diff --git a/README.md b/README.md index b5aac435..efc73022 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ Executes Javascript, Typescript Scripts. * (@krobipd) Fixed saving of Blockly scripts under Blockly 13: a script containing a named timeout, interval or schedule could not be saved anymore - the save button did not appear (#2349) * (@krobipd) Fixed saving of Blockly scripts containing a function with a return value and no statements (#1958) * (@krobipd) The Blockly regression tests now also cover saving: every block is serialized the way the editor does it and reloaded to the same code +* (@krobipd) When a block fails while the script is regenerated after a change, the editor now shows the error instead of silently never offering the save button; a failing export shows its error too ### 10.1.1 (2026-08-24) * (@GermanBluefox) The credentials of the central storage (Basic settings -> Credentials) are available in the scripts as `SECRETS`, e.g. `SECRETS.CameraPassword.key`. The values are decrypted, read-only and are updated live when a credential is edited in the admin UI diff --git a/admin/assets/AiChatPanel-AefbI3hv.js b/admin/assets/AiChatPanel-AefbI3hv.js new file mode 100644 index 00000000..96935724 --- /dev/null +++ b/admin/assets/AiChatPanel-AefbI3hv.js @@ -0,0 +1,242 @@ +import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./vite-preload-helper-B7qeedMF.js";import{An as n,Bt as r,Cn as i,Dn as a,En as o,Ht as s,Jn as c,Lt as l,Rn as u,Ut as d,Vt as f,Xt as p,Yn as m,Zt as h,_r as g,br as _,bt as v,f as y,fr as b,kn as x,mn as S,mr as C,pn as w,st as T,ut as E,vt as D,wr as O,xn as k,yn as A,yr as j,yt as M,zt as N}from"./_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js";import{b as P,f as ee,m as F,p as I,s as L}from"./index-2X_5uU-_.js";var R=u(c(`path`,{d:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m5 11h-4v4h-2v-4H7v-2h4V7h2v4h4z`}),`AddCircleOutlined`),z=u(c(`path`,{d:`M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4zM17 11h-4v4h-2v-4H7V9h4V5h2v4h4z`}),`AddComment`),B=u(c(`path`,{d:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10h5v-2h-5c-4.34 0-8-3.66-8-8s3.66-8 8-8 8 3.66 8 8v1.43c0 .79-.71 1.57-1.5 1.57s-1.5-.78-1.5-1.57V12c0-2.76-2.24-5-5-5s-5 2.24-5 5 2.24 5 5 5c1.38 0 2.64-.56 3.54-1.47.65.89 1.77 1.47 2.96 1.47 1.97 0 3.5-1.6 3.5-3.57V12c0-5.52-4.48-10-10-10m0 13c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3`}),`AlternateEmail`),V=u(c(`path`,{d:`M9.01 14H2v2h7.01v3L13 15l-3.99-4zm5.98-1v-3H22V8h-7.01V5L11 9z`}),`CompareArrows`),te=u(c(`path`,{d:`M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4`}),`Person`),H=u(c(`path`,{d:`M3 10h11v2H3zm0-4h11v2H3zm0 8h7v2H3zm17.59-2.07-4.25 4.24-2.12-2.12-1.41 1.41L16.34 19 22 13.34z`}),`PlaylistAddCheck`),U=u(c(`path`,{d:`M20 9V7c0-1.1-.9-2-2-2h-3c0-1.66-1.34-3-3-3S9 3.34 9 5H6c-1.1 0-2 .9-2 2v2c-1.66 0-3 1.34-3 3s1.34 3 3 3v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c1.66 0 3-1.34 3-3s-1.34-3-3-3M7.5 11.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5S9.83 13 9 13s-1.5-.67-1.5-1.5M16 17H8v-2h8zm-1-4c-.83 0-1.5-.67-1.5-1.5S14.17 10 15 10s1.5.67 1.5 1.5S15.83 13 15 13`}),`SmartToy`);O();var W=e(T(),1),G=t(()=>import(`./docs-compact-D7rpMc7r.js`),[],import.meta.url),K={openai:`img/openai.svg`,anthropic:`img/anthropic.svg`,gemini:`img/gemini.svg`,deepseek:`img/deepseek.svg`,custom:`img/custom.svg`},q={width:16,height:16,flexShrink:0,opacity:.7},ne={ru:`Russian`,en:`English`,de:`German`,es:`Spanish`,fr:`French`,it:`Italian`,pl:`Polish`,nl:`Dutch`,pt:`Portuguese`,uk:`Ukrainian`,"zh-cn":`Chinese`},J=null,Y=null,X=null,Z=null;function re(){J=null,Y=null,X=null,Z=null}async function ie(e,t){if(J)return J;let n=Object.keys(t)[0];if(!n)return null;let r=await e.sendTo(n,`getAvailableAiProviders`,{}),i=((r==null?void 0:r.providers)||[]).map(e=>e.provider),a=((r==null?void 0:r.providers)||[]).find(e=>e.provider===`custom`);return i.length?(J={providers:i,gptBaseUrl:a==null?void 0:a.baseUrl},J):null}var ae=`embedding.text-embedding.textembedding.embeddinggemma.embed-.-embed.bge-.mxbai-embed.nomic-embed.arctic-embed.snowflake-arctic-embed.all-minilm.multilingual-e5.jina-embed.voyage-.gecko.paraphrase-multilingual.dall-e.gpt-image.image-edit.-image-preview.-image-latest.flash-image.nano-banana.stable-diffusion.sdxl.midjourney.flux-.imagen.sora.veo-.cogvideo.runway-.lumiere.lyria.whisper.tts-.-tts.speech-.audio-preview.mini-tts.mini-transcribe.-transcribe.native-audio.flash-live.gpt-audio.realtime.bark-.xtts.voicebox.moderation.omni-moderation.llama-guard.shieldgemma.prompt-guard.-guardian.safeguard.rerank.reranker.babbage-.davinci-.curie-.text-ada-.text-davinci.text-curie.text-babbage.instructgpt.code-davinci.code-cushman.-turbo-instruct.-search-preview.-search-api.code-search.text-search.similarity-.computer-use-preview.deep-research.robotics.aqa.reader-lm.-nsql.minicheck`.split(`.`);function oe(e){let t=e.toLowerCase();return!(ae.some(e=>t.includes(e))||t.startsWith(`claude-1`)||t.startsWith(`claude-instant`))}async function se(e,t){let n=await ie(e,t);if(!n)return{models:[],providerMap:{},errors:[`No API keys configured`]};let r=Object.keys(t)[0];if(!r)return{models:[],providerMap:{},errors:[y.t(`No running javascript instance found`)]};let i=[],a={},o=[],s=(e,t)=>{for(let n of e)oe(n)&&(a[n]||(i.push(n),a[n]=t))},c=[],l=(t,n)=>{c.push(e.sendTo(r,`testApiConnection`,{provider:t===`custom`?`openai`:t}).then(e=>{e.models?s(e.models,t):e.error&&o.push(`${n||t}: ${e.error}`)}).catch(e=>{o.push(`${n||t}: ${String(e)}`)}))},u={openai:`OpenAI`,anthropic:`Anthropic`,gemini:`Gemini`,deepseek:`DeepSeek`,custom:`Custom`};for(let e of n.providers)l(e,u[e]);return await Promise.all(c),i.sort(),{models:i,providerMap:a,errors:o}}async function ce(e,t,n){var r;return await e.sendTo(t,`chatCompletion`,{timeout:n.timeout||6e5,model:n.model,provider:n.provider,messages:n.messages,...n.baseUrl?{baseUrl:n.baseUrl}:{},...(r=n.tools)!=null&&r.length?{tools:n.tools}:{}})}async function le(e){if(Z)return Z;let t=await e.getObjectViewSystem(`state`,``,`香`),n=await e.getObjectViewSystem(`channel`,``,`香`),r=await e.getObjectViewSystem(`device`,``,`香`),i=await e.getObjectViewSystem(`folder`,``,`香`),a=await e.getObjectViewSystem(`enum`,``,`香`);return Z=Object.assign(t,n,r,i,a),Z}async function ue(e){return le(e)}function de(e,t){return e&&typeof e==`object`?e[t]||e.en:e||``}async function fe(e){if(Y)return Y;let t=y.getLanguage(),n=await le(e),r=Object.keys(n).sort(),i=new W.default,a=[],o=[`UNREACH_STICKY`],s=[W.Types.info],c=[],l=[],u=[],d=[];r.forEach(e=>{var t,r;((t=n[e])==null?void 0:t.type)===`enum`?c.push(e):(r=n[e])!=null&&(r=r.common)!=null&&r.smartName&&d.push(e)}),c.forEach(e=>{e.startsWith(`enum.rooms.`)?l.push(e):e.startsWith(`enum.functions.`)&&u.push(e);let t=n[e].common.members;t!=null&&t.length&&t.forEach(e=>{n[e]&&!d.includes(e)&&d.push(e)})});let f={id:``,objects:n,_keysOptional:r,_usedIdsOptional:a,ignoreIndicators:o,excludedTypes:s},p=[];d.forEach(e=>{f.id=e;let r=i.detect(f);r&&r.forEach(e=>{var r;let i=(r=e.states.find(e=>e.id))==null?void 0:r.id;if(!i||p.find(e=>e.id===i))return;let a=n[i],o={id:i,name:de(a.common.name,t),type:a.type,deviceType:e.type,states:e.states.filter(e=>e.id).map(e=>({id:e.id,name:e.name,role:e.defaultRole,type:n[e.id].common.type,unit:n[e.id].common.unit,read:n[e.id].common.read??!0,write:n[e.id].common.write??!0}))},s=i.split(`.`),c,d;(a.type===`channel`||a.type===`state`)&&(s.pop(),c=s.join(`.`),n[c]&&(n[c].type===`channel`||n[c].type===`folder`)?(s.pop(),d=s.join(`.`),(!n[d]||n[d].type!==`device`&&n[c].type!==`folder`)&&(d=void 0)):c=void 0);let f=l.find(e=>{var t,r,a;return(t=n[e].common.members)!=null&&t.includes(i)||c&&(r=n[e].common.members)!=null&&r.includes(c)?!0:d&&((a=n[e].common.members)==null?void 0:a.includes(d))});f&&(o.room=de(n[f].common.name,t));let m=u.find(e=>{var t,r,a;return(t=n[e].common.members)!=null&&t.includes(i)||c&&(r=n[e].common.members)!=null&&r.includes(c)?!0:d&&((a=n[e].common.members)==null?void 0:a.includes(d))});m&&(o.function=de(n[m].common.name,t)),p.push(o)})});for(let e=0;e { + // obj.state.val = the new value (boolean or number) + // obj.id = the state ID that changed + setState('zigbee.0.lamp.state', obj.state.val); + log('Changed to ' + obj.state.val); +}); + +// CORRECT: on() with filter +on({id: /zigbee\\.0\\..*\\.state$/, change: 'ne'}, (obj) => { + if (obj.state.val === true) { + setState('zigbee.0.other.state', true); + } +}); + +// Other correct examples: +setState('id', true); +setState('id', 50); +const val = getState('id').val; +schedule('0 7 * * *', () => { log('runs daily at 07:00'); }); +schedule('0 22 * * *', () => { setState('id', false); }); + +// CORRECT Telegram: always use sendTo, NEVER setState on telegram +sendTo('telegram.0', 'send', {text: 'Alert: ' + someValue}); + +// CORRECT httpGet: res.data is a STRING, parse JSON with JSON.parse +httpGet('https://api.example.com/data', (err, res) => { + const data = JSON.parse(res.data); + log('Temperature: ' + data.main.temp); +}); + +$('state[state.id=*.state](rooms=Room)').each((id) => { setState(id, false); }); +createState('name', 0, {type: 'number', name: 'Name'}); +// CORRECT: one-time delayed action (turn off after 5 minutes = 300000ms) +setStateDelayed('zigbee.0.lamp.state', false, false, 5 * 60 * 1000); +log(formatDate(new Date(), 'DD.MM.YYYY hh:mm')); + +WRONG: on('id', (id, state) => {}) CORRECT: on('id', (obj) => {}) +WRONG: set('id', true) CORRECT: setState('id', true) +WRONG: adapter.setState('id', true) CORRECT: setState('id', true) +WRONG: obj.val or newState.val CORRECT: obj.state.val +WRONG: on('change', {id: 'x'}, cb) CORRECT: on({id: 'x', change: 'ne'}, cb) +WRONG: setState('telegram.0', text) CORRECT: sendTo('telegram.0', 'send', {text: text}) +WRONG: res.body.main.temp CORRECT: JSON.parse(res.data).main.temp +WRONG: function myFunc() {} CORRECT: write code directly, no function definitions +WRONG: setTimeout(fn, ms) CORRECT: setStateDelayed(id, val, false, ms) for one-time delay +WRONG: schedule('*/5 * * * *', fn) for one-time delay. schedule() is ONLY for recurring tasks +Values are boolean (true/false) or numbers, NEVER strings like 'ON'/'OFF'. +NEVER use: function keyword, require, import, setInterval, setTimeout, console.log, debug(). + +All available functions (use syntax from examples above): +on(pattern, (obj)=>{}) | once(pattern, (obj)=>{}) | unsubscribe(handler) +setState(id, val) | getState(id).val | setStateChanged(id, val) | setStateDelayed(id, val, ack, ms) | clearStateDelayed(id) +existsState(id) | existsObject(id) | getObject(id) | setObject(id, obj) | extendObject(id, obj) | deleteObject(id) +createState(name, initVal, {type,name,role}) | deleteState(name) | createAlias(name, alias) +schedule(cron, ()=>{}) | clearSchedule(obj) | scheduleById(id, (obj)=>{}) | getSchedules() +sendTo(adapter, cmd, msg) | sendToHost(host, cmd, msg) +$('selector').each((id)=>{}) | $('selector').setState(val) | $('selector').getState() +log(text) | formatDate(date, 'DD.MM.YYYY hh:mm') | formatTimeDiff(ms) | formatValue(val, decimals) +getDateObject(str) | getAstroDate(pattern) | isAstroDay() | compareTime(start, end, op) +exec(cmd, (err,stdout,stderr)=>{}) | httpGet(url, (err,res)=>{}) | httpPost(url, data, (err,res)=>{}) +readFile(adapter, name, (err,data)=>{}) | writeFile(adapter, name, data, cb) | delFile(adapter, name, cb) +onFile(id, name, withFile, cb) | offFile(id, name) | onStop(cb, timeout) +getHistory(inst, {id,start,end,aggregate,count}, cb) | getEnums(name) | getIdByName(name) +wait(ms) | toInt(val) | toFloat(val) | toBoolean(val) +messageTo(target, data) | onMessage(name, cb) | onLog(severity, cb) +runScript(name) | startScript(name) | stopScript(name) | isScriptActive(name) + +Write comments in ${e}. Put code in a \`\`\`javascript code block.`}function ge(e){return`You generate ioBroker Blockly XML blocks. Return Blockly XML in a \`\`\`xml code block. +Use EXACT state IDs from the plan. Write text/comments in ${e}. + +IMPORTANT RULES: +- Return ONLY the inner blocks (no wrapper needed) +- Use the exact block types shown below +- State IDs must be full paths like "zigbee2mqtt.0.0x1234.state" +- Values are boolean (true/false) or numbers, NEVER strings like "ON"/"OFF" +- For Telegram use sendto_custom block, NEVER setState on telegram + +## Block Templates + +### Trigger: on_ext (react to state changes) + + + ne + + + STATE_ID_HERE + + + + + + +### Schedule: schedule (cron-based) + + 0 7 * * * + + + + + +### Set State: control + + + STATE_ID_HERE + FALSE + + TRUE + + + +### Get State Value: get_value + + val + STATE_ID_HERE + + +### Log: debug + + log + + Message here + + + +### SendTo (Telegram): sendto_custom + + + telegram.0 + send + + + Message text + + + text + + + +### Timeout: timeouts_settimeout + + timeout1 + 5000 + ms + + + + + +### If/Else: controls_if + + + + + EQ + valSTATE_ID + TRUE + + + + + + +### Number value +0 + +### Text value +hello + +### Boolean value +TRUE + +### Comparison: logic_compare + + EQ + + + + + +## Common Patterns + +### Turn on light when sensor triggers: + + + ne + + + zigbee2mqtt.0.0xSENSOR.occupancy + + + + + + EQ + valzigbee2mqtt.0.0xSENSOR.occupancy + TRUE + + + + + + zigbee2mqtt.0.0xLAMP.state + FALSE + TRUE + + + + + + +Write comments in ${e}. Put blocks in a \`\`\`xml code block.`}function _e(e){let t=e;return t=t.replace(/[\s\S]*?<\/think>/gi,``),t=t.replace(/<\|endoftext\|>/g,``),t=t.replace(/<\|im_start\|>[\s\S]*?<\|im_end\|>/g,``),t=t.replace(/<\|im_start\|>[\s\S]*/g,``),t.trim()}var ve=[{type:`function`,function:{name:`search_datapoints`,description:`Search ALL ioBroker objects by ID, name, or role — includes states, channels, devices, folders, enums (rooms/functions), adapters, instances, scripts, meta, etc. Returns matching IDs with object type, name, role, unit, and a hasChildren hint for containers. IMPORTANT: Aliases and physical device groupings are usually CHANNELS containing multiple state children (e.g. a motion sensor is often a channel alias.0.Floor.Room.MotionSensor with states ACTUAL, BATTERY, STATE under it). If a channel/device/folder matches your query, call get_object_info on its ID to list its state children. Role-based queries work too: "sensor.motion", "switch.light", "value.temperature".`,parameters:{type:`object`,properties:{query:{type:`string`,description:`Search pattern (case-insensitive substring) - matches against object ID, name, and role. Examples: "bewegungsmelder", "temperature", "sensor.motion", "alias.0", "küche", "zigbee2mqtt.0.lamp".`},max_results:{type:`number`,description:`Maximum number of results to return (default: 20).`},object_type:{type:`string`,description:`Optional filter by object type: "state", "channel", "device", "folder", "enum", "adapter", "instance", "script", "meta", etc. Omit to search every type.`}},required:[`query`]}}},{type:`function`,function:{name:`get_state_value`,description:`Get the current value of an ioBroker state/datapoint. Returns value, timestamp, and acknowledgment flag.`,parameters:{type:`object`,properties:{id:{type:`string`,description:`The full state ID, e.g. "zigbee2mqtt.0.sensor.temperature"`}},required:[`id`]}}},{type:`function`,function:{name:`get_object_info`,description:`Get detailed info about ANY ioBroker object + its full parent hierarchy + direct children. Works for every object type: state, channel, device, folder, adapter, instance, enum, meta, script. Returns: the object itself, parent chain (all non-state ancestors up to the adapter), and — if the object is a container (channel/device/folder/enum/instance/adapter/meta) — the list of direct children with their types, names, roles and units. Use this to navigate the object tree: start from a channel found by search_datapoints, read its children to see the actual state IDs underneath.`,parameters:{type:`object`,properties:{id:{type:`string`,description:`The full object ID, e.g. "zigbee2mqtt.0.0x1234.state", "alias.0.Room.MotionSensor", or "enum.rooms.kitchen".`}},required:[`id`]}}},{type:`function`,function:{name:`search_scripts`,description:`Search through all ioBroker JavaScript/Blockly/Rules scripts. Can search by script name/path OR by content (e.g. find all scripts that use a specific datapoint ID). Returns matching script names, paths, and matching lines.`,parameters:{type:`object`,properties:{query:{type:`string`,description:`Search term - matches against script name, path, AND source code content. Examples: "carport", "zigbee2mqtt.0.lamp.state", "telegram"`},max_results:{type:`number`,description:`Maximum number of scripts to return (default: 10)`}},required:[`query`]}}},{type:`function`,function:{name:`read_script`,description:`Read the full source code of a specific ioBroker script by its ID or path. Use search_scripts first to find the script ID, then read_script to see its complete code.`,parameters:{type:`object`,properties:{id:{type:`string`,description:`The script ID (e.g. "script.js.common.Licht.Carport") or path (e.g. "common/Licht/Carport")`}},required:[`id`]}}},{type:`function`,function:{name:`list_scripts`,description:`List ALL available ioBroker scripts with their names, paths, types (JavaScript/Blockly/TypeScript), and enabled status. Use this to get an overview of all scripts before searching or reading specific ones.`,parameters:{type:`object`,properties:{}}}},{type:`function`,function:{name:`run_script`,description:"Execute a JavaScript or TypeScript snippet in the live ioBroker javascript engine and get back everything it logged. The code runs with the full script API (log, console.*, setState, getState, on, schedule, $, exec, httpGet, …) in VERBOSE mode, so internal operations (setState/getState/subscribe/…) are logged too — ideal for diagnosing behaviour or inspecting values. The snippet runs for a short window and is then automatically STOPPED and fully cleaned up (timers, subscriptions, schedules removed); it does NOT create a persistent script. Use `log(...)` or `console.log(...)` in the code to surface the values you want to inspect. WARNING: side effects are real (e.g. setState changes actual devices) — prefer read-only diagnostics unless the user explicitly asked to change something.",parameters:{type:`object`,properties:{source:{type:`string`,description:`The JavaScript (or TypeScript) source to execute. Log the values you want to inspect via log(...) / console.log(...). Top-level await is supported.`},engineType:{type:`string`,description:`Optional. "TypeScript/ts" to run the code as TypeScript. Defaults to JavaScript.`},timeout:{type:`number`,description:`Optional. Milliseconds to keep the script alive to collect asynchronous logs before it is stopped (default 5000, max 60000). Increase when waiting for timers, subscriptions or HTTP responses.`},logLevel:{type:`string`,description:`Optional minimum severity to return: silly, debug, info, warn, error. Default silly (everything).`}},required:[`source`]}}},{type:`function`,function:{name:`get_editor_selection`,description:`Read what the user has currently selected in the script editor. Returns the selected text and its line/column range, or a message if nothing is selected. Use this when the user refers to "this", "das hier", "the selection", or asks about a specific piece of code they highlighted.`,parameters:{type:`object`,properties:{}}}},{type:`function`,function:{name:`get_editor_content`,description:`Read the full current content of the script editor (may differ from the initial script version if the user has made edits). Use this when you need the live editor state rather than the saved script.`,parameters:{type:`object`,properties:{}}}},{type:`function`,function:{name:`get_cursor_position`,description:`Read the current cursor position (line and column, 1-based) in the script editor.`,parameters:{type:`object`,properties:{}}}},{type:`function`,function:{name:`highlight_text_in_editor`,description:`Search for a literal text in the script editor and select + scroll to it. Returns how many occurrences were found. Use this to draw the user's attention to a specific snippet you are discussing.`,parameters:{type:`object`,properties:{text:{type:`string`,description:`Exact substring to search for (case-sensitive).`}},required:[`text`]}}},{type:`function`,function:{name:`highlight_line_range`,description:`Select and scroll to a range of lines in the editor. Both line numbers are 1-based and inclusive. Use this to show the user which block of code you are referring to.`,parameters:{type:`object`,properties:{start_line:{type:`number`,description:`First line (1-based, inclusive).`},end_line:{type:`number`,description:`Last line (1-based, inclusive).`}},required:[`start_line`,`end_line`]}}},{type:`function`,function:{name:`go_to_line`,description:`Move the cursor to a specific line (and optional column) and scroll that line into view. Use this to navigate the user to a relevant spot.`,parameters:{type:`object`,properties:{line:{type:`number`,description:`1-based line number.`},column:{type:`number`,description:`1-based column (optional, default 1).`}},required:[`line`]}}},{type:`function`,function:{name:`insert_text_at_cursor`,description:`Insert text at the current cursor position in the editor (or replace the current selection if one exists). Use sparingly — prefer returning code in a fenced markdown block so the user can review and smart-apply it. Only use direct insertion when the user explicitly asked you to write something into the editor.`,parameters:{type:`object`,properties:{text:{type:`string`,description:`Text to insert.`}},required:[`text`]}}},{type:`function`,function:{name:`replace_selection`,description:`Replace the currently selected text in the editor with new text. Fails if nothing is selected. Use this to refactor or rewrite a specific highlighted snippet.`,parameters:{type:`object`,properties:{text:{type:`string`,description:`Replacement text.`}},required:[`text`]}}},{type:`function`,function:{name:`get_diagnostics`,description:`Read all active Monaco diagnostics (errors, warnings, info, hints) from the current editor model — this is what shows up as red/yellow squiggles. Use this to find syntax errors, unused variables, missing types, or other editor-reported issues the user might be asking about.`,parameters:{type:`object`,properties:{}}}},{type:`function`,function:{name:`get_document_symbols`,description:`Get the document outline of the current script: all top-level functions, classes, constants, and variables with their line numbers. Use this to understand the structure of a long script or to find where a specific function is defined.`,parameters:{type:`object`,properties:{}}}}];function ye(e){return e&&typeof e==`object`?e.en||e.de||``:e||``}function be(e,t,n){let r=(n||``).toLowerCase();if(!r)return!1;if(e.toLowerCase().includes(r))return!0;let i=t==null?void 0:t.common;if(!i)return!1;let a=ye(i.name).toLowerCase();if(a&&a.includes(r))return!0;let o=(i.role||``).toLowerCase();return!!(o&&o.includes(r))}async function xe(e,t,n=20,r){let i=await ue(e),a=r==null?void 0:r.toLowerCase(),o=[],s=Object.keys(i),c=new Set;for(let e of s){let t=e.lastIndexOf(`.`);t>0&&c.add(e.substring(0,t))}for(let e of s){let r=i[e],s=r==null?void 0:r.type;if(!s||a&&s!==a||!be(e,r,t))continue;let l=r.common,u={id:e,type:s,name:ye(l==null?void 0:l.name)};if(l!=null&&l.role&&(u.role=l.role),s===`state`?(u.stateType=(l==null?void 0:l.type)||``,l!=null&&l.unit&&(u.unit=l.unit)):c.has(e)&&(u.hasChildren=!0),o.push(u),o.length>=n)break}return o.length===0?JSON.stringify({message:`No objects found matching "${t}". Hint: try a role like "sensor.motion" or a partial path.`}):JSON.stringify(o)}async function Se(e,t){try{let n=await e.getState(t);return JSON.stringify(n?{val:n.val,ts:n.ts?new Date(n.ts).toISOString():null,ack:n.ack,from:n.from}:{error:`State '${t}' not found`})}catch{return JSON.stringify({error:`Failed to read state '${t}'`})}}var Ce=new Set([`channel`,`device`,`folder`,`adapter`,`instance`,`enum`,`meta`]),we=50;async function Te(e,t){try{let r=await e.getObject(t);if(!r)return JSON.stringify({error:`Object '${t}' not found`});let i={id:r._id,type:r.type,common:r.common},a=t.split(`.`),o=[];for(let t=a.length-1;t>=2;t--){let r=a.slice(0,t).join(`.`);try{let t=await e.getObject(r);if(t&&t.type!==`state`){var n;o.push({id:t._id,type:t.type,name:ye((n=t.common)==null?void 0:n.name),common:t.common})}}catch{}}if(o.length>0&&(i.parents=o),Ce.has(r.type)){let n=await ue(e),r=[],a=`${t}.`,o=!1;for(let e of Object.keys(n))if(e.startsWith(a)&&!e.substring(a.length).includes(`.`)){let t=n[e],i=t==null?void 0:t.common,a={id:e,name:ye(i==null?void 0:i.name),type:(t==null?void 0:t.type)||``};if(i!=null&&i.role&&(a.role=i.role),(t==null?void 0:t.type)===`state`&&i!=null&&i.unit&&(a.unit=i.unit),r.push(a),r.length>=we){o=!0;break}}r.length>0&&(i.children=r,o&&(i.childrenTruncated=!0,i.childrenHint=`Only the first ${we} children are shown. Use search_datapoints with a more specific query or the object_type filter to narrow down.`))}return JSON.stringify(i)}catch{return JSON.stringify({error:`Failed to read object '${t}'`})}}function Ee(e){return I(e)||e}function De(e,t,n=10){let r=t.toLowerCase(),i=[];for(let t of e){let e=t.id.toLowerCase(),a=t.name.toLowerCase(),o=t.id.replace(/^script\.js\./,``).replace(/\./g,`/`),s=t.engineType===`Blockly`||t.engineType===`Rules`,c=e.includes(r)||a.includes(r),l=s?Ee(t.source):t.source,u=l.toLowerCase().includes(r);if(c||u){let e={id:t.id,path:o,name:t.name,type:s?`Blockly`:t.engineType.includes(`TypeScript`)?`TypeScript`:`JavaScript`,enabled:t.enabled};if(u){let t=l.split(` +`),n=[];for(let e=0;e=5));e++);n.length>0&&(e.matchingLines=n)}if(i.push(e),i.length>=n)break}}return i.length===0?JSON.stringify({message:`No scripts found matching "${t}"`}):JSON.stringify(i)}function Oe(e,t){let n=t.replace(/\//g,`.`).toLowerCase(),r=e.find(e=>{let t=e.id.toLowerCase();return t===n||t===`script.js.${n}`||t.endsWith(`.${n}`)});if(!r)return JSON.stringify({error:`Script '${t}' not found. Use search_scripts to find available scripts.`});let i=r.engineType===`Blockly`||r.engineType===`Rules`,a=i?Ee(r.source):r.source,o=r.id.replace(/^script\.js\./,``).replace(/\./g,`/`);return JSON.stringify({id:r.id,path:o,name:r.name,type:i?`Blockly`:r.engineType.includes(`TypeScript`)?`TypeScript`:`JavaScript`,enabled:r.enabled,source:a})}function ke(e){let t=e.map(e=>({id:e.id,path:e.id.replace(/^script\.js\./,``).replace(/\./g,`/`),name:e.name,type:e.engineType===`Blockly`||e.engineType===`Rules`?`Blockly`:e.engineType.includes(`TypeScript`)?`TypeScript`:`JavaScript`,enabled:e.enabled}));return JSON.stringify(t)}function Q(){return JSON.stringify({error:`Editor is not available. This tool requires the script editor to be open.`})}async function Ae(e,t,n){if(!t)return JSON.stringify({error:`No running javascript instance found to execute the script.`});let r=n.source;if(!r||typeof r!=`string`)return JSON.stringify({error:`No source code provided.`});try{var i;let a=await e.sendTo(t,`execute`,{source:r,engineType:n.engineType,timeout:n.timeout,logLevel:n.logLevel});return!a||a.ok===!1?JSON.stringify({error:(a==null?void 0:a.error)||`Execution failed`,logs:(a==null?void 0:a.logs)||[]}):JSON.stringify({engineType:a.engineType,runtime:a.runtime,truncated:a.truncated||!1,logCount:((i=a.logs)==null?void 0:i.length)||0,logs:a.logs||[],output:a.output||``})}catch(e){return JSON.stringify({error:`Failed to execute script: ${e instanceof Error?e.message:String(e)}`})}}async function je(e,t,n,r,i){let a;try{a=JSON.parse(t.function.arguments)}catch{return JSON.stringify({error:`Invalid arguments: ${t.function.arguments}`})}switch(t.function.name){case`search_datapoints`:return xe(e,a.query,a.max_results||20,a.object_type);case`get_state_value`:return Se(e,a.id);case`get_object_info`:return Te(e,a.id);case`search_scripts`:return De(n||[],a.query,a.max_results||10);case`read_script`:return Oe(n||[],a.id);case`list_scripts`:return ke(n||[]);case`run_script`:return Ae(e,i,a);case`get_editor_selection`:{if(!(r!=null&&r.getSelection))return Q();let e=r.getSelection();return JSON.stringify(e||{message:`No text is currently selected in the editor.`})}case`get_editor_content`:return r!=null&&r.getContent?JSON.stringify({content:r.getContent()}):Q();case`get_cursor_position`:{if(!(r!=null&&r.getCursorPosition))return Q();let e=r.getCursorPosition();return JSON.stringify(e||{message:`Editor has no cursor position (not focused).`})}case`highlight_text_in_editor`:{if(!(r!=null&&r.highlightText))return Q();let e=r.highlightText(a.text);return JSON.stringify({matches:e,message:e===0?`Text "${a.text}" was not found in the editor.`:`Highlighted ${e} occurrence(s) of "${a.text}".`})}case`highlight_line_range`:{if(!(r!=null&&r.highlightLineRange))return Q();let e=r.highlightLineRange(a.start_line,a.end_line);return JSON.stringify({success:e,message:e?`Selected lines ${a.start_line}-${a.end_line}.`:`Could not select the requested line range.`})}case`go_to_line`:{if(!(r!=null&&r.goToLine))return Q();let e=r.goToLine(a.line,a.column);return JSON.stringify({success:e,message:e?`Cursor moved to line ${a.line}.`:`Could not move the cursor.`})}case`insert_text_at_cursor`:{if(!(r!=null&&r.insertTextAtCursor))return Q();let e=r.insertTextAtCursor(a.text);return JSON.stringify({success:e,message:e?`Text inserted at cursor.`:`Editor rejected the insertion.`})}case`replace_selection`:{if(!(r!=null&&r.replaceSelection))return Q();let e=r.replaceSelection(a.text);return JSON.stringify({success:e,message:e?`Selection replaced.`:`No text was selected to replace.`})}case`get_diagnostics`:{if(!(r!=null&&r.getDiagnostics))return Q();let e=r.getDiagnostics();return JSON.stringify({count:e.length,diagnostics:e})}case`get_document_symbols`:{if(!(r!=null&&r.getSymbols))return Q();let e=await r.getSymbols();return JSON.stringify({count:e.length,symbols:e})}default:return JSON.stringify({error:`Unknown tool: ${t.function.name}`})}}var Me=0;function Ne(){return`msg_${Date.now()}_${++Me}`}function Pe(e){let{socket:n,runningInstances:r,currentCode:i,currentLanguage:a,allScripts:o,editorApi:s,currentScriptId:c}=e,l=b((e,t,n)=>e===`none`||!n?null:{range:t,scriptId:c||``,scriptVersion:(i||``).length,kind:e,originalText:n},[c,i]),[u,d]=_(()=>{try{let e=window.localStorage.getItem(`Editor.aiChatMessages`);return e?JSON.parse(e):[]}catch{return[]}}),f=b(e=>{d(t=>{let n=typeof e==`function`?e(t):e,r=n.length>100?n.slice(-100):n;try{window.localStorage.setItem(`Editor.aiChatMessages`,JSON.stringify(r))}catch{try{let e=r.slice(-20);window.localStorage.setItem(`Editor.aiChatMessages`,JSON.stringify(e))}catch{}}return r})},[]),[p,m]=_(!1),[h,g]=_(null),[v,x]=_(window.localStorage.getItem(`Editor.aiChatMode`)||`agent`),S=b(e=>{x(e),window.localStorage.setItem(`Editor.aiChatMode`,e)},[]),[w,T]=_(null),[E,D]=_(window.localStorage.getItem(`openai-model`)||``),[O,k]=_([]),[A,M]=_({}),[N,P]=_(!0),[I,L]=_(null),R=j(null),z=j(null),B=j(null),V=j(null),te=b(e=>{D(e),window.localStorage.setItem(`openai-model`,e)},[]),H=b(async()=>{P(!0),L(null);try{let e=await se(n,r);if(k(e.models),M(e.providerMap),e.models.length>0){let t=window.localStorage.getItem(`openai-model`);t&&e.models.includes(t)?D(t):D(e.models[0])}e.errors.length>0&&L(e.errors.join(`; `))}catch(e){L(String(e))}P(!1)},[n,r]);C(()=>{H()},[H]);let U=b(e=>{let t=!1,n=!1,r=[],i=!1,a=/@([\w/äöüÄÖÜß-]+)/g,s;for(;(s=a.exec(e))!==null;){let e=s[1].toLowerCase();if(e===`alle`||e===`all`)t=!0;else if(e===`geräte`||e===`devices`||e===`geraete`)n=!0;else if(i=!0,o&&o.length>0){let e=s[1].replace(/\//g,`.`).toLowerCase(),t=e.split(`.`),n=o.find(n=>{let r=n.id.toLowerCase(),i=r.replace(/^script\.js\./,``);if(i===e||i.endsWith(`.${e}`)||r===`script.js.${e}`)return!0;let a=0;for(let e of t){let t=i.indexOf(e,a);if(t===-1)return!1;a=t+e.length}return!0});if(n)r.push(n.id);else for(let e of t){if(e.length<3)continue;let t=o.filter(t=>t.id.toLowerCase().includes(`.${e}`)||t.name.toLowerCase().includes(e));for(let e of t)r.includes(e.id)||r.push(e.id)}}}return i&&r.length===0&&(t=!0),{cleanMessage:e.replace(/@[\w/äöüÄÖÜß]+\s*/g,``).trim(),mentionedScriptIds:r,includeAll:t,includeDevices:n}},[o]),W=b(async(e,t,s)=>{V.current||=await pe(),R.current||=await ie(n,r);let c=me(),l=a===`blockly`,u=e||s.length>0,d=`You are an AI assistant for ioBroker JavaScript adapter scripting. Help the user write, debug, and understand ioBroker scripts. Write comments in ${c}. Use the ioBroker JavaScript API correctly. + +ioBroker object hierarchy: adapter.instance.device.channel.state +- A "state" is a single datapoint (e.g. zigbee2mqtt.0.0x1234.temperature) +- A "channel" groups related states (e.g. zigbee2mqtt.0.0x1234 contains temperature, humidity, battery) +- A "device" groups channels (e.g. zigbee2mqtt.0.0x1234) +- The channel/device often has the human-readable name (e.g. "Living Room Sensor") +When looking up info about a datapoint, ALWAYS also check its parent channel/device for the device name and context. Use get_object_info which returns the full parent hierarchy automatically. + +To verify code or diagnose runtime behaviour, you can use the run_script tool: it executes a JavaScript/TypeScript snippet in the live engine (verbose mode) and returns everything it logged, then auto-stops it. Log the values you want to inspect via log(...) / console.log(...). It runs against the live system, so prefer read-only diagnostics (getState, $, getObject) and only call setState when the user explicitly asked to change something. + +Available API and syntax rules: +${V.current}`;if(l&&(d+="\n\nThe user is working in the Blockly visual editor. When asked to create or modify code, respond with Blockly XML in a ```xml code block instead of JavaScript."),(t||e)&&(B.current||=await fe(n),d+=`\n\nAvailable smart home devices:\n${JSON.stringify(B.current,null,0)}`),!u&&i){if(l){let e=i.indexOf(`%%BLOCKLY_XML%%`),t=e===-1?i:i.substring(0,e).trim(),n=e===-1?``:i.substring(e+15).trim();d+=`\n\nThe user is working on this Blockly script (currently open in the editor).\n\nGenerated JavaScript (shows the logic):\n\`\`\`javascript\n${t}\n\`\`\``,n&&(d+=`\n\nBlockly XML (use for modifications):\n\`\`\`xml\n${n}\n\`\`\``)}else d+=`\n\nThe user's question is about this script (currently open in the editor, ${a||`javascript`}):\n\`\`\`${a||`javascript`}\n${i}\n\`\`\``}if(e&&o&&o.length>0)d+=`\n\nThe user requested ALL scripts. Search through all of them to answer the question. Always identify WHICH script you describe by its full ID. Scripts may reference datapoint IDs via variables.\n\n${ee(o,!0)}`;else if(s.length>0&&o){let e=o.filter(e=>s.includes(e.id));e.length>0&&(d+=`\n\nIMPORTANT: The user is asking about the following script(s). Answer ONLY about these scripts, NOT about the currently open editor tab. Analyze the source code below carefully:\n\n${ee(e,!0)}`)}return l&&(d+=`\n\n${ge(c)}`),[{role:`system`,content:d}]},[n,r,i,a,o]),G=b(async e=>{if(!e.trim()||p)return;let t=A[E];if(!t){T(y.t(`Please select a valid model`));return}let i=R.current||await ie(n,r);if(R.current=i,!i){T(y.t(`No API keys configured`));return}let o=Object.keys(r)[0];if(!o){T(y.t(`No running javascript instance found`));return}let s=t===`custom`&&i.gptBaseUrl||``,c={id:Ne(),role:`user`,content:e,timestamp:Date.now()},l={id:Ne(),role:`assistant`,content:`⏳ ${y.t(`Generating plan...`)}`,timestamp:Date.now()};f(e=>[...e,c,l]),m(!0),T(null);try{let r=me();B.current||=await fe(n);let i=B.current||[],c=`Devices in my smart home:\n${JSON.stringify(i)}\n\nI need a plan for this task: ${e}\n\nAnswer with max 6 lines. Use FULL device IDs from the list above (e.g. zigbee2mqtt.0.0xa4c1383f5ef5fb07.state). No explanation. No reasoning.\n1. IDs: \n2. Trigger: \n3. Condition: \n4. Actions: \n5. Else: \n6. Extra: \nValues are boolean (true/false) or numbers, not strings. Use .state not .state_toggle.`,l=await ce(n,o,{messages:[{role:`user`,content:c}],model:E,provider:t,baseUrl:s});if(l.error){T(l.error),f(e=>e.slice(0,-2)),m(!1);return}let u=_e(l.content||``);f(e=>{let t=[...e],n=t[t.length-1];return(n==null?void 0:n.role)===`assistant`&&(t[t.length-1]={...n,content:`📋 **${y.t(`Plan`)}:**\n${u}`}),t});let d={id:Ne(),role:`assistant`,content:`⏳ ${y.t(`Generating code...`)}`,timestamp:Date.now()};f(e=>[...e,d]);let p=a===`blockly`,h=p?`TASK: ${e}\n\nPLAN:\n${u}\n\nGenerate Blockly XML blocks for this ioBroker automation. Use the exact state IDs from the plan. If the plan contains TODO_DEVICE_ID, keep it as a placeholder. Write comments in ${r}. Put the blocks in a \`\`\`xml code block. You may add a short explanation before or after the XML.`:`TASK: ${e}\n\nPLAN:\n${u}\n\nWrite the ioBroker script. Use the exact state IDs from the plan. If the plan contains TODO_DEVICE_ID, keep it as a placeholder with a comment so the user can fill in the correct ID. Write comments in ${r}. Put the code in a \`\`\`javascript code block. You may add a short explanation before or after the code.`,_=p?ge(r):he(r),v=await ce(n,o,{messages:[{role:`system`,content:_},{role:`user`,content:h}],model:E,provider:t,baseUrl:s});if(v.error){T(v.error),f(e=>e.slice(0,-1)),m(!1);return}let b=_e(v.content||``);f(e=>{let t=[...e],n=t[t.length-1];return(n==null?void 0:n.role)===`assistant`&&(t[t.length-1]={...n,content:b}),t}),g(`${y.t(`devices`)}: ${i.length}`)}catch(e){T(String(e)),f(e=>e.slice(0,-1))}m(!1)},[E,A,p,n,r,a,f]),K=b(async e=>{if(v===`code`)return G(e);if(!e.trim()||p)return;let t=A[E];if(!t){T(y.t(`Please select a valid model`));return}let i=R.current||await ie(n,r);if(R.current=i,!i){T(y.t(`No API keys configured`));return}let a=Object.keys(r)[0];if(!a){T(y.t(`No running javascript instance found`));return}let c=z.current;if(z.current=null,!c)try{var d;let e=s==null||(d=s.getSelection)==null?void 0:d.call(s);e&&e.text&&(c=l(`selection`,e.range,e.text))}catch{}let h={id:Ne(),role:`user`,content:e,timestamp:Date.now(),sourceRange:c},_={id:Ne(),role:`assistant`,content:``,timestamp:Date.now(),sourceRange:c};f(e=>[...e,h,_]),m(!0),T(null);let{cleanMessage:b,mentionedScriptIds:x,includeAll:S,includeDevices:C}=U(e),w=[];if(S)w.push(`${y.t(`all scripts`)} (${(o==null?void 0:o.length)||0})`);else if(x.length>0){let e=x.map(e=>e.replace(/^script\.js\./,``));w.push(e.join(`, `))}else w.push(y.t(`current script`));C&&w.push(y.t(`devices`)),g(`${y.t(`Context`)}: ${w.join(` + `)}`);let D=await W(S,C,x),O=t===`custom`&&i.gptBaseUrl||``,k=b||e;if(o&&o.length>0){let e=k.match(/\b[\w-]+\.\d+\.[\w.-]+/g);if(e){let t=[];for(let n of new Set(e)){let e=F(o,n);e.length>0&&t.push(`Datapoint "${n}" is used in:\n${e.map(e=>` - ${e.scriptName} (${e.scriptId}) line ${e.lineNumber}: ${e.usageType} → ${e.line}`).join(` +`)}`)}t.length>0&&(k+=`\n\n[Automatic analysis results]\n${t.join(` + +`)}`)}}let j=[...D,...u.filter(e=>e.role!==`system`).map(e=>({role:e.role,content:e.content})),{role:`user`,content:k}],M=v===`agent`;try{let e=[...j];for(let r=0;r<5;r++){let i=await ce(n,a,{messages:e,model:E,provider:t,baseUrl:O,...M?{tools:ve}:{}});if(i.error){if(M&&r===0&&i.error.toLowerCase().includes(`tool`)){let r=await ce(n,a,{messages:e,model:E,provider:t,baseUrl:O});if(r.error)T(r.error),f(e=>e.slice(0,-1));else{let e=_e(r.content||``);f(t=>{let n=[...t],r=n[n.length-1];return(r==null?void 0:r.role)===`assistant`&&(n[n.length-1]={...r,content:e}),n})}break}T(i.error),f(e=>e.slice(0,-1));break}let c=i.tool_calls;if((!c||c.length===0)&&M&&i.content){let e=i.content.trim();try{let t=JSON.parse(e);t.name&&t.arguments&&(c=[{id:`text_tool_${Date.now()}`,type:`function`,function:{name:t.name,arguments:JSON.stringify(t.arguments)}}])}catch{}}if(!c||c.length===0){let e=_e(i.content||``);f(t=>{let n=[...t],r=n[n.length-1];return(r==null?void 0:r.role)===`assistant`&&(n[n.length-1]={...r,content:e}),n});break}i.tool_calls=c;let l=i.tool_calls.map(e=>{let t={};try{t=JSON.parse(e.function.arguments)}catch{}switch(e.function.name){case`search_datapoints`:return`🔍 ${y.t(`Searching datapoints`)}: "${String(t.query||``)}"`;case`get_state_value`:return`📊 ${y.t(`Reading value`)}: ${String(t.id||``)}`;case`get_object_info`:return`📋 ${y.t(`Loading object info`)}: ${String(t.id||``)}`;case`search_scripts`:return`🔍 ${y.t(`Searching scripts`)}: "${String(t.query||``)}"`;case`read_script`:return`📖 ${y.t(`Reading script`)}: ${String(t.id||``)}`;case`list_scripts`:return`📂 ${y.t(`Loading script list`)}`;default:return`⚙️ ${e.function.name}`}});f(e=>{let t=[...e],n=t[t.length-1];return(n==null?void 0:n.role)===`assistant`&&(t[t.length-1]={...n,content:l.join(` +`)}),t}),e.push({role:`assistant`,content:i.content||``,tool_calls:i.tool_calls});for(let t of i.tool_calls){let r=await je(n,t,o,s,a);e.push({role:`tool`,tool_call_id:t.id,content:r})}}}catch(e){T(String(e)),f(e=>e.slice(0,-1))}m(!1)},[E,A,u,p,n,r,W,U,o,v,G,f,l,s]),q=b(()=>{f([]),T(null),m(!1),g(null),re(),window.localStorage.removeItem(`Editor.aiChatHistory`)},[f]),ne=b(async(e,t)=>{let i=A[E];if(!i)return`Error: ${y.t(`Please select a valid model`)}`;let o=R.current||await ie(n,r);if(R.current=o,!o)return`Error: ${y.t(`No API keys configured`)}`;let s=Object.keys(r)[0];if(!s)return`Error: ${y.t(`No running javascript instance found`)}`;let c=i===`custom`&&o.gptBaseUrl||``,l=a||`javascript`,u=`You are an assistant for writing ioBroker ${l} scripts. The user will ask a question about a snippet of their code. Match your answer to the question: \n- If they ask for an explanation, description, or "what does this do?", reply with clear prose (a few sentences). Do NOT repeat the code unchanged. \n- If they explicitly ask for a change, refactor, fix, or rewrite, reply with a single fenced \`\`\`${l===`blockly`?`xml`:l}\`\`\` code block containing the full replacement for the selection. You may add one short sentence before or after the block. \n- If they ask something ambiguous or meta (e.g. "is this correct?"), reply in prose first and only include code if proposing a change. \nioBroker globals available in scripts: on, setState, getState, schedule, sendTo, log, createState, setStateDelayed, existsState, httpGet, httpPost.`,d=t?`Code from my editor:\n\n\`\`\`${l===`blockly`?`xml`:l}\n${t}\n\`\`\`\n\n${e}`:e;try{let e=await ce(n,s,{messages:[{role:`system`,content:u},{role:`user`,content:d}],model:E,provider:i,baseUrl:c});return e.error?`Error: ${e.error}`:e.content||``}catch(e){return`Error: ${e.message||String(e)}`}},[E,A,r,n,a]);return{messages:u,isLoading:p,error:w,model:E,availableModels:O,modelProviderMap:A,modelsLoading:N,modelsError:I,lastContextInfo:h,mode:v,setMode:S,setModel:te,sendMessage:K,triggerAiAction:b(e=>{e.range&&e.code?z.current=l(e.kind||`codelens`,e.range,e.code):z.current=null,t(async()=>{let{buildActionPrompt:e}=await import(`./aiPromptBuilder-CXetnpLr.js`);return{buildActionPrompt:e}},[],import.meta.url).then(({buildActionPrompt:t})=>{let n=t({action:e.action,code:e.code,language:a||`javascript`,diagnostic:e.diagnostic,question:e.question,rangeLabel:e.rangeLabel});n?K(n):z.current=null}).catch(()=>{z.current=null,T(y.t(`Failed to build AI action prompt`))})},[K,a,l]),askInline:ne,clearChat:q,retryLoadModels:H}}O();var Fe=({code:e,language:t,themeType:n,onInsertCode:r,onShowDiff:i,sourceRange:a})=>{let o=j(null);C(()=>{var r;let i=window.monaco;if(!o.current||!(i!=null&&(r=i.editor)!=null&&r.colorize))return;let a=t===`ts`||t===`typescript`?`typescript`:t||`javascript`;i.editor.colorize(e,a,{theme:n===`dark`?`vs-dark`:`vs`}).then(e=>{o.current&&(o.current.innerHTML=e)})},[e,t,n]);let s=b(()=>{navigator.clipboard.writeText(e)},[e]);return m(f,{sx:{position:`relative`,my:1,borderRadius:1,overflow:`hidden`,border:`1px solid`,borderColor:`divider`},children:[m(f,{sx:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,px:1,py:.5,bgcolor:`action.hover`,borderBottom:`1px solid`,borderColor:`divider`},children:[c(f,{sx:{fontSize:`0.75rem`,color:`text.secondary`,textTransform:`uppercase`},children:t||`javascript`}),m(f,{children:[c(N,{title:y.t(`Copy`),children:c(S,{size:`small`,onClick:s,children:c(D,{sx:{fontSize:16}})})}),r&&c(N,{title:y.t(`Insert into editor`),children:c(S,{size:`small`,onClick:()=>r(e),children:c(R,{sx:{fontSize:16}})})}),i&&c(N,{title:y.t(`Show as diff`),children:c(S,{size:`small`,onClick:()=>i(e,a),children:c(V,{sx:{fontSize:16}})})})]})]}),c(`pre`,{ref:o,style:{margin:0,padding:`8px 12px`,overflow:`auto`,maxHeight:400,fontSize:`13px`,fontFamily:`'Cascadia Code', 'Fira Code', 'Consolas', monospace`,backgroundColor:n===`dark`?`#1e1e1e`:`#f8f8f8`,color:n===`dark`?`#d4d4d4`:`#333`},children:e})]})};O();var Ie=({xml:e,themeType:t})=>{let n=j(null),r=j(null),[i,a]=_(60),o=j(!1);return C(()=>{o.current&&(o.current=!1,requestAnimationFrame(()=>{let e=window.Blockly,t=r.current;e&&t&&(e.svgResize(t),t.scrollCenter())}))},[i]),C(()=>{let i=window.Blockly;if(!(!i||!n.current)){r.current&&=(r.current.dispose(),null);try{let s=i.inject(n.current,{readOnly:!0,toolbox:null,trashcan:!1,zoom:{controls:!1,wheel:!1,startScale:1},move:{scrollbars:!1,drag:!1,wheel:!1},sounds:!1,renderer:`thrasos`,theme:t===`dark`?L():`classic`,media:`google-blockly/media/`});r.current=s;let c=e.trim();c.startsWith(`${c}`);let l=i.utils.xml.textToDom(c),u=10,d=Array.from(l.querySelectorAll(`:scope > block`));for(let e of d)e.setAttribute(`x`,`10`),e.setAttribute(`y`,String(u)),u+=200;i.Xml.domToWorkspace(l,s);let f=s.getTopBlocks(!1);if(f.length>1){let e=10;for(let t of f){let n=t.getRelativeToSurfaceXY();t.moveBy(10-n.x,e-n.y),e+=t.getHeightWidth().height+20}}let p=s.getBlocksBoundingBox();if(p){let e=p.bottom-p.top+20,t=Math.max(60,Math.ceil(e));o.current=!0,a(t)}}catch{}return()=>{r.current&&=(r.current.dispose(),null)}}},[e,t]),c(f,{ref:n,sx:{width:`100%`,height:i,minHeight:60,borderRadius:1,overflow:`hidden`,border:`1px solid`,borderColor:`divider`}})};O();function Le(e){let t=[],n=/```(\w*)\n?([\s\S]*?)```/g,r=0,i;for(;(i=n.exec(e))!==null;){if(i.index>r){let n=e.substring(r,i.index).trim();n&&t.push({type:`text`,content:n})}t.push({type:`code`,content:i[2].trim(),language:i[1]||`javascript`}),r=i.index+i[0].length}if(rr&&t.push(e.substring(r,i.index)),i[2]?t.push(c(`strong`,{children:i[2]},a++)):i[3]?t.push(c(`em`,{children:i[3]},a++)):i[4]&&t.push(c(`code`,{className:`ai-chat-inline-code`,style:{padding:`2px 6px`,borderRadius:4,fontSize:`0.85em`,fontFamily:`'Cascadia Code', 'Fira Code', 'Consolas', monospace`},children:i[4]},a++)),r=i.index+i[0].length;return re.trim().replace(/^\||\|$/g,``).split(`|`).map(e=>e.trim()),a=i(e[0]),o=e.slice(2).map(i);return c(f,{sx:{overflowX:`auto`,my:1},children:m(`table`,{style:{borderCollapse:`collapse`,width:`100%`,fontSize:`0.8rem`,color:t.palette.text.primary},children:[c(`thead`,{children:c(`tr`,{children:a.map((e,n)=>c(`th`,{style:{border:`1px solid ${t.palette.divider}`,padding:`6px 10px`,backgroundColor:r?t.palette.grey[800]:t.palette.grey[100],color:t.palette.text.primary,fontWeight:600,textAlign:`left`},children:$(e)},n))})}),c(`tbody`,{children:o.map((e,n)=>c(`tr`,{style:{backgroundColor:n%2==1?r?t.palette.grey[900]:t.palette.grey[50]:void 0},children:e.map((e,n)=>c(`td`,{style:{border:`1px solid ${t.palette.divider}`,padding:`6px 10px`,color:t.palette.text.primary},children:$(e)},n))},n))})]})},n)}function Ve(e,t){let n=e.split(` +`),r=[],i=0,a=0;for(;ac(`li`,{children:$(e)},t))},i++));continue}if(/^\d+[.)]\s/.test(e)){let e=[];for(;ac(`li`,{children:$(e)},t))},i++));continue}r.push(c(`div`,{children:$(e)},i++)),a++}return r}var He=({message:e,themeType:t,currentLanguage:r,onInsertCode:i,onShowDiff:a,onApplyCode:o})=>{let l=e.role===`user`,u=s(),p=l?t===`dark`?u.palette.primary.dark:u.palette.primary.main:t===`dark`?u.palette.secondary.dark:u.palette.secondary.main,h=u.palette.getContrastText(p),_=g(()=>Le(e.content),[e.content]),v=(e,t)=>!!(e===`xml`||e===`blockly`||r===`blockly`&&t&&/n.type===`code`?v(n.language,n.content)?m(f,{sx:{my:1},children:[c(Ie,{xml:n.content,themeType:t}),m(f,{sx:{display:`flex`,gap:.5,mt:.5},children:[o&&c(d,{size:`small`,variant:`contained`,color:`primary`,startIcon:c(H,{sx:{fontSize:14}}),onClick:()=>o(n.content),sx:{textTransform:`none`,fontSize:`0.75rem`},children:y.t(`Apply blocks`)}),i&&c(d,{size:`small`,variant:`outlined`,startIcon:c(R,{sx:{fontSize:14}}),onClick:()=>i(n.content),sx:{textTransform:`none`,fontSize:`0.75rem`},children:y.t(`Insert blocks`)})]})]},r):c(Fe,{code:n.content,language:n.language||`javascript`,themeType:t,onInsertCode:i,onShowDiff:a,sourceRange:e.sourceRange||null},r):c(f,{sx:{wordBreak:`break-word`,color:u.palette.text.primary},children:Ve(n.content,u)},r))})]})};function Ue(e){let t=(e||``).toLowerCase();return t.includes(`blockly`)||t.includes(`rules`)?`blockly`:t.includes(`typescript`)?`typescript`:`javascript`}function We(e,t){return`\`\`\`${t===`blockly`?`xml`:t}\n${e}\n\`\`\``}function Ge(e){let t=(e.code||``).trim(),n=Ue(e.language),r=e.rangeLabel?` (${e.rangeLabel})`:``;switch(e.action){case`explain`:return t?[`Please explain what this ioBroker ${n} code does${r}.`,`Focus on: which datapoints it reads/writes, which triggers fire it, and any side-effects.`,``,We(t,n)].join(` +`):null;case`refactor`:return t?[`Refactor this ioBroker ${n} code${r} to be cleaner and more idiomatic.`,`Preserve behavior exactly. Keep ioBroker APIs (on, setState, getState, schedule, sendTo, log).`,`Return the full refactored block inside a \`\`\`${n===`blockly`?`xml`:n}\`\`\` code block so it can be smart-applied.`,``,We(t,n)].join(` +`):null;case`comment`:return t?[`Add clear, concise inline comments to this ioBroker ${n} code${r}.`,`Only add comments where they add real value (non-obvious logic, tricky edge cases, business rules).`,`Do not over-comment trivial lines. Return the commented version in a code block.`,``,We(t,n)].join(` +`):null;case`fix`:{if(!t)return null;let i=(e.diagnostic||``).trim();return[`This ioBroker ${n} code has an issue${r}. Please fix it and return the corrected code.${i?`\nReported problem: ${i}`:``}`,`Keep the fix minimal — do not rewrite unrelated parts.`,``,We(t,n)].join(` +`)}case`tests`:return t?[`Suggest how to test this ioBroker ${n} script manually inside the ioBroker admin UI${r}.`,``,"ioBroker scripts run inside the adapter sandbox and CANNOT be unit-tested with Jest, Mocha, or any external test framework. Do NOT propose Jest/Mocha tests, do NOT propose extracting the code into a separate Node.js project, do NOT write `describe` / `test` blocks.",``,`Instead, propose a short list of manual test cases. For each case describe:`,` • Setup — which ioBroker datapoints to prepare and to which values (via the objects tree "Values" tab)`,` • Action — what to trigger: set a state with setState, wait for a schedule, change a sensor value, etc.`,` • Expected — what should happen afterwards: which states should change, what should appear in the adapter log (javascript.0), which side effects are visible`,``,`Keep it concise: 3-6 cases covering the happy path, typical edge cases, and any guard conditions the script has.`,``,We(t,n)].join(` +`):null;case`ask`:{let i=(e.question||``).trim();return i?t?[`Regarding this ioBroker ${n} code${r}:`,``,We(t,n),``,i].join(` +`):i:null}default:return null}}function Ke(e){let t=(e||``).trimStart();if(!t.startsWith(`/`))return null;let n=t.match(/^\/(\w+)(?:\s+([\s\S]*))?$/);if(!n)return null;let r=n[1].toLowerCase(),i=(n[2]||``).trim(),a={explain:`explain`,erklaere:`explain`,erklaeren:`explain`,refactor:`refactor`,refaktor:`refactor`,refaktoriere:`refactor`,comment:`comment`,comments:`comment`,kommentar:`comment`,kommentiere:`comment`,fix:`fix`,fixme:`fix`,tests:`tests`,test:`tests`,ask:`ask`,frag:`ask`,frage:`ask`}[r];return a?{action:a,rest:i}:null}O();function qe(){return[{id:`@all`,label:y.t(`mention @all`),descriptionKey:`All scripts`},{id:`@devices`,label:y.t(`mention @devices`),descriptionKey:`Smart home devices`}]}function Je({provider:e,isDark:t}){return K[e]?c(`img`,{src:`./img/${e}.svg`,alt:e,style:{...q,...t?{filter:`invert(0.85)`}:{}},onError:e=>{e.target.style.display=`none`}}):null}function Ye(){try{let e=window.localStorage.getItem(`Editor.aiChatHistory`);return e?JSON.parse(e):[]}catch{return[]}}var Xe=({onSend:e,disabled:t,themeType:n,hasSelection:s,selectionText:u,allScripts:d,model:h,availableModels:v,modelProviderMap:w,modelsLoading:T,onModelChange:E,mode:D,onModeChange:O,currentLanguage:ee})=>{let[F,I]=_(``),[L,R]=_(!1),[z,V]=_(``),[te,H]=_(0),U=j(null),W=j(-1),G=j(Ye()),K=j(-1),q=j(``),ne=g(()=>{let e=qe().map(e=>({...e,description:y.t(e.descriptionKey)}));if(d)for(let t of d){let n=t.id.replace(/^script\.js\./,``).replace(/\./g,`/`);e.push({id:`@${n}`,label:`@${n}`,description:`${t.name} [${t.enabled?`active`:`inactive`}]`})}return e},[d]),J=g(()=>{if(!z)return ne;let e=z.toLowerCase();return ne.filter(t=>t.id.toLowerCase().includes(e)||t.description.toLowerCase().includes(e))},[ne,z]);C(()=>{H(0)},[z]);let Y=b(()=>{let n=F.trim();if(!n||t)return;let r=n,i=Ke(n);if(i){let e=s&&u?u:``,t=Ge({action:i.action,code:e,language:ee||`javascript`,question:i.action===`ask`?i.rest:void 0,diagnostic:i.action===`fix`&&i.rest||void 0});t&&(r=t)}else s&&u&&(r=`[Selected code in editor]\n\`\`\`\n${u}\n\`\`\`\n\n${n}`);G.current.push(n),K.current=-1,q.current=``;try{let e=G.current.slice(-50);window.localStorage.setItem(`Editor.aiChatHistory`,JSON.stringify(e))}catch{}e(r),I(``),R(!1),requestAnimationFrame(()=>{var e;return(e=U.current)==null?void 0:e.focus()})},[F,t,e,s,u,ee]),X=b(e=>{let t=W.current,n=U.current;if(t<0){let t=F?`${F}${e} `:`${e} `;I(t),R(!1),V(``),setTimeout(()=>{n&&(n.focus(),n.setSelectionRange(t.length,t.length))},0);return}let r=F.substring(0,t),i=(n==null?void 0:n.selectionStart)??F.length,a=`${r}${e} ${F.substring(i)}`;I(a),R(!1),V(``),W.current=-1,setTimeout(()=>{if(n){let t=r.length+e.length+1;n.focus(),n.setSelectionRange(t,t)}},0)},[F]),Z=b(()=>{W.current=-1,V(``),R(e=>!e)},[]),re=b(e=>{let t=e.target.value;I(t);let n=e.target.selectionStart??t.length,r=t.substring(0,n).match(/@([\w/äöüÄÖÜß]*)$/);r?(W.current=n-r[0].length,V(r[1]),R(!0)):(R(!1),V(``))},[]),ie=b(e=>{if(L&&J.length>0){if(e.key===`ArrowDown`){e.preventDefault(),H(e=>(e+1)%J.length);return}if(e.key===`ArrowUp`){e.preventDefault(),H(e=>(e-1+J.length)%J.length);return}if(e.key===`Enter`||e.key===`Tab`){e.preventDefault(),X(J[te].id);return}if(e.key===`Escape`){e.preventDefault(),R(!1);return}}if(e.key===`ArrowUp`&&!L&&G.current.length>0){let t=U.current,n=!t||t.selectionStart===0,r=!F.includes(` +`);if(n&&r){e.preventDefault(),K.current===-1?(q.current=F,K.current=G.current.length-1):K.current>0&&K.current--,I(G.current[K.current]);return}}if(e.key===`ArrowDown`&&!L&&K.current>=0){let t=U.current,n=!t||t.selectionStart===F.length,r=!F.includes(` +`);if(n&&r){e.preventDefault(),K.current0&&c(a,{elevation:4,sx:{position:`absolute`,bottom:`100%`,left:8,right:8,maxHeight:200,overflow:`auto`,zIndex:10,mb:.5},children:c(A,{dense:!0,disablePadding:!0,children:J.slice(0,15).map((e,t)=>c(k,{selected:t===te,onClick:()=>X(e.id),sx:{py:.25,minHeight:32},children:c(i,{primary:e.label,secondary:e.description,slotProps:{primary:{sx:{fontSize:`0.8rem`,fontWeight:500}},secondary:{sx:{fontSize:`0.7rem`}}}})},e.id))})}),D===`code`&&c(p,{label:`${y.t(`mention @devices`)} — ${y.t(`Smart home devices`)}`,size:`small`,variant:`outlined`,sx:{mx:1,mt:.5,maxWidth:`calc(100% - 16px)`}}),s&&u&&c(p,{icon:c(M,{sx:{fontSize:14}}),label:y.t(`Selected code as context`),size:`small`,variant:`outlined`,sx:{mx:1,mt:.5,maxWidth:`calc(100% - 16px)`}}),m(f,{sx:{mx:1,mt:.5,mb:.5,border:`1px solid`,borderColor:`divider`,borderRadius:1.5,overflow:`hidden`,"&:focus-within":{borderColor:`primary.main`}},children:[c(l,{inputRef:U,fullWidth:!0,multiline:!0,maxRows:6,placeholder:y.t(`Ask about your script...`),value:F,onChange:re,onKeyDown:ie,disabled:t,onBlur:()=>{setTimeout(()=>R(!1),200)},variant:`standard`,slotProps:{input:{disableUnderline:!0}},sx:{px:1.5,pt:1,pb:.5,"& .MuiInputBase-root":{fontSize:`0.875rem`}}}),m(f,{sx:{display:`flex`,alignItems:`center`,gap:.75,px:1,pb:.5},children:[c(N,{title:m(f,{sx:{fontSize:`0.8rem`,lineHeight:1.5,maxWidth:360},children:[c(f,{sx:{fontWeight:600,mb:.75},children:y.t(`AI chat mode`)}),m(f,{sx:{mb:.75},children:[m(`strong`,{children:[`💬 `,y.t(`Chat`)]}),` —`,` `,y.t(`Plain conversation. Use for questions, explanations, syntax help. Does not read or modify your scripts.`)]}),m(f,{sx:{mb:.75},children:[m(`strong`,{children:[`🤖 `,y.t(`Agent`)]}),` —`,` `,y.t(`For larger models with tool support. The AI can read, create, and edit scripts, look up datapoints, and browse the object tree — useful for "create a script that...", "which scripts use this state?" or "analyze my light script".`)]}),m(f,{children:[m(`strong`,{children:[`💻 `,y.t(`Code`)]}),` —`,` `,y.t(`For smaller models without tool support. Two-step script generator (plan then code) — useful for "create a script that..." or "write a Blockly rule for...". Output goes into the editor for smart-apply.`)]})]}),enterDelay:400,placement:`left`,children:m(x,{value:D,onChange:e=>O(e.target.value),size:`small`,variant:`standard`,disableUnderline:!0,sx:{fontSize:`0.7rem`,color:`text.secondary`,border:`1px solid`,borderColor:`text.secondary`,borderRadius:3,bgcolor:`action.hover`,px:.75,"&:hover":{borderColor:`text.disabled`,bgcolor:`action.hover`},"& .MuiSelect-select":{py:`2px`,pr:`18px !important`,display:`flex`,alignItems:`center`,gap:.5}},children:[c(o,{value:`chat`,sx:{fontSize:`0.75rem`},title:y.t(`Plain conversation. Best for: general questions, syntax help, concept explanations.`),children:`💬 Chat`}),c(o,{value:`agent`,sx:{fontSize:`0.75rem`},title:y.t(`For larger models with tool support. Best for: creating, editing, or analyzing scripts; finding datapoint usages; inspecting the object tree.`),children:`🤖 Agent`}),c(o,{value:`code`,sx:{fontSize:`0.75rem`},title:y.t(`For smaller models without tool support. Best for: creating new JavaScript/TypeScript or Blockly scripts from a description.`),children:`💻 Code`})]})}),c(x,{value:h,onChange:e=>E(e.target.value),size:`small`,disabled:T||v.length===0,variant:`standard`,disableUnderline:!0,sx:{fontSize:`0.7rem`,color:`text.secondary`,border:`1px solid`,borderColor:`text.secondary`,borderRadius:3,bgcolor:`action.hover`,px:.75,"&:hover":{borderColor:`text.disabled`,bgcolor:`action.hover`},"& .MuiSelect-select":{py:`2px`,pr:`18px !important`,display:`flex`,alignItems:`center`,gap:.5}},children:v.map(e=>m(o,{value:e,sx:{fontSize:`0.75rem`,display:`flex`,gap:.5},children:[c(Je,{provider:w[e],isDark:n===`dark`}),e]},e))}),c(N,{title:y.t(`Mention scripts as context for the AI. Use @all for all scripts or @scriptName for a specific one.`),enterDelay:500,children:c(S,{size:`small`,onClick:Z,sx:{p:`3px`,color:L?`primary.main`:`text.secondary`,border:`1px solid`,borderColor:L?`primary.main`:`text.secondary`,bgcolor:L?void 0:`action.hover`,borderRadius:3,"&:hover":{borderColor:`text.disabled`,bgcolor:`action.hover`}},children:c(B,{sx:{fontSize:16}})})}),c(f,{sx:{flex:1}}),m(r,{variant:`caption`,sx:{color:`text.disabled`,fontSize:`0.65rem`,mr:.5,whiteSpace:`nowrap`},children:[`Enter `,y.t(`to send`)]}),c(N,{title:`${y.t(`Send`)} (Enter)`,children:c(`span`,{children:c(S,{color:`primary`,onClick:Y,disabled:t||!F.trim(),size:`small`,sx:{p:.25},children:c(P,{sx:{fontSize:18}})})})})]})]})]})};O();var Ze=({socket:e,runningInstances:t,themeType:n,currentCode:i,currentLanguage:a,selectedCode:o,allScripts:s,editorApi:l,aiActionRequest:u,onAiActionConsumed:d,onRegisterInlineAsk:p,onInsertCode:_,onShowDiff:x,onApplyCode:T,currentScriptId:D,onClose:O})=>{var k;let A=j(null),{messages:M,isLoading:P,error:ee,model:F,availableModels:I,modelProviderMap:L,modelsLoading:R,modelsError:B,lastContextInfo:V,mode:te,setMode:H,setModel:U,sendMessage:W,triggerAiAction:G,askInline:K,clearChat:q,retryLoadModels:ne}=Pe(g(()=>({socket:e,runningInstances:t,currentCode:i,currentLanguage:a,allScripts:s,editorApi:l,currentScriptId:D}),[e,t,i,a,s,l,D]));C(()=>(p==null||p(K),()=>p==null?void 0:p(null)),[K,p]);let J=j(null);C(()=>{!u||J.current===u||(J.current=u,G(u),d==null||d())},[u,G,d]),C(()=>{var e;(e=A.current)==null||e.scrollIntoView({behavior:`smooth`})},[M]);let Y=b(e=>{_==null||_(e)},[_]),X=b((e,t)=>{x==null||x(e,t)},[x]),Z=b(e=>{T==null||T(e)},[T]);return m(f,{sx:{display:`flex`,flexDirection:`column`,height:`100%`,bgcolor:`background.default`,"& .ai-chat-inline-code":{backgroundColor:`action.selected`,color:`text.primary`,border:`1px solid`,borderColor:`divider`}},children:[m(f,{sx:{display:`flex`,alignItems:`center`,gap:1,px:1,py:.5,borderBottom:`1px solid`,borderColor:`divider`,bgcolor:n===`dark`?`grey.900`:`grey.100`,flexShrink:0},children:[c(r,{variant:`subtitle2`,sx:{fontWeight:600,flex:1,color:`text.primary`},children:y.t(`AI Chat`)}),R&&c(h,{size:16}),c(N,{title:y.t(`New chat`),children:c(S,{size:`small`,onClick:q,children:c(z,{sx:{fontSize:18}})})}),c(N,{title:y.t(`Close`),children:c(S,{size:`small`,onClick:O,children:c(v,{sx:{fontSize:18}})})})]}),(ee||B)&&c(w,{severity:`error`,sx:{m:1,py:0},action:B?c(S,{size:`small`,onClick:ne,children:c(E,{sx:{fontSize:16}})}):void 0,children:ee||B}),V&&c(r,{variant:`caption`,sx:{px:1.5,py:.25,color:`text.secondary`,fontSize:`0.7rem`,bgcolor:`action.hover`,borderBottom:`1px solid`,borderColor:`divider`,flexShrink:0},children:V}),m(f,{sx:{flex:1,overflow:`auto`,py:1},children:[M.length===0&&!P&&m(f,{sx:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,height:`100%`,color:`text.secondary`,px:3,textAlign:`center`},children:[c(r,{variant:`body2`,sx:{mb:1},children:y.t(`Ask questions about your script, request changes, or generate new code.`)}),m(r,{variant:`caption`,color:`text.disabled`,children:[`Enter `,y.t(`to send`),`, Shift+Enter `,y.t(`for new line`)]})]}),M.filter(e=>e.role!==`system`).map(e=>c(He,{message:e,themeType:n,currentLanguage:a,onInsertCode:Y,onShowDiff:X,onApplyCode:Z},e.id)),P&&((k=M[M.length-1])==null?void 0:k.content)===``&&m(f,{sx:{display:`flex`,alignItems:`center`,gap:1,px:2,py:1},children:[c(h,{size:16}),c(r,{variant:`caption`,color:`text.secondary`,children:y.t(`Thinking...`)})]}),c(`div`,{ref:A})]}),c(Xe,{onSend:W,disabled:P||I.length===0,themeType:n,hasSelection:!!o,selectionText:o,allScripts:s,model:F,availableModels:I,modelProviderMap:L,modelsLoading:R,onModelChange:U,mode:te,onModeChange:H,currentLanguage:a})]})};export{Ze as default,Ke as n,Ge as t}; \ No newline at end of file diff --git a/admin/assets/Debugger-osayggsE.js b/admin/assets/Debugger-osayggsE.js new file mode 100644 index 00000000..7b3bab12 --- /dev/null +++ b/admin/assets/Debugger-osayggsE.js @@ -0,0 +1,15 @@ +import{a as e,o as t,t as n}from"./rolldown-runtime-C0FnF6B9.js";import{$ as r,C as i,Cn as a,Cr as o,F as s,Ft as c,I as l,It as u,Jn as d,L as f,Ln as p,N as m,Ot as h,Rt as g,T as _,U as v,Vt as y,W as b,X as x,Yn as S,en as C,f as w,g as T,gn as E,hn as D,in as O,j as k,mn as A,nr as j,q as ee,vn as M,w as N,wr as P,x as F,xn as I,yn as te}from"./_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js";import{t as L}from"./Error-1oeF0cix.js";import{C as R,S as z}from"./index-2X_5uU-_.js";import{t as B}from"./ScriptEditorVanillaMonaco-BPeIEG64.js";P();var V={editorDiv:{height:`100%`,width:`100%`,overflow:`hidden`,position:`relative`}},H=class extends j.Component{constructor(e){super(e),this.state={lines:(this.props.script||``).split(/\r\n|\n/)}}render(){return d(`div`,{style:V.editorDiv,children:d(B,{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:e=>this.props.onToggleBreakpoint(e)},`scriptEditor2`)},`scriptEditorDiv2`)}};P();var U=34,W={logBox:{width:`100%`,height:`100%`,position:`relative`,overflow:`hidden`},logBoxInner:e=>({display:`inline-block`,color:e.palette.mode===`dark`?`white`:`black`,width:`calc(100% - ${U}px)`,height:`100%`,overflow:`auto`,position:`relative`,verticalAlign:`top`}),info:e=>({background:e.palette.mode===`dark`?`darkgrey`:`lightgrey`,color:(e.palette.mode,`black`)}),error:e=>({background:`#FF0000`,color:e.palette.mode===`dark`?`black`:`white`}),warn:e=>({background:`#FF8000`,color:e.palette.mode===`dark`?`black`:`white`}),debug:e=>({background:`gray`,opacity:.8,color:e.palette.mode===`dark`?`black`:`white`}),silly:e=>({background:`gray`,opacity:.6,color:e.palette.mode===`dark`?`black`:`white`}),table:{fontFamily:`monospace`,width:`100%`},toolbox:{width:U,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 ne(e){let t,n=e.getHours();return n<10&&(n=`0${n.toString()}`),t=`${n}:`,n=e.getMinutes(),n<10&&(n=`0${n.toString()}`),t+=`${n}:`,n=e.getSeconds(),n<10&&(n=`0${n.toString()}`),t+=`${n}.`,n=e.getMilliseconds(),n<10?n=`00${n.toString()}`:n<100&&(n=`0${n.toString()}`),t+=n,t}var re=class e extends j.Component{constructor(e){super(e),p(this,`messagesEnd`,void 0),this.state={goBottom:!0},this.messagesEnd=j.createRef()}static generateLine(e){return S(y,{component:`tr`,sx:W[e.severity],children:[d(`td`,{style:W.trTime,children:ne(new Date(e.ts))}),d(`td`,{style:W.trSeverity,children:e.severity}),d(`td`,{children:e.text})]},`tr_${e.ts}_${e.text.substring(e.text.length-10,e.text.length)}`)}renderLogList(t){return t!=null&&t.length?S(y,{sx:W.logBoxInner,children:[d(`table`,{style:W.table,children:d(`tbody`,{children:t.map(t=>e.generateLine(t))})},`logTable`),d(`div`,{ref:this.messagesEnd,style:{float:`left`,clear:`both`}},`logScrollPoint`)]},`logList`):d(y,{sx:W.logBoxInner,style:{paddingLeft:10},children:w.t(`Log outputs`)},`logList`)}onCopy(){T.copyToClipboard(this.props.console.join(` +`))}scrollToBottom(){var e;(e=this.messagesEnd)==null||(e=e.current)==null||e.scrollIntoView({behavior:`smooth`})}componentDidUpdate(){this.state.goBottom&&this.scrollToBottom()}render(){let e=this.props.console;return S(`div`,{style:W.logBox,children:[S(`div`,{style:W.toolbox,children:[d(A,{style:W.iconButtons,onClick:()=>this.setState({goBottom:!this.state.goBottom}),color:this.state.goBottom?`secondary`:void 0,size:`medium`,children:d(x,{})}),e!=null&&e.length?d(A,{style:W.iconButtons,onClick:()=>this.props.onClearAllLogs(),size:`medium`,children:d(f,{})}):null,e!=null&&e.length?d(A,{style:W.iconButtons,onClick:()=>this.onCopy(),size:`medium`,children:d(s,{})}):null]},`toolbox`),this.renderLogList(e)]})}},G=n(((t,n)=>{(function(r,i){typeof t==`object`&&typeof n==`object`?n.exports=i((P(),e(o))):typeof define==`function`&&define.amd?define([`react`],i):typeof t==`object`?t.reactJsonView=i((P(),e(o))):r.reactJsonView=i(r.React)})(t,(function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t||4&t&&typeof e==`object`&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&typeof e!=`string`)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=48)}([function(t,n){t.exports=e},function(e,t){var n=e.exports={version:`2.6.12`};typeof __e==`number`&&(__e=n)},function(e,t,n){var r=n(26)(`wks`),i=n(17),a=n(3).Symbol,o=typeof a==`function`;(e.exports=function(e){return r[e]||(r[e]=o&&a[e]||(o?a:i)(`Symbol.`+e))}).store=r},function(e,t){var n=e.exports=typeof window<`u`&&window.Math==Math?window:typeof self<`u`&&self.Math==Math?self:Function(`return this`)();typeof __g==`number`&&(__g=n)},function(e,t,n){e.exports=!n(8)((function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7}))},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(7),i=n(16);e.exports=n(4)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(10),i=n(35),a=n(23),o=Object.defineProperty;t.f=n(4)?Object.defineProperty:function(e,t,n){if(r(e),t=a(t,!0),r(n),i)try{return o(e,t,n)}catch{}if(`get`in n||`set`in n)throw TypeError(`Accessors not supported!`);return`value`in n&&(e[t]=n.value),e}},function(e,t){e.exports=function(e){try{return!!e()}catch{return!0}}},function(e,t,n){var r=n(40),i=n(22);e.exports=function(e){return r(i(e))}},function(e,t,n){var r=n(11);e.exports=function(e){if(!r(e))throw TypeError(e+` is not an object!`);return e}},function(e,t){e.exports=function(e){return typeof e==`object`?e!==null:typeof e==`function`}},function(e,t){e.exports={}},function(e,t,n){var r=n(39),i=n(27);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t){e.exports=!0},function(e,t,n){var r=n(3),i=n(1),a=n(53),o=n(6),s=n(5),c=function(e,t,n){var l,u,d,f=e&c.F,p=e&c.G,m=e&c.S,h=e&c.P,g=e&c.B,_=e&c.W,v=p?i:i[t]||(i[t]={}),y=v.prototype,b=p?r:m?r[t]:(r[t]||{}).prototype;for(l in p&&(n=t),n)(u=!f&&b&&b[l]!==void 0)&&s(v,l)||(d=u?b[l]:n[l],v[l]=p&&typeof b[l]!=`function`?n[l]:g&&u?a(d,r):_&&b[l]==d?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(d):h&&typeof d==`function`?a(Function.call,d):d,h&&((v.virtual||={})[l]=d,e&c.R&&y&&!y[l]&&o(y,l,d)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return`Symbol(${e===void 0?``:e})_${(++n+r).toString(36)}`}},function(e,t,n){var r=n(22);e.exports=function(e){return Object(r(e))}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var r=n(52)(!0);n(34)(String,`String`,(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})}))},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t){e.exports=function(e){if(e==null)throw TypeError(`Can't call method on `+e);return e}},function(e,t,n){var r=n(11);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&typeof(n=e.toString)==`function`&&!r(i=n.call(e))||typeof(n=e.valueOf)==`function`&&!r(i=n.call(e))||!t&&typeof(n=e.toString)==`function`&&!r(i=n.call(e)))return i;throw TypeError(`Can't convert object to primitive value`)}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(26)(`keys`),i=n(17);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t,n){var r=n(1),i=n(3),a=i[`__core-js_shared__`]||={};(e.exports=function(e,t){return a[e]||(a[e]=t===void 0?{}:t)})(`versions`,[]).push({version:r.version,mode:n(14)?`pure`:`global`,copyright:`© 2020 Denis Pushkarev (zloirock.ru)`})},function(e,t){e.exports=`constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf`.split(`,`)},function(e,t,n){var r=n(7).f,i=n(5),a=n(2)(`toStringTag`);e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,a)&&r(e,a,{configurable:!0,value:t})}},function(e,t,n){n(62);for(var r=n(3),i=n(6),a=n(12),o=n(2)(`toStringTag`),s=`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(`,`),c=0;cdocument.F=Object<\/script>`),e.close(),c=e.F;r--;)delete c.prototype[a[r]];return c()};e.exports=Object.create||function(e,t){var n;return e===null?n=c():(s.prototype=r(e),n=new s,s.prototype=null,n[o]=e),t===void 0?n:i(n,t)}},function(e,t,n){var r=n(5),i=n(9),a=n(57)(!1),o=n(25)(`IE_PROTO`);e.exports=function(e,t){var n,s=i(e),c=0,l=[];for(n in s)n!=o&&r(s,n)&&l.push(n);for(;t.length>c;)r(s,n=t[c++])&&(~a(l,n)||l.push(n));return l}},function(e,t,n){var r=n(24);e.exports=Object(`z`).propertyIsEnumerable(0)?Object:function(e){return r(e)==`String`?e.split(``):Object(e)}},function(e,t,n){var r=n(39),i=n(27).concat(`length`,`prototype`);t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},function(e,t,n){var r=n(24),i=n(2)(`toStringTag`),a=r(function(){return arguments}())==`Arguments`;e.exports=function(e){var t,n,o;return e===void 0?`Undefined`:e===null?`Null`:typeof(n=function(e,t){try{return e[t]}catch{}}(t=Object(e),i))==`string`?n:a?r(t):(o=r(t))==`Object`&&typeof t.callee==`function`?`Arguments`:o}},function(e,t){var n=function(){return this}();try{n||=Function(`return this`)()}catch{typeof window==`object`&&(n=window)}e.exports=n},function(e,t){var n=/-?\d+(\.\d+)?%?/g;e.exports=function(e){return e.match(n)}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getBase16Theme=t.createStyling=t.invertTheme=void 0;var r=p(n(49)),i=p(n(76)),a=p(n(81)),o=p(n(89)),s=p(n(93)),c=function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(94)),l=p(n(132)),u=p(n(133)),d=p(n(138)),f=n(139);function p(e){return e&&e.__esModule?e:{default:e}}var m=c.default,h=(0,o.default)(m),g=(0,d.default)(u.default,f.rgb2yuv,(function(e){var t,n=(0,a.default)(e,3),r=n[0],i=n[1],o=n[2];return[(t=r,t<.25?1:t<.5?.9-t:1.1-t),i,o]}),f.yuv2rgb,l.default),_=function(e){return function(t){return{className:[t.className,e.className].filter(Boolean).join(` `),style:(0,i.default)({},t.style||{},e.style||{})}}},v=function(e,t){var n=(0,o.default)(t);for(var a in e)n.indexOf(a)===-1&&n.push(a);return n.reduce((function(n,a){return n[a]=function(e,t){if(e===void 0)return t;if(t===void 0)return e;var n=e===void 0?`undefined`:(0,r.default)(e),a=t===void 0?`undefined`:(0,r.default)(t);switch(n){case`string`:switch(a){case`string`:return[t,e].filter(Boolean).join(` `);case`object`:return _({className:e,style:t});case`function`:return function(n){var r=[...arguments].slice(1);return _({className:e})(t.apply(void 0,[n].concat(r)))}}case`object`:switch(a){case`string`:return _({className:t,style:e});case`object`:return(0,i.default)({},t,e);case`function`:return function(n){var r=[...arguments].slice(1);return _({style:e})(t.apply(void 0,[n].concat(r)))}}case`function`:switch(a){case`string`:return function(n){var r=[...arguments].slice(1);return e.apply(void 0,[_(n)({className:t})].concat(r))};case`object`:return function(n){var r=[...arguments].slice(1);return e.apply(void 0,[_(n)({style:t})].concat(r))};case`function`:return function(n){var r=[...arguments].slice(1);return e.apply(void 0,[t.apply(void 0,[n].concat(r))].concat(r))}}}}(e[a],t[a]),n}),{})},y=function(e,t){var n=[...arguments].slice(2);if(t===null)return e;Array.isArray(t)||(t=[t]);var a=t.map((function(t){return e[t]})).filter(Boolean).reduce((function(e,t){return typeof t==`string`?e.className=[e.className,t].filter(Boolean).join(` `):(t===void 0?`undefined`:(0,r.default)(t))===`object`?e.style=(0,i.default)({},e.style,t):typeof t==`function`&&(e=(0,i.default)({},e,t.apply(void 0,[e].concat(n)))),e}),{className:``,style:{}});return a.className||delete a.className,(0,o.default)(a.style).length===0&&delete a.style,a},b=t.invertTheme=function(e){return(0,o.default)(e).reduce((function(t,n){return t[n]=/^base/.test(n)?g(e[n]):n===`scheme`?e[n]+`:inverted`:e[n],t}),{})},x=(t.createStyling=(0,s.default)((function(e){var t=[...arguments].slice(3),n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=n.defaultBase16,c=a===void 0?m:a,l=n.base16Themes,u=x(r,l===void 0?null:l);u&&(r=(0,i.default)({},u,r));var d=h.reduce((function(e,t){return e[t]=r[t]||c[t],e}),{}),f=v((0,o.default)(r).reduce((function(e,t){return h.indexOf(t)===-1&&(e[t]=r[t]),e}),{}),e(d));return(0,s.default)(y,2).apply(void 0,[f].concat(t))}),3),t.getBase16Theme=function(e,t){if(e&&e.extend&&(e=e.extend),typeof e==`string`){var n=e.split(`:`),r=(0,a.default)(n,2),i=r[0],o=r[1];e=(t||{})[i]||c[i],o===`inverted`&&(e=b(e))}return e&&e.hasOwnProperty(`base00`)?e:void 0})},function(e,t,n){var r,i=typeof Reflect==`object`?Reflect:null,a=i&&typeof i.apply==`function`?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&typeof i.ownKeys==`function`?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(n,r){function i(){a!==void 0&&e.removeListener(`error`,a),n([].slice.call(arguments))}var a;t!==`error`&&(a=function(n){e.removeListener(t,i),r(n)},e.once(`error`,a)),e.once(t,i)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function l(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}function u(e){return e._maxListeners===void 0?s.defaultMaxListeners:e._maxListeners}function d(e,t,n,r){var i,a,o,s;if(l(n),(a=e._events)===void 0?(a=e._events=Object.create(null),e._eventsCount=0):(a.newListener!==void 0&&(e.emit(`newListener`,t,n.listener?n.listener:n),a=e._events),o=a[t]),o===void 0)o=a[t]=n,++e._eventsCount;else if(typeof o==`function`?o=a[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=u(e))>0&&o.length>i&&!o.warned){o.warned=!0;var c=Error(`Possible EventEmitter memory leak detected. `+o.length+` `+String(t)+` listeners added. Use emitter.setMaxListeners() to increase limit`);c.name=`MaxListenersExceededWarning`,c.emitter=e,c.type=t,c.count=o.length,s=c,console&&console.warn&&console.warn(s)}return e}function f(){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 p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}function m(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i==`function`?n?[i.listener||i]:[i]:n?function(e){for(var t=Array(e.length),n=0;n0&&(o=t[0]),o instanceof Error)throw o;var s=Error(`Unhandled error.`+(o?` (`+o.message+`)`:``));throw s.context=o,s}var c=i[e];if(c===void 0)return!1;if(typeof c==`function`)a(c,this,t);else{var l=c.length,u=g(c,l);for(n=0;n=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;i===0?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return m(this,e,!0)},s.prototype.rawListeners=function(e){return m(this,e,!1)},s.listenerCount=function(e,t){return typeof e.listenerCount==`function`?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){e.exports.Dispatcher=n(140)},function(e,t,n){e.exports=n(142)},function(e,t,n){t.__esModule=!0;var r=o(n(50)),i=o(n(65)),a=typeof i.default==`function`&&typeof r.default==`symbol`?function(e){return typeof e}:function(e){return e&&typeof i.default==`function`&&e.constructor===i.default&&e!==i.default.prototype?`symbol`:typeof e};function o(e){return e&&e.__esModule?e:{default:e}}t.default=typeof i.default==`function`&&a(r.default)===`symbol`?function(e){return e===void 0?`undefined`:a(e)}:function(e){return e&&typeof i.default==`function`&&e.constructor===i.default&&e!==i.default.prototype?`symbol`:e===void 0?`undefined`:a(e)}},function(e,t,n){e.exports={default:n(51),__esModule:!0}},function(e,t,n){n(20),n(29),e.exports=n(30).f(`iterator`)},function(e,t,n){var r=n(21),i=n(22);e.exports=function(e){return function(t,n){var a,o,s=String(i(t)),c=r(n),l=s.length;return c<0||c>=l?e?``:void 0:(a=s.charCodeAt(c))<55296||a>56319||c+1===l||(o=s.charCodeAt(c+1))<56320||o>57343?e?s.charAt(c):a:e?s.slice(c,c+2):o-56320+(a-55296<<10)+65536}}},function(e,t,n){var r=n(54);e.exports=function(e,t,n){if(r(e),t===void 0)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if(typeof e!=`function`)throw TypeError(e+` is not a function!`);return e}},function(e,t,n){var r=n(38),i=n(16),a=n(28),o={};n(6)(o,n(2)(`iterator`),(function(){return this})),e.exports=function(e,t,n){e.prototype=r(o,{next:i(1,n)}),a(e,t+` Iterator`)}},function(e,t,n){var r=n(7),i=n(10),a=n(13);e.exports=n(4)?Object.defineProperties:function(e,t){i(e);for(var n,o=a(t),s=o.length,c=0;s>c;)r.f(e,n=o[c++],t[n]);return e}},function(e,t,n){var r=n(9),i=n(58),a=n(59);e.exports=function(e){return function(t,n,o){var s,c=r(t),l=i(c.length),u=a(o,l);if(e&&n!=n){for(;l>u;)if((s=c[u++])!=s)return!0}else for(;l>u;u++)if((e||u in c)&&c[u]===n)return e||u||0;return!e&&-1}}},function(e,t,n){var r=n(21),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t,n){var r=n(21),i=Math.max,a=Math.min;e.exports=function(e,t){return(e=r(e))<0?i(e+t,0):a(e,t)}},function(e,t,n){var r=n(3).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(5),i=n(18),a=n(25)(`IE_PROTO`),o=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,a)?e[a]:typeof e.constructor==`function`&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?o:null}},function(e,t,n){var r=n(63),i=n(64),a=n(12),o=n(9);e.exports=n(34)(Array,`Array`,(function(e,t){this._t=o(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):i(0,t==`keys`?n:t==`values`?e[n]:[n,e[n]])}),`values`),a.Arguments=a.Array,r(`keys`),r(`values`),r(`entries`)},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){e.exports={default:n(66),__esModule:!0}},function(e,t,n){n(67),n(73),n(74),n(75),e.exports=n(1).Symbol},function(e,t,n){var r=n(3),i=n(5),a=n(4),o=n(15),s=n(37),c=n(68).KEY,l=n(8),u=n(26),d=n(28),f=n(17),p=n(2),m=n(30),h=n(31),g=n(69),_=n(70),v=n(10),y=n(11),b=n(18),x=n(9),S=n(23),C=n(16),w=n(38),T=n(71),E=n(72),D=n(32),O=n(7),k=n(13),A=E.f,j=O.f,ee=T.f,M=r.Symbol,N=r.JSON,P=N&&N.stringify,F=p(`_hidden`),I=p(`toPrimitive`),te={}.propertyIsEnumerable,L=u(`symbol-registry`),R=u(`symbols`),z=u(`op-symbols`),B=Object.prototype,V=typeof M==`function`&&!!D.f,H=r.QObject,U=!H||!H.prototype||!H.prototype.findChild,W=a&&l((function(){return w(j({},`a`,{get:function(){return j(this,`a`,{value:7}).a}})).a!=7}))?function(e,t,n){var r=A(B,t);r&&delete B[t],j(e,t,n),r&&e!==B&&j(B,t,r)}:j,ne=function(e){var t=R[e]=w(M.prototype);return t._k=e,t},re=V&&typeof M.iterator==`symbol`?function(e){return typeof e==`symbol`}:function(e){return e instanceof M},G=function(e,t,n){return e===B&&G(z,t,n),v(e),t=S(t,!0),v(n),i(R,t)?(n.enumerable?(i(e,F)&&e[F][t]&&(e[F][t]=!1),n=w(n,{enumerable:C(0,!1)})):(i(e,F)||j(e,F,C(1,{})),e[F][t]=!0),W(e,t,n)):j(e,t,n)},ie=function(e,t){v(e);for(var n,r=g(t=x(t)),i=0,a=r.length;a>i;)G(e,n=r[i++],t[n]);return e},K=function(e){var t=te.call(this,e=S(e,!0));return!(this===B&&i(R,e)&&!i(z,e))&&(!(t||!i(this,e)||!i(R,e)||i(this,F)&&this[F][e])||t)},q=function(e,t){if(e=x(e),t=S(t,!0),e!==B||!i(R,t)||i(z,t)){var n=A(e,t);return!n||!i(R,t)||i(e,F)&&e[F][t]||(n.enumerable=!0),n}},J=function(e){for(var t,n=ee(x(e)),r=[],a=0;n.length>a;)i(R,t=n[a++])||t==F||t==c||r.push(t);return r},Y=function(e){for(var t,n=e===B,r=ee(n?z:x(e)),a=[],o=0;r.length>o;)!i(R,t=r[o++])||n&&!i(B,t)||a.push(R[t]);return a};V||(s((M=function(){if(this instanceof M)throw TypeError(`Symbol is not a constructor!`);var e=f(arguments.length>0?arguments[0]:void 0),t=function(n){this===B&&t.call(z,n),i(this,F)&&i(this[F],e)&&(this[F][e]=!1),W(this,e,C(1,n))};return a&&U&&W(B,e,{configurable:!0,set:t}),ne(e)}).prototype,`toString`,(function(){return this._k})),E.f=q,O.f=G,n(41).f=T.f=J,n(19).f=K,D.f=Y,a&&!n(14)&&s(B,`propertyIsEnumerable`,K,!0),m.f=function(e){return ne(p(e))}),o(o.G+o.W+o.F*!V,{Symbol:M});for(var X=`hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables`.split(`,`),Z=0;X.length>Z;)p(X[Z++]);for(var ae=k(p.store),oe=0;ae.length>oe;)h(ae[oe++]);o(o.S+o.F*!V,`Symbol`,{for:function(e){return i(L,e+=``)?L[e]:L[e]=M(e)},keyFor:function(e){if(!re(e))throw TypeError(e+` is not a symbol!`);for(var t in L)if(L[t]===e)return t},useSetter:function(){U=!0},useSimple:function(){U=!1}}),o(o.S+o.F*!V,`Object`,{create:function(e,t){return t===void 0?w(e):ie(w(e),t)},defineProperty:G,defineProperties:ie,getOwnPropertyDescriptor:q,getOwnPropertyNames:J,getOwnPropertySymbols:Y});var se=l((function(){D.f(1)}));o(o.S+o.F*se,`Object`,{getOwnPropertySymbols:function(e){return D.f(b(e))}}),N&&o(o.S+o.F*(!V||l((function(){var e=M();return P([e])!=`[null]`||P({a:e})!=`{}`||P(Object(e))!=`{}`}))),`JSON`,{stringify:function(e){for(var t,n,r=[e],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=t=r[1],(y(t)||e!==void 0)&&!re(e))return _(t)||(t=function(e,t){if(typeof n==`function`&&(t=n.call(this,e,t)),!re(t))return t}),r[1]=t,P.apply(N,r)}}),M.prototype[I]||n(6)(M.prototype,I,M.prototype.valueOf),d(M,`Symbol`),d(Math,`Math`,!0),d(r.JSON,`JSON`,!0)},function(e,t,n){var r=n(17)(`meta`),i=n(11),a=n(5),o=n(7).f,s=0,c=Object.isExtensible||function(){return!0},l=!n(8)((function(){return c(Object.preventExtensions({}))})),u=function(e){o(e,r,{value:{i:`O`+ ++s,w:{}}})},d=e.exports={KEY:r,NEED:!1,fastKey:function(e,t){if(!i(e))return typeof e==`symbol`?e:(typeof e==`string`?`S`:`P`)+e;if(!a(e,r)){if(!c(e))return`F`;if(!t)return`E`;u(e)}return e[r].i},getWeak:function(e,t){if(!a(e,r)){if(!c(e))return!0;if(!t)return!1;u(e)}return e[r].w},onFreeze:function(e){return l&&d.NEED&&c(e)&&!a(e,r)&&u(e),e}}},function(e,t,n){var r=n(13),i=n(32),a=n(19);e.exports=function(e){var t=r(e),n=i.f;if(n)for(var o,s=n(e),c=a.f,l=0;s.length>l;)c.call(e,o=s[l++])&&t.push(o);return t}},function(e,t,n){var r=n(24);e.exports=Array.isArray||function(e){return r(e)==`Array`}},function(e,t,n){var r=n(9),i=n(41).f,a={}.toString,o=typeof window==`object`&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return o&&a.call(e)==`[object Window]`?function(e){try{return i(e)}catch{return o.slice()}}(e):i(r(e))}},function(e,t,n){var r=n(19),i=n(16),a=n(9),o=n(23),s=n(5),c=n(35),l=Object.getOwnPropertyDescriptor;t.f=n(4)?l:function(e,t){if(e=a(e),t=o(t,!0),c)try{return l(e,t)}catch{}if(s(e,t))return i(!r.f.call(e,t),e[t])}},function(e,t){},function(e,t,n){n(31)(`asyncIterator`)},function(e,t,n){n(31)(`observable`)},function(e,t,n){t.__esModule=!0;var r;t.default=((r=n(77))&&r.__esModule?r:{default:r}).default||function(e){for(var t=1;tu;)for(var p,m=c(arguments[u++]),h=d?i(m).concat(d(m)):i(m),g=h.length,_=0;g>_;)p=h[_++],r&&!f.call(m,p)||(n[p]=m[p]);return n}:l},function(e,t,n){t.__esModule=!0;var r=a(n(82)),i=a(n(85));function a(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t){if(Array.isArray(e))return e;if((0,r.default)(Object(e)))return function(e,t){var n=[],r=!0,a=!1,o=void 0;try{for(var s,c=(0,i.default)(e);!(r=(s=c.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{!r&&c.return&&c.return()}finally{if(a)throw o}}return n}(e,t);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}},function(e,t,n){e.exports={default:n(83),__esModule:!0}},function(e,t,n){n(29),n(20),e.exports=n(84)},function(e,t,n){var r=n(42),i=n(2)(`iterator`),a=n(12);e.exports=n(1).isIterable=function(e){var t=Object(e);return t[i]!==void 0||`@@iterator`in t||a.hasOwnProperty(r(t))}},function(e,t,n){e.exports={default:n(86),__esModule:!0}},function(e,t,n){n(29),n(20),e.exports=n(87)},function(e,t,n){var r=n(10),i=n(88);e.exports=n(1).getIterator=function(e){var t=i(e);if(typeof t!=`function`)throw TypeError(e+` is not iterable!`);return r(t.call(e))}},function(e,t,n){var r=n(42),i=n(2)(`iterator`),a=n(12);e.exports=n(1).getIteratorMethod=function(e){if(e!=null)return e[i]||e[`@@iterator`]||a[r(e)]}},function(e,t,n){e.exports={default:n(90),__esModule:!0}},function(e,t,n){n(91),e.exports=n(1).Object.keys},function(e,t,n){var r=n(18),i=n(13);n(92)(`keys`,(function(){return function(e){return i(r(e))}}))},function(e,t,n){var r=n(15),i=n(1),a=n(8);e.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],o={};o[e]=t(n),r(r.S+r.F*a((function(){n(1)})),`Object`,o)}},function(e,t,n){(function(t){var n=[[`ary`,128],[`bind`,1],[`bindKey`,2],[`curry`,8],[`curryRight`,16],[`flip`,512],[`partial`,32],[`partialRight`,64],[`rearg`,256]],r=/^\s+|\s+$/g,i=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,a=/\{\n\/\* \[wrapped with (.+)\] \*/,o=/,? & /,s=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,l=/^\[object .+?Constructor\]$/,u=/^0o[0-7]+$/i,d=/^(?:0|[1-9]\d*)$/,f=parseInt,p=typeof t==`object`&&t&&t.Object===Object&&t,m=typeof self==`object`&&self&&self.Object===Object&&self,h=p||m||Function(`return this`)();function g(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function _(e,t){return!!(e&&e.length)&&function(e,t,n){if(t!=t)return function(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a-1}function v(e){return e!=e}function y(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&r++;return r}function b(e,t){for(var n=-1,r=e.length,i=0,a=[];++n2?S:void 0);function F(e){return J(e)?ee(e):{}}function I(e){return!(!J(e)||function(e){return!!D&&D in e}(e))&&(function(e){var t=J(e)?A.call(e):``;return t==`[object Function]`||t==`[object GeneratorFunction]`}(e)||function(e){var t=!1;if(e!=null&&typeof e.toString!=`function`)try{t=!!(e+``)}catch{}return t}(e)?j:l).test(function(e){if(e!=null){try{return O.call(e)}catch{}try{return e+``}catch{}}return``}(e))}function te(e,t,n,r){for(var i=-1,a=e.length,o=n.length,s=-1,c=t.length,l=M(a-o,0),u=Array(c+l),d=!r;++s1&&x.reverse(),u&&c1?`& `:``)+t[r],t=t.join(n>2?`, `:` `),e.replace(i,`{ +/* [wrapped with `+t+`] */ +`)}function re(e,t){return!!(t??=9007199254740991)&&(typeof e==`number`||d.test(e))&&e>-1&&e%1==0&&e1&&r--,a=6*r<1?t+6*(n-t)*r:2*r<1?n:3*r<2?t+(n-t)*(2/3-r)*6:t,i[l]=255*a;return i}},function(e,t,n){(function(t){var n=typeof t==`object`&&t&&t.Object===Object&&t,r=typeof self==`object`&&self&&self.Object===Object&&self,i=n||r||Function(`return this`)();function a(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function o(e,t){for(var n=-1,r=t.length,i=e.length;++n-1&&e%1==0&&e<=9007199254740991}(e.length)&&!function(e){var t=function(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}(e)?l.call(e):``;return t==`[object Function]`||t==`[object GeneratorFunction]`}(e)}(e)}(e)&&c.call(e,`callee`)&&(!d.call(e,`callee`)||l.call(e)==`[object Arguments]`)}(e)||!!(f&&e&&e[f])}var h=Array.isArray,g,_,v;e.exports=(_=function(e){var t=(e=function e(t,n,r,i,a){var s=-1,c=t.length;for(r||=m,a||=[];++s0&&r(l)?n>1?e(l,n-1,r,i,a):o(a,l):i||(a[a.length]=l)}return a}(e,1)).length,n=t;for(g&&e.reverse();n--;)if(typeof e[n]!=`function`)throw TypeError(`Expected a function`);return function(){for(var n=0,r=t?e[n].apply(this,arguments):arguments[0];++n`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,r=d(e);if(t){var i=d(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return m(this,n)}}n.r(t);var g=n(0),_=n.n(g);function v(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);e!=null&&this.setState(e)}function y(e){this.setState(function(t){return this.constructor.getDerivedStateFromProps(e,t)??null}.bind(this))}function b(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function x(e){var t=e.prototype;if(!t||!t.isReactComponent)throw Error(`Can only polyfill class components`);if(typeof e.getDerivedStateFromProps!=`function`&&typeof t.getSnapshotBeforeUpdate!=`function`)return e;var n=null,r=null,i=null;if(typeof t.componentWillMount==`function`?n=`componentWillMount`:typeof t.UNSAFE_componentWillMount==`function`&&(n=`UNSAFE_componentWillMount`),typeof t.componentWillReceiveProps==`function`?r=`componentWillReceiveProps`:typeof t.UNSAFE_componentWillReceiveProps==`function`&&(r=`UNSAFE_componentWillReceiveProps`),typeof t.componentWillUpdate==`function`?i=`componentWillUpdate`:typeof t.UNSAFE_componentWillUpdate==`function`&&(i=`UNSAFE_componentWillUpdate`),n!==null||r!==null||i!==null){var a=e.displayName||e.name,o=typeof e.getDerivedStateFromProps==`function`?`getDerivedStateFromProps()`:`getSnapshotBeforeUpdate()`;throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs. + +`+a+` uses `+o+` but also contains the following legacy lifecycles:`+(n===null?``:` + `+n)+(r===null?``:` + `+r)+(i===null?``:` + `+i)+` + +The above lifecycles should be removed. Learn more about this warning here: +https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof e.getDerivedStateFromProps==`function`&&(t.componentWillMount=v,t.componentWillReceiveProps=y),typeof t.getSnapshotBeforeUpdate==`function`){if(typeof t.componentDidUpdate!=`function`)throw Error(`Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype`);t.componentWillUpdate=b;var s=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;s.call(this,e,t,r)}}return e}function S(e,t){if(e==null)return{};var n,r,i=function(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function C(e){var t=function(e){return{}.toString.call(e).match(/\s([a-zA-Z]+)/)[1].toLowerCase()}(e);return t===`number`&&(t=isNaN(e)?`nan`:(0|e)==e?`integer`:`float`),t}v.__suppressDeprecationWarning=!0,y.__suppressDeprecationWarning=!0,b.__suppressDeprecationWarning=!0;var w={scheme:`rjv-default`,author:`mac gainor`,base00:`rgba(0, 0, 0, 0)`,base01:`rgb(245, 245, 245)`,base02:`rgb(235, 235, 235)`,base03:`#93a1a1`,base04:`rgba(0, 0, 0, 0.3)`,base05:`#586e75`,base06:`#073642`,base07:`#002b36`,base08:`#d33682`,base09:`#cb4b16`,base0A:`#dc322f`,base0B:`#859900`,base0C:`#6c71c4`,base0D:`#586e75`,base0E:`#2aa198`,base0F:`#268bd2`},T={scheme:`rjv-grey`,author:`mac gainor`,base00:`rgba(1, 1, 1, 0)`,base01:`rgba(1, 1, 1, 0.1)`,base02:`rgba(0, 0, 0, 0.2)`,base03:`rgba(1, 1, 1, 0.3)`,base04:`rgba(0, 0, 0, 0.4)`,base05:`rgba(1, 1, 1, 0.5)`,base06:`rgba(1, 1, 1, 0.6)`,base07:`rgba(1, 1, 1, 0.7)`,base08:`rgba(1, 1, 1, 0.8)`,base09:`rgba(1, 1, 1, 0.8)`,base0A:`rgba(1, 1, 1, 0.8)`,base0B:`rgba(1, 1, 1, 0.8)`,base0C:`rgba(1, 1, 1, 0.8)`,base0D:`rgba(1, 1, 1, 0.8)`,base0E:`rgba(1, 1, 1, 0.8)`,base0F:`rgba(1, 1, 1, 0.8)`},E={white:`#fff`,black:`#000`,transparent:`rgba(1, 1, 1, 0)`,globalFontFamily:`monospace`,globalCursor:`default`,indentBlockWidth:`5px`,braceFontWeight:`bold`,braceCursor:`pointer`,ellipsisFontSize:`18px`,ellipsisLineHeight:`10px`,ellipsisCursor:`pointer`,keyMargin:`0px 5px`,keyLetterSpacing:`0.5px`,keyFontStyle:`none`,keyBorderRadius:`3px`,keyColonWeight:`bold`,keyVerticalAlign:`top`,keyOpacity:`0.85`,keyOpacityHover:`1`,keyValPaddingTop:`3px`,keyValPaddingBottom:`3px`,keyValPaddingRight:`5px`,keyValBorderLeft:`1px solid`,keyValBorderHover:`2px solid`,keyValPaddingHover:`3px 5px 3px 4px`,pushedContentMarginLeft:`6px`,variableValuePaddingRight:`6px`,nullFontSize:`11px`,nullFontWeight:`bold`,nullPadding:`1px 2px`,nullBorderRadius:`3px`,nanFontSize:`11px`,nanFontWeight:`bold`,nanPadding:`1px 2px`,nanBorderRadius:`3px`,undefinedFontSize:`11px`,undefinedFontWeight:`bold`,undefinedPadding:`1px 2px`,undefinedBorderRadius:`3px`,dataTypeFontSize:`11px`,dataTypeMarginRight:`4px`,datatypeOpacity:`0.8`,objectSizeBorderRadius:`3px`,objectSizeFontStyle:`italic`,objectSizeMargin:`0px 6px 0px 0px`,clipboardCursor:`pointer`,clipboardCheckMarginLeft:`-12px`,metaDataPadding:`0px 0px 0px 10px`,arrayGroupMetaPadding:`0px 0px 0px 4px`,iconContainerWidth:`17px`,tooltipPadding:`4px`,editInputMinWidth:`130px`,editInputBorderRadius:`2px`,editInputPadding:`5px`,editInputMarginRight:`4px`,editInputFontFamily:`monospace`,iconCursor:`pointer`,iconFontSize:`15px`,iconPaddingRight:`1px`,dateValueMarginLeft:`2px`,iconMarginRight:`3px`,detectedRowPaddingTop:`3px`,addKeyCoverBackground:`rgba(255, 255, 255, 0.3)`,addKeyCoverPosition:`absolute`,addKeyCoverPositionPx:`0px`,addKeyModalWidth:`200px`,addKeyModalMargin:`auto`,addKeyModalPadding:`10px`,addKeyModalRadius:`3px`},D=n(45),O=function(e){var t=function(e){return{backgroundColor:e.base00,ellipsisColor:e.base09,braceColor:e.base07,expandedIcon:e.base0D,collapsedIcon:e.base0E,keyColor:e.base07,arrayKeyColor:e.base0C,objectSize:e.base04,copyToClipboard:e.base0F,copyToClipboardCheck:e.base0D,objectBorder:e.base02,dataTypes:{boolean:e.base0E,date:e.base0D,float:e.base0B,function:e.base0D,integer:e.base0F,string:e.base09,nan:e.base08,null:e.base0A,undefined:e.base05,regexp:e.base0A,background:e.base02},editVariable:{editIcon:e.base0E,cancelIcon:e.base09,removeIcon:e.base09,addIcon:e.base0E,checkIcon:e.base0E,background:e.base01,color:e.base0A,border:e.base07},addKeyModal:{background:e.base05,border:e.base04,color:e.base0A,labelColor:e.base01},validationFailure:{background:e.base09,iconColor:e.base01,fontColor:e.base01}}}(e);return{"app-container":{fontFamily:E.globalFontFamily,cursor:E.globalCursor,backgroundColor:t.backgroundColor,position:`relative`},ellipsis:{display:`inline-block`,color:t.ellipsisColor,fontSize:E.ellipsisFontSize,lineHeight:E.ellipsisLineHeight,cursor:E.ellipsisCursor},"brace-row":{display:`inline-block`,cursor:`pointer`},brace:{display:`inline-block`,cursor:E.braceCursor,fontWeight:E.braceFontWeight,color:t.braceColor},"expanded-icon":{color:t.expandedIcon},"collapsed-icon":{color:t.collapsedIcon},colon:{display:`inline-block`,margin:E.keyMargin,color:t.keyColor,verticalAlign:`top`},objectKeyVal:function(e,n){return{style:a({paddingTop:E.keyValPaddingTop,paddingRight:E.keyValPaddingRight,paddingBottom:E.keyValPaddingBottom,borderLeft:E.keyValBorderLeft+` `+t.objectBorder,":hover":{paddingLeft:n.paddingLeft-1+`px`,borderLeft:E.keyValBorderHover+` `+t.objectBorder}},n)}},"object-key-val-no-border":{padding:E.keyValPadding},"pushed-content":{marginLeft:E.pushedContentMarginLeft},variableValue:function(e,t){return{style:a({display:`inline-block`,paddingRight:E.variableValuePaddingRight,position:`relative`},t)}},"object-name":{display:`inline-block`,color:t.keyColor,letterSpacing:E.keyLetterSpacing,fontStyle:E.keyFontStyle,verticalAlign:E.keyVerticalAlign,opacity:E.keyOpacity,":hover":{opacity:E.keyOpacityHover}},"array-key":{display:`inline-block`,color:t.arrayKeyColor,letterSpacing:E.keyLetterSpacing,fontStyle:E.keyFontStyle,verticalAlign:E.keyVerticalAlign,opacity:E.keyOpacity,":hover":{opacity:E.keyOpacityHover}},"object-size":{color:t.objectSize,borderRadius:E.objectSizeBorderRadius,fontStyle:E.objectSizeFontStyle,margin:E.objectSizeMargin,cursor:`default`},"data-type-label":{fontSize:E.dataTypeFontSize,marginRight:E.dataTypeMarginRight,opacity:E.datatypeOpacity},boolean:{display:`inline-block`,color:t.dataTypes.boolean},date:{display:`inline-block`,color:t.dataTypes.date},"date-value":{marginLeft:E.dateValueMarginLeft},float:{display:`inline-block`,color:t.dataTypes.float},function:{display:`inline-block`,color:t.dataTypes.function,cursor:`pointer`,whiteSpace:`pre-line`},"function-value":{fontStyle:`italic`},integer:{display:`inline-block`,color:t.dataTypes.integer},string:{display:`inline-block`,color:t.dataTypes.string},nan:{display:`inline-block`,color:t.dataTypes.nan,fontSize:E.nanFontSize,fontWeight:E.nanFontWeight,backgroundColor:t.dataTypes.background,padding:E.nanPadding,borderRadius:E.nanBorderRadius},null:{display:`inline-block`,color:t.dataTypes.null,fontSize:E.nullFontSize,fontWeight:E.nullFontWeight,backgroundColor:t.dataTypes.background,padding:E.nullPadding,borderRadius:E.nullBorderRadius},undefined:{display:`inline-block`,color:t.dataTypes.undefined,fontSize:E.undefinedFontSize,padding:E.undefinedPadding,borderRadius:E.undefinedBorderRadius,backgroundColor:t.dataTypes.background},regexp:{display:`inline-block`,color:t.dataTypes.regexp},"copy-to-clipboard":{cursor:E.clipboardCursor},"copy-icon":{color:t.copyToClipboard,fontSize:E.iconFontSize,marginRight:E.iconMarginRight,verticalAlign:`top`},"copy-icon-copied":{color:t.copyToClipboardCheck,marginLeft:E.clipboardCheckMarginLeft},"array-group-meta-data":{display:`inline-block`,padding:E.arrayGroupMetaPadding},"object-meta-data":{display:`inline-block`,padding:E.metaDataPadding},"icon-container":{display:`inline-block`,width:E.iconContainerWidth},tooltip:{padding:E.tooltipPadding},removeVarIcon:{verticalAlign:`top`,display:`inline-block`,color:t.editVariable.removeIcon,cursor:E.iconCursor,fontSize:E.iconFontSize,marginRight:E.iconMarginRight},addVarIcon:{verticalAlign:`top`,display:`inline-block`,color:t.editVariable.addIcon,cursor:E.iconCursor,fontSize:E.iconFontSize,marginRight:E.iconMarginRight},editVarIcon:{verticalAlign:`top`,display:`inline-block`,color:t.editVariable.editIcon,cursor:E.iconCursor,fontSize:E.iconFontSize,marginRight:E.iconMarginRight},"edit-icon-container":{display:`inline-block`,verticalAlign:`top`},"check-icon":{display:`inline-block`,cursor:E.iconCursor,color:t.editVariable.checkIcon,fontSize:E.iconFontSize,paddingRight:E.iconPaddingRight},"cancel-icon":{display:`inline-block`,cursor:E.iconCursor,color:t.editVariable.cancelIcon,fontSize:E.iconFontSize,paddingRight:E.iconPaddingRight},"edit-input":{display:`inline-block`,minWidth:E.editInputMinWidth,borderRadius:E.editInputBorderRadius,backgroundColor:t.editVariable.background,color:t.editVariable.color,padding:E.editInputPadding,marginRight:E.editInputMarginRight,fontFamily:E.editInputFontFamily},"detected-row":{paddingTop:E.detectedRowPaddingTop},"key-modal-request":{position:E.addKeyCoverPosition,top:E.addKeyCoverPositionPx,left:E.addKeyCoverPositionPx,right:E.addKeyCoverPositionPx,bottom:E.addKeyCoverPositionPx,backgroundColor:E.addKeyCoverBackground},"key-modal":{width:E.addKeyModalWidth,backgroundColor:t.addKeyModal.background,marginLeft:E.addKeyModalMargin,marginRight:E.addKeyModalMargin,padding:E.addKeyModalPadding,borderRadius:E.addKeyModalRadius,marginTop:`15px`,position:`relative`},"key-modal-label":{color:t.addKeyModal.labelColor,marginLeft:`2px`,marginBottom:`5px`,fontSize:`11px`},"key-modal-input-container":{overflow:`hidden`},"key-modal-input":{width:`100%`,padding:`3px 6px`,fontFamily:`monospace`,color:t.addKeyModal.color,border:`none`,boxSizing:`border-box`,borderRadius:`2px`},"key-modal-cancel":{backgroundColor:t.editVariable.removeIcon,position:`absolute`,top:`0px`,right:`0px`,borderRadius:`0px 3px 0px 3px`,cursor:`pointer`},"key-modal-cancel-icon":{color:t.addKeyModal.labelColor,fontSize:E.iconFontSize,transform:`rotate(45deg)`},"key-modal-submit":{color:t.editVariable.addIcon,fontSize:E.iconFontSize,position:`absolute`,right:`2px`,top:`3px`,cursor:`pointer`},"function-ellipsis":{display:`inline-block`,color:t.ellipsisColor,fontSize:E.ellipsisFontSize,lineHeight:E.ellipsisLineHeight,cursor:E.ellipsisCursor},"validation-failure":{float:`right`,padding:`3px 6px`,borderRadius:`2px`,cursor:`pointer`,color:t.validationFailure.fontColor,backgroundColor:t.validationFailure.background},"validation-failure-label":{marginRight:`6px`},"validation-failure-clear":{position:`relative`,verticalAlign:`top`,cursor:`pointer`,color:t.validationFailure.iconColor,fontSize:E.iconFontSize,transform:`rotate(45deg)`}}};function k(e,t,n){return e||console.error(`theme has not been set`),function(e){var t=w;return!1!==e&&e!==`none`||(t=T),(0,D.createStyling)(O,{defaultBase16:t})(e)}(e)(t,n)}var A=function(e){u(n,e);var t=h(n);function n(){return o(this,n),t.apply(this,arguments)}return c(n,[{key:`render`,value:function(){var e=this.props,t=(e.rjvId,e.type_name),n=e.displayDataTypes,r=e.theme;return n?_.a.createElement(`span`,Object.assign({className:`data-type-label`},k(r,`data-type-label`)),t):null}}]),n}(_.a.PureComponent),j=function(e){u(n,e);var t=h(n);function n(){return o(this,n),t.apply(this,arguments)}return c(n,[{key:`render`,value:function(){var e=this.props;return _.a.createElement(`div`,k(e.theme,`boolean`),_.a.createElement(A,Object.assign({type_name:`bool`},e)),e.value?`true`:`false`)}}]),n}(_.a.PureComponent),ee=function(e){u(n,e);var t=h(n);function n(){return o(this,n),t.apply(this,arguments)}return c(n,[{key:`render`,value:function(){var e=this.props;return _.a.createElement(`div`,k(e.theme,`date`),_.a.createElement(A,Object.assign({type_name:`date`},e)),_.a.createElement(`span`,Object.assign({className:`date-value`},k(e.theme,`date-value`)),e.value.toLocaleTimeString(`en-us`,{weekday:`short`,year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})))}}]),n}(_.a.PureComponent),M=function(e){u(n,e);var t=h(n);function n(){return o(this,n),t.apply(this,arguments)}return c(n,[{key:`render`,value:function(){var e=this.props;return _.a.createElement(`div`,k(e.theme,`float`),_.a.createElement(A,Object.assign({type_name:`float`},e)),this.props.value)}}]),n}(_.a.PureComponent);function N(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n`u`||e[Symbol.iterator]==null){if(Array.isArray(e)||(n=P(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function I(e){return function(e){if(Array.isArray(e))return N(e)}(e)||function(e){if(typeof Symbol<`u`&&Symbol.iterator in Object(e))return Array.from(e)}(e)||P(e)||function(){throw TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}var te=n(46),L=new(n(47)).Dispatcher,R=new(function(e){u(n,e);var t=h(n);function n(){var e;o(this,n);var r=[...arguments];return(e=t.call.apply(t,[this].concat(r))).objects={},e.set=function(t,n,r,i){e.objects[t]===void 0&&(e.objects[t]={}),e.objects[t][n]===void 0&&(e.objects[t][n]={}),e.objects[t][n][r]=i},e.get=function(t,n,r,i){return e.objects[t]===void 0||e.objects[t][n]===void 0||e.objects[t][n][r]==null?i:e.objects[t][n][r]},e.handleAction=function(t){var n=t.rjvId,r=t.data;switch(t.name){case`RESET`:e.emit(`reset-`+n);break;case`VARIABLE_UPDATED`:t.data.updated_src=e.updateSrc(n,r),e.set(n,`action`,`variable-update`,a(a({},r),{},{type:`variable-edited`})),e.emit(`variable-update-`+n);break;case`VARIABLE_REMOVED`:t.data.updated_src=e.updateSrc(n,r),e.set(n,`action`,`variable-update`,a(a({},r),{},{type:`variable-removed`})),e.emit(`variable-update-`+n);break;case`VARIABLE_ADDED`:t.data.updated_src=e.updateSrc(n,r),e.set(n,`action`,`variable-update`,a(a({},r),{},{type:`variable-added`})),e.emit(`variable-update-`+n);break;case`ADD_VARIABLE_KEY_REQUEST`:e.set(n,`action`,`new-key-request`,r),e.emit(`add-key-request-`+n)}},e.updateSrc=function(t,n){var r=n.name,i=n.namespace,a=n.new_value,o=(n.existing_value,n.variable_removed);i.shift();var s,c=e.get(t,`global`,`src`),l=e.deepCopy(c,I(i)),u=l,d=F(i);try{for(d.s();!(s=d.n()).done;)u=u[s.value]}catch(e){d.e(e)}finally{d.f()}return o?C(u)==`array`?u.splice(r,1):delete u[r]:r===null?l=a:u[r]=a,e.set(t,`global`,`src`,l),l},e.deepCopy=function(t,n){var r,i=C(t),o=n.shift();return i==`array`?r=I(t):i==`object`&&(r=a({},t)),o!==void 0&&(r[o]=e.deepCopy(t[o],n)),r},e}return n}(te.EventEmitter));L.register(R.handleAction.bind(R));var z=R,B=function(e){u(n,e);var t=h(n);function n(e){var r;return o(this,n),(r=t.call(this,e)).toggleCollapsed=function(){r.setState({collapsed:!r.state.collapsed},(function(){z.set(r.props.rjvId,r.props.namespace,`collapsed`,r.state.collapsed)}))},r.getFunctionDisplay=function(e){var t=p(r).props;return e?_.a.createElement(`span`,null,r.props.value.toString().slice(9,-1).replace(/\{[\s\S]+/,``),_.a.createElement(`span`,{className:`function-collapsed`,style:{fontWeight:`bold`}},_.a.createElement(`span`,null,`{`),_.a.createElement(`span`,k(t.theme,`ellipsis`),`...`),_.a.createElement(`span`,null,`}`))):r.props.value.toString().slice(9,-1)},r.state={collapsed:z.get(e.rjvId,e.namespace,`collapsed`,!0)},r}return c(n,[{key:`render`,value:function(){var e=this.props,t=this.state.collapsed;return _.a.createElement(`div`,k(e.theme,`function`),_.a.createElement(A,Object.assign({type_name:`function`},e)),_.a.createElement(`span`,Object.assign({},k(e.theme,`function-value`),{className:`rjv-function-container`,onClick:this.toggleCollapsed}),this.getFunctionDisplay(t)))}}]),n}(_.a.PureComponent),V=function(e){u(n,e);var t=h(n);function n(){return o(this,n),t.apply(this,arguments)}return c(n,[{key:`render`,value:function(){return _.a.createElement(`div`,k(this.props.theme,`nan`),`NaN`)}}]),n}(_.a.PureComponent),H=function(e){u(n,e);var t=h(n);function n(){return o(this,n),t.apply(this,arguments)}return c(n,[{key:`render`,value:function(){return _.a.createElement(`div`,k(this.props.theme,`null`),`NULL`)}}]),n}(_.a.PureComponent),U=function(e){u(n,e);var t=h(n);function n(){return o(this,n),t.apply(this,arguments)}return c(n,[{key:`render`,value:function(){var e=this.props;return _.a.createElement(`div`,k(e.theme,`integer`),_.a.createElement(A,Object.assign({type_name:`int`},e)),this.props.value)}}]),n}(_.a.PureComponent),W=function(e){u(n,e);var t=h(n);function n(){return o(this,n),t.apply(this,arguments)}return c(n,[{key:`render`,value:function(){var e=this.props;return _.a.createElement(`div`,k(e.theme,`regexp`),_.a.createElement(A,Object.assign({type_name:`regexp`},e)),this.props.value.toString())}}]),n}(_.a.PureComponent),ne=function(e){u(n,e);var t=h(n);function n(e){var r;return o(this,n),(r=t.call(this,e)).toggleCollapsed=function(){r.setState({collapsed:!r.state.collapsed},(function(){z.set(r.props.rjvId,r.props.namespace,`collapsed`,r.state.collapsed)}))},r.state={collapsed:z.get(e.rjvId,e.namespace,`collapsed`,!0)},r}return c(n,[{key:`render`,value:function(){this.state.collapsed;var e=this.props,t=e.collapseStringsAfterLength,n=e.theme,r=e.value,i={style:{cursor:`default`}};return C(t)===`integer`&&r.length>t&&(i.style.cursor=`pointer`,this.state.collapsed&&(r=_.a.createElement(`span`,null,r.substring(0,t),_.a.createElement(`span`,k(n,`ellipsis`),` ...`)))),_.a.createElement(`div`,k(n,`string`),_.a.createElement(A,Object.assign({type_name:`string`},e)),_.a.createElement(`span`,Object.assign({className:`string-value`},i,{onClick:this.toggleCollapsed}),`"`,r,`"`))}}]),n}(_.a.PureComponent),re=function(e){u(n,e);var t=h(n);function n(){return o(this,n),t.apply(this,arguments)}return c(n,[{key:`render`,value:function(){return _.a.createElement(`div`,k(this.props.theme,`undefined`),`undefined`)}}]),n}(_.a.PureComponent);function G(){return(G=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,[`cacheMeasurements`,`maxRows`,`minRows`,`onChange`,`onHeightChange`]),u,d=l.value!==void 0,f=(0,g.useRef)(null),p=J(f,t),m=(0,g.useRef)(0),h=(0,g.useRef)(),_=function(){var e=f.current,t=n&&h.current?h.current:function(e){var t=window.getComputedStyle(e);if(t===null)return null;var n,r=(n=t,oe.reduce((function(e,t){return e[t]=n[t],e}),{})),i=r.boxSizing;return i===``?null:(se&&i===`border-box`&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+`px`),{sizingStyle:r,paddingSize:parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),borderSize:parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth)})}(e);if(t){h.current=t;var a=function(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),Z||((Z=document.createElement(`textarea`)).setAttribute(`tab-index`,`-1`),Z.setAttribute(`aria-hidden`,`true`),X(Z)),Z.parentNode===null&&document.body.appendChild(Z);var i=e.paddingSize,a=e.borderSize,o=e.sizingStyle,s=o.boxSizing;Object.keys(o).forEach((function(e){var t=e;Z.style[t]=o[t]})),X(Z),Z.value=t;var c=function(e,t){var n=e.scrollHeight;return t.sizingStyle.boxSizing===`border-box`?n+t.borderSize:n-t.paddingSize}(Z,e);Z.value=`x`;var l=Z.scrollHeight-i,u=l*n;s===`border-box`&&(u=u+i+a),c=Math.max(u,c);var d=l*r;return s===`border-box`&&(d=d+i+a),[c=Math.min(d,c),l]}(t,e.value||e.placeholder||`x`,i,r),o=a[0],s=a[1];m.current!==o&&(m.current=o,e.style.setProperty(`height`,o+`px`,`important`),c(o,{rowHeight:s}))}};return(0,g.useLayoutEffect)(_),u=K(_),(0,g.useLayoutEffect)((function(){var e=function(e){u.current(e)};return window.addEventListener(`resize`,e),function(){window.removeEventListener(`resize`,e)}}),[]),(0,g.createElement)(`textarea`,G({},l,{onChange:function(e){d||_(),o(e)},ref:p}))});function le(e){e=e.trim();try{if((e=JSON.stringify(JSON.parse(e)))[0]===`[`)return Q(`array`,JSON.parse(e));if(e[0]===`{`)return Q(`object`,JSON.parse(e));if(e.match(/\-?\d+\.\d+/)&&e.match(/\-?\d+\.\d+/)[0]===e)return Q(`float`,parseFloat(e));if(e.match(/\-?\d+e-\d+/)&&e.match(/\-?\d+e-\d+/)[0]===e)return Q(`float`,Number(e));if(e.match(/\-?\d+/)&&e.match(/\-?\d+/)[0]===e)return Q(`integer`,parseInt(e));if(e.match(/\-?\d+e\+\d+/)&&e.match(/\-?\d+e\+\d+/)[0]===e)return Q(`integer`,Number(e))}catch{}switch(e=e.toLowerCase()){case`undefined`:return Q(`undefined`,void 0);case`nan`:return Q(`nan`,NaN);case`null`:return Q(`null`,null);case`true`:return Q(`boolean`,!0);case`false`:return Q(`boolean`,!1);default:if(e=Date.parse(e))return Q(`date`,new Date(e))}return Q(!1,null)}function Q(e,t){return{type:e,value:t}}var ue=function(e){u(n,e);var t=h(n);function n(){return o(this,n),t.apply(this,arguments)}return c(n,[{key:`render`,value:function(){var e=this.props,t=e.style,n=S(e,[`style`]);return _.a.createElement(`span`,n,_.a.createElement(`svg`,Object.assign({},$(t),{viewBox:`0 0 24 24`,fill:`currentColor`,preserveAspectRatio:`xMidYMid meet`}),_.a.createElement(`path`,{d:`M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M7,13H17V11H7`})))}}]),n}(_.a.PureComponent),de=function(e){u(n,e);var t=h(n);function n(){return o(this,n),t.apply(this,arguments)}return c(n,[{key:`render`,value:function(){var e=this.props,t=e.style,n=S(e,[`style`]);return _.a.createElement(`span`,n,_.a.createElement(`svg`,Object.assign({},$(t),{viewBox:`0 0 24 24`,fill:`currentColor`,preserveAspectRatio:`xMidYMid meet`}),_.a.createElement(`path`,{d:`M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M13,7H11V11H7V13H11V17H13V13H17V11H13V7Z`})))}}]),n}(_.a.PureComponent),fe=function(e){u(n,e);var t=h(n);function n(){return o(this,n),t.apply(this,arguments)}return c(n,[{key:`render`,value:function(){var e=this.props,t=e.style,n=S(e,[`style`]),r=$(t).style;return _.a.createElement(`span`,n,_.a.createElement(`svg`,{fill:r.color,width:r.height,height:r.width,style:r,viewBox:`0 0 1792 1792`},_.a.createElement(`path`,{d:`M1344 800v64q0 14-9 23t-23 9h-832q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h832q14 0 23 9t9 23zm128 448v-832q0-66-47-113t-113-47h-832q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113zm128-832v832q0 119-84.5 203.5t-203.5 84.5h-832q-119 0-203.5-84.5t-84.5-203.5v-832q0-119 84.5-203.5t203.5-84.5h832q119 0 203.5 84.5t84.5 203.5z`})))}}]),n}(_.a.PureComponent),pe=function(e){u(n,e);var t=h(n);function n(){return o(this,n),t.apply(this,arguments)}return c(n,[{key:`render`,value:function(){var e=this.props,t=e.style,n=S(e,[`style`]),r=$(t).style;return _.a.createElement(`span`,n,_.a.createElement(`svg`,{fill:r.color,width:r.height,height:r.width,style:r,viewBox:`0 0 1792 1792`},_.a.createElement(`path`,{d:`M1344 800v64q0 14-9 23t-23 9h-352v352q0 14-9 23t-23 9h-64q-14 0-23-9t-9-23v-352h-352q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h352v-352q0-14 9-23t23-9h64q14 0 23 9t9 23v352h352q14 0 23 9t9 23zm128 448v-832q0-66-47-113t-113-47h-832q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113zm128-832v832q0 119-84.5 203.5t-203.5 84.5h-832q-119 0-203.5-84.5t-84.5-203.5v-832q0-119 84.5-203.5t203.5-84.5h832q119 0 203.5 84.5t84.5 203.5z`})))}}]),n}(_.a.PureComponent),me=function(e){u(n,e);var t=h(n);function n(){return o(this,n),t.apply(this,arguments)}return c(n,[{key:`render`,value:function(){var e=this.props,t=e.style,n=S(e,[`style`]);return _.a.createElement(`span`,n,_.a.createElement(`svg`,{style:a(a({},$(t).style),{},{paddingLeft:`2px`,verticalAlign:`top`}),viewBox:`0 0 15 15`,fill:`currentColor`},_.a.createElement(`path`,{d:`M0 14l6-6-6-6z`})))}}]),n}(_.a.PureComponent),he=function(e){u(n,e);var t=h(n);function n(){return o(this,n),t.apply(this,arguments)}return c(n,[{key:`render`,value:function(){var e=this.props,t=e.style,n=S(e,[`style`]);return _.a.createElement(`span`,n,_.a.createElement(`svg`,{style:a(a({},$(t).style),{},{paddingLeft:`2px`,verticalAlign:`top`}),viewBox:`0 0 15 15`,fill:`currentColor`},_.a.createElement(`path`,{d:`M0 5l6 6 6-6z`})))}}]),n}(_.a.PureComponent),ge=function(e){u(n,e);var t=h(n);function n(){return o(this,n),t.apply(this,arguments)}return c(n,[{key:`render`,value:function(){var e=this.props,t=e.style,n=S(e,[`style`]);return _.a.createElement(`span`,n,_.a.createElement(`svg`,Object.assign({},$(t),{viewBox:`0 0 40 40`,fill:`currentColor`,preserveAspectRatio:`xMidYMid meet`}),_.a.createElement(`g`,null,_.a.createElement(`path`,{d:`m30 35h-25v-22.5h25v7.5h2.5v-12.5c0-1.4-1.1-2.5-2.5-2.5h-7.5c0-2.8-2.2-5-5-5s-5 2.2-5 5h-7.5c-1.4 0-2.5 1.1-2.5 2.5v27.5c0 1.4 1.1 2.5 2.5 2.5h25c1.4 0 2.5-1.1 2.5-2.5v-5h-2.5v5z m-20-27.5h2.5s2.5-1.1 2.5-2.5 1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5 1.3 2.5 2.5 2.5h2.5s2.5 1.1 2.5 2.5h-20c0-1.5 1.1-2.5 2.5-2.5z m-2.5 20h5v-2.5h-5v2.5z m17.5-5v-5l-10 7.5 10 7.5v-5h12.5v-5h-12.5z m-17.5 10h7.5v-2.5h-7.5v2.5z m12.5-17.5h-12.5v2.5h12.5v-2.5z m-7.5 5h-5v2.5h5v-2.5z`}))))}}]),n}(_.a.PureComponent),_e=function(e){u(n,e);var t=h(n);function n(){return o(this,n),t.apply(this,arguments)}return c(n,[{key:`render`,value:function(){var e=this.props,t=e.style,n=S(e,[`style`]);return _.a.createElement(`span`,n,_.a.createElement(`svg`,Object.assign({},$(t),{viewBox:`0 0 40 40`,fill:`currentColor`,preserveAspectRatio:`xMidYMid meet`}),_.a.createElement(`g`,null,_.a.createElement(`path`,{d:`m28.6 25q0-0.5-0.4-1l-4-4 4-4q0.4-0.5 0.4-1 0-0.6-0.4-1.1l-2-2q-0.4-0.4-1-0.4-0.6 0-1 0.4l-4.1 4.1-4-4.1q-0.4-0.4-1-0.4-0.6 0-1 0.4l-2 2q-0.5 0.5-0.5 1.1 0 0.5 0.5 1l4 4-4 4q-0.5 0.5-0.5 1 0 0.7 0.5 1.1l2 2q0.4 0.4 1 0.4 0.6 0 1-0.4l4-4.1 4.1 4.1q0.4 0.4 1 0.4 0.6 0 1-0.4l2-2q0.4-0.4 0.4-1z m8.7-5q0 4.7-2.3 8.6t-6.3 6.2-8.6 2.3-8.6-2.3-6.2-6.2-2.3-8.6 2.3-8.6 6.2-6.2 8.6-2.3 8.6 2.3 6.3 6.2 2.3 8.6z`}))))}}]),n}(_.a.PureComponent),ve=function(e){u(n,e);var t=h(n);function n(){return o(this,n),t.apply(this,arguments)}return c(n,[{key:`render`,value:function(){var e=this.props,t=e.style,n=S(e,[`style`]);return _.a.createElement(`span`,n,_.a.createElement(`svg`,Object.assign({},$(t),{viewBox:`0 0 40 40`,fill:`currentColor`,preserveAspectRatio:`xMidYMid meet`}),_.a.createElement(`g`,null,_.a.createElement(`path`,{d:`m30.1 21.4v-2.8q0-0.6-0.4-1t-1-0.5h-5.7v-5.7q0-0.6-0.4-1t-1-0.4h-2.9q-0.6 0-1 0.4t-0.4 1v5.7h-5.7q-0.6 0-1 0.5t-0.5 1v2.8q0 0.6 0.5 1t1 0.5h5.7v5.7q0 0.5 0.4 1t1 0.4h2.9q0.6 0 1-0.4t0.4-1v-5.7h5.7q0.6 0 1-0.5t0.4-1z m7.2-1.4q0 4.7-2.3 8.6t-6.3 6.2-8.6 2.3-8.6-2.3-6.2-6.2-2.3-8.6 2.3-8.6 6.2-6.2 8.6-2.3 8.6 2.3 6.3 6.2 2.3 8.6z`}))))}}]),n}(_.a.PureComponent),ye=function(e){u(n,e);var t=h(n);function n(){return o(this,n),t.apply(this,arguments)}return c(n,[{key:`render`,value:function(){var e=this.props,t=e.style,n=S(e,[`style`]);return _.a.createElement(`span`,n,_.a.createElement(`svg`,Object.assign({},$(t),{viewBox:`0 0 40 40`,fill:`currentColor`,preserveAspectRatio:`xMidYMid meet`}),_.a.createElement(`g`,null,_.a.createElement(`path`,{d:`m31.6 21.6h-10v10h-3.2v-10h-10v-3.2h10v-10h3.2v10h10v3.2z`}))))}}]),n}(_.a.PureComponent),be=function(e){u(n,e);var t=h(n);function n(){return o(this,n),t.apply(this,arguments)}return c(n,[{key:`render`,value:function(){var e=this.props,t=e.style,n=S(e,[`style`]);return _.a.createElement(`span`,n,_.a.createElement(`svg`,Object.assign({},$(t),{viewBox:`0 0 40 40`,fill:`currentColor`,preserveAspectRatio:`xMidYMid meet`}),_.a.createElement(`g`,null,_.a.createElement(`path`,{d:`m19.8 26.4l2.6-2.6-3.4-3.4-2.6 2.6v1.3h2.2v2.1h1.2z m9.8-16q-0.3-0.4-0.7 0l-7.8 7.8q-0.4 0.4 0 0.7t0.7 0l7.8-7.8q0.4-0.4 0-0.7z m1.8 13.2v4.3q0 2.6-1.9 4.5t-4.5 1.9h-18.6q-2.6 0-4.5-1.9t-1.9-4.5v-18.6q0-2.7 1.9-4.6t4.5-1.8h18.6q1.4 0 2.6 0.5 0.3 0.2 0.4 0.5 0.1 0.4-0.2 0.7l-1.1 1.1q-0.3 0.3-0.7 0.1-0.5-0.1-1-0.1h-18.6q-1.4 0-2.5 1.1t-1 2.5v18.6q0 1.4 1 2.5t2.5 1h18.6q1.5 0 2.5-1t1.1-2.5v-2.9q0-0.2 0.2-0.4l1.4-1.5q0.3-0.3 0.8-0.1t0.4 0.6z m-2.1-16.5l6.4 6.5-15 15h-6.4v-6.5z m9.9 3l-2.1 2-6.4-6.4 2.1-2q0.6-0.7 1.5-0.7t1.5 0.7l3.4 3.4q0.6 0.6 0.6 1.5t-0.6 1.5z`}))))}}]),n}(_.a.PureComponent),xe=function(e){u(n,e);var t=h(n);function n(){return o(this,n),t.apply(this,arguments)}return c(n,[{key:`render`,value:function(){var e=this.props,t=e.style,n=S(e,[`style`]);return _.a.createElement(`span`,n,_.a.createElement(`svg`,Object.assign({},$(t),{viewBox:`0 0 40 40`,fill:`currentColor`,preserveAspectRatio:`xMidYMid meet`}),_.a.createElement(`g`,null,_.a.createElement(`path`,{d:`m31.7 16.4q0-0.6-0.4-1l-2.1-2.1q-0.4-0.4-1-0.4t-1 0.4l-9.1 9.1-5-5q-0.5-0.4-1-0.4t-1 0.4l-2.1 2q-0.4 0.4-0.4 1 0 0.6 0.4 1l8.1 8.1q0.4 0.4 1 0.4 0.6 0 1-0.4l12.2-12.1q0.4-0.4 0.4-1z m5.6 3.6q0 4.7-2.3 8.6t-6.3 6.2-8.6 2.3-8.6-2.3-6.2-6.2-2.3-8.6 2.3-8.6 6.2-6.2 8.6-2.3 8.6 2.3 6.3 6.2 2.3 8.6z`}))))}}]),n}(_.a.PureComponent);function $(e){return e||={},{style:a(a({verticalAlign:`middle`},e),{},{color:e.color?e.color:`#000000`,height:`1em`,width:`1em`})}}var Se=function(e){u(n,e);var t=h(n);function n(e){var r;return o(this,n),(r=t.call(this,e)).copiedTimer=null,r.handleCopy=function(){var e=document.createElement(`textarea`),t=r.props,n=t.clickCallback,i=t.src,a=t.namespace;e.innerHTML=JSON.stringify(r.clipboardValue(i),null,` `),document.body.appendChild(e),e.select(),document.execCommand(`copy`),document.body.removeChild(e),r.copiedTimer=setTimeout((function(){r.setState({copied:!1})}),5500),r.setState({copied:!0},(function(){typeof n==`function`&&n({src:i,namespace:a,name:a[a.length-1]})}))},r.getClippyIcon=function(){var e=r.props.theme;return r.state.copied?_.a.createElement(`span`,null,_.a.createElement(ge,Object.assign({className:`copy-icon`},k(e,`copy-icon`))),_.a.createElement(`span`,k(e,`copy-icon-copied`),`✔`)):_.a.createElement(ge,Object.assign({className:`copy-icon`},k(e,`copy-icon`)))},r.clipboardValue=function(e){switch(C(e)){case`function`:case`regexp`:return e.toString();default:return e}},r.state={copied:!1},r}return c(n,[{key:`componentWillUnmount`,value:function(){this.copiedTimer&&=(clearTimeout(this.copiedTimer),null)}},{key:`render`,value:function(){var e=this.props,t=(e.src,e.theme),n=e.hidden,r=e.rowHovered,i=k(t,`copy-to-clipboard`).style,o=`inline`;return n&&(o=`none`),_.a.createElement(`span`,{className:`copy-to-clipboard-container`,title:`Copy to clipboard`,style:{verticalAlign:`top`,display:r?`inline-block`:`none`}},_.a.createElement(`span`,{style:a(a({},i),{},{display:o}),onClick:this.handleCopy},this.getClippyIcon()))}}]),n}(_.a.PureComponent),Ce=function(e){u(n,e);var t=h(n);function n(e){var r;return o(this,n),(r=t.call(this,e)).getEditIcon=function(){var e=r.props,t=e.variable,n=e.theme;return _.a.createElement(`div`,{className:`click-to-edit`,style:{verticalAlign:`top`,display:r.state.hovered?`inline-block`:`none`}},_.a.createElement(be,Object.assign({className:`click-to-edit-icon`},k(n,`editVarIcon`),{onClick:function(){r.prepopInput(t)}})))},r.prepopInput=function(e){if(!1!==r.props.onEdit){var t=function(e){var t;switch(C(e)){case`undefined`:t=`undefined`;break;case`nan`:t=`NaN`;break;case`string`:t=e;break;case`date`:case`function`:case`regexp`:t=e.toString();break;default:try{t=JSON.stringify(e,null,` `)}catch{t=``}}return t}(e.value),n=le(t);r.setState({editMode:!0,editValue:t,parsedInput:{type:n.type,value:n.value}})}},r.getRemoveIcon=function(){var e=r.props,t=e.variable,n=e.namespace,i=e.theme,a=e.rjvId;return _.a.createElement(`div`,{className:`click-to-remove`,style:{verticalAlign:`top`,display:r.state.hovered?`inline-block`:`none`}},_.a.createElement(_e,Object.assign({className:`click-to-remove-icon`},k(i,`removeVarIcon`),{onClick:function(){L.dispatch({name:`VARIABLE_REMOVED`,rjvId:a,data:{name:t.name,namespace:n,existing_value:t.value,variable_removed:!0}})}})))},r.getValue=function(e,t){var n=!t&&e.type,i=p(r).props;switch(n){case!1:return r.getEditInput();case`string`:return _.a.createElement(ne,Object.assign({value:e.value},i));case`integer`:return _.a.createElement(U,Object.assign({value:e.value},i));case`float`:return _.a.createElement(M,Object.assign({value:e.value},i));case`boolean`:return _.a.createElement(j,Object.assign({value:e.value},i));case`function`:return _.a.createElement(B,Object.assign({value:e.value},i));case`null`:return _.a.createElement(H,i);case`nan`:return _.a.createElement(V,i);case`undefined`:return _.a.createElement(re,i);case`date`:return _.a.createElement(ee,Object.assign({value:e.value},i));case`regexp`:return _.a.createElement(W,Object.assign({value:e.value},i));default:return _.a.createElement(`div`,{className:`object-value`},JSON.stringify(e.value))}},r.getEditInput=function(){var e=r.props.theme,t=r.state.editValue;return _.a.createElement(`div`,null,_.a.createElement(ce,Object.assign({type:`text`,inputRef:function(e){return e&&e.focus()},value:t,className:`variable-editor`,onChange:function(e){var t=e.target.value,n=le(t);r.setState({editValue:t,parsedInput:{type:n.type,value:n.value}})},onKeyDown:function(e){switch(e.key){case`Escape`:r.setState({editMode:!1,editValue:``});break;case`Enter`:(e.ctrlKey||e.metaKey)&&r.submitEdit(!0)}e.stopPropagation()},placeholder:`update this value`,minRows:2},k(e,`edit-input`))),_.a.createElement(`div`,k(e,`edit-icon-container`),_.a.createElement(_e,Object.assign({className:`edit-cancel`},k(e,`cancel-icon`),{onClick:function(){r.setState({editMode:!1,editValue:``})}})),_.a.createElement(xe,Object.assign({className:`edit-check string-value`},k(e,`check-icon`),{onClick:function(){r.submitEdit()}})),_.a.createElement(`div`,null,r.showDetected())))},r.submitEdit=function(e){var t=r.props,n=t.variable,i=t.namespace,a=t.rjvId,o=r.state,s=o.editValue,c=o.parsedInput,l=s;e&&c.type&&(l=c.value),r.setState({editMode:!1}),L.dispatch({name:`VARIABLE_UPDATED`,rjvId:a,data:{name:n.name,namespace:i,existing_value:n.value,new_value:l,variable_removed:!1}})},r.showDetected=function(){var e=r.props,t=e.theme,n=(e.variable,e.namespace,e.rjvId,r.state.parsedInput),i=(n.type,n.value,r.getDetectedInput());if(i)return _.a.createElement(`div`,null,_.a.createElement(`div`,k(t,`detected-row`),i,_.a.createElement(xe,{className:`edit-check detected`,style:a({verticalAlign:`top`,paddingLeft:`3px`},k(t,`check-icon`).style),onClick:function(){r.submitEdit(!0)}})))},r.getDetectedInput=function(){var e=r.state.parsedInput,t=e.type,n=e.value,i=p(r).props,o=i.theme;if(!1!==t)switch(t.toLowerCase()){case`object`:return _.a.createElement(`span`,null,_.a.createElement(`span`,{style:a(a({},k(o,`brace`).style),{},{cursor:`default`})},`{`),_.a.createElement(`span`,{style:a(a({},k(o,`ellipsis`).style),{},{cursor:`default`})},`...`),_.a.createElement(`span`,{style:a(a({},k(o,`brace`).style),{},{cursor:`default`})},`}`));case`array`:return _.a.createElement(`span`,null,_.a.createElement(`span`,{style:a(a({},k(o,`brace`).style),{},{cursor:`default`})},`[`),_.a.createElement(`span`,{style:a(a({},k(o,`ellipsis`).style),{},{cursor:`default`})},`...`),_.a.createElement(`span`,{style:a(a({},k(o,`brace`).style),{},{cursor:`default`})},`]`));case`string`:return _.a.createElement(ne,Object.assign({value:n},i));case`integer`:return _.a.createElement(U,Object.assign({value:n},i));case`float`:return _.a.createElement(M,Object.assign({value:n},i));case`boolean`:return _.a.createElement(j,Object.assign({value:n},i));case`function`:return _.a.createElement(B,Object.assign({value:n},i));case`null`:return _.a.createElement(H,i);case`nan`:return _.a.createElement(V,i);case`undefined`:return _.a.createElement(re,i);case`date`:return _.a.createElement(ee,Object.assign({value:new Date(n)},i))}},r.state={editMode:!1,editValue:``,hovered:!1,renameKey:!1,parsedInput:{type:!1,value:null}},r}return c(n,[{key:`render`,value:function(){var e=this,t=this.props,n=t.variable,r=t.singleIndent,i=t.type,o=t.theme,s=t.namespace,c=t.indentWidth,l=t.enableClipboard,u=t.onEdit,d=t.onDelete,f=t.onSelect,p=t.displayArrayKey,m=t.quotesOnKeys,h=this.state.editMode;return _.a.createElement(`div`,Object.assign({},k(o,`objectKeyVal`,{paddingLeft:c*r}),{onMouseEnter:function(){return e.setState(a(a({},e.state),{},{hovered:!0}))},onMouseLeave:function(){return e.setState(a(a({},e.state),{},{hovered:!1}))},className:`variable-row`,key:n.name}),i==`array`?p?_.a.createElement(`span`,Object.assign({},k(o,`array-key`),{key:n.name+`_`+s}),n.name,_.a.createElement(`div`,k(o,`colon`),`:`)):null:_.a.createElement(`span`,null,_.a.createElement(`span`,Object.assign({},k(o,`object-name`),{className:`object-key`,key:n.name+`_`+s}),!!m&&_.a.createElement(`span`,{style:{verticalAlign:`top`}},`"`),_.a.createElement(`span`,{style:{display:`inline-block`}},n.name),!!m&&_.a.createElement(`span`,{style:{verticalAlign:`top`}},`"`)),_.a.createElement(`span`,k(o,`colon`),`:`)),_.a.createElement(`div`,Object.assign({className:`variable-value`,onClick:!1===f&&!1===u?null:function(t){var r=I(s);(t.ctrlKey||t.metaKey)&&!1!==u?e.prepopInput(n):!1!==f&&(r.shift(),f(a(a({},n),{},{namespace:r})))}},k(o,`variableValue`,{cursor:!1===f?`default`:`pointer`})),this.getValue(n,h)),l?_.a.createElement(Se,{rowHovered:this.state.hovered,hidden:h,src:n.value,clickCallback:l,theme:o,namespace:[].concat(I(s),[n.name])}):null,!1!==u&&h==0?this.getEditIcon():null,!1!==d&&h==0?this.getRemoveIcon():null)}}]),n}(_.a.PureComponent),we=function(e){u(n,e);var t=h(n);function n(){var e;o(this,n);var r=[...arguments];return(e=t.call.apply(t,[this].concat(r))).getObjectSize=function(){var t=e.props,n=t.size,r=t.theme;if(t.displayObjectSize)return _.a.createElement(`span`,Object.assign({className:`object-size`},k(r,`object-size`)),n,` item`,n===1?``:`s`)},e.getAddAttribute=function(t){var n=e.props,r=n.theme,i=n.namespace,o=n.name,s=n.src,c=n.rjvId,l=n.depth;return _.a.createElement(`span`,{className:`click-to-add`,style:{verticalAlign:`top`,display:t?`inline-block`:`none`}},_.a.createElement(ve,Object.assign({className:`click-to-add-icon`},k(r,`addVarIcon`),{onClick:function(){var e={name:l>0?o:null,namespace:i.splice(0,i.length-1),existing_value:s,variable_removed:!1,key_name:null};C(s)===`object`?L.dispatch({name:`ADD_VARIABLE_KEY_REQUEST`,rjvId:c,data:e}):L.dispatch({name:`VARIABLE_ADDED`,rjvId:c,data:a(a({},e),{},{new_value:[].concat(I(s),[null])})})}})))},e.getRemoveObject=function(t){var n=e.props,r=n.theme,i=(n.hover,n.namespace),a=n.name,o=n.src,s=n.rjvId;if(i.length!==1)return _.a.createElement(`span`,{className:`click-to-remove`,style:{display:t?`inline-block`:`none`}},_.a.createElement(_e,Object.assign({className:`click-to-remove-icon`},k(r,`removeVarIcon`),{onClick:function(){L.dispatch({name:`VARIABLE_REMOVED`,rjvId:s,data:{name:a,namespace:i.splice(0,i.length-1),existing_value:o,variable_removed:!0}})}})))},e.render=function(){var t=e.props,n=t.theme,r=t.onDelete,i=t.onAdd,a=t.enableClipboard,o=t.src,s=t.namespace,c=t.rowHovered;return _.a.createElement(`div`,Object.assign({},k(n,`object-meta-data`),{className:`object-meta-data`,onClick:function(e){e.stopPropagation()}}),e.getObjectSize(),a?_.a.createElement(Se,{rowHovered:c,clickCallback:a,src:o,theme:n,namespace:s}):null,!1===i?null:e.getAddAttribute(c),!1===r?null:e.getRemoveObject(c))},e}return n}(_.a.PureComponent);function Te(e){var t=e.parent_type,n=e.namespace,r=e.quotesOnKeys,i=e.theme,a=e.jsvRoot,o=e.name,s=e.displayArrayKey,c=e.name?e.name:``;return!a||!1!==o&&o!==null?t==`array`?s?_.a.createElement(`span`,Object.assign({},k(i,`array-key`),{key:n}),_.a.createElement(`span`,{className:`array-key`},c),_.a.createElement(`span`,k(i,`colon`),`:`)):_.a.createElement(`span`,null):_.a.createElement(`span`,Object.assign({},k(i,`object-name`),{key:n}),_.a.createElement(`span`,{className:`object-key`},r&&_.a.createElement(`span`,{style:{verticalAlign:`top`}},`"`),_.a.createElement(`span`,null,c),r&&_.a.createElement(`span`,{style:{verticalAlign:`top`}},`"`)),_.a.createElement(`span`,k(i,`colon`),`:`)):_.a.createElement(`span`,null)}function Ee(e){var t=e.theme;switch(e.iconStyle){case`triangle`:return _.a.createElement(he,Object.assign({},k(t,`expanded-icon`),{className:`expanded-icon`}));case`square`:return _.a.createElement(fe,Object.assign({},k(t,`expanded-icon`),{className:`expanded-icon`}));default:return _.a.createElement(ue,Object.assign({},k(t,`expanded-icon`),{className:`expanded-icon`}))}}function De(e){var t=e.theme;switch(e.iconStyle){case`triangle`:return _.a.createElement(me,Object.assign({},k(t,`collapsed-icon`),{className:`collapsed-icon`}));case`square`:return _.a.createElement(pe,Object.assign({},k(t,`collapsed-icon`),{className:`collapsed-icon`}));default:return _.a.createElement(de,Object.assign({},k(t,`collapsed-icon`),{className:`collapsed-icon`}))}}var Oe=function(e){u(n,e);var t=h(n);function n(e){var r;return o(this,n),(r=t.call(this,e)).toggleCollapsed=function(e){var t=[];for(var n in r.state.expanded)t.push(r.state.expanded[n]);t[e]=!t[e],r.setState({expanded:t})},r.state={expanded:[]},r}return c(n,[{key:`getExpandedIcon`,value:function(e){var t=this.props,n=t.theme,r=t.iconStyle;return this.state.expanded[e]?_.a.createElement(Ee,{theme:n,iconStyle:r}):_.a.createElement(De,{theme:n,iconStyle:r})}},{key:`render`,value:function(){var e=this,t=this.props,n=t.src,r=t.groupArraysAfterLength,i=(t.depth,t.name),a=t.theme,o=t.jsvRoot,s=t.namespace,c=(t.parent_type,S(t,[`src`,`groupArraysAfterLength`,`depth`,`name`,`theme`,`jsvRoot`,`namespace`,`parent_type`])),l=0,u=5*this.props.indentWidth;o||(l=5*this.props.indentWidth);var d=r,f=Math.ceil(n.length/d);return _.a.createElement(`div`,Object.assign({className:`object-key-val`},k(a,o?`jsv-root`:`objectKeyVal`,{paddingLeft:l})),_.a.createElement(Te,this.props),_.a.createElement(`span`,null,_.a.createElement(we,Object.assign({size:n.length},this.props))),I(Array(f)).map((function(t,r){return _.a.createElement(`div`,Object.assign({key:r,className:`object-key-val array-group`},k(a,`objectKeyVal`,{marginLeft:6,paddingLeft:u})),_.a.createElement(`span`,k(a,`brace-row`),_.a.createElement(`div`,Object.assign({className:`icon-container`},k(a,`icon-container`),{onClick:function(t){e.toggleCollapsed(r)}}),e.getExpandedIcon(r)),e.state.expanded[r]?_.a.createElement(je,Object.assign({key:i+r,depth:0,name:!1,collapsed:!1,groupArraysAfterLength:d,index_offset:r*d,src:n.slice(r*d,r*d+d),namespace:s,type:`array`,parent_type:`array_group`,theme:a},c)):_.a.createElement(`span`,Object.assign({},k(a,`brace`),{onClick:function(t){e.toggleCollapsed(r)},className:`array-group-brace`}),`[`,_.a.createElement(`div`,Object.assign({},k(a,`array-group-meta-data`),{className:`array-group-meta-data`}),_.a.createElement(`span`,Object.assign({className:`object-size`},k(a,`object-size`)),r*d,` - `,r*d+d>n.length?n.length:r*d+d)),`]`)))})))}}]),n}(_.a.PureComponent),ke=function(e){u(n,e);var t=h(n);function n(e){var r;o(this,n),(r=t.call(this,e)).toggleCollapsed=function(){r.setState({expanded:!r.state.expanded},(function(){z.set(r.props.rjvId,r.props.namespace,`expanded`,r.state.expanded)}))},r.getObjectContent=function(e,t,n){return _.a.createElement(`div`,{className:`pushed-content object-container`},_.a.createElement(`div`,Object.assign({className:`object-content`},k(r.props.theme,`pushed-content`)),r.renderObjectContents(t,n)))},r.getEllipsis=function(){return r.state.size===0?null:_.a.createElement(`div`,Object.assign({},k(r.props.theme,`ellipsis`),{className:`node-ellipsis`,onClick:r.toggleCollapsed}),`...`)},r.getObjectMetaData=function(e){var t=r.props,n=(t.rjvId,t.theme,r.state),i=n.size,a=n.hovered;return _.a.createElement(we,Object.assign({rowHovered:a,size:i},r.props))},r.renderObjectContents=function(e,t){var n,i=r.props,a=i.depth,o=i.parent_type,s=i.index_offset,c=i.groupArraysAfterLength,l=i.namespace,u=r.state.object_type,d=[],f=Object.keys(e||{});return r.props.sortKeys&&u!==`array`&&(f=f.sort()),f.forEach((function(i){if(n=new Ae(i,e[i]),o===`array_group`&&s&&(n.name=parseInt(n.name)+s),e.hasOwnProperty(i)){if(n.type===`object`)d.push(_.a.createElement(je,Object.assign({key:n.name,depth:a+1,name:n.name,src:n.value,namespace:l.concat(n.name),parent_type:u},t)));else if(n.type===`array`){var f=je;c&&n.value.length>c&&(f=Oe),d.push(_.a.createElement(f,Object.assign({key:n.name,depth:a+1,name:n.name,src:n.value,namespace:l.concat(n.name),type:`array`,parent_type:u},t)))}else d.push(_.a.createElement(Ce,Object.assign({key:n.name+`_`+l,variable:n,singleIndent:5,namespace:l,type:r.props.type},t)))}})),d};var i=n.getState(e);return r.state=a(a({},i),{},{prevProps:{}}),r}return c(n,[{key:`getBraceStart`,value:function(e,t){var n=this,r=this.props,i=r.src,a=r.theme,o=r.iconStyle;if(r.parent_type===`array_group`)return _.a.createElement(`span`,null,_.a.createElement(`span`,k(a,`brace`),e===`array`?`[`:`{`),t?this.getObjectMetaData(i):null);var s=t?Ee:De;return _.a.createElement(`span`,null,_.a.createElement(`span`,Object.assign({onClick:function(e){n.toggleCollapsed()}},k(a,`brace-row`)),_.a.createElement(`div`,Object.assign({className:`icon-container`},k(a,`icon-container`)),_.a.createElement(s,{theme:a,iconStyle:o})),_.a.createElement(Te,this.props),_.a.createElement(`span`,k(a,`brace`),e===`array`?`[`:`{`)),t?this.getObjectMetaData(i):null)}},{key:`render`,value:function(){var e=this,t=this.props,n=t.depth,r=t.src,i=(t.namespace,t.name,t.type,t.parent_type),o=t.theme,s=t.jsvRoot,c=t.iconStyle,l=S(t,[`depth`,`src`,`namespace`,`name`,`type`,`parent_type`,`theme`,`jsvRoot`,`iconStyle`]),u=this.state,d=u.object_type,f=u.expanded,p={};return s||i===`array_group`?i===`array_group`&&(p.borderLeft=0,p.display=`inline`):p.paddingLeft=5*this.props.indentWidth,_.a.createElement(`div`,Object.assign({className:`object-key-val`,onMouseEnter:function(){return e.setState(a(a({},e.state),{},{hovered:!0}))},onMouseLeave:function(){return e.setState(a(a({},e.state),{},{hovered:!1}))}},k(o,s?`jsv-root`:`objectKeyVal`,p)),this.getBraceStart(d,f),f?this.getObjectContent(n,r,a({theme:o,iconStyle:c},l)):this.getEllipsis(),_.a.createElement(`span`,{className:`brace-row`},_.a.createElement(`span`,{style:a(a({},k(o,`brace`).style),{},{paddingLeft:f?`3px`:`0px`})},d===`array`?`]`:`}`),f?null:this.getObjectMetaData(r)))}}],[{key:`getDerivedStateFromProps`,value:function(e,t){var r=t.prevProps;return e.src!==r.src||e.collapsed!==r.collapsed||e.name!==r.name||e.namespace!==r.namespace||e.rjvId!==r.rjvId?a(a({},n.getState(e)),{},{prevProps:e}):null}}]),n}(_.a.PureComponent);ke.getState=function(e){var t=Object.keys(e.src).length,n=(!1===e.collapsed||!0!==e.collapsed&&e.collapsed>e.depth)&&(!e.shouldCollapse||!1===e.shouldCollapse({name:e.name,src:e.src,type:C(e.src),namespace:e.namespace}))&&t!==0;return{expanded:z.get(e.rjvId,e.namespace,`expanded`,n),object_type:e.type===`array`?`array`:`object`,parent_type:e.type===`array`?`array`:`object`,size:t,hovered:!1}};var Ae=function e(t,n){o(this,e),this.name=t,this.value=n,this.type=C(n)};x(ke);var je=ke,Me=function(e){u(n,e);var t=h(n);function n(){var e;o(this,n);var r=[...arguments];return(e=t.call.apply(t,[this].concat(r))).render=function(){var t=p(e).props,n=[t.name],r=je;return Array.isArray(t.src)&&t.groupArraysAfterLength&&t.src.length>t.groupArraysAfterLength&&(r=Oe),_.a.createElement(`div`,{className:`pretty-json-container object-container`},_.a.createElement(`div`,{className:`object-content`},_.a.createElement(r,Object.assign({namespace:n,depth:0,jsvRoot:!0},t))))},e}return n}(_.a.PureComponent),Ne=function(e){u(n,e);var t=h(n);function n(e){var r;return o(this,n),(r=t.call(this,e)).closeModal=function(){L.dispatch({rjvId:r.props.rjvId,name:`RESET`})},r.submit=function(){r.props.submit(r.state.input)},r.state={input:e.input?e.input:``},r}return c(n,[{key:`render`,value:function(){var e=this,t=this.props,n=t.theme,r=t.rjvId,i=t.isValid,a=this.state.input,o=i(a);return _.a.createElement(`div`,Object.assign({className:`key-modal-request`},k(n,`key-modal-request`),{onClick:this.closeModal}),_.a.createElement(`div`,Object.assign({},k(n,`key-modal`),{onClick:function(e){e.stopPropagation()}}),_.a.createElement(`div`,k(n,`key-modal-label`),`Key Name:`),_.a.createElement(`div`,{style:{position:`relative`}},_.a.createElement(`input`,Object.assign({},k(n,`key-modal-input`),{className:`key-modal-input`,ref:function(e){return e&&e.focus()},spellCheck:!1,value:a,placeholder:`...`,onChange:function(t){e.setState({input:t.target.value})},onKeyPress:function(t){o&&t.key===`Enter`?e.submit():t.key===`Escape`&&e.closeModal()}})),o?_.a.createElement(xe,Object.assign({},k(n,`key-modal-submit`),{className:`key-modal-submit`,onClick:function(t){return e.submit()}})):null),_.a.createElement(`span`,k(n,`key-modal-cancel`),_.a.createElement(ye,Object.assign({},k(n,`key-modal-cancel-icon`),{className:`key-modal-cancel`,onClick:function(){L.dispatch({rjvId:r,name:`RESET`})}})))))}}]),n}(_.a.PureComponent),Pe=function(e){u(n,e);var t=h(n);function n(){var e;o(this,n);var r=[...arguments];return(e=t.call.apply(t,[this].concat(r))).isValid=function(t){var n=e.props.rjvId,r=z.get(n,`action`,`new-key-request`);return t!=``&&Object.keys(r.existing_value).indexOf(t)===-1},e.submit=function(t){var n=e.props.rjvId,r=z.get(n,`action`,`new-key-request`);r.new_value=a({},r.existing_value),r.new_value[t]=e.props.defaultValue,L.dispatch({name:`VARIABLE_ADDED`,rjvId:n,data:r})},e}return c(n,[{key:`render`,value:function(){var e=this.props,t=e.active,n=e.theme,r=e.rjvId;return t?_.a.createElement(Ne,{rjvId:r,theme:n,isValid:this.isValid,submit:this.submit}):null}}]),n}(_.a.PureComponent),Fe=function(e){u(n,e);var t=h(n);function n(){return o(this,n),t.apply(this,arguments)}return c(n,[{key:`render`,value:function(){var e=this.props,t=e.message,n=e.active,r=e.theme,i=e.rjvId;return n?_.a.createElement(`div`,Object.assign({className:`validation-failure`},k(r,`validation-failure`),{onClick:function(){L.dispatch({rjvId:i,name:`RESET`})}}),_.a.createElement(`span`,k(r,`validation-failure-label`),t),_.a.createElement(ye,k(r,`validation-failure-clear`))):null}}]),n}(_.a.PureComponent),Ie=function(e){u(n,e);var t=h(n);function n(e){var r;return o(this,n),(r=t.call(this,e)).rjvId=Date.now().toString(),r.getListeners=function(){return{reset:r.resetState,"variable-update":r.updateSrc,"add-key-request":r.addKeyRequest}},r.updateSrc=function(){var e,t=z.get(r.rjvId,`action`,`variable-update`),n=t.name,i=t.namespace,a=t.new_value,o=t.existing_value,s=(t.variable_removed,t.updated_src),c=t.type,l=r.props,u=l.onEdit,d=l.onDelete,f=l.onAdd,p={existing_src:r.state.src,new_value:a,updated_src:s,name:n,namespace:i,existing_value:o};switch(c){case`variable-added`:e=f(p);break;case`variable-edited`:e=u(p);break;case`variable-removed`:e=d(p)}!1===e?r.setState({validationFailure:!0}):(z.set(r.rjvId,`global`,`src`,s),r.setState({src:s}))},r.addKeyRequest=function(){r.setState({addKeyRequest:!0})},r.resetState=function(){r.setState({validationFailure:!1,addKeyRequest:!1})},r.state={addKeyRequest:!1,editKeyRequest:!1,validationFailure:!1,src:n.defaultProps.src,name:n.defaultProps.name,theme:n.defaultProps.theme,validationMessage:n.defaultProps.validationMessage,prevSrc:n.defaultProps.src,prevName:n.defaultProps.name,prevTheme:n.defaultProps.theme},r}return c(n,[{key:`componentDidMount`,value:function(){z.set(this.rjvId,`global`,`src`,this.state.src);var e=this.getListeners();for(var t in e)z.on(t+`-`+this.rjvId,e[t]);this.setState({addKeyRequest:!1,editKeyRequest:!1})}},{key:`componentDidUpdate`,value:function(e,t){!1!==t.addKeyRequest&&this.setState({addKeyRequest:!1}),!1!==t.editKeyRequest&&this.setState({editKeyRequest:!1}),e.src!==this.state.src&&z.set(this.rjvId,`global`,`src`,this.state.src)}},{key:`componentWillUnmount`,value:function(){var e=this.getListeners();for(var t in e)z.removeListener(t+`-`+this.rjvId,e[t])}},{key:`render`,value:function(){var e=this.state,t=e.validationFailure,n=e.validationMessage,r=e.addKeyRequest,i=e.theme,o=e.src,s=e.name,c=this.props,l=c.style,u=c.defaultValue;return _.a.createElement(`div`,{className:`react-json-view`,style:a(a({},k(i,`app-container`).style),l)},_.a.createElement(Fe,{message:n,active:t,theme:i,rjvId:this.rjvId}),_.a.createElement(Me,Object.assign({},this.props,{src:o,name:s,theme:i,type:C(o),rjvId:this.rjvId})),_.a.createElement(Pe,{active:r,theme:i,rjvId:this.rjvId,defaultValue:u}))}}],[{key:`getDerivedStateFromProps`,value:function(e,t){if(e.src!==t.prevSrc||e.name!==t.prevName||e.theme!==t.prevTheme){var r={src:e.src,name:e.name,theme:e.theme,validationMessage:e.validationMessage,prevSrc:e.src,prevName:e.name,prevTheme:e.theme};return n.validateState(r)}return null}}]),n}(_.a.PureComponent);Ie.defaultProps={src:{},name:`root`,theme:`rjv-default`,collapsed:!1,collapseStringsAfterLength:!1,shouldCollapse:!1,sortKeys:!1,quotesOnKeys:!0,groupArraysAfterLength:100,indentWidth:4,enableClipboard:!0,displayObjectSize:!0,displayDataTypes:!0,onEdit:!1,onDelete:!1,onAdd:!1,onSelect:!1,iconStyle:`triangle`,style:{},validationMessage:`Validation Error`,defaultValue:null,displayArrayKey:!0},Ie.validateState=function(e){var t={};return C(e.theme)!==`object`||function(e){var t=[`base00`,`base01`,`base02`,`base03`,`base04`,`base05`,`base06`,`base07`,`base08`,`base09`,`base0A`,`base0B`,`base0C`,`base0D`,`base0E`,`base0F`];if(C(e)===`object`){for(var n=0;n({color:e.palette.mode===`dark`?`#CCC`:`#333`}),frameTextSecondary:{fontStyle:`italic`,fontSize:12,opacity:.6,pl:1},listRoot:{padding:0,fontSize:`small`},scopeType:{verticalAlign:`top`,textTransform:`uppercase`,width:50},scopeType_local:{color:`#53a944`},scopeType_closure:{color:`#365b80`},scopeType_user:{color:`#a48a15`},scopeName:{color:`#bc5b5b`,width:`calc(100% - 82px)`,whiteSpace:`nowrap`,textOverflow:`ellipsis`},scopeButton:{width:32},scopeValueEditable:{cursor:`pointer`},selectedFrame:{backgroundColor:`#777`,color:`white`},splitter:{width:`100%`,height:`calc(100% - 36px)`,overflow:`hidden`,fontSize:12},toolbarScopes:e=>({width:24,display:`inline-block`,height:`100%`,background:e.palette.mode===`dark`?`#222`:`#EEE`,verticalAlign:`top`}),scopesAfterToolbar:{width:`calc(100% - 24px)`,display:`inline-block`,height:`100%`,verticalAlign:`top`},scopeNameName:{fontWeight:`bold`,display:`inline-block`,verticalAlign:`top`},scopeNameEqual:e=>({display:`inline-block`,color:e.palette.mode===`dark`?`#EEE`:`#222`,verticalAlign:`top`}),scopeNameValue:{verticalAlign:`top`,display:`inline-block`,color:`#3b709f`,whiteSpace:`nowrap`},scopeButtonDel:{padding:0,float:`right`},valueNull:{color:`#a44a24`},valueUndefined:{color:`#a44a24`},valueString:{color:`#1e8816`},valueNumber:{color:`#163c88`},valueBoolean:{color:`#a44a24`},valueObject:{color:`#721b70`},valueNone:{color:`#8a8a8a`},valueFunc:{color:`#ac4343`},error:e=>({color:e.palette.mode===`dark`?`#FF8080`:`#FF0000`,fontStyle:`italic`})};function q(e){var t;let n={};return e.className===`ReferenceError`?e.description:((t=e.preview)==null||(t=t.properties)==null||t.forEach(e=>{(e==null?void 0:e.type)===`object`?e.subtype===`null`?n[e.name]=null:n[e.name]=`{ ${e.value===`Object`?`...`:e.value} }`:e.type===`boolean`?n[e.name||e.description]=e.value===`true`:e.type===`number`?n[e.name||e.description]=parseFloat(e.value):e.type===`function`?n[e.name||e.description]=`function(){}`:e.type===`undefined`?n[e.name||e.description]=void 0:n[e.name||e.description]=e.value}),n)}var J=class extends j.Component{constructor(e){super(e),p(this,`editRef`,void 0),p(this,`scopeValue`,null);let t=window.localStorage.getItem(`JS.framesSizes`),n=[30,70];if(t)try{n=JSON.parse(t)}catch{}this.state={editValue:null,callFrames:this.props.callFrames,framesSizes:n},this.editRef=j.createRef()}onExpressionNameUpdate(){this.state.editValue&&this.props.onExpressionNameUpdate(this.state.editValue.index,this.scopeValue,()=>{this.setState({editValue:null}),this.scopeValue=null})}renderExpression(e,t){let n=this.state.editValue&&this.state.editValue.type===`expression`&&this.state.editValue.index===t?d(D,{inputRef:this.editRef,fullWidth:!0,margin:`dense`,onBlur:()=>this.state.editValue&&this.setState({editValue:null}),defaultValue:e.name,onKeyUp:e=>{e.key===`Enter`?this.onExpressionNameUpdate():e.key===`Escape`&&this.setState({editValue:null})},onChange:e=>this.scopeValue=e.target.value,endAdornment:d(E,{position:`end`,children:d(A,{onClick:()=>this.onExpressionNameUpdate(),size:`medium`,children:d(k,{})})})}):[d(`div`,{style:K.scopeNameName,title:w.t(`Double click to edit expression`),children:e.name},`name`),S(y,{sx:K.scopeNameEqual,children:[` `,`=`,` `]},`=`),d(`div`,{style:K.scopeNameValue,children:this.formatValue(e.value)},`val`)];return S(`tr`,{children:[d(`td`,{style:{...K.scopeType,...K.scopeType_user},children:`user`}),d(`td`,{style:K.scopeName,onDoubleClick:()=>{this.scopeValue=e.name||``,this.setState({editValue:{type:`expression`,valueType:`string`,index:t,name:e.name,value:e.name||``}})},children:n}),d(A,{style:K.scopeButtonDel,size:`small`,disabled:!!this.state.editValue,onClick:()=>this.props.onExpressionDelete(t),children:d(l,{})})]},`user_${t}${e.name}`)}renderExpressions(){return this.props.expressions.map((e,t)=>this.renderExpression(e,t))}renderOneFrameTitle(e,t){if(this.props.mainScriptId===this.props.currentScriptId&&e.location.scriptId!==this.props.mainScriptId)return null;let n=(e.url.split(`/`).pop()||``).replace(/^script\.js\./,``);return d(I,{onClick:()=>this.props.onChangeCurrentFrame(t),dense:!0,selected:this.props.currentFrame===t,style:K.frameRoot,children:d(a,{sx:{...K.frameTextRoot,"& .MuiListItemText-primary":K.frameTextPrimary,"& .MuiListItemText-secondary":K.frameTextSecondary},title:e.url,primary:e.functionName||`anonymous`,secondary:`${n} (${e.location.lineNumber}:${e.location.columnNumber})`})},e.callFrameId)}formatValue(e,t){if(!e)return t?`none`:d(`span`,{style:K.valueNone,children:`none`});if(e.type===`undefined`)return t?`undefined`:d(`span`,{style:K.valueUndefined,children:`undefined`});if(e.type===`null`)return t?`null`:d(`span`,{style:K.valueNull,children:`null`});if(e.type===`function`){let n=e.description?e.description.length>100?`${e.description.substring(0,100)}...`:e.description:`function`;return t?n:d(`span`,{style:K.valueFunc,title:e.description,children:n})}if(e.type===`object`){let n=q(e);return t?JSON.stringify(n):typeof n==`string`?d(y,{component:`span`,sx:K.error,children:n}):d(ie.default,{name:!1,enableClipboard:!1,style:{backgroundColor:`inherit`,marginTop:3},src:n,collapsed:!0,theme:this.props.themeType===`dark`?`brewer`:`rjv-default`,displayDataTypes:!1})}if(e.value===void 0)return t?`undefined`:d(`span`,{style:K.valueUndefined,children:`undefined`});if(e.value===null)return t?`null`:d(`span`,{style:K.valueNull,children:`null`});if(e.type===`string`){if(t)return e.value;let n=`"${e.value?e.value.length>100?`${e.value.substring(0,100)}...`:e.value:``}"`;return d(`span`,{style:K.valueString,title:n,children:n})}return e.type===`boolean`?t?e.value.toString():d(`span`,{style:K.valueBoolean,children:e.value.toString()}):e.value.toString()}onWriteScopeValue(){var e,t;this.scopeValue===`true`?this.scopeValue=!0:this.scopeValue===`false`?this.scopeValue=!1:this.scopeValue===`null`?this.scopeValue=null:this.scopeValue===`undefined`?this.scopeValue=void 0:parseFloat(this.scopeValue).toString()===this.scopeValue&&(this.scopeValue=parseFloat(this.scopeValue)),this.props.onWriteScopeValue({variableName:((e=this.state.editValue)==null?void 0:e.name)||``,scopeNumber:0,newValue:{value:this.scopeValue,valueType:typeof this.scopeValue},callFrameId:(t=this.props.callFrames)==null?void 0:t[this.props.currentFrame].callFrameId}),this.setState({editValue:null}),this.scopeValue=null}componentDidUpdate(){var e;(e=this.editRef.current)==null||e.focus()}renderScope(e,t,n){var r,i,a,o;let s=!this.props.currentFrame&&t.value&&(t.value.type===`undefined`||t.value.type===`string`||t.value.type===`number`||t.value.type===`boolean`||((r=t.value)==null?void 0:r.value)===null||((i=t.value)==null?void 0:i.value)===void 0&&t.value.type!==`object`),c=((a=this.state.editValue)==null?void 0:a.type)===n&&((o=this.state.editValue)==null?void 0:o.name)===t.name?[d(`div`,{style:K.scopeNameName,children:t.name},`name`),S(y,{sx:K.scopeNameEqual,children:[` `,`=`,` `]},`=`),d(D,{inputRef:this.editRef,margin:`dense`,onBlur:()=>this.state.editValue&&this.setState({editValue:null}),defaultValue:this.formatValue(t.value,!0),onKeyUp:e=>{e.key===`Enter`?this.onWriteScopeValue():e.key===`Escape`&&this.setState({editValue:null})},onChange:e=>this.scopeValue=e.target.value,endAdornment:d(E,{position:`end`,children:d(A,{onClick:()=>this.onWriteScopeValue(),size:`medium`,children:d(k,{})})})},`input`)]:[d(`div`,{style:K.scopeNameName,title:w.t(`Double click to write value`),children:t.name},`name`),S(y,{sx:K.scopeNameEqual,children:[` `,`=`,` `]},`=`),S(`div`,{style:K.scopeNameValue,children:[this.formatValue(t.value),` (`,t.value.type,`)`]},`val`)];return S(`tr`,{children:[d(`td`,{style:{...K.scopeType,...K[`scopeType_${n}`]},children:n}),d(`td`,{style:{...K.scopeName,...!this.props.currentFrame&&s?K.scopeValueEditable:void 0},onDoubleClick:()=>{s&&(this.scopeValue=t.value.value,this.setState({editValue:{scopeId:e,type:n,index:0,valueType:t.value.type,name:t.name,value:t.value.value}}))},children:c})]},`${n}_${e}_${t.name}`)}renderScopes(e){var t,n;if(!e)return null;let r=this.renderExpressions(),i=(t=this.props.scopes)==null||(t=t.local)==null||(t=t.properties)==null?void 0:t.result.map(e=>this.props.scopes&&this.renderScope(``,e,`local`));return i==null||i.forEach(e=>e&&r.push(e)),i=(n=this.props.scopes)==null||(n=n.closure)==null||(n=n.properties)==null?void 0:n.result.map(e=>this.props.scopes&&this.renderScope(``,e,`closure`)),i==null||i.forEach(e=>e&&r.push(e)),d(`table`,{style:{width:`100%`,fontSize:`small`},children:d(`tbody`,{children:r})})}render(){var e,t;return S(z,{direction:R.Horizontal,initialSizes:this.state.framesSizes,minWidths:[100,200],onResizeFinished:(e,t)=>{this.setState({framesSizes:t}),window.localStorage.setItem(`JS.framesSizes`,JSON.stringify(t))},gutterClassName:this.props.themeType===`dark`?`Dark visGutter`:`Light visGutter`,children:[d(`div`,{style:{width:`100%`,height:`100%`,overflow:`auto`},children:d(te,{style:K.listRoot,children:((e=this.props.callFrames)==null?void 0:e.map((e,t)=>this.renderOneFrameTitle(e,t)))||null})}),S(`div`,{style:{width:`100%`,height:`100%`,overflow:`auto`},children:[d(y,{sx:K.toolbarScopes,children:d(A,{size:`small`,onClick:()=>this.props.onExpressionAdd((e,t)=>{this.scopeValue=t.name||``,this.setState({editValue:{type:`expression`,valueType:`string`,index:e,name:t.name,value:t.name||``}})}),children:d(F,{})})}),d(`div`,{style:K.scopesAfterToolbar,children:((t=this.props.callFrames)==null?void 0:t.length)&&this.renderScopes(this.props.callFrames[this.props.currentFrame])})]})]})}};P();var Y={root:e=>({width:`100%`,height:`calc(100% - ${parseInt(e.toolbar.height,10)+38+5}px)`,overflow:`hidden`,position:`relative`}),toolbar:{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)`},buttonRun:{color:`green`},buttonPause:{color:`orange`},buttonRestart:{color:`darkgreen`},buttonStop:{color:`red`},buttonNext:{color:`blue`},buttonStep:{color:`blue`},buttonOut:{color:`blue`},buttonException:{},tabFile:e=>({textTransform:`inherit`,color:e.palette.mode===`dark`?`#DDD`:`inherit`}),tabText:{maxWidth:130,textOverflow:`ellipsis`,whiteSpace:`nowrap`,overflow:`hidden`,display:`inline-block`,verticalAlign:`middle`},closeButton:{position:`absolute`,top:8,right:0,zIndex:10,padding:8,cursor:`pointer`},tabsRoot:e=>({minHeight:24,background:e.palette.mode===`dark`?`#333`:`#e6e6e6`,color:e.palette.mode===`dark`?`white`:`inherit`}),tabRoot:{minHeight:24},bpListItem:{borderTop:`1px dashed #bfbfbf44`},monospace:{fontFamily:`Courier New, monospace`,whiteSpace:`pre`,fontSize:12},arrow:{color:`#fffa4f`},splitter:{height:`calc(100% - 52px)`,"& .layout-pane":{overflow:`hidden`,height:`100%`}}},X=class e extends j.Component{constructor(t){super(t),p(this,`console`,null),p(this,`scripts`,{}),p(this,`mainScriptId`,null),p(this,`fromInstance`,(t,n)=>{if(n!=null&&n.val&&this.state.instance!==void 0)try{let t=JSON.parse(n.val);if(t.cmd===`subscribed`)this.props.socket.sendTo(this.state.instance,`debug`,this.props.debugInstance||{scriptName:this.props.src});else if(t.cmd===`readyToDebug`){var r;this.mainScriptId=t.scriptId,this.scripts[t.scriptId]=t.script,t.script.startsWith(`(async () => {debugger; +`)?this.scripts[t.scriptId]=`(async () => {\n${t.script.substring(24)}`:t.script.startsWith(`debugger;`)&&(this.scripts[t.scriptId]=t.script.substring(9));let n=JSON.parse(JSON.stringify(this.state.tabs));n[t.scriptId]=this.props.debugInstance?t.url:this.props.src.replace(`script.js.`,``);let i=`${Date.now()}.${Math.random()*1e4}`;(r=t.context)==null||(r=r.callFrames)==null||r.forEach((e,t)=>e.id=i+t),this.setState({starting:!1,finished:!1,selected:this.mainScriptId,script:this.scripts[t.scriptId],tabs:n,currentFrame:0,started:!0,paused:!0,location:e.getLocation(t.context),context:t.context},()=>this.reinitBreakpoints(()=>{this.readCurrentScope(),this.readExpressions()}))}else if(t.cmd===`paused`){var i;let n=`${Date.now()}.${Math.random()*1e4}`;(i=t.context)==null||(i=i.callFrames)==null||i.forEach((e,t)=>e.id=n+t);let r=e.getLocation(t.context),a=JSON.parse(JSON.stringify(this.state.tabs)),o=t.context.callFrames[0].url.split(`iobroker.javascript`);r&&(a[r.scriptId]=(o[1]||o[0]).replace(`script.js.`,``));let s={tabs:a,paused:!0,location:r,currentFrame:0,context:t.context};s.script=!(r!=null&&r.scriptId)||this.scripts[r.scriptId]===void 0?w.t(`loading...`):this.scripts[r.scriptId],s.selected=r==null?void 0:r.scriptId,this.setState(s,()=>{this.readCurrentScope(),this.readExpressions(),r!=null&&r.scriptId&&(this.scripts[r.scriptId]||this.sendToInstance({cmd:`source`,scriptId:r.scriptId}))})}else if(t.cmd===`script`)this.scripts[t.scriptId]=t.text,this.state.selected===t.scriptId&&this.setState({script:this.scripts[t.scriptId]});else if(t.cmd===`resumed`)this.setState({paused:!1});else if(t.cmd===`log`){if(this.state.toolsTab===`console`){this.console=null;let e=[...this.state.console];e.push({text:t.text,severity:t.severity,ts:t.ts}),this.setState({console:e})}else t.severity===`error`?this.setState({logErrors:this.state.logErrors+1}):t.severity===`warn`?this.setState({logWarnings:this.state.logWarnings+1}):this.setState({logs:this.state.logs+1}),this.console=this.console||[...this.state.console],this.console.push({text:t.text,severity:t.severity,ts:t.ts})}else if(t.cmd===`error`)this.setState({error:t.error});else if(t.cmd===`finished`||t.cmd===`debugStopped`)this.setState({finished:!0,starting:!1,started:!0});else if(t.cmd===`sb`){let e=JSON.parse(JSON.stringify(this.state.breakpoints)),n=!1;t.breakpoints.filter(e=>e).forEach(t=>{e.find(e=>e.location.scriptId===t.location.scriptId&&e.location.lineNumber===t.location.lineNumber)||(n=!0,e.push(t))}),n&&window.localStorage.setItem(`javascript.tools.bp.${this.props.src}`,JSON.stringify(e)),n&&this.setState({breakpoints:e})}else if(t.cmd===`cb`){let e=JSON.parse(JSON.stringify(this.state.breakpoints)),n=!1;t.breakpoints.filter(e=>e!=null).forEach(t=>{let r=e.find(e=>e.id===t);if(r){let t=e.indexOf(r);e.splice(t,1),n=!0}}),n&&window.localStorage.setItem(`javascript.tools.bp.${this.props.src}`,JSON.stringify(e)),n&&this.setState({breakpoints:e})}else if(t.cmd===`scope`){let e=t.scopes.find(e=>e.type===`local`)||void 0,n=t.scopes.find(e=>e.type===`closure`)||void 0;console.log(JSON.stringify(n)),this.setState({scopes:{local:e,closure:n}})}else if(t.cmd===`setValue`){let e=JSON.parse(JSON.stringify(this.state.scopes)),n;if(t.scopeNumber===0){var a;n=e==null||(a=e.local)==null||(a=a.properties)==null?void 0:a.result.find(e=>e.name===t.variableName)}else{var o;n=e==null||(o=e.closure)==null||(o=o.properties)==null?void 0:o.result.find(e=>e.name===t.variableName)}n&&(n.value.value=t.newValue.value,this.setState({scopes:e}))}else if(t.cmd===`expressions`){let e=JSON.parse(JSON.stringify(this.state.expressions)),n=!1;t.expressions.forEach(t=>{let r=e.find(e=>e.name===t.name);r&&(n=!0,r.value=t.result)}),n&&this.setState({expressions:e}),console.log(`expressions: ${JSON.stringify(t)}`)}else if(t.cmd===`getPossibleBreakpoints`){var s,c;((s=t.breakpoints)==null?void 0:s.length)===1?this.sendToInstance({breakpoints:t.breakpoints,cmd:`sb`}):(c=t.breakpoints)!=null&&c.length?this.setState({queryBreakpoints:t.breakpoints}):window.alert(`cannot set`)}else console.error(`Unknown command: ${JSON.stringify(t)}`)}catch{}});let n=window.localStorage.getItem(`javascript.tools.bp.${this.props.src}`),r;try{r=n?JSON.parse(n):[]}catch{r=[]}let i=window.localStorage.getItem(`javascript.tools.exps.${this.props.src}`),a;try{a=(i?JSON.parse(i):[]).map(e=>({name:e,value:{type:`undefined`,description:``,value:`undefined`,name:`name`}}))}catch{a=[]}let o=window.localStorage.getItem(`JS.toolSizes`),s=[80,20];if(o)try{s=JSON.parse(o)}catch{}this.state={starting:!0,selected:null,tabs:{},script:``,breakpoints:r,expressions:a,running:!1,error:``,started:!1,paused:!0,location:null,toolsTab:window.localStorage.getItem(`javascript.tools.tab`)||`console`,stopOnException:window.localStorage.getItem(`javascript.tools.stopOnException`)===`true`,console:[],finished:!1,currentFrame:0,scopes:{},queryBreakpoints:null,logErrors:0,logWarnings:0,logs:0,toolSizes:s,instance:void 0,context:null}}async componentDidMount(){let e;if(this.props.debugInstance)e=this.props.debugInstance.instance;else{var t;let n=await this.props.socket.getObject(this.props.src);e=(n==null||(t=n.common)==null||(t=t.engine)==null?void 0:t.replace(`system.adapter.`,``))||``}this.setState({instance:e},()=>{this.state.instance?(this.props.socket.setState(`${this.state.instance}.debug.from`,{val:`{"cmd": "subscribed"}`,ack:!0}),setTimeout(()=>this.props.socket.subscribeState(`${this.state.instance}.debug.from`,this.fromInstance),200)):this.setState({error:`Unknown instance`})})}componentWillUnmount(){this.state.instance&&(this.props.socket.unsubscribeState(`${this.state.instance}.debug.from`,this.fromInstance),this.props.socket.sendTo(this.state.instance,`debugStop`))}sendToInstance(e){this.props.socket.setState(`${this.state.instance}.debug.to`,{val:JSON.stringify(e),ack:!1})}reinitBreakpoints(e){if(this.state.breakpoints.length){let t=JSON.parse(JSON.stringify(this.state.breakpoints)).map(e=>e.location);this.setState({breakpoints:[]},()=>{this.sendToInstance({breakpoints:t,cmd:`sb`}),this.state.stopOnException&&this.sendToInstance({cmd:`stopOnException`,state:!0}),e&&e()})}else this.state.stopOnException&&this.sendToInstance({cmd:`stopOnException`,state:!0}),e&&e()}static getLocation(e){return e.callFrames?e.callFrames[0].location:null}readCurrentScope(){var e;let t=((e=this.state.context)==null?void 0:e.callFrames)&&this.state.context.callFrames[this.state.currentFrame];if(t){let e=t.scopeChain.filter(e=>e.type!==`global`);e.length?this.sendToInstance({cmd:`scope`,scopes:e}):(this.state.scopes.global||this.state.scopes.local||this.state.scopes.closure)&&this.setState({scopes:{}})}}readExpressions(e){var t;this.state.expressions.length&&(t=this.state.context)!=null&&t.callFrames&&this.state.context.callFrames[this.state.currentFrame]&&(e===void 0?this.sendToInstance({cmd:`expressions`,expressions:this.state.expressions,callFrameId:this.state.context.callFrames[this.state.currentFrame].callFrameId}):this.sendToInstance({cmd:`expressions`,expressions:[this.state.expressions[e]],callFrameId:this.state.context.callFrames[this.state.currentFrame].callFrameId}))}getTextAtLocation(e){let t=this.state.script.split(/\r\n|\n/)[e.lineNumber],n;return e.columnNumber!==void 0&&e.columnNumber>=10?(t=t.substring(e.columnNumber-10,e.columnNumber+20),n=`${``.padStart(10,` `)}↑`):e.columnNumber!==void 0&&(t=t.substring(0,30-e.columnNumber),n=`${``.padStart(e.columnNumber,` `)}↑`),[d(`div`,{style:Y.monospace,children:t},`line`),d(`div`,{style:{...Y.monospace,...Y.arrow},children:n},`arrow`)]}renderQueryBreakpoints(){return this.state.queryBreakpoints?S(C,{onClose:()=>this.setState({queryBreakpoints:null}),"aria-labelledby":`bp-dialog-title`,open:!0,children:[d(O,{id:`bp-dialog-title`,children:w.t(`Select breakpoint`)}),d(te,{children:this.state.queryBreakpoints.map((e,t)=>d(I,{style:Y.bpListItem,dense:!0,onClick:()=>{this.sendToInstance({breakpoints:[e],cmd:`sb`}),this.setState({queryBreakpoints:null})},children:d(a,{primary:this.getTextAtLocation(e)})},t))})]}):null}renderError(){return this.state.error?d(L,{onClose:()=>this.setState({error:``}),text:this.state.error},`dialogError`):null}closeTab(e,t){t==null||t.stopPropagation();let n=JSON.parse(JSON.stringify(this.state.tabs));delete n[e];let r={tabs:n,script:this.mainScriptId?this.scripts[this.mainScriptId]:`...`,selected:this.mainScriptId};this.state.location&&this.state.location.scriptId!==this.mainScriptId&&(r.location=null),this.setState(r)}renderTabs(){let e=!this.state.tabs||!this.state.started;return d(c,{component:`div`,indicatorColor:`primary`,style:{position:`relative`,width:`calc(100% - 300px)`,display:`inline-block`},value:this.state.selected,onChange:(e,t)=>{this.scripts[t]?this.setState({selected:t,script:this.scripts[t]}):this.setState({selected:t,script:`loading...`},()=>this.sendToInstance({cmd:`source`,scriptId:t}))},scrollButtons:`auto`,children:Object.keys(this.state.tabs||[]).map(t=>{let n=t,r=this.state.tabs[t]||``;this.state.tabs[t]&&(n=this.state.tabs[t].split(`/`).pop()||``);let i=[d(`div`,{style:Y.tabText,children:n},`text`),t===this.mainScriptId?null:d(`span`,{style:Y.closeButton,children:d(m,{onClick:e=>this.closeTab(t,e),fontSize:`small`},`close`)},`icon`)];return d(h,{disabled:e,sx:Y.tabFile,label:i,title:r,value:t},t)})})}onResume(){this.sendToInstance({cmd:`cont`})}onPause(){this.sendToInstance({cmd:`pause`})}onNext(){this.sendToInstance({cmd:`next`})}onStepIn(){this.sendToInstance({cmd:`step`})}onStepOut(){this.sendToInstance({cmd:`out`})}onRestart(){this.setState({started:!1,starting:!0},()=>this.state.instance!==void 0&&this.props.socket.sendTo(this.state.instance,`debug`,this.props.debugInstance||{scriptName:this.props.src}))}onToggleException(){let e=!this.state.stopOnException;window.localStorage.setItem(`javascript.tools.stopOnException`,e?`true`:`false`),this.setState({stopOnException:e},()=>this.sendToInstance({cmd:`stopOnException`,state:e}))}renderToolbar(){let e=!this.state.started;return S(g,{variant:`dense`,style:Y.toolbar,children:[d(A,{style:Y.buttonRestart,disabled:e,onClick:()=>this.onRestart(),title:w.t(`Restart`),size:`medium`,children:d(ee,{})}),!this.state.finished&&this.state.paused?d(A,{style:Y.buttonRun,disabled:e,onClick:()=>this.onResume(),title:w.t(`Resume execution`),size:`medium`,children:d(b,{})}):!this.state.finished&&d(A,{disabled:e,style:Y.buttonPause,onClick:()=>this.onPause(),title:w.t(`Pause execution`),size:`medium`,children:d(v,{})}),!this.state.finished&&d(A,{style:Y.buttonNext,disabled:e||!this.state.paused,onClick:()=>this.onNext(),title:w.t(`Go to next line`),size:`medium`,children:d(N,{})}),!this.state.finished&&d(A,{style:Y.buttonStep,disabled:e||!this.state.paused,onClick:()=>this.onStepIn(),title:w.t(`Step into function`),size:`medium`,children:d(i,{})}),!this.state.finished&&d(A,{style:Y.buttonOut,disabled:e||!this.state.paused,onClick:()=>this.onStepOut(),title:w.t(`Step out from function`),size:`medium`,children:d(_,{})}),!this.state.finished&&d(A,{style:Y.buttonException,color:this.state.stopOnException?`primary`:`default`,disabled:e||!this.state.paused,onClick:()=>this.onToggleException(),title:w.t(`Stop on exception`),size:`medium`,children:d(r,{})}),this.renderTabs()]},`toolbar1`)}getPossibleBreakpoints(e){let t={...e,columnNumber:1e3};this.sendToInstance({cmd:`getPossibleBreakpoints`,start:e,end:t})}toggleBreakpoint(e){let t=this.state.breakpoints.find(t=>t.location.scriptId===this.state.selected&&t.location.lineNumber===e);if(t){let e=JSON.parse(JSON.stringify(this.state.breakpoints));this.setState({breakpoints:e},()=>this.sendToInstance({breakpoints:[t.id],cmd:`cb`}))}else this.getPossibleBreakpoints({scriptId:this.state.selected,lineNumber:e,columnNumber:0})}renderCode(){if(this.state.script&&this.state.started){let e=this.state.breakpoints.filter(e=>e.location.scriptId===this.state.selected);return d(H,{runningInstances:this.props.runningInstances,socket:this.props.socket,adapterName:this.props.adapterName,scriptName:this.state.selected?this.state.tabs[this.state.selected]:``,sourceId:this.state.selected,script:this.state.script,paused:this.state.paused,breakpoints:e,location:this.state.location,themeType:this.props.themeType,themeName:this.props.themeName,onToggleBreakpoint:e=>this.toggleBreakpoint(e)})}return null}renderFrames(){var e;return this.state.paused?d(J,{currentScriptId:this.state.selected,scopes:this.state.scopes,expressions:this.state.expressions,themeType:this.props.themeType,callFrames:(e=this.state.context)==null?void 0:e.callFrames,currentFrame:this.state.currentFrame,onChangeCurrentFrame:e=>{this.setState({currentFrame:e,scopes:{}},()=>{this.readCurrentScope(),this.readExpressions()})},onWriteScopeValue:e=>{this.sendToInstance({cmd:`setValue`,variableName:e.variableName,scopeNumber:e.scopeNumber,newValue:e.newValue,callFrameId:e.callFrameId})},onExpressionDelete:e=>{let t=JSON.parse(JSON.stringify(this.state.expressions));t.splice(e,1),this.setState({expressions:t}),window.localStorage.setItem(`javascript.tools.exps.${this.props.src}`,JSON.stringify(t.map(e=>e.name)))},onExpressionAdd:e=>{let t=JSON.parse(JSON.stringify(this.state.expressions));t.push({name:``,value:{value:``}}),this.setState({expressions:t},()=>e&&e(t.length-1,this.state.expressions[t.length-1]))},onExpressionNameUpdate:(e,t,n)=>{let r=JSON.parse(JSON.stringify(this.state.expressions));if(!t)r.splice(e,1);else if(r.find(e=>e.name===t))return n&&n();else r[e].name=t;this.setState({expressions:r},()=>{t&&this.readExpressions(e),n&&n()}),window.localStorage.setItem(`javascript.tools.exps.${this.props.src}`,JSON.stringify(r.map(e=>e.name)))}}):null}renderConsole(){return d(re,{console:this.state.console,onClearAllLogs:()=>this.setState({console:[],logErrors:0,logWarnings:0,logs:0})})}renderTools(){let e=!this.state.tabs||!this.state.started,t;return t=this.state.logErrors?d(u,{badgeContent:this.state.logErrors,color:`error`,children:d(`span`,{children:w.t(`Console`)})}):this.state.logWarnings?d(u,{badgeContent:this.state.logWarnings,color:`secondary`,children:d(`span`,{children:w.t(`Console`)})}):this.state.logs?d(u,{badgeContent:this.state.logs,color:`default`,children:d(`span`,{children:w.t(`Console`)})}):w.t(`Console`),S(`div`,{style:{width:`100%`,height:`100%`,overflow:`hidden`},children:[S(c,{sx:Y.tabsRoot,component:`div`,indicatorColor:`primary`,style:{position:`relative`,width:`100%`},value:this.state.toolsTab,onChange:(e,t)=>{let n={toolsTab:t};this.console&&t===`console`&&(n.console=this.console,this.console=null,n.logs=0,n.logWarnings=0,n.logErrors=0),window.localStorage.setItem(`javascript.tools.tab`,t),this.setState(n)},scrollButtons:`auto`,children:[d(h,{style:Y.tabRoot,disabled:e,label:w.t(`Stack`),value:`stack`}),d(h,{style:Y.tabRoot,disabled:e,label:t,value:`console`})]}),S(`div`,{style:{width:`100%`,height:`calc(100% - 36px)`,overflow:`hidden`},children:[this.state.toolsTab===`stack`&&!e?this.renderFrames():null,this.state.toolsTab===`console`&&!e?this.renderConsole():null]})]})}render(){return S(y,{sx:Y.root,children:[this.state.starting?d(M,{}):null,this.renderToolbar(),S(z,{direction:R.Vertical,initialSizes:this.state.toolSizes,minHeights:[100,100],onResizeFinished:(e,t)=>{this.setState({toolSizes:t}),window.localStorage.setItem(`JS.toolSizes`,JSON.stringify(t))},gutterClassName:this.props.themeType===`dark`?`Dark visGutter`:`Light visGutter`,children:[S(`div`,{style:{width:`100%`,height:`100%`,overflow:`hidden`},children:[this.renderCode(),this.renderQueryBreakpoints()]}),d(`div`,{style:{width:`100%`,height:`100%`,overflow:`hidden`},children:this.renderTools()})]}),this.renderError()]},`debugger`)}};export{X as default}; \ No newline at end of file diff --git a/admin/assets/RulesEditor-DwJ0UTnU.js b/admin/assets/RulesEditor-DwJ0UTnU.js new file mode 100644 index 00000000..168c7f1d --- /dev/null +++ b/admin/assets/RulesEditor-DwJ0UTnU.js @@ -0,0 +1 @@ +import{En as e,Et as t,Fn as n,Ft as r,Jn as i,Ot as a,Qt as o,Rn as s,St as c,Tt as l,Ut as u,Yn as d,_r as f,br as p,bt as m,dt as h,en as g,f as _,fr as v,g as y,hr as b,in as x,kn as S,mn as C,mr as w,nn as T,pr as E,rn as D,tn as O,ur as k,wn as A,wr as j,wt as M,yr as N}from"./_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js";import{n as P,t as ee}from"./Import-BH2X_ziv.js";import{_ as te,a as F,g as I,h as L,i as R,n as z,o as B,r as ne,t as V,v as H,x as U,y as W}from"./index-2X_5uU-_.js";var re=s(i(`path`,{d:`M7.5 5.6 10 7 8.6 4.5 10 2 7.5 3.4 5 2l1.4 2.5L5 7zm12 9.8L17 14l1.4 2.5L17 19l2.5-1.4L22 19l-1.4-2.5L22 14zM22 2l-2.5 1.4L17 2l1.4 2.5L17 7l2.5-1.4L22 7l-1.4-2.5zm-7.63 5.29a.996.996 0 0 0-1.41 0L1.29 18.96c-.39.39-.39 1.02 0 1.41l2.34 2.34c.39.39 1.02.39 1.41 0L16.7 11.05c.39-.39.39-1.02 0-1.41zm-1.03 5.49-2.12-2.12 2.44-2.44 2.12 2.12z`}),`AutoFixHigh`),ie=s(i(`path`,{d:`M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z`}),`ChevronLeft`),ae=s(i(`path`,{d:`M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z`}),`ChevronRight`),oe=s(i(`path`,{d:`M16 9v10H8V9zm-1.5-6h-5l-1 1H5v2h14V4h-3.5zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2z`}),`DeleteOutlined`),se=s(i(`path`,{d:`M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z`}),`NavigateBefore`);j();function ce(e){let t=H().getMonitor(),[n,r]=W(t,e);return w(()=>t.subscribeToOffsetChange(r)),w(()=>t.subscribeToStateChange(r)),n}var G;function le(){return G||(G=new Image,G.src=`data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==`),G}var K={wrapperRules:`_wrapperRules_147jt_8`,rootWrapper:`_rootWrapper_147jt_14`,bands:`_bands_147jt_26`,emptyRule:`_emptyRule_147jt_39`,emptyRuleText:`_emptyRuleText_147jt_51`},ue={switchesItem:`_switchesItem_10ls3_1`,switchesItemActive:`_switchesItemActive_10ls3_28`,iconTheme:`_iconTheme_10ls3_36`};j();var de=({name:e,id:t,active:n,icon:r,adapter:a,socket:o,onDoubleClick:s,title:c,onTouchMove:l,style:u})=>d(`div`,{onDoubleClick:s,onTouchMove:l,title:c?_.t(c):void 0,className:y.clsx(ue.switchesItem,n&&ue.switchesItemActive,`block-${t}`),children:[i(F,{iconName:r,className:ue.iconTheme,adapter:a,socket:o,style:u}),i(`span`,{children:e?_.t(e):``})]},t),q={cardStyle:`_cardStyle_vibq0_1`,railTriggers:`_railTriggers_vibq0_25`,railConditions:`_railConditions_vibq0_29`,railActions:`_railActions_vibq0_33`,cardStyleActive:`_cardStyleActive_vibq0_37`,controlMenu:`_controlMenu_vibq0_42`,closeBtn:`_closeBtn_vibq0_60`,isDelete:`_isDelete_vibq0_102`,drag_mobile:`_drag_mobile_vibq0_121`};function J(e,t,n){let r;switch(e){case`actions`:if(n===`else`)return r={...t,actions:{...t[e],else:[...t[e].else]}},r;if(n===`then`)return r={...t,actions:{...t[e],then:[...t[e].then]}},r;throw console.error(`Unknown additionalParameter: ${n}`),Error(`Unknown additionalParameter: ${n}`);case`triggers`:return r={...t,triggers:[...t.triggers]},r;case`conditions`:return r={...t,conditions:[...t.conditions]},r;default:throw Error(`Unknown name: ${e}`)}}function Y(e,t,n,r){switch(e){case`actions`:return t.actions[n]=t.actions[n].filter(e=>e._id!==r),t;case`conditions`:var i;return t.conditions[n]=(i=t.conditions[n])==null?void 0:i.filter(e=>e._id!==r),t;default:return t.triggers=t.triggers.filter(e=>e._id!==r),t}}function fe(e,t,n){let{_id:r,acceptedBy:i}=e,a;if(!i||!t[i])return console.warn(`Cannot find ${i}`),t;switch(i){case`actions`:if(a=t.actions[n].find(e=>e._id===r),!a)console.warn(`Cannot find ${r}`);else{let r=t.actions[n].indexOf(a);t.actions[n][r]=e}return t;case`conditions`:if(a=t.conditions[n].find(e=>e._id===r),!a)console.warn(`Cannot find ${r}`);else{let r=t.conditions[n].indexOf(a);t.conditions[n][r]=e}return t;default:if(a=t.triggers.find(e=>e._id===r),!a)console.warn(`Cannot find ${r}`);else{let n=t.triggers.indexOf(a);t.triggers[n]=e}return t}}j();var pe={triggers:q.railTriggers,conditions:q.railConditions,actions:q.railActions},me=k(e=>{var t;let{setUserRules:n,userRules:r,_id:a,id:o,blockValue:s,active:c,acceptedBy:l,isTourOpen:u,setTourStep:m,tourStep:h}=e,{blocks:g,socket:_,onUpdate:y,setOnUpdate:b,onDebugMessage:x,enableSimulation:S}=E(V),C=v(e=>g==null?void 0:g.find(t=>t.getStaticData().id===e),[g]),w=v(e=>{let t=fe(e,r,s);t&&n(t)},[r]),T=f(()=>{let t=C(o)||R;return i(t,{...e,notFound:!C(o),isTourOpen:u,setTourStep:m,tourStep:h,onUpdate:y,setOnUpdate:b,enableSimulation:S,onDebugMessage:x,onChange:w,className:void 0,socket:_})},[r,y,x,S]),[D,O]=p(!1);return d(`div`,{onMouseDown:e=>{if(e.ctrlKey){let e,t=J(l,r,s);l===`conditions`?(e=t.conditions[s].find(e=>e._id===a),e&&t.conditions[s].splice(t.conditions[s].indexOf(e),0,{...e,_id:Date.now()})):l===`actions`?(e=t.actions[s].find(e=>e._id===a),e&&t.actions[s].splice(t.actions[s].indexOf(e),0,{...e,_id:Date.now()})):(e=t.triggers.find(e=>e._id===a),e&&t.triggers.splice(t[l].indexOf(e),0,{...e,_id:Date.now()})),n(t)}},id:`height`,style:c?{width:(((t=document.getElementById(`width`))==null?void 0:t.clientWidth)||0)-70}:void 0,className:[q.cardStyle,pe[l],c&&q.cardStyleActive,D&&q.isDelete].filter(Boolean).join(` `),children:[i(`div`,{className:q.drag_mobile}),T,n&&i(`div`,{className:q.controlMenu,children:i(`div`,{onClick:()=>{let e=J(l,r,s);e=Y(l,e,s,a),O(!0),setTimeout(()=>{l===`triggers`&&b(!0),n(e)},300)},className:q.closeBtn})})]})});j();var he={position:`fixed`,pointerEvents:`none`,zIndex:100,left:0,top:0,width:`100%`,height:`100%`},ge=(e,t)=>[Math.round(e/32)*32,Math.round(t/32)*32],_e=(e,t,n)=>{if(!e||!t)return{display:`none`};let{x:r,y:i}=t;n&&(r-=e.x,i-=e.y,[r,i]=ge(r,i),r+=e.x,i+=e.y);let a=`translate(${r}px, ${i}px)`;return{transform:a,WebkitTransform:a}},ve=e=>{let{itemType:t,isDragging:n,item:r,initialOffset:a,currentOffset:o,targetIds:s}=ce(e=>({item:e.getItem(),itemType:e.getItemType(),initialOffset:e.getInitialSourceClientOffset(),currentOffset:e.getSourceClientOffset(),isDragging:e.isDragging(),targetIds:e.getTargetIds()}));return n?i(`div`,{style:he,children:i(`div`,{style:_e(a,o),children:(()=>{switch(t){case`box`:return s.length?i(me,{active:!0,...r,allBlocks:e.allBlocks}):i(de,{active:!0,...r,socket:e.socket});default:return null}})()})}):null},X={emptyBlockStyle:`_emptyBlockStyle_p7qtf_1`,emptyBlock:`_emptyBlock_p7qtf_1`,marginTop:`_marginTop_p7qtf_1`,selectOnChange:`_selectOnChange_p7qtf_17`,selectOnChangeHelp:`_selectOnChangeHelp_p7qtf_23`,selectOnChangeHelpIcon:`_selectOnChangeHelpIcon_p7qtf_29`,emptyBlockNone:`_emptyBlockNone_p7qtf_44`,bandTriggers:`_bandTriggers_p7qtf_57`,bandConditions:`_bandConditions_p7qtf_61`,bandActions:`_bandActions_p7qtf_65`,mainBlockItemRules:`_mainBlockItemRules_p7qtf_69`,nameBlockItems:`_nameBlockItems_p7qtf_93`,contentBlockItem:`_contentBlockItem_p7qtf_119`,wrapperMargin:`_wrapperMargin_p7qtf_127`,contentHeightOn:`_contentHeightOn_p7qtf_134`,heightBlock:`_heightBlock_p7qtf_1`,contentHeightOff:`_contentHeightOff_p7qtf_146`,cardAdd:`_cardAdd_p7qtf_152`,blockCardAdd:`_blockCardAdd_p7qtf_172`};j();function ye(e,t){let[n,r]=p(window.localStorage.getItem(t)?JSON.parse(window.localStorage.getItem(t)||``):e);return[n,e=>{window.localStorage.setItem(t,JSON.stringify(e)),r(e)},!!window.localStorage.getItem(t)]}function be(e,t){let n=0,r=null,i;return function(...a){let o=Date.now();i=a,o-n>=t?(n=o,e.apply(this,a)):r||=setTimeout(()=>{n=Date.now(),r=null,e.apply(this,i)},t-(o-n))}}function xe(e){if(Array.isArray(e))return e.map(e=>xe(e));if(typeof e==`function`)return e.bind(null);if(e&&typeof e==`object`){let t={};return Object.keys(e).forEach(n=>{t[n]=xe(e[n])}),t}return e}var Se=be((e,t)=>e(t),0);function Ce(e,t){let n=t.find(t=>t._id===e);return{card:n,index:n?t.indexOf(n):-1}}function we(e,t,n,r,i,a,o,s,c){let{card:l,index:u}=Ce(e,n);if(!(ut&&s>c)&&l&&u!==t){let e=xe(n);e.splice(u,1),e.splice(t,0,l);let s=xe(i);switch(a){case`actions`:s.actions[o]=e,Se(r,s);return;case`conditions`:s.conditions[o]=e,Se(r,s);return;default:s.triggers=e,Se(r,s);return}}}var Te={drag:`_drag_7xfhc_1`,root:`_root_7xfhc_11`};j();var Ee=({typeBlock:e,allProperties:t,id:n,isActive:r,setUserRules:a,userRules:o,children:s,_id:c,blockValue:l})=>{let{setOnUpdate:u}=E(V),[{opacity:f},p,m]=te({type:`box`,item:()=>({...t,id:n,isActive:r,_id:c}),end:(e,t)=>{let{acceptedBy:n}=e,r=t.getDropResult(),i;if(!r)return typeof c==`number`&&!t.getTargetIds().length&&(i=J(n,o,l),i=Y(n,i,l,c),a(i)),null;if(r.blockValue!==l){let t=typeof c==`number`?c:Date.now();i=J(n,o,r.blockValue);let s={id:e.id,acceptedBy:e.acceptedBy};switch(n){case`actions`:return l&&(i=Y(`actions`,i,l,t)),i=Y(`actions`,i,r.blockValue,t),i.actions[r.blockValue].push({...s,_id:t}),a(i);case`conditions`:return typeof l==`number`&&(i=Y(`conditions`,i,l,t)),i=Y(`conditions`,i,r.blockValue,t),i.conditions[r.blockValue].push({...s,_id:t}),a(i);default:return u(!0),i=Y(`triggers`,i,r.blockValue,t),i.triggers.push({...s,_id:t}),a(i)}}},collect:e=>({opacity:e.isDragging()?.4:1,isDragging:e.isDragging()})}),h=N(null),[,g]=I({accept:`box`,canDrop:()=>!1,hover({_id:t,acceptedBy:n},r){var i;if(!h.current||e!==n)return;let s=(i=h.current)==null?void 0:i.getBoundingClientRect(),u=(s.bottom-s.top)/2,d=r.getClientOffset(),f=((d==null?void 0:d.y)||0)-s.top;if(c&&t!==c)switch(n){case`actions`:if(l===`then`||l===`else`){let{index:e}=Ce(c,o.actions[l]);e!==t&&we(t,e,o[n][l],a,o,n,l,f,u)}return;case`conditions`:if(typeof l==`number`){let{index:e}=Ce(c,o[n][l]);e!==t&&we(t,e,o[n][l],a,o,n,l,f,u)}return;default:{let{index:e}=Ce(c,o[n]);e!==t&&we(t,e,o[n],a,o,n,void 0,f,u);return}}}});w(()=>{m(le(),{captureDraggingState:!0})},[]),p(g(h));let _=window.innerWidth<600;return d(`div`,{ref:_&&c?null:h,className:Te.root,style:{opacity:f},children:[i(`div`,{className:c?Te.drag:null,ref:c&&_?h:null}),s]})};j();var De=({onClose:e,open:t})=>d(g,{open:t,onClose:e,"aria-labelledby":`alert-dialog-title`,"aria-describedby":`alert-dialog-description`,children:[i(T,{children:d(`div`,{style:{fontSize:`1rem`,fontFamily:`"Roboto", "Helvetica", "Arial", sans-serif`,fontWeight:400,lineHeight:1.5,letterSpacing:`0.00938em`},children:[i(`h3`,{children:_.t(`On condition change`)}),i(`div`,{children:_.t(`help_on_change`)}),i(`h3`,{children:_.t(`Just check`)}),i(`div`,{children:_.t(`help_just_check`)})]})}),i(O,{children:i(u,{onClick:e,color:`primary`,autoFocus:!0,startIcon:i(c,{}),children:_.t(`OK`)})})]});j();var Oe=({onClose:e,open:t})=>d(g,{open:t,onClose:e,"aria-labelledby":`alert-dialog-title`,"aria-describedby":`alert-dialog-description`,children:[i(T,{children:d(D,{id:`alert-dialog-description`,children:[i(`h3`,{children:_.t(`On condition change`)}),i(`div`,{children:_.t(`help_on_change`)}),i(`h3`,{children:_.t(`Just check`)}),i(`div`,{children:_.t(`help_just_check`)})]})}),i(O,{children:i(u,{onClick:e,color:`primary`,autoFocus:!0,children:_.t(`OK`)})})]});j();var ke={triggers:X.bandTriggers,conditions:X.bandConditions,actions:X.bandActions},Ae=({blockValue:e,boolean:t,typeBlock:n,userRules:r,setUserRules:a,animation:o,setTourStep:s,tourStep:c,isTourOpen:l,theme:u,themeType:f,themeName:m})=>{var h;let[g,_]=p(!1),[v,b]=p(!1),[x,S]=p(!1),[C,T]=p(``);t===void 0&&(t=!0);let E=I({accept:`box`,drop:()=>({blockValue:e}),hover:({acceptedBy:e,_id:t},r)=>{_(e===n),S(!!t),T(r.getHandlerId()||``)},canDrop:({acceptedBy:e})=>(b(e===n),e===n),collect:e=>{var t;return{isOver:e.isOver(),canDrop:((t=e.getItem())==null?void 0:t.acceptedBy)===n,offset:e.getClientOffset(),targetId:e.getHandlerId()}}}),{canDrop:D,isOver:O,offset:k,targetId:A}=E[0],j=E[1];w(()=>{T(``)},[k]);let M=D&&O,N=``;M?N=g?`#00fb003d`:`#fb00002e`:D?N=v?`#00fb003d`:`#fb00002e`:k&&(N=A===C?`#fb00002e`:``);let P;return P=n===`actions`?r.actions[e]:n===`conditions`?r.conditions[e]:r.triggers,i(`div`,{ref:e=>{j(e)},style:{backgroundColor:N},className:y.clsx(X.contentBlockItem,t?o&&X.contentHeightOn:X.contentHeightOff),children:d(`div`,{className:X.wrapperMargin,children:[P.map(t=>i(Ee,{typeBlock:n,...t,blockValue:e,allProperties:t,userRules:r,setUserRules:a,children:i(me,{...t,isTourOpen:l,setTourStep:s,tourStep:c,settings:t,blockValue:e,userRules:r,setUserRules:a,theme:u,themeType:f,themeName:m})},t._id)),i(`div`,{style:M&&g&&!x?{height:((h=document.getElementById(`height`))==null?void 0:h.clientHeight)||200}:void 0,className:`${X.emptyBlockStyle} ${M&&g&&!x?X.emptyBlock:X.emptyBlockNone}`})]})})},je=({typeBlock:t,name:n,nameAdditionally:r,additionally:a,userRules:o,setUserRules:s,iconName:c,adapter:l,socket:u,setTourStep:f,tourStep:m,isTourOpen:h,theme:g,themeType:v,themeName:y})=>{let[x,T,E]=ye(t!==`actions`&&[],`additionallyClickItems_${t}`),[D,O]=p(!1),[k,A]=p(!1);w(()=>{if(t===`conditions`&&(x==null?void 0:x.length)!==o.conditions.length-1){let e=[];o.conditions.forEach((t,n)=>{n>0&&e.push({_id:Date.now(),open:!0})}),T([...x,...e])}t===`actions`&&!E&&o.actions.else.length&&T(!0)},[]);let[j,M]=p(!1);return d(`div`,{className:`${X.mainBlockItemRules} ${ke[t]}`,children:[d(`span`,{id:`width`,className:X.nameBlockItems,children:[i(F,{iconName:c,className:X.iconThemCard,adapter:l,socket:u}),n]}),t===`conditions`?d(`div`,{style:{width:`100%`},children:[d(S,{variant:`standard`,className:X.selectOnChange,value:o.justCheck||!1,onChange:e=>{let t=J(`conditions`,o);t.justCheck=e.target.value===`true`,s(t)},children:[i(e,{value:`false`,children:_.t(`on condition change`)}),i(e,{value:`true`,children:_.t(`just check`)})]}),i(C,{size:`small`,title:_.t(`Explanation`),className:X.selectOnChangeHelp,onClick:()=>O(!0),children:i(U,{className:X.selectOnChangeHelpIcon})})]}):null,i(Ae,{setTourStep:f,tourStep:m,isTourOpen:h,blockValue:t===`actions`?`then`:t===`conditions`?0:t,typeBlock:t,setUserRules:s,userRules:o,theme:g,themeName:y,themeType:v}),a&&[...Array(t===`actions`?1:o.conditions.length-1)].map((e,n)=>{let a=(e=n)=>t===`actions`?!!x:!!x.find((t,n)=>n===e&&t.open);return d(b,{children:[d(`div`,{onClick:()=>{if(t===`actions`)return T(!x),null;let e=JSON.parse(JSON.stringify(x));if(o.conditions[n+1].length)return e[n].open=!e[n].open,T(e),null;e=e.filter((e,t)=>t!==n),T(e),M(n),setTimeout(()=>{M(!1),s({...o,conditions:[...o.conditions.filter((e,t)=>t!==n+1)]})},250)},className:X.blockCardAdd,children:[a()?`-`:`+`,i(`div`,{className:X.cardAdd,children:r})]},n),i(Ae,{blockValue:t===`actions`?`else`:t===`conditions`?n+1:t,typeBlock:t,setUserRules:s,userRules:o,boolean:a(),animation:j===n,theme:g,themeName:y,themeType:v})]},`${n}_block_${t}`)}),a&&t===`conditions`&&d(`div`,{onClick:()=>{T([...x,{_id:Date.now(),open:!0}]),s({...o,conditions:[...o.conditions,[]]}),M(o.conditions.length-1),setTimeout(()=>M(!1),1e3)},className:X.blockCardAdd,children:[`+`,i(`div`,{className:X.cardAdd,children:r})]}),i(De,{open:D,onClose:()=>O(!1)}),i(Oe,{open:k,onClose:()=>A(!1)})]})},Z={menuRules:`_menuRules_1b2q2_1`,wizardButton:`_wizardButton_1b2q2_13`,switchesRenderWrapper:`_switchesRenderWrapper_1b2q2_21`,menuOff:`_menuOff_1b2q2_30`,menuTitle:`_menuTitle_1b2q2_36`,marginAuto:`_marginAuto_1b2q2_50`,inputWidth:`_inputWidth_1b2q2_55`,menuWrapper:`_menuWrapper_1b2q2_60`,hamburgerWrapper:`_hamburgerWrapper_1b2q2_68`,hamburgerOff:`_hamburgerOff_1b2q2_96`,nothingFound:`_nothingFound_1b2q2_104`,resetSearch:`_resetSearch_1b2q2_111`,controlPanel:`_controlPanel_1b2q2_123`,controlPanelAppBar:`_controlPanelAppBar_1b2q2_134`,addClassMenu:`_addClassMenu_1b2q2_148`,addClassBackground:`_addClassBackground_1b2q2_154`,addClassPosition:`_addClassPosition_1b2q2_158`};j();var Me=e=>{let{allProperties:t,allProperties:{acceptedBy:n,id:r},setUserRules:a,userRules:o,setTourStep:s,tourStep:c,isTourOpen:l,onTouchMove:u,isActive:d}=e;return i(Ee,{allProperties:t,id:t.id,isActive:d,setUserRules:a,userRules:o,children:i(de,{onDoubleClick:()=>{l&&c===L.addScheduleByDoubleClick&&r===`TriggerScheduleBlock`&&s(L.openTagsMenu),l&&c===L.addActionPrintText&&r===`ActionPrintText`&&s(L.showJavascript);let e=Date.now(),t;switch(n){case`actions`:t=`then`;break;case`conditions`:t=o[n].length-1}let i=J(n,o,t),u={id:r,_id:e,acceptedBy:n};t===void 0?i.triggers.push({...u}):n===`actions`?i.actions[t].push({...u}):n===`conditions`&&i.conditions[t].push({...u}),a(i)},...e,...t,onTouchMove:u})})};j();var Ne=({addClass:e,setAllBlocks:t,allBlocks:n,userRules:s,onChangeBlocks:c,setTourStep:l,tourStep:f,isTourOpen:p,onStartWizard:m})=>{let{blocks:h,socket:g}=E(V),[v,x]=ye(!1,`hamburgerOnOff`),[S,C]=ye({text:``,type:`triggers`,index:0},`filterControlPanel`),T=(e=S.text,n=S.type)=>{if(!h)return;let r=[...h];r=r.filter(t=>{if(!e)return!0;let{name:n}=t.getStaticData();return n&&_.t(n).toLowerCase().includes(e.toLowerCase())}),r=r.filter(e=>n===e.getStaticData().acceptedBy),t(r)},D=(e,t)=>{p&&t===0&&f===L.selectTriggers&&l(L.addScheduleByDoubleClick),p&&t===2&&f===L.selectActions&&l(L.addActionPrintText),C({...S,index:t,type:[`triggers`,`conditions`,`actions`][t]}),T(S.text,[`triggers`,`conditions`,`actions`][t])},O=e=>({id:`scrollable-force-tab-${e}`,"aria-controls":`scrollable-force-tabpanel-${e}`});return w(()=>{T()},[h]),i(o,{mouseEvent:!1,touchEvent:`onTouchStart`,onClickAway:()=>x(!0),children:d(`div`,{className:y.clsx(Z.menuWrapper,e[1035]&&Z.addClassMenu),children:[i(`div`,{className:`${Z.hamburgerWrapper} ${v?Z.hamburgerOff:null}`,onClick:()=>x(!v),children:i(v?ae:ie,{})}),d(`div`,{className:`${y.clsx(Z.menuRules,e[1035]&&Z.addClassBackground,e[835]&&Z.addClassPosition)} ${v?Z.menuOff:null}`,children:[i(u,{className:Z.wizardButton,fullWidth:!0,size:`small`,variant:`outlined`,startIcon:i(re,{}),onClick:m,children:_.t(`Wizard`)}),i(`div`,{className:Z.controlPanel,children:i(A,{className:Z.controlPanelAppBar,position:`static`,children:d(r,{value:S.index,onChange:D,children:[i(a,{className:`blocks-triggers`,title:_.t(`Triggers`),icon:i(F,{iconName:`FlashOn`}),...O(0)}),i(a,{title:_.t(`Conditions`),className:`blocks-conditions`,icon:i(F,{iconName:`Help`}),...O(1)}),i(a,{title:_.t(`Actions`),className:`blocks-actions`,icon:i(F,{iconName:`PlayForWork`}),...O(2)})]})})}),i(`div`,{className:Z.switchesRenderWrapper,children:d(`span`,{children:[n.map(e=>{let{name:t,id:n,icon:r,adapter:a}=e.getStaticData();return i(b,{children:i(Me,{adapter:a,allProperties:e.getStaticData(),icon:r,id:n,isActive:!1,isTourOpen:p,name:t,onTouchMove:()=>x(!0),setTourStep:l,setUserRules:c,socket:g,tourStep:f,userRules:s})},n)}),!n.length&&d(`div`,{className:Z.nothingFound,children:[_.t(`Nothing found`),`...`,i(`div`,{className:Z.resetSearch,onClick:()=>{C({...S,text:``}),T(``)},children:_.t(`reset search`)})]})]})}),i(`div`,{className:y.clsx(Z.menuTitle,Z.marginAuto)}),i(B,{className:Z.inputWidth,fullWidth:!0,customValue:!0,value:S.text,size:`small`,autoComplete:`off`,label:_.t(`search`),variant:`outlined`,onChange:e=>{C({...S,text:e}),T(e)}})]})]})})},Q={bandTriggers:`_bandTriggers_91vrz_5`,bandConditions:`_bandConditions_91vrz_9`,bandActions:`_bandActions_91vrz_13`,paper:`_paper_91vrz_17`,title:`_title_91vrz_22`,close:`_close_91vrz_29`,content:`_content_91vrz_35`,stepper:`_stepper_91vrz_40`,step:`_step_91vrz_40`,hint:`_hint_91vrz_56`,warning:`_warning_91vrz_61`,blockCard:`_blockCard_91vrz_68`,blockBody:`_blockBody_91vrz_79`,remove:`_remove_91vrz_86`,notFound:`_notFound_91vrz_93`,chooser:`_chooser_91vrz_99`,choice:`_choice_91vrz_105`,choiceIcon:`_choiceIcon_91vrz_128`,choiceName:`_choiceName_91vrz_136`,addMore:`_addMore_91vrz_144`,summaryBand:`_summaryBand_91vrz_150`,summaryLabel:`_summaryLabel_91vrz_156`,preview:`_preview_91vrz_164`,actions:`_actions_91vrz_169`,spacer:`_spacer_91vrz_173`};j();var $=[`triggers`,`conditions`,`actions`],Pe={triggers:`Triggers`,conditions:`Conditions`,actions:`Actions`},Fe={triggers:`What should start the rule?`,conditions:`When should the rule run? This step is optional.`,actions:`What should happen?`},Ie={triggers:`when`,conditions:`and`,actions:`then`},Le={triggers:Q.bandTriggers,conditions:Q.bandConditions,actions:Q.bandActions},Re=()=>({triggers:[],conditions:[],actions:[]}),ze=({onCreate:e,onClose:r,hasRule:a,socket:o,theme:s,themeType:c,themeName:v})=>{let{blocks:b}=E(V),[S,w]=p(0),[D,k]=p(Re),[A,j]=p(null),P=N(0),ee=f(()=>{let e={triggers:[],conditions:[],actions:[]};return b==null||b.forEach(t=>{var n;let{acceptedBy:r}=t.getStaticData();(n=e[r])==null||n.push(t)}),e},[b]),te=f(()=>({triggers:D.triggers,conditions:D.conditions.length?[D.conditions]:[[]],justCheck:!1,actions:{then:D.actions,else:[]}}),[D]),I=(e,t)=>{P.current+=1,k(n=>({...n,[e]:[...n[e],{id:t,_id:P.current,acceptedBy:e}]})),j(null)},L=(e,t)=>k(n=>({...n,[e]:n[e].filter(e=>e._id!==t)})),R=(e,t,n)=>k(r=>({...r,[e]:r[e].map(r=>r._id===t?{...n,_id:t,id:r.id,acceptedBy:e}:r)})),z=(e,t,n)=>{let r=b==null?void 0:b.find(t=>t.getStaticData().id===e.id);return r?i(r,{_id:e._id,settings:e,acceptedBy:t,onChange:n?()=>{}:n=>R(t,e._id,n),socket:o,theme:s,themeType:c,themeName:v,enableSimulation:!1,userRules:te,onUpdate:!1,setOnUpdate:()=>{}}):i(`div`,{className:Q.notFound,children:_.t(`Block not found`)})},B=e=>i(`div`,{className:Q.chooser,children:ee[e].map(t=>{let{id:n,name:r,icon:a,adapter:s,title:c}=t.getStaticData();return d(`button`,{type:`button`,className:Q.choice,title:c?_.t(c):void 0,onClick:()=>I(e,n),children:[i(F,{iconName:a,adapter:s,socket:o,className:Q.choiceIcon}),i(`span`,{className:Q.choiceName,children:_.t(r)})]},n)})}),ne=(e,t)=>d(`div`,{className:Q.step,hidden:S!==t,children:[i(`div`,{className:Q.hint,children:_.t(Fe[e])}),D[e].map(t=>d(`div`,{className:y.clsx(Q.blockCard,Le[e]),children:[i(`div`,{className:Q.blockBody,children:z(t,e)}),i(C,{className:Q.remove,size:`small`,title:_.t(`Delete`),onClick:()=>L(e,t._id),children:i(oe,{fontSize:`small`})})]},t._id)),A===e||!D[e].length?B(e):i(u,{className:Q.addMore,startIcon:i(M,{}),onClick:()=>j(e),children:_.t(`Add another`)})]},e),H=()=>d(`div`,{className:Q.step,children:[$.map(e=>D[e].length?d(`div`,{className:Q.summaryBand,children:[i(`div`,{className:y.clsx(Q.summaryLabel,Le[e]),children:_.t(Ie[e])}),D[e].map(t=>i(`div`,{className:y.clsx(Q.blockCard,Q.preview,Le[e]),children:i(`div`,{className:Q.blockBody,children:z(t,e,!0)})},t._id))]},e):null),D.conditions.length?null:i(`div`,{className:Q.hint,children:_.t(`Without a condition the rule always runs`)}),a?i(`div`,{className:Q.warning,children:_.t(`The current rule will be replaced`)}):null]}),U=S===$.length,W=U||S===1||!!D[$[S]].length;return d(g,{open:!0,fullWidth:!0,maxWidth:`md`,onClose:r,classes:{paper:Q.paper},children:[d(x,{className:Q.title,children:[_.t(`Create a rule step by step`),i(C,{className:Q.close,size:`small`,title:_.t(`Close`),onClick:r,children:i(m,{})})]}),d(T,{className:Q.content,children:[d(t,{className:Q.stepper,activeStep:S,children:[$.map(e=>i(n,{children:i(l,{children:_.t(Pe[e])})},e)),i(n,{children:i(l,{children:_.t(`Summary`)})})]}),$.map(ne),U?H():null]}),d(O,{className:Q.actions,children:[i(u,{disabled:!S,startIcon:i(se,{}),onClick:()=>w(S-1),children:_.t(`Back`)}),i(`div`,{className:Q.spacer}),i(u,{onClick:r,children:_.t(`Cancel`)}),U?i(u,{variant:`contained`,color:`primary`,onClick:()=>{e(te),r()},children:_.t(a?`Replace rule`:`Create rule`)}):i(u,{variant:`contained`,color:`primary`,disabled:!W,endIcon:i(h,{}),onClick:()=>w(S+1),children:_.t(S===1&&!D.conditions.length?`Skip`:`Next`)})]})]})};j();var Be=[],Ve=({code:e,onChange:t,themeName:n,themeType:r,theme:a,setTourStep:o,tourStep:s,isTourOpen:c,command:l,scriptId:f,changed:m,running:h,newRuleId:g,onNewRuleHandled:y})=>{var b;let{blocks:x,socket:S,setOnUpdate:C,setOnDebugMessage:T,setEnableSimulation:D}=E(V),[O,k]=p([]),[A,j]=p(z(e)),[M,te]=p(``),[F,I]=p(!1),[L,R]=p(!1);w(()=>{let e,t,n=(n,r)=>{n===`${e}.alive`&&t!==(r==null?void 0:r.val)&&(t=!!(r!=null&&r.val),t&&e&&(S==null||S.sendTo(e.replace(/^system\.adapter\./,``),`rulesOn`,f)))},r=(r,i)=>{var a;if(S&&e!==(i==null||(a=i.common)==null?void 0:a.engine)){var o;e&&(S.unsubscribeState(`${e}.alive`,n),t&&S.sendTo(e.replace(/^system\.adapter\./,``),`rulesOn`,f)),e=i==null||(o=i.common)==null?void 0:o.engine,e&&e&&S.subscribeState(`${e}.alive`,n)}},i=(e,t)=>{if(t)try{let e=JSON.parse(t.val),n=Date.now();if(e.ruleId===f&&n-e.ts<1e3){let t=[...Be,{blockId:e.blockId,data:e.data,ts:e.ts}];t.length>200&&t.splice(0,t.length-200);for(let e=t.length-1;e>=0;e--)if(t[e].ts{var a;e=t==null||(a=t.common)==null?void 0:a.engine,S.subscribeObject(f,r),e&&(S.subscribeState(`${e}.alive`,n),S.subscribeState(`${e.replace(/^system\.adapter\./,``)}.debug.rules`,i))}),function(){S==null||S.unsubscribeObject(f,r),e&&(S==null||S.unsubscribeState(`${e}.alive`,n),t&&(S==null||S.sendTo(e.replace(/^system\.adapter\./,``),`rulesOff`,f)),S==null||S.unsubscribeState(`${e.replace(/^system\.adapter\./,``)}.debug.rules`,i))}},[]),w(()=>{D(!m&&h)},[m,h,D]),w(()=>{l&&(te(l),F||I(!0))},[l]),w(()=>{let t=z(e);JSON.stringify(t)!==JSON.stringify(A)&&(j(t),C(!0))},[e]),w(()=>{document.getElementsByTagName(`HTML`)[0].className=n||`blue`},[n]),w(()=>{g&&g===f&&(y(),R(!0))},[g,f,y]);let B=v(e=>{j(e),x&&t(ne(e,x))},[x,t]),H=N(null),[U,W]=p({835:!1,1035:!1});if(w(()=>{H.current&&(H.current.clientWidth<=1035&&W({835:!1,1035:!0}),H.current.clientWidth<=835&&W({1035:!0,835:!0}),H.current.clientWidth>1035&&W({835:!1,1035:!1}))},[((b=H.current)==null?void 0:b.clientWidth)||0]),!x||!S)return null;let ie=!A.triggers.length&&!A.actions.then.length&&!A.actions.else.length&&!A.conditions.some(e=>e.length);return d(`div`,{className:K.wrapperRules,ref:H,children:[i(ve,{allBlocks:O,socket:S}),F?M===`export`?i(P,{scriptId:f,themeType:r,onClose:()=>I(!1),text:JSON.stringify(A,null,2)}):i(ee,{themeType:r,onClose:e=>{I(!1),e&&B(JSON.parse(e))}}):null,L?i(ze,{hasRule:!ie,socket:S,theme:a,themeType:r,themeName:n,onCreate:B,onClose:()=>R(!1)}):null,d(`div`,{className:K.rootWrapper,children:[i(Ne,{setAllBlocks:k,allBlocks:O,userRules:A,onChangeBlocks:B,setTourStep:o,tourStep:s,addClass:U,isTourOpen:c,onStartWizard:()=>R(!0)}),d(`div`,{className:K.bands,children:[ie?d(`div`,{className:K.emptyRule,children:[i(`div`,{className:K.emptyRuleText,children:_.t(`Create a rule step by step`)}),i(u,{variant:`contained`,color:`primary`,startIcon:i(re,{}),onClick:()=>R(!0),children:_.t(`Wizard`)})]}):null,i(je,{socket:S,setUserRules:B,userRules:A,isTourOpen:c,setTourStep:o,tourStep:s,name:`${_.t(`when`)}...`,typeBlock:`triggers`,iconName:`FlashOn`,themeType:r,themeName:n,theme:a}),i(je,{socket:S,setUserRules:B,isTourOpen:c,setTourStep:o,tourStep:s,userRules:A,name:`...${_.t(`and`)}...`,typeBlock:`conditions`,iconName:`Help`,nameAdditionally:_.t(`or`),additionally:!0,themeType:r,themeName:n,theme:a}),i(je,{socket:S,setUserRules:B,isTourOpen:c,setTourStep:o,tourStep:s,userRules:A,name:`...${_.t(`then`)}`,typeBlock:`actions`,iconName:`PlayForWork`,nameAdditionally:_.t(`else`),additionally:!0,themeType:r,themeName:n,theme:a})]})]})]},`rulesEditor`)};export{Ve as default}; \ No newline at end of file diff --git a/admin/assets/ScriptEditor-DiCKl9d2.js b/admin/assets/ScriptEditor-DiCKl9d2.js new file mode 100644 index 00000000..bb7158c7 --- /dev/null +++ b/admin/assets/ScriptEditor-DiCKl9d2.js @@ -0,0 +1,2 @@ +import{Ct as e,Jn as t,Ut as n,Vt as r,Yn as i,en as a,f as o,in as s,lt as c,nn as l,nr as u,tn as d,wr as f}from"./_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js";import{t as p}from"./ScriptEditorVanillaMonaco-BPeIEG64.js";f();var m={textArea:{width:`calc(100% - 10px)`,resize:`none`},dialog:{height:`95%`},fullHeight:{height:`100%`,overflow:`hidden`},args:e=>({color:e.palette.mode===`dark`?`white`:`black`,height:30,width:`100%`,fontSize:16}),argsTitle:e=>({color:e.palette.mode===`dark`?`white`:`black`,fontWeight:`bold`})},h=class extends u.Component{constructor(e){super(e),this.state={changed:!1,source:!e.source&&e.isReturn?` +return false`:e.source}}componentDidMount(){setTimeout(()=>{try{var e;(e=window.document.getElementById(`source-text-area`))==null||e.focus()}catch{}},100)}handleCancel(){this.props.onClose(!1)}handleOk(){(!this.props.isReturn||this.state.source.includes(`return `))&&this.props.onClose(this.state.source)}onChange(e){this.setState({changed:!0,source:e})}render(){return i(a,{onClose:()=>!1,maxWidth:`lg`,sx:{"& .MuiDialog-paper":m.dialog},fullWidth:!0,open:!0,"aria-labelledby":`source-dialog-title`,children:[t(s,{id:`source-dialog-title`,children:o.t(`Function editor`)}),i(l,{style:m.fullHeight,children:[this.props.args&&i(r,{sx:m.args,children:[t(r,{component:`span`,sx:m.argsTitle,children:o.t(`function (`)}),this.props.args,t(r,{component:`span`,sx:m.argsTitle,children:`)`})]},`arguments`),t(p,{triggerPrettier:1,adapterName:this.props.adapterName,runningInstances:this.props.runningInstances,style:{...m.textArea,height:this.props.args?`calc(100% - 30px)`:`100%`},name:`blockly`,socket:this.props.socket,readOnly:!1,checkJs:!1,changed:this.state.changed,code:this.state.source,isDark:this.props.themeType===`dark`,onChange:e=>this.onChange(e),language:`javascript`},`scriptEditor`)]}),i(d,{children:[t(n,{variant:`contained`,onClick:()=>this.handleOk(),color:`primary`,startIcon:t(c,{}),children:o.t(`Save`)}),t(n,{color:`grey`,variant:`contained`,onClick:()=>this.handleCancel(),startIcon:t(e,{}),children:o.t(`Cancel`)})]})]})}};export{h as default}; \ No newline at end of file diff --git a/admin/assets/ScriptEditorVanillaMonaco-BPeIEG64.js b/admin/assets/ScriptEditorVanillaMonaco-BPeIEG64.js new file mode 100644 index 00000000..c37d6d67 --- /dev/null +++ b/admin/assets/ScriptEditorVanillaMonaco-BPeIEG64.js @@ -0,0 +1,3 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./stateHoverProvider-CIFNrLee.js","./cronHoverProvider-BhX-SvkB.js","./index-2X_5uU-_.js","./Import-BH2X_ziv.js","./Error-1oeF0cix.js","./blockly-DBw-ytY1.js","./index-Z8Hkv58g.css","./inlineDiffController-DianrKl1.js","./applyCodeEdit-D3nb7erO.js","./inlineChatWidget-CBVgT6FZ.js"])))=>i.map(i=>d[i]); +import{r as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./vite-preload-helper-B7qeedMF.js";import{Jn as n,Ln as r,N as i,Nn as a,Ut as o,Yn as s,en as c,f as l,in as u,mn as d,nn as f,nr as p,sn as m,tn as h,wr as g,z as _}from"./_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js";import{d as v}from"./index-2X_5uU-_.js";var y=e({default:()=>C});g();function b(e){return/^script\.js\.global\./.test(e)}var x=0;function S(e){return e.replace(/\x1b\[[0-9;]*m/g,``)}var C=class extends p.Component{get monacoTS(){var e;return(e=this.monaco)==null||(e=e.languages)==null?void 0:e.typescript}constructor(e){super(e),r(this,`monacoDiv`,null),r(this,`editor`,null),r(this,`monaco`,window.monaco),r(this,`insert`,``),r(this,`originalCode`,void 0),r(this,`runningInstancesStr`,void 0),r(this,`monacoCounter`,0),r(this,`location`,void 0),r(this,`breakpoints`,void 0),r(this,`lastSearch`,``),r(this,`typings`,{}),r(this,`decorations`,[]),r(this,`datapointProviderDisposable`,null),r(this,`inlineProviderDisposable`,null),r(this,`stateHoverDisposable`,null),r(this,`showStateValueDisposable`,null),r(this,`cronHoverDisposable`,null),r(this,`codeLensDisposable`,null),r(this,`inlineChatWidgetInstance`,null),r(this,`inlineDiffInstance`,null),r(this,`inlineDiffCssInjected`,!1),r(this,`triggerPrettier`,void 0),r(this,`contentChangeDisposable`,null),r(this,`mouseDownDisposable`,null),this.state={name:`current`,isDark:e.isDark||!1,language:e.language||`javascript`,readOnly:e.readOnly||!1,alive:!0,check:!1,searchText:this.props.searchText||``,typingsLoaded:!1,showError:null},this.triggerPrettier=e.triggerPrettier,this.runningInstancesStr=JSON.stringify(this.props.runningInstances),this.originalCode=e.code||``,this.monacoDiv=p.createRef()}waitForMonaco(e){var t;let n=!!((t=this.monacoTS)!=null&&(t=t.typescriptDefaults)!=null&&t.getCompilerOptions);if(!n||!this.props.runningInstances){var r;if(this.monaco=window.monaco,n=!!((r=this.monacoTS)!=null&&(r=r.typescriptDefaults)!=null&&r.getCompilerOptions),this.monacoCounter++,!n&&this.monacoCounter<20){console.log(`wait for monaco loaded`),setTimeout(()=>this.waitForMonaco(e),200);return}this.monacoCounter>=20&&console.error(`Cannot load monaco!`)}else e&&e()}loadTypings(e){if(!this.editor)return;e||=this.props.runningInstances;let t=e&&Object.keys(e).find(t=>e==null?void 0:e[t]);t&&this.props.socket.sendTo(t.replace(`system.adapter.`,``),`loadTypings`,null).then(e=>{this.setState({alive:!0,check:!0,typingsLoaded:!0}),this.setTypeCheck(!0),e.typings?(this.typings=e.typings,this.setEditorTypings(this.state.name)):console.error(`failed to load typings: ${e.error}`)})}componentDidMount(){var e;this.undo,this.redo,this.showInlineDiff,this.getEditorSelection,this.getEditorContent,this.getCursorPosition,this.highlightLineRange,this.goToLine,this.replaceSelection,this.getDiagnostics,this.getDocumentSymbols;let n=!!((e=this.monacoTS)!=null&&(e=e.typescriptDefaults)!=null&&e.getCompilerOptions);if(!n||!this.props.runningInstances){var r;if(this.monaco=window.monaco,n=!!((r=this.monacoTS)!=null&&(r=r.typescriptDefaults)!=null&&r.getCompilerOptions),!n){console.log(`wait for monaco loaded...`),this.waitForMonaco(()=>this.componentDidMount());return}}if(!this.editor&&n&&this.monaco){var i,a,o;console.log(`Init editor`),(i=(a=this.props).onRegisterSelect)==null||i.call(a,()=>{if(this.editor){let t=this.editor.getSelection();if(t){var e;return(e=this.editor.getModel())==null?void 0:e.getValueInRange(t)}}});let e=this.monacoTS.typescriptDefaults.getCompilerOptions();if(e.allowJs=!0,e.checkJs=this.props.checkJs!==!1,e.noLib=!0,e.lib=[],e.useUnknownInCatchVariables=!1,e.moduleResolution=this.monacoTS.ModuleResolutionKind.NodeJs,e.target=this.monacoTS.ScriptTarget.ESNext,e.module=this.monacoTS.ModuleKind.ESNext,e.allowNonTsExtensions=!0,this.monacoTS.typescriptDefaults.setCompilerOptions(e),this.setTypeCheck(!1),(o=this.monacoDiv)!=null&&o.current){var s;this.editor=this.monaco.editor.create((s=this.monacoDiv)==null?void 0:s.current,{lineNumbers:`on`,scrollBeyondLastLine:!1,automaticLayout:!0,glyphMargin:!!this.props.breakpoints,colorDecorators:!0,hover:{enabled:`on`,delay:200,sticky:!0},fixedOverflowWidgets:!0}),this.contentChangeDisposable=this.editor.onDidChangeModelContent(()=>this.onChange()),this.monaco&&!this.datapointProviderDisposable&&t(async()=>{let{registerDatapointProvider:e}=await import(`./AiDatapointProvider-DzFpUKkT.js`);return{registerDatapointProvider:e}},[],import.meta.url).then(({registerDatapointProvider:e})=>{this.monaco&&(this.datapointProviderDisposable=e(this.monaco,this.props.socket))}).catch(()=>{}),this.monaco&&!this.stateHoverDisposable&&t(async()=>{let{registerStateHoverProvider:e,registerShowStateValueAction:t}=await import(`./stateHoverProvider-CIFNrLee.js`);return{registerStateHoverProvider:e,registerShowStateValueAction:t}},__vite__mapDeps([0]),import.meta.url).then(({registerStateHoverProvider:e,registerShowStateValueAction:t})=>{this.monaco&&(this.stateHoverDisposable=e(this.monaco,this.props.socket)),this.monaco&&this.editor&&!this.showStateValueDisposable&&(this.showStateValueDisposable=t(this.editor,this.monaco,l.t(`Show ioBroker state value`)))}).catch(()=>{}),this.monaco&&!this.cronHoverDisposable&&t(async()=>{let{registerCronHoverProvider:e}=await import(`./cronHoverProvider-BhX-SvkB.js`);return{registerCronHoverProvider:e}},__vite__mapDeps([1]),import.meta.url).then(({registerCronHoverProvider:e})=>{this.monaco&&(this.cronHoverDisposable=e(this.monaco))}).catch(()=>{}),this.props.aiCompletionsEnabled&&this.monaco&&!this.inlineProviderDisposable&&t(async()=>{let{registerAiInlineProvider:e}=await import(`./AiInlineProvider-CaHd2G2Q.js`);return{registerAiInlineProvider:e}},[],import.meta.url).then(({registerAiInlineProvider:e})=>{this.monaco&&(this.inlineProviderDisposable=e(this.monaco,this.props.socket,this.props.runningInstances))}).catch(()=>{}),this.loadTypings(),this.props.onForceSave&&this.editor.addCommand(this.monaco.KeyMod.CtrlCmd|this.monaco.KeyCode.KeyS,()=>this.props.onForceSave&&this.props.onForceSave()),this.registerAiActions(),this.monaco&&this.editor&&this.props.onAiAction&&!this.codeLensDisposable&&t(async()=>{let{registerAiCodeLensProvider:e}=await import(`./index-2X_5uU-_.js`).then(e=>e.u);return{registerAiCodeLensProvider:e}},__vite__mapDeps([2,3,4,5,6]),import.meta.url).then(({registerAiCodeLensProvider:e})=>{this.monaco&&this.editor&&this.props.onAiAction&&(this.codeLensDisposable=e(this.monaco,this.editor,(e,t,n,r,i)=>{var a,o,s;let c=(a=this.editor)==null?void 0:a.getModel(),l=c?c.getLineMaxColumn(Math.min(i,c.getLineCount())):1;(o=(s=this.props).onAiAction)==null||o.call(s,{action:e,code:t,rangeLabel:n,range:{startLine:r,startColumn:1,endLine:i,endColumn:l},kind:`codelens`})}))}).catch(()=>{}),setTimeout(()=>{this.highlightText(this.state.searchText),this.location=this.props.location||void 0,this.breakpoints=this.props.breakpoints,this.showDecorators()})}}let c={selectOnLineNumbers:!0,scrollBeyondLastLine:!1,automaticLayout:!0,readOnly:this.state.readOnly,language:this.state.language,isDark:this.state.isDark};this.setEditorOptions(c),this.editor&&(this.editor.focus(),this.editor.setValue(this.originalCode),this.props.onToggleBreakpoint&&(this.mouseDownDisposable=this.editor.onMouseDown(e=>{var t;let n=e.target;this.props.onToggleBreakpoint&&((t=n.detail)==null?void 0:t.glyphMarginLeft)!==void 0&&n.position&&this.props.onToggleBreakpoint(n.position.lineNumber-1)})))}setEditorOptions(e){if(e&&(e.language&&this.setEditorLanguage(e.language),this.editor&&(e.readOnly!==void 0&&this.editor.updateOptions({readOnly:e.readOnly}),e.lineWrap!==void 0&&this.editor.updateOptions({wordWrap:e.lineWrap?`on`:`off`})),e.typeCheck!==void 0&&this.setTypeCheck(e.typeCheck),e.isDark!==void 0)){var t;(t=this.monaco)==null||t.editor.setTheme(e.isDark?`vs-dark`:`vs`)}}componentWillUnmount(){var e,n,r,i,a,o,s,c,l;if((e=this.contentChangeDisposable)==null||e.dispose(),this.contentChangeDisposable=null,(n=this.mouseDownDisposable)==null||n.dispose(),this.mouseDownDisposable=null,(r=this.datapointProviderDisposable)==null||r.dispose(),this.datapointProviderDisposable=null,t(async()=>{let{clearDatapointCache:e}=await import(`./AiDatapointProvider-DzFpUKkT.js`);return{clearDatapointCache:e}},[],import.meta.url).then(({clearDatapointCache:e})=>e()).catch(()=>{}),(i=this.inlineProviderDisposable)==null||i.dispose(),this.inlineProviderDisposable=null,(a=this.stateHoverDisposable)==null||a.dispose(),this.stateHoverDisposable=null,(o=this.showStateValueDisposable)==null||o.dispose(),this.showStateValueDisposable=null,t(async()=>{let{clearStateHoverCache:e}=await import(`./stateHoverProvider-CIFNrLee.js`);return{clearStateHoverCache:e}},__vite__mapDeps([0]),import.meta.url).then(({clearStateHoverCache:e})=>e()).catch(()=>{}),(s=this.cronHoverDisposable)==null||s.dispose(),this.cronHoverDisposable=null,(c=this.codeLensDisposable)==null||c.dispose(),this.codeLensDisposable=null,(l=this.inlineChatWidgetInstance)==null||l.dispose(),this.inlineChatWidgetInstance=null,this.hideInlineDiff(),this.editor){var u,d;(u=(d=this.props).onRegisterSelect)==null||u.call(d,null),this.editor.dispose(),this.editor=null}}async doPrettier(){var e;let t=this.props.runningInstances&&Object.keys(this.props.runningInstances).find(e=>{var t;return(t=this.props.runningInstances)==null?void 0:t[e]});if(!t){window.alert(l.t(`No script adapter instance found to format the code`));return}let n=await this.props.socket.sendTo(t.replace(`system.adapter.`,``),`prettier`,{code:(e=this.editor)==null?void 0:e.getValue(),type:this.state.language});if(n.error)this.setState({showError:{title:l.t(`Error formatting code`),message:S(n.error)}});else if(n.code){var r,i,a;(r=this.editor)==null||r.setValue(n.code),(i=(a=this.props).onChange)==null||i.call(a,n.code),this.showDecorators()}}setEditorLanguage(e){if(!this.editor)return;let t=this.editor.getModel();if(t){var n;let i=t.getValue(),a=t.uri.path,o=typeof a==`string`&&a.includes(`.`)?a.substring(0,a.lastIndexOf(`.`)):`index`,s=e===`javascript`?`js`:e===`typescript`?`ts`:e;t.dispose();let c=e===`javascript`||e===`typescript`?`typescript`:e,l=(n=this.monaco)==null?void 0:n.editor.createModel(i,c,this.monaco.Uri.from({scheme:window.location.protocol.replace(`:`,``),path:`${o}${x++}.${s}`}));if(l){var r;this.editor.setModel(l),(r=this.contentChangeDisposable)==null||r.dispose(),this.contentChangeDisposable=this.editor.onDidChangeModelContent(()=>this.onChange())}}}setTypeCheck(e){var t,n;let r={noSemanticValidation:!this.state.alive||!e,noSyntaxValidation:!this.state.alive};(t=this.monacoTS)==null||t.typescriptDefaults.setDiagnosticsOptions(r),(n=this.monacoTS)==null||n.javascriptDefaults.setDiagnosticsOptions({noSemanticValidation:!this.state.alive||!e,noSyntaxValidation:!this.state.alive})}setEditorTypings(e=``){var t,n;let r=b(e),i=`${e}.d.ts`,a=[];for(let e of Object.keys(this.typings))r&&(e===`global.d.ts`||e.startsWith(`script.js.global`)&&e!==i)||a.push({filePath:e,content:this.typings[e]});if((t=this.monacoTS)!=null&&(t=t.typescriptDefaults)!=null&&t.setExtraLibs)this.monacoTS.typescriptDefaults.setExtraLibs(a);else if((n=this.monacoTS)!=null&&(n=n.typescriptDefaults)!=null&&n.addExtraLib){let e=this.monacoTS.typescriptDefaults.getExtraLibs();a.forEach(t=>{!e[t.filePath]&&this.monaco&&this.monacoTS.typescriptDefaults.addExtraLib(t.content,t.filePath)})}}undo(){var e;(e=this.editor)==null||e.trigger(`toolbar`,`undo`,null)}redo(){var e;(e=this.editor)==null||e.trigger(`toolbar`,`redo`,null)}insertTextIntoEditor(e){if(!this.editor||!this.monaco)return;let t=this.editor.getSelection();if(t){let n=new this.monaco.Range(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn);this.editor.executeEdits(``,[{range:n,text:e,forceMoveMarkers:!0}])}this.editor.focus()}highlightText(e){var t;if(!this.editor||!this.monaco)return 0;let n=e?(t=this.editor.getModel())==null?void 0:t.findMatches(e,!0,!1,!1,null,!0):void 0;if(n!=null&&n.length)return n.forEach(e=>{var t;return(t=this.editor)==null?void 0:t.setSelection(e.range)}),this.editor.revealLine(n[0].range.startLineNumber),n.length;let r=this.editor.getPosition();if(r){let e=r.lineNumber,t=r.column;this.editor.setSelection(new this.monaco.Range(e,t,e,t))}return 0}showInlineDiff(e){if(!this.editor||!this.monaco)return;let n=this.editor,r=this.monaco;this.hideInlineDiff(),t(async()=>{let{InlineDiffController:e,INLINE_DIFF_CSS:t}=await import(`./inlineDiffController-DianrKl1.js`);return{InlineDiffController:e,INLINE_DIFF_CSS:t}},__vite__mapDeps([7,8]),import.meta.url).then(({InlineDiffController:t,INLINE_DIFF_CSS:i})=>{if(!this.inlineDiffCssInjected){let e=document.createElement(`style`);e.textContent=i,e.setAttribute(`data-iob-aichat`,`inline-diff`),document.head.appendChild(e),this.inlineDiffCssInjected=!0}let a=new t(n,r,{range:e.range,originalText:e.originalText,modifiedText:e.modifiedText,onAccepted:()=>{var t;this.inlineDiffInstance=null,(t=e.onAccepted)==null||t.call(e)},onRejected:()=>{var t;this.inlineDiffInstance=null,(t=e.onRejected)==null||t.call(e)}});this.inlineDiffInstance=a,a.show()}).catch(()=>{})}hideInlineDiff(){if(this.inlineDiffInstance){try{this.inlineDiffInstance.dispose()}catch{}this.inlineDiffInstance=null}}showInlineChatWidget(){if(!this.editor||!this.monaco||!this.props.onInlineAsk)return;if(this.inlineChatWidgetInstance){this.inlineChatWidgetInstance.show();return}let e=this.editor,n=this.monaco,r=this.props.onInlineAsk,i=this.props.onAiAction;t(async()=>{let{InlineChatWidget:e}=await import(`./inlineChatWidget-CBVgT6FZ.js`);return{InlineChatWidget:e}},__vite__mapDeps([9,8]),import.meta.url).then(({InlineChatWidget:t})=>{let a=new t(e,n,{onSubmit:async e=>r({question:e.question,selectedCode:e.selectedCode}),onEscalateToChat:e=>{i&&i({action:`ask`,code:e.selectedCode,question:e.question,rangeLabel:e.range?`lines ${e.range.startLineNumber}-${e.range.endLineNumber}`:`whole file`})}});this.inlineChatWidgetInstance=a,a.show()}).catch(()=>{})}registerAiActions(){if(!this.editor||!this.monaco||!this.props.onAiAction)return;let e=this.monaco,t=(t,n={})=>{if(!this.editor||!this.props.onAiAction)return;let r=this.editor.getModel();if(!r)return;let i=this.editor.getSelection(),a=i&&!i.isEmpty(),o,s,c,l=`selection`;if(a)o=r.getValueInRange(i),s=i.startLineNumber===i.endLineNumber?`line ${i.startLineNumber}`:`lines ${i.startLineNumber}-${i.endLineNumber}`,c={startLine:i.startLineNumber,startColumn:i.startColumn,endLine:i.endLineNumber,endColumn:i.endColumn},l=`selection`;else{let t=this.editor.getPosition(),n=null;if(t)try{n=v(r.getValue(),t.lineNumber)}catch{}if(n){let t=n.startLine,i=n.endLine,a=r.getLineMaxColumn(i),u=new e.Range(t,1,i,a);o=r.getValueInRange(u),s=t===i?`line ${t}`:`lines ${t}-${i}`,c={startLine:t,startColumn:1,endLine:i,endColumn:a},l=`codelens`}else o=r.getValue(),s=`whole file`,l=`none`}this.props.onAiAction({action:t,code:o,rangeLabel:s,range:c,kind:l,...n})},n=[{id:`iobroker.ai.inline`,label:`🤖 ${l.t(`AI: Inline chat…`)}`,keybindings:[e.KeyMod.CtrlCmd|e.KeyMod.Alt|e.KeyCode.KeyI],order:1,run:()=>{if(this.props.onInlineAsk)this.showInlineChatWidget();else{let e=window.prompt(l.t(`Ask the AI about the selected code:`));e&&e.trim()&&t(`ask`,{question:e.trim()})}}},{id:`iobroker.ai.explain`,label:`💡 ${l.t(`AI: Explain`)}`,keybindings:[e.KeyMod.CtrlCmd|e.KeyMod.Alt|e.KeyCode.KeyE],order:2,run:()=>t(`explain`)},{id:`iobroker.ai.refactor`,label:`🔧 ${l.t(`AI: Refactor`)}`,keybindings:[e.KeyMod.CtrlCmd|e.KeyMod.Alt|e.KeyCode.KeyR],order:3,run:()=>t(`refactor`)},{id:`iobroker.ai.comment`,label:`💬 ${l.t(`AI: Add comments`)}`,keybindings:[e.KeyMod.CtrlCmd|e.KeyMod.Alt|e.KeyCode.KeyC],order:4,run:()=>t(`comment`)},{id:`iobroker.ai.fix`,label:`🛠️ ${l.t(`AI: Fix problem`)}`,keybindings:[e.KeyMod.CtrlCmd|e.KeyMod.Alt|e.KeyCode.KeyF],order:5,run:()=>{let n;try{var r,i;let t=(r=this.editor)==null?void 0:r.getModel(),a=(i=this.editor)==null?void 0:i.getPosition();if(t&&a){let r=e.editor.getModelMarkers({resource:t.uri}).find(e=>a.lineNumber>=e.startLineNumber&&a.lineNumber<=e.endLineNumber);r&&(n=r.message)}}catch{}t(`fix`,{diagnostic:n})}},{id:`iobroker.ai.tests`,label:`✅ ${l.t(`AI: Suggest tests`)}`,order:6,run:()=>t(`tests`)}];for(let e of n)try{this.editor.addAction({id:e.id,label:e.label,contextMenuGroupId:`aichat`,contextMenuOrder:e.order,keybindings:e.keybindings,run:()=>e.run()})}catch{}}getEditorSelection(){if(!this.editor)return null;let e=this.editor.getSelection();if(!e||e.isEmpty())return null;let t=this.editor.getModel();return t?{text:t.getValueInRange(e),range:{startLine:e.startLineNumber,startColumn:e.startColumn,endLine:e.endLineNumber,endColumn:e.endColumn}}:null}getEditorContent(){var e;return((e=this.editor)==null||(e=e.getModel())==null?void 0:e.getValue())??``}getCursorPosition(){var e;let t=(e=this.editor)==null?void 0:e.getPosition();return t?{line:t.lineNumber,column:t.column}:null}highlightLineRange(e,t){if(!this.editor||!this.monaco)return!1;let n=this.editor.getModel();if(!n)return!1;let r=n.getLineCount(),i=Math.max(1,Math.min(e,r)),a=Math.max(i,Math.min(t,r)),o=n.getLineMaxColumn(a);return this.editor.setSelection(new this.monaco.Range(i,1,a,o)),this.editor.revealLineInCenter(i),!0}goToLine(e,t=1){if(!this.editor||!this.monaco)return!1;let n=this.editor.getModel();if(!n)return!1;let r=n.getLineCount(),i=Math.max(1,Math.min(e,r));return this.editor.setPosition({lineNumber:i,column:t}),this.editor.revealLineInCenter(i),this.editor.focus(),!0}replaceSelection(e){if(!this.editor||!this.monaco)return!1;let t=this.editor.getSelection();if(!t)return!1;let n=new this.monaco.Range(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn);return this.editor.executeEdits(``,[{range:n,text:e,forceMoveMarkers:!0}]),this.editor.focus(),!0}getDiagnostics(){if(!this.editor||!this.monaco)return[];let e=this.editor.getModel();if(!e)return[];let t=this.monaco.editor.getModelMarkers({resource:e.uri}),n={8:`error`,4:`warning`,2:`info`,1:`hint`};return t.map(e=>({line:e.startLineNumber,column:e.startColumn,endLine:e.endLineNumber,endColumn:e.endColumn,severity:n[e.severity]||`info`,message:e.message,...e.source?{source:e.source}:{}}))}async getDocumentSymbols(){if(!this.editor||!this.monaco)return[];let e=this.editor.getModel();if(!e)return[];let t=[];try{var n;let r=this.monaco.languages,i=(n=r.getDocumentSymbolProviders)==null?void 0:n.call(r,e);if(i!=null&&i.length){let n={0:`file`,1:`module`,2:`namespace`,3:`package`,4:`class`,5:`method`,6:`property`,7:`field`,8:`constructor`,9:`enum`,10:`interface`,11:`function`,12:`variable`,13:`constant`,14:`string`,15:`number`,16:`boolean`,17:`array`,18:`object`,19:`key`,20:`null`,21:`enum-member`,22:`struct`,23:`event`,24:`operator`,25:`type-parameter`};for(let r of i){let i=await r.provideDocumentSymbols(e,{isCancellationRequested:!1});if(!i)continue;let a=e=>{for(let i of e){var r;t.push({name:i.name,kind:n[i.kind]||String(i.kind),line:i.range.startLineNumber,endLine:i.range.endLineNumber,...i.detail?{detail:i.detail}:{}}),(r=i.children)!=null&&r.length&&a(i.children)}};if(a(i),t.length)break}}}catch{}if(t.length===0){let n=e.getValue().split(` +`),r=[{re:/^(?:export\s+)?(?:async\s+)?function\s+(\w+)/,kind:`function`},{re:/^(?:export\s+)?class\s+(\w+)/,kind:`class`},{re:/^(?:export\s+)?(?:const|let|var)\s+(\w+)/,kind:`variable`}];for(let e=0;e{this.monaco&&t.push({range:new this.monaco.Range(e.location.lineNumber+1,0,e.location.lineNumber+1,100),options:{isWholeLine:!0,glyphMarginClassName:this.props.isDark?`monacoBreakPointDark`:`monacoBreakPoint`}})}),this.editor){let e=this.editor.getModel();e&&(this.decorations=e.deltaDecorations(this.decorations,t))}}initNewScript(e,t){var n;this.setState({name:e}),this.originalCode=t||``,(n=this.editor)==null||n.setValue(t||``),this.highlightText(this.lastSearch),this.showDecorators(),this.setEditorTypings(e)}scrollToLineIfNeeded(e){if(this.editor){let t=this.editor.getVisibleRanges();(!t||!t[0]||t[0].startLineNumber>e||e>t[0].endLineNumber)&&this.editor.revealLineInCenter(e)}}UNSAFE_componentWillReceiveProps(e){let n={};this.state.name!==e.name&&this.initNewScript(e.name,e.code),JSON.stringify(e.runningInstances)!==this.runningInstancesStr&&(this.runningInstancesStr=JSON.stringify(e.runningInstances),this.state.typingsLoaded||this.loadTypings(e.runningInstances)),this.editor&&!e.changed&&(e.code!==this.originalCode||e.code!==this.editor.getValue())&&(this.originalCode=e.code||``,this.editor.setValue(this.originalCode),this.showDecorators(),this.location&&this.scrollToLineIfNeeded(this.location.lineNumber+1)),e.searchText!==this.lastSearch&&(this.lastSearch=e.searchText||``,this.highlightText(this.lastSearch)),JSON.stringify(e.location)!==JSON.stringify(this.location)&&JSON.stringify(e.breakpoints)!==JSON.stringify(this.breakpoints)?(this.location=e.location||void 0,this.breakpoints=e.breakpoints,this.showDecorators(),this.editor&&this.location&&this.scrollToLineIfNeeded(this.location.lineNumber+1)):JSON.stringify(e.breakpoints)===JSON.stringify(this.breakpoints)?JSON.stringify(e.location)!==JSON.stringify(this.location)&&(this.location=e.location||void 0,this.showDecorators(),this.editor&&this.location&&this.scrollToLineIfNeeded(this.location.lineNumber+1)):(this.breakpoints=e.breakpoints,this.showDecorators()),this.state.language===(e.language||`javascript`)?this.state.readOnly===(e.readOnly||!1)?this.state.isDark!==(e.isDark||!1)&&(this.setState({isDark:e.isDark||!1}),n.isDark=e.isDark):(this.setState({readOnly:e.readOnly||!1}),n.readOnly=e.readOnly):(this.setState({language:e.language||`javascript`}),n.language=e.language||`javascript`),this.setEditorOptions(n),e.aiCompletionsEnabled!==this.props.aiCompletionsEnabled&&(e.aiCompletionsEnabled&&this.monaco&&!this.inlineProviderDisposable?t(async()=>{let{registerAiInlineProvider:e}=await import(`./AiInlineProvider-CaHd2G2Q.js`);return{registerAiInlineProvider:e}},[],import.meta.url).then(({registerAiInlineProvider:e})=>{this.monaco&&(this.inlineProviderDisposable=e(this.monaco,this.props.socket,this.props.runningInstances))}).catch(()=>{}):!e.aiCompletionsEnabled&&this.inlineProviderDisposable&&(this.inlineProviderDisposable.dispose(),this.inlineProviderDisposable=null)),this.insert!==e.insert&&(this.insert=e.insert||``,this.insert&&(console.log(`Insert text: ${this.insert}`),setTimeout(e=>{this.insertTextIntoEditor(e),setTimeout(()=>this.props.onInserted&&this.props.onInserted(),100)},100,this.insert)))}onChange(){if(!this.props.readOnly&&this.editor){var e,t;(e=(t=this.props).onChange)==null||e.call(t,this.editor.getValue())}}renderErrorDialog(){return this.state.showError?this.state.showError.full?s(c,{open:!0,maxWidth:`md`,onClose:()=>this.setState({showError:null}),children:[n(u,{children:this.state.showError.title||l.t(`Error`)}),n(f,{children:n(`pre`,{children:n(`code`,{children:this.state.showError.message})})}),n(h,{children:s(o,{variant:`contained`,startIcon:n(i,{}),onClick:()=>this.setState({showError:null}),children:[l.t(`Close`),` `]})})]}):n(a,{open:!0,autoHideDuration:5e3,onClose:()=>this.setState({showError:null}),message:this.state.showError.title,action:s(p.Fragment,{children:[n(o,{color:`secondary`,size:`small`,onClick:()=>this.setState({showError:{...this.state.showError,full:!0}}),children:l.t(`More`)}),n(d,{size:`small`,"aria-label":`close`,color:`inherit`,onClick:()=>this.setState({showError:null}),children:n(i,{fontSize:`small`})})]})}):null}render(){var e;return!((e=this.monacoTS)!=null&&e.typescriptDefaults)||!this.props.runningInstances?(setTimeout(()=>{this.monaco=window.monaco,this.forceUpdate()},200),null):(this.props.triggerPrettier!==this.triggerPrettier&&(this.triggerPrettier=this.props.triggerPrettier,setTimeout(()=>this.doPrettier().catch(e=>console.error(`Error formatting code:`,e)),50)),s(`div`,{ref:this.monacoDiv,style:{...this.props.style,width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`},children:[this.renderErrorDialog(),!this.state.check&&n(m,{size:`small`,title:l.t(`Check is not active, because javascript adapter is disabled`),style:{bottom:10,right:10,opacity:.5,position:`absolute`,zIndex:1,background:`red`,color:`white`},color:`secondary`,children:n(_,{})})]}))}};export{y as n,C as t}; \ No newline at end of file diff --git a/admin/assets/aiPromptBuilder-CXetnpLr.js b/admin/assets/aiPromptBuilder-CXetnpLr.js new file mode 100644 index 00000000..6e3ea9a2 --- /dev/null +++ b/admin/assets/aiPromptBuilder-CXetnpLr.js @@ -0,0 +1 @@ +import{t as e}from"./AiChatPanel-AefbI3hv.js";export{e as buildActionPrompt}; \ No newline at end of file diff --git a/admin/assets/blocks_action-Cax68JNQ.js b/admin/assets/blocks_action-Cax68JNQ.js new file mode 100644 index 00000000..77a5b79c --- /dev/null +++ b/admin/assets/blocks_action-Cax68JNQ.js @@ -0,0 +1 @@ +import{i as e,o as t,r as n,t as r}from"./blockly-DBw-ytY1.js";import{c as i,l as a}from"./index-2X_5uU-_.js";import{d as o,i as s,p as c,r as l,s as u}from"./helpers-JkY7wkCZ.js";function d(){let d=window.Blockly,f=d.Translate,p=window.getHelp;d.CustomBlocks=d.CustomBlocks||[],d.CustomBlocks.push(`Action`),d.Action={HUE:330,blocks:{}};let m=()=>new n(`FALSE`,function(e){this.getSourceBlock().updateShape_(l(e))}),h=()=>[[f(`http_timeout_ms`),`ms`],[f(`http_timeout_sec`),`sec`]],g=()=>[[f(`http_type_text`),`text`],[f(`http_type_arraybuffer`),`arraybuffer`]],_={mutationToDom:function(){let e=document.createElement(`mutation`);return e.setAttribute(`with_statement`,String(l(this.getFieldValue(`WITH_STATEMENT`)))),e},domToMutation:function(e){this.updateShape_(l(e.getAttribute(`with_statement`)))},updateShape_:function(e){o(this,e)}},v=(t,n,o,s,l,u)=>{r[t]={init:function(){this.appendDummyInput().appendField(n),this.appendDummyInput(`ATTR`).appendField(new e(o),`ATTR`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(d.Action.HUE),this.setTooltip(f(`${t}_tooltip`)),u&&this.setHelpUrl(p(u))},onchange:function(){c(this,s,l)},FUNCTION_TYPES:s},a.forBlock[t]=function(e){return[e.getFieldValue(`ATTR`),i.ATOMIC]}};d.Action.blocks.exec=` FALSE pwd `,r.exec={init:function(){this.appendDummyInput(`TEXT`).appendField(`» ${f(`exec`)}`),this.appendValueInput(`COMMAND`).appendField(f(`exec_command`)),this.appendDummyInput(`WITH_STATEMENT`).appendField(f(`with_results`)).appendField(m(),`WITH_STATEMENT`),this.appendDummyInput(`LOG`).appendField(f(`loglevel`)).appendField(new e(s()),`LOG`),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(d.Action.HUE),this.setTooltip(f(`exec_tooltip`)),this.setHelpUrl(p(`exec_help`))},..._},a.forBlock.exec=function(e){let t=a.valueToCode(e,`COMMAND`,i.ATOMIC),n=e.getFieldValue(`LOG`),r=``;if(n&&(r=`console.${n}('exec: ' + ${t});\n`),l(e.getFieldValue(`WITH_STATEMENT`))){let n=a.statementToCode(e,`STATEMENT`);if(n)return`exec(${t}, async (error, result, stderr) => {\n${n}});\n${r}`}return`exec(${t});\n${r}`},d.Action.blocks.exec_result=` result`,v(`exec_result`,`»`,[[f(`exec_result_result`),`result`],[f(`exec_result_stderr`),`stderr`],[f(`exec_result_error`),`error`]],[`exec`],`exec_result_warning`,`exec_help`),d.Action.blocks.http_get=` 2000 ms text http:// `,r.http_get={init:function(){this.appendValueInput(`URL`).appendField(`🌐 ${f(`http_get`)}`),this.appendDummyInput().appendField(f(`http_timeout`)).appendField(new t(`2000`),`TIMEOUT`).appendField(new e(h()),`UNIT`),this.appendDummyInput(`TYPE`).appendField(f(`http_type`)).appendField(new e(g()),`TYPE`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(d.Action.HUE),this.setTooltip(f(`http_get_tooltip`)),this.setHelpUrl(p(`http_get_help`))}},a.forBlock.http_get=function(e){let t=a.valueToCode(e,`URL`,i.ATOMIC),n=e.getFieldValue(`UNIT`),r=e.getFieldValue(`TIMEOUT`);Number.isNaN(r)&&(r=2e3),n===`sec`&&(r*=1e3);let o=e.getFieldValue(`TYPE`)||`text`,s=a.statementToCode(e,`STATEMENT`);return`httpGet(${t}, { timeout: ${r}, responseType: '${o}' }, async (err, response) => {\n${s}});\n`},d.Action.blocks.http_post=` 2000 ms text http:// `,r.http_post={init:function(){this.appendValueInput(`URL`).appendField(`🌐 ${f(`http_post`)}`),this.appendDummyInput().appendField(f(`http_timeout`)).appendField(new t(`2000`),`TIMEOUT`).appendField(new e(h()),`UNIT`),this.appendDummyInput(`TYPE`).appendField(f(`http_type`)).appendField(new e(g()),`TYPE`),this.appendValueInput(`DATA`).appendField(f(`http_post_data`)),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(d.Action.HUE),this.setTooltip(f(`http_post_tooltip`)),this.setHelpUrl(p(`http_post_help`))}},a.forBlock.http_post=function(e){let t=a.valueToCode(e,`URL`,i.ATOMIC),n=e.getFieldValue(`UNIT`),r=e.getFieldValue(`TIMEOUT`);isNaN(r)&&(r=2e3),n===`sec`&&(r*=1e3);let o=e.getFieldValue(`TYPE`)||`text`,s=a.valueToCode(e,`DATA`,i.ATOMIC)||`null`,c=a.statementToCode(e,`STATEMENT`);return`httpPost(${t}, ${s}, { timeout: ${r}, responseType: '${o}' }, async (err, response) => {\n${c}});\n`},d.Action.blocks.http_response=` response.data`,v(`http_response`,`🌐`,[[f(`http_response_data`),`response.data`],[f(`http_response_statuscode`),`response.statusCode`],[f(`http_response_responsetime`),`response.responseTime`],[f(`http_response_headers`),`response.headers`],[f(`http_response_error`),`err`]],[`http_get`,`http_post`],`http_response_warning`,`http_response_help`),d.Action.blocks.http_response_tofile=` temp.jpg `,r.http_response_tofile={init:function(){this.appendDummyInput().appendField(`🌐 ${f(`http_response_tofile`)}`),this.appendValueInput(`FILENAME`).appendField(f(`http_response_tofile_filename`)).setCheck(null),this.setInputsInline(!1),this.setOutput(!0,`String`),this.setColour(d.Action.HUE),this.setTooltip(f(`http_response_tofile_tooltip`)),this.setHelpUrl(p(`http_response_tofile_help`))},onchange:function(){c(this,[`http_get`,`http_post`],`http_response_warning`)},FUNCTION_TYPES:[`http_get`,`http_post`]},a.forBlock.http_response_tofile=function(e){return[`createTempFile(${a.valueToCode(e,`FILENAME`,i.ATOMIC)}, response.data)`,i.ATOMIC]};let y=()=>`${a.prefixLines(`if (err) {`,a.INDENT)}\n${a.prefixLines(`console.error(err);`,a.INDENT+a.INDENT)}\n${a.prefixLines(`}`,a.INDENT)}\n`;d.Action.blocks.file_write=` 0_userdata.0 demo.json `,r.file_write={init:function(){this.appendValueInput(`OID`).appendField(`📁 ${f(`file_write`)}`),this.appendValueInput(`FILE`).appendField(f(`file_write_filename`)).setCheck(null),this.appendValueInput(`DATA`).appendField(f(`file_write_data`)),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(d.Action.HUE),this.setTooltip(f(`file_write_tooltip`)),this.setHelpUrl(p(`file_write_help`))}},a.forBlock.file_write=function(e){let t=a.valueToCode(e,`OID`,i.ATOMIC),n=a.valueToCode(e,`FILE`,i.ATOMIC),r=a.valueToCode(e,`DATA`,i.ATOMIC),o=u(t);return`writeFile(${t}${o?` /* ${o} */`:``}, String(${n}), ${r||`null`}, (err) => {\n${y()}});\n`},d.Action.blocks.file_read=` 0_userdata.0 demo.json `,r.file_read={init:function(){this.appendValueInput(`OID`).appendField(`📁 ${f(`file_read`)}`),this.appendValueInput(`FILE`).appendField(f(`file_read_filename`)).setCheck(null),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(d.Action.HUE),this.setTooltip(f(`file_read_tooltip`)),this.setHelpUrl(p(`file_read_help`))}},a.forBlock.file_read=function(e){let t=a.valueToCode(e,`OID`,i.ATOMIC),n=a.valueToCode(e,`FILE`,i.ATOMIC),r=a.statementToCode(e,`STATEMENT`),o=u(t);return`readFile(${t}${o?` /* ${o} */`:``}, String(${n}), (err, data, mimeType) => {\n${y()}${r}});\n`},d.Action.blocks.file_data=` data`,v(`file_data`,`📁`,[[f(`file_data_data`),`data`],[f(`file_data_mimeType`),`mimeType`]],[`file_read`],`file_data_warning`),d.Action.blocks.request=` FALSE http:// `,r.request={init:function(){this.appendDummyInput(`TEXT`).appendField(f(`request`)),this.appendValueInput(`URL`).appendField(f(`request_url`)),this.appendDummyInput(`WITH_STATEMENT`).appendField(f(`with_results`)).appendField(m(),`WITH_STATEMENT`),this.appendDummyInput(`LOG`).appendField(f(`loglevel`)).appendField(new e(s()),`LOG`),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(d.Action.HUE),this.setTooltip(f(`request_tooltip`)),this.setHelpUrl(f(`request_help`))},..._},a.forBlock.request=function(e){let t=a.valueToCode(e,`URL`,i.ATOMIC),n=e.getFieldValue(`LOG`),r=``;if(n&&(r=`console.${n}('request: ' + ${t});\n`),l(e.getFieldValue(`WITH_STATEMENT`))){let n=a.statementToCode(e,`STATEMENT`);if(n)return`try {\n require("request")(${t}, async (error, response, result) => {\n ${n} }).on("error", (e) => { console.error(e); });\n} catch (e) { console.error(e); }\n${r}`}return`try {\n require("request")(${t}).on("error", (e) => { console.error(e); });\n} catch (e) { console.error(e); }\n${r}`}}export{d as install}; \ No newline at end of file diff --git a/admin/assets/blocks_convert-kP7xTnRo.js b/admin/assets/blocks_convert-kP7xTnRo.js new file mode 100644 index 00000000..176e694d --- /dev/null +++ b/admin/assets/blocks_convert-kP7xTnRo.js @@ -0,0 +1,3 @@ +import{i as e,o as t,r as n,t as r}from"./blockly-DBw-ytY1.js";import{c as i,l as a}from"./index-2X_5uU-_.js";import{c as o,n as s,t as c}from"./helpers-JkY7wkCZ.js";function l(){let l=window.Blockly,u=l.Translate;l.CustomBlocks=l.CustomBlocks||[],l.CustomBlocks.push(`Convert`),l.Convert={HUE:280,blocks:{}},l.Convert.blocks.convert_tonumber=``,r.convert_tonumber={init:function(){this.appendValueInput(`VALUE`).appendField(u(`convert_tonumber`)),this.setOutput(!0,`Number`),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_tonumber_tooltip`))}},a.forBlock.convert_tonumber=function(e){return[`parseFloat(${a.valueToCode(e,`VALUE`,i.ATOMIC)})`,i.ATOMIC]},l.Convert.blocks.convert_toboolean=``,r.convert_toboolean={init:function(){this.appendValueInput(`VALUE`).appendField(u(`convert_toboolean`)),this.setOutput(!0,`Boolean`),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_toboolean_tooltip`))}},a.forBlock.convert_toboolean=function(e){return[`(() => { + const val = ${a.valueToCode(e,`VALUE`,i.ATOMIC)};\n if (val === 'true' || val === 'TRUE') return true;\n if (val === 'false' || val === 'FALSE') return false;\n return !!val; +})()`,i.ATOMIC]},l.Convert.blocks.convert_tostring=``,r.convert_tostring={init:function(){this.appendValueInput(`VALUE`).appendField(u(`convert_tostring`)),this.setOutput(!0,`String`),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_tostring_tooltip`))}},a.forBlock.convert_tostring=function(e){return[`('' + ${a.valueToCode(e,`VALUE`,i.ATOMIC)})`,i.ATOMIC]},l.Convert.blocks.convert_type=``,r.convert_type={init:function(){this.appendValueInput(`ITEM`).appendField(u(`convert_type`)),this.setOutput(!0,`String`),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_type_tooltip`))}},a.forBlock.convert_type=function(e){return[`typeof ${a.valueToCode(e,`ITEM`,i.ATOMIC)}`,i.ATOMIC]},l.Convert.blocks.convert_to_date=``,r.convert_to_date={init:function(){this.appendValueInput(`VALUE`).appendField(u(`convert_to_date`)),this.setOutput(!0,`Date`),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_to_date_tooltip`))}},a.forBlock.convert_to_date=function(e){return[`getDateObject(${a.valueToCode(e,`VALUE`,i.ATOMIC)}).getTime()`,i.ATOMIC]},l.Convert.blocks.convert_from_date=` object`,r.convert_from_date={init:function(){this.appendValueInput(`VALUE`).appendField(u(`convert_from_date`)),this.appendDummyInput(`OPTION`).appendField(u(`convert_to`)).appendField(new e(c(),function(e){this.getSourceBlock().updateShape_(e===`custom`,e===`wdts`||e===`wdt`||e===`Mt`||e===`Mts`)}),`OPTION`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_from_date_tooltip`))},mutationToDom:function(){let e=document.createElement(`mutation`),t=this.getFieldValue(`OPTION`);return e.setAttribute(`format`,t===`custom`?`true`:`false`),e.setAttribute(`language`,t===`wdt`||t===`wdts`||t===`Mt`||t===`Mts`?`true`:`false`),e},domToMutation:function(e){let t=e.getAttribute(`format`),n=e.getAttribute(`language`);this.updateShape_(t===`true`||t===`TRUE`,n===`true`||n===`TRUE`)},updateShape_:function(n,r){if(n?this.getInput(`FORMAT`)||this.appendDummyInput(`FORMAT`).appendField(` `).appendField(new t(u(`time_get_default_format`)),`FORMAT`):this.getInput(`FORMAT`)&&this.removeInput(`FORMAT`),r){if(!this.getInput(`LANGUAGE`)){let t=s();this.appendDummyInput(`LANGUAGE`).appendField(new e(t),`LANGUAGE`)}}else this.getInput(`LANGUAGE`)&&this.removeInput(`LANGUAGE`)}},a.forBlock.convert_from_date=function(e){let t=e.getFieldValue(`OPTION`),n=e.getFieldValue(`FORMAT`),r=e.getFieldValue(`LANGUAGE`),s=a.valueToCode(e,`VALUE`,i.ATOMIC),c;return c=t===`object`?`getDateObject(${s}).getTime()`:t===`ms`?`getDateObject(${s}).getMilliseconds()`:t===`s`?`getDateObject(${s}).getSeconds()`:t===`sid`?`(() => { const v = getDateObject(${s}); return v.getHours() * 3600 + v.getMinutes() * 60 + v.getSeconds(); })()`:t===`m`?`getDateObject(${s}).getMinutes()`:t===`mid`?`(() => { const v = getDateObject(${s}); return v.getHours() * 60 + v.getMinutes(); })()`:t===`h`?`getDateObject(${s}).getHours()`:t===`d`?`getDateObject(${s}).getDate()`:t===`M`?`(getDateObject(${s}).getMonth() + 1)`:t===`Mt`?`formatDate(getDateObject(${s}), 'OO', '${r}')`:t===`Mts`?`formatDate(getDateObject(${s}), 'O', '${r}')`:t===`y`?`getDateObject(${s}).getYear()`:t===`fy`?`getDateObject(${s}).getFullYear()`:t===`wdt`?`formatDate(getDateObject(${s}), 'WW', '${r}')`:t===`wdts`?`formatDate(getDateObject(${s}), 'W', '${r}')`:t===`wd`?`(() => { const d = getDateObject(${s}).getDay(); return d === 0 ? 7 : d; })()`:t===`cw`?`((date) => { const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate())); const dayNum = d.getUTCDay() || 7; d.setUTCDate(d.getUTCDate() + 4 - dayNum); const yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1)); return Math.ceil(((d.getTime() - yearStart.getTime()) / 86400000 + 1) / 7); })(getDateObject(${s}))`:t===`custom`?`formatDate(getDateObject(${s}), ${o(n)})`:`formatDate(getDateObject(${s}), ${o(t)})`,[c,i.ATOMIC]},l.Convert.blocks.convert_time_difference=` hh:mm:ss `,r.convert_time_difference={init:function(){this.appendValueInput(`VALUE`).appendField(u(`convert_time_difference`)),this.appendDummyInput(`OPTION`).appendField(u(`convert_to`)).appendField(new e([[u(`time_difference_hh:mm:ss`),`hh:mm:ss`],[u(`time_difference_h:m:s`),`h:m:s`],[u(`time_difference_hh:mm`),`hh:mm`],[u(`time_difference_h:m`),`h:m`],[u(`time_difference_mm:ss`),`mm:ss`],[u(`time_difference_m:s`),`m:s`],[u(`time_difference_custom`),`custom`]],function(e){this.getSourceBlock().updateShape_(e===`custom`)}),`OPTION`),this.setInputsInline(!0),this.setOutput(!0,`String`),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_time_difference_tooltip`))},mutationToDom:function(){let e=document.createElement(`mutation`),t=this.getFieldValue(`OPTION`);return e.setAttribute(`format`,t===`custom`?`true`:`false`),e},domToMutation:function(e){let t=e.getAttribute(`format`);this.updateShape_(t===`true`||t===`TRUE`)},updateShape_:function(e){e?this.getInput(`FORMAT`)||this.appendDummyInput(`FORMAT`).appendField(` `).appendField(new t(u(`time_difference_default_format`)),`FORMAT`):this.getInput(`FORMAT`)&&this.removeInput(`FORMAT`)}},a.forBlock.convert_time_difference=function(e){let t=e.getFieldValue(`OPTION`),n=e.getFieldValue(`FORMAT`);return[`formatTimeDiff(${a.valueToCode(e,`VALUE`,i.ATOMIC)||`0`}, ${o(t===`custom`?n:t)})`,i.ATOMIC]},l.Convert.blocks.convert_json2object=``,r.convert_json2object={init:function(){this.appendValueInput(`VALUE`).appendField(u(`convert_json2object`)),this.setOutput(!0),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_json2object_tooltip`))}},a.forBlock.convert_json2object=function(e){return[`(() => { try { return JSON.parse(${a.valueToCode(e,`VALUE`,i.ATOMIC)}); } catch (e) { return {}; }})()`,i.ATOMIC]},l.Convert.blocks.convert_object2json=` FALSE`,r.convert_object2json={init:function(){this.appendValueInput(`VALUE`).appendField(u(`convert_object2json`)),this.appendDummyInput(`PRETTIFY`).appendField(u(`convert_object2json_prettify`)).appendField(new n(`FALSE`),`PRETTIFY`),this.setOutput(!0,`String`),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_object2json_tooltip`))}},a.forBlock.convert_object2json=function(e){let t=a.valueToCode(e,`VALUE`,i.ATOMIC),n=e.getFieldValue(`PRETTIFY`);return[`JSON.stringify(${t}${n===`TRUE`||n===`true`||n===!0?`, null, 2`:``})`,i.ATOMIC]},l.Convert.blocks.convert_jsonata=` * `,r.convert_jsonata={init:function(){this.appendValueInput(`EXPRESSION`).appendField(u(`convert_jsonata`)),this.appendValueInput(`TARGET`).appendField(u(`convert_jsonata_target`)),this.setInputsInline(!0),this.setOutput(!0,`String`),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_jsonata_tooltip`))}},a.forBlock.convert_jsonata=function(e){let t=a.valueToCode(e,`EXPRESSION`,i.ATOMIC),n=a.valueToCode(e,`TARGET`,i.ATOMIC);return n||=`{}`,[`(await jsonataExpression(${n}, ${t}))`,i.ATOMIC]}}export{l as install}; \ No newline at end of file diff --git a/admin/assets/blocks_logic-DMmdGePo.js b/admin/assets/blocks_logic-DMmdGePo.js new file mode 100644 index 00000000..12832585 --- /dev/null +++ b/admin/assets/blocks_logic-DMmdGePo.js @@ -0,0 +1 @@ +import{f as e,i as t,p as n,t as r}from"./blockly-DBw-ytY1.js";import{c as i,l as a}from"./index-2X_5uU-_.js";import{l as o}from"./helpers-JkY7wkCZ.js";function s(t,s,c,l,u){let d=window.Blockly.Translate,f=`${t}_container`,p=`${t}_mutator`;r[f]={init:function(){this.appendDummyInput().appendField(d(t)),this.appendStatementInput(`STACK`),this.setColour(`%{BKY_LOGIC_HUE}`),this.setTooltip(d(`${t}_tooltip`)),this.contextMenu=!1}},r[p]={init:function(){this.appendDummyInput(s).appendField(d(c)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(`%{BKY_LOGIC_HUE}`),this.setTooltip(d(`${t}_tooltip`)),this.contextMenu=!1}},r[t]={init:function(){this.itemCount_=2,this.setMutator(new e.MutatorIcon([p],this)),this.setInputsInline(!1),this.setOutput(!0,`Boolean`),this.setColour(`%{BKY_LOGIC_HUE}`),this.setTooltip(d(`${t}_tooltip`))},mutationToDom:function(){let e=document.createElement(`mutation`);return e.setAttribute(`items`,String(this.itemCount_)),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute(`items`),10),this.updateShape_()},decompose:function(e){var t;let n=e.newBlock(f);n.initSvg();let r=(t=n.getInput(`STACK`))==null?void 0:t.connection;for(let t=0;t0&&t.appendField(d(c))}for(let e=this.itemCount_;this.getInput(`${s}${e}`);e++)this.removeInput(`${s}${e}`)}},a.forBlock[t]=function(e){let t=e,n=[];for(let r=0;r0?n.join(l):`false`}`,u]}}function c(){let e=window.Blockly.Translate;s(`logic_multi_and`,`AND`,`logic_multi_and_and`,` && `,i.LOGICAL_AND),s(`logic_multi_or`,`OR`,`logic_multi_or_or`,` || `,i.LOGICAL_OR),r.logic_between={init:function(){this.appendValueInput(`MIN`).setCheck(`Number`),this.appendValueInput(`VALUE`).setCheck(`Number`).appendField(new t([[`<`,`LT`],[`≤`,`LE`]]),`MIN_OPERATOR`),this.appendValueInput(`MAX`).setCheck(`Number`).appendField(new t([[`<`,`LT`],[`≤`,`LE`]]),`MAX_OPERATOR`),this.setInputsInline(!0),this.setOutput(!0,`Boolean`),this.setColour(`%{BKY_LOGIC_HUE}`),this.setTooltip(e(`logic_between_tooltip`))}},a.forBlock.logic_between=function(e){let t=a.valueToCode(e,`MIN`,i.RELATIONAL)||0,n=a.valueToCode(e,`VALUE`,i.RELATIONAL)||0,r=a.valueToCode(e,`MAX`,i.RELATIONAL)||0;return[`${t} ${e.getFieldValue(`MIN_OPERATOR`)===`LT`?`<`:`<=`} ${n} && ${n} ${e.getFieldValue(`MAX_OPERATOR`)===`LT`?`<`:`<=`} ${r}`,i.LOGICAL_AND]},r.logic_ifempty={init:function(){this.appendValueInput(`VALUE`).setCheck(null).setAlign(n.Align.RIGHT).appendField(e(`logic_ifempty`)),this.appendValueInput(`DEFLT`).setCheck(null).setAlign(n.Align.RIGHT).appendField(e(`logic_ifempty_then`)),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(`%{BKY_LOGIC_HUE}`),this.setTooltip(e(`logic_ifempty_tooltip`))}},a.forBlock.logic_ifempty=function(e){return[`${a.valueToCode(e,`VALUE`,i.LOGICAL_OR)||null} || ${a.valueToCode(e,`DEFLT`,i.LOGICAL_OR)||null}`,i.LOGICAL_OR]}}export{c as install}; \ No newline at end of file diff --git a/admin/assets/blocks_number-DNxaWJG0.js b/admin/assets/blocks_number-DNxaWJG0.js new file mode 100644 index 00000000..1de4a9e2 --- /dev/null +++ b/admin/assets/blocks_number-DNxaWJG0.js @@ -0,0 +1 @@ +import{a as e,s as t,t as n}from"./blockly-DBw-ytY1.js";import{c as r,l as i}from"./index-2X_5uU-_.js";function a(){let a=window.Blockly.Translate;n.math_rndfixed={init:function(){this.appendValueInput(`x`).setCheck(`Number`).appendField(a(`math_rndfixed_round`)),this.appendDummyInput().appendField(a(`math_rndfixed_to`)).appendField(new e(0,1,25),`n`).appendField(a(`math_rndfixed_decplcs`)),this.setInputsInline(!0),this.setOutput(!0,`Number`),this.setColour(t.MATH_HUE),this.setTooltip(a(`math_rndfixed_tooltip`))}},i.forBlock.math_rndfixed=function(e){let t=i.valueToCode(e,`x`,r.ATOMIC),n=10**Number(e.getFieldValue(`n`));return[`Math.round(${t} * ${n}) / ${n}`,r.ATOMIC]}}export{a as install}; \ No newline at end of file diff --git a/admin/assets/blocks_object-CeScY42Q.js b/admin/assets/blocks_object-CeScY42Q.js new file mode 100644 index 00000000..2e3d72a4 --- /dev/null +++ b/admin/assets/blocks_object-CeScY42Q.js @@ -0,0 +1 @@ +import{f as e,o as t,p as n,t as r}from"./blockly-DBw-ytY1.js";import{c as i,l as a}from"./index-2X_5uU-_.js";import{c as o,l as s}from"./helpers-JkY7wkCZ.js";function c(){let c=window.Blockly,l=c.Translate;c.CustomBlocks=c.CustomBlocks||[],c.CustomBlocks.push(`Object`),c.Object={HUE:40,blocks:{}},c.Object.blocks.object_new=``,r.object_new_container={init:function(){this.setColour(c.Object.HUE),this.appendDummyInput().appendField(l(`object_new_attributes`)),this.appendStatementInput(`STACK`),this.setTooltip(l(`object_new_tooltip`)),this.contextMenu=!1}},r.object_new_mutator={init:function(){this.setColour(c.Object.HUE),this.appendDummyInput(`ATTR`).appendField(l(`object_new_attribute`)).appendField(new t(`attribute1`),`ATTR`),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(l(`object_new_tooltip`)),this.contextMenu=!1}},r.object_new={init:function(){this.appendDummyInput(`NAME`).appendField(l(`object_new`)),this.attributes_=[],this.itemCount_=0,this.setMutator(new e.MutatorIcon([`object_new_mutator`],this)),this.setInputsInline(!1),this.setOutput(!0),this.setColour(c.Object.HUE),this.setTooltip(l(`object_new_tooltip`))},mutationToDom:function(){let e=document.createElement(`mutation`);for(let t=0;t{var n;if(!((n=t.connection)!=null&&n.isConnected())){let n=e.newBlock(`text`);n.setShadow(!0),n.initSvg(),n.render(),n.outputConnection.connect(t.connection)}},100,r)}for(let e=this.itemCount_;this.getInput(`ATTR_${e}`);e++)this.removeInput(`ATTR_${e}`)}},a.forBlock.object_new=function(e){let t=e,n=[];for(let r=0;r attribute1 value `,r.object_set_attr={init:function(){this.appendDummyInput(`ATTR`).appendField(l(`object_set_attr`)).appendField(new t(`attribute1`),`ATTR`),this.appendValueInput(`OBJECT`).appendField(l(`object_set_attr_object`)),this.appendValueInput(`VALUE`).setCheck(null).appendField(l(`object_set_attr_value`)),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(c.Object.HUE),this.setTooltip(l(`object_set_attr_tooltip`))}},a.forBlock.object_set_attr=function(e){let t=e.getFieldValue(`ATTR`),n=a.valueToCode(e,`VALUE`,i.ATOMIC),r=a.valueToCode(e,`OBJECT`,i.ATOMIC);return r||=`{}`,`((obj) => { if (typeof obj === 'object') { obj[${o(t)}] = ${n}; } })(${r});\n`},c.Object.blocks.object_del_attr=` attribute1`,r.object_del_attr={init:function(){this.appendDummyInput(`ATTR`).appendField(l(`object_del_attr`)).appendField(new t(`attribute1`),`ATTR`),this.appendValueInput(`OBJECT`).appendField(l(`object_del_attr_object`)),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(c.Object.HUE),this.setTooltip(l(`object_del_attr_tooltip`))}},a.forBlock.object_del_attr=function(e){let t=e.getFieldValue(`ATTR`),n=a.valueToCode(e,`OBJECT`,i.ATOMIC);return n||=`{}`,`((obj) => { if (typeof obj === 'object') { delete obj[${o(t)}]; } })(${n});\n`},c.Object.blocks.object_has_attr=` attribute1 Object ID `,r.object_has_attr={init:function(){this.appendValueInput(`OBJECT`).appendField(l(`object_has_attr`)),this.appendDummyInput(`ATTR`).appendField(l(`object_has_attr_attr`)).appendField(new t(`attribute1`),`ATTR`),this.setInputsInline(!0),this.setOutput(!0,`Boolean`),this.setColour(c.Object.HUE),this.setTooltip(l(`object_has_attr_tooltip`))}},a.forBlock.object_has_attr=function(e){let t=a.valueToCode(e,`OBJECT`,i.ATOMIC),n=e.getFieldValue(`ATTR`);return[`Object.prototype.hasOwnProperty.call(${t}, ${o(n)})`,i.ATOMIC]},c.Object.blocks.object_keys=` Object ID `,r.object_keys={init:function(){this.appendValueInput(`OBJECT`).appendField(l(`object_keys`)),this.setInputsInline(!0),this.setOutput(!0,`Array`),this.setColour(c.Object.HUE),this.setTooltip(l(`object_keys_tooltip`))}},a.forBlock.object_keys=function(e){let t=a.valueToCode(e,`OBJECT`,i.ATOMIC);return t||=`{}`,[`Object.keys(${t})`,i.ATOMIC]}}export{c as install}; \ No newline at end of file diff --git a/admin/assets/blocks_procedures-ChquWIeu.js b/admin/assets/blocks_procedures-ChquWIeu.js new file mode 100644 index 00000000..77107d54 --- /dev/null +++ b/admin/assets/blocks_procedures-ChquWIeu.js @@ -0,0 +1,3 @@ +import{f as e,h as t,l as n,o as r,s as i,t as a}from"./blockly-DBw-ytY1.js";import{c as o,l as s}from"./index-2X_5uU-_.js";import{FieldScript as c,b64DecodeUnicode as l}from"./field_script-4IGidWJ7.js";function u(e){return a[e]}function d(){let d=window.Blockly,f=d.Translate,p=t.xml,m=u(`procedures_ifreturn`);m.FUNCTION_TYPES.includes(`procedures_defcustomreturn`)||m.FUNCTION_TYPES.push(`procedures_defcustomreturn`),m.FUNCTION_TYPES.includes(`procedures_defcustomnoreturn`)||m.FUNCTION_TYPES.push(`procedures_defcustomnoreturn`),d.Procedures.allProceduresNew=function(e){let t=n.allProcedures(e),r=()=>e.getProcedureMap().getProcedures().filter(e=>!!e.getReturnTypes()).map(e=>[e.getName(),e.getParameters().map(e=>e.getName()),!0]),i=t=>{let i=r();return e.getBlocksByType(t,!1).forEach(e=>{n.isProcedureBlock(e)||i.push(e.getProcedureDef())}),i};return t.concat([i(`procedures_defcustomnoreturn`),i(`procedures_defcustomreturn`)])},d.Procedures.flyoutCategoryNew=function(e){let t=[],n=(e,n)=>{if(!a[e])return;let r=p.createElement(`block`);r.setAttribute(`type`,e),r.setAttribute(`gap`,`16`);let o=p.createElement(`field`);o.setAttribute(`name`,`NAME`),o.appendChild(p.createTextNode(i[n])),r.appendChild(o),t.push(r)},r=e=>{if(!a[e])return;let n=p.createElement(`block`);n.setAttribute(`type`,e),n.setAttribute(`gap`,`16`),t.push(n)};n(`procedures_defnoreturn`,`PROCEDURES_DEFNORETURN_PROCEDURE`),n(`procedures_defreturn`,`PROCEDURES_DEFRETURN_PROCEDURE`),r(`procedures_ifreturn`),r(`procedures_return`),n(`procedures_defcustomnoreturn`,`PROCEDURES_DEFNORETURN_PROCEDURE`),n(`procedures_defcustomreturn`,`PROCEDURES_DEFRETURN_PROCEDURE`),t.length&&t[t.length-1].setAttribute(`gap`,`24`);let o=(e,n)=>{for(let[r,i]of e){let e=p.createElement(`block`);e.setAttribute(`type`,n),e.setAttribute(`gap`,`16`);let a=p.createElement(`mutation`);a.setAttribute(`name`,r),e.appendChild(a);for(let e of i){let t=p.createElement(`arg`);t.setAttribute(`name`,e),a.appendChild(t)}t.push(e)}},s=d.Procedures.allProceduresNew(e);return o(s[0],`procedures_callnoreturn`),o(s[1],`procedures_callreturn`),o(s[2],`procedures_callcustomnoreturn`),o(s[3],`procedures_callcustomreturn`),t},s.forBlock.procedures_defreturn=function(e){let t=s,r=t.nameDB_.getName(e.getFieldValue(`NAME`),n.CATEGORY_NAME),i=``;t.STATEMENT_PREFIX&&(i+=t.injectId(t.STATEMENT_PREFIX,e)),t.STATEMENT_SUFFIX&&(i+=t.injectId(t.STATEMENT_SUFFIX,e)),i&&=t.prefixLines(i,t.INDENT);let a=``;t.INFINITE_LOOP_TRAP&&(a=t.prefixLines(t.injectId(t.INFINITE_LOOP_TRAP,e),t.INDENT));let c=``,l=``,u=e.getInput(`STACK`)?t.statementToCode(e,`STACK`):``;e.getInput(`RETURN`)&&(c=t.valueToCode(e,`RETURN`,o.NONE)||``,u&&c&&(l=i),c&&=`${t.INDENT}return ${c};\n`);let d=`async function ${r}(${e.getVarModels().map(e=>t.nameDB_.getName(e.name,`VARIABLE`)).join(`, `)}) {\n${i}${a}${u}${l}${c}}`;return d=t.scrub_(e,d),t.definitions_[`%${r}`]=d,null},s.forBlock.procedures_defnoreturn=s.forBlock.procedures_defreturn,s.forBlock.procedures_callreturn=function(e){let t=s;return[`await ${t.nameDB_.getName(e.getFieldValue(`NAME`),n.CATEGORY_NAME)}(${e.getVarModels().map((n,r)=>t.valueToCode(e,`ARG${r}`,o.NONE)||`null`).join(`, `)})`,o.FUNCTION_CALL]};let h=t=>{let o=t?`procedures_defcustomreturn`:`procedures_defcustomnoreturn`,s=u(t?`procedures_defreturn`:`procedures_defnoreturn`),l=t?`procedures_defcustomreturn_name`:`procedures_defcustomnoreturn_name`,d=t?`PROCEDURES_DEFRETURN`:`PROCEDURES_DEFNORETURN`;a[o]={getProcedureModel(){return this.model},isProcedureDef(){return!0},init:function(){var a;let o=new r(``,n.rename);o.setSpellcheck(!1),this.appendDummyInput().appendField(f(l)).appendField(o,`NAME`).appendField(``,`PARAMS`),this.setMutator(new e.MutatorIcon([`procedures_mutatorarg`],this));let s=this.workspace.options;(s.comments||(a=s.parentWorkspace)!=null&&a.options.comments)&&i[`${d}_COMMENT`]&&this.setCommentText(i[`${d}_COMMENT`]),this.setStyle(`procedure_blocks`),t||this.setColour(i.PROCEDURES_HUE),this.setTooltip(i[`${d}_TOOLTIP`]),this.setHelpUrl(i[`${d}_HELPURL`]),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null,this.appendDummyInput(`SCRIPT`).appendField(new c(t?btoa(`return 0;`):``),`SCRIPT`),this.setInputsInline(!0),this.setStatements_(!1)},setStatements_:s.setStatements_,updateParams_:s.updateParams_,mutationToDom:s.mutationToDom,domToMutation:s.domToMutation,decompose:function(e){var t,r;let i=e.newBlock(`procedures_mutatorcontainer`);i.initSvg(),(t=i.getInput(`STATEMENT_INPUT`))==null||t.setVisible(!1);let a=(r=i.getInput(`STACK`))==null?void 0:r.connection;for(let t=0;t{let t=e?`procedures_callcustomreturn`:`procedures_callcustomnoreturn`,n=u(e?`procedures_callreturn`:`procedures_callnoreturn`);a[t]={init:n.init,getProcedureCall:n.getProcedureCall,renameProcedure:n.renameProcedure,setProcedureParameters_:n.setProcedureParameters_,updateShape_:n.updateShape_,mutationToDom:n.mutationToDom,domToMutation:n.domToMutation,getVarModels:n.getVarModels,onchange:n.onchange,customContextMenu:n.customContextMenu,defType_:e?`procedures_defcustomreturn`:`procedures_defcustomnoreturn`}};h(!0),s.forBlock.procedures_defcustomreturn=function(e){let t=s,r=t.nameDB_.getName(e.getFieldValue(`NAME`),n.CATEGORY_NAME),i=e.arguments_.map(e=>t.nameDB_.getName(e,`VARIABLE`)),a=l(e.getFieldValue(`SCRIPT`)||``).split(` +`).map(e=>` ${e}`),o=`async function ${r}(${i.join(`, `)}) {\n${a.join(` +`)}\n}`;return o=t.scrub_(e,o),t.definitions_[`%${r}`]=o,null},g(!0),s.forBlock.procedures_callcustomreturn=s.forBlock.procedures_callreturn,u(`procedures_ifreturn`).init=function(){let e=this.appendValueInput(`CONDITION`).setCheck(`Boolean`).appendField(i.CONTROLS_IF_MSG_IF),t=this.workspace.newBlock(`logic_boolean`);t.setShadow(!0),t.setFieldValue(`TRUE`,`BOOL`),t.outputConnection.connect(e.connection),this.appendValueInput(`VALUE`).appendField(i.PROCEDURES_DEFRETURN_RETURN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setStyle(`procedure_blocks`),this.setTooltip(i.PROCEDURES_IFRETURN_TOOLTIP),this.setHelpUrl(i.PROCEDURES_IFRETURN_HELPURL),this.hasReturnValue_=!0},h(!1),a.procedures_defcustomnoreturn.decompose=a.procedures_defcustomreturn.decompose,a.procedures_defcustomnoreturn.compose=a.procedures_defcustomreturn.compose,s.forBlock.procedures_defcustomnoreturn=s.forBlock.procedures_defcustomreturn,g(!1),s.forBlock.procedures_callcustomnoreturn=function(e){return`${s.forBlock.procedures_callcustomreturn(e,s)[0]};\n`},a.procedures_return={init:function(){this.appendValueInput(`VALUE`).appendField(i.PROCEDURES_DEFRETURN_RETURN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setStyle(`procedure_blocks`),this.setTooltip(i.PROCEDURES_IFRETURN_TOOLTIP),this.setHelpUrl(i.PROCEDURES_IFRETURN_HELPURL),this.hasReturnValue_=!0},mutationToDom:function(){let e=p.createElement(`mutation`);return e.setAttribute(`value`,String(Number(this.hasReturnValue_))),e},domToMutation:function(e){this.hasReturnValue_=e.getAttribute(`value`)===`1`,this.hasReturnValue_||(this.removeInput(`VALUE`),this.appendDummyInput(`VALUE`).appendField(i.PROCEDURES_DEFRETURN_RETURN))},onchange:function(e){var t,n;if((t=(n=this.workspace).isDragging)!=null&&t.call(n)||e.type!==`move`&&e.type!==`create`)return;let r=!1,a=this;do{if(this.FUNCTION_TYPES.includes(a.type)){r=!0;break}a=a.getSurroundParent()}while(a);r?(a.type===`procedures_defnoreturn`&&this.hasReturnValue_?(this.removeInput(`VALUE`),this.appendDummyInput(`VALUE`).appendField(i.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!1):a.type===`procedures_defreturn`&&!this.hasReturnValue_&&(this.removeInput(`VALUE`),this.appendValueInput(`VALUE`).appendField(i.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!0),this.setWarningText(null)):this.setWarningText(i.PROCEDURES_IFRETURN_WARNING),this.isInFlyout||this.setDisabledReason(!r,`UNPARENTED_IFRETURN`)},FUNCTION_TYPES:[`procedures_defnoreturn`,`procedures_defreturn`,`procedures_defcustomreturn`,`procedures_defcustomnoreturn`]},s.forBlock.procedures_return=function(e,t){let n=``;if(t.STATEMENT_SUFFIX&&(n+=t.prefixLines(t.injectId(t.STATEMENT_SUFFIX,e),t.INDENT)),e.hasReturnValue_){let r=t.valueToCode(e,`VALUE`,o.NONE)||`null`;n+=`${t.INDENT}return ${r};\n`}else n+=`${t.INDENT}return;\n`;return n}}export{d as install}; \ No newline at end of file diff --git a/admin/assets/blocks_sendto-BhFgmaXl.js b/admin/assets/blocks_sendto-BhFgmaXl.js new file mode 100644 index 00000000..21ff8932 --- /dev/null +++ b/admin/assets/blocks_sendto-BhFgmaXl.js @@ -0,0 +1,5 @@ +import{f as e,i as t,o as n,p as r,r as i,t as a}from"./blockly-DBw-ytY1.js";import{c as o,l as s}from"./index-2X_5uU-_.js";import{c,d as l,i as u,l as d,r as f,s as p}from"./helpers-JkY7wkCZ.js";function m(e,t){let n=parseFloat(e);return t===`min`?n*6e4:t===`sec`?n*1e3:n}function h(){let h=window.Blockly,g=h.Translate,_=window.getHelp;h.CustomBlocks=h.CustomBlocks||[],h.CustomBlocks.push(`Sendto`),h.Sendto={HUE:310,blocks:{}};let v=()=>new i(`FALSE`,function(e){this.getSourceBlock().updateShape_(f(e))});h.Sendto.blocks.sendto_custom=` admin.0 send FALSE `,a.sendto_custom_container={init:function(){this.appendDummyInput().appendField(g(`sendto_custom_arguments`)),this.appendStatementInput(`STACK`),this.setColour(h.Sendto.HUE),this.setTooltip(g(`sendto_custom_arg_tooltip`)),this.contextMenu=!1}},a.sendto_custom_mutator={init:function(){this.appendDummyInput(`ATTR`).appendField(g(`sendto_custom_argument`)).appendField(new n(`parameter`),`ATTR`),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(h.Sendto.HUE),this.setTooltip(g(`sendto_custom_arg_tooltip`)),this.contextMenu=!1}},a.sendto_custom={init:function(){var r;let i=[];if((r=window.main)!=null&&r.instances){for(let e of window.main.instances){var a;if((a=window.main.objects[e])!=null&&(a=a.common)!=null&&a.messagebox){let t=e.substring(15);i.push([t,t])}}i.length||i.push([g(`sendto_no_instances`),``]),this.appendDummyInput(`INSTANCE`).appendField(g(`sendto_custom`)).appendField(new t(i),`INSTANCE`)}else this.appendDummyInput(`INSTANCE`).appendField(g(`sendto_custom`)).appendField(new n(`adapter.0`),`INSTANCE`);this.appendDummyInput(`COMMAND`).appendField(g(`sendto_custom_command`)).appendField(new n(`send`),`COMMAND`),this.appendDummyInput(`LOG`).appendField(g(`loglevel`)).appendField(new t(u()),`LOG`),this.appendDummyInput(`WITH_STATEMENT`).appendField(g(`with_results`)).appendField(v(),`WITH_STATEMENT`),this.attributes_=[],this.itemCount_=0,this.setMutator(new e.MutatorIcon([`sendto_custom_mutator`],this)),this.updateShape_(),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(h.Sendto.HUE),this.setTooltip(g(`sendto_custom_tooltip`)),this.setHelpUrl(_(`sendto_custom_help`))},mutationToDom:function(){let e=document.createElement(`mutation`);return e.setAttribute(`items`,this.attributes_.map(e=>encodeURIComponent(e)).join(`,`)),e},domToMutation:function(e){this.attributes_=e.getAttribute(`items`).split(`,`).map(e=>decodeURIComponent(e)),this.itemCount_=this.attributes_.length,this.updateShape_()},decompose:function(e){var t;let n=e.newBlock(`sendto_custom_container`);n.initSvg();let r=(t=n.getInput(`STACK`))==null?void 0:t.connection;for(let t=0;t=1&&n.fieldRow[0].setValue(this.attributes_[e]):(n=this.appendValueInput(`ARG${e}`).setAlign(r.Align.RIGHT),n.appendField(this.attributes_[e])),setTimeout(e=>{var n;if(!((n=e.connection)!=null&&n.isConnected())){let n=t.newBlock(`text`);n.setShadow(!0),n.initSvg(),n.render(),n.outputConnection.connect(e.connection)}},100,n)}for(let e=this.itemCount_;this.getInput(`ARG${e}`);e++)this.removeInput(`ARG${e}`);l(this,e)}},s.forBlock.sendto_custom=function(e){let t=e,n=e.getFieldValue(`INSTANCE`),r=e.getFieldValue(`LOG`),i=e.getFieldValue(`COMMAND`),a=``,l;f(e.getFieldValue(`WITH_STATEMENT`))&&(l=s.statementToCode(e,`STATEMENT`));let u=[];for(let d=0;d {\n${l}});\n${a}`:`sendTo('${n}', ${c(i)}, ${p});\n${a}`;u.push({attr:f.replace(/'/g,`\\'`),val:p})}let d=u.length?u.map(e=>s.prefixLines(`'${e.attr}': ${e.val},`,s.INDENT)).join(` +`):``;return r&&(a=`console.${r}('sendTo[custom] ${n}: ${u.length?u.map(e=>`${e.attr}: ' + ${e.val} + '`).join(`, `):`[no args]`}');\n`),l?`sendTo('${n}', ${c(i)}, {\n${d}\n}, async (result) => {\n${l}});\n${a}`:`sendTo('${n}', ${c(i)}, {\n${d}\n});\n${a}`},h.Sendto.blocks.sendto_otherscript=` 0 1000 ms customMessage FALSE Script Object ID `,a.sendto_otherscript={init:function(){var e;let r=[];if((e=window.main)!=null&&e.instances)for(let e of window.main.instances){let t=e.match(/^system\.adapter\.javascript\.(\d+)$/);if(t){let e=parseInt(t[1],10);r.push([`javascript.${e}`,String(e)])}}if(!r.length)for(let e=0;e<=4;e++)r.push([`javascript.${e}`,String(e)]);this.appendDummyInput(`NAME`).appendField(`✉️ ${g(`sendto_otherscript_name`)}`),this.appendDummyInput(`INSTANCE`).appendField(g(`sendto_otherscript_instance`)).appendField(new t(r),`INSTANCE`),this.appendValueInput(`OID`).appendField(g(`sendto_otherscript_script`)).setCheck(null),this.appendDummyInput().appendField(g(`sendto_otherscript_timeout`)).appendField(new n(`1000`),`TIMEOUT`).appendField(new t([[g(`timeouts_settimeout_ms`),`ms`],[g(`timeouts_settimeout_sec`),`sec`],[g(`timeouts_settimeout_min`),`min`]]),`UNIT`),this.appendDummyInput(`MESSAGE`).appendField(g(`sendto_otherscript_message`)).appendField(new n(`customMessage`),`MESSAGE`),this.appendValueInput(`DATA`).appendField(g(`sendto_otherscript_data`)),this.appendDummyInput(`WITH_STATEMENT`).appendField(g(`with_results`)).appendField(v(),`WITH_STATEMENT`),this.updateShape_(),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(h.Sendto.HUE),this.setTooltip(g(`sendto_otherscript_tooltip`)),this.setHelpUrl(_(`sendto_otherscript_help`))},updateShape_:function(e){l(this,e)}},s.forBlock.sendto_otherscript=function(e){let t=e.getFieldValue(`INSTANCE`),n=s.valueToCode(e,`OID`,o.ATOMIC),r=e.getFieldValue(`MESSAGE`),i=m(e.getFieldValue(`TIMEOUT`),e.getFieldValue(`UNIT`)),a;f(e.getFieldValue(`WITH_STATEMENT`))&&(a=s.statementToCode(e,`STATEMENT`));let l=p(n),u=s.valueToCode(e,`DATA`,o.ATOMIC)||`true`,d=`{ instance: ${t}, script: ${n}${l?` /* ${l} */`:``}, message: ${c(r)} }`;return a?`messageTo(${d}, ${u}, { timeout: ${i} }, (result) => {\n${a}})\n`:`messageTo(${d}, ${u}, { timeout: ${i} });\n`},h.Sendto.blocks.sendto_gethistory=` default none 0 500 min dayStart dayEnd `,a.sendto_gethistory={init:function(){var e;let r=[[`default`,`default`]];if((e=window.main)!=null&&e.instances)for(let e of window.main.instances){let t=e.match(/^system\.adapter\.(history|influxdb|sql)\.(\d+)$/);if(t){let e=`${t[1]}.${t[2]}`;r.push([e,e])}}this.appendDummyInput(`NAME`).appendField(g(`sendto_gethistory_name`)),this.appendDummyInput(`INSTANCE`).appendField(g(`sendto_gethistory_instance`)).appendField(new t(r),`INSTANCE`),this.appendValueInput(`OID`).appendField(g(`sendto_gethistory_oid`)).setCheck(null),this.appendValueInput(`START`).appendField(g(`sendto_gethistory_start`)).setCheck(null),this.appendValueInput(`END`).appendField(g(`sendto_gethistory_end`)).setCheck(null),this.appendDummyInput(`AGGREGATE`).appendField(g(`sendto_gethistory_aggregate`)).appendField(new t([[g(`sendto_gethistory_none`),`none`],[g(`sendto_gethistory_minimum`),`min`],[g(`sendto_gethistory_maximum`),`max`],[g(`sendto_gethistory_avg`),`average`],[g(`sendto_gethistory_cnt`),`count`]]),`AGGREGATE`),this.appendDummyInput(`UNIT`).appendField(g(`sendto_gethistory_step`)).appendField(new n(`0`),`STEP`).appendField(new t([[g(`sendto_gethistory_ms`),`ms`],[g(`sendto_gethistory_sec`),`sec`],[g(`sendto_gethistory_min`),`min`],[g(`sendto_gethistory_hour`),`hour`],[g(`sendto_gethistory_day`),`day`]]),`UNIT`),this.appendDummyInput(`COUNT`).appendField(g(`sendto_gethistory_count`)).appendField(new n(`0`),`COUNT`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(h.Sendto.HUE),this.setTooltip(g(`sendto_gethistory_tooltip`)),this.setHelpUrl(_(`sendto_gethistory_help`))}},s.forBlock.sendto_gethistory=function(e){let t=e.getFieldValue(`INSTANCE`),n=s.valueToCode(e,`OID`,o.ATOMIC),r=s.valueToCode(e,`START`,o.ATOMIC),i=s.valueToCode(e,`END`,o.ATOMIC),a=e.getFieldValue(`AGGREGATE`),l=e.getFieldValue(`UNIT`),u=parseInt(e.getFieldValue(`COUNT`),10),d=parseFloat(e.getFieldValue(`STEP`));l===`day`?d*=864e5:l===`hour`?d*=36e5:l===`min`?d*=6e4:l===`sec`&&(d*=1e3);let f=s.statementToCode(e,`STATEMENT`),m=p(n);return`getHistory(${t==="default"?``:`${c(t)}, `}{\n id: ${n}${m?` /* ${m} */`:``},\n start: ${r},\n end: ${i},\n`+(d>0&&a!==`none`?` step: ${d},\n`:``)+(d===0||a===`none`?` count: ${u},\n`:``)+` aggregate: '${a}',\n removeBorderValues: true,\n}, async (err, result) => {\n if (err) {\n console.error(err);\n`+(f?` } else { +`:``)+(f?s.prefixLines(f,s.INDENT):``)+` } +}); +`}}export{h as install}; \ No newline at end of file diff --git a/admin/assets/blocks_switch-DlLu45bT.js b/admin/assets/blocks_switch-DlLu45bT.js new file mode 100644 index 00000000..7300bafd --- /dev/null +++ b/admin/assets/blocks_switch-DlLu45bT.js @@ -0,0 +1,2 @@ +import{f as e,t}from"./blockly-DBw-ytY1.js";import{c as n,l as r}from"./index-2X_5uU-_.js";function i(){let i=window.Blockly.Translate;t.logic_switch_case={init:function(){this.appendValueInput(`CONDITION`).appendField(i(`logic_switch_case_is`)),this.appendValueInput(`CASECONDITION0`).appendField(i(`logic_switch_case_of`)),this.appendStatementInput(`CASE0`).appendField(i(`logic_switch_do`)),this.setMutator(new e.MutatorIcon([`case_incaseof`,`case_default`],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(`%{BKY_LOGIC_HUE}`),this.setTooltip(i(`logic_switch_tooltip`)),this.caseCount_=0,this.defaultCount_=0},mutationToDom:function(){if(!this.caseCount_&&!this.defaultCount_)return null;let e=document.createElement(`mutation`);return this.caseCount_&&e.setAttribute(`case`,String(this.caseCount_)),this.defaultCount_&&e.setAttribute(`default`,`1`),e},domToMutation:function(e){this.caseCount_=parseInt(e.getAttribute(`case`),10),this.defaultCount_=parseInt(e.getAttribute(`default`),10);for(let e=1;e<=this.caseCount_;e++)this.appendValueInput(`CASECONDITION${e}`).appendField(i(`logic_switch_case_of`)),this.appendStatementInput(`CASE${e}`).appendField(i(`logic_switch_do`));this.defaultCount_&&this.appendStatementInput(`ONDEFAULT`).appendField(`default`)},decompose:function(e){var t;let n=e.newBlock(`control_case`);n.initSvg();let r=(t=n.getInput(`STACK`))==null?void 0:t.connection;for(let t=1;t<=this.caseCount_;t++){let t=e.newBlock(`case_incaseof`);t.initSvg(),r.connect(t.previousConnection),r=t.nextConnection}if(this.defaultCount_){let t=e.newBlock(`case_default`);t.initSvg(),r.connect(t.previousConnection)}return n},compose:function(e){this.defaultCount_&&this.removeInput(`ONDEFAULT`),this.defaultCount_=0;for(let e=this.caseCount_;e>0;e--)this.removeInput(`CASECONDITION${e}`),this.removeInput(`CASE${e}`);this.caseCount_=0;let t=e.getInputTargetBlock(`STACK`);for(;t;){switch(t.type){case`case_incaseof`:{this.caseCount_++;let e=this.appendValueInput(`CASECONDITION${this.caseCount_}`).appendField(i(`logic_switch_case_of`)),a=this.appendStatementInput(`CASE${this.caseCount_}`).appendField(i(`logic_switch_do`));if(t.valueConnection_){var n;(n=e.connection)==null||n.connect(t.valueConnection_)}if(t.statementConnection_){var r;(r=a.connection)==null||r.connect(t.statementConnection_)}break}case`case_default`:{this.defaultCount_++;let e=this.appendStatementInput(`ONDEFAULT`).appendField(`default`);if(t.statementConnection_){var a;(a=e.connection)==null||a.connect(t.statementConnection_)}break}default:throw`Unknown block type.`}t=t.nextConnection&&t.nextConnection.targetBlock()}},saveConnections:function(e){let t=e.getInputTargetBlock(`STACK`),n=1;for(;t;){var r;switch(t.type){case`case_incaseof`:{var i,a;let e=this.getInput(`CASECONDITION${n}`),r=this.getInput(`CASE${n}`);t.valueConnection_=e==null||(i=e.connection)==null?void 0:i.targetConnection,t.statementConnection_=r==null||(a=r.connection)==null?void 0:a.targetConnection,n++;break}case`case_default`:{var o;let e=this.getInput(`ONDEFAULT`);t.statementConnection_=e==null||(o=e.connection)==null?void 0:o.targetConnection;break}default:throw`Unknown block type`}t=(r=t.nextConnection)==null?void 0:r.targetBlock()}}},t.control_case={init:function(){this.appendDummyInput().appendField(i(`logic_switch_case_is`)),this.appendStatementInput(`STACK`),this.setColour(`%{BKY_LOGIC_HUE}`),this.setTooltip(i(`logic_switch_control_case_tooltip`)),this.contextMenu=!1}},t.case_incaseof={init:function(){this.appendDummyInput().appendField(i(`logic_switch_case_of`)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(`%{BKY_LOGIC_HUE}`),this.setTooltip(i(`logic_switch_case_incaseof_tooltip`)),this.contextMenu=!1}},t.case_default={init:function(){this.appendDummyInput().appendField(`default`),this.setPreviousStatement(!0),this.setNextStatement(!1),this.setColour(`%{BKY_LOGIC_HUE}`),this.setTooltip(i(`logic_switch_default_tooltip`)),this.contextMenu=!1}},r.forBlock.logic_switch_case=function(e){let t=e,i=``,a,o,s=r.valueToCode(e,`CONDITION`,n.NONE)||null;if(s){if(/^\(?([._$\d\w"'?: ()])*\)?$/g.test(s)){i=`\nswitch (${s}) {\n`;let c=r.valueToCode(e,`CASECONDITION0`,n.NONE)||null,l=r.statementToCode(e,`CASE0`);i+=`\tcase ${c}:\n${l}\n\t\tbreak;\n`;for(let s=1;s<=t.caseCount_;s++)o=r.valueToCode(e,`CASECONDITION${s}`,n.NONE)||null,o&&(a=r.statementToCode(e,`CASE${s}`),i+=`\tcase ${o}:\n${a}\n\t\tbreak;\n`);t.defaultCount_&&(a=r.statementToCode(e,`ONDEFAULT`),i+=`\tdefault:\n${a}\n\t\tbreak;\n`),i+=`} +`}else alert(`logic_switch_case: ${s} is not a variable name`)}return i}}export{i as install}; \ No newline at end of file diff --git a/admin/assets/blocks_system-DhweUbd2.js b/admin/assets/blocks_system-DhweUbd2.js new file mode 100644 index 00000000..21ef8182 --- /dev/null +++ b/admin/assets/blocks_system-DhweUbd2.js @@ -0,0 +1 @@ +import{i as e,o as t,r as n,s as r,t as i}from"./blockly-DBw-ytY1.js";import{c as a,l as o}from"./index-2X_5uU-_.js";import{c as s,o as c,r as l,u}from"./helpers-JkY7wkCZ.js";import{FieldOID as d}from"./field_oid-CJZIeruf.js";function f(){let f=window.Blockly,p=f.Translate,m=window.getHelp;f.CustomBlocks=f.CustomBlocks||[],f.CustomBlocks.push(`System`),f.System={HUE:210,blocks:{},WARNING_PARENTS:[`on_ext`]};let h=e=>[[p(`get_value_val`),`val`],[p(`get_value_ack`),`ack`],[p(`get_value_ts`),`ts`],[p(`get_value_lc`),`lc`],[p(`get_value_q`),`q`],[p(`get_value_comment`),`c`],[p(`get_value_from`),`from`],...e?[[p(`get_value_user`),`user`]]:[],[p(`get_common_name`),`common.name`],[p(`get_common_desc`),`common.desc`],[p(`get_common_unit`),`common.unit`],[p(`get_common_role`),`common.role`],[p(`get_common_state_type`),`common.type`],[p(`get_common_read`),`common.read`],[p(`get_common_write`),`common.write`]],g=e=>e===`type`||e.startsWith(`common.`),_=function(){let e=this.getParent();e&&f.System.WARNING_PARENTS.includes(e.type)?this.setWarningText(p(`false_connection_trigger_warning`),this.id):this.setWarningText(null,this.id)},v=r=>({mutationToDom:function(){let e=document.createElement(`mutation`);return e.setAttribute(`delay_input`,String(l(this.getFieldValue(`WITH_DELAY`)))),e},domToMutation:function(e){this.updateShape_(l(e.getAttribute(`delay_input`)))},updateShape_:function(i){i?this.getInput(`DELAY`)||this.appendDummyInput(`DELAY`).appendField(` `).appendField(new t(`1000`),`DELAY_MS`).appendField(new e([[p(`control_ms`),`ms`],[p(`control_sec`),`sec`],[p(`control_min`),`min`]]),`UNIT`):this.getInput(`DELAY`)&&this.removeInput(`DELAY`),i?this.getInput(`CLEAR_RUNNING_INPUT`)||this.appendDummyInput(`CLEAR_RUNNING_INPUT`).appendField(p(r)).appendField(new n,`CLEAR_RUNNING`):this.getInput(`CLEAR_RUNNING_INPUT`)&&this.removeInput(`CLEAR_RUNNING_INPUT`)}}),y=()=>new n(`FALSE`,function(e){this.getSourceBlock().updateShape_(l(e))}),b=e=>u(e.getFieldValue(`DELAY_MS`),e.getFieldValue(`UNIT`));f.System.blocks.global_var=` scriptName`,i.global_var={init:function(){this.appendDummyInput(`VAR`).appendField(new e([[p(`global_var_scriptname`),`scriptName`],[p(`global_var_defaultdatadir`),`defaultDataDir`],[p(`global_var_verbose`),`verbose`]]),`VAR`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(f.System.HUE),this.setTooltip(p(`global_var_tooltip`)),this.setHelpUrl(m(`global_var`))}},o.forBlock.global_var=function(e){return[e.getFieldValue(`VAR`),a.ATOMIC]},f.System.blocks.secret=``;let x=()=>{var e;return((e=window.main)==null?void 0:e.secrets)||[]},S=()=>x().length?x().map(e=>[e.name,e.name]):[[p(`secret_no_secrets`),``]],C=function(){var e,t;let n=(e=this.getSourceBlock())==null?void 0:e.getFieldValue(`NAME`),r=(t=x().find(e=>e.name===n))==null?void 0:t.fields;return(r!=null&&r.length?r:[`key`,`login`,`password`]).map(e=>[e,e])};i.secret={init:function(){let n=this.appendDummyInput(`SECRET`).appendField(p(`secret`));x().length?n.appendField(new e(S),`NAME`):n.appendField(new t(`CameraPassword`),`NAME`),n.appendField(p(`secret_attr`)).appendField(new e(C),`ATTR`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(f.System.HUE),this.setTooltip(p(`secret_tooltip`)),this.setHelpUrl(m(`secret_help`))}},o.forBlock.secret=function(e){let t=e.getFieldValue(`NAME`),n=e.getFieldValue(`ATTR`),r=/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(n)?`.${n}`:`[${s(n)}]`;return[`SECRETS[${s(t)}]?${r}`,a.ATOMIC]},f.System.blocks.debug=` info test `,i.debug={init:function(){this.appendValueInput(`TEXT`).setCheck(null).appendField(p(`debug`)),this.appendDummyInput(`Severity`).appendField(new e([[p(`loglevel_debug`),`debug`],[p(`loglevel_info`),`info`],[p(`loglevel_warn`),`warn`],[p(`loglevel_error`),`error`]]),`Severity`),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`debug_tooltip`)),this.setHelpUrl(m(`debug_help`))}},o.forBlock.debug=function(e){let t=o.valueToCode(e,`TEXT`,a.ATOMIC);return`console.${e.getFieldValue(`Severity`)}(${t});\n`},f.System.blocks.comment=``,i.comment={init:function(){this.appendDummyInput(`COMMENT`).appendField(new f.FieldMultilineInput(p(`comment`)),`COMMENT`),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(`#FFFF00`),this.setTooltip(p(`comment_tooltip`))}},o.forBlock.comment=function(e){return`${o.prefixLines(e.getFieldValue(`COMMENT`),`// `)}\n`},f.System.blocks.control=` FALSE`,i.control={init:function(){this.appendDummyInput().appendField(p(`control`)),this.appendDummyInput(`OID`).appendField(new d(p(`select_id`),`state`),`OID`),this.appendValueInput(`VALUE`).setCheck(null).appendField(p(`control_with`)),this.appendDummyInput(`WITH_DELAY`).appendField(p(`control_delay`)).appendField(y(),`WITH_DELAY`),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`control_tooltip`)),this.setHelpUrl(m(`control_help`))},...v(`control_clear_running`)},o.forBlock.control=function(e){let t=e.getFieldValue(`OID`);r.VARIABLES_DEFAULT_NAME=`value`;let n=b(e),i=l(e.getFieldValue(`CLEAR_RUNNING`)),s=o.valueToCode(e,`VALUE`,a.ATOMIC),u=c(t),d=u?` /* ${u} */`:``;return l(e.getFieldValue(`WITH_DELAY`))?`setStateDelayed('${t}'${d}, ${s}, ${n}, ${i});\n`:`setState('${t}'${d}, ${s});\n`},f.System.blocks.toggle=` FALSE`,i.toggle={init:function(){this.appendDummyInput().appendField(p(`toggle`)),this.appendDummyInput(`OID`).appendField(new d(p(`select_id`),`state`),`OID`),this.appendDummyInput(`WITH_DELAY`).appendField(p(`toggle_delay`)).appendField(y(),`WITH_DELAY`),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`toggle_tooltip`)),this.setHelpUrl(m(`toggle_help`))},...v(`toggle_clear_running`)},o.forBlock.toggle=function(e){var t;let n=e.getFieldValue(`OID`);r.VARIABLES_DEFAULT_NAME=`value`;let i=b(e),a=(t=window.main)==null||(t=t.objects[n])==null?void 0:t.common,s=(a==null?void 0:a.type)||`boolean`,u=c(n),d=u?` /* ${u} */`:``,f=l(e.getFieldValue(`CLEAR_RUNNING`)),p;if(s===`number`){let e=a.max===void 0?100:parseFloat(a.max),t=a.min===void 0?0:parseFloat(a.min);p=`setState('${n}'${d}, state ? (state.val === ${t} ? ${e} : ${t}) : ${e});`}else p=`setState('${n}'${d}, state ? !state.val : true);`;let m=l(e.getFieldValue(`WITH_DELAY`))?`setStateDelayed('${n}'${d}, state ? !state.val : true, ${i}, ${f});`:p;return`getState('${n}', (err, state) => {\n${o.prefixLines(m,o.INDENT)}\n});\n`},f.System.blocks.update=` FALSE`,i.update={init:function(){this.appendDummyInput().appendField(p(`update`)),this.appendDummyInput(`OID`).appendField(new d(p(`select_id`),`state`),`OID`),this.appendValueInput(`VALUE`).setCheck(null).appendField(p(`update_with`)),this.appendDummyInput(`WITH_DELAY`).appendField(p(`update_delay`)).appendField(y(),`WITH_DELAY`),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`update_tooltip`)),this.setHelpUrl(m(`update_help`))},...v(`control_clear_running`)},o.forBlock.update=function(e){let t=e.getFieldValue(`OID`);r.VARIABLES_DEFAULT_NAME=`value`;let n=o.valueToCode(e,`VALUE`,a.ATOMIC),i=b(e),s=l(e.getFieldValue(`CLEAR_RUNNING`)),u=c(t),d=u?` /* ${u} */`:``;return l(e.getFieldValue(`WITH_DELAY`))?`setStateDelayed('${t}'${d}, ${n}, true, ${i}, ${s});\n`:`setState('${t}'${d}, ${n}, true);\n`},f.System.blocks.control_ex=` false FALSE TRUE 0 0 `,i.control_ex={init:function(){this.appendDummyInput().appendField(p(`control_ex`)),this.appendValueInput(`OID`).setCheck(`String`).appendField(p(`field_oid_OID`)),this.appendDummyInput(`TYPE`).appendField(new e([[p(`control_ex_control`),`false`],[p(`control_ex_update`),`true`]]),`TYPE`),this.appendValueInput(`VALUE`).setCheck(null).appendField(p(`control_ex_value`)),this.appendValueInput(`DELAY_MS`).setCheck(`Number`).appendField(p(`control_ex_delay`)),this.appendValueInput(`EXPIRE`).setCheck(`Number`).appendField(p(`control_ex_expire`)),this.appendDummyInput(`CLEAR_RUNNING_INPUT`).appendField(p(`control_ex_clear_running`)).appendField(new n,`CLEAR_RUNNING`),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`control_tooltip`)),this.setHelpUrl(m(`control_help`))}},o.forBlock.control_ex=function(e){let t=o.valueToCode(e,`OID`,a.ATOMIC),n=o.valueToCode(e,`VALUE`,a.ATOMIC),r=o.valueToCode(e,`DELAY_MS`,a.ATOMIC),i=o.valueToCode(e,`EXPIRE`,a.ATOMIC),s=l(e.getFieldValue(`CLEAR_RUNNING`));return`setStateDelayed(${t}, { val: ${n}, ack: ${l(e.getFieldValue(`TYPE`))}${i?`, expire: ${i}`:``} }, parseInt(((${r}) || '').toString(), 10), ${s});\n`},f.System.blocks.create=` 0_userdata.0.example`,i.create={init:function(){this.appendDummyInput().appendField(p(`create`)),this.appendDummyInput(`NAME`).appendField(p(`create_oid`)).appendField(new t(`0_userdata.0.example`),`NAME`);let e=this.appendValueInput(`VALUE`).setCheck(null).appendField(p(`create_init`));e.connection&&(e.connection._optional=!0);let n=this.appendValueInput(`COMMON`).setCheck(null).appendField(p(`create_common`));n.connection&&(n.connection._optional=!0),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`create_tooltip`)),this.setHelpUrl(m(`create_help`))}},o.forBlock.create=function(e){let t=e.getFieldValue(`NAME`),n=o.valueToCode(e,`VALUE`,a.ATOMIC),r=n!==null&&n!==``?`, ${n}`:``,i=o.valueToCode(e,`COMMON`,a.ATOMIC),c=i!==null&&i!==``?`, ((common) => typeof common !== 'object' ? JSON.parse(common) : common)(${i})`:``,l=o.statementToCode(e,`STATEMENT`);return`createState(${s(t)}${r}${c}, async () => {\n${l}});\n`},f.System.blocks.create_ex=` 0_userdata.0.example string FALSE FALSE`,i.create_ex={init:function(){this.appendDummyInput().appendField(p(`create`)),this.appendDummyInput(`NAME`).appendField(p(`create_oid`)).appendField(new t(`0_userdata.0.example`),`NAME`),this.appendDummyInput(`TYPE`).appendField(p(`create_type`)).appendField(new e([[p(`create_type_string`),`string`],[p(`create_type_number`),`number`],[p(`create_type_boolean`),`boolean`],[p(`create_type_json`),`json`],[p(`create_type_object`),`object`],[p(`create_type_array`),`array`]]),`TYPE`);let r=this.appendValueInput(`VALUE`).setCheck(null).appendField(p(`create_init`));r.connection&&(r.connection._optional=!0),this.appendDummyInput(`READABLE_INPUT`).appendField(p(`create_readable`)).appendField(new n(`FALSE`),`READABLE`),this.appendDummyInput(`WRITEABLE_INPUT`).appendField(p(`create_writeable`)).appendField(new n(`FALSE`),`WRITEABLE`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`create_tooltip`)),this.setHelpUrl(m(`create_help`))}},o.forBlock.create_ex=function(e){let t=e.getFieldValue(`NAME`),n=e.getFieldValue(`TYPE`),r=``,i=o.valueToCode(e,`VALUE`,a.ATOMIC);i!==null&&i!==``&&(r=n===`number`?`, parseFloat(${i})`:n===`boolean`?`, !!${i}`:n===`string`?`, String(${i})`:`, ${i}`);let c=l(e.getFieldValue(`READABLE`)),u=l(e.getFieldValue(`WRITEABLE`)),d=o.statementToCode(e,`STATEMENT`);return`createState(${s(t)}${r}, { type: '${n}', read: ${c}, write: ${u} }, async () => {\n${d}});\n`},f.System.blocks.get_value=` val`,i.get_value={init:function(){this.appendDummyInput(`ATTR`).appendField(new e(h(!0)),`ATTR`),this.appendDummyInput().appendField(p(`get_value_OID`)),this.appendDummyInput().appendField(new d(p(`select_id`),`state`),`OID`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(f.System.HUE),this.setTooltip(p(`get_value_tooltip`)),this.setHelpUrl(m(`get_value_help`))},onchange:_},o.forBlock.get_value=function(e){let t=e.getFieldValue(`OID`),n=e.getFieldValue(`ATTR`);return g(n)?[`(await getObjectAsync('${t}')).${n}`,a.ATOMIC]:[`getState(${s(t)}).${n}`,a.ATOMIC]},f.System.blocks.get_value_var=` val `,i.get_value_var={init:function(){this.appendDummyInput(`ATTR`).appendField(new e(h(!1)),`ATTR`),this.appendDummyInput().appendField(p(`get_value_OID`)),this.appendValueInput(`OID`).setCheck(null),this.setInputsInline(!0),this.setOutput(!0),this.setColour(f.System.HUE),this.setTooltip(p(`get_value_tooltip`)),this.setHelpUrl(m(`get_value_help`))},onchange:_},o.forBlock.get_value_var=function(e){let t=o.valueToCode(e,`OID`,a.ATOMIC),n=e.getFieldValue(`ATTR`);return g(n)?[`(await getObjectAsync(${t})).${n}`,a.ATOMIC]:[`getState(${t}).${n}`,a.ATOMIC]},f.System.blocks.get_value_async=` val`,i.get_value_async={init:function(){this.appendDummyInput(`ATTR`).appendField(new e(h(!1)),`ATTR`),this.appendDummyInput().appendField(p(`get_value_OID`)),this.appendDummyInput().appendField(new d(p(`select_id`),`state`),`OID`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`get_value_tooltip`)),this.setHelpUrl(m(`get_value_help`))}},o.forBlock.get_value_async=function(e){let t=e.getFieldValue(`OID`),n=e.getFieldValue(`ATTR`),r=o.statementToCode(e,`STATEMENT`),i=g(n)?{call:`getObjectAsync`,args:`(err, obj)`,from:`obj`}:{call:`getState`,args:`(err, state)`,from:`state`};return`${i.call}(${s(t)}, async ${i.args} => {\n${o.prefixLines(`let value = ${i.from}.${n};`,o.INDENT)}\n${r}});\n`},f.System.blocks.get_object=``,i.get_object={init:function(){this.appendDummyInput().appendField(p(`get_object`)),this.appendDummyInput().appendField(new d(p(`select_id`),`all`),`OID`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(f.Object.HUE),this.setTooltip(p(`get_object_tooltip`)),this.setHelpUrl(m(`get_object_help`))},onchange:function(){let e=this.getParent();e&&f.System.WARNING_PARENTS.includes(e.type)?this.setWarningText(p(`false_connection_trigger_warning`),this.id):e&&[`direct`,`control_ex`,`get_value_var`].includes(e.type)?this.setWarningText(p(`get_object_connection_warning`),this.id):this.setWarningText(null,this.id)}},o.forBlock.get_object=function(e){return[`getObject(${s(e.getFieldValue(`OID`))})`,a.ATOMIC]},f.System.blocks.get_object_async=``,i.get_object_async={init:function(){this.appendDummyInput().appendField(p(`get_object`)),this.appendDummyInput().appendField(new d(p(`select_id`),`all`),`OID`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setColour(f.Object.HUE),this.setTooltip(p(`get_object_tooltip`)),this.setHelpUrl(m(`get_object_help`))}},o.forBlock.get_object_async=function(e){let t=o.statementToCode(e,`STATEMENT`);return`getObjectAsync(${s(e.getFieldValue(`OID`))}).then(async (obj) => {\n${t}});\n`},f.System.blocks.state_exists_var=` `,i.state_exists_var={init:function(){this.appendDummyInput().appendField(p(`state_exists`)),this.appendValueInput(`OID`).setCheck(null),this.setInputsInline(!0),this.setOutput(!0,`Boolean`),this.setColour(f.System.HUE),this.setTooltip(p(`state_exists_tooltip`)),this.setHelpUrl(m(`state_exists_help`))}},o.forBlock.state_exists_var=function(e){return[`(await existsStateAsync(${o.valueToCode(e,`OID`,a.ATOMIC)||`''`}))`,a.ATOMIC]};let w=(e,t,n)=>{i[e]={init:function(){this.appendDummyInput().appendField(p(t)),this.appendDummyInput().appendField(new d(p(`select_id`),n),`oid`),this.setInputsInline(!0),this.setOutput(!0,`String`),this.setColour(`%{BKY_TEXTS_HUE}`),this.setTooltip(p(`field_oid_tooltip`))}},o.forBlock[e]=function(e){return[s(e.getFieldValue(`oid`)),a.ATOMIC]}};f.System.blocks.field_oid=``,w(`field_oid`,`field_oid_OID`,`state`),f.System.blocks.field_oid_meta=``,w(`field_oid_meta`,`field_oid_OID_meta`,`meta`),f.System.blocks.field_oid_script=``,w(`field_oid_script`,`field_oid_OID_script`,`script`),f.System.blocks.get_attr=` attribute1 Object ID `,i.get_attr={init:function(){this.appendValueInput(`PATH`).setCheck(null).appendField(p(`get_attr_path`)),this.appendValueInput(`OBJECT`).appendField(p(`get_attr_by`)),this.setInputsInline(!0),this.setOutput(!0),this.setColour(f.System.HUE),this.setTooltip(p(`get_attr_tooltip`)),this.setHelpUrl(m(`get_attr_help`))}},o.forBlock.get_attr=function(e){return[`getAttr(${o.valueToCode(e,`OBJECT`,a.ATOMIC)}, ${o.valueToCode(e,`PATH`,a.ATOMIC)})`,a.ATOMIC]},f.System.blocks.direct=` TRUE Object ID 1 Object ID 2 `,i.direct={init:function(){this.appendDummyInput().appendField(p(`direct`)),this.appendValueInput(`OID_SRC`).setCheck(`String`).appendField(p(`direct_oid_src`)),this.appendValueInput(`OID_DST`).setCheck(`String`).appendField(p(`direct_oid_dst`)),this.appendDummyInput(`ONLY_CHANGES`).appendField(p(`direct_only_changes`)).appendField(new n(`TRUE`),`ONLY_CHANGES`),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.Trigger.HUE),this.setTooltip(p(`direct_tooltip`)),this.setHelpUrl(m(`direct_help`))}},o.forBlock.direct=function(e){let t=o.valueToCode(e,`OID_SRC`,a.ATOMIC),n=o.valueToCode(e,`OID_DST`,a.ATOMIC);return`on({ id: ${t}, change: '${l(e.getFieldValue(`ONLY_CHANGES`))?`ne`:`any`}' }, (obj) => {\n${o.prefixLines(`setState(${n}, obj.state.val);`,o.INDENT)}\n});\n`},f.System.blocks.control_instance=` admin.0 restartInstanceAsync`,i.control_instance={init:function(){var n;let r=[];if((n=window.main)!=null&&n.instances){for(let e of window.main.instances){let t=e.substring(15);r.push([t,t])}r.length||r.push([p(`control_instance_no_instances`),``]),this.appendDummyInput(`INSTANCE`).appendField(p(`control_instance`)).appendField(new e(r),`INSTANCE`)}else this.appendDummyInput(`INSTANCE`).appendField(p(`control_instance`)).appendField(new t(`adapter.0`),`INSTANCE`);this.appendDummyInput(`ACTION`).appendField(p(`control_instance_action`)).appendField(new e([[p(`control_instance_start`),`startInstanceAsync`],[p(`control_instance_stop`),`stopInstanceAsync`],[p(`control_instance_restart`),`restartInstanceAsync`]]),`ACTION`),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`control_instance_tooltip`)),this.setHelpUrl(m(`control_instance_help`))}},o.forBlock.control_instance=function(e){return`await ${e.getFieldValue(`ACTION`)}(${s(e.getFieldValue(`INSTANCE`))});\n`},f.System.blocks.control_script=` startScriptAsync`,i.control_script={init:function(){this.appendDummyInput(`OID`).appendField(p(`control_script`)).appendField(new d(p(`select_id`),`script`),`OID`),this.appendDummyInput(`ACTION`).appendField(p(`control_instance_action`)).appendField(new e([[p(`control_script_start`),`startScriptAsync`],[p(`control_script_stop`),`stopScriptAsync`]]),`ACTION`),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`control_script_tooltip`)),this.setHelpUrl(m(`control_script_help`))}},o.forBlock.control_script=function(e){return`await ${e.getFieldValue(`ACTION`)}(${s(e.getFieldValue(`OID`))});\n`},f.System.blocks.regex=` (.*)`,i.regex={init:function(){this.appendDummyInput().appendField(`RegExp`),this.appendDummyInput(`TEXT`).appendField(new t(`(.*)`),`TEXT`),this.setInputsInline(!0),this.setOutput(!0,`Array`),this.setColour(f.System.HUE)}},o.forBlock.regex=function(e){return[`new RegExp(${s(e.getFieldValue(`TEXT`))})`,a.ATOMIC]},f.System.blocks.selector=` channel[state.id=*]`,i.selector={init:function(){this.appendDummyInput().appendField(`${p(`selector`)} $(`),this.appendDummyInput(`TEXT`).appendField(new t(`channel[state.id=*]`),`TEXT`),this.appendDummyInput().appendField(`)`),this.setInputsInline(!0),this.setOutput(!0,`Array`),this.setColour(f.System.HUE)}},o.forBlock.selector=function(e){return[`Array.prototype.slice.apply($(${s(e.getFieldValue(`TEXT`))}))`,a.ATOMIC]}}export{f as install}; \ No newline at end of file diff --git a/admin/assets/blocks_text-BmR86101.js b/admin/assets/blocks_text-BmR86101.js new file mode 100644 index 00000000..5cee2e59 --- /dev/null +++ b/admin/assets/blocks_text-BmR86101.js @@ -0,0 +1 @@ +import{i as e,t}from"./blockly-DBw-ytY1.js";import{c as n,l as r}from"./index-2X_5uU-_.js";function i(){let i=window.Blockly.Translate;t.text_newline={init:function(){this.appendDummyInput().appendField(i(`text_newline`)),this.appendDummyInput().appendField(new e([[`\\n`,`\\n`],[`\\r`,`\\r`],[`\\r\\n`,`\\r\\n`]]),`Type`),this.setInputsInline(!0),this.setOutput(!0,`String`),this.setColour(`%{BKY_TEXTS_HUE}`),this.setTooltip(i(`text_newline_tooltip`))}},r.forBlock.text_newline=function(e){return[`'${e.getFieldValue(`Type`)}'`,n.ATOMIC]},t.text_contains={init:function(){this.appendDummyInput().appendField(i(`text_contains`)),this.appendValueInput(`VALUE`).setCheck(null),this.appendValueInput(`FIND`).setCheck(null).appendField(i(`text_contains_value`)),this.setInputsInline(!0),this.setOutput(!0,`Boolean`),this.setColour(`%{BKY_TEXTS_HUE}`)}},r.forBlock.text_contains=function(e){return[`String(${r.valueToCode(e,`VALUE`,n.ATOMIC)}).includes(${r.valueToCode(e,`FIND`,n.ATOMIC)})`,n.ATOMIC]},t.text_format_value={init:function(){this.appendValueInput(`VALUE`).appendField(i(`text_format_value`)).setCheck(null),this.appendDummyInput().appendField(i(`text_format_value_format`)).appendField(new e([[`System`,`system`],[`.,`,`.,`],[`,.`,`,.`],[` .`,` .`]]),`FORMAT`),this.appendValueInput(`DECIMALS`).appendField(i(`text_format_value_decimals`)),this.setInputsInline(!0),this.setOutput(!0,`String`),this.setColour(`%{BKY_TEXTS_HUE}`)}},r.forBlock.text_format_value=function(e){let t=r.valueToCode(e,`VALUE`,n.ATOMIC),i=r.valueToCode(e,`DECIMALS`,n.ATOMIC),a=e.getFieldValue(`FORMAT`);return a===`system`?[`formatValue(parseFloat(${t}), ${i})`,n.ATOMIC]:[`formatValue(parseFloat(${t}), ${i}, '${a}')`,n.ATOMIC]}}export{i as install}; \ No newline at end of file diff --git a/admin/assets/blocks_time-y3-FPsEo.js b/admin/assets/blocks_time-y3-FPsEo.js new file mode 100644 index 00000000..dc207d91 --- /dev/null +++ b/admin/assets/blocks_time-y3-FPsEo.js @@ -0,0 +1 @@ +import{i as e,o as t,r as n,t as r}from"./blockly-DBw-ytY1.js";import{c as i,l as a}from"./index-2X_5uU-_.js";import{c as o,n as s,t as c}from"./helpers-JkY7wkCZ.js";var l={"time_get_yyyy.mm.dd":`YYYY.MM.DD`,"time_get_yyyy/mm/dd":`YYYY/MM/DD`,"time_get_yy.mm.dd":`YY.MM.DD`,"time_get_yy/mm/dd":`YY/MM/DD`,"time_get_dd.mm.yyyy":`DD.MM.YYYY`,"time_get_dd/mm/yyyy":`DD/MM/YYYY`,"time_get_dd.mm.yy":`DD.MM.YY`,"time_get_dd/mm/yy":`DD/MM/YY`,"time_get_mm/dd/yyyy":`MM/DD/YYYY`,"time_get_mm/dd/yy":`MM/DD/YY`,"time_get_dd.mm":`DD.MM.`,"time_get_dd/mm":`DD/MM`,"time_get_mm.dd":`MM.DD`,"time_get_mm/dd":`MM/DD`,time_get_hh_mm:`hh:mm`,time_get_hh_mm_ss:`hh:mm:ss`,"time_get_hh_mm_ss.sss":`hh:mm:ss.sss`};function u(e){return e===!0||e===`true`||e===`TRUE`}function d(){let d=window.Blockly,f=d.Translate,p=window.getHelp;d.CustomBlocks=d.CustomBlocks||[],d.CustomBlocks.push(`Time`),d.Time={HUE:270,blocks:{}};for(let[e,t]of Object.entries(l))d.Words[e].format=t;let m=()=>[[f(`time_compare_lt`),`<`],[f(`time_compare_le`),`<=`],[f(`time_compare_gt`),`>`],[f(`time_compare_ge`),`>=`],[f(`time_compare_eq`),`==`],[f(`time_compare_bw`),`between`],[f(`time_compare_nb`),`not between`]];d.Time.blocks.time_compare_ex=` TRUE < 12:00 `,r.time_compare_ex={init:function(){this.appendDummyInput(`TIME_TEXT`).appendField(f(`time_compare_ex`)),this.appendDummyInput(`USE_ACTUAL_TIME`).appendField(new n(`TRUE`,function(e){this.getSourceBlock().updateShape_(void 0,e)}),`USE_ACTUAL_TIME`),this.appendDummyInput().appendField(f(`time_compare_is_ex`)),this.appendDummyInput(`OPTION`).appendField(new e(m(),function(e){this.getSourceBlock().updateShape_(e===`between`||e===`not between`)}),`OPTION`),this.appendDummyInput().appendField(` `),this.appendValueInput(`START_TIME`),this.setInputsInline(!0),this.setOutput(!0,`Boolean`),this.setColour(d.Time.HUE),this.setTooltip(f(`time_compare_ex_tooltip`)),this.setHelpUrl(p(`time_compare_ex_help`))},mutationToDom:function(){let e=document.createElement(`mutation`),t=this.getFieldValue(`OPTION`),n=this.getFieldValue(`USE_ACTUAL_TIME`);return e.setAttribute(`end_time`,t===`between`||t===`not between`?`true`:`false`),e.setAttribute(`actual_time`,u(n)?`true`:`false`),e},domToMutation:function(e){this.updateShape_(u(e.getAttribute(`end_time`)),u(e.getAttribute(`actual_time`)))},updateShape_:function(e,t){if(e===void 0&&(e=this.getFieldValue(`OPTION`)===`between`||this.getFieldValue(`OPTION`)===`not between`),e){if(!this.getInput(`END_TIME`)&&(this.getInput(`CUSTOM_TIME`)&&(this.removeInput(`CUSTOM_TIME`),this.removeInput(`CUSTOM_TEXT`)),this.appendDummyInput(`AND`).appendField(f(`time_compare_and`)),this.appendValueInput(`END_TIME`),!window.scripts.loading)){let e=this.workspace;setTimeout(()=>{var t;let n=this.getInput(`END_TIME`);if(!(n!=null&&(t=n.connection)!=null&&t.isConnected())){let t=e.newBlock(`text`);t.setShadow(!0),t.setFieldValue(`18:00`,`TEXT`),t.outputConnection.connect(n.connection),t.initSvg(),t.render()}},100)}}else this.getInput(`END_TIME`)&&(this.removeInput(`END_TIME`),this.removeInput(`AND`));t===void 0&&(t=this.getFieldValue(`USE_ACTUAL_TIME`));let n=u(t),r=this.getInput(`CUSTOM_TIME`);n?r&&(this.getInput(`TIME_TEXT`).fieldRow[0].setValue(f(`time_compare_ex`)),this.removeInput(`CUSTOM_TIME`),this.removeInput(`CUSTOM_TEXT`)):(this.getInput(`TIME_TEXT`).fieldRow[0].setValue(f(`time_compare_custom_ex`)),r||(this.appendDummyInput(`CUSTOM_TEXT`).appendField(f(`time_compare_ex_custom`)),this.appendValueInput(`CUSTOM_TIME`)))}},a.forBlock.time_compare_ex=function(e){let t=e.getFieldValue(`OPTION`);return[`compareTime(${a.valueToCode(e,`START_TIME`,i.ATOMIC)}, ${e.getInput(`END_TIME`)&&a.valueToCode(e,`END_TIME`,i.ATOMIC)||null}, '${t}', ${e.getInput(`CUSTOM_TIME`)&&a.valueToCode(e,`CUSTOM_TIME`,i.ATOMIC)||null})`,i.ATOMIC]},d.Time.blocks.time_compare=` < 12:00`,r.time_compare={init:function(){this.appendDummyInput().appendField(f(`time_compare`)),this.appendDummyInput(`OPTION`).appendField(new e(m(),function(e){this.getSourceBlock().updateShape_(e===`between`||e===`not between`)}),`OPTION`),this.appendDummyInput().appendField(` `),this.appendDummyInput(`START_TIME`).appendField(new t(`12:00`),`START_TIME`),this.setInputsInline(!0),this.setOutput(!0,`Boolean`),this.setColour(d.Time.HUE),this.setTooltip(f(`time_compare_tooltip`)),this.setHelpUrl(p(`time_compare_help`))},mutationToDom:function(){let e=document.createElement(`mutation`),t=this.getFieldValue(`OPTION`);return e.setAttribute(`end_time`,t===`between`||t===`not between`?`true`:`false`),e},domToMutation:function(e){this.updateShape_(u(e.getAttribute(`end_time`)))},updateShape_:function(e){e?this.getInput(`END_TIME`)||(this.appendDummyInput(`AND`).appendField(f(`time_compare_and`)),this.appendDummyInput(`END_TIME`).appendField(new t(`18:00`),`END_TIME`)):this.getInput(`END_TIME`)&&(this.removeInput(`END_TIME`),this.removeInput(`AND`))}},a.forBlock.time_compare=function(e){let t=e.getFieldValue(`OPTION`),n=e.getFieldValue(`START_TIME`),r=e.getFieldValue(`END_TIME`);return[`compareTime(${o(n)}, ${r?o(r):`null`}, ${o(t)})`,i.ATOMIC]},d.Time.blocks.time_get=` object`,r.time_get={init:function(){this.appendDummyInput().appendField(f(`time_get`)),this.appendDummyInput(`OPTION`).appendField(new e(c(),function(e){this.getSourceBlock().updateShape_(e===`custom`,e===`wdt`||e===`wdts`||e===`Mt`||e===`Mts`)}),`OPTION`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(d.Time.HUE),this.setTooltip(f(`time_get_tooltip`))},mutationToDom:function(){let e=document.createElement(`mutation`),t=this.getFieldValue(`OPTION`);return e.setAttribute(`format`,t===`custom`?`true`:`false`),e.setAttribute(`language`,t===`wdt`||t===`wdts`||t===`Mt`||t===`Mts`?`true`:`false`),e},domToMutation:function(e){this.updateShape_(u(e.getAttribute(`format`)),u(e.getAttribute(`language`)))},updateShape_:function(n,r){n?this.getInput(`FORMAT`)||this.appendDummyInput(`FORMAT`).appendField(` `).appendField(new t(f(`time_get_default_format`)),`FORMAT`):this.getInput(`FORMAT`)&&this.removeInput(`FORMAT`),r?this.getInput(`LANGUAGE`)||this.appendDummyInput(`LANGUAGE`).appendField(new e(s()),`LANGUAGE`):this.getInput(`LANGUAGE`)&&this.removeInput(`LANGUAGE`)}},a.forBlock.time_get=function(e){let t=e.getFieldValue(`OPTION`),n=e.getFieldValue(`FORMAT`),r=e.getFieldValue(`LANGUAGE`),a;return a=t===`object`?`(new Date().getTime())`:t===`ms`?`(new Date().getMilliseconds())`:t===`s`?`(new Date().getSeconds())`:t===`sid`?`(() => { const v = new Date(); return v.getHours() * 3600 + v.getMinutes() * 60 + v.getSeconds(); })()`:t===`m`?`(new Date().getMinutes())`:t===`mid`?`(() => { const v = new Date(); return v.getHours() * 60 + v.getMinutes(); })()`:t===`h`?`(new Date().getHours())`:t===`d`?`(new Date().getDate())`:t===`M`?`(new Date().getMonth() + 1)`:t===`Mt`?`formatDate(new Date(), 'OO', '${r}')`:t===`Mts`?`formatDate(new Date(), 'O', '${r}')`:t===`y`?`(new Date().getYear())`:t===`fy`?`(new Date().getFullYear())`:t===`wdt`?`formatDate(new Date(), 'WW', '${r}')`:t===`wdts`?`formatDate(new Date(), 'W', '${r}')`:t===`wd`?`(() => { const d = new Date().getDay(); return d === 0 ? 7 : d; })()`:t===`cw`?`((date) => { const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate())); const dayNum = d.getUTCDay() || 7; d.setUTCDate(d.getUTCDate() + 4 - dayNum); const yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1)); return Math.ceil(((d.getTime() - yearStart.getTime()) / 86400000 + 1) / 7); })(new Date())`:t===`custom`?`formatDate(new Date(), ${o(n)})`:`formatDate(new Date(), ${o(t)})`,[a,i.ATOMIC]},d.Time.blocks.time_get_special=` dayStart`,r.time_get_special={init:function(){this.appendDummyInput().appendField(f(`time_get_special`)),this.appendDummyInput(`TYPE`).appendField(new e([[f(`time_get_special_day_start`),`dayStart`],[f(`time_get_special_day_end`),`dayEnd`],[f(`time_get_special_week_start`),`weekStart`],[f(`time_get_special_week_end`),`weekEnd`],[f(`time_get_special_month_start`),`monthStart`],[f(`time_get_special_month_end`),`monthEnd`]]),`TYPE`),this.setInputsInline(!0),this.setOutput(!0,`Number`),this.setColour(d.Time.HUE),this.setTooltip(f(`time_get_special_tooltip`))}},a.forBlock.time_get_special=function(e){let t=e.getFieldValue(`TYPE`),n=``;return t===`dayStart`?n=`/* start of day */ (() => { const d = new Date(); d.setHours(0, 0, 0, 0); return d.getTime(); })()`:t===`dayEnd`?n=`/* end of day */ (() => { const d = new Date(); d.setHours(23, 59, 59, 999); return d.getTime(); })()`:t===`weekStart`?n=`/* start of week */ (() => { const d = new Date(); d.setHours(0, 0, 0, 0); return new Date(d.getFullYear(), d.getMonth(), d.getDate() - d.getDay() + (d.getDay() == 0 ? -6 : 1)).getTime(); })()`:t===`weekEnd`?n=`/* end of week */ (() => { const d = new Date(); d.setHours(0, 0, 0, 0); return new Date(d.getFullYear(), d.getMonth(), d.getDate() + (8 - d.getDay())).getTime() - 1; })()`:t===`monthStart`?n=`/* start of month */ (() => { const d = new Date(); d.setHours(0, 0, 0, 0); d.setDate(1); return d.getTime(); })()`:t===`monthEnd`&&(n=`/* end of month */ (() => { const d = new Date(); d.setHours(0, 0, 0, 0); return new Date(d.getFullYear(), d.getMonth() + 1, 1).getTime() - 1; })()`),[n,i.ATOMIC]},d.Time.blocks.time_astro=` sunrise 0`,r.time_astro={init:function(){this.appendDummyInput().appendField(f(`time_astro`)),this.appendDummyInput(`TYPE`).appendField(new e([[f(`astro_sunriseText`),`sunrise`],[f(`astro_sunriseEndText`),`sunriseEnd`],[f(`astro_goldenHourEndText`),`goldenHourEnd`],[f(`astro_solarNoonText`),`solarNoon`],[f(`astro_goldenHourText`),`goldenHour`],[f(`astro_sunsetStartText`),`sunsetStart`],[f(`astro_sunsetText`),`sunset`],[f(`astro_duskText`),`dusk`],[f(`astro_nauticalDuskText`),`nauticalDusk`],[f(`astro_nightText`),`night`],[f(`astro_nightEndText`),`nightEnd`],[f(`astro_nauticalDawnText`),`nauticalDawn`],[f(`astro_dawnText`),`dawn`],[f(`astro_nadirText`),`nadir`]]),`TYPE`),this.appendDummyInput(`OFFSET`).appendField(f(`time_astro_offset`)).appendField(new t(`0`),`OFFSET`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(d.Time.HUE),this.setTooltip(f(`time_astro_tooltip`)),this.setHelpUrl(p(`time_astro_help`))}},a.forBlock.time_astro=function(e){return[`getAstroDate('${e.getFieldValue(`TYPE`)}', undefined, ${parseFloat(e.getFieldValue(`OFFSET`))})`,i.ATOMIC]},d.Time.blocks.time_calculation=` + ms object 1 `,r.time_calculation={init:function(){this.appendDummyInput(`NAME`).appendField(f(`time_calculation`)),this.appendValueInput(`DATE_TIME`).appendField(f(`time_calculation_on`)).setCheck(null),this.appendDummyInput(`OPERATION`).appendField(new e([[`+`,`+`],[`-`,`-`]]),`OPERATION`),this.appendValueInput(`VALUE`),this.appendDummyInput(`UNIT`).appendField(new e([[f(`time_calculation_ms`),`ms`],[f(`time_calculation_sec`),`sec`],[f(`time_calculation_min`),`min`],[f(`time_calculation_hour`),`hour`],[f(`time_calculation_day`),`day`],[f(`time_calculation_week`),`week`]]),`UNIT`),this.setInputsInline(!0),this.setOutput(!0,`Number`),this.setColour(d.Time.HUE),this.setTooltip(f(`time_calculation_tooltip`))}},a.forBlock.time_calculation=function(e){let t=a.valueToCode(e,`DATE_TIME`,i.ATOMIC),n=e.getFieldValue(`OPERATION`),r=a.valueToCode(e,`VALUE`,i.ATOMIC),o=e.getFieldValue(`UNIT`),s=1;return o===`sec`?s=1e3:o===`min`?s=6e4:o===`hour`?s=36e5:o===`day`?s=864e5:o===`week`&&(s=6048e5),[`/* time calculation */ ((dateTime) => { const ts = (typeof dateTime === 'object' ? dateTime.getTime() : dateTime); return ts ${n} ((${r}) * ${s}); })(${t})`,i.ATOMIC]}}export{d as install}; \ No newline at end of file diff --git a/admin/assets/blocks_timeout-BJm5IiqU.js b/admin/assets/blocks_timeout-BJm5IiqU.js new file mode 100644 index 00000000..b2a2875e --- /dev/null +++ b/admin/assets/blocks_timeout-BJm5IiqU.js @@ -0,0 +1 @@ +import{c as e,i as t,o as n,t as r}from"./blockly-DBw-ytY1.js";import{c as i,l as a}from"./index-2X_5uU-_.js";import{a as o}from"./helpers-JkY7wkCZ.js";var s={id:`timeout`,marker:`isTimeout_`,variableType:`timeout`},c={id:`interval`,marker:`isInterval_`,variableType:`interval`};function l(e,t){let n=parseFloat(e);return t===`min`?n*6e4:t===`sec`?n*1e3:n}function u(e){return a.nameDB_.safeName(e.getFieldValue(`NAME`))}function d(){let d=window.Blockly,f=d.Translate,p=window.getHelp;d.CustomBlocks=d.CustomBlocks||[],d.CustomBlocks.push(`Timeouts`);let m=()=>[[f(`timeouts_settimeout_ms`),`ms`],[f(`timeouts_settimeout_sec`),`sec`],[f(`timeouts_settimeout_min`),`min`]],h=(t,n,r)=>{for(let i of n.getAllBlocks())if(i!==r&&(i.isTimeout_||i.isInterval_)&&e.equals(i.getFieldValue(`NAME`),t))return!1;return!0},g=(e,t)=>{if(t.isInFlyout)return e;for(;!h(e,t.workspace,t);){let t=e.match(/^(.*?)(\d+)$/);t?e=t[1]+(parseInt(t[2],10)+1):e+=`2`}return e},_=function(e){return g(e.replace(/^[\s\xa0]+|[\s\xa0]+$/g,``),this.getSourceBlock())},v=(e,t)=>{let n=[];for(let r of e.getAllBlocks())if(r[t.marker]){let e=r.getFieldValue(`NAME`);n.push([e,e])}if(window.scripts.loading)for(let t of e.getVariableMap().getVariablesOfType(``))n.find(e=>e[0]===t.getName())||n.push([t.getName(),t.getName()]);for(let r of e.getVariableMap().getVariablesOfType(t.variableType))n.find(e=>e[0]===r.getName())||n.push([r.getName(),r.getName()]);return n.length||n.push([``,``]),n};d.Timeouts={HUE:70,blocks:{},getAllTimeouts:e=>v(e,s),getAllIntervals:e=>v(e,c)};let y=e=>new t(()=>{var t;return(t=window.scripts)!=null&&t.blocklyWorkspace?v(window.scripts.blocklyWorkspace,e):[]});d.Timeouts.blocks.timeouts_wait=` 1000 ms`,r.timeouts_wait={init:function(){this.appendDummyInput().appendField(f(`timeouts_wait`)).appendField(new n(`1000`),`DELAY`).appendField(new t(m()),`UNIT`),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(d.Timeouts.HUE),this.setTooltip(f(`timeouts_wait_tooltip`)),this.setHelpUrl(p(`timeouts_wait_help`))}},a.forBlock.timeouts_wait=function(e){return`await wait(${l(e.getFieldValue(`DELAY`),e.getFieldValue(`UNIT`))});\n`};let b=(e,s)=>{let c=e.id===`timeout`,h=`timeouts_set${e.id}${s?`_variable`:``}`,v=c?`DELAY`:`INTERVAL`,y=c?`DELAY_MS`:`INTERVAL_MS`,b=`timeouts_set${e.id}`,x=c?`timeout`:f(`timeouts_setinterval_name`);r[h]={init:function(){let e=new n(g(x,this),_);e.setSpellcheck(!1);let r=this.appendDummyInput().appendField(f(b)).appendField(e,`NAME`).appendField(f(`${b}_in`));s?this.appendValueInput(y).setCheck(`Number`).appendField(f(`timeouts_settimeout_ms`)):r.appendField(new n(`1000`),v).appendField(new t(m()),`UNIT`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(s),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(d.Timeouts.HUE),this.setTooltip(f(`${b}_tooltip`)),this.setHelpUrl(p(`${b}_help`))},[e.marker]:!0,getVars:function(){return[this.getFieldValue(`NAME`)]},getVarModels:function(){return[o(this.getFieldValue(`NAME`),e.variableType)]}},a.forBlock[h]=function(e){let t=u(e),n=a.statementToCode(e,`STATEMENT`),r=s?`parseInt(${a.valueToCode(e,y,i.ATOMIC)})`:String(l(e.getFieldValue(v),e.getFieldValue(`UNIT`))),o=c?`${a.prefixLines(`${t} = null;`,a.INDENT)}\n`:``;return`${t} = ${c?`setTimeout`:`setInterval`}(async () => {\n${o}${n}}, ${r});\n`}},x=e=>{let t=`timeouts_clear${e.id}`,n=`timeouts_get${e.id}`;d.Timeouts.blocks[t]=` `,r[t]={init:function(){this.appendDummyInput(`NAME`).appendField(f(t)).appendField(y(e),`NAME`),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(d.Timeouts.HUE),this.setTooltip(f(`${t}_tooltip`)),this.setHelpUrl(p(`${t}_help`))}},a.forBlock[t]=function(t){let n=u(t);return`(() => { if (${n}) { ${e.id===`timeout`?`clearTimeout`:`clearInterval`}(${n}); ${n} = null; }})();\n`},d.Timeouts.blocks[n]=` `,r[n]={init:function(){this.appendDummyInput(`NAME`).appendField(f(n)).appendField(y(e),`NAME`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(d.Timeouts.HUE),this.setTooltip(f(`${n}_tooltip`)),this.setHelpUrl(p(`${n}_help`))}},a.forBlock[n]=function(e){return[u(e),i.ATOMIC]}};d.Timeouts.blocks.timeouts_settimeout=` timeout 1000 ms`,b(s,!1),d.Timeouts.blocks.timeouts_settimeout_variable=` 1000 `,b(s,!0),x(s),d.Timeouts.blocks.timeouts_setinterval=` 1000 ms`,b(c,!1),d.Timeouts.blocks.timeouts_setinterval_variable=` 1000 `,b(c,!0),x(c)}export{d as install}; \ No newline at end of file diff --git a/admin/assets/blocks_trigger-BeibKDOj.js b/admin/assets/blocks_trigger-BeibKDOj.js new file mode 100644 index 00000000..cc1b8389 --- /dev/null +++ b/admin/assets/blocks_trigger-BeibKDOj.js @@ -0,0 +1,2 @@ +import{c as e,f as t,i as n,o as r,r as i,s as a,t as o}from"./blockly-DBw-ytY1.js";import{c as s,l as c}from"./index-2X_5uU-_.js";import{a as l,c as u,f as d,l as f,o as p,p as m,r as h,s as g}from"./helpers-JkY7wkCZ.js";import{FieldOID as _}from"./field_oid-CJZIeruf.js";import{FieldCRON as v}from"./field_cron-BJLkgNzf.js";function y(e){return c.nameDB_.safeName(e.getFieldValue(`NAME`))}function b(){let b=window.Blockly,x=b.Translate,S=window.getHelp;b.CustomBlocks=b.CustomBlocks||[],b.CustomBlocks.push(`Trigger`);let C=e=>{let t=[];for(let n of e.getAllBlocks())if(n.isSchedule_){let e=n.getFieldValue(`NAME`);t.push([e,e])}if(window.scripts.loading)for(let n of e.getVariableMap().getVariablesOfType(``))t.find(e=>e[0]===n.getName())||t.push([n.getName(),n.getName()]);for(let n of e.getVariableMap().getVariablesOfType(`cron`))t.find(e=>e[0]===n.getName())||t.push([n.getName(),n.getName()]);return t.length||t.push([``,``]),t};b.Trigger={HUE:330,getAllSchedules:C,blocks:{},WARNING_PARENTS:[`on`,`on_ext`,`schedule`,`schedule_by_id`,`schedule_create`,`astro`,`onMessage`,`onFile`,`onLog`,`onEnumMembers`,`timeouts_setinterval`,`timeouts_setinterval_variable`,`controls_repeat_ext`,`controls_repeat_ext`,`controls_for`,`controls_forEach`]};let w=()=>[[x(`on_onchange`),`ne`],[x(`on_any`),`any`],[x(`on_gt`),`gt`],[x(`on_ge`),`ge`],[x(`on_lt`),`lt`],[x(`on_le`),`le`],[x(`on_true`),`true`],[x(`on_false`),`false`]],T=()=>[[x(`on_ack_any`),``],[x(`on_ack_true`),`true`],[x(`on_ack_false`),`false`]],E=e=>e===`true`||e===`false`?`val: ${e}`:`change: '${e}'`,D=()=>`${c.prefixLines(`let value = obj.state.val;`,c.INDENT)}\n${c.prefixLines(`let oldValue = obj.oldState.val;`,c.INDENT)}\n`,O=(e,t,n,r)=>{setTimeout(()=>{var i;if(!((i=t.connection)!=null&&i.isConnected())){let i=e.newBlock(n);i.setShadow(!0),r&&i.setFieldValue(r[1],r[0]),i.outputConnection.connect(t.connection),i.initSvg(),i.render()}},100)},k=(e,t,r,i,a,s,c)=>{o[e]={init:function(){this.appendDummyInput().appendField(t),this.appendDummyInput(`ATTR`).appendField(new n(r),`ATTR`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(s),this.setTooltip(x(`${e}_tooltip`)),c&&this.setHelpUrl(S(c))},onchange:function(){m(this,i,a)},FUNCTION_TYPES:i}};b.Trigger.blocks.on_ext=` ne `,o.on_ext_oid_container={init:function(){this.appendDummyInput().appendField(x(`on_ext_on`)),this.appendStatementInput(`STACK`),this.setColour(b.Trigger.HUE),this.setTooltip(x(`on_ext_on_tooltip`)),this.contextMenu=!1}},o.on_ext_oid={init:function(){this.appendDummyInput(`OID`).appendField(x(`on_ext_oid`)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(b.Trigger.HUE),this.setTooltip(x(`on_ext_oid_tooltip`)),this.contextMenu=!1}},o.on_ext={init:function(){this.itemCount_=1,this.setMutator(new t.MutatorIcon([`on_ext_oid`],this)),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(b.Trigger.HUE),this.setTooltip(x(`on_ext_tooltip`)),this.setHelpUrl(S(`on_help`))},mutationToDom:function(){let e=document.createElement(`mutation`);return e.setAttribute(`items`,String(this.itemCount_)),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute(`items`),10),this.updateShape_()},decompose:function(e){var t;let n=e.newBlock(`on_ext_oid_container`);n.initSvg();let r=(t=n.getInput(`STACK`))==null?void 0:t.connection;for(let t=0;t {\n${i.length===1?D():``}${o}});\n`},b.Trigger.blocks.on=` ne `,o.on={init:function(){this.appendDummyInput().appendField(x(`on`)),this.appendDummyInput(`OID`).appendField(new _(x(`select_id`),`state`),`OID`),this.appendDummyInput(`CONDITION`).appendField(new n(w()),`CONDITION`),this.appendDummyInput(`ACK_CONDITION`).appendField(x(`on_ack`)).appendField(new n(T()),`ACK_CONDITION`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(b.Trigger.HUE),this.setTooltip(x(`on_tooltip`)),this.setHelpUrl(S(`on_help`))},onchange:function(){d(this)}},c.forBlock.on=function(e){let t=e.getFieldValue(`OID`),n=E(e.getFieldValue(`CONDITION`)),r=e.getFieldValue(`ACK_CONDITION`);a.VARIABLES_DEFAULT_NAME=`value`;let i=p(t),o=c.statementToCode(e,`STATEMENT`);return`on({ id: '${t}'${i?` /* ${i} */`:``}, ${n}${r?`, ack: ${r}`:``} }, async (obj) => {\n${D()}${o}});\n`},b.Trigger.blocks.on_source=` state.val`,k(`on_source`,`↪`,[[x(`on_source_state_val`),`state.val`],[x(`on_source_state_ts`),`state.ts`],[x(`on_source_state_q`),`state.q`],[x(`on_source_state_from`),`state.from`],[x(`on_source_state_ack`),`state.ack`],[x(`on_source_state_lc`),`state.lc`],[x(`on_source_state_c`),`state.c`],[x(`on_source_state_user`),`state.user`],[x(`on_source_id`),`id`],[x(`on_source_name`),`common.name`],[x(`on_source_desc`),`common.desc`],[x(`on_source_channel_id`),`channelId`],[x(`on_source_channel_name`),`channelName`],[x(`on_source_device_id`),`deviceId`],[x(`on_source_device_name`),`deviceName`],[x(`on_source_oldstate_val`),`oldState.val`],[x(`on_source_oldstate_ts`),`oldState.ts`],[x(`on_source_oldstate_q`),`oldState.q`],[x(`on_source_oldstate_from`),`oldState.from`],[x(`on_source_oldstate_ack`),`oldState.ack`],[x(`on_source_oldstate_lc`),`oldState.lc`],[x(`on_source_oldstate_c`),`oldState.c`],[x(`on_source_oldstate_user`),`oldState.user`]],[`on`,`on_ext`,`onEnumMembers`],`on_source_warning`,b.Trigger.HUE,`on_help`),c.forBlock.on_source=function(e){let t=e.getFieldValue(`ATTR`),n=t.split(`.`);return[n.length>1?`(obj.${n[0]} ? obj.${t} : '')`:`obj.${t}`,s.ATOMIC]},b.Trigger.blocks.on_ack_value=``,o.on_ack_value={init:function(){this.appendDummyInput().appendField(`↪ ${x(`on_ack_value`)}`),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(b.Trigger.HUE),this.setTooltip(x(`on_ack_value_tooltip`)),this.setHelpUrl(S(`on_help`))},onchange:function(){m(this,[`on`,`on_ext`,`onEnumMembers`],`on_ack_value_warning`)},FUNCTION_TYPES:[`on`,`on_ext`,`onEnumMembers`]},c.forBlock.on_ack_value=function(){return`if (obj.id && obj?.state && !obj.state.ack) { +${c.prefixLines(`await setStateAsync(obj.id, { val: obj.state.val, ack: true });`,c.INDENT)}\n}\n`},b.Trigger.blocks.astro=` sunrise 0`,o.astro={init:function(){this.appendDummyInput().appendField(x(`astro`)),this.appendDummyInput(`TYPE`).appendField(new n([[x(`astro_sunriseText`),`sunrise`],[x(`astro_sunriseEndText`),`sunriseEnd`],[x(`astro_goldenHourEndText`),`goldenHourEnd`],[x(`astro_solarNoonText`),`solarNoon`],[x(`astro_goldenHourText`),`goldenHour`],[x(`astro_sunsetStartText`),`sunsetStart`],[x(`astro_sunsetText`),`sunset`],[x(`astro_duskText`),`dusk`],[x(`astro_nauticalDuskText`),`nauticalDusk`],[x(`astro_nightText`),`night`],[x(`astro_nightEndText`),`nightEnd`],[x(`astro_nauticalDawnText`),`nauticalDawn`],[x(`astro_dawnText`),`dawn`],[x(`astro_nadirText`),`nadir`]]),`TYPE`),this.appendDummyInput().appendField(x(`astro_offset`)),this.appendDummyInput(`OFFSET`).appendField(new r(`0`),`OFFSET`),this.appendDummyInput().appendField(x(`astro_minutes`)),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(b.Trigger.HUE),this.setTooltip(x(`astro_tooltip`)),this.setHelpUrl(S(`astro_help`))},onchange:function(){d(this)}},c.forBlock.astro=function(e){return`schedule({ astro: '${e.getFieldValue(`TYPE`)}', shift: ${parseInt(e.getFieldValue(`OFFSET`),10)} }, async () => {\n${c.statementToCode(e,`STATEMENT`)}});\n`},b.Trigger.blocks.schedule=` * * * * *`,o.schedule={init:function(){this.appendDummyInput().appendField(x(`schedule`)),this.appendDummyInput(`SCHEDULE`).appendField(new v(`* * * * *`),`SCHEDULE`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(b.Trigger.HUE),this.setTooltip(x(`schedule_tooltip`)),this.setHelpUrl(S(`schedule_help`))},onchange:function(){d(this)}},c.forBlock.schedule=function(e){let t=e.getFieldValue(`SCHEDULE`),n=c.statementToCode(e,`STATEMENT`);return`schedule(${t.startsWith(`{`)?`'${t}'`:`"${t}"`}, async () => {\n${n}});\n`},b.Trigger.blocks.schedule_by_id=` `,o.schedule_by_id={init:function(){this.appendDummyInput().appendField(x(`schedule_by_id`)),this.appendDummyInput(`OID`).appendField(new _(x(`select_id`),`state`),`OID`),this.appendDummyInput(`ACK_CONDITION`).appendField(x(`on_ack`)).appendField(new n(T()),`ACK_CONDITION`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(b.Trigger.HUE),this.setTooltip(x(`schedule_by_id_tooltip`)),this.setHelpUrl(S(`schedule_by_id_help`))}},c.forBlock.schedule_by_id=function(e){let t=e.getFieldValue(`OID`),n=e.getFieldValue(`ACK_CONDITION`),r=c.statementToCode(e,`STATEMENT`),i=p(t);return`scheduleById('${t}'${i?` /* ${i} */`:``}${n?`, ${n}`:``}, async () => {\n${r}});\n`},b.Trigger.blocks.schedule_create=` schedule `;let A=(t,n,r)=>{if(t===`schedule`)return!1;for(let i of n.getAllBlocks())if(i!==r&&i.isSchedule_&&e.equals(i.getFieldValue(`NAME`),t))return!1;return!0},j=(e,t)=>{if(t.isInFlyout)return e;for(;!A(e,t.workspace,t);){let t=e.match(/^(.*?)(\d+)$/);t?e=t[1]+(parseInt(t[2],10)+1):e+=`1`}return e},M=function(e){return j(e.replace(/^[\s\xa0]+|[\s\xa0]+$/g,``),this.getSourceBlock())};o.schedule_create={init:function(){let e=new r(j(`schedule`,this),M);e.setSpellcheck(!1),this.appendDummyInput(`NAME`).appendField(x(`schedule_create`)).appendField(e,`NAME`),this.appendValueInput(`SCHEDULE`).appendField(x(`schedule_text`)),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(b.Trigger.HUE),this.setTooltip(x(`schedule_create_tooltip`)),this.setHelpUrl(S(`schedule_create_help`))},isSchedule_:!0,getVars:function(){return[this.getFieldValue(`NAME`)]},getVarModels:function(){return[l(this.getFieldValue(`NAME`),`cron`)]}},c.forBlock.schedule_create=function(e){return`${y(e)} = schedule(${c.valueToCode(e,`SCHEDULE`,s.ATOMIC)}, async () => {\n${c.statementToCode(e,`STATEMENT`)}});\n`},b.Trigger.blocks.schedule_clear=` `,o.schedule_clear={init:function(){this.appendDummyInput(`NAME`).appendField(x(`schedule_clear`)).appendField(new n(()=>{var e;return(e=window.scripts)!=null&&e.blocklyWorkspace?C(window.scripts.blocklyWorkspace):[]}),`NAME`),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(b.Trigger.HUE),this.setTooltip(x(`schedule_clear_tooltip`)),this.setHelpUrl(S(`schedule_clear_help`))}},c.forBlock.schedule_clear=function(e){let t=y(e);return`(() => { if (${t}) { clearSchedule(${t}); ${t} = null; }})();\n`},b.Trigger.blocks.field_cron=` * * * * *`,o.field_cron={init:function(){this.appendDummyInput().appendField(x(`field_cron_CRON`)),this.appendDummyInput().appendField(new v(`* * * * *`),`CRON`),this.setInputsInline(!0),this.setOutput(!0,`String`),this.setColour(b.Trigger.HUE),this.setTooltip(x(`field_cron_tooltip`))}},c.forBlock.field_cron=function(e){return[`'${e.getFieldValue(`CRON`)}'`,s.ATOMIC]},b.Trigger.blocks.cron_builder=` FALSE FALSE * * * * * `,o.cron_builder={init:function(){this.appendDummyInput().appendField(x(`cron_builder_CRON`)),this.appendDummyInput(`LINE`).appendField(x(`cron_builder_line`)).appendField(new i(`FALSE`,function(e){var t;(t=this.getSourceBlock())==null||t.setInputsInline(h(e))}),`LINE`);let e=this.workspace;for(let[t,n]of[[`DOW`,`cron_builder_dow`],[`MONTHS`,`cron_builder_month`],[`DAYS`,`cron_builder_day`],[`HOURS`,`cron_builder_hour`],[`MINUTES`,`cron_builder_minutes`]]){let r=this.appendValueInput(t).appendField(x(n));O(e,r,`text`,[`TEXT`,`*`])}this.appendDummyInput(`WITH_SECONDS`).appendField(x(`cron_builder_with_seconds`)).appendField(new i(`FALSE`,function(e){this.getSourceBlock().updateShape_(h(e))}),`WITH_SECONDS`),this.seconds_=!1,this.as_line_=!1,this.setInputsInline(this.as_line_),this.setOutput(!0,`String`),this.setColour(b.Trigger.HUE),this.setTooltip(x(`field_cron_tooltip`))},mutationToDom:function(){let e=document.createElement(`mutation`);return e.setAttribute(`seconds`,String(this.seconds_)),e.setAttribute(`as_line`,String(this.as_line_)),e},domToMutation:function(e){this.seconds_=e.getAttribute(`seconds`)===`true`,this.as_line_=e.getAttribute(`as_line`)===`true`,this.setInputsInline(this.as_line_),this.updateShape_(this.seconds_)},updateShape_:function(e){if(this.seconds_=e,e){if(!this.getInput(`SECONDS`)){let e=this.appendValueInput(`SECONDS`).appendField(x(`cron_builder_seconds`));O(this.workspace,e,`text`,[`TEXT`,`*`])}}else this.getInput(`SECONDS`)&&this.removeInput(`SECONDS`)}},c.forBlock.cron_builder=function(e){let t=t=>c.valueToCode(e,t,s.ATOMIC),n=e.getFieldValue(`WITH_SECONDS`),r=n&&e.getInput(`SECONDS`)?t(`SECONDS`):`0`;return[(h(n)?`${r}.toString().trim() + ' ' + `:``)+`${t(`MINUTES`)}.toString().trim() + ' ' + ${t(`HOURS`)}.toString().trim() + ' ' + ${t(`DAYS`)}.toString().trim() + ' ' + ${t(`MONTHS`)}.toString().trim() + ' ' + ${t(`DOW`)}.toString().trim()`,s.ATOMIC]},b.Trigger.blocks.onMessage=` customMessage`,o.onMessage={init:function(){this.appendDummyInput(`NAME`).appendField(`✉️ ${x(`onMessage`)}`),this.appendDummyInput(`MESSAGE`).appendField(x(`onMessage_message`)).appendField(new r(`customMessage`),`MESSAGE`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(b.Trigger.HUE),this.setTooltip(x(`onMessage_tooltip`)),this.setHelpUrl(S(`onMessage_help`))},onchange:function(){d(this)}},c.forBlock.onMessage=function(e){let t=e.getFieldValue(`MESSAGE`),n=c.statementToCode(e,`STATEMENT`);return`onMessage(${u(t)}, async (data, callback) => {\n${n}${c.prefixLines(`typeof callback === 'function' && callback({ result: true }); // default callback`,c.INDENT)}\n});\n`},b.Trigger.blocks.onMessage_data=` data`,k(`onMessage_data`,`✉️ `,[[x(`onMessage_data_data`),`data`]],[`onMessage`],`onMessage_data_warning`,b.Action.HUE,`onMessage_data_help`),c.forBlock.onMessage_data=function(e){return[e.getFieldValue(`ATTR`),s.ATOMIC]},b.Trigger.blocks.onFile=` FALSE 0_userdata.0 * `,o.onFile={init:function(){this.appendValueInput(`OID`).appendField(`📁 ${x(`onFile`)}`).setCheck(null),this.appendValueInput(`FILE`).appendField(x(`onFile_file`)).setCheck(null),this.appendDummyInput(`WITH_FILE_INPUT`).appendField(x(`onFile_withFile`)).appendField(new i(`FALSE`),`WITH_FILE`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(b.Trigger.HUE),this.setTooltip(x(`onFile_tooltip`)),this.setHelpUrl(S(`onFile_help`))},onchange:function(){d(this)}},c.forBlock.onFile=function(e){let t=c.valueToCode(e,`OID`,s.ATOMIC),n=c.valueToCode(e,`FILE`,s.ATOMIC),r=e.getFieldValue(`WITH_FILE`),i=c.statementToCode(e,`STATEMENT`),a=g(t);return`onFile(${t}${a?` /* ${a} */`:``}, ${n}, ${r===`TRUE`?`true`:`false`}, async (id, fileName, size, data, mimeType) => {\n${i}});\n`},b.Trigger.blocks.onFile_data=` data`,k(`onFile_data`,`📁`,[[x(`onFile_data_data`),`data`],[x(`onFile_data_filename`),`fileName`],[x(`onFile_data_size`),`size`],[x(`onFile_data_mimeType`),`mimeType`],[x(`onFile_data_id`),`id`],[x(`onFile_data_tempFile`),`TEMP_FILE_PATH`]],[`onFile`],`onFile_data_warning`,b.Trigger.HUE),c.forBlock.onFile_data=function(e){let t=e.getFieldValue(`ATTR`);return t===`TEMP_FILE_PATH`?[`createTempFile(fileName, data)`,s.ATOMIC]:[t,s.ATOMIC]},b.Trigger.blocks.offFile=` 0_userdata.0 * `,o.offFile={init:function(){this.appendValueInput(`OID`).appendField(`📁 ${x(`offFile`)}`).setCheck(null),this.appendValueInput(`FILE`).appendField(x(`onFile_file`)).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(b.Trigger.HUE),this.setTooltip(x(`offFile_tooltip`)),this.setHelpUrl(S(`offFile_help`))}},c.forBlock.offFile=function(e){let t=c.valueToCode(e,`OID`,s.ATOMIC),n=c.valueToCode(e,`FILE`,s.ATOMIC),r=g(t);return`offFile(${t}${r?` /* ${r} */`:``}, ${n});\n`},b.Trigger.blocks.onLog=` error`,o.onLog={init:function(){this.appendDummyInput(`TEXT`).appendField(`💬 ${x(`onLog`)}`),this.appendDummyInput(`Severity`).appendField(x(`loglevel`)).appendField(new n([[x(`loglevel_error`),`error`],[x(`loglevel_warn`),`warn`],[x(`loglevel_info`),`info`],[x(`loglevel_debug`),`debug`],[x(`loglevel_all`),`*`]]),`Severity`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(b.Trigger.HUE),this.setTooltip(x(`onLog_tooltip`)),this.setHelpUrl(S(`onLog_help`))},onchange:function(){d(this)}},c.forBlock.onLog=function(e){let t=c.statementToCode(e,`STATEMENT`);return`onLog('${e.getFieldValue(`Severity`)}', async (data) => {\n${t}});\n`},b.Trigger.blocks.onLog_data=` data.message`,k(`onLog_data`,`💬 `,[[x(`onLog_data_message`),`data.message`],[x(`loglevel`),`data.severity`],[x(`onLog_data_from`),`data.from`],[x(`onLog_data_ts`),`data.ts`]],[`onLog`],`onLog_data_warning`,b.Trigger.HUE),c.forBlock.onLog_data=function(e){return[e.getFieldValue(`ATTR`),s.ATOMIC]},b.Trigger.blocks.onEnumMembers=``,o.onEnumMembers={init:function(){this.appendDummyInput().appendField(x(`onEnumMembers`)),this.appendDummyInput(`OID`).appendField(new _(x(`select_id`),`enum`),`OID`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(b.Trigger.HUE),this.setTooltip(x(`onEnumMembers_tooltip`)),this.setHelpUrl(S(`onEnumMembers_help`))},onchange:function(){d(this)}},c.forBlock.onEnumMembers=function(e){let t=e.getFieldValue(`OID`),n=c.statementToCode(e,`STATEMENT`),r=p(t);return`onEnumMembers('${t}'${r?` /* ${r} */`:``}, async (obj) => {\n${D()}${n}});\n`}}export{b as install}; \ No newline at end of file diff --git a/admin/assets/helpers-JkY7wkCZ.js b/admin/assets/helpers-JkY7wkCZ.js new file mode 100644 index 00000000..2058366f --- /dev/null +++ b/admin/assets/helpers-JkY7wkCZ.js @@ -0,0 +1 @@ +import{l as javascriptGenerator}from"./index-2X_5uU-_.js";function reconnectChild(e,t,n){var r;if(!(e!=null&&e.getSourceBlock().workspace))return!1;let i=(r=t.getInput(n))==null?void 0:r.connection;if(!i)return!1;let a=e.targetBlock();return(!a||a===t)&&i.targetConnection!==e&&(i.isConnected()&&i.disconnect(),i.connect(e),!0)}function quote(e){return javascriptGenerator.quote_(e)}function dateFormat(e){return window.Blockly.Words[e].format}function dateFormatOptions(){let e=window.Blockly.Translate,t=[`object`,`ms`,`s`,`sid`,`m`,`mid`,`h`,`d`,`M`,`Mt`,`Mts`,`y`,`fy`,`wdt`,`wdts`,`wd`,`cw`,`custom`],n=[`time_get_yyyy.mm.dd`,`time_get_yyyy/mm/dd`,`time_get_yy.mm.dd`,`time_get_yy/mm/dd`,`time_get_dd.mm.yyyy`,`time_get_dd/mm/yyyy`,`time_get_dd.mm.yy`,`time_get_dd/mm/yy`,`time_get_mm/dd/yyyy`,`time_get_mm/dd/yy`,`time_get_dd.mm`,`time_get_dd/mm`,`time_get_mm.dd`,`time_get_mm/dd`,`time_get_hh_mm`,`time_get_hh_mm_ss`,`time_get_hh_mm_ss.sss`];return[...t.map(t=>[e(`time_get_${t}`),t]),...n.map(t=>[e(t),dateFormat(t)])]}function dateLanguageOptions(){let e=[`in english`,`en`],t=[`auf deutsch`,`de`],n=[`на русском`,`ru`];return window.systemLang===`de`?[t,e,n]:window.systemLang===`ru`?[n,e,t]:[e,t,n]}function isTrue(e){return e===!0||e===`true`||e===`TRUE`}function logLevelOptions(){let e=window.Blockly.Translate;return[[e(`loglevel_none`),``],[e(`loglevel_debug`),`debug`],[e(`loglevel_info`),`info`],[e(`loglevel_warn`),`warn`],[e(`loglevel_error`),`error`]]}function updateStatementInput(e,t){let n=t===void 0?isTrue(e.getFieldValue(`WITH_STATEMENT`)):t;e.getInput(`STATEMENT`)&&e.removeInput(`STATEMENT`),n&&e.appendStatementInput(`STATEMENT`)}function warnIfNotNestedIn(e,t,n){let r=!1,i=e;do{if(t.includes(i.type)){r=!0;break}i=i.getSurroundParent()}while(i);e.setWarningText(r?null:window.Blockly.Translate(n),e.id)}function objectNameOf(code){try{var _window$main;const objId=eval(code);let name=((_window$main=window.main)==null||(_window$main=_window$main.objects[objId])==null||(_window$main=_window$main.common)==null?void 0:_window$main.name)||``;return typeof name==`object`&&(name=name[window.systemLang]||name.en),name||``}catch{return``}}function toMilliseconds(e,t){let n=parseFloat(e);return t===`min`?n*6e4:t===`sec`?n*1e3:n}function objectNameById(e){var t;let n=((t=window.main)==null||(t=t.objects[e])==null||(t=t.common)==null?void 0:t.name)||``;return typeof n==`object`&&(n=n[window.systemLang]||n.en),n||``}function warnIfInsideTrigger(e){let t=e.getSurroundParent();for(;t;){if(window.Blockly.Trigger.WARNING_PARENTS.includes(t.type)){e.setWarningText(window.Blockly.Translate(`trigger_in_trigger_warning`),e.id);return}t=t.getSurroundParent()}e.setWarningText(null,e.id)}function namedResourceVariableModel(e,t){return{getId:()=>e,getName:()=>e,getType:()=>t,name:e,type:t}}export{namedResourceVariableModel as a,quote as c,updateStatementInput as d,warnIfInsideTrigger as f,logLevelOptions as i,reconnectChild as l,dateLanguageOptions as n,objectNameById as o,warnIfNotNestedIn as p,isTrue as r,objectNameOf as s,dateFormatOptions as t,toMilliseconds as u}; \ No newline at end of file diff --git a/admin/assets/index-2X_5uU-_.js b/admin/assets/index-2X_5uU-_.js new file mode 100644 index 00000000..fff60474 --- /dev/null +++ b/admin/assets/index-2X_5uU-_.js @@ -0,0 +1,871 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./RulesEditor-DwJ0UTnU.js","./Import-BH2X_ziv.js","./RulesEditor-BcGsf9n4.css","./Debugger-osayggsE.js","./Error-1oeF0cix.js","./ScriptEditorVanillaMonaco-BPeIEG64.js","./ScriptEditor-DiCKl9d2.js","./AiChatPanel-AefbI3hv.js","./AiDiffView-DtbcD6Yx.js","./blocks_action-Cax68JNQ.js","./blockly-DBw-ytY1.js","./rolldown-runtime-C0FnF6B9.js","./helpers-JkY7wkCZ.js","./blocks_convert-kP7xTnRo.js","./blocks_logic-DMmdGePo.js","./blocks_number-DNxaWJG0.js","./blocks_procedures-ChquWIeu.js","./field_script-4IGidWJ7.js","./blocks_sendto-BhFgmaXl.js","./blocks_system-DhweUbd2.js","./field_oid-CJZIeruf.js","./field_cron-BJLkgNzf.js","./blocks_object-CeScY42Q.js","./blocks_switch-DlLu45bT.js","./blocks_text-BmR86101.js","./blocks_time-y3-FPsEo.js","./blocks_trigger-BeibKDOj.js","./blocks_timeout-BJm5IiqU.js"])))=>i.map(i=>d[i]); +import{i as e,o as t,r as n,t as r}from"./rolldown-runtime-C0FnF6B9.js";import{n as i,r as a}from"./dist-CaOsN0XW.js";import{t as o}from"./vite-preload-helper-B7qeedMF.js";import"./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__iobroker_javascript__remoteEntry_js-BO-WKj5V.js";import{$n as s,$t as c,A as l,At as u,B as d,Bn as f,Cn as p,Ct as m,D as h,Dn as g,Dt as _,E as v,En as y,F as b,Ft as x,G as S,Gt as C,H as w,Hn as T,It as E,J as D,Jn as O,Jt as k,K as A,Kn as j,Kt as M,L as ee,Ln as N,Lt as P,M as F,Mn as I,Mt as te,N as ne,Nn as re,Nt as ie,O as ae,Ot as oe,P as se,Pn as ce,Pt as le,Q as ue,R as de,Rn as L,Rt as fe,S as pe,Sn as me,Sr as he,St as ge,Tn as _e,U as ve,Un as ye,Ut as R,V as be,Vn as xe,Vt as Se,W as Ce,Wn as z,Wt as we,X as Te,Y as Ee,Yn as B,Yt as De,Z as Oe,Zn as ke,_ as Ae,_n as je,_r as Me,_t as Ne,a as Pe,an as Fe,ar as Ie,at as Le,bn as Re,br as ze,bt as Be,c as Ve,cr as He,ct as Ue,d as We,dn as Ge,dr as Ke,en as qe,et as Je,f as V,fn as Ye,fr as Xe,ft as Ze,g as H,gn as Qe,gr as $e,gt as et,h as tt,hn as nt,hr as rt,ht as it,i as at,in as ot,ir as st,it as ct,j as lt,jn as ut,jt as dt,k as ft,kn as pt,kt as mt,l as ht,ln as gt,lr as _t,m as vt,mn as U,mr as yt,mt as bt,n as xt,nn as St,nr as W,nt as Ct,o as wt,on as Tt,or as Et,ot as Dt,p as Ot,pr as kt,pt as At,q as jt,qn as Mt,qt as Nt,r as Pt,rn as Ft,rr as It,rt as Lt,s as Rt,sr as zt,t as Bt,tn as Vt,tt as Ht,u as Ut,un as Wt,ur as Gt,v as Kt,vn as qt,vr as Jt,vt as Yt,wr as G,wt as Xt,x as Zt,xn as Qt,xr as $t,xt as en,y as tn,yn as nn,yr as rn,zn as an,zt as on}from"./_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js";import{t as sn}from"./_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-_q6w9ugW.js";import{n as cn,t as ln}from"./Import-BH2X_ziv.js";import{t as un}from"./Error-1oeF0cix.js";import{d as dn,g as fn,m as pn}from"./blockly-DBw-ytY1.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})(),G();var mn=r((e=>{var t=60103,n=60106,r=60107,i=60108,a=60114,o=60109,s=60110,c=60112,l=60113,u=60120,d=60115,f=60116;if(typeof Symbol==`function`&&Symbol.for){var p=Symbol.for;t=p(`react.element`),n=p(`react.portal`),r=p(`react.fragment`),i=p(`react.strict_mode`),a=p(`react.profiler`),o=p(`react.provider`),s=p(`react.context`),c=p(`react.forward_ref`),l=p(`react.suspense`),u=p(`react.suspense_list`),d=p(`react.memo`),f=p(`react.lazy`),p(`react.block`),p(`react.server.block`),p(`react.fundamental`),p(`react.debug_trace_mode`),p(`react.legacy_hidden`)}function m(e){if(typeof e==`object`&&e){var p=e.$$typeof;switch(p){case t:switch(e=e.type,e){case r:case a:case i:case l:case u:return e;default:switch(e&&=e.$$typeof,e){case s:case c:case f:case d:case o:return e;default:return p}}case n:return p}}}e.isFragment=function(e){return m(e)===r}})),hn=r(((e,t)=>{t.exports=mn()}))();function gn(e,t){let n=getComputedStyle(t);if(!n)return;let r=e===wn.Horizontal?t.clientWidth:t.clientHeight;return r===0?void 0:(e===wn.Horizontal?r-=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight):r-=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom),r)}function _n(e,t,n=[],r={condition:!0}){let{condition:i}=r,a=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`){var i=0;for(r=Object.getOwnPropertySymbols(e);i(i&&window.addEventListener(e,t,a),()=>{i&&window.removeEventListener(e,t)})),[e,t,i,...n])}(function(e,t){t===void 0&&(t={});var n=t.insertAt;if(e&&typeof document<`u`){var r=document.head||document.getElementsByTagName(`head`)[0],i=document.createElement(`style`);i.type=`text/css`,n===`top`&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}})(`/* === 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; +} +/* ====== */`);var vn=W.forwardRef((({className:e,theme:t,draggerClassName:n,direction:r=wn.Vertical,onDragging:i},a)=>{let o=`__dbk__gutter ${r} ${e||t}`,s=`__dbk__dragger ${r} ${n||t}`;return O(`div`,Object.assign({className:o,ref:a,dir:r,onMouseDown:i,onTouchStart:En?i:void 0},{children:O(`div`,{className:s},void 0)}),void 0)})),yn;function bn(e,t,n){let r,i;return t?(r=e/2,i=e):n?(r=e,i=e/2):(r=e,i=e),{aGutterSize:r,bGutterSize:i}}function xn(e,t){switch(t.type){case yn.SetIsReadyToCompute:return Object.assign(Object.assign({},e),{isReady:t.payload.isReady});case yn.CreatePairs:{let{direction:n,children:r,gutters:i}=t.payload,a=r[0].parentNode;if(!a)throw Error(`Cannot create pairs - parent is undefined.`);let o=gn(n,a);if(o===void 0)throw Error(`Cannot create pairs - parent has undefined or zero size: ${o}.`);let s=[];return r.forEach(((e,t)=>{if(t>0){let e=r[t-1],o=r[t],c=i[t-1],l=n===wn.Horizontal?e.getBoundingClientRect().left:e.getBoundingClientRect().top,u=n===wn.Horizontal?o.getBoundingClientRect().right:o.getBoundingClientRect().bottom,d=n===wn.Horizontal?e.getBoundingClientRect().width+c.getBoundingClientRect().width+o.getBoundingClientRect().width:e.getBoundingClientRect().height+c.getBoundingClientRect().height+o.getBoundingClientRect().height,f=n===wn.Horizontal?c.getBoundingClientRect().width:c.getBoundingClientRect().height,p={idx:t-1,a:e,b:o,gutter:c,parent:a,start:l,end:u,size:d,gutterSize:f,aSizePct:100/r.length,bSizePct:100/r.length};s.push(p)}})),Object.assign(Object.assign({},e),{pairs:s})}case yn.StartDragging:{let{gutterIdx:n}=t.payload;return Object.assign(Object.assign({},e),{isDragging:!0,draggingIdx:n})}case yn.StopDragging:return Object.assign(Object.assign({},e),{isDragging:!1});case yn.CalculateSizes:{let{direction:n,gutterIdx:r}=t.payload,i=e.pairs[r],a=gn(n,i.parent);if(!a)throw Error(`Cannot calculate sizes - 'pair.parent' has undefined or zero size.`);let o=i.gutter[n===wn.Horizontal?`clientWidth`:`clientHeight`],{aGutterSize:s,bGutterSize:c}=bn(o,r===0,r===e.pairs.length-1),l,u,d,f,p;return n===wn.Horizontal?(l=i.a.getBoundingClientRect().left,u=i.b.getBoundingClientRect().right,f=(i.a.getBoundingClientRect().width+s)/a*100,p=(i.b.getBoundingClientRect().width+c)/a*100,d=i.a.getBoundingClientRect().width+s+c+i.b.getBoundingClientRect().width):(l=i.a.getBoundingClientRect().top,u=i.b.getBoundingClientRect().bottom,f=(i.a.getBoundingClientRect().height+s)/a*100,p=(i.b.getBoundingClientRect().height+c)/a*100,d=i.a.getBoundingClientRect().height+s+c+i.b.getBoundingClientRect().height),e.pairs[r]=Object.assign(Object.assign({},i),{start:l,end:u,size:d,aSizePct:f,bSizePct:p,gutterSize:o}),Object.assign({},e)}default:return e}}function Sn(e,t=0,n=[]){return It.toArray(e).reduce(((e,r,i)=>((0,hn.isFragment)(r)?e.push.apply(e,Sn(r.props.children,t+1,n.concat(r.key||i))):_t(r)?e.push(st(r,{key:n.concat(String(r.key)).join(`.`)})):typeof r!=`string`&&typeof r!=`number`||e.push(r),e)),[])}(function(e){e[e.SetIsReadyToCompute=0]=`SetIsReadyToCompute`,e[e.CreatePairs=1]=`CreatePairs`,e[e.CalculateSizes=2]=`CalculateSizes`,e[e.StartDragging=3]=`StartDragging`,e[e.StopDragging=4]=`StopDragging`})(yn||={});var Cn=e=>`changedTouches`in e,wn,Tn;(function(e){e.Horizontal=`Horizontal`,e.Vertical=`Vertical`})(wn||={}),function(e){e.Light=`Light`,e.Dark=`Dark`}(Tn||={});var En=typeof window<`u`&&`ontouchstart`in window;function Dn(e){return e===wn.Horizontal?`col-resize`:`row-resize`}var On={isReady:!1,isDragging:!1,pairs:[]};function kn({direction:e=wn.Horizontal,minWidths:t=[],minHeights:n=[],initialSizes:r,gutterTheme:i=Tn.Dark,gutterClassName:a,draggerClassName:o,children:s,onResizeStarted:c,onResizeFinished:l,classes:u=[]}){let d=Sn(s),[f,p]=Jt(xn,On),m=rn(null),h=rn([]),g=rn([]);h.current=[],g.current=[];let _=W.useCallback((e=>{p({type:yn.SetIsReadyToCompute,payload:{isReady:e}})}),[]),v=W.useCallback(((e,t)=>{p({type:yn.StartDragging,payload:{gutterIdx:t}});let n=f.pairs[t];c==null||c(n.idx),n.a.style.userSelect=`none`,n.b.style.userSelect=`none`,n.gutter.style.cursor=Dn(e),n.parent.style.cursor=Dn(e),document.body.style.cursor=Dn(e)}),[f.pairs]),y=W.useCallback((()=>{p({type:yn.StopDragging});let t=[];for(let n=0;n{p({type:yn.CalculateSizes,payload:{direction:e,gutterIdx:t}})}),[]),x=W.useCallback(((e,t,n)=>{p({type:yn.CreatePairs,payload:{direction:e,children:t,gutters:n}})}),[]),S=W.useCallback(((e,t,n,r)=>{let i=t[0].parentNode;if(!i)throw Error(`Cannot set initial sizes - parent is undefined`);if(gn(e,i)===void 0)throw Error(`Cannot set initial sizes - parent has undefined size`);t.forEach(((i,a)=>{let o=a===0,s=a===t.length-1,c,l=0;t.length>1&&(l=n[s?a-1:a].getBoundingClientRect()[e===wn.Horizontal?`width`:`height`],l=o||s?l/2:l),c=r&&a{if(f.draggingIdx===void 0)throw Error(`Cannot adjust size - 'draggingIdx' is undefined`);let n=f.pairs[f.draggingIdx];if(n.size===void 0)throw Error(`Cannot adjust size - 'pair.size' is undefined`);if(n.gutterSize===void 0)throw Error(`Cannot adjust size - 'pair.gutterSize' is undefined`);let r=n.aSizePct+n.bSizePct,i=t/n.size*r,a=r-t/n.size*r,o=f.draggingIdx===0,s=f.draggingIdx===f.pairs.length-1,{aGutterSize:c,bGutterSize:l}=bn(n.gutterSize,o,s),u=`calc(${i}% - ${c}px)`,d=`calc(${a}% - ${l}px)`;e===wn.Horizontal?(n.a.style.width=u,n.b.style.width=d):(n.a.style.height=u,n.b.style.height=d)}),[f.draggingIdx,f.pairs,e]),w=W.useCallback(((e,t,n)=>{if(!f.isDragging)return;if(f.draggingIdx===void 0)throw Error(`Cannot drag - 'draggingIdx' is undefined`);let r=f.pairs[f.draggingIdx];if(r.start===void 0)throw Error(`Cannot drag - 'pair.start' is undefined`);if(r.size===void 0)throw Error(`Cannot drag - 'pair.size' is undefined`);if(r.gutterSize===void 0)throw Error(`Cannot drag - 'pair.gutterSize' is undefined`);let i=function(e,t){let n=Cn(t)?t.changedTouches[0]:t;return e===wn.Horizontal?n.clientX:n.clientY}(t,e)-r.start,a=16,o=16;n.length>f.draggingIdx&&(a=n[f.draggingIdx]),n.length>=f.draggingIdx+1&&(o=n[f.draggingIdx+1]),i=r.size-(r.gutterSize+o)&&(i=r.size-(r.gutterSize+o)),C(t,i)}),[f.isDragging,f.draggingIdx,f.pairs,C]),T=()=>{if(f.isDragging){if(f.draggingIdx===void 0)throw Error(`Cannot calculate sizes after dragging = 'state.draggingIdx' is undefined`);b(e,f.draggingIdx),y()}},E=r=>{f.isDragging&&(Cn(r)&&r.preventDefault(),w(r,e,e===wn.Horizontal?t:n))};function D(e,t){if(!e.current)throw Error(`Can't add element to ref object - ref isn't initialized`);t&&!e.current.includes(t)&&e.current.push(t)}return _n(`mouseup`,T,[f.isDragging,y]),_n(`mousemove`,E,[e,f.isDragging,w,t,n]),_n(`touchend`,T,[f.isDragging,y],{condition:En}),_n(`touchmove`,E,[e,f.isDragging,w,t,n],{condition:En,passive:!En}),yt((function(){if(!m.current)return;let t=m.current.parentElement;if(!t)return;let n=new ResizeObserver((()=>{let n=getComputedStyle(t),r=e===wn.Horizontal?t.clientWidth:t.clientHeight;_(!!n&&!!r)}));return n.observe(t),()=>{n.disconnect()}}),[m.current,e]),yt((function(){if(f.isReady&&(!h.current||h.current[0].offsetParent)){if(!h.current||!g.current)throw Error(`Cannot create pairs - either variable 'childRefs' or 'gutterRefs' is undefined`);d.length<=1?S(e,h.current,g.current,r):(S(e,h.current,g.current,r),x(e,h.current,g.current))}}),[s,f.isReady,e,S,x,r]),O(`div`,Object.assign({className:`__dbk__container ${e}`,ref:m},{children:f.isReady&&d.map(((t,n)=>B(W.Fragment,{children:[O(`div`,Object.assign({ref:e=>D(h,e),className:`__dbk__child-wrapper `+(nD(g,e),className:a,theme:i,draggerClassName:o,direction:e,onDragging:()=>{b(e,t=n),v(e,t);return;var t}},void 0)]},n)))}),void 0)}var An=L([O(`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`),O(`path`,{d:`M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z`},`1`)],`AccessTime`),jn=L(O(`path`,{d:`M22 11V3h-7v3H9V3H2v8h7V8h2v10h4v3h7v-8h-7v3h-2V8h2v3z`}),`AccountTree`),Mn=L(O(`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`),Nn=L(O(`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`),Pn=L(O(`path`,{d:`M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-5 14H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z`}),`Article`),Fn=L(O(`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`),In=L(O(`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`),Ln=L(O(`path`,{d:`M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 16H5V10h14zM9 14H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zm-8 4H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2z`}),`CalendarMonth`),Rn=L([O(`path`,{d:`m12 2-5.5 9h11z`},`0`),O(`circle`,{cx:`17.5`,cy:`17.5`,r:`4.5`},`1`),O(`path`,{d:`M3 13.5h8v8H3z`},`2`)],`Category`),zn=L(O(`path`,{d:`M7 2v11h3v9l7-12h-4l4-8z`}),`FlashOn`),Bn=L(O(`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`),Vn=L(O(`path`,{d:`M21 6h-2v9H6v2c0 .55.45 1 1 1h11l4 4V7c0-.55-.45-1-1-1m-4 6V3c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v14l4-4h10c.55 0 1-.45 1-1`}),`Forum`),Hn=L(O(`path`,{d:`M18 4H6v2l6.5 6L6 18v2h12v-3h-7l5-5-5-5h7z`}),`Functions`),Un=L(O(`path`,{d:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 17h-2v-2h2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25`}),`HelpOutlined`),Wn=L(O(`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`),Gn=L(O(`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`),Kn=L(O(`path`,{d:`M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-2 12H6v-2h12zm0-3H6V9h12zm0-3H6V6h12z`}),`Message`),qn=L(O(`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`),Jn=L(O(`path`,{d:`M7.58 4.08 6.15 2.65C3.75 4.48 2.17 7.3 2.03 10.5h2c.15-2.65 1.51-4.97 3.55-6.42m12.39 6.42h2c-.15-3.2-1.73-6.02-4.12-7.85l-1.42 1.43c2.02 1.45 3.39 3.77 3.54 6.42M18 11c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2zm-6 11c.14 0 .27-.01.4-.04.65-.14 1.18-.58 1.44-1.18q.15-.36.15-.78h-4c.01 1.1.9 2 2.01 2`}),`NotificationsActive`),Yn=L(O(`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`),Xn=L(O(`path`,{d:`M6 19h4V5H6zm8-14v14h4V5z`}),`Pause`),Zn=L(O(`path`,{d:`M8 5v14l11-7z`}),`PlayArrow`),Qn=L(O(`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`),$n=L(O(`path`,{d:`m17.66 9.53-7.07 7.07-4.24-4.24 1.41-1.41 2.83 2.83 5.66-5.66zM4 12c0-2.33 1.02-4.42 2.62-5.88L9 8.5v-6H3l2.2 2.2C3.24 6.52 2 9.11 2 12c0 5.19 3.95 9.45 9 9.95v-2.02c-3.94-.49-7-3.86-7-7.93m18 0c0-5.19-3.95-9.45-9-9.95v2.02c3.94.49 7 3.86 7 7.93 0 2.33-1.02 4.42-2.62 5.88L15 15.5v6h6l-2.2-2.2c1.96-1.82 3.2-4.41 3.2-7.3`}),`PublishedWithChanges`),er=L(O(`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`),tr=L(O(`path`,{d:`M2.01 21 23 12 2.01 3 2 10l15 2-15 2z`}),`Send`),nr=L(O(`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`),rr=L(O(`path`,{d:`M6 6h12v12H6z`}),`Stop`),ir=L(O(`path`,{d:`M2 20h20v-4H2zm2-3h2v2H4zM2 4v4h20V4zm4 3H4V5h2zm-4 7h20v-4H2zm2-3h2v2H4z`}),`Storage`),ar=L(O(`path`,{d:`M14 17H4v2h10zm6-8H4v2h16zM4 15h16v-2H4zM4 5v2h16V5z`}),`Subject`),or=L(O(`path`,{d:`M6.99 11 3 15l3.99 4v-3H14v-2H6.99zM21 9l-3.99-4v3H10v2h7.01v3z`}),`SwapHoriz`),sr=L(O(`path`,{d:`M16 17.01V10h-2v7.01h-3L15 21l4-3.99zM9 3 5 6.99h3V14h2V6.99h3z`}),`SwapVert`),cr=L(O(`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`),lr=L(O(`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`);G();var ur=Ie({dragDropManager:void 0});function dr(e){"@babel/helpers - typeof";return dr=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},dr(e)}function fr(e,t){if(dr(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(dr(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function pr(e){var t=fr(e,`string`);return dr(t)==`symbol`?t:t+``}function mr(e,t,n){return(t=pr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hr(e){return`Minified Redux error #`+e+`; visit https://redux.js.org/Errors?code=`+e+` for the full message or use the non-minified dev environment for full errors. `}var gr=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})(),_r=function(){return Math.random().toString(36).substring(7).split(``).join(`.`)},vr={INIT:`@@redux/INIT`+_r(),REPLACE:`@@redux/REPLACE`+_r(),PROBE_UNKNOWN_ACTION:function(){return`@@redux/PROBE_UNKNOWN_ACTION`+_r()}};function yr(e){if(typeof e!=`object`||!e)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function br(e,t,n){var r;if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(hr(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(hr(1));return n(br)(e,t)}if(typeof e!=`function`)throw Error(hr(2));var i=e,a=t,o=[],s=o,c=!1;function l(){s===o&&(s=o.slice())}function u(){if(c)throw Error(hr(3));return a}function d(e){if(typeof e!=`function`)throw Error(hr(4));if(c)throw Error(hr(5));var t=!0;return l(),s.push(e),function(){if(t){if(c)throw Error(hr(6));t=!1,l();var n=s.indexOf(e);s.splice(n,1),o=null}}}function f(e){if(!yr(e))throw Error(hr(7));if(e.type===void 0)throw Error(hr(8));if(c)throw Error(hr(9));try{c=!0,a=i(a,e)}finally{c=!1}for(var t=o=s,n=0;ne&&e[t]?e[t]:n||null,e)}function Cr(e,t){return e.filter(e=>e!==t)}function wr(e){return typeof e==`object`}function Tr(e,t){let n=new Map,r=e=>{n.set(e,n.has(e)?n.get(e)+1:1)};e.forEach(r),t.forEach(r);let i=[];return n.forEach((e,t)=>{e===1&&i.push(t)}),i}function Er(e,t){return e.filter(e=>t.indexOf(e)>-1)}var Dr=`dnd-core/INIT_COORDS`,Or=`dnd-core/BEGIN_DRAG`,kr=`dnd-core/PUBLISH_DRAG_SOURCE`,Ar=`dnd-core/HOVER`,jr=`dnd-core/DROP`,Mr=`dnd-core/END_DRAG`;function Nr(e,t){return{type:Dr,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}var Pr={type:Dr,payload:{clientOffset:null,sourceClientOffset:null}};function Fr(e){return function(t=[],n={publishSource:!0}){let{publishSource:r=!0,clientOffset:i,getSourceClientOffset:a}=n,o=e.getMonitor(),s=e.getRegistry();e.dispatch(Nr(i)),Ir(t,o,s);let c=zr(t,o);if(c==null){e.dispatch(Pr);return}let l=null;if(i){if(!a)throw Error(`getSourceClientOffset must be defined`);Lr(a),l=a(c)}e.dispatch(Nr(i,l));let u=s.getSource(c).beginDrag(o,c);return u==null?void 0:(Rr(u),s.pinSource(c),{type:Or,payload:{itemType:s.getSourceType(c),item:u,sourceId:c,clientOffset:i||null,sourceClientOffset:l||null,isSourcePublic:!!r}})}}function Ir(e,t,n){K(!t.isDragging(),`Cannot call beginDrag while dragging.`),e.forEach(function(e){K(n.getSource(e),`Expected sourceIds to be registered.`)})}function Lr(e){K(typeof e==`function`,`When clientOffset is provided, getSourceClientOffset must be a function.`)}function Rr(e){K(wr(e),`Item must be an object.`)}function zr(e,t){let n=null;for(let r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}function Br(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vr(e){for(var t=1;t{let o={type:jr,payload:{dropResult:Vr({},t,Wr(i,a,r,n))}};e.dispatch(o)})}}function Ur(e){K(e.isDragging(),`Cannot call drop while not dragging.`),K(!e.didDrop(),`Cannot call drop twice during one drag operation.`)}function Wr(e,t,n,r){let i=n.getTarget(e),a=i?i.drop(r,e):void 0;return Gr(a),a===void 0&&(a=t===0?{}:r.getDropResult()),a}function Gr(e){K(e===void 0||wr(e),`Drop result must either be an object or undefined.`)}function Kr(e){let t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function qr(e){return function(){let t=e.getMonitor(),n=e.getRegistry();Jr(t);let r=t.getSourceId();return r!=null&&(n.getSource(r,!0).endDrag(t,r),n.unpinSource()),{type:Mr}}}function Jr(e){K(e.isDragging(),`Cannot call endDrag while not dragging.`)}function Yr(e,t){return t===null?e===null:Array.isArray(e)?e.some(e=>e===t):e===t}function Xr(e){return function(t,{clientOffset:n}={}){Zr(t);let r=t.slice(0),i=e.getMonitor(),a=e.getRegistry();return $r(r,a,i.getItemType()),Qr(r,i,a),ei(r,i,a),{type:Ar,payload:{targetIds:r,clientOffset:n||null}}}}function Zr(e){K(Array.isArray(e),`Expected targetIds to be an array.`)}function Qr(e,t,n){K(t.isDragging(),`Cannot call hover while not dragging.`),K(!t.didDrop(),`Cannot call hover after drop.`);for(let t=0;t=0;r--){let i=e[r];Yr(t.getTargetType(i),n)||e.splice(r,1)}}function ei(e,t,n){e.forEach(function(e){n.getTarget(e).hover(t,e)})}function ti(e){return function(){if(e.getMonitor().isDragging())return{type:kr}}}function ni(e){return{beginDrag:Fr(e),publishDragSource:ti(e),hover:Xr(e),drop:Hr(e),endDrag:qr(e)}}var ri=class{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){let e=this,{dispatch:t}=this.store;function n(n){return(...r)=>{let i=n.apply(e,r);i!==void 0&&t(i)}}let r=ni(this);return Object.keys(r).reduce((e,t)=>{let i=r[t];return e[t]=n(i),e},{})}dispatch(e){this.store.dispatch(e)}constructor(e,t){this.isSetUp=!1,this.handleRefCountChange=()=>{let e=this.store.getState().refCount>0;this.backend&&(e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=t,e.subscribe(this.handleRefCountChange)}};function ii(e,t){return{x:e.x+t.x,y:e.y+t.y}}function ai(e,t){return{x:e.x-t.x,y:e.y-t.y}}function oi(e){let{clientOffset:t,initialClientOffset:n,initialSourceClientOffset:r}=e;return!t||!n||!r?null:ai(ii(t,r),n)}function si(e){let{clientOffset:t,initialClientOffset:n}=e;return!t||!n?null:ai(t,n)}var ci=[],li=[];ci.__IS_NONE__=!0,li.__IS_ALL__=!0;function ui(e,t){return e===ci?!1:e===li||t===void 0||Er(t,e).length>0}var di=class{subscribeToStateChange(e,t={}){let{handlerIds:n}=t;K(typeof e==`function`,`listener must be a function.`),K(n===void 0||Array.isArray(n),`handlerIds, when specified, must be an array of strings.`);let r=this.store.getState().stateId;return this.store.subscribe(()=>{let t=this.store.getState(),i=t.stateId;try{i===r||i===r+1&&!ui(t.dirtyHandlerIds,n)||e()}finally{r=i}})}subscribeToOffsetChange(e){K(typeof e==`function`,`listener must be a function.`);let t=this.store.getState().dragOffset;return this.store.subscribe(()=>{let n=this.store.getState().dragOffset;n!==t&&(t=n,e())})}canDragSource(e){if(!e)return!1;let t=this.registry.getSource(e);return K(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()&&t.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;let t=this.registry.getTarget(e);return K(t,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop()?!1:Yr(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;let t=this.registry.getSource(e,!0);return K(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic()||this.registry.getSourceType(e)!==this.getItemType()?!1:t.isDragging(this,e)}isOverTarget(e,t={shallow:!1}){if(!e)return!1;let{shallow:n}=t;if(!this.isDragging())return!1;let r=this.registry.getTargetType(e),i=this.getItemType();if(i&&!Yr(r,i))return!1;let a=this.getTargetIds();if(!a.length)return!1;let o=a.indexOf(e);return n?o===a.length-1:o>-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 oi(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return si(this.store.getState().dragOffset)}constructor(e,t){this.store=e,this.registry=t}},fi=typeof global<`u`?global:self,pi=fi.MutationObserver||fi.WebKitMutationObserver;function mi(e){return function(){let t=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(t),clearInterval(n),e()}}}function hi(e){let t=1,n=new pi(e),r=document.createTextNode(``);return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}var gi=typeof pi==`function`?hi:mi,_i=class{enqueueTask(e){let{queue:t,requestFlush:n}=this;t.length||(n(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{let{queue:e}=this;for(;this.indexthis.capacity){for(let t=0,n=e.length-this.index;t{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=gi(this.flush),this.requestErrorThrow=mi(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},vi=class{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}},yi=class{create(e){let t=this.freeTasks,n=t.length?t.pop():new vi(this.onError,e=>t[t.length]=e);return n.task=e,n}constructor(e){this.onError=e,this.freeTasks=[]}},bi=new _i,xi=new yi(bi.registerPendingError);function Si(e){bi.enqueueTask(xi.create(e))}var Ci=`dnd-core/ADD_SOURCE`,wi=`dnd-core/ADD_TARGET`,Ti=`dnd-core/REMOVE_SOURCE`,Ei=`dnd-core/REMOVE_TARGET`;function Di(e){return{type:Ci,payload:{sourceId:e}}}function Oi(e){return{type:wi,payload:{targetId:e}}}function ki(e){return{type:Ti,payload:{sourceId:e}}}function Ai(e){return{type:Ei,payload:{targetId:e}}}function ji(e){K(typeof e.canDrag==`function`,`Expected canDrag to be a function.`),K(typeof e.beginDrag==`function`,`Expected beginDrag to be a function.`),K(typeof e.endDrag==`function`,`Expected endDrag to be a function.`)}function Mi(e){K(typeof e.canDrop==`function`,`Expected canDrop to be a function.`),K(typeof e.hover==`function`,`Expected hover to be a function.`),K(typeof e.drop==`function`,`Expected beginDrag to be a function.`)}function Ni(e,t){if(t&&Array.isArray(e)){e.forEach(e=>Ni(e,!1));return}K(typeof e==`string`||typeof e==`symbol`,t?`Type can only be a string, a symbol, or an array of either.`:`Type can only be a string or a symbol.`)}var Pi;(function(e){e.SOURCE=`SOURCE`,e.TARGET=`TARGET`})(Pi||={});var Fi=0;function Ii(){return Fi++}function Li(e){let t=Ii().toString();switch(e){case Pi.SOURCE:return`S${t}`;case Pi.TARGET:return`T${t}`;default:throw Error(`Unknown Handler Role: ${e}`)}}function Ri(e){switch(e[0]){case`S`:return Pi.SOURCE;case`T`:return Pi.TARGET;default:throw Error(`Cannot parse handler ID: ${e}`)}}function zi(e,t){let n=e.entries(),r=!1;do{let{done:e,value:[,i]}=n.next();if(i===t)return!0;r=!!e}while(!r);return!1}var Bi=class{addSource(e,t){Ni(e),ji(t);let n=this.addHandler(Pi.SOURCE,e,t);return this.store.dispatch(Di(n)),n}addTarget(e,t){Ni(e,!0),Mi(t);let n=this.addHandler(Pi.TARGET,e,t);return this.store.dispatch(Oi(n)),n}containsHandler(e){return zi(this.dragSources,e)||zi(this.dropTargets,e)}getSource(e,t=!1){return K(this.isSourceId(e),`Expected a valid source ID.`),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return K(this.isTargetId(e),`Expected a valid target ID.`),this.dropTargets.get(e)}getSourceType(e){return K(this.isSourceId(e),`Expected a valid source ID.`),this.types.get(e)}getTargetType(e){return K(this.isTargetId(e),`Expected a valid target ID.`),this.types.get(e)}isSourceId(e){return Ri(e)===Pi.SOURCE}isTargetId(e){return Ri(e)===Pi.TARGET}removeSource(e){K(this.getSource(e),`Expected an existing source.`),this.store.dispatch(ki(e)),Si(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){K(this.getTarget(e),`Expected an existing target.`),this.store.dispatch(Ai(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){let t=this.getSource(e);K(t,`Expected an existing source.`),this.pinnedSourceId=e,this.pinnedSource=t}unpinSource(){K(this.pinnedSource,`No source is pinned at the time.`),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,t,n){let r=Li(e);return this.types.set(r,t),e===Pi.SOURCE?this.dragSources.set(r,n):e===Pi.TARGET&&this.dropTargets.set(r,n),r}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}},Vi=(e,t)=>e===t;function Hi(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Ui(e,t,n=Vi){if(e.length!==t.length)return!1;for(let r=0;r0||!Ui(n,r)))return ci;let a=r[r.length-1],o=n[n.length-1];return a!==o&&(a&&i.push(a),o&&i.push(o)),i}function Gi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ki(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sa(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a=0)&&(n[i]=e[i]);return n}var ca=0,la=Symbol.for(`__REACT_DND_CONTEXT_INSTANCE__`),ua=Gt(function(e){var{children:t}=e;let[n,r]=da(oa(e,[`children`]));return yt(()=>{if(r){let e=pa();return++ca,()=>{--ca===0&&(e[la]=null)}}},[]),O(ur.Provider,{value:n,children:t})});function da(e){return`manager`in e?[{dragDropManager:e.manager},!1]:[fa(e.backend,e.context,e.options,e.debugMode),!e.context]}function fa(e,t=pa(),n,r){let i=t;return i[la]||(i[la]={dragDropManager:ia(e,t,n,r)}),i[la]}function pa(){return typeof global<`u`?global:window}var ma=r(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}}));G();var ha=typeof window<`u`?$e:yt,ga=t(ma(),1);G();function _a(e,t,n){let[r,i]=ze(()=>t(e)),a=Xe(()=>{let a=t(e);(0,ga.default)(r,a)||(i(a),n&&n())},[r,e,n]);return ha(a),[r,a]}function va(e,t,n){let[r,i]=_a(e,t,n);return ha(function(){let t=e.getHandlerId();if(t!=null)return e.subscribeToStateChange(i,{handlerIds:[t]})},[e,i]),r}function ya(e,t,n){return va(t,e||(()=>({})),()=>n.reconnect())}G();function ba(e,t){let n=[...t||[]];return t==null&&typeof e!=`function`&&n.push(e),Me(()=>typeof e==`function`?e():e,n)}G();function xa(e){return Me(()=>e.hooks.dragSource(),[e])}function Sa(e){return Me(()=>e.hooks.dragPreview(),[e])}var Ca=!1,wa=!1,Ta=class{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){K(!Ca,`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 Ca=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Ca=!1}}isDragging(){if(!this.sourceId)return!1;K(!wa,`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 wa=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{wa=!1}}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,t){return this.internalMonitor.isOverTarget(e,t)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}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(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}},Ea=!1,Da=class{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}canDrop(){if(!this.targetId)return!1;K(!Ea,`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 Ea=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Ea=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!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(e){this.targetId=null,this.internalMonitor=e.getMonitor()}};function Oa(e,t,n){let r=n.getRegistry(),i=r.addTarget(e,t);return[i,()=>r.removeTarget(i)]}function ka(e,t,n){let r=n.getRegistry(),i=r.addSource(e,t);return[i,()=>r.removeSource(i)]}function Aa(e,t,n,r){let i=n?n.call(r,e,t):void 0;if(i!==void 0)return!!i;if(e===t)return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let a=Object.keys(e),o=Object.keys(t);if(a.length!==o.length)return!1;let s=Object.prototype.hasOwnProperty.bind(t);for(let o=0;o, or turn it into a drag source or a drop target itself.`)}function Na(e){return(t=null,n=null)=>{if(!_t(t)){let r=t;return e(r,n),r}let r=t;return Ma(r),Ia(r,n?t=>e(t,n):e)}}function Pa(e){let t={};return Object.keys(e).forEach(n=>{let r=e[n];if(n.endsWith(`Ref`))t[n]=e[n];else{let e=Na(r);t[n]=()=>e}}),t}function Fa(e,t){typeof e==`function`?e(t):e.current=t}function Ia(e,t){let n=e.ref;return K(typeof n!=`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`),n?st(e,{ref:e=>{Fa(n,e),Fa(t,e)}}):st(e,{ref:t})}var La=class{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){let e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){let e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return t&&this.disconnectDragSource(),this.handlerId?e?(t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),t):(this.lastConnectedDragSource=e,t):t}reconnectDragPreview(e=!1){let t=this.dragPreview,n=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(n&&this.disconnectDragPreview(),this.handlerId){if(!t){this.lastConnectedDragPreview=t;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=t,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,t,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Aa(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Aa(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){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(e){this.hooks=Pa({dragSource:(e,t)=>{this.clearDragSource(),this.dragSourceOptions=t||null,ja(e)?this.dragSourceRef=e:this.dragSourceNode=e,this.reconnectDragSource()},dragPreview:(e,t)=>{this.clearDragPreview(),this.dragPreviewOptions=t||null,ja(e)?this.dragPreviewRef=e:this.dragPreviewNode=e,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=e}},Ra=class{get connectTarget(){return this.dropTarget}reconnect(){let e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();let t=this.dropTarget;if(this.handlerId){if(!t){this.lastConnectedDropTarget=t;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Aa(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&=(this.unsubscribeDropTarget(),void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=Pa({dropTarget:(e,t)=>{this.clearDropTarget(),this.dropTargetOptions=t,ja(e)?this.dropTargetRef=e:this.dropTargetNode=e,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}};G();function za(){let{dragDropManager:e}=kt(ur);return K(e!=null,`Expected drag drop context`),e}G();function Ba(e,t){let n=za(),r=Me(()=>new La(n.getBackend()),[n]);return ha(()=>(r.dragSourceOptions=e||null,r.reconnect(),()=>r.disconnectDragSource()),[r,e]),ha(()=>(r.dragPreviewOptions=t||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,t]),r}G();function Va(){let e=za();return Me(()=>new Ta(e),[e])}var Ha=class{beginDrag(){let e=this.spec,t=this.monitor,n=null;return n=typeof e.item==`object`?e.item:typeof e.item==`function`?e.item(t):{},n??null}canDrag(){let e=this.spec,t=this.monitor;return typeof e.canDrag==`boolean`?e.canDrag:typeof e.canDrag!=`function`||e.canDrag(t)}isDragging(e,t){let n=this.spec,r=this.monitor,{isDragging:i}=n;return i?i(r):t===e.getSourceId()}endDrag(){let e=this.spec,t=this.monitor,n=this.connector,{end:r}=e;r&&r(t.getItem(),t),n.reconnect()}constructor(e,t,n){this.spec=e,this.monitor=t,this.connector=n}};G();function Ua(e,t,n){let r=Me(()=>new Ha(e,t,n),[t,n]);return yt(()=>{r.spec=e},[e]),r}G();function Wa(e){return Me(()=>{let t=e.type;return K(t!=null,`spec.type must be defined`),t},[e])}function Ga(e,t,n){let r=za(),i=Ua(e,t,n),a=Wa(e);ha(function(){if(a!=null){let[e,o]=ka(a,i,r);return t.receiveHandlerId(e),n.receiveHandlerId(e),o}},[r,t,n,i,a])}function Ka(e,t){let n=ba(e,t);K(!n.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)`);let r=Va(),i=Ba(n.options,n.previewOptions);return Ga(n,r,i),[ya(n.collect,r,i),xa(i),Sa(i)]}G();function qa(e){return Me(()=>e.hooks.dropTarget(),[e])}G();function Ja(e){let t=za(),n=Me(()=>new Ra(t.getBackend()),[t]);return ha(()=>(n.dropTargetOptions=e||null,n.reconnect(),()=>n.disconnectDropTarget()),[e]),n}G();function Ya(){let e=za();return Me(()=>new Da(e),[e])}G();function Xa(e){let{accept:t}=e;return Me(()=>(K(e.accept!=null,`accept must be defined`),Array.isArray(t)?t:[t]),[t])}var Za=class{canDrop(){let e=this.spec,t=this.monitor;return!e.canDrop||e.canDrop(t.getItem(),t)}hover(){let e=this.spec,t=this.monitor;e.hover&&e.hover(t.getItem(),t)}drop(){let e=this.spec,t=this.monitor;if(e.drop)return e.drop(t.getItem(),t)}constructor(e,t){this.spec=e,this.monitor=t}};G();function Qa(e,t){let n=Me(()=>new Za(e,t),[t]);return yt(()=>{n.spec=e},[e]),n}function $a(e,t,n){let r=za(),i=Qa(e,t),a=Xa(e);ha(function(){let[e,o]=Oa(a,i,r);return t.receiveHandlerId(e),n.receiveHandlerId(e),o},[r,t,i,n,a.map(e=>e.toString()).join(`|`)])}function eo(e,t){let n=ba(e,t),r=Ya(),i=Ja(n.options);return $a(n,r,i),[ya(n.collect,r,i),qa(i)]}function to(e){let t=null;return()=>(t??=e(),t)}function no(e,t){return e.filter(e=>e!==t)}function ro(e,t){let n=new Set,r=e=>n.add(e);e.forEach(r),t.forEach(r);let i=[];return n.forEach(e=>i.push(e)),i}var io=class{enter(e){let t=this.entered.length,n=t=>this.isNodeInDocument(t)&&(!t.contains||t.contains(e));return this.entered=ro(this.entered.filter(n),[e]),t===0&&this.entered.length>0}leave(e){let t=this.entered.length;return this.entered=no(this.entered.filter(this.isNodeInDocument),e),t>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}},ao=class{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){let t={};Object.keys(this.config.exposeProperties).forEach(n=>{let r=this.config.exposeProperties[n];r!=null&&(t[n]={value:r(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,t)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,t){return t===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}},oo=n({FILE:()=>so,HTML:()=>uo,TEXT:()=>lo,URL:()=>co}),so=`__NATIVE_FILE__`,co=`__NATIVE_URL__`,lo=`__NATIVE_TEXT__`,uo=`__NATIVE_HTML__`;function fo(e,t,n){return t.reduce((t,n)=>t||e.getData(n),``)??n}var po={[so]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:[`Files`]},[uo]:{exposeProperties:{html:(e,t)=>fo(e,t,``),dataTransfer:e=>e},matchesTypes:[`Html`,`text/html`]},[co]:{exposeProperties:{urls:(e,t)=>fo(e,t,``).split(` +`),dataTransfer:e=>e},matchesTypes:[`Url`,`text/uri-list`]},[lo]:{exposeProperties:{text:(e,t)=>fo(e,t,``),dataTransfer:e=>e},matchesTypes:[`Text`,`text/plain`]}};function mo(e,t){let n=po[e];if(!n)throw Error(`native type ${e} has no configuration`);let r=new ao(n);return r.loadDataTransfer(t),r}function ho(e){if(!e)return null;let t=Array.prototype.slice.call(e.types||[]);return Object.keys(po).filter(e=>{let n=po[e];return n!=null&&n.matchesTypes?n.matchesTypes.some(e=>t.indexOf(e)>-1):!1})[0]||null}var go=to(()=>/firefox/i.test(navigator.userAgent)),_o=to(()=>!!window.safari),vo=class{interpolate(e){let{xs:t,ys:n,c1s:r,c2s:i,c3s:a}=this,o=t.length-1;if(e===t[o])return n[o];let s=0,c=a.length-1,l;for(;s<=c;){l=Math.floor(.5*(s+c));let r=t[l];if(re)c=l-1;else return n[l]}o=Math.max(0,c);let u=e-t[o],d=u*u;return n[o]+r[o]*u+i[o]*d+a[o]*u*d}constructor(e,t){let{length:n}=e,r=[];for(let e=0;ee[t]{let e=new vo([0,.5,1],[s.y,s.y/l*p,s.y+p-l]).interpolate(d);return _o()&&a&&(e+=(window.devicePixelRatio-1)*p),e},h=()=>new vo([0,.5,1],[s.x,s.x/c*f,s.x+f-c]).interpolate(u),{offsetX:g,offsetY:_}=i,v=g===0||g,y=_===0||_;return{x:v?g:h(),y:y?_:m()}}var To=class{get window(){if(this.globalContext)return this.globalContext;if(typeof window<`u`)return window}get document(){var e;if((e=this.globalContext)!=null&&e.document)return this.globalContext.document;if(this.window)return this.window.document}get rootElement(){var e;return((e=this.optionsArgs)==null?void 0:e.rootElement)||this.window}constructor(e,t){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=t}};function Eo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Do(e){for(var t=1;t{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,t,n){this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,n);let r=t=>this.handleDragStart(t,e),i=e=>this.handleSelectStart(e);return t.setAttribute(`draggable`,`true`),t.addEventListener(`dragstart`,r),t.addEventListener(`selectstart`,i),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),t.removeEventListener(`dragstart`,r),t.removeEventListener(`selectstart`,i),t.setAttribute(`draggable`,`false`)}}connectDropTarget(e,t){let n=t=>this.handleDragEnter(t,e),r=t=>this.handleDragOver(t,e),i=t=>this.handleDrop(t,e);return t.addEventListener(`dragenter`,n),t.addEventListener(`dragover`,r),t.addEventListener(`drop`,i),()=>{t.removeEventListener(`dragenter`,n),t.removeEventListener(`dragover`,r),t.removeEventListener(`drop`,i)}}addEventListeners(e){e.addEventListener&&(e.addEventListener(`dragstart`,this.handleTopDragStart),e.addEventListener(`dragstart`,this.handleTopDragStartCapture,!0),e.addEventListener(`dragend`,this.handleTopDragEndCapture,!0),e.addEventListener(`dragenter`,this.handleTopDragEnter),e.addEventListener(`dragenter`,this.handleTopDragEnterCapture,!0),e.addEventListener(`dragleave`,this.handleTopDragLeaveCapture,!0),e.addEventListener(`dragover`,this.handleTopDragOver),e.addEventListener(`dragover`,this.handleTopDragOverCapture,!0),e.addEventListener(`drop`,this.handleTopDrop),e.addEventListener(`drop`,this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener(`dragstart`,this.handleTopDragStart),e.removeEventListener(`dragstart`,this.handleTopDragStartCapture,!0),e.removeEventListener(`dragend`,this.handleTopDragEndCapture,!0),e.removeEventListener(`dragenter`,this.handleTopDragEnter),e.removeEventListener(`dragenter`,this.handleTopDragEnterCapture,!0),e.removeEventListener(`dragleave`,this.handleTopDragLeaveCapture,!0),e.removeEventListener(`dragover`,this.handleTopDragOver),e.removeEventListener(`dragover`,this.handleTopDragOverCapture,!0),e.removeEventListener(`drop`,this.handleTopDrop),e.removeEventListener(`drop`,this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){let e=this.monitor.getSourceId(),t=this.sourceNodeOptions.get(e);return Do({dropEffect:this.altKeyPressed?`copy`:`move`},t||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?`copy`:this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){let e=this.monitor.getSourceId();return Do({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}isDraggingNativeItem(){let e=this.monitor.getItemType();return Object.keys(oo).some(t=>oo[t]===e)}beginDragNativeItem(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=mo(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.mouseMoveTimeoutTimer=setTimeout(()=>{var e;return(e=this.rootElement)==null?void 0:e.addEventListener(`mousemove`,this.endDragIfSourceWasRemovedFromDOM,!0)},1e3)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)==null||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener(`mousemove`,this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,t){e.defaultPrevented||(this.dragStartSourceIds||=[],this.dragStartSourceIds.unshift(t))}handleDragEnter(e,t){this.dragEnterTargetIds.unshift(t)}handleDragOver(e,t){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}handleDrop(e,t){this.dropTargetIds.unshift(t)}constructor(e,t,n){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=e=>{let t=this.sourceNodes.get(e);return t&&bo(t)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=e=>!!(e&&this.document&&this.document.body&&this.document.body.contains(e)),this.endDragIfSourceWasRemovedFromDOM=()=>{let e=this.currentDragSourceNode;e==null||this.isNodeInDocument(e)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=e=>{this.hoverRafId===null&&typeof requestAnimationFrame<`u`&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(e||[],{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=e=>{if(e.defaultPrevented)return;let{dragStartSourceIds:t}=this;this.dragStartSourceIds=null;let n=xo(e);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(t||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:n});let{dataTransfer:r}=e,i=ho(r);if(this.monitor.isDragging()){if(r&&typeof r.setDragImage==`function`){let e=this.monitor.getSourceId(),t=this.sourceNodes.get(e),i=this.sourcePreviewNodes.get(e)||t;if(i){let{anchorX:e,anchorY:a,offsetX:o,offsetY:s}=this.getCurrentSourcePreviewNodeOptions(),c=wo(t,i,n,{anchorX:e,anchorY:a},{offsetX:o,offsetY:s});r.setDragImage(i,c.x,c.y)}}try{r==null||r.setData(`application/json`,{})}catch{}this.setCurrentDragSourceNode(e.target);let{captureDraggingState:t}=this.getCurrentSourcePreviewNodeOptions();t?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(i)this.beginDragNativeItem(i);else if(r&&!r.types&&(e.target&&!e.target.hasAttribute||!e.target.hasAttribute(`draggable`)))return;else e.preventDefault()},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=e=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var t;(t=this.currentNativeSource)==null||t.loadDataTransfer(e.dataTransfer)}if(!this.enterLeaveCounter.enter(e.target)||this.monitor.isDragging())return;let{dataTransfer:n}=e,r=ho(n);r&&this.beginDragNativeItem(r,n)},this.handleTopDragEnter=e=>{let{dragEnterTargetIds:t}=this;this.dragEnterTargetIds=[],this.monitor.isDragging()&&(this.altKeyPressed=e.altKey,t.length>0&&this.actions.hover(t,{clientOffset:xo(e)}),t.some(e=>this.monitor.canDropOnTarget(e))&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=this.getCurrentDropEffect())))},this.handleTopDragOverCapture=e=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var t;(t=this.currentNativeSource)==null||t.loadDataTransfer(e.dataTransfer)}},this.handleTopDragOver=e=>{let{dragOverTargetIds:t}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`none`);return}this.altKeyPressed=e.altKey,this.lastClientOffset=xo(e),this.scheduleHover(t),(t||[]).some(e=>this.monitor.canDropOnTarget(e))?(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?e.preventDefault():(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`none`))},this.handleTopDragLeaveCapture=e=>{this.isDraggingNativeItem()&&e.preventDefault(),this.enterLeaveCounter.leave(e.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=e=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var t;e.preventDefault(),(t=this.currentNativeSource)==null||t.loadDataTransfer(e.dataTransfer)}else ho(e.dataTransfer)&&e.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=e=>{let{dropTargetIds:t}=this;this.dropTargetIds=[],this.actions.hover(t,{clientOffset:xo(e)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=e=>{let t=e.target;typeof t.dragDrop==`function`&&(t.tagName===`INPUT`||t.tagName===`SELECT`||t.tagName===`TEXTAREA`||t.isContentEditable||(e.preventDefault(),t.dragDrop()))},this.options=new To(t,n),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new io(this.isNodeInDocument)}},ko=function(e,t,n){return new Oo(e,t,n)},Ao=`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`,jo=`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`,Mo=`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`,No=`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIj4KICAgIDxyYWRpYWxHcmFkaWVudCBpZD0ibXlHcmFkaWVudCI+CiAgICAgICAgPHN0b3Agb2Zmc2V0PSIxMCUiIHN0b3AtY29sb3I9IiMxQzJENUYiIC8+CiAgICAgICAgPHN0b3Agb2Zmc2V0PSI5NSUiIHN0b3AtY29sb3I9IiMwQjFENTMiIC8+CiAgICA8L3JhZGlhbEdyYWRpZW50PgogICAgPHBhdGggZmlsbD0idXJsKCcjbXlHcmFkaWVudCcpIiBkPSJNLS4xLS4xaDUxMnY1MTJILS4xVi0uMXoiLz4KICAgIDxwYXRoIGZpbGw9IiNmOGY4ZmEiCiAgICAgICAgICBkPSJNNDgyLjUgMjMxLjV2NmgtMjVjLS45NzItOC4xNy01LjYzOS0xMi4xNy0xNC0xMi05LjUzMS4wMjktMTMuMzY1IDQuNjk1LTExLjUgMTRsNC41IDQuNSAzMyA4YzE5LjM4OCA5LjYzNCAyMy4zODggMjMuODAxIDEyIDQyLjVhMzUuMDYgMzUuMDYgMCAwIDAtOCA2Yy0xMy45MjUgNC43NjEtMjguMjU4IDYuMjYxLTQzIDQuNS0xMC42MDEtMS4wMjQtMTguOTM1LTUuODU3LTI1LTE0LjUtMS4wNzctMi4yMjktMS43NDQtNC41NjMtMi03di04aDI1YzEuNDk1IDQuMjc5IDMuODI4IDguMTEzIDcgMTEuNSA3LjQ3OCAyLjI1OCAxNC44MTEgMS45MjUgMjItMSAyLjg5NC0yLjkwOSAzLjcyNy02LjQwOSAyLjUtMTAuNWEzNi44IDM2LjggMCAwIDAtMTIuNS01LjUgNTM5Ljc5IDUzOS43OSAwIDAgMS0yOC04Yy0xMi44NzQtNi41NjItMTcuNzA3LTE3LjA2Mi0xNC41LTMxLjUgMy41Ny0xMC41NjkgMTAuNzM3LTE3LjQwMyAyMS41LTIwLjUgMTYuMTQ4LTQuNTM5IDMxLjQ4Mi0yLjcwNiA0NiA1LjUgMiAyLjY2NyA0LjMzMyA1IDcgNyAxLjg3MSAyLjczNCAyLjg3MSA1LjczNCAzIDl6Ii8+CiAgICA8cGF0aCBmaWxsPSIjYTRhYmJmIiBkPSJNMTUzLjUgMjA5LjVjLjA2LS41NDMuMzkzLS44NzYgMS0xYTEwMjQuNjMgMTAyNC42MyAwIDAgMSAxIDY0bC0yLTYzeiIvPgogICAgPHBhdGggZmlsbD0iI2ZhZmJmYyIKICAgICAgICAgIGQ9Ik0xNTMuNSAyMDkuNWwyIDYzYzEuMjc4IDExLjQ0NCA3LjYxMSAxNi4yNzcgMTkgMTQuNSA4LjcwNC0xLjM3OCAxMy4yMDQtNi41NDQgMTMuNS0xNS41LjUtMjAuNjY0LjY2Ny00MS4zMzEuNS02MiA5Ljc0My0uMjE5IDE5LjQwOS0uMjE5IDI5IDAgLjQwMSAyMy4zNjItLjA5OSA0Ni42OTYtMS41IDcwLTQuMjk4IDE0Ljk2OC0xNC4xMzEgMjMuNDY4LTI5LjUgMjUuNWEyMjUuMTQgMjI1LjE0IDAgMCAxLTMwIDBjLTE1LjgyMi0yLjE1NS0yNS42NTUtMTAuOTg4LTI5LjUtMjYuNWwtLjUtNjloMjd6Ii8+CiAgICA8cGF0aCBmaWxsPSIjZmVmZWZlIgogICAgICAgICAgZD0iTTIzMy41IDIwOS41aDI3Yy0uMzMxIDI1LjE3Mi4wMDIgNTAuMTcyIDEgNzUgMCAuNjY3LjMzMyAxIDEgMSAxMy4xNTYuOTk2IDI2LjQ5IDEuMzI5IDQwIDF2MTdoLTY5di05NHoiLz4KICAgIDxwYXRoIGZpbGw9IiNhNWFjYmYiIGQ9Ik0yMzMuNSAyMDkuNWM5LjE1Mi0uOTk0IDE4LjQ4NS0xLjMyNyAyOC0xdjc2Yy0uOTk4LTI0LjgyOC0xLjMzMS00OS44MjgtMS03NWgtMjd6Ii8+CiAgICA8cGF0aCBmaWxsPSIjYTdhZWMxIiBkPSJNMzE2LjUgMjA5LjVoNzNjLjMyMyA2LjE5LS4wMSAxMi4xOS0xIDE4di0xN2MtMjQuMTcyLjMzMS00OC4xNzItLjAwMi03Mi0xeiIvPgogICAgPHBhdGggZmlsbD0iI2E1YWNjMCIgZD0iTTg1LjUgMjEwLjVoLTU5djkzaDI3Yy0uMzI4LTExLjE3OS4wMDUtMjIuMTc5IDEtMzN2MzRoLTI5di05NWE5MDAuOTggOTAwLjk4IDAgMCAxIDYwIDF6Ii8+CiAgICA8cGF0aCBmaWxsPSIjZmNmY2ZjIgogICAgICAgICAgZD0iTTg1LjUgMjEwLjVjMjIuMjIzIDMuNzU4IDI5LjU1NiAxNi40MjUgMjIgMzgtNC4yMjggNS4zOTctOS4yMjggOS44OTctMTUgMTMuNS0xLjMwNS44MDQtMS45NzEgMS45NzEtMiAzLjVsMjMgMzZjLTQuNDUxIDEuMzI3LTkuMjg0IDEuOTk0LTE0LjUgMmExMjguMTkgMTI4LjE5IDAgMCAxLTE1LjUtMWMtNi45NTUtMTAuMzI2LTEzLjQ1NS0yMC45OTItMTkuNS0zMi0zLjI2OS0xLjMxOC02LjQzNS0xLjMxOC05LjUgMC0uOTk1IDEwLjgyMS0xLjMyOCAyMS44MjEtMSAzM2gtMjd2LTkzaDU5eiIvPgogICAgPHBhdGggZmlsbD0iI2ZlZmVmZSIKICAgICAgICAgIGQ9Ik0zMTYuNSAyMDkuNWMyMy44MjguOTk4IDQ3LjgyOCAxLjMzMSA3MiAxdjE3Yy0xNC42Ny0uMTY3LTI5LjMzNyAwLTQ0IC41LTEuMzI2IDYuNTk5LTEuMzI2IDEzLjA5OSAwIDE5LjUgMTQuNDkuOTk2IDI5LjE1NyAxLjMyOSA0NCAxdjE2Yy0xNC44NDMtLjMyOS0yOS41MS4wMDQtNDQgMWE1MC41MSA1MC41MSAwIDAgMCAwIDIwYzE0LjQ5Ljk5NiAyOS4xNTcgMS4zMjkgNDQgMXYxN2gtNzNjLS4zMzItMzEuNTA0LjAwMi02Mi44MzggMS05NHoiLz4KICAgIDxwYXRoIGZpbGw9IiMxODI3NWIiCiAgICAgICAgICBkPSJNNTUuNSAyMjkuNWM3LjA4OS0uMzg0IDE0LjA4OS4xMTYgMjEgMS41IDMuNDAxIDEuMzIgNC43MzUgMy44MiA0IDcuNWwtLjUgNWMtMS43NzEuODA0LTMuMjcxIDEuOTcxLTQuNSAzLjUtNi41OTIgMS4zMjktMTMuMjU5IDEuODI5LTIwIDEuNXYtMTl6Ii8+CiAgICA8cGF0aCBmaWxsPSIjYTVhY2MwIiBkPSJNNDgyLjUgMjMxLjVjLjk2OCAyLjEwNyAxLjMwMiA0LjQ0MSAxIDctOC44NDkuMzI2LTE3LjUxNi0uMDA3LTI2LTFoMjV2LTZ6Ii8+CiAgICA8cGF0aCBmaWxsPSIjYTZhZGMwIiBkPSJNMzQ0LjUgMjQ3LjVoNDV2MThoLTQ1YzE0LjQ5LS45OTYgMjkuMTU3LTEuMzI5IDQ0LTF2LTE2Yy0xNC44NDMuMzI5LTI5LjUxLS4wMDQtNDQtMXoiLz4KICAgIDxwYXRoIGZpbGw9IiNhMmE5YmUiIGQ9Ik00MjguNSAyNzUuNWgtMjV2OGMtLjk3Ny0yLjc4Ny0xLjMxLTUuNzg3LTEtOSA4Ljg0OS0uMzI2IDE3LjUxNi4wMDcgMjYgMXoiLz4KICAgIDxwYXRoIGZpbGw9IiNhNWFjYmYiCiAgICAgICAgICBkPSJNMTEzLjUgMzAxLjVjLjk3OC4zMTEgMS42NDUuOTc4IDIgMmwtMTYgMWMtNS43MTEtLjAwNS0xMS4wNDQtLjY3Mi0xNi0yYTEyOC4xOSAxMjguMTkgMCAwIDAgMTUuNSAxYzUuMjE2LS4wMDYgMTAuMDQ5LS42NzMgMTQuNS0yeiIvPgogICAgPHBhdGggZmlsbD0iI2E1YWNjMCIgZD0iTTIzMy41IDIwOS41djk0aDY5di0xN2MtMTMuNTEuMzI5LTI2Ljg0NC0uMDA0LTQwLTFoNDF2MTloLTcxYTIyNTYuNDEgMjI1Ni40MSAwIDAgMSAxLTk1eiIvPgogICAgPHBhdGggZmlsbD0iI2E2YWNjMCIKICAgICAgICAgIGQ9Ik0zMTYuNSAyMDkuNWMtLjk5OCAzMS4xNjItMS4zMzIgNjIuNDk2LTEgOTRoNzN2LTE3Yy0xNC44NDMuMzI5LTI5LjUxLS4wMDQtNDQtMWg0NXYxOWgtNzVhMjMwNC45NSAyMzA0Ljk1IDAgMCAxIDEtOTZjLjYwNy4xMjQuOTQuNDU3IDEgMXoiLz4KPC9zdmc+`;G();var Po=class e extends W.Component{constructor(t){super(t),N(this,`isShowInstance`,void 0),N(this,`oldId`,void 0),N(this,`handleCancel`,()=>{this.props.onClose()}),N(this,`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()}),N(this,`handleChange`,e=>{this.setState({name:e,id:this.getId(e)})}),this.state={name:t.name,id:t.id,instance:t.instance||0,prefix:e.getPrefix(t.id)},this.isShowInstance=!t.folder&&!!t.instances&&(!!t.instance||!!t.instances[0]||t.instances.length>1),this.oldId=t.id}static getPrefix(e){let t=(e||``).split(`.`);return t.pop(),t.join(`.`)}getId(e){return e=(e||``).replace(/[\\/\][.*,;'"`<>?\s]/g,`_`).trim().replace(/\.$/,`_`),`${this.state.prefix}.${e}`}render(){let e=this.props.instanceHosts||{};return B(qe,{onClose:()=>!1,maxWidth:`md`,fullWidth:!0,open:!0,"aria-labelledby":`confirmation-dialog-title`,children:[O(ot,{id:`confirmation-dialog-title`,children:V.t(`Rename`)}),O(St,{children:B(`form`,{noValidate:!0,autoComplete:`off`,children:[O(P,{variant:`standard`,style:{width:`100%`},id:`standard-name`,autoFocus:!0,label:V.t(`Name`),value:this.state.name,onKeyUp:e=>{e.key===`Enter`&&(e.preventDefault(),setTimeout(()=>this.handleOk(),200))},onChange:e=>this.handleChange(e.target.value),margin:`normal`}),O(P,{variant:`standard`,id:`standard-name-id`,style:{width:`100%`},label:V.t(`ID`),value:this.state.id,disabled:!0,margin:`normal`}),this.isShowInstance&&B(gt,{variant:`standard`,children:[O(je,{htmlFor:`instance`,children:V.t(`Instance`)}),O(pt,{variant:`standard`,value:this.state.instance,onChange:e=>this.setState({instance:parseInt(e.target.value,10)}),inputProps:{name:`instance`,id:`instance`},children:this.props.instances.map(t=>{let n=e[t];return B(y,{value:t,children:[t||`0`,n?O(`span`,{style:{opacity:.6,marginLeft:8,fontSize:`smaller`},children:`@ ${n}`}):null]},t)})})]})]})}),B(Vt,{children:[O(R,{variant:`contained`,onClick:this.handleOk,color:`primary`,startIcon:O(ge,{}),children:V.t(`Ok`)}),O(R,{color:`grey`,variant:`contained`,onClick:this.handleCancel,startIcon:O(m,{}),children:V.t(`Cancel`)})]})]})}};G();var Fo=class extends W.Component{constructor(e){super(e),N(this,`handleCancel`,()=>{this.props.onClose()}),N(this,`handleOk`,()=>{this.props.onDelete(this.state.id),this.props.onClose()}),this.state={name:e.name,id:e.id}}render(){return B(qe,{onClose:()=>!1,maxWidth:`md`,open:!0,"aria-labelledby":`confirmation-dialog-title`,children:[O(ot,{id:`confirmation-dialog-title`,children:V.t(`Are you sure?`)}),B(St,{children:[O(et,{}),O(`span`,{style:{fontSize:14,fontWeight:`bold`},children:V.t(`Delete %s`,this.state.name)})]}),B(Vt,{children:[O(R,{variant:`contained`,onClick:this.handleOk,color:`primary`,startIcon:O(ge,{}),children:V.t(`Ok`)}),O(R,{color:`grey`,variant:`contained`,onClick:this.handleCancel,startIcon:O(m,{}),children:V.t(`Cancel`)})]})]})}},Io=``+new URL(`tileJS-C48gYbHw.png`,import.meta.url).href,Lo=``+new URL(`tileTS-CsXmgy4B.png`,import.meta.url).href,Ro=``+new URL(`tileBlockly-BMpdinN3.png`,import.meta.url).href,zo=``+new URL(`tileRules-BkbaFIhs.png`,import.meta.url).href;G();var Bo={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}},Vo=class e extends W.Component{constructor(...e){super(...e),N(this,`handleCancel`,()=>{this.props.onClose()})}static openHtml(e){let t=V.getLanguage();!e.includes(`javascript.md`)&&(t===`de`||t===`ru`)&&(e=e.replace(/\/en\//,`/${t}/`));let n=window.open(e,`_blank`);n==null||n.focus()}getJSCard(){return B(we,{style:Bo.card,children:[B(C,{onClick:()=>this.props.onClose&&this.props.onClose(`Javascript/js`),children:[O(k,{style:Bo.media,image:Io,title:`JavaScript`}),B(Nt,{children:[O(`h2`,{children:`JavaScript`}),O(`div`,{style:Bo.complexity,children:V.t(`for programmers`)}),O(`div`,{style:Bo.text,children:V.t(`JS description`)})]})]}),B(M,{children:[O(R,{size:`small`,color:`primary`,variant:`contained`,onClick:()=>this.props.onClose&&this.props.onClose(`Javascript/js`),children:V.t(`Add`)}),O(R,{size:`small`,color:`secondary`,onClick:()=>e.openHtml(`https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/javascript.md`),children:V.t(`Learn More`)})]})]})}getTSCard(){return B(we,{style:Bo.card,children:[B(C,{onClick:()=>this.props.onClose&&this.props.onClose(`TypeScript/ts`),children:[O(k,{style:Bo.media,image:Lo,title:`TypeScript`}),B(Nt,{children:[O(`h2`,{children:`TypeScript`}),O(`div`,{style:Bo.complexity,children:V.t(`for professionals`)}),O(`div`,{style:Bo.text,children:V.t(`TS description`)})]})]}),B(M,{children:[O(R,{size:`small`,color:`primary`,variant:`contained`,onClick:()=>this.props.onClose&&this.props.onClose(`TypeScript/ts`),children:V.t(`Add`)}),O(R,{size:`small`,color:`secondary`,onClick:()=>e.openHtml(`https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/javascript.md`),children:V.t(`Learn More`)})]})]})}getBlocklyCard(){return B(we,{style:Bo.card,children:[B(C,{onClick:()=>this.props.onClose&&this.props.onClose(`Blockly`),children:[O(k,{style:Bo.media,image:Ro,title:`Blockly`}),B(Nt,{children:[O(`h2`,{children:`Blockly`}),O(`div`,{style:Bo.complexity,children:V.t(`normal`)}),O(`div`,{style:Bo.text,children:V.t(`Blockly description`)})]})]}),B(M,{children:[O(R,{size:`small`,color:`primary`,variant:`contained`,onClick:()=>this.props.onClose&&this.props.onClose(`Blockly`),children:V.t(`Add`)}),O(R,{size:`small`,color:`secondary`,onClick:()=>e.openHtml(`https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/blockly.md`),children:V.t(`Learn More`)})]})]})}getRulesCard(){return B(we,{style:Bo.card,children:[B(C,{onClick:()=>this.props.onClose&&this.props.onClose(`Rules`),children:[O(k,{style:Bo.media,image:zo,title:`Rules`}),B(Nt,{children:[O(`h2`,{children:`Rules`}),O(`div`,{style:Bo.complexity,children:V.t(`easy`)}),O(`div`,{style:Bo.text,children:V.t(`Rules description`)})]})]}),B(M,{children:[O(R,{size:`small`,color:`primary`,variant:`contained`,onClick:()=>this.props.onClose&&this.props.onClose(`Rules`),children:V.t(`Add`)}),O(R,{size:`small`,color:`secondary`,onClick:()=>e.openHtml(`https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/javascript.md`),children:V.t(`Learn More`)})]})]})}render(){return B(qe,{onClose:()=>!1,maxWidth:`lg`,fullWidth:!0,open:!0,"aria-labelledby":`confirmation-dialog-title`,children:[O(ot,{id:`confirmation-dialog-title`,children:V.t(`Add new script`)}),B(St,{style:{textAlign:`center`},children:[this.getRulesCard(),this.getBlocklyCard(),this.getJSCard(),this.getTSCard()]}),O(Vt,{children:O(R,{color:`grey`,onClick:this.handleCancel,startIcon:O(m,{}),children:V.t(`Cancel`)})})]})}};G();var Ho=class extends W.Component{constructor(e){super(e),N(this,`isShowInstance`,void 0),N(this,`handleOk`,()=>{this.props.onAdd(this.getId(this.state.name),this.state.name,this.state.instance,this.props.type),this.props.onClose()}),this.state={name:e.name||`Script`,instance:e.instance||0,parent:e.parent,error:``,id:``},this.isShowInstance=!e.folder&&!!e.instances&&(!!e.instance||!!e.instances[0]||e.instances.length>1)}getId(e){return e=e||this.state.name||``,e=e.replace(/[\\/\][.*,;'"`<>?\s]/g,`_`).trim().replace(/\.$/,`_`),`${this.state?this.state.parent:this.props.parent}.${e}`}render(){var e;return B(qe,{onClose:()=>!1,maxWidth:`md`,fullWidth:!0,open:!0,"aria-labelledby":`confirmation-dialog-title`,children:[O(ot,{id:`confirmation-dialog-title`,children:this.props.title||V.t(`Create new`)}),O(St,{children:B(`form`,{noValidate:!0,autoComplete:`off`,children:[O(P,{variant:`standard`,style:{width:`100%`},id:`standard-name`,autoFocus:!0,error:!!this.state.error,label:V.t(`Name`),value:this.state.name||``,helperText:this.state.error,slotProps:{input:{endAdornment:this.state.name?O(U,{size:`small`,onClick:()=>this.setState({name:``}),children:O(en,{})}):void 0}},onKeyUp:e=>{e.preventDefault(),e.key===`Enter`&&!this.state.error&&setTimeout(()=>this.handleOk(),200)},onChange:e=>{var t;let n=e.target.value,r=this.getId(n);n?(t=this.props.existingItems)!=null&&t.includes(r)?this.setState({name:n,id:r,error:V.t(`Duplicate name`)}):this.setState({name:n,id:r,error:``}):this.setState({name:n,id:r,error:V.t(`Empty name is not allowed`)})},margin:`normal`}),B(gt,{variant:`standard`,style:{width:`100%`},children:[O(je,{htmlFor:`parent`,children:V.t(`Folder`)}),O(pt,{variant:`standard`,style:{width:`100%`},value:this.state.parent,onChange:e=>this.setState({parent:e.target.value}),inputProps:{name:`parent`,id:`parent`},children:this.props.parents.map(e=>{let t=e.id.split(`.`);t.splice(0,2);let n=[],r=`script.js`;return t.forEach(e=>{r+=`.${e}`;let t=this.props.parents.find(e=>e.id===r);t?n.push(t.name):n.push(e)}),n.length||n.push(e.name),O(y,{value:e.id,children:n.join(` / `)},e.id)})})]}),O(P,{variant:`standard`,id:`standard-name-id`,style:{width:`100%`},label:V.t(`ID`),value:this.getId(),disabled:!0,margin:`normal`}),this.isShowInstance&&B(gt,{variant:`standard`,children:[O(je,{htmlFor:`instance`,children:V.t(`Instance`)}),O(pt,{variant:`standard`,value:this.state.instance,onChange:e=>this.setState({instance:e.target.value}),inputProps:{name:`instance`,id:`instance`},children:(e=this.props.instances)==null?void 0:e.map(e=>O(y,{value:e,children:e||`0`},`instance${e}`))})]})]})}),B(Vt,{children:[O(R,{variant:`contained`,onClick:this.handleOk,disabled:!!this.state.error,color:`primary`,startIcon:O(ge,{}),children:V.t(`Ok`)}),O(R,{color:`grey`,variant:`contained`,onClick:()=>this.props.onClose(),startIcon:O(m,{}),children:V.t(`Cancel`)})]})]})}};G();var Uo={buttonIcon:{marginRight:8},icon:{width:24,height:24},filter:{width:`100%`},filterWithButton:{width:`100%`},title:{fontWeight:`bold`,marginTop:16}},Wo=class extends W.Component{constructor(e){super(e),N(this,`handleOk`,()=>{var e;if((e=this.state.instances.find(e=>e.id===this.state.adapterToDebug))!=null&&e.enabled){this.props.socket.getObject(`system.adapter.${this.state.adapterToDebug}`).then(e=>{e&&(e.common.enabled=!1,this.props.socket.setObject(e._id,e).then(()=>this.props.onDebug(this.state.jsInstance,this.state.adapterToDebug)))});return}this.props.onDebug(this.state.jsInstance,this.state.adapterToDebug)}),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(e=>{let t=e.filter(e=>{var t;return e&&!((t=e.common)!=null&&t.onlyWWW)}).map(e=>{var t,n,r;let i=e._id.replace(/^system\.adapter\./,``),[a]=i.split(`.`);return{id:i,enabled:(t=e.common)==null?void 0:t.enabled,host:(n=e.common)==null?void 0:n.host,icon:(r=e.common)!=null&&r.icon?`../../adapter/${a}/${e.common.icon}`:``}});t.sort((e,t)=>e.id>t.id?1:e.ide.id===this.state.jsInstance):null,i;if(!this.state.jsInstance||!r){let e=t.find(e=>e.id.startsWith(`javascript.`));i=(e==null?void 0:e.host)||``,n=(e==null?void 0:e.id)||``}else i=(r==null?void 0:r.host)||``;let a=this.state.adapterToDebug||``;a&&!t.find(e=>e.id===a)&&(a=``),this.setState({instances:t,jsInstance:n,adapterToDebug:a,jsInstanceHost:i})})}renderJavascriptList(){let e=this.state.instances.filter(e=>e.id.startsWith(`javascript.`));return e.length<2?null:B(Ye,{children:[O(`div`,{style:Uo.title,children:V.t(`Host`)}),O(nn,{component:`nav`,children:e.map(e=>B(Qt,{component:`div`,selected:this.state.jsInstance===e.id,onClick:()=>this.setState({jsInstance:e.id,jsInstanceHost:e.host}),children:[O(me,{children:O(`img`,{src:e.icon,alt:e.id,style:Uo.icon})}),O(p,{primary:e.id})]},e.id))})]})}renderInstances(){if(!this.state.jsInstance)return O(Ye,{});let e=this.state.instances.filter(e=>e.id!==this.state.jsInstance&&e.host===this.state.jsInstanceHost&&(!this.state.filter||e.id.includes(this.state.filter.toLowerCase())));return B(Ye,{children:[O(`div`,{style:Uo.title,children:V.t(`Instances`)}),O(nn,{component:`nav`,children:e.map(e=>B(Qt,{selected:this.state.adapterToDebug===e.id,onDoubleClick:()=>this.setState({adapterToDebug:e.id},()=>this.handleOk()),onClick:()=>this.setState({adapterToDebug:e.id}),children:[O(me,{children:O(`img`,{src:e.icon,alt:e.id,style:Uo.icon})}),O(p,{primary:e.id})]},e.id))})]})}render(){return B(qe,{maxWidth:`md`,fullWidth:!1,open:!0,onClose:()=>!1,"aria-labelledby":`confirmation-dialog-title`,children:[O(ot,{id:`confirmation-dialog-title`,children:this.props.title||V.t(`Debug instance`)}),O(St,{children:B(ce,{children:[O(Ye,{children:O(nt,{style:Uo.filterWithButton,value:this.state.filter,placeholder:V.t(`Filter`),onChange:e=>{this.setState({filter:e.target.value}),window.localStorage.setItem(`javascript.debug.filter`,e.target.value)},endAdornment:O(Qe,{position:`end`,children:this.state.filter?O(U,{size:`small`,"aria-label":`toggle password visibility`,onClick:()=>this.setState({filter:``}),children:O(Be,{})}):``})})}),O(Ye,{children:B(Ye,{container:!0,children:[this.renderJavascriptList(),this.renderInstances()]})})]})}),B(Vt,{children:[O(R,{variant:`contained`,onClick:this.handleOk,disabled:!this.state.jsInstance||!this.state.adapterToDebug,color:`primary`,startIcon:O(ge,{}),children:V.t(`Start`)}),O(R,{color:`grey`,variant:`contained`,onClick:()=>this.props.onClose(),startIcon:O(m,{}),children:V.t(`Close`)})]})]})}};function Go(e){if(!e)throw Error(`Password must be a non-empty string.`)}function Ko(e){return new TextEncoder().encode(e)}function qo(e){return new TextDecoder().decode(e)}function Jo(e){let t=``;for(let n=0;n({height:e.toolbar.height}),toolbarButtons:e=>({color:e.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},iconOnTheRight:{position:`absolute`,right:10,top:`calc(50% - 8px)`},menu:{width:`100%`,height:`100%`},innerMenu:{width:`100%`,height:`calc(100% - 76px)`,overflowX:`hidden`,overflowY:`auto`},listItemIcon:{minWidth:32},filterIcon:{width:18,height:18,borderRadius:2,marginRight:5},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:{},expandButton:{width:37,height:37},selected:window.vendorPrefix?e=>({backgroundColor:e.palette.primary.main,color:e.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:e=>({"& img":{color:e.palette.mode===`dark`?`#ffffff`:`#111111`,cursor:`pointer`,mt:`1px`,mr:`2px`,height:22,width:22,"&:hover":{backgroundColor:`#dbdbdb`}},"& svg":{color:e.palette.mode===`dark`?`#ffffff`:`#111111`,cursor:`pointer`,mt:`1px`,mr:`2px`,height:22,width:22,"&:hover":{backgroundColor:`#dbdbdb`}}}),footerButtonsRight:{float:`right`}},cs={Blockly:jo,"Javascript/js":Ao,def:Ao,Rules:No,"TypeScript/ts":Mo};function ls(e,t,n){var r;return n||=V.getLanguage(),t!=null&&(r=t.common)!=null&&r.name?typeof t.common.name==`object`?(t.common.name[n]||t.common.name.en||e.replace(/^script\.js./,``)).toString():t.common.name.toString():e.replace(/^script\.js./,``)}function us(e){let t=[{id:rs,depth:0,index:0,parent:null,title:`root`,type:`folder`,parentIndex:null}],n=Object.keys(e);for(let i=0;i1?o.join(`.`):null,instance:a.common.engine?parseInt(a.common.engine.split(`.`).pop(),10)||0:null,index:0,parentIndex:0})}else t.push({id:n[i],title:ls(n[i],a),depth:o.length-1,type:`folder`,parent:o.length>1?o.join(`.`):null,index:0,parentIndex:null})}let i;do i=!1,t.forEach(e=>{if(e.parent&&!t.find(t=>t.id===e.parent)){let n=e.parent.split(`.`);n.pop(),t.push({id:e.parent,title:e.parent.split(`.`).pop()||``,depth:n.length-1,type:`folder`,parent:n.length>1?n.join(`.`):null,index:0,parentIndex:null}),i=!0}});while(i);return t.sort((e,t)=>{let n=e.id.toLowerCase(),r=t.id.toLowerCase();return e.type===`folder`&&t.type!==`folder`?-1:t.type===`folder`&&e.type!==`folder`||n>r?1:ne.index=t),t.forEach(e=>{if(e.parent){let n=t.find(t=>t.id===e.parent);n&&(e.parentIndex=n.index)}}),t}function ds(e){let{onDrop:t}=e,[{isOver:n,isOverAny:r},i]=eo({accept:`script`,drop:e=>n?t(e):void 0,collect:e=>({isOver:e.isOver({shallow:!0}),isOverAny:e.isOver()})});return O(`div`,{ref:e=>{i(e)},style:{background:n?`#40adff`:void 0,opacity:r?.7:void 0},children:e.children},e.folderName)}function fs(e){let{name:t}=e,[{opacity:n},r]=Ka({type:`script`,item:()=>({name:t}),collect:e=>({opacity:e.isDragging()?.3:1})});return O(`div`,{ref:e=>{r(e)},style:{opacity:n,transform:`translate3d(0, 0, 0)`},children:e.children},t)}var ps=class e extends W.Component{constructor(e){super(e),N(this,`inputRef`,void 0),N(this,`filterTimer`,void 0),N(this,`problems`,void 0),N(this,`problemsTimer`,void 0),N(this,`onProblemUpdatedBound`,void 0),N(this,`parent`,null);let t=window.localStorage?window.localStorage.getItem(`SideMenu.expanded`):`[]`,n;try{n=JSON.parse(t||`[]`)||[]}catch{n=[]}this.inputRef=W.createRef(),this.state={listItems:us(e.scripts||{}),expanded:n,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:e.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:e.scriptsHash,showAdapterDebug:!1,isAllZeroInstances:!1,showExportDialog:!1};let r=this.ensureSelectedIsVisible();r&&Object.assign(this.state,{expanded:r}),this.filterTimer=null,Object.assign(this.state,{isAllZeroInstances:this.getIsAllZeroInstances()}),this.problems=null,this.problemsTimer=null,this.onProblemUpdatedBound=this.onProblemUpdated.bind(this)}readProblems(e,t){if(t||=Object.keys(this.props.scripts),!t||!t.length)e&&e();else{var n,r;let i=t.shift(),a=this.props.scripts[i];if(((n=this.props.scripts)==null?void 0:n[i].type)===`script`&&(r=a.common)!=null&&r.enabled&&!i.match(/^script\.js\.global\./)){let n=a.common.engine.split(`.`).pop(),r=this,o=`javascript.${n}.scriptProblem.${i.substring(10)}`;this.props.socket.getState(o).then(n=>{r.onProblemUpdated(o,n),setTimeout(()=>r.readProblems(e,t),0)})}else setTimeout(()=>this.readProblems(e,t),0)}}componentDidMount(){this.readProblems(()=>{this.props.instances.forEach(e=>{this.props.socket.subscribeState(`javascript.${e}.scriptProblem.*`,this.onProblemUpdatedBound)})})}componentWillUnmount(){this.props.instances.forEach(e=>{this.props.socket.unsubscribeState(`javascript.${e}.scriptProblem.*`,this.onProblemUpdatedBound)}),this.filterTimer&&=(clearTimeout(this.filterTimer),null),this.problemsTimer&&=(clearTimeout(this.problemsTimer),null)}onProblemUpdated(e,t){if(!t||!e)return;e=`${rs}.${e.replace(/^javascript\.\d+\.scriptProblem\./,``)}`,this.problems||=JSON.parse(JSON.stringify(this.state.problems))||[];let n=!1;if(t.val)this.problems.includes(e)||(this.problems.push(e),n=!0);else{let t=this.problems.indexOf(e);t!==-1&&(this.problems.splice(t,1),n=!0)}n&&!this.problemsTimer&&(this.problemsTimer=setTimeout(()=>{this.problemsTimer=null,this.setState({problems:this.problems}),this.problems=null},300))}static filterListStatic(e,t,n,r,i){t=JSON.parse(JSON.stringify(t));let a=!1,o={listItems:t};if(e&&n&&r){let e=r.toLowerCase();if(t.forEach(t=>{var n;let r=t.title.toLowerCase();t.filteredPartly=!1;let o=r.includes(e),s=i==null||(n=i[t.id])==null?void 0:n.common;if(!o&&s!=null&&s.source){if(s.engineType===`Blockly`){let t=s.source.lastIndexOf(`//`);o=s.source.substring(0,t).toLowerCase().includes(e)}else o=s.source.toLowerCase().includes(e)}o?t.filtered&&(t.filtered=!1,a=!0):t.filtered||(t.filtered=!0,a=!0)}),a)for(let e=t.length-1;e>=0;e--){let n=t[e];if(!n.filtered||n.filteredPartly){let e=n;do e!=null&&e.parent&&t[e.parentIndex]&&(a=!0,t[e.parentIndex].filteredPartly=!0),e=e!=null&&e.parent&&t[e.parentIndex]?t[e.parentIndex]:null;while(e)}}}else t.forEach(e=>{(e.filtered||e.filteredPartly)&&(e.filtered=!1,e.filteredPartly=!1,a=!0)}),e||(o.searchText=``,o.searchMode=!1,a=!0);return a?o:null}filterList(t,n){let r=e.filterListStatic(t,this.state.listItems,this.state.searchMode,this.state.searchText,this.props.scripts);r?this.setState(r,()=>n&&n()):n&&n()}static ensureSelectedIsVisibleStatic(e,t,n){t=JSON.parse(JSON.stringify(t));let r=!1,i=typeof e==`object`?e:n.find(t=>t.id===e);do{if(i!=null&&i.parent){let e=i.parent;i=n.find(t=>t.id===e)}else i=void 0;i&&(t.includes(i.id)||(t.push(i.id),r=!0))}while(i);return r?t:null}ensureSelectedIsVisible(t,n){return e.ensureSelectedIsVisibleStatic(t||this.state.selected,n||this.state.expanded,this.state.listItems)}static getDerivedStateFromProps(t,n){let r={},i=!1;if(n.expertMode!==t.expertMode&&(i=!0,r.expertMode=t.expertMode),n.scriptsHash!==t.scriptsHash&&t.scripts){let a=us(t.scripts||{});if(r.listItems=a,n.searchText){let i=e.filterListStatic(!0,a,n.searchMode,n.searchText,t.scripts);i&&Object.assign(r,i)}let o=e.getIsAllZeroInstancesStatic(a,t.instances||[]),s=e.ensureSelectedIsVisibleStatic(n.selected,n.expanded,n.listItems);r.isAllZeroInstances=o,s&&(r.expanded=s),i=!0}if(n.width!==t.width&&(i=!0,r.width=t.width),n.themeName!==t.themeName&&(i=!0,r.themeName=t.themeName),t.selectId&&n.selected!==t.selectId){let a=n.listItems.find(e=>e.id===t.selectId);if(!n.reorder&&a){let t=e.ensureSelectedIsVisibleStatic(a,n.expanded,n.listItems);r.selected=a.id,t&&(r.expanded=t),i=!0,window.localStorage&&window.localStorage.setItem(`SideMenu.selected`,a.id)}}return i?r:null}static getIsAllZeroInstancesStatic(e,t){let n=!t[0]&&t.length<=1;return n&&e.forEach(e=>{e.type!==`folder`&&e.instance!==0&&(n=!1)}),n}getIsAllZeroInstances(t,n){return t||=this.state.listItems,n||=this.state.instances,e.getIsAllZeroInstancesStatic(t||this.state.listItems,n||this.state.instances)}saveExpanded(e){window.localStorage.setItem(`SideMenu.expanded`,JSON.stringify(e||this.state.expanded))}showError(e){this.setState({errorText:e})}onToggle(e,t){if(t==null||t.stopPropagation(),e===rs)return;let n=[...this.state.expanded],r=n.indexOf(e);r===-1?(n.push(e),n.sort()):(n.splice(r,1),this.state.selected&&this.state.selected.startsWith(`${e}.`)&&window.localStorage&&window.localStorage.setItem(`SideMenu.selected`,e)),this.setState({expanded:n}),this.saveExpanded(n)}renderItemButtonsOnEnd(e,t){if(this.state.reorder)return null;if(e.type!==`folder`){let t=e.enabled?es:ns;return e.enabled&&this.state.problems.includes(e.id)&&(t=ts),[O(U,{onClick:t=>{t.stopPropagation(),this.props.onEnableDisable&&this.props.onEnableDisable(e.id,!e.enabled)},title:e.enabled?V.t(`Pause script`):V.t(`Run script`),disabled:this.props.debugMode,style:{...q.iconButtons,...this.props.debugMode?q.iconButtonsDisabled:void 0,color:t},size:`medium`,children:e.enabled?O(Xn,{}):O(Zn,{})},`startStop`),this.state.width>os?O(U,{style:this.props.debugMode?q.iconButtonsDisabled:void 0,title:V.t(`Delete script`),disabled:e.id===as||e.id===is||this.props.debugMode,onClick:t=>this.onDelete(e,t),size:`medium`,children:O(et,{})},`delete`):null,O(U,{style:this.props.debugMode?q.iconButtonsDisabled:void 0,disabled:this.props.debugMode,title:V.t(`Edit script or just double click`),onClick:t=>this.onEdit(e,t),size:`medium`,children:O(Wn,{})},`openInEdit`)]}return this.state.width>os&&e.id!==rs&&e.id!==is&&e.id!==as&&!(t!=null&&t.length)?O(U,{style:this.props.debugMode?q.iconButtonsDisabled:void 0,title:V.t(`Delete folder`),disabled:e.id===as||e.id===is||this.props.debugMode,onClick:t=>this.onDelete(e,t),size:`medium`,children:O(et,{})},`delete`):null}onDelete(e,t){return t==null||t.stopPropagation(),new Promise(t=>{if(!e){t();return}typeof e==`object`?this.setState({deleting:e.id},()=>t()):this.setState({deleting:e},()=>t())})}onEdit(e,t){this.onClick(e,t),this.props.onEdit&&this.props.onEdit(e.id)}getTextStyle(e){return!this.state.reorder&&e.type!==`folder`?{width:`calc(100% - ${this.state.width>os?185:137}px)`,overflow:`hidden`,whiteSpace:`nowrap`,flex:`none`,padding:`0 16px 0 0`}:{whiteSpace:`nowrap`,padding:`0 16px 0 0`}}onClick(e,t){if(t==null||t.stopPropagation(),!this.state.reorder&&e){let t=this.ensureSelectedIsVisible(e),n={selected:e.id};t&&(n.expanded=t),this.setState(n),window.localStorage&&window.localStorage.setItem(`SideMenu.selected`,e.id)}}onDblClick(e,t){t==null||t.stopPropagation(),!this.state.reorder&&(e.type===`folder`?this.onToggle(e.id):this.onEdit(e))}isFilteredOut(e){var t;return e.filtered&&!e.filteredPartly||this.state.typeFilter&&e.type!==`folder`&&e.type.toLowerCase()!==this.state.typeFilter.toLowerCase()||!this.state.expertMode&&(t=this.props.scripts[e.id])!=null&&(t=t.native)!=null&&t.protected||this.state.statusFilter&&e.type!==`folder`&&(this.state.statusFilter===`running`&&!e.enabled||this.state.statusFilter===`paused`&&e.enabled||this.state.statusFilter===`problems`&&(!e.enabled||!this.state.problems.includes(e.id)))?!0:e.id===as&&!this.state.expertMode}hasVisibleContent(e,t){return e.type===`folder`?t.some(n=>n.parent===e.id&&this.hasVisibleContent(n,t)):!this.isFilteredOut(e)}countDescendantScripts(e,t){let n=0,r=t.filter(t=>t.parent===e.id);for(let e of r)e.type===`folder`?n+=this.countDescendantScripts(e,t):n++;return n}countVisibleDescendantScripts(e,t){let n=0,r=t.filter(t=>t.parent===e.id);for(let e of r)e.type===`folder`?n+=this.countVisibleDescendantScripts(e,t):this.isFilteredOut(e)||n++;return n}renderListItem(e,t,n,r=0,i=0){var a;if(e.id===rs&&!this.state.reorder)return null;let o=(this.state.reorder?e.depth:e.depth-1)*ss,s=e.title;if(this.state.searchText){let e=s.toLowerCase().indexOf(this.state.searchText.toLowerCase());e!==-1&&(s=[O(`span`,{children:s.substring(0,e)},`first`),O(`span`,{style:{color:`orange`},children:s.substring(e,e+this.state.searchText.length)},`second`),O(`span`,{children:s.substring(e+this.state.searchText.length)},`third`)])}if(!this.state.isAllZeroInstances&&e.type!==`folder`){let t=this.state.runningInstances[`system.adapter.javascript.${e.instance}`];s=[B(`span`,{title:`${V.t(`Instance`)} ${e.instance}${t?``:` (${V.t(`not running`)})`}`,style:{...q.instances,color:t?es:ns},children:[`[`,e.instance,`]`]},`instance`),O(`span`,{children:s},`title`)]}let c=this.state.reorder&&!this.props.debugMode,l={marginLeft:o,cursor:e.type===`folder`&&c?`default`:`inherit`,width:`calc(100% - ${o}px)`};c||(l.opacity=e.filteredPartly?.5:1),e.id===as&&e.id!==this.state.selected&&(l.color=`#00a200`);let u=e.id===rs;!u&&t&&(u=this.state.expanded.includes(e.id));let d;d=e.type===`folder`?{...q.folderIcon,...c?q.folderIconReorder:q.folderIconNoReorder}:{...q.scriptIcon},e.id===as?d.color=`#356956`:e.id===is&&(d.color=`#4899e1`);let f=null;if(e.type===`folder`&&r>0){let e=!!(this.state.statusFilter||this.state.typeFilter);f=O(`span`,{style:q.childrenCount,children:e&&i!==r?`${i}(${r})`:r})}let m={...e.type===`folder`?q.folder:q.script,...c?q.reorder:void 0,...c&&e.type!==`folder`?q.scriptReorder:void 0,...c&&e.type===`folder`?q.folderReorder:void 0,...l};return B(Re,{style:m,sx:e.id===this.state.selected&&!c?q.selected:void 0,className:H.clsx(c&&e.type===`folder`&&`folder-reorder`,c&&e.type!==`folder`&&`script-reorder`),onClick:t=>this.onClick(e,t),onDoubleClick:t=>this.onDblClick(e,t),secondaryAction:this.renderItemButtonsOnEnd(e,t),children:[(a=this.props.scripts[e.id])!=null&&(a=a.native)!=null&&a.protected?O(Gn,{style:{color:`orange`,position:`absolute`,right:5,width:10,height:10}}):null,O(me,{style:q.listItemIcon,children:e.type===`folder`?O(c||u?Dt:Le,{style:d,onClick:t=>!c&&this.onToggle(e.id,t)}):O(`img`,{style:d,alt:e.type,src:cs[e.type]||cs.def})}),O(p,{sx:{"& .MuiListItemText-primary":e.id===this.state.selected&&!c?q.selected:void 0},style:this.getTextStyle(e),primary:B(`span`,{style:{display:`flex`,alignItems:`center`},children:[O(`span`,{style:{flex:1,overflow:`hidden`,textOverflow:`ellipsis`},children:s}),f]})})]},e.id)}onDragFinish(e,t){let n=`${t}.${e.split(`.`).pop()}`;n!==e&&(this.state.listItems.find(e=>e.id===n)&&(n+=`_${V.t(`copy`)}`),this.props.onRename&&this.props.onRename(e,n))}renderOneItem(e,t){let n=this.state.statusFilter||this.state.typeFilter?e.filter(n=>n.parent===t.id&&this.hasVisibleContent(n,e)):[],r=e.filter(e=>e.parent===t.id);if(this.isFilteredOut(t)||t.type===`folder`&&(this.state.statusFilter||this.state.typeFilter)&&!n.length)return null;let i=this.state.reorder&&!this.props.debugMode,a=t.type===`folder`?this.countDescendantScripts(t,e):0,o=t.type===`folder`&&(this.state.statusFilter||this.state.typeFilter)?this.countVisibleDescendantScripts(t,e):a,s=this.renderListItem(t,r,n,a,o),c=[],l;return r&&(i||this.state.expanded.includes(t.id)||t.id===rs)&&(l=r.map(t=>this.renderOneItem(e,t)).reduce((e,t)=>t?e.concat(t.filter(e=>!!e)):e,[])),i?t.type===`folder`?c.push(B(ds,{onDrop:e=>this.onDragFinish(e.name,t.id),folderName:t.id,children:[O(fs,{name:t.id,children:s},`draggable_${t.id}`),O(`div`,{children:l||null})]},`droppable_${t.id}`)):c.push(B(fs,{name:t.id,children:[s,l||null]},`draggable_${t.id}`)):(c.push(s),l==null||l.forEach(e=>c.push(e))),c}renderAllItems(e){let t=e.filter(e=>!e.parent).map(t=>this.renderOneItem(e,t)).reduce((e,t)=>t?e.concat(t.filter(e=>!!e)):e,[]);return O(nn,{dense:!0,disablePadding:!0,sx:q.mainList,children:t})}onAddNew(e){e==null||e.stopPropagation();let t=this.state.listItems.find(e=>e.id===this.state.selected),n=rs;for(;t&&t.type!==`folder`;)t=this.state.listItems[t.parentIndex];t&&(n=t.id),this.parent=n,this.setState({choosingType:!0})}onCopy(e,t){e==null||e.stopPropagation();let n=this.state.listItems.find(e=>e.id===t),r=rs;for(;n&&n.type!==`folder`;)n=this.state.listItems[n.parentIndex];n&&(r=n.id),this.parent=r,this.setState({copingScript:t||``})}onAddNewFolder(e){e==null||e.stopPropagation();let t=this.state.listItems.find(e=>e.id===this.state.selected),n=rs;for(;t&&t.type!==`folder`;)t=this.state.listItems[t.parentIndex];t&&(n=t.id),this.parent=n,this.setState({creatingFolder:!0})}onRename(e){e==null||e.stopPropagation(),this.setState({renaming:this.state.selected})}getUniqueName(e){let t=1,n=`${V.t(`Script`)} `;if(e){let r=ls(e,this.props.scripts[e]),i=r.match(/\d+$/);i?(n=r.replace(/\d+$/,``),t=parseInt(i[0],10)+1):n=r}for(;this.state.listItems.find(e=>e.id===`${this.parent}.${n.replace(/\.\s/g,`_`)}${t}`);)t++;return n+t}getUniqueFolderName(){let e=1;for(;this.state.listItems.find(t=>t.id===`${this.parent}.${V.t(`Folder`)}_${e}`);)e++;return`${V.t(`Folder`)} ${e}`}onCloseMenu(e){this.setState({menuOpened:!1,menuAnchorEl:null,menuAnchorFilterEl:null},e)}getMainMenu(e,t){var n,r;let i=this.state.expertMode&&!!Object.keys(this.props.changedScripts).find(e=>{var t;return this.props.changedScripts[e]&&((t=this.props.scripts[e])==null||(t=t.native)==null?void 0:t.protected)});return B(_e,{id:`long-menu`,anchorEl:this.state.menuAnchorEl,open:this.state.menuOpened,onClose:()=>this.setState({menuOpened:!1,menuAnchorEl:null}),slotProps:{paper:{style:{maxHeight:$o*7.5}}},children:[this.state.width<=os?B(y,{disabled:this.props.debugMode||!this.state.selected||this.state.selected===as||this.state.selected===is||!!(e!=null&&e.length),onClick:e=>{if(e.stopPropagation(),e.preventDefault(),this.state.listItems.find(e=>e.parent===this.state.selected)){this.showError(V.t(`Cannot delete non empty item!`));return}this.setState({menuOpened:!1,menuAnchorEl:null},()=>this.onDelete(this.state.selected).then(()=>{}))},children:[O(et,{style:{...q.iconDropdownMenu,color:`red`}}),V.t(`Delete`)]},`delete`):null,B(y,{disabled:this.props.debugMode||i,selected:this.state.expertMode,onClick:e=>{e.stopPropagation(),e.preventDefault(),this.onCloseMenu(()=>this.props.onExpertModeChange&&this.props.onExpertModeChange(!this.state.expertMode))},children:[O(tn,{style:{...q.iconDropdownMenu,color:this.state.expertMode?`orange`:`inherit`}}),V.t(`Expert mode`)]},`expertMode`),this.props.onExport&&B(y,{onClick:e=>{e.stopPropagation(),e.preventDefault(),this.onCloseMenu(()=>this.setState({showExportDialog:!0}))},children:[O(Ct,{style:q.iconDropdownMenu}),V.t(`Export all scripts`)]},`exportAll`),this.props.onImport&&B(y,{disabled:this.props.debugMode,onClick:e=>{e.stopPropagation(),e.preventDefault(),this.onCloseMenu(()=>this.props.onImport())},children:[O(Lt,{style:q.iconDropdownMenu}),V.t(`Import scripts`)]},`import`),this.props.onThemeChange&&B(y,{onClick:()=>this.onCloseMenu(()=>{this.props.onThemeChange&&this.props.onThemeChange(H.toggleTheme(this.state.themeName))}),children:[O(Yn,{style:q.iconDropdownMenu}),V.t(`Change theme (actual "%s")`,this.state.themeName)]},`dark`),this.props.onAddNew&&B(y,{disabled:!this.state.selected||!t||t.type===`folder`,onClick:e=>{let t=this.state.selected;this.onCloseMenu(()=>this.onCopy(e,t))},children:[O(Yt,{style:q.iconDropdownMenu}),V.t(`Copy script`)]},`copy`),this.state.expertMode&&B(y,{disabled:this.props.debugMode,onClick:e=>{e.stopPropagation(),e.preventDefault(),this.onCloseMenu(()=>this.setState({showAdapterDebug:!0}))},children:[O(In,{style:q.iconDropdownMenu}),V.t(`Debug instance`)]},`debugInstance`),this.state.selected&&this.props.password&&this.props.scripts[this.state.selected].type===`script`?B(y,{disabled:this.props.debugMode||this.props.changedScripts[this.state.selected],onClick:e=>{e.stopPropagation(),e.preventDefault(),this.onCloseMenu(async()=>{let e=await this.props.socket.getObject(this.state.selected);if(e){var t;(t=e.native)!=null&&t.protected?(delete e.native.protected,e.common.source=Qo(this.props.password,e.common.source||``)):(e.native||={},e.native.protected=!0,e.common.source=Zo(this.props.password,e.common.source||``)),await this.props.socket.setObject(e._id,e)}})},children:[O(Gn,{style:{...q.iconDropdownMenu,color:`orange`}}),(n=this.props.scripts[this.state.selected])!=null&&(n=n.native)!=null&&n.protected?O(`span`,{style:{color:(r=this.props.scripts[this.state.selected])!=null&&(r=r.native)!=null&&r.protected?`orange`:void 0},children:V.t(`Unprotect script`)}):V.t(`Protect script`)]},`encrypt`):null]},`menu`)}getToolbarButtons(){let e=[],t=this.state.reorder&&!this.props.debugMode;if(this.state.searchMode&&!this.props.debugMode)e.push(O(nt,{value:this.state.searchText,style:q.toolbarSearch,ref:this.inputRef,autoFocus:!0,placeholder:V.t(`Search...`),onChange:e=>{this.setState({searchText:e.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`)),e.push(O(U,{sx:q.toolbarButtons,style:{float:`right`},title:V.t(`End search mode`),onClick:e=>{e.stopPropagation(),this.filterList(!1,()=>this.props.onSearch&&this.props.onSearch(this.state.searchText))},size:`medium`,children:O(Bn,{})},`disableSearch`)),this.state.searchText&&e.push(O(U,{title:V.t(`Clear search input`),sx:q.toolbarButtons,style:{marginTop:7,float:`right`},onClick:e=>{e.stopPropagation(),this.setState({searchText:``},()=>{this.filterList(!0),this.props.onSearch&&this.props.onSearch(this.state.searchText)})},size:`medium`,children:O(Be,{fontSize:`small`})},`cleanSearch`));else{if(!t){e.push(O(U,{"aria-label":`More`,"aria-owns":this.state.menuOpened?`long-menu`:void 0,title:V.t(`Menu`),"aria-haspopup":`true`,onClick:e=>{e.stopPropagation(),e.preventDefault(),this.setState({menuOpened:!0,menuAnchorEl:e.currentTarget})},size:`medium`,children:O(qn,{})},`menuButton`));let n=this.state.listItems.find(e=>e.id===this.state.selected),r;n&&this.state.width<=os&&n.type===`folder`&&(r=this.state.listItems.filter(e=>e.parent===this.state.selected)),e.push(this.getMainMenu(r,n)),e.push(O(U,{disabled:this.props.debugMode,title:V.t(`Create new script`),sx:{...q.toolbarButtons,...this.props.debugMode?q.iconButtonsDisabled:void 0},style:{color:t?`red`:`inherit`},onClick:e=>this.onAddNew(e),size:`medium`,children:O(Xt,{})},`new-script`)),e.push(O(U,{disabled:this.props.debugMode,title:V.t(`Create new folder`),sx:{...q.toolbarButtons,...this.props.debugMode?q.iconButtonsDisabled:void 0},style:{color:t?`red`:`inherit`},onClick:e=>this.onAddNewFolder(e),size:`medium`,children:O(Ne,{})},`new-folder`))}e.push(O(U,{disabled:t||this.props.debugMode,sx:{...q.toolbarButtons,...this.props.debugMode?q.iconButtonsDisabled:void 0},title:V.t(`Search in scripts`),style:{float:`right`,opacity:this.props.debugMode?.5:+!t},onClick:e=>{e.stopPropagation(),this.setState({searchMode:!0})},size:`medium`,children:O(er,{})},`search`)),e.push(O(U,{disabled:this.props.debugMode,title:V.t(`Reorder scripts in folders`),sx:{...q.toolbarButtons,...this.props.debugMode?q.iconButtonsDisabled:void 0},style:{color:t?`red`:`inherit`,float:`right`},onClick:e=>{e.stopPropagation(),this.setState({reorder:!this.state.reorder})},size:`medium`,children:O(sr,{})},`reorder`)),!t&&this.state.selected&&this.state.selected!==as&&this.state.selected!==is&&e.push(O(U,{sx:{...q.toolbarButtons,...this.props.debugMode?q.iconButtonsDisabled:void 0},disabled:this.props.debugMode,title:V.t(`Rename`),onClick:e=>this.onRename(e),size:`medium`,children:O(it,{})},`rename`)),e.push(B(`span`,{style:{opacity:.5,fontSize:10},children:[`v`,this.props.version]},`version`))}return e}getFolders(){let e=[{id:rs,name:V.t(`Root folder`)}];return this.state.listItems.forEach(t=>{t.type===`folder`&&t.id!==rs&&(!t.id.startsWith(as)||this.state.expertMode)&&e.push({id:t.id,name:t.title})}),e}onCollapseAll(){this.setState({expanded:[]}),this.saveExpanded([])}onExpandAll(){let e=[];this.state.listItems.forEach(t=>this.state.listItems.find(e=>e.parent===t.id)&&e.push(t.id)),this.setState({expanded:e}),this.saveExpanded(e)}getBottomButtons(){return this.state.reorder||this.props.debugMode?null:[O(Se,{sx:q.footerButtons,title:V.t(`Show only running scripts`),onClick:e=>{e.stopPropagation(),e.preventDefault();let t=this.state.statusFilter===`running`?``:`running`;window.localStorage&&window.localStorage.setItem(`SideMenu.statusFilter`,t),this.setState({statusFilter:t})},children:O(Xn,{style:{color:es,opacity:this.state.statusFilter===`running`?1:.3,background:this.state.statusFilter===`running`?`gray`:`inherit`}})},`filterByRunning`),O(Se,{sx:q.footerButtons,title:V.t(`Show only paused scripts`),onClick:()=>{let e=this.state.statusFilter===`paused`?``:`paused`;window.localStorage&&window.localStorage.setItem(`SideMenu.statusFilter`,e),this.setState({statusFilter:e})},children:O(Zn,{style:{color:ns,opacity:this.state.statusFilter===`paused`?1:.3,background:this.state.statusFilter===`paused`?`gray`:`inherit`}})},`filterByPaused`),O(Se,{sx:q.footerButtons,style:{marginRight:16},title:V.t(`Show only scripts with problems`),onClick:()=>{let e=this.state.statusFilter===`problems`?``:`problems`;window.localStorage&&window.localStorage.setItem(`SideMenu.statusFilter`,e),this.setState({statusFilter:e})},children:O(Xn,{style:{color:ts,opacity:this.state.statusFilter===`problems`?1:.3,background:this.state.statusFilter===`problems`?`gray`:`inherit`}})},`filterByProblem`),O(Se,{sx:q.footerButtons,children:O(`img`,{alt:`Blockly`,style:{opacity:this.state.typeFilter===`Blockly`?1:.3,background:this.state.typeFilter===`Blockly`?`gray`:`inherit`},src:cs.Blockly||cs.def,onClick:()=>{let e=this.state.typeFilter===`Blockly`?``:`Blockly`;window.localStorage&&window.localStorage.setItem(`SideMenu.typeFilter`,e),this.setState({typeFilter:e})}})},`filterBlockly`),O(Se,{sx:q.footerButtons,children:O(`img`,{alt:`Javascript`,style:{opacity:this.state.typeFilter===`Javascript/js`?1:.3,background:this.state.typeFilter===`Javascript/js`?`gray`:`inherit`},src:cs[`Javascript/js`]||cs.def,onClick:()=>{let e=this.state.typeFilter===`Javascript/js`?``:`Javascript/js`;window.localStorage&&window.localStorage.setItem(`SideMenu.typeFilter`,e),this.setState({typeFilter:e})}})},`filterJS`),O(Se,{sx:q.footerButtons,children:O(`img`,{alt:`TypeScript`,style:{opacity:this.state.typeFilter===`TypeScript/ts`?1:.3,background:this.state.typeFilter===`TypeScript/ts`?`gray`:`inherit`},src:cs[`TypeScript/ts`]||cs.def,onClick:()=>{let e=this.state.typeFilter===`TypeScript/ts`?``:`TypeScript/ts`;window.localStorage&&window.localStorage.setItem(`SideMenu.typeFilter`,e),this.setState({typeFilter:e})}})},`filterTS`),O(Se,{sx:q.footerButtons,children:O(`img`,{alt:`Rules`,style:{opacity:this.state.typeFilter===`Rules`?1:.3,background:this.state.typeFilter===`Rules`?`gray`:`inherit`},src:cs.Rules||cs.def,onClick:()=>{let e=this.state.typeFilter===`Rules`?``:`Rules`;window.localStorage&&window.localStorage.setItem(`SideMenu.typeFilter`,e),this.setState({typeFilter:e})}})},`filterRules`),O(`div`,{style:{flexGrow:1}},`padding`),O(Se,{sx:q.footerButtons,onClick:()=>this.onExpandAll(),title:V.t(`Expand all`),children:O(lr,{style:q.footerButtonsRight})},`expandAll`),this.state.expanded.length?O(Se,{sx:q.footerButtons,onClick:()=>this.onCollapseAll(),title:V.t(`Collapse all`),children:O(cr,{style:q.footerButtonsRight})},`collapseAll`):O(`div`,{style:{height:22,width:24}})]}getAdapterDebugDialog(){return this.state.showAdapterDebug?O(Wo,{socket:this.props.socket,onClose:()=>this.setState({showAdapterDebug:!1}),onDebug:(e,t)=>this.setState({showAdapterDebug:!1},()=>this.props.onDebugInstance({instance:e,adapter:t}))},`debug`):null}render(){var e,t;let n=this.state.renaming?this.state.listItems.find(e=>e.id===this.state.renaming):void 0,r=this.state.copingScript&&this.props.scripts[this.state.copingScript].type===`script`?this.props.scripts[this.state.copingScript]:void 0;return[B(Tt,{variant:`permanent`,style:q.menu,sx:{"& .MuiDrawer-paper":q.drawerPaper},anchor:`left`,onClick:()=>this.onClick({id:``}),children:[O(Se,{sx:q.toolbar,children:this.getToolbarButtons()}),O(Fe,{}),O(ua,{backend:ko,children:O(`div`,{style:q.innerMenu,children:this.renderAllItems(this.state.listItems)})}),O(Fe,{}),O(`div`,{style:q.footer,children:this.getBottomButtons()})]},`drawer`),n?O(Po,{name:n.title,id:this.state.renaming||``,folder:n.type===`folder`,instance:n.instance,instances:this.props.instances,instanceHosts:this.props.instanceHosts,onClose:()=>this.setState({renaming:null}),onRename:(e,t,n,r)=>this.props.onRename&&this.props.onRename(e,t,n,r)},`dialog-rename`):null,this.state.deleting?O(Fo,{name:this.state.listItems.find(e=>e.id===this.state.deleting).title,id:this.state.deleting,onClose:()=>this.setState({deleting:null}),onDelete:e=>this.props.onDelete&&this.props.onDelete(e)},`dialog-delete`):null,this.state.choosingType?O(Vo,{onClose:e=>{let t={choosingType:!1};e&&(t.creatingScript=e),this.setState(t)}},`dialog-script-type`):null,this.state.creatingScript?O(Ho,{onClose:()=>this.setState({creatingScript:null}),title:V.t(`Create new script`),name:this.getUniqueName(),parents:this.getFolders(),folder:!1,existingItems:this.state.listItems.map(e=>e.id),instance:this.props.instances[0]||0,instances:this.props.instances,type:this.state.creatingScript,parent:this.parent,onAdd:(e,t,n,r)=>this.props.onAddNew&&this.props.onAddNew(e,t,!1,n,r)},`dialog-new-script`):null,this.state.copingScript?O(Ho,{onClose:()=>this.setState({copingScript:``}),title:V.t(`Copy script`),name:this.getUniqueName(this.state.copingScript),parents:this.getFolders(),folder:!1,instance:parseInt(r==null||(e=r.common)==null||(e=e.engine)==null?void 0:e.split(`.`).pop(),10)||0,instances:this.props.instances,type:(r==null||(t=r.common)==null?void 0:t.engineType)||`Javascript/js`,parent:this.parent,onAdd:(e,t,n,r)=>{var i;let a=this.state.copingScript&&this.props.scripts[this.state.copingScript].type===`script`?this.props.scripts[this.state.copingScript]:void 0;a!=null&&a.common&&(a.common.enabled=!1),this.props.onAddNew&&this.props.onAddNew(e,t,!1,n,r,a==null||(i=a.common)==null?void 0:i.source)}},`dialog-copy-script`):null,this.state.creatingFolder?O(Ho,{onClose:()=>this.setState({creatingFolder:!1}),title:V.t(`Create new folder`),parents:this.getFolders(),name:this.getUniqueFolderName(),parent:this.parent,onAdd:(e,t)=>this.props.onAddNew&&this.props.onAddNew(e,t,!0)},`dialog-new-folder`):null,this.state.errorText?O(un,{onClose:()=>this.setState({errorText:``}),text:this.state.errorText},`error`):null,this.getAdapterDebugDialog(),this.state.showExportDialog?B(qe,{open:!0,onClose:()=>this.setState({showExportDialog:!1}),children:[O(ot,{children:V.t(`Export all scripts`)}),B(Vt,{children:[O(R,{variant:`contained`,onClick:()=>{this.setState({showExportDialog:!1}),this.props.onExport(!0)},color:`primary`,children:V.t(`as JSON`)}),O(R,{variant:`contained`,onClick:()=>{this.setState({showExportDialog:!1}),this.props.onExport(!1)},color:`grey`,children:V.t(`as plain text`)}),O(R,{variant:`contained`,onClick:()=>this.setState({showExportDialog:!1}),color:`primary`,children:V.t(`Cancel`)})]})]},`dialog-export-format`):null]}};G();var ms=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgAQMAAADYVuV7AAAABlBMVEUAAAAzMzPI8eYgAAAAAXRSTlMAQObYZgAAACFJREFUeAFjAIJRwP////8PYIKWHCigNQdKj/pn1D+jAABTG16wVQqVpQAAAABJRU5ErkJggg==`,hs=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgAQMAAADYVuV7AAAABlBMVEUAAAAzMzPI8eYgAAAAAXRSTlMAQObYZgAAABtJREFUeAFjAIJRwP8fCj7QkENn/4z6Z5QzCgBjbWaoyx1PqQAAAABJRU5ErkJggg==`;function gs(e){let t,n=e.getHours();return n<10&&(n=`0${n.toString()}`),t=`${n}:`,n=e.getMinutes(),n<10&&(n=`0${n.toString()}`),t+=`${n}:`,n=e.getSeconds(),n<10&&(n=`0${n.toString()}`),t+=`${n}.`,n=e.getMilliseconds(),n<10?n=`00${n.toString()}`:n<100&&(n=`0${n.toString()}`),t+=n,t}var _s=34,vs={logBox:{width:`100%`,height:`100%`,position:`relative`,overflow:`hidden`},logBoxInner:e=>({display:`inline-block`,color:e.palette.mode===`dark`?`white`:`black`,width:`calc(100% - ${_s}px)`,height:`100%`,overflow:`auto`,position:`relative`,verticalAlign:`top`}),info:e=>({background:e.palette.mode===`dark`?`darkgrey`:`lightgrey`,color:(e.palette.mode,`black`)}),error:e=>({background:`#FF0000`,color:e.palette.mode===`dark`?`black`:`white`}),warn:e=>({background:`#FF8000`,color:e.palette.mode===`dark`?`black`:`white`}),debug:e=>({background:`gray`,opacity:.8,color:e.palette.mode===`dark`?`black`:`white`}),silly:e=>({background:`gray`,opacity:.6,color:e.palette.mode===`dark`?`black`:`white`}),table:{fontFamily:`monospace`,width:`100%`},toolbox:{width:_s,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:e=>({"& img":{width:24,height:24,background:e.palette.mode===`dark`?`#9d9d9d`:void 0,borderRadius:e.palette.mode===`dark`?`30px`:void 0}})};function ys(e){return e<10?`00${e}`:e<100?`0${e}`:e.toString()}var bs={},xs=class e extends W.Component{constructor(t){super(t),N(this,`messagesEnd`,void 0),N(this,`logHandler`,t=>{let n=this.state.lines,r=this.state.editing.filter(e=>t.message.includes(e)),i=null;if(!r.length||(r.length===1?i=r[0]:(r.sort(),i=r[r.length-1]),!i))return;let a=n[i]||[],o=bs[i]||[];a.push(e.generateLine(t,i));let s=t.severity;(s===`info`||s===`warn`)&&(s+=` `);let c=new Date(t.ts);if(o.push(`${c.toLocaleString()}.${ys(c.getMilliseconds())}\t[${s}]: ${t.message}`),a.length>300){let e=a.length-300;a.splice(0,e),o.splice(0,e)}bs[i]=o,n[i]=a,this.setState({lines:n})}),this.state={lines:{},goBottom:!0,selected:null,editing:this.props.editing||[]},this.messagesEnd=W.createRef()}static generateLine(e,t){let n=e.message||``;if(typeof n!=`object`){let t=RegExp(`${e.from.replace(`.`,`\\.`).replace(`)`,`\\)`).replace(`(`,`\\(`)} \\(\\d+\\) `,`g`),r=n.match(t);n=r?n.replace(r[0],``):n.replace(`${e.from} `,``)}return n.startsWith(`${t}: `)&&(n=n.substring(t.length+2)),B(Se,{component:`tr`,sx:vs[e.severity],children:[O(`td`,{style:vs.trFrom,children:e.from}),O(`td`,{style:vs.trTime,children:gs(new Date(e.ts))}),O(`td`,{style:vs.trSeverity,children:e.severity}),O(`td`,{children:O(`pre`,{style:vs.trPreMessage,children:n})})]},`tr_${e.ts}_${e.message.substring(e.message.length-10)}`)}scrollToBottom(){var e;(e=this.messagesEnd)==null||(e=e.current)==null||e.scrollIntoView({behavior:`smooth`})}componentDidMount(){this.props.socket.registerLogHandler(this.logHandler)}componentWillUnmount(){this.props.socket.unregisterLogHandler(this.logHandler)}componentDidUpdate(){this.state.goBottom&&this.scrollToBottom()}static getDerivedStateFromProps(e,t){let n=!1,r={};if(e.selected!==t.selected){let i=e.selected,a=t.lines;i&&(a[i]=a[i]||[],bs[i]=bs[i]||[]),r.selected=i,n=!0}if(JSON.stringify(e.editing)!==JSON.stringify(t.editing)){let i=JSON.parse(JSON.stringify(e.editing));n=!0;let a=t.lines;for(let e in bs)Object.prototype.hasOwnProperty.call(bs,e)&&(i.includes(e)||(delete bs[e],delete a[e]));r.editing=i}return n?r:null}onCopy(){H.copyToClipboard((bs[this.state.selected]||[]).join(` +`))}clearLog(){let e=this.state.lines;e[this.state.selected]&&(e[this.state.selected]=[]),bs[this.state.selected]&&(bs[this.state.selected]=[]),this.setState({lines:e})}renderLogList(e){return this.state.selected&&e!=null&&e.length?B(Se,{sx:vs.logBoxInner,children:[O(`table`,{style:vs.table,children:O(`tbody`,{children:e})},`logTable`),O(`div`,{ref:this.messagesEnd,style:{float:`left`,clear:`both`}},`logScrollPoint`)]},`logList`):O(Se,{sx:vs.logBoxInner,style:{paddingLeft:10},children:V.t(`Log outputs`)},`logList`)}render(){let e=this.state.selected?this.state.lines[this.state.selected]:null;return B(`div`,{style:vs.logBox,children:[B(`div`,{style:vs.toolbox,children:[O(U,{style:vs.iconButtons,onClick:()=>this.setState({goBottom:!this.state.goBottom}),color:this.state.goBottom?`secondary`:void 0,size:`medium`,children:O(Te,{})}),e!=null&&e.length?O(U,{style:vs.iconButtons,onClick:()=>this.clearLog(),size:`medium`,children:O(ee,{})}):null,e!=null&&e.length?O(U,{style:vs.iconButtons,onClick:()=>this.onCopy(),size:`medium`,children:O(b,{})}):null,this.props.onLayoutChange?O(U,{style:vs.iconButtons,onClick:()=>this.props.onLayoutChange&&this.props.onLayoutChange(),title:V.t(`Change layout`),size:`medium`,sx:vs.layoutIcon,children:O(`img`,{alt:`split`,src:this.props.verticalLayout?ms:hs})}):null,O(U,{style:vs.iconButtons,onClick:()=>this.props.onHideLog(),title:V.t(`Hide logs`),size:`medium`,children:O(ue,{})})]},`toolbox`),this.renderLogList(e)]})}},Ss=`focus-outline-hidden`;function Cs(){var e=this;document.addEventListener(`keydown`,function(t){e.focusByKeyboard=!0},!0),document.addEventListener(`mousedown`,function(t){e.focusByKeyboard=!1},!0),document.addEventListener(`focus`,function(t){e.updateVisibility()},!0),document.addEventListener(`focusout`,function(t){window.setTimeout(function(){document.hasFocus()||(e.focusByKeyboard=!0,e.updateVisibility())},0)}),this.updateVisibility()}Cs.prototype={focusByKeyboard:!0,updateVisibility:function(){this.hidden=!this.focusByKeyboard},set hidden(e){document.documentElement.classList.toggle(Ss,e)},get hidden(){return document.documentElement.classList.contains(Ss)}},new Cs;var ws=r(((e,t)=>{(function(){var e={}.hasOwnProperty;function n(){for(var t=[],r=0;r{Object.defineProperty(e,"__esModule",{value:!0});var t=e.easeFunctions={linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return e<.5?2*e*e:-1+(4-2*e)*e},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e}},n=e.isNumeric=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};e.setPosition=function(e,n,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:`easeInOutCubic`;return r>i?n:e+(n-e)*t[a](r/i)},e.calcEndPoint=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if(n(e))return parseInt(e)+r;var i=t===window||t===document.documentElement?window.pageYOffset:t.scrollTop-t.getBoundingClientRect().top;return(e.nodeName.toLowerCase()===`html`?-i:e.getBoundingClientRect().top+i)+r}})),Es=r(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},r=Ts();e.default=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.duration,a=i===void 0?500:i,o=t.context,s=o===void 0?window:o,c=t.offset,l=c===void 0?0:c,u=t.ease,d=u===void 0?`easeInOutCubic`:u,f=t.callback;if((typeof window>`u`?`undefined`:n(window))===`object`){var p=s.scrollTop!==null&&s.scrollTop!==void 0?s.scrollTop:window.pageYOffset,m=(0,r.calcEndPoint)(e,s,l),h=performance.now(),g=window.requestAnimationFrame;(function t(){var n=performance.now()-h,i=(0,r.setPosition)(p,m,n,a,d);s===window?window.scroll(0,i):s.scrollTop=i,n>a?typeof f==`function`&&f(e):g(t)})()}},t.exports=e.default})),Ds=r(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{},t=e.query,i=t===void 0?`[href^="#"]:not([href="#"]`:t,a=e.match,o=a===void 0?function(e){return document.getElementById(e.hash.substring(1))}:a,s=e.hashChange,c=s===void 0||s,l=e.scrollSmoothConfig,u=document.querySelectorAll(i),d=function(e){e.preventDefault();var t=o(e.target);t&&(c&&history.replaceState(null,null,`#`+t.id),(0,r.default)(t,n({},l)))};Array.from(u).map(function(e){e.addEventListener(`click`,d,!1)})},t.exports=e.default})),Os=r(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});function n(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&arguments[0]!==void 0?arguments[0]:{},t=e.activeClass,r=t===void 0?`active`:t,i=e.query,a=i===void 0?`[href^="#"]:not([href="#"]):not([href="#0"])`:i,o=e.threshold,s=o===void 0?[.25,.5,.75]:o,c=e.detectType,l=c===void 0?`max`:c,u={threshold:s},d=function(e){return e.classList.remove(r)},f=function(e){return e.classList.add(r)},p=function(){document.querySelectorAll(`.`+r).forEach(d)},m=function(e){p(),f(document.querySelector(`a[href="#`+e.id+`"]`))},h=function(e){e.forEach(function(e){e.intersectionRatio>=Math[l].apply(Math,n(s))&&m(e.target)})},g=document.querySelectorAll(a),_=new IntersectionObserver(h,u);g.forEach(function(e){var t=document.querySelector(`#`+e.hash.slice(1));_.observe(t)})},t.exports=e.default})),ks=r(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=o(Es()),r=Ts(),i=o(Ds()),a=o(Os());function o(e){return e&&e.__esModule?e:{default:e}}e.default={to:n.default,calcEndPoint:r.calcEndPoint,anchorScroll:i.default,observe:a.default},t.exports=e.default})),As=r(((e,t)=>{(function(e,n){typeof t==`object`&&t.exports?t.exports=n():e.Scrollparent=n()})(e,function(){var e=/(auto|scroll)/,t=function(e,n){return e.parentNode===null?n:t(e.parentNode,n.concat([e]))},n=function(e,t){return getComputedStyle(e,null).getPropertyValue(t)},r=function(e){return n(e,`overflow`)+n(e,`overflow-y`)+n(e,`overflow-x`)},i=function(t){return e.test(r(t))};return function(e){if(e instanceof HTMLElement||e instanceof SVGElement){for(var n=t(e.parentNode,[]),r=0;r{var n=NaN,r=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt,c=typeof global==`object`&&global&&global.Object===Object&&global,l=typeof self==`object`&&self&&self.Object===Object&&self,u=c||l||Function(`return this`)(),d=Object.prototype.toString,f=Math.max,p=Math.min,m=function(){return u.Date.now()};function h(e,t,n){var r,i,a,o,s,c,l=0,u=!1,d=!1,h=!0;if(typeof e!=`function`)throw TypeError(`Expected a function`);t=y(t)||0,g(n)&&(u=!!n.leading,d=`maxWait`in n,a=d?f(y(n.maxWait)||0,t):a,h=`trailing`in n?!!n.trailing:h);function _(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function v(e){return l=e,s=setTimeout(S,t),u?_(e):o}function b(e){var n=e-c,r=e-l,i=t-n;return d?p(i,a-r):i}function x(e){var n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function S(){var e=m();if(x(e))return C(e);s=setTimeout(S,b(e))}function C(e){return s=void 0,h&&r?_(e):(r=i=void 0,o)}function w(){s!==void 0&&clearTimeout(s),l=0,r=c=i=s=void 0}function T(){return s===void 0?o:C(m())}function E(){var e=m(),n=x(e);if(r=arguments,i=this,c=e,n){if(s===void 0)return v(c);if(d)return s=setTimeout(S,t),_(c)}return s===void 0&&(s=setTimeout(S,t)),o}return E.cancel=w,E.flush=T,E}function g(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function _(e){return!!e&&typeof e==`object`}function v(e){return typeof e==`symbol`||_(e)&&d.call(e)==`[object Symbol]`}function y(e){if(typeof e==`number`)return e;if(v(e))return n;if(g(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=g(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=e.replace(r,``);var c=a.test(e);return c||o.test(e)?s(e.slice(2),c?2:8):i.test(e)?n:+e}t.exports=h})),Ms=t(ws()),Ns=t(ks()),Ps=t(As()),Fs=t(js());function Is(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Ls=`data-focus-lock`,Rs=`data-focus-lock-disabled`,zs=`data-no-focus-lock`,Bs=`data-autofocus-inside`,Vs=`data-no-autofocus`;function Hs(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}G();function Us(e,t){var n=ze(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}G();var Ws=typeof window<`u`?$e:yt,Gs=new WeakMap;function Ks(e,t){var n=Us(t||null,function(t){return e.forEach(function(e){return Hs(e,t)})});return Ws(function(){var t=Gs.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Hs(e,null)}),i.forEach(function(e){r.has(e)||Hs(e,a)})}Gs.set(n,e)},[e]),n}G();var qs={width:`1px`,height:`0px`,padding:0,overflow:`hidden`,position:`fixed`,top:`1px`,left:`1px`},Js=function(){return Js=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0}).sort(kc)},Mc=[`button:enabled`,`select:enabled`,`textarea:enabled`,`input:enabled`,`a[href]`,`area[href]`,`summary`,`iframe`,`object`,`embed`,`audio[controls]`,`video[controls]`,`[tabindex]`,`[contenteditable]`,`[autofocus]`].join(`,`),Nc=`${Mc}, [data-focus-guard]`,Pc=function(e,t){return lc((e.shadowRoot||e).children).reduce(function(e,n){return e.concat(n.matches(t?Nc:Mc)?[n]:[],Pc(n))},[])},Fc=function(e,t){var n;return e instanceof HTMLIFrameElement&&(n=e.contentDocument)!=null&&n.body?Ic([e.contentDocument.body],t):[e]},Ic=function(e,t){return e.reduce(function(e,n){var r,i=Pc(n,t),a=(r=[]).concat.apply(r,i.map(function(e){return Fc(e,t)}));return e.concat(a,n.parentNode?lc(n.parentNode.querySelectorAll(Mc)).filter(function(e){return e===n}):[])},[])},Lc=function(e){return lc(e.querySelectorAll(`[${Bs}]`)).map(function(e){return Ic([e])}).reduce(function(e,t){return e.concat(t)},[])},Rc=function(e,t){return lc(e).filter(function(e){return _c(t,e)}).filter(function(e){return wc(e)})},zc=function(e,t){return t===void 0&&(t=new Map),lc(e).filter(function(e){return yc(t,e)})},Bc=function(e,t,n){return jc(Rc(Ic(e,n),t),!0,n)},Vc=function(e,t){return jc(Rc(Ic(e),t),!1)},Hc=function(e,t){return Rc(Lc(e),t)},Uc=function(e,t){return e.shadowRoot?Uc(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:lc(e.children).some(function(e){var n;if(e instanceof HTMLIFrameElement){var r=(n=e.contentDocument)==null?void 0:n.body;return r?Uc(r,t):!1}return Uc(e,t)})},Wc=function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(i),(a&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(e,n){return!t.has(n)})},Gc=function(e){return e.parentNode?Gc(e.parentNode):e},Kc=function(e){return uc(e).filter(Boolean).reduce(function(e,t){var n=t.getAttribute(Ls);return e.push.apply(e,n?Wc(lc(Gc(t).querySelectorAll(`[${Ls}="${n}"]:not([${Rs}="disabled"])`))):[t]),e},[])},qc=function(e){try{return e()}catch{return}},Jc=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?Jc(t.shadowRoot):t instanceof HTMLIFrameElement&&qc(function(){return t.contentWindow.document})?Jc(t.contentWindow.document):t}},Yc=function(e,t){return e===t},Xc=function(e,t){return!!lc(e.querySelectorAll(`iframe`)).some(function(e){return Yc(e,t)})},Zc=function(e,t){return t===void 0&&(t=Jc(dc(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:Kc(e).some(function(e){return Uc(e,t)||Xc(e,t)})},Qc=function(e){e===void 0&&(e=document);var t=Jc(e);return t?lc(e.querySelectorAll(`[${zs}]`)).some(function(e){return Uc(e,t)}):!1},$c=function(e,t){return t.filter(Cc).filter(function(t){return t.name===e.name}).filter(function(e){return e.checked})[0]||e},el=function(e,t){return Cc(e)&&e.name?$c(e,t):e},tl=function(e){var t=new Set;return e.forEach(function(n){return t.add(el(n,e))}),e.filter(function(e){return t.has(e)})},nl=function(e){return e[0]&&e.length>1?el(e[0],e):e[0]},rl=function(e,t){return e.indexOf(el(t,e))},il=`NEW_FOCUS`,al=function(e,t,n,r,i){var a=e.length,o=e[0],s=e[a-1],c=Ec(r);if(!(r&&e.indexOf(r)>=0)){var l=r===void 0?-1:n.indexOf(r),u=i?n.indexOf(i):l,d=i?e.indexOf(i):-1;if(l===-1)return d===-1?il:d;if(d===-1)return il;var f=l-u,p=n.indexOf(o),m=n.indexOf(s),h=tl(n),g=r===void 0?-1:h.indexOf(r),_=i?h.indexOf(i):g,v=h.filter(function(e){return e.tabIndex>=0}),y=r===void 0?-1:v.indexOf(r),b=i?v.indexOf(i):y,x=y>=0&&b>=0?b-y:_-g;if(!f&&d>=0||t.length===0)return d;var S=rl(e,t[0]),C=rl(e,t[t.length-1]);if(l<=p&&c&&Math.abs(f)>1)return C;if(l>=m&&c&&Math.abs(f)>1)return S;if(f&&Math.abs(x)>1)return d;if(l<=p)return C;if(l>m)return S;if(f)return Math.abs(f)>1?d:(a+d+f)%a}},ol=function(e){return function(t){var n,r=(n=bc(t))==null?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!==`false`||e.indexOf(t)>=0}},sl=function(e,t,n){var r=zc(e.map(function(e){return e.node}).filter(ol(n)));return r&&r.length?nl(r):nl(zc(t))},cl=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&cl(e.parentNode.host||e.parentNode,t),t},ll=function(e,t){for(var n=cl(e),r=cl(t),i=0;i=0)return a}return!1},ul=function(e,t,n){var r=uc(e),i=uc(t),a=r[0],o=!1;return i.filter(Boolean).forEach(function(e){o=ll(o||e,e)||o,n.filter(Boolean).forEach(function(e){var t=ll(a,e);t&&(o=!o||Uc(t,o)?t:ll(t,o))})}),o},dl=function(e,t){return e.reduce(function(e,n){return e.concat(Hc(n,t))},[])},fl=function(e,t){var n=new Map;return t.forEach(function(e){return n.set(e.node,e)}),e.map(function(e){return n.get(e)}).filter(Oc)},pl=function(e,t){var n=Jc(uc(e).length>0?document:dc(e).ownerDocument),r=Kc(e).filter(Dc),i=ul(n||e,e,r),a=new Map,o=Vc(r,a),s=o.filter(function(e){var t=e.node;return Dc(t)});if(s[0]){var c=Vc([i],a).map(function(e){return e.node}),l=fl(c,s),u=l.map(function(e){return e.node}),d=l.filter(function(e){return e.tabIndex>=0}).map(function(e){return e.node}),f=al(u,d,c,n,t);if(f===`NEW_FOCUS`){var p=sl(o,d,dl(r,a))||sl(o,u,dl(r,a));if(p)return{node:p};console.warn(`focus-lock: cannot find any node to move focus into`);return}return f===void 0?f:l[f]}},ml=function(e){var t=Kc(e).filter(Dc),n=jc(Ic([ul(e,e,t)],!0),!0,!0),r=Ic(t,!1);return n.map(function(e){var t=e.node;return{node:t,index:e.index,lockItem:r.indexOf(t)>=0,guard:Ec(t)}})},hl=function(e,t){e&&(`focus`in e&&e.focus(t),`contentWindow`in e&&e.contentWindow&&e.contentWindow.focus())},gl=0,_l=!1,vl=function(e,t,n){n===void 0&&(n={});var r=pl(e,t);if(!_l&&r){if(gl>2){console.error(`FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting`),_l=!0,setTimeout(function(){_l=!1},1);return}gl++,hl(r.node,n.focusOptions),gl--}};function yl(e){if(!e)return null;if(typeof WeakRef>`u`)return function(){return e||null};var t=e?new WeakRef(e):null;return function(){return(t==null?void 0:t.deref())||null}}var bl=function(e){if(!e)return null;for(var t=[],n=e;n&&n!==document.body;)t.push({current:yl(n),parent:yl(n.parentElement),left:yl(n.previousElementSibling),right:yl(n.nextElementSibling)}),n=n.parentElement;return{element:yl(e),stack:t,ownerDocument:e.ownerDocument}},xl=function(e){var t,n,r;if(e)for(var i=e.stack,a=e.ownerDocument,o=new Map,s=0,c=i;s-1&&(m.filter(function(e){var t=e.guard,n=e.node;return t&&n.dataset.focusAutoGuard}).forEach(function(e){return e.node.removeAttribute(`tabIndex`)}),Kl(h,m.length,1,m),Kl(h,-1,-1,m))}}}return e},$l=function(e){Ql()&&e&&(e.stopPropagation(),e.preventDefault())},eu=function(){return Ml(Ql)},tu=function(e){var t=e.target,n=e.currentTarget;n.contains(t)||Wl(n,t)},nu=function(){return null},ru=function(){Vl=!0},iu=function(){Vl=!1,Bl=`just`,Ml(function(){Bl=`meanwhile`})},au=function(){document.addEventListener(`focusin`,$l),document.addEventListener(`focusout`,eu),window.addEventListener(`focus`,ru),window.addEventListener(`blur`,iu)},ou=function(){document.removeEventListener(`focusin`,$l),document.removeEventListener(`focusout`,eu),window.removeEventListener(`focus`,ru),window.removeEventListener(`blur`,iu)};function su(e){return e.filter(function(e){return!e.disabled})}var cu={moveFocusInside:vl,focusInside:Zc,focusNextElement:Dl,focusPrevElement:Ol,focusFirstElement:Al,focusLastElement:jl,captureFocusRestore:Sl};function lu(e){var t=e.slice(-1)[0];t&&!Il&&au();var n=Il,r=n&&t&&t.id===n.id;Il=t,n&&!r&&(n.onDeactivation(),e.filter(function(e){return e.id===n.id}).length||n.returnFocus(!t)),t?(Ll=null,(!r||n.observed!==t.observed)&&t.onActivation(cu),Ql(!0),Ml(Ql)):(ou(),Ll=null)}$s.assignSyncMedium(tu),ec.assignMedium(eu),tc.assignMedium(function(e){return e(cu)});var uu=cc(su,lu)(nu);G();var du=He(function(e,t){return W.createElement(ac,j({sideCar:uu,ref:t},e))}),fu=ac.propTypes||{};fu.sideCar,Is(fu,[`sideCar`]),du.propTypes={};var pu=du,mu=`-ms-`,hu=`-moz-`,gu=`-webkit-`,_u=`comm`,vu=`rule`,yu=`decl`,bu=`@import`,xu=`@namespace`,Su=`@keyframes`,Cu=`@layer`,wu=Math.abs,Tu=String.fromCharCode,Eu=Object.assign;function Du(e,t){return ju(e,0)^45?(((t<<2^ju(e,0))<<2^ju(e,1))<<2^ju(e,2))<<2^ju(e,3):0}function Ou(e){return e.trim()}function ku(e,t){return(e=t.exec(e))?e[0]:e}function J(e,t,n){return e.replace(t,n)}function Au(e,t,n){return e.indexOf(t,n)}function ju(e,t){return e.charCodeAt(t)|0}function Mu(e,t,n){return e.slice(t,n)}function Nu(e){return e.length}function Pu(e){return e.length}function Fu(e,t){return t.push(e),e}function Iu(e,t){return e.map(t).join(``)}function Lu(e,t){return e.filter(function(e){return!ku(e,t)})}var Ru=1,zu=1,Bu=0,Vu=0,Hu=0,Uu=``;function Wu(e,t,n,r,i,a,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:Ru,column:zu,length:o,return:``,siblings:s}}function Gu(e,t){return Eu(Wu(``,null,null,``,null,null,0,e.siblings),e,{length:-e.length},t)}function Ku(e){for(;e.root;)e=Gu(e.root,{children:[e]});Fu(e,e.siblings)}function qu(){return Hu}function Ju(){return Hu=Vu>0?ju(Uu,--Vu):0,zu--,Hu===10&&(zu=1,Ru--),Hu}function Yu(){return Hu=Vu2||$u(Hu)>3?``:` `}function id(e,t){for(;--t&&Yu()&&!(Hu<48||Hu>102||Hu>57&&Hu<65||Hu>70&&Hu<97););return Qu(e,Zu()+(t<6&&Xu()==32&&Yu()==32))}function ad(e){for(;Yu();)switch(Hu){case e:return Vu;case 34:case 39:e!==34&&e!==39&&ad(Hu);break;case 40:e===41&&ad(e);break;case 92:Yu();break}return Vu}function od(e,t){for(;Yu()&&e+Hu!==57&&(e+Hu!==84||Xu()!==47););return`/*`+Qu(t,Vu-1)+`*`+Tu(e===47?e:Yu())}function sd(e){for(;!$u(Xu());)Yu();return Qu(e,Vu)}function cd(e){return td(ld(``,null,null,null,[``],e=ed(e),0,[0],e))}function ld(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,_=1,v=0,y=``,b=i,x=a,S=r,C=y;g;)switch(m=v,v=Yu()){case 40:if(m!=108&&ju(C,d-1)==58){Au(C+=J(nd(v),`&`,`&\f`),`&\f`,wu(l?s[l-1]:0))!=-1&&(_=-1);break}case 34:case 39:case 91:C+=nd(v);break;case 9:case 10:case 13:case 32:C+=rd(m);break;case 92:C+=id(Zu()-1,7);continue;case 47:switch(Xu()){case 42:case 47:Fu(dd(od(Yu(),Zu()),t,n,c),c),($u(m||1)==5||$u(Xu()||1)==5)&&Nu(C)&&Mu(C,-1,void 0)!==` `&&(C+=` `);break;default:C+=`/`}break;case 123*h:s[l++]=Nu(C)*_;case 125*h:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:_==-1&&(C=J(C,/\f/g,``)),p>0&&(Nu(C)-d||h===0&&m===47)&&Fu(p>32?fd(C+`;`,r,n,d-1,c):fd(J(C,` `,``)+`;`,r,n,d-2,c),c);break;case 59:C+=`;`;default:if(Fu(S=ud(C,t,n,l,u,i,s,y,b=[],x=[],d,a),a),v===123){if(u===0)ld(C,t,S,S,b,a,d,s,x);else{switch(f){case 99:if(ju(C,3)===110)break;case 108:if(ju(C,2)===97)break;default:u=0;case 100:case 109:case 115:}u?ld(e,S,S,r&&Fu(ud(e,S,S,0,0,i,s,y,i,b=[],d,x),x),i,x,d,s,r?b:x):ld(C,S,S,S,[``],x,0,s,x)}}}l=u=p=0,h=_=1,y=C=``,d=o;break;case 58:d=1+Nu(C),p=m;default:if(h<1){if(v==123)--h;else if(v==125&&h++==0&&Ju()==125)continue}switch(C+=Tu(v),v*h){case 38:_=u>0?1:(C+=`\f`,-1);break;case 44:s[l++]=(Nu(C)-1)*_,_=1;break;case 64:Xu()===45&&(C+=nd(Yu())),f=Xu(),u=d=Nu(y=C+=sd(Zu())),v++;break;case 45:m===45&&Nu(C)==2&&(h=0)}}return a}function ud(e,t,n,r,i,a,o,s,c,l,u,d){for(var f=i-1,p=i===0?a:[``],m=Pu(p),h=0,g=0,_=0;h0?p[v]+` `+y:J(y,/&\f/g,p[v])))&&(c[_++]=b);return Wu(e,t,n,i===0?vu:s,c,l,u,d)}function dd(e,t,n,r){return Wu(e,t,n,_u,Tu(qu()),Mu(e,2,-2),0,r)}function fd(e,t,n,r,i){return Wu(e,t,n,yu,Mu(e,0,r),Mu(e,r+1,-1),r,i)}function pd(e,t,n){switch(Du(e,t)){case 5103:return gu+`print-`+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:case 6391:case 5879:case 5623:case 6135:case 4599:return gu+e+e;case 4855:return gu+e.replace(`add`,`source-over`).replace(`substract`,`source-out`).replace(`intersect`,`source-in`).replace(`exclude`,`xor`)+e;case 4789:return hu+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return gu+e+hu+e+mu+e+e;case 5936:switch(ju(e,t+11)){case 114:return gu+e+mu+J(e,/[svh]\w+-[tblr]{2}/,`tb`)+e;case 108:return gu+e+mu+J(e,/[svh]\w+-[tblr]{2}/,`tb-rl`)+e;case 45:return gu+e+mu+J(e,/[svh]\w+-[tblr]{2}/,`lr`)+e}case 6828:case 4268:case 2903:return gu+e+mu+e+e;case 6165:return gu+e+mu+`flex-`+e+e;case 5187:return gu+e+J(e,/(\w+).+(:[^]+)/,gu+`box-$1$2`+mu+`flex-$1$2`)+e;case 5443:return gu+e+mu+`flex-item-`+J(e,/flex-|-self/g,``)+(ku(e,/flex-|baseline/)?``:mu+`grid-row-`+J(e,/flex-|-self/g,``))+e;case 4675:return gu+e+mu+`flex-line-pack`+J(e,/align-content|flex-|-self/g,``)+e;case 5548:return gu+e+mu+J(e,`shrink`,`negative`)+e;case 5292:return gu+e+mu+J(e,`basis`,`preferred-size`)+e;case 6060:return gu+`box-`+J(e,`-grow`,``)+gu+e+mu+J(e,`grow`,`positive`)+e;case 4554:return gu+J(e,/([^-])(transform)/g,`$1`+gu+`$2`)+e;case 6187:return J(J(J(e,/(zoom-|grab)/,gu+`$1`),/(image-set)/,gu+`$1`),e,``)+e;case 5495:case 3959:return J(e,/(image-set\([^]*)/,gu+"$1$`$1");case 4968:return J(J(e,/(.+:)(flex-)?(.*)/,gu+`box-pack:$3`+mu+`flex-pack:$3`),/space-between/,`justify`)+gu+e+e;case 4200:if(!ku(e,/flex-|baseline/))return mu+`grid-column-align`+Mu(e,t)+e;break;case 2592:case 3360:return mu+J(e,`template-`,``)+e;case 4384:case 3616:return n&&n.some(function(e,n){return t=n,ku(e.props,/grid-\w+-end/)})?~Au(e+(n=n[t].value),`span`,0)?e:mu+J(e,`-start`,``)+e+mu+`grid-row-span:`+(~Au(n,`span`,0)?ku(n,/\d+/):ku(n,/\d+/)-+ku(e,/\d+/))+`;`:mu+J(e,`-start`,``)+e;case 4896:case 4128:return n&&n.some(function(e){return ku(e.props,/grid-\w+-start/)})?e:mu+J(J(e,`-end`,`-span`),`span `,``)+e;case 4095:case 3583:case 4068:case 2532:return J(e,/(.+)-inline(.+)/,gu+`$1$2`)+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Nu(e)-1-t>6)switch(ju(e,t+1)){case 109:if(ju(e,t+4)!==45)break;case 102:return J(e,/(.+:)(.+)-([^]+)/,`$1`+gu+`$2-$3$1`+hu+(ju(e,t+3)==108?`$3`:`$2-$3`))+e;case 115:return~Au(e,`stretch`,0)?pd(J(e,`stretch`,`fill-available`),t,n)+e:e}break;case 5152:case 5920:return J(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(t,n,r,i,a,o,s){return mu+n+`:`+r+s+(i?mu+n+`-span:`+(a?o:o-+r)+s:``)+e});case 4949:if(ju(e,t+6)===121)return J(e,`:`,`:`+gu)+e;break;case 6444:switch(ju(e,ju(e,14)===45?18:11)){case 120:return J(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,`$1`+gu+(ju(e,14)===45?`inline-`:``)+`box$3$1`+gu+`$2$3$1`+mu+`$2box$3`)+e;case 100:return J(e,`:`,`:`+mu)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return J(e,`scroll-`,`scroll-snap-`)+e}return e}function md(e,t){for(var n=``,r=0;r-1&&!e.return)switch(e.type){case yu:e.return=pd(e.value,e.length,n);return;case Su:return md([Gu(e,{value:J(e.value,`@`,`@`+gu)})],r);case vu:if(e.length)return Iu(n=e.props,function(t){switch(ku(t,r=/(::plac\w+|:read-\w+)/)){case`:read-only`:case`:read-write`:Ku(Gu(e,{props:[J(t,/:(read-\w+)/,`:`+hu+`$1`)]})),Ku(Gu(e,{props:[t]})),Eu(e,{props:Lu(n,r)});break;case`::placeholder`:Ku(Gu(e,{props:[J(t,/:(plac\w+)/,`:`+gu+`input-$1`)]})),Ku(Gu(e,{props:[J(t,/:(plac\w+)/,`:`+hu+`$1`)]})),Ku(Gu(e,{props:[J(t,/:(plac\w+)/,mu+`input-$1`)]})),Ku(Gu(e,{props:[t]})),Eu(e,{props:Lu(n,r)})}return``})}}G();var yd=typeof process<`u`&&({}.REACT_APP_SC_ATTR||{}.SC_ATTR)||`data-styled`,bd=`active`,xd=`data-styled-version`,Sd=`6.5.3`,Cd=`/*!sc*/ +`,wd=typeof window<`u`&&typeof document<`u`;function Td(e){if(typeof process<`u`){let t={}[e];if(t!==void 0&&t!==``)return t!==`false`}}var Ed=!!(typeof SC_DISABLE_SPEEDY==`boolean`?SC_DISABLE_SPEEDY:Td(`REACT_APP_SC_DISABLE_SPEEDY`)??Td(`SC_DISABLE_SPEEDY`)??(typeof process<`u`&&!1)),Dd=`sc-keyframes-`,Od={};function kd(e,...t){return Error(`An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#${e} for more information.${t.length>0?` Args: ${t.join(`, `)}`:``}`)}var Ad=new Map,jd=new Map,Md=1,Nd=e=>{if(Ad.has(e))return Ad.get(e);for(;jd.has(Md);)Md++;let t=Md++;return Ad.set(e,t),jd.set(t,e),t},Pd=e=>jd.get(e),Fd=(e,t)=>{Md=t+1,Ad.set(e,t),jd.set(t,e)},Id=Object.freeze([]),Ld=Object.freeze({});function Rd(e,t,n=Ld){return e.theme!==n.theme&&e.theme||t||n.theme}var zd=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Bd=/(^-|-$)/g;function Vd(e){return e.replace(zd,`-`).replace(Bd,``)}var Hd=/(a)(d)/gi,Ud=e=>String.fromCharCode(e+(e>25?39:97));function Wd(e){let t,n=``;for(t=Math.abs(e);t>52;t=t/52|0)n=Ud(t%52)+n;return(Ud(t%52)+n).replace(Hd,`$1-$2`)}var Gd=5381,Kd=(e,t)=>{let n=t.length;for(;n;)e=33*e^t.charCodeAt(--n);return e},qd=e=>Kd(Gd,e);function Jd(e){return Wd(qd(e)>>>0)}function Yd(e){return e.displayName||e.name||`Component`}function Xd(e){return typeof e==`string`&&!0}function Zd(e){return Xd(e)?`styled.${e}`:`Styled(${Yd(e)})`}var Qd=Symbol.for(`react.memo`),$d=Symbol.for(`react.forward_ref`),ef={contextType:!0,defaultProps:!0,displayName:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,propTypes:!0,type:!0},tf={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},nf={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},rf={[$d]:{$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},[Qd]:nf};function af(e){return(`type`in(t=e)&&t.type.$$typeof)===Qd?nf:`$$typeof`in e?rf[e.$$typeof]:ef;var t}var of=Object.defineProperty,sf=Object.getOwnPropertyNames,cf=Object.getOwnPropertySymbols,lf=Object.getOwnPropertyDescriptor,uf=Object.getPrototypeOf,df=Object.prototype;function ff(e,t,n){if(typeof t!=`string`){let r=uf(t);r&&r!==df&&ff(e,r,n);let i=sf(t).concat(cf(t)),a=af(e),o=af(t);for(let r=0;rthis._cGroup)for(let n=this._cGroup;n=e;n--)t-=this.groupSizes[n];return this._cGroup=e,this._cIndex=t,t}insertRules(e,t){if(e>=this.groupSizes.length){let t=this.groupSizes,n=t.length,r=n;for(;e>=r;)if(r<<=1,r<0)throw kd(16,`${e}`);this.groupSizes=new Uint32Array(r),this.groupSizes.set(t),this.length=r;for(let e=n;e0&&this._cGroup>e&&(this._cIndex+=r)}clearGroup(e){if(e0&&this._cGroup>e&&(this._cIndex-=t)}}getGroup(e){let t=``;if(e>=this.length||this.groupSizes[e]===0)return t;let n=this.groupSizes[e],r=this.indexOfGroup(e),i=r+n;for(let e=r;etypeof ShadowRoot<`u`&&e instanceof ShadowRoot||`host`in e&&e.nodeType===11,Tf=e=>{if(!e)return document;if(wf(e))return e;if(`getRootNode`in e){let t=e.getRootNode();if(wf(t))return t}return document},Ef=(e,t,n)=>{let r=n.split(`,`),i;for(let n=0,a=r.length;n{let n=(t.textContent??``).split(Cd),r=[];for(let t=0,i=n.length;t{let t=Tf(e.options.target).querySelectorAll(Sf);for(let n=0,r=t.length;n{let n=document.head,r=e||n,i=document.createElement(`style`),a=(e=>{let t=Array.from(e.querySelectorAll(`style[${yd}]`));return t[t.length-1]})(r),o=a===void 0?null:a.nextSibling;i.setAttribute(yd,bd),i.setAttribute(xd,Sd);let s=t||Af();return s&&i.setAttribute(`nonce`,s),r.insertBefore(i,o),i},Mf=class{constructor(e,t){this.element=jf(e,t),this.element.appendChild(document.createTextNode(``)),this.sheet=(e=>{if(e.sheet)return e.sheet;let t=e.getRootNode().styleSheets??document.styleSheets;for(let n=0,r=t.length;n=0){let n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1}deleteRule(e){this.element.removeChild(this.nodes[e]),this.length--}getRule(e){return e(e=>{let t=e.getTag(),{length:n}=t,r=``;for(let i=0;i0&&(c+=e+`,`);r+=o+s+`{content:"`+c+`"}/*!sc*/ +`}return r})(this))}rehydrate(){!this.server&&wd&&Of(this)}reconstructWithOptions(t,n=!0){let r=new e(Object.assign(Object.assign({},this.options),t),this.gs,n&&this.names||void 0);return r.keyframeIds=new Set(this.keyframeIds),!this.server&&wd&&t.target!==this.options.target&&Tf(this.options.target)!==Tf(t.target)&&Of(r),r}allocateGSInstance(e){return this.gs[e]=(this.gs[e]||0)+1}getTag(){return this.tag||=(e=(({useCSSOMInjection:e,target:t,nonce:n})=>e?new Mf(t,n):new Nf(t,n))(this.options),new xf(e));var e}hasNameForId(e,t){var n,r;return(r=(n=this.names.get(e))==null?void 0:n.has(t))!=null&&r}registerName(e,t){Nd(e),e.startsWith(Dd)&&this.keyframeIds.add(e);let n=this.names.get(e);n?n.add(t):this.names.set(e,new Set([t]))}insertRules(e,t,n){this.registerName(e,t),this.getTag().insertRules(Nd(e),n)}clearNames(e){this.names.has(e)&&this.names.get(e).clear()}clearRules(e){this.getTag().clearGroup(Nd(e)),this.clearNames(e)}clearTag(){this.tag=void 0}},Lf=new WeakSet,Rf={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexShrink:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function zf(e,t){return t==null||typeof t==`boolean`||t===``?``:typeof t!=`number`||t===0||e in Rf||e.startsWith(`--`)?String(t).trim():t+`px`}var Bf=47;function Vf(e){if(e.charCodeAt(0)===45&&e.charCodeAt(1)===45)return e;let t=``;for(let n=0;n=65&&r<=90?`-`+String.fromCharCode(r+32):e[n]}return t.startsWith(`ms-`)?`-`+t:t}var Hf=Symbol.for(`sc-keyframes`);function Uf(e){return typeof e==`object`&&!!e&&Hf in e}function Wf(e){return pf(e)&&!(e.prototype&&e.prototype.isReactComponent)}var Gf=e=>e==null||!1===e||e===``,Kf=Symbol.for(`react.client.reference`);function qf(e){return e.$$typeof===Kf}function Jf(e,t){for(let n in e){let r=e[n];e.hasOwnProperty(n)&&!Gf(r)&&(Array.isArray(r)&&Lf.has(r)||pf(r)?t.push(Vf(n)+`:`,r,`;`):vf(r)?(t.push(n+` {`),Jf(r,t),t.push(`}`)):t.push(Vf(n)+`: `+zf(n,r)+`;`))}}function Yf(e,t,n,r,i=[]){if(Gf(e))return i;let a=typeof e;if(a===`string`)return i.push(e),i;if(a===`function`)return qf(e)?i:Wf(e)&&t?Yf(e(t),t,n,r,i):(i.push(e),i);if(Array.isArray(e)){for(let a=0;a>>0),this.dynamicNameCache.size>=200){let e=this.dynamicNameCache.keys().next().value;e!==void 0&&this.dynamicNameCache.delete(e)}this.dynamicNameCache.set(e,a)}if(!t.hasNameForId(this.componentId,a)){let e=n(i,`.`+a,void 0,this.componentId);t.insertRules(this.componentId,a,e)}r=gf(r,a)}}return r}},Qf=/&/g;function $f(e,t){let n=0;for(;--t>=0&&e.charCodeAt(t)===92;)n++;return!(1&~n)}function ep(e){let t=e.length,n=``,r=0,i=0,a=0,o=!1,s=!1;for(let c=0;ci.startsWith(r)&&i.endsWith(r)&&i.replaceAll(r,``).length>0?`.${n}`:e,o=t.slice();o.push(e=>{e.type===`rule`&&e.value.includes(`&`)&&(i||=RegExp(`\\${r}\\b`,`g`),e.props[0]=e.props[0].replace(Qf,r).replace(i,a))}),e.prefix&&o.push(vd),o.push(hd);let s=[],c=gd(o.concat(_d(e=>s.push(e)))),l=(t,a=``,o=``,l=`&`)=>{n=l,r=a,i=void 0;let u=function(e){let t=e.indexOf(`//`)!==-1,n=e.indexOf(`}`)!==-1;if(!t&&!n)return e;if(!t)return ep(e);let r=e.length,i=``,a=0,o=0,s=0,c=0,l=0,u=!1;for(;o0)o++;else if(t===42&&o+10&&c--,o++}else c++,o++}else o++}else s===0?s=t:s===t&&(s=0),o++}return u?(ae(t,r)&&n(t,r)}else d=e}let f=new Zf(n,l,r?i.componentStyle:void 0);function p(e,t){return function(e,t,n){let{attrs:r,componentStyle:i,defaultProps:a,foldedComponentIds:o,styledComponentId:s,target:c}=e,l=W.useContext(sp),u=op(),d=e.shouldForwardProp||u.shouldForwardProp,f=Rd(t,l,a)||Ld,p,m;{let e=W.useRef(null),n=e.current;if(n!==null&&n[1]===f&&n[2]===u.styleSheet&&n[3]===u.stylis&&n[7]===i&&function(e,t,n){let r=e,i=t,a=0;for(let e in i)if(cp.call(i,e)&&(a++,r[e]!==i[e]))return!1;return a===n}(n[0],t,n[4]))p=n[5],m=n[6];else{p=function(e,t,n){let r=Object.assign(Object.assign({},t),{className:void 0,theme:n}),i=e.length>1;for(let n=0;n`.${m.styledComponentId}`),a&&ff(m,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),m}var fp=new Set(`a.abbr.address.area.article.aside.audio.b.bdi.bdo.blockquote.body.button.br.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.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.main.map.mark.menu.meter.nav.object.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.slot.small.span.strong.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.u.ul.var.video.wbr.circle.clipPath.defs.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.foreignObject.g.image.line.linearGradient.marker.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.svg.switch.symbol.text.textPath.tspan.use`.split(`.`));function pp(e,t){let n=[e[0]];for(let r=0,i=t.length;r(Lf.add(e),e);function hp(e,...t){if(pf(e)||vf(e))return mp(Yf(pp(Id,[e,...t])));let n=e;return t.length===0&&n.length===1&&typeof n[0]==`string`?Yf(n):mp(Yf(pp(n,t)))}function gp(e,t,n=Ld){if(!t)throw kd(1,t);let r=(r,...i)=>e(t,n,hp(r,...i));return r.attrs=r=>gp(e,t,Object.assign(Object.assign({},n),{attrs:Array.prototype.concat(n.attrs,r).filter(Boolean)})),r.withConfig=r=>gp(e,t,Object.assign(Object.assign({},n),r)),r}var _p=e=>gp(dp,e),vp=_p;fp.forEach(e=>{vp[e]=_p(e)});var yp=class{constructor(e,t){this.instanceRules=new Map,this.rules=e,this.componentId=t,this.isStatic=function(e){for(let t=0;t{let t=op(),n=W.useContext(sp),a;{let e=W.useRef(null);e.current===null&&(e.current=t.styleSheet.allocateGSInstance(r)),a=e.current}t.styleSheet.server&&o(a,e,t.styleSheet,n,t.stylis);{let s=i.isStatic?[a,t.styleSheet,i]:[a,e,t.styleSheet,n,t.stylis,i],c=W.useRef(i);W.useLayoutEffect(()=>{t.styleSheet.server||(c.current!==i&&(t.styleSheet.clearRules(r),c.current=i),o(a,e,t.styleSheet,n,t.stylis))},s),W.useLayoutEffect(()=>()=>{t.styleSheet.server||i.removeStyles(a,t.styleSheet)},[a,t.styleSheet,i])}return t.styleSheet.server&&i.instanceRules.delete(a),null};function o(e,t,n,r,o){if(i.isStatic)i.renderStyles(e,Od,n,o);else{let s=Object.assign(Object.assign({},t),{theme:Rd(t,r,a.defaultProps)});i.renderStyles(e,s,n,o)}}return W.memo(a)}`${yd}`,`${yd}`,`${yd}`,G();function xp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function kp(e,t,n){return(t=Hp(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ap(e){return Ap=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ap(e)}function jp(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Rp(e,t)}function Mp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Mp=function(){return!!e})()}function Np(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Pp(){throw TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ip(e){for(var t=1;tn.right&&(n.right=s.right),s.bottom>n.bottom&&(n.bottom=s.bottom),s.left=0+c&&i>=0+c&&r<=o-c&&n<=a-c}function am(e){return e===document.querySelector(`body`)||e===document.querySelector(`html`)}var om=function(e){return/(left|right)/.test(e)},sm=function(e,t){return e>t},cm=function(e,t){return e>t},lm=function(e){return e<0?0:e};function um(e){return Object.keys(e).map(function(t){return{position:t,value:e[t]}}).sort(function(e,t){return t.value-e.value}).map(function(e){return e.position})}var dm,fm=vp.div(dm||=Bp([` + --reactour-accent: `,`; + `,` + position: fixed; + transition: transform 0.3s; + top: 0; + left: 0; + z-index: 1000000; + + transform: `,`; +`]),function(e){return e.accentColor},function(e){return e.defaultStyles?` + max-width: 331px; + min-width: 150px; + padding-right: 40px; + border-radius: ${e.rounded}px; + background-color: #fff; + padding: 24px 30px; + box-shadow: 0 0.5em 3em rgba(0, 0, 0, 0.3); + color: inherit; + `:``},function(e){var t=e.targetTop,n=e.targetRight,r=e.targetBottom,i=e.targetLeft,a=e.windowWidth,o=e.windowHeight,s=e.helperWidth,c=e.helperHeight,l=e.helperPosition,u=e.padding,d={left:i,right:a-n,top:t,bottom:o-r},f=function(e){return d[e]>(om(e)?s+u*2:c+u*2)},p=function(e){for(var t=um(d),n=0;nu?h:u,_=cm(t+c,o)?cm(r+u,o)?r-c:r-c+u:t-u,v=_>u?_:u,y={top:[g,t-c-u*2],right:[n+u*2,v],bottom:[g,r+u*2],left:[i-s-u*2,v],center:[a/2-s/2,o/2-c/2]};return e===`center`||f(e)?y[e]:p(y)}(l);return`translate(${Math.round(m[0])}px, ${Math.round(m[1])}px)`}),pm,mm=vp.span(pm||=Bp([` + 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(e){return e.accentColor}),hm,gm=vp.div(hm||=Bp([` + display: flex; + margin-top: 24px; + align-items: center; + justify-content: center; +`])),_m,vm=vp.nav(_m||=Bp([` + counter-reset: dot; + display: flex; + justify-content: center; + align-items: center; + flex-wrap: wrap; +`])),ym,bm=vp.button(ym||=Bp([` + 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(e){return e.current===e.index?`0`:`1px solid #caccce`},function(e){return e.disabled?`not-allowed`:`pointer`},function(e){return e.current===e.index?1.25:1},function(e){return e.current===e.index?`var(--reactour-accent)`:`#caccce`},function(e){return e.current===e.index?`var(--reactour-accent)`:`none`},function(e){return e.current===e.index?e.accentColor:`#caccce`},function(e){return e.current===e.index?e.accentColor:`none`},function(e){return e.showNumber?`block`:`none`}),xm,Sm=vp.div(xm||=Bp([` + opacity: `,`; + color: `,`; + width: 100%; + left: 0; + top: 0; + height: 100%; + position: fixed; + z-index: 99999; + pointer-events: none; +`]),function(e){return!e.maskClassName&&.7},function(e){return!e.maskClassName&&`#000`});function Cm(e){var t=e.windowWidth,n=e.windowHeight,r=e.targetWidth,i=e.targetHeight,a=e.targetTop,o=e.targetLeft,s=e.padding,c=e.rounded,l=e.roundedStep,u=e.disableInteraction,d=e.disableInteractionClassName,f=e.className,p=e.onClick,m=e.highlightedBorder,h=lm(r+s*2),g=lm(i+s*2),_=lm(a-s),v=lm(o-s),y=l?Math.min(h/2,g/2):c;return W.createElement(Sm,{onClick:p,maskClassName:f},W.createElement(`svg`,{width:t,height:n,xmlns:`http://www.w3.org/2000/svg`,className:f},W.createElement(`defs`,null,W.createElement(`mask`,{id:`mask-main`},W.createElement(`rect`,{x:0,y:0,width:t,height:n,fill:`white`}),W.createElement(`rect`,{x:v,y:_,width:h,height:g,fill:`black`}),W.createElement(`rect`,{x:v-1,y:_-1,width:y,height:y,fill:`white`}),W.createElement(`circle`,{cx:v+y,cy:_+y,r:y,fill:`black`}),W.createElement(`rect`,{x:v+h-y+1,y:_-1,width:y,height:y,fill:`white`}),W.createElement(`circle`,{cx:v+h-y,cy:_+y,r:y,fill:`black`}),W.createElement(`rect`,{x:v-1,y:_+g-y+1,width:y,height:y,fill:`white`}),W.createElement(`circle`,{cx:v+y,cy:_+g-y,r:y,fill:`black`}),W.createElement(`rect`,{x:v+h-y+1,y:_+g-y+1,width:y,height:y,fill:`white`}),W.createElement(`circle`,{cx:v+h-y,cy:_+g-y,r:y,fill:`black `})),W.createElement(`clipPath`,{id:`clip-path`},W.createElement(`rect`,{x:0,y:0,width:t,height:_}),W.createElement(`rect`,{x:0,y:_,width:v,height:g}),W.createElement(`rect`,{x:o+r+s,y:_,width:lm(t-r-v),height:g}),W.createElement(`rect`,{x:0,y:a+i+s,width:t,height:lm(n-i-_)}))),W.createElement(`rect`,{x:0,y:0,width:t,height:n,fill:`currentColor`,mask:`url(#mask-main)`}),W.createElement(`rect`,{x:0,y:0,width:t,height:n,fill:`currentColor`,clipPath:`url(#clip-path)`,pointerEvents:`auto`}),W.createElement(`rect`,{x:v,y:_,width:h,height:g,pointerEvents:`auto`,fill:`transparent`,display:u?`block`:`none`,className:d}),m&&W.createElement(`rect`,{x:lm(v+m.width/2),y:lm(_+m.width/2),width:lm(h-m.width),height:lm(g-m.width),pointerEvents:`auto`,fill:`none`,strokeWidth:m.width,stroke:m.color,rx:y-2})))}Cm.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 wm=(function(e){var t=e.step,n=e.refresh,r=zp(ze(0),2),i=r[0],a=r[1];return yt(function(){if(t.resizeObservables){var e=function(e){var n=Op(e),r;try{var o=function(){var e=r.value;if(!e.attributes)return 1;t.resizeObservables.find(function(t){return e.matches(t)||e.querySelector(t)!=null})&&a(i+1)};for(n.s();!(r=n.n()).done;)if(o())continue}catch(e){n.e(e)}finally{n.f()}},n=new MutationObserver(function(t){var n=Op(t),r;try{for(n.s();!(r=n.n()).done;){var i=r.value;i.addedNodes.length!==0&&e(i.addedNodes),i.removedNodes.length!==0&&e(i.removedNodes)}}catch(e){n.e(e)}finally{n.f()}}),r=document.documentElement||document.body;return n.observe(r,{childList:!0,subtree:!0}),function(){n.disconnect()}}},[t,i]),yt(function(){if(t.resizeObservables){var e=new ResizeObserver(function(e){n()}),r=Op(t.resizeObservables),i;try{for(r.s();!(i=r.n()).done;){var a=i.value,o=document.querySelector(a);o&&e.observe(o)}}catch(e){r.e(e)}finally{r.f()}return function(){e.disconnect()}}},[t,i]),null}),Tm=(function(e){var t=e.step,n=e.refresh;return yt(function(){if(t.mutationObservables){var e=function(e){var r=Op(e),i;try{var a=function(){var e=i.value;if(!e.attributes)return 1;t.mutationObservables.find(function(t){return e.matches(t)||e.querySelector(t)!=null})&&n()};for(r.s();!(i=r.n()).done;)if(a())continue}catch(e){r.e(e)}finally{r.f()}},r=new MutationObserver(function(t){var n=Op(t),r;try{for(n.s();!(r=n.n()).done;){var i=r.value;i.addedNodes.length!==0&&e(i.addedNodes),i.removedNodes.length!==0&&e(i.removedNodes)}}catch(e){n.e(e)}finally{n.f()}}),i=document.documentElement||document.body;return r.observe(i,{childList:!0,subtree:!0}),function(){r.disconnect()}}},[t]),null});function Em(e){var t=e.children,n=rn(null);return n.current===null&&(n.current=document.createElement(`div`),n.current.setAttribute(`id`,`___reactour`)),yt(function(){return document.body.appendChild(n.current),function(){document.body.removeChild(n.current)}},[n]),ke(t,n.current)}var Dm={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})},Om={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},km={mask:{base:`reactour__mask`,isOpen:`reactour__mask--is-open`,disableInteraction:`reactour__mask--disable-interaction`},helper:{base:`reactour__helper`,isOpen:`reactour__helper--is-open`},dot:{base:`reactour__dot`,active:`reactour__dot--is-active`}},Am=function(e){function t(){var e;return Tp(this,t),e=wp(this,t),kp(e,`unlockFocus`,function(t){e.setState({focusUnlocked:!0},t())}),kp(e,`showStep`,function(){if(!(!e.helper||!e.helper.current)){var t=e.props.steps,n=e.state,r=n.current;n.focusUnlocked&&e.setState({focusUnlocked:!1});var i=t[r],a=i.selector?document.querySelector(i.selector):null,o=function(t){i.action&&typeof i.action==`function`&&e.unlockFocus(function(){return i.action(t)})};if(i.observe){var s=document.querySelector(i.observe),c={attributes:!0,childList:!0,characterData:!0};e.setState(function(t){return t.observer&&setTimeout(function(){t.observer.disconnect()},0),{observer:new MutationObserver(function(t){t.forEach(function(t){if(t.type===`childList`&&t.addedNodes.length>0){var n=function(){return o(t.addedNodes[0])};setTimeout(function(){return e.calculateNode(t.addedNodes[0],i,n)},100)}else t.type===`childList`&&t.removedNodes.length>0&&e.calculateNode(a,i,function(){return o(a)})})})}},function(){return e.state.observer.observe(s,c)})}else e.state.observer&&(e.state.observer.disconnect(),e.setState({observer:null}));a?e.calculateNode(a,i,function(){return o(a)}):(e.setState(jm(null,i,e.helper.current),o),i.selector&&console.warn(`Doesn't find a DOM node '${i.selector}'. Please check the 'steps' Tour prop Array at position ${r}.`))}}),kp(e,`calculateNode`,function(t,n,r){var i=e.props,a=i.scrollDuration,o=i.inViewThreshold,s=i.scrollOffset,c=rm(t,n),l=Math.max(document.documentElement.clientWidth,window.innerWidth||0),u=Math.max(document.documentElement.clientHeight,window.innerHeight||0);if(im(Ip(Ip({},c),{},{w:l,h:u,threshold:o})))e.setState(jm(t,n,e.helper.current),r);else{var d=(0,Ps.default)(t),f=s||(c.height>u?-25:-(u/2)+c.height/2);Ns.default.to(t,{context:am(d)?window:d,duration:a,offset:f,callback:function(t){e.setState(jm(t,n,e.helper.current),r)}})}}),kp(e,`recalculateNode`,function(t){var n=document.querySelector(t.selector),r=function(n){t.action&&typeof t.action==`function`&&e.unlockFocus(function(){return t.action(n)})};e.calculateNode(n,t,function(){return r(n)})}),kp(e,`maskClickHandler`,function(t){var n=e.props,r=n.closeWithMask,i=n.onRequestClose;r&&!t.target.classList.contains(km.mask.disableInteraction)&&i(t)}),kp(e,`nextStep`,function(){var t=e.props,n=t.steps,r=t.getCurrentStep;e.setState(function(e){var t=e.current0?e.current-1:e.current;return typeof t==`function`&&t(n),{current:n}},e.showStep)}),kp(e,`gotoStep`,function(t){var n=e.props,r=n.steps,i=n.getCurrentStep;e.setState(function(e){var n=r[t]?t:e.current;return typeof i==`function`&&i(n),{current:n}},e.showStep)}),kp(e,`keyDownHandler`,function(t){var n=e.props,r=n.onRequestClose,i=n.nextStep,a=n.prevStep,o=n.disableKeyboardNavigation;if(t.stopPropagation(),o!==!0){var s,c,l;o&&(s=o.includes(`esc`),c=o.includes(`right`),l=o.includes(`left`)),t.keyCode===27&&!s&&(t.preventDefault(),r()),t.keyCode===39&&!c&&(t.preventDefault(),typeof i==`function`?i():e.nextStep()),t.keyCode===37&&!l&&(t.preventDefault(),typeof a==`function`?a():e.prevStep())}}),e.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},e.helper=zt(),e.helperElement=null,e.debouncedShowStep=(0,Fs.default)(e.showStep,70),e}return jp(t,e),Dp(t,[{key:`componentDidMount`,value:function(){var e=this.props,t=e.isOpen,n=e.startAt;t&&this.open(n)}},{key:`UNSAFE_componentWillReceiveProps`,value:function(e){var t=this.props,n=t.isOpen,r=t.update,i=t.updateDelay;!n&&e.isOpen?this.open(e.startAt):n&&!e.isOpen&&this.close(),n&&r!==e.update&&(e.steps[this.state.current]?setTimeout(this.showStep,i):this.props.onRequestClose()),n&&e.isOpen&&this.state.current!==e.goToStep&&this.gotoStep(e.goToStep)}},{key:`componentWillUnmount`,value:function(){this.props.isOpen&&this.close(),this.state.observer&&this.state.observer.disconnect()}},{key:`open`,value:function(e){var t=this,n=this.props.onAfterOpen;this.setState(function(t){return{isOpen:!0,current:e===void 0?t.current:e}},function(){setTimeout(t.showStep,1),t.helperElement=t.helper.current,t.props.disableFocusLock||t.helper.current.focus(),n&&n(t.helperElement)}),window.addEventListener(`resize`,this.debouncedShowStep,!1),window.addEventListener(`keydown`,this.keyDownHandler,!1)}},{key:`close`,value:function(){this.setState(function(e){return e.observer&&e.observer.disconnect(),{isOpen:!1,observer:null}},this.onBeforeClose),window.removeEventListener(`resize`,this.debouncedShowStep),window.removeEventListener(`keydown`,this.keyDownHandler)}},{key:`onBeforeClose`,value:function(){var e=this.props.onBeforeClose;e&&e(this.helperElement)}},{key:`render`,value:function(){var e=this,t=this.props,n=t.className,r=t.steps,i=t.maskClassName,a=t.showButtons,o=t.showCloseButton,s=t.closeButtonAriaLabel,c=t.showNavigation,l=t.showNavigationNumber,u=t.showNumber,d=t.onRequestClose,f=t.maskSpace,p=t.lastStepNextButton,m=t.nextButton,h=t.prevButton,g=t.badgeContent,_=t.highlightedMaskClassName,v=t.disableInteraction,y=t.disableDotsNavigation,b=t.nextStep,x=t.prevStep,S=t.rounded,C=t.accentColor,w=t.CustomHelper,T=t.disableFocusLock,E=t.highlightedBorder,D=this.state,O=D.isOpen,k=D.current,A=D.inDOM,j=D.top,M=D.right,ee=D.bottom,N=D.left,P=D.width,F=D.height,I=D.w,te=D.h,ne=D.helperWidth,re=D.helperHeight,ie=D.helperPosition;return O?W.createElement(Em,null,W.createElement(Gp,null),W.createElement(wm,{step:r[k],refresh:function(){return e.recalculateNode(r[k])}}),W.createElement(Tm,{step:r[k],refresh:function(){return e.recalculateNode(r[k])}}),W.createElement(Cm,{onClick:this.maskClickHandler,forwardRef:function(t){return e.mask=t},windowWidth:I,windowHeight:te,targetWidth:P,targetHeight:F,targetTop:j,targetLeft:N,padding:f,rounded:S,roundedStep:r[k].roundedStep,className:i,disableInteraction:r[k].stepInteraction===!1||v?!r[k].stepInteraction:v,disableInteractionClassName:`${km.mask.disableInteraction} ${_}`,highlightedBorder:E}),W.createElement(pu,{disabled:T,autoFocus:!1},W.createElement(fm,{ref:this.helper,targetHeight:F,targetWidth:P,targetTop:j,targetRight:M,targetBottom:ee,targetLeft:N,windowWidth:I,windowHeight:te,helperWidth:ne,helperHeight:re,helperPosition:ie,padding:f,tabIndex:-1,current:k,style:r[k].style?r[k].style:{},rounded:S,className:(0,Ms.default)(km.helper.base,n,kp({},km.helper.isOpen,O)),accentColor:C,defaultStyles:!w,role:`dialog`},w?W.createElement(w,{current:k,totalSteps:r.length,gotoStep:this.gotoStep,close:d,content:r[k]&&(typeof r[k].content==`function`?r[k].content({close:d,goTo:this.gotoStep,inDOM:A,step:k+1}):r[k].content)},this.props.children):W.createElement(W.Fragment,null,this.props.children,r[k]&&(typeof r[k].content==`function`?r[k].content({close:d,goTo:this.gotoStep,inDOM:A,step:k+1}):r[k].content),u&&W.createElement(mm,{"data-tour-elem":`badge`,accentColor:C},typeof g==`function`?g(k+1,r.length):k+1),(a||c)&&W.createElement(gm,{"data-tour-elem":`controls`},a&&W.createElement(Qp,{onClick:typeof x==`function`?x:this.prevStep,disabled:k===0,label:h||null}),c&&W.createElement(vm,{"data-tour-elem":`navigation`},r.map(function(t,n){return W.createElement(bm,{key:`${t.selector?t.selector:`undef`}_${n}`,onClick:function(){return e.gotoStep(n)},current:k,index:n,accentColor:C,disabled:k===n||y,showNumber:l,"data-tour-elem":`dot`,className:(0,Ms.default)(km.dot.base,kp({},km.dot.active,k===n)),"aria-label":t.navDotAriaLabel})})),a&&W.createElement(Qp,{onClick:k===r.length-1?p?d:function(){}:typeof b==`function`?b:this.nextStep,disabled:!p&&k===r.length-1,inverted:!0,label:p&&k===r.length-1?p:m||null})),o&&W.createElement(tm,{onClick:d,className:`reactour__close`,ariaLabel:s}))))):null}}])}(Ke),jm=function(e,t,n){if(n){var r=Math.max(document.documentElement.clientWidth,window.innerWidth||0),i=Math.max(document.documentElement.clientHeight,window.innerHeight||0),a=nm(n),o=a.width,s=a.height,c={top:i+10,right:r/2+9,bottom:i/2+9,left:r/2-o/2,width:0,height:0,w:r,h:i,helperPosition:`center`};return e&&(c=rm(e,t)),function(){return Ip(Ip({w:r,h:i,helperWidth:o,helperHeight:s,helperPosition:t.position},c),{},{inDOM:!!e})}}};Am.propTypes=Dm,Am.defaultProps=Om,``+new URL(`blockly2js-B3Jxf2e-.svg`,import.meta.url).href,``+new URL(`rules2js-DnYyR8mI.svg`,import.meta.url).href;var Mm=`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCAzMiIgd2lkdGg9IjY0IiBoZWlnaHQ9IjMyIj4KICA8cG9seWdvbiBwb2ludHM9IjgsMSA2MywxIDYzLDMxIDgsMzEgMSwxNiIgZmlsbD0iIzRhOTBkOSIgZmlsbC1vcGFjaXR5PSIwLjE1IiBzdHJva2U9IiM0YTkwZDkiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+CiAgPGNpcmNsZSBjeD0iMTAuNSIgY3k9IjE2IiByPSIyIiBmaWxsPSJub25lIiBzdHJva2U9IiM0YTkwZDkiIHN0cm9rZS13aWR0aD0iMS4yIi8+CiAgPHRleHQgeD0iMzciIHk9IjIxIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmb250LWZhbWlseT0iQXJpYWwsc2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgZm9udC13ZWlnaHQ9ImJvbGQiIGZpbGw9IiM0YTkwZDkiPk5hbWU8L3RleHQ+Cjwvc3ZnPgo=`,Nm=`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCAzMiIgd2lkdGg9IjY0IiBoZWlnaHQ9IjMyIj4KICA8cG9seWdvbiBwb2ludHM9IjgsMSA2MywxIDYzLDMxIDgsMzEgMSwxNiIgZmlsbD0iIzRhOTBkOSIgc3Ryb2tlPSIjNGE5MGQ5IiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgogIDxjaXJjbGUgY3g9IjEwLjUiIGN5PSIxNiIgcj0iMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjYThjZWYwIiBzdHJva2Utd2lkdGg9IjEuMiIvPgogIDx0ZXh0IHg9IjM3IiB5PSIxOCIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZm9udC1mYW1pbHk9IkFyaWFsLHNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGZvbnQtd2VpZ2h0PSJib2xkIiBmaWxsPSIjYThjZWYwIj5OYW1lPC90ZXh0PgogIDxjaXJjbGUgY3g9IjMwIiBjeT0iMjUiIHI9IjEuNSIgZmlsbD0iI2E4Y2VmMCIvPgogIDxjaXJjbGUgY3g9IjM3IiBjeT0iMjUiIHI9IjEuNSIgZmlsbD0iI2E4Y2VmMCIvPgogIDxjaXJjbGUgY3g9IjQ0IiBjeT0iMjUiIHI9IjEuNSIgZmlsbD0iI2E4Y2VmMCIvPgo8L3N2Zz4K`,Pm=`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCAzMiIgd2lkdGg9IjY0IiBoZWlnaHQ9IjMyIj4KICA8cG9seWdvbiBwb2ludHM9IjgsMSA2MywxIDYzLDMxIDgsMzEgMSwxNiIgZmlsbD0iI2U2N2UyMiIgZmlsbC1vcGFjaXR5PSIwLjE1IiBzdHJva2U9IiNlNjdlMjIiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+CiAgPGNpcmNsZSBjeD0iMTAuNSIgY3k9IjE2IiByPSIyIiBmaWxsPSJub25lIiBzdHJva2U9IiNlNjdlMjIiIHN0cm9rZS13aWR0aD0iMS4yIi8+CiAgPHRleHQgeD0iMzciIHk9IjIxIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmb250LWZhbWlseT0iQXJpYWwsc2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgZm9udC13ZWlnaHQ9ImJvbGQiIGZpbGw9IiNlNjdlMjIiPklEPC90ZXh0Pgo8L3N2Zz4K`,Fm=`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCAzMiIgd2lkdGg9IjY0IiBoZWlnaHQ9IjMyIj4KICA8cG9seWdvbiBwb2ludHM9IjgsMSA2MywxIDYzLDMxIDgsMzEgMSwxNiIgZmlsbD0iI2U2N2UyMiIgc3Ryb2tlPSIjZTY3ZTIyIiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgogIDxjaXJjbGUgY3g9IjEwLjUiIGN5PSIxNiIgcj0iMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZjVjMjhhIiBzdHJva2Utd2lkdGg9IjEuMiIvPgogIDx0ZXh0IHg9IjM3IiB5PSIxOCIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZm9udC1mYW1pbHk9IkFyaWFsLHNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGZvbnQtd2VpZ2h0PSJib2xkIiBmaWxsPSIjZjVjMjhhIj5JRDwvdGV4dD4KICA8Y2lyY2xlIGN4PSIzMCIgY3k9IjI1IiByPSIxLjUiIGZpbGw9IiNmNWMyOGEiLz4KICA8Y2lyY2xlIGN4PSIzNyIgY3k9IjI1IiByPSIxLjUiIGZpbGw9IiNmNWMyOGEiLz4KICA8Y2lyY2xlIGN4PSI0NCIgY3k9IjI1IiByPSIxLjUiIGZpbGw9IiNmNWMyOGEiLz4KPC9zdmc+Cg==`,Im={selectTriggers:0,addScheduleByDoubleClick:1,openTagsMenu:2,selectIntervalTag:3,selectActions:4,addActionPrintText:5,showJavascript:6,switchBackToRules:7,saveTheScript:8},Lm=[{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();var Rm=187,zm={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 Bm(){return B(`div`,{style:zm.root,children:[O(`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: ${Rm}; + } + 50% { + stroke-dashoffset: ${Rm/4}; + transform: rotate(135deg); + } + 100% { + stroke-dashoffset: ${Rm}; + transform: 'rotate(450deg); + } + } + @keyframes admin-connecting-rotator { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(270deg); + } + } +`}),O(`div`,{style:zm.connecting,children:O(`svg`,{style:zm.spinner,width:`100%`,height:`100%`,viewBox:`0 0 66 66`,xmlns:`http://www.w3.org/2000/svg`,children:O(`circle`,{style:zm.path,fill:`none`,strokeWidth:`6`,strokeLinecap:`round`,cx:`33`,cy:`33`,r:`30`})})})]})}function Vm(e){let t=[];for(let n of Object.keys(e)){let r=e[n];if((r==null?void 0:r.type)!==`script`)continue;let i=r.common;if(!(i!=null&&i.source))continue;let a;a=typeof i.name==`object`&&i.name?i.name.en||i.name.de||n:i.name||n,t.push({id:n,name:a,source:i.source,engineType:i.engineType||`Javascript/js`,enabled:i.enabled??!1})}return t}var Hm=[{regex:e=>RegExp(`getState\\s*\\(\\s*['"\`]${Um(e)}['"\`]`,`g`),type:`read`},{regex:e=>RegExp(`setState\\s*\\(\\s*['"\`]${Um(e)}['"\`]`,`g`),type:`write`},{regex:e=>RegExp(`setStateChanged\\s*\\(\\s*['"\`]${Um(e)}['"\`]`,`g`),type:`write`},{regex:e=>RegExp(`setStateDelayed\\s*\\(\\s*['"\`]${Um(e)}['"\`]`,`g`),type:`write`},{regex:e=>RegExp(`on\\s*\\(\\s*['"\`]${Um(e)}['"\`]`,`g`),type:`subscribe`},{regex:e=>RegExp(`on\\s*\\(\\s*\\{[^}]*id\\s*:\\s*['"\`]${Um(e)}['"\`]`,`g`),type:`subscribe`},{regex:e=>RegExp(`subscribe\\s*\\(\\s*['"\`]${Um(e)}['"\`]`,`g`),type:`subscribe`},{regex:e=>RegExp(`existsState\\s*\\(\\s*['"\`]${Um(e)}['"\`]`,`g`),type:`exists`},{regex:e=>RegExp(`existsObject\\s*\\(\\s*['"\`]${Um(e)}['"\`]`,`g`),type:`exists`},{regex:e=>RegExp(`=\\s*['"\`]${Um(e)}['"\`]`,`g`),type:`read`}];function Um(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Wm(e,t){let n=[];for(let i of e){if(!i.source.includes(t))continue;let e=i.source.split(` +`);for(let a of Hm){let o=a.regex(t),s;for(;(s=o.exec(i.source))!==null;){var r;let t=i.source.substring(0,s.index).split(` +`).length,o=((r=e[t-1])==null?void 0:r.trim())||``;if(!n.some(e=>e.scriptId===i.id&&e.lineNumber===t&&e.usageType===a.type)){let e;e=typeof i.name==`string`?i.name:i.id,n.push({scriptId:i.id,scriptName:e,usageType:a.type,lineNumber:t,line:o})}}}}return n}var Gm=2e5;function Km(e){let t=e.match(/\n\/\/((?:[A-Za-z0-9+/=]){50,})$/);if(t){let n=e.substring(0,e.length-t[0].length).trim();if(n&&!n.startsWith(`=0;e--){let t=n[e].trim();if(t.startsWith(`//`)&&t.length>200&&/^\/\/[A-Za-z0-9+/=%]+$/.test(t)){let t=n.slice(0,e).join(` +`).trim();if(t&&!t.startsWith(`([^<]+)<\/field>/gi,r=new Set,i;for(;(i=n.exec(e))!==null;)r.add(i[1]);r.size>0&&t.push(`Datapoints used: ${[...r].join(`, `)}`);let a=/([^<]+)<\/field>/gi,o=[],s;for(;(s=a.exec(e))!==null;)s[1].trim()&&o.push(`${s[1].trim()}`);o.length>0&&t.push(`Values/parameters: ${o.join(`, `)}`);let c=/0&&t.push(`Actions: ${[...new Set(d)].join(`, `)}`);let f=/]*>([^<]+)<\/comment>/gi,p=[],m;for(;(m=f.exec(e))!==null;)m[1].trim()&&p.push(m[1].trim());return p.length>0&&t.push(`Comments: ${p.join(`; `)}`),t.length>0?t.join(` +`):`No details could be extracted from the Blockly XML.`}function Jm(e,t=!1){if(e.length===0)return`No scripts found.`;let n=[`All scripts in this ioBroker installation: +`],r=0,i=!1;for(let a of e){let e=a.enabled?`active`:`inactive`,o=a.engineType===`Blockly`||a.engineType===`Rules`,s=a.engineType.includes(`TypeScript`),c=o?`Blockly`:s?`TS`:`JS`,l=`### ${a.id.replace(/^script\.js\./,``).replace(/\./g,`/`)} [${c}, ${e}] (${a.id})`,u;if(o){let e=Km(a.source);u=e?`${l}\nThis is a Blockly script. Compiled JavaScript:\n\`\`\`javascript\n${e}\n\`\`\`\n`:`${l}\nThis is a Blockly (visual programming) script. Extracted information:\n${qm(a.source)}\n`}else u=`${l}\n${`\`\`\`${s?`typescript`:`javascript`}\n${a.source}\n\`\`\``}\n`;!t&&r+u.length>Gm?(i=!0,n.push(`${l}\n(source too large to include)\n`)):(n.push(u),r+=u.length)}return i&&n.push(` +Note: Some script sources were omitted due to size. The user can ask about specific scripts by name.`),n.join(` +`)}var Ym=n({buildCodeLenses:()=>nh,computeFullSymbolRange:()=>Qm,findCodeLensSymbols:()=>eh,findLeadingCommentsStart:()=>Zm,findSymbolAtLine:()=>$m,findSymbolEndByBraces:()=>Xm,registerAiCodeLensProvider:()=>rh});function Xm(e,t,n){let r=0,i=!1;for(let n=t-1;n=0;){let t=e[r].trim();if(t===``){if(i>=1)break;i++,r--;continue}if(!(t.startsWith(`//`)||t.startsWith(`/*`)||t.startsWith(`*`)||t.endsWith(`*/`)))break;n=r+1,i=0,r--}return n}function Qm(e,t,n){let r=Xm(e,t,n);return{startLine:Zm(e,t),endLine:r}}function $m(e,t){let n=eh(e);if(!n.length)return null;let r=e.split(` +`),i=r.length;for(let e=0;e=s.startLine&&t<=s.endLine)return{startLine:s.startLine,endLine:s.endLine,symbol:a}}return null}function eh(e){if(!e)return[];let t=e.split(` +`),n=[],r=[{re:/^(?:export\s+)?(?:async\s+)?function\s+(\w+)/,kind:`function`},{re:/^(?:export\s+)?class\s+(\w+)/,kind:`class`},{re:/^(?:export\s+)?(?:const|let)\s+(\w+)\s*=\s*(?:async\s*)?(?:\([^)]*\)|\w+)\s*=>/,kind:`arrow`}];for(let e=0;e`Explain ${e} ${t}`,refactorTooltip:(e,t)=>`Refactor ${e} ${t}`,testsTooltip:(e,t)=>`Suggest tests for ${e} ${t}`};function nh(e,t,n=th){let r=eh(e);if(!r.length)return[];let i=e.split(` +`),a=i.length,o=[];for(let e=0;e{let[a,o,s]=i,c=t.getModel();if(!c)return;let l=Math.max(1,Math.min(Number(o),c.getLineCount())),u=Math.max(l,Math.min(Number(s),c.getLineCount())),d=new e.Range(l,1,u,c.getLineMaxColumn(u));n(a,c.getValueInRange(d),l===u?`line ${l}`:`lines ${l}-${u}`,l,u)},``);if(!r)return{dispose:()=>void 0};let i={explainTitle:`💡 ${V.t(`Explain`)}`,refactorTitle:`🔧 ${V.t(`Refactor`)}`,testsTitle:`✅ ${V.t(`Tests`)}`,explainTooltip:(e,t)=>V.t(`Explain %s %s`,e,t),refactorTooltip:(e,t)=>V.t(`Refactor %s %s`,e,t),testsTooltip:(e,t)=>V.t(`Suggest tests for %s %s`,e,t)},a=[];for(let t of[`javascript`,`typescript`]){let n=e.languages.registerCodeLensProvider(t,{provideCodeLenses:(t,n)=>{let a=nh(t.getValue(),r,i),o=[];for(let t of a)for(let n of t.commands)o.push({range:new e.Range(t.displayLine,1,t.displayLine,1),id:`${r}-${t.displayLine}-${n.title}`,command:{id:n.id,title:n.title,tooltip:n.tooltip,arguments:n.arguments}});return{lenses:o,dispose:()=>void 0}},resolveCodeLens:(e,t)=>t});a.push(n)}return{dispose(){a.forEach(e=>{try{e.dispose()}catch{}})}}}function ih(e,t,n){let r=0,i=!1;for(let n=t-1;nd&&(d=n,l=e,u=t)}if(l<0||dl+1&&!f[u-1];)u--;for(;le.trim()).filter(e=>e.length>0);return t.length!==0&&t.every(e=>e.startsWith(`//`)||e.startsWith(`/*`)||e.startsWith(`*`)||e.endsWith(`*/`))}function lh(e){let t=[],n=!1,r=null,i=0;for(let a=0;a0||o.length===0)&&(t.push({startLine:i,endLine:a}),n=!1,r=null):o.startsWith(`/*`)?(n=!0,r=`jsdoc`,i=a+1,o.includes(`*/`)&&(t.push({startLine:i,endLine:a+1}),n=!1,r=null)):o.startsWith(`//`)&&(n=!0,r=`line`,i=a+1)}return n&&i>0&&t.push({startLine:i,endLine:e.length}),t}function uh(e,t,n=.2){if(!ch(e)||!t)return null;let r=t.split(` +`),i=lh(r);if(!i.length)return null;let a=new Set;for(let t of e.split(` +`)){let e=t.trim().replace(/^\/\*+/,``).replace(/\*+\/$/,``).replace(/^\/\//,``).replace(/^\*+/,``).trim();e.length>=3&&a.add(e.toLowerCase())}if(a.size===0){if(i.length===1){let e=i[0],t=r[e.endLine-1]??``;return{range:{startLine:e.startLine,startColumn:1,endLine:e.endLine,endColumn:t.length+1},confidence:.5,method:`similarity`}}return null}let o=i[0],s=0;for(let e of i){let t=0;for(let n=e.startLine-1;ns&&(s=n,o=e)}if(so(()=>Promise.resolve().then(()=>qO),void 0,import.meta.url)),mh=W.lazy(()=>o(()=>import(`./RulesEditor-DwJ0UTnU.js`),__vite__mapDeps([0,1,2]),import.meta.url)),hh=W.lazy(()=>o(()=>import(`./Debugger-osayggsE.js`),__vite__mapDeps([3,4,5]),import.meta.url)),gh=W.lazy(()=>o(()=>import(`./ScriptEditorVanillaMonaco-BPeIEG64.js`).then(e=>e.n),__vite__mapDeps([5]),import.meta.url)),_h=W.lazy(()=>o(()=>import(`./ScriptEditor-DiCKl9d2.js`),__vite__mapDeps([6,5]),import.meta.url)),vh=W.lazy(()=>o(()=>import(`./AiChatPanel-AefbI3hv.js`),__vite__mapDeps([7]),import.meta.url)),yh=W.lazy(()=>o(()=>import(`./AiDiffView-DtbcD6Yx.js`),__vite__mapDeps([8]),import.meta.url)),bh={Blockly:jo,"Javascript/js":Ao,Rules:No,def:Ao,"TypeScript/ts":Mo},xh=48,Sh=`#02a102`,Ch=`#70aae9`,wh=xe[400],Th=T[400],Y={toolbar:e=>({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:e.palette.mode===`dark`?`#1e1e1e`:`#E2E2E2`}),toolbarButtons:{padding:4,marginLeft:4},toolbarButtonsDisabled:{filter:`grayscale(100%)`,opacity:.5},editorDiv:e=>({height:`calc(100% - ${(parseInt(e.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`},textIcon:{marginLeft:8},tabIcon:{width:24,height:24,verticalAlign:`middle`,marginBottom:2,marginRight:2,borderRadius:3},hintIcon:{padding:`0 8px 0 8px`},hintText:{},hintButton:{marginTop:8,marginLeft:20},tabMenuButton:{position:`absolute`,top:0,right:0},tabChanged:e=>({color:e.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}},Eh=class e extends W.Component{constructor(e){var t;super(e),N(this,`getSelect`,null),N(this,`changedMirror`,{}),N(this,`cron`,{initValue:null,callback:null}),N(this,`scriptDialog`,{initValue:null,callback:null,args:null,isReturn:!1}),N(this,`objects`,void 0),N(this,`scripts`,void 0),N(this,`selectId`,{initValue:null,callback:null}),N(this,`confirmCallback`,null),N(this,`blocklyEditorRef`,W.createRef()),N(this,`scriptEditorRef`,W.createRef()),N(this,`lastKnownTs`,{}),N(this,`onBrowserClose`,e=>{let t=Object.keys(this.scripts).find(e=>JSON.stringify(this.scripts[e])!==JSON.stringify(this.getScriptFromObject(e)));if(t){console.log(`Script ${JSON.stringify(this.scripts[t])}`);let n=V.t(`Configuration not saved.`);return e||=window.event,e&&(e.returnValue=n),n}}),N(this,`cachedScriptInfos`,null),N(this,`lastObjectsHash`,``),N(this,`setTourStep`,e=>this.setState({tourStep:e}));let n=window.localStorage.getItem(`Editor.selected`)||``,r=window.localStorage.getItem(`Editor.editing`)||`[]`,i;try{i=JSON.parse(r)}catch{i=[]}n&&!i.includes(n)&&i.push(n),n&&!this.props.password&&(t=this.props.objects[n])!=null&&(t=t.native)!=null&&t.protected&&(n=i.find(e=>{var t;return!((t=this.props.objects[e])!=null&&(t=t.native)!=null&&t.protected)})||``),!n&&i.length&&(n=this.props.password?i[0]:i.find(e=>{var t;return!((t=this.props.objects[e])!=null&&(t=t.native)!=null&&t.protected)})||``),this.state={askAboutDebug:!1,astroEvents:null,blockly:null,changed:{},cmdToBlockly:``,cmdToRules:``,confirm:``,debugEnabled:!1,editing:i,insert:``,instancesLoaded:!1,isTourOpen:window.localStorage.getItem(`tour`)!==`true`,menuDebugAnchorEl:null,menuOidDisplayAnchorEl:null,oidDisplayMode:parseInt(window.localStorage.getItem(`Blockly.FieldOID.displayMode`)||`0`,10)||0,oidShowIcon:window.localStorage.getItem(`Blockly.FieldOID.showIcon`)===`true`,menuOpened:!!this.props.menuOpened,menuTabsOpened:!1,aiChatOpen:window.localStorage.getItem(`Editor.aiChatOpen`)===`true`,aiDiffView:null,aiActionRequest:null,inlineAskHandler:null,aiCompletionsEnabled:window.localStorage.getItem(`Editor.aiCompletions`)!==`false`,triggerPrettier:1,scriptConflict:``,rules:null,runningInstances:this.props.runningInstances||{},searchText:``,selected:n,showAdapterDebug:!1,showAstro:!1,showCompiledCode:!1,showCron:!1,showDebugMenu:!1,showScript:!1,showSelectId:!1,themeType:this.props.themeType,toast:``,tourStep:Im.selectTriggers,verboseEnabled:!1,visible:e.visible},this.setChangedInAdmin(),window.systemLang=V.getLanguage(),window.main={objects:{},getObject:(e,t)=>this.props.socket.getObject(e).then(e=>t==null?void 0:t(null,e)).catch(e=>t==null?void 0:t(e)),getState:(e,t)=>this.props.socket.getState(e).then(e=>t==null?void 0:t(null,e)).catch(e=>t==null?void 0:t(e)),instances:[],secrets:[],selectIdDialog:(e,t,n)=>{typeof t==`function`&&(n=t,t=null),this.selectId.callback=n,this.selectId.initValue=e,this.selectId.type=t,this.setState({showSelectId:!0})},cronDialog:(e,t)=>{this.cron.callback=t,this.cron.initValue=e,this.setState({showCron:!0})},showScriptDialog:(e,t,n,r)=>{this.scriptDialog.callback=r,this.scriptDialog.initValue=e,this.scriptDialog.args=t,this.scriptDialog.isReturn=n||!1,this.setState({showScript:!0})}},this.objects=e.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(){let e=await this.props.socket.getAdapterInstances(!0),t={},n=e.map(e=>(t[e._id]=e,e._id));window.main.objects=t,window.main.instances=n,this.setState({instancesLoaded:!0})}static onInstanceChanged(e,t){if(e){if(!t&&window.main.instances.includes(e)){delete window.main.objects[e];let t=window.main.instances.indexOf(e);window.main.instances.splice(t,1)}else(t==null?void 0:t.type)===`instance`&&(window.main.instances.includes(e)||(window.main.instances.push(e),window.main.instances.sort()),window.main.objects[e]=t)}}setChangedInAdmin(){let e=Object.keys(this.state.changed).find(e=>this.state.changed[e]);Object.keys(this.state.changed).forEach(e=>{this.changedMirror[e]=this.state.changed[e]}),Object.keys(this.changedMirror).forEach(e=>{this.state.changed[e]===void 0&&delete this.changedMirror[e]}),this.props.onChangedChanged(this.changedMirror),window.parent!==void 0&&window.parent&&(window.parent.configNotSaved=!!e)}componentDidMount(){window.addEventListener(`beforeunload`,this.onBrowserClose,!1),this.props.socket.subscribeObject(`system.adapter.*`,e.onInstanceChanged),this.loadSecrets()}async loadSecrets(e){e||=this.state.runningInstances;let t=Object.keys(e).find(t=>e[t]);if(t)try{let e=await this.props.socket.sendTo(t.replace(`system.adapter.`,``),`getSecrets`,null);window.main.secrets=(e==null?void 0:e.secrets)||[]}catch(e){console.error(`Cannot read the credentials: ${e}`)}}componentWillUnmount(){window.removeEventListener(`beforeunload`,this.onBrowserClose),this.props.socket.unsubscribeObject(`system.adapter.*`,e.onInstanceChanged)}componentDidUpdate(e){if(e.scriptsHash!==this.props.scriptsHash)for(let e of this.state.editing){let t=this.props.objects[e];if(!t||t.type!==`script`)continue;let n=t.ts||0,r=this.lastKnownTs[e];r!==void 0&&n!==r&&(this.state.changed[e]?this.state.scriptConflict||this.setState({scriptConflict:e}):(this.scripts[e]=this.getScriptFromObject(e),this.lastKnownTs[e]=n))}}removeNonExistingScripts(e,t){e||=this.props,t||={};let n=!1;if(this.state.editing&&this.state.editing.find(t=>e&&!e.objects[t])){let e=[...this.state.editing];for(let t=e.length-1;t>=0;t--)this.objects[e[t]]||(n=!0,e.splice(t,1));n&&(t.editing=e),this.state.selected&&!this.objects[this.state.selected]&&(n=!0,t.selected=e[0]||``,t.selected&&this.scripts[t.selected]&&(this.state.blockly!==(this.scripts[t.selected].engineType===`Blockly`)&&(t.blockly=this.scripts[t.selected].engineType===`Blockly`,n=!0),this.state.rules!==(this.scripts[t.selected].engineType===`Rules`)&&(t.rules=this.scripts[t.selected].engineType===`Rules`,n=!0),this.state.verboseEnabled!==this.scripts[t.selected].verbose&&(t.verboseEnabled=this.scripts[t.selected].verbose,n=!0),this.state.debugEnabled!==this.scripts[t.selected].debug&&(t.debugEnabled=this.scripts[t.selected].debug,n=!0)))}return n}UNSAFE_componentWillReceiveProps(e){let t={},n=!1;if(JSON.stringify(e.runningInstances)!==JSON.stringify(this.state.runningInstances)&&(n=!0,t.runningInstances=e.runningInstances,this.loadSecrets(e.runningInstances)),this.state.menuOpened!==e.menuOpened&&(t.menuOpened=e.menuOpened,n=!0),this.state.themeType!==e.themeType&&(t.themeType=e.themeType,n=!0),this.removeNonExistingScripts(e,t)&&(n=!0),this.state.searchText!==e.searchText&&(t.searchText=e.searchText,n=!0),this.objects!==e.objects){this.objects=e.objects,window.main.objects=e.objects,Object.keys(this.scripts).forEach(e=>{let t=this.scripts[e].source;this.scripts[e]=JSON.parse(JSON.stringify(this.objects[e].common)),this.scripts[e].source=t}),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`)&&(t.blockly=this.scripts[this.state.selected].engineType===`Blockly`,n=!0),this.state.rules!==(this.scripts[this.state.selected].engineType===`Rules`)&&(t.rules=this.scripts[this.state.selected].engineType===`Rules`,n=!0),this.state.verboseEnabled!==this.scripts[this.state.selected].verbose&&(t.verboseEnabled=this.scripts[this.state.selected].verbose,n=!0),this.state.debugEnabled!==this.scripts[this.state.selected].debug&&(t.debugEnabled=this.scripts[this.state.selected].debug,n=!0));let r=[...this.state.editing];for(let e=r.length-1;e>=0;e--)this.objects[r[e]]||(n=!0,r.splice(e,1),this.state.changed[r[e]]!==void 0&&(t.changed||={...this.state.changed},t.changed&&delete t.changed[r[e]]));this.state.selected&&!this.objects[this.state.selected]&&(t.selected=r[0]||``),n&&(t.editing=r)}else for(let e in this.scripts){var r;if(Object.prototype.hasOwnProperty.call(this.scripts,e)){if((r=this.objects[e])!=null&&r.common){if(this.objects[e].type===`script`){let r=this.scripts[e].source,o=JSON.parse(JSON.stringify(this.scripts[e]));if(o.source=this.objects[e].common.source,JSON.stringify(o)!==JSON.stringify(this.objects[e].common)&&(this.scripts[e]=JSON.parse(JSON.stringify(this.objects[e].common)),this.scripts[e].source=r),r!==this.objects[e].common.source){if(this.state.changed[e]){var i;(i=this.objects[e].from)!=null&&i.startsWith(`system.adapter.javascript.`)&&(this.objects[e].from=`system.adapter.admin.0`,this.setState({toast:V.t(`Script %s was modified on disk.`,e.split(`.`).pop())}))}else{var a;this.props.password&&(a=this.objects[e].native)!=null&&a.protected?this.scripts[e].source=Qo(this.props.password,this.objects[e].common.source):this.scripts[e].source=this.objects[e].common.source}}else this.state.changed[e]&&(t.changed||={...this.state.changed},t.changed&&(t.changed[e]=!1),n=!0)}}else if(this.scripts[e]&&(delete this.scripts[e],this.state.selected===e)){if(this.state.editing.indexOf(e)!==-1){let r=[...this.state.editing],i=r.indexOf(e);i!==-1&&(r.splice(i,1),t.editing=r,n=!0)}t.selected=this.state.editing[0]||``,n=!0}}}if(e.selected&&this.state.selected!==e.selected){let r=this.getScriptFromObject(e.selected);this.scripts[e.selected]||=r;let i=r&&JSON.stringify(this.scripts[e.selected])!==JSON.stringify(r),a=[...this.state.editing];e.selected&&!a.includes(e.selected)&&(a.push(e.selected),this.props.onSelectedChange(e.selected,a),window.localStorage.setItem(`Editor.editing`,JSON.stringify(a))),n=!0,t.changed||={...this.state.changed},t.changed[e.selected]=!!i,t.editing=a,t.selected=e.selected,t.blockly=this.scripts[e.selected].engineType===`Blockly`,t.rules=this.scripts[e.selected].engineType===`Rules`,t.verboseEnabled=this.scripts[e.selected].verbose,t.debugEnabled=this.scripts[e.selected].debug,t.showCompiledCode=!1}this.state.visible!==e.visible&&(n=!0,t.visible=e.visible),n&&this.setState(t,()=>this.setChangedInAdmin())}onRestart(){var e,t;(e=(t=this.props).onRestart)==null||e.call(t,this.state.selected)}onStartStop(){var e,t,n;let r=JSON.parse(JSON.stringify(this.scripts[this.state.selected]));r.enabled=!r.enabled,this.props.password&&(e=this.props.objects[this.state.selected].native)!=null&&e.protected&&(r.source=Zo(this.props.password,r.source)),(t=(n=this.props).onChange)==null||t.call(n,this.state.selected,r)}onSave(){if(this.state.isTourOpen&&this.state.tourStep===Im.saveTheScript&&(this.setState({isTourOpen:!1}),window.localStorage.setItem(`tour`,`true`)),this.state.changed[this.state.selected]){let e={...this.state.changed};e[this.state.selected]=!1,this.setState({changed:e},()=>{var e,t,n;this.setChangedInAdmin();let r=JSON.parse(JSON.stringify(this.scripts[this.state.selected]));this.props.password&&(e=this.props.objects[this.state.selected].native)!=null&&e.protected&&(r.source=Zo(this.props.password,r.source)),(t=(n=this.props).onChange)==null||t.call(n,this.state.selected,r)})}}onSaveAll(){let e={...this.state.changed};Object.keys(e).forEach(t=>{if(e[t]){var n,r,i;e[t]=!1;let a=JSON.parse(JSON.stringify(this.scripts[t]));this.props.password&&(n=this.props.objects[t].native)!=null&&n.protected&&(a.source=Zo(this.props.password,a.source)),(r=(i=this.props).onChange)==null||r.call(i,t,a)}}),this.setState({changed:e},()=>this.setChangedInAdmin())}onCancel(){var e;this.scripts[this.state.selected]=this.getScriptFromObject(this.state.selected),this.lastKnownTs[this.state.selected]=((e=this.props.objects[this.state.selected])==null?void 0:e.ts)||0;let t={...this.state.changed};t[this.state.selected]=!1,this.setState({changed:t},()=>this.setChangedInAdmin())}onRegisterSelect(e){this.getSelect=e}handleAiAction(e){let t={aiActionRequest:e};this.state.aiChatOpen||(window.localStorage.setItem(`Editor.aiChatOpen`,`true`),t.aiChatOpen=!0),this.setState(t)}getEditorApi(){let e=()=>this.scriptEditorRef.current;return{getSelection:()=>{var t,n;return((t=e())==null||(n=t.getEditorSelection)==null?void 0:n.call(t))??null},getContent:()=>{var t,n;return((t=e())==null||(n=t.getEditorContent)==null?void 0:n.call(t))??``},getCursorPosition:()=>{var t,n;return((t=e())==null||(n=t.getCursorPosition)==null?void 0:n.call(t))??null},highlightText:t=>{var n,r;return((n=e())==null||(r=n.highlightText)==null?void 0:r.call(n,t))??0},highlightLineRange:(t,n)=>{var r,i;return((r=e())==null||(i=r.highlightLineRange)==null?void 0:i.call(r,t,n))??!1},goToLine:(t,n)=>{var r,i;return((r=e())==null||(i=r.goToLine)==null?void 0:i.call(r,t,n))??!1},insertTextAtCursor:t=>{let n=e();return n!=null&&n.insertTextIntoEditor?(n.insertTextIntoEditor(t),!0):!1},replaceSelection:t=>{var n,r;return((n=e())==null||(r=n.replaceSelection)==null?void 0:r.call(n,t))??!1},getDiagnostics:()=>{var t,n;return((t=e())==null||(n=t.getDiagnostics)==null?void 0:n.call(t))??[]},getSymbols:async()=>{var t,n;return((t=e())==null||(n=t.getDocumentSymbols)==null?void 0:n.call(t))??[]}}}onConvertBlockly2JS(){this.showConfirmDialog(V.t(`It will not be possible to revert this operation.`),e=>{if(e){this.scripts[this.state.selected].engineType=`Javascript/js`;let e=this.scripts[this.state.selected].source.split(` +`);e.pop(),this.scripts[this.state.selected].source=e.join(` +`);let t=this.state.selected,n={...this.state.changed};n[this.state.selected]=!0,this.setState({changed:n,blockly:!1,selected:``},()=>{this.setChangedInAdmin(),setTimeout(()=>this.setState({selected:t}),100)})}})}onChange(e){if(e.script!==void 0){if(e.script===this.scripts[this.state.selected].source)return;this.scripts[this.state.selected].source=e.script}e.debug!==void 0&&(this.scripts[this.state.selected].debug=e.debug),e.verbose!==void 0&&(this.scripts[this.state.selected].verbose=e.verbose);let t=JSON.stringify(this.scripts[this.state.selected])!==JSON.stringify(this.getScriptFromObject(this.state.selected));if(t!==!!this.state.changed[this.state.selected]){let e={...this.state.changed};e[this.state.selected]=t,this.objects[this.state.selected].from=`system.adapter.admin.0`,this.setState({changed:e},()=>this.setChangedInAdmin())}}onTabChange(e){var t,n;if(this.props.debugMode)return;window.localStorage.setItem(`Editor.selected`,e);let r=this.scripts[e]||this.getScriptFromObject(e);this.scripts[e]||(this.scripts[e]=r),this.lastKnownTs[e]===void 0&&this.props.objects[e]&&(this.lastKnownTs[e]=this.props.objects[e].ts||0),this.setState({selected:e,rules:r.engineType===`Rules`,blockly:r.engineType===`Blockly`,showCompiledCode:!1,verboseEnabled:r.verbose,debugEnabled:r.debug}),(t=(n=this.props).onSelectedChange)==null||t.call(n,e,this.state.editing)}isScriptChanged(e){return!!(this.scripts[e]&&this.props.objects[e]&&JSON.stringify(this.scripts[e])!==JSON.stringify(this.getScriptFromObject(e)))}onTabClose(e,t){t==null||t.stopPropagation();let n=this.state.editing.indexOf(e);if(this.state.editing.includes(e)){if(this.isScriptChanged(e))this.showConfirmDialog(V.t(`Discard changes for %s`,this.props.objects[e].common.name),t=>{t&&(delete this.scripts[e],delete this.lastKnownTs[e],this.onTabClose(e))});else{let t=[...this.state.editing];t.splice(n,1);let r={editing:t};if(e===this.state.selected?r.selected=t.length?n===0||t.length===1?t[0]:t[n-1]:``:this.state.selected&&!t.length&&(r.selected=``),window.localStorage.setItem(`Editor.editing`,JSON.stringify(t)),r.selected!==void 0){r.changed||={...this.state.changed},r.changed[r.selected]=this.isScriptChanged(r.selected);let e=r.selected?this.scripts[r.selected]||this.getScriptFromObject(r.selected):void 0;r.blockly=(e==null?void 0:e.engineType)===`Blockly`,r.rules=(e==null?void 0:e.engineType)===`Rules`,r.verboseEnabled=!!(e!=null&&e.verbose),r.debugEnabled=!!(e!=null&&e.debug),r.showCompiledCode=!1}this.setState(r,()=>{if(this.setChangedInAdmin(),r.selected!==void 0){var e,t;(e=(t=this.props).onSelectedChange)==null||e.call(t,r.selected,this.state.editing),window.localStorage.setItem(`Editor.selected`,r.selected)}else{var n,i;(n=(i=this.props).onSelectedChange)==null||n.call(i,this.state.selected,this.state.editing)}})}}}showConfirmDialog(e,t){this.confirmCallback=t,this.setState({confirm:e})}sendCommandToBlockly(e){this.setState({cmdToBlockly:e},()=>setTimeout(()=>this.setState({cmdToBlockly:``}),200))}sendCommandToRules(e){this.setState({cmdToRules:e},()=>setTimeout(()=>this.setState({cmdToRules:``}),200))}static getText(e){return typeof e==`object`?e[V.getLanguage()]||e.en:e}getScriptFullName(t){let n=t.split(`.`);n.shift(),n.shift();let r=[],i=`script.js`;for(let t=0;tthis.onTabChange(t),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(t=>{var n,r;if(!this.props.objects[t]){let e=[O(Se,{sx:this.isScriptChanged(t)?Y.tabChanged:void 0,style:Y.tabText,children:t.split(`.`).pop()},`text`),O(U,{onClick:e=>this.onTabClose(t,e),style:Y.closeButton,size:`small`,component:`span`,children:O(ne,{})},`icon`)];return O(oe,{wrapped:!0,href:`#${t}`,label:e,value:t,sx:{"& .MuiTab-wrapper":Y.tabButtonWrapper}},t)}if(!this.props.password&&(n=this.props.objects[t].native)!=null&&n.protected)return null;let i=e.getText(this.props.objects[t].common.name)||``,a=this.getScriptFullName(t);i.length>18&&(i=`${i.substring(0,15)}...`);let o=(r=this.getScriptFromObject(t))==null?void 0:r.source,s=this.scripts[t]&&o!==this.scripts[t].source,c=[O(Se,{sx:this.isScriptChanged(t)?Y.tabChanged:void 0,style:Y.tabText,children:i},`text`),s?O(`span`,{style:Y.tabChangedIcon,children:`▣`},`changedSign`):null,!this.props.debugInstance&&(!this.props.debugMode||this.state.selected!==t)&&O(U,{onClick:e=>this.onTabClose(t,e),style:Y.closeButton,size:`small`,component:`span`,children:O(ne,{})},`icon`)];return O(oe,{disabled:!!this.props.debugInstance||this.state.selected!==t&&this.props.debugMode,wrapped:!0,iconPosition:`start`,icon:O(`img`,{alt:``,src:bh[this.props.objects[t].common.engineType]||bh.def,style:Y.tabIcon},`icon`),href:`#${t}`,label:c,style:Y.tabButton,value:t,title:a,sx:{"& .MuiTab-wrapper":Y.tabButtonWrapper}},t)}),this.props.debugInstance?O(oe,{disabled:!1,wrapped:!0,href:`#${this.props.debugInstance.adapter}`,label:this.props.debugInstance.adapter,style:Y.tabButton,value:this.props.debugInstance.adapter,title:this.props.debugInstance.adapter,sx:{"& .MuiTab-wrapper":Y.tabButtonWrapper}},this.props.debugInstance.adapter):``]},`tabs1`),this.state.editing.length>1?O(U,{href:`#`,"aria-label":`Close all but current`,style:Y.tabMenuButton,title:V.t(`Close all but current`),"aria-haspopup":`false`,onClick:e=>{let t=[this.state.selected];Object.keys(this.scripts).forEach(e=>e!==this.state.selected&&JSON.stringify(this.scripts[e])!==JSON.stringify(this.getScriptFromObject(e))&&t.push(e)),window.localStorage.setItem(`Editor.editing`,JSON.stringify(t)),this.setState({menuTabsOpened:!1,editing:t})},size:`medium`,children:O(F,{})},`menuButton`):null]:O(Se,{sx:Y.toolbar,children:B(R,{color:`grey`,disabled:!0,style:Y.hintButton,href:``,children:[O(`span`,{children:V.t(`Click on this icon`)},`select2`),O(be,{style:Y.hintIcon},`select3`),O(`span`,{children:V.t(`for edit or create script`)},`select4`)]},`select1`)},`tabs2`)}getDebugMenu(){return this.state.showDebugMenu?B(_e,{id:`menu-debug`,anchorEl:this.state.menuDebugAnchorEl,open:this.state.showDebugMenu,onClose:()=>this.setState({showDebugMenu:!1,menuDebugAnchorEl:null}),slotProps:{root:{style:{maxHeight:xh*7.5}}},children:[B(y,{title:V.t(`debug_help`),onClick:e=>{e.stopPropagation(),e.preventDefault(),this.setState({showDebugMenu:!1,menuDebugAnchorEl:null,debugEnabled:!this.state.debugEnabled},()=>this.onChange({debug:this.state.debugEnabled}))},children:[O(De,{checked:this.state.debugEnabled}),O(ae,{style:{...Y.menuIcon,color:Sh}}),V.t(`debug_label`)]},`debugEnabled`),B(y,{title:V.t(`verbose_help`),onClick:e=>{e.stopPropagation(),e.preventDefault(),this.setState({showDebugMenu:!1,menuDebugAnchorEl:null,verboseEnabled:!this.state.verboseEnabled},()=>this.onChange({verbose:this.state.verboseEnabled}))},children:[O(De,{checked:this.state.verboseEnabled}),O(S,{style:{...Y.menuIcon,color:Ch}}),V.t(`verbose_label`)]},`verboseEnabled`)]},`menuDebug`):null}getDebugBadge(){return[this.state.debugEnabled&&this.state.verboseEnabled?O(ae,{style:{...Y.menuIcon,color:Ch}},`DebugVerbose`):null,this.state.debugEnabled&&!this.state.verboseEnabled?O(ae,{style:{...Y.menuIcon,color:Sh}},`DebugNoVerbose`):null,!this.state.debugEnabled&&this.state.verboseEnabled?O(S,{style:{...Y.menuIcon,color:Ch}},`noDebugVerbose`):null]}getAskAboutDebug(){return this.state.askAboutDebug?O(Bt,{onClose:()=>{this.setState({askAboutDebug:!1},()=>this.props.onDebugModeChange(!0))},ok:V.t(`Yes`),cancel:V.t(`Cancel`),text:V.t(`The script will be stopped and must be activated manually after debugging. Continue?`)}):null}getToolbar(){var e,t;let n=!!(this.state.selected&&(e=this.scripts[this.state.selected])!=null&&e.engine&&this.state.runningInstances[this.scripts[this.state.selected].engine]),r=!!(this.state.selected&&(t=this.scripts[this.state.selected])!=null&&t.enabled);if(this.state.selected){let e=Object.keys(this.state.changed).filter(e=>this.state.changed[e]).length,t=this.state.changed[this.state.selected];return B(fe,{variant:`dense`,sx:Y.toolbar,children:[!this.props.debugInstance&&this.state.menuOpened&&this.props.onLocate&&O(U,{style:Y.toolbarButtons,title:V.t(`Locate file`),onClick:()=>this.props.onLocate(this.state.selected),size:`medium`,children:O(d,{})},`locate`),!this.props.debugInstance&&!t&&n?O(U,{disabled:this.props.debugMode,style:Y.toolbarButtons,onClick:()=>this.onRestart(),title:V.t(`Restart`),size:`medium`,children:O(jt,{})},`restart`):null,!this.props.debugInstance&&!t?O(U,{disabled:this.props.debugMode,onClick:()=>this.onStartStop(),title:r?V.t(`Pause script`):V.t(`Run script`),size:`medium`,style:{...Y.toolbarButtons,color:r?wh:Th},children:O(r?ve:Ce,{})},`start-stop`):null,!this.props.debugInstance&&!t&&!r?O(`span`,{style:Y.notRunning,children:V.t(`Script is not running`)}):null,!t&&r&&!n?O(`span`,{style:Y.notRunning,children:V.t(`Instance is disabled`)}):null,t?O(R,{color:`grey`,variant:`contained`,style:{...Y.textButton,...Y.saveButton},className:`button-save`,onClick:()=>this.onSave(),endIcon:O(D,{}),children:V.t(`Save`)},`save`):null,e>1||e===1&&!t?O(R,{color:`grey`,variant:`contained`,style:Y.textButton,onClick:()=>this.onSaveAll(),endIcon:O(D,{}),children:V.t(`Save all`)},`saveall`):null,t?O(R,{color:`grey`,variant:`contained`,style:Y.textButton,onClick:()=>this.onCancel(),endIcon:O(l,{}),children:V.t(`Cancel`)},`cancel`):null,!this.state.showCompiledCode&&!this.state.rules?O(U,{title:V.t(`Undo`),style:Y.toolbarButtons,onClick:()=>{if(this.state.blockly){var e;let t=(e=this.blocklyEditorRef.current)==null?void 0:e.blocklyWorkspace;t==null||t.undo(!1)}else{var t;(t=this.scriptEditorRef.current)==null||t.undo()}},size:`medium`,children:O(Ee,{})},`undo`):null,!this.state.showCompiledCode&&!this.state.rules?O(U,{title:V.t(`Redo`),style:Y.toolbarButtons,onClick:()=>{if(this.state.blockly){var e;let t=(e=this.blocklyEditorRef.current)==null?void 0:e.blocklyWorkspace;t==null||t.undo(!0)}else{var t;(t=this.scriptEditorRef.current)==null||t.redo()}},size:`medium`,children:O(A,{})},`redo`):null,O(`div`,{style:{flex:2}}),this.state.blockly&&!this.state.showCompiledCode&&O(U,{"aria-label":`OID display mode`,title:V.t(`OID display mode`),style:Y.toolbarButtons,onClick:e=>this.setState({menuOidDisplayAnchorEl:e.currentTarget}),size:`medium`,children:O(`img`,{src:fh[this.state.oidDisplayMode]||fh[0],alt:`OID`,width:36,height:22})},`oid-display-mode`),B(_e,{anchorEl:this.state.menuOidDisplayAnchorEl,open:!!this.state.menuOidDisplayAnchorEl,onClose:()=>this.setState({menuOidDisplayAnchorEl:null}),children:[fh.map((e,t)=>B(y,{selected:this.state.oidDisplayMode===t,onClick:()=>{var e,n;this.setState({oidDisplayMode:t,menuOidDisplayAnchorEl:null});let r=(e=window.scripts)==null?void 0:e.blocklyWorkspace;r&&(n=window.Blockly)!=null&&(n=n.FieldOID)!=null&&n.setDisplayMode&&window.Blockly.FieldOID.setDisplayMode(t,r)},children:[O(`img`,{src:e,alt:``,width:48,height:28,style:{marginRight:8}}),(()=>{var e,n,r;let i=(e=window.Blockly)==null||(e=e.FieldOID)==null||(e=e.DISPLAY_MODE_KEYS)==null?void 0:e[t];return i&&(((n=window.Blockly)==null||(n=n.Words)==null||(n=n[i])==null?void 0:n[V.getLanguage()])||((r=window.Blockly)==null||(r=r.Words)==null||(r=r[i])==null?void 0:r.en))||[`Show name`,`Show name path`,`Show ID`,`Show full ID`][t]})()]},`oid-mode-${t}`)),O(Fe,{}),B(y,{onClick:()=>{var e,t;let n=!this.state.oidShowIcon;this.setState({oidShowIcon:n});let r=(e=window.scripts)==null?void 0:e.blocklyWorkspace;r&&(t=window.Blockly)!=null&&(t=t.FieldOID)!=null&&t.setShowIcon&&window.Blockly.FieldOID.setShowIcon(n,r)},children:[O(De,{checked:this.state.oidShowIcon,style:{padding:0,marginRight:8}}),(()=>{var e,t;let n=`oid_show_icon`;return((e=window.Blockly)==null||(e=e.Words)==null||(e=e[n])==null?void 0:e[V.getLanguage()])||((t=window.Blockly)==null||(t=t.Words)==null||(t=t[n])==null?void 0:t.en)||`Show icon`})()]},`oid-show-icon`)]},`menuOidDisplay`),!this.props.debugInstance&&!this.state.showCompiledCode&&O(U,{style:Y.toolbarButtons,title:V.t(`Prettify the script`),onClick:()=>this.setState({triggerPrettier:this.state.triggerPrettier+1}),size:`medium`,children:O(se,{})},`prettier`),this.state.blockly&&!this.state.showCompiledCode?O(U,{"aria-label":`Export Blocks`,title:V.t(`Export blocks`),style:Y.toolbarButtons,onClick:()=>this.sendCommandToBlockly(`export`),size:`medium`,children:O(Ct,{})},`export`):null,this.state.blockly&&!this.state.showCompiledCode&&O(U,{"aria-label":`Import Blocks`,title:V.t(`Import blocks`),style:Y.toolbarButtons,onClick:()=>this.sendCommandToBlockly(`import`),size:`medium`,children:O(Lt,{})},`import`),this.state.blockly&&!this.state.showCompiledCode&&O(U,{"aria-label":`Check code`,title:V.t(`Check blocks`),style:Y.toolbarButtons,onClick:()=>this.sendCommandToBlockly(`check`),size:`medium`,children:O(ct,{})},`check`),!this.props.debugMode&&!this.state.blockly&&!this.state.rules&&!this.state.showCompiledCode?O(U,{"aria-label":`create CRON`,title:V.t(`Create or edit CRON or time wizard`),style:Y.toolbarButtons,onClick:()=>this.setState({showCron:!0}),size:`medium`,children:O(Ht,{})},`select-cron`):null,this.scripts[this.state.selected]&&this.scripts[this.state.selected].engineType!==`Rules`?O(Mt,{children:O(U,{"aria-label":`AI`,title:V.t(`AI Chat`),style:{...Y.toolbarButtons,...this.state.aiChatOpen?{color:`#4caf50`}:{}},size:`medium`,onClick:()=>{let e=!this.state.aiChatOpen;window.localStorage.setItem(`Editor.aiChatOpen`,String(e)),this.setState({aiChatOpen:e})},children:O(v,{})},`ai`)}):null,O(U,{"aria-label":`Show astronomical events`,title:V.t(`Show astronomical events`),style:Y.toolbarButtons,disabled:!n,onClick:()=>{this.setState({showAstro:!0,astroEvents:null}),this.props.socket.sendTo(this.scripts[this.state.selected].engine.replace(`system.adapter.`,``),`calcAstroAll`,{}).then(e=>this.setState({astroEvents:e}))},size:`medium`,children:O(h,{})},`show-astro`),!this.props.debugMode&&!this.state.blockly&&!this.state.rules&&!this.state.showCompiledCode&&O(U,{"aria-label":`select ID`,title:V.t(`Insert object ID`),style:Y.toolbarButtons,onClick:()=>this.setState({showSelectId:!0}),size:`medium`,children:O(Je,{})},`select-id`),this.state.blockly&&!this.state.rules&&this.state.showCompiledCode&&O(R,{color:`grey`,"aria-label":`convert to javascript`,title:V.t(`Convert blockly to javascript for ever.`),onClick:()=>this.onConvertBlockly2JS(),children:`Blockly=>JS`},`convert2js`),this.state.rules&&!this.state.showCompiledCode&&O(U,{"aria-label":`Export Blocks`,title:V.t(`Export blocks`),style:Y.toolbarButtons,onClick:()=>this.sendCommandToRules(`export`),size:`medium`,children:O(Ct,{})},`export`),this.state.rules&&!this.state.showCompiledCode&&O(U,{"aria-label":`Import Blocks`,title:V.t(`Import blocks`),style:Y.toolbarButtons,onClick:()=>this.sendCommandToRules(`import`),size:`medium`,children:O(Lt,{})},`import`),this.props.expertMode&&!t&&(this.props.debugMode||!this.state.blockly&&!this.state.rules||(this.state.blockly||this.state.rules)&&this.state.showCompiledCode)&&O(U,{style:Y.toolbarButtons,color:this.props.debugMode?`primary`:`default`,disabled:!this.props.debugMode&&!n,onClick:()=>{!this.props.debugMode&&r?this.setState({askAboutDebug:!0}):this.props.onDebugModeChange(!this.props.debugMode)},size:`medium`,children:O(ae,{style:{fontSize:32}})}),(this.state.blockly||this.state.rules)&&O(R,{"aria-label":`blockly`,title:V.t(`Show javascript code`),className:`button-js-code`,color:this.state.showCompiledCode?`secondary`:`inherit`,disabled:this.props.debugMode,style:{...Y.toolbarButtons,...this.props.debugMode?Y.toolbarButtonsDisabled:void 0,padding:`0 5px`},onClick:()=>{this.props.debugMode||(this.setState({showCompiledCode:!this.state.showCompiledCode}),this.state.isTourOpen&&this.state.tourStep===Im.showJavascript&&this.setState({tourStep:Im.switchBackToRules}),this.state.isTourOpen&&this.state.tourStep===Im.switchBackToRules&&this.setState({tourStep:Im.saveTheScript}))},children:O(`img`,{alt:this.state.blockly?`blockly2js`:`rules2js`,src:this.state.blockly?``+new URL(`blockly2js-B3Jxf2e-.svg`,import.meta.url).href:``+new URL(`rules2js-DnYyR8mI.svg`,import.meta.url).href})},`blockly-code`),O(U,{disabled:this.props.debugMode,"aria-label":`Debug menu`,title:V.t(`Debug options`),style:Y.toolbarButtons,onClick:e=>this.setState({showDebugMenu:!0,menuDebugAnchorEl:e.currentTarget}),size:`medium`,children:O(E,{style:Y.badgeMargin,badgeContent:this.getDebugBadge(),children:O(ft,{})})},`debug`)]},`toolbar1`)}return null}getScriptInfos(){let e=Object.keys(this.props.objects).join(`,`);return this.cachedScriptInfos&&this.lastObjectsHash===e?this.cachedScriptInfos:(this.lastObjectsHash=e,this.cachedScriptInfos=Vm(this.props.objects),this.cachedScriptInfos)}getScriptEditor(){if(!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);let n=this.scripts[this.state.selected].engineType===`TypeScript/ts`?`typescript`:`javascript`,r=O(he,{fallback:O(Bm,{}),children:O(gh,{ref:this.scriptEditorRef,name:this.state.selected,adapterName:this.props.adapterName,insert:this.state.insert,onInserted:()=>this.setState({insert:``}),onForceSave:()=>this.onSave(),searchText:this.state.searchText,onRegisterSelect:e=>this.onRegisterSelect(e),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:e=>this.onChange({script:e}),language:n,aiCompletionsEnabled:this.state.aiCompletionsEnabled,onAiAction:e=>this.handleAiAction(e),onInlineAsk:this.state.inlineAskHandler?e=>this.state.inlineAskHandler(e.question,e.selectedCode):void 0},`scriptEditor1`)});if(this.state.aiDiffView)return O(Se,{sx:Y.editorDiv,children:O(he,{fallback:O(Bm,{}),children:O(yh,{originalCode:this.state.aiDiffView.original,modifiedCode:this.state.aiDiffView.modified,language:n,themeType:this.state.themeType,onAccept:e=>{this.onChange({script:e}),this.setState({aiDiffView:null})},onReject:()=>this.setState({aiDiffView:null})})})},`scriptEditorDiv`);if(this.state.aiChatOpen){var e,t;let i=window.localStorage.getItem(`Editor.aiChatSizes`),a=[70,30];try{i&&(a=JSON.parse(i))}catch{}return O(Se,{sx:Y.editorDiv,children:B(kn,{direction:wn.Horizontal,initialSizes:a,minWidths:[200,250],gutterClassName:this.state.themeType===`dark`?`Dark visGutter`:`Light visGutter`,onResizeFinished:(e,t)=>{window.localStorage.setItem(`Editor.aiChatSizes`,JSON.stringify(t))},children:[r,O(he,{fallback:O(Bm,{}),children:O(vh,{socket:this.props.socket,runningInstances:this.state.runningInstances,themeType:this.state.themeType,currentCode:((e=this.scripts[this.state.selected])==null?void 0:e.source)||``,currentLanguage:n,selectedCode:((t=this.getSelect)==null?void 0:t.call(this))||``,allScripts:this.getScriptInfos(),editorApi:this.getEditorApi(),aiActionRequest:this.state.aiActionRequest,onAiActionConsumed:()=>this.setState({aiActionRequest:null}),onRegisterInlineAsk:e=>this.setState({inlineAskHandler:e}),currentScriptId:this.state.selected,onInsertCode:e=>this.setState({insert:e}),onShowDiff:(e,t)=>{var n;let r=this.state.selected,i=((n=this.scripts[r])==null?void 0:n.source)||``,a=this.scriptEditorRef.current,o=(t,n)=>{a==null||a.showInlineDiff({range:t,originalText:n,modifiedText:e,onAccepted:()=>{var e;let t=(a==null||(e=a.getEditorContent)==null?void 0:e.call(a))||i;this.onChange({script:t})}})};if(t&&t.range&&t.scriptId===r){o(t.range,t.originalText);return}try{let t=dh(e,i);if(t){let e=i.split(` +`).slice(t.range.startLine-1,t.range.endLine).join(` +`);o(t.range,e);return}}catch{}this.setState({aiDiffView:{original:i,modified:e}})},onClose:()=>{window.localStorage.setItem(`Editor.aiChatOpen`,`false`),this.setState({aiChatOpen:!1})}})})]})},`scriptEditorDiv`)}return O(Se,{sx:Y.editorDiv,children:r},`scriptEditorDiv`)}return null}getBlocklyEditor(){if(!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);let e=O(he,{fallback:O(Bm,{}),children:O(ph,{ref:this.blocklyEditorRef,command:this.state.cmdToBlockly,themeType:this.state.themeType,searchText:this.state.searchText,code:this.scripts[this.state.selected].source||``,scriptId:this.state.selected,onChange:e=>this.onChange({script:e})},`BlocklyEditor`)});if(this.state.aiChatOpen){let t=window.localStorage.getItem(`Editor.aiBlocklyChatSizes`),n=[70,30];try{t&&(n=JSON.parse(t))}catch{}return O(Se,{sx:Y.editorDiv,children:B(kn,{direction:wn.Horizontal,initialSizes:n,minWidths:[200,250],gutterClassName:this.state.themeType===`dark`?`Dark visGutter`:`Light visGutter`,onResizeFinished:(e,t)=>{window.localStorage.setItem(`Editor.aiBlocklyChatSizes`,JSON.stringify(t))},children:[e,O(he,{fallback:O(Bm,{}),children:O(vh,{socket:this.props.socket,runningInstances:this.state.runningInstances,themeType:this.state.themeType,currentCode:(()=>{let e=this.blocklyEditorRef.current,t=``,n=``;try{t=(e==null?void 0:e.blocklyCode2JSCode(!0))||``}catch{}try{n=(e==null?void 0:e.getWorkspaceXml())||``}catch{}return`${t}\n%%BLOCKLY_XML%%\n${n}`})(),currentLanguage:`blockly`,allScripts:this.getScriptInfos(),onInsertCode:e=>{let t=this.blocklyEditorRef.current;t&&t.appendBlocksFromXml(e)},onApplyCode:e=>{let t=this.blocklyEditorRef.current;t&&t.applyAiBlocks(e)},onClose:()=>{window.localStorage.setItem(`Editor.aiChatOpen`,`false`),this.setState({aiChatOpen:!1})}})})]})},`blocklyEditorDiv`)}return O(Se,{sx:Y.editorDiv,children:e},`blocklyEditorDiv`)}return null}getRulesEditor(){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){var e,t;this.scripts[this.state.selected]||=this.getScriptFromObject(this.state.selected);let n=!!this.state.selected&&!!((e=this.scripts[this.state.selected])!=null&&e.engine)&&this.state.runningInstances[this.scripts[this.state.selected].engine],r=!!this.state.selected&&((t=this.scripts[this.state.selected])==null?void 0:t.enabled);return O(Se,{sx:Y.editorDiv,children:O(he,{fallback:O(Bm,{}),children:O(mh,{scriptId:this.state.selected,setTourStep:this.setTourStep,tourStep:this.state.tourStep,isTourOpen:this.state.isTourOpen,changed:this.state.changed[this.state.selected],running:n&&r,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||``,newRuleId:this.props.newRuleId,onNewRuleHandled:this.props.onNewRuleHandled,onChange:e=>this.onChange({script:e})},`flowEditor`)})},`flowEditorDiv`)}return null}getScriptConflictDialog(){var e;if(!this.state.scriptConflict)return null;let t=this.state.scriptConflict,n=((e=this.props.objects[t])==null||(e=e.common)==null?void 0:e.name)||t;return B(qe,{open:!0,onClose:()=>this.setState({scriptConflict:``}),children:[O(ot,{children:V.t(`Script was modified externally`)}),O(St,{children:V.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?`,n)}),B(Vt,{children:[O(R,{variant:`contained`,onClick:()=>{var e;this.scripts[t]=this.getScriptFromObject(t),this.lastKnownTs[t]=((e=this.props.objects[t])==null?void 0:e.ts)||0;let n={...this.state.changed};n[t]=!1,this.setState({scriptConflict:``,changed:n},()=>this.setChangedInAdmin())},color:`primary`,autoFocus:!0,children:V.t(`Reload`)}),O(R,{variant:`contained`,onClick:()=>{var e;this.lastKnownTs[t]=((e=this.props.objects[t])==null?void 0:e.ts)||0,this.setState({scriptConflict:``})},color:`secondary`,children:V.t(`Keep my changes`)})]})]},`dialogScriptConflict`)}getConfirmDialog(){return this.state.confirm?O(Bt,{text:this.state.confirm,onClose:e=>{if(this.confirmCallback){let t=this.confirmCallback;this.confirmCallback=null,t(e)}this.setState({confirm:``})}},`dialogConfirm1`):null}getSelectIdDialog(){if(this.state.showSelectId){var e;let t=[`state`,`channel`,`device`,`adapter`,`instance`,`enum`,`host`,`config`,`script`,`user`,`group`],n=[`adapter`,`instance`,`enum`,`host`,`config`,`script`,`user`,`group`],r=this.selectId.callback?this.selectId.initValue||``:this.getSelect&&this.getSelect()||``,i=r.indexOf(`/*`);i!==-1&&(r=r.substring(0,i)),i=r.indexOf(`//`),i!==-1&&(r=r.substring(0,i));let a=r.match(/"([^"]+)"/);return a&&(r=a[1]),a=r.match(/'([^']+)'/),a&&(r=a[1]),O(Rt,{theme:this.props.theme,imagePrefix:`../..`,themeName:this.props.themeName,themeType:this.state.themeType,socket:this.props.socket,selected:r,expertMode:this.selectId.type&&this.selectId.type!==`all`&&n.includes(this.selectId.type)?!0:void 0,types:((e=this.selectId)==null?void 0:e.type)===`all`?t:[this.selectId.type||`state`],onClose:()=>{this.setState({showSelectId:!1}),this.selectId.callback&&(this.selectId.callback=null)},onOk:(e,t)=>{this.selectId.initValue=null,this.selectId.callback?(this.selectId.callback(e),this.selectId.callback=null):this.setState({insert:`'${e}'/*${t}*/`})}},`dialogSelectID1`)}return null}getCronDialog(){return this.state.showCron?O(Pt,{theme:this.props.theme,cron:this.cron.callback?this.cron.initValue||``:this.getSelect?this.getSelect():`* * * * *`,onClose:()=>this.setState({showCron:!1}),onOk:e=>{this.cron.initValue=null,this.cron.callback?(this.cron.callback(e),this.cron.callback=null):this.setState({insert:`'${e}'`})}},`dialogCron1`):null}getAstroDialog(){return this.state.showAstro?B(qe,{open:!0,onClose:()=>this.setState({showAstro:!1}),children:[O(ot,{children:V.t(`Astronomical events today`)}),O(St,{children:this.state.astroEvents?O(te,{component:g,children:B(mt,{size:`small`,children:[O(ie,{children:B(le,{children:[O(dt,{children:V.t(`Name`)}),O(dt,{children:V.t(`Server time`)}),O(dt,{children:V.t(`Description`)})]})}),O(u,{children:Object.keys(this.state.astroEvents).map(e=>{var t,n,r,i;return B(le,{children:[O(dt,{component:`th`,scope:`row`,children:e.startsWith(`next`)?``:e}),O(on,{title:`${V.t(`Local time`)}: ${(t=this.state.astroEvents)!=null&&t[e].isValidDate?new Date((n=this.state.astroEvents)==null?void 0:n[e].date).toLocaleTimeString():`n/a`}`,children:O(dt,{align:`right`,children:(r=this.state.astroEvents)!=null&&r[e].isValidDate?(i=this.state.astroEvents)==null?void 0:i[e].serverTime:`n/a`})}),O(dt,{children:V.t(e)})]},e)})})]})}):O(qt,{})}),O(Vt,{children:O(R,{variant:`contained`,onClick:()=>this.setState({showAstro:!1}),color:`primary`,startIcon:O(ne,{}),children:V.t(`Close`)})})]},`dialogAstro`):null}getEditorDialog(){return this.state.showScript?O(he,{fallback:O(Bm,{}),children:O(_h,{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:e=>{this.scriptDialog.initValue=null,this.scriptDialog.callback&&(e!==!1&&this.scriptDialog.callback(e||``),this.scriptDialog.callback=null),this.setState({showScript:!1})}},`scriptEditorDialog`)}):null}getToast(){return O(re,{anchorOrigin:{vertical:`bottom`,horizontal:`left`},open:!!this.state.toast,autoHideDuration:6e3,onClose:()=>this.setState({toast:``}),slotProps:{content:{"aria-describedby":`message-id`}},message:O(`span`,{id:`message-id`,children:this.state.toast}),action:[O(U,{"aria-label":`close`,color:`inherit`,style:Y.closeToast,onClick:()=>this.setState({toast:``}),size:`medium`,children:O(ne,{})},`close`)]},`toast`)}getTour(){return this.state.instancesLoaded&&this.state.selected&&this.props.isAnyRulesExists===1&&this.props.objects[this.state.selected]&&this.state.rules&&this.state.visible?O(Am,{steps:Lm,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]?O(he,{fallback:O(Bm,{}),children:O(hh,{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(e){var t,n;if(!((t=this.props.objects[e])!=null&&t.common))return;let r=JSON.parse(JSON.stringify(this.props.objects[e].common));return(n=this.props.objects[e].native)!=null&&n.protected&&this.props.password&&(r.source=Qo(this.props.password,r.source)),r}render(){var e;if(this.state.selected&&this.props.objects[this.state.selected]&&this.state.blockly===null&&this.state.rules===null){if(!this.scripts[this.state.selected]){var t;this.scripts[this.state.selected]=this.getScriptFromObject(this.state.selected),this.lastKnownTs[this.state.selected]=((t=this.props.objects[this.state.selected])==null?void 0:t.ts)||0}setTimeout(()=>{let e={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,e),this.setState(e)},100)}return this.state.selected&&!this.props.password&&(e=this.props.objects[this.state.selected])!=null&&(e=e.native)!=null&&e.protected&&setTimeout(()=>{let e=this.state.editing.find(e=>{var t;return!((t=this.props.objects[e])!=null&&(t=t.native)!=null&&t.protected)})||``;Object.keys(this.scripts).forEach(e=>{var t;(t=this.props.objects[e])!=null&&(t=t.native)!=null&&t.protected&&delete this.scripts[e]}),this.setState({selected:e},()=>{var t,n;(t=(n=this.props).onSelectedChange)==null||t.call(n,e,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(()=>{let e=this.state.editing[0];this.setState({selected:e},()=>{var t,n;(t=(n=this.props).onSelectedChange)==null||t.call(n,e,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.getToast(),this.getTour()]}};G();var Dh={dialog:{height:`95%`},fullHeight:{height:`100%`,overflow:`hidden`},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}},Oh=class e extends W.Component{constructor(e){super(e),this.state={error:``,imageStatus:``}}componentDidMount(){setTimeout(()=>{try{var e;(e=window.document.getElementById(`import-text-area`))==null||e.focus()}catch{}},100)}handleCancel(){this.props.onClose()}static readFileDataUrl(e,t){let n=new FileReader;n.onload=()=>{t(null,{data:n.result,name:e.name})},n.onabort=()=>{console.error(`file reading was aborted`),t(V.t(`file reading was aborted`))},n.onerror=e=>{console.error(`file reading has failed`),t(V.t(`file reading has failed: %s`,e))},n.readAsDataURL(e)}handleDropFile(t){if(!(t!=null&&t.length))return;let n=t[t.length-1];n&&e.readFileDataUrl(n,(e,t)=>{if(e||!t)this.setState({error:e||`No data`});else{var n;this.props.onClose(((n=t.data)==null?void 0:n.toString())||``,t.name)}})}render(){let e={...Dh.dropzone,...this.state.imageStatus===`accepted`?Dh.dropzoneAccepted:this.state.imageStatus===`rejected`?Dh.dropzoneRejected:void 0};return B(qe,{onClose:()=>!1,maxWidth:`lg`,sx:{"& .MuiDialog-paper":Dh.dialog},fullWidth:!0,open:!0,"aria-labelledby":`import-dialog-title`,slotProps:{paper:{style:{minHeight:`90%`,maxHeight:`90%`}}},children:[O(ot,{id:`import-dialog-title`,children:V.t(`Import scripts`)}),B(St,{children:[O(Ue,{maxSize:5e7,onDrop:(e,t)=>{if(e.length)this.handleDropFile(e);else{var n;window.alert((t==null||(n=t[0])==null||(n=n.errors)==null||(n=n[0])==null?void 0:n.message)||V.t(`ra_Cannot upload`))}},multiple:!1,accept:{"application/zip":[],"application/x-zip-compressed":[]},children:({getRootProps:t,getInputProps:n,isDragActive:r,isDragReject:i})=>i?(this.state.imageStatus!==`rejected`&&this.setState({imageStatus:`rejected`}),B(`div`,{style:{...e,...Dh.dropzoneDiv},...t(),children:[O(`input`,{...n()}),O(`span`,{style:Dh.text,children:V.t(`Some files will be rejected`)},`text`),O(l,{style:{...Dh.icon,...Dh.iconError}},`icon`)]})):r?(this.state.imageStatus!==`accepted`&&this.setState({imageStatus:`accepted`}),B(`div`,{style:{...e,...Dh.dropzoneDiv},...t(),children:[O(`input`,{...n()}),O(`span`,{style:Dh.text,children:V.t(`All files will be accepted`)},`text`),O(Zt,{style:{...Dh.icon,...Dh.iconOk}},`icon`)]})):(this.state.imageStatus!==`wait`&&this.setState({imageStatus:`wait`}),B(`div`,{style:{...e,...Dh.dropzoneDiv},...t(),children:[O(`input`,{...n()}),O(`span`,{style:Dh.text,children:V.t(`Drop some files here or click...`)},`text`),O(de,{style:Dh.icon},`icon`)]}))},`image-drop`),this.state.error?O(un,{text:this.state.error,onClose:()=>this.setState({error:``})}):null]}),O(Vt,{children:O(R,{color:`grey`,variant:`contained`,onClick:()=>this.handleCancel(),startIcon:O(m,{}),children:V.t(`Close`)})})]})}},{blocks:kh,lists:Ah,logic:jh,loops:Mh,math:Nh,procedures:Ph,texts:Fh,variables:Ih,variablesDynamic:Lh}=t(r(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=r(fn()):n.Blockly.libraryBlocks=r(n.Blockly)})(e,function(e){var t=e.__namespace__,n=function(e){return function(){var n=e.workspace,r=e.getField(`VAR`).getVariable();t.Rd(n,r)}},r=function(e){return function(){var n=e.getField(`VAR`).getVariable();n&&t.$d(n.getWorkspace(),n,e)}},i=function(e){return function(){var n=e.workspace,r=e.getField(`VAR`).getVariable();t.Rd(n,r)}},a=function(e){return function(){var n=e.getField(`VAR`).getVariable();n&&t.$d(n.getWorkspace(),n,e)}},o=t.yb([{type:`variables_get_dynamic`,message0:`%1`,args0:[{type:`field_variable`,name:`VAR`,variable:`%{BKY_VARIABLES_DEFAULT_NAME}`}],output:null,style:`variable_dynamic_blocks`,helpUrl:`%{BKY_VARIABLES_GET_HELPURL}`,tooltip:`%{BKY_VARIABLES_GET_TOOLTIP}`,extensions:[`contextMenu_variableDynamicSetterGetter`]},{type:`variables_set_dynamic`,message0:`%{BKY_VARIABLES_SET}`,args0:[{type:`field_variable`,name:`VAR`,variable:`%{BKY_VARIABLES_DEFAULT_NAME}`},{type:`input_value`,name:`VALUE`}],previousStatement:null,nextStatement:null,style:`variable_dynamic_blocks`,tooltip:`%{BKY_VARIABLES_SET_TOOLTIP}`,helpUrl:`%{BKY_VARIABLES_SET_HELPURL}`,extensions:[`contextMenu_variableDynamicSetterGetter`]}]);t.ph(`contextMenu_variableDynamicSetterGetter`,{customContextMenu:function(e){if(this.isInFlyout)(this.type===`variables_get_dynamic`||this.type===`variables_get_reporter_dynamic`)&&(o=this.getField(`VAR`).getText(),a={text:t.C.RENAME_VARIABLE.replace(`%1`,o),enabled:!0,callback:n(this)},o={text:t.C.DELETE_VARIABLE.replace(`%1`,o),enabled:!0,callback:r(this)},e.unshift(a),e.unshift(o));else{if(this.type===`variables_get_dynamic`)var i=`variables_set_dynamic`,a=t.C.VARIABLES_GET_CREATE_SET;else i=`variables_get_dynamic`,a=t.C.VARIABLES_SET_CREATE_GET;var o=this.getField(`VAR`);i={type:i,fields:{VAR:o.saveState(!0)}},e.push({enabled:this.workspace.remainingCapacity()>0,text:a.replace(`%1`,o.getText()),callback:t.Pg(this,i)})}},onchange:function(){var e=this.getFieldValue(`VAR`);e=t.Vd(this.workspace,e),this.type===`variables_get_dynamic`?this.outputConnection.setCheck(e.getType()):this.getInput(`VALUE`).connection.setCheck(e.getType())}}),t.Ab(o);var s={blocks:o},c=t.yb([{type:`variables_get`,message0:`%1`,args0:[{type:`field_variable`,name:`VAR`,variable:`%{BKY_VARIABLES_DEFAULT_NAME}`}],output:null,style:`variable_blocks`,helpUrl:`%{BKY_VARIABLES_GET_HELPURL}`,tooltip:`%{BKY_VARIABLES_GET_TOOLTIP}`,extensions:[`contextMenu_variableSetterGetter`]},{type:`variables_set`,message0:`%{BKY_VARIABLES_SET}`,args0:[{type:`field_variable`,name:`VAR`,variable:`%{BKY_VARIABLES_DEFAULT_NAME}`},{type:`input_value`,name:`VALUE`,ariaLabelText:`%{BKY_INPUT_LABEL_VARIABLES_SET}`}],previousStatement:null,nextStatement:null,style:`variable_blocks`,tooltip:`%{BKY_VARIABLES_SET_TOOLTIP}`,helpUrl:`%{BKY_VARIABLES_SET_HELPURL}`,extensions:[`contextMenu_variableSetterGetter`]}]);t.ph(`contextMenu_variableSetterGetter`,{customContextMenu:function(e){if(this.isInFlyout)(this.type===`variables_get`||this.type===`variables_get_reporter`)&&(o=this.getField(`VAR`).getText(),r={text:t.C.RENAME_VARIABLE.replace(`%1`,o),enabled:!0,callback:i(this)},o={text:t.C.DELETE_VARIABLE.replace(`%1`,o),enabled:!0,callback:a(this)},e.unshift(r),e.unshift(o));else{if(this.type===`variables_get`)var n=`variables_set`,r=t.C.VARIABLES_GET_CREATE_SET;else n=`variables_get`,r=t.C.VARIABLES_SET_CREATE_GET;var o=this.getField(`VAR`);n={type:n,fields:{VAR:o.saveState(!0)}},e.push({enabled:this.workspace.remainingCapacity()>0,text:r.replace(`%1`,o.getText()),callback:t.Pg(this,n)})}}}),t.Ab(c);var l={blocks:c},u=t.yb([{type:`text`,message0:`%1`,args0:[{type:`field_input`,name:`TEXT`,text:``}],output:`String`,style:`text_blocks`,helpUrl:`%{BKY_TEXT_TEXT_HELPURL}`,tooltip:`%{BKY_TEXT_TEXT_TOOLTIP}`,extensions:[`text_quotes`,`parent_tooltip_when_inline`]},{type:`text_join`,message0:``,output:`String`,style:`text_blocks`,helpUrl:`%{BKY_TEXT_JOIN_HELPURL}`,tooltip:`%{BKY_TEXT_JOIN_TOOLTIP}`,mutator:`text_join_mutator`},{type:`text_create_join_container`,message0:`%{BKY_TEXT_CREATE_JOIN_TITLE_JOIN} %1 %2`,args0:[{type:`input_dummy`},{type:`input_statement`,name:`STACK`}],style:`text_blocks`,tooltip:`%{BKY_TEXT_CREATE_JOIN_TOOLTIP}`,enableContextMenu:!1},{type:`text_create_join_item`,message0:`%{BKY_TEXT_CREATE_JOIN_ITEM_TITLE_ITEM}`,previousStatement:null,nextStatement:null,style:`text_blocks`,tooltip:`%{BKY_TEXT_CREATE_JOIN_ITEM_TOOLTIP}`,enableContextMenu:!1},{type:`text_append`,message0:`%{BKY_TEXT_APPEND_TITLE}`,args0:[{type:`field_variable`,name:`VAR`,variable:`%{BKY_TEXT_APPEND_VARIABLE}`},{type:`input_value`,name:`TEXT`,ariaLabelText:`%{BKY_INPUT_LABEL_TEXT_APPEND}`}],previousStatement:null,nextStatement:null,style:`text_blocks`,extensions:[`text_append_tooltip`]},{type:`text_length`,message0:`%{BKY_TEXT_LENGTH_TITLE}`,args0:[{type:`input_value`,name:`VALUE`,check:[`String`,`Array`],ariaLabelText:`%{BKY_INPUT_LABEL_TEXT_TO_CHECK}`}],output:`Number`,style:`text_blocks`,tooltip:`%{BKY_TEXT_LENGTH_TOOLTIP}`,helpUrl:`%{BKY_TEXT_LENGTH_HELPURL}`},{type:`text_isEmpty`,message0:`%{BKY_TEXT_ISEMPTY_TITLE}`,args0:[{type:`input_value`,name:`VALUE`,check:[`String`,`Array`],ariaLabelText:`%{BKY_INPUT_LABEL_TEXT_TO_CHECK}`}],output:`Boolean`,style:`text_blocks`,tooltip:`%{BKY_TEXT_ISEMPTY_TOOLTIP}`,helpUrl:`%{BKY_TEXT_ISEMPTY_HELPURL}`},{type:`text_indexOf`,message0:`%{BKY_TEXT_INDEXOF_TITLE}`,args0:[{type:`input_value`,name:`VALUE`,check:`String`,ariaLabelText:`%{BKY_INPUT_LABEL_TEXT_TO_CHECK}`},{type:`field_dropdown`,name:`END`,options:[[`%{BKY_TEXT_INDEXOF_OPERATOR_FIRST}`,`FIRST`],[`%{BKY_TEXT_INDEXOF_OPERATOR_LAST}`,`LAST`]]},{type:`input_value`,name:`FIND`,check:`String`,ariaLabelText:`%{BKY_INPUT_LABEL_TEXT_TO_FIND}`}],output:`Number`,style:`text_blocks`,helpUrl:`%{BKY_TEXT_INDEXOF_HELPURL}`,inputsInline:!0,extensions:[`text_indexOf_tooltip`]},{type:`text_charAt`,message0:`%{BKY_TEXT_CHARAT_TITLE}`,args0:[{type:`input_value`,name:`VALUE`,check:`String`,ariaLabelText:`%{BKY_INPUT_LABEL_TEXT_TO_CHECK}`},{type:`field_dropdown`,name:`WHERE`,options:[[`%{BKY_TEXT_CHARAT_FROM_START}`,`FROM_START`,`%{BKY_TEXT_FROM_START_ARIA}`],[`%{BKY_TEXT_CHARAT_FROM_END}`,`FROM_END`,`%{BKY_TEXT_FROM_END_ARIA}`],[`%{BKY_TEXT_CHARAT_FIRST}`,`FIRST`],[`%{BKY_TEXT_CHARAT_LAST}`,`LAST`],[`%{BKY_TEXT_CHARAT_RANDOM}`,`RANDOM`]]}],output:`String`,style:`text_blocks`,helpUrl:`%{BKY_TEXT_CHARAT_HELPURL}`,inputsInline:!0,mutator:`text_charAt_mutator`}]);u.text_getSubstring={init:function(){this.WHERE_OPTIONS_1=[[t.C.TEXT_GET_SUBSTRING_START_FROM_START,`FROM_START`,t.C.TEXT_FROM_START_ARIA],[t.C.TEXT_GET_SUBSTRING_START_FROM_END,`FROM_END`,t.C.TEXT_FROM_END_ARIA],[t.C.TEXT_GET_SUBSTRING_START_FIRST,`FIRST`]],this.WHERE_OPTIONS_2=[[t.C.TEXT_GET_SUBSTRING_END_FROM_START,`FROM_START`,t.C.TEXT_FROM_START_ARIA],[t.C.TEXT_GET_SUBSTRING_END_FROM_END,`FROM_END`,t.C.TEXT_FROM_END_ARIA],[t.C.TEXT_GET_SUBSTRING_END_LAST,`LAST`]],this.setHelpUrl(t.C.TEXT_GET_SUBSTRING_HELPURL),this.setStyle(`text_blocks`),this.appendValueInput(`STRING`).setCheck(`String`).appendField(t.C.TEXT_GET_SUBSTRING_INPUT_IN_TEXT).setAriaLabelProvider(t.C.INPUT_LABEL_TEXT_TO_CHECK);var e=e=>{var n=t.lh({type:`field_dropdown`,options:this[`WHERE_OPTIONS_`+e]});return n.setValidator(function(t){var n=this.getValue();t=t===`FROM_START`||t===`FROM_END`,t!==(n===`FROM_START`||n===`FROM_END`)&&this.getSourceBlock().updateAt_(e,t)}),n};this.appendDummyInput(`WHERE1_INPUT`).appendField(e(1),`WHERE1`),this.appendDummyInput(`AT1`),this.appendDummyInput(`WHERE2_INPUT`).appendField(e(2),`WHERE2`),this.appendDummyInput(`AT2`),t.C.TEXT_GET_SUBSTRING_TAIL&&this.appendDummyInput(`TAIL`).appendField(t.C.TEXT_GET_SUBSTRING_TAIL),this.setInputsInline(!0),this.setOutput(!0,`String`),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(t.C.TEXT_GET_SUBSTRING_TOOLTIP)},mutationToDom:function(){var e=t.rc(`mutation`),n=this.getInput(`AT1`)instanceof t.Nn;return e.setAttribute(`at1`,`${n}`),n=this.getInput(`AT2`)instanceof t.Nn,e.setAttribute(`at2`,`${n}`),e},domToMutation:function(e){var t=e.getAttribute(`at1`)===`true`;e=e.getAttribute(`at2`)===`true`,this.updateAt_(1,t),this.updateAt_(2,e)},updateAt_:function(e,n){this.removeInput(`AT`+e),this.removeInput(`ORDINAL`+e,!0),n?(this.appendValueInput(`AT`+e).setCheck(`Number`).setAriaLabelProvider(e===1?t.C.INPUT_LABEL_TEXT_START_POSITION:t.C.INPUT_LABEL_TEXT_END_POSITION),t.C.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput(`ORDINAL`+e).appendField(t.C.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput(`AT`+e),e===2&&t.C.TEXT_GET_SUBSTRING_TAIL&&(this.removeInput(`TAIL`,!0),this.appendDummyInput(`TAIL`).appendField(t.C.TEXT_GET_SUBSTRING_TAIL)),e===1&&(this.moveInputBefore(`AT1`,`WHERE2_INPUT`),this.getInput(`ORDINAL1`)&&this.moveInputBefore(`ORDINAL1`,`WHERE2_INPUT`))}},u.text_changeCase={init:function(){var e=[[t.C.TEXT_CHANGECASE_OPERATOR_UPPERCASE,`UPPERCASE`],[t.C.TEXT_CHANGECASE_OPERATOR_LOWERCASE,`LOWERCASE`],[t.C.TEXT_CHANGECASE_OPERATOR_TITLECASE,`TITLECASE`]];this.setHelpUrl(t.C.TEXT_CHANGECASE_HELPURL),this.setStyle(`text_blocks`),this.appendValueInput(`TEXT`).setCheck(`String`).appendField(t.lh({type:`field_dropdown`,options:e}),`CASE`).setAriaLabelProvider(t.C.INPUT_LABEL_TEXT_TO_CHANGE),this.setOutput(!0,`String`),this.setTooltip(t.C.TEXT_CHANGECASE_TOOLTIP)}},u.text_trim={init:function(){var e=[[t.C.TEXT_TRIM_OPERATOR_BOTH,`BOTH`],[t.C.TEXT_TRIM_OPERATOR_LEFT,`LEFT`],[t.C.TEXT_TRIM_OPERATOR_RIGHT,`RIGHT`]];this.setHelpUrl(t.C.TEXT_TRIM_HELPURL),this.setStyle(`text_blocks`),this.appendValueInput(`TEXT`).setCheck(`String`).appendField(t.lh({type:`field_dropdown`,options:e}),`MODE`).setAriaLabelProvider(t.C.INPUT_LABEL_TEXT_TO_CHANGE),this.setOutput(!0,`String`),this.setTooltip(t.C.TEXT_TRIM_TOOLTIP)}},u.text_print={init:function(){this.jsonInit({message0:t.C.TEXT_PRINT_TITLE,args0:[{type:`input_value`,name:`TEXT`}],previousStatement:null,nextStatement:null,style:`text_blocks`,tooltip:t.C.TEXT_PRINT_TOOLTIP,helpUrl:t.C.TEXT_PRINT_HELPURL})}};var d={updateType_:function(e){this.outputConnection.setCheck(e===`NUMBER`?`Number`:`String`)},mutationToDom:function(){var e=t.rc(`mutation`);return e.setAttribute(`type`,this.getFieldValue(`TYPE`)),e},domToMutation:function(e){this.updateType_(e.getAttribute(`type`))}};u.text_prompt_ext=Object.assign({},d,{init:function(){var e=[[t.C.TEXT_PROMPT_TYPE_TEXT,`TEXT`],[t.C.TEXT_PROMPT_TYPE_NUMBER,`NUMBER`]];this.setHelpUrl(t.C.TEXT_PROMPT_HELPURL),this.setStyle(`text_blocks`),e=t.lh({type:`field_dropdown`,options:e}),e.setValidator(e=>{this.updateType_(e)}),this.appendValueInput(`TEXT`).appendField(e,`TYPE`).setAriaLabelProvider(t.C.INPUT_LABEL_TEXT_PROMPT_MESSAGE),this.setOutput(!0,`String`),this.setTooltip(()=>this.getFieldValue(`TYPE`)===`TEXT`?t.C.TEXT_PROMPT_TOOLTIP_TEXT:t.C.TEXT_PROMPT_TOOLTIP_NUMBER)}}),u.text_prompt=Object.assign({},d,{init:function(){this.mixin(f);var e=[[t.C.TEXT_PROMPT_TYPE_TEXT,`TEXT`],[t.C.TEXT_PROMPT_TYPE_NUMBER,`NUMBER`]];this.setHelpUrl(t.C.TEXT_PROMPT_HELPURL),this.setStyle(`text_blocks`),e=t.lh({type:`field_dropdown`,options:e}),e.setValidator(e=>{this.updateType_(e)}),this.appendDummyInput().appendField(e,`TYPE`).appendField(this.newQuote_(!0)).appendField(t.lh({type:`field_input`,text:``}),`TEXT`).appendField(this.newQuote_(!1)),this.setOutput(!0,`String`),this.setTooltip(()=>this.getFieldValue(`TYPE`)===`TEXT`?t.C.TEXT_PROMPT_TOOLTIP_TEXT:t.C.TEXT_PROMPT_TOOLTIP_NUMBER)}}),u.text_count={init:function(){this.jsonInit({message0:t.C.TEXT_COUNT_MESSAGE0,args0:[{type:`input_value`,name:`SUB`,check:`String`,ariaLabelText:`%{BKY_INPUT_LABEL_TEXT_TO_FIND}`},{type:`input_value`,name:`TEXT`,check:`String`,ariaLabelText:`%{BKY_INPUT_LABEL_TEXT_TO_CHECK}`}],output:`Number`,inputsInline:!0,style:`text_blocks`,tooltip:t.C.TEXT_COUNT_TOOLTIP,helpUrl:t.C.TEXT_COUNT_HELPURL})}},u.text_replace={init:function(){this.jsonInit({message0:t.C.TEXT_REPLACE_MESSAGE0,args0:[{type:`input_value`,name:`FROM`,check:`String`,ariaLabelText:`%{BKY_INPUT_LABEL_TEXT_TO_FIND}`},{type:`input_value`,name:`TO`,check:`String`,ariaLabelText:`%{BKY_INPUT_LABEL_TEXT_TO_REPLACE}`},{type:`input_value`,name:`TEXT`,check:`String`,ariaLabelText:`%{BKY_INPUT_LABEL_TEXT_TO_CHECK}`}],output:`String`,inputsInline:!0,style:`text_blocks`,tooltip:t.C.TEXT_REPLACE_TOOLTIP,helpUrl:t.C.TEXT_REPLACE_HELPURL})}},u.text_reverse={init:function(){this.jsonInit({message0:t.C.TEXT_REVERSE_MESSAGE0,args0:[{type:`input_value`,name:`TEXT`,check:`String`,ariaLabelText:`%{BKY_INPUT_LABEL_TEXT_TO_CHANGE}`}],output:`String`,inputsInline:!0,style:`text_blocks`,tooltip:t.C.TEXT_REVERSE_TOOLTIP,helpUrl:t.C.TEXT_REVERSE_HELPURL})}};var f={QUOTE_IMAGE_LEFT_DATAURI:`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC`,QUOTE_IMAGE_RIGHT_DATAURI:`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==`,QUOTE_IMAGE_WIDTH:12,QUOTE_IMAGE_HEIGHT:12,quoteField_:function(e){for(let t=0,n;n=this.inputList[t];t++)for(let t=0,r;r=n.fieldRow[t];t++)if(e===r.name){n.insertFieldAt(t,this.newQuote_(!0)),n.insertFieldAt(t+2,this.newQuote_(!1));return}console.warn(`field named "`+e+`" not found in `+this.toDevString())},newQuote_:function(e){return e=this.RTL?!e:e,t.lh({type:`field_image`,src:e?this.QUOTE_IMAGE_LEFT_DATAURI:this.QUOTE_IMAGE_RIGHT_DATAURI,width:this.QUOTE_IMAGE_WIDTH,height:this.QUOTE_IMAGE_HEIGHT,alt:e?`“`:`”`})}};t.oh(`text_append_tooltip`,t.Ah(`%{BKY_TEXT_APPEND_TOOLTIP}`,`VAR`)),t.oh(`text_indexOf_tooltip`,function(){this.setTooltip(()=>t.C.TEXT_INDEXOF_TOOLTIP.replace(`%1`,this.workspace.options.oneBasedIndex?`0`:`-1`))}),t.oh(`text_quotes`,function(){this.mixin(f),this.quoteField_(`TEXT`)}),t.ph(`quote_image_mixin`,f),t.th(`text_join_mutator`,{itemCount_:0,mutationToDom:function(){var e=t.rc(`mutation`);return e.setAttribute(`items`,`${this.itemCount_}`),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute(`items`),10),this.updateShape_()},saveExtraState:function(){return{itemCount:this.itemCount_}},loadExtraState:function(e){this.itemCount_=e.itemCount,this.updateShape_()},decompose:function(e){var t=e.newBlock(`text_create_join_container`);t.initSvg();var n,r=(n=t.getInput(`STACK`))==null?void 0:n.connection;for(n=0;n{var e=this.getFieldValue(`WHERE`),n=t.C.TEXT_CHARAT_TOOLTIP;return(e===`FROM_START`||e===`FROM_END`)&&(e=e===`FROM_START`?t.C.LISTS_INDEX_FROM_START_TOOLTIP:t.C.LISTS_INDEX_FROM_END_TOOLTIP)&&(n+=` `+e.replace(`%1`,this.workspace.options.oneBasedIndex?`#1`:`#0`)),n})}),t.Ab(u);var p={blocks:u},m={},h={setStatements_:function(e){this.hasStatements_!==e&&(e?(this.appendStatementInput(`STACK`).appendField(t.C.PROCEDURES_DEFNORETURN_DO),this.getInput(`RETURN`)&&this.moveInputBefore(`STACK`,`RETURN`)):this.removeInput(`STACK`,!0),this.hasStatements_=e)},updateParams_:function(){var e=``;this.arguments_.length&&(e=t.C.PROCEDURES_BEFORE_PARAMS+` `+this.arguments_.join(`, `)),t.Ub++;try{this.setFieldValue(e,`PARAMS`)}finally{t.Ub--}},mutationToDom:function(e){var n=t.rc(`mutation`);e&&n.setAttribute(`name`,this.getFieldValue(`NAME`));for(let r=0;re.getName()))===JSON.stringify(this.arguments_)||(r=null),r)r.isEnabled()||(this.setDisabledReason(!0,`DISABLED_PROCEDURE_DEFINITION`),this.setWarningText(t.C.PROCEDURES_CALL_DISABLED_DEF_WARNING.replace(`%1`,n)));else{t.B(e.group),e=t.rc(`xml`),n=t.rc(`block`),n.setAttribute(`type`,this.defType_),r=this.getRelativeToSurfaceXY();var i=r.y+t.Og.snapRadius*2;n.setAttribute(`x`,`${r.x+t.Og.snapRadius*(this.RTL?-1:1)}`),n.setAttribute(`y`,`${i}`),r=this.mutationToDom(),n.appendChild(r),r=t.rc(`field`),r.setAttribute(`name`,`NAME`),i=this.getProcedureCall();let a=t.jj(i,this);i!==a&&this.renameProcedure(i,a),r.appendChild(t.sc(i)),n.appendChild(r),e.appendChild(n),t.ch(e,this.workspace),t.B(!1)}}else e.type===t.lm?(n=this.getProcedureCall(),t.tj(n,this.workspace)||(t.B(e.group),this.dispose(!0),t.B(!1))):e.type===t.km&&e.element===`disabled`&&(n=this.getProcedureCall(),(i=t.tj(n,this.workspace))&&i.id===e.blockId&&((r=t.gd)&&console.log(`Saw an existing group while responding to a definition change`),t.B(e.group),e=i.isEnabled(),this.setDisabledReason(!e,`DISABLED_PROCEDURE_DEFINITION`),this.setWarningText(e?null:t.C.PROCEDURES_CALL_DISABLED_DEF_WARNING.replace(`%1`,n)),t.B(r)))}},customContextMenu:function(e){if(this.workspace.isMovable()){var n=this.getProcedureCall(),r=this.workspace;e.push({enabled:!0,text:t.C.PROCEDURES_HIGHLIGHT_DEF,callback:function(){var e=t.tj(n,r);e&&(r.centerOnBlock(e.id),t.t().focusNode(e))}})}}};m.procedures_callnoreturn=Object.assign({},_,{init:function(){this.appendDummyInput(`TOPROW`).appendField(``,`NAME`),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setStyle(`procedure_blocks`),this.setHelpUrl(t.C.PROCEDURES_CALLNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.quarkConnections_={},this.quarkIds_=null},defType_:`procedures_defnoreturn`}),m.procedures_callreturn=Object.assign({},_,{init:function(){this.appendDummyInput(`TOPROW`).appendField(``,`NAME`),this.setOutput(!0),this.setStyle(`procedure_blocks`),this.setHelpUrl(t.C.PROCEDURES_CALLRETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.quarkConnections_={},this.quarkIds_=null},defType_:`procedures_defreturn`}),m.procedures_ifreturn={init:function(){this.appendValueInput(`CONDITION`).setCheck(`Boolean`).appendField(t.C.CONTROLS_IF_MSG_IF),this.appendValueInput(`VALUE`).appendField(t.C.PROCEDURES_DEFRETURN_RETURN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setStyle(`procedure_blocks`),this.setTooltip(t.C.PROCEDURES_IFRETURN_TOOLTIP),this.setHelpUrl(t.C.PROCEDURES_IFRETURN_HELPURL),this.hasReturnValue_=!0},mutationToDom:function(){var e=t.rc(`mutation`);return e.setAttribute(`value`,String(Number(this.hasReturnValue_))),e},domToMutation:function(e){this.hasReturnValue_=e.getAttribute(`value`)===`1`,this.hasReturnValue_||(this.removeInput(`VALUE`),this.appendDummyInput(`VALUE`).appendField(t.C.PROCEDURES_DEFRETURN_RETURN))},onchange:function(e){if(!(this.workspace.isDragging&&this.workspace.isDragging()||e.type!==t.nm&&e.type!==t.Od)){e=!1;var n=this;do{if(this.FUNCTION_TYPES.includes(n.type)){e=!0;break}n=n.getSurroundParent()}while(n);if(e?(n.type===`procedures_defnoreturn`&&this.hasReturnValue_?(this.removeInput(`VALUE`),this.appendDummyInput(`VALUE`).appendField(t.C.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!1):n.type!==`procedures_defreturn`||this.hasReturnValue_||(this.removeInput(`VALUE`),this.appendValueInput(`VALUE`).appendField(t.C.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!0),this.setWarningText(null)):this.setWarningText(t.C.PROCEDURES_IFRETURN_WARNING),!this.isInFlyout)try{t.Qc=!1,this.setDisabledReason(!e,`UNPARENTED_IFRETURN`)}finally{t.Qc=!0}}},FUNCTION_TYPES:[`procedures_defnoreturn`,`procedures_defreturn`]},t.Ab(m);var v={blocks:m},y=t.yb([{type:`math_number`,message0:`%1`,args0:[{type:`field_number`,name:`NUM`,value:0}],output:`Number`,helpUrl:`%{BKY_MATH_NUMBER_HELPURL}`,style:`math_blocks`,tooltip:`%{BKY_MATH_NUMBER_TOOLTIP}`,extensions:[`parent_tooltip_when_inline`]},{type:`math_arithmetic`,message0:`%1 %2 %3`,args0:[{type:`input_value`,name:`A`,check:`Number`,ariaLabelText:`%{BKY_INPUT_LABEL_NUMBER_A}`},{type:`field_dropdown`,name:`OP`,options:[[`%{BKY_MATH_ADDITION_SYMBOL}`,`ADD`,`%{BKY_MATH_ADDITION_SYMBOL_ARIA}`],[`%{BKY_MATH_SUBTRACTION_SYMBOL}`,`MINUS`,`%{BKY_MATH_SUBTRACTION_SYMBOL_ARIA}`],[`%{BKY_MATH_MULTIPLICATION_SYMBOL}`,`MULTIPLY`,`%{BKY_MATH_MULTIPLICATION_SYMBOL_ARIA}`],[`%{BKY_MATH_DIVISION_SYMBOL}`,`DIVIDE`,`%{BKY_MATH_DIVISION_SYMBOL_ARIA}`],[`%{BKY_MATH_POWER_SYMBOL}`,`POWER`,`%{BKY_MATH_POWER_SYMBOL_ARIA}`]]},{type:`input_value`,name:`B`,check:`Number`,ariaLabelText:`%{BKY_INPUT_LABEL_NUMBER_B}`}],inputsInline:!0,output:`Number`,style:`math_blocks`,helpUrl:`%{BKY_MATH_ARITHMETIC_HELPURL}`,extensions:[`math_op_tooltip`]},{type:`math_single`,message0:`%1 %2`,args0:[{type:`field_dropdown`,name:`OP`,options:[[`%{BKY_MATH_SINGLE_OP_ROOT}`,`ROOT`],[`%{BKY_MATH_SINGLE_OP_ABSOLUTE}`,`ABS`,`%{BKY_MATH_SINGLE_OP_ABSOLUTE_ARIA}`],[`-`,`NEG`,`%{BKY_MATH_SINGLE_OP_NEG_ARIA}`],[`ln`,`LN`,`%{BKY_MATH_SINGLE_OP_LN_ARIA}`],[`log10`,`LOG10`,`%{BKY_MATH_SINGLE_OP_LOG10_ARIA}`],[`e^`,`EXP`,`%{BKY_MATH_SINGLE_OP_EXP_ARIA}`],[`10^`,`POW10`,`%{BKY_MATH_SINGLE_OP_POW10_ARIA}`]]},{type:`input_value`,name:`NUM`,check:`Number`,ariaLabelText:`%{BKY_INPUT_LABEL_NUMBER}`}],output:`Number`,style:`math_blocks`,helpUrl:`%{BKY_MATH_SINGLE_HELPURL}`,extensions:[`math_op_tooltip`]},{type:`math_trig`,message0:`%1 %2`,args0:[{type:`field_dropdown`,name:`OP`,options:[[`%{BKY_MATH_TRIG_SIN}`,`SIN`,`%{BKY_MATH_TRIG_SIN_ARIA}`],[`%{BKY_MATH_TRIG_COS}`,`COS`,`%{BKY_MATH_TRIG_COS_ARIA}`],[`%{BKY_MATH_TRIG_TAN}`,`TAN`,`%{BKY_MATH_TRIG_TAN_ARIA}`],[`%{BKY_MATH_TRIG_ASIN}`,`ASIN`,`%{BKY_MATH_TRIG_ASIN_ARIA}`],[`%{BKY_MATH_TRIG_ACOS}`,`ACOS`,`%{BKY_MATH_TRIG_ACOS_ARIA}`],[`%{BKY_MATH_TRIG_ATAN}`,`ATAN`,`%{BKY_MATH_TRIG_ATAN_ARIA}`]]},{type:`input_value`,name:`NUM`,check:`Number`,ariaLabelText:`%{BKY_INPUT_LABEL_NUMBER}`}],output:`Number`,style:`math_blocks`,helpUrl:`%{BKY_MATH_TRIG_HELPURL}`,extensions:[`math_op_tooltip`]},{type:`math_constant`,message0:`%1`,args0:[{type:`field_dropdown`,name:`CONSTANT`,options:[[`π`,`PI`,`%{BKY_MATH_CONSTANT_PI_ARIA}`],[`e`,`E`,`%{BKY_MATH_CONSTANT_E_ARIA}`],[`φ`,`GOLDEN_RATIO`,`%{BKY_MATH_CONSTANT_GOLDEN_RATIO_ARIA}`],[`sqrt(2)`,`SQRT2`,`%{BKY_MATH_CONSTANT_SQRT2_ARIA}`],[`sqrt(½)`,`SQRT1_2`,`%{BKY_MATH_CONSTANT_SQRT1_2_ARIA}`],[`∞`,`INFINITY`,`%{BKY_MATH_CONSTANT_INFINITY_ARIA}`]]}],output:`Number`,style:`math_blocks`,tooltip:`%{BKY_MATH_CONSTANT_TOOLTIP}`,helpUrl:`%{BKY_MATH_CONSTANT_HELPURL}`},{type:`math_number_property`,message0:`%1 %2`,args0:[{type:`input_value`,name:`NUMBER_TO_CHECK`,check:`Number`,ariaLabelText:`%{BKY_INPUT_LABEL_NUMBER_TO_CHECK}`},{type:`field_dropdown`,name:`PROPERTY`,options:[[`%{BKY_MATH_IS_EVEN}`,`EVEN`],[`%{BKY_MATH_IS_ODD}`,`ODD`],[`%{BKY_MATH_IS_PRIME}`,`PRIME`],[`%{BKY_MATH_IS_WHOLE}`,`WHOLE`],[`%{BKY_MATH_IS_POSITIVE}`,`POSITIVE`],[`%{BKY_MATH_IS_NEGATIVE}`,`NEGATIVE`],[`%{BKY_MATH_IS_DIVISIBLE_BY}`,`DIVISIBLE_BY`]]}],inputsInline:!0,output:`Boolean`,style:`math_blocks`,tooltip:`%{BKY_MATH_IS_TOOLTIP}`,mutator:`math_is_divisibleby_mutator`},{type:`math_change`,message0:`%{BKY_MATH_CHANGE_TITLE}`,args0:[{type:`field_variable`,name:`VAR`,variable:`%{BKY_MATH_CHANGE_TITLE_ITEM}`},{type:`input_value`,name:`DELTA`,check:`Number`,ariaLabelText:`%{BKY_INPUT_LABEL_MATH_CHANGE_BY}`}],previousStatement:null,nextStatement:null,style:`variable_blocks`,helpUrl:`%{BKY_MATH_CHANGE_HELPURL}`,extensions:[`math_change_tooltip`]},{type:`math_round`,message0:`%1 %2`,args0:[{type:`field_dropdown`,name:`OP`,options:[[`%{BKY_MATH_ROUND_OPERATOR_ROUND}`,`ROUND`],[`%{BKY_MATH_ROUND_OPERATOR_ROUNDUP}`,`ROUNDUP`],[`%{BKY_MATH_ROUND_OPERATOR_ROUNDDOWN}`,`ROUNDDOWN`]]},{type:`input_value`,name:`NUM`,check:`Number`,ariaLabelText:`%{BKY_INPUT_LABEL_NUMBER}`}],output:`Number`,style:`math_blocks`,helpUrl:`%{BKY_MATH_ROUND_HELPURL}`,tooltip:`%{BKY_MATH_ROUND_TOOLTIP}`},{type:`math_on_list`,message0:`%1 %2`,args0:[{type:`field_dropdown`,name:`OP`,options:[[`%{BKY_MATH_ONLIST_OPERATOR_SUM}`,`SUM`],[`%{BKY_MATH_ONLIST_OPERATOR_MIN}`,`MIN`,`%{BKY_MATH_ONLIST_OPERATOR_MIN_ARIA}`],[`%{BKY_MATH_ONLIST_OPERATOR_MAX}`,`MAX`,`%{BKY_MATH_ONLIST_OPERATOR_MAX_ARIA}`],[`%{BKY_MATH_ONLIST_OPERATOR_AVERAGE}`,`AVERAGE`],[`%{BKY_MATH_ONLIST_OPERATOR_MEDIAN}`,`MEDIAN`],[`%{BKY_MATH_ONLIST_OPERATOR_MODE}`,`MODE`],[`%{BKY_MATH_ONLIST_OPERATOR_STD_DEV}`,`STD_DEV`],[`%{BKY_MATH_ONLIST_OPERATOR_RANDOM}`,`RANDOM`]]},{type:`input_value`,name:`LIST`,check:`Array`,ariaLabelText:`%{BKY_INPUT_LABEL_NUMBER_LIST}`}],output:`Number`,style:`math_blocks`,helpUrl:`%{BKY_MATH_ONLIST_HELPURL}`,mutator:`math_modes_of_list_mutator`,extensions:[`math_op_tooltip`]},{type:`math_modulo`,message0:`%{BKY_MATH_MODULO_TITLE}`,args0:[{type:`input_value`,name:`DIVIDEND`,check:`Number`,ariaLabelText:`%{BKY_INPUT_LABEL_MATH_DIVIDEND}`},{type:`input_value`,name:`DIVISOR`,check:`Number`,ariaLabelText:`%{BKY_INPUT_LABEL_MATH_DIVISOR}`}],inputsInline:!0,output:`Number`,style:`math_blocks`,tooltip:`%{BKY_MATH_MODULO_TOOLTIP}`,helpUrl:`%{BKY_MATH_MODULO_HELPURL}`},{type:`math_constrain`,message0:`%{BKY_MATH_CONSTRAIN_TITLE}`,args0:[{type:`input_value`,name:`VALUE`,check:`Number`,ariaLabelText:`%{BKY_INPUT_LABEL_MATH_CONSTRAIN_VALUE}`},{type:`input_value`,name:`LOW`,check:`Number`},{type:`input_value`,name:`HIGH`,check:`Number`}],inputsInline:!0,output:`Number`,style:`math_blocks`,tooltip:`%{BKY_MATH_CONSTRAIN_TOOLTIP}`,helpUrl:`%{BKY_MATH_CONSTRAIN_HELPURL}`},{type:`math_random_int`,message0:`%{BKY_MATH_RANDOM_INT_TITLE}`,args0:[{type:`input_value`,name:`FROM`,check:`Number`,ariaLabelText:`%{BKY_INPUT_LABEL_NUMBER_MIN}`},{type:`input_value`,name:`TO`,check:`Number`,ariaLabelText:`%{BKY_INPUT_LABEL_NUMBER_MAX}`}],inputsInline:!0,output:`Number`,style:`math_blocks`,tooltip:`%{BKY_MATH_RANDOM_INT_TOOLTIP}`,helpUrl:`%{BKY_MATH_RANDOM_INT_HELPURL}`},{type:`math_random_float`,message0:`%{BKY_MATH_RANDOM_FLOAT_TITLE_RANDOM}`,output:`Number`,style:`math_blocks`,tooltip:`%{BKY_MATH_RANDOM_FLOAT_TOOLTIP}`,helpUrl:`%{BKY_MATH_RANDOM_FLOAT_HELPURL}`},{type:`math_atan2`,message0:`%{BKY_MATH_ATAN2_TITLE}`,args0:[{type:`input_value`,name:`X`,check:`Number`,ariaLabelText:`%{BKY_INPUT_LABEL_NUMBER_ATAN2_X}`},{type:`input_value`,name:`Y`,check:`Number`,ariaLabelText:`%{BKY_INPUT_LABEL_NUMBER_ATAN2_Y}`}],inputsInline:!0,output:`Number`,style:`math_blocks`,tooltip:`%{BKY_MATH_ATAN2_TOOLTIP}`,helpUrl:`%{BKY_MATH_ATAN2_HELPURL}`}]);t.oh(`math_op_tooltip`,t.yh(`OP`,{ADD:`%{BKY_MATH_ARITHMETIC_TOOLTIP_ADD}`,MINUS:`%{BKY_MATH_ARITHMETIC_TOOLTIP_MINUS}`,MULTIPLY:`%{BKY_MATH_ARITHMETIC_TOOLTIP_MULTIPLY}`,DIVIDE:`%{BKY_MATH_ARITHMETIC_TOOLTIP_DIVIDE}`,POWER:`%{BKY_MATH_ARITHMETIC_TOOLTIP_POWER}`,ROOT:`%{BKY_MATH_SINGLE_TOOLTIP_ROOT}`,ABS:`%{BKY_MATH_SINGLE_TOOLTIP_ABS}`,NEG:`%{BKY_MATH_SINGLE_TOOLTIP_NEG}`,LN:`%{BKY_MATH_SINGLE_TOOLTIP_LN}`,LOG10:`%{BKY_MATH_SINGLE_TOOLTIP_LOG10}`,EXP:`%{BKY_MATH_SINGLE_TOOLTIP_EXP}`,POW10:`%{BKY_MATH_SINGLE_TOOLTIP_POW10}`,SIN:`%{BKY_MATH_TRIG_TOOLTIP_SIN}`,COS:`%{BKY_MATH_TRIG_TOOLTIP_COS}`,TAN:`%{BKY_MATH_TRIG_TOOLTIP_TAN}`,ASIN:`%{BKY_MATH_TRIG_TOOLTIP_ASIN}`,ACOS:`%{BKY_MATH_TRIG_TOOLTIP_ACOS}`,ATAN:`%{BKY_MATH_TRIG_TOOLTIP_ATAN}`,SUM:`%{BKY_MATH_ONLIST_TOOLTIP_SUM}`,MIN:`%{BKY_MATH_ONLIST_TOOLTIP_MIN}`,MAX:`%{BKY_MATH_ONLIST_TOOLTIP_MAX}`,AVERAGE:`%{BKY_MATH_ONLIST_TOOLTIP_AVERAGE}`,MEDIAN:`%{BKY_MATH_ONLIST_TOOLTIP_MEDIAN}`,MODE:`%{BKY_MATH_ONLIST_TOOLTIP_MODE}`,STD_DEV:`%{BKY_MATH_ONLIST_TOOLTIP_STD_DEV}`,RANDOM:`%{BKY_MATH_ONLIST_TOOLTIP_RANDOM}`})),t.th(`math_is_divisibleby_mutator`,{mutationToDom:function(){var e=t.rc(`mutation`),n=this.getFieldValue(`PROPERTY`)===`DIVISIBLE_BY`;return e.setAttribute(`divisor_input`,String(n)),e},domToMutation:function(e){e=e.getAttribute(`divisor_input`)===`true`,this.updateShape_(e)},updateShape_:function(e){var t=this.getInput(`DIVISOR`);e?t||this.appendValueInput(`DIVISOR`).setCheck(`Number`):t&&this.removeInput(`DIVISOR`)}},function(){this.getField(`PROPERTY`).setValidator(function(e){e=e===`DIVISIBLE_BY`,this.getSourceBlock().updateShape_(e)})}),t.oh(`math_change_tooltip`,t.Ah(`%{BKY_MATH_CHANGE_TOOLTIP}`,`VAR`)),t.th(`math_modes_of_list_mutator`,{updateType_:function(e){e===`MODE`?this.outputConnection.setCheck(`Array`):this.outputConnection.setCheck(`Number`)},mutationToDom:function(){var e=t.rc(`mutation`);return e.setAttribute(`op`,this.getFieldValue(`OP`)),e},domToMutation:function(e){if(e=e.getAttribute(`op`),e===null)throw TypeError(`xmlElement had no op attribute`);this.updateType_(e)}},function(){this.getField(`OP`).setValidator(function(e){this.updateType_(e)}.bind(this))}),t.Ab(y);var b={blocks:y},x=t.yb([{type:`controls_repeat_ext`,message0:`%{BKY_CONTROLS_REPEAT_TITLE}`,args0:[{type:`input_value`,name:`TIMES`,check:`Number`,ariaLabelText:`%{BKY_INPUT_LABEL_LOOP_TIMES}`}],message1:`%{BKY_CONTROLS_REPEAT_INPUT_DO} %1`,args1:[{type:`input_statement`,name:`DO`}],previousStatement:null,nextStatement:null,style:`loop_blocks`,tooltip:`%{BKY_CONTROLS_REPEAT_TOOLTIP}`,helpUrl:`%{BKY_CONTROLS_REPEAT_HELPURL}`},{type:`controls_repeat`,message0:`%{BKY_CONTROLS_REPEAT_TITLE}`,args0:[{type:`field_number`,name:`TIMES`,value:10,min:0,precision:1,ariaLabelText:`%{BKY_INPUT_LABEL_LOOP_TIMES}`}],message1:`%{BKY_CONTROLS_REPEAT_INPUT_DO} %1`,args1:[{type:`input_statement`,name:`DO`}],previousStatement:null,nextStatement:null,style:`loop_blocks`,tooltip:`%{BKY_CONTROLS_REPEAT_TOOLTIP}`,helpUrl:`%{BKY_CONTROLS_REPEAT_HELPURL}`},{type:`controls_whileUntil`,message0:`%1 %2`,args0:[{type:`field_dropdown`,name:`MODE`,options:[[`%{BKY_CONTROLS_WHILEUNTIL_OPERATOR_WHILE}`,`WHILE`],[`%{BKY_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL}`,`UNTIL`]]},{type:`input_value`,name:`BOOL`,check:`Boolean`,ariaLabelText:`%{BKY_INPUT_LABEL_CONDITION}`}],message1:`%{BKY_CONTROLS_REPEAT_INPUT_DO} %1`,args1:[{type:`input_statement`,name:`DO`}],previousStatement:null,nextStatement:null,style:`loop_blocks`,helpUrl:`%{BKY_CONTROLS_WHILEUNTIL_HELPURL}`,extensions:[`controls_whileUntil_tooltip`]},{type:`controls_for`,message0:`%{BKY_CONTROLS_FOR_TITLE}`,args0:[{type:`field_variable`,name:`VAR`,variable:null},{type:`input_value`,name:`FROM`,check:`Number`,align:`RIGHT`,ariaLabelText:`%{BKY_INPUT_LABEL_LOOP_FROM}`},{type:`input_value`,name:`TO`,check:`Number`,align:`RIGHT`,ariaLabelText:`%{BKY_INPUT_LABEL_LOOP_TO}`},{type:`input_value`,name:`BY`,check:`Number`,align:`RIGHT`,ariaLabelText:`%{BKY_INPUT_LABEL_LOOP_BY}`}],message1:`%{BKY_CONTROLS_REPEAT_INPUT_DO} %1`,args1:[{type:`input_statement`,name:`DO`}],inputsInline:!0,previousStatement:null,nextStatement:null,style:`loop_blocks`,helpUrl:`%{BKY_CONTROLS_FOR_HELPURL}`,extensions:[`contextMenu_newGetVariableBlock`,`controls_for_tooltip`]},{type:`controls_forEach`,message0:`%{BKY_CONTROLS_FOREACH_TITLE}`,args0:[{type:`field_variable`,name:`VAR`,variable:null},{type:`input_value`,name:`LIST`,check:`Array`,ariaLabelText:`%{BKY_INPUT_LABEL_LOOP_LIST}`}],message1:`%{BKY_CONTROLS_REPEAT_INPUT_DO} %1`,args1:[{type:`input_statement`,name:`DO`}],previousStatement:null,nextStatement:null,style:`loop_blocks`,helpUrl:`%{BKY_CONTROLS_FOREACH_HELPURL}`,extensions:[`contextMenu_newGetVariableBlock`,`controls_forEach_tooltip`]},{type:`controls_flow_statements`,message0:`%1`,args0:[{type:`field_dropdown`,name:`FLOW`,options:[[`%{BKY_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK}`,`BREAK`],[`%{BKY_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE}`,`CONTINUE`]]}],previousStatement:null,style:`loop_blocks`,helpUrl:`%{BKY_CONTROLS_FLOW_STATEMENTS_HELPURL}`,suppressPrefixSuffix:!0,extensions:[`controls_flow_tooltip`,`controls_flow_in_loop_check`]}]);t.oh(`controls_whileUntil_tooltip`,t.yh(`MODE`,{WHILE:`%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_WHILE}`,UNTIL:`%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}`})),t.oh(`controls_flow_tooltip`,t.yh(`FLOW`,{BREAK:`%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK}`,CONTINUE:`%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}`})),t.ph(`contextMenu_newGetVariableBlock`,{customContextMenu:function(e){if(!this.isInFlyout){var n=this.getField(`VAR`),r=n.getVariable().getName();this.isCollapsed()||r===null||(n={type:`variables_get`,fields:{VAR:n.saveState(!0)}},e.push({enabled:!0,text:t.C.VARIABLES_SET_CREATE_GET.replace(`%1`,r),callback:t.Pg(this,n)}))}}}),t.oh(`controls_for_tooltip`,t.Ah(`%{BKY_CONTROLS_FOR_TOOLTIP}`,`VAR`)),t.oh(`controls_forEach_tooltip`,t.Ah(`%{BKY_CONTROLS_FOREACH_TOOLTIP}`,`VAR`));var S=new Set([`controls_repeat`,`controls_repeat_ext`,`controls_forEach`,`controls_for`,`controls_whileUntil`]);t.ph(`controls_flow_in_loop_check`,{getSurroundLoop:function(){var e=this;do{if(S.has(e.type))return e;e=e.getSurroundParent()}while(e);return null},onchange:function(e){var n=this.workspace;if(n.isDragging&&!n.isDragging()&&(e.type===t.nm||e.type===t.Od)&&(e=!!this.getSurroundLoop(),this.setWarningText(e?null:t.C.CONTROLS_FLOW_STATEMENTS_WARNING),!this.isInFlyout))try{t.Qc=!1,this.setDisabledReason(!e,`CONTROL_FLOW_NOT_IN_LOOP`)}finally{t.Qc=!0}}}),t.Ab(x);var C={blocks:x,loopTypes:S},w=t.yb([{type:`logic_boolean`,message0:`%1`,args0:[{type:`field_dropdown`,name:`BOOL`,options:[[`%{BKY_LOGIC_BOOLEAN_TRUE}`,`TRUE`],[`%{BKY_LOGIC_BOOLEAN_FALSE}`,`FALSE`]]}],output:`Boolean`,style:`logic_blocks`,tooltip:`%{BKY_LOGIC_BOOLEAN_TOOLTIP}`,helpUrl:`%{BKY_LOGIC_BOOLEAN_HELPURL}`},{type:`controls_if`,message0:`%{BKY_CONTROLS_IF_MSG_IF} %1`,args0:[{type:`input_value`,name:`IF0`,check:`Boolean`}],message1:`%{BKY_CONTROLS_IF_MSG_THEN} %1`,args1:[{type:`input_statement`,name:`DO0`}],previousStatement:null,nextStatement:null,style:`logic_blocks`,helpUrl:`%{BKY_CONTROLS_IF_HELPURL}`,suppressPrefixSuffix:!0,mutator:`controls_if_mutator`,extensions:[`controls_if_tooltip`]},{type:`controls_ifelse`,message0:`%{BKY_CONTROLS_IF_MSG_IF} %1`,args0:[{type:`input_value`,name:`IF0`,check:`Boolean`}],message1:`%{BKY_CONTROLS_IF_MSG_THEN} %1`,args1:[{type:`input_statement`,name:`DO0`}],message2:`%{BKY_CONTROLS_IF_MSG_ELSE} %1`,args2:[{type:`input_statement`,name:`ELSE`}],previousStatement:null,nextStatement:null,style:`logic_blocks`,tooltip:`%{BKY_CONTROLS_IF_TOOLTIP_2}`,helpUrl:`%{BKY_CONTROLS_IF_HELPURL}`,suppressPrefixSuffix:!0},{type:`logic_compare`,message0:`%1 %2 %3`,args0:[{type:`input_value`,name:`A`,ariaLabelText:`%{BKY_INPUT_LABEL_VALUE_A}`},{type:`field_dropdown`,name:`OP`,options:[[`=`,`EQ`,`%{BKY_LOGIC_COMPARE_EQ_ARIA}`],[`≠`,`NEQ`,`%{BKY_LOGIC_COMPARE_NEQ_ARIA}`],[`‏<`,`LT`,`%{BKY_LOGIC_COMPARE_LT_ARIA}`],[`‏≤`,`LTE`,`%{BKY_LOGIC_COMPARE_LTE_ARIA}`],[`‏>`,`GT`,`%{BKY_LOGIC_COMPARE_GT_ARIA}`],[`‏≥`,`GTE`,`%{BKY_LOGIC_COMPARE_GTE_ARIA}`]]},{type:`input_value`,name:`B`,ariaLabelText:`%{BKY_INPUT_LABEL_VALUE_B}`}],inputsInline:!0,output:`Boolean`,style:`logic_blocks`,helpUrl:`%{BKY_LOGIC_COMPARE_HELPURL}`,extensions:[`logic_compare`,`logic_op_tooltip`]},{type:`logic_operation`,message0:`%1 %2 %3`,args0:[{type:`input_value`,name:`A`,check:`Boolean`,ariaLabelText:`%{BKY_INPUT_LABEL_CONDITION_A}`},{type:`field_dropdown`,name:`OP`,options:[[`%{BKY_LOGIC_OPERATION_AND}`,`AND`],[`%{BKY_LOGIC_OPERATION_OR}`,`OR`]]},{type:`input_value`,name:`B`,check:`Boolean`,ariaLabelText:`%{BKY_INPUT_LABEL_CONDITION_B}`}],inputsInline:!0,output:`Boolean`,style:`logic_blocks`,helpUrl:`%{BKY_LOGIC_OPERATION_HELPURL}`,extensions:[`logic_op_tooltip`]},{type:`logic_negate`,message0:`%{BKY_LOGIC_NEGATE_TITLE}`,args0:[{type:`input_value`,name:`BOOL`,check:`Boolean`}],output:`Boolean`,style:`logic_blocks`,tooltip:`%{BKY_LOGIC_NEGATE_TOOLTIP}`,helpUrl:`%{BKY_LOGIC_NEGATE_HELPURL}`},{type:`logic_null`,message0:`%{BKY_LOGIC_NULL}`,output:null,style:`logic_blocks`,tooltip:`%{BKY_LOGIC_NULL_TOOLTIP}`,helpUrl:`%{BKY_LOGIC_NULL_HELPURL}`},{type:`logic_ternary`,message0:`%{BKY_LOGIC_TERNARY_CONDITION} %1`,args0:[{type:`input_value`,name:`IF`,check:`Boolean`}],message1:`%{BKY_LOGIC_TERNARY_IF_TRUE} %1`,args1:[{type:`input_value`,name:`THEN`}],message2:`%{BKY_LOGIC_TERNARY_IF_FALSE} %1`,args2:[{type:`input_value`,name:`ELSE`}],output:null,style:`logic_blocks`,tooltip:`%{BKY_LOGIC_TERNARY_TOOLTIP}`,helpUrl:`%{BKY_LOGIC_TERNARY_HELPURL}`,extensions:[`logic_ternary`]},{type:`controls_if_if`,message0:`%{BKY_CONTROLS_IF_IF_TITLE_IF}`,nextStatement:null,enableContextMenu:!1,style:`logic_blocks`,tooltip:`%{BKY_CONTROLS_IF_IF_TOOLTIP}`},{type:`controls_if_elseif`,message0:`%{BKY_CONTROLS_IF_ELSEIF_TITLE_ELSEIF}`,previousStatement:null,nextStatement:null,enableContextMenu:!1,style:`logic_blocks`,tooltip:`%{BKY_CONTROLS_IF_ELSEIF_TOOLTIP}`},{type:`controls_if_else`,message0:`%{BKY_CONTROLS_IF_ELSE_TITLE_ELSE}`,previousStatement:null,enableContextMenu:!1,style:`logic_blocks`,tooltip:`%{BKY_CONTROLS_IF_ELSE_TOOLTIP}`}]);t.oh(`logic_op_tooltip`,t.yh(`OP`,{EQ:`%{BKY_LOGIC_COMPARE_TOOLTIP_EQ}`,NEQ:`%{BKY_LOGIC_COMPARE_TOOLTIP_NEQ}`,LT:`%{BKY_LOGIC_COMPARE_TOOLTIP_LT}`,LTE:`%{BKY_LOGIC_COMPARE_TOOLTIP_LTE}`,GT:`%{BKY_LOGIC_COMPARE_TOOLTIP_GT}`,GTE:`%{BKY_LOGIC_COMPARE_TOOLTIP_GTE}`,AND:`%{BKY_LOGIC_OPERATION_TOOLTIP_AND}`,OR:`%{BKY_LOGIC_OPERATION_TOOLTIP_OR}`})),t.th(`controls_if_mutator`,{elseifCount_:0,elseCount_:0,mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var e=t.rc(`mutation`);return this.elseifCount_&&e.setAttribute(`elseif`,String(this.elseifCount_)),this.elseCount_&&e.setAttribute(`else`,`1`),e},domToMutation:function(e){this.elseifCount_=parseInt(e.getAttribute(`elseif`),10)||0,this.elseCount_=parseInt(e.getAttribute(`else`),10)||0,this.rebuildShape_()},saveExtraState:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var e=Object.create(null);return this.elseifCount_&&(e.elseIfCount=this.elseifCount_),this.elseCount_&&(e.hasElse=!0),e},loadExtraState:function(e){this.elseifCount_=e.elseIfCount||0,this.elseCount_=+!!e.hasElse,this.updateShape_()},decompose:function(e){var t=e.newBlock(`controls_if_if`);t.initSvg();var n=t.nextConnection;for(let t=1;t<=this.elseifCount_;t++){let t=e.newBlock(`controls_if_elseif`);t.initSvg(),n.connect(t.previousConnection),n=t.nextConnection}return this.elseCount_&&(e=e.newBlock(`controls_if_else`),e.initSvg(),n.connect(e.previousConnection)),t},compose:function(e){e=e.nextConnection.targetBlock(),this.elseCount_=this.elseifCount_=0;for(var t=[null],n=[null],r=null;e;){if(!e.isInsertionMarker())switch(e.type){case`controls_if_elseif`:this.elseifCount_++,t.push(e.valueConnection_),n.push(e.statementConnection_);break;case`controls_if_else`:this.elseCount_++,r=e.statementConnection_;break;default:throw TypeError(`Unknown block type: `+e.type)}e=e.getNextBlock()}this.updateShape_(),this.reconnectChildBlocks_(t,n,r)},saveConnections:function(e){e=e.nextConnection.targetBlock();for(var t=1;e;){if(!e.isInsertionMarker())switch(e.type){case`controls_if_elseif`:var n=this.getInput(`IF`+t);let r=this.getInput(`DO`+t);e.valueConnection_=n&&n.connection.targetConnection,e.statementConnection_=r&&r.connection.targetConnection,t++;break;case`controls_if_else`:n=this.getInput(`ELSE`),e.statementConnection_=n&&n.connection.targetConnection;break;default:throw TypeError(`Unknown block type: `+e.type)}e=e.getNextBlock()}},rebuildShape_:function(){var e=[null],t=[null],n=null;this.getInput(`ELSE`)&&(n=this.getInput(`ELSE`).connection.targetConnection);for(let n=1;this.getInput(`IF`+n);n++){let r=this.getInput(`IF`+n),i=this.getInput(`DO`+n);e.push(r.connection.targetConnection),t.push(i.connection.targetConnection)}this.updateShape_(),this.reconnectChildBlocks_(e,t,n)},updateShape_:function(){this.getInput(`ELSE`)&&this.removeInput(`ELSE`);for(var e=1;this.getInput(`IF`+e);e++)this.removeInput(`IF`+e),this.removeInput(`DO`+e);for(e=1;e<=this.elseifCount_;e++)this.appendValueInput(`IF`+e).setCheck(`Boolean`).appendField(t.C.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput(`DO`+e).appendField(t.C.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput(`ELSE`).appendField(t.C.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(e,t,n){for(let n=1;n<=this.elseifCount_;n++){let r;(r=e[n])==null||r.reconnect(this,`IF`+n);let i;(i=t[n])==null||i.reconnect(this,`DO`+n)}n==null||n.reconnect(this,`ELSE`)}},null,[`controls_if_elseif`,`controls_if_else`]),t.oh(`controls_if_tooltip`,function(){this.setTooltip(function(){if(this.elseifCount_||this.elseCount_){if(!this.elseifCount_&&this.elseCount_)return t.C.CONTROLS_IF_TOOLTIP_2;if(this.elseifCount_&&!this.elseCount_)return t.C.CONTROLS_IF_TOOLTIP_3;if(this.elseifCount_&&this.elseCount_)return t.C.CONTROLS_IF_TOOLTIP_4}else return t.C.CONTROLS_IF_TOOLTIP_1;return``}.bind(this))});var T={onchange:function(e){this.prevBlocks_||=[null,null];var n=this.getInputTargetBlock(`A`),r=this.getInputTargetBlock(`B`);n&&r&&!this.workspace.connectionChecker.doTypeChecks(n.outputConnection,r.outputConnection)&&(t.B(e.group),e=this.prevBlocks_[0],e!==n&&(n.unplug(),!e||e.isDisposed()||e.isShadow()||this.getInput(`A`).connection.connect(e.outputConnection)),n=this.prevBlocks_[1],n!==r&&(r.unplug(),!n||n.isDisposed()||n.isShadow()||this.getInput(`B`).connection.connect(n.outputConnection)),this.bumpNeighbours(),t.B(!1)),this.prevBlocks_[0]=this.getInputTargetBlock(`A`),this.prevBlocks_[1]=this.getInputTargetBlock(`B`)}};t.oh(`logic_compare`,function(){this.mixin(T)}),t.ph(`logic_ternary`,{prevParentConnection_:null,onchange:function(e){var n=this.getInputTargetBlock(`THEN`),r=this.getInputTargetBlock(`ELSE`),i=this.outputConnection.targetConnection;if((n||r)&&i)for(let a=0;a<2;a++){let o=a===1?n:r;o&&!o.workspace.connectionChecker.doTypeChecks(o.outputConnection,i)&&(t.B(e.group),i===this.prevParentConnection_?(this.unplug(),i.getSourceBlock().bumpNeighbours()):(o.unplug(),o.bumpNeighbours()),t.B(!1))}this.prevParentConnection_=i}}),t.Ab(w);var E={blocks:w},D=t.yb([{type:`lists_create_empty`,message0:`%{BKY_LISTS_CREATE_EMPTY_TITLE}`,output:`Array`,style:`list_blocks`,tooltip:`%{BKY_LISTS_CREATE_EMPTY_TOOLTIP}`,helpUrl:`%{BKY_LISTS_CREATE_EMPTY_HELPURL}`},{type:`lists_repeat`,message0:`%{BKY_LISTS_REPEAT_TITLE}`,args0:[{type:`input_value`,name:`ITEM`,ariaLabelText:`%{BKY_INPUT_LABEL_LISTS_REPEAT_ITEM}`},{type:`input_value`,name:`NUM`,check:`Number`,ariaLabelText:`%{BKY_INPUT_LABEL_LISTS_REPEAT_NUM}`}],output:`Array`,style:`list_blocks`,tooltip:`%{BKY_LISTS_REPEAT_TOOLTIP}`,helpUrl:`%{BKY_LISTS_REPEAT_HELPURL}`},{type:`lists_reverse`,message0:`%{BKY_LISTS_REVERSE_MESSAGE0}`,args0:[{type:`input_value`,name:`LIST`,check:`Array`,ariaLabelText:`%{BKY_INPUT_LABEL_LISTS_TO_CHANGE}`}],output:`Array`,inputsInline:!0,style:`list_blocks`,tooltip:`%{BKY_LISTS_REVERSE_TOOLTIP}`,helpUrl:`%{BKY_LISTS_REVERSE_HELPURL}`},{type:`lists_isEmpty`,message0:`%{BKY_LISTS_ISEMPTY_TITLE}`,args0:[{type:`input_value`,name:`VALUE`,check:[`String`,`Array`],ariaLabelText:`%{BKY_INPUT_LABEL_LISTS_TO_CHECK}`}],output:`Boolean`,style:`list_blocks`,tooltip:`%{BKY_LISTS_ISEMPTY_TOOLTIP}`,helpUrl:`%{BKY_LISTS_ISEMPTY_HELPURL}`},{type:`lists_length`,message0:`%{BKY_LISTS_LENGTH_TITLE}`,args0:[{type:`input_value`,name:`VALUE`,check:[`String`,`Array`],ariaLabelText:`%{BKY_INPUT_LABEL_LISTS_TO_CHECK}`}],output:`Number`,style:`list_blocks`,tooltip:`%{BKY_LISTS_LENGTH_TOOLTIP}`,helpUrl:`%{BKY_LISTS_LENGTH_HELPURL}`}]);D.lists_create_with={init:function(){this.setHelpUrl(t.C.LISTS_CREATE_WITH_HELPURL),this.setStyle(`list_blocks`),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,`Array`),this.setMutator(new t.sh([`lists_create_with_item`],this)),this.setTooltip(t.C.LISTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var e=t.rc(`mutation`);return e.setAttribute(`items`,String(this.itemCount_)),e},domToMutation:function(e){if(e=e.getAttribute(`items`),!e)throw TypeError(`element did not have items`);this.itemCount_=parseInt(e,10),this.updateShape_()},saveExtraState:function(){return{itemCount:this.itemCount_}},loadExtraState:function(e){this.itemCount_=e.itemCount,this.updateShape_()},decompose:function(e){var t=e.newBlock(`lists_create_with_container`);t.initSvg();var n=t.getInput(`STACK`).connection;for(let t=0;tt.C.LISTS_INDEX_OF_TOOLTIP.replace(`%1`,this.workspace.options.oneBasedIndex?`0`:`-1`))}},D.lists_getIndex={init:function(){var e=[[t.C.LISTS_GET_INDEX_GET,`GET`],[t.C.LISTS_GET_INDEX_GET_REMOVE,`GET_REMOVE`],[t.C.LISTS_GET_INDEX_REMOVE,`REMOVE`]];this.WHERE_OPTIONS=[[t.C.LISTS_GET_INDEX_FROM_START,`FROM_START`],[t.C.LISTS_GET_INDEX_FROM_END,`FROM_END`],[t.C.LISTS_GET_INDEX_FIRST,`FIRST`],[t.C.LISTS_GET_INDEX_LAST,`LAST`],[t.C.LISTS_GET_INDEX_RANDOM,`RANDOM`]],this.setHelpUrl(t.C.LISTS_GET_INDEX_HELPURL),this.setStyle(`list_blocks`),e=t.lh({type:`field_dropdown`,options:e}),e.setValidator(function(e){e=e===`REMOVE`,this.getSourceBlock().updateStatement_(e)}),this.appendValueInput(`VALUE`).setCheck(`Array`).appendField(t.C.LISTS_GET_INDEX_INPUT_IN_LIST).setAriaLabelProvider(t.C.INPUT_LABEL_LISTS_TO_CHECK),this.appendDummyInput().appendField(e,`MODE`).appendField(``,`SPACE`),e=t.lh({type:`field_dropdown`,options:this.WHERE_OPTIONS}),e.setValidator(function(e){var t=this.getValue();e=e===`FROM_START`||e===`FROM_END`,e!==(t===`FROM_START`||t===`FROM_END`)&&this.getSourceBlock().updateAt_(e)}),this.appendDummyInput().appendField(e,`WHERE`),this.appendDummyInput(`AT`),t.C.LISTS_GET_INDEX_TAIL&&this.appendDummyInput(`TAIL`).appendField(t.C.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0),this.setTooltip(()=>{var e=this.getFieldValue(`MODE`),n=this.getFieldValue(`WHERE`),r=``;switch(e+` `+n){case`GET FROM_START`:case`GET FROM_END`:r=t.C.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case`GET FIRST`:r=t.C.LISTS_GET_INDEX_TOOLTIP_GET_FIRST;break;case`GET LAST`:r=t.C.LISTS_GET_INDEX_TOOLTIP_GET_LAST;break;case`GET RANDOM`:r=t.C.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case`GET_REMOVE FROM_START`:case`GET_REMOVE FROM_END`:r=t.C.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case`GET_REMOVE FIRST`:r=t.C.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST;break;case`GET_REMOVE LAST`:r=t.C.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST;break;case`GET_REMOVE RANDOM`:r=t.C.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM;break;case`REMOVE FROM_START`:case`REMOVE FROM_END`:r=t.C.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM;break;case`REMOVE FIRST`:r=t.C.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST;break;case`REMOVE LAST`:r=t.C.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST;break;case`REMOVE RANDOM`:r=t.C.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM}return(n===`FROM_START`||n===`FROM_END`)&&(r+=` `+(n===`FROM_START`?t.C.LISTS_INDEX_FROM_START_TOOLTIP:t.C.LISTS_INDEX_FROM_END_TOOLTIP).replace(`%1`,this.workspace.options.oneBasedIndex?`#1`:`#0`)),r})},mutationToDom:function(){var e=t.rc(`mutation`);e.setAttribute(`statement`,String(!this.outputConnection));var n=this.getInput(`AT`)instanceof t.Nn;return e.setAttribute(`at`,String(n)),e},domToMutation:function(e){var t=e.getAttribute(`statement`)===`true`;this.updateStatement_(t),e=e.getAttribute(`at`)!==`false`,this.updateAt_(e)},saveExtraState:function(){return this.outputConnection?null:{isStatement:!0}},loadExtraState:function(e){e.isStatement?this.updateStatement_(!0):typeof e==`string`&&this.domToMutation(t.uc(e))},updateStatement_:function(e){e!==!this.outputConnection&&(this.unplug(!0,!0),e?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(e){this.removeInput(`AT`),this.removeInput(`ORDINAL`,!0),e?(this.appendValueInput(`AT`).setCheck(`Number`).setAriaLabelProvider(t.C.INPUT_LABEL_LISTS_POSITION),t.C.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput(`ORDINAL`).appendField(t.C.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput(`AT`),t.C.LISTS_GET_INDEX_TAIL&&this.moveInputBefore(`TAIL`,null)}},D.lists_setIndex={init:function(){var e=[[t.C.LISTS_SET_INDEX_SET,`SET`],[t.C.LISTS_SET_INDEX_INSERT,`INSERT`]];this.WHERE_OPTIONS=[[t.C.LISTS_GET_INDEX_FROM_START,`FROM_START`],[t.C.LISTS_GET_INDEX_FROM_END,`FROM_END`],[t.C.LISTS_GET_INDEX_FIRST,`FIRST`],[t.C.LISTS_GET_INDEX_LAST,`LAST`],[t.C.LISTS_GET_INDEX_RANDOM,`RANDOM`]],this.setHelpUrl(t.C.LISTS_SET_INDEX_HELPURL),this.setStyle(`list_blocks`),this.appendValueInput(`LIST`).setCheck(`Array`).appendField(t.C.LISTS_SET_INDEX_INPUT_IN_LIST).setAriaLabelProvider(t.C.INPUT_LABEL_LISTS_TO_CHECK),e=t.lh({type:`field_dropdown`,options:e}),this.appendDummyInput().appendField(e,`MODE`).appendField(``,`SPACE`),e=t.lh({type:`field_dropdown`,options:this.WHERE_OPTIONS}),e.setValidator(function(e){var t=this.getValue();e=e===`FROM_START`||e===`FROM_END`,e!==(t===`FROM_START`||t===`FROM_END`)&&this.getSourceBlock().updateAt_(e)}),this.appendDummyInput().appendField(e,`WHERE`),this.appendDummyInput(`AT`),this.appendValueInput(`TO`).appendField(t.C.LISTS_SET_INDEX_INPUT_TO).setAriaLabelProvider(t.C.INPUT_LABEL_LISTS_VALUE_TO_SET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(t.C.LISTS_SET_INDEX_TOOLTIP),this.updateAt_(!0),this.setTooltip(()=>{var e=this.getFieldValue(`MODE`),n=this.getFieldValue(`WHERE`),r=``;switch(e+` `+n){case`SET FROM_START`:case`SET FROM_END`:r=t.C.LISTS_SET_INDEX_TOOLTIP_SET_FROM;break;case`SET FIRST`:r=t.C.LISTS_SET_INDEX_TOOLTIP_SET_FIRST;break;case`SET LAST`:r=t.C.LISTS_SET_INDEX_TOOLTIP_SET_LAST;break;case`SET RANDOM`:r=t.C.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM;break;case`INSERT FROM_START`:case`INSERT FROM_END`:r=t.C.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM;break;case`INSERT FIRST`:r=t.C.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST;break;case`INSERT LAST`:r=t.C.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST;break;case`INSERT RANDOM`:r=t.C.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM}return(n===`FROM_START`||n===`FROM_END`)&&(r+=` `+t.C.LISTS_INDEX_FROM_START_TOOLTIP.replace(`%1`,this.workspace.options.oneBasedIndex?`#1`:`#0`)),r})},mutationToDom:function(){var e=t.rc(`mutation`),n=this.getInput(`AT`)instanceof t.Nn;return e.setAttribute(`at`,String(n)),e},domToMutation:function(e){e=e.getAttribute(`at`)!==`false`,this.updateAt_(e)},saveExtraState:function(){return null},loadExtraState:function(){},updateAt_:function(e){this.removeInput(`AT`),this.removeInput(`ORDINAL`,!0),e?(this.appendValueInput(`AT`).setCheck(`Number`).setAriaLabelProvider(t.C.INPUT_LABEL_LISTS_POSITION),t.C.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput(`ORDINAL`).appendField(t.C.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput(`AT`),this.moveInputBefore(`AT`,`TO`),this.getInput(`ORDINAL`)&&this.moveInputBefore(`ORDINAL`,`TO`)}},D.lists_getSublist={init:function(){this.WHERE_OPTIONS_1=[[t.C.LISTS_GET_SUBLIST_START_FROM_START,`FROM_START`],[t.C.LISTS_GET_SUBLIST_START_FROM_END,`FROM_END`],[t.C.LISTS_GET_SUBLIST_START_FIRST,`FIRST`]],this.WHERE_OPTIONS_2=[[t.C.LISTS_GET_SUBLIST_END_FROM_START,`FROM_START`],[t.C.LISTS_GET_SUBLIST_END_FROM_END,`FROM_END`],[t.C.LISTS_GET_SUBLIST_END_LAST,`LAST`]],this.setHelpUrl(t.C.LISTS_GET_SUBLIST_HELPURL),this.setStyle(`list_blocks`),this.appendValueInput(`LIST`).setCheck(`Array`).appendField(t.C.LISTS_GET_SUBLIST_INPUT_IN_LIST).setAriaLabelProvider(t.C.INPUT_LABEL_LISTS_TO_CHECK);var e=e=>{var n=t.lh({type:`field_dropdown`,options:this[`WHERE_OPTIONS_`+e]});return n.setValidator(function(t){var n=this.getValue();t=t===`FROM_START`||t===`FROM_END`,t!==(n===`FROM_START`||n===`FROM_END`)&&this.getSourceBlock().updateAt_(e,t)}),n};this.appendDummyInput(`WHERE1_INPUT`).appendField(e(1),`WHERE1`),this.appendDummyInput(`AT1`),this.appendDummyInput(`WHERE2_INPUT`).appendField(e(2),`WHERE2`),this.appendDummyInput(`AT2`),t.C.LISTS_GET_SUBLIST_TAIL&&this.appendDummyInput(`TAIL`).appendField(t.C.LISTS_GET_SUBLIST_TAIL),this.setInputsInline(!0),this.setOutput(!0,`Array`),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(t.C.LISTS_GET_SUBLIST_TOOLTIP)},mutationToDom:function(){var e=t.rc(`mutation`),n=this.getInput(`AT1`)instanceof t.Nn;return e.setAttribute(`at1`,String(n)),n=this.getInput(`AT2`)instanceof t.Nn,e.setAttribute(`at2`,String(n)),e},domToMutation:function(e){var t=e.getAttribute(`at1`)===`true`;e=e.getAttribute(`at2`)===`true`,this.updateAt_(1,t),this.updateAt_(2,e)},saveExtraState:function(){return null},loadExtraState:function(){},updateAt_:function(e,n){this.removeInput(`AT`+e),this.removeInput(`ORDINAL`+e,!0),n?(this.appendValueInput(`AT`+e).setCheck(`Number`).setAriaLabelProvider(e===1?t.C.INPUT_LABEL_LISTS_START_POSITION:t.C.INPUT_LABEL_LISTS_END_POSITION),t.C.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput(`ORDINAL`+e).appendField(t.C.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput(`AT`+e),e===1&&(this.moveInputBefore(`AT1`,`WHERE2_INPUT`),this.getInput(`ORDINAL1`)&&this.moveInputBefore(`ORDINAL1`,`WHERE2_INPUT`)),t.C.LISTS_GET_SUBLIST_TAIL&&this.moveInputBefore(`TAIL`,null)}},D.lists_sort={init:function(){this.jsonInit({message0:`%{BKY_LISTS_SORT_TITLE}`,args0:[{type:`field_dropdown`,name:`TYPE`,options:[[`%{BKY_LISTS_SORT_TYPE_NUMERIC}`,`NUMERIC`],[`%{BKY_LISTS_SORT_TYPE_TEXT}`,`TEXT`],[`%{BKY_LISTS_SORT_TYPE_IGNORECASE}`,`IGNORE_CASE`]]},{type:`field_dropdown`,name:`DIRECTION`,options:[[`%{BKY_LISTS_SORT_ORDER_ASCENDING}`,`1`],[`%{BKY_LISTS_SORT_ORDER_DESCENDING}`,`-1`]]},{type:`input_value`,name:`LIST`,check:`Array`,ariaLabelText:t.C.INPUT_LABEL_LISTS_TO_CHANGE}],output:`Array`,style:`list_blocks`,tooltip:`%{BKY_LISTS_SORT_TOOLTIP}`,helpUrl:`%{BKY_LISTS_SORT_HELPURL}`})}},D.lists_split={init:function(){var e=t.lh({type:`field_dropdown`,options:[[t.C.LISTS_SPLIT_LIST_FROM_TEXT,`SPLIT`],[t.C.LISTS_SPLIT_TEXT_FROM_LIST,`JOIN`]]});if(!e)throw Error(`field_dropdown not found`);e.setValidator(e=>{this.updateType_(e)}),this.setHelpUrl(t.C.LISTS_SPLIT_HELPURL),this.setStyle(`list_blocks`),this.appendValueInput(`INPUT`).setCheck(`String`).appendField(e,`MODE`).setAriaLabelProvider(()=>{var e=this.getFieldValue(`MODE`);if(e===`SPLIT`)return t.C.INPUT_LABEL_LISTS_LIST_FROM_TEXT;if(e===`JOIN`)return t.C.INPUT_LABEL_LISTS_TEXT_FROM_LIST}),this.appendValueInput(`DELIM`).setCheck(`String`).appendField(t.C.INPUT_LABEL_LISTS_DELIMITER).setAriaLabelProvider(t.C.INPUT_LABEL_LISTS_SPLIT_WITH_DELIMITER),this.setInputsInline(!0),this.setOutput(!0,`Array`),this.setTooltip(()=>{var e=this.getFieldValue(`MODE`);if(e===`SPLIT`)return t.C.LISTS_SPLIT_TOOLTIP_SPLIT;if(e===`JOIN`)return t.C.LISTS_SPLIT_TOOLTIP_JOIN;throw Error(`Unknown mode: `+e)})},updateType_:function(e){if(this.getFieldValue(`MODE`)!==e){let e=this.getInput(`INPUT`).connection;e.setShadowDom(null);let t=e.targetBlock();t&&(e.disconnect(),t.isShadow()?t.dispose(!1):this.bumpNeighbours())}e===`SPLIT`?(this.outputConnection.setCheck(`Array`),this.getInput(`INPUT`).setCheck(`String`)):(this.outputConnection.setCheck(`String`),this.getInput(`INPUT`).setCheck(`Array`))},mutationToDom:function(){var e=t.rc(`mutation`);return e.setAttribute(`mode`,this.getFieldValue(`MODE`)),e},domToMutation:function(e){this.updateType_(e.getAttribute(`mode`))},saveExtraState:function(){return{mode:this.getFieldValue(`MODE`)}},loadExtraState:function(e){this.updateType_(e.mode)}},t.Ab(D);var O={blocks:D};return t.__chunk_blocks={blocks:Object.assign({},D,w,x,y,m,u,c,o),lists:O,logic:E,loops:C,math:b,procedures:v,texts:p,variables:l,variablesDynamic:s},t.__chunk_blocks.__namespace__=t,t.__chunk_blocks})}))(),1).default,{JavascriptGenerator:Rh,Order:zh,javascriptGenerator:Bh}=t(r(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=r(fn()):(n.javascript=r(n.Blockly),n.Blockly.JavaScript=n.javascript.javascriptGenerator)})(e,function(e){var t=e.__namespace__,n=function(e,t,n){return t===`FIRST`?`0`:t===`FROM_END`?e+`.length - 1 - `+n:t===`LAST`?e+`.length - 1`:n},r=function(e,t){var n=0,r=``;t.STATEMENT_PREFIX&&(r+=t.injectId(t.STATEMENT_PREFIX,e));do{let i=t.valueToCode(e,`IF`+n,f.NONE)||`false`,a=t.statementToCode(e,`DO`+n);t.STATEMENT_SUFFIX&&(a=t.prefixLines(t.injectId(t.STATEMENT_SUFFIX,e),t.INDENT)+a),r+=(n>0?` else `:``)+`if (`+i+`) { +`+a+`}`,n++}while(e.getInput(`IF`+n));return(e.getInput(`ELSE`)||t.STATEMENT_SUFFIX)&&(n=e.getInput(`ELSE`)?t.statementToCode(e,`ELSE`):``,t.STATEMENT_SUFFIX&&(n=t.prefixLines(t.injectId(t.STATEMENT_SUFFIX,e),t.INDENT)+n),r+=` else { +`+n+`}`),r+` +`},i=function(e,n){var r=e.getField(`TIMES`)?String(Number(e.getFieldValue(`TIMES`))):n.valueToCode(e,`TIMES`,f.ASSIGNMENT)||`0`,i=n.statementToCode(e,`DO`);i=n.addLoopTrap(i,e),e=``;var a=n.nameDB_.getDistinctName(`count`,t.P.VARIABLE),o=r;return r.match(/^\w+$/)||t.zf(r)||(o=n.nameDB_.getDistinctName(`repeat_end`,t.P.VARIABLE),e+=`var `+o+` = `+r+`; +`),e+(`for (var `+a+` = 0; `+a+` < `+o+`; `+a+`++) { +`+i+`} +`)},a=function(e,t){var n=e.getFieldValue(`OP`);if(n===`NEG`)return e=t.valueToCode(e,`NUM`,f.UNARY_NEGATION)||`0`,e[0]===`-`&&(e=` `+e),[`-`+e,f.UNARY_NEGATION];switch(e=n===`SIN`||n===`COS`||n===`TAN`?t.valueToCode(e,`NUM`,f.DIVISION)||`0`:t.valueToCode(e,`NUM`,f.NONE)||`0`,n){case`ABS`:var r=`Math.abs(`+e+`)`;break;case`ROOT`:r=`Math.sqrt(`+e+`)`;break;case`LN`:r=`Math.log(`+e+`)`;break;case`EXP`:r=`Math.exp(`+e+`)`;break;case`POW10`:r=`Math.pow(10,`+e+`)`;break;case`ROUND`:r=`Math.round(`+e+`)`;break;case`ROUNDUP`:r=`Math.ceil(`+e+`)`;break;case`ROUNDDOWN`:r=`Math.floor(`+e+`)`;break;case`SIN`:r=`Math.sin(`+e+` / 180 * Math.PI)`;break;case`COS`:r=`Math.cos(`+e+` / 180 * Math.PI)`;break;case`TAN`:r=`Math.tan(`+e+` / 180 * Math.PI)`}if(r)return[r,f.FUNCTION_CALL];switch(n){case`LOG10`:r=`Math.log(`+e+`) / Math.log(10)`;break;case`ASIN`:r=`Math.asin(`+e+`) / Math.PI * 180`;break;case`ACOS`:r=`Math.acos(`+e+`) / Math.PI * 180`;break;case`ATAN`:r=`Math.atan(`+e+`) / Math.PI * 180`;break;default:throw Error(`Unknown math operator: `+n)}return[r,f.DIVISION]},o=function(e,t){var n=t.getProcedureName(e.getFieldValue(`NAME`)),r=``;t.STATEMENT_PREFIX&&(r+=t.injectId(t.STATEMENT_PREFIX,e)),t.STATEMENT_SUFFIX&&(r+=t.injectId(t.STATEMENT_SUFFIX,e)),r&&=t.prefixLines(r,t.INDENT);var i=``;t.INFINITE_LOOP_TRAP&&(i=t.prefixLines(t.injectId(t.INFINITE_LOOP_TRAP,e),t.INDENT));var a=``;e.getInput(`STACK`)&&(a=t.statementToCode(e,`STACK`));var o=``;e.getInput(`RETURN`)&&(o=t.valueToCode(e,`RETURN`,f.NONE)||``);var s=``;a&&o&&(s=r),o&&=t.INDENT+`return `+o+`; +`;var c=[],l=e.getVarModels();for(let e=0;e0?s=f.ADDITION:r<0?s=f.SUBTRACTION:i&&(s=f.UNARY_NEGATION),e=this.valueToCode(e,n,s)||o,r===0&&!i?e:t.zf(e)?(e=String(Number(e)+r),i&&(e=String(-Number(e))),e):(r>0?e=`${e} + ${r}`:r<0&&(e=`${e} - ${-r}`),i&&(e=r?`-(${e})`:`-${e}`),Math.floor(a)>=Math.floor(s)&&(e=`(${e})`),e)}},h={};h.controls_if=r,h.controls_ifelse=r,h.logic_boolean=function(e){return[e.getFieldValue(`BOOL`)===`TRUE`?`true`:`false`,f.ATOMIC]},h.logic_compare=function(e,t){var n={EQ:`==`,NEQ:`!=`,LT:`<`,LTE:`<=`,GT:`>`,GTE:`>=`}[e.getFieldValue(`OP`)],r=n===`==`||n===`!=`?f.EQUALITY:f.RELATIONAL,i=t.valueToCode(e,`A`,r)||`0`;return e=t.valueToCode(e,`B`,r)||`0`,[i+` `+n+` `+e,r]},h.logic_negate=function(e,t){var n=f.LOGICAL_NOT;return[`!`+(t.valueToCode(e,`BOOL`,n)||`true`),n]},h.logic_null=function(){return[`null`,f.ATOMIC]},h.logic_operation=function(e,t){var n=e.getFieldValue(`OP`)===`AND`?`&&`:`||`,r=n===`&&`?f.LOGICAL_AND:f.LOGICAL_OR,i=t.valueToCode(e,`A`,r);return e=t.valueToCode(e,`B`,r),i||e?(t=n===`&&`?`true`:`false`,i||=t,e||=t):e=i=`false`,[i+` `+n+` `+e,r]},h.logic_ternary=function(e,t){var n=t.valueToCode(e,`IF`,f.CONDITIONAL)||`false`,r=t.valueToCode(e,`THEN`,f.CONDITIONAL)||`null`;return e=t.valueToCode(e,`ELSE`,f.CONDITIONAL)||`null`,[n+` ? `+r+` : `+e,f.CONDITIONAL]};var g={controls_flow_statements:function(e,t){var n=``;if(t.STATEMENT_PREFIX&&(n+=t.injectId(t.STATEMENT_PREFIX,e)),t.STATEMENT_SUFFIX&&(n+=t.injectId(t.STATEMENT_SUFFIX,e)),t.STATEMENT_PREFIX){let r=e.getSurroundLoop();r&&!r.suppressPrefixSuffix&&(n+=t.injectId(t.STATEMENT_PREFIX,r))}switch(e.getFieldValue(`FLOW`)){case`BREAK`:return n+`break; +`;case`CONTINUE`:return n+`continue; +`}throw Error(`Unknown flow statement.`)},controls_for:function(e,n){var r=n.getVariableName(e.getFieldValue(`VAR`)),i=n.valueToCode(e,`FROM`,f.ASSIGNMENT)||`0`,a=n.valueToCode(e,`TO`,f.ASSIGNMENT)||`0`,o=n.valueToCode(e,`BY`,f.ASSIGNMENT)||`1`,s=n.statementToCode(e,`DO`);if(s=n.addLoopTrap(s,e),t.zf(i)&&t.zf(a)&&t.zf(o))n=Number(i)<=Number(a),e=`for (`+r+` = `+i+`; `+r+(n?` <= `:` >= `)+a+`; `+r,r=Math.abs(Number(o)),e=r===1?e+(n?`++`:`--`):e+((n?` += `:` -= `)+r),e+=`) { +`+s+`} +`;else{e=``;let c=i;i.match(/^\w+$/)||t.zf(i)||(c=n.nameDB_.getDistinctName(r+`_start`,t.P.VARIABLE),e+=`var `+c+` = `+i+`; +`),i=a,a.match(/^\w+$/)||t.zf(a)||(i=n.nameDB_.getDistinctName(r+`_end`,t.P.VARIABLE),e+=`var `+i+` = `+a+`; +`),a=n.nameDB_.getDistinctName(r+`_inc`,t.P.VARIABLE),e+=`var `+a+` = `,e=t.zf(o)?e+(Math.abs(Number(o))+`; +`):e+(`Math.abs(`+o+`); +`),e+=`if (`+c+` > `+i+`) { +`,e+=n.INDENT+a+` = -`+a+`; +`,e=e+`} +for (`+(r+` = `+c+`; `+a+` >= 0 ? `+r+` <= `+i+` : `+r+` >= `+i+`; `+r+` += `+a+`) { +`+s+`} +`)}return e},controls_forEach:function(e,n){var r=n.getVariableName(e.getFieldValue(`VAR`)),i=n.valueToCode(e,`LIST`,f.ASSIGNMENT)||`[]`,a=n.statementToCode(e,`DO`);a=n.addLoopTrap(a,e),e=``;var o=i;return i.match(/^\w+$/)||(o=n.nameDB_.getDistinctName(r+`_list`,t.P.VARIABLE),e+=`var `+o+` = `+i+`; +`),i=n.nameDB_.getDistinctName(r+`_index`,t.P.VARIABLE),a=n.INDENT+r+` = `+o+`[`+i+`]; +`+a,e+(`for (var `+i+` in `+o+`) { +`+a+`} +`)}};g.controls_repeat=i,g.controls_repeat_ext=i,g.controls_whileUntil=function(e,t){var n=e.getFieldValue(`MODE`)===`UNTIL`,r=t.valueToCode(e,`BOOL`,n?f.LOGICAL_NOT:f.NONE)||`false`,i=t.statementToCode(e,`DO`);return i=t.addLoopTrap(i,e),n&&(r=`!`+r),`while (`+r+`) { +`+i+`} +`};var _={math_arithmetic:function(e,t){var n={ADD:[` + `,f.ADDITION],MINUS:[` - `,f.SUBTRACTION],MULTIPLY:[` * `,f.MULTIPLICATION],DIVIDE:[` / `,f.DIVISION],POWER:[null,f.NONE]}[e.getFieldValue(`OP`)],r=n[0];n=n[1];var i=t.valueToCode(e,`A`,n)||`0`;return e=t.valueToCode(e,`B`,n)||`0`,r?[i+r+e,n]:[`Math.pow(`+i+`, `+e+`)`,f.FUNCTION_CALL]},math_atan2:function(e,t){var n=t.valueToCode(e,`X`,f.NONE)||`0`;return[`Math.atan2(`+(t.valueToCode(e,`Y`,f.NONE)||`0`)+`, `+n+`) / Math.PI * 180`,f.DIVISION]},math_change:function(e,t){var n=t.valueToCode(e,`DELTA`,f.ADDITION)||`0`;return e=t.getVariableName(e.getFieldValue(`VAR`)),e+` = (typeof `+e+` === 'number' ? `+e+` : 0) + `+n+`; +`},math_constant:function(e){return{PI:[`Math.PI`,f.MEMBER],E:[`Math.E`,f.MEMBER],GOLDEN_RATIO:[`(1 + Math.sqrt(5)) / 2`,f.DIVISION],SQRT2:[`Math.SQRT2`,f.MEMBER],SQRT1_2:[`Math.SQRT1_2`,f.MEMBER],INFINITY:[`Infinity`,f.ATOMIC]}[e.getFieldValue(`CONSTANT`)]},math_constrain:function(e,t){var n=t.valueToCode(e,`VALUE`,f.NONE)||`0`,r=t.valueToCode(e,`LOW`,f.NONE)||`0`;return e=t.valueToCode(e,`HIGH`,f.NONE)||`Infinity`,[`Math.min(Math.max(`+n+`, `+r+`), `+e+`)`,f.FUNCTION_CALL]},math_modulo:function(e,t){var n=t.valueToCode(e,`DIVIDEND`,f.MODULUS)||`0`;return e=t.valueToCode(e,`DIVISOR`,f.MODULUS)||`0`,[n+` % `+e,f.MODULUS]},math_number:function(e){return e=Number(e.getFieldValue(`NUM`)),[String(e),e>=0?f.ATOMIC:f.UNARY_NEGATION]},math_number_property:function(e,t){var n={EVEN:[` % 2 === 0`,f.MODULUS,f.EQUALITY],ODD:[` % 2 === 1`,f.MODULUS,f.EQUALITY],WHOLE:[` % 1 === 0`,f.MODULUS,f.EQUALITY],POSITIVE:[` > 0`,f.RELATIONAL,f.RELATIONAL],NEGATIVE:[` < 0`,f.RELATIONAL,f.RELATIONAL],DIVISIBLE_BY:[null,f.MODULUS,f.EQUALITY],PRIME:[null,f.NONE,f.FUNCTION_CALL]},r=e.getFieldValue(`PROPERTY`),[i,a,o]=n[r];return n=t.valueToCode(e,`NUMBER_TO_CHECK`,a)||`0`,r===`PRIME`?e=t.provideFunction_(`mathIsPrime`,` +function ${t.FUNCTION_NAME_PLACEHOLDER_}(n) { + // https://en.wikipedia.org/wiki/Primality_test#Naive_methods + if (n == 2 || n == 3) { + return true; + } + // False if n is NaN, negative, is 1, or not whole. + // And false if n is divisible by 2 or 3. + if (isNaN(n) || n <= 1 || n % 1 !== 0 || n % 2 === 0 || n % 3 === 0) { + return false; + } + // Check all the numbers of form 6k +/- 1, up to sqrt(n). + for (var x = 6; x <= Math.sqrt(n) + 1; x += 6) { + if (n % (x - 1) === 0 || n % (x + 1) === 0) { + return false; + } + } + return true; +} +`)+`(`+n+`)`:r===`DIVISIBLE_BY`?(e=t.valueToCode(e,`DIVISOR`,f.MODULUS)||`0`,e=n+` % `+e+` === 0`):e=n+i,[e,o]},math_on_list:function(e,t){var n=e.getFieldValue(`OP`);switch(n){case`SUM`:e=t.valueToCode(e,`LIST`,f.MEMBER)||`[]`,e+=`.reduce(function(x, y) {return x + y;}, 0)`;break;case`MIN`:e=t.valueToCode(e,`LIST`,f.NONE)||`[]`,e=`Math.min.apply(null, `+e+`)`;break;case`MAX`:e=t.valueToCode(e,`LIST`,f.NONE)||`[]`,e=`Math.max.apply(null, `+e+`)`;break;case`AVERAGE`:n=t.provideFunction_(`mathMean`,` +function ${t.FUNCTION_NAME_PLACEHOLDER_}(myList) { + return myList.reduce(function(x, y) {return x + y;}, 0) / myList.length; +} +`),e=t.valueToCode(e,`LIST`,f.NONE)||`[]`,e=n+`(`+e+`)`;break;case`MEDIAN`:n=t.provideFunction_(`mathMedian`,` +function ${t.FUNCTION_NAME_PLACEHOLDER_}(myList) { + var localList = myList.filter(function (x) {return typeof x === 'number';}); + if (!localList.length) return null; + localList.sort(function(a, b) {return b - a;}); + if (localList.length % 2 === 0) { + return (localList[localList.length / 2 - 1] + localList[localList.length / 2]) / 2; + } else { + return localList[(localList.length - 1) / 2]; + } +} +`),e=t.valueToCode(e,`LIST`,f.NONE)||`[]`,e=n+`(`+e+`)`;break;case`MODE`:n=t.provideFunction_(`mathModes`,` +function ${t.FUNCTION_NAME_PLACEHOLDER_}(values) { + var modes = []; + var counts = []; + var maxCount = 0; + for (var i = 0; i < values.length; i++) { + var value = values[i]; + var found = false; + var thisCount; + for (var j = 0; j < counts.length; j++) { + if (counts[j][0] === value) { + thisCount = ++counts[j][1]; + found = true; + break; + } + } + if (!found) { + counts.push([value, 1]); + thisCount = 1; + } + maxCount = Math.max(thisCount, maxCount); + } + for (var j = 0; j < counts.length; j++) { + if (counts[j][1] === maxCount) { + modes.push(counts[j][0]); + } + } + return modes; +} +`),e=t.valueToCode(e,`LIST`,f.NONE)||`[]`,e=n+`(`+e+`)`;break;case`STD_DEV`:n=t.provideFunction_(`mathStandardDeviation`,` +function ${t.FUNCTION_NAME_PLACEHOLDER_}(numbers) { + var n = numbers.length; + if (!n) return null; + var mean = numbers.reduce(function(x, y) {return x + y;}) / n; + var variance = 0; + for (var j = 0; j < n; j++) { + variance += Math.pow(numbers[j] - mean, 2); + } + variance /= n; + return Math.sqrt(variance); +} +`),e=t.valueToCode(e,`LIST`,f.NONE)||`[]`,e=n+`(`+e+`)`;break;case`RANDOM`:n=t.provideFunction_(`mathRandomList`,` +function ${t.FUNCTION_NAME_PLACEHOLDER_}(list) { + var x = Math.floor(Math.random() * list.length); + return list[x]; +} +`),e=t.valueToCode(e,`LIST`,f.NONE)||`[]`,e=n+`(`+e+`)`;break;default:throw Error(`Unknown operator: `+n)}return[e,f.FUNCTION_CALL]},math_random_float:function(){return[`Math.random()`,f.FUNCTION_CALL]},math_random_int:function(e,t){var n=t.valueToCode(e,`FROM`,f.NONE)||`0`;return e=t.valueToCode(e,`TO`,f.NONE)||`0`,[t.provideFunction_(`mathRandomInt`,` +function ${t.FUNCTION_NAME_PLACEHOLDER_}(a, b) { + if (a > b) { + // Swap a and b to ensure a is smaller. + var c = a; + a = b; + b = c; + } + return Math.floor(Math.random() * (b - a + 1) + a); +} +`)+`(`+n+`, `+e+`)`,f.FUNCTION_CALL]}};_.math_round=a,_.math_single=a,_.math_trig=a;var v={procedures_callnoreturn:function(e,t){return t.forBlock.procedures_callreturn(e,t)[0]+`; +`},procedures_callreturn:function(e,t){var n=t.getProcedureName(e.getFieldValue(`NAME`)),r=[],i=e.getVarModels();for(let n=0;n String(b) ? 1 : -1; }, + 'IGNORE_CASE': function(a, b) { + return String(a).toLowerCase() > String(b).toLowerCase() ? 1 : -1; }, + }; + var compare = compareFuncs[type]; + return function(a, b) { return compare(a, b) * direction; }; +} + `),[n+`.slice().sort(`+t+`("`+e+`", `+r+`))`,f.FUNCTION_CALL]},lists_split:function(e,t){var n=t.valueToCode(e,`INPUT`,f.MEMBER);if(t=t.valueToCode(e,`DELIM`,f.NONE)||`''`,e=e.getFieldValue(`MODE`),e===`SPLIT`)n||=`''`,e=`split`;else if(e===`JOIN`)n||=`[]`,e=`join`;else throw Error(`Unknown mode: `+e);return[n+`.`+e+`(`+t+`)`,f.FUNCTION_CALL]}},h,g,_,v,b,x,S);for(let e in w)C.forBlock[e]=w[e];var T={};return T.JavascriptGenerator=m,T.Order=f,T.javascriptGenerator=C,t.__chunk_javascript=T,t.__chunk_javascript.__namespace__=t,t.__chunk_javascript})}))(),1).default,Vh=r(((e,t)=>{(function(n,r){if(typeof e==`object`)t.exports=r();else{var i=r();for(var a in i)n.Blockly.Msg[a]=i[a]}})(e,function(){var e=e||{Msg:Object.create(null)};return e.Msg.ADD_COMMENT=`Add Comment`,e.Msg.ALT_KEY=`Alt`,e.Msg.ANNOUNCE_MOVE_AFTER=`Moving %1 after %2.`,e.Msg.ANNOUNCE_MOVE_AROUND=`Moving %1 around %2.`,e.Msg.ANNOUNCE_MOVE_BEFORE=`Moving %1 before %2.`,e.Msg.ANNOUNCE_MOVE_CANCELED=`Canceled movement.`,e.Msg.ANNOUNCE_MOVE_INSIDE=`Moving %1 inside %2.`,e.Msg.ANNOUNCE_MOVE_OF=`%1 of %2`,e.Msg.ANNOUNCE_MOVE_TO=`Moving %1 to %2.`,e.Msg.ANNOUNCE_MOVE_WORKSPACE=`Moving %1 on workspace.`,e.Msg.ARIA_LABEL_ADD_ELSE_IF=`Add else if`,e.Msg.ARIA_LABEL_ADD_INPUT=`Add input`,e.Msg.ARIA_LABEL_ADD_LIST_ITEM=`Add list item`,e.Msg.ARIA_LABEL_ADD_TEXT=`Add text`,e.Msg.ARIA_LABEL_BUTTON=`button`,e.Msg.ARIA_LABEL_COMMENT=`Comment`,e.Msg.ARIA_LABEL_COMMENT_COLLAPSE=`Collapse Comment`,e.Msg.ARIA_LABEL_COMMENT_EXPAND=`Expand Comment`,e.Msg.ARIA_LABEL_FIELD_ANGLE=`%1 degrees`,e.Msg.ARIA_LABEL_HEADING=`heading`,e.Msg.ARIA_LABEL_REMOVE_ELSE_IF=`Remove else if`,e.Msg.ARIA_LABEL_REMOVE_INPUT=`Remove input`,e.Msg.ARIA_LABEL_REMOVE_LIST_ITEM=`Remove list item`,e.Msg.ARIA_LABEL_REMOVE_TEXT=`Remove text`,e.Msg.ARIA_LABEL_TRASH_EMPTY=`Trash, currently empty`,e.Msg.ARIA_TYPE_FIELD_ANGLE=`angle`,e.Msg.ARIA_TYPE_FIELD_BITMAP=`pixel image`,e.Msg.ARIA_TYPE_FIELD_CHECKBOX=`checkbox`,e.Msg.ARIA_TYPE_FIELD_COLOUR=`color`,e.Msg.ARIA_TYPE_FIELD_DATE=`date`,e.Msg.ARIA_TYPE_FIELD_DROPDOWN=`dropdown`,e.Msg.ARIA_TYPE_FIELD_GRID=`grid dropdown`,e.Msg.ARIA_TYPE_FIELD_IMAGE=`image`,e.Msg.ARIA_TYPE_FIELD_INPUT=`input`,e.Msg.ARIA_TYPE_FIELD_NUMBER=`number`,e.Msg.ARIA_TYPE_FIELD_TEXT_INPUT=`text`,e.Msg.ARIA_TYPE_FIELD_TEXT_INPUT_ARGUMENT=`input name`,e.Msg.ARIA_TYPE_FIELD_TEXT_INPUT_PROCEDURE=`function name`,e.Msg.BACKSPACE_KEY=`Backspace`,e.Msg.BLOCK_LABEL_BEGIN_PREFIX=`Begin %1`,e.Msg.BLOCK_LABEL_BEGIN_STACK=`Begin stack`,e.Msg.BLOCK_LABEL_COLLAPSED=`collapsed`,e.Msg.BLOCK_LABEL_CONTAINER=`container`,e.Msg.BLOCK_LABEL_DISABLED=`disabled`,e.Msg.BLOCK_LABEL_HAS_BRANCHES=`has %1 branches`,e.Msg.BLOCK_LABEL_HAS_INPUT=`has input`,e.Msg.BLOCK_LABEL_HAS_INPUTS=`has inputs`,e.Msg.BLOCK_LABEL_REPLACEABLE=`replaceable`,e.Msg.BLOCK_LABEL_STACK_BLOCKS=`%1 stack blocks`,e.Msg.BLOCK_LABEL_STATEMENT=`statement`,e.Msg.BLOCK_LABEL_TOOLBOX_CATEGORY=`%1 category`,e.Msg.BLOCK_LABEL_VALUE=`value`,e.Msg.BUBBLE_LABEL_COMMENT=`Comment: %1`,e.Msg.BUBBLE_LABEL_DEFAULT=`Bubble`,e.Msg.BUBBLE_LABEL_WARNING=`Warning: %1`,e.Msg.CANNOT_DELETE_VARIABLE_PROCEDURE=`Can't delete the variable '%1' because it's part of the definition of the function '%2'`,e.Msg.CAPS_LOCK_KEY=`Caps Lock`,e.Msg.CHANGE_VALUE_TITLE=`Change value:`,e.Msg.CHROME_OS=`ChromeOS`,e.Msg.CLEAN_UP=`Clean up Blocks`,e.Msg.CLOSE=`Close`,e.Msg.CLOSE_BACKPACK=`Close backpack`,e.Msg.COLLAPSED_WARNINGS_WARNING=`Collapsed blocks contain warnings.`,e.Msg.COLLAPSE_ALL=`Collapse Blocks`,e.Msg.COLLAPSE_BLOCK=`Collapse Block`,e.Msg.COLOUR_BLEND_COLOUR1=`colour 1`,e.Msg.COLOUR_BLEND_COLOUR2=`colour 2`,e.Msg.COLOUR_BLEND_HELPURL=`https://meyerweb.com/eric/tools/color-blend/#:::rgbp`,e.Msg.COLOUR_BLEND_RATIO=`ratio`,e.Msg.COLOUR_BLEND_TITLE=`blend`,e.Msg.COLOUR_BLEND_TOOLTIP=`Blends two colours together with a given ratio (0.0 - 1.0).`,e.Msg.COLOUR_PICKER_HELPURL=`https://en.wikipedia.org/wiki/Color`,e.Msg.COLOUR_PICKER_TOOLTIP=`Choose a colour from the palette.`,e.Msg.COLOUR_RANDOM_HELPURL=`http://randomcolour.com`,e.Msg.COLOUR_RANDOM_TITLE=`random colour`,e.Msg.COLOUR_RANDOM_TOOLTIP=`Choose a colour at random.`,e.Msg.COLOUR_RGB_BLUE=`blue`,e.Msg.COLOUR_RGB_GREEN=`green`,e.Msg.COLOUR_RGB_HELPURL=`https://www.december.com/html/spec/colorpercompact.html`,e.Msg.COLOUR_RGB_RED=`red`,e.Msg.COLOUR_RGB_TITLE=`colour with`,e.Msg.COLOUR_RGB_TOOLTIP=`Create a colour with the specified amount of red, green, and blue. All values must be between 0 and 100.`,e.Msg.COMMAND_KEY=`Command`,e.Msg.CONTEXT_MENU_KEY=`≣ Menu`,e.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Loops#loop-termination-blocks`,e.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK=`break out of loop`,e.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE=`continue with next iteration of loop`,e.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK=`Break out of the containing loop.`,e.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE=`Skip the rest of this loop, and continue with the next iteration.`,e.Msg.CONTROLS_FLOW_STATEMENTS_WARNING=`Warning: This block may only be used within a loop.`,e.Msg.CONTROLS_FOREACH_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Loops#for-each`,e.Msg.CONTROLS_FOREACH_TITLE=`for each item %1 in list %2`,e.Msg.CONTROLS_FOREACH_TOOLTIP=`For each item in a list, set the variable '%1' to the item, and then do some statements.`,e.Msg.CONTROLS_FOR_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Loops#count-with`,e.Msg.CONTROLS_FOR_TITLE=`count with %1 from %2 to %3 by %4`,e.Msg.CONTROLS_FOR_TOOLTIP=`Have the variable '%1' take on the values from the start number to the end number, counting by the specified interval, and do the specified blocks.`,e.Msg.CONTROLS_IF_ELSEIF_TOOLTIP=`Add a condition to the if block.`,e.Msg.CONTROLS_IF_ELSE_TOOLTIP=`Add a final, catch-all condition to the if block.`,e.Msg.CONTROLS_IF_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/IfElse`,e.Msg.CONTROLS_IF_IF_TOOLTIP=`Add, remove, or reorder sections to reconfigure this if block.`,e.Msg.CONTROLS_IF_MSG_ELSE=`else`,e.Msg.CONTROLS_IF_MSG_ELSEIF=`else if`,e.Msg.CONTROLS_IF_MSG_IF=`if`,e.Msg.CONTROLS_IF_TOOLTIP_1=`If a value is true, then do some statements.`,e.Msg.CONTROLS_IF_TOOLTIP_2=`If a value is true, then do the first block of statements. Otherwise, do the second block of statements.`,e.Msg.CONTROLS_IF_TOOLTIP_3=`If the first value is true, then do the first block of statements. Otherwise, if the second value is true, do the second block of statements.`,e.Msg.CONTROLS_IF_TOOLTIP_4=`If the first value is true, then do the first block of statements. Otherwise, if the second value is true, do the second block of statements. If none of the values are true, do the last block of statements.`,e.Msg.CONTROLS_REPEAT_HELPURL=`https://en.wikipedia.org/wiki/For_loop`,e.Msg.CONTROLS_REPEAT_INPUT_DO=`do`,e.Msg.CONTROLS_REPEAT_TITLE=`repeat %1 times`,e.Msg.CONTROLS_REPEAT_TOOLTIP=`Do some statements several times.`,e.Msg.CONTROLS_WHILEUNTIL_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Loops#repeat`,e.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL=`repeat until`,e.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE=`repeat while`,e.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL=`While a value is false, then do some statements.`,e.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE=`While a value is true, then do some statements.`,e.Msg.CONTROL_KEY=`Control`,e.Msg.COPY_ALL_TO_BACKPACK=`Copy All Blocks to Backpack`,e.Msg.COPY_SHORTCUT=`Copy`,e.Msg.COPY_TO_BACKPACK=`Copy to Backpack`,e.Msg.CURRENT_BLOCK_ANNOUNCEMENT=`Current block: %1`,e.Msg.CUT_SHORTCUT=`Cut`,e.Msg.DELETE_ALL_BLOCKS=`Delete all %1 blocks?`,e.Msg.DELETE_BLOCK=`Delete Block`,e.Msg.DELETE_KEY=`Delete`,e.Msg.DELETE_VARIABLE=`Delete the '%1' variable`,e.Msg.DELETE_VARIABLE_CONFIRMATION=`Delete %1 uses of the '%2' variable?`,e.Msg.DELETE_X_BLOCKS=`Delete %1 Blocks`,e.Msg.DIALOG_CANCEL=`Cancel`,e.Msg.DIALOG_OK=`OK`,e.Msg.DISABLE_BLOCK=`Disable Block`,e.Msg.DUPLICATE_BLOCK=`Duplicate`,e.Msg.DUPLICATE_COMMENT=`Duplicate Comment`,e.Msg.EDIT_BLOCK_CONTENTS=`Edit Block contents`,e.Msg.EMPTY_BACKPACK=`Empty Backpack`,e.Msg.ENABLE_BLOCK=`Enable Block`,e.Msg.END_KEY=`End`,e.Msg.ENTER_KEY=`Enter`,e.Msg.ESCAPE=`Escape`,e.Msg.EXPAND_ALL=`Expand Blocks`,e.Msg.EXPAND_BLOCK=`Expand Block`,e.Msg.EXTERNAL_INPUTS=`External Inputs`,e.Msg.FIELD_BITMAP_ARIA_VALUE=`%1 by %2, %3 pixels on`,e.Msg.FIELD_BITMAP_BUTTON_LABEL_CLEAR=`Clear`,e.Msg.FIELD_BITMAP_BUTTON_LABEL_RANDOMIZE=`Randomize`,e.Msg.FIELD_BITMAP_PIXEL_LABEL=`%1, row %2, column %3`,e.Msg.FIELD_BITMAP_PIXEL_OFF=`off`,e.Msg.FIELD_BITMAP_PIXEL_ON=`on`,e.Msg.FIELD_LABEL_CHECKBOX_CHECKED=`Checked`,e.Msg.FIELD_LABEL_CHECKBOX_UNCHECKED=`Not checked`,e.Msg.FIELD_LABEL_EDIT_PREFIX=`Edit %1`,e.Msg.FIELD_LABEL_EMPTY=`empty`,e.Msg.FIELD_LABEL_OPTION_INDEX=`Option %1`,e.Msg.FIELD_LABEL_VARIABLE=`Variable '%1'`,e.Msg.FIELD_MULTILINEINPUT_FINISH_EDITING=`Finish editing`,e.Msg.FIELD_MULTILINEINPUT_NEW_LINE=`New line`,e.Msg.HELP=`Help`,e.Msg.HELP_PROMPT=`Press %1 for help on keyboard controls.`,e.Msg.HOME_KEY=`Home`,e.Msg.ICON_LABEL_COMMENT_CLOSED=`Open Comment`,e.Msg.ICON_LABEL_COMMENT_OPEN=`Close Comment`,e.Msg.ICON_LABEL_DEFAULT=`Icon`,e.Msg.ICON_LABEL_MUTATOR_CLOSED=`Edit this block`,e.Msg.ICON_LABEL_MUTATOR_OPEN=`Close block editor`,e.Msg.ICON_LABEL_WARNING_CLOSED=`Open Warning`,e.Msg.ICON_LABEL_WARNING_OPEN=`Close Warning`,e.Msg.INLINE_INPUTS=`Inline Inputs`,e.Msg.INPUT_LABEL_CONDITION=`condition`,e.Msg.INPUT_LABEL_CONDITION_A=`first condition`,e.Msg.INPUT_LABEL_CONDITION_B=`second condition`,e.Msg.INPUT_LABEL_EMPTY=`Empty`,e.Msg.INPUT_LABEL_END_STATEMENT=`End %1`,e.Msg.INPUT_LABEL_INDEX=`input %1`,e.Msg.INPUT_LABEL_LISTS_CREATE_WITH_ITEM=`value %1`,e.Msg.INPUT_LABEL_LISTS_DELIMITER=`delimiter`,e.Msg.INPUT_LABEL_LISTS_END_POSITION=`end position`,e.Msg.INPUT_LABEL_LISTS_LIST_FROM_TEXT=`text to split`,e.Msg.INPUT_LABEL_LISTS_POSITION=`position within list`,e.Msg.INPUT_LABEL_LISTS_REPEAT_ITEM=`value to repeat`,e.Msg.INPUT_LABEL_LISTS_REPEAT_NUM=`number of times to repeat`,e.Msg.INPUT_LABEL_LISTS_START_POSITION=`start position`,e.Msg.INPUT_LABEL_LISTS_TEXT_FROM_LIST=`list to join`,e.Msg.INPUT_LABEL_LISTS_TO_CHANGE=`list to change`,e.Msg.INPUT_LABEL_LISTS_TO_CHECK=`list to check`,e.Msg.INPUT_LABEL_LISTS_VALUE_TO_SET=`value to set`,e.Msg.INPUT_LABEL_LOOP_BY=`increment`,e.Msg.INPUT_LABEL_LOOP_FROM=`starting number`,e.Msg.INPUT_LABEL_LOOP_LIST=`list to iterate over`,e.Msg.INPUT_LABEL_LOOP_TIMES=`number of times to repeat`,e.Msg.INPUT_LABEL_LOOP_TO=`ending number`,e.Msg.INPUT_LABEL_MATH_CHANGE_BY=`amount to change by`,e.Msg.INPUT_LABEL_MATH_CONSTRAIN_VALUE=`number to constrain`,e.Msg.INPUT_LABEL_MATH_DIVIDEND=`dividend`,e.Msg.INPUT_LABEL_MATH_DIVISOR=`divisor`,e.Msg.INPUT_LABEL_NUMBER=`number`,e.Msg.INPUT_LABEL_NUMBER_A=`first number`,e.Msg.INPUT_LABEL_NUMBER_ATAN2_X=`x coordinate`,e.Msg.INPUT_LABEL_NUMBER_ATAN2_Y=`y coordinate`,e.Msg.INPUT_LABEL_NUMBER_B=`second number`,e.Msg.INPUT_LABEL_NUMBER_LIST=`list of numbers`,e.Msg.INPUT_LABEL_NUMBER_MAX=`maximum`,e.Msg.INPUT_LABEL_NUMBER_MIN=`minimum`,e.Msg.INPUT_LABEL_NUMBER_TO_CHECK=`number to check`,e.Msg.INPUT_LABEL_STATEMENT=`statement position`,e.Msg.INPUT_LABEL_TEXT_APPEND=`value to append`,e.Msg.INPUT_LABEL_TEXT_END_POSITION=`end position`,e.Msg.INPUT_LABEL_TEXT_JOIN_ITEM=`value %1`,e.Msg.INPUT_LABEL_TEXT_POSITION=`letter position`,e.Msg.INPUT_LABEL_TEXT_PROMPT_MESSAGE=`message`,e.Msg.INPUT_LABEL_TEXT_START_POSITION=`start position`,e.Msg.INPUT_LABEL_TEXT_TO_CHANGE=`text to change`,e.Msg.INPUT_LABEL_TEXT_TO_CHECK=`text to check`,e.Msg.INPUT_LABEL_TEXT_TO_FIND=`text to find`,e.Msg.INPUT_LABEL_TEXT_TO_REPLACE=`text to replace`,e.Msg.INPUT_LABEL_VALUE=`value position`,e.Msg.INPUT_LABEL_VALUE_A=`first value`,e.Msg.INPUT_LABEL_VALUE_B=`second value`,e.Msg.INPUT_LABEL_VARIABLES_SET=`value to set`,e.Msg.INSERT_KEY=`Insert`,e.Msg.KEYBOARD_NAV_BLOCK_NAVIGATION_HINT=`Use %1 to navigate inside of blocks.`,e.Msg.KEYBOARD_NAV_CONSTRAINED_MOVE_HINT=`Use the arrow keys to move, then %1 to accept the position.`,e.Msg.KEYBOARD_NAV_COPIED_HINT=`Copied. Press %1 to paste.`,e.Msg.KEYBOARD_NAV_CUT_HINT=`Cut. Press %1 to paste.`,e.Msg.KEYBOARD_NAV_FLYOUT_LABEL_HINT=`Use the arrow keys to navigate to a block, or press %1 to go to the next heading.`,e.Msg.KEYBOARD_NAV_UNCONSTRAINED_MOVE_HINT=`Hold %1 and use arrow keys to move freely, then %2 to accept the position.`,e.Msg.KEYBOARD_NAV_WORKSPACE_NAVIGATION_HINT=`Use the arrow keys to navigate.`,e.Msg.LINUX=`Linux`,e.Msg.LISTS_CREATE_EMPTY_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#create-empty-list`,e.Msg.LISTS_CREATE_EMPTY_TITLE=`create empty list`,e.Msg.LISTS_CREATE_EMPTY_TOOLTIP=`Returns a list, of length 0, containing no data records`,e.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD=`list`,e.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP=`Add, remove, or reorder sections to reconfigure this list block.`,e.Msg.LISTS_CREATE_WITH_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#create-list-with`,e.Msg.LISTS_CREATE_WITH_INPUT_WITH=`create list with`,e.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP=`Add an item to the list.`,e.Msg.LISTS_CREATE_WITH_TOOLTIP=`Create a list with any number of items.`,e.Msg.LISTS_GET_INDEX_FIRST=`first`,e.Msg.LISTS_GET_INDEX_FROM_END=`# from end`,e.Msg.LISTS_GET_INDEX_FROM_START=`#`,e.Msg.LISTS_GET_INDEX_GET=`get`,e.Msg.LISTS_GET_INDEX_GET_REMOVE=`get and remove`,e.Msg.LISTS_GET_INDEX_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#getting-items-from-a-list`,e.Msg.LISTS_GET_INDEX_LAST=`last`,e.Msg.LISTS_GET_INDEX_RANDOM=`random`,e.Msg.LISTS_GET_INDEX_REMOVE=`remove`,e.Msg.LISTS_GET_INDEX_TAIL=``,e.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST=`Returns the first item in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM=`Returns the item at the specified position in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST=`Returns the last item in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM=`Returns a random item in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST=`Removes and returns the first item in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM=`Removes and returns the item at the specified position in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST=`Removes and returns the last item in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM=`Removes and returns a random item in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST=`Removes the first item in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM=`Removes the item at the specified position in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST=`Removes the last item in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM=`Removes a random item in a list.`,e.Msg.LISTS_GET_SUBLIST_END_FROM_END=`to # from end`,e.Msg.LISTS_GET_SUBLIST_END_FROM_START=`to #`,e.Msg.LISTS_GET_SUBLIST_END_LAST=`to last`,e.Msg.LISTS_GET_SUBLIST_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#getting-a-sublist`,e.Msg.LISTS_GET_SUBLIST_START_FIRST=`get sub-list from first`,e.Msg.LISTS_GET_SUBLIST_START_FROM_END=`get sub-list from # from end`,e.Msg.LISTS_GET_SUBLIST_START_FROM_START=`get sub-list from #`,e.Msg.LISTS_GET_SUBLIST_TAIL=``,e.Msg.LISTS_GET_SUBLIST_TOOLTIP=`Creates a copy of the specified portion of a list.`,e.Msg.LISTS_INDEX_FROM_END_TOOLTIP=`%1 is the last item.`,e.Msg.LISTS_INDEX_FROM_START_TOOLTIP=`%1 is the first item.`,e.Msg.LISTS_INDEX_OF_FIRST=`find first occurrence of item`,e.Msg.LISTS_INDEX_OF_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#finding-items-in-a-list`,e.Msg.LISTS_INDEX_OF_LAST=`find last occurrence of item`,e.Msg.LISTS_INDEX_OF_TOOLTIP=`Returns the index of the first/last occurrence of the item in the list. Returns %1 if item is not found.`,e.Msg.LISTS_INLIST=`in list`,e.Msg.LISTS_ISEMPTY_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#is-empty`,e.Msg.LISTS_ISEMPTY_TITLE=`%1 is empty`,e.Msg.LISTS_ISEMPTY_TOOLTIP=`Returns true if the list is empty.`,e.Msg.LISTS_LENGTH_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#length-of`,e.Msg.LISTS_LENGTH_TITLE=`length of %1`,e.Msg.LISTS_LENGTH_TOOLTIP=`Returns the length of a list.`,e.Msg.LISTS_REPEAT_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#create-list-with`,e.Msg.LISTS_REPEAT_TITLE=`create list with item %1 repeated %2 times`,e.Msg.LISTS_REPEAT_TOOLTIP=`Creates a list consisting of the given value repeated the specified number of times.`,e.Msg.LISTS_REVERSE_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#reversing-a-list`,e.Msg.LISTS_REVERSE_MESSAGE0=`reverse %1`,e.Msg.LISTS_REVERSE_TOOLTIP=`Reverse a copy of a list.`,e.Msg.LISTS_SET_INDEX_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#in-list--set`,e.Msg.LISTS_SET_INDEX_INPUT_TO=`as`,e.Msg.LISTS_SET_INDEX_INSERT=`insert at`,e.Msg.LISTS_SET_INDEX_SET=`set`,e.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST=`Inserts the item at the start of a list.`,e.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM=`Inserts the item at the specified position in a list.`,e.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST=`Append the item to the end of a list.`,e.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM=`Inserts the item randomly in a list.`,e.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST=`Sets the first item in a list.`,e.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM=`Sets the item at the specified position in a list.`,e.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST=`Sets the last item in a list.`,e.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM=`Sets a random item in a list.`,e.Msg.LISTS_SORT_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#sorting-a-list`,e.Msg.LISTS_SORT_ORDER_ASCENDING=`ascending`,e.Msg.LISTS_SORT_ORDER_DESCENDING=`descending`,e.Msg.LISTS_SORT_TITLE=`sort %1 %2 %3`,e.Msg.LISTS_SORT_TOOLTIP=`Sort a copy of a list.`,e.Msg.LISTS_SORT_TYPE_IGNORECASE=`alphabetic, ignore case`,e.Msg.LISTS_SORT_TYPE_NUMERIC=`numeric`,e.Msg.LISTS_SORT_TYPE_TEXT=`alphabetic`,e.Msg.LISTS_SPLIT_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#splitting-strings-and-joining-lists`,e.Msg.LISTS_SPLIT_LIST_FROM_TEXT=`make list from text`,e.Msg.LISTS_SPLIT_TEXT_FROM_LIST=`make text from list`,e.Msg.LISTS_SPLIT_TOOLTIP_JOIN=`Join a list of texts into one text, separated by a delimiter.`,e.Msg.LISTS_SPLIT_TOOLTIP_SPLIT=`Split text into a list of texts, breaking at each delimiter.`,e.Msg.LISTS_SPLIT_WITH_DELIMITER=`with delimiter`,e.Msg.LOGIC_BOOLEAN_FALSE=`false`,e.Msg.LOGIC_BOOLEAN_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Logic#values`,e.Msg.LOGIC_BOOLEAN_TOOLTIP=`Returns either true or false.`,e.Msg.LOGIC_BOOLEAN_TRUE=`true`,e.Msg.LOGIC_COMPARE_EQ_ARIA=`equals`,e.Msg.LOGIC_COMPARE_GTE_ARIA=`greater than or equal to`,e.Msg.LOGIC_COMPARE_GT_ARIA=`greater than`,e.Msg.LOGIC_COMPARE_HELPURL=`https://en.wikipedia.org/wiki/Inequality_(mathematics)`,e.Msg.LOGIC_COMPARE_LTE_ARIA=`less than or equal to`,e.Msg.LOGIC_COMPARE_LT_ARIA=`less than`,e.Msg.LOGIC_COMPARE_NEQ_ARIA=`not equals`,e.Msg.LOGIC_COMPARE_TOOLTIP_EQ=`Return true if both inputs equal each other.`,e.Msg.LOGIC_COMPARE_TOOLTIP_GT=`Return true if the first input is greater than the second input.`,e.Msg.LOGIC_COMPARE_TOOLTIP_GTE=`Return true if the first input is greater than or equal to the second input.`,e.Msg.LOGIC_COMPARE_TOOLTIP_LT=`Return true if the first input is smaller than the second input.`,e.Msg.LOGIC_COMPARE_TOOLTIP_LTE=`Return true if the first input is smaller than or equal to the second input.`,e.Msg.LOGIC_COMPARE_TOOLTIP_NEQ=`Return true if both inputs are not equal to each other.`,e.Msg.LOGIC_NEGATE_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Logic#not`,e.Msg.LOGIC_NEGATE_TITLE=`not %1`,e.Msg.LOGIC_NEGATE_TOOLTIP=`Returns true if the input is false. Returns false if the input is true.`,e.Msg.LOGIC_NULL=`null`,e.Msg.LOGIC_NULL_HELPURL=`https://en.wikipedia.org/wiki/Nullable_type`,e.Msg.LOGIC_NULL_TOOLTIP=`Returns null.`,e.Msg.LOGIC_OPERATION_AND=`and`,e.Msg.LOGIC_OPERATION_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Logic#logical-operations`,e.Msg.LOGIC_OPERATION_OR=`or`,e.Msg.LOGIC_OPERATION_TOOLTIP_AND=`Return true if both inputs are true.`,e.Msg.LOGIC_OPERATION_TOOLTIP_OR=`Return true if at least one of the inputs is true.`,e.Msg.LOGIC_TERNARY_CONDITION=`test`,e.Msg.LOGIC_TERNARY_HELPURL=`https://en.wikipedia.org/wiki/%3F:`,e.Msg.LOGIC_TERNARY_IF_FALSE=`if false`,e.Msg.LOGIC_TERNARY_IF_TRUE=`if true`,e.Msg.LOGIC_TERNARY_TOOLTIP=`Check the condition in 'test'. If the condition is true, returns the 'if true' value; otherwise returns the 'if false' value.`,e.Msg.MAC_OS=`macOS`,e.Msg.MATH_ADDITION_SYMBOL=`+`,e.Msg.MATH_ADDITION_SYMBOL_ARIA=`plus`,e.Msg.MATH_ARITHMETIC_HELPURL=`https://en.wikipedia.org/wiki/Arithmetic`,e.Msg.MATH_ARITHMETIC_TOOLTIP_ADD=`Return the sum of the two numbers.`,e.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE=`Return the quotient of the two numbers.`,e.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS=`Return the difference of the two numbers.`,e.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY=`Return the product of the two numbers.`,e.Msg.MATH_ARITHMETIC_TOOLTIP_POWER=`Return the first number raised to the power of the second number.`,e.Msg.MATH_ATAN2_HELPURL=`https://en.wikipedia.org/wiki/Atan2`,e.Msg.MATH_ATAN2_TITLE=`atan2 of X:%1 Y:%2`,e.Msg.MATH_ATAN2_TOOLTIP=`Return the arctangent of point (X, Y) in degrees from -180 to 180.`,e.Msg.MATH_CHANGE_HELPURL=`https://en.wikipedia.org/wiki/Programming_idiom#Incrementing_a_counter`,e.Msg.MATH_CHANGE_TITLE=`change %1 by %2`,e.Msg.MATH_CHANGE_TOOLTIP=`Add a number to variable '%1'.`,e.Msg.MATH_CONSTANT_E_ARIA=`e`,e.Msg.MATH_CONSTANT_GOLDEN_RATIO_ARIA=`golden ratio`,e.Msg.MATH_CONSTANT_HELPURL=`https://en.wikipedia.org/wiki/Mathematical_constant`,e.Msg.MATH_CONSTANT_INFINITY_ARIA=`infinity`,e.Msg.MATH_CONSTANT_PI_ARIA=`pi`,e.Msg.MATH_CONSTANT_SQRT1_2_ARIA=`square root of 1 over 2`,e.Msg.MATH_CONSTANT_SQRT2_ARIA=`square root of 2`,e.Msg.MATH_CONSTANT_TOOLTIP=`Return one of the common constants: π (3.141…), e (2.718…), φ (1.618…), sqrt(2) (1.414…), sqrt(½) (0.707…), or ∞ (infinity).`,e.Msg.MATH_CONSTRAIN_HELPURL=`https://en.wikipedia.org/wiki/Clamping_(graphics)`,e.Msg.MATH_CONSTRAIN_TITLE=`constrain %1 low %2 high %3`,e.Msg.MATH_CONSTRAIN_TOOLTIP=`Constrain a number to be between the specified limits (inclusive).`,e.Msg.MATH_DIVISION_SYMBOL=`÷`,e.Msg.MATH_DIVISION_SYMBOL_ARIA=`divided by`,e.Msg.MATH_IS_DIVISIBLE_BY=`is divisible by`,e.Msg.MATH_IS_EVEN=`is even`,e.Msg.MATH_IS_NEGATIVE=`is negative`,e.Msg.MATH_IS_ODD=`is odd`,e.Msg.MATH_IS_POSITIVE=`is positive`,e.Msg.MATH_IS_PRIME=`is prime`,e.Msg.MATH_IS_TOOLTIP=`Check if a number is an even, odd, prime, whole, positive, negative, or if it is divisible by certain number. Returns true or false.`,e.Msg.MATH_IS_WHOLE=`is whole`,e.Msg.MATH_MODULO_HELPURL=`https://en.wikipedia.org/wiki/Modulo_operation`,e.Msg.MATH_MODULO_TITLE=`remainder of %1 ÷ %2`,e.Msg.MATH_MODULO_TOOLTIP=`Return the remainder from dividing the two numbers.`,e.Msg.MATH_MULTIPLICATION_SYMBOL=`×`,e.Msg.MATH_MULTIPLICATION_SYMBOL_ARIA=`times`,e.Msg.MATH_NUMBER_HELPURL=`https://en.wikipedia.org/wiki/Number`,e.Msg.MATH_NUMBER_TOOLTIP=`A number.`,e.Msg.MATH_ONLIST_HELPURL=``,e.Msg.MATH_ONLIST_OPERATOR_AVERAGE=`average of list`,e.Msg.MATH_ONLIST_OPERATOR_MAX=`max of list`,e.Msg.MATH_ONLIST_OPERATOR_MAX_ARIA=`maximum`,e.Msg.MATH_ONLIST_OPERATOR_MEDIAN=`median of list`,e.Msg.MATH_ONLIST_OPERATOR_MIN=`min of list`,e.Msg.MATH_ONLIST_OPERATOR_MIN_ARIA=`minimum`,e.Msg.MATH_ONLIST_OPERATOR_MODE=`modes of list`,e.Msg.MATH_ONLIST_OPERATOR_RANDOM=`random item of list`,e.Msg.MATH_ONLIST_OPERATOR_STD_DEV=`standard deviation of list`,e.Msg.MATH_ONLIST_OPERATOR_SUM=`sum of list`,e.Msg.MATH_ONLIST_TOOLTIP_AVERAGE=`Return the average (arithmetic mean) of the numeric values in the list.`,e.Msg.MATH_ONLIST_TOOLTIP_MAX=`Return the largest number in the list.`,e.Msg.MATH_ONLIST_TOOLTIP_MEDIAN=`Return the median number in the list.`,e.Msg.MATH_ONLIST_TOOLTIP_MIN=`Return the smallest number in the list.`,e.Msg.MATH_ONLIST_TOOLTIP_MODE=`Return a list of the most common item(s) in the list.`,e.Msg.MATH_ONLIST_TOOLTIP_RANDOM=`Return a random element from the list.`,e.Msg.MATH_ONLIST_TOOLTIP_STD_DEV=`Return the standard deviation of the list.`,e.Msg.MATH_ONLIST_TOOLTIP_SUM=`Return the sum of all the numbers in the list.`,e.Msg.MATH_POWER_SYMBOL=`^`,e.Msg.MATH_POWER_SYMBOL_ARIA=`to the power of`,e.Msg.MATH_RANDOM_FLOAT_HELPURL=`https://en.wikipedia.org/wiki/Random_number_generation`,e.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM=`random fraction`,e.Msg.MATH_RANDOM_FLOAT_TOOLTIP=`Return a random fraction between 0.0 (inclusive) and 1.0 (exclusive).`,e.Msg.MATH_RANDOM_INT_HELPURL=`https://en.wikipedia.org/wiki/Random_number_generation`,e.Msg.MATH_RANDOM_INT_TITLE=`random integer from %1 to %2`,e.Msg.MATH_RANDOM_INT_TOOLTIP=`Return a random integer between the two specified limits, inclusive.`,e.Msg.MATH_ROUND_HELPURL=`https://en.wikipedia.org/wiki/Rounding`,e.Msg.MATH_ROUND_OPERATOR_ROUND=`round`,e.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN=`round down`,e.Msg.MATH_ROUND_OPERATOR_ROUNDUP=`round up`,e.Msg.MATH_ROUND_TOOLTIP=`Round a number up or down.`,e.Msg.MATH_SINGLE_HELPURL=`https://en.wikipedia.org/wiki/Square_root`,e.Msg.MATH_SINGLE_OP_ABSOLUTE=`absolute`,e.Msg.MATH_SINGLE_OP_ABSOLUTE_ARIA=`absolute value`,e.Msg.MATH_SINGLE_OP_EXP_ARIA=`e to the power of`,e.Msg.MATH_SINGLE_OP_LN_ARIA=`natural logarithm`,e.Msg.MATH_SINGLE_OP_LOG10_ARIA=`base 10 logarithm`,e.Msg.MATH_SINGLE_OP_NEG_ARIA=`negative`,e.Msg.MATH_SINGLE_OP_POW10_ARIA=`10 to the power of`,e.Msg.MATH_SINGLE_OP_ROOT=`square root`,e.Msg.MATH_SINGLE_TOOLTIP_ABS=`Return the absolute value of a number.`,e.Msg.MATH_SINGLE_TOOLTIP_EXP=`Return e to the power of a number.`,e.Msg.MATH_SINGLE_TOOLTIP_LN=`Return the natural logarithm of a number.`,e.Msg.MATH_SINGLE_TOOLTIP_LOG10=`Return the base 10 logarithm of a number.`,e.Msg.MATH_SINGLE_TOOLTIP_NEG=`Return the negation of a number.`,e.Msg.MATH_SINGLE_TOOLTIP_POW10=`Return 10 to the power of a number.`,e.Msg.MATH_SINGLE_TOOLTIP_ROOT=`Return the square root of a number.`,e.Msg.MATH_SUBTRACTION_SYMBOL=`-`,e.Msg.MATH_SUBTRACTION_SYMBOL_ARIA=`minus`,e.Msg.MATH_TRIG_ACOS=`acos`,e.Msg.MATH_TRIG_ACOS_ARIA=`inverse cosine`,e.Msg.MATH_TRIG_ASIN=`asin`,e.Msg.MATH_TRIG_ASIN_ARIA=`inverse sine`,e.Msg.MATH_TRIG_ATAN=`atan`,e.Msg.MATH_TRIG_ATAN_ARIA=`inverse tangent`,e.Msg.MATH_TRIG_COS=`cos`,e.Msg.MATH_TRIG_COS_ARIA=`cosine`,e.Msg.MATH_TRIG_HELPURL=`https://en.wikipedia.org/wiki/Trigonometric_functions`,e.Msg.MATH_TRIG_SIN=`sin`,e.Msg.MATH_TRIG_SIN_ARIA=`sine`,e.Msg.MATH_TRIG_TAN=`tan`,e.Msg.MATH_TRIG_TAN_ARIA=`tangent`,e.Msg.MATH_TRIG_TOOLTIP_ACOS=`Return the arccosine of a number.`,e.Msg.MATH_TRIG_TOOLTIP_ASIN=`Return the arcsine of a number.`,e.Msg.MATH_TRIG_TOOLTIP_ATAN=`Return the arctangent of a number.`,e.Msg.MATH_TRIG_TOOLTIP_COS=`Return the cosine of a degree (not radian).`,e.Msg.MATH_TRIG_TOOLTIP_SIN=`Return the sine of a degree (not radian).`,e.Msg.MATH_TRIG_TOOLTIP_TAN=`Return the tangent of a degree (not radian).`,e.Msg.MINIMAP_ARIA_LABEL=`Workspace minimap. Use the arrow keys to pan the workspace.`,e.Msg.MOVE_BLOCK=`Move Block`,e.Msg.NEW_COLOUR_VARIABLE=`Create colour variable...`,e.Msg.NEW_NUMBER_VARIABLE=`Create number variable...`,e.Msg.NEW_STRING_VARIABLE=`Create string variable...`,e.Msg.NEW_VARIABLE=`Create variable...`,e.Msg.NEW_VARIABLE_TITLE=`New variable name:`,e.Msg.NEW_VARIABLE_TYPE_TITLE=`New variable type:`,e.Msg.NO_PARENT_ANNOUNCEMENT=`Current block has no parent`,e.Msg.OPEN_BACKPACK=`Open backpack`,e.Msg.OPEN_TRASH=`Open trash`,e.Msg.OPTION_KEY=`Option`,e.Msg.ORDINAL_NUMBER_SUFFIX=``,e.Msg.PAGE_DOWN_KEY=`Page Down`,e.Msg.PAGE_UP_KEY=`Page Up`,e.Msg.PARENT_BLOCKS_ANNOUNCEMENT=`Parent blocks: %1`,e.Msg.PASTE_ALL_FROM_BACKPACK=`Paste All Blocks from Backpack`,e.Msg.PASTE_SHORTCUT=`Paste`,e.Msg.PAUSE_KEY=`Pause`,e.Msg.PROCEDURES_ALLOW_STATEMENTS=`allow statements`,e.Msg.PROCEDURES_BEFORE_PARAMS=`with:`,e.Msg.PROCEDURES_CALLNORETURN_HELPURL=`https://en.wikipedia.org/wiki/Subroutine`,e.Msg.PROCEDURES_CALLNORETURN_TOOLTIP=`Run the user-defined function '%1'.`,e.Msg.PROCEDURES_CALLRETURN_HELPURL=`https://en.wikipedia.org/wiki/Subroutine`,e.Msg.PROCEDURES_CALLRETURN_TOOLTIP=`Run the user-defined function '%1' and use its output.`,e.Msg.PROCEDURES_CALL_BEFORE_PARAMS=`with:`,e.Msg.PROCEDURES_CALL_DISABLED_DEF_WARNING=`Can't run the user-defined function '%1' because the definition block is disabled.`,e.Msg.PROCEDURES_CREATE_DO=`Create '%1'`,e.Msg.PROCEDURES_DEFNORETURN_COMMENT=`Describe this function...`,e.Msg.PROCEDURES_DEFNORETURN_DO=``,e.Msg.PROCEDURES_DEFNORETURN_HELPURL=`https://en.wikipedia.org/wiki/Subroutine`,e.Msg.PROCEDURES_DEFNORETURN_PROCEDURE=`do something`,e.Msg.PROCEDURES_DEFNORETURN_TITLE=`to`,e.Msg.PROCEDURES_DEFNORETURN_TOOLTIP=`Creates a function with no output.`,e.Msg.PROCEDURES_DEFRETURN_HELPURL=`https://en.wikipedia.org/wiki/Subroutine`,e.Msg.PROCEDURES_DEFRETURN_RETURN=`return`,e.Msg.PROCEDURES_DEFRETURN_TOOLTIP=`Creates a function with an output.`,e.Msg.PROCEDURES_DEF_DUPLICATE_WARNING=`Warning: This function has duplicate parameters.`,e.Msg.PROCEDURES_HIGHLIGHT_DEF=`Highlight function definition`,e.Msg.PROCEDURES_IFRETURN_HELPURL=`https://c2.com/cgi/wiki?GuardClause`,e.Msg.PROCEDURES_IFRETURN_TOOLTIP=`If a value is true, then return a second value.`,e.Msg.PROCEDURES_IFRETURN_WARNING=`Warning: This block may be used only within a function definition.`,e.Msg.PROCEDURES_MUTATORARG_TITLE=`input name:`,e.Msg.PROCEDURES_MUTATORARG_TOOLTIP=`Add an input to the function.`,e.Msg.PROCEDURES_MUTATORCONTAINER_TITLE=`inputs`,e.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP=`Add, remove, or reorder inputs to this function.`,e.Msg.REDO=`Redo`,e.Msg.REMOVE_COMMENT=`Remove Comment`,e.Msg.REMOVE_FROM_BACKPACK=`Remove from Backpack`,e.Msg.RENAME_VARIABLE=`Rename the '%1' variable`,e.Msg.RENAME_VARIABLE_TITLE=`Rename all '%1' variables to:`,e.Msg.RESET_ZOOM=`Reset zoom`,e.Msg.SCREENREADER_HINT=`Use the arrow keys to navigate. Press %1 to toggle screenreader accessibility mode.`,e.Msg.SCREENREADER_MODE_DISABLED=`Screenreader mode is off, press %1 to turn it on`,e.Msg.SCREENREADER_MODE_ENABLED=`Screenreader mode is on, press %1 to turn it off`,e.Msg.SHIFT_KEY=`Shift`,e.Msg.SHORTCUTS_ABORT_MOVE=`Abort move`,e.Msg.SHORTCUTS_CLEANUP=`Clean up workspace`,e.Msg.SHORTCUTS_CODE_NAVIGATION=`Code navigation`,e.Msg.SHORTCUTS_DELETE=`Delete`,e.Msg.SHORTCUTS_DISCONNECT=`Disconnect block`,e.Msg.SHORTCUTS_DUPLICATE=`Duplicate`,e.Msg.SHORTCUTS_EDITING=`Editing`,e.Msg.SHORTCUTS_ESCAPE=`Exit`,e.Msg.SHORTCUTS_EXTENDED_INFORMATION=`Announce detailed information`,e.Msg.SHORTCUTS_FINISH_MOVE=`Finish move`,e.Msg.SHORTCUTS_FOCUS_TOOLBOX=`Focus toolbox`,e.Msg.SHORTCUTS_FOCUS_WORKSPACE=`Focus workspace`,e.Msg.SHORTCUTS_GENERAL=`General`,e.Msg.SHORTCUTS_INFORMATION=`Announce information`,e.Msg.SHORTCUTS_JUMP_BLOCK_END=`Jump to block end`,e.Msg.SHORTCUTS_JUMP_BLOCK_START=`Jump to block start`,e.Msg.SHORTCUTS_JUMP_BOTTOM_STACK=`Jump to bottom of stack`,e.Msg.SHORTCUTS_JUMP_FIRST_BLOCK=`Jump to first block`,e.Msg.SHORTCUTS_JUMP_LAST_BLOCK=`Jump to last block`,e.Msg.SHORTCUTS_JUMP_TOP_STACK=`Jump to top of stack`,e.Msg.SHORTCUTS_MOVE_DOWN=`Move down`,e.Msg.SHORTCUTS_MOVE_LEFT=`Move left`,e.Msg.SHORTCUTS_MOVE_RIGHT=`Move right`,e.Msg.SHORTCUTS_MOVE_UP=`Move up`,e.Msg.SHORTCUTS_NEXT_HEADING=`Next heading`,e.Msg.SHORTCUTS_NEXT_STACK=`Next stack`,e.Msg.SHORTCUTS_PERFORM_ACTION=`Edit or confirm`,e.Msg.SHORTCUTS_PREVIOUS_HEADING=`Previous heading`,e.Msg.SHORTCUTS_PREVIOUS_STACK=`Previous stack`,e.Msg.SHORTCUTS_SHOW_CONTEXT_MENU=`Show menu`,e.Msg.SHORTCUTS_SHOW_TOOLTIP=`Show tooltip`,e.Msg.SHORTCUTS_START_MOVE=`Start move`,e.Msg.SHORTCUTS_START_MOVE_STACK=`Start move stack`,e.Msg.SHORTCUTS_TOGGLE_SCREENREADER_MODE=`Toggle screenreader mode`,e.Msg.SPACE_KEY=`Space`,e.Msg.TAB_KEY=`Tab`,e.Msg.TEXT_APPEND_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#text-modification`,e.Msg.TEXT_APPEND_TITLE=`to %1 append text %2`,e.Msg.TEXT_APPEND_TOOLTIP=`Append some text to variable '%1'.`,e.Msg.TEXT_CHANGECASE_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#adjusting-text-case`,e.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE=`to lower case`,e.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE=`to Title Case`,e.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE=`to UPPER CASE`,e.Msg.TEXT_CHANGECASE_TOOLTIP=`Return a copy of the text in a different case.`,e.Msg.TEXT_CHARAT_FIRST=`get first letter`,e.Msg.TEXT_CHARAT_FROM_END=`get letter # from end`,e.Msg.TEXT_CHARAT_FROM_START=`get letter #`,e.Msg.TEXT_CHARAT_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#extracting-text`,e.Msg.TEXT_CHARAT_LAST=`get last letter`,e.Msg.TEXT_CHARAT_RANDOM=`get random letter`,e.Msg.TEXT_CHARAT_TAIL=``,e.Msg.TEXT_CHARAT_TITLE=`in text %1 %2`,e.Msg.TEXT_CHARAT_TOOLTIP=`Returns the letter at the specified position.`,e.Msg.TEXT_COUNT_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#counting-substrings`,e.Msg.TEXT_COUNT_MESSAGE0=`count %1 in %2`,e.Msg.TEXT_COUNT_TOOLTIP=`Count how many times some text occurs within some other text.`,e.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP=`Add an item to the text.`,e.Msg.TEXT_CREATE_JOIN_TITLE_JOIN=`join`,e.Msg.TEXT_CREATE_JOIN_TOOLTIP=`Add, remove, or reorder sections to reconfigure this text block.`,e.Msg.TEXT_FROM_END_ARIA=`letter number from end`,e.Msg.TEXT_FROM_START_ARIA=`letter number`,e.Msg.TEXT_GET_SUBSTRING_END_FROM_END=`to letter # from end`,e.Msg.TEXT_GET_SUBSTRING_END_FROM_START=`to letter #`,e.Msg.TEXT_GET_SUBSTRING_END_LAST=`to last letter`,e.Msg.TEXT_GET_SUBSTRING_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#extracting-a-region-of-text`,e.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT=`in text`,e.Msg.TEXT_GET_SUBSTRING_START_FIRST=`get substring from first letter`,e.Msg.TEXT_GET_SUBSTRING_START_FROM_END=`get substring from letter # from end`,e.Msg.TEXT_GET_SUBSTRING_START_FROM_START=`get substring from letter #`,e.Msg.TEXT_GET_SUBSTRING_TAIL=``,e.Msg.TEXT_GET_SUBSTRING_TOOLTIP=`Returns a specified portion of the text.`,e.Msg.TEXT_INDEXOF_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#finding-text`,e.Msg.TEXT_INDEXOF_OPERATOR_FIRST=`find first occurrence of text`,e.Msg.TEXT_INDEXOF_OPERATOR_LAST=`find last occurrence of text`,e.Msg.TEXT_INDEXOF_TITLE=`in text %1 %2 %3`,e.Msg.TEXT_INDEXOF_TOOLTIP=`Returns the index of the first/last occurrence of the first text in the second text. Returns %1 if text is not found.`,e.Msg.TEXT_ISEMPTY_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#checking-for-empty-text`,e.Msg.TEXT_ISEMPTY_TITLE=`%1 is empty`,e.Msg.TEXT_ISEMPTY_TOOLTIP=`Returns true if the provided text is empty.`,e.Msg.TEXT_JOIN_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#text-creation`,e.Msg.TEXT_JOIN_TITLE_CREATEWITH=`create text with`,e.Msg.TEXT_JOIN_TOOLTIP=`Create a piece of text by joining together any number of items.`,e.Msg.TEXT_LENGTH_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#text-modification`,e.Msg.TEXT_LENGTH_TITLE=`length of %1`,e.Msg.TEXT_LENGTH_TOOLTIP=`Returns the number of letters (including spaces) in the provided text.`,e.Msg.TEXT_PRINT_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#printing-text`,e.Msg.TEXT_PRINT_TITLE=`print %1`,e.Msg.TEXT_PRINT_TOOLTIP=`Print the specified text, number or other value.`,e.Msg.TEXT_PROMPT_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#getting-input-from-the-user`,e.Msg.TEXT_PROMPT_TOOLTIP_NUMBER=`Prompt for user for a number.`,e.Msg.TEXT_PROMPT_TOOLTIP_TEXT=`Prompt for user for some text.`,e.Msg.TEXT_PROMPT_TYPE_NUMBER=`prompt for number with message`,e.Msg.TEXT_PROMPT_TYPE_TEXT=`prompt for text with message`,e.Msg.TEXT_REPLACE_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#replacing-substrings`,e.Msg.TEXT_REPLACE_MESSAGE0=`replace %1 with %2 in %3`,e.Msg.TEXT_REPLACE_TOOLTIP=`Replace all occurances of some text within some other text.`,e.Msg.TEXT_REVERSE_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#reversing-text`,e.Msg.TEXT_REVERSE_MESSAGE0=`reverse %1`,e.Msg.TEXT_REVERSE_TOOLTIP=`Reverses the order of the characters in the text.`,e.Msg.TEXT_TEXT_HELPURL=`https://en.wikipedia.org/wiki/String_(computer_science)`,e.Msg.TEXT_TEXT_TOOLTIP=`A letter, word, or line of text.`,e.Msg.TEXT_TRIM_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#trimming-removing-spaces`,e.Msg.TEXT_TRIM_OPERATOR_BOTH=`trim spaces from both sides of`,e.Msg.TEXT_TRIM_OPERATOR_LEFT=`trim spaces from left side of`,e.Msg.TEXT_TRIM_OPERATOR_RIGHT=`trim spaces from right side of`,e.Msg.TEXT_TRIM_TOOLTIP=`Return a copy of the text with spaces removed from one or both ends.`,e.Msg.TODAY=`Today`,e.Msg.UNDO=`Undo`,e.Msg.UNKNOWN=`Unknown`,e.Msg.UNNAMED_KEY=`unnamed`,e.Msg.VARIABLES_DEFAULT_NAME=`item`,e.Msg.VARIABLES_GET_CREATE_SET=`Create 'set %1'`,e.Msg.VARIABLES_GET_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Variables#get`,e.Msg.VARIABLES_GET_TOOLTIP=`Returns the value of this variable.`,e.Msg.VARIABLES_SET=`set %1 to %2`,e.Msg.VARIABLES_SET_CREATE_GET=`Create 'get %1'`,e.Msg.VARIABLES_SET_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Variables#set`,e.Msg.VARIABLES_SET_TOOLTIP=`Sets this variable to be equal to the input.`,e.Msg.VARIABLE_ALREADY_EXISTS=`A variable named '%1' already exists.`,e.Msg.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE=`A variable named '%1' already exists for another type: '%2'.`,e.Msg.VARIABLE_ALREADY_EXISTS_FOR_A_PARAMETER=`A variable named '%1' already exists as a parameter in the procedure '%2'.`,e.Msg.WINDOWS=`Windows`,e.Msg.WORKSPACE_COMMENT_DEFAULT_TEXT=`Say something...`,e.Msg.WORKSPACE_CONTENTS_BLOCKS_MANY=`%1 stacks of blocks%2 in workspace.`,e.Msg.WORKSPACE_CONTENTS_BLOCKS_ONE=`One stack of blocks%2 in workspace.`,e.Msg.WORKSPACE_CONTENTS_BLOCKS_ZERO=`No blocks%2 in workspace.`,e.Msg.WORKSPACE_CONTENTS_COMMENTS_MANY=` and %1 comments`,e.Msg.WORKSPACE_CONTENTS_COMMENTS_ONE=` and one comment`,e.Msg.WORKSPACE_LABEL_1_STACK=`1 stack of blocks`,e.Msg.WORKSPACE_LABEL_FLYOUT_WORKSPACE=`%1 blocks`,e.Msg.WORKSPACE_LABEL_MANY_STACKS=`%1 stacks of blocks`,e.Msg.WORKSPACE_LABEL_MUTATOR_WORKSPACE=`Block editor workspace`,e.Msg.WORKSPACE_LABEL_PLAIN=`Blocks workspace.`,e.Msg.WORKSPACE_ROLEDESCRIPTION=`workspace`,e.Msg.ZOOM_IN=`Zoom in`,e.Msg.ZOOM_OUT=`Zoom out`,e.Msg.ZOOM_TO_FIT_ARIA_LABEL=`Zoom to fit`,e.Msg.CONTROLS_FOREACH_INPUT_DO=e.Msg.CONTROLS_REPEAT_INPUT_DO,e.Msg.CONTROLS_FOR_INPUT_DO=e.Msg.CONTROLS_REPEAT_INPUT_DO,e.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF=e.Msg.CONTROLS_IF_MSG_ELSEIF,e.Msg.CONTROLS_IF_ELSE_TITLE_ELSE=e.Msg.CONTROLS_IF_MSG_ELSE,e.Msg.CONTROLS_IF_IF_TITLE_IF=e.Msg.CONTROLS_IF_MSG_IF,e.Msg.CONTROLS_IF_MSG_THEN=e.Msg.CONTROLS_REPEAT_INPUT_DO,e.Msg.CONTROLS_WHILEUNTIL_INPUT_DO=e.Msg.CONTROLS_REPEAT_INPUT_DO,e.Msg.LISTS_CREATE_WITH_ITEM_TITLE=e.Msg.VARIABLES_DEFAULT_NAME,e.Msg.LISTS_GET_INDEX_INPUT_IN_LIST=e.Msg.LISTS_INLIST,e.Msg.LISTS_GET_SUBLIST_INPUT_IN_LIST=e.Msg.LISTS_INLIST,e.Msg.LISTS_INDEX_OF_INPUT_IN_LIST=e.Msg.LISTS_INLIST,e.Msg.LISTS_SET_INDEX_INPUT_IN_LIST=e.Msg.LISTS_INLIST,e.Msg.MATH_CHANGE_TITLE_ITEM=e.Msg.VARIABLES_DEFAULT_NAME,e.Msg.PROCEDURES_DEFRETURN_COMMENT=e.Msg.PROCEDURES_DEFNORETURN_COMMENT,e.Msg.PROCEDURES_DEFRETURN_DO=e.Msg.PROCEDURES_DEFNORETURN_DO,e.Msg.PROCEDURES_DEFRETURN_PROCEDURE=e.Msg.PROCEDURES_DEFNORETURN_PROCEDURE,e.Msg.PROCEDURES_DEFRETURN_TITLE=e.Msg.PROCEDURES_DEFNORETURN_TITLE,e.Msg.TEXT_APPEND_VARIABLE=e.Msg.VARIABLES_DEFAULT_NAME,e.Msg.TEXT_CREATE_JOIN_ITEM_TITLE_ITEM=e.Msg.VARIABLES_DEFAULT_NAME,e.Msg.COLOUR_HUE=`20`,e.Msg.LISTS_HUE=`260`,e.Msg.LOGIC_HUE=`210`,e.Msg.LOOPS_HUE=`120`,e.Msg.MATH_HUE=`230`,e.Msg.PROCEDURES_HUE=`290`,e.Msg.TEXTS_HUE=`160`,e.Msg.VARIABLES_DYNAMIC_HUE=`310`,e.Msg.VARIABLES_HUE=`330`,e.Msg})})),Hh=n({ADD_COMMENT:()=>ng,ALT_KEY:()=>bw,ANNOUNCE_MOVE_AFTER:()=>XE,ANNOUNCE_MOVE_AROUND:()=>QE,ANNOUNCE_MOVE_BEFORE:()=>YE,ANNOUNCE_MOVE_CANCELED:()=>tD,ANNOUNCE_MOVE_INSIDE:()=>ZE,ANNOUNCE_MOVE_OF:()=>eD,ANNOUNCE_MOVE_TO:()=>$E,ANNOUNCE_MOVE_WORKSPACE:()=>JE,ARIA_LABEL_ADD_ELSE_IF:()=>VD,ARIA_LABEL_ADD_INPUT:()=>qD,ARIA_LABEL_ADD_LIST_ITEM:()=>UD,ARIA_LABEL_ADD_TEXT:()=>GD,ARIA_LABEL_BUTTON:()=>bD,ARIA_LABEL_COMMENT:()=>MD,ARIA_LABEL_COMMENT_COLLAPSE:()=>ND,ARIA_LABEL_COMMENT_EXPAND:()=>PD,ARIA_LABEL_FIELD_ANGLE:()=>XD,ARIA_LABEL_HEADING:()=>xD,ARIA_LABEL_REMOVE_ELSE_IF:()=>HD,ARIA_LABEL_REMOVE_INPUT:()=>JD,ARIA_LABEL_REMOVE_LIST_ITEM:()=>WD,ARIA_LABEL_REMOVE_TEXT:()=>KD,ARIA_LABEL_TRASH_EMPTY:()=>vO,ARIA_TYPE_FIELD_ANGLE:()=>YD,ARIA_TYPE_FIELD_BITMAP:()=>$D,ARIA_TYPE_FIELD_CHECKBOX:()=>uD,ARIA_TYPE_FIELD_COLOUR:()=>QD,ARIA_TYPE_FIELD_DATE:()=>ZD,ARIA_TYPE_FIELD_DROPDOWN:()=>cD,ARIA_TYPE_FIELD_GRID:()=>eO,ARIA_TYPE_FIELD_IMAGE:()=>lD,ARIA_TYPE_FIELD_INPUT:()=>rD,ARIA_TYPE_FIELD_NUMBER:()=>aD,ARIA_TYPE_FIELD_TEXT_INPUT:()=>iD,ARIA_TYPE_FIELD_TEXT_INPUT_ARGUMENT:()=>sD,ARIA_TYPE_FIELD_TEXT_INPUT_PROCEDURE:()=>oD,BACKSPACE_KEY:()=>Sw,BLOCK_LABEL_BEGIN_PREFIX:()=>zT,BLOCK_LABEL_BEGIN_STACK:()=>RT,BLOCK_LABEL_COLLAPSED:()=>HT,BLOCK_LABEL_CONTAINER:()=>JT,BLOCK_LABEL_DISABLED:()=>VT,BLOCK_LABEL_HAS_BRANCHES:()=>KT,BLOCK_LABEL_HAS_INPUT:()=>WT,BLOCK_LABEL_HAS_INPUTS:()=>GT,BLOCK_LABEL_REPLACEABLE:()=>UT,BLOCK_LABEL_STACK_BLOCKS:()=>XT,BLOCK_LABEL_STATEMENT:()=>qT,BLOCK_LABEL_TOOLBOX_CATEGORY:()=>BT,BLOCK_LABEL_VALUE:()=>YT,BUBBLE_LABEL_COMMENT:()=>CD,BUBBLE_LABEL_DEFAULT:()=>SD,BUBBLE_LABEL_WARNING:()=>wD,CANNOT_DELETE_VARIABLE_PROCEDURE:()=>Pg,CAPS_LOCK_KEY:()=>Dw,CHANGE_VALUE_TITLE:()=>xg,CHROME_OS:()=>mw,CLEAN_UP:()=>ug,CLOSE:()=>dg,CLOSE_BACKPACK:()=>cO,COLLAPSED_WARNINGS_WARNING:()=>sw,COLLAPSE_ALL:()=>pg,COLLAPSE_BLOCK:()=>fg,COLOUR_BLEND_COLOUR1:()=>Yg,COLOUR_BLEND_COLOUR2:()=>Xg,COLOUR_BLEND_HELPURL:()=>qg,COLOUR_BLEND_RATIO:()=>Zg,COLOUR_BLEND_TITLE:()=>Jg,COLOUR_BLEND_TOOLTIP:()=>Qg,COLOUR_HUE:()=>Jh,COLOUR_PICKER_HELPURL:()=>Ig,COLOUR_PICKER_TOOLTIP:()=>Lg,COLOUR_RANDOM_HELPURL:()=>Rg,COLOUR_RANDOM_TITLE:()=>zg,COLOUR_RANDOM_TOOLTIP:()=>Bg,COLOUR_RGB_BLUE:()=>Gg,COLOUR_RGB_GREEN:()=>Wg,COLOUR_RGB_HELPURL:()=>Vg,COLOUR_RGB_RED:()=>Ug,COLOUR_RGB_TITLE:()=>Hg,COLOUR_RGB_TOOLTIP:()=>Kg,COMMAND_KEY:()=>vw,CONTEXT_MENU_KEY:()=>Fw,CONTROLS_FLOW_STATEMENTS_HELPURL:()=>__,CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK:()=>v_,CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE:()=>y_,CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK:()=>b_,CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE:()=>x_,CONTROLS_FLOW_STATEMENTS_WARNING:()=>S_,CONTROLS_FOREACH_HELPURL:()=>p_,CONTROLS_FOREACH_INPUT_DO:()=>h_,CONTROLS_FOREACH_TITLE:()=>m_,CONTROLS_FOREACH_TOOLTIP:()=>g_,CONTROLS_FOR_HELPURL:()=>l_,CONTROLS_FOR_INPUT_DO:()=>f_,CONTROLS_FOR_TITLE:()=>d_,CONTROLS_FOR_TOOLTIP:()=>u_,CONTROLS_IF_ELSEIF_TITLE_ELSEIF:()=>P_,CONTROLS_IF_ELSEIF_TOOLTIP:()=>F_,CONTROLS_IF_ELSE_TITLE_ELSE:()=>I_,CONTROLS_IF_ELSE_TOOLTIP:()=>L_,CONTROLS_IF_HELPURL:()=>C_,CONTROLS_IF_IF_TITLE_IF:()=>M_,CONTROLS_IF_IF_TOOLTIP:()=>N_,CONTROLS_IF_MSG_ELSE:()=>A_,CONTROLS_IF_MSG_ELSEIF:()=>k_,CONTROLS_IF_MSG_IF:()=>O_,CONTROLS_IF_MSG_THEN:()=>j_,CONTROLS_IF_TOOLTIP_1:()=>w_,CONTROLS_IF_TOOLTIP_2:()=>T_,CONTROLS_IF_TOOLTIP_3:()=>E_,CONTROLS_IF_TOOLTIP_4:()=>D_,CONTROLS_REPEAT_HELPURL:()=>$g,CONTROLS_REPEAT_INPUT_DO:()=>t_,CONTROLS_REPEAT_TITLE:()=>e_,CONTROLS_REPEAT_TOOLTIP:()=>n_,CONTROLS_WHILEUNTIL_HELPURL:()=>r_,CONTROLS_WHILEUNTIL_INPUT_DO:()=>i_,CONTROLS_WHILEUNTIL_OPERATOR_UNTIL:()=>o_,CONTROLS_WHILEUNTIL_OPERATOR_WHILE:()=>a_,CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL:()=>c_,CONTROLS_WHILEUNTIL_TOOLTIP_WHILE:()=>s_,CONTROL_KEY:()=>_w,COPY_ALL_TO_BACKPACK:()=>lO,COPY_SHORTCUT:()=>Lw,COPY_TO_BACKPACK:()=>uO,CURRENT_BLOCK_ANNOUNCEMENT:()=>LD,CUT_SHORTCUT:()=>Iw,DELETE_ALL_BLOCKS:()=>lg,DELETE_BLOCK:()=>sg,DELETE_KEY:()=>Cw,DELETE_VARIABLE:()=>Fg,DELETE_VARIABLE_CONFIRMATION:()=>Ng,DELETE_X_BLOCKS:()=>cg,DIALOG_CANCEL:()=>lw,DIALOG_OK:()=>cw,DISABLE_BLOCK:()=>gg,DUPLICATE_BLOCK:()=>tg,DUPLICATE_COMMENT:()=>ig,EDIT_BLOCK_CONTENTS:()=>uw,EMPTY_BACKPACK:()=>dO,ENABLE_BLOCK:()=>_g,END_KEY:()=>jw,ENTER_KEY:()=>xw,ESCAPE:()=>ww,EXPAND_ALL:()=>hg,EXPAND_BLOCK:()=>mg,EXTERNAL_INPUTS:()=>ag,FIELD_BITMAP_ARIA_VALUE:()=>oO,FIELD_BITMAP_BUTTON_LABEL_CLEAR:()=>nO,FIELD_BITMAP_BUTTON_LABEL_RANDOMIZE:()=>tO,FIELD_BITMAP_PIXEL_LABEL:()=>aO,FIELD_BITMAP_PIXEL_OFF:()=>iO,FIELD_BITMAP_PIXEL_ON:()=>rO,FIELD_LABEL_CHECKBOX_CHECKED:()=>_D,FIELD_LABEL_CHECKBOX_UNCHECKED:()=>vD,FIELD_LABEL_EDIT_PREFIX:()=>dD,FIELD_LABEL_EMPTY:()=>nD,FIELD_LABEL_OPTION_INDEX:()=>gD,FIELD_LABEL_VARIABLE:()=>yD,FIELD_MULTILINEINPUT_FINISH_EDITING:()=>mO,FIELD_MULTILINEINPUT_NEW_LINE:()=>hO,HELP:()=>vg,HELP_PROMPT:()=>zw,HOME_KEY:()=>Mw,ICON_LABEL_COMMENT_CLOSED:()=>ED,ICON_LABEL_COMMENT_OPEN:()=>DD,ICON_LABEL_DEFAULT:()=>TD,ICON_LABEL_MUTATOR_CLOSED:()=>OD,ICON_LABEL_MUTATOR_OPEN:()=>kD,ICON_LABEL_WARNING_CLOSED:()=>AD,ICON_LABEL_WARNING_OPEN:()=>jD,INLINE_INPUTS:()=>og,INPUT_LABEL_CONDITION:()=>nE,INPUT_LABEL_CONDITION_A:()=>rE,INPUT_LABEL_CONDITION_B:()=>iE,INPUT_LABEL_EMPTY:()=>tE,INPUT_LABEL_END_STATEMENT:()=>eE,INPUT_LABEL_INDEX:()=>ZT,INPUT_LABEL_LISTS_CREATE_WITH_ITEM:()=>IE,INPUT_LABEL_LISTS_DELIMITER:()=>KE,INPUT_LABEL_LISTS_END_POSITION:()=>UE,INPUT_LABEL_LISTS_LIST_FROM_TEXT:()=>WE,INPUT_LABEL_LISTS_POSITION:()=>VE,INPUT_LABEL_LISTS_REPEAT_ITEM:()=>LE,INPUT_LABEL_LISTS_REPEAT_NUM:()=>RE,INPUT_LABEL_LISTS_START_POSITION:()=>HE,INPUT_LABEL_LISTS_TEXT_FROM_LIST:()=>GE,INPUT_LABEL_LISTS_TO_CHANGE:()=>qE,INPUT_LABEL_LISTS_TO_CHECK:()=>zE,INPUT_LABEL_LISTS_VALUE_TO_SET:()=>BE,INPUT_LABEL_LOOP_BY:()=>CE,INPUT_LABEL_LOOP_FROM:()=>xE,INPUT_LABEL_LOOP_LIST:()=>wE,INPUT_LABEL_LOOP_TIMES:()=>bE,INPUT_LABEL_LOOP_TO:()=>SE,INPUT_LABEL_MATH_CHANGE_BY:()=>mE,INPUT_LABEL_MATH_CONSTRAIN_VALUE:()=>hE,INPUT_LABEL_MATH_DIVIDEND:()=>fE,INPUT_LABEL_MATH_DIVISOR:()=>pE,INPUT_LABEL_NUMBER:()=>sE,INPUT_LABEL_NUMBER_A:()=>cE,INPUT_LABEL_NUMBER_ATAN2_X:()=>vE,INPUT_LABEL_NUMBER_ATAN2_Y:()=>yE,INPUT_LABEL_NUMBER_B:()=>lE,INPUT_LABEL_NUMBER_LIST:()=>dE,INPUT_LABEL_NUMBER_MAX:()=>_E,INPUT_LABEL_NUMBER_MIN:()=>gE,INPUT_LABEL_NUMBER_TO_CHECK:()=>uE,INPUT_LABEL_STATEMENT:()=>$T,INPUT_LABEL_TEXT_APPEND:()=>EE,INPUT_LABEL_TEXT_END_POSITION:()=>NE,INPUT_LABEL_TEXT_JOIN_ITEM:()=>TE,INPUT_LABEL_TEXT_POSITION:()=>jE,INPUT_LABEL_TEXT_PROMPT_MESSAGE:()=>PE,INPUT_LABEL_TEXT_START_POSITION:()=>ME,INPUT_LABEL_TEXT_TO_CHANGE:()=>DE,INPUT_LABEL_TEXT_TO_CHECK:()=>OE,INPUT_LABEL_TEXT_TO_FIND:()=>kE,INPUT_LABEL_TEXT_TO_REPLACE:()=>AE,INPUT_LABEL_VALUE:()=>QT,INPUT_LABEL_VALUE_A:()=>aE,INPUT_LABEL_VALUE_B:()=>oE,INPUT_LABEL_VARIABLES_SET:()=>FE,INSERT_KEY:()=>Nw,KEYBOARD_NAV_BLOCK_NAVIGATION_HINT:()=>FT,KEYBOARD_NAV_CONSTRAINED_MOVE_HINT:()=>xT,KEYBOARD_NAV_COPIED_HINT:()=>ST,KEYBOARD_NAV_CUT_HINT:()=>CT,KEYBOARD_NAV_FLYOUT_LABEL_HINT:()=>LT,KEYBOARD_NAV_UNCONSTRAINED_MOVE_HINT:()=>bT,KEYBOARD_NAV_WORKSPACE_NAVIGATION_HINT:()=>IT,LINUX:()=>hw,LISTS_CREATE_EMPTY_HELPURL:()=>zx,LISTS_CREATE_EMPTY_TITLE:()=>Bx,LISTS_CREATE_EMPTY_TOOLTIP:()=>Vx,LISTS_CREATE_WITH_CONTAINER_TITLE_ADD:()=>Gx,LISTS_CREATE_WITH_CONTAINER_TOOLTIP:()=>Kx,LISTS_CREATE_WITH_HELPURL:()=>Hx,LISTS_CREATE_WITH_INPUT_WITH:()=>Wx,LISTS_CREATE_WITH_ITEM_TITLE:()=>qx,LISTS_CREATE_WITH_ITEM_TOOLTIP:()=>Jx,LISTS_CREATE_WITH_TOOLTIP:()=>Ux,LISTS_GET_INDEX_FIRST:()=>gS,LISTS_GET_INDEX_FROM_END:()=>hS,LISTS_GET_INDEX_FROM_START:()=>mS,LISTS_GET_INDEX_GET:()=>dS,LISTS_GET_INDEX_GET_REMOVE:()=>fS,LISTS_GET_INDEX_HELPURL:()=>uS,LISTS_GET_INDEX_INPUT_IN_LIST:()=>bS,LISTS_GET_INDEX_LAST:()=>_S,LISTS_GET_INDEX_RANDOM:()=>vS,LISTS_GET_INDEX_REMOVE:()=>pS,LISTS_GET_INDEX_TAIL:()=>yS,LISTS_GET_INDEX_TOOLTIP_GET_FIRST:()=>wS,LISTS_GET_INDEX_TOOLTIP_GET_FROM:()=>CS,LISTS_GET_INDEX_TOOLTIP_GET_LAST:()=>TS,LISTS_GET_INDEX_TOOLTIP_GET_RANDOM:()=>ES,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST:()=>OS,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM:()=>DS,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST:()=>kS,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM:()=>AS,LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST:()=>MS,LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM:()=>jS,LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST:()=>NS,LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM:()=>PS,LISTS_GET_SUBLIST_END_FROM_END:()=>eC,LISTS_GET_SUBLIST_END_FROM_START:()=>$S,LISTS_GET_SUBLIST_END_LAST:()=>tC,LISTS_GET_SUBLIST_HELPURL:()=>JS,LISTS_GET_SUBLIST_INPUT_IN_LIST:()=>YS,LISTS_GET_SUBLIST_START_FIRST:()=>QS,LISTS_GET_SUBLIST_START_FROM_END:()=>ZS,LISTS_GET_SUBLIST_START_FROM_START:()=>XS,LISTS_GET_SUBLIST_TAIL:()=>nC,LISTS_GET_SUBLIST_TOOLTIP:()=>rC,LISTS_HUE:()=>qh,LISTS_INDEX_FROM_END_TOOLTIP:()=>SS,LISTS_INDEX_FROM_START_TOOLTIP:()=>xS,LISTS_INDEX_OF_FIRST:()=>sS,LISTS_INDEX_OF_HELPURL:()=>aS,LISTS_INDEX_OF_INPUT_IN_LIST:()=>oS,LISTS_INDEX_OF_LAST:()=>cS,LISTS_INDEX_OF_TOOLTIP:()=>lS,LISTS_INLIST:()=>iS,LISTS_ISEMPTY_HELPURL:()=>tS,LISTS_ISEMPTY_TITLE:()=>nS,LISTS_ISEMPTY_TOOLTIP:()=>rS,LISTS_LENGTH_HELPURL:()=>Qx,LISTS_LENGTH_TITLE:()=>$x,LISTS_LENGTH_TOOLTIP:()=>eS,LISTS_REPEAT_HELPURL:()=>Yx,LISTS_REPEAT_TITLE:()=>Zx,LISTS_REPEAT_TOOLTIP:()=>Xx,LISTS_REVERSE_HELPURL:()=>vC,LISTS_REVERSE_MESSAGE0:()=>yC,LISTS_REVERSE_TOOLTIP:()=>bC,LISTS_SET_INDEX_HELPURL:()=>FS,LISTS_SET_INDEX_INPUT_IN_LIST:()=>IS,LISTS_SET_INDEX_INPUT_TO:()=>zS,LISTS_SET_INDEX_INSERT:()=>RS,LISTS_SET_INDEX_SET:()=>LS,LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST:()=>GS,LISTS_SET_INDEX_TOOLTIP_INSERT_FROM:()=>WS,LISTS_SET_INDEX_TOOLTIP_INSERT_LAST:()=>KS,LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM:()=>qS,LISTS_SET_INDEX_TOOLTIP_SET_FIRST:()=>VS,LISTS_SET_INDEX_TOOLTIP_SET_FROM:()=>BS,LISTS_SET_INDEX_TOOLTIP_SET_LAST:()=>HS,LISTS_SET_INDEX_TOOLTIP_SET_RANDOM:()=>US,LISTS_SORT_HELPURL:()=>iC,LISTS_SORT_ORDER_ASCENDING:()=>sC,LISTS_SORT_ORDER_DESCENDING:()=>cC,LISTS_SORT_TITLE:()=>aC,LISTS_SORT_TOOLTIP:()=>oC,LISTS_SORT_TYPE_IGNORECASE:()=>dC,LISTS_SORT_TYPE_NUMERIC:()=>lC,LISTS_SORT_TYPE_TEXT:()=>uC,LISTS_SPLIT_HELPURL:()=>fC,LISTS_SPLIT_LIST_FROM_TEXT:()=>pC,LISTS_SPLIT_TEXT_FROM_LIST:()=>mC,LISTS_SPLIT_TOOLTIP_JOIN:()=>_C,LISTS_SPLIT_TOOLTIP_SPLIT:()=>gC,LISTS_SPLIT_WITH_DELIMITER:()=>hC,LOGIC_BOOLEAN_FALSE:()=>sv,LOGIC_BOOLEAN_HELPURL:()=>av,LOGIC_BOOLEAN_TOOLTIP:()=>cv,LOGIC_BOOLEAN_TRUE:()=>ov,LOGIC_COMPARE_EQ_ARIA:()=>z_,LOGIC_COMPARE_GTE_ARIA:()=>Y_,LOGIC_COMPARE_GT_ARIA:()=>q_,LOGIC_COMPARE_HELPURL:()=>R_,LOGIC_COMPARE_LTE_ARIA:()=>G_,LOGIC_COMPARE_LT_ARIA:()=>U_,LOGIC_COMPARE_NEQ_ARIA:()=>V_,LOGIC_COMPARE_TOOLTIP_EQ:()=>B_,LOGIC_COMPARE_TOOLTIP_GT:()=>J_,LOGIC_COMPARE_TOOLTIP_GTE:()=>X_,LOGIC_COMPARE_TOOLTIP_LT:()=>W_,LOGIC_COMPARE_TOOLTIP_LTE:()=>K_,LOGIC_COMPARE_TOOLTIP_NEQ:()=>H_,LOGIC_HUE:()=>Uh,LOGIC_NEGATE_HELPURL:()=>nv,LOGIC_NEGATE_TITLE:()=>rv,LOGIC_NEGATE_TOOLTIP:()=>iv,LOGIC_NULL:()=>uv,LOGIC_NULL_HELPURL:()=>lv,LOGIC_NULL_TOOLTIP:()=>dv,LOGIC_OPERATION_AND:()=>$_,LOGIC_OPERATION_HELPURL:()=>Z_,LOGIC_OPERATION_OR:()=>tv,LOGIC_OPERATION_TOOLTIP_AND:()=>Q_,LOGIC_OPERATION_TOOLTIP_OR:()=>ev,LOGIC_TERNARY_CONDITION:()=>pv,LOGIC_TERNARY_HELPURL:()=>fv,LOGIC_TERNARY_IF_FALSE:()=>hv,LOGIC_TERNARY_IF_TRUE:()=>mv,LOGIC_TERNARY_TOOLTIP:()=>gv,LOOPS_HUE:()=>Wh,MAC_OS:()=>pw,MATH_ADDITION_SYMBOL:()=>yv,MATH_ADDITION_SYMBOL_ARIA:()=>bv,MATH_ARITHMETIC_HELPURL:()=>qv,MATH_ARITHMETIC_TOOLTIP_ADD:()=>Jv,MATH_ARITHMETIC_TOOLTIP_DIVIDE:()=>Zv,MATH_ARITHMETIC_TOOLTIP_MINUS:()=>Yv,MATH_ARITHMETIC_TOOLTIP_MULTIPLY:()=>Xv,MATH_ARITHMETIC_TOOLTIP_POWER:()=>Qv,MATH_ATAN2_HELPURL:()=>vb,MATH_ATAN2_TITLE:()=>yb,MATH_ATAN2_TOOLTIP:()=>bb,MATH_CHANGE_HELPURL:()=>My,MATH_CHANGE_TITLE:()=>Ny,MATH_CHANGE_TITLE_ITEM:()=>Py,MATH_CHANGE_TOOLTIP:()=>Fy,MATH_CONSTANT_E_ARIA:()=>Hv,MATH_CONSTANT_GOLDEN_RATIO_ARIA:()=>Uv,MATH_CONSTANT_HELPURL:()=>Sy,MATH_CONSTANT_INFINITY_ARIA:()=>Kv,MATH_CONSTANT_PI_ARIA:()=>Vv,MATH_CONSTANT_SQRT1_2_ARIA:()=>Gv,MATH_CONSTANT_SQRT2_ARIA:()=>Wv,MATH_CONSTANT_TOOLTIP:()=>Cy,MATH_CONSTRAIN_HELPURL:()=>lb,MATH_CONSTRAIN_TITLE:()=>ub,MATH_CONSTRAIN_TOOLTIP:()=>db,MATH_DIVISION_SYMBOL:()=>Cv,MATH_DIVISION_SYMBOL_ARIA:()=>wv,MATH_HUE:()=>Gh,MATH_IS_DIVISIBLE_BY:()=>Ay,MATH_IS_EVEN:()=>wy,MATH_IS_NEGATIVE:()=>ky,MATH_IS_ODD:()=>Ty,MATH_IS_POSITIVE:()=>Oy,MATH_IS_PRIME:()=>Ey,MATH_IS_TOOLTIP:()=>jy,MATH_IS_WHOLE:()=>Dy,MATH_MODULO_HELPURL:()=>ob,MATH_MODULO_TITLE:()=>sb,MATH_MODULO_TOOLTIP:()=>cb,MATH_MULTIPLICATION_SYMBOL:()=>Tv,MATH_MULTIPLICATION_SYMBOL_ARIA:()=>Ev,MATH_NUMBER_HELPURL:()=>_v,MATH_NUMBER_TOOLTIP:()=>vv,MATH_ONLIST_HELPURL:()=>Vy,MATH_ONLIST_OPERATOR_AVERAGE:()=>Xy,MATH_ONLIST_OPERATOR_MAX:()=>qy,MATH_ONLIST_OPERATOR_MAX_ARIA:()=>Jy,MATH_ONLIST_OPERATOR_MEDIAN:()=>Qy,MATH_ONLIST_OPERATOR_MIN:()=>Wy,MATH_ONLIST_OPERATOR_MIN_ARIA:()=>Gy,MATH_ONLIST_OPERATOR_MODE:()=>eb,MATH_ONLIST_OPERATOR_RANDOM:()=>ib,MATH_ONLIST_OPERATOR_STD_DEV:()=>nb,MATH_ONLIST_OPERATOR_SUM:()=>Hy,MATH_ONLIST_TOOLTIP_AVERAGE:()=>Zy,MATH_ONLIST_TOOLTIP_MAX:()=>Yy,MATH_ONLIST_TOOLTIP_MEDIAN:()=>$y,MATH_ONLIST_TOOLTIP_MIN:()=>Ky,MATH_ONLIST_TOOLTIP_MODE:()=>tb,MATH_ONLIST_TOOLTIP_RANDOM:()=>ab,MATH_ONLIST_TOOLTIP_STD_DEV:()=>rb,MATH_ONLIST_TOOLTIP_SUM:()=>Uy,MATH_POWER_SYMBOL:()=>Dv,MATH_POWER_SYMBOL_ARIA:()=>Ov,MATH_RANDOM_FLOAT_HELPURL:()=>hb,MATH_RANDOM_FLOAT_TITLE_RANDOM:()=>gb,MATH_RANDOM_FLOAT_TOOLTIP:()=>_b,MATH_RANDOM_INT_HELPURL:()=>fb,MATH_RANDOM_INT_TITLE:()=>pb,MATH_RANDOM_INT_TOOLTIP:()=>mb,MATH_ROUND_HELPURL:()=>Iy,MATH_ROUND_OPERATOR_ROUND:()=>Ry,MATH_ROUND_OPERATOR_ROUNDDOWN:()=>By,MATH_ROUND_OPERATOR_ROUNDUP:()=>zy,MATH_ROUND_TOOLTIP:()=>Ly,MATH_SINGLE_HELPURL:()=>$v,MATH_SINGLE_OP_ABSOLUTE:()=>ny,MATH_SINGLE_OP_ABSOLUTE_ARIA:()=>ry,MATH_SINGLE_OP_EXP_ARIA:()=>cy,MATH_SINGLE_OP_LN_ARIA:()=>oy,MATH_SINGLE_OP_LOG10_ARIA:()=>sy,MATH_SINGLE_OP_NEG_ARIA:()=>ay,MATH_SINGLE_OP_POW10_ARIA:()=>ly,MATH_SINGLE_OP_ROOT:()=>ey,MATH_SINGLE_TOOLTIP_ABS:()=>iy,MATH_SINGLE_TOOLTIP_EXP:()=>py,MATH_SINGLE_TOOLTIP_LN:()=>dy,MATH_SINGLE_TOOLTIP_LOG10:()=>fy,MATH_SINGLE_TOOLTIP_NEG:()=>uy,MATH_SINGLE_TOOLTIP_POW10:()=>my,MATH_SINGLE_TOOLTIP_ROOT:()=>ty,MATH_SUBTRACTION_SYMBOL:()=>xv,MATH_SUBTRACTION_SYMBOL_ARIA:()=>Sv,MATH_TRIG_ACOS:()=>Lv,MATH_TRIG_ACOS_ARIA:()=>Rv,MATH_TRIG_ASIN:()=>Fv,MATH_TRIG_ASIN_ARIA:()=>Iv,MATH_TRIG_ATAN:()=>zv,MATH_TRIG_ATAN_ARIA:()=>Bv,MATH_TRIG_COS:()=>jv,MATH_TRIG_COS_ARIA:()=>Mv,MATH_TRIG_HELPURL:()=>hy,MATH_TRIG_SIN:()=>kv,MATH_TRIG_SIN_ARIA:()=>Av,MATH_TRIG_TAN:()=>Nv,MATH_TRIG_TAN_ARIA:()=>Pv,MATH_TRIG_TOOLTIP_ACOS:()=>by,MATH_TRIG_TOOLTIP_ASIN:()=>yy,MATH_TRIG_TOOLTIP_ATAN:()=>xy,MATH_TRIG_TOOLTIP_COS:()=>_y,MATH_TRIG_TOOLTIP_SIN:()=>gy,MATH_TRIG_TOOLTIP_TAN:()=>vy,MINIMAP_ARIA_LABEL:()=>_O,MOVE_BLOCK:()=>dw,NEW_COLOUR_VARIABLE:()=>Dg,NEW_NUMBER_VARIABLE:()=>Eg,NEW_STRING_VARIABLE:()=>Tg,NEW_VARIABLE:()=>wg,NEW_VARIABLE_TITLE:()=>kg,NEW_VARIABLE_TYPE_TITLE:()=>Og,NO_PARENT_ANNOUNCEMENT:()=>zD,OPEN_BACKPACK:()=>sO,OPEN_TRASH:()=>fD,OPTION_KEY:()=>yw,ORDINAL_NUMBER_SUFFIX:()=>xC,PAGE_DOWN_KEY:()=>Aw,PAGE_UP_KEY:()=>kw,PARENT_BLOCKS_ANNOUNCEMENT:()=>RD,PASTE_ALL_FROM_BACKPACK:()=>fO,PASTE_SHORTCUT:()=>Rw,PAUSE_KEY:()=>Pw,PROCEDURES_ALLOW_STATEMENTS:()=>GC,PROCEDURES_BEFORE_PARAMS:()=>MC,PROCEDURES_CALLNORETURN_HELPURL:()=>qC,PROCEDURES_CALLNORETURN_TOOLTIP:()=>JC,PROCEDURES_CALLRETURN_HELPURL:()=>YC,PROCEDURES_CALLRETURN_TOOLTIP:()=>XC,PROCEDURES_CALL_BEFORE_PARAMS:()=>NC,PROCEDURES_CALL_DISABLED_DEF_WARNING:()=>PC,PROCEDURES_CREATE_DO:()=>nw,PROCEDURES_DEFNORETURN_COMMENT:()=>LC,PROCEDURES_DEFNORETURN_DO:()=>FC,PROCEDURES_DEFNORETURN_HELPURL:()=>kC,PROCEDURES_DEFNORETURN_PROCEDURE:()=>jC,PROCEDURES_DEFNORETURN_TITLE:()=>AC,PROCEDURES_DEFNORETURN_TOOLTIP:()=>IC,PROCEDURES_DEFRETURN_COMMENT:()=>HC,PROCEDURES_DEFRETURN_DO:()=>VC,PROCEDURES_DEFRETURN_HELPURL:()=>RC,PROCEDURES_DEFRETURN_PROCEDURE:()=>BC,PROCEDURES_DEFRETURN_RETURN:()=>UC,PROCEDURES_DEFRETURN_TITLE:()=>zC,PROCEDURES_DEFRETURN_TOOLTIP:()=>WC,PROCEDURES_DEF_DUPLICATE_WARNING:()=>KC,PROCEDURES_HIGHLIGHT_DEF:()=>tw,PROCEDURES_HUE:()=>Zh,PROCEDURES_IFRETURN_HELPURL:()=>iw,PROCEDURES_IFRETURN_TOOLTIP:()=>rw,PROCEDURES_IFRETURN_WARNING:()=>aw,PROCEDURES_MUTATORARG_TITLE:()=>$C,PROCEDURES_MUTATORARG_TOOLTIP:()=>ew,PROCEDURES_MUTATORCONTAINER_TITLE:()=>ZC,PROCEDURES_MUTATORCONTAINER_TOOLTIP:()=>QC,REDO:()=>bg,REMOVE_COMMENT:()=>rg,REMOVE_FROM_BACKPACK:()=>pO,RENAME_VARIABLE:()=>Sg,RENAME_VARIABLE_TITLE:()=>Cg,RESET_ZOOM:()=>hD,SCREENREADER_HINT:()=>BD,SCREENREADER_MODE_DISABLED:()=>ID,SCREENREADER_MODE_ENABLED:()=>FD,SHIFT_KEY:()=>Ew,SHORTCUTS_ABORT_MOVE:()=>Qw,SHORTCUTS_CLEANUP:()=>dT,SHORTCUTS_CODE_NAVIGATION:()=>Hw,SHORTCUTS_DELETE:()=>Ww,SHORTCUTS_DISCONNECT:()=>iT,SHORTCUTS_DUPLICATE:()=>uT,SHORTCUTS_EDITING:()=>Vw,SHORTCUTS_ESCAPE:()=>Uw,SHORTCUTS_EXTENDED_INFORMATION:()=>rT,SHORTCUTS_FINISH_MOVE:()=>Zw,SHORTCUTS_FOCUS_TOOLBOX:()=>tT,SHORTCUTS_FOCUS_WORKSPACE:()=>eT,SHORTCUTS_GENERAL:()=>Bw,SHORTCUTS_INFORMATION:()=>nT,SHORTCUTS_JUMP_BLOCK_END:()=>hT,SHORTCUTS_JUMP_BLOCK_START:()=>mT,SHORTCUTS_JUMP_BOTTOM_STACK:()=>_T,SHORTCUTS_JUMP_FIRST_BLOCK:()=>vT,SHORTCUTS_JUMP_LAST_BLOCK:()=>yT,SHORTCUTS_JUMP_TOP_STACK:()=>gT,SHORTCUTS_MOVE_DOWN:()=>Xw,SHORTCUTS_MOVE_LEFT:()=>qw,SHORTCUTS_MOVE_RIGHT:()=>Jw,SHORTCUTS_MOVE_UP:()=>Yw,SHORTCUTS_NEXT_HEADING:()=>sT,SHORTCUTS_NEXT_STACK:()=>aT,SHORTCUTS_PERFORM_ACTION:()=>lT,SHORTCUTS_PREVIOUS_HEADING:()=>cT,SHORTCUTS_PREVIOUS_STACK:()=>oT,SHORTCUTS_SHOW_CONTEXT_MENU:()=>$w,SHORTCUTS_SHOW_TOOLTIP:()=>fT,SHORTCUTS_START_MOVE:()=>Gw,SHORTCUTS_START_MOVE_STACK:()=>Kw,SHORTCUTS_TOGGLE_SCREENREADER_MODE:()=>pT,SPACE_KEY:()=>Ow,TAB_KEY:()=>Tw,TEXTS_HUE:()=>Kh,TEXT_APPEND_HELPURL:()=>Ab,TEXT_APPEND_TITLE:()=>jb,TEXT_APPEND_TOOLTIP:()=>Nb,TEXT_APPEND_VARIABLE:()=>Mb,TEXT_CHANGECASE_HELPURL:()=>fx,TEXT_CHANGECASE_OPERATOR_LOWERCASE:()=>hx,TEXT_CHANGECASE_OPERATOR_TITLECASE:()=>gx,TEXT_CHANGECASE_OPERATOR_UPPERCASE:()=>mx,TEXT_CHANGECASE_TOOLTIP:()=>px,TEXT_CHARAT_FIRST:()=>Zb,TEXT_CHARAT_FROM_END:()=>Xb,TEXT_CHARAT_FROM_START:()=>Yb,TEXT_CHARAT_HELPURL:()=>qb,TEXT_CHARAT_LAST:()=>Qb,TEXT_CHARAT_RANDOM:()=>$b,TEXT_CHARAT_TAIL:()=>ex,TEXT_CHARAT_TITLE:()=>Jb,TEXT_CHARAT_TOOLTIP:()=>tx,TEXT_COUNT_HELPURL:()=>jx,TEXT_COUNT_MESSAGE0:()=>Ax,TEXT_COUNT_TOOLTIP:()=>Mx,TEXT_CREATE_JOIN_ITEM_TITLE_ITEM:()=>Ob,TEXT_CREATE_JOIN_ITEM_TOOLTIP:()=>kb,TEXT_CREATE_JOIN_TITLE_JOIN:()=>Eb,TEXT_CREATE_JOIN_TOOLTIP:()=>Db,TEXT_FROM_END_ARIA:()=>Kb,TEXT_FROM_START_ARIA:()=>Gb,TEXT_GET_SUBSTRING_END_FROM_END:()=>lx,TEXT_GET_SUBSTRING_END_FROM_START:()=>cx,TEXT_GET_SUBSTRING_END_LAST:()=>ux,TEXT_GET_SUBSTRING_HELPURL:()=>rx,TEXT_GET_SUBSTRING_INPUT_IN_TEXT:()=>ix,TEXT_GET_SUBSTRING_START_FIRST:()=>sx,TEXT_GET_SUBSTRING_START_FROM_END:()=>ox,TEXT_GET_SUBSTRING_START_FROM_START:()=>ax,TEXT_GET_SUBSTRING_TAIL:()=>dx,TEXT_GET_SUBSTRING_TOOLTIP:()=>nx,TEXT_INDEXOF_HELPURL:()=>Bb,TEXT_INDEXOF_OPERATOR_FIRST:()=>Ub,TEXT_INDEXOF_OPERATOR_LAST:()=>Wb,TEXT_INDEXOF_TITLE:()=>Hb,TEXT_INDEXOF_TOOLTIP:()=>Vb,TEXT_ISEMPTY_HELPURL:()=>Lb,TEXT_ISEMPTY_TITLE:()=>Rb,TEXT_ISEMPTY_TOOLTIP:()=>zb,TEXT_JOIN_HELPURL:()=>Cb,TEXT_JOIN_TITLE_CREATEWITH:()=>wb,TEXT_JOIN_TOOLTIP:()=>Tb,TEXT_LENGTH_HELPURL:()=>Pb,TEXT_LENGTH_TITLE:()=>Fb,TEXT_LENGTH_TOOLTIP:()=>Ib,TEXT_PRINT_HELPURL:()=>Sx,TEXT_PRINT_TITLE:()=>Cx,TEXT_PRINT_TOOLTIP:()=>wx,TEXT_PROMPT_HELPURL:()=>Tx,TEXT_PROMPT_TOOLTIP_NUMBER:()=>Ox,TEXT_PROMPT_TOOLTIP_TEXT:()=>kx,TEXT_PROMPT_TYPE_NUMBER:()=>Dx,TEXT_PROMPT_TYPE_TEXT:()=>Ex,TEXT_REPLACE_HELPURL:()=>Px,TEXT_REPLACE_MESSAGE0:()=>Nx,TEXT_REPLACE_TOOLTIP:()=>Fx,TEXT_REVERSE_HELPURL:()=>Lx,TEXT_REVERSE_MESSAGE0:()=>Ix,TEXT_REVERSE_TOOLTIP:()=>Rx,TEXT_TEXT_HELPURL:()=>xb,TEXT_TEXT_TOOLTIP:()=>Sb,TEXT_TRIM_HELPURL:()=>_x,TEXT_TRIM_OPERATOR_BOTH:()=>yx,TEXT_TRIM_OPERATOR_LEFT:()=>bx,TEXT_TRIM_OPERATOR_RIGHT:()=>xx,TEXT_TRIM_TOOLTIP:()=>vx,TODAY:()=>eg,UNDO:()=>yg,UNKNOWN:()=>gw,UNNAMED_KEY:()=>$h,VARIABLES_DEFAULT_NAME:()=>Qh,VARIABLES_DYNAMIC_HUE:()=>Xh,VARIABLES_GET_CREATE_SET:()=>wC,VARIABLES_GET_HELPURL:()=>SC,VARIABLES_GET_TOOLTIP:()=>CC,VARIABLES_HUE:()=>Yh,VARIABLES_SET:()=>EC,VARIABLES_SET_CREATE_GET:()=>OC,VARIABLES_SET_HELPURL:()=>TC,VARIABLES_SET_TOOLTIP:()=>DC,VARIABLE_ALREADY_EXISTS:()=>Ag,VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE:()=>jg,VARIABLE_ALREADY_EXISTS_FOR_A_PARAMETER:()=>Mg,WINDOWS:()=>fw,WORKSPACE_COMMENT_DEFAULT_TEXT:()=>ow,WORKSPACE_CONTENTS_BLOCKS_MANY:()=>AT,WORKSPACE_CONTENTS_BLOCKS_ONE:()=>jT,WORKSPACE_CONTENTS_BLOCKS_ZERO:()=>MT,WORKSPACE_CONTENTS_COMMENTS_MANY:()=>NT,WORKSPACE_CONTENTS_COMMENTS_ONE:()=>PT,WORKSPACE_LABEL_1_STACK:()=>ET,WORKSPACE_LABEL_FLYOUT_WORKSPACE:()=>kT,WORKSPACE_LABEL_MANY_STACKS:()=>DT,WORKSPACE_LABEL_MUTATOR_WORKSPACE:()=>OT,WORKSPACE_LABEL_PLAIN:()=>wT,WORKSPACE_ROLEDESCRIPTION:()=>TT,ZOOM_IN:()=>pD,ZOOM_OUT:()=>mD,ZOOM_TO_FIT_ARIA_LABEL:()=>gO}),{LOGIC_HUE:Uh,LOOPS_HUE:Wh,MATH_HUE:Gh,TEXTS_HUE:Kh,LISTS_HUE:qh,COLOUR_HUE:Jh,VARIABLES_HUE:Yh,VARIABLES_DYNAMIC_HUE:Xh,PROCEDURES_HUE:Zh,VARIABLES_DEFAULT_NAME:Qh,UNNAMED_KEY:$h,TODAY:eg,DUPLICATE_BLOCK:tg,ADD_COMMENT:ng,REMOVE_COMMENT:rg,DUPLICATE_COMMENT:ig,EXTERNAL_INPUTS:ag,INLINE_INPUTS:og,DELETE_BLOCK:sg,DELETE_X_BLOCKS:cg,DELETE_ALL_BLOCKS:lg,CLEAN_UP:ug,CLOSE:dg,COLLAPSE_BLOCK:fg,COLLAPSE_ALL:pg,EXPAND_BLOCK:mg,EXPAND_ALL:hg,DISABLE_BLOCK:gg,ENABLE_BLOCK:_g,HELP:vg,UNDO:yg,REDO:bg,CHANGE_VALUE_TITLE:xg,RENAME_VARIABLE:Sg,RENAME_VARIABLE_TITLE:Cg,NEW_VARIABLE:wg,NEW_STRING_VARIABLE:Tg,NEW_NUMBER_VARIABLE:Eg,NEW_COLOUR_VARIABLE:Dg,NEW_VARIABLE_TYPE_TITLE:Og,NEW_VARIABLE_TITLE:kg,VARIABLE_ALREADY_EXISTS:Ag,VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE:jg,VARIABLE_ALREADY_EXISTS_FOR_A_PARAMETER:Mg,DELETE_VARIABLE_CONFIRMATION:Ng,CANNOT_DELETE_VARIABLE_PROCEDURE:Pg,DELETE_VARIABLE:Fg,COLOUR_PICKER_HELPURL:Ig,COLOUR_PICKER_TOOLTIP:Lg,COLOUR_RANDOM_HELPURL:Rg,COLOUR_RANDOM_TITLE:zg,COLOUR_RANDOM_TOOLTIP:Bg,COLOUR_RGB_HELPURL:Vg,COLOUR_RGB_TITLE:Hg,COLOUR_RGB_RED:Ug,COLOUR_RGB_GREEN:Wg,COLOUR_RGB_BLUE:Gg,COLOUR_RGB_TOOLTIP:Kg,COLOUR_BLEND_HELPURL:qg,COLOUR_BLEND_TITLE:Jg,COLOUR_BLEND_COLOUR1:Yg,COLOUR_BLEND_COLOUR2:Xg,COLOUR_BLEND_RATIO:Zg,COLOUR_BLEND_TOOLTIP:Qg,CONTROLS_REPEAT_HELPURL:$g,CONTROLS_REPEAT_TITLE:e_,CONTROLS_REPEAT_INPUT_DO:t_,CONTROLS_REPEAT_TOOLTIP:n_,CONTROLS_WHILEUNTIL_HELPURL:r_,CONTROLS_WHILEUNTIL_INPUT_DO:i_,CONTROLS_WHILEUNTIL_OPERATOR_WHILE:a_,CONTROLS_WHILEUNTIL_OPERATOR_UNTIL:o_,CONTROLS_WHILEUNTIL_TOOLTIP_WHILE:s_,CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL:c_,CONTROLS_FOR_HELPURL:l_,CONTROLS_FOR_TOOLTIP:u_,CONTROLS_FOR_TITLE:d_,CONTROLS_FOR_INPUT_DO:f_,CONTROLS_FOREACH_HELPURL:p_,CONTROLS_FOREACH_TITLE:m_,CONTROLS_FOREACH_INPUT_DO:h_,CONTROLS_FOREACH_TOOLTIP:g_,CONTROLS_FLOW_STATEMENTS_HELPURL:__,CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK:v_,CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE:y_,CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK:b_,CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE:x_,CONTROLS_FLOW_STATEMENTS_WARNING:S_,CONTROLS_IF_HELPURL:C_,CONTROLS_IF_TOOLTIP_1:w_,CONTROLS_IF_TOOLTIP_2:T_,CONTROLS_IF_TOOLTIP_3:E_,CONTROLS_IF_TOOLTIP_4:D_,CONTROLS_IF_MSG_IF:O_,CONTROLS_IF_MSG_ELSEIF:k_,CONTROLS_IF_MSG_ELSE:A_,CONTROLS_IF_MSG_THEN:j_,CONTROLS_IF_IF_TITLE_IF:M_,CONTROLS_IF_IF_TOOLTIP:N_,CONTROLS_IF_ELSEIF_TITLE_ELSEIF:P_,CONTROLS_IF_ELSEIF_TOOLTIP:F_,CONTROLS_IF_ELSE_TITLE_ELSE:I_,CONTROLS_IF_ELSE_TOOLTIP:L_,LOGIC_COMPARE_HELPURL:R_,LOGIC_COMPARE_EQ_ARIA:z_,LOGIC_COMPARE_TOOLTIP_EQ:B_,LOGIC_COMPARE_NEQ_ARIA:V_,LOGIC_COMPARE_TOOLTIP_NEQ:H_,LOGIC_COMPARE_LT_ARIA:U_,LOGIC_COMPARE_TOOLTIP_LT:W_,LOGIC_COMPARE_LTE_ARIA:G_,LOGIC_COMPARE_TOOLTIP_LTE:K_,LOGIC_COMPARE_GT_ARIA:q_,LOGIC_COMPARE_TOOLTIP_GT:J_,LOGIC_COMPARE_GTE_ARIA:Y_,LOGIC_COMPARE_TOOLTIP_GTE:X_,LOGIC_OPERATION_HELPURL:Z_,LOGIC_OPERATION_TOOLTIP_AND:Q_,LOGIC_OPERATION_AND:$_,LOGIC_OPERATION_TOOLTIP_OR:ev,LOGIC_OPERATION_OR:tv,LOGIC_NEGATE_HELPURL:nv,LOGIC_NEGATE_TITLE:rv,LOGIC_NEGATE_TOOLTIP:iv,LOGIC_BOOLEAN_HELPURL:av,LOGIC_BOOLEAN_TRUE:ov,LOGIC_BOOLEAN_FALSE:sv,LOGIC_BOOLEAN_TOOLTIP:cv,LOGIC_NULL_HELPURL:lv,LOGIC_NULL:uv,LOGIC_NULL_TOOLTIP:dv,LOGIC_TERNARY_HELPURL:fv,LOGIC_TERNARY_CONDITION:pv,LOGIC_TERNARY_IF_TRUE:mv,LOGIC_TERNARY_IF_FALSE:hv,LOGIC_TERNARY_TOOLTIP:gv,MATH_NUMBER_HELPURL:_v,MATH_NUMBER_TOOLTIP:vv,MATH_ADDITION_SYMBOL:yv,MATH_ADDITION_SYMBOL_ARIA:bv,MATH_SUBTRACTION_SYMBOL:xv,MATH_SUBTRACTION_SYMBOL_ARIA:Sv,MATH_DIVISION_SYMBOL:Cv,MATH_DIVISION_SYMBOL_ARIA:wv,MATH_MULTIPLICATION_SYMBOL:Tv,MATH_MULTIPLICATION_SYMBOL_ARIA:Ev,MATH_POWER_SYMBOL:Dv,MATH_POWER_SYMBOL_ARIA:Ov,MATH_TRIG_SIN:kv,MATH_TRIG_SIN_ARIA:Av,MATH_TRIG_COS:jv,MATH_TRIG_COS_ARIA:Mv,MATH_TRIG_TAN:Nv,MATH_TRIG_TAN_ARIA:Pv,MATH_TRIG_ASIN:Fv,MATH_TRIG_ASIN_ARIA:Iv,MATH_TRIG_ACOS:Lv,MATH_TRIG_ACOS_ARIA:Rv,MATH_TRIG_ATAN:zv,MATH_TRIG_ATAN_ARIA:Bv,MATH_CONSTANT_PI_ARIA:Vv,MATH_CONSTANT_E_ARIA:Hv,MATH_CONSTANT_GOLDEN_RATIO_ARIA:Uv,MATH_CONSTANT_SQRT2_ARIA:Wv,MATH_CONSTANT_SQRT1_2_ARIA:Gv,MATH_CONSTANT_INFINITY_ARIA:Kv,MATH_ARITHMETIC_HELPURL:qv,MATH_ARITHMETIC_TOOLTIP_ADD:Jv,MATH_ARITHMETIC_TOOLTIP_MINUS:Yv,MATH_ARITHMETIC_TOOLTIP_MULTIPLY:Xv,MATH_ARITHMETIC_TOOLTIP_DIVIDE:Zv,MATH_ARITHMETIC_TOOLTIP_POWER:Qv,MATH_SINGLE_HELPURL:$v,MATH_SINGLE_OP_ROOT:ey,MATH_SINGLE_TOOLTIP_ROOT:ty,MATH_SINGLE_OP_ABSOLUTE:ny,MATH_SINGLE_OP_ABSOLUTE_ARIA:ry,MATH_SINGLE_TOOLTIP_ABS:iy,MATH_SINGLE_OP_NEG_ARIA:ay,MATH_SINGLE_OP_LN_ARIA:oy,MATH_SINGLE_OP_LOG10_ARIA:sy,MATH_SINGLE_OP_EXP_ARIA:cy,MATH_SINGLE_OP_POW10_ARIA:ly,MATH_SINGLE_TOOLTIP_NEG:uy,MATH_SINGLE_TOOLTIP_LN:dy,MATH_SINGLE_TOOLTIP_LOG10:fy,MATH_SINGLE_TOOLTIP_EXP:py,MATH_SINGLE_TOOLTIP_POW10:my,MATH_TRIG_HELPURL:hy,MATH_TRIG_TOOLTIP_SIN:gy,MATH_TRIG_TOOLTIP_COS:_y,MATH_TRIG_TOOLTIP_TAN:vy,MATH_TRIG_TOOLTIP_ASIN:yy,MATH_TRIG_TOOLTIP_ACOS:by,MATH_TRIG_TOOLTIP_ATAN:xy,MATH_CONSTANT_HELPURL:Sy,MATH_CONSTANT_TOOLTIP:Cy,MATH_IS_EVEN:wy,MATH_IS_ODD:Ty,MATH_IS_PRIME:Ey,MATH_IS_WHOLE:Dy,MATH_IS_POSITIVE:Oy,MATH_IS_NEGATIVE:ky,MATH_IS_DIVISIBLE_BY:Ay,MATH_IS_TOOLTIP:jy,MATH_CHANGE_HELPURL:My,MATH_CHANGE_TITLE:Ny,MATH_CHANGE_TITLE_ITEM:Py,MATH_CHANGE_TOOLTIP:Fy,MATH_ROUND_HELPURL:Iy,MATH_ROUND_TOOLTIP:Ly,MATH_ROUND_OPERATOR_ROUND:Ry,MATH_ROUND_OPERATOR_ROUNDUP:zy,MATH_ROUND_OPERATOR_ROUNDDOWN:By,MATH_ONLIST_HELPURL:Vy,MATH_ONLIST_OPERATOR_SUM:Hy,MATH_ONLIST_TOOLTIP_SUM:Uy,MATH_ONLIST_OPERATOR_MIN:Wy,MATH_ONLIST_OPERATOR_MIN_ARIA:Gy,MATH_ONLIST_TOOLTIP_MIN:Ky,MATH_ONLIST_OPERATOR_MAX:qy,MATH_ONLIST_OPERATOR_MAX_ARIA:Jy,MATH_ONLIST_TOOLTIP_MAX:Yy,MATH_ONLIST_OPERATOR_AVERAGE:Xy,MATH_ONLIST_TOOLTIP_AVERAGE:Zy,MATH_ONLIST_OPERATOR_MEDIAN:Qy,MATH_ONLIST_TOOLTIP_MEDIAN:$y,MATH_ONLIST_OPERATOR_MODE:eb,MATH_ONLIST_TOOLTIP_MODE:tb,MATH_ONLIST_OPERATOR_STD_DEV:nb,MATH_ONLIST_TOOLTIP_STD_DEV:rb,MATH_ONLIST_OPERATOR_RANDOM:ib,MATH_ONLIST_TOOLTIP_RANDOM:ab,MATH_MODULO_HELPURL:ob,MATH_MODULO_TITLE:sb,MATH_MODULO_TOOLTIP:cb,MATH_CONSTRAIN_HELPURL:lb,MATH_CONSTRAIN_TITLE:ub,MATH_CONSTRAIN_TOOLTIP:db,MATH_RANDOM_INT_HELPURL:fb,MATH_RANDOM_INT_TITLE:pb,MATH_RANDOM_INT_TOOLTIP:mb,MATH_RANDOM_FLOAT_HELPURL:hb,MATH_RANDOM_FLOAT_TITLE_RANDOM:gb,MATH_RANDOM_FLOAT_TOOLTIP:_b,MATH_ATAN2_HELPURL:vb,MATH_ATAN2_TITLE:yb,MATH_ATAN2_TOOLTIP:bb,TEXT_TEXT_HELPURL:xb,TEXT_TEXT_TOOLTIP:Sb,TEXT_JOIN_HELPURL:Cb,TEXT_JOIN_TITLE_CREATEWITH:wb,TEXT_JOIN_TOOLTIP:Tb,TEXT_CREATE_JOIN_TITLE_JOIN:Eb,TEXT_CREATE_JOIN_TOOLTIP:Db,TEXT_CREATE_JOIN_ITEM_TITLE_ITEM:Ob,TEXT_CREATE_JOIN_ITEM_TOOLTIP:kb,TEXT_APPEND_HELPURL:Ab,TEXT_APPEND_TITLE:jb,TEXT_APPEND_VARIABLE:Mb,TEXT_APPEND_TOOLTIP:Nb,TEXT_LENGTH_HELPURL:Pb,TEXT_LENGTH_TITLE:Fb,TEXT_LENGTH_TOOLTIP:Ib,TEXT_ISEMPTY_HELPURL:Lb,TEXT_ISEMPTY_TITLE:Rb,TEXT_ISEMPTY_TOOLTIP:zb,TEXT_INDEXOF_HELPURL:Bb,TEXT_INDEXOF_TOOLTIP:Vb,TEXT_INDEXOF_TITLE:Hb,TEXT_INDEXOF_OPERATOR_FIRST:Ub,TEXT_INDEXOF_OPERATOR_LAST:Wb,TEXT_FROM_START_ARIA:Gb,TEXT_FROM_END_ARIA:Kb,TEXT_CHARAT_HELPURL:qb,TEXT_CHARAT_TITLE:Jb,TEXT_CHARAT_FROM_START:Yb,TEXT_CHARAT_FROM_END:Xb,TEXT_CHARAT_FIRST:Zb,TEXT_CHARAT_LAST:Qb,TEXT_CHARAT_RANDOM:$b,TEXT_CHARAT_TAIL:ex,TEXT_CHARAT_TOOLTIP:tx,TEXT_GET_SUBSTRING_TOOLTIP:nx,TEXT_GET_SUBSTRING_HELPURL:rx,TEXT_GET_SUBSTRING_INPUT_IN_TEXT:ix,TEXT_GET_SUBSTRING_START_FROM_START:ax,TEXT_GET_SUBSTRING_START_FROM_END:ox,TEXT_GET_SUBSTRING_START_FIRST:sx,TEXT_GET_SUBSTRING_END_FROM_START:cx,TEXT_GET_SUBSTRING_END_FROM_END:lx,TEXT_GET_SUBSTRING_END_LAST:ux,TEXT_GET_SUBSTRING_TAIL:dx,TEXT_CHANGECASE_HELPURL:fx,TEXT_CHANGECASE_TOOLTIP:px,TEXT_CHANGECASE_OPERATOR_UPPERCASE:mx,TEXT_CHANGECASE_OPERATOR_LOWERCASE:hx,TEXT_CHANGECASE_OPERATOR_TITLECASE:gx,TEXT_TRIM_HELPURL:_x,TEXT_TRIM_TOOLTIP:vx,TEXT_TRIM_OPERATOR_BOTH:yx,TEXT_TRIM_OPERATOR_LEFT:bx,TEXT_TRIM_OPERATOR_RIGHT:xx,TEXT_PRINT_HELPURL:Sx,TEXT_PRINT_TITLE:Cx,TEXT_PRINT_TOOLTIP:wx,TEXT_PROMPT_HELPURL:Tx,TEXT_PROMPT_TYPE_TEXT:Ex,TEXT_PROMPT_TYPE_NUMBER:Dx,TEXT_PROMPT_TOOLTIP_NUMBER:Ox,TEXT_PROMPT_TOOLTIP_TEXT:kx,TEXT_COUNT_MESSAGE0:Ax,TEXT_COUNT_HELPURL:jx,TEXT_COUNT_TOOLTIP:Mx,TEXT_REPLACE_MESSAGE0:Nx,TEXT_REPLACE_HELPURL:Px,TEXT_REPLACE_TOOLTIP:Fx,TEXT_REVERSE_MESSAGE0:Ix,TEXT_REVERSE_HELPURL:Lx,TEXT_REVERSE_TOOLTIP:Rx,LISTS_CREATE_EMPTY_HELPURL:zx,LISTS_CREATE_EMPTY_TITLE:Bx,LISTS_CREATE_EMPTY_TOOLTIP:Vx,LISTS_CREATE_WITH_HELPURL:Hx,LISTS_CREATE_WITH_TOOLTIP:Ux,LISTS_CREATE_WITH_INPUT_WITH:Wx,LISTS_CREATE_WITH_CONTAINER_TITLE_ADD:Gx,LISTS_CREATE_WITH_CONTAINER_TOOLTIP:Kx,LISTS_CREATE_WITH_ITEM_TITLE:qx,LISTS_CREATE_WITH_ITEM_TOOLTIP:Jx,LISTS_REPEAT_HELPURL:Yx,LISTS_REPEAT_TOOLTIP:Xx,LISTS_REPEAT_TITLE:Zx,LISTS_LENGTH_HELPURL:Qx,LISTS_LENGTH_TITLE:$x,LISTS_LENGTH_TOOLTIP:eS,LISTS_ISEMPTY_HELPURL:tS,LISTS_ISEMPTY_TITLE:nS,LISTS_ISEMPTY_TOOLTIP:rS,LISTS_INLIST:iS,LISTS_INDEX_OF_HELPURL:aS,LISTS_INDEX_OF_INPUT_IN_LIST:oS,LISTS_INDEX_OF_FIRST:sS,LISTS_INDEX_OF_LAST:cS,LISTS_INDEX_OF_TOOLTIP:lS,LISTS_GET_INDEX_HELPURL:uS,LISTS_GET_INDEX_GET:dS,LISTS_GET_INDEX_GET_REMOVE:fS,LISTS_GET_INDEX_REMOVE:pS,LISTS_GET_INDEX_FROM_START:mS,LISTS_GET_INDEX_FROM_END:hS,LISTS_GET_INDEX_FIRST:gS,LISTS_GET_INDEX_LAST:_S,LISTS_GET_INDEX_RANDOM:vS,LISTS_GET_INDEX_TAIL:yS,LISTS_GET_INDEX_INPUT_IN_LIST:bS,LISTS_INDEX_FROM_START_TOOLTIP:xS,LISTS_INDEX_FROM_END_TOOLTIP:SS,LISTS_GET_INDEX_TOOLTIP_GET_FROM:CS,LISTS_GET_INDEX_TOOLTIP_GET_FIRST:wS,LISTS_GET_INDEX_TOOLTIP_GET_LAST:TS,LISTS_GET_INDEX_TOOLTIP_GET_RANDOM:ES,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM:DS,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST:OS,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST:kS,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM:AS,LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM:jS,LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST:MS,LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST:NS,LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM:PS,LISTS_SET_INDEX_HELPURL:FS,LISTS_SET_INDEX_INPUT_IN_LIST:IS,LISTS_SET_INDEX_SET:LS,LISTS_SET_INDEX_INSERT:RS,LISTS_SET_INDEX_INPUT_TO:zS,LISTS_SET_INDEX_TOOLTIP_SET_FROM:BS,LISTS_SET_INDEX_TOOLTIP_SET_FIRST:VS,LISTS_SET_INDEX_TOOLTIP_SET_LAST:HS,LISTS_SET_INDEX_TOOLTIP_SET_RANDOM:US,LISTS_SET_INDEX_TOOLTIP_INSERT_FROM:WS,LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST:GS,LISTS_SET_INDEX_TOOLTIP_INSERT_LAST:KS,LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM:qS,LISTS_GET_SUBLIST_HELPURL:JS,LISTS_GET_SUBLIST_INPUT_IN_LIST:YS,LISTS_GET_SUBLIST_START_FROM_START:XS,LISTS_GET_SUBLIST_START_FROM_END:ZS,LISTS_GET_SUBLIST_START_FIRST:QS,LISTS_GET_SUBLIST_END_FROM_START:$S,LISTS_GET_SUBLIST_END_FROM_END:eC,LISTS_GET_SUBLIST_END_LAST:tC,LISTS_GET_SUBLIST_TAIL:nC,LISTS_GET_SUBLIST_TOOLTIP:rC,LISTS_SORT_HELPURL:iC,LISTS_SORT_TITLE:aC,LISTS_SORT_TOOLTIP:oC,LISTS_SORT_ORDER_ASCENDING:sC,LISTS_SORT_ORDER_DESCENDING:cC,LISTS_SORT_TYPE_NUMERIC:lC,LISTS_SORT_TYPE_TEXT:uC,LISTS_SORT_TYPE_IGNORECASE:dC,LISTS_SPLIT_HELPURL:fC,LISTS_SPLIT_LIST_FROM_TEXT:pC,LISTS_SPLIT_TEXT_FROM_LIST:mC,LISTS_SPLIT_WITH_DELIMITER:hC,LISTS_SPLIT_TOOLTIP_SPLIT:gC,LISTS_SPLIT_TOOLTIP_JOIN:_C,LISTS_REVERSE_HELPURL:vC,LISTS_REVERSE_MESSAGE0:yC,LISTS_REVERSE_TOOLTIP:bC,ORDINAL_NUMBER_SUFFIX:xC,VARIABLES_GET_HELPURL:SC,VARIABLES_GET_TOOLTIP:CC,VARIABLES_GET_CREATE_SET:wC,VARIABLES_SET_HELPURL:TC,VARIABLES_SET:EC,VARIABLES_SET_TOOLTIP:DC,VARIABLES_SET_CREATE_GET:OC,PROCEDURES_DEFNORETURN_HELPURL:kC,PROCEDURES_DEFNORETURN_TITLE:AC,PROCEDURES_DEFNORETURN_PROCEDURE:jC,PROCEDURES_BEFORE_PARAMS:MC,PROCEDURES_CALL_BEFORE_PARAMS:NC,PROCEDURES_CALL_DISABLED_DEF_WARNING:PC,PROCEDURES_DEFNORETURN_DO:FC,PROCEDURES_DEFNORETURN_TOOLTIP:IC,PROCEDURES_DEFNORETURN_COMMENT:LC,PROCEDURES_DEFRETURN_HELPURL:RC,PROCEDURES_DEFRETURN_TITLE:zC,PROCEDURES_DEFRETURN_PROCEDURE:BC,PROCEDURES_DEFRETURN_DO:VC,PROCEDURES_DEFRETURN_COMMENT:HC,PROCEDURES_DEFRETURN_RETURN:UC,PROCEDURES_DEFRETURN_TOOLTIP:WC,PROCEDURES_ALLOW_STATEMENTS:GC,PROCEDURES_DEF_DUPLICATE_WARNING:KC,PROCEDURES_CALLNORETURN_HELPURL:qC,PROCEDURES_CALLNORETURN_TOOLTIP:JC,PROCEDURES_CALLRETURN_HELPURL:YC,PROCEDURES_CALLRETURN_TOOLTIP:XC,PROCEDURES_MUTATORCONTAINER_TITLE:ZC,PROCEDURES_MUTATORCONTAINER_TOOLTIP:QC,PROCEDURES_MUTATORARG_TITLE:$C,PROCEDURES_MUTATORARG_TOOLTIP:ew,PROCEDURES_HIGHLIGHT_DEF:tw,PROCEDURES_CREATE_DO:nw,PROCEDURES_IFRETURN_TOOLTIP:rw,PROCEDURES_IFRETURN_HELPURL:iw,PROCEDURES_IFRETURN_WARNING:aw,WORKSPACE_COMMENT_DEFAULT_TEXT:ow,COLLAPSED_WARNINGS_WARNING:sw,DIALOG_OK:cw,DIALOG_CANCEL:lw,EDIT_BLOCK_CONTENTS:uw,MOVE_BLOCK:dw,WINDOWS:fw,MAC_OS:pw,CHROME_OS:mw,LINUX:hw,UNKNOWN:gw,CONTROL_KEY:_w,COMMAND_KEY:vw,OPTION_KEY:yw,ALT_KEY:bw,ENTER_KEY:xw,BACKSPACE_KEY:Sw,DELETE_KEY:Cw,ESCAPE:ww,TAB_KEY:Tw,SHIFT_KEY:Ew,CAPS_LOCK_KEY:Dw,SPACE_KEY:Ow,PAGE_UP_KEY:kw,PAGE_DOWN_KEY:Aw,END_KEY:jw,HOME_KEY:Mw,INSERT_KEY:Nw,PAUSE_KEY:Pw,CONTEXT_MENU_KEY:Fw,CUT_SHORTCUT:Iw,COPY_SHORTCUT:Lw,PASTE_SHORTCUT:Rw,HELP_PROMPT:zw,SHORTCUTS_GENERAL:Bw,SHORTCUTS_EDITING:Vw,SHORTCUTS_CODE_NAVIGATION:Hw,SHORTCUTS_ESCAPE:Uw,SHORTCUTS_DELETE:Ww,SHORTCUTS_START_MOVE:Gw,SHORTCUTS_START_MOVE_STACK:Kw,SHORTCUTS_MOVE_LEFT:qw,SHORTCUTS_MOVE_RIGHT:Jw,SHORTCUTS_MOVE_UP:Yw,SHORTCUTS_MOVE_DOWN:Xw,SHORTCUTS_FINISH_MOVE:Zw,SHORTCUTS_ABORT_MOVE:Qw,SHORTCUTS_SHOW_CONTEXT_MENU:$w,SHORTCUTS_FOCUS_WORKSPACE:eT,SHORTCUTS_FOCUS_TOOLBOX:tT,SHORTCUTS_INFORMATION:nT,SHORTCUTS_EXTENDED_INFORMATION:rT,SHORTCUTS_DISCONNECT:iT,SHORTCUTS_NEXT_STACK:aT,SHORTCUTS_PREVIOUS_STACK:oT,SHORTCUTS_NEXT_HEADING:sT,SHORTCUTS_PREVIOUS_HEADING:cT,SHORTCUTS_PERFORM_ACTION:lT,SHORTCUTS_DUPLICATE:uT,SHORTCUTS_CLEANUP:dT,SHORTCUTS_SHOW_TOOLTIP:fT,SHORTCUTS_TOGGLE_SCREENREADER_MODE:pT,SHORTCUTS_JUMP_BLOCK_START:mT,SHORTCUTS_JUMP_BLOCK_END:hT,SHORTCUTS_JUMP_TOP_STACK:gT,SHORTCUTS_JUMP_BOTTOM_STACK:_T,SHORTCUTS_JUMP_FIRST_BLOCK:vT,SHORTCUTS_JUMP_LAST_BLOCK:yT,KEYBOARD_NAV_UNCONSTRAINED_MOVE_HINT:bT,KEYBOARD_NAV_CONSTRAINED_MOVE_HINT:xT,KEYBOARD_NAV_COPIED_HINT:ST,KEYBOARD_NAV_CUT_HINT:CT,WORKSPACE_LABEL_PLAIN:wT,WORKSPACE_ROLEDESCRIPTION:TT,WORKSPACE_LABEL_1_STACK:ET,WORKSPACE_LABEL_MANY_STACKS:DT,WORKSPACE_LABEL_MUTATOR_WORKSPACE:OT,WORKSPACE_LABEL_FLYOUT_WORKSPACE:kT,WORKSPACE_CONTENTS_BLOCKS_MANY:AT,WORKSPACE_CONTENTS_BLOCKS_ONE:jT,WORKSPACE_CONTENTS_BLOCKS_ZERO:MT,WORKSPACE_CONTENTS_COMMENTS_MANY:NT,WORKSPACE_CONTENTS_COMMENTS_ONE:PT,KEYBOARD_NAV_BLOCK_NAVIGATION_HINT:FT,KEYBOARD_NAV_WORKSPACE_NAVIGATION_HINT:IT,KEYBOARD_NAV_FLYOUT_LABEL_HINT:LT,BLOCK_LABEL_BEGIN_STACK:RT,BLOCK_LABEL_BEGIN_PREFIX:zT,BLOCK_LABEL_TOOLBOX_CATEGORY:BT,BLOCK_LABEL_DISABLED:VT,BLOCK_LABEL_COLLAPSED:HT,BLOCK_LABEL_REPLACEABLE:UT,BLOCK_LABEL_HAS_INPUT:WT,BLOCK_LABEL_HAS_INPUTS:GT,BLOCK_LABEL_HAS_BRANCHES:KT,BLOCK_LABEL_STATEMENT:qT,BLOCK_LABEL_CONTAINER:JT,BLOCK_LABEL_VALUE:YT,BLOCK_LABEL_STACK_BLOCKS:XT,INPUT_LABEL_INDEX:ZT,INPUT_LABEL_VALUE:QT,INPUT_LABEL_STATEMENT:$T,INPUT_LABEL_END_STATEMENT:eE,INPUT_LABEL_EMPTY:tE,INPUT_LABEL_CONDITION:nE,INPUT_LABEL_CONDITION_A:rE,INPUT_LABEL_CONDITION_B:iE,INPUT_LABEL_VALUE_A:aE,INPUT_LABEL_VALUE_B:oE,INPUT_LABEL_NUMBER:sE,INPUT_LABEL_NUMBER_A:cE,INPUT_LABEL_NUMBER_B:lE,INPUT_LABEL_NUMBER_TO_CHECK:uE,INPUT_LABEL_NUMBER_LIST:dE,INPUT_LABEL_MATH_DIVIDEND:fE,INPUT_LABEL_MATH_DIVISOR:pE,INPUT_LABEL_MATH_CHANGE_BY:mE,INPUT_LABEL_MATH_CONSTRAIN_VALUE:hE,INPUT_LABEL_NUMBER_MIN:gE,INPUT_LABEL_NUMBER_MAX:_E,INPUT_LABEL_NUMBER_ATAN2_X:vE,INPUT_LABEL_NUMBER_ATAN2_Y:yE,INPUT_LABEL_LOOP_TIMES:bE,INPUT_LABEL_LOOP_FROM:xE,INPUT_LABEL_LOOP_TO:SE,INPUT_LABEL_LOOP_BY:CE,INPUT_LABEL_LOOP_LIST:wE,INPUT_LABEL_TEXT_JOIN_ITEM:TE,INPUT_LABEL_TEXT_APPEND:EE,INPUT_LABEL_TEXT_TO_CHANGE:DE,INPUT_LABEL_TEXT_TO_CHECK:OE,INPUT_LABEL_TEXT_TO_FIND:kE,INPUT_LABEL_TEXT_TO_REPLACE:AE,INPUT_LABEL_TEXT_POSITION:jE,INPUT_LABEL_TEXT_START_POSITION:ME,INPUT_LABEL_TEXT_END_POSITION:NE,INPUT_LABEL_TEXT_PROMPT_MESSAGE:PE,INPUT_LABEL_VARIABLES_SET:FE,INPUT_LABEL_LISTS_CREATE_WITH_ITEM:IE,INPUT_LABEL_LISTS_REPEAT_ITEM:LE,INPUT_LABEL_LISTS_REPEAT_NUM:RE,INPUT_LABEL_LISTS_TO_CHECK:zE,INPUT_LABEL_LISTS_VALUE_TO_SET:BE,INPUT_LABEL_LISTS_POSITION:VE,INPUT_LABEL_LISTS_START_POSITION:HE,INPUT_LABEL_LISTS_END_POSITION:UE,INPUT_LABEL_LISTS_LIST_FROM_TEXT:WE,INPUT_LABEL_LISTS_TEXT_FROM_LIST:GE,INPUT_LABEL_LISTS_DELIMITER:KE,INPUT_LABEL_LISTS_TO_CHANGE:qE,ANNOUNCE_MOVE_WORKSPACE:JE,ANNOUNCE_MOVE_BEFORE:YE,ANNOUNCE_MOVE_AFTER:XE,ANNOUNCE_MOVE_INSIDE:ZE,ANNOUNCE_MOVE_AROUND:QE,ANNOUNCE_MOVE_TO:$E,ANNOUNCE_MOVE_OF:eD,ANNOUNCE_MOVE_CANCELED:tD,FIELD_LABEL_EMPTY:nD,ARIA_TYPE_FIELD_INPUT:rD,ARIA_TYPE_FIELD_TEXT_INPUT:iD,ARIA_TYPE_FIELD_NUMBER:aD,ARIA_TYPE_FIELD_TEXT_INPUT_PROCEDURE:oD,ARIA_TYPE_FIELD_TEXT_INPUT_ARGUMENT:sD,ARIA_TYPE_FIELD_DROPDOWN:cD,ARIA_TYPE_FIELD_IMAGE:lD,ARIA_TYPE_FIELD_CHECKBOX:uD,FIELD_LABEL_EDIT_PREFIX:dD,OPEN_TRASH:fD,ZOOM_IN:pD,ZOOM_OUT:mD,RESET_ZOOM:hD,FIELD_LABEL_OPTION_INDEX:gD,FIELD_LABEL_CHECKBOX_CHECKED:_D,FIELD_LABEL_CHECKBOX_UNCHECKED:vD,FIELD_LABEL_VARIABLE:yD,ARIA_LABEL_BUTTON:bD,ARIA_LABEL_HEADING:xD,BUBBLE_LABEL_DEFAULT:SD,BUBBLE_LABEL_COMMENT:CD,BUBBLE_LABEL_WARNING:wD,ICON_LABEL_DEFAULT:TD,ICON_LABEL_COMMENT_CLOSED:ED,ICON_LABEL_COMMENT_OPEN:DD,ICON_LABEL_MUTATOR_CLOSED:OD,ICON_LABEL_MUTATOR_OPEN:kD,ICON_LABEL_WARNING_CLOSED:AD,ICON_LABEL_WARNING_OPEN:jD,ARIA_LABEL_COMMENT:MD,ARIA_LABEL_COMMENT_COLLAPSE:ND,ARIA_LABEL_COMMENT_EXPAND:PD,SCREENREADER_MODE_ENABLED:FD,SCREENREADER_MODE_DISABLED:ID,CURRENT_BLOCK_ANNOUNCEMENT:LD,PARENT_BLOCKS_ANNOUNCEMENT:RD,NO_PARENT_ANNOUNCEMENT:zD,SCREENREADER_HINT:BD,ARIA_LABEL_ADD_ELSE_IF:VD,ARIA_LABEL_REMOVE_ELSE_IF:HD,ARIA_LABEL_ADD_LIST_ITEM:UD,ARIA_LABEL_REMOVE_LIST_ITEM:WD,ARIA_LABEL_ADD_TEXT:GD,ARIA_LABEL_REMOVE_TEXT:KD,ARIA_LABEL_ADD_INPUT:qD,ARIA_LABEL_REMOVE_INPUT:JD,ARIA_TYPE_FIELD_ANGLE:YD,ARIA_LABEL_FIELD_ANGLE:XD,ARIA_TYPE_FIELD_DATE:ZD,ARIA_TYPE_FIELD_COLOUR:QD,ARIA_TYPE_FIELD_BITMAP:$D,ARIA_TYPE_FIELD_GRID:eO,FIELD_BITMAP_BUTTON_LABEL_RANDOMIZE:tO,FIELD_BITMAP_BUTTON_LABEL_CLEAR:nO,FIELD_BITMAP_PIXEL_ON:rO,FIELD_BITMAP_PIXEL_OFF:iO,FIELD_BITMAP_PIXEL_LABEL:aO,FIELD_BITMAP_ARIA_VALUE:oO,OPEN_BACKPACK:sO,CLOSE_BACKPACK:cO,COPY_ALL_TO_BACKPACK:lO,COPY_TO_BACKPACK:uO,EMPTY_BACKPACK:dO,PASTE_ALL_FROM_BACKPACK:fO,REMOVE_FROM_BACKPACK:pO,FIELD_MULTILINEINPUT_FINISH_EDITING:mO,FIELD_MULTILINEINPUT_NEW_LINE:hO,ZOOM_TO_FIT_ARIA_LABEL:gO,MINIMAP_ARIA_LABEL:_O,ARIA_LABEL_TRASH_EMPTY:vO}=t(Vh(),1).default,yO=[{id:`blocks_words`,source:`module`},{id:`blocks_procedures`,source:`module`},{id:`blocks_logic`,source:`module`},{id:`blocks_switch`,source:`module`},{id:`blocks_text`,source:`module`},{id:`blocks_number`,source:`module`},{id:`field_oid`,source:`module`},{id:`field_cron`,source:`module`},{id:`field_script`,source:`module`},{id:`blocks_system`,source:`module`},{id:`blocks_action`,source:`module`},{id:`blocks_sendto`,source:`module`},{id:`blocks_time`,source:`module`},{id:`blocks_convert`,source:`module`},{id:`blocks_trigger`,source:`module`},{id:`blocks_timeout`,source:`module`},{id:`blocks_object`,source:`module`}],bO={blocks_action:()=>o(()=>import(`./blocks_action-Cax68JNQ.js`),__vite__mapDeps([9,10,11,12]),import.meta.url),blocks_convert:()=>o(()=>import(`./blocks_convert-kP7xTnRo.js`),__vite__mapDeps([13,10,11,12]),import.meta.url),blocks_words:()=>o(()=>import(`./blocks_words-BhHIf_1o.js`),[],import.meta.url),blocks_logic:()=>o(()=>import(`./blocks_logic-DMmdGePo.js`),__vite__mapDeps([14,10,11,12]),import.meta.url),blocks_number:()=>o(()=>import(`./blocks_number-DNxaWJG0.js`),__vite__mapDeps([15,10,11]),import.meta.url),blocks_procedures:()=>o(()=>import(`./blocks_procedures-ChquWIeu.js`),__vite__mapDeps([16,10,17]),import.meta.url),blocks_sendto:()=>o(()=>import(`./blocks_sendto-BhFgmaXl.js`),__vite__mapDeps([18,10,11,12]),import.meta.url),blocks_system:()=>o(()=>import(`./blocks_system-DhweUbd2.js`),__vite__mapDeps([19,10,12,20]),import.meta.url),field_cron:()=>o(()=>import(`./field_cron-BJLkgNzf.js`),__vite__mapDeps([21,10]),import.meta.url),field_oid:()=>o(()=>import(`./field_oid-CJZIeruf.js`),__vite__mapDeps([20,10]),import.meta.url),field_script:()=>o(()=>import(`./field_script-4IGidWJ7.js`),__vite__mapDeps([17,10]),import.meta.url),blocks_object:()=>o(()=>import(`./blocks_object-CeScY42Q.js`),__vite__mapDeps([22,10,11,12]),import.meta.url),blocks_switch:()=>o(()=>import(`./blocks_switch-DlLu45bT.js`),__vite__mapDeps([23,10,11]),import.meta.url),blocks_text:()=>o(()=>import(`./blocks_text-BmR86101.js`),__vite__mapDeps([24,10,11]),import.meta.url),blocks_time:()=>o(()=>import(`./blocks_time-y3-FPsEo.js`),__vite__mapDeps([25,10,11,12]),import.meta.url),blocks_trigger:()=>o(()=>import(`./blocks_trigger-BeibKDOj.js`),__vite__mapDeps([26,10,12,20,21]),import.meta.url),blocks_timeout:()=>o(()=>import(`./blocks_timeout-BJm5IiqU.js`),__vite__mapDeps([27,10,11,12]),import.meta.url)},xO={...dn,JavaScript:Bh};pn(Hh),window.Blockly=xO,window.goog||={provide:()=>{},require:()=>{}};function SO(e){return new Promise(t=>{let n=window.document.createElement(`script`);n.src=e,n.onload=()=>t(),n.onerror=()=>{console.error(`Cannot load ${e}`),t()},window.document.head.appendChild(n)})}var CO=null;function wO(){return CO||=(async()=>{for(let e of yO)if(e.source===`module`){let t=bO[e.id];if(!t){console.error(`No module registered for "${e.id}" - check BLOCK_MODULES in bridge.ts`);continue}(await t()).install()}else await SO(`google-blockly/own/${e.id}.js`)})(),CO}var X=window.Blockly,TO=class extends Error{constructor(){super(`The field has not yet been attached to its input. Call appendField to attach it.`)}},EO=class e extends X.Field{constructor(e,t,n){super(e),N(this,`textGroup`,null),N(this,`borderRect_`,null),N(this,`maxLines_`,1/0),N(this,`isOverflowedY_`,!1),e!==Symbol(`SKIP_SETUP`)&&(n&&this.configure_(n),this.SERIALIZABLE=!0,this.setValue((e==null?void 0:e.toString())||``),t&&this.setValidator(t))}configure_(e){super.configure_(e),e.maxLines&&this.setMaxLines(e.maxLines)}toXml(e){return e.textContent=this.getValue().replace(/\n/g,` `),e}fromXml(e){this.setValue(e.textContent.replace(/ /g,` +`))}saveState(){let t=this.saveLegacyState(e);return t===null?this.getValue():t}loadState(e){this.loadLegacyState(X.Field,e)||this.setValue(e)}initView(){this.createBorderRect_(),this.textGroup=X.utils.dom.createSvgElement(X.utils.Svg.G,{class:`blocklyEditableText`},this.fieldGroup_)}onHtmlInputKeyDownSuper_(e){e.key===`Enter`?(X.WidgetDiv.hideIfOwner(this),X.dropDownDiv.hideWithoutAnimation()):e.key===`Escape`?(this.setValue(this.htmlInput_.getAttribute(`data-untyped-default-value`),!1),X.WidgetDiv.hideIfOwner(this),X.dropDownDiv.hideWithoutAnimation()):e.key===`Tab`&&(X.WidgetDiv.hideIfOwner(this),X.dropDownDiv.hideWithoutAnimation(),this.sourceBlock_.tab(this,!e.shiftKey),e.preventDefault())}onHtmlInputChange_(e){let t=this.value_;this.setValue(this.getValueFromEditorText_(this.htmlInput_.value),!1),this.sourceBlock_&&X.Events.isEnabled()&&this.value_!==t&&X.Events.fire(new(X.Events.get(`block_field_intermediate_change`))(this.sourceBlock_,this.name||null,t,this.value_))}onFinishEditing_(e){}getValueFromEditorText_(e){return e}bindInputEvents_(e){this.onKeyDownWrapper_=X.browserEvents.conditionalBind(e,`keydown`,this,this.onHtmlInputKeyDown_),this.onKeyInputWrapper_=X.browserEvents.conditionalBind(e,`input`,this,this.onHtmlInputChange_)}getDisplayText_(){let e=this.getSourceBlock();if(!e)throw Error(`The field has not yet been attached to its input. Call appendField to attach it.`);let t=this.getText();if(!t)return X.Field.NBSP;let n=t.split(` +`);t=``;let r=this.isOverflowedY_?this.maxLines_:n.length;for(let e=0;ethis.maxDisplayLength?i=`${i.substring(0,this.maxDisplayLength-4)}...`:this.isOverflowedY_&&e===r-1&&(i=`${i.substring(0,i.length-3)}...`),i=i.replace(/\s/g,X.Field.NBSP),t+=i,e!==r-1&&(t+=` +`)}return e.RTL&&(t+=`‏`),t}doValueUpdate_(e){super.doValueUpdate_(e),this.value_!==null&&(this.isOverflowedY_=this.value_.split(` +`).length>this.maxLines_)}render_(){let e=this.getSourceBlock();if(!e)throw Error(`The field has not yet been attached to its input. Call appendField to attach it.`);let t,n=this.textGroup;for(;t=n.firstChild;)n.removeChild(t);let r=this.getConstants();if(!r)throw Error(`Constants not found`);let i=this.getDisplayText_().split(` +`),a=0;for(let e=0;ea&&(a=l),o+=e.FIELD_TEXT_HEIGHT+(s>0?e.FIELD_BORDER_RECT_Y_PADDING:0)}if(this.isBeingEdited_){let e=String(this.value_).split(` +`),t=X.utils.dom.createSvgElement(X.utils.Svg.TEXT,{class:`blocklyText blocklyMultilineText`});for(let o=0;othis.maxDisplayLength&&(e[o]=e[o].substring(0,this.maxDisplayLength)),t.textContent=e[o];let s=X.utils.dom.getFastTextWidth(t,n,r,i);s>a&&(a=s)}let o=this.htmlInput_,s=o.offsetWidth-o.clientWidth;a+=s}this.borderRect_&&(o+=e.FIELD_BORDER_RECT_Y_PADDING*2,a+=e.FIELD_BORDER_RECT_X_PADDING*2+1,this.borderRect_.setAttribute(`width`,`${a}`),this.borderRect_.setAttribute(`height`,`${o}`)),this.size_.width=a,this.size_.height=o,this.positionBorderRect_()}showInlineEditor_(e){let t=this.getSourceBlock();if(!t)throw new TO;X.WidgetDiv.show(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())}getEditorText_(e){return`${e}`}getScaledBBox(){let e,t,n,r=this.getSourceBlock();if(!r)throw new TO;if(this.isFullBlockField()){let i=this.sourceBlock_.getHeightWidth(),a=r.workspace.scale;n=this.getAbsoluteXY_(),e=(i.width+1)*a,t=(i.height+1)*a,X.utils.userAgent.GECKO?(n.x+=1.5*a,n.y+=1.5*a):(n.x-=.5*a,n.y-=.5*a)}else{let r=this.borderRect_.getBoundingClientRect();n=X.utils.style.getPageOffset(this.borderRect_),e=r.width,t=r.height}return new X.utils.Rect(n.y,n.y+t,n.x,n.x+e)}resizeEditor_(){X.renderManagement.finishQueuedRenders().then(()=>{let e=this.getSourceBlock();if(!e)throw new TO;let t=X.WidgetDiv.getDiv(),n=this.getScaledBBox();t.style.width=`${n.right-n.left}px`,t.style.height=`${n.bottom-n.top}px`;let r=e.RTL?n.right-t.offsetWidth:n.left,i=n.top;t.style.left=`${r}px`,t.style.top=`${i}px`})}unbindInputEvents_(){this.onKeyDownWrapper_&&=(X.browserEvents.unbind(this.onKeyDownWrapper_),null),this.onKeyInputWrapper_&&=(X.browserEvents.unbind(this.onKeyInputWrapper_),null)}getClickTarget_(){return this.clickTarget_||this.getSvgRoot()}widgetDispose_(){this.isBeingEdited_=!1,this.isTextValid_=!0,this.forceRerender(),this.onFinishEditing_(this.value_),this.sourceBlock_&&X.Events.isEnabled()&&this.valueWhenEditorWasOpened_!==null&&this.valueWhenEditorWasOpened_!==this.value_&&(X.Events.fire(new(X.Events.get(`change`))(this.sourceBlock_,`field`,this.name||null,this.valueWhenEditorWasOpened_,this.value_)),this.valueWhenEditorWasOpened_=null),X.Events.setGroup(!1),this.unbindInputEvents_();let e=X.WidgetDiv.getDiv().style;e.width=`auto`,e.height=`auto`,e.fontSize=``,e.transition=``,e.boxShadow=``,this.htmlInput_=null;let t=this.getClickTarget_();if(!t)throw Error(`A click target has not been set.`);X.utils.dom.removeClass(t,`editing`)}showEditor_(e,t){this.workspace_=this.sourceBlock_.workspace,!t&&this.workspace_.options.modalInputs&&(X.utils.userAgent.MOBILE||X.utils.userAgent.ANDROID||X.utils.userAgent.IPAD)?this.showPromptEditor_():this.showInlineEditor_(!!t),this.forceRerender()}widgetCreate_(){let e=X.WidgetDiv.getDiv(),t=this.workspace_.getScale(),n=this.getConstants();if(!n)throw Error(`Constants not found`);let r=document.createElement(`textarea`);r.className=`blocklyHtmlInput blocklyHtmlTextAreaInput`,r.setAttribute(`spellcheck`,String(this.spellcheck_));let i=`${n.FIELD_TEXT_FONTSIZE*t}pt`;e.style.fontSize=i,r.style.fontSize=i;let a=`${X.FieldTextInput.BORDERRADIUS*t}px`;r.style.borderRadius=a;let o=n.FIELD_BORDER_RECT_X_PADDING*t,s=n.FIELD_BORDER_RECT_Y_PADDING*t/2;r.style.padding=`${s}px ${o}px ${s}px ${o}px`;let c=n.FIELD_TEXT_HEIGHT+n.FIELD_BORDER_RECT_Y_PADDING;return r.style.lineHeight=`${c*t}px`,e.appendChild(r),r.value=r.defaultValue=this.getEditorText_(this.value_),r.setAttribute(`data-untyped-default-value`,String(this.value_)),r.setAttribute(`data-old-value`,``),X.utils.userAgent.GECKO?setTimeout(this.resizeEditor_.bind(this),0):this.resizeEditor_(),this.bindInputEvents_(r),r}setMaxLines(e){typeof e==`number`&&e>0&&e!==this.maxLines_&&(this.maxLines_=e,this.forceRerender())}getMaxLines(){return this.maxLines_}onHtmlInputKeyDown_(e){e.key!==`Enter`&&this.onHtmlInputKeyDownSuper_(e)}static fromJson(e){let t=X.utils.parsing.replaceMessageReferences(e.text);return new this(t,void 0,e)}};X.Css.register(` +.blocklyHtmlTextAreaInput { + font-family: monospace; + resize: none; + overflow: hidden; + height: 100%; + text-align: left; +} + +.blocklyHtmlTextAreaInputOverflowedY { + overflow-y: scroll; +} +`);var DO=`text_multiline`,OO={type:DO,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 kO(e,t){let n=t.multiline_quote_(e.getFieldValue(`TEXT`));return[n,n.indexOf(`+`)===-1?0:6.2]}window.Blockly.common.createBlockDefinitionsFromJsonArray([OO])[DO];var Z=window.Blockly,AO=class extends Z.Field{constructor(e,t,n){super(e),N(this,`picker`,null),N(this,`highlightedIndex`,null),N(this,`boundEvents`,[]),N(this,`SERIALIZABLE`,!0),N(this,`CURSOR`,`default`),N(this,`isDirty_`,!1),N(this,`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`.split(`.`)),N(this,`titles`,[]),N(this,`columns`,7),e!==Symbol(`SKIP_SETUP`)&&(n&&this.configure_(n),this.setValue(e),t&&this.setValidator(t))}configure_(e){super.configure_(e),e.colourOptions&&(this.colours=e.colourOptions),e.colourTitles&&(this.titles=e.colourTitles),e.columns&&(this.columns=e.columns)}initView(){let e=this.getConstants();if(!e)throw Error(`Constants not found`);this.size_=new Z.utils.Size(e.FIELD_COLOUR_DEFAULT_WIDTH,e.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 Z.UnattachedFieldError;let e=this.getConstants();return this.blockIsSimpleReporter()&&!!(e!=null&&e.FIELD_COLOUR_FULL_BLOCK)}blockIsSimpleReporter(){let e=this.getSourceBlock();if(!e)throw new Z.UnattachedFieldError;if(!e.outputConnection)return!1;for(let t of e.inputList)if(t.connection||t.fieldRow.length>1)return!1;return!0}applyColour(){let e=this.getSourceBlock();if(!e)throw new Z.UnattachedFieldError;if(!this.fieldGroup_)return;let t=this.borderRect_;if(!t)throw Error(`The border rect has not been initialized`);this.isFullBlockField()?(t.style.display=`none`,e.pathObject.svgPath.setAttribute(`fill`,this.getValue()),e.pathObject.svgPath.setAttribute(`stroke`,`#fff`)):(t.style.display=`block`,t.style.fill=this.getValue())}getSize(){var e;return(e=this.getConstants())!=null&&e.FIELD_COLOUR_FULL_BLOCK&&(this.render_(),this.isDirty_=!1),super.getSize()}render_(){super.render_();let e=this.getSourceBlock();if(!e)throw new Z.UnattachedFieldError;e.applyColour()}updateSize_(e){let t=this.getConstants();if(!t)return;let n,r;this.isFullBlockField()?(n=(e??0)*2,r=t.FIELD_TEXT_HEIGHT):(n=t.FIELD_COLOUR_DEFAULT_WIDTH,r=t.FIELD_COLOUR_DEFAULT_HEIGHT),this.size_.height=r,this.size_.width=n,this.positionBorderRect_()}doClassValidation_(e){return typeof e==`string`?Z.utils.colour.parse(e):null}getText(){let e=this.value_;return/^#(.)\1(.)\2(.)\3$/.test(e)&&(e=`#${e[1]}${e[3]}${e[5]}`),e}setColours(e,t){return this.colours=e,t&&(this.titles=t),this}setColumns(e){return this.columns=e,this}showEditor_(){if(this.dropdownCreate(),!this.picker)throw Error(`Picker not found`);Z.DropDownDiv.getContentDiv().appendChild(this.picker),Z.DropDownDiv.showPositionedByField(this,this.dropdownDispose.bind(this)),this.picker.focus({preventScroll:!0})}onClick(e){let t=e.target,n=t==null?void 0:t.getAttribute(`data-colour`);n!==null&&(this.setValue(n),Z.DropDownDiv.hideIfOwner(this))}onKeyDown(e){let t=!0,n;switch(e.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(n=this.getHighlighted(),n){let e=n.getAttribute(`data-colour`);e!==null&&this.setValue(e)}Z.DropDownDiv.hideWithoutAnimation();break;default:t=!1}t&&e.stopPropagation()}moveHighlightBy(e,t){if(!this.highlightedIndex)return;let n=this.colours,r=this.columns,i=this.highlightedIndex%r,a=Math.floor(this.highlightedIndex/r);i+=e,a+=t,e<0?i<0&&a>0?(i=r-1,a--):i<0&&(i=0):e>0?i>r-1&&ar-1&&i--:t<0?a<0&&(a=0):t>0&&a>Math.floor(n.length/r)-1&&(a=Math.floor(n.length/r)-1);let o=this.picker.childNodes[a].childNodes[i],s=a*r+i;this.setHighlightedCell(o,s)}onMouseMove(e){let t=e.target,n=t&&Number(t.getAttribute(`data-index`));n!==null&&n!==this.highlightedIndex&&this.setHighlightedCell(t,n)}onMouseEnter(){var e;(e=this.picker)==null||e.focus({preventScroll:!0})}onMouseLeave(){var e;(e=this.picker)==null||e.blur();let t=this.getHighlighted();t&&Z.utils.dom.removeClass(t,`blocklyColourHighlighted`)}getHighlighted(){var e;if(!this.highlightedIndex)return null;let t=this.highlightedIndex%this.columns,n=Math.floor(this.highlightedIndex/this.columns),r=(e=this.picker)==null?void 0:e.childNodes[n];return r?r.childNodes[t]:null}setHighlightedCell(e,t){let n=this.getHighlighted();n&&Z.utils.dom.removeClass(n,`blocklyColourHighlighted`),Z.utils.dom.addClass(e,`blocklyColourHighlighted`),this.highlightedIndex=t;let r=e.getAttribute(`id`);r&&this.picker&&Z.utils.aria.setState(this.picker,Z.utils.aria.State.ACTIVEDESCENDANT,r)}dropdownCreate(){let e=this.columns,t=this.colours,n=this.getValue(),r=document.createElement(`table`);r.className=`blocklyColourTable`,r.tabIndex=0,r.dir=`ltr`,Z.utils.aria.setRole(r,Z.utils.aria.Role.GRID),Z.utils.aria.setState(r,Z.utils.aria.State.EXPANDED,!0),Z.utils.aria.setState(r,Z.utils.aria.State.ROWCOUNT,Math.floor(t.length/e)),Z.utils.aria.setState(r,Z.utils.aria.State.COLCOUNT,e);let i=null;for(let a=0;atr>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; +} +`);var jO=`colour_picker`,MO={type:jO,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 NO(e,t){return[t.quote_(e.getFieldValue(`COLOUR`)),0]}window.Blockly.common.createBlockDefinitionsFromJsonArray([MO])[jO];var PO=`colour_random`,FO={type:PO,message0:`%{BKY_COLOUR_RANDOM_TITLE}`,output:`Colour`,helpUrl:`%{BKY_COLOUR_RANDOM_HELPURL}`,style:`colour_blocks`,tooltip:`%{BKY_COLOUR_RANDOM_TOOLTIP}`};function IO(e,t){return[`${t.provideFunction_(`colourRandom`,` +function ${t.FUNCTION_NAME_PLACEHOLDER_}() { + var num = Math.floor(Math.random() * 0x1000000); + return '#' + ('00000' + num.toString(16)).substr(-6); +} +`)}()`,2]}window.Blockly.common.createBlockDefinitionsFromJsonArray([FO])[PO];var LO=`colour_rgb`,RO={type:LO,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 zO(e,t){let n=t.valueToCode(e,`RED`,99)||0,r=t.valueToCode(e,`GREEN`,99)||0,i=t.valueToCode(e,`BLUE`,99)||0;return[`${t.provideFunction_(`colourRgb`,` +function ${t.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; +} +`)}(${n}, ${r}, ${i})`,2]}window.Blockly.common.createBlockDefinitionsFromJsonArray([RO])[LO];var BO=`colour_blend`,VO={type:BO,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 HO(e,t){let n=t.valueToCode(e,`COLOUR1`,99)||`'#000000'`,r=t.valueToCode(e,`COLOUR2`,99)||`'#000000'`,i=t.valueToCode(e,`RATIO`,99)||.5;return[`${t.provideFunction_(`colourBlend`,` +function ${t.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; +} +`)}(${n}, ${r}, ${i})`,2]}window.Blockly.common.createBlockDefinitionsFromJsonArray([VO])[BO];function UO(){window.Blockly.FieldMultilineInput||(window.Blockly.fieldRegistry.register(`field_multilinetext`,EO),window.Blockly.JavaScript.forBlock.text_multiline=kO,window.Blockly.FieldMultilineInput=EO,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`,AO),window.Blockly.JavaScript.forBlock.colour_picker=NO,window.Blockly.JavaScript.forBlock.colour_blend=HO,window.Blockly.JavaScript.forBlock.colour_random=IO,window.Blockly.JavaScript.forBlock.colour_rgb=zO,window.Blockly.FieldColour=AO,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}`}]))),WO()}function WO(){let e=window.Blockly.JavaScript;e.forBlock&&Object.keys(e).forEach(t=>{typeof e[t]==`function`&&(e.forBlock[t]||(console.log(`Migrating Blockly.JavaScript.${t} to Blockly.JavaScript.forBlock.${t}`),e.forBlock[t]=e[t],delete e[t]))})}var GO=null;function KO(){return GO||=window.Blockly.Theme.defineTheme(`dark`,{name:`dark`,base:window.Blockly.Themes.Classic,componentStyles:{workspaceBackgroundColour:`#1e1e1e`,toolboxBackgroundColour:`blackBackground`,toolboxForegroundColour:`#fff`,flyoutBackgroundColour:`#252526`,flyoutForegroundColour:`#ccc`,flyoutOpacity:1,scrollbarColour:`#797979`,insertionMarkerColour:`#fff`,insertionMarkerOpacity:.3,scrollbarOpacity:.4,cursorColour:`#d0d0d0`,blackBackground:`#333`}}),GO}var qO=n({default:()=>$O});G();var JO=!1,YO=!1,XO=null,ZO=[];function QO(e,t,n,r){if(r||=[],(e.tagName===`BLOCK`||e.tagName===`block`)&&(n=e.id),e.tagName===`FIELD`||e.tagName===`field`)for(let a=0;aQO(e,t,n,r)),r}var $O=class e extends W.Component{constructor(t){super(t),N(this,`blockly`,null),N(this,`blocklyWorkspace`,null),N(this,`originalCode`,void 0),N(this,`someSelected`,null),N(this,`changeTimer`,null),N(this,`lastChangeError`,``),N(this,`someSelectedTime`,0),N(this,`ignoreChanges`,!1),N(this,`blinkBlock`,void 0),N(this,`onResizeBind`,void 0),N(this,`resizeObserver`,null),N(this,`didUpdate`,null),N(this,`lastCommand`,``),N(this,`lastSearch`,void 0),N(this,`onShowNameDialog`,(e,t,n)=>{this.setState({showInputPrompt:{promptText:e,defaultText:t,callback:n,value:t}})}),this.state={languageOwnLoaded:YO,languageBlocklyLoaded:JO,changed:!1,message:``,error:``,themeType:this.props.themeType,exportText:``,importText:!1,searchText:this.props.searchText||``,showInputPrompt:null},this.originalCode=t.code||``,this.someSelected=null,this.onResizeBind=this.onResize.bind(this),this.lastSearch=this.props.searchText||``,this.blinkBlock=null,UO(),e.Blockly.dialog.setPrompt(this.onShowNameDialog),this.loadLanguages()}static loadJS(e,t,n){let r=document.createElement(`script`);try{r.src=e,r.onload=t,r.onerror=t,(n||window.document.body).appendChild(r)}catch(n){console.error(`Cannot load ${e}: ${n}`),t&&t()}}static loadScripts(t,n){if(!(t!=null&&t.length)){WO(),n&&n();return}let r=t.pop();r&&!ZO.includes(r)?(ZO.push(r),e.loadJS(`../../adapter/${r}/blockly.js`,()=>setTimeout(()=>e.loadScripts(t,n),0))):setTimeout(()=>e.loadScripts(t,n),0)}static loadCustomBlockly(t,n){let r=[];for(let e in t){var i;!Object.prototype.hasOwnProperty.call(t,e)||!t[e]||!e.match(/^system\.adapter\./)||t[e].type!==`adapter`||(i=t[e].common)!=null&&i.blockly&&(console.log(`Detected custom blockly: ${t[e].common.name}`),r.push(t[e].common.name))}wO().then(()=>e.loadScripts(r,n))}static loadXMLDoc(e){let t;return t=window.DOMParser?e=>new window.DOMParser().parseFromString(e,`text/xml`):window.ActiveXObject!==void 0&&new window.ActiveXObject(`Microsoft.XMLDOM`)?e=>{let t=new window.ActiveXObject(`Microsoft.XMLDOM`);return t.async=`false`,t.loadXML(e),t}:()=>null,t(e)}searchBlocks(t){if(this.blocklyWorkspace){let n=QO(e.Blockly.Xml.workspaceToDom(this.blocklyWorkspace),t.toLowerCase());return console.log(`Search "${t}" found blocks: ${n.length?JSON.stringify(n):`none`}`),n}return[]}searchId(){let e=this.lastSearch?this.searchBlocks(this.lastSearch):null;e!=null&&e.length?(this.someSelected=e,this.someSelected.forEach(e=>{var t;return(t=this.blocklyWorkspace)==null?void 0:t.highlightBlock(e,!0)}),this.someSelectedTime=Date.now()):this.someSelected&&=(this.someSelected.forEach(e=>{var t;return(t=this.blocklyWorkspace)==null?void 0:t.highlightBlock(e,!1)}),null)}UNSAFE_componentWillReceiveProps(t){t.command&&this.lastCommand!==t.command&&(this.lastCommand=t.command,setTimeout(()=>this.lastCommand=``,300),this.lastCommand===`check`?this.blocklyCheckBlocks((t,n)=>{t?(n&&e.blocklyBlinkBlock(n),this.setState({error:{text:V.t(t),title:V.t(`Error was found`)}}),this.blinkBlock=n):this.setState({message:V.t(`Ok`)})}):this.lastCommand===`export`?this.exportBlocks():this.lastCommand===`import`&&this.importBlocks()),t.searchText!==this.lastSearch&&(this.lastSearch=t.searchText,this.searchId()),this.state.themeType!==t.themeType&&this.setState({themeType:t.themeType},()=>this.updateBackground()),this.originalCode!==t.code&&(this.originalCode=t.code||``,this.loadCode(),this.searchId())}static async applyBlocklyMessages(e){try{let t=await fetch(e);if(!t.ok)return;let n=await t.text();Function(`define`,`exports`,`module`,n).call(window,void 0,void 0,void 0)}catch(t){console.error(`Cannot apply ${e}: ${t}`)}}loadLanguages(){if(JO||e.applyBlocklyMessages(`google-blockly/msg/js/${V.getLanguage()}.js`).then(()=>{JO=!0,this.setState({languageBlocklyLoaded:JO})}),!YO){let e=window.document.createElement(`script`);e.setAttribute(`type`,`text/javascript`),e.setAttribute(`src`,`google-blockly/own/msg/${V.getLanguage()}.js`),e.onload=()=>{YO=!0,this.setState({languageOwnLoaded:YO})},window.document.getElementsByTagName(`head`)[0].appendChild(e)}}onResize(){this.blocklyWorkspace&&e.Blockly.svgResize(this.blocklyWorkspace)}static jsCode2Blockly(e){e||=``;let t=e.split(/[\r\n]+|\r|\n/g),n=``;for(let e=t.length-1;e>=0;e--)if(t[e].substring(0,2)===`//`){n=t[e].substring(2);break}if(n.substring(0,4)===`e.select(),t),setTimeout(()=>e.unselect(),t+150)}blocklyRemoveOrphanedShadows(){if(this.blocklyWorkspace){let e=this.blocklyWorkspace.getAllBlocks(),t;for(let n=0;t=e[n];n++)if(t.isShadow()){let e=t.getConnections_(!0),n;for(let r=0;n=e[r];r++)if(!n.targetConnection){t.dispose();break}}}}blocklyCheckBlocks(t){let n;if(!this.blocklyWorkspace||this.blocklyWorkspace.getAllBlocks().length===0)return t&&t(`no blocks found`),!1;let r=this.blocklyGetUnconnectedBlock();return r?n=`not properly connected`:(r=this.blocklyGetBlockWithWarning(),r&&(n=`warning on this block`)),r?(t?t(n,r):e.blocklyBlinkBlock(r),!1):(t(),!0)}blocklyGetUnconnectedBlock(){var t;let n=(t=this.blocklyWorkspace)==null?void 0:t.getAllBlocks(),r;if(n)for(let t=0;r=n[t];t++){let t=r.getConnections_(!0),n;for(let i=0;n=t[i];i++)if(!n.sourceBlock_||(n.type===e.Blockly.INPUT_VALUE||n.type===e.Blockly.OUTPUT_VALUE)&&!n.targetConnection&&!n._optional)return r}return null}blocklyGetBlockWithWarning(){var e;let t=(e=this.blocklyWorkspace)==null?void 0:e.getAllBlocks(),n;if(t){for(let e=0;n=t[e];e++)if(n.warning)return n}return null}appendBlocksFromXml(e){this.onImportBlocks(e)}applyAiBlocks(t){if(this.blocklyWorkspace&&(t=(t||``).trim(),t))try{t.startsWith(`${t}`),t=t.replace(/[\n\r]/g,``).replace(/.*<\/variables>/g,``);let n=e.Blockly.utils.xml.textToDom(t),r=Array.from(n.querySelectorAll(`:scope > block`));if(r.length===0)return;let i=e=>{let t=e.getAttribute(`type`)||``,n=[];for(let t of Array.from(e.children))t.tagName===`field`&&n.push(`${t.getAttribute(`name`)}=${t.textContent}`),t.tagName===`mutation`&&n.push(`mut:${t.outerHTML}`);return`${t}|${n.join(`,`)}`},a=e=>{let t=e.type||``,n=[];for(let t of e.inputList||[])for(let e of t.fieldRow||[])e.name&&e.getValue&&n.push(`${e.name}=${e.getValue()}`);if(e.mutationToDom)try{let t=e.mutationToDom();t&&n.push(`mut:${t.outerHTML}`)}catch{}return`${t}|${n.join(`,`)}`},o=r.map(e=>i(e)),s=this.blocklyWorkspace.getTopBlocks(!1),c=s.map(e=>a(e)),l=Array(s.length).fill(!1),u=[];for(let e=0;e1){let e=new Set;for(let t of r)e.add(`${t.getAttribute(`x`)||`0`},${t.getAttribute(`y`)||`0`}`);if(e.size===1){let e=10;for(let t of r)t.setAttribute(`x`,`10`),t.setAttribute(`y`,String(e)),e+=200}}e.Blockly.Xml.appendDomToWorkspace(n,this.blocklyWorkspace);let p=this.blocklyWorkspace.getTopBlocks(!1),m=p.slice(-r.length),h=10;for(let e of p.slice(0,-r.length)){let t=e.getRelativeToSurfaceXY(),n=e.getHeightWidth();h=Math.max(h,t.y+n.height+30)}for(let e=0;e${t}`),t=t.replace(/[\n\r]/g,``).replace(/.*<\/variables>/g,``),window.scripts.loading=!0;let n=e.Blockly.utils.xml.textToDom(t),r=Array.from(n.querySelectorAll(`:scope > block`));if(r.length>1){let e=new Set;for(let t of r)e.add(`${t.getAttribute(`x`)||`0`},${t.getAttribute(`y`)||`0`}`);if(e.size===1){let e=parseInt(r[0].getAttribute(`y`)||`0`,10);for(let t of r)t.setAttribute(`y`,String(e)),e+=200}}if(e.Blockly.Xml.appendDomToWorkspace(n,this.blocklyWorkspace),r.length>1){let e=this.blocklyWorkspace.getTopBlocks(!1).slice(-r.length);if(e.length>1){let t=e[0].getRelativeToSurfaceXY().y;for(let n of e){let e=n.getRelativeToSurfaceXY();n.moveBy(0,t-e.y),t+=n.getHeightWidth().height+20}}}window.scripts.loading=!1,this.onBlocklyChanged()}catch(e){this.setState({error:{text:e.toString(),title:V.t(`Import error`)}})}}loadCode(){if(this.blocklyWorkspace){this.ignoreChanges=!0,this.blocklyWorkspace.clear();try{let t=e.jsCode2Blockly(this.originalCode)||``;window.scripts.loading=!0;let n=e.Blockly.utils.xml.textToDom(t);e.Blockly.Xml.domToWorkspace(n,this.blocklyWorkspace),window.scripts.loading=!1}catch(e){console.error(e),setTimeout(()=>this.setState({error:V.t(`Cannot extract Blockly code!`)}))}setTimeout(()=>this.ignoreChanges=!1,100)}}onBlocklyChanged(){try{this.blocklyRemoveOrphanedShadows(),this.setState({changed:!0}),this.onChange(),this.lastChangeError=``}catch(e){console.error(`Cannot generate the script: ${e.stack||e.toString()}`);let t=e.message||String(e);this.lastChangeError!==t&&(this.lastChangeError=t,this.setState({error:{text:`${V.t(`A block failed while generating the script, so the changes cannot be saved`)}: ${t}`,title:V.t(`Blockly error`)}}))}}async componentDidUpdate(){var t;if(!this.blockly||(this.didUpdate&&=(clearTimeout(this.didUpdate),null),this.blocklyWorkspace))return;window.addEventListener(`resize`,this.onResizeBind,!1),!this.resizeObserver&&this.blockly&&(this.resizeObserver=new ResizeObserver(()=>this.onResize()),this.resizeObserver.observe(this.blockly)),XO||=await this.getToolbox();let n=e.Blockly.utils.xml.textToDom(XO);if(this.blocklyWorkspace=e.Blockly.inject(this.blockly,{renderer:`thrasos`,theme:this.state.themeType===`dark`?KO():`classic`,media:`google-blockly/media/`,toolbox:n,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(t=>{if(this.someSelected&&Date.now()-this.someSelectedTime>500){var n;let e=(n=this.blocklyWorkspace)==null?void 0:n.getAllBlocks();this.someSelected=null,e==null||e.forEach(e=>e.removeSelect())}[e.Blockly.Events.UI,e.Blockly.Events.CREATE,e.Blockly.Events.VIEWPORT_CHANGE].includes(t.type)||this.ignoreChanges||(this.changeTimer&&clearTimeout(this.changeTimer),this.changeTimer=setTimeout(()=>{this.changeTimer=null,this.onBlocklyChanged()},200))}),this.loadCode(),this.onResize(),(t=window.Blockly)!=null&&(t=t.FieldOID)!=null&&t.DISPLAY_MODE_KEYS){let t=this.blocklyWorkspace,n=t.configureContextMenu;t.configureContextMenu=(r,i)=>{n&&n.call(t,r,i);let a=window.Blockly.FieldOID,o=a.DISPLAY_MODE_KEYS;for(let n=0;na.setDisplayMode(n,t),scope:{workspace:t},weight:200+n})}}}this.updateBackground(),setTimeout(()=>this.searchId(),200)}updateBackground(){if(this.state.themeType===`dark`){var t;(t=this.blocklyWorkspace)==null||t.setTheme(KO())}else this.blocklyWorkspace&&(this.blocklyWorkspace.getThemeManager(),this.blocklyWorkspace.setTheme(e.Blockly.Themes.Classic))}componentWillUnmount(){this.appendBlocksFromXml,this.applyAiBlocks,this.getWorkspaceXml,this.blocklyWorkspace&&(this.blocklyWorkspace.dispose(),this.blocklyWorkspace=null,this.changeTimer&&clearTimeout(this.changeTimer),this.changeTimer=null,window.removeEventListener(`resize`,this.onResizeBind),this.resizeObserver&&=(this.resizeObserver.disconnect(),null))}onChange(){this.originalCode=this.blocklyCode2JSCode(),this.props.onChange&&this.props.onChange(this.originalCode)}async getToolbox(e){let t=window.document.getElementById(`toolbox`),n=t==null?void 0:t.outerHTML;if(!n)return e?(console.error(`Cannot load blocks!`),``):new Promise(e=>{setTimeout(()=>e(this.getToolbox(!0)),500)});if(n=n.replace(/{(\w+)}/g,(e,t)=>window.MSG[t]),window.Blockly.CustomBlocks){let e=``,t=V.getLanguage();for(let n=0;n`;for(let t in i.blocks)Object.prototype.hasOwnProperty.call(i.blocks,t)&&(e+=i.blocks[t]);e+=``}n=n.replace(`%%CUSTOM_BLOCKS%%`,e)}return n}renderMessageDialog(){return this.state.message?O(wt,{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?O(un,{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&&=(e.blocklyBlinkBlock(this.blinkBlock),null),this.setState({error:``})}},`dialogError`):null}renderExportDialog(){return this.state.exportText?O(cn,{themeType:this.state.themeType,onClose:()=>this.setState({exportText:``}),text:this.state.exportText,scriptId:this.props.scriptId},`dialogExport`):null}renderImportDialog(){return this.state.importText?O(ln,{themeType:this.props.themeType,onClose:e=>{this.setState({importText:!1}),this.onImportBlocks(e)}},`dialogImport`):null}renderDialogPrompt(){return this.state.showInputPrompt?B(qe,{onClose:()=>{var e;let t=(e=this.state.showInputPrompt)==null?void 0:e.callback;t&&t(null),this.setState({showInputPrompt:null})},maxWidth:`sm`,fullWidth:!0,open:!0,children:[O(ot,{children:this.state.showInputPrompt.promptText}),O(St,{children:O(P,{variant:`standard`,fullWidth:!0,autoFocus:!0,value:this.state.showInputPrompt.value,onKeyUp:e=>{if(e.key===`Enter`){var t,n;let e=(t=this.state.showInputPrompt)==null?void 0:t.callback,r=(n=this.state.showInputPrompt)==null?void 0:n.value;e&&e(r===void 0?null:r),this.setState({showInputPrompt:null})}},onChange:e=>{var t;let n={...this.state.showInputPrompt};if((t=this.state.showInputPrompt)!=null&&t.callback){var r;n.callback=(r=this.state.showInputPrompt)==null?void 0:r.callback}n.value=e.target.value,this.setState({showInputPrompt:n})}})}),B(Vt,{children:[O(R,{variant:`contained`,disabled:!this.state.showInputPrompt.value,onClick:()=>{var e,t;let n=(e=this.state.showInputPrompt)==null?void 0:e.callback,r=(t=this.state.showInputPrompt)==null?void 0:t.value;n&&n(r===void 0?null:r),this.setState({showInputPrompt:null})},color:`primary`,startIcon:O(ge,{}),children:V.t(`Apply`)}),O(R,{color:`grey`,variant:`contained`,onClick:()=>{var e;let t=(e=this.state.showInputPrompt)==null?void 0:e.callback;t&&t(null),this.setState({showInputPrompt:null})},startIcon:O(m,{}),children:V.t(`Close`)})]})]},`inputDialog`):null}render(){return this.state.languageBlocklyLoaded&&this.state.languageOwnLoaded?(this.didUpdate=setTimeout(()=>{this.didUpdate=null,this.componentDidUpdate()},100),[O(`div`,{ref:e=>{this.blockly=e},style:{width:`100%`,height:`100%`,position:`relative`}},`blocklyDOM`),this.renderDialogPrompt(),this.renderMessageDialog(),this.renderErrorDialog(),this.renderExportDialog(),this.renderImportDialog()]):null}};N($O,`Blockly`,window.Blockly);var Q={nameCard:`_nameCard_n9i6h_15`,nameCardSummary:`_nameCardSummary_n9i6h_24`,headerRow:`_headerRow_n9i6h_32`,headerRowClickable:`_headerRowClickable_n9i6h_39`,headerText:`_headerText_n9i6h_43`,kicker:`_kicker_n9i6h_49`,summarySub:`_summarySub_n9i6h_61`,chevron:`_chevron_n9i6h_70`,chevronCollapsed:`_chevronCollapsed_n9i6h_82`,chevronPlaceholder:`_chevronPlaceholder_n9i6h_87`,iconThemCard:`_iconThemCard_n9i6h_91`,iconThemCardCollapsed:`_iconThemCardCollapsed_n9i6h_102`,iconThemCardSelectable:`_iconThemCardSelectable_n9i6h_107`,iconHelp:`_iconHelp_n9i6h_111`,blockName:`_blockName_n9i6h_117`,debugInfo:`_debugInfo_n9i6h_123`,fadeIn:`_fadeIn_n9i6h_1`,tagCard:`_tagCard_n9i6h_139`,displayFlex:`_displayFlex_n9i6h_156`,blockMarginTop:`_blockMarginTop_n9i6h_161`,nameBlock:`_nameBlock_n9i6h_162`,frontText:`_frontText_n9i6h_166`,backText:`_backText_n9i6h_172`,iconTag:`_iconTag_n9i6h_176`,displayItalic:`_displayItalic_n9i6h_186`},ek={root:`_root_1dr6a_1`,square:`_square_1dr6a_11`,icon:`_icon_1dr6a_16`};G();var tk=({fullWidth:e,size:t,onClick:n,style:r,className:i,value:a,square:o,icon:s})=>O(R,{variant:`outlined`,color:`primary`,onClick:n,fullWidth:e,style:r,className:H.clsx(ek.root,i,o?ek.square:``),size:t||`medium`,children:s?O(Ut,{className:ek.icon,src:s}):a}),nk={root:`_root_1ucda_1`};G();var rk=Gt(({size:e,value:t,title:n,onChange:r,className:i,customValue:a,disabled:o})=>{let[s,c]=ze(!1);return B(Mt,{children:[O(De,{disabled:o,checked:!!(a?t:s),className:H.clsx(nk.root,i),onChange:e=>{a&&c(e.target.checked),r&&r(e.target.checked)},size:e||`medium`}),n||null]})}),ik={root:`_root_19roy_1`};G();var ak=e=>{let[t,n]=ze(``),{value:r,type:i,error:a,className:o,icon:s,label:c,style:l,onChange:u,fullWidth:d,autoComplete:f,customValue:p,autoFocus:m,rows:h,size:g,variant:_,multiline:v,disabled:y}=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},e);return O(P,{error:!!a,autoFocus:m,fullWidth:d,label:c,disabled:y,variant:_,multiline:v,rows:h,value:p?r:t,type:i,helperText:a,style:l,className:H.clsx(ik.root,o),autoComplete:f,onChange:e=>{!p&&n(e.target.value),u&&u(e.target.value)},slotProps:{input:{endAdornment:s?O(Qe,{position:`end`,children:O(Ut,{className:ik.icon,src:s})}):null}},margin:`normal`,size:g})};G();var ok={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`}}},sk=({multiple:e,value:t,customValue:n,socket:r,title:i,attr:a,adapter:o,style:s,onChange:c,onInstanceHide:l})=>{let[u,d]=ze(t||`test1`),[f,p]=ze([]);return yt(()=>{r==null||r.getAdapterInstances(o).then(e=>{let t=e.map(e=>({value:e._id.replace(`system.adapter.`,``),title:e._id.replace(`system.adapter.`,``)}));t.length===1?l(t[0].value):t.unshift({value:o,title:V.t(`All`)}),p(t)})},[r,o,l]),B(gt,{sx:ok.formControl,fullWidth:!0,style:s,children:[O(pt,{variant:`standard`,value:(n?t:u)||`_`,fullWidth:!0,multiple:e,renderValue:t=>e&&Array.isArray(t)?t.join(`, `):t,onChange:e=>{!n&&d(e.target.value),c(e.target.value)},input:a?O(nt,{name:a,id:`${a}-helper`}):O(nt,{name:a}),children:f.map(e=>O(y,{style:{placeContent:`space-between`},value:e.value||`_`,children:V.t(e.title)},`key-${e.value}`))}),i?O(Ge,{children:V.t(i)}):null]})},ck={modalContentWrapper:`_modalContentWrapper_587ci_1`,modalButtonBlock:`_modalButtonBlock_587ci_8`,modalButtonBlockTwo:`_modalButtonBlockTwo_587ci_23`,modalWrapper:`_modalWrapper_587ci_33`,modalDialog:`_modalDialog_587ci_40`,close:`_close_587ci_44`};G();var lk=({onClose:e,children:t,titleButtonApply:n,titleButtonClose:r,onApply:i,className:a,textInput:o,defaultValue:s,disabled:c})=>{let[l,u]=ze(s||``),[d]=ze(s||``);return B(qe,{open:!0,maxWidth:`md`,onClose:e,classes:{paper:ck.modalDialog},className:ck.modalWrapper,children:[B(St,{children:[o&&O(ak,{className:a,autoComplete:`off`,fullWidth:!0,variant:`outlined`,size:`medium`,rows:10,multiline:!0,value:l,onChange:u,customValue:!0}),!o&&t]}),B(Vt,{children:[O(R,{disabled:c===void 0?d===l:c,onClick:()=>i(o?l:null),variant:`contained`,color:`primary`,children:V.t(n||`Ok`)}),O(R,{color:`grey`,onClick:e,variant:`contained`,children:V.t(r||`Cancel`)})]})]})},uk={root:`_root_15mo1_1`};G();var dk=({multiple:e,value:t,customValue:n,title:r,attr:i,options:a,style:o,onChange:s,className:c,doNotTranslate:l,doNotTranslate2:u})=>{let[d,f]=ze(t===void 0?a[0].value:t),p=n?t:d,m=p===``||p==null?`_`:p;return B(gt,{variant:`standard`,className:H.clsx(uk.root,c),fullWidth:!0,style:o,children:[B(pt,{variant:`standard`,value:m,fullWidth:!0,multiple:e,renderValue:t=>{if(e&&Array.isArray(t)){t.sort();let e=t.indexOf(`0`);e!==-1&&(t.splice(e,1),t.push(`0`)),e=t.indexOf(`_`),e!==-1&&(t.splice(e,1),t.unshift(`_`));let n=a.find(e=>e.only);return n&&t.includes(n.value)?n.titleShort?l?n.titleShort:V.t(n.titleShort):l?n.title:V.t(n.title):t.map(e=>a.find(t=>t.value===e||e===`_`&&t.value===``)||e).map(e=>typeof e==`object`?e.titleShort?l?e.titleShort:V.t(e.titleShort):l?e.title:V.t(e.title):l?e:V.t(e)).join(`, `)}let n=a?a.find(e=>e.value===t||t===`_`&&e.value===``):null;return n!=null&&n.title?l?n==null?void 0:n.title:V.t(n==null?void 0:n.title):t},onChange:t=>{if(n||f(t.target.value),e){let e=t.target.value,n=a.find(e=>e.only);if(n){let t=n.value;if(e.length===a.length-1&&e.includes(t))return s(e.filter(e=>e!==t),i);if(e.includes(t))return s(a.map(e=>e.value),i)}}s(t.target.value,i)},input:i?O(nt,{name:i,id:`${i}-helper`}):O(nt,{name:i}),children:[!e&&(a==null?void 0:a.map(e=>B(y,{style:{placeContent:`space-between`},value:e.value===``||e.value===null||e.value===void 0?`_`:e.value,children:[l?e.title:V.t(e.title),e.title2&&O(`div`,{children:u?e.title2:V.t(e.title2)})]},`key-${e.value}`))),e&&(a==null?void 0:a.map(e=>B(y,{style:{placeContent:`space-between`},value:e.value||`_`,children:[l?e.title:V.t(e.title),` `,O(rk,{customValue:!0,value:t==null?void 0:t.includes(e.value)})]},`key-${e.value}`)))]}),r?O(Ge,{children:V.t(r)}):null]})},fk={root:`_root_167v0_1`,mark:`_mark_167v0_24`};G();var pk=({size:e,value:t,style:n,onChange:r,className:i,customValue:a,min:o,max:s,step:c,unit:l})=>{let[u,d]=ze(0);o=o===void 0?0:o,s=s===void 0?0:s,c=c===void 0?(s-o)/100:c;let f=[{value:o,label:o+(l||``)},{value:s,label:s+(l||``)}];return O(I,{defaultValue:a?t:u,"aria-labelledby":`discrete-slider`,valueLabelDisplay:`auto`,classes:{mark:fk.mark},marks:f,step:c,min:o,max:s,value:a?t:u,style:n,className:H.clsx(fk.root,i),onChange:(e,t)=>{Array.isArray(t)?(!a&&d(t[0]),r(t[0])):(!a&&d(t),r(t))},size:e||`medium`})},mk={root:`_root_rzul6_1`};G();var hk=Gt(({label:e,size:t,value:n,style:r,onChange:i,className:a,customValue:o})=>{let[s,c]=ze(!1);return O(Wt,{className:mk.root,control:O(_,{checked:o?n:s,style:r,className:a,onChange:e=>{o||c(e.target.checked),i(e.target.checked)},size:t||`medium`}),label:e??`all`})}),gk={root:`_root_135pm_1`};G();var _k=({value:e,style:t,onChange:n,className:r})=>O(P,{variant:`standard`,id:`time`,type:`time`,onChange:e=>n(e.currentTarget.value),value:e,className:H.clsx(gk.root,r),fullWidth:!0,style:t,slotProps:{htmlInput:{step:300},inputLabel:{shrink:!0}}}),vk={root:`_root_135pm_1`};G();var yk=[31,29,31,30,31,30,31,31,30,31,30,31],bk=({value:e,onChange:t,className:n,style:r})=>{let[i,a]=(e||`01.01`).toString().split(`.`),o=parseInt(a,10)||0,s=parseInt(i,10)||0;s>12?s=12:s<0&&(s=0),o>yk[s]?o=yk[s]:o<0&&(o=0);let c=[];for(let e=0;et(`${e.target.value.toString().padStart(2,`0`)}.${o.toString().padStart(2,`0`)}`),value:s,children:[O(y,{style:{placeContent:`space-between`},value:0,children:V.t(`Any month`)},0),O(y,{style:{placeContent:`space-between`},value:1,children:V.t(`January`)},1),O(y,{style:{placeContent:`space-between`},value:2,children:V.t(`February`)},2),O(y,{style:{placeContent:`space-between`},value:3,children:V.t(`March`)},3),O(y,{style:{placeContent:`space-between`},value:4,children:V.t(`April`)},4),O(y,{style:{placeContent:`space-between`},value:5,children:V.t(`May`)},5),O(y,{style:{placeContent:`space-between`},value:6,children:V.t(`June`)},6),O(y,{style:{placeContent:`space-between`},value:7,children:V.t(`July`)},7),O(y,{style:{placeContent:`space-between`},value:8,children:V.t(`August`)},8),O(y,{style:{placeContent:`space-between`},value:9,children:V.t(`September`)},9),O(y,{style:{placeContent:`space-between`},value:10,children:V.t(`October`)},10),O(y,{style:{placeContent:`space-between`},value:11,children:V.t(`November`)},11),O(y,{style:{placeContent:`space-between`},value:12,children:V.t(`December`)},12)]})}),O(gt,{variant:`standard`,className:H.clsx(vk.root,n),style:r,children:B(pt,{variant:`standard`,className:H.clsx(vk.root,n),margin:`dense`,label:V.t(`Date`),onChange:e=>t(`${s.toString().padStart(2,`0`)}.${e.target.value.toString().padStart(2,`0`)}`),value:o,children:[O(y,{style:{placeContent:`space-between`},value:0,children:V.t(`Any`)},`A`),c.map(e=>O(y,{style:{placeContent:`space-between`},value:e,children:e},e))]})})]})};G();var xk={},Sk={Shuffle:nr,Apps:Nn,Functions:Hn,Language:Ze,AddBox:Mn,Pause:Xn,Subject:ar,PlayForWork:Qn,Brightness3:Fn,HelpOutline:Un,Storage:ir,AccessTime:An,PlayArrow:Zn,FlashOn:zn,CalendarMonth:Ln,Send:tr,Message:Kn,NotificationsActive:Jn,SwapHoriz:or,InsertDriveFile:At,AccountTree:jn,Article:Pn,Stop:rr,Category:Rn,Forum:Vn,PublishedWithChanges:$n};function Ck({iconName:e,className:t,adapter:n,socket:r,onClick:i,style:a}){let[o,s]=ze(``);if(yt(()=>{n&&r&&(xk[n]instanceof Promise||(xk[n]=r.getObject(`system.adapter.${n}`)),xk[n].then(e=>{var t;return(e==null||(t=e.common)==null?void 0:t.icon)&&s(`../../adapter/${n}/${e.common.icon}`)}))},[n,r]),n)return O(`img`,{onClick:e=>i&&i(e),src:o||``,className:t,style:a,alt:``});let c=e&&Sk[e]||bt;return O(c,{className:t,style:a,onClick:e=>i&&i(e)})}var wk;function Tk(e){return wk||=V.getLanguage(),e&&typeof e==`object`?e[wk]||e.en:e||``}function Ek(e){return e===null?`null`:e===void 0?`undefined`:Array.isArray(e)?e.join(`, `):typeof e==`object`?JSON.stringify(e):e.toString()}G();var $=class extends Ke{static getStaticData(){return{acceptedBy:`actions`,name:`Not found`,id:`ActionEmpty`,icon:`Shuffle`}}static compile(e,t){return``}constructor(e,t){super(e),N(this,`debugHideTimeout`,null),N(this,`initiallyCollapsed`,!1),N(this,`collapseDecided`,!1),N(this,`lastObjectIdChange`,0),N(this,`enableSimulationProcessing`,!1),N(this,`mounted`,!1),N(this,`tagCardTimeout`,null),N(this,`enableSimulationTimeout`,null),N(this,`lastDebugMessage`,0),N(this,`debugMessageTimeout`,null),t||={};let n=e.settings||{tagCard:t.tagCardArray?typeof t.tagCardArray[0]==`string`?t.tagCardArray[0]:t.tagCardArray[0].title:``};!n.tagCard&&t.tagCardArray&&(n.tagCard=typeof t.tagCardArray[0]==`string`?t.tagCardArray[0]:t.tagCardArray[0].title),this.state={inputs:t.inputs||e.inputs||[],name:t.name||e.name||``,icon:t.icon||e.icon||``,adapter:t.adapter||e.adapter||``,helpDialog:t.helpDialog||e.helpDialog||``,tagCardArray:t.tagCardArray||[],openTagMenu:!1,openModal:!1,iconTag:!1,error:``,helpText:``,instanceSelectionOptions:[],instanceSelectionDef:``,hideAttributes:[],settings:n,debugMessage:null,enableSimulation:this.props.enableSimulation}}componentWillUnmount(){this.mounted=!1,this.debugMessageTimeout&&=(clearTimeout(this.debugMessageTimeout),null),this.debugHideTimeout&&=(clearTimeout(this.debugHideTimeout),null),this.tagCardTimeout&&=(clearTimeout(this.tagCardTimeout),null),this.enableSimulationTimeout&&=(clearTimeout(this.enableSimulationTimeout),null)}onTagChange(e,t,n,r,i){let a=!1,o=JSON.parse(JSON.stringify(this.state.settings));this.state.inputs.forEach(e=>{let t=e.attr,n=e.defaultValue;t&&n!==void 0&&o[t]===void 0&&(a=!0,o[t]=n)}),a?(this.setState({settings:o},()=>t==null?void 0:t()),this.props.onChange(o)):t&&t()}onUpdate(){}onValueChanged(e,t){}getSummary(){return null}objectName(e){if(!e)return;let t=this.state[e];if(t===void 0){setTimeout(async()=>{let t=await this.props.socket.getObject(e);this.mounted&&this.setState({[e]:t||!1})},0);return}return t&&H.getObjectNameFromObj(t,V.getLanguage())||void 0}optionTitle(e,t,n=`title`){var r,i;if(t==null||t===``)return;let a=(r=this.state.inputs)==null?void 0:r.find(t=>t.attr===e),o=a==null||(i=a.options)==null?void 0:i.find(e=>String(e.value)===String(t));if(o)return n===`title2`?o.title2:a!=null&&a.doNotTranslate?o.title:V.t(o.title)}isCollapsed(e){this.collapseDecided||(this.collapseDecided=!0,this.initiallyCollapsed=e);let t=this.state.userCollapsed;return e&&(t===void 0?this.initiallyCollapsed:t)}toggleCollapsed(e){this.setState({userCollapsed:e})}renderText(e,t,n){let{className:r}=this.props,{attr:i,frontText:a,backText:o,nameBlock:s,name:c,doNotTranslate:l,doNotTranslateBack:u}=e;return B(rt,{children:[B(`div`,{className:H.clsx(Q.displayFlex,Q.blockMarginTop),children:[a&&O(`div`,{className:Q.frontText,children:l?a:V.t(a)}),O(ak,{className:r,autoComplete:`off`,label:Tk(c),variant:`outlined`,size:`small`,fullWidth:!0,value:t,onChange:n,customValue:!0}),o&&O(`div`,{className:Q.backText,children:u?o:V.t(o)})]}),s&&O(`div`,{className:Q.nameBlock,children:V.t(s)})]},i)}renderSwitch(e,t,n){let{className:r}=this.props,{attr:i,frontText:a,backText:o,nameBlock:s,doNotTranslate:c,doNotTranslateBack:l}=e;return B(`div`,{children:[B(`div`,{className:H.clsx(Q.displayFlex,Q.blockMarginTop),children:[a&&O(`div`,{className:Q.frontText,children:c?a:V.t(a)}),O(hk,{className:r,label:``,customValue:!0,value:t,onChange:n}),o&&O(`div`,{className:Q.backText,children:l?o:V.t(o)})]}),s&&O(`div`,{className:Q.nameBlock,children:V.t(s)})]},i)}renderNameText({attr:e,signature:t,doNotTranslate:n,defaultValue:r},i){return O(`div`,{className:H.clsx(t?Q.displayItalic:Q.displayFlex,Q.blockMarginTop),children:i?n?i:V.t(i):n?r:V.t(r)},e)}renderNumber(e,t,n){let{className:r}=this.props,{settings:i}=this.state,{attr:a,backText:o,frontText:s,openCheckbox:c,doNotTranslate:l,doNotTranslateBack:u}=e,d=!0;return c&&(d=typeof i.offset!=`boolean`||i.offset),d?B(`div`,{className:H.clsx(Q.displayFlex,Q.blockMarginTop),children:[s&&O(`div`,{className:Q.frontText,children:l?s:V.t(s)}),O(ak,{className:H.clsx(r,e.className),fullWidth:!0,autoComplete:`off`,label:e.noHelperText?``:`number`,variant:`outlined`,size:`small`,type:`number`,value:t,onChange:n,customValue:!0}),o&&O(`div`,{className:Q.backText,children:u?o:V.t(o)})]},a):null}renderColor(e,t,n){let{className:r}=this.props,{attr:i,backText:a,frontText:o,doNotTranslate:s,doNotTranslateBack:c}=e;return B(`div`,{className:H.clsx(Q.displayFlex,Q.blockMarginTop),children:[o&&O(`div`,{className:Q.frontText,children:s?o:V.t(o)}),O(ak,{className:r,autoComplete:`off`,fullWidth:!0,variant:`outlined`,size:`small`,type:`color`,value:t,onChange:n}),a&&O(`div`,{className:Q.backText,children:c?a:V.t(a)})]},i)}renderCheckbox(e,t,n){let{className:r}=this.props,{settings:i}=this.state,{attr:a,backText:o,frontText:s,defaultValue:c,doNotTranslate:l,doNotTranslateBack:u}=e;return B(`div`,{className:Q.displayFlex,children:[s&&O(`div`,{className:Q.frontText,children:l?s:V.t(s)}),O(rk,{className:r,size:`small`,value:typeof i[a]==`boolean`?!!i[a]:!!c,customValue:!0,onChange:n}),o&&O(`div`,{onClick:()=>n(typeof i[a]==`boolean`?!i[a]:!c),className:Q.backText,children:u?o:V.t(o)})]},a)}renderSlider(e,t,n){let{className:r}=this.props,{attr:i,frontText:a,backText:o,nameBlock:s,min:c,max:l,step:u,unit:d,doNotTranslate:f,doNotTranslateBack:p}=e;return B(`div`,{children:[B(`div`,{className:Q.displayFlex,style:{marginRight:20},children:[a&&O(`div`,{className:Q.frontText,children:f?a:V.t(a)}),O(pk,{customValue:!0,min:c,max:l,step:u,unit:d,className:r,autoComplete:`off`,label:`number`,variant:`outlined`,size:`small`,value:t,onChange:e=>{console.log(e),n(e)}}),o&&O(`div`,{style:{marginLeft:20},className:Q.backText,children:p?o:V.t(o)})]}),s&&O(`div`,{className:Q.nameBlock,children:V.t(s)})]},i)}renderButton(e,t,n){let{className:r}=this.props,{attr:i,frontText:a,backText:o,doNotTranslate:s,doNotTranslateBack:c}=e;return B(`div`,{className:H.clsx(Q.displayFlex,Q.blockMarginTop),children:[a&&O(`div`,{className:Q.frontText,children:s?a:V.t(a)}),O(tk,{fullWidth:!0,value:t.toString(),className:r,onClick:()=>n(t)}),o&&O(`div`,{className:Q.backText,children:c?o:V.t(o)})]},i)}async findIcon(e){var t;if(!e)return null;if((t=e.common)!=null&&t.icon)return ht(e,`../..`);if(e.type===`state`||e.type===`channel`){let t=e._id.split(`.`);t.pop();let n=t.join(`.`);try{let e=await this.props.socket.getObject(n);return await this.findIcon(e)}catch{return null}}return null}renderObjectID(e,t,n){let{attr:r,openCheckbox:i,checkReadOnly:a}=e,{settings:o}=this.state,s=this.state[`showSelectId${r}`],{className:c,socket:l,style:u}=this.props,d=!0;i&&(d=typeof o.offset!=`boolean`||o.offset);let f=o[r],p=f?this.state[f]:void 0;return f&&!p&&p!==!1&&setTimeout(async e=>{var n;let r=await l.getObject(t),i=await this.findIcon(r);if(!this.mounted)return;let s={[e]:r||!1,[`${e}___icon`]:i,error:a&&this.lastObjectIdChange&&Date.now()-this.lastObjectIdChange<1e3&&(r==null||(n=r.common)==null?void 0:n.write)===!1?V.t(`Read only ID selected: %s`,o[e]):``};this.setState(s)},0,f),d?B(`div`,{className:Q.blockMarginTop,children:[B(`div`,{className:Q.displayFlex,children:[e.title?O(`div`,{children:V.t(e.title)}):null,O(ak,{className:c,style:u,autoComplete:`off`,fullWidth:!0,disabled:!0,variant:`outlined`,size:`small`,value:t,customValue:!0}),O(tk,{icon:this.state[`${f}___icon`],square:!0,style:{...u||void 0,marginLeft:7},value:`...`,className:c,onClick:()=>{let e={};e[`showSelectId${r}`]=!0,this.setState(e)}})]}),p?O(`div`,{className:H.clsx(Q.nameBlock,Q.displayItalic),children:H.getObjectNameFromObj(p,V.getLanguage())}):null,s?O(Rt,{theme:this.props.theme,imagePrefix:`../..`,dialogName:`javascript`,themeType:H.getThemeType(),socket:l,selected:t,onClose:()=>{let e={};e[`showSelectId${r}`]=!1,this.setState(e)},onOk:(e,t)=>{let i={};i[`showSelectId${r}`]=!1;let a=Array.isArray(e)?e[0]:e;this.setState(i,async()=>{var t,i,o,s,c,u,d,f,p,m;let h=a?await l.getObject(a):void 0;this.lastObjectIdChange=Date.now(),n({[r]:e,[`${r}Role`]:h==null||(t=h.common)==null?void 0:t.role,[`${r}Type`]:h==null||(i=h.common)==null?void 0:i.type,[`${r}Unit`]:h==null||(o=h.common)==null?void 0:o.unit,[`${r}States`]:h==null||(s=h.common)==null?void 0:s.states,[`${r}Min`]:h==null||(c=h.common)==null?void 0:c.min,[`${r}Max`]:h==null||(u=h.common)==null?void 0:u.max,[`${r}Step`]:h==null||(d=h.common)==null?void 0:d.step,[`${r}Def`]:h==null||(f=h.common)==null?void 0:f.def,[`${r}Write`]:h==null||(p=h.common)==null?void 0:p.write,[`${r}Read`]:h==null||(m=h.common)==null?void 0:m.read},()=>this.props.setOnUpdate&&this.props.setOnUpdate(!0))})}}):null]},r):null}renderIconTag(){return O(`div`,{className:Q.iconTag,onClick:e=>{this.state.settings.tagCard&&(this.state.tagCardArray.length<3?this.onChangeTag():this.setState({openTagMenu:e.currentTarget}))},children:this.state.settings.tagCard})}renderTime(e,t,n){let{attr:r,backText:i,frontText:a,doNotTranslate:o,doNotTranslateBack:s}=e;return B(`div`,{className:Q.displayFlex,style:{whiteSpace:`nowrap`},children:[a&&O(`div`,{className:Q.frontText,children:o?a:V.t(a)}),O(_k,{value:t,onChange:n}),i&&O(`div`,{className:Q.backText,children:s?i:V.t(i)})]},r)}renderSelect(e,t,n){let{className:r,style:i}=this.props,{name:a,options:o,frontText:s,backText:c,attr:l,multiple:u,doNotTranslate:d,doNotTranslate2:f,doNotTranslateBack:p}=e;return B(`div`,{className:H.clsx(Q.displayFlex,Q.blockMarginTop),style:{whiteSpace:`nowrap`},children:[s&&O(`div`,{className:Q.frontText,children:V.t(s)}),O(dk,{attr:l,doNotTranslate:d,doNotTranslate2:f,title:a,className:r,style:i,options:o,value:t,onChange:n,multiple:u,customValue:!0}),c&&O(`div`,{className:Q.backText,children:p?c:V.t(c)})]},l)}renderInstance(e,t,n){let{socket:r}=this.props,{name:i,frontText:a,backText:o,attr:s,adapter:c,doNotTranslate:l,doNotTranslateBack:u}=e;return this.state.hideAttributes.includes(s)?null:B(`div`,{className:H.clsx(Q.displayFlex,Q.blockMarginTop),style:{whiteSpace:`nowrap`},children:[a&&O(`div`,{className:Q.frontText,children:l?a:V.t(a)}),O(sk,{attr:s,socket:r,adapter:c,title:i,value:t,onChange:e=>{n(Array.isArray(e)?e[0]:e)},customValue:!0,onInstanceHide:e=>this.setState({hideAttributes:[...this.state.hideAttributes,s]},()=>n(e))}),o&&O(`div`,{className:Q.backText,children:u?o:V.t(o)})]},s)}renderDialog(e){let{onShowDialog:t,frontText:n,backText:r,attr:i,icon:a,doNotTranslate:o,doNotTranslateBack:s}=e;return B(`div`,{className:H.clsx(Q.displayFlex,Q.blockMarginTop),style:{whiteSpace:`nowrap`},children:[n&&O(`div`,{className:Q.frontText,children:o?n:V.t(n)}),O(Ck,{iconName:a,className:H.clsx(Q.iconDialog),onClick:()=>t&&t()}),r&&O(`div`,{className:Q.backText,children:s?r:V.t(r)})]},i)}renderModalInput(e,t,n){let{openModal:r}=this.state,{className:i}=this.props,{attr:a,nameBlock:o,frontText:s,backText:c,noTextEdit:l,doNotTranslate:u,doNotTranslateBack:d}=e;return B(`div`,{children:[B(`div`,{className:H.clsx(Q.displayFlex,Q.blockMarginTop),children:[s&&O(`div`,{className:Q.frontText,children:u?s:V.t(s)}),O(ak,{disabled:!!l,className:i,autoComplete:`off`,fullWidth:!0,variant:`outlined`,size:`small`,value:t,onChange:n,customValue:!0}),O(tk,{square:!0,style:{marginLeft:5},value:`...`,className:i,onClick:()=>this.setState({openModal:!0})}),c&&O(`div`,{className:Q.backText,children:d?c:V.t(c)})]}),r?O(lk,{onApply:e=>this.setState({openModal:!1},()=>e!=null&&n(e)),onClose:()=>this.setState({openModal:!1}),defaultValue:t,textInput:!0}):null,o&&O(`div`,{className:Q.nameBlock,children:V.t(o)})]},a)}renderDate(e,t,n){let{attr:r,backText:i,frontText:a,doNotTranslate:o,doNotTranslateBack:s}=e;return B(`div`,{className:Q.displayFlex,style:{whiteSpace:`nowrap`},children:[a&&O(`div`,{className:Q.frontText,children:o?a:V.t(a)}),O(bk,{value:t,onChange:n}),i&&O(`div`,{className:Q.backText,children:s?i:V.t(i)})]},r)}static getReplacesInText(e){var t,n,r,i,a,o;let s=``;return(t=e.trigger)!=null&&t.oidType||((n=e.trigger)==null?void 0:n.id)===`TriggerEnumMembers`?s=`.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)`:((r=e.trigger)==null?void 0:r.id)===`TriggerMessage`?s=`.replace(/%s/g, typeof data === "object" ? JSON.stringify(data) : data)`:((i=e.trigger)==null?void 0:i.id)===`TriggerFile`?s=`.replace(/%s/g, fileName).replace(/%id/g, fileId)`:((a=e.trigger)==null?void 0:a.id)===`TriggerObject`?s=`.replace(/%s/g, id).replace(/%id/g, id)`:((o=e.trigger)==null?void 0:o.id)===`TriggerLog`?s=`.replace(/%s/g, info.message).replace(/%id/g, info.from)`:e.conditionsStates.length&&(s=`.replace(/%s/g, ${e.conditionsStates[0].name}).replace(/%id/g, "${e.conditionsStates[0].id}")`),s}renderTags(){let{tagCardArray:e,openTagMenu:t}=this.state,{tagCard:n}=this.state.settings,r=n!==`=`&&n!==`<>`&&n!==`>=`&&n!==`()`&&n!==`.`&&n!==`<=`&&n!==`<`&&n!==`>`&&n?V.t(n):n;return e.length>=3&&(r=B(`div`,{children:[O(`div`,{"aria-controls":`simple-menu`,"aria-haspopup":`true`,onClick:e=>{this.setState({openTagMenu:e.currentTarget},()=>{this.props.isTourOpen&&this.props.tourStep===Im.openTagsMenu&&setTimeout(()=>this.props.setTourStep&&this.props.setTourStep(Im.selectIntervalTag),300)})},children:r}),O(_e,{id:`simple-menu`,anchorEl:t,keepMounted:!0,open:!!t,onClose:()=>this.setState({openTagMenu:null}),children:e.map((e,t)=>{let r;return r=typeof e==`string`?e:e.title,B(y,{selected:r===n,className:`tag-card-${r}`,style:{placeContent:`space-between`},onClick:e=>{e.stopPropagation(),this.props.isTourOpen&&(this.props.tourStep===Im.openTagsMenu||this.props.tourStep===Im.selectIntervalTag)&&r===`interval`&&setTimeout(()=>{var e,t;return(e=(t=this.props).setTourStep)==null?void 0:e.call(t,Im.selectActions)},500);let t=JSON.parse(JSON.stringify(this.state.settings));t.tagCard=r,this.setState({openTagMenu:null,settings:t},()=>{this.props.onChange(this.state.settings),this.onTagChange(this.state.settings.tagCard)})},children:[r.search(/>|<|<>|<=|>=|=/)===-1?V.t(r):r,typeof e!=`string`&&e.title2&&O(`div`,{style:{marginLeft:4},children:V.t(e.title2)})]},`${r}_${t}`)})})]})),r}getData(){return{acceptedBy:`triggers`,name:``,id:``}}onChangeTag(){let{tagCardArray:e,settings:t,settings:{tagCard:n}}=this.state,r;if(r=typeof e[0]==`string`?[...e]:e.map(e=>e.title),n&&r.length<3){let e={...t},i=r[(r.indexOf(n)+1)%r.length];e.tagCard=i,this.setState({settings:e},()=>{this.props.onChange(e),this.onTagChange(i)})}}componentDidMount(){this.mounted=!0,this.onTagChange()}componentDidUpdate(){this.props.acceptedBy!==`triggers`&&this.props.onUpdate&&setTimeout(()=>this.onUpdate(),0)}onChangeInput(e){return(t,n,r)=>{let i=JSON.parse(JSON.stringify(this.state.settings));typeof t==`object`&&(!n||typeof n==`function`)?(Object.keys(t).forEach(e=>i[e]=t[e]),typeof n==`function`&&(r=n,n=void 0)):i[n||e]=t,i.id=this.getData().id,i._id=this.props._id,this.setState({settings:i},()=>{this.onValueChanged(t,n||e),this.props.onChange(i),r==null||r()})}}renderSpecific(){return null}renderDebug(e){return``}renderDebugInfo(){return this.state.debugMessage?O(`div`,{className:Q.debugInfo,style:{opacity:1,height:22,bottom:-22},children:this.renderDebug?this.renderDebug(this.state.debugMessage):V.t(`executed`)},this.state.debugMessage.ts):null}renderCron(e,t,n){return null}renderWizard(e,t,n){return null}renderWriteState(){return null}renderInputElement(e,t){let{nameRender:n,defaultValue:r,attr:i}=e,{settings:a}=this.state,o=i?a[i]:void 0;switch(o===void 0&&(o=r),n){case`renderTime`:return i?this.renderTime(e,o,this.onChangeInput(i)):O(`div`,{children:V.t(`Invalid renderTime`)},`invalid_${t}`);case`renderNameText`:return this.renderNameText(e,r);case`renderSelect`:return i?this.renderSelect(e,o,this.onChangeInput(i)):O(`div`,{children:V.t(`Invalid renderSelect`)},`invalid_${t}`);case`renderModalInput`:return i?this.renderModalInput(e,o,this.onChangeInput(i)):O(`div`,{children:V.t(`Invalid renderModalInput`)},`invalid_${t}`);case`renderObjectID`:return i?this.renderObjectID(e,o,this.onChangeInput(i)):O(`div`,{children:V.t(`Invalid renderObjectID`)},`invalid_${t}`);case`renderDialog`:return i?this.renderDialog(e):O(`div`,{children:V.t(`Invalid renderDialog`)},`invalid_${t}`);case`renderInstance`:return i?this.renderInstance(e,o,this.onChangeInput(i)):O(`div`,{children:V.t(`Invalid renderInstance`)},`invalid_${t}`);case`renderText`:return i?this.renderText(e,o,this.onChangeInput(i)):O(`div`,{children:V.t(`Invalid renderText`)},`invalid_${t}`);case`renderSlider`:return i?this.renderSlider(e,o,this.onChangeInput(i)):O(`div`,{children:V.t(`Invalid renderSlider`)},`invalid_${t}`);case`renderCheckbox`:return i?this.renderCheckbox(e,o,this.onChangeInput(i)):O(`div`,{children:V.t(`Invalid renderCheckbox`)},`invalid_${t}`);case`renderButton`:return i?this.renderButton(e,o,this.onChangeInput(i)):O(`div`,{children:V.t(`Invalid renderButton`)},`invalid_${t}`);case`renderColor`:return i?this.renderColor(e,o,this.onChangeInput(i)):O(`div`,{children:V.t(`Invalid renderColor`)},`invalid_${t}`);case`renderSwitch`:return i?this.renderSwitch(e,o,this.onChangeInput(i)):O(`div`,{children:V.t(`Invalid renderSwitch`)},`invalid_${t}`);case`renderDate`:return i?this.renderDate(e,o,this.onChangeInput(i)):O(`div`,{children:V.t(`Invalid renderDate`)},`invalid_${t}`);case`renderCron`:return i?this.renderCron(e,o,this.onChangeInput(i)):O(`div`,{children:V.t(`Invalid renderCron`)},`invalid_${t}`);case`renderWizard`:return i?this.renderWizard(e,o,this.onChangeInput(i)):O(`div`,{children:V.t(`Invalid renderWizard`)},`invalid_${t}`);case`renderWriteState`:return this.renderWriteState();case`renderNumber`:return i?this.renderNumber(e,o,this.onChangeInput(i)):O(`div`,{children:V.t(`Invalid renderNumber`)},`invalid_${t}`);default:return this[n]?this[n](e,o,i?this.onChangeInput(i):null):O(`div`,{children:V.t(`Invalid input type: %s`,n)},`invalid_${t}`)}}render(){var e;let{inputs:t,name:n,icon:r,iconTag:i,settings:a,adapter:o,settings:{tagCard:s},helpDialog:c}=this.state,{socket:l,notFound:u}=this.props;this.state.settings&&!this.state.settings.tagCard&&(e=this.state.tagCardArray)!=null&&e.length&&!this.tagCardTimeout&&(this.tagCardTimeout=setTimeout(()=>{if(this.tagCardTimeout=null,!this.mounted)return;let e=JSON.parse(JSON.stringify(this.state.settings));e.tagCard=typeof this.state.tagCardArray[0]==`string`?this.state.tagCardArray[0]:this.state.tagCardArray[0].title,this.setState({settings:e})},50)),this.state.enableSimulation!==this.props.enableSimulation&&!this.enableSimulationProcessing&&(this.enableSimulationProcessing=!0,this.enableSimulationTimeout=setTimeout(()=>{if(this.enableSimulationTimeout=null,!this.mounted){this.enableSimulationProcessing=!1;return}this.setState({enableSimulation:this.props.enableSimulation},()=>{this.enableSimulationProcessing=!1})},50));let d;if(this.props.onDebugMessage)for(let e=this.props.onDebugMessage.length-1;e>=0;e--){let t=this.props.onDebugMessage[e];if(t.blockId===this.props._id&&t.ts>this.lastDebugMessage&&t.ts>Date.now()-1e3){d=t;break}}d&&(this.lastDebugMessage=d.ts,this.debugMessageTimeout&&clearTimeout(this.debugMessageTimeout),this.debugHideTimeout&&=(clearTimeout(this.debugHideTimeout),null),this.debugMessageTimeout=setTimeout(e=>{let t=JSON.parse(e),n=t.hideTimeout||5e3;this.debugMessageTimeout=null,this.setState({debugMessage:t},()=>{this.debugHideTimeout&&clearTimeout(this.debugHideTimeout),this.debugHideTimeout=setTimeout(()=>{this.debugHideTimeout=null,this.setState({debugMessage:null})},n)})},50,JSON.stringify(d)));let f=this.getSummary(),p=this.isCollapsed(!!f);return B(rt,{children:[i?this.renderIconTag():O(Ck,{iconName:r,className:H.clsx(Q.iconThemCard,p&&Q.iconThemCardCollapsed,s&&this.state.tagCardArray.length&&Q.iconThemCardSelectable),adapter:o,socket:l,onClick:e=>{s&&(e.stopPropagation(),this.state.tagCardArray.length<3?this.onChangeTag():this.setState({openTagMenu:e.currentTarget}))}}),B(`div`,{className:Q.blockName,children:[B(`div`,{className:H.clsx(Q.headerRow,f&&Q.headerRowClickable),onClick:f?()=>this.toggleCollapsed(!p):void 0,children:[O(`span`,{className:H.clsx(Q.chevron,p&&Q.chevronCollapsed,!f&&Q.chevronPlaceholder),children:`▾`}),B(`div`,{className:Q.headerText,children:[f!=null&&f.kicker?O(`div`,{className:Q.kicker,children:f.kicker}):null,B(`span`,{className:H.clsx(Q.nameCard,f&&Q.nameCardSummary),children:[f?f.title:V.t(n),u?V.t(`%s not found`,a.id):``]}),p&&f!=null&&f.subtitle?O(`div`,{className:Q.summarySub,title:f.subtitle,children:f.subtitle}):null]}),s?O(`div`,{onClick:e=>{e.stopPropagation(),this.onChangeTag()},className:H.clsx(Q.tagCard,`tag-card`),children:this.renderTags()}):null,c?O(U,{className:Q.iconHelp,size:`small`,onClick:e=>{e.stopPropagation(),this.setState({helpText:V.t(c)})},children:O(Un,{})}):null]}),p?null:t.map((e,t)=>this.renderInputElement(e,t))]}),this.renderDebugInfo(),this.state.error?O(at,{title:V.t(`Warning`),text:this.state.error,onClose:()=>this.setState({error:``})}):null,this.state.helpText?O(Pe,{title:V.t(`Instructions`),text:this.state.helpText,onClose:()=>this.setState({helpText:``})}):null,this.renderSpecific()]})}},Dk={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`}},Ok=class e extends ${constructor(t){super(t,e.getStaticData())}static compile(e,t){return e.text?`// Sayit ${e.text||``} +\t\tconst subActionVar${e._id} = "${e.language&&e.language!==`_`?`${e.language};`:``}${e.volume?`${e.volume};`:``}${(e.text||``).replace(/"/g,`\\"`)}"${$.getReplacesInText(t)}; +\t\t_sendToFrontEnd(${e._id}, {text: subActionVar${e._id}}); +\t\tawait setStateAsync("${e.instance}.tts.text", subActionVar${e._id});`:`// no text defined +_sendToFrontEnd(${e._id}, {text: 'No text defined'});`}renderDebug(e){return`${V.t(`Say:`)} ${e.data.text}`}getSummary(){let{text:e,instance:t,volume:n}=this.state.settings;if(!e)return null;let r=[t,n&&Number(n)!==100?`${n}%`:void 0].filter(Boolean);return{title:String(e),subtitle:r.length?r.join(` · `):void 0}}onTagChange(){let e=V.getLanguage(),t=Object.keys(Dk).filter(t=>t.startsWith(e)).map(e=>({title:Dk[e].name,value:e}));t.unshift({title:`Default`,value:`_`}),this.setState({inputs:[{attr:`instance`,nameRender:`renderInstance`,adapter:`sayit`,defaultValue:`sayit.0`,frontText:`Instance:`},{nameRender:`renderSelect`,frontText:`Language:`,options:t,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 e.getStaticData()}},kk=class e extends ${constructor(t){super(t,e.getStaticData())}static compile(e,t){let n=(e.text||``).replace(/"/g,`\\"`);return n?`// Pushover ${e.text||``} +\t\tconst subActionVar${e._id} = "${n}"${$.getReplacesInText(t)}; +\t\t_sendToFrontEnd(${e._id}, {text: subActionVar${e._id}}); +\t\tsendTo("${e.instance}", "send", { +\t\t message: subActionVar${e._id}, +\t\t title: "${(e.title||``).replace(/"/g,`\\"`)}"${$.getReplacesInText(t)}, +\t\t sound: "${e.sound}", +\t\t priority: ${e.priority} +\t\t});`:`// no text defined +_sendToFrontEnd(${e._id}, {text: 'No text defined'});`}renderDebug(e){return`Sent: ${e.data.text}`}getSummary(){let{text:e,title:t,instance:n,priority:r}=this.state.settings;if(!e)return null;let i=[n,this.optionTitle(`priority`,r)].filter(Boolean);return{kicker:t?String(t):void 0,title:String(e),subtitle:i.join(` · `)}}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 e.getStaticData()}},Ak=class e extends ${constructor(t){super(t,e.getStaticData())}static compile(e,t){let n=(e.text||``).replace(/"/g,`\\"`);return n?`// whatsapp ${n||``} +\t\tconst subActionVar${e._id} = "${(n||``).replace(/"/g,`\\"`)}"${$.getReplacesInText(t)}; +\t\t_sendToFrontEnd(${e._id}, {text: subActionVar${e._id}}); +\t\tsendTo("${e.instance}", "send", {text: subActionVar${e._id}${e.phone?`, phone: "${e.phone.replace(/"/g,`\\"`)}"`:``}});`:`// no text defined +_sendToFrontEnd(${e._id}, {text: 'No text defined'});`}renderDebug(e){return`${V.t(`Sent:`)} ${e.data.text}`}getSummary(){let{text:e,instance:t,phone:n}=this.state.settings;if(!e)return null;let r=[t,n].filter(Boolean);return{title:String(e),subtitle:r.length?r.join(` · `):void 0}}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 e.getStaticData()}},jk=class e extends ${constructor(t){super(t,e.getStaticData())}static compile(e,t){let n=(e.text||``).replace(/"/g,`\\"`);return n?`// Pushsafer ${e.text||``} +\t\tconst subActionVar${e._id} = "${n}"${$.getReplacesInText(t)}; +\t\t_sendToFrontEnd(${e._id}, {text: subActionVar${e._id}}); +\t\tsendTo("${e.instance}", "send", { +\t\t message: subActionVar${e._id}, +\t\t title: "${(e.title||``).replace(/"/g,`\\"`)}"${$.getReplacesInText(t)}, +\t\t ${e.sound&&e.sound!==`_`?`sound: "${e.sound}",`:``} +\t\t priority: ${e.priority}, +\t\t ${e.vibration&&e.vibration!==`_`?`vibration: ${e.vibration},`:``} +\t\t});`:`// no text defined +_sendToFrontEnd(${e._id}, {text: 'No text defined'});`}renderDebug(e){return`Sent: ${e.data.text}`}getSummary(){let{text:e,title:t,instance:n,priority:r}=this.state.settings;if(!e)return null;let i=[n,this.optionTitle(`priority`,r)].filter(Boolean);return{kicker:t?String(t):void 0,title:String(e),subtitle:i.join(` · `)}}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 e.getStaticData()}},Mk=`async function (obj) { + "__%%DEBUG_TRIGGER%%__"; + __%%CONDITIONS_VARS%%__ + const _cond = __%%CONDITION%%__; + + "__%%DEBUG_CONDITIONS%%__"; + + if (_cond) { +__%%THEN%%__ + } else { +__%%ELSE%%__ + } +}`,Nk=`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%%__ + } +}`,Pk=`async function (data, _callback) { + "__%%DEBUG_TRIGGER%%__"; + __%%CONDITIONS_VARS%%__ + const _cond = __%%CONDITION%%__; + + "__%%DEBUG_CONDITIONS%%__"; + + if (_cond) { +__%%THEN%%__ + } else { +__%%ELSE%%__ + } +}`,Fk=`async function (data, _callback) { + "__%%DEBUG_TRIGGER%%__"; + __%%CONDITIONS_VARS%%__ + const _cond = __%%CONDITION%%__; + + "__%%DEBUG_CONDITIONS%%__"; + + if (__%%STATE%%__ === false && _cond) { + __%%STATE%%__ = true; +__%%THEN%%__ + } else if (__%%STATE%%__ === true && !_cond) { + __%%STATE%%__ = false; +__%%ELSE%%__ + } +}`,Ik=`async function (fileId, fileName, size) { + "__%%DEBUG_TRIGGER%%__"; + __%%CONDITIONS_VARS%%__ + const _cond = __%%CONDITION%%__; + + "__%%DEBUG_CONDITIONS%%__"; + + if (_cond) { +__%%THEN%%__ + } else { +__%%ELSE%%__ + } +}`,Lk=`async function (fileId, fileName, size) { + "__%%DEBUG_TRIGGER%%__"; + __%%CONDITIONS_VARS%%__ + const _cond = __%%CONDITION%%__; + + "__%%DEBUG_CONDITIONS%%__"; + + if (__%%STATE%%__ === false && _cond) { + __%%STATE%%__ = true; +__%%THEN%%__ + } else if (__%%STATE%%__ === true && !_cond) { + __%%STATE%%__ = false; +__%%ELSE%%__ + } +}`,Rk=`async function (id, obj) { + "__%%DEBUG_TRIGGER%%__"; + __%%CONDITIONS_VARS%%__ + const _cond = __%%CONDITION%%__; + + "__%%DEBUG_CONDITIONS%%__"; + + if (_cond) { +__%%THEN%%__ + } else { +__%%ELSE%%__ + } +}`,zk=`async function (id, 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%%__ + } +}`,Bk=`async function (info) { + "__%%DEBUG_TRIGGER%%__"; + __%%CONDITIONS_VARS%%__ + const _cond = __%%CONDITION%%__; + + "__%%DEBUG_CONDITIONS%%__"; + + if (_cond) { +__%%THEN%%__ + } else { +__%%ELSE%%__ + } +}`,Vk=`async function (info) { + "__%%DEBUG_TRIGGER%%__"; + __%%CONDITIONS_VARS%%__ + const _cond = __%%CONDITION%%__; + + "__%%DEBUG_CONDITIONS%%__"; + + if (__%%STATE%%__ === false && _cond) { + __%%STATE%%__ = true; +__%%THEN%%__ + } else if (__%%STATE%%__ === true && !_cond) { + __%%STATE%%__ = false; +__%%ELSE%%__ + } +}`,Hk=`function (_done) { + void (async () => { + "__%%DEBUG_TRIGGER%%__"; + __%%CONDITIONS_VARS%%__ + const _cond = __%%CONDITION%%__; + + "__%%DEBUG_CONDITIONS%%__"; + + if (_cond) { +__%%THEN%%__ + } else { +__%%ELSE%%__ + } + })().catch(e => console.error(e)).finally(_done); +}`,Uk=`"__%%DEBUG_TRIGGER%%__"; +__%%CONDITIONS_VARS%%__ +const _cond = __%%CONDITION%%__; + +"__%%DEBUG_CONDITIONS%%__"; + +if (_cond) { +__%%THEN%%__ +} else { +__%%ELSE%%__ +}`,Wk={triggers:[],conditions:[[]],justCheck:!1,actions:{then:[],else:[]}};function Gk(e,t,n){let r=[],i=e.triggers;i.length||(i=[{id:`TriggerScriptSave`}]);let a=[],o=[],s=e.conditions.find(e=>e.find(e=>e.tagCard===`()`));i.forEach((t,i)=>{let c=Kk(t.id,n);if(c){var l;let u={trigger:t,condition:{index:0},justCheck:s?!1:e.justCheck||!e.conditions.length||!e.conditions[0].length,conditionsDebug:[],conditionsVars:[],conditionsStates:[]},d=c.compile(t,u),f=Jk(e.conditions,u,n),p=qk(e.actions.then,u,n),m=qk(e.actions.else,u,n);a.push(`cond${i}`),(l=u.prelines)!=null&&l.length&&u.prelines.forEach(e=>o.push(e)),d.includes(` __%%CONDITIONS_VARS%%__`)&&(u.conditionsVars=u.conditionsVars.map((e,t)=>t?` ${e}`:e),u.conditionsDebug=u.conditionsDebug.map((e,t)=>t?` ${e}`:e)),r.push(d.replace(`__%%CONDITIONS_VARS%%__`,u.conditionsVars.join(` +`)).replace(`"__%%DEBUG_CONDITIONS%%__";`,u.conditionsDebug.join(` +`)).replace(`__%%CONDITION%%__`,f).replace(`__%%THEN%%__`,p||`// ignore`).replace(`__%%ELSE%%__`,m||`// ignore`).replace(/__%%STATE%%__/g,`cond${i}`))}});let c=r.join(` + +`);return(!e.justCheck||s)&&(c=`${a.map(e=>`let ${e} = false;`).join(` +`)}\n\n${c}`),o&&(c=`${o.join(` +`)}\n\n${c}`),c}function Kk(e,t){return t.find(t=>t.getStaticData&&t.getStaticData().id===e)}function qk(e,t,n){let r=[];return e==null||e.forEach(e=>{let i=Kk(e.id,n);i&&r.push(i.compile(e,t))}),`\t\t${r.join(` + + `)}`}function Jk(e,t,n){let r=[],i=0;return e==null||e.forEach(e=>{let a=[];e!=null&&e.length&&(e.forEach(e=>{let r=Kk(e.id,n);r&&(t.condition.index=i++,a.push(r.compile(e,t)))}),r.push(`(${a.join(`) && + (`)})`))}),r.length?r.length===1?r[0]||`true`:`(${r.join(`) || (`)})`:`true`}function Yk(e,t){return Gk(e,null,t)}function Xk(e){if(!e)return Wk;let t=e.split(` +`);try{let e=(t.pop()||``).replace(/^\/\//,``),n=JSON.parse(e);return n.triggers||(n=Wk),n}catch{return Wk}}function Zk(e,t){let n=``,r=Yk(e,t);return n+=r,n+=`\n/*\nconst demo = ${JSON.stringify(e,null,2).replace(/\*\//g,`* /`)};\n*/\n`,`${n}\n//${JSON.stringify(e)}`}var Qk=class e extends ${constructor(t){super(t,e.getStaticData())}static compile(e,t){return Uk.replace(`"__%%DEBUG_TRIGGER%%__"`,`_sendToFrontEnd(${e._id}, {trigger: true})`)}renderDebug(){return V.t(`Triggered`)}getSummary(){return{title:V.t(`On script save or adapter start`)}}onTagChange(e){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 e.getStaticData()}},$k=r(((e,t)=>{(function(){var n=Math.PI,r=Math.sin,i=Math.cos,a=Math.tan,o=Math.asin,s=Math.atan2,c=Math.acos,l=n/180,u=864e5,d=2440588,f=2451545;function p(e){return e.valueOf()/u-.5+d}function m(e){return new Date((e+.5-d)*u)}function h(e){return p(e)-f}var g=l*23.4397;function _(e,t){return s(r(e)*i(g)-a(t)*r(g),i(e))}function v(e,t){return o(r(t)*i(g)+i(t)*r(g)*r(e))}function y(e,t,n){return s(r(e),i(e)*r(t)-a(n)*i(t))}function b(e,t,n){return o(r(t)*r(n)+i(t)*i(n)*i(e))}function x(e,t){return l*(280.16+360.9856235*e)-t}function S(e){return e<0&&(e=0),2967e-7/Math.tan(e+.00312536/(e+.08901179))}function C(e){return l*(357.5291+.98560028*e)}function w(e){var t=l*(1.9148*r(e)+.02*r(2*e)+3e-4*r(3*e)),i=l*102.9372;return e+t+i+n}function T(e){var t=w(C(e));return{dec:v(t,0),ra:_(t,0)}}var E={};E.getPosition=function(e,t,n){var r=l*-n,i=l*t,a=h(e),o=T(a),s=x(a,r)-o.ra;return{azimuth:y(s,i,o.dec),altitude:b(s,i,o.dec)}};var D=E.times=[[-.833,`sunrise`,`sunset`],[-.3,`sunriseEnd`,`sunsetStart`],[-6,`dawn`,`dusk`],[-12,`nauticalDawn`,`nauticalDusk`],[-18,`nightEnd`,`night`],[6,`goldenHourEnd`,`goldenHour`]];E.addTime=function(e,t,n){D.push([e,t,n])};var O=9e-4;function k(e,t){return Math.round(e-O-t/(2*n))}function A(e,t,r){return O+(e+t)/(2*n)+r}function j(e,t,n){return f+e+.0053*r(t)-.0069*r(2*n)}function M(e,t,n){return c((r(e)-r(t)*r(n))/(i(t)*i(n)))}function ee(e,t,n,r,i,a,o){return j(A(M(e,n,r),t,i),a,o)}E.getTimes=function(e,t,n){var r=l*-n,i=l*t,a=k(h(e),r),o=A(0,r,a),s=C(o),c=w(s),u=v(c,0),d=j(o,s,c),f,p,g,_,y,b={solarNoon:m(d),nadir:m(d+.5)};for(f=0,p=D.length;f=0&&(b=Math.sqrt(g)/(Math.abs(f)*2),v=m-b,y=m+b,Math.abs(v)<=1&&_++,Math.abs(y)<=1&&_++,v<-1&&(v=y)),_===1?o<0?u=x+v:d=x+v:_===2&&(u=x+(h<0?y:v),d=x+(h<0?v:y)),!(u&&d));x+=2)o=c;var S={};return u&&(S.rise=P(i,u)),d&&(S.set=P(i,d)),!u&&!d&&(S[h>0?`alwaysUp`:`alwaysDown`]=!0),S},typeof e==`object`&&t!==void 0?t.exports=E:window.SunCalc=E})()}));G();var eA=t($k(),1),tA=`{"time":{"start":"00:00","end":"24:00","mode":"hours","interval":1},"period":{"days":1}}`,nA=class e extends ${constructor(t){super(t,e.getStaticData()),N(this,`coordinates`,null)}static compile(e,t){let n=``,r=t.justCheck?Mk:Nk;if(r=r.replace(`"__%%DEBUG_TRIGGER%%__"`,`_sendToFrontEnd(${e._id}, {trigger: true})`),e.tagCard===`interval`)n=`setInterval(${r}, ${e.interval||1} * ${e.unit===`s`?1e3:e.unit===`m`?6e4:36e5});`;else if(e.tagCard===`cron`)n=`schedule("${e.cron}", ${r});`;else if(e.tagCard===`at`){var i;let[t,a]=(e.at||``).split(`:`),o=`*`;if(e!=null&&(i=e.dow)!=null&&i.length&&!e.dow.includes(`_`)){let t=[...e.dow].map(e=>parseInt(e,10));t.sort();let n=[],r=t[0],i=1;for(;i1?(r===t[i-1]?n.push(r.toString()):t[i-1]-r===1?n.push(`${r},${t[i-1]}`):n.push(`${r}-${t[i-1]}`),r=t[i]):i===t.length-1&&(r===t[i-1]||t[i]-r===1?n.push(`${r},${t[i]}`):n.push(`${r}-${t[i]}`));o=n.join(`,`)}n=`schedule("${a||`0`} ${t||`0`} * * ${o}", ${r});`}else e.tagCard===`astro`?n=`schedule({astro: "${e.astro}", shift: ${e.offset?e.offsetValue:0}}, ${r});`:e.tagCard===`wizard`&&(n=`schedule('${e.wizard}', ${r});`);return n}static _time2String(e){return e?`${e.getHours().toString().padStart(2,`0`)}:${e.getMinutes().toString().padStart(2,`0`)}`:`--:--`}async _setAstro(t,n,r){if(t||=this.state.settings.astro||`solarNoon`,n??=this.state.settings.offset,r??=this.state.settings.offsetValue,r=parseInt(r,10)||0,!this.coordinates){var i,a;let e=await this.props.socket.getObject(`system.adapter.javascript.0`),t=e==null||(i=e.native)==null?void 0:i.latitude,n=e==null||(a=e.native)==null?void 0:a.longitude;if(!t&&!n){let e=await this.props.socket.getObject(`system.config`);this.coordinates=e!=null&&e.common&&(e.common.latitude||e.common.longitude)?{latitude:parseFloat(e.common.latitude),longitude:parseFloat(e.common.longitude)}:null}else this.coordinates={latitude:parseFloat(t),longitude:parseFloat(n)}}let o=this.coordinates&&eA.default.getTimes(new Date,this.coordinates.latitude,this.coordinates.longitude),s=o?Object.keys(o).map(t=>({value:t,title:t,title2:`[${e._time2String(o[t])}]`,order:o?e._time2String(o[t]):`??:??`})):[];s.sort((e,t)=>e.order>t.order?1:e.ordersuper.onTagChange())}_setInterval(e){e=parseInt(e||this.state.settings.interval,10)||30;let t;t=e===1?[{value:`s`,title:`second`},{value:`m`,title:`minute`},{value:`h`,title:`hour`}]:[{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:t}]},()=>super.onTagChange())}renderDebug(e){return V.t(`Triggered`)}onValueChanged(e,t){this.state.settings.tagCard===`astro`?t===`astro`?this._setAstro(e):t===`offset`?this._setAstro(void 0,e):t===`offsetValue`&&this._setAstro(void 0,void 0,e):this.state.settings.tagCard===`interval`&&t===`interval`&&this._setInterval(e)}renderCron(e,t,n){let{className:r}=this.props;return B(`div`,{children:[B(`div`,{style:{display:`flex`,alignItems:`baseline`},children:[O(`div`,{style:{width:`100%`},children:this.renderText({nameRender:`renderText`,attr:`cron`,defaultValue:t},this.state.settings.cron||t,n)}),O(tk,{square:!0,style:{marginLeft:7},value:`...`,className:r,onClick:()=>this.setState({openDialog:!0,textCron:this.state.settings.cron})})]}),this.state.openDialog?O(lk,{disabled:this.state.settings.cron===this.state.textCron,onApply:()=>{let e=this.state.textCron;n(e,`cron`,()=>{n(Kt(e,V.getLanguage()),`addText`),this.setState({openDialog:!1})})},onClose:()=>this.setState({openDialog:!1,textCron:``}),children:O(Ae,{cronExpression:this.state.settings.cron,onChange:e=>this.setState({textCron:e}),language:V.getLanguage()})}):null,this.renderNameText({nameRender:`renderNameText`,defaultValue:V.t(`every hour at 0 minutes`),attr:`addText`,signature:!0,doNotTranslate:!0},this.state.settings.addText||V.t(`every hour at 0 minutes`))]},`cron`)}renderWizard(e,t,n){let{className:r}=this.props;return B(`div`,{children:[B(`div`,{style:{display:`flex`,alignItems:`center`,marginTop:7},children:[O(ak,{className:r,autoComplete:`off`,fullWidth:!0,variant:`outlined`,size:`small`,multiline:!0,rows:2,value:this.state.settings.wizardText,onChange:e=>n(e),customValue:!0}),O(tk,{square:!0,style:{marginLeft:7},value:`...`,className:r,onClick:()=>this.setState({openDialog:!0,wizard:this.state.settings.wizard,wizardText:vt.state2text(this.state.settings.wizard)})})]}),this.state.openDialog?O(lk,{disabled:this.state.settings.wizard===this.state.wizard,onApply:()=>this.setState({openDialog:!1},()=>{let e=JSON.parse(this.state.wizard);e.valid||={from:vt.now2string()},e.valid.from||=vt.now2string(),n({wizardText:this.state.wizardText,wizard:JSON.stringify(e)})}),onClose:()=>this.setState({openDialog:!1}),children:O(vt,{theme:this.props.theme,schedule:t,onChange:(e,t)=>this.setState({wizardText:t||``,wizard:e})})}):null]},`wizard`)}onTagChange(e){switch(e||=this.state.settings.tagCard,e){case`interval`:this._setInterval();break;case`cron`:this.setState({inputs:[{nameRender:`renderCron`,attr:`cron`,defaultValue:`0 * * * *`}]},()=>super.onTagChange());break;case`wizard`:{let e=JSON.parse(tA);e.valid||={from:vt.now2string()},e.valid.from||=vt.now2string(),this.setState({inputs:[{nameRender:`renderWizard`,attr:`wizard`,defaultValue:JSON.stringify(e)}]},()=>super.onTagChange(null,()=>{let t=vt.state2text(this.state.settings.wizard||e);if(this.state.settings.wizard!==t){let e=JSON.parse(JSON.stringify(this.state.settings));e.wizardText=t,this.setState({settings:e}),this.props.onChange(e)}}));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()}}getSummary(){let{tagCard:e,interval:t,unit:n,cron:r,at:i,astro:a,offset:o,offsetValue:s}=this.state.settings,c=e?V.t(e):void 0;switch(e){case`interval`:return t?{kicker:c,title:`${V.t(`every`)} ${t} ${V.t(n||`s`)}`}:null;case`at`:return i?{kicker:c,title:i}:null;case`astro`:{if(!a)return null;let e=o&&s?` ${s>0?`+`:``}${s} ${V.t(`min`)}`:``;return{kicker:c,title:`${V.t(a)}${e}`}}case`cron`:case`wizard`:return r?{kicker:c,title:String(r)}:null;default:return null}}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 e.getStaticData()}};G();var rA={valueAck:{color:`#b02323`},valueNotAck:{color:`#12ac15`}},iA=W.forwardRef((e,t)=>O(ut,{direction:`up`,ref:t,...e}));iA.displayName=`Transition`;var aA=class e extends ${constructor(t){super(t,e.getStaticData()),N(this,`inputRef`,void 0),this.inputRef=W.createRef()}static compile(e,t){let n=t.justCheck?Mk:Nk;return n=n.replace(`"__%%DEBUG_TRIGGER%%__"`,`_sendToFrontEnd(${e._id}, {val: obj.state.val, ack: obj.state.ack, valOld: obj.oldState && obj.oldState.val, ackOld: obj.oldState && obj.oldState.ack})`),`on({id: "${e.oid||``}", change: "${e.tagCard===`on update`?`any`:`ne`}"}, ${n});`}renderDebug(e){return e.data.valOld===void 0?B(`span`,{children:[V.t(`Triggered`),` `,O(`span`,{style:e.data.ack?rA.valueAck:rA.valueNotAck,children:Ek(e.data.val)})]}):B(`span`,{children:[V.t(`Triggered`),` `,O(`span`,{style:e.data.ackOld?rA.valueAck:rA.valueNotAck,children:Ek(e.data.valOld)}),` `,`→`,` `,O(`span`,{style:e.data.ack?rA.valueAck:rA.valueNotAck,children:Ek(e.data.val)})]})}onWriteValue(){this.setState({openSimulate:!1});let e=this.state.simulateValue;window.localStorage.setItem(`javascript.app.${this.state.settings.oid}_ack`,this.state.simulateAck?`true`:`false`),this.state.settings.oidType===`boolean`?(e=e===!0||e===`true`||e===`1`,window.localStorage.setItem(`javascript.app.${this.state.settings.oid}`,e?`true`:`false`)):this.state.settings.oidType===`number`?(e=parseFloat(e)||0,window.localStorage.setItem(`javascript.app.${this.state.settings.oid}`,e.toString())):window.localStorage.setItem(`javascript.app.${this.state.settings.oid}`,(e==null?void 0:e.toString())||``),this.props.socket.setState(this.state.settings.oid,{val:e,ack:!!this.state.simulateAck})}renderWriteState(){return[O(R,{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 e;return(e=this.inputRef.current)==null?void 0:e.focus()},200)},children:V.t(`Simulate`)},`buttonWrite`),B(qe,{open:!!this.state.openSimulate,slots:{transition:iA},keepMounted:!0,onClose:()=>this.setState({openSimulate:!1}),"aria-labelledby":`simulate-dialog-slide-title`,"aria-describedby":`simulate-dialog-slide-description`,children:[O(ot,{id:`simulate-dialog-slide-title`,children:V.t(`Trigger with value`)}),B(St,{children:[this.state.settings.oidType===`boolean`?O(Wt,{control:O(_,{slotProps:{input:{ref:this.inputRef}},onKeyUp:e=>e.key===`Enter`&&this.onWriteValue(),value:!!this.state.simulateValue,onChange:e=>this.setState({simulateValue:e.target.checked})}),label:V.t(`Value`)}):O(P,{variant:`standard`,inputRef:this.inputRef,label:V.t(`Value`),fullWidth:!0,onKeyUp:e=>e.key===`Enter`&&this.onWriteValue(),value:!this.state.simulateValue&&this.state.simulateValue!==0?``:this.state.simulateValue,onChange:e=>this.setState({simulateValue:e.target.value})}),O(`br`,{}),O(Wt,{control:O(De,{checked:!!this.state.simulateAck,onChange:e=>this.setState({simulateAck:e.target.checked}),color:`primary`}),label:V.t(`Ack`)})]}),B(Vt,{children:[B(R,{variant:`contained`,onClick:()=>this.onWriteValue(),color:`primary`,children:[O(lt,{}),V.t(`Write`)]}),B(R,{color:`grey`,variant:`contained`,onClick:()=>this.setState({openSimulate:!1}),children:[O(l,{}),V.t(`Close`)]})]})]},`dialogWrite`)]}getSummary(){let{oid:e,tagCard:t}=this.state.settings;if(!e)return null;let n=this.objectName(e);return{kicker:t?V.t(t):void 0,title:n||e,subtitle:n?e:void 0}}onTagChange(e){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 e.getStaticData()}},oA=class e extends ${constructor(t){super(t,e.getStaticData())}static compile(e,t){let n=t.justCheck?Pk:Fk;return n=n.replace(`"__%%DEBUG_TRIGGER%%__"`,`_sendToFrontEnd(${e._id}, {message: typeof data === "object" ? JSON.stringify(data) : data})`),`onMessage(${JSON.stringify(e.message||`message`)}, ${n});`}renderDebug(e){return`${V.t(`Received:`)} ${e.data.message}`}getSummary(){let{message:e}=this.state.settings;return e?{kicker:V.t(`On message`),title:String(e)}:null}onTagChange(e){this.setState({inputs:[{nameRender:`renderText`,attr:`message`,frontText:`Message name:`,defaultValue:`myMessage`}]},()=>super.onTagChange(e))}static getStaticData(){return{acceptedBy:`triggers`,name:`On message`,id:`TriggerMessage`,icon:`Message`,title:`Triggers the rule when another script or adapter sends a message`,helpDialog:`Send the message from a script with messageTo({instance: 'javascript.0'}, 'myMessage', data). The sent data is available in the texts of the actions as %s.`}}getData(){return e.getStaticData()}},sA=class e extends ${constructor(t){super(t,e.getStaticData())}static compile(e,t){if(!e.fileId)return`// no object for the file subscription defined +_sendToFrontEnd(${e._id}, {fileName: 'No object defined'});`;let n=t.justCheck?Ik:Lk;return n=n.replace(`"__%%DEBUG_TRIGGER%%__"`,`_sendToFrontEnd(${e._id}, {fileName: fileName, size: size})`),`onFile(${JSON.stringify(e.fileId)}, ${JSON.stringify(e.filePattern||`*`)}, false, ${n});`}renderDebug(e){let t=e.data.size===null?`Deleted:`:`File changed:`;return`${V.t(t)} ${e.data.fileName}`}getSummary(){let{fileId:e,filePattern:t}=this.state.settings;return e?{kicker:V.t(`File`),title:`${e}/${t||`*`}`}:null}onTagChange(e){this.setState({inputs:[{nameRender:`renderText`,attr:`fileId`,frontText:`Files of:`,defaultValue:`vis.0`},{nameRender:`renderText`,attr:`filePattern`,frontText:`File name:`,defaultValue:`main/*`}]},()=>super.onTagChange(e))}static getStaticData(){return{acceptedBy:`triggers`,name:`On file change`,id:`TriggerFile`,icon:`InsertDriveFile`,title:`Triggers the rule when a file of an object is written or deleted`,helpDialog:`Both fields may contain *, e.g. the object "vis.0" and the file name "main/*". In the texts of the actions %s is the name of the changed file and %id the object it belongs to. Requires js-controller 4.1 or newer.`}}getData(){return e.getStaticData()}},cA=[{value:`_`,title:`any change`},{value:`exists`,title:`created or changed`},{value:`deleted`,title:`deleted`}],lA=class e extends ${constructor(t){super(t,e.getStaticData())}static compile(e,t){if(!e.pattern)return`// no object pattern defined +_sendToFrontEnd(${e._id}, {id: 'No pattern defined'});`;let n=t.justCheck?Rk:zk,r=e.change===`deleted`?` + if (obj) { return; }`:e.change===`exists`?` + if (!obj) { return; }`:``;return n=n.replace(`"__%%DEBUG_TRIGGER%%__";`,`_sendToFrontEnd(${e._id}, {id: id, deleted: !obj});${r}`),`onObject(${JSON.stringify(e.pattern)}, ${n});`}renderDebug(e){return`${V.t(e.data.deleted?`Object deleted:`:`Object changed:`)} ${e.data.id}`}getSummary(){let{pattern:e,change:t}=this.state.settings;if(!e)return null;let n=cA.find(e=>e.value===(t||`_`));return{kicker:n?V.t(n.title):void 0,title:e}}onTagChange(e){this.setState({inputs:[{nameRender:`renderText`,attr:`pattern`,frontText:`Object ID:`,defaultValue:`javascript.0.*`},{nameRender:`renderSelect`,attr:`change`,frontText:`React on:`,options:cA,defaultValue:`_`}]},()=>super.onTagChange(e))}static getStaticData(){return{acceptedBy:`triggers`,name:`On object change`,id:`TriggerObject`,icon:`AccountTree`,title:`Triggers the rule when an object is created, changed or deleted`,helpDialog:`This reacts to the object itself, not to its value - use the "State" trigger for values. The pattern may contain *, e.g. "hm-rpc.0.*". In the texts of the actions %s and %id are the id of the changed object.`}}getData(){return e.getStaticData()}},uA=[{value:`error`,title:`error`},{value:`warn`,title:`warn`},{value:`info`,title:`info`},{value:`debug`,title:`debug`},{value:`silly`,title:`silly`},{value:`*`,title:`any level`}],dA=class e extends ${constructor(t){super(t,e.getStaticData())}static compile(e,t){let n=t.justCheck?Bk:Vk,r=(e.filter||``).trim(),i=r?`\n if (!String(info.message).toLowerCase().includes(${JSON.stringify(r.toLowerCase())})) { return; }`:``;return n=n.replace(`"__%%DEBUG_TRIGGER%%__";`,`_sendToFrontEnd(${e._id}, {message: info.message, severity: info.severity});${i}`),`onLog(${JSON.stringify(e.severity||`error`)}, ${n});`}renderDebug(e){return`${V.t(`Logged:`)} ${e.data.message}`}getSummary(){let{severity:e,filter:t}=this.state.settings,n=uA.find(t=>t.value===(e||`error`));return{kicker:n?V.t(n.title):void 0,title:t?`${V.t(`Log contains`)}: ${t}`:V.t(`Every log entry`)}}onTagChange(e){this.setState({inputs:[{nameRender:`renderSelect`,attr:`severity`,frontText:`Level:`,options:uA,defaultValue:`error`},{nameRender:`renderText`,attr:`filter`,frontText:`Contains:`,defaultValue:``}]},()=>super.onTagChange(e))}static getStaticData(){return{acceptedBy:`triggers`,name:`On log message`,id:`TriggerLog`,icon:`Article`,title:`Triggers the rule when something is written to the ioBroker log`,helpDialog:`Leave "Contains" empty to react to every entry of that level. Fill it in if an action of this rule writes to the log itself - a rule that matches its own message can trigger itself. In the texts of the actions %s is the log message and %id the instance it came from.`}}getData(){return e.getStaticData()}},fA=class e extends ${constructor(t){super(t,e.getStaticData())}static compile(e){return`onStop(${Hk.replace(`"__%%DEBUG_TRIGGER%%__"`,`_sendToFrontEnd(${e._id}, {trigger: true})`)}, ${parseInt(e.timeout,10)||1e3});`}renderDebug(){return V.t(`Triggered`)}getSummary(){let{timeout:e}=this.state.settings;return{title:V.t(`On rule stop`),subtitle:`${V.t(`Wait at most:`)} ${parseInt(e,10)||1e3} ${V.t(`ms`)}`}}onTagChange(e){this.setState({inputs:[{nameRender:`renderNumber`,attr:`timeout`,frontText:`Wait at most:`,backText:`ms`,doNotTranslateBack:!0,defaultValue:1e3}]},()=>super.onTagChange(e))}static getStaticData(){return{acceptedBy:`triggers`,name:`On rule stop`,id:`TriggerOnStop`,icon:`Stop`,title:`Runs the rule once more when it is stopped, saved or the adapter shuts down`,helpDialog:`The adapter waits for the actions, but only for the time set here - what does not fit is cut off. A rule can have only one block of this kind; a second one replaces the first.`}}getData(){return e.getStaticData()}};function pA(e){return[{nameRender:`renderSelect`,attr:`enumId`,frontText:`Members of:`,doNotTranslate:!0,defaultValue:``,options:e}]}var mA=class e extends ${constructor(t){super(t,e.getStaticData()),N(this,`enumsPromise`,null)}static compile(e,t){if(!e.enumId)return`// no enum defined +_sendToFrontEnd(${e._id}, {id: 'No enum defined'});`;let n=t.justCheck?Mk:Nk;return n=n.replace(`"__%%DEBUG_TRIGGER%%__"`,`_sendToFrontEnd(${e._id}, {id: obj.id, val: obj.state && obj.state.val})`),`onEnumMembers(${JSON.stringify(e.enumId)}, ${n});`}renderDebug(e){return`${V.t(`Triggered`)}: ${e.data.id} = ${e.data.val}`}enumTitle(e,t){var n;let r=e==null||(n=e.common)==null?void 0:n.name,i=r&&typeof r==`object`?r[V.getLanguage()]||r.en:r;return i?`${i} (${t})`:t}setInputs(){this.setState({inputs:pA([])},()=>super.onTagChange()),this.enumsPromise||=this.props.socket.getObjectViewSystem(`enum`,`enum.`,`enum.香`),this.enumsPromise.then(e=>{if(!this.mounted)return;let t=Object.keys(e||{}).filter(e=>e.split(`.`).length>2).sort().map(t=>({value:t,title:this.enumTitle(e[t],t)}));this.setState({inputs:pA(t)},()=>super.onTagChange())})}onTagChange(e){this.setInputs()}getSummary(){let{enumId:e}=this.state.settings;return e?{kicker:V.t(`Any member of`),title:e}:null}static getStaticData(){return{acceptedBy:`triggers`,name:`On enum member change`,id:`TriggerEnumMembers`,icon:`Category`,title:`Triggers the rule when any state of a room or function changes`,helpDialog:`Subscribes to every state of the selected enum and follows it: a device added to that room later is included without changing the rule. In the texts of the actions %s is the new value and %id the state that changed.`}}getData(){return e.getStaticData()}},hA=``+new URL(`hysteresis-CLhhemcG.png`,import.meta.url).href;G();var gA=`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; + } +}`,_A=class e extends ${constructor(t){super(t,e.getStaticData()),N(this,`onShowHelp`,()=>this.setState({showHysteresisHelp:!0}))}isAllTriggersOnState(){var e,t;return!!((e=this.props.userRules)!=null&&(e=e.triggers)!=null&&e.find(e=>e.id===`TriggerState`))&&!((t=this.props.userRules)!=null&&(t=t.triggers)!=null&&t.find(e=>e.id!==`TriggerState`))}static compile(e,t){let n=e.value;n??=!1;let r,i;if(e.tagCard===`()`)t.prelines||=[],t.prelines.find(e=>e!==gA)||t.prelines.push(gA),e.useTrigger?(r=`obj.state.val`,n===``&&(n=0),i=`__hysteresis(subCondVar${e._id}, ${n}, __%%STATE%%__, ${e.hist}, "${e.histComp}")`):(r=`(await getStateAsync("${e.oid}")).val`,n===``&&(n=0),typeof n==`string`&&parseFloat(n.trim()).toString()!==n.trim()&&(n=`"${n}"`),i=`__hysteresis(subCondVar${e._id}, ${n}, __%%STATE%%__, ${e.hist}, "${e.histComp}")`);else if(e.tagCard!==`includes`){let o=e.tagCard===`=`?`==`:e.tagCard===`<>`?`!=`:e.tagCard;if(e.useTrigger){var a;r=`obj.state.val`,(t==null||(a=t.trigger)==null?void 0:a.oidType)===`string`?(n=n.replace(/"/g,`\\"`),i=`subCondVar${e._id} ${o} "${n}"`):(n===``&&(n=0),typeof n==`string`&&parseFloat(n.trim()).toString()!==n.trim()&&(n=`"${n}"`),i=`subCondVar${e._id} ${o} ${n}`)}else r=`(await getStateAsync("${e.oid}")).val`,e.oidType===`string`?(n=n.replace(/"/g,`\\"`),i=`subCondVar${e._id} ${o} "${n}"`):(n===``&&(n=0),typeof n==`string`&&parseFloat(n.trim()).toString()!==n.trim()&&(n=`"${n}"`),i=`subCondVar${e._id} ${o} ${n}`)}else if(e.useTrigger){var o;r=`obj.state.val`,(t==null||(o=t.trigger)==null?void 0:o.oidType)===`string`?(n=n.replace(/"/g,`\\"`),i=`obj.state.val.includes("${n}")`):i=`false`}else r=`(await getStateAsync("${e.oid}")).val`,e.oidType===`string`?(n=n.replace(/"/g,`\\"`),i=`subCondVar${e._id}.includes("${n}")`):i=`false`;return t.conditionsStates.push({name:`subCondVar${e._id}`,id:e.oid}),t.conditionsVars.push(`const subCondVar${e._id} = ${r};`),t.conditionsVars.push(`const subCond${e._id} = ${i};`),t.conditionsDebug.push(`_sendToFrontEnd(${e._id}, {result: subCond${e._id}, value: subCondVar${e._id}, compareWith: "${n}"});`),`subCond${e._id}`}renderDebug(e){let t=this.state.settings.tagCard;return t===`()`?V.t(`Triggered`):`${e.data.result.toString().toUpperCase()} [${e.data.value} ${t} ${e.data.compareWith}]`}_setInputs(t,n,r,i,a){var o;let s=this.isAllTriggersOnState();n||=this.state.settings.tagCard,r||=this.state.settings.oidType,i||=this.state.settings.oidUnit,a||=this.state.settings.oidStates,t===void 0&&(t=this.state.settings.useTrigger),s&&t&&((o=this.props.userRules)==null||(o=o.triggers)==null?void 0:o.length)===1&&(r=this.props.userRules.triggers[0].oidType,i=this.props.userRules.triggers[0].oidUnit,a=this.props.userRules.triggers[0].oidStates);let c=e.getStaticData().tagCardArray,l=c.find(e=>e.title===n)||c[0],u,d=null;r===`number`?(u=[{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`}],a&&(d=Object.keys(a).map(e=>a?{value:e,title:a[e]}:null).filter(e=>e))):r===`boolean`?(u=[{title:`=`,title2:`[equal]`,text:`equal to`},{title:`<>`,title2:`[not equal]`,text:`not equal to`}],d=[{title:`false`,value:!1},{title:`true`,value:!0}]):(u=[{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`}],a&&(d=Object.keys(a).map(e=>({value:e,title:a?a[e]:e.toString()}))));let f=null;u.find(e=>e.title===n)||(n=u[0].title,f||={...this.state.settings},f.tagCard=n);let p,m={nameRender:`renderText`,defaultValue:``,attr:`value`,frontText:n===`()`?`Limit`:(l==null?void 0:l.text)||`compare with`,doNotTranslateBack:!0,backText:i};d&&(m={nameRender:`renderSelect`,defaultValue:d[0].value,options:d,attr:`value`,frontText:(l==null?void 0:l.text)||`compare with`,doNotTranslateBack:!0,backText:i},d.find(e=>e.value===this.state.settings.value)||(f||={...this.state.settings},f.value=d[0].value),d.length<=2&&(u=[{title:`=`,title2:`[equal]`,text:`equal to`},{title:`<>`,title2:`[not equal]`,text:`not equal to`}])),p=s&&t?[{backText:`use trigger value`,nameRender:`renderCheckbox`,attr:`useTrigger`,defaultValue:!1},m]:s?[{backText:`use trigger value`,nameRender:`renderCheckbox`,attr:`useTrigger`},{nameRender:`renderObjectID`,attr:`oid`,defaultValue:``},m]:[{nameRender:`renderObjectID`,attr:`oid`,defaultValue:``},m],n===`()`&&(p.splice(1,0,{nameRender:`renderDialog`,icon:`HelpOutline`,frontText:`Explanation`,onShowDialog:this.onShowHelp}),p.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:`<>`}]}),p.push({frontText:`Δ`,doNotTranslate:!0,nameRender:`renderNumber`,noHelperText:!0,attr:`hist`,defaultValue:1,doNotTranslateBack:!0,backText:i}));let h={iconTag:!0,tagCardArray:u,inputs:p};this.setState(h,()=>super.onTagChange(null,()=>{f&&(this.setState({settings:f}),this.props.onChange(f))}))}onValueChanged(e,t){typeof e==`object`?this._setInputs(e.useTrigger,e.tagCard,e.oidType,e.states):t===`useTrigger`?this._setInputs(e):t===`oidType`?this._setInputs(void 0,void 0,e):t===`oidUnit`?this._setInputs(void 0,void 0,void 0,e):t===`oidStates`&&this._setInputs(void 0,void 0,void 0,void 0,e)}onUpdate(){this._setInputs(this.state.settings.useTrigger)}onTagChange(e){this._setInputs(this.state.settings.useTrigger,e)}getSummary(){let{useTrigger:e,tagCard:t,value:n,oid:r}=this.state.settings;if(!e&&!r)return null;let i=e?void 0:this.objectName(r);return{title:`${e?V.t(`Trigger value`):i||r||``} ${t||`=`} ${n===void 0||n===``?`…`:String(n)}`,subtitle:i?r:void 0}}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 e.getStaticData()}renderSpecific(){return this.state.showHysteresisHelp?B(qe,{open:!0,maxWidth:`md`,onClose:()=>this.setState({showHysteresisHelp:!1}),"aria-labelledby":`alert-dialog-title`,"aria-describedby":`alert-dialog-description`,children:[O(St,{children:O(Ft,{id:`alert-dialog-description`,children:O(`img`,{src:hA,alt:`Hysteresis`})})}),O(Vt,{children:O(R,{onClick:()=>this.setState({showHysteresisHelp:!1}),color:`primary`,autoFocus:!0,children:V.t(`OK`)})})]}):null}},vA=[31,29,31,30,31,30,31,31,30,31,30,31],yA=class e extends ${constructor(t){super(t,e.getStaticData())}static compile(e,t){let n=e.tagCard===`=`?`===`:e.tagCard===`<>`?`!==`:e.tagCard,r;if(e.withDate){let[t,i]=(e.date||`01.01`).toString().split(`.`),a=parseInt(i,10)||0,o=parseInt(t,10)||0;o>12?o=12:o<0&&(o=0),a>vA[o]?a=vA[o]:a<0&&(a=0),r=a&&o?`formatDate(Date.now(), 'MM.DD-hh:mm') ${n} "${e.date}-${e.time}"`:a===0&&o?`formatDate(Date.now(), 'MM-hh:mm') ${n} "${o.toString().padStart(2,`0`)}-${e.time}"`:o===0&&a?`formatDate(Date.now(), 'DD-hh:mm') ${n} "${a.toString().padStart(2,`0`)}-${e.time}"`:`formatDate(Date.now(), 'hh:mm') ${n} "${e.time}"`}else r=`formatDate(Date.now(), 'hh:mm') ${n} "${e.time}"`;return t.conditionsVars.push(`const subCond${e._id} = ${r};`),t.conditionsDebug.push(`_sendToFrontEnd(${e._id}, {result: subCond${e._id}});`),`subCond${e._id}`}_setInputs(t,n){n=n===void 0?this.state.settings.withDate:n,t||=this.state.settings.tagCard;let r=e.getStaticData().tagCardArray,i=r==null?void 0:r.find(e=>e.title===t),a=[{nameRender:`renderNameText`,attr:`interval`,defaultValue:`Actual time of day`},{frontText:(i==null?void 0:i.text)||t,nameRender:`renderTime`,attr:`time`,defaultValue:`12:00`},{frontText:`with date`,nameRender:`renderCheckbox`,attr:`withDate`,defaultValue:!1}];n&&a.push({nameRender:`renderDate`,attr:`date`,defaultValue:`01.01`}),this.setState({inputs:a,iconTag:!0},()=>super.onTagChange())}onValueChanged(e,t){t===`withDate`&&this._setInputs(void 0,e)}onTagChange(e){this._setInputs(e)}getSummary(){let{tagCard:e,time:t,withDate:n,date:r}=this.state.settings;if(!t)return null;let i=n&&r?`${t} · ${r}`:t;return{title:`${V.t(`Actual time of day`)} ${e||`=`} ${i}`}}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 e.getStaticData()}},bA=class e extends ${constructor(t){super(t,e.getStaticData()),N(this,`coordinates`,null)}static compile(e,t){let n=e.tagCard===`=`?`===`:e.tagCard===`<>`?`!==`:e.tagCard,r;e.offset&&(r=parseInt(e.offsetValue,10)||0);let i=`formatDate(Date.now(), 'hh:mm') ${n} formatDate(getAstroDate("${e.astro}"${r?`, undefined, ${r}`:``}), 'hh:mm')`;return t.conditionsVars.push(`const subCond${e._id} = ${i};`),t.conditionsDebug.push(`_sendToFrontEnd(${e._id}, {result: ${i}});`),i}static _time2String(e){return e?`${e.getHours().toString().padStart(2,`0`)}:${e.getMinutes().toString().padStart(2,`0`)}`:`--:--`}getSummary(){let{astro:e,tagCard:t,offset:n,offsetValue:r}=this.state.settings;if(!e)return null;let i=parseInt(r,10)||0,a=this.optionTitle(`astro`,e,`title2`),o=n&&i?` ${i>0?`+`:``}${i} ${V.t(`minutes`)}`:``;return{title:`${V.t(`Actual time of day`)} ${t||`=`} ${e}${o}`,subtitle:a}}onValueChanged(e,t){t===`astro`?this._setAstro(e):t===`offset`?this._setAstro(void 0,e):t===`offsetValue`&&this._setAstro(void 0,void 0,e)}async _setAstro(t,n,r){if(t=t||this.state.settings.astro||`solarNoon`,n=n===void 0?this.state.settings.offset:n,r=r===void 0?this.state.settings.offsetValue:r,r=parseInt(r,10)||0,!this.coordinates){let e=await this.props.socket.getObject(`system.adapter.javascript.0`);if(!(e!=null&&e.native.latitude)&&!(e!=null&&e.native.longitude)){let e=await this.props.socket.getObject(`system.config`);this.coordinates=e&&(e.common.latitude||e.common.longitude)?{latitude:e.common.latitude,longitude:e.common.longitude}:null}else this.coordinates={latitude:e==null?void 0:e.native.latitude,longitude:e==null?void 0:e.native.longitude}}let i=this.coordinates?eA.default.getTimes(new Date,this.coordinates.latitude,this.coordinates.longitude):null,a=i?Object.keys(i).map(t=>({value:t,title:t,title2:`[${e._time2String(i[t])}]`,order:e._time2String(i[t])})):[];a.sort((e,t)=>e.order>t.order?1:e.ordere.title===this.state.settings.tagCard)||o[0],c=`--:--`;if(t&&i&&i[t]){let a=new Date(i[t]);n&&a.setMinutes(a.getMinutes()+parseInt(r,10)),c=`(${V.t(s.text)} ${e._time2String(a)})`}let l;l=n?[{nameRender:`renderNameText`,defaultValue:`Actual time of day`,attr:`text`},{frontText:s.text,attr:`astro`,nameRender:`renderSelect`,options:a,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:c}]:[{nameRender:`renderNameText`,defaultValue:`Actual time of day`,attr:`text`},{frontText:s.text,attr:`astro`,nameRender:`renderSelect`,options:a,doNotTranslate2:!0,defaultValue:`solarNoon`},{backText:`with offset`,nameRender:`renderCheckbox`,attr:`offset`},{nameRender:`renderNameText`,attr:`textTime`,doNotTranslate:!0,defaultValue:c}],this.setState({inputs:l},()=>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 e.getStaticData()}},xA=[{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`}],SA=class e extends ${constructor(t){super(t,e.getStaticData())}static compile(e,t){let n=e.dow||[],r=n.filter(e=>e!==`_`).map(e=>parseInt(e,10)),i=!r.length||n.includes(`_`)?`true`:`[${r.join(`, `)}].includes(new Date().getDay())`;return t.conditionsVars.push(`const subCond${e._id} = ${i};`),t.conditionsDebug.push(`_sendToFrontEnd(${e._id}, {result: subCond${e._id}});`),`subCond${e._id}`}onTagChange(){this.setState({inputs:[{nameRender:`renderNameText`,attr:`text`,defaultValue:`Day of week`},{nameRender:`renderSelect`,attr:`dow`,multiple:!0,default:``,defaultValue:[`1`,`2`,`3`,`4`,`5`],options:xA}]},()=>super.onTagChange())}getSummary(){let e=this.state.settings.dow;if(!(e!=null&&e.length))return null;if(e.includes(`_`))return{title:V.t(`Every day`)};let t=xA.filter(t=>t.value!==`_`&&e.includes(t.value)).map(e=>V.t(e.titleShort));return{title:`${V.t(`Day of week`)}: ${t.join(`, `)}`}}static getStaticData(){return{acceptedBy:`conditions`,name:`Weekday`,id:`ConditionWeekday`,icon:`CalendarMonth`,title:`Let the rule run only on the selected days of the week`}}getData(){return e.getStaticData()}},CA=class e extends ${constructor(t){super(t,e.getStaticData())}static compile(e,t){let n=((e.func||``).trim()||`return true;`).split(` +`).map(e=>` ${e}`).join(` +`);return t.conditionsVars.push(`const subCond${e._id} = !!(await (async () => {\n${n}\n })());`),t.conditionsDebug.push(`_sendToFrontEnd(${e._id}, {result: subCond${e._id}});`),`subCond${e._id}`}renderDebug(e){return`${V.t(`Condition`)}: ${e.data.result}`}getSummary(){let e=String(this.state.settings.func||``).split(` +`).map(e=>e.trim()).filter(Boolean);return e.length?{title:e.length>1?`${e[0]} …`:e[0]}:null}onTagChange(e){this.setState({inputs:[{nameRender:`renderModalInput`,attr:`func`,noTextEdit:!0,defaultValue:`return getState("javascript.0.variable").val > 5;`,nameBlock:`Condition`}]},()=>super.onTagChange(e))}static getStaticData(){return{acceptedBy:`conditions`,name:`User condition`,id:`ConditionFunction`,icon:`Functions`,title:`Write your own condition`,helpDialog:`This is an advanced option. The code is the body of a function and must return the result, e.g. "return getState('javascript.0.variable').val > 5;". You may use await inside.`}}getData(){return e.getStaticData()}},wA=class e extends ${constructor(t){super(t,e.getStaticData()),N(this,`instancesPromise`,null)}static compile(e,t){if(!e.instance)return`// no instance defined +_sendToFrontEnd(${e._id}, {message: 'No instance defined'});`;let n=JSON.stringify(e.command||`send`),r=JSON.stringify(e.instance),i=`${e.instance} ${e.command||`send`}`.replace(/[\r\n]+/g,` `);if(e.asJson){let t=(e.message||``).trim();try{JSON.parse(t)}catch{return`// invalid JSON +_sendToFrontEnd(${e._id}, {message: 'Invalid JSON'});`}return`// sendTo ${i} +\t\t_sendToFrontEnd(${e._id}, {message: ${JSON.stringify(t)}}); +\t\tsendTo(${r}, ${n}, ${t});`}return e.message?`// sendTo ${i} +\t\tconst subActionVar${e._id} = ${JSON.stringify(e.message)}${$.getReplacesInText(t)}; +\t\t_sendToFrontEnd(${e._id}, {message: subActionVar${e._id}}); +\t\tsendTo(${r}, ${n}, subActionVar${e._id});`:`// no message defined +_sendToFrontEnd(${e._id}, {message: 'No message defined'});`}renderDebug(e){return`${V.t(`Sent:`)} ${e.data.message}`}inputs(e){let t=!!this.state.settings.asJson;return[{nameRender:`renderSelect`,attr:`instance`,frontText:`Instance:`,doNotTranslate:!0,defaultValue:e[0]||``,options:e.map(e=>({value:e,title:e}))},{nameRender:`renderText`,attr:`command`,frontText:`Command:`,defaultValue:`send`},{nameRender:`renderModalInput`,attr:`message`,nameBlock:``,frontText:t?`JSON:`:`Text:`,defaultValue:`Hello`},{nameRender:`renderCheckbox`,attr:`asJson`,backText:`as JSON`,defaultValue:!1}]}setInputs(){this.setState({inputs:this.inputs([])},()=>super.onTagChange()),this.instancesPromise||=this.props.socket.getAdapterInstances(),this.instancesPromise.then(e=>{if(!this.mounted)return;let t=(e||[]).map(e=>{var t;return e==null||(t=e._id)==null?void 0:t.replace(`system.adapter.`,``)}).filter(e=>!!e).sort();this.setState({inputs:this.inputs(t)},()=>super.onTagChange())})}onTagChange(){this.setInputs()}onValueChanged(e,t){t===`asJson`&&this.setInputs()}getSummary(){let{instance:e,command:t,message:n,asJson:r}=this.state.settings;return!e||!n?null:{kicker:r?V.t(`as JSON`):void 0,title:String(n),subtitle:`${e} · ${t||`send`}`}}static getStaticData(){return{acceptedBy:`actions`,name:`Send to adapter`,id:`ActionSendTo`,icon:`Send`,title:`Sends a message to any adapter instance`,helpDialog:`You can use %s in the text to display current trigger value or %id to display the triggered object ID`}}getData(){return e.getStaticData()}},TA=class e extends ${constructor(t){super(t,e.getStaticData())}static compile(e,t){return e.message?`// notification ${e.isAlert?`alert`:`message`} +\t\tconst subActionVar${e._id} = ${JSON.stringify(e.message)}${$.getReplacesInText(t)}; +\t\t_sendToFrontEnd(${e._id}, {message: subActionVar${e._id}}); +\t\tregisterNotification(subActionVar${e._id}, ${!!e.isAlert});`:`// no notification text defined +_sendToFrontEnd(${e._id}, {message: 'No text defined'});`}renderDebug(e){return`${V.t(`Registered:`)} ${e.data.message}`}getSummary(){let{message:e,isAlert:t}=this.state.settings;return e?{kicker:t?V.t(`Alert`):void 0,title:String(e)}:null}onTagChange(e){this.setState({inputs:[{nameRender:`renderModalInput`,attr:`message`,defaultValue:`My device triggered`,nameBlock:`Notification text`},{nameRender:`renderCheckbox`,attr:`isAlert`,backText:`as alert`,defaultValue:!1}]},()=>super.onTagChange(e))}static getStaticData(){return{acceptedBy:`actions`,name:`Notification`,id:`ActionNotification`,icon:`NotificationsActive`,title:`Creates an ioBroker notification, which is shown in the admin`,helpDialog:`You can use %s in the text to display current trigger value or %id to display the triggered object ID`}}getData(){return e.getStaticData()}},EA=class e extends ${constructor(t){super(t,e.getStaticData())}static compile(e,t){if(!e.message)return`// no message name defined +_sendToFrontEnd(${e._id}, {message: 'No message name defined'});`;let n=JSON.stringify(e.message),r=e.message.replace(/[\r\n]+/g,` `);if(e.asJson){let t=(e.data||``).trim();try{JSON.parse(t)}catch{return`// invalid JSON +_sendToFrontEnd(${e._id}, {message: 'Invalid JSON'});`}return`// messageTo ${r} +\t\t_sendToFrontEnd(${e._id}, {message: ${JSON.stringify(t)}}); +\t\tmessageTo(${n}, ${t});`}return`// messageTo ${r} +\t\tconst subActionVar${e._id} = ${JSON.stringify(e.data||``)}${$.getReplacesInText(t)}; +\t\t_sendToFrontEnd(${e._id}, {message: subActionVar${e._id}}); +\t\tmessageTo(${n}, subActionVar${e._id});`}renderDebug(e){return`${V.t(`Sent:`)} ${e.data.message}`}inputs(){return[{nameRender:`renderText`,attr:`message`,frontText:`Message name:`,defaultValue:`myMessage`},{nameRender:`renderModalInput`,attr:`data`,nameBlock:``,frontText:this.state.settings.asJson?`JSON:`:`Text:`,defaultValue:`Hello`},{nameRender:`renderCheckbox`,attr:`asJson`,backText:`as JSON`,defaultValue:!1}]}onTagChange(e){this.setState({inputs:this.inputs()},()=>super.onTagChange(e))}onValueChanged(e,t){t===`asJson`&&this.onTagChange()}getSummary(){let{message:e,data:t,asJson:n}=this.state.settings;return e?{kicker:n?V.t(`as JSON`):void 0,title:String(e),subtitle:t?String(t):void 0}:null}static getStaticData(){return{acceptedBy:`actions`,name:`Send message`,id:`ActionMessageTo`,icon:`Forum`,title:`Sends a message to other scripts and rules`,helpDialog:`Every rule with an "On message" trigger of the same name receives it, as does a script with onMessage(). You can use %s in the text to send the current trigger value or %id the triggered object ID.`}}getData(){return e.getStaticData()}};G();var DA={valueAck:{color:`#b02323`},valueNotAck:{color:`#12ac15`}},OA=class e extends ${constructor(e){super(e,new.target.getStaticData())}isAllTriggersOnState(){var e,t;return!!((e=this.props.userRules)!=null&&(e=e.triggers)!=null&&e.find(e=>e.id===`TriggerState`))&&!((t=this.props.userRules)!=null&&(t=t.triggers)!=null&&t.find(e=>e.id!==`TriggerState`))}static compile(e,t){let n=e.value;e.useTrigger?n=e.toggle?`!obj.state.val`:`obj.state.val`:(n??=``,typeof e.value==`string`&&parseFloat(e.value).toString()!==e.value&&e.value!==`true`&&e.value!==`false`&&(n=`"${n.replace(/"/g,`\\"`)}"${$.getReplacesInText(t)}`));let r;return r=e.toggle&&!e.useTrigger?`const subActionVar${e._id} = !(await getStateAsync("${e.oid}")).val`:`const subActionVar${e._id} = ${n}`,`// set state ${e.oid} to ${e.toggle&&!e.useTrigger?`toggle`:n} +\t\t${r}; +\t\t_sendToFrontEnd(${e._id}, {val: subActionVar${e._id}, ack: ${e.tagCard===`update`}}); +\t\tawait setStateAsync("${e.oid}", subActionVar${e._id}, ${e.tagCard===`update`});`}renderDebug(e){return B(`span`,{children:[V.t(`Set:`),` `,O(`span`,{style:e.data.ack?DA.valueAck:DA.valueNotAck,children:Ek(e.data.val)})]})}_setInputs(e,t){let n=this.isAllTriggersOnState();t=t===void 0?this.state.settings.toggle:t,e=e===void 0?this.state.settings.useTrigger:e;let r=``,i,{oidType:a,oidUnit:o,oidStates:s,oidMax:c,oidMin:l,oidRole:u,oidWrite:d,oidStep:f}=this.state.settings,p;a&&(a===`number`?(r=`number`,c!==void 0&&l!==void 0&&(r=`slider`)):a===`boolean`?(r=`boolean`,u&&u.includes(`button`)&&d&&(r=`button`)):(r=``,u&&u.includes(`color`)&&(r=`color`)),s&&(i=Object.keys(s).map(e=>({value:e,title:s[e]})),r=`select`));let m;if(n&&e)m=[{backText:`use trigger value`,nameRender:`renderCheckbox`,attr:`useTrigger`,defaultValue:!1}],r===`boolean`&&m.push({backText:`toggle value`,attr:`toggle`,nameRender:`renderCheckbox`,defaultValue:!1});else{switch(r){case`number`:m=[{backText:o||``,frontText:`with`,nameRender:`renderNumber`,defaultValue:c===void 0?0:c,attr:`value`}],this.state.settings.value!==void 0&&isNaN(parseFloat(this.state.settings.value))&&(p={value:c===void 0?0:c});break;case`slider`:{m=[{nameRender:`renderSlider`,defaultValue:c,min:l,max:c,unit:o,step:f,attr:`value`}];let e=parseFloat(this.state.settings.value);this.state.settings.value!==void 0&&(isNaN(e)||ec)&&(p={value:c});break}case`select`:m=[{nameRender:`renderSelect`,frontText:`with`,options:i,defaultValue:(i==null?void 0:i[0].value)||``,attr:`value`}],this.state.settings.value!==void 0&&!(i!=null&&i.find(e=>e.value===this.state.settings.value))&&(p={value:(i==null?void 0:i[0].value)||``});break;case`boolean`:m=[{backText:`toggle value`,attr:`toggle`,nameRender:`renderCheckbox`,defaultValue:!1}],t||m.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&&(p={value:!1});break;case`button`:m=[{nameRender:`renderButton`,defaultValue:!0,attr:`value`}],this.state.settings.value!==void 0&&this.state.settings.value!==!0&&(p={value:!0});break;case`color`:m=[{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`))&&(p={value:`#FFFFFF`});break;default:m=[{backText:o||``,frontText:`with`,nameRender:`renderText`,defaultValue:``,attr:`value`}]}n&&m.unshift({backText:`use trigger value`,nameRender:`renderCheckbox`,attr:`useTrigger`})}return{inputs:m,newSettings:p}}onTagChange(e,t,n,r,i){i=i===void 0?this.state.settings.useTrigger:i;let{inputs:a,newSettings:o}=this._setInputs(i,r);a.unshift({nameRender:`renderObjectID`,attr:`oid`,defaultValue:``,checkReadOnly:!0}),this.setState({inputs:a},()=>super.onTagChange(null,()=>{if(o){let e=JSON.parse(JSON.stringify(this.state.settings));Object.assign(e,o),this.setState(e),this.props.onChange(e)}}))}onValueChanged(e,t){this.onTagChange(void 0,void 0,void 0,t===`toggle`?e:void 0,t===`useTrigger`?e:void 0)}onUpdate(){this.onTagChange()}getSummary(){let{oid:e,value:t,toggle:n,useTrigger:r,tagCard:i}=this.state.settings;if(!e)return null;let a=this.objectName(e),o;return o=r?V.t(`Trigger value`):n?V.t(`toggle`):t===void 0||t===``?`…`:String(t),{kicker:i?V.t(i):void 0,title:`${a||e} ← ${o}`,subtitle:a?e:void 0}}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 e.getStaticData()}},kA=class e extends OA{static compile(e,t){let n=e.value;e.useTrigger?n=e.toggle?`!obj.state.val`:`obj.state.val`:(n??=``,typeof e.value==`string`&&parseFloat(e.value).toString()!==e.value&&e.value!==`true`&&e.value!==`false`&&(n=`${JSON.stringify(n)}${$.getReplacesInText(t)}`));let r=e.toggle&&!e.useTrigger?`const subActionVar${e._id} = !(await getStateAsync(${JSON.stringify(e.oid)})).val`:`const subActionVar${e._id} = ${n}`;return`// set state ${e.oid} to ${e.toggle&&!e.useTrigger?`toggle`:n} if changed +\t\t${r}; +\t\t_sendToFrontEnd(${e._id}, {val: subActionVar${e._id}, ack: ${e.tagCard===`update`}}); +\t\tawait setStateChangedAsync(${JSON.stringify(e.oid)}, subActionVar${e._id}, ${e.tagCard===`update`});`}getSummary(){let e=super.getSummary();return e?{...e,subtitle:[e.subtitle,V.t(`only if changed`)].filter(Boolean).join(` · `)}:null}static getStaticData(){return{acceptedBy:`actions`,name:`Set state if changed`,id:`ActionSetStateChanged`,icon:`PublishedWithChanges`,tagCardArray:[`control`,`update`],title:`Writes a state only if its value differs from the current one`,helpDialog:`Use this instead of "Set state action" for rules that run often: an unchanged value is not written at all, so nothing subscribed to that state is woken up for nothing.`}}getData(){return e.getStaticData()}},AA=class e extends ${constructor(t){super(t,e.getStaticData())}static literal(e){if(typeof e==`number`||typeof e==`boolean`)return String(e);let t=e??``;return parseFloat(t).toString()===t||t===`true`||t===`false`?t:JSON.stringify(t)}static compile(t){if(!t.oid)return`// no object selected +_sendToFrontEnd(${t._id}, {message: 'No object selected'});`;let n=t.tagCard===`update`,r=`String((await getStateAsync(${JSON.stringify(t.oid)}))?.val) === ${JSON.stringify(String(t.value1??``))}`;return`// toggle ${`${t.oid} between ${t.value1} and ${t.value2}`.replace(/[\r\n]+/g,` `)} +\t\tconst subActionVar${t._id} = ${r} ? ${e.literal(t.value2)} : ${e.literal(t.value1)}; +\t\t_sendToFrontEnd(${t._id}, {val: subActionVar${t._id}, ack: ${n}}); +\t\tawait setStateAsync(${JSON.stringify(t.oid)}, subActionVar${t._id}, ${n});`}renderDebug(e){return e.data.message||`${V.t(`Toggled:`)} ${e.data.val}`}buildInputs(){let{oidStates:e,oidUnit:t}=this.state.settings,n=e?Object.keys(e).map(t=>({value:t,title:e[t]})):void 0,r,i;if(n!=null&&n.length){let e=n[1]||n[0];r=[{nameRender:`renderSelect`,attr:`value1`,frontText:`between`,options:n,defaultValue:n[0].value},{nameRender:`renderSelect`,attr:`value2`,frontText:`and`,options:n,defaultValue:e.value}];let t={},a=[n[0],e];[`value1`,`value2`].forEach((e,r)=>{let i=this.state.settings[e];i!==void 0&&!n.find(e=>e.value===String(i))&&(t[e]=a[r].value)}),Object.keys(t).length&&(i=t)}else r=[{nameRender:`renderText`,attr:`value1`,frontText:`between`,backText:t||``,doNotTranslateBack:!0,defaultValue:``},{nameRender:`renderText`,attr:`value2`,frontText:`and`,backText:t||``,doNotTranslateBack:!0,defaultValue:``}];return r.unshift({nameRender:`renderObjectID`,attr:`oid`,defaultValue:``,checkReadOnly:!0}),{inputs:r,newSettings:i}}onTagChange(e,t){let{inputs:n,newSettings:r}=this.buildInputs();this.setState({inputs:n},()=>super.onTagChange(null,()=>{if(r){let e={...this.state.settings,...r};this.setState({settings:e}),this.props.onChange(e)}t==null||t()}))}onValueChanged(e,t){t===`oid`&&this.onTagChange()}getSummary(){let{oid:e,value1:t,value2:n,tagCard:r}=this.state.settings;if(!e)return null;let i=this.objectName(e),a=e=>e===void 0||e===``?`…`:String(e);return{kicker:r?V.t(r):void 0,title:`${i||e}: ${a(t)} ⇄ ${a(n)}`,subtitle:i?e:void 0}}static getStaticData(){return{acceptedBy:`actions`,name:`Toggle between two values`,id:`ActionToggleState`,icon:`SwapHoriz`,tagCardArray:[`control`,`update`],title:`Switches a state back and forth between two values`,helpDialog:`If the state does not hold the first value, the first one is written - so the rule always ends up on a defined value. To invert a boolean, use the "toggle value" checkbox of the "Set state action" instead.`}}getData(){return e.getStaticData()}},jA=class e extends ${constructor(t){super(t,e.getStaticData())}static compile(e,t){return`// exec "${e.exec}" +\t\tconst subActionVar${e._id} = "${(e.exec||``).replace(/"/g,`\\"`)}"${$.getReplacesInText(t)}; +\t\t_sendToFrontEnd(${e._id}, {exec: subActionVar${e._id}}); +\t\tconsole.log(subActionVar${e._id});`}renderDebug(e){return`Exec: ${e.data.exec}`}onTagChange(e){this.setState({inputs:[{nameRender:`renderModalInput`,attr:`exec`,defaultValue:`ls /opt/iobroker`,nameBlock:`Shell command`}]},()=>super.onTagChange(e))}getSummary(){let{exec:e}=this.state.settings;return e?{title:String(e)}:null}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 e.getStaticData()}},MA=class e extends ${constructor(t){super(t,e.getStaticData())}static compile(e,t){return`// HTTP request ${(e.url||``).replace(/[\r\n]+/g,` `)} +\t\tconst subActionVar${e._id} = ${JSON.stringify(e.url||``)}${$.getReplacesInText(t)}; +\t\t_sendToFrontEnd(${e._id}, {url: subActionVar${e._id}}); +\t\thttpGet(subActionVar${e._id}, (error, response) => +\t\t\t_sendToFrontEnd(${e._id}, {url: subActionVar${e._id}, statusCode: response.statusCode, error: error ? error.message : undefined}));`}renderDebug(e){let{url:t,statusCode:n,error:r}=e.data;return r?`${V.t(`HTTP error:`)} ${r}`:n===void 0?`URL: ${t}`:`URL: ${t} → ${n}`}getSummary(){let{url:e}=this.state.settings;return e?{title:String(e)}:null}onTagChange(e){this.setState({inputs:[{nameRender:`renderModalInput`,attr:`url`,defaultValue:`http://mydevice.com?...`,nameBlock:`URL`}]},()=>super.onTagChange(e))}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 e.getStaticData()}},NA=class e extends ${constructor(t){super(t,e.getStaticData())}static compile(e,t){return`// Log ${e.text} +\t\tconst subActionVar${e._id} = "${(e.text||``).replace(/"/g,`\\"`)}"${$.getReplacesInText(t)}; +\t\t_sendToFrontEnd(${e._id}, {text: subActionVar${e._id}}); +\t\tconsole.log(subActionVar${e._id});`}renderDebug(e){return V.t(`Log: %s`,e.data.text)}onTagChange(){this.setState({inputs:[{nameRender:`renderModalInput`,attr:`text`,defaultValue:`My device triggered`,nameBlock:`Log text`}]},()=>super.onTagChange())}getSummary(){let{text:e}=this.state.settings;return e?{title:String(e)}:null}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 e.getStaticData()}},PA=class e extends ${constructor(t){super(t,e.getStaticData())}static compile(e){let t=e.unit===`ms`?1:e.unit===`s`?1e3:e.unit===`m`?6e4:36e5;return`// pause for ${t}ms +\t\t_sendToFrontEnd(${e._id}, {paused: true});\n +\t\tawait wait(${e.pause} * ${t});\n +\t\t_sendToFrontEnd(${e._id}, {paused: false});`}renderDebug(e){return V.t(`Paused: %s`,e.data.paused)}_getOptions(e){return e=e===void 0?this.state.settings.pause:e,e===1||e===`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(e){this.setState({inputs:[{nameRender:`renderNumber`,attr:`pause`,defaultValue:100,noHelperText:!0},{nameRender:`renderSelect`,attr:`unit`,defaultValue:`ms`,options:this._getOptions(e)}]},()=>super.onTagChange())}onValueChanged(e,t){t===`pause`&&this._setInputs(e)}onTagChange(){this._setInputs()}getSummary(){let{pause:e,unit:t}=this.state.settings;return e==null?null:{title:`${e} ${V.t(t||`ms`)}`}}static getStaticData(){return{acceptedBy:`actions`,name:`Pause`,id:`ActionPause`,icon:`Pause`,title:`Make a pause between actions`}}getData(){return e.getStaticData()}},FA=class e extends ${constructor(t){super(t,e.getStaticData())}static compile(e){let t=(e.func||``).split(` +`).map(e=>` ${e}`);return t.unshift(`\t\t_sendToFrontEnd(${e._id}, {func: 'executed'});`),t.unshift(`// user function`),t.join(` +`)}renderDebug(){return V.t(`Function: executed`)}getSummary(){let{func:e}=this.state.settings,t=String(e||``).split(` +`).map(e=>e.trim()).filter(Boolean);return t.length?{title:t.length>1?`${t[0]} …`:t[0]}:null}onTagChange(e){this.setState({inputs:[{nameRender:`renderModalInput`,attr:`func`,noTextEdit:!0,defaultValue:`console.log("Test")`,nameBlock:`Function`}]},()=>super.onTagChange(e))}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 e.getStaticData()}};G();var IA=class e extends ${constructor(t){super(t,e.getStaticData())}isAllTriggersOnState(){var e,t;return!!((e=this.props.userRules)!=null&&(e=e.triggers)!=null&&e.find(e=>e.id===`TriggerState`))&&!((t=this.props.userRules)!=null&&(t=t.triggers)!=null&&t.find(e=>e.id!==`TriggerState`))}static compile(e,t){let n=e.value;e.useTrigger?n=e.toggle?`!obj.state.val`:`obj.state.val`:(n??=``,typeof e.value==`string`&&parseFloat(e.value).toString()!==e.value&&e.value!==`true`&&e.value!==`false`&&(n=`"${n.replace(/"/g,`\\"`)}"${$.getReplacesInText(t)}`));let r;return r=e.toggle&&!e.useTrigger?`const subActionVar${e._id} = !(await getStateAsync("${e.oid}")).val`:`const subActionVar${e._id} = ${n}`,`// set delayed state ${e.oid} to ${e.toggle&&!e.useTrigger?`toggle`:n} with delay of ${e.delay}ms +\t\t${r}; +\t\t_sendToFrontEnd(${e._id}, {val: subActionVar${e._id}, ack: ${e.tagCard===`update`}}); +\t\tsetStateDelayed("${e.oid}", subActionVar${e._id}, ${e.tagCard===`update`}, ${parseInt(e.delay,10)}, ${e.clearRunning?`true`:`false`});`}renderDebug(e){var t,n;return B(`span`,{children:[V.t(`Set:`),` `,O(`span`,{className:e.data.ack?(t=this.props.classes)==null?void 0:t.valueAck:(n=this.props.classes)==null?void 0:n.valueNotAck,children:Ek(e.data.val)})]})}_setInputs(e,t){let n=this.isAllTriggersOnState();t=t===void 0?this.state.settings.toggle:t,e=e===void 0?this.state.settings.useTrigger:e;let r=``,i,{oidType:a,oidUnit:o,oidStates:s,oidMax:c,oidMin:l,oidRole:u,oidWrite:d,oidStep:f}=this.state.settings,p;a&&(a===`number`?(r=`number`,c!==void 0&&l!==void 0&&(r=`slider`)):a===`boolean`?(r=`boolean`,u&&u.includes(`button`)&&d&&(r=`button`)):(r=``,u&&u.includes(`color`)&&(r=`color`)),s&&(i=Object.keys(s).map(e=>({value:e,title:s[e]})),r=`select`));let m;if(n&&e)m=[{backText:`use trigger value`,nameRender:`renderCheckbox`,attr:`useTrigger`,defaultValue:!1}],r===`boolean`&&m.push({backText:`toggle value`,attr:`toggle`,nameRender:`renderCheckbox`,defaultValue:!1});else{switch(r){case`number`:m=[{backText:o||``,frontText:`with`,nameRender:`renderNumber`,defaultValue:c===void 0?0:c,attr:`value`}],this.state.settings.value!==void 0&&isNaN(parseFloat(this.state.settings.value))&&(p={value:c===void 0?0:c});break;case`slider`:{m=[{nameRender:`renderSlider`,defaultValue:c,min:l,max:c,unit:o,step:f,attr:`value`}];let e=parseFloat(this.state.settings.value);this.state.settings.value!==void 0&&(isNaN(e)||ec)&&(p={value:c});break}case`select`:m=[{nameRender:`renderSelect`,frontText:`with`,options:i,defaultValue:(i==null?void 0:i[0].value)||``,attr:`value`}],this.state.settings.value!==void 0&&!(i!=null&&i.find(e=>e.value===this.state.settings.value))&&(p={value:(i==null?void 0:i[0].value)||``});break;case`boolean`:m=[{backText:`toggle value`,attr:`toggle`,nameRender:`renderCheckbox`,defaultValue:!1}],t||m.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&&(p={value:!1});break;case`button`:m=[{nameRender:`renderButton`,defaultValue:!0,attr:`value`}],this.state.settings.value!==void 0&&this.state.settings.value!==!0&&(p={value:!0});break;case`color`:m=[{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`))&&(p={value:`#FFFFFF`});break;default:m=[{backText:o||``,frontText:`with`,nameRender:`renderText`,defaultValue:``,attr:`value`}]}n&&m.unshift({backText:`use trigger value`,nameRender:`renderCheckbox`,attr:`useTrigger`})}return m.push({backText:`ms`,frontText:`Delay`,nameRender:`renderNumber`,defaultValue:1e3,noHelperText:!0,attr:`delay`}),m.push({backText:`clear running`,nameRender:`renderCheckbox`,defaultValue:!0,attr:`clearRunning`}),{inputs:m,newSettings:p}}onTagChange(e,t,n,r,i){i=i===void 0?this.state.settings.useTrigger:i;let{inputs:a,newSettings:o}=this._setInputs(i,r);a.unshift({nameRender:`renderObjectID`,attr:`oid`,defaultValue:``,checkReadOnly:!0}),this.setState({inputs:a},()=>super.onTagChange(null,()=>{if(o){let e=JSON.parse(JSON.stringify(this.state.settings));Object.assign(e,o),this.setState(e),this.props.onChange(e)}}))}onValueChanged(e,t){this.onTagChange(void 0,void 0,void 0,t===`toggle`?e:void 0,t===`useTrigger`?e:void 0)}onUpdate(){this.onTagChange()}getSummary(){let{oid:e,value:t,toggle:n,useTrigger:r,tagCard:i,delay:a}=this.state.settings;if(!e)return null;let o=this.objectName(e),s;s=r?V.t(`Trigger value`):n?V.t(`toggle`):t===void 0||t===``?`…`:String(t);let c=[];return i&&c.push(V.t(i)),a&&c.push(`${a} ms`),{kicker:c.length?c.join(` · `):void 0,title:`${o||e} ← ${s}`,subtitle:o?e:void 0}}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 e.getStaticData()}};G();var LA=[nA,Qk,aA,oA,sA,lA,dA,fA,mA,_A,yA,bA,SA,CA,OA,kA,AA,wA,EA,jA,MA,NA,TA,PA,FA,IA,class e extends ${constructor(t){super(t,e.getStaticData())}isAllTriggersOnState(){var e,t;return!!((e=this.props.userRules)!=null&&(e=e.triggers)!=null&&e.find(e=>e.id===`TriggerState`))&&!((t=this.props.userRules)!=null&&(t=t.triggers)!=null&&t.find(e=>e.id!==`TriggerState`))}static compile(e){let t=`const val2_${e._id} = (await getStateAsync("${e.oid1}")).val;`,n=`const val1_${e._id} = (await getStateAsync("${e.oid2}")).val;`;return`// ${e.oid1} ${e.operation} ${e.oid2} => ${e.oidResult} +\t\t ${t} +\t\t ${n} +\t\t_sendToFrontEnd(${e._id}, {val: val1_${e._id} ${e.operation} val2_${e._id}, ack: ${e.tagCard===`update`}}); +\t\tawait setStateAsync("${e.oidResult}", val1_${e._id} ${e.operation} val2_${e._id}, ${e.tagCard===`update`});`}renderDebug(e){var t,n;return B(`span`,{children:[V.t(`Set:`),` `,O(`span`,{className:e.data.ack?(t=this.props.classes)==null?void 0:t.valueAck:(n=this.props.classes)==null?void 0:n.valueNotAck,children:Ek(e.data.val)})]})}getSummary(){let{oid1:e,oid2:t,operation:n,oidResult:r,tagCard:i}=this.state.settings;if(!e||!t||!r)return null;let a=this.objectName(e)||e,o=this.objectName(t)||t,s=this.objectName(r)||r;return{kicker:i?V.t(i):void 0,title:`${s} ← ${a} ${n||`+`} ${o}`,subtitle:r}}onTagChange(){let e=[];e.push({nameRender:`renderObjectID`,title:`ID1`,attr:`oid1`,defaultValue:``,checkReadOnly:!1}),e.push({nameRender:`renderSelect`,options:[{value:`+`,title:`+`},{value:`-`,title:`-`},{value:`*`,title:`*`},{value:`/`,title:`/`}],doNotTranslate:!0,defaultValue:`+`,attr:`operation`}),e.push({nameRender:`renderObjectID`,title:`ID2`,attr:`oid2`,defaultValue:``,checkReadOnly:!1}),e.push({nameRender:`renderNameText`,defaultValue:`store in`,attr:`textEqual`}),e.push({nameRender:`renderObjectID`,attr:`oidResult`,defaultValue:``,checkReadOnly:!0}),this.setState({inputs:e},()=>super.onTagChange(null,()=>{let e=JSON.parse(JSON.stringify(this.state.settings));this.props.onChange(e)}))}onValueChanged(e,t){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 e.getStaticData()}}];G();var RA={sayit:Ok,pushover:kk,"whatsapp-cmb":Ak,pushsafer:jk},zA=Ie({blocks:null,socket:null,onUpdate:!1,setOnUpdate:e=>{},setOnDebugMessage:e=>{},onDebugMessage:[],enableSimulation:!1,setEnableSimulation:e=>{},changedScripts:{},setChangedScripts:e=>{}}),BA=({children:e,socket:t})=>{let[n,r]=ze(null),[o,s]=ze(!1),[c,l]=ze([]),[u,d]=ze(!1),[f,p]=ze({});return yt(()=>{o&&s(!1)},[o]),yt(()=>{(async()=>{let e=await t.getAdapterInstances(),n=Object.keys(RA).filter(t=>e.find(e=>{var n;return(e==null||(n=e.common)==null?void 0:n.name)===t})),o=[],s=e.filter(e=>e.common.javascriptRules),c=[];for(let e of s){if(c.includes(e.common.name)||!e.common.javascriptRules)continue;let t;if(t=e.common.javascriptRules.url.startsWith(`http:`)||e.common.javascriptRules.url.startsWith(`https:`)?e.common.javascriptRules.url:e.common.javascriptRules.url.startsWith(`./`)?`${window.location.protocol}//${window.location.host}${e.common.javascriptRules.url.replace(/^\./,``)}`:`${window.location.protocol}//${window.location.host}/adapter/${e.common.name}/${e.common.javascriptRules.url}`,e.common.javascriptRules.i18n===!0){let e=t.lastIndexOf(`/`),n;n=e===-1?t:t.substring(0,e);let r=V.getLanguage(),i=`${n}/i18n/${r}.json`;await fetch(i).then(e=>e.json()).then(e=>V.extendTranslations(e,r)).catch(e=>{if(r!==`en`)return fetch(`${n}/i18n/en.json`).then(e=>e.json()).then(e=>V.extendTranslations(e,r)).catch(e=>console.error(`Cannot load i18n "${i}": ${e}`));console.log(`Cannot load i18n "${i}": ${e}`)})}else if(e.common.javascriptRules.i18n&&typeof e.common.javascriptRules.i18n==`object`)try{V.extendTranslations(e.common.javascriptRules.i18n)}catch(t){console.error(`Cannot import i18n for "${e.common.javascriptRules.name}": ${t}`)}try{a([{name:e.common.javascriptRules.name,entry:t,type:e.common.javascriptRules.type}]);let n=(await i(`${e.common.javascriptRules.name}/${e.common.javascriptRules.name}`)).default;n&&(o.push(n),c.push(e.common.name),RA[e.common.name]=null)}catch(t){console.error(`Cannot load component "${e.common.javascriptRules.name}": ${t}`)}}let l=n.filter(e=>RA[e]).map(e=>RA[e]);r([...LA,...l,...o])})()},[]),O(zA.Provider,{value:{blocks:n,socket:t,onUpdate:o,setOnUpdate:s,onDebugMessage:c,setOnDebugMessage:l,enableSimulation:u,setEnableSimulation:d,changedScripts:f,setChangedScripts:p},children:e})},VA={"%s not found":`%s not found`,"()":`()`,"(at %s)":`(at %s)`,"(optional)":`(optional)`,"-":`-`,".":`.`,Ack:`Acknowledged`,Actions:`Actions`,"Actual time of day":`Actual time of day`,Add:`Add`,"Add new script":`Add new script`,All:`All`,"All files will be accepted":`All files will be accepted`,Any:`Any`,"Any month":`Any month`,Apply:`Apply`,April:`April`,"Are you sure?":`Are you sure?`,Ask:`Ask`,Astronomical:`Astronomical`,"Astronomical events today":`Astronomical events today`,August:`August`,"Blockly description":`Creating rules by graphic blocks`,"Body:":`Body:`,Cancel:`Cancel`,"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:`Close`,"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:`Condition`,Conditions:`Conditions`,"Configuration not saved.":`Configuration not saved.`,Console:`Console`,"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:`Copied`,"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`,"Cron expression":`Cron expression`,"Dark Theme":`Dark theme`,"Dark style":`Dark style`,Date:`Date`,"Day of month":`Day of month`,"Day of week":`Day of week`,"Debug instance":`Debug instance`,"Debug options":`Debug options`,December:`December`,Default:`Default`,"Define cron...":`Define cron...`,"Define schedule...":`Define schedule...`,Delay:`Delay`,Delete:`Delete`,"Delete %s":`Delete %s...`,"Delete folder":`Delete folder`,"Delete script":`Delete script`,Description:`Description`,"Deselect all":`Deselect all`,"Discard changes for %s":`Discard changes for %s`,Done:`Done`,"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`,Error:`Error`,"Error formatting code":`Error formatting code`,"Error was found":`Error was found`,"Every day":`Every day`,Exec:`Exec shell`,"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:`Explanation`,Export:`Export`,"Export all scripts":`Export all scripts`,"Export blocks":`Export blocks`,"Export selected blocks":`Export selected blocks`,Februar:`Februar`,February:`February`,Filter:`Filter`,Folder:`Folder`,Fr:`Fr`,Friday:`Friday`,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`,Hour:`Hour`,ID:`ID`,ID1:`ID1`,ID2:`ID2`,Import:`Import`,"Import blocks":`Import blocks`,"Import error":`Import error`,"Import scripts":`Import scripts`,"Insert object ID":`Insert object ID`,Instance:`Instance`,"Instance is disabled":`Instance is disabled`,"Instance:":`Instance:`,Instances:`Instances`,Instructions:`Instructions`,"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:`Januar`,January:`January`,July:`July`,June:`June`,"Just check":`Just check`,"Keep my changes":`Keep my changes`,"Language:":`Language:`,"Learn More":`Learn More`,"Light style":`Light style`,Limit:`Limit`,"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:`March`,"March ":`March `,May:`May`,Menu:`Menu`,Message:`Message`,Minute:`Minute`,Mo:`Mo`,Model:`Model`,Monday:`Monday`,Month:`Month`,More:`More`,Name:`Name`,"No active host found":`No active host found`,"Nothing found":`Nothing found`,November:`November`,OK:`OK`,October:`October`,Ok:`Ok`,"On condition change":`On condition result change`,"On script save or adapter start":`On script save or adapter start`,"On weekdays":`On weekdays`,"Operate two states":`Operate two states`,"Operations with two states":`Operations with two states`,"Paste your blocks here":`Paste your blocks here`,Pause:`Pause`,"Pause execution":`Pause execution`,"Pause script":`Pause script`,"Phone:":`Phone:`,"Please select object ID...":`Please select object ID...`,"Prettify the script":`Prettify the script`,"Print some text in log":`Print some text in log`,"Priority:":`Priority:`,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`,Restart:`Restart`,Result:`Result`,"Resume execution":`Resume execution`,"Root folder":`Root folder`,"Rules description":`Create rules with IF, THEN, ELSE blocks`,"Run script":`Run script`,Sa:`Sa`,Saturday:`Saturday`,Save:`Save`,"Save all":`Save all`,"Say It":`Say It`,"Say some text via sayit adapter":`Say some text via sayit adapter`,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...`,Second:`Second`,"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:`September`,"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 ioBroker state value":`Show ioBroker state value`,"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:`Simulate`,"Some files will be rejected":`Some files will be rejected`,"Sound:":`Sound:`,Stack:`Stack`,Start:`Start`,"Start script":`Start script`,State:`State`,"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:`Su`,"Subject:":`Subject:`,Sunday:`Sunday`,"TS description":`Creating rules by writing Typescript`,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`,Time:`Time`,"Time condition":`Time condition`,"Title:":`Title:`,"To:":`To:`,"Trigger with value":`Trigger with value`,Triggered:`Triggered`,Triggers:`Triggers`,"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:`Tu`,Tuesday:`Tuesday`,URL:`URL`,"Unknown error":`Unknown error`,"Unknown error!":`Unknown error!`,"User function":`User function`,"User:":`User:`,Value:`Value`,"Vibration:":`Vibration:`,Volume:`Volume`,We:`We`,Wednesday:`Wednesday`,"Whatsapp-cmb":`Whatsapp-cmb`,Write:`Write`,"Write your own code":`Write your own code`,Year:`Year`,Yes:`Yes`,"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`,"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:`acknowledgment`,all:`all`,and:`and`,"as JSON":`as JSON`,"as plain text":`as plain text`,astro:`Astro`,at:`at`,"clear running":`clear running`,control:`control`,copy:`copy`,cron:`CRON`,dawn:`Dawn`,debug_help:`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.`,debug_label:`Debug`,default:`default`,dusk:`Dusk`,easy:`easy`,else:`else`,"equal to":`equal to`,every:`every`,"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:`Function`,filter_id:`ID`,filter_name:`Name`,filter_role:`Role`,filter_room:`Room`,"for edit or create script":`for edit or create a new script`,"for professionals":`for professionals`,"for programmers":`for programmers`,goldenHour:`Golden hour`,goldenHourEnd:`End of golden hour`,"greater or equal":`greater or equal`,"greater or equal to":`greater or equal to`,"greater than":`greater than`,help_just_check:`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.`,help_on_change:`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.`,"high priority":`high priority`,"high-priority":`high-priority`,"highest priority":`highest priority`,hours:`hours`,includes:`includes`,interval:`interval`,"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:`magic`,milliseconds:`milliseconds`,minutes:`minutes`,ms:`ms`,nadir:`Nadir`,nauticalDawn:`Nautical dawn`,nauticalDusk:`Nautical dusk`,nextSunrise:`Next Sunrise`,nextSunset:`Next sunset`,night:`Night`,nightEnd:`Night end`,"no blocks found":`No blocks found`,"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`,"on change":`on change`,"on condition change":`on condition change`,"on update":`on update`,one:`one`,or:`or`,quiet:`quiet`,"reset search":`reset search`,search:`search`,seconds:`seconds`,solarNoon:`Solar noon`,"store in":`store in`,sunrise:`sunrise`,sunriseEnd:`Sunrise end`,sunset:`Sunset`,sunsetStart:`Sunset start`,then:`then`,"toggle value":`toggle value`,tooltip_ack:`Acknowledge`,tooltip_from:`From`,tooltip_lc:`Last changed`,tooltip_quality:`Quality`,tooltip_ts:`Timestamp`,tooltip_user:`User`,tooltip_value:`Value`,true:`true`,two:`two`,undefined:`undefined`,update:`update`,"use seconds":`use seconds`,"use trigger value":`use trigger value`,verbose_help:`Adds debug output to the log for many system commands`,verbose_label:`Verbose log outputs`,when:`when`,with:`with`,"with date":`with date`,"with offset":`with offset`,wizard:`Wizard`,"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:`Retry`,"No running javascript instance found":`No running javascript instance found`,"OID display mode":`OID display mode`,"AI Chat":`AI Chat`,"AI inline completions":`AI inline completions`,"New chat":`New chat`,"Ask about your script...":`Ask about your script...`,"Insert blocks":`Insert blocks`,"Apply blocks":`Apply blocks`,Undo:`Undo`,Redo:`Redo`,"Insert into editor":`Insert into editor`,"Show as diff":`Show as diff`,"Selected code as context":`Selected code as context`,"Ask questions about your script, request changes, or generate new code.":`Ask questions about your script, request changes, or generate new code.`,"to send":`to send`,"Thinking...":`Thinking...`,"AI suggested changes":`AI suggested changes`,Accept:`Accept`,Reject:`Reject`,"No API keys configured":`No API keys configured`,"for new line":`for new line`,"AI chat mode":`AI chat mode`,"Plain conversation. Use for questions, explanations, syntax help. Does not read or modify your scripts.":`Plain conversation. Use for questions, explanations, syntax help. Does not read or modify your scripts.`,'For larger models with tool support. The AI can read, create, and edit scripts, look up datapoints, and browse the object tree — useful for "create a script that...", "which scripts use this state?" or "analyze my light script".':`For larger models with tool support. The AI can read, create, and edit scripts, look up datapoints, and browse the object tree — useful for "create a script that...", "which scripts use this state?" or "analyze my light script".`,'For smaller models without tool support. Two-step script generator (plan then code) — useful for "create a script that..." or "write a Blockly rule for...". Output goes into the editor for smart-apply.':`For smaller models without tool support. Two-step script generator (plan then code) — useful for "create a script that..." or "write a Blockly rule for...". Output goes into the editor for smart-apply.`,"Plain conversation. Best for: general questions, syntax help, concept explanations.":`Plain conversation. Best for: general questions, syntax help, concept explanations.`,"For larger models with tool support. Best for: creating, editing, or analyzing scripts; finding datapoint usages; inspecting the object tree.":`For larger models with tool support. Best for: creating, editing, or analyzing scripts; finding datapoint usages; inspecting the object tree.`,"For smaller models without tool support. Best for: creating new JavaScript/TypeScript or Blockly scripts from a description.":`For smaller models without tool support. Best for: creating new JavaScript/TypeScript or Blockly scripts from a description.`,"Mention scripts as context for the AI. Use @all for all scripts or @scriptName for a specific one.":`Mention scripts as context for the AI. Use @all for all scripts or @scriptName for a specific one.`,Context:`Context`,"current script":`current script`,"all scripts":`all scripts`,devices:`devices`,"Searching datapoints":`Searching datapoints`,"Reading value":`Reading value`,"Loading object info":`Loading object info`,"Searching scripts":`Searching scripts`,"Reading script":`Reading script`,"Loading script list":`Loading script list`,"All scripts":`All scripts`,"Smart home devices":`Smart home devices`,"Generating plan...":`Generating plan...`,"Generating code...":`Generating code...`,Plan:`Plan`,"mention @all":`@all`,"mention @devices":`@devices`,Send:`Send`,Copy:`Copy`,"AI inline chat":`AI inline chat`,'e.g. "Refactor this to use async/await"':`e.g. "Refactor this to use async/await"`,"Open in chat":`Open in chat`,"Selection: %s line(s)":`Selection: %s line(s)`,"No selection — the question will use context from the whole script.":`No selection — the question will use context from the whole script.`,"Please enter a question.":`Please enter a question.`,"Thinking…":`Thinking…`,"Code proposal — press Apply to replace your selection.":`Code proposal — press Apply to replace your selection.`,"Plain text answer.":`Plain text answer.`,"Show more details":`Show more details`,"AI: Inline chat…":`AI: Inline chat…`,"AI: Explain":`AI: Explain`,"AI: Refactor":`AI: Refactor`,"AI: Add comments":`AI: Add comments`,"AI: Fix problem":`AI: Fix problem`,"AI: Suggest tests":`AI: Suggest tests`,"Ask the AI about the selected code:":`Ask the AI about the selected code:`,Explain:`Explain`,Refactor:`Refactor`,Tests:`Tests`,"Explain %s %s":`Explain %s %s`,"Refactor %s %s":`Refactor %s %s`,"Suggest tests for %s %s":`Suggest tests for %s %s`,"Apply changes":`Apply changes`,"Discard changes":`Discard changes`,'Ask anything, or request a change (e.g. "what does this do?")':`Ask anything, or request a change (e.g. "what does this do?")`,Wizard:`Wizard`,"Create a rule step by step":`Create a rule step by step`,Summary:`Summary`,Back:`Back`,Next:`Next`,Skip:`Skip`,"Create rule":`Create rule`,"Replace rule":`Replace rule`,"The current rule will be replaced":`The current rule will be replaced`,"Add another":`Add another`,"Without a condition the rule always runs":`Without a condition the rule always runs`,"What should start the rule?":`What should start the rule?`,"When should the rule run? This step is optional.":`When should the rule run? This step is optional.`,"What should happen?":`What should happen?`,"Block not found":`Block not found`,Weekday:`Weekday`,"Let the rule run only on the selected days of the week":`Let the rule run only on the selected days of the week`,"Send to adapter":`Send to adapter`,"Sends a message to any adapter instance":`Sends a message to any adapter instance`,"Command:":`Command:`,"JSON:":`JSON:`,"Sent:":`Sent:`,"User condition":`User condition`,"Write your own condition":`Write your own condition`,"This is an advanced option. The code is the body of a function and must return the result, e.g. \"return getState('javascript.0.variable').val > 5;\". You may use await inside.":`This is an advanced option. The code is the body of a function and must return the result, e.g. "return getState('javascript.0.variable').val > 5;". You may use await inside.`,"On message":`On message`,"Triggers the rule when another script or adapter sends a message":`Triggers the rule when another script or adapter sends a message`,"Send the message from a script with messageTo({instance: 'javascript.0'}, 'myMessage', data). The sent data is available in the texts of the actions as %s.":`Send the message from a script with messageTo({instance: 'javascript.0'}, 'myMessage', data). The sent data is available in the texts of the actions as %s.`,"Message name:":`Message name:`,"Received:":`Received:`,Notification:`Notification`,"Creates an ioBroker notification, which is shown in the admin":`Creates an ioBroker notification, which is shown in the admin`,"Notification text":`Notification text`,"as alert":`as alert`,Alert:`Alert`,"Registered:":`Registered:`,"Toggle between two values":`Toggle between two values`,"Switches a state back and forth between two values":`Switches a state back and forth between two values`,'If the state does not hold the first value, the first one is written - so the rule always ends up on a defined value. To invert a boolean, use the "toggle value" checkbox of the "Set state action" instead.':`If the state does not hold the first value, the first one is written - so the rule always ends up on a defined value. To invert a boolean, use the "toggle value" checkbox of the "Set state action" instead.`,between:`between`,"Toggled:":`Toggled:`,"On file change":`On file change`,"Triggers the rule when a file of an object is written or deleted":`Triggers the rule when a file of an object is written or deleted`,'Both fields may contain *, e.g. the object "vis.0" and the file name "main/*". In the texts of the actions %s is the name of the changed file and %id the object it belongs to. Requires js-controller 4.1 or newer.':`Both fields may contain *, e.g. the object "vis.0" and the file name "main/*". In the texts of the actions %s is the name of the changed file and %id the object it belongs to. Requires js-controller 4.1 or newer.`,"Files of:":`Files of:`,"File name:":`File name:`,"File changed:":`File changed:`,"Deleted:":`Deleted:`,File:`File`,"On object change":`On object change`,"Triggers the rule when an object is created, changed or deleted":`Triggers the rule when an object is created, changed or deleted`,'This reacts to the object itself, not to its value - use the "State" trigger for values. The pattern may contain *, e.g. "hm-rpc.0.*". In the texts of the actions %s and %id are the id of the changed object.':`This reacts to the object itself, not to its value - use the "State" trigger for values. The pattern may contain *, e.g. "hm-rpc.0.*". In the texts of the actions %s and %id are the id of the changed object.`,"Object ID:":`Object ID:`,"React on:":`React on:`,"any change":`any change`,"created or changed":`created or changed`,deleted:`deleted`,"Object changed:":`Object changed:`,"Object deleted:":`Object deleted:`,"On log message":`On log message`,"Triggers the rule when something is written to the ioBroker log":`Triggers the rule when something is written to the ioBroker log`,'Leave "Contains" empty to react to every entry of that level. Fill it in if an action of this rule writes to the log itself - a rule that matches its own message can trigger itself. In the texts of the actions %s is the log message and %id the instance it came from.':`Leave "Contains" empty to react to every entry of that level. Fill it in if an action of this rule writes to the log itself - a rule that matches its own message can trigger itself. In the texts of the actions %s is the log message and %id the instance it came from.`,"Level:":`Level:`,"Contains:":`Contains:`,error:`error`,warn:`warn`,info:`info`,debug:`debug`,silly:`silly`,"any level":`any level`,"Logged:":`Logged:`,"Log contains":`Log contains`,"Every log entry":`Every log entry`,"On rule stop":`On rule stop`,"Runs the rule once more when it is stopped, saved or the adapter shuts down":`Runs the rule once more when it is stopped, saved or the adapter shuts down`,"The adapter waits for the actions, but only for the time set here - what does not fit is cut off. A rule can have only one block of this kind; a second one replaces the first.":`The adapter waits for the actions, but only for the time set here - what does not fit is cut off. A rule can have only one block of this kind; a second one replaces the first.`,"Wait at most:":`Wait at most:`,"HTTP error:":`HTTP error:`,"On enum member change":`On enum member change`,"Triggers the rule when any state of a room or function changes":`Triggers the rule when any state of a room or function changes`,"Subscribes to every state of the selected enum and follows it: a device added to that room later is included without changing the rule. In the texts of the actions %s is the new value and %id the state that changed.":`Subscribes to every state of the selected enum and follows it: a device added to that room later is included without changing the rule. In the texts of the actions %s is the new value and %id the state that changed.`,"Members of:":`Members of:`,"Any member of":`Any member of`,"Send message":`Send message`,"Sends a message to other scripts and rules":`Sends a message to other scripts and rules`,'Every rule with an "On message" trigger of the same name receives it, as does a script with onMessage(). You can use %s in the text to send the current trigger value or %id the triggered object ID.':`Every rule with an "On message" trigger of the same name receives it, as does a script with onMessage(). You can use %s in the text to send the current trigger value or %id the triggered object ID.`,"Set state if changed":`Set state if changed`,"Writes a state only if its value differs from the current one":`Writes a state only if its value differs from the current one`,'Use this instead of "Set state action" for rules that run often: an unchanged value is not written at all, so nothing subscribed to that state is woken up for nothing.':`Use this instead of "Set state action" for rules that run often: an unchanged value is not written at all, so nothing subscribed to that state is woken up for nothing.`,"only if changed":`only if changed`,"A block failed while generating the script, so the changes cannot be saved":`A block failed while generating the script, so the changes cannot be saved`,"Blockly error":`Blockly error`,"Export error":`Export error`},HA={"%s not found":`%s nicht gefunden`,"()":`()`,"(at %s)":`(um %s)`,"(optional)":`(optional)`,"-":`-`,".":`.`,Ack:`Bestätigt`,Actions:`Aktionen`,"Actual time of day":`Tatsächliche Tageszeit`,Add:`Hinzufügen`,"Add new script":`Neues Skript hinzufügen`,All:`Alle`,"All files will be accepted":`Alle Dateien werden akzeptiert`,Any:`Egal`,"Any month":`Jeden Monat`,Apply:`Anwenden`,April:`April`,"Are you sure?":`Wirklich sicher?`,Ask:`Fragen`,Astronomical:`Astronomisch`,"Astronomical events today":`Astronomische Ereignisse heute`,August:`August`,"Blockly description":`Erstellen von Regeln durch Grafikblöcke`,"Body:":`Körper:`,Cancel:`Abbrechen`,"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:`Schließen`,"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:`Bedingung`,Conditions:`Bedingungen`,"Configuration not saved.":`Die Konfiguration ist nicht gespeichert.`,Console:`Konsole`,"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:`Kopiert`,"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`,"Cron expression":`Cron-Ausdruck`,"Dark Theme":`Dunkles Thema`,"Dark style":`Dunkler Stil`,Date:`Datum`,"Day of month":`Tag (des Monats)`,"Day of week":`Wochentag`,"Debug instance":`Debug-Instanz`,"Debug options":`Debug-Optionen`,December:`Dezember`,Default:`Standard`,"Define cron...":`Cron definieren ...`,"Define schedule...":`Zeitplan definieren ...`,Delay:`Verzögerung`,Delete:`Löschen`,"Delete %s":`Löschen %s...`,"Delete folder":`Ordner löschen`,"Delete script":`Skript löschen`,Description:`Beschreibung`,"Deselect all":`Alles abwählen`,"Discard changes for %s":`Änderungen für %s verwerfen`,Done:`Fertig`,"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`,Error:`Fehler`,"Error formatting code":`Fehler beim Formatieren des Codes`,"Error was found":`Fehler wurde gefunden`,"Every day":`Täglich`,Exec:`Exec shell`,"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:`Erläuterung`,Export:`Export`,"Export all scripts":`Alle Skripte exportieren`,"Export blocks":`Blöcke exportieren`,"Export selected blocks":`Ausgewählte Blöcke exportieren`,Februar:`Februar`,February:`Februar`,Filter:`Filter`,Folder:`Ordner`,Fr:`Fr`,Friday:`Freitag`,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`,Hour:`Stunde`,ID:`ID`,ID1:`ID1`,ID2:`ID2`,Import:`Import`,"Import blocks":`Blöcke importieren`,"Import error":`Fehler beim Importieren`,"Import scripts":`Skripte importieren`,"Insert object ID":`Objekt-ID einfügen`,Instance:`Instanz`,"Instance is disabled":`Instanz ist deaktiviert`,"Instance:":`Instanz:`,Instances:`Instanzen`,Instructions:`Anleitung`,"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:`Januar`,January:`Januar`,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`,Limit:`Grenze`,"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:`März`,"March ":`März `,May:`Mai`,Menu:`Menü`,Message:`Nachricht`,Minute:`Minute`,Mo:`Mo`,Model:`Modell`,Monday:`Montag`,Month:`Monat`,More:`Mehr`,Name:`Name`,"No active host found":`Kein aktiver Host gefunden`,"Nothing found":`Nichts gefunden`,November:`November`,OK:`OK`,October:`Oktober`,Ok:`Ok`,"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`,"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:`Pause`,"Pause execution":`Ausführung pausieren`,"Pause script":`Skript anhalten`,"Phone:":`Telefon:`,"Please select object ID...":`Objekt-ID auswählen ...`,"Prettify the script":`Verschönern Sie das Skript`,"Print some text in log":`Einen Text im Protokoll ausdrucken`,"Priority:":`Priorität:`,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`,Restart:`Neustart`,Result:`Ergebnis`,"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:`Sa`,Saturday:`Samstag`,Save:`Speichern`,"Save all":`Alle speichern`,"Say It":`Say It`,"Say some text via sayit adapter":`Einen Text über den Sayit-Adapter sagen`,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...`,Second:`Sekunde`,"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:`September`,"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 ioBroker state value":`ioBroker-Statuswert anzeigen`,"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:`Simulieren`,"Some files will be rejected":`Einige Dateien werden abgelehnt`,"Sound:":`Klang:`,Stack:`Stack`,Start:`Start`,"Start script":`Skript starten`,State:`Zustand`,"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:`So`,"Subject:":`Gegenstand:`,Sunday:`Sonntag`,"TS description":`Regeln erstellen mit TypeScript`,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`,Time:`Zeit`,"Time condition":`Zeitbedingung`,"Title:":`Titel:`,"To:":`Zu:`,"Trigger with value":`Trigger mit Wert`,Triggered:`Ausgelöst`,Triggers:`Löst aus`,"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:`Di`,Tuesday:`Dienstag`,URL:`URL`,"Unknown error":`Unbekannter Fehler`,"Unknown error!":`Unbekannter Fehler!`,"User function":`Benutzerfunktion`,"User:":`Benutzer:`,Value:`Wert`,"Vibration:":`Vibration:`,Volume:`Volumen`,We:`Mi`,Wednesday:`Mittwoch`,"Whatsapp-cmb":`WhatsApp-cmb`,Write:`Schreiben`,"Write your own code":`Eigenen Code schreiben`,Year:`Jahr`,Yes:`Ja`,"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`,"Please select a valid model":`Bitte ein gültiges Modell auswählen`,"[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:`Wissen`,all:`alle`,and:`und`,"as JSON":`als JSON`,"as plain text":`als Klartext`,astro:`Astro`,at:`um`,"clear running":`laufende abbrechen`,control:`Steuerung`,copy:`Kopie`,cron:`CRON`,dawn:`Morgendämmerung`,debug_help:`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.`,debug_label:`Debuggen`,default:`Standard`,dusk:`Abenddämmerung`,easy:`einfach`,else:`sonst`,"equal to":`gleich`,every:`jeder`,"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:`Funktion`,filter_id:`ID`,filter_name:`Name`,filter_role:`Rolle`,filter_room:`Raum`,"for edit or create script":`zum Bearbeiten oder zum Erstellen eines neues Skripts`,"for professionals":`für Profis`,"for programmers":`für Programmierer`,goldenHour:`Goldene Abendstunde`,goldenHourEnd:`Vormittag`,"greater or equal":`größer oder gleich`,"greater or equal to":`größer oder gleich`,"greater than":`größer als`,help_just_check:`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.`,help_on_change:`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.`,"high priority":`hohe Priorität`,"high-priority":`hohe Priorität`,"highest priority":`höchste Priorität`,hours:`Stunden`,includes:`beinhaltet`,interval:`Intervall`,"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:`Magie`,milliseconds:`Millisekunden`,minutes:`Minuten`,ms:`ms`,nadir:`Nadir`,nauticalDawn:`nautische Morgendämmerung`,nauticalDusk:`nautische Abenddämmerung`,nextSunrise:`Nächster Sonnenaufgang`,nextSunset:`Nächster Sonnenuntergang`,night:`Nacht`,nightEnd:`astronomische Morgendämmerung`,"no blocks found":`Keine Blöcke gefunden`,"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`,"on change":`bei Änderung`,"on condition change":`bei Zustandsänderung`,"on update":`beim Aktualisieren`,one:`einer`,or:`oder`,quiet:`ruhig`,"reset search":`Suche zurücksetzen`,search:`Suche`,seconds:`Sekunden`,solarNoon:`(Nach-)Mittag`,"store in":`speichern in`,sunrise:`Sonnenaufgang`,sunriseEnd:`Goldene Morgenstunde`,sunset:`Sonnenuntergang`,sunsetStart:`Sonnenuntergang (Anfang)`,then:`dann`,"toggle value":`Wert umschalten`,tooltip_ack:`Bestätigen`,tooltip_from:`Von`,tooltip_lc:`Zuletzt geändert`,tooltip_quality:`Qualität`,tooltip_ts:`Zeitstempel`,tooltip_user:`Benutzer`,tooltip_value:`Wert`,true:`wahr`,two:`zwei`,undefined:`nicht definiert`,update:`Aktualisieren`,"use seconds":`Sekunden verwenden`,"use trigger value":`Triggerwert benutzen`,verbose_help:`Fügt Debug-Ausgaben für viele Systembefehle zum Protokoll hinzu`,verbose_label:`Ausführliche Protokollausgaben`,when:`falls`,with:`mit`,"with date":`mit Datum`,"with offset":`mit Versatz`,wizard:`Assistent`,"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:`Erneut versuchen`,"No running javascript instance found":`Keine laufende JavaScript-Instanz gefunden`,"OID display mode":`OID-Anzeigemodus`,"AI Chat":`KI Chat`,"AI inline completions":`KI Inline-Vervollständigung`,"New chat":`Neuer Chat`,"Ask about your script...":`Frage zu deinem Script stellen...`,"Insert blocks":`Blöcke einfügen`,"Apply blocks":`Blöcke anwenden`,Undo:`Rückgängig`,Redo:`Wiederherstellen`,"Insert into editor":`In Editor einfügen`,"Show as diff":`Als Diff anzeigen`,"Selected code as context":`Ausgewählter Code als Kontext`,"Ask questions about your script, request changes, or generate new code.":`Stelle Fragen zu deinem Script, fordere Änderungen an oder generiere neuen Code.`,"to send":`zum Senden`,"Thinking...":`Denke nach...`,"AI suggested changes":`KI-vorgeschlagene Änderungen`,Accept:`Akzeptieren`,Reject:`Ablehnen`,"No API keys configured":`Keine API-Schlüssel konfiguriert`,"for new line":`für neue Zeile`,"AI chat mode":`KI-Chat-Modus`,"Plain conversation. Use for questions, explanations, syntax help. Does not read or modify your scripts.":`Reine Unterhaltung. Für Fragen, Erklärungen und Syntaxhilfe. Greift nicht auf deine Skripte zu und ändert sie nicht.`,'For larger models with tool support. The AI can read, create, and edit scripts, look up datapoints, and browse the object tree — useful for "create a script that...", "which scripts use this state?" or "analyze my light script".':`Für größere Modelle mit Tool-Unterstützung. Die KI kann Skripte lesen, erstellen und bearbeiten, Datenpunkte nachschlagen und den Objektbaum durchsuchen — nützlich für „Erstelle ein Skript, das …“, „Welche Skripte nutzen diesen State?“ oder „Analysiere mein Licht-Skript“.`,'For smaller models without tool support. Two-step script generator (plan then code) — useful for "create a script that..." or "write a Blockly rule for...". Output goes into the editor for smart-apply.':`Für kleinere Modelle ohne Tool-Unterstützung. Zweistufiger Skript-Generator (erst Plan, dann Code) — nützlich für „Erstelle ein Skript, das …“ oder „Schreibe eine Blockly-Regel für …“. Das Ergebnis landet im Editor und kann per Smart-Apply übernommen werden.`,"Plain conversation. Best for: general questions, syntax help, concept explanations.":`Reine Unterhaltung. Am besten für: allgemeine Fragen, Syntaxhilfe, Konzept-Erklärungen.`,"For larger models with tool support. Best for: creating, editing, or analyzing scripts; finding datapoint usages; inspecting the object tree.":`Für größere Modelle mit Tool-Unterstützung. Am besten für: Skripte erstellen, bearbeiten oder analysieren; Datenpunkt-Verwendungen finden; Objektbaum durchsuchen.`,"For smaller models without tool support. Best for: creating new JavaScript/TypeScript or Blockly scripts from a description.":`Für kleinere Modelle ohne Tool-Unterstützung. Am besten für: neue JavaScript-/TypeScript- oder Blockly-Skripte aus einer Beschreibung erzeugen.`,"Mention scripts as context for the AI. Use @all for all scripts or @scriptName for a specific one.":`Skripte als Kontext für die KI erwähnen. Nutze @alle für alle Skripte oder @Skriptname für ein bestimmtes.`,Context:`Kontext`,"current script":`aktuelles Script`,"all scripts":`alle Scripts`,devices:`Geräte`,"Searching datapoints":`Suche Datenpunkte`,"Reading value":`Lese Wert`,"Loading object info":`Lade Objekt-Info`,"Searching scripts":`Durchsuche Scripts`,"Reading script":`Lese Script`,"Loading script list":`Lade Script-Liste`,"All scripts":`Alle Scripts`,"Smart home devices":`Smart-Home-Geräte`,"Generating plan...":`Erstelle Plan...`,"Generating code...":`Generiere Code...`,Plan:`Plan`,"mention @all":`@alle`,"mention @devices":`@geräte`,Send:`Senden`,Copy:`Kopieren`,"AI inline chat":`KI-Inline-Chat`,'e.g. "Refactor this to use async/await"':`z.B. "Refaktoriere das zu async/await"`,"Open in chat":`Im Chat öffnen`,"Selection: %s line(s)":`Auswahl: %s Zeile(n)`,"No selection — the question will use context from the whole script.":`Keine Auswahl — die Frage bezieht sich auf das gesamte Skript.`,"Please enter a question.":`Bitte gib eine Frage ein.`,"Thinking…":`Denke nach…`,"Code proposal — press Apply to replace your selection.":`Code-Vorschlag — drücke Anwenden, um die Auswahl zu ersetzen.`,"Plain text answer.":`Textantwort.`,"Show more details":`Mehr Details anzeigen`,"AI: Inline chat…":`KI: Inline-Chat…`,"AI: Explain":`KI: Erklären`,"AI: Refactor":`KI: Refaktorieren`,"AI: Add comments":`KI: Kommentare hinzufügen`,"AI: Fix problem":`KI: Problem beheben`,"AI: Suggest tests":`KI: Tests vorschlagen`,"Ask the AI about the selected code:":`Frage die KI zum ausgewählten Code:`,Explain:`Erklären`,Refactor:`Refaktorieren`,Tests:`Tests`,"Explain %s %s":`%s %s erklären`,"Refactor %s %s":`%s %s refaktorieren`,"Suggest tests for %s %s":`Tests für %s %s vorschlagen`,"Apply changes":`Änderungen übernehmen`,"Discard changes":`Änderungen verwerfen`,'Ask anything, or request a change (e.g. "what does this do?")':`Frag etwas oder bitte um eine Änderung (z.B. "was macht dieser Befehl?")`,Wizard:`Assistent`,"Create a rule step by step":`Regel Schritt für Schritt erstellen`,Summary:`Übersicht`,Back:`Zurück`,Next:`Weiter`,Skip:`Überspringen`,"Create rule":`Regel erstellen`,"Replace rule":`Regel ersetzen`,"The current rule will be replaced":`Die vorhandene Regel wird ersetzt`,"Add another":`Weiteren hinzufügen`,"Without a condition the rule always runs":`Ohne Bedingung läuft die Regel immer`,"What should start the rule?":`Was soll die Regel auslösen?`,"When should the rule run? This step is optional.":`Wann soll die Regel laufen? Dieser Schritt ist optional.`,"What should happen?":`Was soll passieren?`,"Block not found":`Block nicht gefunden`,Weekday:`Wochentag`,"Let the rule run only on the selected days of the week":`Die Regel nur an den gewählten Wochentagen ausführen`,"Send to adapter":`An Adapter senden`,"Sends a message to any adapter instance":`Sendet eine Nachricht an eine beliebige Adapter-Instanz`,"Command:":`Befehl:`,"JSON:":`JSON:`,"Sent:":`Gesendet:`,"User condition":`Benutzerbedingung`,"Write your own condition":`Eigene Bedingung schreiben`,"This is an advanced option. The code is the body of a function and must return the result, e.g. \"return getState('javascript.0.variable').val > 5;\". You may use await inside.":`Dies ist eine erweiterte Option. Der Code ist der Rumpf einer Funktion und muss das Ergebnis mit return zurückgeben, z. B. "return getState('javascript.0.variable').val > 5;". await darf darin verwendet werden.`,"On message":`Bei Nachricht`,"Triggers the rule when another script or adapter sends a message":`Löst die Regel aus, wenn ein anderes Skript oder ein Adapter eine Nachricht sendet`,"Send the message from a script with messageTo({instance: 'javascript.0'}, 'myMessage', data). The sent data is available in the texts of the actions as %s.":`Sende die Nachricht aus einem Skript mit messageTo({instance: 'javascript.0'}, 'myMessage', data). Die gesendeten Daten stehen in den Texten der Aktionen als %s zur Verfügung.`,"Message name:":`Nachrichtenname:`,"Received:":`Empfangen:`,Notification:`Benachrichtigung`,"Creates an ioBroker notification, which is shown in the admin":`Erzeugt eine ioBroker-Benachrichtigung, die im Admin angezeigt wird`,"Notification text":`Benachrichtigungstext`,"as alert":`als Alarm`,Alert:`Alarm`,"Registered:":`Registriert:`,"Toggle between two values":`Zwischen zwei Werten umschalten`,"Switches a state back and forth between two values":`Schaltet einen Zustand zwischen zwei Werten hin und her`,'If the state does not hold the first value, the first one is written - so the rule always ends up on a defined value. To invert a boolean, use the "toggle value" checkbox of the "Set state action" instead.':`Hält der Zustand nicht den ersten Wert, wird der erste geschrieben - so landet die Regel immer auf einem definierten Wert. Um einen booleschen Wert zu invertieren, nutze stattdessen das Kontrollkästchen "toggle value" der Aktion "Set state action".`,between:`zwischen`,"Toggled:":`Umgeschaltet:`,"On file change":`Bei Dateiänderung`,"Triggers the rule when a file of an object is written or deleted":`Löst die Regel aus, wenn eine Datei eines Objekts geschrieben oder gelöscht wird`,'Both fields may contain *, e.g. the object "vis.0" and the file name "main/*". In the texts of the actions %s is the name of the changed file and %id the object it belongs to. Requires js-controller 4.1 or newer.':`Beide Felder dürfen * enthalten, z. B. das Objekt "vis.0" und der Dateiname "main/*". In den Texten der Aktionen ist %s der Name der geänderten Datei und %id das Objekt, zu dem sie gehört. Erfordert js-controller 4.1 oder neuer.`,"Files of:":`Dateien von:`,"File name:":`Dateiname:`,"File changed:":`Datei geändert:`,"Deleted:":`Gelöscht:`,File:`Datei`,"On object change":`Bei Objektänderung`,"Triggers the rule when an object is created, changed or deleted":`Löst die Regel aus, wenn ein Objekt angelegt, geändert oder gelöscht wird`,'This reacts to the object itself, not to its value - use the "State" trigger for values. The pattern may contain *, e.g. "hm-rpc.0.*". In the texts of the actions %s and %id are the id of the changed object.':`Reagiert auf das Objekt selbst, nicht auf seinen Wert - für Werte den Trigger "State" verwenden. Das Muster darf * enthalten, z. B. "hm-rpc.0.*". In den Texten der Aktionen sind %s und %id die ID des geänderten Objekts.`,"Object ID:":`Objekt-ID:`,"React on:":`Reagieren auf:`,"any change":`jede Änderung`,"created or changed":`angelegt oder geändert`,deleted:`gelöscht`,"Object changed:":`Objekt geändert:`,"Object deleted:":`Objekt gelöscht:`,"On log message":`Bei Log-Eintrag`,"Triggers the rule when something is written to the ioBroker log":`Löst die Regel aus, wenn etwas in das ioBroker-Log geschrieben wird`,'Leave "Contains" empty to react to every entry of that level. Fill it in if an action of this rule writes to the log itself - a rule that matches its own message can trigger itself. In the texts of the actions %s is the log message and %id the instance it came from.':`"Enthält" leer lassen, um auf jeden Eintrag dieser Stufe zu reagieren. Ausfüllen, wenn eine Aktion dieser Regel selbst ins Log schreibt - eine Regel, die auf ihre eigene Meldung passt, kann sich selbst auslösen. In den Texten der Aktionen ist %s die Log-Meldung und %id die Instanz, von der sie stammt.`,"Level:":`Stufe:`,"Contains:":`Enthält:`,error:`error`,warn:`warn`,info:`info`,debug:`debug`,silly:`silly`,"any level":`jede Stufe`,"Logged:":`Protokolliert:`,"Log contains":`Log enthält`,"Every log entry":`Jeder Log-Eintrag`,"On rule stop":`Beim Stoppen der Regel`,"Runs the rule once more when it is stopped, saved or the adapter shuts down":`Führt die Regel noch einmal aus, wenn sie gestoppt oder gespeichert wird oder der Adapter herunterfährt`,"The adapter waits for the actions, but only for the time set here - what does not fit is cut off. A rule can have only one block of this kind; a second one replaces the first.":`Der Adapter wartet auf die Aktionen, aber nur die hier eingestellte Zeit - was nicht hineinpasst, wird abgeschnitten. Eine Regel kann nur einen Block dieser Art haben; ein zweiter ersetzt den ersten.`,"Wait at most:":`Höchstens warten:`,"HTTP error:":`HTTP-Fehler:`,"On enum member change":`Bei Änderung im Raum oder Gewerk`,"Triggers the rule when any state of a room or function changes":`Löst die Regel aus, wenn sich irgendein Zustand eines Raums oder Gewerks ändert`,"Subscribes to every state of the selected enum and follows it: a device added to that room later is included without changing the rule. In the texts of the actions %s is the new value and %id the state that changed.":`Abonniert jeden Zustand des gewählten Enums und folgt ihm: ein später hinzugefügtes Gerät ist ohne Änderung der Regel dabei. In den Texten der Aktionen ist %s der neue Wert und %id der Zustand, der sich geändert hat.`,"Members of:":`Mitglieder von:`,"Any member of":`Beliebiges Mitglied von`,"Send message":`Nachricht senden`,"Sends a message to other scripts and rules":`Sendet eine Nachricht an andere Skripte und Regeln`,'Every rule with an "On message" trigger of the same name receives it, as does a script with onMessage(). You can use %s in the text to send the current trigger value or %id the triggered object ID.':`Jede Regel mit einem Trigger "Bei Nachricht" desselben Namens empfängt sie, ebenso ein Skript mit onMessage(). Mit %s im Text sendest du den aktuellen Trigger-Wert, mit %id die ausgelöste Objekt-ID.`,"Set state if changed":`Zustand nur bei Änderung setzen`,"Writes a state only if its value differs from the current one":`Schreibt einen Zustand nur, wenn sich sein Wert vom aktuellen unterscheidet`,'Use this instead of "Set state action" for rules that run often: an unchanged value is not written at all, so nothing subscribed to that state is woken up for nothing.':`Für häufig laufende Regeln statt "Zustand setzen" verwenden: ein unveränderter Wert wird gar nicht geschrieben, also wird auch nichts, was diesen Zustand abonniert hat, umsonst geweckt.`,"only if changed":`nur bei Änderung`,"A block failed while generating the script, so the changes cannot be saved":`Ein Block hat beim Erzeugen des Skripts einen Fehler verursacht, die Änderungen können nicht gespeichert werden`,"Blockly error":`Blockly-Fehler`,"Export error":`Exportfehler`},UA={"%s not found":`%s no encontrado`,"()":`()`,"(at %s)":`(en %s)`,"(optional)":`(Opcional)`,"-":`-`,".":`.`,Ack:`Admitido`,Actions:`Comportamiento`,"Actual time of day":`Hora real del día`,Add:`Añadir`,"Add new script":`Agregar nuevo script`,All:`Todos`,"All files will be accepted":`Todos los archivos serán aceptados.`,Any:`Alguna`,"Any month":`Cualquier mes`,Apply:`Apply`,April:`abril`,"Are you sure?":`¿Estás seguro?`,Ask:`Preguntar`,Astronomical:`Astronómico`,"Astronomical events today":`Eventos astronómicos hoy`,August:`agosto`,"Blockly description":`Crear reglas por bloques gráficos`,"Body:":`Cuerpo:`,Cancel:`Cancelar`,"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:`Cerrar`,"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:`Condición`,Conditions:`Condiciones`,"Configuration not saved.":`Configuración no guardada.`,Console:`Consola`,"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:`Copiado`,"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:`diciembre`,Default:`Defecto`,"Define cron...":`Definir cron ...`,"Define schedule...":`Definir horario ...`,Delay:`Demora`,Delete:`Eliminar`,"Delete %s":`Eliminar %s ...`,"Delete folder":`Eliminar carpeta`,"Delete script":`Eliminar guión`,Description:`Descripción`,"Deselect all":`Deseleccionar todo`,"Discard changes for %s":`Descartar cambios para %s`,Done:`Hecho`,"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`,Error:`Error`,"Error formatting code":`Código de formato de error`,"Error was found":`Error encontrado`,"Every day":`Diario`,Exec:`Ejecutivo shell`,"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:`Explicación`,Export:`Exportar`,"Export all scripts":`Exportar todos los scripts`,"Export blocks":`Exportar bloques`,"Export selected blocks":`Exportar bloques seleccionados`,Februar:`Februar`,February:`febrero`,Filter:`Filtrar`,Folder:`Carpeta`,Fr:`P.`,Friday:`viernes`,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:`CARNÉ DE IDENTIDAD`,ID1:`ID1`,ID2:`ID2`,Import:`Importar`,"Import blocks":`Importar bloques`,"Import error":`Error de importación`,"Import scripts":`Importar guiones`,"Insert object ID":`Insertar ID de objeto`,Instance:`Ejemplo`,"Instance is disabled":`La instancia está deshabilitada`,"Instance:":`Ejemplo:`,Instances:`Instancias`,Instructions:`Instrucciones`,"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:`Enero`,January:`enero`,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`,Limit:`Límite`,"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:`marzo`,"March ":`marzo`,May:`Mayo`,Menu:`Menú`,Message:`Mensaje`,Mo:`Mes`,Model:`Modelo`,Monday:`lunes`,Month:`Mes`,More:`Más`,Name:`Nombre`,"No active host found":`No se encontró un host activo`,"Nothing found":`Nada Encontrado`,November:`noviembre`,OK:`OK`,October:`octubre`,Ok:`Okay`,"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`,"Operate two states":`Operar dos estados`,"Operations with two states":`Operaciones con dos estados`,"Paste your blocks here":`Pega tus bloques aquí`,Pause:`Pausa`,"Pause execution":`Pausar ejecución`,"Pause script":`Pausar guion`,"Phone:":`Teléfono:`,"Please select object ID...":`Por favor, seleccione la ID del objeto ...`,"Prettify the script":`Embellecer el guión`,"Print some text in log":`Imprime texto en el registro`,"Priority:":`Prioridad:`,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`,Restart:`Reiniciar`,Result:`Resultado`,"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:`Sa`,Saturday:`sábado`,Save:`Salvar`,"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:`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...`,"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:`septiembre`,"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:`Simular`,"Some files will be rejected":`Algunos archivos serán rechazados`,"Sound:":`Sonido:`,Stack:`Stack`,Start:`Comienzo`,"Start script":`Iniciar guion`,State:`Expresar`,"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:`Su`,"Subject:":`Sujeto:`,Sunday:`domingo`,"TS description":`Crear reglas escribiendo el mecanografiado`,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`,Time:`Tiempo`,"Time condition":`Condición de tiempo`,"Title:":`Título:`,"To:":`A:`,"Trigger with value":`Activar con valor`,Triggered:`Motivado`,Triggers:`Disparadores`,"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:`Tu`,Tuesday:`martes`,URL:`URL`,"Unknown error":`Error desconocido`,"Unknown error!":`¡Error desconocido!`,"User function":`Función de usuario`,"User:":`Usuario:`,Value:`Valor`,"Vibration:":`Vibración:`,Volume:`Volumen`,We:`3`,Wednesday:`miércoles`,"Whatsapp-cmb":`Whatsapp-cmb`,Write:`Escribir`,"Write your own code":`Escribe tu propio código`,Yes:`sí`,"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`,"Please select a valid model":`Por favor, 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:`Reconocimiento`,all:`todos`,and:`y`,"as JSON":`como JSON`,"as plain text":`como texto plano`,astro:`astro`,at:`a`,"clear running":`carrera clara`,control:`control`,copy:`Copiar`,cron:`CRON`,dawn:`Amanecer`,debug_help:`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.`,debug_label:`Depurar`,default:`defecto`,dusk:`Oscuridad`,easy:`fácil`,else:`demás`,"equal to":`igual a`,every:`cada`,"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:`Función`,filter_id:`CARNÉ DE IDENTIDAD`,filter_name:`Nombre`,filter_role:`Papel`,filter_room:`Habitación`,"for edit or create script":`para editar o crear un nuevo script`,"for professionals":`para profesionales`,"for programmers":`para programadores`,goldenHour:`hora dorada`,goldenHourEnd:`Fin de la hora dorada`,"greater or equal":`mayor o igual`,"greater or equal to":`mayor o igual a`,"greater than":`mas grande que`,help_just_check:`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.`,help_on_change:`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.`,"high priority":`alta prioridad`,"high-priority":`alta prioridad`,"highest priority":`más alta prioridad`,hours:`horas`,includes:`incluye`,interval:`intervalo`,"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:`magia`,milliseconds:`milisegundos`,minutes:`minutos`,ms:`ms`,nadir:`nadir`,nauticalDawn:`Amanecer náutico`,nauticalDusk:`Atardecer náutico`,nextSunrise:`próximo amanecer`,nextSunset:`Próxima puesta de sol`,night:`Noche`,nightEnd:`Fin de la noche`,"no blocks found":`No se encontraron bloques`,"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`,"on change":`en el cambio`,"on condition change":`con cambio de condición`,"on update":`en actualización`,one:`uno`,or:`o`,quiet:`tranquilo`,"reset search":`restablecer la búsqueda`,search:`buscar`,seconds:`segundos`,solarNoon:`Mediodía solar`,"store in":`almacenar en`,sunrise:`amanecer`,sunriseEnd:`Final del amanecer`,sunset:`puesta de sol`,sunsetStart:`Inicio al atardecer`,then:`entonces`,"toggle value":`alternar valor`,tooltip_ack:`Reconocer`,tooltip_from:`De`,tooltip_lc:`Último cambio`,tooltip_quality:`Calidad`,tooltip_ts:`Marca de tiempo`,tooltip_user:`Usuario`,tooltip_value:`Valor`,true:`cierto`,two:`dos`,undefined:`indefinido`,update:`actualizar`,"use seconds":`usar segundos`,"use trigger value":`usar valor de activación`,verbose_help:`Agrega salida de depuración al registro para muchos comandos del sistema`,verbose_label:`Salidas de registro detalladas`,when:`cuando`,with:`con`,"with date":`con fecha`,"with offset":`con desplazamiento`,wizard:`Wizard`,"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:`Reintentar`,"No running javascript instance found":`No se encontró ninguna instancia de JavaScript en ejecución`,"OID display mode":`Modo de visualización OID`,"Ask questions about your script, request changes, or generate new code.":`Haz preguntas sobre tu script, solicita cambios o genera nuevo código.`,"to send":`para enviar`,"Thinking...":`Pensando...`,"AI suggested changes":`Cambios sugeridos por IA`,Accept:`Aceptar`,Reject:`Rechazar`,"No API keys configured":`No hay claves API configuradas`,"for new line":`para nueva línea`,"AI chat mode":`Modo de chat IA`,"Plain conversation. Use for questions, explanations, syntax help. Does not read or modify your scripts.":`Conversación simple. Úsalo para preguntas, explicaciones y ayuda de sintaxis. No lee ni modifica tus scripts.`,'For larger models with tool support. The AI can read, create, and edit scripts, look up datapoints, and browse the object tree — useful for "create a script that...", "which scripts use this state?" or "analyze my light script".':`Para modelos más grandes con soporte de herramientas. La IA puede leer, crear y editar scripts, consultar datapoints y navegar por el árbol de objetos — útil para «crea un script que...», «¿qué scripts usan este state?» o «analiza mi script de luz».`,'For smaller models without tool support. Two-step script generator (plan then code) — useful for "create a script that..." or "write a Blockly rule for...". Output goes into the editor for smart-apply.':`Para modelos más pequeños sin soporte de herramientas. Generador de scripts en dos pasos (primero plan, luego código) — útil para "crea un script que..." o "escribe una regla Blockly para...". El resultado va al editor para smart-apply.`,"Plain conversation. Best for: general questions, syntax help, concept explanations.":`Conversación simple. Ideal para: preguntas generales, ayuda de sintaxis, explicaciones de conceptos.`,"For larger models with tool support. Best for: creating, editing, or analyzing scripts; finding datapoint usages; inspecting the object tree.":`Para modelos más grandes con soporte de herramientas. Ideal para: crear, editar o analizar scripts; encontrar usos de datapoints; inspeccionar el árbol de objetos.`,"For smaller models without tool support. Best for: creating new JavaScript/TypeScript or Blockly scripts from a description.":`Para modelos más pequeños sin soporte de herramientas. Ideal para: crear nuevos scripts JavaScript/TypeScript o Blockly a partir de una descripción.`,"Mention scripts as context for the AI. Use @all for all scripts or @scriptName for a specific one.":`Mencionar scripts como contexto para la IA. Usa @todos para todos los scripts o @nombreScript para uno específico.`,Context:`Contexto`,"current script":`script actual`,"all scripts":`todos los scripts`,devices:`dispositivos`,"Searching datapoints":`Buscando puntos de datos`,"Reading value":`Leyendo valor`,"Loading object info":`Cargando información del objeto`,"Searching scripts":`Buscando scripts`,"Reading script":`Leyendo script`,"Loading script list":`Cargando lista de scripts`,"All scripts":`Todos los scripts`,"Smart home devices":`Dispositivos del hogar inteligente`,"AI Chat":`Chat IA`,"AI inline completions":`Completado en línea con IA`,"New chat":`Nuevo chat`,"Ask about your script...":`Pregunta sobre tu script...`,"Insert blocks":`Insertar bloques`,"Apply blocks":`Aplicar bloques`,Undo:`Deshacer`,Redo:`Rehacer`,"Insert into editor":`Insertar en el editor`,"Show as diff":`Mostrar como diff`,"Selected code as context":`Código seleccionado como contexto`,"Generating plan...":`Generando plan...`,"Generating code...":`Generando código...`,Plan:`Plan`,"mention @all":`@todos`,"mention @devices":`@dispositivos`,Send:`Enviar`,Copy:`Copiar`,"AI inline chat":`Chat IA integrado`,'e.g. "Refactor this to use async/await"':`p. ej. "Refactor this to use async/await"`,"Open in chat":`Abrir en el chat`,"Selection: %s line(s)":`Selección: %s línea(s)`,"No selection — the question will use context from the whole script.":`Sin selección — la pregunta usará el contexto de todo el script.`,"Please enter a question.":`Introduce una pregunta.`,"Thinking…":`Pensando…`,"Code proposal — press Apply to replace your selection.":`Propuesta de código — pulsa Aplicar para reemplazar la selección.`,"Plain text answer.":`Respuesta de texto.`,"Show more details":`Mostrar más detalles`,"AI: Inline chat…":`IA: Chat integrado…`,"AI: Explain":`IA: Explicar`,"AI: Refactor":`IA: Refactorizar`,"AI: Add comments":`IA: Añadir comentarios`,"AI: Fix problem":`IA: Corregir problema`,"AI: Suggest tests":`IA: Sugerir pruebas`,"Ask the AI about the selected code:":`Pregunta a la IA sobre el código seleccionado:`,Explain:`Explicar`,Refactor:`Refactorizar`,Tests:`Pruebas`,"Explain %s %s":`Explicar %s %s`,"Refactor %s %s":`Refactorizar %s %s`,"Suggest tests for %s %s":`Sugerir pruebas para %s %s`,"Apply changes":`Aplicar cambios`,"Discard changes":`Descartar cambios`,'Ask anything, or request a change (e.g. "what does this do?")':`Pregunta lo que quieras o pide un cambio (p. ej. "¿qué hace esto?")`,Wizard:`Asistente`,"Create a rule step by step":`Crear una regla paso a paso`,Summary:`Resumen`,Back:`Atrás`,Next:`Siguiente`,Skip:`Omitir`,"Create rule":`Crear regla`,"Replace rule":`Reemplazar regla`,"The current rule will be replaced":`La regla actual será reemplazada`,"Add another":`Añadir otro`,"Without a condition the rule always runs":`Sin condición, la regla siempre se ejecuta`,"What should start the rule?":`¿Qué debe iniciar la regla?`,"When should the rule run? This step is optional.":`¿Cuándo debe ejecutarse la regla? Este paso es opcional.`,"What should happen?":`¿Qué debe ocurrir?`,"Block not found":`Bloque no encontrado`,Weekday:`Día de la semana`,"Let the rule run only on the selected days of the week":`Ejecutar la regla solo en los días de la semana seleccionados`,"Send to adapter":`Enviar al adaptador`,"Sends a message to any adapter instance":`Envía un mensaje a cualquier instancia de adaptador`,"Command:":`Comando:`,"JSON:":`JSON:`,"Sent:":`Enviado:`,"User condition":`Condición de usuario`,"Write your own condition":`Escribe tu propia condición`,"This is an advanced option. The code is the body of a function and must return the result, e.g. \"return getState('javascript.0.variable').val > 5;\". You may use await inside.":`Esta es una opción avanzada. El código es el cuerpo de una función y debe devolver el resultado con return, p. ej. "return getState('javascript.0.variable').val > 5;". Puede usar await en su interior.`,"On message":`Al recibir mensaje`,"Triggers the rule when another script or adapter sends a message":`Activa la regla cuando otro script o adaptador envía un mensaje`,"Send the message from a script with messageTo({instance: 'javascript.0'}, 'myMessage', data). The sent data is available in the texts of the actions as %s.":`Envía el mensaje desde un script con messageTo({instance: 'javascript.0'}, 'myMessage', data). Los datos enviados están disponibles en los textos de las acciones como %s.`,"Message name:":`Nombre del mensaje:`,"Received:":`Recibido:`,Notification:`Notificación`,"Creates an ioBroker notification, which is shown in the admin":`Crea una notificación de ioBroker que se muestra en el admin`,"Notification text":`Texto de la notificación`,"as alert":`como alerta`,Alert:`Alerta`,"Registered:":`Registrado:`,"Toggle between two values":`Alternar entre dos valores`,"Switches a state back and forth between two values":`Cambia un estado de un lado a otro entre dos valores`,'If the state does not hold the first value, the first one is written - so the rule always ends up on a defined value. To invert a boolean, use the "toggle value" checkbox of the "Set state action" instead.':`Si el estado no contiene el primer valor, se escribe el primero, de modo que la regla siempre termina en un valor definido. Para invertir un booleano, use la casilla "toggle value" de la acción "Set state action".`,between:`entre`,"Toggled:":`Alternado:`,"On file change":`Al cambiar un archivo`,"Triggers the rule when a file of an object is written or deleted":`Activa la regla cuando un archivo de un objeto se escribe o se elimina`,'Both fields may contain *, e.g. the object "vis.0" and the file name "main/*". In the texts of the actions %s is the name of the changed file and %id the object it belongs to. Requires js-controller 4.1 or newer.':`Ambos campos pueden contener *, p. ej. el objeto "vis.0" y el nombre de archivo "main/*". En los textos de las acciones, %s es el nombre del archivo modificado y %id el objeto al que pertenece. Requiere js-controller 4.1 o superior.`,"Files of:":`Archivos de:`,"File name:":`Nombre del archivo:`,"File changed:":`Archivo modificado:`,"Deleted:":`Eliminado:`,File:`Archivo`,"On object change":`Al cambiar un objeto`,"Triggers the rule when an object is created, changed or deleted":`Activa la regla cuando un objeto se crea, se modifica o se elimina`,'This reacts to the object itself, not to its value - use the "State" trigger for values. The pattern may contain *, e.g. "hm-rpc.0.*". In the texts of the actions %s and %id are the id of the changed object.':`Reacciona al objeto en sí, no a su valor: use el disparador "State" para los valores. El patrón puede contener *, p. ej. "hm-rpc.0.*". En los textos de las acciones, %s y %id son el id del objeto modificado.`,"Object ID:":`ID del objeto:`,"React on:":`Reaccionar a:`,"any change":`cualquier cambio`,"created or changed":`creado o modificado`,deleted:`eliminado`,"Object changed:":`Objeto modificado:`,"Object deleted:":`Objeto eliminado:`,"On log message":`Al recibir un mensaje de registro`,"Triggers the rule when something is written to the ioBroker log":`Activa la regla cuando se escribe algo en el registro de ioBroker`,'Leave "Contains" empty to react to every entry of that level. Fill it in if an action of this rule writes to the log itself - a rule that matches its own message can trigger itself. In the texts of the actions %s is the log message and %id the instance it came from.':`Deje "Contiene" vacío para reaccionar a cada entrada de ese nivel. Rellénelo si una acción de esta regla escribe en el registro: una regla que coincide con su propio mensaje puede activarse a sí misma. En los textos de las acciones, %s es el mensaje de registro y %id la instancia de la que proviene.`,"Level:":`Nivel:`,"Contains:":`Contiene:`,error:`error`,warn:`warn`,info:`info`,debug:`debug`,silly:`silly`,"any level":`cualquier nivel`,"Logged:":`Registrado en el log:`,"Log contains":`El registro contiene`,"Every log entry":`Cada entrada del registro`,"On rule stop":`Al detener la regla`,"Runs the rule once more when it is stopped, saved or the adapter shuts down":`Ejecuta la regla una vez más cuando se detiene, se guarda o el adaptador se apaga`,"The adapter waits for the actions, but only for the time set here - what does not fit is cut off. A rule can have only one block of this kind; a second one replaces the first.":`El adaptador espera a las acciones, pero solo el tiempo configurado aquí; lo que no quepa se corta. Una regla solo puede tener un bloque de este tipo; un segundo sustituye al primero.`,"Wait at most:":`Esperar como máximo:`,"HTTP error:":`Error HTTP:`,"On enum member change":`Al cambiar un miembro del enum`,"Triggers the rule when any state of a room or function changes":`Activa la regla cuando cambia cualquier estado de una habitación o función`,"Subscribes to every state of the selected enum and follows it: a device added to that room later is included without changing the rule. In the texts of the actions %s is the new value and %id the state that changed.":`Se suscribe a todos los estados del enum seleccionado y lo sigue: un dispositivo añadido más tarde se incluye sin cambiar la regla. En los textos de las acciones, %s es el nuevo valor y %id el estado que cambió.`,"Members of:":`Miembros de:`,"Any member of":`Cualquier miembro de`,"Send message":`Enviar mensaje`,"Sends a message to other scripts and rules":`Envía un mensaje a otros scripts y reglas`,'Every rule with an "On message" trigger of the same name receives it, as does a script with onMessage(). You can use %s in the text to send the current trigger value or %id the triggered object ID.':`La recibe toda regla con un disparador "Al recibir mensaje" del mismo nombre, así como un script con onMessage(). Con %s en el texto envías el valor actual del disparador y con %id el ID del objeto activado.`,"Set state if changed":`Establecer estado solo si cambia`,"Writes a state only if its value differs from the current one":`Escribe un estado solo si su valor difiere del actual`,'Use this instead of "Set state action" for rules that run often: an unchanged value is not written at all, so nothing subscribed to that state is woken up for nothing.':`Use esto en lugar de "Set state action" para reglas que se ejecutan a menudo: un valor sin cambios no se escribe en absoluto, así que nada suscrito a ese estado se despierta en vano.`,"only if changed":`solo si cambia`,"A block failed while generating the script, so the changes cannot be saved":`Un bloque falló al generar el script, los cambios no se pueden guardar`,"Blockly error":`Error de Blockly`,"Export error":`Error de exportación`},WA={"%s not found":`%s non trouvé`,"()":`()`,"(at %s)":`(à %s)`,"(optional)":`(optionnel)`,"-":`-`,".":`.`,Ack:`Reconnu`,Actions:`Actions`,"Actual time of day":`Heure réelle de la journée`,Add:`Ajouter`,"Add new script":`Ajouter un nouveau script`,All:`Tout`,"All files will be accepted":`Tous les fichiers seront acceptés`,Any:`Tout`,"Any month":`N'importe quel mois`,Apply:`Postuler`,April:`avril`,"Are you sure?":`Êtes-vous sûr?`,Ask:`Demander`,Astronomical:`Astronomique`,"Astronomical events today":`Événements astronomiques aujourd'hui`,August:`août`,"Blockly description":`Création de règles par blocs graphiques`,"Body:":`Corps:`,Cancel:`Annuler`,"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:`proche`,"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:`État`,Conditions:`Conditions`,"Configuration not saved.":`Configuration non enregistrée.`,Console:`Console`,"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:`Copié`,"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:`décembre`,Default:`Défaut`,"Define cron...":`Définir le cron ...`,"Define schedule...":`Définir le calendrier ...`,Delay:`Retard`,Delete:`Effacer`,"Delete %s":`Supprimer %s ...`,"Delete folder":`Supprimer le dossier`,"Delete script":`Supprimer le script`,Description:`Description`,"Deselect all":`Tout déselectionner`,"Discard changes for %s":`Ignorer les modifications pour %s`,Done:`Terminé`,"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`,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:`Exec shell`,"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:`Explication`,Export:`Exportation`,"Export all scripts":`Exporter tous les scripts`,"Export blocks":`Blocs d'exportation`,"Export selected blocks":`Exporter les blocs sélectionnés`,Februar:`Février`,February:`février`,Filter:`Filtre`,Folder:`Dossier`,Fr:`Fr`,Friday:`Vendredi`,Function:`Fonction`,"Function editor":`Éditeur de fonction`,"Function: executed":`Fonction\xA0: exécutée`,"Go to next line":`Aller à la ligne suivante`,"HTTP Call":`Appel HTTP`,"Hide logs":`Masquer les journaux`,ID:`ID`,ID1:`ID1`,ID2:`ID2`,Import:`Importation`,"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:`Exemple`,"Instance is disabled":`L'instance est désactivée`,"Instance:":`Exemple:`,Instances:`Instances`,Instructions:`Instructions`,"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:`Janvier`,January:`janvier`,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`,Limit:`Limite`,"Local time":`Heure locale`,"Locate file":`Localiser le fichier`,"Log outputs":`Journal des sorties`,"Log text":`Texte du journal`,"Log: %s":`Log\xA0: %s`,"Make a HTTP get request":`Faire une requête HTTP Get`,"Make a pause between actions":`Faites une pause entre les actions`,March:`Mars`,"March ":`mars`,May:`Mai`,Menu:`M e n u`,Message:`Message`,Mo:`Mo`,Model:`Modèle`,Monday:`Lundi`,Month:`Mois`,More:`Plus`,Name:`Nom`,"No active host found":`Aucun hôte actif trouvé`,"Nothing found":`Rien n'a été trouvé`,November:`novembre`,OK:`OK`,October:`octobre`,Ok:`D'accord`,"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`,"Operate two states":`Opérer deux états`,"Operations with two states":`Opérations à deux états`,"Paste your blocks here":`Collez vos blocs ici`,Pause:`Pause`,"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 ...`,"Prettify the script":`Embellir le scénario`,"Print some text in log":`Imprimer du texte dans le journal`,"Priority:":`Priorité:`,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`,Restart:`Redémarrer`,Result:`Résultat`,"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:`Sa`,Saturday:`samedi`,Save:`sauver`,"Save all":`Sauver tous`,"Say It":`Say It`,"Say some text via sayit adapter":`Dites du texte via l'adaptateur sayit`,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...`,"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:`septembre`,"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:`Simuler`,"Some files will be rejected":`Certains fichiers seront rejetés`,"Sound:":`Sonner:`,Stack:`Stack`,Start:`Début`,"Start script":`Lancer le script`,State:`État`,"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:`Su`,"Subject:":`Sujet:`,Sunday:`dimanche`,"TS description":`Créer des règles en écrivant des caractères dactylographiés`,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`,Time:`Temps`,"Time condition":`Condition de temps`,"Title:":`Titre:`,"To:":`À:`,"Trigger with value":`Déclencheur avec valeur`,Triggered:`Déclenché`,Triggers:`Déclencheurs`,"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:`Tu`,Tuesday:`Mardi`,URL:`URL`,"Unknown error":`Erreur inconnue`,"Unknown error!":`Erreur inconnue!`,"User function":`Fonction utilisateur`,"User:":`Utilisateur:`,Value:`Valeur`,"Vibration:":`Vibration:`,Volume:`Le volume`,We:`3`,Wednesday:`Mercredi`,"Whatsapp-cmb":`Whatsapp-cmb`,Write:`Écrivez`,"Write your own code":`Écrivez votre propre code`,Yes:`Oui`,"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`,"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:`reconnaissance`,all:`tout`,and:`et`,"as JSON":`en JSON`,"as plain text":`en texte brut`,astro:`astro`,at:`à`,"clear running":`course claire`,control:`contrôler`,copy:`copie`,cron:`CRON`,dawn:`Aube`,debug_help:`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.`,debug_label:`Déboguer`,default:`défaut`,dusk:`Crépuscule`,easy:`facile`,else:`autre`,"equal to":`égal à`,every:`chaque`,"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:`Une fonction`,filter_id:`ID`,filter_name:`Nom`,filter_role:`Rôle`,filter_room:`Pièce`,"for edit or create script":`pour éditer ou créer un nouveau script`,"for professionals":`pour les professionnels`,"for programmers":`pour les programmeurs`,goldenHour:`Heure d'or`,goldenHourEnd:`Fin de l'heure d'or`,"greater or equal":`supérieur ou égal`,"greater or equal to":`supérieur ou égal à`,"greater than":`plus grand que`,help_just_check:`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.`,help_on_change:`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.`,"high priority":`haute priorité`,"high-priority":`haute priorité`,"highest priority":`priorité la plus élevée`,hours:`les heures`,includes:`comprend`,interval:`intervalle`,"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:`la magie`,milliseconds:`millisecondes`,minutes:`minutes`,ms:`ms`,nadir:`nadir`,nauticalDawn:`Aube nautique`,nauticalDusk:`Crépuscule nautique`,nextSunrise:`Prochain lever de soleil`,nextSunset:`Prochain coucher de soleil`,night:`Nuit`,nightEnd:`Fin de nuit`,"no blocks found":`Aucun bloc trouvé`,"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`,"on change":`sur le changement`,"on condition change":`sur changement de condition`,"on update":`sur mise à jour`,one:`une`,or:`ou`,quiet:`calmer`,"reset search":`Réinitialiser la recherche`,search:`chercher`,seconds:`secondes`,solarNoon:`Midi solaire`,"store in":`stocker dans`,sunrise:`lever du soleil`,sunriseEnd:`Fin du lever du soleil`,sunset:`le coucher du soleil`,sunsetStart:`Début du coucher du soleil`,then:`alors`,"toggle value":`valeur de bascule`,tooltip_ack:`Reconnaître`,tooltip_from:`De`,tooltip_lc:`Dernière modification`,tooltip_quality:`Qualité`,tooltip_ts:`Horodatage`,tooltip_user:`Utilisateur`,tooltip_value:`Valeur`,true:`vrai`,two:`deux`,undefined:`indéfini`,update:`mettre à jour`,"use seconds":`utiliser les secondes`,"use trigger value":`use trigger value`,verbose_help:`Ajoute une sortie de débogage au journal pour de nombreuses commandes système`,verbose_label:`Sorties de journal détaillées`,when:`lorsque`,with:`avec`,"with date":`avec date`,"with offset":`avec offset`,wizard:`Wizard`,"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:`Réessayer`,"No running javascript instance found":`Aucune instance JavaScript en cours d'exécution trouvée`,"OID display mode":`Mode d'affichage OID`,"Ask questions about your script, request changes, or generate new code.":`Posez des questions sur votre script, demandez des modifications ou générez du nouveau code.`,"to send":`pour envoyer`,"Thinking...":`Réflexion...`,"AI suggested changes":`Modifications suggérées par l'IA`,Accept:`Accepter`,Reject:`Rejeter`,"No API keys configured":`Aucune clé API configurée`,"for new line":`pour nouvelle ligne`,"AI chat mode":`Mode de chat IA`,"Plain conversation. Use for questions, explanations, syntax help. Does not read or modify your scripts.":`Conversation simple. À utiliser pour les questions, explications et aide de syntaxe. Ne lit ni ne modifie vos scripts.`,'For larger models with tool support. The AI can read, create, and edit scripts, look up datapoints, and browse the object tree — useful for "create a script that...", "which scripts use this state?" or "analyze my light script".':`Pour les modèles plus grands avec prise en charge des outils. L'IA peut lire, créer et modifier des scripts, rechercher des datapoints et parcourir l'arbre d'objets — utile pour « crée un script qui... », « quels scripts utilisent cet état ? » ou « analyse mon script d'éclairage ».`,'For smaller models without tool support. Two-step script generator (plan then code) — useful for "create a script that..." or "write a Blockly rule for...". Output goes into the editor for smart-apply.':`Pour les modèles plus petits sans prise en charge des outils. Générateur de scripts en deux étapes (plan puis code) — utile pour « crée un script qui... » ou « écris une règle Blockly pour... ». Le résultat arrive dans l'éditeur pour un smart-apply.`,"Plain conversation. Best for: general questions, syntax help, concept explanations.":`Conversation simple. Idéal pour : questions générales, aide de syntaxe, explications de concepts.`,"For larger models with tool support. Best for: creating, editing, or analyzing scripts; finding datapoint usages; inspecting the object tree.":`Pour les modèles plus grands avec prise en charge des outils. Idéal pour : créer, modifier ou analyser des scripts ; trouver les utilisations de datapoints ; examiner l'arbre d'objets.`,"For smaller models without tool support. Best for: creating new JavaScript/TypeScript or Blockly scripts from a description.":`Pour les modèles plus petits sans prise en charge des outils. Idéal pour : créer de nouveaux scripts JavaScript/TypeScript ou Blockly à partir d'une description.`,"Mention scripts as context for the AI. Use @all for all scripts or @scriptName for a specific one.":`Mentionner des scripts comme contexte pour l'IA. Utilisez @tous pour tous les scripts ou @nomDuScript pour un script spécifique.`,Context:`Contexte`,"current script":`script actuel`,"all scripts":`tous les scripts`,devices:`appareils`,"Searching datapoints":`Recherche de points de données`,"Reading value":`Lecture de la valeur`,"Loading object info":`Chargement des informations de l'objet`,"Searching scripts":`Recherche de scripts`,"Reading script":`Lecture du script`,"Loading script list":`Chargement de la liste des scripts`,"All scripts":`Tous les scripts`,"Smart home devices":`Appareils domotiques`,"AI Chat":`Chat IA`,"AI inline completions":`Complétions en ligne IA`,"New chat":`Nouveau chat`,"Ask about your script...":`Posez une question sur votre script...`,"Insert blocks":`Insérer des blocs`,"Apply blocks":`Appliquer les blocs`,Undo:`Annuler`,Redo:`Rétablir`,"Insert into editor":`Insérer dans l'éditeur`,"Show as diff":`Afficher comme diff`,"Selected code as context":`Code sélectionné comme contexte`,"Generating plan...":`Génération du plan...`,"Generating code...":`Génération du code...`,Plan:`Plan`,"mention @all":`@tous`,"mention @devices":`@appareils`,Send:`Envoyer`,Copy:`Copier`,"AI inline chat":`Chat IA intégré`,'e.g. "Refactor this to use async/await"':`p. ex. "Refactor this to use async/await"`,"Open in chat":`Ouvrir dans le chat`,"Selection: %s line(s)":`Sélection : %s ligne(s)`,"No selection — the question will use context from the whole script.":`Aucune sélection — la question utilisera le contexte du script entier.`,"Please enter a question.":`Veuillez saisir une question.`,"Thinking…":`Réflexion…`,"Code proposal — press Apply to replace your selection.":`Proposition de code — appuyez sur Appliquer pour remplacer la sélection.`,"Plain text answer.":`Réponse textuelle.`,"Show more details":`Afficher plus de détails`,"AI: Inline chat…":`IA : Chat intégré…`,"AI: Explain":`IA : Expliquer`,"AI: Refactor":`IA : Refactoriser`,"AI: Add comments":`IA : Ajouter des commentaires`,"AI: Fix problem":`IA : Corriger le problème`,"AI: Suggest tests":`IA : Suggérer des tests`,"Ask the AI about the selected code:":`Interroger l'IA sur le code sélectionné :`,Explain:`Expliquer`,Refactor:`Refactoriser`,Tests:`Tests`,"Explain %s %s":`Expliquer %s %s`,"Refactor %s %s":`Refactoriser %s %s`,"Suggest tests for %s %s":`Suggérer des tests pour %s %s`,"Apply changes":`Appliquer les modifications`,"Discard changes":`Annuler les modifications`,'Ask anything, or request a change (e.g. "what does this do?")':`Posez une question ou demandez une modification (p. ex. « que fait ceci ? »)`,Wizard:`Assistant`,"Create a rule step by step":`Créer une règle étape par étape`,Summary:`Récapitulatif`,Back:`Retour`,Next:`Suivant`,Skip:`Ignorer`,"Create rule":`Créer la règle`,"Replace rule":`Remplacer la règle`,"The current rule will be replaced":`La règle actuelle sera remplacée`,"Add another":`Ajouter un autre`,"Without a condition the rule always runs":`Sans condition, la règle s'exécute toujours`,"What should start the rule?":`Qu'est-ce qui doit déclencher la règle ?`,"When should the rule run? This step is optional.":`Quand la règle doit-elle s'exécuter ? Cette étape est facultative.`,"What should happen?":`Que doit-il se passer ?`,"Block not found":`Bloc introuvable`,Weekday:`Jour de la semaine`,"Let the rule run only on the selected days of the week":`Exécuter la règle uniquement les jours de la semaine sélectionnés`,"Send to adapter":`Envoyer à l'adaptateur`,"Sends a message to any adapter instance":`Envoie un message à n'importe quelle instance d'adaptateur`,"Command:":`Commande :`,"JSON:":`JSON :`,"Sent:":`Envoyé :`,"User condition":`Condition utilisateur`,"Write your own condition":`Écrivez votre propre condition`,"This is an advanced option. The code is the body of a function and must return the result, e.g. \"return getState('javascript.0.variable').val > 5;\". You may use await inside.":`Ceci est une option avancée. Le code est le corps d'une fonction et doit renvoyer le résultat avec return, par ex. "return getState('javascript.0.variable').val > 5;". Vous pouvez utiliser await à l'intérieur.`,"On message":`À la réception d'un message`,"Triggers the rule when another script or adapter sends a message":`Déclenche la règle lorsqu'un autre script ou adaptateur envoie un message`,"Send the message from a script with messageTo({instance: 'javascript.0'}, 'myMessage', data). The sent data is available in the texts of the actions as %s.":`Envoyez le message depuis un script avec messageTo({instance: 'javascript.0'}, 'myMessage', data). Les données envoyées sont disponibles dans les textes des actions sous la forme %s.`,"Message name:":`Nom du message :`,"Received:":`Reçu :`,Notification:`Notification`,"Creates an ioBroker notification, which is shown in the admin":`Crée une notification ioBroker, affichée dans l'admin`,"Notification text":`Texte de la notification`,"as alert":`comme alerte`,Alert:`Alerte`,"Registered:":`Enregistré :`,"Toggle between two values":`Basculer entre deux valeurs`,"Switches a state back and forth between two values":`Fait basculer un état entre deux valeurs`,'If the state does not hold the first value, the first one is written - so the rule always ends up on a defined value. To invert a boolean, use the "toggle value" checkbox of the "Set state action" instead.':`Si l'état ne contient pas la première valeur, la première est écrite - la règle aboutit ainsi toujours à une valeur définie. Pour inverser un booléen, utilisez plutôt la case "toggle value" de l'action "Set state action".`,between:`entre`,"Toggled:":`Basculé :`,"On file change":`Lors d'une modification de fichier`,"Triggers the rule when a file of an object is written or deleted":`Déclenche la règle lorsqu'un fichier d'un objet est écrit ou supprimé`,'Both fields may contain *, e.g. the object "vis.0" and the file name "main/*". In the texts of the actions %s is the name of the changed file and %id the object it belongs to. Requires js-controller 4.1 or newer.':`Les deux champs peuvent contenir *, par ex. l'objet "vis.0" et le nom de fichier "main/*". Dans les textes des actions, %s est le nom du fichier modifié et %id l'objet auquel il appartient. Nécessite js-controller 4.1 ou plus récent.`,"Files of:":`Fichiers de :`,"File name:":`Nom du fichier :`,"File changed:":`Fichier modifié :`,"Deleted:":`Supprimé :`,File:`Fichier`,"On object change":`Lors d'une modification d'objet`,"Triggers the rule when an object is created, changed or deleted":`Déclenche la règle lorsqu'un objet est créé, modifié ou supprimé`,'This reacts to the object itself, not to its value - use the "State" trigger for values. The pattern may contain *, e.g. "hm-rpc.0.*". In the texts of the actions %s and %id are the id of the changed object.':`Réagit à l'objet lui-même, pas à sa valeur - utilisez le déclencheur "State" pour les valeurs. Le motif peut contenir *, par ex. "hm-rpc.0.*". Dans les textes des actions, %s et %id sont l'id de l'objet modifié.`,"Object ID:":`ID de l'objet :`,"React on:":`Réagir à :`,"any change":`tout changement`,"created or changed":`créé ou modifié`,deleted:`supprimé`,"Object changed:":`Objet modifié :`,"Object deleted:":`Objet supprimé :`,"On log message":`Lors d'un message de journal`,"Triggers the rule when something is written to the ioBroker log":`Déclenche la règle lorsque quelque chose est écrit dans le journal ioBroker`,'Leave "Contains" empty to react to every entry of that level. Fill it in if an action of this rule writes to the log itself - a rule that matches its own message can trigger itself. In the texts of the actions %s is the log message and %id the instance it came from.':`Laissez "Contient" vide pour réagir à chaque entrée de ce niveau. Remplissez-le si une action de cette règle écrit elle-même dans le journal - une règle qui correspond à son propre message peut se déclencher elle-même. Dans les textes des actions, %s est le message du journal et %id l'instance dont il provient.`,"Level:":`Niveau :`,"Contains:":`Contient :`,error:`error`,warn:`warn`,info:`info`,debug:`debug`,silly:`silly`,"any level":`tout niveau`,"Logged:":`Journalisé :`,"Log contains":`Le journal contient`,"Every log entry":`Chaque entrée du journal`,"On rule stop":`À l'arrêt de la règle`,"Runs the rule once more when it is stopped, saved or the adapter shuts down":`Exécute la règle une dernière fois lorsqu'elle est arrêtée, enregistrée ou que l'adaptateur s'arrête`,"The adapter waits for the actions, but only for the time set here - what does not fit is cut off. A rule can have only one block of this kind; a second one replaces the first.":`L'adaptateur attend les actions, mais seulement pendant le temps défini ici - ce qui ne rentre pas est interrompu. Une règle ne peut avoir qu'un seul bloc de ce type ; un second remplace le premier.`,"Wait at most:":`Attendre au plus :`,"HTTP error:":`Erreur HTTP :`,"On enum member change":`Lors d'un changement dans l'énumération`,"Triggers the rule when any state of a room or function changes":`Déclenche la règle lorsqu'un état quelconque d'une pièce ou d'une fonction change`,"Subscribes to every state of the selected enum and follows it: a device added to that room later is included without changing the rule. In the texts of the actions %s is the new value and %id the state that changed.":`S'abonne à chaque état de l'énumération choisie et la suit : un appareil ajouté plus tard est inclus sans modifier la règle. Dans les textes des actions, %s est la nouvelle valeur et %id l'état qui a changé.`,"Members of:":`Membres de :`,"Any member of":`N'importe quel membre de`,"Send message":`Envoyer un message`,"Sends a message to other scripts and rules":`Envoie un message à d'autres scripts et règles`,'Every rule with an "On message" trigger of the same name receives it, as does a script with onMessage(). You can use %s in the text to send the current trigger value or %id the triggered object ID.':`Toute règle avec un déclencheur "À la réception d'un message" du même nom la reçoit, tout comme un script avec onMessage(). Avec %s dans le texte vous envoyez la valeur actuelle du déclencheur et avec %id l'ID de l'objet déclenché.`,"Set state if changed":`Définir l'état seulement s'il change`,"Writes a state only if its value differs from the current one":`N'écrit un état que si sa valeur diffère de l'actuelle`,'Use this instead of "Set state action" for rules that run often: an unchanged value is not written at all, so nothing subscribed to that state is woken up for nothing.':`À utiliser à la place de "Set state action" pour les règles qui s'exécutent souvent : une valeur inchangée n'est pas écrite du tout, donc rien de ce qui est abonné à cet état n'est réveillé pour rien.`,"only if changed":`seulement si changé`,"A block failed while generating the script, so the changes cannot be saved":`Un bloc a échoué lors de la génération du script, les modifications ne peuvent pas être enregistrées`,"Blockly error":`Erreur Blockly`,"Export error":`Erreur d'exportation`},GA={"%s not found":`%s non trovato`,"()":`()`,"(at %s)":`(a %s)`,"(optional)":`(opzionale)`,"-":`-`,".":`.`,Ack:`Riconosciuto`,Actions:`Azioni`,"Actual time of day":`Ora effettiva della giornata`,Add:`Inserisci`,"Add new script":`Aggiungi nuovo script`,All:`Tutti`,"All files will be accepted":`Tutti i file saranno accettati`,Any:`Qualunque`,"Any month":`Ogni mese`,Apply:`Applica`,April:`aprile`,"Are you sure?":`Sei sicuro?`,Ask:`Chiedere`,Astronomical:`Astronomico`,"Astronomical events today":`Eventi astronomici oggi`,August:`agosto`,"Blockly description":`Creazione di regole tramite blocchi grafici`,"Body:":`Corpo:`,Cancel:`Annulla`,"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:`Vicino`,"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:`Condizione`,Conditions:`Condizioni`,"Configuration not saved.":`Configurazione non salvata.`,Console:`Console`,"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:`Copiato`,"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:`dicembre`,Default:`Predefinito`,"Define cron...":`Definisci cron ...`,"Define schedule...":`Definisci programma ...`,Delay:`Ritardo`,Delete:`Elimina`,"Delete %s":`Elimina %s ...`,"Delete folder":`Elimina cartella`,"Delete script":`Elimina script`,Description:`Descrizione`,"Deselect all":`Deselezionare tutto`,"Discard changes for %s":`Annulla modifiche per %s`,Done:`Fatto`,"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`,Error:`Errore`,"Error formatting code":`Errore di formattazione del codice`,"Error was found":`Errore trovato`,"Every day":`Ogni giorno`,Exec:`Execshell`,"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:`Spiegazione`,Export:`Esportare`,"Export all scripts":`Esporta tutti gli script`,"Export blocks":`Esporta blocchi`,"Export selected blocks":`Esporta i blocchi selezionati`,Februar:`Februar`,February:`febbraio`,Filter:`Filtro`,Folder:`Cartella`,Fr:`P`,Friday:`Venerdì`,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:`ID`,ID1:`ID1`,ID2:`ID2`,Import:`Importare`,"Import blocks":`Importa blocchi`,"Import error":`Errore di importazione`,"Import scripts":`Importa script`,"Insert object ID":`Inserisci l'ID oggetto`,Instance:`Esempio`,"Instance is disabled":`L'istanza è disabilitata`,"Instance:":`Esempio:`,Instances:`istanze`,Instructions:`Istruzioni`,"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:`Januar`,January:`gennaio`,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`,Limit:`Limite`,"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:`marzo`,"March ":`marzo`,May:`Maggio`,Menu:`Menu`,Message:`Messaggio`,Mo:`Mo`,Model:`Modello`,Monday:`Lunedi`,Month:`Mese`,More:`Di più`,Name:`Nome`,"No active host found":`Nessun host attivo trovato`,"Nothing found":`Non abbiamo trovato nulla`,November:`novembre`,OK:`OK`,October:`ottobre`,Ok:`Ok`,"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`,"Operate two states":`Gestisci due stati`,"Operations with two states":`Operazioni con due stati`,"Paste your blocks here":`Incolla qui i tuoi blocchi`,Pause:`Pausa`,"Pause execution":`Metti in pausa l'esecuzione`,"Pause script":`Metti in pausa lo script`,"Phone:":`Telefono:`,"Please select object ID...":`Seleziona l'ID oggetto ...`,"Prettify the script":`Abbellire la sceneggiatura`,"Print some text in log":`Stampa del testo nel registro`,"Priority:":`Priorità:`,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`,Restart:`Ricomincia`,Result:`Risultato`,"Resume execution":`Riprendi esecuzione`,"Root folder":`Cartella root`,"Rules description":`Crea regole con i blocchi IF, THEN, ELSE`,"Run script":`Esegui script`,Sa:`Sa`,Saturday:`Sabato`,Save:`Salva`,"Save all":`Salva tutto`,"Say It":`Say It`,"Say some text via sayit adapter":`Pronuncia del testo tramite l'adattatore sayit`,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...`,"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:`settembre`,"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:`Simulare`,"Some files will be rejected":`Alcuni file verranno rifiutati`,"Sound:":`Suono:`,Stack:`Stack`,Start:`Cominciare`,"Start script":`Avvia script`,State:`Stato`,"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:`Su`,"Subject:":`Soggetto:`,Sunday:`Domenica`,"TS description":`Creare regole scrivendo dattiloscritto`,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`,Time:`Tempo`,"Time condition":`Condizione temporale`,"Title:":`Titolo:`,"To:":`Per:`,"Trigger with value":`Trigger con valore`,Triggered:`Innescato`,Triggers:`Trigger`,"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:`Tu`,Tuesday:`martedì`,URL:`URL`,"Unknown error":`Errore sconosciuto`,"Unknown error!":`Errore sconosciuto!`,"User function":`Funzione utente`,"User:":`Utente:`,Value:`Valore`,"Vibration:":`Vibrazione:`,Volume:`Volume`,We:`3`,Wednesday:`mercoledì`,"Whatsapp-cmb":`Whatsapp-cmb`,Write:`Scrivi`,"Write your own code":`Scrivi il tuo codice`,Yes:`sì`,"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`,"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:`riconoscimento`,all:`tutti`,and:`e`,"as JSON":`come JSON`,"as plain text":`come testo`,astro:`astro`,at:`a`,"clear running":`chiara esecuzione`,control:`controllo`,copy:`copia`,cron:`CRON`,dawn:`alba`,debug_help:`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.`,debug_label:`Debug`,default:`predefinito`,dusk:`crepuscolo`,easy:`facile`,else:`altro`,"equal to":`uguale a`,every:`ogni`,"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:`Funzione`,filter_id:`ID`,filter_name:`Nome`,filter_role:`Ruolo`,filter_room:`Camera`,"for edit or create script":`per modificare o creare un nuovo script`,"for professionals":`per i professionisti`,"for programmers":`per i programmatori`,goldenHour:`Ora d'oro`,goldenHourEnd:`Fine dell'ora d'oro`,"greater or equal":`maggiore o uguale`,"greater or equal to":`maggiore o uguale a`,"greater than":`più grande di`,help_just_check:`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.`,help_on_change:`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.`,"high priority":`priorità alta`,"high-priority":`priorità alta`,"highest priority":`massima priorità`,hours:`ore`,includes:`include`,interval:`intervallo`,"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:`Magia`,milliseconds:`millisecondi`,minutes:`minuti`,ms:`ms`,nadir:`nadir`,nauticalDawn:`Alba nautica`,nauticalDusk:`Crepuscolo nautico`,nextSunrise:`Prossima alba`,nextSunset:`Prossimo tramonto`,night:`Notte`,nightEnd:`Fine della notte`,"no blocks found":`Nessun blocco trovato`,"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`,"on change":`sul cambiamento`,"on condition change":`a cambio di condizione`,"on update":`in aggiornamento`,one:`uno`,or:`o`,quiet:`silenzioso`,"reset search":`resetta la ricerca`,search:`ricerca`,seconds:`secondi`,solarNoon:`Mezzogiorno solare`,"store in":`conservare in`,sunrise:`Alba`,sunriseEnd:`Fine dell'alba`,sunset:`tramonto`,sunsetStart:`Inizio del tramonto`,then:`poi`,"toggle value":`alterna valore`,tooltip_ack:`Riconoscere`,tooltip_from:`A partire dal`,tooltip_lc:`Ultima modifica`,tooltip_quality:`Qualità`,tooltip_ts:`timestamp`,tooltip_user:`Utente`,tooltip_value:`Valore`,true:`vero`,two:`Due`,undefined:`non definito`,update:`aggiornare`,"use seconds":`usa i secondi`,"use trigger value":`usa il trigger`,verbose_help:`Aggiunge l'output di debug al registro per molti comandi di sistema`,verbose_label:`Output di log dettagliati`,when:`quando`,with:`con`,"with date":`con data`,"with offset":`con offset`,wizard:`procedura guidata`,"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:`Riprova`,"No running javascript instance found":`Nessuna istanza JavaScript in esecuzione trovata`,"OID display mode":`Modalità di visualizzazione OID`,"Ask questions about your script, request changes, or generate new code.":`Fai domande sul tuo script, richiedi modifiche o genera nuovo codice.`,"to send":`per inviare`,"Thinking...":`Pensando...`,"AI suggested changes":`Modifiche suggerite dall'IA`,Accept:`Accetta`,Reject:`Rifiuta`,"No API keys configured":`Nessuna chiave API configurata`,"for new line":`per nuova riga`,"AI chat mode":`Modalità chat IA`,"Plain conversation. Use for questions, explanations, syntax help. Does not read or modify your scripts.":`Conversazione semplice. Usala per domande, spiegazioni e aiuto sulla sintassi. Non legge né modifica i tuoi script.`,'For larger models with tool support. The AI can read, create, and edit scripts, look up datapoints, and browse the object tree — useful for "create a script that...", "which scripts use this state?" or "analyze my light script".':`Per modelli più grandi con supporto degli strumenti. L'IA può leggere, creare e modificare script, cercare datapoint e sfogliare l'albero degli oggetti — utile per "crea uno script che...", "quali script usano questo state?" o "analizza il mio script delle luci".`,'For smaller models without tool support. Two-step script generator (plan then code) — useful for "create a script that..." or "write a Blockly rule for...". Output goes into the editor for smart-apply.':`Per modelli più piccoli senza supporto degli strumenti. Generatore di script in due passi (prima piano, poi codice) — utile per "crea uno script che..." o "scrivi una regola Blockly per...". L'output va nell'editor per smart-apply.`,"Plain conversation. Best for: general questions, syntax help, concept explanations.":`Conversazione semplice. Ideale per: domande generali, aiuto sulla sintassi, spiegazioni di concetti.`,"For larger models with tool support. Best for: creating, editing, or analyzing scripts; finding datapoint usages; inspecting the object tree.":`Per modelli più grandi con supporto degli strumenti. Ideale per: creare, modificare o analizzare script; trovare usi di datapoint; ispezionare l'albero degli oggetti.`,"For smaller models without tool support. Best for: creating new JavaScript/TypeScript or Blockly scripts from a description.":`Per modelli più piccoli senza supporto degli strumenti. Ideale per: creare nuovi script JavaScript/TypeScript o Blockly da una descrizione.`,"Mention scripts as context for the AI. Use @all for all scripts or @scriptName for a specific one.":`Menziona script come contesto per l'IA. Usa @tutti per tutti gli script o @nomeScript per uno specifico.`,Context:`Contesto`,"current script":`script corrente`,"all scripts":`tutti gli script`,devices:`dispositivi`,"Searching datapoints":`Ricerca punti dati`,"Reading value":`Lettura valore`,"Loading object info":`Caricamento info oggetto`,"Searching scripts":`Ricerca script`,"Reading script":`Lettura script`,"Loading script list":`Caricamento lista script`,"All scripts":`Tutti gli script`,"Smart home devices":`Dispositivi smart home`,"AI Chat":`Chat IA`,"AI inline completions":`Completamento in linea IA`,"New chat":`Nuova chat`,"Ask about your script...":`Chiedi informazioni sul tuo script...`,"Insert blocks":`Inserisci blocchi`,"Apply blocks":`Applica blocchi`,Undo:`Annulla`,Redo:`Ripristina`,"Insert into editor":`Inserisci nell'editor`,"Show as diff":`Mostra come diff`,"Selected code as context":`Codice selezionato come contesto`,"Generating plan...":`Generazione piano...`,"Generating code...":`Generazione codice...`,Plan:`Piano`,"mention @all":`@tutti`,"mention @devices":`@dispositivi`,Send:`Invia`,Copy:`Copia`,"AI inline chat":`Chat IA integrata`,'e.g. "Refactor this to use async/await"':`es. "Refactor this to use async/await"`,"Open in chat":`Apri in chat`,"Selection: %s line(s)":`Selezione: %s riga/e`,"No selection — the question will use context from the whole script.":`Nessuna selezione — la domanda userà il contesto dell'intero script.`,"Please enter a question.":`Inserisci una domanda.`,"Thinking…":`Sto pensando…`,"Code proposal — press Apply to replace your selection.":`Proposta di codice — premi Applica per sostituire la selezione.`,"Plain text answer.":`Risposta testuale.`,"Show more details":`Mostra più dettagli`,"AI: Inline chat…":`IA: Chat integrata…`,"AI: Explain":`IA: Spiega`,"AI: Refactor":`IA: Rifattorizza`,"AI: Add comments":`IA: Aggiungi commenti`,"AI: Fix problem":`IA: Correggi problema`,"AI: Suggest tests":`IA: Suggerisci test`,"Ask the AI about the selected code:":`Chiedi all'IA riguardo al codice selezionato:`,Explain:`Spiega`,Refactor:`Rifattorizza`,Tests:`Test`,"Explain %s %s":`Spiega %s %s`,"Refactor %s %s":`Rifattorizza %s %s`,"Suggest tests for %s %s":`Suggerisci test per %s %s`,"Apply changes":`Applica modifiche`,"Discard changes":`Annulla modifiche`,'Ask anything, or request a change (e.g. "what does this do?")':`Chiedi qualsiasi cosa o richiedi una modifica (es. "cosa fa questo?")`,Wizard:`Assistente`,"Create a rule step by step":`Crea una regola passo dopo passo`,Summary:`Riepilogo`,Back:`Indietro`,Next:`Avanti`,Skip:`Salta`,"Create rule":`Crea regola`,"Replace rule":`Sostituisci regola`,"The current rule will be replaced":`La regola attuale verrà sostituita`,"Add another":`Aggiungi un altro`,"Without a condition the rule always runs":`Senza condizione la regola viene sempre eseguita`,"What should start the rule?":`Che cosa deve avviare la regola?`,"When should the rule run? This step is optional.":`Quando deve essere eseguita la regola? Questo passaggio è facoltativo.`,"What should happen?":`Che cosa deve succedere?`,"Block not found":`Blocco non trovato`,Weekday:`Giorno della settimana`,"Let the rule run only on the selected days of the week":`Esegui la regola solo nei giorni della settimana selezionati`,"Send to adapter":`Invia all'adattatore`,"Sends a message to any adapter instance":`Invia un messaggio a qualsiasi istanza di adattatore`,"Command:":`Comando:`,"JSON:":`JSON:`,"Sent:":`Inviato:`,"User condition":`Condizione utente`,"Write your own condition":`Scrivi la tua condizione`,"This is an advanced option. The code is the body of a function and must return the result, e.g. \"return getState('javascript.0.variable').val > 5;\". You may use await inside.":`Questa è un'opzione avanzata. Il codice è il corpo di una funzione e deve restituire il risultato con return, ad es. "return getState('javascript.0.variable').val > 5;". Puoi usare await al suo interno.`,"On message":`Al messaggio`,"Triggers the rule when another script or adapter sends a message":`Attiva la regola quando un altro script o adattatore invia un messaggio`,"Send the message from a script with messageTo({instance: 'javascript.0'}, 'myMessage', data). The sent data is available in the texts of the actions as %s.":`Invia il messaggio da uno script con messageTo({instance: 'javascript.0'}, 'myMessage', data). I dati inviati sono disponibili nei testi delle azioni come %s.`,"Message name:":`Nome del messaggio:`,"Received:":`Ricevuto:`,Notification:`Notifica`,"Creates an ioBroker notification, which is shown in the admin":`Crea una notifica ioBroker, che viene mostrata nell'admin`,"Notification text":`Testo della notifica`,"as alert":`come avviso`,Alert:`Avviso`,"Registered:":`Registrato:`,"Toggle between two values":`Alterna tra due valori`,"Switches a state back and forth between two values":`Commuta uno stato avanti e indietro tra due valori`,'If the state does not hold the first value, the first one is written - so the rule always ends up on a defined value. To invert a boolean, use the "toggle value" checkbox of the "Set state action" instead.':`Se lo stato non contiene il primo valore, viene scritto il primo - così la regola finisce sempre su un valore definito. Per invertire un booleano, usa invece la casella "toggle value" dell'azione "Set state action".`,between:`tra`,"Toggled:":`Commutato:`,"On file change":`Alla modifica di un file`,"Triggers the rule when a file of an object is written or deleted":`Attiva la regola quando un file di un oggetto viene scritto o eliminato`,'Both fields may contain *, e.g. the object "vis.0" and the file name "main/*". In the texts of the actions %s is the name of the changed file and %id the object it belongs to. Requires js-controller 4.1 or newer.':`Entrambi i campi possono contenere *, ad es. l'oggetto "vis.0" e il nome del file "main/*". Nei testi delle azioni %s è il nome del file modificato e %id l'oggetto a cui appartiene. Richiede js-controller 4.1 o successivo.`,"Files of:":`File di:`,"File name:":`Nome del file:`,"File changed:":`File modificato:`,"Deleted:":`Eliminato:`,File:`File`,"On object change":`Alla modifica di un oggetto`,"Triggers the rule when an object is created, changed or deleted":`Attiva la regola quando un oggetto viene creato, modificato o eliminato`,'This reacts to the object itself, not to its value - use the "State" trigger for values. The pattern may contain *, e.g. "hm-rpc.0.*". In the texts of the actions %s and %id are the id of the changed object.':`Reagisce all'oggetto stesso, non al suo valore: per i valori usa il trigger "State". Il modello può contenere *, ad es. "hm-rpc.0.*". Nei testi delle azioni %s e %id sono l'id dell'oggetto modificato.`,"Object ID:":`ID oggetto:`,"React on:":`Reagisci a:`,"any change":`qualsiasi modifica`,"created or changed":`creato o modificato`,deleted:`eliminato`,"Object changed:":`Oggetto modificato:`,"Object deleted:":`Oggetto eliminato:`,"On log message":`Al messaggio di log`,"Triggers the rule when something is written to the ioBroker log":`Attiva la regola quando qualcosa viene scritto nel log di ioBroker`,'Leave "Contains" empty to react to every entry of that level. Fill it in if an action of this rule writes to the log itself - a rule that matches its own message can trigger itself. In the texts of the actions %s is the log message and %id the instance it came from.':`Lascia "Contiene" vuoto per reagire a ogni voce di quel livello. Compilalo se un'azione di questa regola scrive nel log: una regola che corrisponde al proprio messaggio può attivarsi da sola. Nei testi delle azioni %s è il messaggio di log e %id l'istanza da cui proviene.`,"Level:":`Livello:`,"Contains:":`Contiene:`,error:`error`,warn:`warn`,info:`info`,debug:`debug`,silly:`silly`,"any level":`qualsiasi livello`,"Logged:":`Registrato nel log:`,"Log contains":`Il log contiene`,"Every log entry":`Ogni voce del log`,"On rule stop":`All'arresto della regola`,"Runs the rule once more when it is stopped, saved or the adapter shuts down":`Esegue la regola un'ultima volta quando viene fermata, salvata o l'adattatore si arresta`,"The adapter waits for the actions, but only for the time set here - what does not fit is cut off. A rule can have only one block of this kind; a second one replaces the first.":`L'adattatore attende le azioni, ma solo per il tempo impostato qui: ciò che non ci sta viene interrotto. Una regola può avere un solo blocco di questo tipo; un secondo sostituisce il primo.`,"Wait at most:":`Attendi al massimo:`,"HTTP error:":`Errore HTTP:`,"On enum member change":`Alla modifica di un membro di enum`,"Triggers the rule when any state of a room or function changes":`Attiva la regola quando cambia un qualsiasi stato di una stanza o funzione`,"Subscribes to every state of the selected enum and follows it: a device added to that room later is included without changing the rule. In the texts of the actions %s is the new value and %id the state that changed.":`Si iscrive a ogni stato dell'enum selezionato e lo segue: un dispositivo aggiunto in seguito viene incluso senza modificare la regola. Nei testi delle azioni %s è il nuovo valore e %id lo stato che è cambiato.`,"Members of:":`Membri di:`,"Any member of":`Qualsiasi membro di`,"Send message":`Invia messaggio`,"Sends a message to other scripts and rules":`Invia un messaggio ad altri script e regole`,'Every rule with an "On message" trigger of the same name receives it, as does a script with onMessage(). You can use %s in the text to send the current trigger value or %id the triggered object ID.':`La riceve ogni regola con un trigger "Al messaggio" dello stesso nome, così come uno script con onMessage(). Con %s nel testo invii il valore corrente del trigger e con %id l'ID dell'oggetto attivato.`,"Set state if changed":`Imposta lo stato solo se cambia`,"Writes a state only if its value differs from the current one":`Scrive uno stato solo se il suo valore differisce da quello attuale`,'Use this instead of "Set state action" for rules that run often: an unchanged value is not written at all, so nothing subscribed to that state is woken up for nothing.':`Usalo al posto di "Set state action" per regole che girano spesso: un valore invariato non viene scritto affatto, quindi nulla di iscritto a quello stato viene svegliato inutilmente.`,"only if changed":`solo se cambiato`,"A block failed while generating the script, so the changes cannot be saved":`Un blocco ha causato un errore durante la generazione dello script, le modifiche non possono essere salvate`,"Blockly error":`Errore Blockly`,"Export error":`Errore di esportazione`},KA={"%s not found":`%s niet gevonden`,"()":`()`,"(at %s)":`(op %s)`,"(optional)":`(optioneel)`,"-":`-`,".":`.`,Ack:`Erkend`,Actions:`Acties`,"Actual time of day":`Werkelijke tijd van de dag`,Add:`Toevoegen`,"Add new script":`Nieuw script toevoegen`,All:`Alle`,"All files will be accepted":`Alle bestanden worden geaccepteerd`,Any:`Ieder`,"Any month":`Elke maand`,Apply:`Solliciteer`,April:`april`,"Are you sure?":`Weet je zeker dat?`,Ask:`Vragen`,Astronomical:`Astronomisch`,"Astronomical events today":`Astronomische gebeurtenissen vandaag`,August:`augustus`,"Blockly description":`Regels maken door grafische blokken`,"Body:":`Lichaam:`,Cancel:`annuleren`,"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:`Dichtbij`,"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:`Staat`,Conditions:`Voorwaarden`,"Configuration not saved.":`Configuratie niet opgeslagen.`,Console:`Troosten`,"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:`Gekopieerd`,"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:`december`,Default:`Standaard`,"Define cron...":`Definieer cron ...`,"Define schedule...":`Definieer schema ...`,Delay:`Vertraging`,Delete:`Verwijder`,"Delete %s":`%s verwijderen ...`,"Delete folder":`Verwijder map`,"Delete script":`Script verwijderen`,Description:`Beschrijving`,"Deselect all":`Deselecteer alles`,"Discard changes for %s":`Wijzigingen voor %s annuleren`,Done:`Gedaan`,"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`,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:`Exec shell`,"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:`Uitleg`,Export:`Exporteren`,"Export all scripts":`Exporteer alle scripts`,"Export blocks":`Blokken exporteren`,"Export selected blocks":`Exporteer geselecteerde blokken`,Februar:`Februari`,February:`februari`,Filter:`Filter`,Folder:`Map`,Fr:`Vr`,Friday:`vrijdag`,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:`ID kaart`,ID1:`ID1`,ID2:`ID2`,Import:`Importeren`,"Import blocks":`Blokken importeren`,"Import error":`Importfout`,"Import scripts":`Scripts importeren`,"Insert object ID":`Object-ID invoegen`,Instance:`Voorbeeld`,"Instance is disabled":`Exemplaar is uitgeschakeld`,"Instance:":`Voorbeeld:`,Instances:`Instanties`,Instructions:`Instructies`,"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:`Januar`,January:`januari`,July:`juli`,June:`juni`,"Just check":`Kijk maar`,"Keep my changes":`Mijn wijzigingen behouden`,"Language:":`Taal:`,"Learn More":`Leer meer`,"Light style":`Lichte stijl`,Limit:`Begrenzing`,"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:`maart`,"March ":`maart`,May:`mei`,Menu:`Menu`,Message:`Bericht`,Mo:`Ma`,Model:`Model`,Monday:`maandag`,Month:`Maand`,More:`Meer`,Name:`Naam`,"No active host found":`Geen actieve host gevonden`,"Nothing found":`Niets gevonden`,November:`november`,OK:`OK`,October:`oktober`,Ok:`OK`,"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`,"Operate two states":`Bedien twee toestanden:`,"Operations with two states":`Bewerkingen met twee toestanden`,"Paste your blocks here":`Plak hier je blokken`,Pause:`Pauze`,"Pause execution":`Uitvoering pauzeren`,"Pause script":`Pauzeer script`,"Phone:":`Telefoon:`,"Please select object ID...":`Selecteer object-ID ...`,"Prettify the script":`Maak het script mooier`,"Print some text in log":`Druk wat tekst af in het logboek`,"Priority:":`Prioriteit:`,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`,Restart:`Herstarten`,Result:`Resultaat`,"Resume execution":`Uitvoering hervatten`,"Root folder":`Hoofdmap`,"Rules description":`Maak regels met IF, THEN, ELSE blokken`,"Run script":`Voer script uit`,Sa:`Za`,Saturday:`zaterdag`,Save:`Opslaan`,"Save all":`Sla alles op`,"Say It":`Say It`,"Say some text via sayit adapter":`Zeg wat tekst via de sayit-adapter`,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...`,"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:`september`,"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:`Simuleren`,"Some files will be rejected":`Sommige bestanden worden geweigerd`,"Sound:":`Geluid:`,Stack:`Stack`,Start:`Begin`,"Start script":`Start het script`,State:`Staat`,"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:`Zo`,"Subject:":`Onderwerpen:`,Sunday:`zondag`,"TS description":`Regels maken door Typescript te schrijven`,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`,Time:`Tijd`,"Time condition":`Tijdsvoorwaarde`,"Title:":`Titel:`,"To:":`Naar:`,"Trigger with value":`Trigger met waarde`,Triggered:`Veroorzaakt`,Triggers:`Triggers`,"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:`Di`,Tuesday:`dinsdag`,URL:`URL`,"Unknown error":`Onbekende fout`,"Unknown error!":`Onbekende fout!`,"User function":`Gebruikersfunctie`,"User:":`Gebruiker:`,Value:`Waarde`,"Vibration:":`Trilling:`,Volume:`Volume`,We:`3`,Wednesday:`woensdag`,"Whatsapp-cmb":`Whatsapp-cmb`,Write:`Schrijven`,"Write your own code":`Schrijf je eigen code`,Yes:`Ja`,"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`,"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:`erkenning`,all:`alle`,and:`en`,"as JSON":`als JSON`,"as plain text":`als platte tekst`,astro:`astro`,at:`Bij`,"clear running":`duidelijk rennen`,control:`controle`,copy:`kopiëren`,cron:`cron`,dawn:`dageraad`,debug_help:`Dit is een speciale modus waarin toestanden en objecten niet veranderen. Maar alleen informatie over elke geplande wijziging wordt in het protocol weergegeven.`,debug_label:`Debuggen`,default:`standaard`,dusk:`schemer`,easy:`eenvoudig`,else:`anders`,"equal to":`gelijk aan`,every:`elke`,"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:`Functie`,filter_id:`ID kaart`,filter_name:`Naam`,filter_role:`Rol`,filter_room:`Kamer`,"for edit or create script":`voor bewerken of een nieuw script maken`,"for professionals":`voor professionals`,"for programmers":`voor programmeurs`,goldenHour:`gouden uur`,goldenHourEnd:`Einde van gouden uur`,"greater or equal":`groter of gelijk`,"greater or equal to":`groter of gelijk aan`,"greater than":`groter dan`,help_just_check:`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.`,help_on_change:`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.`,"high priority":`hoge prioriteit`,"high-priority":`hoge prioriteit`,"highest priority":`hoogste prioriteit`,hours:`uren`,includes:`omvat`,interval:`interval`,"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:`magie`,milliseconds:`milliseconden`,minutes:`minuten`,ms:`ms`,nadir:`nadir`,nauticalDawn:`Nautische dageraad`,nauticalDusk:`Nautische schemering`,nextSunrise:`Volgende zonsopgang`,nextSunset:`Volgende zonsondergang`,night:`nacht`,nightEnd:`Einde van de nacht`,"no blocks found":`Geen blokken gevonden`,"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`,"on change":`bij verandering`,"on condition change":`op voorwaarde verandering`,"on update":`bij update`,one:`een`,or:`of`,quiet:`stil`,"reset search":`reset zoeken`,search:`zoeken`,seconds:`seconden`,solarNoon:`Zonne-middag`,"store in":`opslaan in`,sunrise:`zonsopkomst`,sunriseEnd:`Einde zonsopgang`,sunset:`zonsondergang`,sunsetStart:`Begin van de zonsondergang`,then:`vervolgens`,"toggle value":`schakelwaarde`,tooltip_ack:`Erkennen`,tooltip_from:`Van`,tooltip_lc:`Laatst gewijzigd`,tooltip_quality:`Kwaliteit`,tooltip_ts:`tijdstempel`,tooltip_user:`Gebruiker`,tooltip_value:`Waarde`,true:`waar`,two:`twee`,undefined:`ongedefinieerd`,update:`bijwerken`,"use seconds":`gebruik seconden`,"use trigger value":`triggerwaarde gebruiken`,verbose_help:`Voegt foutopsporingsuitvoer toe aan het logboek voor veel systeemopdrachten`,verbose_label:`Uitgebreide log-uitgangen`,when:`wanneer`,with:`met`,"with date":`met datum`,"with offset":`met offset`,wizard:`tovenaar`,"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:`Opnieuw proberen`,"No running javascript instance found":`Geen draaiende JavaScript-instantie gevonden`,"OID display mode":`OID-weergavemodus`,"Ask questions about your script, request changes, or generate new code.":`Stel vragen over je script, vraag wijzigingen aan of genereer nieuwe code.`,"to send":`om te verzenden`,"Thinking...":`Nadenken...`,"AI suggested changes":`Door AI voorgestelde wijzigingen`,Accept:`Accepteren`,Reject:`Afwijzen`,"No API keys configured":`Geen API-sleutels geconfigureerd`,"for new line":`voor nieuwe regel`,"AI chat mode":`AI-chatmodus`,"Plain conversation. Use for questions, explanations, syntax help. Does not read or modify your scripts.":`Gewoon gesprek. Gebruik voor vragen, uitleg en syntaxishulp. Leest of wijzigt je scripts niet.`,'For larger models with tool support. The AI can read, create, and edit scripts, look up datapoints, and browse the object tree — useful for "create a script that...", "which scripts use this state?" or "analyze my light script".':`Voor grotere modellen met tool-ondersteuning. De AI kan scripts lezen, aanmaken en bewerken, datapunten opzoeken en door de objectboom bladeren — handig voor "maak een script dat...", "welke scripts gebruiken deze state?" of "analyseer mijn licht-script".`,'For smaller models without tool support. Two-step script generator (plan then code) — useful for "create a script that..." or "write a Blockly rule for...". Output goes into the editor for smart-apply.':`Voor kleinere modellen zonder tool-ondersteuning. Scriptgenerator in twee stappen (eerst plan, dan code) — handig voor "maak een script dat..." of "schrijf een Blockly-regel voor...". Het resultaat komt in de editor voor smart-apply.`,"Plain conversation. Best for: general questions, syntax help, concept explanations.":`Gewoon gesprek. Het beste voor: algemene vragen, syntaxishulp, concept-uitleg.`,"For larger models with tool support. Best for: creating, editing, or analyzing scripts; finding datapoint usages; inspecting the object tree.":`Voor grotere modellen met tool-ondersteuning. Het beste voor: scripts maken, bewerken of analyseren; datapuntgebruik vinden; objectboom inspecteren.`,"For smaller models without tool support. Best for: creating new JavaScript/TypeScript or Blockly scripts from a description.":`Voor kleinere modellen zonder tool-ondersteuning. Het beste voor: nieuwe JavaScript/TypeScript- of Blockly-scripts maken op basis van een beschrijving.`,"Mention scripts as context for the AI. Use @all for all scripts or @scriptName for a specific one.":`Vermeld scripts als context voor de AI. Gebruik @alle voor alle scripts of @scriptnaam voor een specifiek script.`,Context:`Context`,"current script":`huidig script`,"all scripts":`alle scripts`,devices:`apparaten`,"Searching datapoints":`Datapunten zoeken`,"Reading value":`Waarde lezen`,"Loading object info":`Objectinfo laden`,"Searching scripts":`Scripts zoeken`,"Reading script":`Script lezen`,"Loading script list":`Scriptlijst laden`,"All scripts":`Alle scripts`,"Smart home devices":`Slimme apparaten`,"AI Chat":`AI Chat`,"AI inline completions":`AI inline-aanvullingen`,"New chat":`Nieuwe chat`,"Ask about your script...":`Stel een vraag over je script...`,"Insert blocks":`Blokken invoegen`,"Apply blocks":`Blokken toepassen`,Undo:`Ongedaan maken`,Redo:`Opnieuw`,"Insert into editor":`In editor invoegen`,"Show as diff":`Als diff tonen`,"Selected code as context":`Geselecteerde code als context`,"Generating plan...":`Plan genereren...`,"Generating code...":`Code genereren...`,Plan:`Plan`,"mention @all":`@alle`,"mention @devices":`@apparaten`,Send:`Verzenden`,Copy:`Kopiëren`,"AI inline chat":`AI inline chat`,'e.g. "Refactor this to use async/await"':`bv. "Refactor this to use async/await"`,"Open in chat":`Open in chat`,"Selection: %s line(s)":`Selectie: %s regel(s)`,"No selection — the question will use context from the whole script.":`Geen selectie — de vraag gebruikt de context van het hele script.`,"Please enter a question.":`Voer een vraag in.`,"Thinking…":`Denken…`,"Code proposal — press Apply to replace your selection.":`Codevoorstel — druk op Toepassen om de selectie te vervangen.`,"Plain text answer.":`Tekstantwoord.`,"Show more details":`Meer details tonen`,"AI: Inline chat…":`AI: Inline chat…`,"AI: Explain":`AI: Uitleggen`,"AI: Refactor":`AI: Refactoren`,"AI: Add comments":`AI: Commentaar toevoegen`,"AI: Fix problem":`AI: Probleem oplossen`,"AI: Suggest tests":`AI: Tests voorstellen`,"Ask the AI about the selected code:":`Vraag de AI over de geselecteerde code:`,Explain:`Uitleggen`,Refactor:`Refactoren`,Tests:`Tests`,"Explain %s %s":`%s %s uitleggen`,"Refactor %s %s":`%s %s refactoren`,"Suggest tests for %s %s":`Tests voorstellen voor %s %s`,"Apply changes":`Wijzigingen toepassen`,"Discard changes":`Wijzigingen negeren`,'Ask anything, or request a change (e.g. "what does this do?")':`Stel een vraag of vraag een wijziging (bv. "wat doet dit?")`,Wizard:`Wizard`,"Create a rule step by step":`Een regel stap voor stap maken`,Summary:`Overzicht`,Back:`Terug`,Next:`Volgende`,Skip:`Overslaan`,"Create rule":`Regel maken`,"Replace rule":`Regel vervangen`,"The current rule will be replaced":`De huidige regel wordt vervangen`,"Add another":`Nog een toevoegen`,"Without a condition the rule always runs":`Zonder voorwaarde wordt de regel altijd uitgevoerd`,"What should start the rule?":`Wat moet de regel starten?`,"When should the rule run? This step is optional.":`Wanneer moet de regel worden uitgevoerd? Deze stap is optioneel.`,"What should happen?":`Wat moet er gebeuren?`,"Block not found":`Blok niet gevonden`,Weekday:`Weekdag`,"Let the rule run only on the selected days of the week":`De regel alleen op de geselecteerde weekdagen uitvoeren`,"Send to adapter":`Naar adapter sturen`,"Sends a message to any adapter instance":`Stuurt een bericht naar een willekeurige adapterinstantie`,"Command:":`Opdracht:`,"JSON:":`JSON:`,"Sent:":`Verzonden:`,"User condition":`Gebruikersvoorwaarde`,"Write your own condition":`Schrijf je eigen voorwaarde`,"This is an advanced option. The code is the body of a function and must return the result, e.g. \"return getState('javascript.0.variable').val > 5;\". You may use await inside.":`Dit is een geavanceerde optie. De code is de body van een functie en moet het resultaat met return teruggeven, bijv. "return getState('javascript.0.variable').val > 5;". Je mag await erin gebruiken.`,"On message":`Bij bericht`,"Triggers the rule when another script or adapter sends a message":`Activeert de regel wanneer een ander script of adapter een bericht stuurt`,"Send the message from a script with messageTo({instance: 'javascript.0'}, 'myMessage', data). The sent data is available in the texts of the actions as %s.":`Verstuur het bericht vanuit een script met messageTo({instance: 'javascript.0'}, 'myMessage', data). De verzonden gegevens zijn in de teksten van de acties beschikbaar als %s.`,"Message name:":`Berichtnaam:`,"Received:":`Ontvangen:`,Notification:`Melding`,"Creates an ioBroker notification, which is shown in the admin":`Maakt een ioBroker-melding die in de admin wordt getoond`,"Notification text":`Meldingstekst`,"as alert":`als waarschuwing`,Alert:`Waarschuwing`,"Registered:":`Geregistreerd:`,"Toggle between two values":`Wisselen tussen twee waarden`,"Switches a state back and forth between two values":`Schakelt een status heen en weer tussen twee waarden`,'If the state does not hold the first value, the first one is written - so the rule always ends up on a defined value. To invert a boolean, use the "toggle value" checkbox of the "Set state action" instead.':`Als de status niet de eerste waarde bevat, wordt de eerste geschreven - zo eindigt de regel altijd op een gedefinieerde waarde. Gebruik voor het omkeren van een boolean het selectievakje "toggle value" van de actie "Set state action".`,between:`tussen`,"Toggled:":`Omgeschakeld:`,"On file change":`Bij bestandswijziging`,"Triggers the rule when a file of an object is written or deleted":`Activeert de regel wanneer een bestand van een object wordt geschreven of verwijderd`,'Both fields may contain *, e.g. the object "vis.0" and the file name "main/*". In the texts of the actions %s is the name of the changed file and %id the object it belongs to. Requires js-controller 4.1 or newer.':`Beide velden mogen * bevatten, bijv. het object "vis.0" en de bestandsnaam "main/*". In de teksten van de acties is %s de naam van het gewijzigde bestand en %id het object waartoe het behoort. Vereist js-controller 4.1 of nieuwer.`,"Files of:":`Bestanden van:`,"File name:":`Bestandsnaam:`,"File changed:":`Bestand gewijzigd:`,"Deleted:":`Verwijderd:`,File:`Bestand`,"On object change":`Bij objectwijziging`,"Triggers the rule when an object is created, changed or deleted":`Activeert de regel wanneer een object wordt aangemaakt, gewijzigd of verwijderd`,'This reacts to the object itself, not to its value - use the "State" trigger for values. The pattern may contain *, e.g. "hm-rpc.0.*". In the texts of the actions %s and %id are the id of the changed object.':`Reageert op het object zelf, niet op de waarde ervan - gebruik de trigger "State" voor waarden. Het patroon mag * bevatten, bijv. "hm-rpc.0.*". In de teksten van de acties zijn %s en %id de id van het gewijzigde object.`,"Object ID:":`Object-ID:`,"React on:":`Reageren op:`,"any change":`elke wijziging`,"created or changed":`aangemaakt of gewijzigd`,deleted:`verwijderd`,"Object changed:":`Object gewijzigd:`,"Object deleted:":`Object verwijderd:`,"On log message":`Bij logbericht`,"Triggers the rule when something is written to the ioBroker log":`Activeert de regel wanneer er iets naar het ioBroker-logboek wordt geschreven`,'Leave "Contains" empty to react to every entry of that level. Fill it in if an action of this rule writes to the log itself - a rule that matches its own message can trigger itself. In the texts of the actions %s is the log message and %id the instance it came from.':`Laat "Bevat" leeg om op elke regel van dat niveau te reageren. Vul het in als een actie van deze regel zelf naar het logboek schrijft - een regel die op zijn eigen bericht past, kan zichzelf activeren. In de teksten van de acties is %s het logbericht en %id de instantie waar het vandaan komt.`,"Level:":`Niveau:`,"Contains:":`Bevat:`,error:`error`,warn:`warn`,info:`info`,debug:`debug`,silly:`silly`,"any level":`elk niveau`,"Logged:":`Gelogd:`,"Log contains":`Logboek bevat`,"Every log entry":`Elke logregel`,"On rule stop":`Bij het stoppen van de regel`,"Runs the rule once more when it is stopped, saved or the adapter shuts down":`Voert de regel nog één keer uit wanneer deze wordt gestopt, opgeslagen of de adapter afsluit`,"The adapter waits for the actions, but only for the time set here - what does not fit is cut off. A rule can have only one block of this kind; a second one replaces the first.":`De adapter wacht op de acties, maar alleen zolang als hier is ingesteld - wat er niet in past wordt afgebroken. Een regel kan maar één blok van dit type hebben; een tweede vervangt het eerste.`,"Wait at most:":`Maximaal wachten:`,"HTTP error:":`HTTP-fout:`,"On enum member change":`Bij wijziging in de enum`,"Triggers the rule when any state of a room or function changes":`Activeert de regel wanneer een willekeurige status van een ruimte of functie verandert`,"Subscribes to every state of the selected enum and follows it: a device added to that room later is included without changing the rule. In the texts of the actions %s is the new value and %id the state that changed.":`Abonneert op elke status van de gekozen enum en volgt deze: een later toegevoegd apparaat doet mee zonder de regel aan te passen. In de teksten van de acties is %s de nieuwe waarde en %id de status die veranderde.`,"Members of:":`Leden van:`,"Any member of":`Elk lid van`,"Send message":`Bericht sturen`,"Sends a message to other scripts and rules":`Stuurt een bericht naar andere scripts en regels`,'Every rule with an "On message" trigger of the same name receives it, as does a script with onMessage(). You can use %s in the text to send the current trigger value or %id the triggered object ID.':`Elke regel met een trigger "Bij bericht" van dezelfde naam ontvangt het, net als een script met onMessage(). Met %s in de tekst stuur je de huidige triggerwaarde en met %id de ID van het geactiveerde object.`,"Set state if changed":`Status alleen bij wijziging zetten`,"Writes a state only if its value differs from the current one":`Schrijft een status alleen als de waarde afwijkt van de huidige`,'Use this instead of "Set state action" for rules that run often: an unchanged value is not written at all, so nothing subscribed to that state is woken up for nothing.':`Gebruik dit in plaats van "Set state action" voor regels die vaak lopen: een ongewijzigde waarde wordt helemaal niet geschreven, dus niets dat op die status geabonneerd is wordt voor niets gewekt.`,"only if changed":`alleen bij wijziging`,"A block failed while generating the script, so the changes cannot be saved":`Een blok veroorzaakte een fout bij het genereren van het script, de wijzigingen kunnen niet worden opgeslagen`,"Blockly error":`Blockly-fout`,"Export error":`Exportfout`},qA={"%s not found":`%s nie znaleziono`,"()":`()`,"(at %s)":`(w %s)`,"(optional)":`(opcjonalny)`,"-":`-`,".":`.`,Ack:`Potwierdzony`,Actions:`Działania`,"Actual time of day":`Aktualna pora dnia`,Add:`Dodaj`,"Add new script":`Dodaj nowy skrypt`,All:`Wszystko`,"All files will be accepted":`Wszystkie pliki zostaną zaakceptowane`,Any:`Każdy`,"Any month":`Dowolny miesiąc`,Apply:`Zastosuj`,April:`Kwiecień`,"Are you sure?":`Jesteś pewny?`,Ask:`Zapytać`,Astronomical:`Astronomiczny`,"Astronomical events today":`Wydarzenia astronomiczne dzisiaj`,August:`Sierpień`,"Blockly description":`Tworzenie reguł za pomocą bloków graficznych`,"Body:":`Treść:`,Cancel:`Odwołaj`,"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:`Zamknij`,"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:`Stan`,Conditions:`Warunki`,"Configuration not saved.":`Konfiguracja nie została zapisana.`,Console:`Konsola`,"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:`Skopiowano`,"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:`Grudzień`,Default:`Domyślna`,"Define cron...":`Zdefiniuj CRON ...`,"Define schedule...":`Zdefiniuj harmonogram ...`,Delay:`Opóźnienie`,Delete:`Usuń`,"Delete %s":`Usuń %s ...`,"Delete folder":`Usuń folder`,"Delete script":`Usuń skrypt`,Description:`Opis`,"Deselect all":`Odznacz wszystkie`,"Discard changes for %s":`Odrzuć zmiany dla %s`,Done:`Gotowe`,"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`,Error:`Błąd`,"Error formatting code":`Błąd formatowania kodu`,"Error was found":`Błąd został znaleziony`,"Every day":`Codziennie`,Exec:`Uruchom shell`,"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:`Wyjaśnienie`,Export:`Eksport`,"Export all scripts":`Wyeksportuj wszystkie skrypty`,"Export blocks":`Eksportuj bloki`,"Export selected blocks":`Eksportuj wybrane bloki`,Februar:`Luty`,February:`Luty`,Filter:`Filtr`,Folder:`Folder`,Fr:`Pt`,Friday:`Piątek`,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:`ID`,ID1:`ID1`,ID2:`ID2`,Import:`Import`,"Import blocks":`Importuj bloki`,"Import error":`Błąd importowania`,"Import scripts":`Importuj skrypty`,"Insert object ID":`Wstaw identyfikator obiektu`,Instance:`Instancja`,"Instance is disabled":`Instancja jest wyłączona`,"Instance:":`Instancja:`,Instances:`Instancje`,Instructions:`Instrukcje`,"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:`Styczeń`,January:`Styczeń`,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`,Limit:`Limit`,"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:`Marzec`,"March ":`Marzec `,May:`Maj`,Menu:`Menu`,Message:`Wiadomość`,Mo:`Po`,Model:`Model`,Monday:`Poniedziałek`,Month:`Miesiąc`,More:`Więcej`,Name:`Nazwa`,"No active host found":`Nie znaleziono aktywnego hosta`,"Nothing found":`Nic nie znaleziono`,November:`Listopad`,OK:`OK`,October:`Październik`,Ok:`Ok`,"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`,"Operate two states":`Obsługuj dwa stany`,"Operations with two states":`Operacje z dwoma stanami`,"Paste your blocks here":`Wklej tutaj swoje bloki`,Pause:`Pauza`,"Pause execution":`Wstrzymaj wykonanie`,"Pause script":`Wstrzymaj skrypt`,"Phone:":`Telefon:`,"Please select object ID...":`Wybierz identyfikator obiektu ...`,"Prettify the script":`Upiększ skrypt`,"Print some text in log":`Wydrukuj tekst w dzienniku`,"Priority:":`Priorytet:`,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`,Restart:`Uruchom ponownie`,Result:`Wynik`,"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:`So`,Saturday:`Sobota`,Save:`Zapisz`,"Save all":`Zapisz wszystko`,"Say It":`Wypowiedz`,"Say some text via sayit adapter":`Powiedz tekst przez adapter sayit`,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...`,"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:`Wrzesień`,"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:`Symulacja`,"Some files will be rejected":`Niektóre pliki zostaną odrzucone`,"Sound:":`Dźwięk:`,Stack:`Stos`,Start:`Początek`,"Start script":`Uruchom skrypt`,State:`Stan`,"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:`Nd`,"Subject:":`Temat:`,Sunday:`Niedziela`,"TS description":`Tworzenie reguł w Typescript`,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`,Time:`Czas`,"Time condition":`Warunek czasowy`,"Title:":`Tytuł:`,"To:":`Do:`,"Trigger with value":`Wyzwalacz z wartością`,Triggered:`Wyzwolony`,Triggers:`Wyzwalacze`,"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:`Wt`,Tuesday:`Wtorek`,URL:`URL`,"Unknown error":`Nieznany błąd`,"Unknown error!":`Nieznany błąd!`,"User function":`Funkcja użytkownika`,"User:":`Użytkownik:`,Value:`Wartość`,"Vibration:":`Wibracja:`,Volume:`Wolumen`,We:`Śr`,Wednesday:`Środa`,"Whatsapp-cmb":`Whatsapp-cmb`,Write:`Pisać`,"Write your own code":`Napisz swój własny kod`,Yes:`Tak`,"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`,"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:`potwierdzenie`,all:`wszystko`,and:`i`,"as JSON":`jako JSON`,"as plain text":`jako zwykły tekst`,astro:`Astro`,at:`w`,"clear running":`czyste uruchomienie`,control:`kontrola`,copy:`Kopiuj`,cron:`CRON`,dawn:`Świt`,debug_help:`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.`,debug_label:`Odpluskwić`,default:`domyślna`,dusk:`Zmierzch`,easy:`łatwy`,else:`inaczej`,"equal to":`równy`,every:`każdy`,"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:`Funkcja`,filter_id:`ID`,filter_name:`Nazwa`,filter_role:`Rola`,filter_room:`Pokój`,"for edit or create script":`do edycji lub utwórz nowy skrypt`,"for professionals":`dla profesjonalistów`,"for programmers":`dla programistów`,goldenHour:`Złota godzina`,goldenHourEnd:`Koniec złotej godziny`,"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:`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.`,help_on_change:`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.`,"high priority":`wysoki priorytet`,"high-priority":`wysoki priorytet`,"highest priority":`najwyższy priorytet`,hours:`godziny`,includes:`zawiera`,interval:`interwał`,"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:`magia`,milliseconds:`milisekund`,minutes:`minuty`,ms:`ms`,nadir:`Północ słoneczna`,nauticalDawn:`Żeglarski świt`,nauticalDusk:`Żeglarski zmierzch`,nextSunrise:`Następny wschód słońca`,nextSunset:`Następny zachód słońca`,night:`Noc`,nightEnd:`Koniec nocy`,"no blocks found":`Nie znaleziono bloków`,"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`,"on change":`na zmianę`,"on condition change":`pod warunkiem zmiany warunków`,"on update":`po aktualizacji`,one:`jeden`,or:`lub`,quiet:`cisza`,"reset search":`zresetuj wyszukiwanie`,search:`Szukaj`,seconds:`sekundy`,solarNoon:`Południe słoneczne`,"store in":`przechowaj w`,sunrise:`Wschód słońca`,sunriseEnd:`Koniec wschodu słońca`,sunset:`Zachód słońca`,sunsetStart:`Początek zachodu słońca`,then:`następnie`,"toggle value":`wartość przełączania`,tooltip_ack:`Akceptuj`,tooltip_from:`Od`,tooltip_lc:`Ostatnia zmiana`,tooltip_quality:`Jakość`,tooltip_ts:`Znacznik czasu`,tooltip_user:`Użytkownik`,tooltip_value:`Wartość`,true:`prawda`,two:`dwa`,undefined:`nieokreślony`,update:`aktualizacja`,"use seconds":`użyj sekund`,"use trigger value":`użyj wartości wyzwalającej`,verbose_help:`Dodaje wyniki debugowania do dziennika dla wielu poleceń systemowych`,verbose_label:`Pełne dane wyjściowe dziennika`,when:`gdy`,with:`z`,"with date":`z datą`,"with offset":`z przesunięciem`,wizard:`Wizard`,"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:`Ponów próbę`,"No running javascript instance found":`Nie znaleziono uruchomionej instancji JavaScript`,"OID display mode":`Tryb wyświetlania OID`,"Ask questions about your script, request changes, or generate new code.":`Zadawaj pytania o swój skrypt, proś o zmiany lub generuj nowy kod.`,"to send":`aby wysłać`,"Thinking...":`Myślenie...`,"AI suggested changes":`Zmiany sugerowane przez AI`,Accept:`Akceptuj`,Reject:`Odrzuć`,"No API keys configured":`Brak skonfigurowanych kluczy API`,"for new line":`dla nowej linii`,"AI chat mode":`Tryb czatu AI`,"Plain conversation. Use for questions, explanations, syntax help. Does not read or modify your scripts.":`Zwykła rozmowa. Użyj do pytań, wyjaśnień i pomocy ze składnią. Nie czyta ani nie modyfikuje skryptów.`,'For larger models with tool support. The AI can read, create, and edit scripts, look up datapoints, and browse the object tree — useful for "create a script that...", "which scripts use this state?" or "analyze my light script".':`Dla większych modeli z obsługą narzędzi. AI może czytać, tworzyć i edytować skrypty, wyszukiwać datapointy i przeglądać drzewo obiektów — przydatne do "stwórz skrypt, który...", "które skrypty używają tego state?" lub "przeanalizuj mój skrypt świateł".`,'For smaller models without tool support. Two-step script generator (plan then code) — useful for "create a script that..." or "write a Blockly rule for...". Output goes into the editor for smart-apply.':`Dla mniejszych modeli bez obsługi narzędzi. Dwuetapowy generator skryptów (najpierw plan, potem kod) — przydatne do "stwórz skrypt, który..." lub "napisz regułę Blockly dla...". Wynik trafia do edytora do smart-apply.`,"Plain conversation. Best for: general questions, syntax help, concept explanations.":`Zwykła rozmowa. Najlepsze do: ogólnych pytań, pomocy ze składnią, wyjaśniania pojęć.`,"For larger models with tool support. Best for: creating, editing, or analyzing scripts; finding datapoint usages; inspecting the object tree.":`Dla większych modeli z obsługą narzędzi. Najlepsze do: tworzenia, edycji lub analizy skryptów; znajdowania użycia datapointów; przeglądania drzewa obiektów.`,"For smaller models without tool support. Best for: creating new JavaScript/TypeScript or Blockly scripts from a description.":`Dla mniejszych modeli bez obsługi narzędzi. Najlepsze do: tworzenia nowych skryptów JavaScript/TypeScript lub Blockly na podstawie opisu.`,"Mention scripts as context for the AI. Use @all for all scripts or @scriptName for a specific one.":`Wspomnij skrypty jako kontekst dla AI. Użyj @wszystkie dla wszystkich skryptów lub @nazwaSkryptu dla konkretnego.`,Context:`Kontekst`,"current script":`bieżący skrypt`,"all scripts":`wszystkie skrypty`,devices:`urządzenia`,"Searching datapoints":`Wyszukiwanie punktów danych`,"Reading value":`Odczyt wartości`,"Loading object info":`Ładowanie informacji o obiekcie`,"Searching scripts":`Wyszukiwanie skryptów`,"Reading script":`Odczyt skryptu`,"Loading script list":`Ładowanie listy skryptów`,"All scripts":`Wszystkie skrypty`,"Smart home devices":`Urządzenia inteligentnego domu`,"AI Chat":`Czat AI`,"AI inline completions":`Uzupełnianie w linii AI`,"New chat":`Nowy czat`,"Ask about your script...":`Zapytaj o swój skrypt...`,"Insert blocks":`Wstaw bloki`,"Apply blocks":`Zastosuj bloki`,Undo:`Cofnij`,Redo:`Ponów`,"Insert into editor":`Wstaw do edytora`,"Show as diff":`Pokaż jako diff`,"Selected code as context":`Zaznaczony kod jako kontekst`,"Generating plan...":`Generowanie planu...`,"Generating code...":`Generowanie kodu...`,Plan:`Plan`,"mention @all":`@wszystkie`,"mention @devices":`@urządzenia`,Send:`Wyślij`,Copy:`Kopiuj`,"AI inline chat":`Wbudowany czat AI`,'e.g. "Refactor this to use async/await"':`np. "Refactor this to use async/await"`,"Open in chat":`Otwórz w czacie`,"Selection: %s line(s)":`Zaznaczenie: %s wiersz(y)`,"No selection — the question will use context from the whole script.":`Brak zaznaczenia — pytanie użyje kontekstu całego skryptu.`,"Please enter a question.":`Wpisz pytanie.`,"Thinking…":`Myślę…`,"Code proposal — press Apply to replace your selection.":`Propozycja kodu — naciśnij Zastosuj, aby zastąpić zaznaczenie.`,"Plain text answer.":`Odpowiedź tekstowa.`,"Show more details":`Pokaż więcej szczegółów`,"AI: Inline chat…":`AI: Wbudowany czat…`,"AI: Explain":`AI: Wyjaśnij`,"AI: Refactor":`AI: Refaktoryzuj`,"AI: Add comments":`AI: Dodaj komentarze`,"AI: Fix problem":`AI: Napraw problem`,"AI: Suggest tests":`AI: Zaproponuj testy`,"Ask the AI about the selected code:":`Zapytaj AI o zaznaczony kod:`,Explain:`Wyjaśnij`,Refactor:`Refaktoryzuj`,Tests:`Testy`,"Explain %s %s":`Wyjaśnij %s %s`,"Refactor %s %s":`Refaktoryzuj %s %s`,"Suggest tests for %s %s":`Zaproponuj testy dla %s %s`,"Apply changes":`Zastosuj zmiany`,"Discard changes":`Odrzuć zmiany`,'Ask anything, or request a change (e.g. "what does this do?")':`Zapytaj o cokolwiek lub poproś o zmianę (np. "co to robi?")`,Wizard:`Kreator`,"Create a rule step by step":`Utwórz regułę krok po kroku`,Summary:`Podsumowanie`,Back:`Wstecz`,Next:`Dalej`,Skip:`Pomiń`,"Create rule":`Utwórz regułę`,"Replace rule":`Zastąp regułę`,"The current rule will be replaced":`Bieżąca reguła zostanie zastąpiona`,"Add another":`Dodaj kolejny`,"Without a condition the rule always runs":`Bez warunku reguła wykonuje się zawsze`,"What should start the rule?":`Co ma uruchamiać regułę?`,"When should the rule run? This step is optional.":`Kiedy reguła ma być wykonywana? Ten krok jest opcjonalny.`,"What should happen?":`Co ma się stać?`,"Block not found":`Nie znaleziono bloku`,Weekday:`Dzień tygodnia`,"Let the rule run only on the selected days of the week":`Wykonuj regułę tylko w wybrane dni tygodnia`,"Send to adapter":`Wyślij do adaptera`,"Sends a message to any adapter instance":`Wysyła wiadomość do dowolnej instancji adaptera`,"Command:":`Polecenie:`,"JSON:":`JSON:`,"Sent:":`Wysłano:`,"User condition":`Warunek użytkownika`,"Write your own condition":`Napisz swój własny warunek`,"This is an advanced option. The code is the body of a function and must return the result, e.g. \"return getState('javascript.0.variable').val > 5;\". You may use await inside.":`To jest opcja zaawansowana. Kod jest ciałem funkcji i musi zwrócić wynik przez return, np. "return getState('javascript.0.variable').val > 5;". Możesz używać await w środku.`,"On message":`Po otrzymaniu wiadomości`,"Triggers the rule when another script or adapter sends a message":`Wyzwala regułę, gdy inny skrypt lub adapter wyśle wiadomość`,"Send the message from a script with messageTo({instance: 'javascript.0'}, 'myMessage', data). The sent data is available in the texts of the actions as %s.":`Wyślij wiadomość ze skryptu za pomocą messageTo({instance: 'javascript.0'}, 'myMessage', data). Wysłane dane są dostępne w tekstach akcji jako %s.`,"Message name:":`Nazwa wiadomości:`,"Received:":`Odebrano:`,Notification:`Powiadomienie`,"Creates an ioBroker notification, which is shown in the admin":`Tworzy powiadomienie ioBroker, które jest wyświetlane w adminie`,"Notification text":`Tekst powiadomienia`,"as alert":`jako alert`,Alert:`Alert`,"Registered:":`Zarejestrowano:`,"Toggle between two values":`Przełącz między dwiema wartościami`,"Switches a state back and forth between two values":`Przełącza stan tam i z powrotem między dwiema wartościami`,'If the state does not hold the first value, the first one is written - so the rule always ends up on a defined value. To invert a boolean, use the "toggle value" checkbox of the "Set state action" instead.':`Jeśli stan nie zawiera pierwszej wartości, zapisywana jest pierwsza - dzięki temu reguła zawsze kończy na zdefiniowanej wartości. Aby odwrócić wartość logiczną, użyj pola "toggle value" akcji "Set state action".`,between:`między`,"Toggled:":`Przełączono:`,"On file change":`Przy zmianie pliku`,"Triggers the rule when a file of an object is written or deleted":`Wyzwala regułę, gdy plik obiektu zostanie zapisany lub usunięty`,'Both fields may contain *, e.g. the object "vis.0" and the file name "main/*". In the texts of the actions %s is the name of the changed file and %id the object it belongs to. Requires js-controller 4.1 or newer.':`Oba pola mogą zawierać *, np. obiekt "vis.0" i nazwa pliku "main/*". W tekstach akcji %s to nazwa zmienionego pliku, a %id obiekt, do którego należy. Wymaga js-controller 4.1 lub nowszego.`,"Files of:":`Pliki obiektu:`,"File name:":`Nazwa pliku:`,"File changed:":`Plik zmieniony:`,"Deleted:":`Usunięto:`,File:`Plik`,"On object change":`Przy zmianie obiektu`,"Triggers the rule when an object is created, changed or deleted":`Wyzwala regułę, gdy obiekt zostanie utworzony, zmieniony lub usunięty`,'This reacts to the object itself, not to its value - use the "State" trigger for values. The pattern may contain *, e.g. "hm-rpc.0.*". In the texts of the actions %s and %id are the id of the changed object.':`Reaguje na sam obiekt, a nie na jego wartość - dla wartości użyj wyzwalacza "State". Wzorzec może zawierać *, np. "hm-rpc.0.*". W tekstach akcji %s i %id to id zmienionego obiektu.`,"Object ID:":`ID obiektu:`,"React on:":`Reaguj na:`,"any change":`każdą zmianę`,"created or changed":`utworzony lub zmieniony`,deleted:`usunięty`,"Object changed:":`Obiekt zmieniony:`,"Object deleted:":`Obiekt usunięty:`,"On log message":`Przy wpisie w dzienniku`,"Triggers the rule when something is written to the ioBroker log":`Wyzwala regułę, gdy coś zostanie zapisane w dzienniku ioBroker`,'Leave "Contains" empty to react to every entry of that level. Fill it in if an action of this rule writes to the log itself - a rule that matches its own message can trigger itself. In the texts of the actions %s is the log message and %id the instance it came from.':`Pozostaw "Zawiera" puste, aby reagować na każdy wpis tego poziomu. Wypełnij, jeśli akcja tej reguły sama pisze do dziennika - reguła pasująca do własnego komunikatu może wyzwolić samą siebie. W tekstach akcji %s to komunikat dziennika, a %id instancja, z której pochodzi.`,"Level:":`Poziom:`,"Contains:":`Zawiera:`,error:`error`,warn:`warn`,info:`info`,debug:`debug`,silly:`silly`,"any level":`każdy poziom`,"Logged:":`Zapisano w dzienniku:`,"Log contains":`Dziennik zawiera`,"Every log entry":`Każdy wpis dziennika`,"On rule stop":`Przy zatrzymaniu reguły`,"Runs the rule once more when it is stopped, saved or the adapter shuts down":`Wykonuje regułę jeszcze raz, gdy zostanie zatrzymana, zapisana lub adapter się wyłącza`,"The adapter waits for the actions, but only for the time set here - what does not fit is cut off. A rule can have only one block of this kind; a second one replaces the first.":`Adapter czeka na akcje, ale tylko przez ustawiony tutaj czas - to, co się nie zmieści, zostanie przerwane. Reguła może mieć tylko jeden blok tego typu; drugi zastępuje pierwszy.`,"Wait at most:":`Czekaj najwyżej:`,"HTTP error:":`Błąd HTTP:`,"On enum member change":`Przy zmianie członka wyliczenia`,"Triggers the rule when any state of a room or function changes":`Wyzwala regułę, gdy zmieni się dowolny stan pomieszczenia lub funkcji`,"Subscribes to every state of the selected enum and follows it: a device added to that room later is included without changing the rule. In the texts of the actions %s is the new value and %id the state that changed.":`Subskrybuje każdy stan wybranego wyliczenia i podąża za nim: urządzenie dodane później jest uwzględniane bez zmiany reguły. W tekstach akcji %s to nowa wartość, a %id stan, który się zmienił.`,"Members of:":`Członkowie:`,"Any member of":`Dowolny członek`,"Send message":`Wyślij wiadomość`,"Sends a message to other scripts and rules":`Wysyła wiadomość do innych skryptów i reguł`,'Every rule with an "On message" trigger of the same name receives it, as does a script with onMessage(). You can use %s in the text to send the current trigger value or %id the triggered object ID.':`Otrzyma ją każda reguła z wyzwalaczem "Po otrzymaniu wiadomości" o tej samej nazwie, a także skrypt z onMessage(). Za pomocą %s w tekście wysyłasz bieżącą wartość wyzwalacza, a %id ID wyzwolonego obiektu.`,"Set state if changed":`Ustaw stan tylko przy zmianie`,"Writes a state only if its value differs from the current one":`Zapisuje stan tylko wtedy, gdy jego wartość różni się od bieżącej`,'Use this instead of "Set state action" for rules that run often: an unchanged value is not written at all, so nothing subscribed to that state is woken up for nothing.':`Używaj zamiast "Set state action" w regułach uruchamianych często: niezmieniona wartość w ogóle nie jest zapisywana, więc nic zasubskrybowanego do tego stanu nie jest budzone na darmo.`,"only if changed":`tylko przy zmianie`,"A block failed while generating the script, so the changes cannot be saved":`Jeden z bloków spowodował błąd podczas generowania skryptu, zmiany nie mogą zostać zapisane`,"Blockly error":`Błąd Blockly`,"Export error":`Błąd eksportu`},JA={"%s not found":`%s não encontrado`,"()":`()`,"(at %s)":`(em %s)`,"(optional)":`(opcional)`,"-":`-`,".":`.`,Ack:`Reconhecido`,Actions:`Ações`,"Actual time of day":`Hora real do dia`,Add:`Adicionar`,"Add new script":`Adicionar novo script`,All:`Todos`,"All files will be accepted":`Todos os arquivos serão aceitos`,Any:`Nenhum`,"Any month":`Qualquer mês`,Apply:`Aplique`,April:`abril`,"Are you sure?":`Você tem certeza?`,Ask:`Perguntar`,Astronomical:`Astronômico`,"Astronomical events today":`Eventos astronômicos hoje`,August:`agosto`,"Blockly description":`Criando regras por blocos gráficos`,"Body:":`Corpo:`,Cancel:`Cancelar`,"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:`Fechar`,"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:`Doença`,Conditions:`Condições`,"Configuration not saved.":`Configuração não esta salva.`,Console:`Console`,"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:`Copiado`,"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:`dezembro`,Default:`Predefinição`,"Define cron...":`Definir cron...`,"Define schedule...":`Definir agendamento ...`,Delay:`Atraso`,Delete:`Deletar`,"Delete %s":`Deletar %s...`,"Delete folder":`Deletar pasta`,"Delete script":`Deletar script`,Description:`Descrição`,"Deselect all":`Desmarcar todos`,"Discard changes for %s":`Descartar alterações para %s`,Done:`Pronto`,"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`,Error:`Erro`,"Error formatting code":`Erro de formatação de código`,"Error was found":`Erro foi encontrado`,"Every day":`Todos os dias`,Exec:`Exec shell`,"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:`Explicação`,Export:`Exportação`,"Export all scripts":`Exportar todos os scripts`,"Export blocks":`Exportar blocos`,"Export selected blocks":`Exportar blocos selecionados`,Februar:`Februar`,February:`fevereiro`,Filter:`Filtro`,Folder:`Pasta`,Fr:`Fr`,Friday:`Sexta-feira`,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:`ID`,ID1:`ID1`,ID2:`ID2`,Import:`Importar`,"Import blocks":`Importar blocos`,"Import error":`Erro de importação`,"Import scripts":`Importar script`,"Insert object ID":`Inserir ID do objeto`,Instance:`Instância`,"Instance is disabled":`Instância está desativada`,"Instance:":`Instância:`,Instances:`Instâncias`,Instructions:`Instruções`,"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:`Januar`,January:`janeiro`,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`,Limit:`Limite`,"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:`março`,"March ":`Março`,May:`maio`,Menu:`Menu`,Message:`mensagem`,Mo:`Mo`,Model:`Modelo`,Monday:`Segunda-feira`,Month:`Mês`,More:`Mais`,Name:`Nome`,"No active host found":`Nenhum host ativo encontrado`,"Nothing found":`Nada encontrado`,November:`novembro`,OK:`OK`,October:`outubro`,Ok:`Ok`,"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`,"Operate two states":`Operar dois estados`,"Operations with two states":`Operações com dois estados`,"Paste your blocks here":`Cole seus blocos aqui`,Pause:`Pausa`,"Pause execution":`Pausar a execução`,"Pause script":`Pausar script`,"Phone:":`Telefone:`,"Please select object ID...":`Selecione o ID do objeto...`,"Prettify the script":`Embeleze o roteiro`,"Print some text in log":`Imprimir algum texto no log`,"Priority:":`Prioridade:`,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`,Restart:`Reiniciar`,Result:`Resultado`,"Resume execution":`Retomar execução`,"Root folder":`Pasta principal`,"Rules description":`Crie regras com blocos IF, THEN, ELSE`,"Run script":`Executar script`,Sa:`Sá`,Saturday:`Sábado`,Save:`Salve`,"Save all":`Salvar tudo`,"Say It":`Say It`,"Say some text via sayit adapter":`Diga algum texto através do adaptador sayit`,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...`,"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:`setembro`,"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:`Simular`,"Some files will be rejected":`Alguns arquivos serão rejeitados`,"Sound:":`Som:`,Stack:`Pilha`,Start:`Começar`,"Start script":`Iniciar script`,State:`Estado`,"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:`Su`,"Subject:":`Sujeito:`,Sunday:`Domingo`,"TS description":`Criando regras escrevendo Typecript`,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`,Time:`Tempo`,"Time condition":`Condição de tempo`,"Title:":`Título:`,"To:":`Para:`,"Trigger with value":`Trigger com valor`,Triggered:`Provocado`,Triggers:`Gatilhos`,"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:`Tu`,Tuesday:`terça`,URL:`URL`,"Unknown error":`Erro desconhecido`,"Unknown error!":`Erro desconhecido!`,"User function":`Função do usuário`,"User:":`Do utilizador:`,Value:`Valor`,"Vibration:":`Vibração:`,Volume:`Volume`,We:`3`,Wednesday:`quarta`,"Whatsapp-cmb":`Whatsapp-cmb`,Write:`Escrever`,"Write your own code":`Escreva seu próprio código`,Yes:`sim`,"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`,"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:`reconhecimento`,all:`todos`,and:`e`,"as JSON":`como JSON`,"as plain text":`como texto simples`,astro:`astro`,at:`no`,"clear running":`corrida limpa`,control:`ao controle`,copy:`copiar`,cron:`CRON`,dawn:`alvorecer`,debug_help:`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.`,debug_label:`Depurar`,default:`predefinição`,dusk:`Crepúsculo`,easy:`fácil`,else:`outro`,"equal to":`igual a`,every:`cada`,"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:`Função`,filter_id:`ID`,filter_name:`Nome`,filter_role:`Tipo`,filter_room:`Quarto`,"for edit or create script":`para editar ou criar um novo script`,"for professionals":`para profissionais`,"for programmers":`para programadores`,goldenHour:`Hora dourada`,goldenHourEnd:`Fim da hora de ouro`,"greater or equal":`maior ou igual`,"greater or equal to":`maior ou igual a`,"greater than":`Maior que`,help_just_check:`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.`,help_on_change:`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.`,"high priority":`prioridade máxima`,"high-priority":`prioridade máxima`,"highest priority":`Prioridade máxima`,hours:`horas`,includes:`inclui`,interval:`intervalo`,"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:`Magia`,milliseconds:`milissegundos`,minutes:`minutos`,ms:`ms`,nadir:`nadir`,nauticalDawn:`Madrugada náutica`,nauticalDusk:`Crepúsculo náutico`,nextSunrise:`próximo nascer do sol`,nextSunset:`Próximo pôr do sol`,night:`Noite`,nightEnd:`Fim de noite`,"no blocks found":`Nenhum bloco encontrado`,"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`,"on change":`em mudança`,"on condition change":`na mudança de condição`,"on update":`em atualização`,one:`1`,or:`ou`,quiet:`quieto`,"reset search":`redefinir pesquisa`,search:`procurar`,seconds:`segundos`,solarNoon:`Meio-dia solar`,"store in":`armazenar em`,sunrise:`nascer do sol`,sunriseEnd:`Fim do nascer do sol`,sunset:`pôr do sol`,sunsetStart:`Começo do pôr do sol`,then:`então`,"toggle value":`valor de alternância`,tooltip_ack:`reconhecer`,tooltip_from:`de`,tooltip_lc:`Última alteração`,tooltip_quality:`Qualidade`,tooltip_ts:`timestamp`,tooltip_user:`usuário`,tooltip_value:`valor`,true:`verdade`,two:`dois`,undefined:`Indefinido`,update:`atualizar`,"use seconds":`use segundos`,"use trigger value":`use o gatilho`,verbose_help:`Adiciona saída de depuração ao log para muitos comandos do sistema`,verbose_label:`Saídas de log detalhadas`,when:`quando`,with:`com`,"with date":`com data`,"with offset":`com deslocamento`,wizard:`Wizard`,"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:`Tentar novamente`,"No running javascript instance found":`Nenhuma instância JavaScript em execução encontrada`,"OID display mode":`Modo de exibição OID`,"Ask questions about your script, request changes, or generate new code.":`Faça perguntas sobre seu script, solicite alterações ou gere novo código.`,"to send":`para enviar`,"Thinking...":`Pensando...`,"AI suggested changes":`Alterações sugeridas pela IA`,Accept:`Aceitar`,Reject:`Rejeitar`,"No API keys configured":`Nenhuma chave API configurada`,"for new line":`para nova linha`,"AI chat mode":`Modo de chat IA`,"Plain conversation. Use for questions, explanations, syntax help. Does not read or modify your scripts.":`Conversa simples. Use para perguntas, explicações e ajuda com sintaxe. Não lê nem modifica seus scripts.`,'For larger models with tool support. The AI can read, create, and edit scripts, look up datapoints, and browse the object tree — useful for "create a script that...", "which scripts use this state?" or "analyze my light script".':`Para modelos maiores com suporte a ferramentas. A IA pode ler, criar e editar scripts, consultar datapoints e navegar pela árvore de objetos — útil para "crie um script que...", "quais scripts usam este state?" ou "analise meu script de luz".`,'For smaller models without tool support. Two-step script generator (plan then code) — useful for "create a script that..." or "write a Blockly rule for...". Output goes into the editor for smart-apply.':`Para modelos menores sem suporte a ferramentas. Gerador de scripts em duas etapas (plano e depois código) — útil para "crie um script que..." ou "escreva uma regra Blockly para...". O resultado vai para o editor para smart-apply.`,"Plain conversation. Best for: general questions, syntax help, concept explanations.":`Conversa simples. Ideal para: perguntas gerais, ajuda com sintaxe, explicações de conceitos.`,"For larger models with tool support. Best for: creating, editing, or analyzing scripts; finding datapoint usages; inspecting the object tree.":`Para modelos maiores com suporte a ferramentas. Ideal para: criar, editar ou analisar scripts; encontrar usos de datapoints; inspecionar a árvore de objetos.`,"For smaller models without tool support. Best for: creating new JavaScript/TypeScript or Blockly scripts from a description.":`Para modelos menores sem suporte a ferramentas. Ideal para: criar novos scripts JavaScript/TypeScript ou Blockly a partir de uma descrição.`,"Mention scripts as context for the AI. Use @all for all scripts or @scriptName for a specific one.":`Mencionar scripts como contexto para a IA. Use @todos para todos os scripts ou @nomeDoScript para um específico.`,Context:`Contexto`,"current script":`script atual`,"all scripts":`todos os scripts`,devices:`dispositivos`,"Searching datapoints":`Pesquisando pontos de dados`,"Reading value":`Lendo valor`,"Loading object info":`Carregando informações do objeto`,"Searching scripts":`Pesquisando scripts`,"Reading script":`Lendo script`,"Loading script list":`Carregando lista de scripts`,"All scripts":`Todos os scripts`,"Smart home devices":`Dispositivos de casa inteligente`,"AI Chat":`Chat IA`,"AI inline completions":`Completações em linha IA`,"New chat":`Novo chat`,"Ask about your script...":`Pergunte sobre seu script...`,"Insert blocks":`Inserir blocos`,"Apply blocks":`Aplicar blocos`,Undo:`Desfazer`,Redo:`Refazer`,"Insert into editor":`Inserir no editor`,"Show as diff":`Mostrar como diff`,"Selected code as context":`Código selecionado como contexto`,"Generating plan...":`Gerando plano...`,"Generating code...":`Gerando código...`,Plan:`Plano`,"mention @all":`@todos`,"mention @devices":`@dispositivos`,Send:`Enviar`,Copy:`Copiar`,"AI inline chat":`Chat IA embutido`,'e.g. "Refactor this to use async/await"':`ex. "Refactor this to use async/await"`,"Open in chat":`Abrir no chat`,"Selection: %s line(s)":`Seleção: %s linha(s)`,"No selection — the question will use context from the whole script.":`Sem seleção — a pergunta usará o contexto de todo o script.`,"Please enter a question.":`Digite uma pergunta.`,"Thinking…":`Pensando…`,"Code proposal — press Apply to replace your selection.":`Proposta de código — pressione Aplicar para substituir sua seleção.`,"Plain text answer.":`Resposta em texto.`,"Show more details":`Mostrar mais detalhes`,"AI: Inline chat…":`IA: Chat embutido…`,"AI: Explain":`IA: Explicar`,"AI: Refactor":`IA: Refatorar`,"AI: Add comments":`IA: Adicionar comentários`,"AI: Fix problem":`IA: Corrigir problema`,"AI: Suggest tests":`IA: Sugerir testes`,"Ask the AI about the selected code:":`Pergunte à IA sobre o código selecionado:`,Explain:`Explicar`,Refactor:`Refatorar`,Tests:`Testes`,"Explain %s %s":`Explicar %s %s`,"Refactor %s %s":`Refatorar %s %s`,"Suggest tests for %s %s":`Sugerir testes para %s %s`,"Apply changes":`Aplicar alterações`,"Discard changes":`Descartar alterações`,'Ask anything, or request a change (e.g. "what does this do?")':`Pergunte algo ou peça uma alteração (ex. "o que isso faz?")`,Wizard:`Assistente`,"Create a rule step by step":`Criar uma regra passo a passo`,Summary:`Resumo`,Back:`Voltar`,Next:`Próximo`,Skip:`Ignorar`,"Create rule":`Criar regra`,"Replace rule":`Substituir regra`,"The current rule will be replaced":`A regra atual será substituída`,"Add another":`Adicionar outro`,"Without a condition the rule always runs":`Sem condição, a regra é sempre executada`,"What should start the rule?":`O que deve iniciar a regra?`,"When should the rule run? This step is optional.":`Quando a regra deve ser executada? Este passo é opcional.`,"What should happen?":`O que deve acontecer?`,"Block not found":`Bloco não encontrado`,Weekday:`Dia da semana`,"Let the rule run only on the selected days of the week":`Executar a regra apenas nos dias da semana selecionados`,"Send to adapter":`Enviar para o adaptador`,"Sends a message to any adapter instance":`Envia uma mensagem para qualquer instância de adaptador`,"Command:":`Comando:`,"JSON:":`JSON:`,"Sent:":`Enviado:`,"User condition":`Condição do usuário`,"Write your own condition":`Escreva sua própria condição`,"This is an advanced option. The code is the body of a function and must return the result, e.g. \"return getState('javascript.0.variable').val > 5;\". You may use await inside.":`Esta é uma opção avançada. O código é o corpo de uma função e deve retornar o resultado com return, por ex. "return getState('javascript.0.variable').val > 5;". Você pode usar await dentro dele.`,"On message":`Ao receber mensagem`,"Triggers the rule when another script or adapter sends a message":`Aciona a regra quando outro script ou adaptador envia uma mensagem`,"Send the message from a script with messageTo({instance: 'javascript.0'}, 'myMessage', data). The sent data is available in the texts of the actions as %s.":`Envie a mensagem de um script com messageTo({instance: 'javascript.0'}, 'myMessage', data). Os dados enviados ficam disponíveis nos textos das ações como %s.`,"Message name:":`Nome da mensagem:`,"Received:":`Recebido:`,Notification:`Notificação`,"Creates an ioBroker notification, which is shown in the admin":`Cria uma notificação do ioBroker, exibida no admin`,"Notification text":`Texto da notificação`,"as alert":`como alerta`,Alert:`Alerta`,"Registered:":`Registrado:`,"Toggle between two values":`Alternar entre dois valores`,"Switches a state back and forth between two values":`Alterna um estado entre dois valores`,'If the state does not hold the first value, the first one is written - so the rule always ends up on a defined value. To invert a boolean, use the "toggle value" checkbox of the "Set state action" instead.':`Se o estado não contiver o primeiro valor, o primeiro é escrito - assim a regra sempre termina em um valor definido. Para inverter um booleano, use a caixa "toggle value" da ação "Set state action".`,between:`entre`,"Toggled:":`Alternado:`,"On file change":`Ao alterar um arquivo`,"Triggers the rule when a file of an object is written or deleted":`Aciona a regra quando um arquivo de um objeto é gravado ou excluído`,'Both fields may contain *, e.g. the object "vis.0" and the file name "main/*". In the texts of the actions %s is the name of the changed file and %id the object it belongs to. Requires js-controller 4.1 or newer.':`Ambos os campos podem conter *, por ex. o objeto "vis.0" e o nome do arquivo "main/*". Nos textos das ações, %s é o nome do arquivo alterado e %id o objeto ao qual pertence. Requer js-controller 4.1 ou mais recente.`,"Files of:":`Arquivos de:`,"File name:":`Nome do arquivo:`,"File changed:":`Arquivo alterado:`,"Deleted:":`Excluído:`,File:`Arquivo`,"On object change":`Ao alterar um objeto`,"Triggers the rule when an object is created, changed or deleted":`Aciona a regra quando um objeto é criado, alterado ou excluído`,'This reacts to the object itself, not to its value - use the "State" trigger for values. The pattern may contain *, e.g. "hm-rpc.0.*". In the texts of the actions %s and %id are the id of the changed object.':`Reage ao próprio objeto, não ao seu valor - use o gatilho "State" para valores. O padrão pode conter *, por ex. "hm-rpc.0.*". Nos textos das ações, %s e %id são o id do objeto alterado.`,"Object ID:":`ID do objeto:`,"React on:":`Reagir a:`,"any change":`qualquer alteração`,"created or changed":`criado ou alterado`,deleted:`excluído`,"Object changed:":`Objeto alterado:`,"Object deleted:":`Objeto excluído:`,"On log message":`Ao receber mensagem de log`,"Triggers the rule when something is written to the ioBroker log":`Aciona a regra quando algo é escrito no log do ioBroker`,'Leave "Contains" empty to react to every entry of that level. Fill it in if an action of this rule writes to the log itself - a rule that matches its own message can trigger itself. In the texts of the actions %s is the log message and %id the instance it came from.':`Deixe "Contém" vazio para reagir a cada entrada desse nível. Preencha se uma ação desta regra escrever no log: uma regra que corresponde à própria mensagem pode acionar a si mesma. Nos textos das ações, %s é a mensagem de log e %id a instância de onde ela veio.`,"Level:":`Nível:`,"Contains:":`Contém:`,error:`error`,warn:`warn`,info:`info`,debug:`debug`,silly:`silly`,"any level":`qualquer nível`,"Logged:":`Registrado no log:`,"Log contains":`O log contém`,"Every log entry":`Cada entrada do log`,"On rule stop":`Ao parar a regra`,"Runs the rule once more when it is stopped, saved or the adapter shuts down":`Executa a regra mais uma vez quando ela é parada, salva ou o adaptador é encerrado`,"The adapter waits for the actions, but only for the time set here - what does not fit is cut off. A rule can have only one block of this kind; a second one replaces the first.":`O adaptador aguarda as ações, mas apenas pelo tempo definido aqui - o que não couber é interrompido. Uma regra pode ter apenas um bloco deste tipo; um segundo substitui o primeiro.`,"Wait at most:":`Esperar no máximo:`,"HTTP error:":`Erro HTTP:`,"On enum member change":`Ao alterar um membro do enum`,"Triggers the rule when any state of a room or function changes":`Aciona a regra quando qualquer estado de um cômodo ou função muda`,"Subscribes to every state of the selected enum and follows it: a device added to that room later is included without changing the rule. In the texts of the actions %s is the new value and %id the state that changed.":`Assina todos os estados do enum selecionado e o acompanha: um dispositivo adicionado depois é incluído sem alterar a regra. Nos textos das ações, %s é o novo valor e %id o estado que mudou.`,"Members of:":`Membros de:`,"Any member of":`Qualquer membro de`,"Send message":`Enviar mensagem`,"Sends a message to other scripts and rules":`Envia uma mensagem para outros scripts e regras`,'Every rule with an "On message" trigger of the same name receives it, as does a script with onMessage(). You can use %s in the text to send the current trigger value or %id the triggered object ID.':`Toda regra com um gatilho "Ao receber mensagem" do mesmo nome a recebe, assim como um script com onMessage(). Com %s no texto você envia o valor atual do gatilho e com %id o ID do objeto acionado.`,"Set state if changed":`Definir estado apenas se mudar`,"Writes a state only if its value differs from the current one":`Grava um estado apenas se o valor for diferente do atual`,'Use this instead of "Set state action" for rules that run often: an unchanged value is not written at all, so nothing subscribed to that state is woken up for nothing.':`Use isto em vez de "Set state action" para regras que rodam com frequência: um valor inalterado não é gravado, então nada inscrito nesse estado é acordado à toa.`,"only if changed":`apenas se mudar`,"A block failed while generating the script, so the changes cannot be saved":`Um bloco falhou ao gerar o script, as alterações não podem ser salvas`,"Blockly error":`Erro do Blockly`,"Export error":`Erro de exportação`},YA={"%s not found":`%s не найден`,"()":`()`,"(at %s)":`(в %s)`,"(optional)":`(необязательный)`,"-":`-`,".":`.`,Ack:`Подтверждение`,Actions:`Действия`,"Actual time of day":`Фактическое время суток`,Add:`Добавить`,"Add new script":`Добавить новый скрипт`,All:`Все`,"All files will be accepted":`Все файлы будут приняты`,Any:`Любая`,"Any month":`В любой месяц`,Apply:`Применить`,April:`Апрель`,"Are you sure?":`Вы уверены?`,Ask:`Спросить`,Astronomical:`Aстрономический`,"Astronomical events today":`Астрономические события сегодня`,August:`Август`,"Blockly description":`Создание правил графическими блоками`,"Body:":`Тело:`,Cancel:`Отмена`,"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:`Закрыть`,"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:`Условие`,Conditions:`Условия`,"Configuration not saved.":`Конфигурация не сохранена.`,Console:`Приставка`,"Control or update some state":`Контролировать или обновлять какое-то состояние`,"Control or update some state with delay":`Контролировать или обновлять какое-либо состояние с задержкой`,"Convert blockly to javascript for ever.":`Преобразовать blockly в Javascript навсегда.`,Copied:`Скопировано`,"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:`Декабрь`,Default:`Дефолт`,"Define cron...":`Задать правило ...`,"Define schedule...":`Задать расписание...`,Delay:`Задержка`,Delete:`Удалить`,"Delete %s":`Удалить %s...`,"Delete folder":`Удалить папку`,"Delete script":`Удалить скрипт`,Description:`Описание`,"Deselect all":`Снять выбор со всех`,"Discard changes for %s":`Отменить изменения для %s`,Done:`Готово`,"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":`Закончить поиск`,Error:`Ошибка`,"Error formatting code":`Ошибка форматирования кода`,"Error was found":`Ошибка была найдена`,"Every day":`Каждый день`,Exec:`Исполнить shell`,"Executes some shell command":`Выполняет некоторую команду оболочки`,"Existing scripts will be overwritten.":`Существующие скрипты будут перезаписаны.`,"Expand all":`Открыть все`,"Expert mode":`Экспертный режим`,Explanation:`Объяснение`,Export:`Экспорт`,"Export all scripts":`Экспорт всех скриптов`,"Export blocks":`Экспортировать блоки`,"Export selected blocks":`Экспортировать выбранные блоки`,Februar:`Февраль`,February:`Февраль`,Filter:`Фильтр`,Folder:`Папка`,Fr:`Пт`,Friday:`пятница`,Function:`Функция`,"Function editor":`Редактор функции`,"Function: executed":`Функция: выполнено`,"Go to next line":`Перейти к следующей строке`,"HTTP Call":`HTTP-вызов`,"Hide logs":`Скрыть журналы`,ID:`ID`,ID1:`ID1`,ID2:`ID2`,Import:`Импорт`,"Import blocks":`Импортировать блоки`,"Import error":`Ошибка импорта`,"Import scripts":`Импорт скриптов`,"Insert object ID":`Вставить ID объекта`,Instance:`Экземпляр`,"Instance is disabled":`Экземпляр отключен`,"Instance:":`Пример:`,Instances:`Экземпляры`,Instructions:`Инструкции`,"Invalid CRON":`Неправильный CRON`,"It will not be possible to revert this operation.":`Невозможно вернуть эту операцию.`,"JS description":`Создание правил путём написания Javascript`,Januar:`Январь`,January:`Январь`,July:`Июль`,June:`Июнь`,"Just check":`Просто проверить`,"Keep my changes":`Сохранить мои изменения`,"Language:":`Язык:`,"Learn More":`Узнать больше`,"Light style":`Светлый стиль`,Limit:`Предел`,"Local time":`Местное время`,"Locate file":`Показать файл в дереве`,"Log outputs":`Журнал`,"Log text":`Текст журнала`,"Log: %s":`Журнал: %s`,"Make a HTTP get request":`Сделайте HTTP-запрос на получение`,"Make a pause between actions":`Сделайте паузу между действиями`,March:`Март`,"March ":`Март `,May:`Май`,Menu:`Меню`,Message:`Сообщение`,Mo:`Пн`,Model:`Модель`,Monday:`понедельник`,Month:`Месяц`,More:`Более`,Name:`Имя`,"No active host found":`Активный host не найден`,"Nothing found":`Ничего не найдено`,November:`Ноябрь`,OK:`Ок`,October:`Октябрь`,Ok:`Ok`,"On condition change":`При изменении реузльтата условий`,"On script save or adapter start":`При сохранении скрипта или запуске адаптера`,"On weekdays":`По дням недели`,"Operate two states":`Операции над двумя состояниями`,"Operations with two states":`Операции с двумя состояниями`,"Paste your blocks here":`Вставьте свои блоки сюда`,Pause:`Пауза`,"Pause execution":`Приостановить выполнение`,"Pause script":`Остановить скрипт`,"Phone:":`Телефон:`,"Please select object ID...":`Пожалуйста, выберите ID объекта ...`,"Prettify the script":`Украсьте сценарий`,"Print some text in log":`Напечатать текст в журнале`,"Priority:":`Приоритет:`,Pushover:`Pushover`,Pushsafer:`Pushsafer`,"Read only ID selected: %s":`Выбран идентификатор только для чтения: %s`,Reload:`Перезагрузить`,Rename:`Переименовать`,"Reorder scripts in folders":`Сортировать скрипты в папках`,Repeat:`Повторение`,Restart:`Перезапустить`,Result:`Результат`,"Resume execution":`Возобновить выполнение`,"Root folder":`Корневая папка`,"Rules description":`Создавайте правила с блоками ЕСЛИ, ТО, ИНАЧЕ`,"Run script":`Запустить скрипт`,Sa:`Сб`,Saturday:`суббота`,Save:`Сохранить`,"Save all":`Сохранить все`,"Say It":`Say It`,"Say some text via sayit adapter":`Произнесите текст через адаптер Sayit`,Schedule:`Расписание`,Script:`скрипт`,"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:`Сентябрь`,"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:`Симулировать`,"Some files will be rejected":`Некоторые файлы будут отклонены`,"Sound:":`Звук:`,Stack:`Stack`,Start:`Начинать`,"Start script":`Старт скрипта`,State:`Состояние`,"State condition":`Сравнение состояния`,"Step into function":`Шаг в функционирование`,"Step out from function":`Выйти из функции`,"Stop on exception":`Остановить при исключении`,Su:`Вс`,"Subject:":`Предмет:`,Sunday:`Воскресенье`,"TS description":`Создание правил путём написания Typescript`,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:`Четверг`,Time:`Время`,"Time condition":`Условие времени`,"Title:":`Заголовок:`,"To:":`К:`,"Trigger with value":`Триггер со значением`,Triggered:`Срабатывает`,Triggers:`Триггеры`,"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:`Вт`,Tuesday:`вторник`,URL:`URL`,"Unknown error":`Неизвестная ошибка`,"Unknown error!":`Неизвестная ошибка!`,"User function":`Функция пользователя`,"User:":`Пользователь:`,Value:`Значение`,"Vibration:":`Вибрация:`,Volume:`Громкость`,We:`Ср`,Wednesday:`среда`,"Whatsapp-cmb":`Whatsapp-cmb`,Write:`Напишите`,"Write your own code":`Напишите свой код`,Yes:`Да`,"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, чтобы использовать старое значение триггера.`,"Please select a valid model":`Пожалуйста, выберите допустимую модель`,"[equal]":`[равно]`,"[greater or equal]":`[больше или равно]`,"[greater]":`[больше]`,"[hysteresis]":`[гистерезис]`,"[includes]":`[содержит]`,"[less or equal]":`[меньше или равно]`,"[less]":`[меньше]`,"[not equal]":`[не равно]`,acknowledgment:`подтверждение`,all:`все`,and:`и`,"as JSON":`как JSON`,"as plain text":`как текст`,astro:`Астро`,at:`в`,"clear running":`остановить уже бегущие`,control:`контроль`,copy:`копия`,cron:`CRON`,dawn:`Рассвет`,debug_help:`Это особый режим, в котором состояния и объекты не будут меняться. Но в протоколе будет отображаться только информация о каждом планируемом изменении.`,debug_label:`Отлаживать`,default:`дефолт`,dusk:`Сумерки`,easy:`легкий`,else:`иначе`,"equal to":`равно`,every:`каждые(ый)`,"every hour at 0 minutes":`каждый час через 0 минут`,false:`false`,"file reading has failed: %s":`Ошибка чтения файла: %s`,"file reading was aborted":`Чтение файла было прервано`,filter_func:`Функция`,filter_id:`ID`,filter_name:`Название`,filter_role:`Роль`,filter_room:`Комната`,"for edit or create script":`для редактирования или создайте новый скрипт`,"for professionals":`для профессионалов`,"for programmers":`для программистов`,goldenHour:`Золотой час`,goldenHourEnd:`Конец золотого часа`,"greater or equal":`больше или равно`,"greater or equal to":`больше или равно`,"greater than":`больше чем`,help_just_check:`Код будет выполняться только каждый раз, когда условие истинно. Например. при срабатывании по значению датчика температуры и условию «если температура выше 20°C», действия «затем» будут выполняться каждый раз, когда датчик отправляет значение температуры, и оно превышает 20°C. На 21°С, на 22°С и так далее.`,help_on_change:`Код будет выполнен только в случае изменения результата условия. Например, при срабатывании по значению датчика температуры и условию «если температура больше 20°C», действия «затем» будут выполнены один раз, когда температура превысит 20°C. В следующий раз действия «затем» будут выполнены, когда температура опустится ниже 20°C, а затем снова поднимается выше 20°C.`,"high priority":`высокий приоритет`,"high-priority":`высокий-приоритет`,"highest priority":`высший приоритет`,hours:`час(ов)`,includes:`содержит`,interval:`интервал`,"just check":`просто проверить`,"less or equal":`меньше или равно`,"less or equal to":`меньше или равно`,"less than":`меньше, чем`,"lower priority":`более низкий приоритет`,"lowest priority":`самый низкий приоритет`,magic:`магия`,milliseconds:`миллисекунды`,minutes:`минут(у)`,ms:`мс`,nadir:`Надир`,nauticalDawn:`Морской рассвет`,nauticalDusk:`Морские сумерки`,nextSunrise:`Следующий восход`,nextSunset:`Следующий закат`,night:`Ночь`,nightEnd:`Конец ночи`,"no blocks found":`Блоков нет`,"no group":`Нет группы`,normal:`нормальный`,"normal priority":`нормальный приоритет`,"not running":`не запущен`,"not equal to":`не равно`,"not properly connected":`Этот блок неправильно соединён или не соединён с другими блоками.`,offset:`сдвиг`,"on change":`по изменению`,"on condition change":`при изменении результата условия`,"on update":`при обновлении`,one:`один`,or:`или`,quiet:`тихий`,"reset search":`Cбросить поиск`,search:`поиск`,seconds:`секунд`,solarNoon:`Солнечный полдень`,"store in":`сохранить в`,sunrise:`Восход солнца`,sunriseEnd:`Конец восхода`,sunset:`Закат солнца`,sunsetStart:`Начало заката`,then:`тогда`,"toggle value":`инвертировать текщее значение`,tooltip_ack:`Подтверждено`,tooltip_from:`От`,tooltip_lc:`Последнее изменение`,tooltip_quality:`Качественный`,tooltip_ts:`Время`,tooltip_user:`Пользователь`,tooltip_value:`Значение`,true:`true`,two:`два`,undefined:`неопределенный`,update:`обновить`,"use seconds":`использовать секунды`,"use trigger value":`использовать значение триггера`,verbose_help:`Добавляет вывод отладки в журнал для многих системных команд.`,verbose_label:`Подробный протокол`,when:`если`,with:`с`,"with date":`с датой`,"with offset":`со сдвигом`,wizard:`Мастер`,"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:`Повторить`,"No running javascript instance found":`Не найден работающий экземпляр JavaScript`,"OID display mode":`Режим отображения OID`,"Ask questions about your script, request changes, or generate new code.":`Задавайте вопросы о вашем скрипте, запрашивайте изменения или генерируйте новый код.`,"to send":`для отправки`,"Thinking...":`Думаю...`,"AI suggested changes":`Изменения, предложенные ИИ`,Accept:`Принять`,Reject:`Отклонить`,"No API keys configured":`API-ключи не настроены`,"for new line":`для новой строки`,"AI chat mode":`Режим чата ИИ`,"Plain conversation. Use for questions, explanations, syntax help. Does not read or modify your scripts.":`Обычный разговор. Используйте для вопросов, объяснений и помощи с синтаксисом. Не читает и не изменяет скрипты.`,'For larger models with tool support. The AI can read, create, and edit scripts, look up datapoints, and browse the object tree — useful for "create a script that...", "which scripts use this state?" or "analyze my light script".':`Для больших моделей с поддержкой инструментов. ИИ может читать, создавать и редактировать скрипты, искать датапоинты и просматривать дерево объектов — подходит для «создай скрипт, который …», «какие скрипты используют этот state?» или «проанализируй мой скрипт освещения».`,'For smaller models without tool support. Two-step script generator (plan then code) — useful for "create a script that..." or "write a Blockly rule for...". Output goes into the editor for smart-apply.':`Для небольших моделей без поддержки инструментов. Двухэтапный генератор скриптов (сначала план, затем код) — подходит для «создай скрипт, который …» или «напиши правило Blockly для …». Результат попадает в редактор для smart-apply.`,"Plain conversation. Best for: general questions, syntax help, concept explanations.":`Обычный разговор. Лучше всего для: общих вопросов, помощи с синтаксисом, объяснения концепций.`,"For larger models with tool support. Best for: creating, editing, or analyzing scripts; finding datapoint usages; inspecting the object tree.":`Для больших моделей с поддержкой инструментов. Лучше всего для: создания, редактирования или анализа скриптов; поиска использования датапоинтов; изучения дерева объектов.`,"For smaller models without tool support. Best for: creating new JavaScript/TypeScript or Blockly scripts from a description.":`Для небольших моделей без поддержки инструментов. Лучше всего для: создания новых JavaScript/TypeScript или Blockly скриптов по описанию.`,"Mention scripts as context for the AI. Use @all for all scripts or @scriptName for a specific one.":`Упомяните скрипты как контекст для ИИ. Используйте @все для всех скриптов или @имяСкрипта для конкретного.`,Context:`Контекст`,"current script":`текущий скрипт`,"all scripts":`все скрипты`,devices:`устройства`,"Searching datapoints":`Поиск точек данных`,"Reading value":`Чтение значения`,"Loading object info":`Загрузка информации об объекте`,"Searching scripts":`Поиск скриптов`,"Reading script":`Чтение скрипта`,"Loading script list":`Загрузка списка скриптов`,"All scripts":`Все скрипты`,"Smart home devices":`Устройства умного дома`,"AI Chat":`ИИ Чат`,"AI inline completions":`ИИ автодополнение`,"New chat":`Новый чат`,"Ask about your script...":`Спросите о вашем скрипте...`,"Insert blocks":`Вставить блоки`,"Apply blocks":`Применить блоки`,Undo:`Отменить`,Redo:`Повторить`,"Insert into editor":`Вставить в редактор`,"Show as diff":`Показать как diff`,"Selected code as context":`Выбранный код как контекст`,"Generating plan...":`Создание плана...`,"Generating code...":`Генерация кода...`,Plan:`План`,"mention @all":`@все`,"mention @devices":`@устройства`,Send:`Отправить`,Copy:`Копировать`,"AI inline chat":`Встроенный ИИ-чат`,'e.g. "Refactor this to use async/await"':`напр. "Refactor this to use async/await"`,"Open in chat":`Открыть в чате`,"Selection: %s line(s)":`Выделение: %s стр.`,"No selection — the question will use context from the whole script.":`Нет выделения — вопрос относится ко всему скрипту.`,"Please enter a question.":`Введите вопрос.`,"Thinking…":`Думаю…`,"Code proposal — press Apply to replace your selection.":`Предложение кода — нажмите Применить, чтобы заменить выделение.`,"Plain text answer.":`Текстовый ответ.`,"Show more details":`Показать подробнее`,"AI: Inline chat…":`ИИ: Встроенный чат…`,"AI: Explain":`ИИ: Объяснить`,"AI: Refactor":`ИИ: Рефакторинг`,"AI: Add comments":`ИИ: Добавить комментарии`,"AI: Fix problem":`ИИ: Исправить проблему`,"AI: Suggest tests":`ИИ: Предложить тесты`,"Ask the AI about the selected code:":`Спросите ИИ о выделенном коде:`,Explain:`Объяснить`,Refactor:`Рефакторинг`,Tests:`Тесты`,"Explain %s %s":`Объяснить %s %s`,"Refactor %s %s":`Рефакторинг %s %s`,"Suggest tests for %s %s":`Предложить тесты для %s %s`,"Apply changes":`Применить изменения`,"Discard changes":`Отменить изменения`,'Ask anything, or request a change (e.g. "what does this do?")':`Задайте любой вопрос или попросите изменение (напр. "что делает эта команда?")`,Wizard:`Мастер`,"Create a rule step by step":`Создать правило шаг за шагом`,Summary:`Сводка`,Back:`Назад`,Next:`Далее`,Skip:`Пропустить`,"Create rule":`Создать правило`,"Replace rule":`Заменить правило`,"The current rule will be replaced":`Текущее правило будет заменено`,"Add another":`Добавить ещё`,"Without a condition the rule always runs":`Без условия правило выполняется всегда`,"What should start the rule?":`Что должно запускать правило?`,"When should the rule run? This step is optional.":`Когда правило должно выполняться? Этот шаг необязателен.`,"What should happen?":`Что должно произойти?`,"Block not found":`Блок не найден`,Weekday:`День недели`,"Let the rule run only on the selected days of the week":`Выполнять правило только в выбранные дни недели`,"Send to adapter":`Отправить адаптеру`,"Sends a message to any adapter instance":`Отправляет сообщение любому экземпляру адаптера`,"Command:":`Команда:`,"JSON:":`JSON:`,"Sent:":`Отправлено:`,"User condition":`Условие пользователя`,"Write your own condition":`Напишите своё условие`,"This is an advanced option. The code is the body of a function and must return the result, e.g. \"return getState('javascript.0.variable').val > 5;\". You may use await inside.":`Это расширенная опция. Код является телом функции и должен вернуть результат через return, например "return getState('javascript.0.variable').val > 5;". Внутри можно использовать await.`,"On message":`По сообщению`,"Triggers the rule when another script or adapter sends a message":`Запускает правило, когда другой скрипт или адаптер отправляет сообщение`,"Send the message from a script with messageTo({instance: 'javascript.0'}, 'myMessage', data). The sent data is available in the texts of the actions as %s.":`Отправьте сообщение из скрипта с помощью messageTo({instance: 'javascript.0'}, 'myMessage', data). Отправленные данные доступны в текстах действий как %s.`,"Message name:":`Имя сообщения:`,"Received:":`Получено:`,Notification:`Уведомление`,"Creates an ioBroker notification, which is shown in the admin":`Создаёт уведомление ioBroker, которое отображается в админке`,"Notification text":`Текст уведомления`,"as alert":`как тревога`,Alert:`Тревога`,"Registered:":`Зарегистрировано:`,"Toggle between two values":`Переключить между двумя значениями`,"Switches a state back and forth between two values":`Переключает состояние между двумя значениями`,'If the state does not hold the first value, the first one is written - so the rule always ends up on a defined value. To invert a boolean, use the "toggle value" checkbox of the "Set state action" instead.':`Если состояние не содержит первое значение, записывается первое - так правило всегда приходит к определённому значению. Чтобы инвертировать логическое значение, используйте флажок "toggle value" действия "Set state action".`,between:`между`,"Toggled:":`Переключено:`,"On file change":`При изменении файла`,"Triggers the rule when a file of an object is written or deleted":`Запускает правило, когда файл объекта записан или удалён`,'Both fields may contain *, e.g. the object "vis.0" and the file name "main/*". In the texts of the actions %s is the name of the changed file and %id the object it belongs to. Requires js-controller 4.1 or newer.':`Оба поля могут содержать *, например объект "vis.0" и имя файла "main/*". В текстах действий %s — имя изменённого файла, а %id — объект, которому он принадлежит. Требуется js-controller 4.1 или новее.`,"Files of:":`Файлы объекта:`,"File name:":`Имя файла:`,"File changed:":`Файл изменён:`,"Deleted:":`Удалено:`,File:`Файл`,"On object change":`При изменении объекта`,"Triggers the rule when an object is created, changed or deleted":`Запускает правило, когда объект создан, изменён или удалён`,'This reacts to the object itself, not to its value - use the "State" trigger for values. The pattern may contain *, e.g. "hm-rpc.0.*". In the texts of the actions %s and %id are the id of the changed object.':`Реагирует на сам объект, а не на его значение - для значений используйте триггер "State". Шаблон может содержать *, например "hm-rpc.0.*". В текстах действий %s и %id — идентификатор изменённого объекта.`,"Object ID:":`ID объекта:`,"React on:":`Реагировать на:`,"any change":`любое изменение`,"created or changed":`создан или изменён`,deleted:`удалён`,"Object changed:":`Объект изменён:`,"Object deleted:":`Объект удалён:`,"On log message":`При записи в журнал`,"Triggers the rule when something is written to the ioBroker log":`Запускает правило, когда что-то записывается в журнал ioBroker`,'Leave "Contains" empty to react to every entry of that level. Fill it in if an action of this rule writes to the log itself - a rule that matches its own message can trigger itself. In the texts of the actions %s is the log message and %id the instance it came from.':`Оставьте "Содержит" пустым, чтобы реагировать на каждую запись этого уровня. Заполните, если действие этого правила само пишет в журнал: правило, совпадающее с собственным сообщением, может запустить само себя. В текстах действий %s — сообщение журнала, а %id — экземпляр, от которого оно пришло.`,"Level:":`Уровень:`,"Contains:":`Содержит:`,error:`error`,warn:`warn`,info:`info`,debug:`debug`,silly:`silly`,"any level":`любой уровень`,"Logged:":`В журнале:`,"Log contains":`Журнал содержит`,"Every log entry":`Каждая запись журнала`,"On rule stop":`При остановке правила`,"Runs the rule once more when it is stopped, saved or the adapter shuts down":`Выполняет правило ещё раз при остановке, сохранении или завершении работы адаптера`,"The adapter waits for the actions, but only for the time set here - what does not fit is cut off. A rule can have only one block of this kind; a second one replaces the first.":`Адаптер ждёт выполнения действий, но только заданное здесь время - то, что не поместилось, обрывается. Правило может содержать только один такой блок; второй заменяет первый.`,"Wait at most:":`Ждать не более:`,"HTTP error:":`Ошибка HTTP:`,"On enum member change":`При изменении в перечислении`,"Triggers the rule when any state of a room or function changes":`Запускает правило при изменении любого состояния комнаты или функции`,"Subscribes to every state of the selected enum and follows it: a device added to that room later is included without changing the rule. In the texts of the actions %s is the new value and %id the state that changed.":`Подписывается на каждое состояние выбранного перечисления и следует за ним: устройство, добавленное позже, учитывается без изменения правила. В текстах действий %s — новое значение, а %id — изменившееся состояние.`,"Members of:":`Члены:`,"Any member of":`Любой член`,"Send message":`Отправить сообщение`,"Sends a message to other scripts and rules":`Отправляет сообщение другим скриптам и правилам`,'Every rule with an "On message" trigger of the same name receives it, as does a script with onMessage(). You can use %s in the text to send the current trigger value or %id the triggered object ID.':`Её получит любое правило с триггером "По сообщению" с тем же именем, а также скрипт с onMessage(). С помощью %s в тексте вы отправите текущее значение триггера, а %id — ID сработавшего объекта.`,"Set state if changed":`Задать состояние только при изменении`,"Writes a state only if its value differs from the current one":`Записывает состояние, только если его значение отличается от текущего`,'Use this instead of "Set state action" for rules that run often: an unchanged value is not written at all, so nothing subscribed to that state is woken up for nothing.':`Используйте вместо "Set state action" в правилах, которые выполняются часто: неизменённое значение вообще не записывается, поэтому ничто, подписанное на это состояние, не будится зря.`,"only if changed":`только при изменении`,"A block failed while generating the script, so the changes cannot be saved":`Один из блоков вызвал ошибку при генерации скрипта, изменения не могут быть сохранены`,"Blockly error":`Ошибка Blockly`,"Export error":`Ошибка экспорта`},XA={"%s not found":`%s не знайдено`,"()":`()`,"(at %s)":`(у %s)`,"(optional)":`(необов'язково)`,"-":`-`,".":`.`,Ack:`Визнано`,Actions:`Дії`,"Actual time of day":`Фактичний час доби`,Add:`додати`,"Add new script":`Додати новий сценарій`,All:`все`,"All files will be accepted":`Усі файли будуть прийняті`,Any:`Будь-який`,"Any month":`Будь-який місяць`,Apply:`Застосувати`,April:`квітень`,"Are you sure?":`Ти впевнений?`,Ask:`Запитуйте`,Astronomical:`Астрономічний`,"Astronomical events today":`Астрономічні події сьогодні`,August:`серпень`,"Blockly description":`Створення правил за графічними блоками`,"Body:":`Тіло:`,Cancel:`Скасувати`,"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:`Закрити`,"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:`Хвороба`,Conditions:`Умови`,"Configuration not saved.":`Конфігурація не збережена.`,Console:`Консоль`,"Control or update some state":`Контролюйте або оновлюйте певний стан`,"Control or update some state with delay":`Контролюйте або оновлюйте деякий стан із затримкою`,"Convert blockly to javascript for ever.":`Назавжди конвертуйте Blockly у Javascript.`,Copied:`Скопійовано`,"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:`Грудень`,Default:`За замовчуванням`,"Define cron...":`Визначити cron...`,"Define schedule...":`Визначити розклад...`,Delay:`Затримка`,Delete:`Видалити`,"Delete %s":`Видалити %s...`,"Delete folder":`Видалити папку`,"Delete script":`Видалити сценарій`,Description:`опис`,"Deselect all":`Зняти вибір із усіх`,"Discard changes for %s":`Скасувати зміни для %s`,Done:`Готово`,"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":`Завершити режим пошуку`,Error:`Помилка`,"Error formatting code":`Помилка форматування коду`,"Error was found":`Виявлено помилку`,"Every day":`Кожен день`,Exec:`Виконавча оболонка`,"Executes some shell command":`Виконує певну команду оболонки`,"Existing scripts will be overwritten.":`Існуючі сценарії буде перезаписано.`,"Expand all":`Розгорнути все`,"Expert mode":`Експертний режим`,Explanation:`Пояснення`,Export:`Експорт`,"Export all scripts":`Експортувати всі сценарії`,"Export blocks":`Експорт блоків`,"Export selected blocks":`Експортувати вибрані блоки`,Februar:`Лютий`,February:`Лютий`,Filter:`фільтр`,Folder:`Папка`,Fr:`О`,Friday:`П'ятниця`,Function:`функція`,"Function editor":`Редактор функцій`,"Function: executed":`Функція: виконано`,"Go to next line":`Перейти до наступного рядка`,"HTTP Call":`Виклик HTTP`,"Hide logs":`Приховати журнали`,ID:`ID`,ID1:`ID1`,ID2:`ID2`,Import:`Імпорт`,"Import blocks":`Імпорт блоків`,"Import error":`Помилка імпорту`,"Import scripts":`Імпорт скриптів`,"Insert object ID":`Вставте ID об'єкта`,Instance:`Екземпляр`,"Instance is disabled":`Примірник вимкнено`,"Instance:":`екземпляр:`,Instances:`Примірники`,Instructions:`Інструкції`,"Invalid CRON":`Недійсний CRON`,"It will not be possible to revert this operation.":`Скасувати цю операцію буде неможливо.`,"JS description":`Створення правил шляхом написання Javascript`,Januar:`січень`,January:`січня`,July:`липень`,June:`червень`,"Just check":`Просто перевірте`,"Keep my changes":`Зберегти мої зміни`,"Language:":`Мову:`,"Learn More":`Вивчайте більше`,"Light style":`Легкий стиль`,Limit:`Ліміт`,"Local time":`Місцевий час`,"Locate file":`Знайти файл`,"Log outputs":`Виходи журналу`,"Log text":`Текст журналу`,"Log: %s":`Журнал: %s`,"Make a HTTP get request":`Зробіть HTTP-запит на отримання`,"Make a pause between actions":`Між діями робіть паузу`,March:`березень`,"March ":`березень`,May:`Може`,Menu:`Меню`,Message:`повідомлення`,Mo:`пн`,Model:`Модель`,Monday:`понеділок`,Month:`місяць`,More:`Більше`,Name:`Ім'я`,"No active host found":`Активний хост не знайдено`,"Nothing found":`Нічого не знайдено`,November:`Листопад`,OK:`в порядку`,October:`жовтень`,Ok:`В порядку`,"On condition change":`За умови зміни результату`,"On script save or adapter start":`Під час збереження сценарію або запуску адаптера`,"On weekdays":`В будні дні`,"Operate two states":`Керуйте двома станами`,"Operations with two states":`Операції з двома станами`,"Paste your blocks here":`Вставте сюди свої блоки`,Pause:`Пауза`,"Pause execution":`Призупинити виконання`,"Pause script":`Призупинити сценарій`,"Phone:":`телефон:`,"Please select object ID...":`Виберіть ідентифікатор об'єкта...`,"Prettify the script":`Прикрасьте сценарій`,"Print some text in log":`Надрукувати текст у журналі`,"Priority:":`Пріоритет:`,Pushover:`Pushover`,Pushsafer:`Pushsafer`,"Read only ID selected: %s":`Вибрано ідентифікатор лише для читання: %s`,Reload:`Перезавантажити`,Rename:`Перейменувати`,"Reorder scripts in folders":`Зміна порядку сценаріїв у папках`,Repeat:`Повторіть`,Restart:`Перезапустіть`,Result:`Результат`,"Resume execution":`Відновити виконання`,"Root folder":`Коренева папка`,"Rules description":`Створюйте правила з блоками IF, THEN, ELSE`,"Run script":`Запустіть сценарій`,Sa:`Sa`,Saturday:`Субота`,Save:`зберегти`,"Save all":`Зберегти все`,"Say It":`Скажи це`,"Say some text via sayit adapter":`Скажіть текст через адаптер sayit`,Schedule:`розклад`,Script:`Сценарій`,"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:`Вересень`,"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:`Симулювати`,"Some files will be rejected":`Деякі файли буде відхилено`,"Sound:":`звук:`,Stack:`Стек`,Start:`старт`,"Start script":`Запустити сценарій`,State:`Держава`,"State condition":`Стан стану`,"Step into function":`Крок у функції`,"Step out from function":`Вийти з функції`,"Stop on exception":`Зупинка на винятках`,Su:`Нд`,"Subject:":`Тема:`,Sunday:`неділя`,"TS description":`Створення правил шляхом написання Typescript`,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:`четвер`,Time:`час`,"Time condition":`Умова часу`,"Title:":`Назва:`,"To:":`до:`,"Trigger with value":`Тригер зі значенням`,Triggered:`Спрацьовує`,Triggers:`Тригери`,"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:`вт`,Tuesday:`вівторок`,URL:`URL`,"Unknown error":`Невідома помилка`,"Unknown error!":`Невідома помилка!`,"User function":`Функція користувача`,"User:":`Користувач:`,Value:`Значення`,"Vibration:":`Вібрація:`,Volume:`Обсяг`,We:`ми`,Wednesday:`Середа`,"Whatsapp-cmb":`Whatsapp-cmb`,Write:`Напишіть`,"Write your own code":`Напишіть власний код`,Yes:`Так`,"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, щоб використовувати старе значення тригера`,"Please select a valid model":`Будь ласка, виберіть дійсну модель`,"[equal]":`[рівний]`,"[greater or equal]":`[більше або дорівнює]`,"[greater]":`[більший]`,"[hysteresis]":`[гістерезис]`,"[includes]":`[включає]`,"[less or equal]":`[менше або рівно]`,"[less]":`[менше]`,"[not equal]":`[не дорівнює]`,acknowledgment:`підтвердження`,all:`все`,and:`і`,"as JSON":`як JSON`,"as plain text":`як текст`,astro:`Астро`,at:`в`,"clear running":`чіткий біг`,control:`КОНТРОЛЬ`,copy:`копія`,cron:`CRON`,dawn:`Світанок`,debug_help:`Це особливий режим, в якому стану та об'єкти не змінюватимуться. Але в протоколі відображатиметься лише інформація про кожну заплановану зміну.`,debug_label:`Відлагоджувати`,default:`за замовчуванням`,dusk:`Сутінки`,easy:`легко`,else:`інше`,"equal to":`дорівнює`,every:`кожен`,"every hour at 0 minutes":`щогодини о 0 хвилин`,false:`помилковий`,"file reading has failed: %s":`не вдалося прочитати файл: %s`,"file reading was aborted":`читання файлу було перервано`,filter_func:`функція`,filter_id:`ID`,filter_name:`Ім'я`,filter_role:`Роль`,filter_room:`Кімната`,"for edit or create script":`для редагування або створення нового сценарію`,"for professionals":`для професіоналів`,"for programmers":`для програмістів`,goldenHour:`Золота година`,goldenHourEnd:`Кінець золотої години`,"greater or equal":`більший або рівний`,"greater or equal to":`більше або дорівнює`,"greater than":`більше, ніж, величніше ніж, крутіший за`,help_just_check:`Код буде виконуватися лише щоразу, коли умова виконується. наприклад якщо спрацьовує значення датчика температури та умова «якщо температура перевищує 20°C», дії «тоді» виконуватимуться щоразу, коли датчик надсилає температуру, і вона перевищує 20°C. На 21°C, на 22°C і так далі.`,help_on_change:`Код буде виконано лише у разі зміни результату умови. наприклад якщо спрацьовує значення датчика температури та умова «якщо температура перевищує 20°C», дії «тоді» будуть виконані один раз, коли температура буде вище 20. Наступного разу дії «тоді» буде виконано, коли температура падає нижче 20, а потім знову піднімається вище 20.`,"high priority":`високий пріоритет`,"high-priority":`високий пріоритет`,"highest priority":`найвищий пріоритет`,hours:`години`,includes:`включає в себе`,interval:`інтервал`,"just check":`просто перевірте`,"less or equal":`менше або дорівнює`,"less or equal to":`менше або дорівнює`,"less than":`менше ніж`,"lower priority":`нижчий пріоритет`,"lowest priority":`найнижчий пріоритет`,magic:`магія`,milliseconds:`мілісекунд`,minutes:`хвилин`,ms:`РС`,nadir:`Надір`,nauticalDawn:`Морський світанок`,nauticalDusk:`Морські сутінки`,nextSunrise:`Наступний схід сонця`,nextSunset:`Наступний захід сонця`,night:`ніч`,nightEnd:`Кінець ночі`,"no blocks found":`Блоків не знайдено`,"no group":`НЕМАЄ ГРУПИ`,normal:`нормально`,"normal priority":`нормальний пріоритет`,"not running":`не запущено`,"not equal to":`не дорівнює`,"not properly connected":`Цей блок неправильно з’єднаний з іншими блоками.`,offset:`зсув`,"on change":`на зміну`,"on condition change":`про зміну умов`,"on update":`на оновлення`,one:`один`,or:`або`,quiet:`тихо`,"reset search":`скинути пошук`,search:`пошук`,seconds:`секунд`,solarNoon:`Сонячний полудень`,"store in":`зберігати в`,sunrise:`схід сонця`,sunriseEnd:`Кінець сходу сонця`,sunset:`Захід сонця`,sunsetStart:`Початок заходу сонця`,then:`потім`,"toggle value":`значення перемикання`,tooltip_ack:`Визнати`,tooltip_from:`Від`,tooltip_lc:`Востаннє змінено`,tooltip_quality:`якість`,tooltip_ts:`Мітка часу`,tooltip_user:`Користувач`,tooltip_value:`Значення`,true:`правда`,two:`два`,undefined:`невизначений`,update:`оновлення`,"use seconds":`використовуйте секунди`,"use trigger value":`використовувати значення тригера`,verbose_help:`Додає вихідні дані налагодження до журналу для багатьох системних команд`,verbose_label:`Докладні результати журналу`,when:`коли`,with:`з`,"with date":`з датою`,"with offset":`зі зміщенням`,wizard:`майстер`,"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:`Повторити`,"No running javascript instance found":`Не знайдено запущеного екземпляра JavaScript`,"OID display mode":`Режим відображення OID`,"Ask questions about your script, request changes, or generate new code.":`Задавайте питання про ваш скрипт, запитуйте зміни або генеруйте новий код.`,"to send":`для надсилання`,"Thinking...":`Думаю...`,"AI suggested changes":`Зміни, запропоновані ШІ`,Accept:`Прийняти`,Reject:`Відхилити`,"No API keys configured":`API-ключі не налаштовані`,"for new line":`для нового рядка`,"AI chat mode":`Режим чату ШІ`,"Plain conversation. Use for questions, explanations, syntax help. Does not read or modify your scripts.":`Звичайна розмова. Використовуйте для питань, пояснень і допомоги із синтаксисом. Не читає і не змінює скрипти.`,'For larger models with tool support. The AI can read, create, and edit scripts, look up datapoints, and browse the object tree — useful for "create a script that...", "which scripts use this state?" or "analyze my light script".':`Для більших моделей з підтримкою інструментів. ШІ може читати, створювати і редагувати скрипти, шукати датапоінти і переглядати дерево об'єктів — підходить для «створи скрипт, який …», «які скрипти використовують цей state?» або «проаналізуй мій скрипт освітлення».`,'For smaller models without tool support. Two-step script generator (plan then code) — useful for "create a script that..." or "write a Blockly rule for...". Output goes into the editor for smart-apply.':`Для менших моделей без підтримки інструментів. Двоетапний генератор скриптів (спочатку план, потім код) — підходить для «створи скрипт, який …» або «напиши правило Blockly для …». Результат потрапляє до редактора для smart-apply.`,"Plain conversation. Best for: general questions, syntax help, concept explanations.":`Звичайна розмова. Найкраще для: загальних питань, допомоги із синтаксисом, пояснення понять.`,"For larger models with tool support. Best for: creating, editing, or analyzing scripts; finding datapoint usages; inspecting the object tree.":`Для більших моделей з підтримкою інструментів. Найкраще для: створення, редагування або аналізу скриптів; пошуку використання датапоінтів; перегляду дерева об'єктів.`,"For smaller models without tool support. Best for: creating new JavaScript/TypeScript or Blockly scripts from a description.":`Для менших моделей без підтримки інструментів. Найкраще для: створення нових JavaScript/TypeScript або Blockly скриптів з опису.`,"Mention scripts as context for the AI. Use @all for all scripts or @scriptName for a specific one.":`Згадайте скрипти як контекст для ШІ. Використовуйте @всі для всіх скриптів або @назваСкрипта для конкретного.`,Context:`Контекст`,"current script":`поточний скрипт`,"all scripts":`усі скрипти`,devices:`пристрої`,"Searching datapoints":`Пошук точок даних`,"Reading value":`Читання значення`,"Loading object info":`Завантаження інформації про об'єкт`,"Searching scripts":`Пошук скриптів`,"Reading script":`Читання скрипта`,"Loading script list":`Завантаження списку скриптів`,"All scripts":`Усі скрипти`,"Smart home devices":`Пристрої розумного дому`,"AI Chat":`ШІ Чат`,"AI inline completions":`ШІ автодоповнення`,"New chat":`Новий чат`,"Ask about your script...":`Запитайте про ваш скрипт...`,"Insert blocks":`Вставити блоки`,"Apply blocks":`Застосувати блоки`,Undo:`Скасувати`,Redo:`Повторити`,"Insert into editor":`Вставити в редактор`,"Show as diff":`Показати як diff`,"Selected code as context":`Вибраний код як контекст`,"Generating plan...":`Створення плану...`,"Generating code...":`Генерація коду...`,Plan:`План`,"mention @all":`@усі`,"mention @devices":`@пристрої`,Send:`Надіслати`,Copy:`Копіювати`,"AI inline chat":`Вбудований ШІ-чат`,'e.g. "Refactor this to use async/await"':`напр. "Refactor this to use async/await"`,"Open in chat":`Відкрити в чаті`,"Selection: %s line(s)":`Виділення: %s рядок(ів)`,"No selection — the question will use context from the whole script.":`Без виділення — питання використає контекст усього скрипта.`,"Please enter a question.":`Введіть запитання.`,"Thinking…":`Думаю…`,"Code proposal — press Apply to replace your selection.":`Пропозиція коду — натисніть Застосувати, щоб замінити виділення.`,"Plain text answer.":`Текстова відповідь.`,"Show more details":`Показати більше подробиць`,"AI: Inline chat…":`ШІ: Вбудований чат…`,"AI: Explain":`ШІ: Пояснити`,"AI: Refactor":`ШІ: Рефакторинг`,"AI: Add comments":`ШІ: Додати коментарі`,"AI: Fix problem":`ШІ: Виправити проблему`,"AI: Suggest tests":`ШІ: Запропонувати тести`,"Ask the AI about the selected code:":`Запитайте ШІ про виділений код:`,Explain:`Пояснити`,Refactor:`Рефакторинг`,Tests:`Тести`,"Explain %s %s":`Пояснити %s %s`,"Refactor %s %s":`Рефакторинг %s %s`,"Suggest tests for %s %s":`Запропонувати тести для %s %s`,"Apply changes":`Застосувати зміни`,"Discard changes":`Скасувати зміни`,'Ask anything, or request a change (e.g. "what does this do?")':`Запитайте будь-що або попросіть зміни (напр. "що це робить?")`,Wizard:`Майстер`,"Create a rule step by step":`Створити правило крок за кроком`,Summary:`Підсумок`,Back:`Назад`,Next:`Далі`,Skip:`Пропустити`,"Create rule":`Створити правило`,"Replace rule":`Замінити правило`,"The current rule will be replaced":`Поточне правило буде замінено`,"Add another":`Додати ще`,"Without a condition the rule always runs":`Без умови правило виконується завжди`,"What should start the rule?":`Що має запускати правило?`,"When should the rule run? This step is optional.":`Коли правило має виконуватися? Цей крок необов'язковий.`,"What should happen?":`Що має статися?`,"Block not found":`Блок не знайдено`,Weekday:`День тижня`,"Let the rule run only on the selected days of the week":`Виконувати правило лише у вибрані дні тижня`,"Send to adapter":`Надіслати адаптеру`,"Sends a message to any adapter instance":`Надсилає повідомлення будь-якому екземпляру адаптера`,"Command:":`Команда:`,"JSON:":`JSON:`,"Sent:":`Надіслано:`,"User condition":`Умова користувача`,"Write your own condition":`Напишіть власну умову`,"This is an advanced option. The code is the body of a function and must return the result, e.g. \"return getState('javascript.0.variable').val > 5;\". You may use await inside.":`Це розширена опція. Код є тілом функції та має повернути результат через return, наприклад "return getState('javascript.0.variable').val > 5;". Усередині можна використовувати await.`,"On message":`За повідомленням`,"Triggers the rule when another script or adapter sends a message":`Запускає правило, коли інший скрипт або адаптер надсилає повідомлення`,"Send the message from a script with messageTo({instance: 'javascript.0'}, 'myMessage', data). The sent data is available in the texts of the actions as %s.":`Надішліть повідомлення зі скрипту за допомогою messageTo({instance: 'javascript.0'}, 'myMessage', data). Надіслані дані доступні в текстах дій як %s.`,"Message name:":`Назва повідомлення:`,"Received:":`Отримано:`,Notification:`Сповіщення`,"Creates an ioBroker notification, which is shown in the admin":`Створює сповіщення ioBroker, яке відображається в адмінці`,"Notification text":`Текст сповіщення`,"as alert":`як тривога`,Alert:`Тривога`,"Registered:":`Зареєстровано:`,"Toggle between two values":`Перемкнути між двома значеннями`,"Switches a state back and forth between two values":`Перемикає стан між двома значеннями`,'If the state does not hold the first value, the first one is written - so the rule always ends up on a defined value. To invert a boolean, use the "toggle value" checkbox of the "Set state action" instead.':`Якщо стан не містить перше значення, записується перше - так правило завжди приходить до визначеного значення. Щоб інвертувати логічне значення, використовуйте прапорець "toggle value" дії "Set state action".`,between:`між`,"Toggled:":`Перемкнено:`,"On file change":`При зміні файлу`,"Triggers the rule when a file of an object is written or deleted":`Запускає правило, коли файл об'єкта записано або видалено`,'Both fields may contain *, e.g. the object "vis.0" and the file name "main/*". In the texts of the actions %s is the name of the changed file and %id the object it belongs to. Requires js-controller 4.1 or newer.':`Обидва поля можуть містити *, наприклад об'єкт "vis.0" та ім'я файлу "main/*". У текстах дій %s — ім'я зміненого файлу, а %id — об'єкт, якому він належить. Потрібен js-controller 4.1 або новіший.`,"Files of:":`Файли об'єкта:`,"File name:":`Ім'я файлу:`,"File changed:":`Файл змінено:`,"Deleted:":`Видалено:`,File:`Файл`,"On object change":`При зміні об'єкта`,"Triggers the rule when an object is created, changed or deleted":`Запускає правило, коли об'єкт створено, змінено або видалено`,'This reacts to the object itself, not to its value - use the "State" trigger for values. The pattern may contain *, e.g. "hm-rpc.0.*". In the texts of the actions %s and %id are the id of the changed object.':`Реагує на сам об'єкт, а не на його значення - для значень використовуйте тригер "State". Шаблон може містити *, наприклад "hm-rpc.0.*". У текстах дій %s та %id — ідентифікатор зміненого об'єкта.`,"Object ID:":`ID об'єкта:`,"React on:":`Реагувати на:`,"any change":`будь-яку зміну`,"created or changed":`створено або змінено`,deleted:`видалено`,"Object changed:":`Об'єкт змінено:`,"Object deleted:":`Об'єкт видалено:`,"On log message":`При записі в журнал`,"Triggers the rule when something is written to the ioBroker log":`Запускає правило, коли щось записується до журналу ioBroker`,'Leave "Contains" empty to react to every entry of that level. Fill it in if an action of this rule writes to the log itself - a rule that matches its own message can trigger itself. In the texts of the actions %s is the log message and %id the instance it came from.':`Залиште "Містить" порожнім, щоб реагувати на кожен запис цього рівня. Заповніть, якщо дія цього правила сама пише в журнал: правило, що збігається з власним повідомленням, може запустити само себе. У текстах дій %s — повідомлення журналу, а %id — екземпляр, від якого воно надійшло.`,"Level:":`Рівень:`,"Contains:":`Містить:`,error:`error`,warn:`warn`,info:`info`,debug:`debug`,silly:`silly`,"any level":`будь-який рівень`,"Logged:":`У журналі:`,"Log contains":`Журнал містить`,"Every log entry":`Кожен запис журналу`,"On rule stop":`При зупинці правила`,"Runs the rule once more when it is stopped, saved or the adapter shuts down":`Виконує правило ще раз при зупинці, збереженні або завершенні роботи адаптера`,"The adapter waits for the actions, but only for the time set here - what does not fit is cut off. A rule can have only one block of this kind; a second one replaces the first.":`Адаптер чекає на виконання дій, але лише заданий тут час - те, що не вмістилося, обривається. Правило може містити лише один такий блок; другий замінює перший.`,"Wait at most:":`Чекати не більше:`,"HTTP error:":`Помилка HTTP:`,"On enum member change":`При зміні в переліку`,"Triggers the rule when any state of a room or function changes":`Запускає правило при зміні будь-якого стану кімнати або функції`,"Subscribes to every state of the selected enum and follows it: a device added to that room later is included without changing the rule. In the texts of the actions %s is the new value and %id the state that changed.":`Підписується на кожен стан вибраного переліку та слідує за ним: пристрій, доданий пізніше, враховується без зміни правила. У текстах дій %s — нове значення, а %id — стан, що змінився.`,"Members of:":`Члени:`,"Any member of":`Будь-який член`,"Send message":`Надіслати повідомлення`,"Sends a message to other scripts and rules":`Надсилає повідомлення іншим скриптам і правилам`,'Every rule with an "On message" trigger of the same name receives it, as does a script with onMessage(). You can use %s in the text to send the current trigger value or %id the triggered object ID.':`Її отримає будь-яке правило з тригером "За повідомленням" з тією ж назвою, а також скрипт з onMessage(). За допомогою %s у тексті ви надішлете поточне значення тригера, а %id — ID об'єкта, що спрацював.`,"Set state if changed":`Задати стан лише при зміні`,"Writes a state only if its value differs from the current one":`Записує стан, лише якщо його значення відрізняється від поточного`,'Use this instead of "Set state action" for rules that run often: an unchanged value is not written at all, so nothing subscribed to that state is woken up for nothing.':`Використовуйте замість "Set state action" у правилах, що виконуються часто: незмінене значення взагалі не записується, тож ніщо, підписане на цей стан, не будиться даремно.`,"only if changed":`лише при зміні`,"A block failed while generating the script, so the changes cannot be saved":`Один із блоків спричинив помилку під час генерації скрипту, зміни не можуть бути збережені`,"Blockly error":`Помилка Blockly`,"Export error":`Помилка експорту`},ZA={"%s not found":`%s 未找到`,"()":`()`,"(at %s)":`(在 %s)`,"(optional)":`(选修的)`,"-":`-`,".":`.`,Ack:`确认`,Actions:`动作`,"Actual time of day":`一天中的实际时间`,Add:`添加`,"Add new script":`添加新脚本`,All:`所有`,"All files will be accepted":`所有文件都将被接受`,Any:`任何`,"Any month":`任何月份`,Apply:`申请`,April:`四月`,"Are you sure?":`你确定吗?`,Ask:`问`,Astronomical:`天文`,"Astronomical events today":`今天的天文事件`,August:`八月`,"Blockly description":`按图形块创建规则`,"Body:":`身体:`,Cancel:`取消`,"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:`关闭`,"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:`健康)状况`,Conditions:`情况`,"Configuration not saved.":`配置未保存。`,Console:`安慰`,"Control or update some state":`控制或更新某些状态`,"Control or update some state with delay":`延迟控制或更新某些状态`,"Convert blockly to javascript for ever.":`立即将blockly转换为Javascript。`,Copied:`复制的`,"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:`十二月`,Default:`默认`,"Define cron...":`定义周期任务...`,"Define schedule...":`定义调度器......`,Delay:`延迟`,Delete:`删除`,"Delete %s":`删除%s...`,"Delete folder":`删除文件夹`,"Delete script":`删除脚本`,Description:`描述`,"Deselect all":`取消全选`,"Discard changes for %s":`放弃%s的更改`,Done:`完成`,"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":`结束搜索模式`,Error:`错误`,"Error formatting code":`代码格式错误`,"Error was found":`发现错误`,"Every day":`每天`,Exec:`执行力`,"Executes some shell command":`执行一些shell命令`,"Existing scripts will be overwritten.":`现有脚本将被覆盖。`,"Expand all":`展开全部`,"Expert mode":`专家模式`,Explanation:`解释`,Export:`导出`,"Export all scripts":`导出所有脚本`,"Export blocks":`导出块`,"Export selected blocks":`导出选定的块`,Februar:`二月`,February:`二月`,Filter:`筛选`,Folder:`文件夹`,Fr:`r`,Friday:`星期五`,Function:`功能`,"Function editor":`功能编辑器`,"Function: executed":`功能:执行`,"Go to next line":`转到下一行`,"HTTP Call":`HTTP呼叫`,"Hide logs":`隐藏日志`,ID:`ID`,ID1:`ID1`,ID2:`ID2`,Import:`导入`,"Import blocks":`导入块`,"Import error":`导入错误`,"Import scripts":`导入脚本`,"Insert object ID":`插入对象ID`,Instance:`实例`,"Instance is disabled":`实例已禁用`,"Instance:":`实例:`,Instances:`实例`,Instructions:`指示`,"Invalid CRON":`无效的周期任务`,"It will not be possible to revert this operation.":`无法恢复此操作。`,"JS description":`通过编写Javascript来创建规则`,Januar:`亚努尔`,January:`一月`,July:`七月`,June:`六月`,"Just check":`只是检查`,"Keep my changes":`保留我的更改`,"Language:":`语言:`,"Learn More":`了解更多`,"Light style":`浅色调风格`,Limit:`限制`,"Local time":`当地时间`,"Locate file":`定位文件`,"Log outputs":`记录输出`,"Log text":`记录文字`,"Log: %s":`日志:%s`,"Make a HTTP get request":`发出HTTP获取请求`,"Make a pause between actions":`在动作之间暂停`,March:`三月`,"March ":`行进`,May:`五月`,Menu:`菜单`,Message:`信息`,Mo:`莫`,Model:`模型`,Monday:`星期一`,Month:`月`,More:`更多的`,Name:`名称`,"No active host found":`找不到活动主机`,"Nothing found":`没有发现`,November:`十一月`,OK:`好的`,October:`十月`,Ok:`确定`,"On condition change":`条件变化时`,"On script save or adapter start":`在脚本保存或适配器启动时`,"On weekdays":`在工作日`,"Operate two states":`操作两种状态`,"Operations with two states":`具有两种状态的操作`,"Paste your blocks here":`在此处粘贴您的区块`,Pause:`暂停`,"Pause execution":`暂停执行`,"Pause script":`暂停脚本`,"Phone:":`电话:`,"Please select object ID...":`请选择对象ID...`,"Prettify the script":`美化脚本`,"Print some text in log":`在日志中打印一些文本`,"Priority:":`优先:`,Pushover:`俯卧撑`,Pushsafer:`推安全`,"Read only ID selected: %s":`选择的只读ID:%s`,Reload:`重新加载`,Rename:`重命名`,"Reorder scripts in folders":`重新排序文件夹中的脚本`,Repeat:`重复`,Restart:`重启`,Result:`结果`,"Resume execution":`恢复执行`,"Root folder":`根文件夹`,"Rules description":`使用IF,THEN,ELSE块创建规则`,"Run script":`运行脚本`,Sa:`萨`,Saturday:`星期六`,Save:`保存`,"Save all":`保存全部`,"Say It":`Say It`,"Say some text via sayit adapter":`通过sayit适配器说一些文字`,Schedule:`日程`,Script:`脚本`,"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:`九月`,"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:`模拟`,"Some files will be rejected":`有些文件将被拒绝`,"Sound:":`声音:`,Stack:`堆`,Start:`开始`,"Start script":`启动脚本`,State:`状态`,"State condition":`状态条件`,"Step into function":`进入功能`,"Step out from function":`退出函数`,"Stop on exception":`异常停止`,Su:`苏`,"Subject:":`学科:`,Sunday:`星期日`,"TS description":`通过编写Typescript来创建规则`,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:`星期四`,Time:`时间`,"Time condition":`时间条件`,"Title:":`标题:`,"To:":`到:`,"Trigger with value":`用值触发`,Triggered:`触发`,Triggers:`扳机`,"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:`涂`,Tuesday:`星期二`,URL:`网址`,"Unknown error":`未知错误`,"Unknown error!":`未知错误!`,"User function":`用户功能`,"User:":`用户:`,Value:`价值`,"Vibration:":`振动:`,Volume:`体积`,We:`3`,Wednesday:`星期三`,"Whatsapp-cmb":`Whatsapp的cmb`,Write:`写`,"Write your own code":`编写自己的代码`,Yes:`是的`,"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 使用旧触发器值`,"Please select a valid model":`请选择有效的模型`,"[equal]":`[平等的]`,"[greater or equal]":`[大于等于]`,"[greater]":`[更大]`,"[hysteresis]":`[磁滞]`,"[includes]":`[包括]`,"[less or equal]":`[小于或等于]`,"[less]":`[较少的]`,"[not equal]":`[不相等]`,acknowledgment:`致谢`,all:`全部`,and:`和`,"as JSON":`为 JSON`,"as plain text":`为纯文本`,astro:`天文`,at:`在`,"clear running":`畅通无阻`,control:`控制`,copy:`复制`,cron:`克朗`,dawn:`黎明`,debug_help:`这是一种特殊模式,其中状态和对象不会改变。但只有有关每个计划更改的信息才会显示在协议中。`,debug_label:`调试`,default:`默认`,dusk:`黄昏`,easy:`简单的`,else:`别的`,"equal to":`等于`,every:`每一个`,"every hour at 0 minutes":`每小时0分钟`,false:`错误的`,"file reading has failed: %s":`文件读取失败:%s`,"file reading was aborted":`文件读取中止`,filter_func:`功能`,filter_id:`ID`,filter_name:`名字`,filter_role:`角色`,filter_room:`房间`,"for edit or create script":`用于编辑或创建脚本`,"for professionals":`对于专业人士`,"for programmers":`对于程序员`,goldenHour:`黄金时段`,goldenHourEnd:`黄金时段结束`,"greater or equal":`大于或等于`,"greater or equal to":`大于或等于`,"greater than":`比...更棒`,help_just_check:`仅在条件为真时才执行代码。例如。如果触发温度传感器值并且条件为“如果温度大于20°C”,则每次传感器发送温度且温度超过20°C时,将执行“然后”动作。 21°C,22°C等。`,help_on_change:`仅当条件结果更改时,代码才会执行。例如。如果触发温度传感器值且条件为“如果温度大于20°C”,则温度超过20时将执行一次“则”动作,下一次,当温度超过20时将执行“则”动作低于20失败,然后再次超过20。`,"high priority":`高优先级`,"high-priority":`高优先级`,"highest priority":`最高优先级`,hours:`小时`,includes:`包括`,interval:`间隔`,"just check":`只是检查`,"less or equal":`小于或等于`,"less or equal to":`小于或等于`,"less than":`少于`,"lower priority":`低优先级`,"lowest priority":`最低优先级`,magic:`魔法`,milliseconds:`毫秒`,minutes:`分钟`,ms:`毫秒`,nadir:`最低点`,nauticalDawn:`航海黎明`,nauticalDusk:`航海黄昏`,nextSunrise:`下一个日出`,nextSunset:`下一个日落`,night:`夜晚`,nightEnd:`夜晚结束`,"no blocks found":`找不到块`,"no group":`没有组`,normal:`普通的`,"normal priority":`正常优先`,"not running":`未运行`,"not equal to":`不等于`,"not properly connected":`此块未正确连接到其他块。`,offset:`抵消`,"on change":`在变化`,"on condition change":`在条件变化时`,"on update":`更新时`,one:`一`,or:`或`,quiet:`安静的`,"reset search":`重置搜索`,search:`搜索`,seconds:`秒`,solarNoon:`星期日正午`,"store in":`存放在`,sunrise:`日出`,sunriseEnd:`日出结束`,sunset:`日落`,sunsetStart:`日落开始`,then:`然后`,"toggle value":`切换值`,tooltip_ack:`确认`,tooltip_from:`从`,tooltip_lc:`上一次改变`,tooltip_quality:`质量`,tooltip_ts:`时间戳`,tooltip_user:`用户`,tooltip_value:`值`,true:`真的`,two:`二`,undefined:`不明确的`,update:`更新`,"use seconds":`精确到秒`,"use trigger value":`使用触发值`,verbose_help:`将调试输出添加到许多系统命令的日志中`,verbose_label:`详细日志输出`,when:`什么时候`,with:`和`,"with date":`有日期`,"with offset":`带偏移`,wizard:`巫师`,"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:`重试`,"No running javascript instance found":`未找到正在运行的 JavaScript 实例`,"OID display mode":`OID显示模式`,"Ask questions about your script, request changes, or generate new code.":`询问有关脚本的问题、请求更改或生成新代码。`,"to send":`发送`,"Thinking...":`思考中...`,"AI suggested changes":`AI 建议的更改`,Accept:`接受`,Reject:`拒绝`,"No API keys configured":`未配置 API 密钥`,"for new line":`换行`,"AI chat mode":`AI 聊天模式`,"Plain conversation. Use for questions, explanations, syntax help. Does not read or modify your scripts.":`纯对话。用于提问、解释和语法帮助。不会读取或修改你的脚本。`,'For larger models with tool support. The AI can read, create, and edit scripts, look up datapoints, and browse the object tree — useful for "create a script that...", "which scripts use this state?" or "analyze my light script".':`适用于支持工具调用的较大模型。AI 可以读取、创建和编辑脚本,查询数据点并浏览对象树——适用于"创建一个脚本,执行..."、"哪些脚本使用了此状态?"或"分析我的灯光脚本"等场景。`,'For smaller models without tool support. Two-step script generator (plan then code) — useful for "create a script that..." or "write a Blockly rule for...". Output goes into the editor for smart-apply.':`适用于不支持工具调用的较小模型。两步脚本生成器(先计划再生成代码)——适用于"创建一个脚本,执行..."或"为...编写 Blockly 规则"。输出进入编辑器以供 smart-apply 使用。`,"Plain conversation. Best for: general questions, syntax help, concept explanations.":`纯对话。最适合:一般问题、语法帮助、概念解释。`,"For larger models with tool support. Best for: creating, editing, or analyzing scripts; finding datapoint usages; inspecting the object tree.":`适用于支持工具调用的较大模型。最适合:创建、编辑或分析脚本;查找数据点用法;检查对象树。`,"For smaller models without tool support. Best for: creating new JavaScript/TypeScript or Blockly scripts from a description.":`适用于不支持工具调用的较小模型。最适合:根据描述创建新的 JavaScript/TypeScript 或 Blockly 脚本。`,"Mention scripts as context for the AI. Use @all for all scripts or @scriptName for a specific one.":`将脚本作为AI的上下文。使用 @全部 引用所有脚本,或 @脚本名称 引用特定脚本。`,Context:`上下文`,"current script":`当前脚本`,"all scripts":`所有脚本`,devices:`设备`,"Searching datapoints":`搜索数据点`,"Reading value":`读取值`,"Loading object info":`加载对象信息`,"Searching scripts":`搜索脚本`,"Reading script":`读取脚本`,"Loading script list":`加载脚本列表`,"All scripts":`所有脚本`,"Smart home devices":`智能家居设备`,"AI Chat":`AI 聊天`,"AI inline completions":`AI 内联补全`,"New chat":`新聊天`,"Ask about your script...":`询问有关脚本的问题...`,"Insert blocks":`插入积木块`,"Apply blocks":`应用模块`,Undo:`撤销`,Redo:`重做`,"Insert into editor":`插入编辑器`,"Show as diff":`显示差异`,"Selected code as context":`选中的代码作为上下文`,"Generating plan...":`生成计划...`,"Generating code...":`生成代码...`,Plan:`计划`,"mention @all":`@全部`,"mention @devices":`@设备`,Send:`发送`,Copy:`复制`,"AI inline chat":`AI 内联聊天`,'e.g. "Refactor this to use async/await"':`例如 "Refactor this to use async/await"`,"Open in chat":`在聊天中打开`,"Selection: %s line(s)":`选中:%s 行`,"No selection — the question will use context from the whole script.":`未选择 — 问题将使用整个脚本的上下文。`,"Please enter a question.":`请输入问题。`,"Thinking…":`思考中…`,"Code proposal — press Apply to replace your selection.":`代码建议 — 按应用替换所选内容。`,"Plain text answer.":`纯文本答案。`,"Show more details":`显示更多详情`,"AI: Inline chat…":`AI:内联聊天…`,"AI: Explain":`AI:解释`,"AI: Refactor":`AI:重构`,"AI: Add comments":`AI:添加注释`,"AI: Fix problem":`AI:修复问题`,"AI: Suggest tests":`AI:建议测试`,"Ask the AI about the selected code:":`向 AI 询问所选代码:`,Explain:`解释`,Refactor:`重构`,Tests:`测试`,"Explain %s %s":`解释 %s %s`,"Refactor %s %s":`重构 %s %s`,"Suggest tests for %s %s":`为 %s %s 建议测试`,"Apply changes":`应用更改`,"Discard changes":`放弃更改`,'Ask anything, or request a change (e.g. "what does this do?")':`提问或请求修改(例如"这段代码做什么?")`,Wizard:`向导`,"Create a rule step by step":`逐步创建规则`,Summary:`摘要`,Back:`上一步`,Next:`下一步`,Skip:`跳过`,"Create rule":`创建规则`,"Replace rule":`替换规则`,"The current rule will be replaced":`当前规则将被替换`,"Add another":`再添加一个`,"Without a condition the rule always runs":`没有条件时,规则始终执行`,"What should start the rule?":`什么触发这条规则?`,"When should the rule run? This step is optional.":`规则何时执行?此步骤为可选。`,"What should happen?":`应该发生什么?`,"Block not found":`未找到模块`,Weekday:`星期`,"Let the rule run only on the selected days of the week":`仅在所选的星期几执行规则`,"Send to adapter":`发送到适配器`,"Sends a message to any adapter instance":`向任意适配器实例发送消息`,"Command:":`命令:`,"JSON:":`JSON:`,"Sent:":`已发送:`,"User condition":`用户条件`,"Write your own condition":`编写自己的条件`,"This is an advanced option. The code is the body of a function and must return the result, e.g. \"return getState('javascript.0.variable').val > 5;\". You may use await inside.":`这是高级选项。代码是函数体,必须用 return 返回结果,例如 "return getState('javascript.0.variable').val > 5;"。其中可以使用 await。`,"On message":`收到消息时`,"Triggers the rule when another script or adapter sends a message":`当其他脚本或适配器发送消息时触发该规则`,"Send the message from a script with messageTo({instance: 'javascript.0'}, 'myMessage', data). The sent data is available in the texts of the actions as %s.":`在脚本中使用 messageTo({instance: 'javascript.0'}, 'myMessage', data) 发送消息。发送的数据可在动作文本中用 %s 引用。`,"Message name:":`消息名称:`,"Received:":`已接收:`,Notification:`通知`,"Creates an ioBroker notification, which is shown in the admin":`创建一条 ioBroker 通知,在 admin 中显示`,"Notification text":`通知文本`,"as alert":`作为警报`,Alert:`警报`,"Registered:":`已注册:`,"Toggle between two values":`在两个值之间切换`,"Switches a state back and forth between two values":`在两个值之间来回切换某个状态`,'If the state does not hold the first value, the first one is written - so the rule always ends up on a defined value. To invert a boolean, use the "toggle value" checkbox of the "Set state action" instead.':`如果状态不等于第一个值,则写入第一个值——这样规则总能落在一个确定的值上。要反转布尔值,请改用 "Set state action" 动作的 "toggle value" 复选框。`,between:`介于`,"Toggled:":`已切换:`,"On file change":`文件变化时`,"Triggers the rule when a file of an object is written or deleted":`当某个对象的文件被写入或删除时触发该规则`,'Both fields may contain *, e.g. the object "vis.0" and the file name "main/*". In the texts of the actions %s is the name of the changed file and %id the object it belongs to. Requires js-controller 4.1 or newer.':`两个字段都可以包含 *,例如对象 "vis.0" 和文件名 "main/*"。在动作文本中,%s 是发生变化的文件名,%id 是它所属的对象。需要 js-controller 4.1 或更高版本。`,"Files of:":`文件所属对象:`,"File name:":`文件名:`,"File changed:":`文件已更改:`,"Deleted:":`已删除:`,File:`文件`,"On object change":`对象变化时`,"Triggers the rule when an object is created, changed or deleted":`当对象被创建、修改或删除时触发该规则`,'This reacts to the object itself, not to its value - use the "State" trigger for values. The pattern may contain *, e.g. "hm-rpc.0.*". In the texts of the actions %s and %id are the id of the changed object.':`它响应对象本身,而不是它的值——值请使用 "State" 触发器。模式中可以包含 *,例如 "hm-rpc.0.*"。在动作文本中,%s 和 %id 都是发生变化的对象 ID。`,"Object ID:":`对象 ID:`,"React on:":`响应:`,"any change":`任何变化`,"created or changed":`创建或修改`,deleted:`删除`,"Object changed:":`对象已更改:`,"Object deleted:":`对象已删除:`,"On log message":`收到日志消息时`,"Triggers the rule when something is written to the ioBroker log":`当有内容写入 ioBroker 日志时触发该规则`,'Leave "Contains" empty to react to every entry of that level. Fill it in if an action of this rule writes to the log itself - a rule that matches its own message can trigger itself. In the texts of the actions %s is the log message and %id the instance it came from.':`将 "包含" 留空即可响应该级别的每一条记录。如果本规则的某个动作自己会写日志,请填写它——匹配到自己消息的规则可能会自我触发。在动作文本中,%s 是日志消息,%id 是来源实例。`,"Level:":`级别:`,"Contains:":`包含:`,error:`error`,warn:`warn`,info:`info`,debug:`debug`,silly:`silly`,"any level":`任意级别`,"Logged:":`已记录:`,"Log contains":`日志包含`,"Every log entry":`每条日志记录`,"On rule stop":`规则停止时`,"Runs the rule once more when it is stopped, saved or the adapter shuts down":`在规则被停止、保存或适配器关闭时再执行一次该规则`,"The adapter waits for the actions, but only for the time set here - what does not fit is cut off. A rule can have only one block of this kind; a second one replaces the first.":`适配器会等待这些动作,但只等待此处设置的时长——超出部分会被中断。一条规则只能有一个此类块;第二个会替换第一个。`,"Wait at most:":`最多等待:`,"HTTP error:":`HTTP 错误:`,"On enum member change":`枚举成员变化时`,"Triggers the rule when any state of a room or function changes":`当某个房间或功能的任意状态发生变化时触发该规则`,"Subscribes to every state of the selected enum and follows it: a device added to that room later is included without changing the rule. In the texts of the actions %s is the new value and %id the state that changed.":`订阅所选枚举中的每一个状态并随之更新:之后加入该房间的设备无需修改规则即可生效。在动作文本中,%s 是新值,%id 是发生变化的状态。`,"Members of:":`成员属于:`,"Any member of":`任意成员属于`,"Send message":`发送消息`,"Sends a message to other scripts and rules":`向其他脚本和规则发送消息`,'Every rule with an "On message" trigger of the same name receives it, as does a script with onMessage(). You can use %s in the text to send the current trigger value or %id the triggered object ID.':`任何带有同名 "收到消息时" 触发器的规则都会收到它,使用 onMessage() 的脚本也一样。在文本中用 %s 发送当前触发值,用 %id 发送触发对象的 ID。`,"Set state if changed":`仅在变化时设置状态`,"Writes a state only if its value differs from the current one":`仅当值与当前值不同时才写入状态`,'Use this instead of "Set state action" for rules that run often: an unchanged value is not written at all, so nothing subscribed to that state is woken up for nothing.':`对于频繁运行的规则,请用它代替 "Set state action":值未变化时根本不会写入,订阅该状态的一切也就不会被白白唤醒。`,"only if changed":`仅在变化时`,"A block failed while generating the script, so the changes cannot be saved":`生成脚本时某个积木块出错,更改无法保存`,"Blockly error":`Blockly 错误`,"Export error":`导出错误`},QA=t(r(((t,n)=>{(function(e){typeof t==`object`&&n!==void 0?n.exports=e():typeof define==`function`&&define.amd?define([],e):(typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this).JSZip=e()})(function(){return function t(n,r,i){function a(s,c){if(!r[s]){if(!n[s]){var l=typeof e==`function`&&e;if(!c&&l)return l(s,!0);if(o)return o(s,!0);var u=Error(`Cannot find module '`+s+`'`);throw u.code=`MODULE_NOT_FOUND`,u}var d=r[s]={exports:{}};n[s][0].call(d.exports,function(e){var t=n[s][1][e];return a(t||e)},d,d.exports,t,n,r,i)}return r[s].exports}for(var o=typeof e==`function`&&e,s=0;s>2,s=(3&t)<<4|n>>4,c=1>6:64,l=2>4,n=(15&o)<<4|(s=a.indexOf(e.charAt(l++)))>>2,r=(3&s)<<6|(c=a.indexOf(e.charAt(l++))),f[u++]=t,s!==64&&(f[u++]=n),c!==64&&(f[u++]=r);return f}},{"./support":30,"./utils":32}],2:[function(e,t,n){var r=e(`./external`),i=e(`./stream/DataWorker`),a=e(`./stream/Crc32Probe`),o=e(`./stream/DataLengthProbe`);function s(e,t,n,r,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=i}s.prototype={getContentWorker:function(){var e=new i(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o(`data_length`)),t=this;return e.on(`end`,function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw Error(`Bug : uncompressed data size mismatch`)}),e},getCompressedWorker:function(){return new i(r.Promise.resolve(this.compressedContent)).withStreamInfo(`compressedSize`,this.compressedSize).withStreamInfo(`uncompressedSize`,this.uncompressedSize).withStreamInfo(`crc32`,this.crc32).withStreamInfo(`compression`,this.compression)}},s.createWorkerFrom=function(e,t,n){return e.pipe(new a).pipe(new o(`uncompressedSize`)).pipe(t.compressWorker(n)).pipe(new o(`compressedSize`)).withStreamInfo(`compression`,t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){var r=e(`./stream/GenericWorker`);n.STORE={magic:`\0\0`,compressWorker:function(){return new r(`STORE compression`)},uncompressWorker:function(){return new r(`STORE decompression`)}},n.DEFLATE=e(`./flate`)},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){var r=e(`./utils`),i=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return e!==void 0&&e.length?r.getTypeOf(e)===`string`?function(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s>>8^a[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length,0):function(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s>>8^a[255&(e^t[s])];return-1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,n){n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t,n){var r=null;r=typeof Promise<`u`?Promise:e(`lie`),t.exports={Promise:r}},{lie:37}],7:[function(e,t,n){var r=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Uint32Array<`u`,i=e(`pako`),a=e(`./utils`),o=e(`./stream/GenericWorker`),s=r?`uint8array`:`array`;function c(e,t){o.call(this,`FlateWorker/`+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}n.magic=`\b\0`,a.inherits(c,o),c.prototype.processChunk=function(e){this.meta=e.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(s,e.data),!1)},c.prototype.flush=function(){o.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},c.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},c.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new c(`Deflate`,e)},n.uncompressWorker=function(){return new c(`Inflate`,{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,n){function r(e,t){var n,r=``;for(n=0;n>>=8;return r}function i(e,t,n,i,o,u){var d,f,p=e.file,m=e.compression,h=u!==s.utf8encode,g=a.transformTo(`string`,u(p.name)),_=a.transformTo(`string`,s.utf8encode(p.name)),v=p.comment,y=a.transformTo(`string`,u(v)),b=a.transformTo(`string`,s.utf8encode(v)),x=_.length!==p.name.length,S=b.length!==v.length,C=``,w=``,T=``,E=p.dir,D=p.date,O={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(O.crc32=e.crc32,O.compressedSize=e.compressedSize,O.uncompressedSize=e.uncompressedSize);var k=0;t&&(k|=8),h||!x&&!S||(k|=2048);var A=0,j=0;E&&(A|=16),o===`UNIX`?(j=798,A|=function(e,t){var n=e;return e||(n=t?16893:33204),(65535&n)<<16}(p.unixPermissions,E)):(j=20,A|=function(e){return 63&(e||0)}(p.dosPermissions)),d=D.getUTCHours(),d<<=6,d|=D.getUTCMinutes(),d<<=5,d|=D.getUTCSeconds()/2,f=D.getUTCFullYear()-1980,f<<=4,f|=D.getUTCMonth()+1,f<<=5,f|=D.getUTCDate(),x&&(w=r(1,1)+r(c(g),4)+_,C+=`up`+r(w.length,2)+w),S&&(T=r(1,1)+r(c(y),4)+b,C+=`uc`+r(T.length,2)+T);var M=``;return M+=` +\0`,M+=r(k,2),M+=m.magic,M+=r(d,2),M+=r(f,2),M+=r(O.crc32,4),M+=r(O.compressedSize,4),M+=r(O.uncompressedSize,4),M+=r(g.length,2),M+=r(C.length,2),{fileRecord:l.LOCAL_FILE_HEADER+M+g+C,dirRecord:l.CENTRAL_FILE_HEADER+r(j,2)+M+r(y.length,2)+`\0\0\0\0`+r(A,4)+r(i,4)+g+C+y}}var a=e(`../utils`),o=e(`../stream/GenericWorker`),s=e(`../utf8`),c=e(`../crc32`),l=e(`../signature`);function u(e,t,n,r){o.call(this,`ZipFileWorker`),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(u,o),u.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,o.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-r-1))/n:100}}))},u.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},u.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=i(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:function(e){return l.DATA_DESCRIPTOR+r(e.crc32,4)+r(e.compressedSize,4)+r(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},u.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return r.transformTo(`string`,this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,n){var r=e(`./Uint8ArrayReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,n){var r=e(`./DataReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,n){var r=e(`./ArrayReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.readData=function(e){if(this.checkOffset(e),e===0)return new Uint8Array;var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,n){var r=e(`../utils`),i=e(`../support`),a=e(`./ArrayReader`),o=e(`./StringReader`),s=e(`./NodeBufferReader`),c=e(`./Uint8ArrayReader`);t.exports=function(e){var t=r.getTypeOf(e);return r.checkSupport(t),t!==`string`||i.uint8array?t===`nodebuffer`?new s(e):i.uint8array?new c(r.transformTo(`uint8array`,e)):new a(r.transformTo(`array`,e)):new o(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){n.LOCAL_FILE_HEADER=`PK`,n.CENTRAL_FILE_HEADER=`PK`,n.CENTRAL_DIRECTORY_END=`PK`,n.ZIP64_CENTRAL_DIRECTORY_LOCATOR=`PK\x07`,n.ZIP64_CENTRAL_DIRECTORY_END=`PK`,n.DATA_DESCRIPTOR=`PK\x07\b`},{}],24:[function(e,t,n){var r=e(`./GenericWorker`),i=e(`../utils`);function a(e){r.call(this,`ConvertWorker to `+e),this.destType=e}i.inherits(a,r),a.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,n){var r=e(`./GenericWorker`),i=e(`../crc32`);function a(){r.call(this,`Crc32Probe`),this.withStreamInfo(`crc32`,0)}e(`../utils`).inherits(a,r),a.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,n){var r=e(`../utils`),i=e(`./GenericWorker`);function a(e){i.call(this,`DataLengthProbe for `+e),this.propName=e,this.withStreamInfo(e,0)}r.inherits(a,i),a.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,n){var r=e(`../utils`),i=e(`./GenericWorker`);function a(e){i.call(this,`DataWorker`);var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type=``,this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=r.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}r.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case`string`:e=this.data.substring(this.index,t);break;case`uint8array`:e=this.data.subarray(this.index,t);break;case`array`:case`nodebuffer`:e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,n){function r(e){this.name=e||`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}r.prototype={push:function(e){this.emit(`data`,e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit(`end`),this.cleanUp(),this.isFinished=!0}catch(e){this.emit(`error`,e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit(`error`,e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var n=0;n `+e:e}},t.exports=r},{}],29:[function(e,t,n){var r=e(`../utils`),i=e(`./ConvertWorker`),a=e(`./GenericWorker`),o=e(`../base64`),s=e(`../support`),c=e(`../external`),l=null;if(s.nodestream)try{l=e(`../nodejs/NodejsStreamOutputAdapter`)}catch{}function u(e,t){return new c.Promise(function(n,i){var a=[],s=e._internalType,c=e._outputType,l=e._mimeType;e.on(`data`,function(e,n){a.push(e),t&&t(n)}).on(`error`,function(e){a=[],i(e)}).on(`end`,function(){try{n(function(e,t,n){switch(e){case`blob`:return r.newBlob(r.transformTo(`arraybuffer`,t),n);case`base64`:return o.encode(t);default:return r.transformTo(e,t)}}(c,function(e,t){var n,r=0,i=null,a=0;for(n=0;n`u`)n.blob=!1;else{var r=new ArrayBuffer(0);try{n.blob=new Blob([r],{type:`application/zip`}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(r),n.blob=i.getBlob(`application/zip`).size===0}catch{n.blob=!1}}}try{n.nodestream=!!e(`readable-stream`).Readable}catch{n.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,n){for(var r=e(`./utils`),i=e(`./support`),a=e(`./nodejsUtils`),o=e(`./stream/GenericWorker`),s=Array(256),c=0;c<256;c++)s[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;s[254]=s[254]=1;function l(){o.call(this,`utf-8 decode`),this.leftOver=null}function u(){o.call(this,`utf-8 encode`)}n.utf8encode=function(e){return i.nodebuffer?a.newBufferFrom(e,`utf-8`):function(e){var t,n,r,a,o,s=e.length,c=0;for(a=0;a>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t}(e)},n.utf8decode=function(e){return i.nodebuffer?r.transformTo(`nodebuffer`,e).toString(`utf-8`):function(e){var t,n,i,a,o=e.length,c=Array(2*o);for(t=n=0;t>10&1023,c[n++]=56320|1023&i)}return c.length!==n&&(c.subarray?c=c.subarray(0,n):c.length=n),r.applyFromCharCode(c)}(e=r.transformTo(i.uint8array?`uint8array`:`array`,e))},r.inherits(l,o),l.prototype.processChunk=function(e){var t=r.transformTo(i.uint8array?`uint8array`:`array`,e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var a=t;(t=new Uint8Array(a.length+this.leftOver.length)).set(this.leftOver,0),t.set(a,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var o=function(e,t){var n;for((t||=e.length)>e.length&&(t=e.length),n=t-1;0<=n&&(192&e[n])==128;)n--;return n<0||n===0?t:n+s[e[n]]>t?n:t}(t),c=t;o!==t.length&&(i.uint8array?(c=t.subarray(0,o),this.leftOver=t.subarray(o,t.length)):(c=t.slice(0,o),this.leftOver=t.slice(o,t.length))),this.push({data:n.utf8decode(c),meta:e.meta})},l.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=l,r.inherits(u,o),u.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=u},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){var r=e(`./support`),i=e(`./base64`),a=e(`./nodejsUtils`),o=e(`./external`);function s(e){return e}function c(e,t){for(var n=0;n>8;this.dir=!!(16&this.externalFileAttributes),e==0&&(this.dosPermissions=63&this.externalFileAttributes),e==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!==`/`||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=r(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,n,r,i=e.index+this.extraFieldsLength;for(this.extraFields||={};e.index+4>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t},n.buf2binstring=function(e){return c(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n>10&1023,l[r++]=56320|1023&i)}return c(l,r)},n.utf8border=function(e,t){var n;for((t||=e.length)>e.length&&(t=e.length),n=t-1;0<=n&&(192&e[n])==128;)n--;return n<0||n===0?t:n+o[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t,n){t.exports=function(e,t,n,r){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;n!==0;){for(n-=o=2e3>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,i){var a=r,o=i+n;e^=-1;for(var s=i;s>>8^a[255&(e^t[s])];return-1^e}},{}],46:[function(e,t,n){var r,i=e(`../utils/common`),a=e(`./trees`),o=e(`./adler32`),s=e(`./crc32`),c=e(`./messages`),l=0,u=4,d=0,f=-2,p=-1,m=4,h=2,g=8,_=9,v=286,y=30,b=19,x=2*v+1,S=15,C=3,w=258,T=w+C+1,E=42,D=113,O=1,k=2,A=3,j=4;function M(e,t){return e.msg=c[t],t}function ee(e){return(e<<1)-(4e.avail_out&&(n=e.avail_out),n!==0&&(i.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))}function F(e,t){a._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,P(e.strm)}function I(e,t){e.pending_buf[e.pending++]=t}function te(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function ne(e,t){var n,r,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-T?e.strstart-(e.w_size-T):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+w,p=l[a+o-1],m=l[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do if(l[(n=t)+o]===m&&l[n+o-1]===p&&l[n]===l[a]&&l[++n]===l[a+1]){a+=2,n++;do;while(l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&ac&&--i!=0);return o<=e.lookahead?o:e.lookahead}function re(e){var t,n,r,a,c,l,u,d,f,p,m=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=m+(m-T)){for(i.arraySet(e.window,e.window,m,m,0),e.match_start-=m,e.strstart-=m,e.block_start-=m,t=n=e.hash_size;r=e.head[--t],e.head[t]=m<=r?r-m:0,--n;);for(t=n=m;r=e.prev[--t],e.prev[t]=m<=r?r-m:0,--n;);a+=m}if(e.strm.avail_in===0)break;if(l=e.strm,u=e.window,d=e.strstart+e.lookahead,f=a,p=void 0,p=l.avail_in,f=C)for(c=e.strstart-e.insert,e.ins_h=e.window[c],e.ins_h=(e.ins_h<=C&&(e.ins_h=(e.ins_h<=C){if(r=a._tr_tally(e,e.strstart-e.match_start,e.match_length-C),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=C){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=C&&(e.ins_h=(e.ins_h<=C&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-C,r=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-C),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(re(e),e.lookahead===0&&t===l)return O;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,F(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-T&&(F(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(F(e,!0),e.strm.avail_out===0?A:j):(e.strstart>e.block_start&&(F(e,!1),e.strm.avail_out),O)}),new oe(4,4,8,4,ie),new oe(4,5,16,8,ie),new oe(4,6,32,32,ie),new oe(4,4,16,16,ae),new oe(8,16,32,32,ae),new oe(8,16,128,128,ae),new oe(8,32,128,256,ae),new oe(32,128,258,1024,ae),new oe(32,258,258,4096,ae)],n.deflateInit=function(e,t){return ue(e,t,g,15,8,0)},n.deflateInit2=ue,n.deflateReset=le,n.deflateResetKeep=ce,n.deflateSetHeader=function(e,t){return e&&e.state&&e.state.wrap===2?(e.state.gzhead=t,d):f},n.deflate=function(e,t){var n,i,o,c;if(!e||!e.state||5>8&255),I(i,i.gzhead.time>>16&255),I(i,i.gzhead.time>>24&255),I(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),I(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(I(i,255&i.gzhead.extra.length),I(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(I(i,0),I(i,0),I(i,0),I(i,0),I(i,0),I(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),I(i,3),i.status=D);else{var p=g+(i.w_bits-8<<4)<<8;p|=(2<=i.strategy||i.level<2?0:i.level<6?1:i.level===6?2:3)<<6,i.strstart!==0&&(p|=32),p+=31-p%31,i.status=D,te(i,p),i.strstart!==0&&(te(i,e.adler>>>16),te(i,65535&e.adler)),e.adler=1}}if(i.status===69){if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),P(e),o=i.pending,i.pending!==i.pending_buf_size));)I(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73}if(i.status===73){if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),P(e),o=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindexo&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),c===0&&(i.gzindex=0,i.status=91)}else i.status=91}if(i.status===91){if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),P(e),o=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindexo&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),c===0&&(i.status=103)}else i.status=103}if(i.status===103&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&P(e),i.pending+2<=i.pending_buf_size&&(I(i,255&e.adler),I(i,e.adler>>8&255),e.adler=0,i.status=D)):i.status=D),i.pending!==0){if(P(e),e.avail_out===0)return i.last_flush=-1,d}else if(e.avail_in===0&&ee(t)<=ee(n)&&t!==u)return M(e,-5);if(i.status===666&&e.avail_in!==0)return M(e,-5);if(e.avail_in!==0||i.lookahead!==0||t!==l&&i.status!==666){var m=i.strategy===2?function(e,t){for(var n;;){if(e.lookahead===0&&(re(e),e.lookahead===0)){if(t===l)return O;break}if(e.match_length=0,n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(F(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(F(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(F(e,!1),e.strm.avail_out===0)?O:k}(i,t):i.strategy===3?function(e,t){for(var n,r,i,o,s=e.window;;){if(e.lookahead<=w){if(re(e),e.lookahead<=w&&t===l)return O;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=C&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=C?(n=a._tr_tally(e,1,e.match_length-C),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(F(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(F(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(F(e,!1),e.strm.avail_out===0)?O:k}(i,t):r[i.level].func(i,t);if(m!==A&&m!==j||(i.status=666),m===O||m===A)return e.avail_out===0&&(i.last_flush=-1),d;if(m===k&&(t===1?a._tr_align(i):t!==5&&(a._tr_stored_block(i,0,0,!1),t===3&&(N(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),P(e),e.avail_out===0))return i.last_flush=-1,d}return t===u?i.wrap<=0?1:(i.wrap===2?(I(i,255&e.adler),I(i,e.adler>>8&255),I(i,e.adler>>16&255),I(i,e.adler>>24&255),I(i,255&e.total_in),I(i,e.total_in>>8&255),I(i,e.total_in>>16&255),I(i,e.total_in>>24&255)):(te(i,e.adler>>>16),te(i,65535&e.adler)),P(e),0=n.w_size&&(s===0&&(N(n.head),n.strstart=0,n.block_start=0,n.insert=0),p=new i.Buf8(n.w_size),i.arraySet(p,t,m-n.w_size,n.w_size,0),t=p,m=n.w_size),c=e.avail_in,l=e.next_in,u=e.input,e.avail_in=m,e.next_in=0,e.input=t,re(n);n.lookahead>=C;){for(r=n.strstart,a=n.lookahead-(C-1);n.ins_h=(n.ins_h<>>=b=y>>>24,m-=b,(b=y>>>16&255)==0)E[a++]=65535&y;else{if(!(16&b)){if(!(64&b)){y=h[(65535&y)+(p&(1<>>=b,m-=b),m<15&&(p+=T[r++]<>>=b=y>>>24,m-=b,!(16&(b=y>>>16&255))){if(!(64&b)){y=g[(65535&y)+(p&(1<>>=b,m-=b,(b=a-o)>3,p&=(1<<(m-=x<<3))-1,e.next_in=r,e.next_out=a,e.avail_in=r>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function g(){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 r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg=``,t.wrap&&(e.adler=1&t.wrap),t.mode=f,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(p),t.distcode=t.distdyn=new r.Buf32(m),t.sane=1,t.back=-1,u):d}function v(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,_(e)):d}function y(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=o.wsize?(r.arraySet(o.window,t,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i<(a=o.wsize-o.wnext)&&(a=i),r.arraySet(o.window,t,n-i,a,o.wnext),(i-=a)?(r.arraySet(o.window,t,n-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,n.check=a(n.check,re,2,0),x=b=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&b)<<8)+(b>>8))%31){e.msg=`incorrect header check`,n.mode=30;break}if((15&b)!=8){e.msg=`unknown compression method`,n.mode=30;break}if(x-=4,P=8+(15&(b>>>=4)),n.wbits===0)n.wbits=P;else if(P>n.wbits){e.msg=`invalid window size`,n.mode=30;break}n.dmax=1<>8&1),512&n.flags&&(re[0]=255&b,re[1]=b>>>8&255,n.check=a(n.check,re,2,0)),x=b=0,n.mode=3;case 3:for(;x<32;){if(v===0)break e;v--,b+=p[g++]<>>8&255,re[2]=b>>>16&255,re[3]=b>>>24&255,n.check=a(n.check,re,4,0)),x=b=0,n.mode=4;case 4:for(;x<16;){if(v===0)break e;v--,b+=p[g++]<>8),512&n.flags&&(re[0]=255&b,re[1]=b>>>8&255,n.check=a(n.check,re,2,0)),x=b=0,n.mode=5;case 5:if(1024&n.flags){for(;x<16;){if(v===0)break e;v--,b+=p[g++]<>>8&255,n.check=a(n.check,re,2,0)),x=b=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(v<(E=n.length)&&(E=v),E&&(n.head&&(P=n.head.extra_len-n.length,n.head.extra||(n.head.extra=Array(n.head.extra_len)),r.arraySet(n.head.extra,p,g,E,P)),512&n.flags&&(n.check=a(n.check,p,E,g)),v-=E,g+=E,n.length-=E),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(v===0)break e;for(E=0;P=p[g+E++],n.head&&P&&n.length<65536&&(n.head.name+=String.fromCharCode(P)),P&&E>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;x<32;){if(v===0)break e;v--,b+=p[g++]<>>=7&x,x-=7&x,n.mode=27;break}for(;x<3;){if(v===0)break e;v--,b+=p[g++]<>>=1)){case 0:n.mode=14;break;case 1:if(w(n),n.mode=20,t!==6)break;b>>>=2,x-=2;break e;case 2:n.mode=17;break;case 3:e.msg=`invalid block type`,n.mode=30}b>>>=2,x-=2;break;case 14:for(b>>>=7&x,x-=7&x;x<32;){if(v===0)break e;v--,b+=p[g++]<>>16^65535)){e.msg=`invalid stored block lengths`,n.mode=30;break}if(n.length=65535&b,x=b=0,n.mode=15,t===6)break e;case 15:n.mode=16;case 16:if(E=n.length){if(v>>=5,x-=5,n.ndist=1+(31&b),b>>>=5,x-=5,n.ncode=4+(15&b),b>>>=4,x-=4,286>>=3,x-=3}for(;n.have<19;)n.lens[ie[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,I={bits:n.lenbits},F=s(0,n.lens,0,19,n.lencode,0,n.work,I),n.lenbits=I.bits,F){e.msg=`invalid code lengths set`,n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have>>16&255,j=65535&ne,!((k=ne>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=k,x-=k,n.lens[n.have++]=j;else{if(j===16){for(te=k+2;x>>=k,x-=k,n.have===0){e.msg=`invalid bit length repeat`,n.mode=30;break}P=n.lens[n.have-1],E=3+(3&b),b>>>=2,x-=2}else if(j===17){for(te=k+3;x>>=k)),b>>>=3,x-=3}else{for(te=k+7;x>>=k)),b>>>=7,x-=7}if(n.have+E>n.nlen+n.ndist){e.msg=`invalid bit length repeat`,n.mode=30;break}for(;E--;)n.lens[n.have++]=P}}if(n.mode===30)break;if(n.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,n.mode=30;break}if(n.lenbits=9,I={bits:n.lenbits},F=s(c,n.lens,0,n.nlen,n.lencode,0,n.work,I),n.lenbits=I.bits,F){e.msg=`invalid literal/lengths set`,n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,I={bits:n.distbits},F=s(l,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,I),n.distbits=I.bits,F){e.msg=`invalid distances set`,n.mode=30;break}if(n.mode=20,t===6)break e;case 20:n.mode=21;case 21:if(6<=v&&258<=y){e.next_out=_,e.avail_out=y,e.next_in=g,e.avail_in=v,n.hold=b,n.bits=x,o(e,C),_=e.next_out,m=e.output,y=e.avail_out,g=e.next_in,p=e.input,v=e.avail_in,b=n.hold,x=n.bits,n.mode===12&&(n.back=-1);break}for(n.back=0;A=(ne=n.lencode[b&(1<>>16&255,j=65535&ne,!((k=ne>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>M)])>>>16&255,j=65535&ne,!(M+(k=ne>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=M,x-=M,n.back+=M}if(b>>>=k,x-=k,n.back+=k,n.length=j,A===0){n.mode=26;break}if(32&A){n.back=-1,n.mode=12;break}if(64&A){e.msg=`invalid literal/length code`,n.mode=30;break}n.extra=15&A,n.mode=22;case 22:if(n.extra){for(te=n.extra;x>>=n.extra,x-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;A=(ne=n.distcode[b&(1<>>16&255,j=65535&ne,!((k=ne>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>M)])>>>16&255,j=65535&ne,!(M+(k=ne>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=M,x-=M,n.back+=M}if(b>>>=k,x-=k,n.back+=k,64&A){e.msg=`invalid distance code`,n.mode=30;break}n.offset=j,n.extra=15&A,n.mode=24;case 24:if(n.extra){for(te=n.extra;x>>=n.extra,x-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg=`invalid distance too far back`,n.mode=30;break}n.mode=25;case 25:if(y===0)break e;if(E=C-y,n.offset>E){if((E=n.offset-E)>n.whave&&n.sane){e.msg=`invalid distance too far back`,n.mode=30;break}D=E>n.wnext?(E-=n.wnext,n.wsize-E):n.wnext-E,E>n.length&&(E=n.length),O=n.window}else O=m,D=_-n.offset,E=n.length;for(yv?(b=I[te+d[w]],ee[N+d[w]]):(b=96,0),p=1<>k)+(m-=p)]=y<<24|b<<16|x|0,m!==0;);for(p=1<>=1;if(p===0?M=0:(M&=p-1,M+=p),w++,--P[C]==0){if(C===E)break;C=t[n+d[w]]}if(D>>7)]}function I(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function te(e,t,n){e.bi_valid>h-n?(e.bi_buf|=t<>h-e.bi_valid,e.bi_valid+=n-h):(e.bi_buf|=t<>>=1,n<<=1,0<--t;);return n>>>1}function ie(e,t,n){var r,i,a=Array(m+1),o=0;for(r=1;r<=m;r++)a[r]=o=o+n[r-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];s!==0&&(e[2*i]=re(a[s]++,s))}}function ae(e){var t;for(t=0;t>1;1<=n;n--)ce(e,a,n);for(i=c;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ce(e,a,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,a[2*i]=a[2*n]+a[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,a[2*n+1]=a[2*r+1]=i,e.heap[1]=i++,ce(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,a,o,s,c=t.dyn_tree,l=t.max_code,u=t.stat_desc.static_tree,d=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,g=t.stat_desc.max_length,_=0;for(a=0;a<=m;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n>=7;r>>=1)if(1&n&&e.dyn_ltree[2*t]!==0)return i;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return a;for(t=32;t>>3,(s=e.static_len+3+7>>>3)<=o&&(o=s)):o=s=n+5,n+4<=o&&t!==-1?pe(e,t,n,r):e.strategy===4||s===o?(te(e,2+ +!!r,3),le(e,T,E)):(te(e,4+ +!!r,3),function(e,t,n,r){var i;for(te(e,t-257,5),te(e,n-1,5),te(e,r-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,t===0?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(O[n]+l+1)]++,e.dyn_dtree[2*F(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){te(e,2,3),ne(e,_,T),function(e){e.bi_valid===16?(I(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,n){t.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(e,t,n){(function(e){(function(e,t){if(!e.setImmediate){var n,r,i,a,o=1,s={},c=!1,l=e.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,n={}.toString.call(e.process)===`[object process]`?function(e){process.nextTick(function(){f(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage(``,`*`),e.onmessage=n,t}}()?(a=`setImmediate$`+Math.random()+`$`,e.addEventListener?e.addEventListener(`message`,p,!1):e.attachEvent(`onmessage`,p),function(t){e.postMessage(a+t,`*`)}):e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){f(e.data)},function(e){i.port2.postMessage(e)}):l&&`onreadystatechange`in l.createElement(`script`)?(r=l.documentElement,function(e){var t=l.createElement(`script`);t.onreadystatechange=function(){f(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):function(e){setTimeout(f,0,e)},u.setImmediate=function(e){typeof e!=`function`&&(e=Function(``+e));for(var t=Array(arguments.length-1),r=0;r`u`?e===void 0?this:e:self)}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{})},{}]},{},[10])(10)})}))(),1);G();function $A(e){let[t,n]=W.useState(``),[r,i]=W.useState(``);return yt(()=>{e.socket.decrypt(e.systemConfig.native.javascriptPassword).then(e=>i(e))},[e.systemConfig,e.socket]),B(qe,{open:!0,onClose:()=>e.onEntered(null),fullWidth:!0,maxWidth:`sm`,children:[O(ot,{children:V.t(`Please enter a password for expert mode`)}),O(St,{children:O(P,{autoFocus:!0,margin:`dense`,variant:`standard`,label:V.t(`Password`),type:`password`,fullWidth:!0,value:t,onKeyDown:n=>{n.key===`Enter`&&t&&(n.preventDefault(),n.stopPropagation(),r===t?e.onEntered(t):e.onEntered(``))},onChange:e=>n(e.target.value)})}),B(Vt,{children:[O(R,{variant:`contained`,disabled:!t,onClick:()=>{r===t?e.onEntered(t):e.onEntered(``)},startIcon:O(ge,{}),children:V.t(`Ok`)}),O(R,{color:`grey`,variant:`contained`,onClick:()=>e.onEntered(null),startIcon:O(m,{}),children:V.t(`Cancel`)})]})]})}G();var ej={root:{flexGrow:1,display:`flex`,width:`100%`,height:`100%`},menuDiv:{overflow:`hidden`},splitterDivs:e=>({"&>div":{overflow:`hidden`,width:`100%`,height:`100%`},"& .layout-splitter":{background:e.palette.mode===`dark`?`#595858`:`#ccc;`}}),mainDiv:{width:`100%`,height:`100%`,overflow:`hidden`},content:e=>({width:`100%`,height:`100%`,backgroundColor:e.palette.background&&e.palette.background.default,position:`relative`}),splitterDivWithMenu:{width:`calc(100% - 300px)`,height:`100%`},menuDivWithoutMenu:{"&>div:first-child":{display:`none`},"&>.layout-splitter":{display:`none`}},progress:{margin:100},menuOpenCloseButton:e=>({position:`absolute`,left:0,borderRadius:`0 5px 5px 0`,top:6,cursor:`pointer`,zIndex:1,height:25,width:20,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:`16px`,background:e.palette.secondary.main,color:e.palette.primary.main,"&:hover":{color:`white`}}),showLogButton:e=>({position:`absolute`,right:3,borderRadius:`5px 5px 0 0`,bottom:0,cursor:`pointer`,zIndex:10,height:20,width:25,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:`16px`,background:e.palette.secondary.main,color:e.palette.primary.main,"&:hover":{color:`white`}})},tj=class extends We{constructor(e){super(e,{Connection:Ve,translations:{en:VA,de:HA,es:UA,fr:WA,it:GA,nl:KA,pl:qA,pt:JA,ru:YA,uk:XA,"zh-cn":ZA},bottomButtons:!1,socket:{autoSubscribeLog:!0},sentryDSN:window.sentryDSN}),N(this,`hosts`,[]),N(this,`importFile`,null),N(this,`importFileName`,null),N(this,`scripts`,{}),N(this,`confirmCallback`,null),N(this,`changedScripts`,{}),N(this,`javascriptPassword`,``),N(this,`onScriptsChanged`,(e,t)=>{if(!e)return;let n=!1,r={};e.startsWith(`script.js.`)&&(t?JSON.stringify(this.scripts[e])!==JSON.stringify(t)&&(this.scripts[e]=t,n=!0,r.scriptsHash=this.state.scriptsHash+1):this.scripts[e]&&(delete this.scripts[e],n=!0,r.scriptsHash=this.state.scriptsHash+1)),n&&this.setState(r)}),N(this,`onInstanceChanged`,(e,t)=>{if(!e)return;let n=!1,r={};if(e.startsWith(`system.adapter.`)){var i;if(e.startsWith(`system.adapter.${this.adapterName}.`)){let i=parseInt(e.split(`.`).pop()||`0`,10)||0;if((t==null?void 0:t.type)===`instance`){var a;this.state.instances.includes(i)||(r.instances=[...this.state.instances],r.instances.push(i),r.instances.sort(),n=!0,this.socket.subscribeState(`${t._id}.alive`,this.onInstanceAliveChange)),(a=t.common)!=null&&a.host&&this.state.instanceHosts[i]!==t.common.host&&(r.instanceHosts={...this.state.instanceHosts,[i]:t.common.host},n=!0)}else if(!t&&this.state.instances.includes(i)){this.socket.unsubscribeState(`${e}.alive`,this.onInstanceAliveChange),r.instances=[...this.state.instances];let t=r.instances.indexOf(i);r.instances.splice(t,1),r.instanceHosts={...this.state.instanceHosts},delete r.instanceHosts[i],n=!0}}t!=null&&(i=t.common)!=null&&i.blockly&&(this.confirmCallback=e=>e&&window.location.reload(),r.confirm=V.t(`Some blocks were updated. Reload admin?`),n=!0)}n&&this.setState(r)}),N(this,`onHostChanged`,(e,t)=>{if(e&&e.startsWith(`system.host.`)){if((t==null?void 0:t.type)===`host`)this.hosts.includes(e)||(this.hosts.push(e),this.hosts.sort());else if(!t&&this.hosts.includes(e)){let t=this.hosts.indexOf(e);this.hosts.splice(t,1)}}}),N(this,`onInstanceAliveChange`,(e,t)=>{if(e&&(e=e?e.substring(0,e.length-6):``,this.state.runningInstances[e]!==(t?t.val:!1))){let n=JSON.parse(JSON.stringify(this.state.runningInstances));n[e]=t?!!t.val:!1,this.setState({runningInstances:n})}});let t=window.localStorage.getItem(`JS.logSizes`),n=[80,20];if(t)try{n=JSON.parse(t)}catch{}let r=window.localStorage.getItem(`JS.splitSizes`),i=[20,80];if(r)try{i=JSON.parse(r)}catch{}this.state={...this.state,splitSizes:i,logSizes:n},window.alert=e=>{console.error(e),this.showJsError(e.toString())}}onConnectionReady(){window.systemLang=this.socket.systemLang,this.setState({ready:!1,scriptsHash:0,instances:[],instanceHosts:{},updating:!1,resizing:!1,selected:null,logMessage:{},editing:[],menuOpened:window.localStorage.getItem(`App.menuOpened`)!==`false`,menuSelectId:``,newRuleId:``,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 e;let t={},n=await this.subscribeOnInstances();t.instances=n.instances,t.runningInstances=n.runningInstances,t.instanceHosts=n.instanceHosts,this.javascriptPassword=((e=this.socket.systemConfig)==null?void 0:e.native.javascriptPassword)||``,await this.readAdaptersWithBlockly();let r=await this.socket.getHosts();this.hosts=r.map(e=>e._id);let i=await this.readAllScripts();window.localStorage.getItem(`App.expertMode`)!==`true`&&window.localStorage.getItem(`App.expertMode`)!==`false`&&!this.javascriptPassword?Object.keys(i).find(e=>e.startsWith(`script.js.global.`)&&i[e].type===`script`)&&(t.expertMode=!0):this.javascriptPassword&&(t.expertMode=!1),this.scripts=i;let a=this.state.scriptsHash;this.compareScripts(i)&&a++,t.scriptsHash=a,t.ready=!0,this.setState(t),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(){let e=await this.socket.getAdapterInstances(this.adapterName),t=e.map(e=>parseInt(e._id.split(`.`).pop()||`0`)).sort(),n={};t.forEach(e=>n[`system.adapter.${this.adapterName}.${e}`]=!1);let r={};e.forEach(e=>{var t;let n=parseInt(e._id.split(`.`).pop()||`0`,10)||0;e!=null&&(t=e.common)!=null&&t.host&&(r[n]=e.common.host)});for(let e=0;ee[n]=t[n]),e}async readAdaptersWithBlockly(){let e=await this.socket.getObjectViewSystem(`adapter`,`system.adapter.`,`system.adapter.香`);return new Promise(t=>$O.loadCustomBlockly(e,()=>t()))}compareScripts(e){let t=Object.keys(this.scripts),n=Object.keys(e);if(t.length!==n.length||JSON.stringify(t)!==JSON.stringify(n))return this.scripts=e,!0;for(let n=0;n ${t}`),this.setState({updating:!0});try{var i;if(((i=this.scripts[e])==null?void 0:i.type)===`script`){let i=JSON.parse(JSON.stringify(this.scripts[e].common));i.name=n||i.name,r!==void 0&&(i.engine=`system.adapter.javascript.${r}`);let a=t.split(`.`);a.pop();let o=a.join(`.`);this.scripts[o]&&this.scripts[o].type===`script`&&(a.pop(),t=`${a.join(`.`)}.${t.split(`.`).pop()}`),await this.updateScript(e,t,i)}else await this.renameGroup(e,t,n)}catch(e){e.toString().includes(`canceled`)||this.showJsError(e)}this.setState({updating:!1})}async renameGroup(e,t,n,r){if(!r){r=[],r=Object.keys(this.scripts).filter(t=>t.startsWith(`${e}.`));let i=await this.socket.getObject(e);i||={common:{},type:`channel`},i.common.name=n||i.common.name||e.split(`.`).pop()||``,i._id=t;try{await this.socket.delObject(e)}catch{}try{await this.socket.setObject(t,i),await this.renameGroup(e,t,n,r)}catch(i){console.log(i);let a={_id:t,type:`channel`,common:{name:n||e.split(`.`).pop()||``,expert:!0},native:{}};await this.socket.setObject(t,a),await this.renameGroup(e,t,n,r)}}else if(r.length){let i=r.pop();if(i){let a=await this.socket.getObject(i);if(a){try{await this.socket.delObject(i)}catch{}i=t+i.substring(e.length),a._id=i,a.common=a.common||{},a.common.expert=!0,await this.socket.setObject(i,a),await this.renameGroup(e,t,n,r)}}}}async onUpdateScript(e,t){var n;if(((n=this.scripts[e])==null?void 0:n.type)===`script`)try{await this.updateScript(e,e,t)}catch(e){e.toString().includes(`canceled`)||this.showJsError(e)}}onSelect(e){this.scripts[e]&&this.scripts[e].common&&this.scripts[e].type===`script`&&this.setState({selected:e,menuSelectId:e},()=>setTimeout(()=>this.setState({menuSelectId:``}),300))}renderPasswordDialog(){return this.state.showPasswordDialog?O($A,{socket:this.socket,systemConfig:this.socket.systemConfig,onEntered:e=>{e===null?this.setState({showPasswordDialog:!1,expertMode:!1,password:``}):e?this.setState({expertMode:!0,showPasswordDialog:!1,password:e}):this.setState({showPasswordDialog:!1,expertMode:!1,message:V.t(`Wrong password`),password:``})}},`passwordDialog`):null}onExpertModeChange(e){if(this.state.expertMode!==e){if(e&&this.javascriptPassword)this.setState({showPasswordDialog:!0});else{var t;let n=this.state.selected;n&&!e&&(t=this.scripts[n].native)!=null&&t.protected&&(n=this.state.editing.find(e=>{var t;return this.scripts[e]&&!((t=this.scripts[e].native)!=null&&t.protected)})||null),window.localStorage.setItem(`App.expertMode`,e?`true`:`false`),this.setState({expertMode:e,password:``,selected:n})}}}showJsError(e){this.setState({errorText:e?e.toString():``})}showMessage(e){this.setState({message:e?e.toString():``})}onDelete(e){this.socket.delObject(e).catch(e=>this.showJsError(e))}onEdit(e){this.state.selected!==e&&this.setState({selected:e})}onAddNew(e,t,n,r,i,a){let o=RegExp(`^${e}\\.`);if(Object.keys(this.scripts).find(t=>e===t||o.test(e)))return this.showJsError(V.t(`Yet exists!`));n?this.socket.setObject(e,{_id:e,type:`channel`,common:{name:t,expert:!0},native:{}}).then(()=>setTimeout(()=>this.setState({menuSelectId:e},()=>setTimeout(()=>this.setState({menuSelectId:``}),300)),1e3)).catch(e=>this.showJsError(e)):(i===`Blockly`&&!a&&(a=`\n//${btoa(`%3Cxml%20xmlns%3D%22https%3A%2F%2Fdevelopers.google.com%2Fblockly%2Fxml%22%3E%3C%2Fxml%3E`)}`),this.socket.setObject(e,{_id:e,type:`script`,common:{name:t,expert:!0,engineType:i||`Javascript/js`,enabled:!1,engine:`system.adapter.javascript.${r||0}`,source:a||``,debug:!1,verbose:!1},native:{}}).then(()=>setTimeout(()=>{i===`Rules`&&!a&&this.setState({newRuleId:e}),this.onSelect(e)},1e3)).catch(e=>this.showJsError(e)))}async updateScript(e,t,n){let r=await this.socket.getObject(e),i={common:{}};if(n.engine!==void 0&&(i.common.engine=n.engine),n.enabled!==void 0&&(i.common.enabled=n.enabled),n.source!==void 0&&(i.common.source=n.source),n.debug!==void 0&&(i.common.debug=n.debug),n.verbose!==void 0&&(i.common.verbose=n.verbose),i.from=`system.adapter.admin.0`,e===t&&r!=null&&r.common&&n.name===r.common.name){(!n.engineType||n.engineType!==r.common.engineType)&&n.engineType!==void 0&&(i.common.engineType=n.engineType||`Javascript/js`),i.type=`script`,await this.socket.extendObject(e,i);return}if(r!=null&&r.common){r.common.engineType=n.engineType||r.common.engineType||`Javascript/js`,await this.socket.delObject(e),i.common.engine!==void 0&&(r.common.engine=i.common.engine),i.common.enabled!==void 0&&(r.common.enabled=i.common.enabled),i.common.source!==void 0&&(r.common.source=i.common.source),i.common.name!==void 0&&(r.common.name=i.common.name),i.common.debug!==void 0&&(r.common.debug=i.common.debug),i.common.verbose!==void 0&&(r.common.verbose=i.common.verbose),r._rev!==void 0&&delete r._rev,r.common.name=n.name,r.common.expert=!0,r.type=`script`,r._id=t,await this.socket.setObject(t,r);return}r=i,r.common.name=n.name,r.common.expert=!0,r.type=`script`,r._id=t,await this.socket.setObject(t,r)}onEnableDisable(e,t){var n;if(((n=this.scripts[e])==null?void 0:n.type)===`script`){let n=this.scripts[e].common;n.enabled=t,n.expert=!0,this.updateScript(e,e,n).catch(e=>e!==`canceled`&&this.showJsError(e))}}async getLiveHost(){for(let e=0;e{if(typeof e==`string`){let t=document.createElement(`a`);t.href=`../../files/${e}`,document.body.appendChild(t),t.click(),t.remove()}else if(e.error&&this.showJsError(e.error),e.data){let t=document.createElement(`a`);t.href=`data: application/zip;base64,${e.data}`,t.download=`${n}scripts.zip`,document.body.appendChild(t),t.click(),t.remove()}})}else{let e=new QA.default;for(let[t,n]of Object.entries(this.scripts))if(n.type===`script`){let r=n,i=r.common.engineType===`TypeScript/ts`?`ts`:r.common.engineType===`Blockly`?`blockly`:r.common.engineType===`Rules`?`rules`:`js`,a=`/******* (ext=${i}/engine=${r.common.engine}/debug=${r.common.debug}/verbose=${r.common.verbose}/enabled=${r.common.enabled}) *******/\n`;a+=r.common.source||``;let o=`${t.substring(10).replace(/\./g,`/`)}.${i}`;e.file(o,a)}e.generateAsync({type:`blob`}).then(e=>{let t=document.createElement(`a`);t.href=URL.createObjectURL(e),t.download=`${n}scripts_plain.zip`,document.body.appendChild(t),t.click(),t.remove(),URL.revokeObjectURL(t.href)})}}onImport(e,t){this.importFile=e||null,this.importFileName=t||null,e?(this.confirmCallback=this.onImportConfirmed.bind(this),this.setState({importFile:!1,confirm:V.t(`Existing scripts will be overwritten.`)})):this.setState({importFile:!1})}async onImportConfirmed(e){let t=this.importFile,n=this.importFileName;if(this.importFile=null,this.importFileName=null,e&&t){if(n&&/_(plain|text)\.zip$/i.test(n)){t=t.split(`,`)[1];try{let e=await QA.default.loadAsync(t,{base64:!0}),n=[];e.forEach((e,t)=>{t.dir||n.push(t.async(`string`).then(async t=>{let n=t.split(` +`),r=n[0]||``,i=n.slice(1).join(` +`),a=r.match(/\/\*{7}\s*\(ext=(\w+)\/engine=([^/]+)\/debug=(\w+)\/verbose=(\w+)\/enabled=(\w+)\)\s*\*{7}\//),o=`Javascript/js`,s=`system.adapter.javascript.0`,c=!1,l=!1,u=!1;if(a){let e=a[1];s=a[2],c=a[3]===`true`,l=a[4]===`true`,u=a[5]===`true`,e===`ts`?o=`TypeScript/ts`:e===`blockly`?o=`Blockly`:e===`rules`&&(o=`Rules`)}let d=e.replace(/\.\w+$/,``).replace(/\//g,`.`),f=`script.js.${d}`,p=d.split(`.`).pop()||d,m=f.split(`.`);for(let e=3;e{e===`permissionError`?this.showJsError(V.t(e)):!e||e.error?this.showJsError(e?V.t(e.error||``):V.t(`Unknown error`)):this.showMessage(V.t(`Done`))})}}}toggleLogLayout(){window.localStorage.setItem(`App.logHorzLayout`,this.state.logHorzLayout?`false`:`true`),this.setState({logHorzLayout:!this.state.logHorzLayout})}renderEditor(){var e;let t=Object.keys(this.scripts).reduce((e,t)=>e+ +(this.scripts[t].common.engineType===`Rules`),0);return O(Eh,{scriptsHash:this.state.scriptsHash,debugMode:this.state.debugMode,onDebugModeChange:e=>{e?this.setState({debugMode:!0}):this.setState({debugMode:!1,debugInstance:null})},visible:!this.state.resizing,socket:this.socket,adapterName:this.adapterName,onLocate:e=>this.setState({menuSelectId:e}),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:(e,t)=>this.onUpdateScript(e,t),newRuleId:this.state.newRuleId,onNewRuleHandled:()=>this.setState({newRuleId:``}),isAnyRulesExists:t,debugInstance:this.state.debugInstance,onSelectedChange:(e,t)=>{let n={},r=!1;e!==this.state.selected&&(r=!0,n.selected=e),JSON.stringify(t)!==JSON.stringify(this.state.editing)&&(r=!0,n.editing=[...t]),r&&this.setState(n)},onRestart:e=>this.socket.extendObject(e,{common:{enabled:!0}}),selected:this.state.selected&&((e=this.scripts[this.state.selected])==null?void 0:e.type)===`script`?this.state.selected:``,objects:this.scripts,resizing:this.state.resizing,onChangedChanged:e=>this.changedScripts=e},`editor`)}showLogButton(){return O(Se,{title:V.t(`Show logs`),sx:ej.showLogButton,onClick:()=>{window.localStorage.setItem(`App.hideLog`,`false`),this.setState({hideLog:!1,resizing:!0}),setTimeout(()=>this.setState({resizing:!1}),300)},children:O(Oe,{})},`showLog`)}renderErrorDialog(){return this.state.errorText?O(un,{onClose:()=>this.setState({errorText:``}),text:this.state.errorText},`dialogError`):null}renderMain(){let e;return e=this.state.debugMode||this.state.hideLog?B(Mt,{children:[!this.state.debugMode&&this.state.hideLog?this.showLogButton():void 0,this.renderEditor()]}):B(kn,{direction:this.state.logHorzLayout?wn.Horizontal:wn.Vertical,initialSizes:this.state.logSizes,minWidths:[500,100],minHeights:[150,50],onResizeStarted:()=>this.setState({resizing:!0}),onResizeFinished:(e,t)=>{this.setState({logSizes:t,resizing:!1}),window.localStorage.setItem(`JS.logSizes`,JSON.stringify(t))},gutterClassName:this.state.themeType===`dark`?`Dark visGutter`:`Light visGutter`,children:[this.renderEditor(),O(xs,{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`)]}),B(Se,{sx:ej.content,className:`iobVerticalSplitter`,children:[O(Se,{sx:ej.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?O(pe,{}):O(w,{})},`closeMenu`),this.state.message?O(wt,{onClose:()=>this.setState({message:``}),text:this.state.message},`dialogMessage`):null,this.renderErrorDialog(),this.state.importFile?O(Oh,{onClose:(e,t)=>this.onImport(e,t)},`dialogImportFile`):null,this.state.confirm?O(xt,{onClose:e=>{this.state.confirm&&this.setState({confirm:``}),this.confirmCallback&&this.confirmCallback(e),this.confirmCallback=null},text:this.state.confirm},`dialogConfirm`):null,this.renderPasswordDialog(),e]},`main`)}render(){if(!this.state.ready)return O(ye,{injectFirst:!0,children:B(f,{theme:this.state.theme,children:[O(c,{}),O(Ot,{themeType:this.state.themeType})]})});let e;return e=this.state.menuOpened?B(kn,{direction:wn.Horizontal,initialSizes:this.state.splitSizes,minWidths:[270,400],onResizeFinished:(e,t)=>{this.setState({splitSizes:t}),window.localStorage.setItem(`JS.splitSizes`,JSON.stringify(t))},gutterClassName:this.state.themeType===`dark`?`Dark visGutter`:`Light visGutter`,children:[O(`div`,{style:ej.mainDiv,children:O(ps,{password:this.state.password,debugMode:this.state.debugMode,onDebugInstance:e=>this.setState({debugInstance:e,debugMode:!!e}),scripts:this.scripts,scriptsHash:this.state.scriptsHash,instances:this.state.instances,instanceHosts:this.state.instanceHosts,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:e=>{H.setThemeName(e);let t=H.getThemeType(e);this.setState({themeName:e,themeType:t},()=>this.toggleTheme(e))},runningInstances:this.state.runningInstances,onExpertModeChange:e=>this.onExpertModeChange(e),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:e=>this.setState({searchText:e}),version:this.props.version,changedScripts:this.changedScripts},`sidemenu`)},`menu`),this.renderMain()]}):this.renderMain(),O(ye,{injectFirst:!0,children:B(f,{theme:this.state.theme,children:[O(c,{}),O(tt,{theme:this.state.theme}),O(`div`,{style:ej.root,children:O(BA,{socket:this.socket,children:e})})]})})}};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 nj(){`serviceWorker`in navigator&&navigator.serviceWorker.ready.then(e=>{e.unregister()})}var rj={name:`js`,version:`10.1.1`,private:!0,type:`module`,dependencies:{"@blockly/field-colour":`^13.2.0`,"@blockly/field-multilineinput":`^13.2.0`,"@devbookhq/splitter":`^1.4.2`,"@emotion/react":`^11.14.0`,"@emotion/styled":`^11.14.1`,"@iobroker/gui-components":`^10.1.0`,"@iobroker/javascript-rules-dev":`^1.0.2`,"@iobroker/type-detector":`^6.0.0`,"@iobroker/types":`^7.2.2`,"@module-federation/runtime":`^2.9.0`,"@module-federation/vite":`^1.20.8`,"@mui/icons-material":`^9.3.1`,"@mui/material":`^9.3.1`,"@mui/x-date-pickers":`^9.12.0`,"@sentry/browser":`^10.71.0`,"@types/lodash":`^4.17.25`,"@types/react":`^19.2.18`,"@types/react-dom":`^19.2.5`,"@types/reactour":`^1.18.5`,"@vitejs/plugin-react":`^6.1.0`,blockly:`^13.2.1`,jszip:`^3.10.1`,moment:`^2.30.1`,"monaco-editor":`~0.56.0`,openai:`^7.5.0`,react:`^19.2.8`,"react-bem-helper":`^1.4.1`,"react-dnd":`^16.0.1`,"react-dnd-html5-backend":`^16.0.1`,"react-dnd-touch-backend":`^16.0.1`,"react-dom":`^19.2.8`,"react-dropzone":`^20.1.1`,"react-fullscreen":`^0.1.0`,"react-i18next":`^17.0.12`,"react-icons":`^5.7.0`,"react-json-view":`^1.21.3`,"react-monaco-editor":`^0.59.0`,"react-splitter-layout":`^4.0.0`,"react-text-mask":`^5.5.0`,"react-treeview-mui":`^0.1.2`,reactour:`^1.19.4`,sass:`^1.103.1`,"styled-components":`^6.5.3`,suncalc2:`^1.8.1`,typescript:`~6.0.3`,vite:`^8.2.2`,"vite-plugin-commonjs":`^0.10.4`},scripts:{start:`vite`,lint:`eslint -c eslint.config.mjs`,build:`tsc && vite build`,preview:`vite preview --port 3000`,tsc:`tsc -p tsconfig.json`,test:`vitest run`,"test:watch":`vitest`,npm:`npm i -f`},eslintConfig:{extends:`react-app`},browserslist:[`>0.2%`,`not dead`,`not ie <= 11`,`not op_mini all`],devDependencies:{jsdom:`^30.0.1`,vitest:`^4.1.11`}},ij;(function(e){e.mouse=`mouse`,e.touch=`touch`,e.keyboard=`keyboard`})(ij||={});var aj=class{get delay(){return this.args.delay??0}get scrollAngleRanges(){return this.args.scrollAngleRanges}get getDropTargetElementsAtPoint(){return this.args.getDropTargetElementsAtPoint}get ignoreContextMenu(){return this.args.ignoreContextMenu??!1}get enableHoverOutsideTarget(){return this.args.enableHoverOutsideTarget??!1}get enableKeyboardEvents(){return this.args.enableKeyboardEvents??!1}get enableMouseEvents(){return this.args.enableMouseEvents??!1}get enableTouchEvents(){return this.args.enableTouchEvents??!0}get touchSlop(){return this.args.touchSlop||0}get delayTouchStart(){var e,t;return((e=this.args)==null?void 0:e.delayTouchStart)??((t=this.args)==null?void 0:t.delay)??0}get delayMouseStart(){var e,t;return((e=this.args)==null?void 0:e.delayMouseStart)??((t=this.args)==null?void 0:t.delay)??0}get window(){if(this.context&&this.context.window)return this.context.window;if(typeof window<`u`)return window}get document(){var e;if((e=this.context)!=null&&e.document)return this.context.document;if(this.window)return this.window.document}get rootElement(){var e;return((e=this.args)==null?void 0:e.rootElement)||this.document}constructor(e,t){this.args=e,this.context=t}};function oj(e,t,n,r){return Math.sqrt(Math.abs(n-e)**2+Math.abs(r-t)**2)}function sj(e,t,n,r,i){if(!i)return!1;let a=Math.atan2(r-t,n-e)*180/Math.PI+180;for(let e=0;e=t.start)&&(t.end==null||a<=t.end))return!0}return!1}var cj={Left:1,Right:2,Center:4},lj={Left:0,Center:1,Right:2};function uj(e){return e.button===void 0||e.button===lj.Left}function dj(e){return e.buttons===void 0||(e.buttons&cj.Left)===0}function fj(e){return!!e.targetTouches}var pj=1;function mj(e){let t=e.nodeType===pj?e:e.parentElement;if(!t)return;let{top:n,left:r}=t.getBoundingClientRect();return{x:r,y:n}}function hj(e,t){if(e.targetTouches.length===1)return gj(e.targetTouches[0]);if(t&&e.touches.length===1&&e.touches[0].target===t.target)return gj(e.touches[0])}function gj(e,t){return fj(e)?hj(e,t):{x:e.clientX,y:e.clientY}}var _j=(()=>{let e=!1;try{addEventListener(`test`,()=>{},Object.defineProperty({},"passive",{get(){return e=!0,!0}}))}catch{}return e})(),vj={[ij.mouse]:{start:`mousedown`,move:`mousemove`,end:`mouseup`,contextmenu:`contextmenu`},[ij.touch]:{start:`touchstart`,move:`touchmove`,end:`touchend`},[ij.keyboard]:{keydown:`keydown`}},yj=class e{profile(){var e;return{sourceNodes:this.sourceNodes.size,sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,targetNodes:this.targetNodes.size,dragOverTargetIds:((e=this.dragOverTargetIds)==null?void 0:e.length)||0}}get document(){return this.options.document}setup(){let t=this.options.rootElement;t&&(K(!e.isSetUp,`Cannot have two Touch backends at the same time.`),e.isSetUp=!0,this.addEventListener(t,`start`,this.getTopMoveStartHandler()),this.addEventListener(t,`start`,this.handleTopMoveStartCapture,!0),this.addEventListener(t,`move`,this.handleTopMove),this.addEventListener(t,`move`,this.handleTopMoveCapture,!0),this.addEventListener(t,`end`,this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.addEventListener(t,`contextmenu`,this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.addEventListener(t,`keydown`,this.handleCancelOnEscape,!0))}teardown(){let t=this.options.rootElement;t&&(e.isSetUp=!1,this._mouseClientOffset={},this.removeEventListener(t,`start`,this.handleTopMoveStartCapture,!0),this.removeEventListener(t,`start`,this.handleTopMoveStart),this.removeEventListener(t,`move`,this.handleTopMoveCapture,!0),this.removeEventListener(t,`move`,this.handleTopMove),this.removeEventListener(t,`end`,this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.removeEventListener(t,`contextmenu`,this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.removeEventListener(t,`keydown`,this.handleCancelOnEscape,!0),this.uninstallSourceNodeRemovalObserver())}addEventListener(e,t,n,r=!1){let i=_j?{capture:r,passive:!1}:r;this.listenerTypes.forEach(function(r){let a=vj[r][t];a&&e.addEventListener(a,n,i)})}removeEventListener(e,t,n,r=!1){let i=_j?{capture:r,passive:!1}:r;this.listenerTypes.forEach(function(r){let a=vj[r][t];a&&e.removeEventListener(a,n,i)})}connectDragSource(e,t){let n=this.handleMoveStart.bind(this,e);return this.sourceNodes.set(e,t),this.addEventListener(t,`start`,n),()=>{this.sourceNodes.delete(e),this.removeEventListener(t,`start`,n)}}connectDragPreview(e,t,n){return this.sourcePreviewNodeOptions.set(e,n),this.sourcePreviewNodes.set(e,t),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDropTarget(e,t){let n=this.options.rootElement;if(!this.document||!n)return()=>{};let r=r=>{if(!this.document||!n||!this.monitor.isDragging())return;let i;switch(r.type){case vj.mouse.move:i={x:r.clientX,y:r.clientY};break;case vj.touch.move:var a,o;i={x:((a=r.touches[0])==null?void 0:a.clientX)||0,y:((o=r.touches[0])==null?void 0:o.clientY)||0}}let s=i==null?void 0:this.document.elementFromPoint(i.x,i.y),c=s&&t.contains(s);if(s===t||c)return this.handleMove(r,e)};return this.addEventListener(this.document.body,`move`,r),this.targetNodes.set(e,t),()=>{this.document&&(this.targetNodes.delete(e),this.removeEventListener(this.document.body,`move`,r))}}getTopMoveStartHandler(){return!this.options.delayTouchStart&&!this.options.delayMouseStart?this.handleTopMoveStart:this.handleTopMoveStartDelay}installSourceNodeRemovalObserver(e){this.uninstallSourceNodeRemovalObserver(),this.draggedSourceNode=e,this.draggedSourceNodeRemovalObserver=new MutationObserver(()=>{e&&!e.parentElement&&(this.resurrectSourceNode(),this.uninstallSourceNodeRemovalObserver())}),!(!e||!e.parentElement)&&this.draggedSourceNodeRemovalObserver.observe(e.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(e,t,n){this.getSourceClientOffset=e=>{let t=this.sourceNodes.get(e);return t&&mj(t)},this.handleTopMoveStartCapture=e=>{uj(e)&&(this.moveStartSourceIds=[])},this.handleMoveStart=e=>{Array.isArray(this.moveStartSourceIds)&&this.moveStartSourceIds.unshift(e)},this.handleTopMoveStart=e=>{if(!uj(e))return;let t=gj(e);t&&(fj(e)&&(this.lastTargetTouchFallback=e.targetTouches[0]),this._mouseClientOffset=t),this.waitingForDelay=!1},this.handleTopMoveStartDelay=e=>{if(!uj(e))return;let t=e.type===vj.touch.start?this.options.delayTouchStart:this.options.delayMouseStart;this.timeout=setTimeout(this.handleTopMoveStart.bind(this,e),t),this.waitingForDelay=!0},this.handleTopMoveCapture=()=>{this.dragOverTargetIds=[]},this.handleMove=(e,t)=>{this.dragOverTargetIds&&this.dragOverTargetIds.unshift(t)},this.handleTopMove=e=>{if(this.timeout&&clearTimeout(this.timeout),!this.document||this.waitingForDelay)return;let{moveStartSourceIds:t,dragOverTargetIds:n}=this,r=this.options.enableHoverOutsideTarget,i=gj(e,this.lastTargetTouchFallback);if(!i)return;if(this._isScrolling||!this.monitor.isDragging()&&sj(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,i.x,i.y,this.options.scrollAngleRanges)){this._isScrolling=!0;return}if(!this.monitor.isDragging()&&this._mouseClientOffset.hasOwnProperty(`x`)&&t&&oj(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,i.x,i.y)>(this.options.touchSlop?this.options.touchSlop:0)&&(this.moveStartSourceIds=void 0,this.actions.beginDrag(t,{clientOffset:this._mouseClientOffset,getSourceClientOffset:this.getSourceClientOffset,publishSource:!1})),!this.monitor.isDragging())return;let a=this.sourceNodes.get(this.monitor.getSourceId());this.installSourceNodeRemovalObserver(a),this.actions.publishDragSource(),e.cancelable&&e.preventDefault();let o=(n||[]).map(e=>this.targetNodes.get(e)).filter(e=>!!e),s=this.options.getDropTargetElementsAtPoint?this.options.getDropTargetElementsAtPoint(i.x,i.y,o):this.document.elementsFromPoint(i.x,i.y),c=[];for(let e in s){if(!s.hasOwnProperty(e))continue;let t=s[e];for(t!=null&&c.push(t);t;)t=t.parentElement,t&&c.indexOf(t)===-1&&c.push(t)}let l=c.filter(e=>o.indexOf(e)>-1).map(e=>this._getDropTargetId(e)).filter(e=>!!e).filter((e,t,n)=>n.indexOf(e)===t);if(r)for(let e in this.targetNodes){let t=this.targetNodes.get(e);if(a&&t&&t.contains(a)&&l.indexOf(e)===-1){l.unshift(e);break}}l.reverse(),this.actions.hover(l,{clientOffset:i})},this._getDropTargetId=e=>{let t=this.targetNodes.keys(),n=t.next();for(;n.done===!1;){let r=n.value;if(e===this.targetNodes.get(r))return r;n=t.next()}},this.handleTopMoveEndCapture=e=>{if(this._isScrolling=!1,this.lastTargetTouchFallback=void 0,dj(e)){if(!this.monitor.isDragging()||this.monitor.didDrop()){this.moveStartSourceIds=void 0;return}e.cancelable&&e.preventDefault(),this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.drop(),this.actions.endDrag()}},this.handleCancelOnEscape=e=>{e.key===`Escape`&&this.monitor.isDragging()&&(this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.endDrag())},this.options=new aj(n,t),this.actions=e.getActions(),this.monitor=e.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(ij.mouse),this.options.enableTouchEvents&&this.listenerTypes.push(ij.touch),this.options.enableKeyboardEvents&&this.listenerTypes.push(ij.keyboard)}},bj=function(e,t={},n={}){return new yj(e,t,n)};G(),window.GenericBlock=$,window.adapterName=`javascript`,window.sentryDSN=`https://504499a725eb4898930d3b9e9da95740@sentry.iobroker.net/56`,console.log(`iobroker.${window.adapterName}@${rj.version}`);var xj=window.innerWidth<600,Sj=document.getElementById(`root`);Sj&&sn(Sj).render(O(ua,{backend:xj?bj:ko,children:O(tj,{version:rj.version})})),nj();var Cj=window.loadDynamicScript;Cj&&Cj(window.location.port===`3000`?`${window.location.protocol}//${window.location.hostname}:8081/lib/js/socket.io.js`:`./../../lib/js/socket.io.js`,()=>Cj(`vs/loader.js`,()=>Cj(`vs/configure.js`,()=>typeof window.socketLoadedHandler==`function`&&window.socketLoadedHandler())));export{wn as C,kn as S,Ka as _,Ck as a,tr as b,zh as c,$m as d,Jm as f,eo as g,Im as h,$ as i,Bh as l,Wm as m,Xk as n,ak as o,Km as p,Zk as r,KO as s,zA as t,Ym as u,za as v,Un as x,_a as y}; \ No newline at end of file diff --git a/admin/assets/mf-entry-bootstrap-0-3980c9b3.js b/admin/assets/mf-entry-bootstrap-0-3980c9b3.js new file mode 100644 index 00000000..36ffebc5 --- /dev/null +++ b/admin/assets/mf-entry-bootstrap-0-3980c9b3.js @@ -0,0 +1,41 @@ + +const __mfCacheGlobalKey = "__mf_module_cache__"; +globalThis[__mfCacheGlobalKey] ||= { share: {}, remote: {} }; +globalThis[__mfCacheGlobalKey].share ||= {}; +globalThis[__mfCacheGlobalKey].remote ||= {}; +const __mfModuleCache = globalThis[__mfCacheGlobalKey]; +for (const __mfShareKey of Object.keys(__mfModuleCache.share)) { + if (__mfShareKey.startsWith("default:")) { + const __mfLegacyShareKey = __mfShareKey.slice("default:".length); + if (__mfModuleCache.share[__mfLegacyShareKey] === undefined) { + __mfModuleCache.share[__mfLegacyShareKey] = __mfModuleCache.share[__mfShareKey]; + } + } else if (!__mfShareKey.includes(":")) { + const __mfDefaultShareKey = "default:" + __mfShareKey; + if (__mfModuleCache.share[__mfDefaultShareKey] === undefined) { + __mfModuleCache.share[__mfDefaultShareKey] = __mfModuleCache.share[__mfShareKey]; + } + } +} + +const __mfImport = (src) => + globalThis.System && typeof globalThis.System.import === 'function' + ? globalThis.System.import(src) + : import(src); + + + + +(async () => { + const __mfHostInit = await __mfImport("./hostInit-B3IjMQKW.js"); + await __mfHostInit.__tla; + const { initHost } = __mfHostInit; + await initHost(); + if (__mfModuleCache.pendingShareLoads) { + await Promise.all(__mfModuleCache.pendingShareLoads); + } + const __mfReactServerModuleCache = globalThis["__mf_module_cache_react_server__"]; + if (__mfReactServerModuleCache?.pendingShareLoads) { + await Promise.all(__mfReactServerModuleCache.pendingShareLoads); + } +})().then(() => __mfImport("./index-2X_5uU-_.js")); diff --git a/admin/mf-stats.json b/admin/mf-stats.json index 0b816bc9..f410fd93 100644 --- a/admin/mf-stats.json +++ b/admin/mf-stats.json @@ -1 +1 @@ -{"id":"iobroker_javascript","name":"iobroker_javascript","metaData":{"name":"iobroker_javascript","type":"app","buildInfo":{"buildVersion":"1.0.0","buildName":"iobroker_javascript"},"remoteEntry":{"name":"remoteEntry.js","path":"","type":"module"},"ssrRemoteEntry":{"name":"remoteEntry.ssr.js","path":"","type":"module"},"types":{"path":"","name":"","zip":"@mf-types.zip","api":"@mf-types.d.ts"},"globalName":"iobroker_javascript","pluginVersion":"0.2.5","publicPath":"auto"},"shared":[{"id":"iobroker_javascript:react","name":"react","version":"19.2.8","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react-dom","name":"react-dom","version":"19.2.8","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:@mui/material","name":"@mui/material","version":"9.3.1","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:prop-types","name":"prop-types","version":"15.8.1","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:@iobroker/gui-components","name":"@iobroker/gui-components","version":"10.1.0","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react/jsx-runtime","name":"react/jsx-runtime","version":"19.2.8","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react-dom/client","name":"react-dom/client","version":"19.2.8","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-_q6w9ugW.js"]},"css":{"async":[],"sync":[]}}}],"remotes":[],"exposes":[],"buildOutput":[{"fileName":"assets/hostInit-B3IjMQKW.js","type":"chunk","isEntry":false,"size":2534},{"fileName":"assets/index-DlFpMLlN.js","type":"chunk","isEntry":true,"size":1065970},{"fileName":"assets/virtualExposes-DgGB-18P.js","type":"chunk","isEntry":false,"size":126},{"fileName":"remoteEntry.js","type":"chunk","isEntry":false,"size":957},{"fileName":"assets/AiChatPanel-9G6bIR9k.js","type":"chunk","isEntry":false,"size":68507},{"fileName":"assets/AiDatapointProvider-DzFpUKkT.js","type":"chunk","isEntry":false,"size":2429},{"fileName":"assets/AiDiffView-DtbcD6Yx.js","type":"chunk","isEntry":false,"size":1503},{"fileName":"assets/AiInlineProvider-CaHd2G2Q.js","type":"chunk","isEntry":false,"size":2404},{"fileName":"assets/Debugger-CCdzg9pi.js","type":"chunk","isEntry":false,"size":146848},{"fileName":"assets/Error-1oeF0cix.js","type":"chunk","isEntry":false,"size":1018},{"fileName":"assets/Import-BH2X_ziv.js","type":"chunk","isEntry":false,"size":6256},{"fileName":"assets/RulesEditor-B84Rh__9.js","type":"chunk","isEntry":false,"size":26876},{"fileName":"assets/ScriptEditor-COVJ2tCs.js","type":"chunk","isEntry":false,"size":2192},{"fileName":"assets/ScriptEditorVanillaMonaco-0Mwut6ZY.js","type":"chunk","isEntry":false,"size":25070},{"fileName":"assets/_virtual_mf-localSharedImportMap___mfe_internal__iobroker_javascript__mf_owner__1-BK6m6sZx.js","type":"chunk","isEntry":false,"size":4746},{"fileName":"assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js","type":"chunk","isEntry":false,"size":2471487},{"fileName":"assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-_q6w9ugW.js","type":"chunk","isEntry":false,"size":181305},{"fileName":"assets/aiPromptBuilder-CBfkFGhG.js","type":"chunk","isEntry":false,"size":77},{"fileName":"assets/applyCodeEdit-D3nb7erO.js","type":"chunk","isEntry":false,"size":633},{"fileName":"assets/blockly-DBw-ytY1.js","type":"chunk","isEntry":false,"size":632009},{"fileName":"assets/blocks_action-HH802DF8.js","type":"chunk","isEntry":false,"size":10231},{"fileName":"assets/blocks_convert-B1CD0UVU.js","type":"chunk","isEntry":false,"size":8703},{"fileName":"assets/blocks_logic-Cyd7_0kb.js","type":"chunk","isEntry":false,"size":3949},{"fileName":"assets/blocks_number-lMRwWLtK.js","type":"chunk","isEntry":false,"size":700},{"fileName":"assets/blocks_object-DCupwas8.js","type":"chunk","isEntry":false,"size":6451},{"fileName":"assets/blocks_procedures-Cxfr0wu8.js","type":"chunk","isEntry":false,"size":9340},{"fileName":"assets/blocks_sendto-CbTqmkT5.js","type":"chunk","isEntry":false,"size":10968},{"fileName":"assets/blocks_switch-55ZePjfL.js","type":"chunk","isEntry":false,"size":4639},{"fileName":"assets/blocks_system-9p9UhPDv.js","type":"chunk","isEntry":false,"size":22796},{"fileName":"assets/blocks_text-BkD85XTp.js","type":"chunk","isEntry":false,"size":1736},{"fileName":"assets/blocks_time-CD9NP7Te.js","type":"chunk","isEntry":false,"size":12608},{"fileName":"assets/blocks_timeout-D4yZ2uPk.js","type":"chunk","isEntry":false,"size":5345},{"fileName":"assets/blocks_trigger-FHBUZCQ8.js","type":"chunk","isEntry":false,"size":22883},{"fileName":"assets/blocks_words-BhHIf_1o.js","type":"chunk","isEntry":false,"size":137965},{"fileName":"assets/cronHoverProvider-BhX-SvkB.js","type":"chunk","isEntry":false,"size":1950},{"fileName":"assets/dist-CaOsN0XW.js","type":"chunk","isEntry":false,"size":63684},{"fileName":"assets/docs-compact-D7rpMc7r.js","type":"chunk","isEntry":false,"size":13791},{"fileName":"assets/field_cron-BJLkgNzf.js","type":"chunk","isEntry":false,"size":697},{"fileName":"assets/field_oid-CJZIeruf.js","type":"chunk","isEntry":false,"size":9049},{"fileName":"assets/field_script-4IGidWJ7.js","type":"chunk","isEntry":false,"size":1594},{"fileName":"assets/helpers-n7EZ1fEP.js","type":"chunk","isEntry":false,"size":3099},{"fileName":"assets/inlineChatWidget-CBVgT6FZ.js","type":"chunk","isEntry":false,"size":6857},{"fileName":"assets/inlineDiffController-DianrKl1.js","type":"chunk","isEntry":false,"size":7288},{"fileName":"assets/rolldown-runtime-C0FnF6B9.js","type":"chunk","isEntry":false,"size":1291},{"fileName":"assets/stateHoverProvider-CIFNrLee.js","type":"chunk","isEntry":false,"size":144294},{"fileName":"assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__iobroker_javascript__remoteEntry_js-BO-WKj5V.js","type":"chunk","isEntry":false,"size":17801},{"fileName":"assets/virtual_mf-exposes___mfe_internal__iobroker_javascript__remoteEntry_js-ChiJXsfH.js","type":"chunk","isEntry":false,"size":24},{"fileName":"assets/vite-preload-helper-B7qeedMF.js","type":"chunk","isEntry":false,"size":1243},{"fileName":"assets/RulesEditor-BcGsf9n4.css","type":"asset","isEntry":false,"size":14095},{"fileName":"assets/blockly2js-B3Jxf2e-.svg","type":"asset","isEntry":false,"size":8421},{"fileName":"assets/hysteresis-CLhhemcG.png","type":"asset","isEntry":false,"size":12163},{"fileName":"assets/index-Z8Hkv58g.css","type":"asset","isEntry":false,"size":7849},{"fileName":"assets/rules2js-DnYyR8mI.svg","type":"asset","isEntry":false,"size":6950},{"fileName":"assets/tileBlockly-BMpdinN3.png","type":"asset","isEntry":false,"size":12893},{"fileName":"assets/tileJS-C48gYbHw.png","type":"asset","isEntry":false,"size":17266},{"fileName":"assets/tileRules-BkbaFIhs.png","type":"asset","isEntry":false,"size":83463},{"fileName":"assets/tileTS-CsXmgy4B.png","type":"asset","isEntry":false,"size":13415},{"fileName":"index.html","type":"asset","isEntry":false,"size":21986},{"fileName":"assets/mf-entry-bootstrap-0-515477cc.js","type":"asset","isEntry":false,"size":1566}],"assetAnalysis":{"react":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"],"async":[]},"css":{"sync":[],"async":[]}},"react-dom":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"],"async":[]},"css":{"sync":[],"async":[]}},"react/jsx-runtime":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"],"async":[]},"css":{"sync":[],"async":[]}},"prop-types":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"],"async":[]},"css":{"sync":[],"async":[]}},"@mui/material":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"],"async":[]},"css":{"sync":[],"async":[]}},"@iobroker/gui-components":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"],"async":[]},"css":{"sync":[],"async":[]}},"react-dom/client":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-_q6w9ugW.js"],"async":[]},"css":{"sync":[],"async":[]}}}} \ No newline at end of file +{"id":"iobroker_javascript","name":"iobroker_javascript","metaData":{"name":"iobroker_javascript","type":"app","buildInfo":{"buildVersion":"1.0.0","buildName":"iobroker_javascript"},"remoteEntry":{"name":"remoteEntry.js","path":"","type":"module"},"ssrRemoteEntry":{"name":"remoteEntry.ssr.js","path":"","type":"module"},"types":{"path":"","name":"","zip":"@mf-types.zip","api":"@mf-types.d.ts"},"globalName":"iobroker_javascript","pluginVersion":"0.2.5","publicPath":"auto"},"shared":[{"id":"iobroker_javascript:react","name":"react","version":"19.2.8","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react-dom","name":"react-dom","version":"19.2.8","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:@mui/material","name":"@mui/material","version":"9.3.1","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:prop-types","name":"prop-types","version":"15.8.1","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:@iobroker/gui-components","name":"@iobroker/gui-components","version":"10.1.0","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react/jsx-runtime","name":"react/jsx-runtime","version":"19.2.8","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react-dom/client","name":"react-dom/client","version":"19.2.8","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-_q6w9ugW.js"]},"css":{"async":[],"sync":[]}}}],"remotes":[],"exposes":[],"buildOutput":[{"fileName":"assets/hostInit-B3IjMQKW.js","type":"chunk","isEntry":false,"size":2534},{"fileName":"assets/index-DlFpMLlN.js","type":"chunk","isEntry":true,"size":1065970},{"fileName":"assets/virtualExposes-DgGB-18P.js","type":"chunk","isEntry":false,"size":126},{"fileName":"remoteEntry.js","type":"chunk","isEntry":false,"size":957},{"fileName":"assets/AiChatPanel-9G6bIR9k.js","type":"chunk","isEntry":false,"size":68507},{"fileName":"assets/AiDatapointProvider-DzFpUKkT.js","type":"chunk","isEntry":false,"size":2429},{"fileName":"assets/AiDiffView-DtbcD6Yx.js","type":"chunk","isEntry":false,"size":1503},{"fileName":"assets/AiInlineProvider-CaHd2G2Q.js","type":"chunk","isEntry":false,"size":2404},{"fileName":"assets/Debugger-CCdzg9pi.js","type":"chunk","isEntry":false,"size":146848},{"fileName":"assets/Error-1oeF0cix.js","type":"chunk","isEntry":false,"size":1018},{"fileName":"assets/Import-BH2X_ziv.js","type":"chunk","isEntry":false,"size":6256},{"fileName":"assets/RulesEditor-B84Rh__9.js","type":"chunk","isEntry":false,"size":26876},{"fileName":"assets/ScriptEditor-COVJ2tCs.js","type":"chunk","isEntry":false,"size":2192},{"fileName":"assets/ScriptEditorVanillaMonaco-0Mwut6ZY.js","type":"chunk","isEntry":false,"size":25070},{"fileName":"assets/_virtual_mf-localSharedImportMap___mfe_internal__iobroker_javascript__mf_owner__1-BK6m6sZx.js","type":"chunk","isEntry":false,"size":4746},{"fileName":"assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js","type":"chunk","isEntry":false,"size":2471487},{"fileName":"assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-_q6w9ugW.js","type":"chunk","isEntry":false,"size":181305},{"fileName":"assets/aiPromptBuilder-CBfkFGhG.js","type":"chunk","isEntry":false,"size":77},{"fileName":"assets/applyCodeEdit-D3nb7erO.js","type":"chunk","isEntry":false,"size":633},{"fileName":"assets/blockly-DBw-ytY1.js","type":"chunk","isEntry":false,"size":632009},{"fileName":"assets/blocks_action-HH802DF8.js","type":"chunk","isEntry":false,"size":10231},{"fileName":"assets/blocks_convert-B1CD0UVU.js","type":"chunk","isEntry":false,"size":8703},{"fileName":"assets/blocks_logic-Cyd7_0kb.js","type":"chunk","isEntry":false,"size":3949},{"fileName":"assets/blocks_number-lMRwWLtK.js","type":"chunk","isEntry":false,"size":700},{"fileName":"assets/blocks_object-DCupwas8.js","type":"chunk","isEntry":false,"size":6451},{"fileName":"assets/blocks_procedures-Cxfr0wu8.js","type":"chunk","isEntry":false,"size":9340},{"fileName":"assets/blocks_sendto-CbTqmkT5.js","type":"chunk","isEntry":false,"size":10968},{"fileName":"assets/blocks_switch-55ZePjfL.js","type":"chunk","isEntry":false,"size":4639},{"fileName":"assets/blocks_system-9p9UhPDv.js","type":"chunk","isEntry":false,"size":22796},{"fileName":"assets/blocks_text-BkD85XTp.js","type":"chunk","isEntry":false,"size":1736},{"fileName":"assets/blocks_time-CD9NP7Te.js","type":"chunk","isEntry":false,"size":12608},{"fileName":"assets/blocks_timeout-D4yZ2uPk.js","type":"chunk","isEntry":false,"size":5345},{"fileName":"assets/blocks_trigger-FHBUZCQ8.js","type":"chunk","isEntry":false,"size":22883},{"fileName":"assets/blocks_words-BhHIf_1o.js","type":"chunk","isEntry":false,"size":137965},{"fileName":"assets/cronHoverProvider-BhX-SvkB.js","type":"chunk","isEntry":false,"size":1950},{"fileName":"assets/dist-CaOsN0XW.js","type":"chunk","isEntry":false,"size":63684},{"fileName":"assets/docs-compact-D7rpMc7r.js","type":"chunk","isEntry":false,"size":13791},{"fileName":"assets/field_cron-BJLkgNzf.js","type":"chunk","isEntry":false,"size":697},{"fileName":"assets/field_oid-CJZIeruf.js","type":"chunk","isEntry":false,"size":9049},{"fileName":"assets/field_script-4IGidWJ7.js","type":"chunk","isEntry":false,"size":1594},{"fileName":"assets/helpers-n7EZ1fEP.js","type":"chunk","isEntry":false,"size":3099},{"fileName":"assets/inlineChatWidget-CBVgT6FZ.js","type":"chunk","isEntry":false,"size":6857},{"fileName":"assets/inlineDiffController-DianrKl1.js","type":"chunk","isEntry":false,"size":7288},{"fileName":"assets/rolldown-runtime-C0FnF6B9.js","type":"chunk","isEntry":false,"size":1291},{"fileName":"assets/stateHoverProvider-CIFNrLee.js","type":"chunk","isEntry":false,"size":144294},{"fileName":"assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__iobroker_javascript__remoteEntry_js-BO-WKj5V.js","type":"chunk","isEntry":false,"size":17801},{"fileName":"assets/virtual_mf-exposes___mfe_internal__iobroker_javascript__remoteEntry_js-ChiJXsfH.js","type":"chunk","isEntry":false,"size":24},{"fileName":"assets/vite-preload-helper-B7qeedMF.js","type":"chunk","isEntry":false,"size":1243},{"fileName":"assets/RulesEditor-BcGsf9n4.css","type":"asset","isEntry":false,"size":14095},{"fileName":"assets/blockly2js-B3Jxf2e-.svg","type":"asset","isEntry":false,"size":8421},{"fileName":"assets/hysteresis-CLhhemcG.png","type":"asset","isEntry":false,"size":12163},{"fileName":"assets/index-Z8Hkv58g.css","type":"asset","isEntry":false,"size":7849},{"fileName":"assets/rules2js-DnYyR8mI.svg","type":"asset","isEntry":false,"size":6950},{"fileName":"assets/tileBlockly-BMpdinN3.png","type":"asset","isEntry":false,"size":12893},{"fileName":"assets/tileJS-C48gYbHw.png","type":"asset","isEntry":false,"size":17266},{"fileName":"assets/tileRules-BkbaFIhs.png","type":"asset","isEntry":false,"size":83463},{"fileName":"assets/tileTS-CsXmgy4B.png","type":"asset","isEntry":false,"size":13415},{"fileName":"index.html","type":"asset","isEntry":false,"size":21986},{"fileName":"assets/mf-entry-bootstrap-0-515477cc.js","type":"asset","isEntry":false,"size":1566}],"assetAnalysis":{"react":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"],"async":[]},"css":{"sync":[],"async":[]}},"react-dom":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"],"async":[]},"css":{"sync":[],"async":[]}},"react/jsx-runtime":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"],"async":[]},"css":{"sync":[],"async":[]}},"prop-types":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"],"async":[]},"css":{"sync":[],"async":[]}},"@mui/material":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"],"async":[]},"css":{"sync":[],"async":[]}},"@iobroker/gui-components":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"],"async":[]},"css":{"sync":[],"async":[]}},"react-dom/client":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-_q6w9ugW.js"],"async":[]},"css":{"sync":[],"async":[]}}}} diff --git a/src-editor/src/Components/BlocklyEditor.tsx b/src-editor/src/Components/BlocklyEditor.tsx index 3fee16e1..70224d57 100644 --- a/src-editor/src/Components/BlocklyEditor.tsx +++ b/src-editor/src/Components/BlocklyEditor.tsx @@ -78,6 +78,9 @@ class BlocklyEditor extends React.Component | null = null; + + /** Message of the last change-handler error, so a broken script warns once and not on every further change */ + private lastChangeError = ''; private someSelectedTime: number = 0; private ignoreChanges: boolean = false; private blinkBlock: any; @@ -647,22 +650,32 @@ class BlocklyEditor extends React.Component { diff --git a/src-editor/src/i18n/de.json b/src-editor/src/i18n/de.json index 247956ee..744ba899 100644 --- a/src-editor/src/i18n/de.json +++ b/src-editor/src/i18n/de.json @@ -558,5 +558,8 @@ "Set state if changed": "Zustand nur bei Änderung setzen", "Writes a state only if its value differs from the current one": "Schreibt einen Zustand nur, wenn sich sein Wert vom aktuellen unterscheidet", "Use this instead of \"Set state action\" for rules that run often: an unchanged value is not written at all, so nothing subscribed to that state is woken up for nothing.": "Für häufig laufende Regeln statt \"Zustand setzen\" verwenden: ein unveränderter Wert wird gar nicht geschrieben, also wird auch nichts, was diesen Zustand abonniert hat, umsonst geweckt.", - "only if changed": "nur bei Änderung" + "only if changed": "nur bei Änderung", + "A block failed while generating the script, so the changes cannot be saved": "Ein Block hat beim Erzeugen des Skripts einen Fehler verursacht, die Änderungen können nicht gespeichert werden", + "Blockly error": "Blockly-Fehler", + "Export error": "Exportfehler" } diff --git a/src-editor/src/i18n/en.json b/src-editor/src/i18n/en.json index 7ddbac7b..82925118 100644 --- a/src-editor/src/i18n/en.json +++ b/src-editor/src/i18n/en.json @@ -558,5 +558,8 @@ "Set state if changed": "Set state if changed", "Writes a state only if its value differs from the current one": "Writes a state only if its value differs from the current one", "Use this instead of \"Set state action\" for rules that run often: an unchanged value is not written at all, so nothing subscribed to that state is woken up for nothing.": "Use this instead of \"Set state action\" for rules that run often: an unchanged value is not written at all, so nothing subscribed to that state is woken up for nothing.", - "only if changed": "only if changed" + "only if changed": "only if changed", + "A block failed while generating the script, so the changes cannot be saved": "A block failed while generating the script, so the changes cannot be saved", + "Blockly error": "Blockly error", + "Export error": "Export error" } diff --git a/src-editor/src/i18n/es.json b/src-editor/src/i18n/es.json index ac7625b7..b6d881e1 100644 --- a/src-editor/src/i18n/es.json +++ b/src-editor/src/i18n/es.json @@ -550,5 +550,8 @@ "Set state if changed": "Establecer estado solo si cambia", "Writes a state only if its value differs from the current one": "Escribe un estado solo si su valor difiere del actual", "Use this instead of \"Set state action\" for rules that run often: an unchanged value is not written at all, so nothing subscribed to that state is woken up for nothing.": "Use esto en lugar de \"Set state action\" para reglas que se ejecutan a menudo: un valor sin cambios no se escribe en absoluto, así que nada suscrito a ese estado se despierta en vano.", - "only if changed": "solo si cambia" + "only if changed": "solo si cambia", + "A block failed while generating the script, so the changes cannot be saved": "Un bloque falló al generar el script, los cambios no se pueden guardar", + "Blockly error": "Error de Blockly", + "Export error": "Error de exportación" } diff --git a/src-editor/src/i18n/fr.json b/src-editor/src/i18n/fr.json index 46c69e4a..251290f5 100644 --- a/src-editor/src/i18n/fr.json +++ b/src-editor/src/i18n/fr.json @@ -550,5 +550,8 @@ "Set state if changed": "Définir l'état seulement s'il change", "Writes a state only if its value differs from the current one": "N'écrit un état que si sa valeur diffère de l'actuelle", "Use this instead of \"Set state action\" for rules that run often: an unchanged value is not written at all, so nothing subscribed to that state is woken up for nothing.": "À utiliser à la place de \"Set state action\" pour les règles qui s'exécutent souvent : une valeur inchangée n'est pas écrite du tout, donc rien de ce qui est abonné à cet état n'est réveillé pour rien.", - "only if changed": "seulement si changé" + "only if changed": "seulement si changé", + "A block failed while generating the script, so the changes cannot be saved": "Un bloc a échoué lors de la génération du script, les modifications ne peuvent pas être enregistrées", + "Blockly error": "Erreur Blockly", + "Export error": "Erreur d'exportation" } diff --git a/src-editor/src/i18n/it.json b/src-editor/src/i18n/it.json index ebc60b61..0977a959 100644 --- a/src-editor/src/i18n/it.json +++ b/src-editor/src/i18n/it.json @@ -550,5 +550,8 @@ "Set state if changed": "Imposta lo stato solo se cambia", "Writes a state only if its value differs from the current one": "Scrive uno stato solo se il suo valore differisce da quello attuale", "Use this instead of \"Set state action\" for rules that run often: an unchanged value is not written at all, so nothing subscribed to that state is woken up for nothing.": "Usalo al posto di \"Set state action\" per regole che girano spesso: un valore invariato non viene scritto affatto, quindi nulla di iscritto a quello stato viene svegliato inutilmente.", - "only if changed": "solo se cambiato" + "only if changed": "solo se cambiato", + "A block failed while generating the script, so the changes cannot be saved": "Un blocco ha causato un errore durante la generazione dello script, le modifiche non possono essere salvate", + "Blockly error": "Errore Blockly", + "Export error": "Errore di esportazione" } diff --git a/src-editor/src/i18n/nl.json b/src-editor/src/i18n/nl.json index 0584b5ec..893801e1 100644 --- a/src-editor/src/i18n/nl.json +++ b/src-editor/src/i18n/nl.json @@ -550,5 +550,8 @@ "Set state if changed": "Status alleen bij wijziging zetten", "Writes a state only if its value differs from the current one": "Schrijft een status alleen als de waarde afwijkt van de huidige", "Use this instead of \"Set state action\" for rules that run often: an unchanged value is not written at all, so nothing subscribed to that state is woken up for nothing.": "Gebruik dit in plaats van \"Set state action\" voor regels die vaak lopen: een ongewijzigde waarde wordt helemaal niet geschreven, dus niets dat op die status geabonneerd is wordt voor niets gewekt.", - "only if changed": "alleen bij wijziging" + "only if changed": "alleen bij wijziging", + "A block failed while generating the script, so the changes cannot be saved": "Een blok veroorzaakte een fout bij het genereren van het script, de wijzigingen kunnen niet worden opgeslagen", + "Blockly error": "Blockly-fout", + "Export error": "Exportfout" } diff --git a/src-editor/src/i18n/pl.json b/src-editor/src/i18n/pl.json index 111affd9..b493a2b5 100644 --- a/src-editor/src/i18n/pl.json +++ b/src-editor/src/i18n/pl.json @@ -550,5 +550,8 @@ "Set state if changed": "Ustaw stan tylko przy zmianie", "Writes a state only if its value differs from the current one": "Zapisuje stan tylko wtedy, gdy jego wartość różni się od bieżącej", "Use this instead of \"Set state action\" for rules that run often: an unchanged value is not written at all, so nothing subscribed to that state is woken up for nothing.": "Używaj zamiast \"Set state action\" w regułach uruchamianych często: niezmieniona wartość w ogóle nie jest zapisywana, więc nic zasubskrybowanego do tego stanu nie jest budzone na darmo.", - "only if changed": "tylko przy zmianie" + "only if changed": "tylko przy zmianie", + "A block failed while generating the script, so the changes cannot be saved": "Jeden z bloków spowodował błąd podczas generowania skryptu, zmiany nie mogą zostać zapisane", + "Blockly error": "Błąd Blockly", + "Export error": "Błąd eksportu" } diff --git a/src-editor/src/i18n/pt.json b/src-editor/src/i18n/pt.json index 3261fad5..8fb5117b 100644 --- a/src-editor/src/i18n/pt.json +++ b/src-editor/src/i18n/pt.json @@ -550,5 +550,8 @@ "Set state if changed": "Definir estado apenas se mudar", "Writes a state only if its value differs from the current one": "Grava um estado apenas se o valor for diferente do atual", "Use this instead of \"Set state action\" for rules that run often: an unchanged value is not written at all, so nothing subscribed to that state is woken up for nothing.": "Use isto em vez de \"Set state action\" para regras que rodam com frequência: um valor inalterado não é gravado, então nada inscrito nesse estado é acordado à toa.", - "only if changed": "apenas se mudar" + "only if changed": "apenas se mudar", + "A block failed while generating the script, so the changes cannot be saved": "Um bloco falhou ao gerar o script, as alterações não podem ser salvas", + "Blockly error": "Erro do Blockly", + "Export error": "Erro de exportação" } diff --git a/src-editor/src/i18n/ru.json b/src-editor/src/i18n/ru.json index 816626ed..eb7a9aa3 100644 --- a/src-editor/src/i18n/ru.json +++ b/src-editor/src/i18n/ru.json @@ -550,5 +550,8 @@ "Set state if changed": "Задать состояние только при изменении", "Writes a state only if its value differs from the current one": "Записывает состояние, только если его значение отличается от текущего", "Use this instead of \"Set state action\" for rules that run often: an unchanged value is not written at all, so nothing subscribed to that state is woken up for nothing.": "Используйте вместо \"Set state action\" в правилах, которые выполняются часто: неизменённое значение вообще не записывается, поэтому ничто, подписанное на это состояние, не будится зря.", - "only if changed": "только при изменении" + "only if changed": "только при изменении", + "A block failed while generating the script, so the changes cannot be saved": "Один из блоков вызвал ошибку при генерации скрипта, изменения не могут быть сохранены", + "Blockly error": "Ошибка Blockly", + "Export error": "Ошибка экспорта" } diff --git a/src-editor/src/i18n/uk.json b/src-editor/src/i18n/uk.json index 26b3220e..5053feac 100644 --- a/src-editor/src/i18n/uk.json +++ b/src-editor/src/i18n/uk.json @@ -550,5 +550,8 @@ "Set state if changed": "Задати стан лише при зміні", "Writes a state only if its value differs from the current one": "Записує стан, лише якщо його значення відрізняється від поточного", "Use this instead of \"Set state action\" for rules that run often: an unchanged value is not written at all, so nothing subscribed to that state is woken up for nothing.": "Використовуйте замість \"Set state action\" у правилах, що виконуються часто: незмінене значення взагалі не записується, тож ніщо, підписане на цей стан, не будиться даремно.", - "only if changed": "лише при зміні" + "only if changed": "лише при зміні", + "A block failed while generating the script, so the changes cannot be saved": "Один із блоків спричинив помилку під час генерації скрипту, зміни не можуть бути збережені", + "Blockly error": "Помилка Blockly", + "Export error": "Помилка експорту" } diff --git a/src-editor/src/i18n/zh-cn.json b/src-editor/src/i18n/zh-cn.json index 3ea771d9..5d8987fe 100644 --- a/src-editor/src/i18n/zh-cn.json +++ b/src-editor/src/i18n/zh-cn.json @@ -550,5 +550,8 @@ "Set state if changed": "仅在变化时设置状态", "Writes a state only if its value differs from the current one": "仅当值与当前值不同时才写入状态", "Use this instead of \"Set state action\" for rules that run often: an unchanged value is not written at all, so nothing subscribed to that state is woken up for nothing.": "对于频繁运行的规则,请用它代替 \"Set state action\":值未变化时根本不会写入,订阅该状态的一切也就不会被白白唤醒。", - "only if changed": "仅在变化时" + "only if changed": "仅在变化时", + "A block failed while generating the script, so the changes cannot be saved": "生成脚本时某个积木块出错,更改无法保存", + "Blockly error": "Blockly 错误", + "Export error": "导出错误" }