onChange(e.currentTarget.value)}\n value={value}\n className={Utils.clsx(cls.root, className)}\n fullWidth\n style={style}\n InputLabelProps={{\n shrink: true,\n }}\n inputProps={{\n step: 300, // 5 min\n }}\n />;\n}\n\nCustomTime.defaultProps = {\n value: '',\n className: null,\n table: false\n};\n\nCustomTime.propTypes = {\n title: PropTypes.string,\n attr: PropTypes.string,\n style: PropTypes.object,\n onChange: PropTypes.func\n};\n\nexport default CustomTime;","// extracted by mini-css-extract-plugin\nexport default {\"root\":\"style_root__FwemI\"};","import React from 'react';\nimport { FormControl, MenuItem, Select } from '@mui/material';\nimport PropTypes from 'prop-types';\n\nimport { I18n, Utils } from '@iobroker/adapter-react-v5';\n\nimport cls from './style.module.scss';\n\nconst DAYS = [\n 31, // 1\n 29, // 2\n 31, // 3\n 30, // 4\n 31, // 5\n 30, // 6\n 31, // 7\n 31, // 8\n 30, // 9\n 31, // 10\n 30, // 11\n 31 // 12\n];\n\nconst CustomDate = ({ value, onChange, className, title, style }) => {\n let [month, date] = (value || '01.01').toString().split('.');\n date = parseInt(date, 10) || 0;\n month = parseInt(month, 10) || 0;\n if (month > 12) {\n month = 12;\n } else if (month < 0) {\n month = 0;\n }\n\n if (date > DAYS[month]) {\n date = DAYS[month];\n } else if (date < 0) {\n date = 0;\n }\n\n let days = [];\n for (let i = 0; i < DAYS[month]; i++) {\n days.push(i + 1);\n }\n\n return \n \n \n \n \n \n \n
;\n}\n\nCustomDate.defaultProps = {\n value: '',\n className: null,\n};\n\nCustomDate.propTypes = {\n title: PropTypes.string,\n attr: PropTypes.string,\n style: PropTypes.object,\n onChange: PropTypes.func\n};\n\nexport default CustomDate;","import { I18n } from '@iobroker/adapter-react-v5';\n\nlet lang;\nconst getName = obj => {\n lang = lang || I18n.getLanguage();\n if (typeof obj === 'object') {\n return obj[lang] || obj.en;\n } else {\n return obj;\n }\n};\n\nconst utils = {\n getName\n};\n\nexport default utils;","const STEPS = {\n selectTriggers: 0,\n addScheduleByDoubleClick: 1,\n openTagsMenu: 2,\n selectIntervalTag: 3,\n selectActions: 4,\n addActionPrintText: 5,\n showJavascript: 6,\n switchBackToRules: 7,\n saveTheScript: 8,\n};\n\nconst steps = [\n { // 0\n selector: '.blocks-triggers',\n content: 'Select triggers',\n },\n { // 1\n selector: '.block-TriggerScheduleBlock',\n content: 'Double click to add the block',\n },\n { // 2\n selector: '.tag-card',\n content: 'Open drop down menu',\n },\n { // 3\n selector: '.tag-card-interval',\n content: 'Select interval',\n },\n { // 4\n selector: '.blocks-actions',\n content: 'Select action blocks',\n },\n { // 5\n selector: '.block-ActionPrintText',\n content: 'Double click to add the block',\n },\n { // 6\n selector: '.button-js-code',\n content: 'Check the script',\n },\n { // 7\n selector: '.button-js-code',\n content: 'Switch back to rules',\n },\n { // 8\n selector: '.button-save',\n content: 'Save the script',\n }\n];\n\nexport {STEPS};\n\nexport default steps;","import React, { PureComponent, Fragment } from 'react';\nimport cls from './style.module.scss';\n\nimport { Menu, MenuItem } from '@mui/material';\nimport IconButton from '@mui/material/IconButton';\nimport IconHelp from '@mui/icons-material/HelpOutline';\n\nimport DialogSelectID from '@iobroker/adapter-react-v5/Dialogs/SelectID';\nimport DialogError from '@iobroker/adapter-react-v5/Dialogs/Error';\nimport DialogMessage from '@iobroker/adapter-react-v5/Dialogs/Message';\nimport { getSelectIdIcon } from '@iobroker/adapter-react-v5/Components/Icon';\nimport { I18n, Utils } from '@iobroker/adapter-react-v5';\n\n\nimport CustomButton from '../CustomButton';\nimport CustomCheckbox from '../CustomCheckbox';\nimport CustomInput from '../CustomInput';\nimport CustomInstance from '../CustomInstance';\nimport CustomModal from '../CustomModal';\nimport CustomSelect from '../CustomSelect';\nimport CustomSlider from '../CustomSlider';\nimport CustomSwitch from '../CustomSwitch';\nimport CustomTime from '../CustomTime';\nimport CustomDate from '../CustomDate';\n\nimport MaterialDynamicIcon from '../../helpers/MaterialDynamicIcon';\nimport utils from '../../helpers/utils';\nimport { STEPS } from '../../helpers/Tour';\n\nclass GenericBlock extends PureComponent {\n constructor(props, item) {\n super(props);\n item = item || {};\n let settings = props.settings || {\n tagCard: item.tagCardArray ? typeof item.tagCardArray[0] !== 'string' ? item.tagCardArray[0].title : item.tagCardArray[0] : '',\n };\n\n if (!settings.tagCard && item.tagCardArray) {\n settings.tagCard = typeof item.tagCardArray[0] !== 'string' ? item.tagCardArray[0].title : item.tagCardArray[0];\n }\n\n this.state = {\n inputs: item.inputs || props.inputs || [],\n name: item.name || props.name || '',\n icon: item.icon || props.icon || '',\n adapter: item.adapter || props.adapter || '',\n helpDialog: item.helpDialog || props.helpDialog || '',\n\n tagCardArray: item.tagCardArray || [],\n\n openTagMenu: false,\n openModal: false,\n iconTag: false,\n error: '',\n helpText: '',\n\n oid: {},\n instanceSelectionOptions: [],\n instanceSelectionDef: '',\n\n hideAttributes: [], // e.g. instance\n\n settings,\n debugMessage: null,\n enableSimulation: this.props.enableSimulation,\n };\n\n this.debugHideTimeout = null;\n }\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n if (!nextProps || !nextProps.settings) {\n console.log(JSON.stringify(nextProps));\n return;\n }\n\n const settings = JSON.parse(JSON.stringify(nextProps.settings));\n if (!settings.tagCard && this.state.tagCardArray && this.state.tagCardArray.length) {\n settings.tagCard = typeof this.state.tagCardArray[0] !== 'string' ? this.state.tagCardArray[0].title : this.state.tagCardArray[0];\n }\n\n let newState = null;\n\n if (nextProps.onDebugMessage && nextProps.onDebugMessage.blockId === this.props._id) {\n newState = {};\n newState.debugMessage = JSON.parse(JSON.stringify(nextProps.onDebugMessage));\n this.debugHideTimeout && clearTimeout(this.debugHideTimeout);\n this.debugHideTimeout = setTimeout(() =>\n this.setState({ debugMessage: null }),\n nextProps.onDebugMessage.hideTimeout || 5000);\n }\n\n if (JSON.stringify(settings) !== JSON.stringify(this.state.settings)) {\n newState = newState || {};\n newState.settings = settings;\n }\n\n if (this.state.enableSimulation !== nextProps.enableSimulation) {\n newState = newState || {};\n newState.enableSimulation = nextProps.enableSimulation;\n }\n\n newState && this.setState(newState);\n }\n\n componentWillUnmount() {\n this.debugHideTimeout && clearTimeout(this.debugHideTimeout);\n this.debugHideTimeout = null;\n }\n\n // called every time, the tagCard changes or at start\n onTagChange(tagCard, cb) {\n // analyse inputs and fill the attributes with default values\n let changed = false;\n let settings = JSON.parse(JSON.stringify(this.state.settings));\n this.state.inputs.forEach(input => {\n if (input.attr && input.defaultValue !== undefined) {\n if (settings[input.attr] === undefined) {\n changed = true;\n settings[input.attr] = input.defaultValue;\n }\n }\n });\n if (changed) {\n this.setState({ settings }, () => cb && cb());\n this.props.onChange(settings);\n } else {\n cb && cb();\n }\n }\n\n // called if trigger added or removed\n onUpdate() {\n // do nothing, but blocks can overwrite it\n }\n\n // called every time if some attribute changes\n onValueChanged(value, attr) {\n // do nothing, but blocks can overwrite it\n }\n\n renderText = (input, value, onChange) => {\n const { className } = this.props;\n const { attr, frontText, backText, nameBlock, name, doNotTranslate, doNotTranslateBack } = input;\n return \n \n {frontText &&
{doNotTranslate ? frontText : I18n.t(frontText)}
}\n
\n {backText &&
{doNotTranslateBack ? backText : I18n.t(backText)}
}\n
\n {nameBlock && {I18n.t(nameBlock)}
}\n ;\n }\n\n renderSwitch = (input, value, onChange) => {\n const { className } = this.props;\n const { attr, frontText, backText, nameBlock, doNotTranslate, doNotTranslateBack } = input;\n return \n
\n {frontText &&
{doNotTranslate ? frontText : I18n.t(frontText)}
}\n
\n {backText &&
{doNotTranslateBack ? backText : I18n.t(backText)}
}\n
\n {nameBlock &&
{I18n.t(nameBlock)}
}\n
;\n }\n\n renderNameText = ({ attr, signature, doNotTranslate, defaultValue }, value) => \n {value ? (doNotTranslate ? value : I18n.t(value)) : (doNotTranslate ? defaultValue : I18n.t(defaultValue))}\n
;\n\n renderNumber = (input, value, onChange) => {\n const { className } = this.props;\n const { settings } = this.state;\n const { attr, backText, frontText, openCheckbox, doNotTranslate, doNotTranslateBack } = input;\n let visibility = true;\n if (openCheckbox) {\n visibility = typeof settings['offset'] === 'boolean' ? settings['offset'] : true;\n }\n return visibility ? \n {frontText &&
{doNotTranslate ? frontText : I18n.t(frontText)}
}\n
\n {backText &&
{doNotTranslateBack ? backText : I18n.t(backText)}
}\n
: null;\n }\n\n renderColor = (input, value, onChange) => {\n const { className } = this.props;\n const { attr, backText, frontText, doNotTranslate, doNotTranslateBack } = input;\n return \n {frontText &&
{doNotTranslate ? frontText : I18n.t(frontText)}
}\n
\n {backText &&
{doNotTranslateBack ? backText : I18n.t(backText)}
}\n
;\n }\n\n renderCheckbox = (input, value, onChange) => {\n const { className } = this.props;\n const { settings } = this.state;\n const { attr, backText, frontText, defaultValue, doNotTranslate, doNotTranslateBack } = input;\n return \n {frontText &&
{doNotTranslate ? frontText : I18n.t(frontText)}
}\n
\n {backText &&
onChange(typeof settings[attr] === 'boolean' ? !settings[attr] : !defaultValue)} className={cls.backText}>{doNotTranslateBack ? backText : I18n.t(backText)}
}\n
;\n }\n\n renderSlider = (input, value, onChange) => {\n const { className } = this.props;\n const { attr, frontText, backText, nameBlock, min, max, step, unit, doNotTranslate, doNotTranslateBack } = input;\n return \n
\n {frontText &&
{doNotTranslate ? frontText : I18n.t(frontText)}
}\n
{\n console.log(val);\n onChange(val);\n }}\n />\n {backText && {doNotTranslateBack ? backText : I18n.t(backText)}
}\n \n {nameBlock &&
{I18n.t(nameBlock)}
}\n
;\n }\n\n renderButton = (input, value, onClick) => {\n const { className } = this.props;\n const { attr, frontText, backText, buttonText, doNotTranslate, doNotTranslateBack } = input;\n return \n {frontText &&
{doNotTranslate ? frontText : I18n.t(frontText)}
}\n
\n {backText &&
{doNotTranslateBack ? backText : I18n.t(backText)}
}\n
;\n }\n\n findIcon = obj => {\n if (!obj) {\n return Promise.resolve(null);\n } else\n if (obj.common?.icon) {\n return Promise.resolve(getSelectIdIcon(obj, '../..'));\n } else if (obj.type === 'state' || obj.type === 'channel') {\n const parts = obj._id.split('.');\n parts.pop();\n const newId = parts.join('.');\n return this.props.socket.getObject(newId)\n .then(obj => this.findIcon(obj))\n .catch(() => null);\n }\n }\n\n renderObjectID = (input, value, onChange) => {\n const { attr, openCheckbox, checkReadOnly } = input;\n const { settings } = this.state;\n const showSelectId = this.state[`showSelectId${attr}`];\n const { className, socket } = this.props;\n let visibility = true;\n if (openCheckbox) {\n visibility = typeof settings['offset'] === 'boolean' ? settings['offset'] : true;\n }\n\n if (settings[attr] && !this.state[settings[attr]]) {\n setTimeout(() => {\n socket.getObject(value)\n .then(obj => {\n this.findIcon(obj)\n .then(icon => this.setState({\n [settings[attr]]: obj,\n [`${settings[attr]}___icon`]: icon,\n error: checkReadOnly && this.lastObjectIdChange && Date.now() - this.lastObjectIdChange < 1000 && obj?.common?.write === false ?\n I18n.t('Read only ID selected: %s', settings[attr]) : '',\n }))\n });\n }, 0);\n }\n\n // return null\n return visibility ? \n
\n {input.title ?
{I18n.t(input.title)}
: null}\n
\n
{\n const settings = {};\n settings[`showSelectId${attr}`] = true;\n this.setState(settings);\n }}\n />\n \n {this.state[this.state.settings[input.attr]] &&
{Utils.getObjectNameFromObj(this.state[settings[attr]], I18n.getLanguage())}
}\n {showSelectId ?
{\n const settings = {};\n settings[`showSelectId${attr}`] = false;\n this.setState(settings);\n }}\n onOk={(selected, name, common) => {\n const settings = {};\n settings[`showSelectId${attr}`] = false;\n this.setState(settings, () =>\n // read type of object\n socket.getObject(selected)\n .then(obj => {\n this.lastObjectIdChange = Date.now();\n onChange({\n [attr]: selected,\n [`${attr}Role`]: obj.common.role,\n [`${attr}Type`]: obj.common.type,\n [`${attr}Unit`]: obj.common.unit,\n [`${attr}States`]: obj.common.states,\n [`${attr}Min`]: obj.common.min,\n [`${attr}Max`]: obj.common.max,\n [`${attr}Step`]: obj.common.step,\n [`${attr}Def`]: obj.common.def,\n [`${attr}Write`]: obj.common.write,\n [`${attr}Read`]: obj.common.read,\n }, null, () =>\n this.props.setOnUpdate && this.props.setOnUpdate(true))\n }))}\n }\n /> : null}\n : null;\n }\n\n renderIconTag = () => {\n return {\n if (this.state.settings.tagCard) {\n if (this.state.tagCardArray.length < 3) {\n this.onChangeTag();\n } else {\n this.setState({ openTagMenu: e.currentTarget })\n }\n }\n }}>\n {this.state.settings.tagCard}\n
;\n }\n\n renderTime = (input, value, onChange) => {\n const { attr, backText, frontText, doNotTranslate, doNotTranslateBack } = input\n return \n {frontText &&
{doNotTranslate ? frontText : I18n.t(frontText)}
}\n
\n {backText &&
{doNotTranslateBack ? backText : I18n.t(backText)}
}\n
;\n };\n\n renderSelect = (input, value, onChange) => {\n const { className } = this.props;\n const { name, options, frontText, backText, attr, multiple, doNotTranslate, doNotTranslate2, doNotTranslateBack } = input;\n return \n {frontText &&
{I18n.t(frontText)}
}\n
\n {backText &&
{doNotTranslateBack ? backText : I18n.t(backText)}
}\n
;\n };\n\n renderInstance = (input, value, onChange) => {\n const { className, socket } = this.props;\n const { name, options, frontText, backText, attr, adapter, doNotTranslate, doNotTranslateBack } = input;\n if (this.state.hideAttributes.includes(attr)) {\n return null;\n }\n return \n {frontText &&
{doNotTranslate ? frontText : I18n.t(frontText)}
}\n
this.setState({ hideAttributes: [...this.state.hideAttributes, attr] }, () => onChange(value))} // hide instance if only exactly one exists\n />\n {backText && {doNotTranslateBack ? backText : I18n.t(backText)}
}\n ;\n }\n\n renderDialog = (input, value, onChange) => {\n const { onShowDialog, frontText, backText, attr, icon, doNotTranslate, doNotTranslateBack } = input;\n return \n {frontText &&
{doNotTranslate ? frontText : I18n.t(frontText)}
}\n
onShowDialog && onShowDialog()}\n />\n {backText && {doNotTranslateBack ? backText : I18n.t(backText)}
}\n ;\n }\n\n renderModalInput = (input, value, onChange) => {\n const { openModal } = this.state;\n const { className } = this.props;\n const { attr, nameBlock, frontText, backText, noTextEdit, doNotTranslate, doNotTranslateBack} = input;\n return \n
\n {frontText &&
{doNotTranslate ? frontText : I18n.t(frontText)}
}\n
\n
this.setState({ openModal: true })}\n />\n {backText && {doNotTranslateBack ? backText : I18n.t(backText)}
}\n \n {openModal ?
\n this.setState({ openModal: false }, () =>\n val !== null && val !== undefined && onChange(val))}\n onClose={() => this.setState({ openModal: false })}\n defaultValue={value}\n textInput\n /> : null}\n {nameBlock && {I18n.t(nameBlock)}
}\n ;\n };\n\n renderDate = (input, value, onChange) => {\n const { attr, backText, frontText, doNotTranslate, doNotTranslateBack } = input\n return \n {frontText &&
{doNotTranslate ? frontText : I18n.t(frontText)}
}\n
\n {backText &&
{doNotTranslateBack ? backText : I18n.t(backText)}
}\n
;\n };\n\n static getReplacesInText(context) {\n let value = '';\n if (context.trigger?.oidType) {\n value = '.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)';\n } else if (context.conditionsStates.length) {\n value = `.replace(/%s/g, ${context.conditionsStates[0].name}).replace(/%id/g, \"${context.conditionsStates[0].id}\")`;\n }\n return value;\n }\n\n /////////////////////////////\n renderTags = () => {\n let { tagCardArray, openTagMenu } = this.state;\n let { tagCard } = this.state.settings;\n let result = tagCard !== '=' && tagCard !== '<>' && tagCard !== '>=' && tagCard !== '()' && tagCard !== '.' && tagCard !== '<=' && tagCard !== '<' && tagCard !== '>' ? I18n.t(tagCard) : tagCard;\n if (tagCardArray.length >= 3) {\n result = \n
{\n this.setState({ openTagMenu: e.currentTarget }, () => {\n this.props.isTourOpen &&\n this.props.tourStep === STEPS.openTagsMenu &&\n setTimeout(() => this.props.setTourStep(STEPS.selectIntervalTag), 300);\n });\n }}>{result}
\n \n
;\n }\n\n return result;\n };\n\n onChangeTag = () => {\n const { tagCardArray, settings, settings: { tagCard } } = this.state;\n let newTagCardArray = [...tagCardArray]\n if (typeof newTagCardArray[0] !== 'string') {\n newTagCardArray = newTagCardArray.map(el => el.title);\n }\n\n if (tagCard && newTagCardArray.length < 3) {\n const newSettings = { ...settings };\n const newTagCard = newTagCardArray[(newTagCardArray.indexOf(tagCard) + 1) % newTagCardArray.length]\n newSettings.tagCard = newTagCard;\n this.setState({ settings: newSettings }, () => {\n this.props.onChange(newSettings);\n this.onTagChange(newTagCard);\n });\n }\n };\n\n componentDidMount = () => {\n this.onTagChange();\n // detect changes\n };\n\n componentDidUpdate = prevProps => {\n if (this.props.acceptedBy !== 'triggers' && this.props.onUpdate) {\n setTimeout(() => this.onUpdate(), 0);\n }\n }\n\n onChangeInput = attribute => {\n return (value, attr, cb) => {\n const settings = JSON.parse(JSON.stringify(this.state.settings));\n\n if (typeof value === 'object' && (!attr || typeof attr === 'function')) {\n Object.keys(value).forEach(_attr => settings[_attr] = value[_attr]);\n } else {\n settings[attr || attribute] = value;\n }\n settings.id = this.getData().id;\n settings._id = this.props._id;\n\n this.setState({ settings }, () => {\n this.onValueChanged(value, attr || attribute);\n this.props.onChange(settings);\n cb && cb();\n });\n }\n }\n\n renderSpecific() {\n return null; // it can be overloaded\n }\n\n renderDebugInfo() {\n if (this.state.debugMessage) {\n return \n {this.renderDebug ? this.renderDebug(this.state.debugMessage) : I18n.t('executed')}\n
;\n } else {\n return null;\n }\n }\n\n render = () => {\n const { inputs, name, icon, iconTag, settings, adapter, settings: { tagCard }, helpDialog } = this.state;\n const { socket, notFound } = this.props;\n\n return \n {iconTag ? this.renderIconTag() :\n {\n if (tagCard) {\n if (this.state.tagCardArray.length < 3) {\n this.onChangeTag();\n } else {\n this.setState({ openTagMenu: e.currentTarget })\n }\n }\n }}\n />}\n \n \n {I18n.t(name)}\n {!!notFound ? I18n.t(`%s not found`, settings.id) : ''}\n {helpDialog ? this.setState({ helpText: I18n.t(helpDialog) })}> : null}\n \n {inputs.filter(({ nameRender }) => this[nameRender])\n .map(input => {\n const { nameRender, defaultValue, attr, options } = input;\n return this[nameRender](\n input,\n settings[attr] !== undefined ? settings[attr] : defaultValue,\n this.onChangeInput(attr),\n options || []\n );\n })}\n
\n {tagCard && \n
this.onChangeTag()} className={Utils.clsx(cls.tagCard, 'tag-card')}>{this.renderTags()}
\n
}\n {this.renderDebugInfo()}\n {this.state.error ? this.setState({ error: '' })} /> : null}\n {this.state.helpText ? this.setState({ helpText: '' })} /> : null}\n {this.renderSpecific()}\n ;\n };\n}\n\nexport default GenericBlock;","import GenericBlock from '../GenericBlock';\nimport { I18n } from '@iobroker/adapter-react-v5';\n\n// copied from https://github.com/ioBroker/ioBroker.sayit/blob/master/admin/blockly.js#L37\nconst sayitEngines = {\n 'en': { name: 'Google - English', engine: 'google', params: [] },\n 'de': { name: 'Google - Deutsch', engine: 'google', params: [] },\n 'ru': { name: 'Google - Русский', engine: 'google', params: [] },\n 'it': { name: 'Google - Italiano', engine: 'google', params: [] },\n 'es': { name: 'Google - Espaniol', engine: 'google', params: [] },\n 'fr': { name: 'Google - Français', engine: 'google', params: [] },\n 'ru_YA': { name: 'Yandex - Русский', engine: 'yandex', params: ['key', 'voice', 'emotion', 'ill', 'drunk', 'robot'], voice: ['jane', 'zahar'], emotion: ['none', 'good', 'neutral', 'evil', 'mixed'] },\n 'ru_YA_CLOUD': { name: 'Yandex Cloud - Русский', engine: 'yandexCloud', params: ['key', 'folderID', 'voice', 'emotion'], voice: ['alyss', 'oksana', 'jane', 'zahar'], emotion: [ 'good', 'neutral', 'evil'] },\n\n 'en-US': { name: 'PicoTTS - Englisch US', engine: 'PicoTTS', params: [] },\n 'en-GB': { name: 'PicoTTS - Englisch GB', engine: 'PicoTTS', params: [] },\n 'de-DE': { name: 'PicoTTS - Deutsch', engine: 'PicoTTS', params: [] },\n 'it-IT': { name: 'PicoTTS - Italiano', engine: 'PicoTTS', params: [] },\n 'es-ES': { name: 'PicoTTS - Espaniol', engine: 'PicoTTS', params: [] },\n 'fr-FR': { name: 'PicoTTS - Français', engine: 'PicoTTS', params: [] },\n\n 'ru-RU_CLOUD_Female': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'ru-RU', ename: 'Tatyana', ssml: true, name: 'Cloud - Русский - Татьяна' },\n 'ru-RU_CLOUD_Male': { gender: 'Male', engine: 'cloud', params: ['cloud'], language: 'ru-RU', ename: 'Maxim', ssml: true, name: 'Cloud - Русский - Максим' },\n 'de-DE_CLOUD_Female': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'de-DE', ename: 'Marlene', ssml: true, name: 'Cloud - Deutsch - Marlene' },\n 'de-DE_CLOUD_Male': { gender: 'Male', engine: 'cloud', params: ['cloud'], language: 'de-DE', ename: 'Hans', ssml: true, name: 'Cloud - Deutsch - Hans' },\n 'en-US_CLOUD_Female': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'en-US', ename: 'Salli', ssml: true, name: 'Cloud - en-US - Female - Salli' },\n 'en-US_CLOUD_Male': { gender: 'Male', engine: 'cloud', params: ['cloud'], language: 'en-US', ename: 'Joey', ssml: true, name: 'Cloud - en-US - Male - Joey' },\n 'da-DK_CLOUD_Female': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'da-DK', ename: 'Naja', ssml: true, name: 'Cloud - da-DK - Female - Naja' },\n 'da-DK_CLOUD_Male': { gender: 'Male', engine: 'cloud', params: ['cloud'], language: 'da-DK', ename: 'Mads', ssml: true, name: 'Cloud - da-DK - Male - Mads' },\n 'en-AU_CLOUD_Female': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'en-AU', ename: 'Nicole', ssml: true, name: 'Cloud - en-AU - Female - Nicole' },\n 'en-AU_CLOUD_Male': { gender: 'Male', engine: 'cloud', params: ['cloud'], language: 'en-AU', ename: 'Russell', ssml: true, name: 'Cloud - en-AU - Male - Russell' },\n 'en-GB_CLOUD_Female_Amy': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'en-GB', ename: 'Amy', ssml: true, name: 'Cloud - en-GB - Female - Amy' },\n 'en-GB_CLOUD_Male': { gender: 'Male', engine: 'cloud', params: ['cloud'], language: 'en-GB', ename: 'Brian', ssml: true, name: 'Cloud - en-GB - Male - Brian' },\n 'en-GB_CLOUD_Female_Emma': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'en-GB', ename: 'Emma', ssml: true, name: 'Cloud - en-GB - Female - Emma' },\n 'en-GB-WLS_CLOUD_Female': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'en-GB-WLS', ename: 'Gwyneth', ssml: true, name: 'Cloud - en-GB-WLS - Female - Gwyneth' },\n 'en-GB-WLS_CLOUD_Male': { gender: 'Male', engine: 'cloud', params: ['cloud'], language: 'en-GB-WLS', ename: 'Geraint', ssml: true, name: 'Cloud - en-GB-WLS - Male - Geraint' },\n 'cy-GB_CLOUD_Female': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'cy-GB', ename: 'Gwyneth', ssml: true, name: 'Cloud - cy-GB - Female - Gwyneth' },\n 'cy-GB_CLOUD_Male': { gender: 'Male', engine: 'cloud', params: ['cloud'], language: 'cy-GB', ename: 'Geraint', ssml: true, name: 'Cloud - cy-GB - Male - Geraint' },\n 'en-IN_CLOUD_Female': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'en-IN', ename: 'Raveena', ssml: true, name: 'Cloud - en-IN - Female - Raveena' },\n 'en-US_CLOUD_Male_Chipmunk':{ gender: 'Male', engine: 'cloud', params: ['cloud'], language: 'en-US', ename: 'Chipmunk', ssml: true, name: 'Cloud - en-US - Male - Chipmunk' },\n 'en-US_CLOUD_Male_Eric': { gender: 'Male', engine: 'cloud', params: ['cloud'], language: 'en-US', ename: 'Eric', ssml: true, name: 'Cloud - en-US - Male - Eric' },\n 'en-US_CLOUD_Female_Ivy': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'en-US', ename: 'Ivy', ssml: true, name: 'Cloud - en-US - Female - Ivy' },\n 'en-US_CLOUD_Female_Jennifer': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'en-US', ename: 'Jennifer', ssml: true, name: 'Cloud - en-US - Female - Jennifer' },\n 'en-US_CLOUD_Male_Justin': { gender: 'Male', engine: 'cloud', params: ['cloud'], language: 'en-US', ename: 'Justin', ssml: true, name: 'Cloud - en-US - Male - Justin' },\n 'en-US_CLOUD_Female_Kendra': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'en-US', ename: 'Kendra', ssml: true, name: 'Cloud - en-US - Female - Kendra' },\n 'en-US_CLOUD_Female_Kimberly': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'en-US', ename: 'Kimberly', ssml: true, name: 'Cloud - en-US - Female - Kimberly' },\n 'es-ES_CLOUD_Female': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'es-ES', ename: 'Conchita', ssml: true, name: 'Cloud - es-ES - Female - Conchita' },\n 'es-ES_CLOUD_Male': { gender: 'Male', engine: 'cloud', params: ['cloud'], language: 'es-ES', ename: 'Enrique', ssml: true, name: 'Cloud - es-ES - Male - Enrique' },\n 'es-US_CLOUD_Female': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'es-US', ename: 'Penelope', ssml: true, name: 'Cloud - es-US - Female - Penelope' },\n 'es-US_CLOUD_Male': { gender: 'Male', engine: 'cloud', params: ['cloud'], language: 'es-US', ename: 'Miguel', ssml: true, name: 'Cloud - es-US - Male - Miguel' },\n 'fr-CA_CLOUD_Female': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'fr-CA', ename: 'Chantal', ssml: true, name: 'Cloud - fr-CA - Female - Chantal' },\n 'fr-FR_CLOUD_Female': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'fr-FR', ename: 'Celine', ssml: true, name: 'Cloud - fr-FR - Female - Celine' },\n 'fr-FR_CLOUD_Male': { gender: 'Male', engine: 'cloud', params: ['cloud'], language: 'fr-FR', ename: 'Mathieu', ssml: true, name: 'Cloud - fr-FR - Male - Mathieu' },\n 'is-IS_CLOUD_Female': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'is-IS', ename: 'Dora', ssml: true, name: 'Cloud - is-IS - Female - Dora' },\n 'is-IS_CLOUD_Male': { gender: 'Male', engine: 'cloud', params: ['cloud'], language: 'is-IS', ename: 'Karl', ssml: true, name: 'Cloud - is-IS - Male - Karl' },\n 'it-IT_CLOUD_Female': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'it-IT', ename: 'Carla', ssml: true, name: 'Cloud - it-IT - Female - Carla' },\n 'it-IT_CLOUD_Male': { gender: 'Male', engine: 'cloud', params: ['cloud'], language: 'it-IT', ename: 'Giorgio', ssml: true, name: 'Cloud - it-IT - Male - Giorgio' },\n 'nb-NO_CLOUD_Female': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'nb-NO', ename: 'Liv', ssml: true, name: 'Cloud - nb-NO - Female - Liv' },\n 'nl-NL_CLOUD_Female': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'nl-NL', ename: 'Lotte', ssml: true, name: 'Cloud - nl-NL - Female - Lotte' },\n 'nl-NL_CLOUD_Male': { gender: 'Male', engine: 'cloud', params: ['cloud'], language: 'nl-NL', ename: 'Ruben', ssml: true, name: 'Cloud - nl-NL - Male - Ruben' },\n 'pl-PL_CLOUD_Female_Agnieszka': { gender: 'Female', engine: 'cloud',params: ['cloud'], language: 'pl-PL', ename: 'Agnieszka', ssml: true, name: 'Cloud - pl-PL - Female - Agnieszka' },\n 'pl-PL_CLOUD_Male_Jacek': { gender: 'Male', engine: 'cloud', params: ['cloud'], language: 'pl-PL', ename: 'Jacek', ssml: true, name: 'Cloud - pl-PL - Male - Jacek' },\n 'pl-PL_CLOUD_Female_Ewa': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'pl-PL', ename: 'Ewa', ssml: true, name: 'Cloud - pl-PL - Female - Ewa' },\n 'pl-PL_CLOUD_Male_Jan': { gender: 'Male', engine: 'cloud', params: ['cloud'], language: 'pl-PL', ename: 'Jan', ssml: true, name: 'Cloud - pl-PL - Male - Jan' },\n 'pl-PL_CLOUD_Female': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'pl-PL', ename: 'Maja', ssml: true, name: 'Cloud - pl-PL - Female - Maja' },\n 'pt-BR_CLOUD_Female': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'pt-BR', ename: 'Vitoria', ssml: true, name: 'Cloud - pt-BR - Female - Vitoria' },\n 'pt-BR_CLOUD_Male': { gender: 'Male', engine: 'cloud', params: ['cloud'], language: 'pt-BR', ename: 'Ricardo', ssml: true, name: 'Cloud - pt-BR - Male - Ricardo' },\n 'pt-PT_CLOUD_Male': { gender: 'Male', engine: 'cloud', params: ['cloud'], language: 'pt-PT', ename: 'Cristiano', ssml: true, name: 'Cloud - pt-PT - Male - Cristiano' },\n 'pt-PT_CLOUD_Female': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'pt-PT', ename: 'Ines', ssml: true, name: 'Cloud - pt-PT - Female - Ines' },\n 'ro-RO_CLOUD_Female': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'ro-RO', ename: 'Carmen', ssml: true, name: 'Cloud - ro-RO - Female - Carmen' },\n 'sv-SE_CLOUD_Female': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'sv-SE', ename: 'Astrid', ssml: true, name: 'Cloud - sv-SE - Female - Astrid' },\n 'tr-TR_CLOUD_Female': { gender: 'Female', engine: 'cloud', params: ['cloud'], language: 'tr-TR', ename: 'Filiz', ssml: true, name: 'Cloud - tr-TR - Female - Filiz' },\n\n 'ru-RU_AP_Female': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'ru-RU', ename: 'Tatyana', ssml: true, name: 'AWS Polly - Русский - Татьяна' },\n 'ru-RU_AP_Male': { gender: 'Male', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'ru-RU', ename: 'Maxim', ssml: true, name: 'AWS Polly - Русский - Максим' },\n 'de-DE_AP_Female': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'de-DE', ename: 'Marlene', ssml: true, name: 'AWS Polly - Deutsch - Marlene' },\n 'de-DE_AP_Female_Vicky': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'de-DE', ename: 'Vicky', ssml: true, name: 'AWS Polly - Deutsch - Vicky' },\n 'de-DE_AP_Male': { gender: 'Male', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'de-DE', ename: 'Hans', ssml: true, name: 'AWS Polly - Deutsch - Hans' },\n 'en-US_AP_Female': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'en-US', ename: 'Salli', ssml: true, name: 'AWS Polly - en-US - Female - Salli' },\n 'en-US_AP_Male': { gender: 'Male', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'en-US', ename: 'Joey', ssml: true, name: 'AWS Polly - en-US - Male - Joey' },\n 'da-DK_AP_Female': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'da-DK', ename: 'Naja', ssml: true, name: 'AWS Polly - da-DK - Female - Naja' },\n 'da-DK_AP_Male': { gender: 'Male', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'da-DK', ename: 'Mads', ssml: true, name: 'AWS Polly - da-DK - Male - Mads' },\n 'en-AU_AP_Female': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'en-AU', ename: 'Nicole', ssml: true, name: 'AWS Polly - en-AU - Female - Nicole' },\n 'en-AU_AP_Male': { gender: 'Male', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'en-AU', ename: 'Russell', ssml: true, name: 'AWS Polly - en-AU - Male - Russell' },\n 'en-GB_AP_Female_Amy': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'en-GB', ename: 'Amy', ssml: true, name: 'AWS Polly - en-GB - Female - Amy' },\n 'en-GB_AP_Male': { gender: 'Male', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'en-GB', ename: 'Brian', ssml: true, name: 'AWS Polly - en-GB - Male - Brian' },\n 'en-GB_AP_Female_Emma': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'en-GB', ename: 'Emma', ssml: true, name: 'AWS Polly - en-GB - Female - Emma' },\n 'en-GB-WLS_AP_Female': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'en-GB-WLS', ename: 'Gwyneth', ssml: true, name: 'AWS Polly - en-GB-WLS - Female - Gwyneth' },\n 'en-GB-WLS_AP_Male': { gender: 'Male', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'en-GB-WLS', ename: 'Geraint', ssml: true, name: 'AWS Polly - en-GB-WLS - Male - Geraint' },\n 'cy-GB_AP_Female': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'cy-GB', ename: 'Gwyneth', ssml: true, name: 'AWS Polly - cy-GB - Female - Gwyneth' },\n 'cy-GB_AP_Male': { gender: 'Male', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'cy-GB', ename: 'Geraint', ssml: true, name: 'AWS Polly - cy-GB - Male - Geraint' },\n 'en-IN_AP_Female': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'en-IN', ename: 'Raveena', ssml: true, name: 'AWS Polly - en-IN - Female - Raveena' },\n 'en-US_AP_Male_Chipmunk': { gender: 'Male', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'en-US', ename: 'Chipmunk', ssml: true, name: 'AWS Polly - en-US - Male - Chipmunk' },\n 'en-US_AP_Male_Eric': { gender: 'Male', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'en-US', ename: 'Eric', ssml: true, name: 'AWS Polly - en-US - Male - Eric' },\n 'en-US_AP_Female_Ivy': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'en-US', ename: 'Ivy', ssml: true, name: 'AWS Polly - en-US - Female - Ivy' },\n 'en-US_AP_Female_Jennifer': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'en-US', ename: 'Jennifer', ssml: true, name: 'AWS Polly - en-US - Female - Jennifer' },\n 'en-US_AP_Male_Justin': { gender: 'Male', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'en-US', ename: 'Justin', ssml: true, name: 'AWS Polly - en-US - Male - Justin' },\n 'en-US_AP_Female_Kendra': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'en-US', ename: 'Kendra', ssml: true, name: 'AWS Polly - en-US - Female - Kendra' },\n 'en-US_AP_Female_Kimberly': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'en-US', ename: 'Kimberly', ssml: true, name: 'AWS Polly - en-US - Female - Kimberly' },\n 'es-ES_AP_Female': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'es-ES', ename: 'Conchita', ssml: true, name: 'AWS Polly - es-ES - Female - Conchita' },\n 'es-ES_AP_Male': { gender: 'Male', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'es-ES', ename: 'Enrique', ssml: true, name: 'AWS Polly - es-ES - Male - Enrique' },\n 'es-US_AP_Female': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'es-US', ename: 'Penelope', ssml: true, name: 'AWS Polly - es-US - Female - Penelope' },\n 'es-US_AP_Male': { gender: 'Male', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'es-US', ename: 'Miguel', ssml: true, name: 'AWS Polly - es-US - Male - Miguel' },\n 'fr-CA_AP_Female': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'fr-CA', ename: 'Chantal', ssml: true, name: 'AWS Polly - fr-CA - Female - Chantal' },\n 'fr-FR_AP_Female': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'fr-FR', ename: 'Celine', ssml: true, name: 'AWS Polly - fr-FR - Female - Celine' },\n 'fr-FR_AP_Male': { gender: 'Male', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'fr-FR', ename: 'Mathieu', ssml: true, name: 'AWS Polly - fr-FR - Male - Mathieu' },\n 'is-IS_AP_Female': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'is-IS', ename: 'Dora', ssml: true, name: 'AWS Polly - is-IS - Female - Dora' },\n 'is-IS_AP_Male': { gender: 'Male', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'is-IS', ename: 'Karl', ssml: true, name: 'AWS Polly - is-IS - Male - Karl' },\n 'it-IT_AP_Female': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'it-IT', ename: 'Carla', ssml: true, name: 'AWS Polly - it-IT - Female - Carla' },\n 'it-IT_AP_Male': { gender: 'Male', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'it-IT', ename: 'Giorgio', ssml: true, name: 'AWS Polly - it-IT - Male - Giorgio' },\n 'nb-NO_AP_Female': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'nb-NO', ename: 'Liv', ssml: true, name: 'AWS Polly - nb-NO - Female - Liv' },\n 'nl-NL_AP_Female': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'nl-NL', ename: 'Lotte', ssml: true, name: 'AWS Polly - nl-NL - Female - Lotte' },\n 'nl-NL_AP_Male': { gender: 'Male', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'nl-NL', ename: 'Ruben', ssml: true, name: 'AWS Polly - nl-NL - Male - Ruben' },\n 'pl-PL_AP_Female_Agnieszka':{ gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'pl-PL', ename: 'Agnieszka', ssml: true, name: 'AWS Polly - pl-PL - Female - Agnieszka' },\n 'pl-PL_AP_Male_Jacek': { gender: 'Male', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'pl-PL', ename: 'Jacek', ssml: true, name: 'AWS Polly - pl-PL - Male - Jacek' },\n 'pl-PL_AP_Female_Ewa': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'pl-PL', ename: 'Ewa', ssml: true, name: 'AWS Polly - pl-PL - Female - Ewa' },\n 'pl-PL_AP_Male_Jan': { gender: 'Male', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'pl-PL', ename: 'Jan', ssml: true, name: 'AWS Polly - pl-PL - Male - Jan' },\n 'pl-PL_AP_Female': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'pl-PL', ename: 'Maja', ssml: true, name: 'AWS Polly - pl-PL - Female - Maja' },\n 'pt-BR_AP_Female': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'pt-BR', ename: 'Vitoria', ssml: true, name: 'AWS Polly - pt-BR - Female - Vitoria' },\n 'pt-BR_AP_Male': { gender: 'Male', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'pt-BR', ename: 'Ricardo', ssml: true, name: 'AWS Polly - pt-BR - Male - Ricardo' },\n 'pt-PT_AP_Male': { gender: 'Male', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'pt-PT', ename: 'Cristiano', ssml: true, name: 'AWS Polly - pt-PT - Male - Cristiano' },\n 'pt-PT_AP_Female': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'pt-PT', ename: 'Ines', ssml: true, name: 'AWS Polly - pt-PT - Female - Ines' },\n 'ro-RO_AP_Female': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'ro-RO', ename: 'Carmen', ssml: true, name: 'AWS Polly - ro-RO - Female - Carmen' },\n 'sv-SE_AP_Female': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'sv-SE', ename: 'Astrid', ssml: true, name: 'AWS Polly - sv-SE - Female - Astrid' },\n 'tr-TR_AP_Female': { gender: 'Female', engine: 'polly', params: ['accessKey', 'secretKey', 'region'], language: 'tr-TR', ename: 'Filiz', ssml: true, name: 'AWS Polly - tr-TR - Female - Filiz' },\n};\n\nclass ActionSayText extends GenericBlock {\n constructor(props) {\n super(props, ActionSayText.getStaticData());\n }\n\n static compile(config, context) {\n if (!config.text) {\n return `// no text defined\n_sendToFrontEnd(${config._id}, {text: 'No text defined'});`;\n } else {\n return `// Sayit ${config.text || ''}\n\\t\\tconst subActionVar${config._id} = \"${config.language && config.language !== '_' ? `${config.language};` : ''}${config.volume ? `${config.volume};` : ''}${(config.text || '').replace(/\"/g, '\\\\\"')}\"${GenericBlock.getReplacesInText(context)};\n\\t\\t_sendToFrontEnd(${config._id}, {text: subActionVar${config._id}});\n\\t\\tawait setStateAsync(\"${config.instance}.tts.text\", subActionVar${config._id});`;\n }\n }\n\n renderDebug(debugMessage) {\n return `${I18n.t('Say:')} ${debugMessage.data.text}`;\n }\n\n onTagChange(tagCard) {\n const lang = I18n.getLanguage();\n const languages = Object.keys(sayitEngines).filter(l => l.startsWith(lang));\n const options = languages.map(lang => ({title: sayitEngines[lang].name, value: lang}));\n options.unshift({title: 'Default', value: '_'});\n\n this.setState({\n inputs: [\n {\n attr: 'instance',\n nameRender: 'renderInstance',\n adapter: 'sayit',\n defaultValue: 'sayit.0',\n frontText: 'Instance:',\n },\n {\n nameRender: 'renderSelect',\n frontText: 'Language:',\n options,\n defaultValue: '_',\n attr: 'language',\n },\n {\n nameRender: 'renderNameText',\n defaultValue: 'Volume',\n attr: 'textVol',\n },\n {\n nameRender: 'renderSlider',\n attr: 'volume',\n defaultValue: 100,\n min: 0,\n max: 100\n },\n {\n attr: 'text',\n nameRender: 'renderModalInput',\n defaultValue: 'Hallo',\n nameBlock: '',\n frontText: 'Text:',\n }\n ]\n }, () => super.onTagChange(tagCard));\n }\n\n static getStaticData() {\n return {\n acceptedBy: 'actions',\n name: 'Say It',\n id: 'ActionSayText',\n adapter: 'sayit',\n title: 'Say some text via sayit adapter',\n helpDialog: 'You can use %s in the text to display current trigger value or %id to display the triggered object ID',\n }\n }\n\n getData() {\n return ActionSayText.getStaticData();\n }\n}\n\nexport default ActionSayText;\n","import GenericBlock from '../GenericBlock';\nimport { I18n } from '@iobroker/adapter-react-v5';\n\nclass ActionSendEmail extends GenericBlock {\n constructor(props) {\n super(props, ActionSendEmail.getStaticData());\n }\n\n static compile(config, context) {\n if (!config.recipients) {\n return `// no recipients defined'\n_sendToFrontEnd(${config._id}, {text: 'No recipients defined'});`;\n } else {\n return `// Send Email ${config.text || ''}\n\\t\\tconst subActionVar${config._id} = \"${(config.text || '').replace(/\"/g, '\\\\\"')}\"${GenericBlock.getReplacesInText(context)};\n\\t\\t_sendToFrontEnd(${config._id}, {text: subActionVar${config._id}});\n\\t\\tsendTo(\"${config.instance || 'email.0'}\", {\n\\t\\t to: \"${config.recipients || ''}\",\n\\t\\t subject: \"${(config.subject || 'ioBroker').replace(/\"/g, '\\\\\"')}\"${GenericBlock.getReplacesInText(context)},\n\\t\\t text: subActionVar${config._id}\n\\t\\t});`;\n }\n }\n\n renderDebug(debugMessage) {\n return `${I18n.t('Sent:')} ${debugMessage.data.text}`;\n }\n\n onTagChange(tagCard) {\n this.setState({\n inputs: [\n {\n attr: 'instance',\n nameRender: 'renderInstance',\n defaultValue: 'email.0',\n frontText: 'Instance:',\n adapter: 'email',\n },\n {\n attr: 'recipients',\n nameRender: 'renderText',\n defaultValue: 'user@mail.ru',\n frontText: 'To:',\n },\n {\n attr: 'subject',\n nameRender: 'renderText',\n defaultValue: 'Email from iobroker',\n nameBlock: '',\n frontText: 'Subject:',\n },\n {\n attr: 'text',\n nameRender: 'renderModalInput',\n defaultValue: 'Email from iobroker',\n nameBlock: '',\n frontText: 'Body:',\n }\n ]\n }, () => super.onTagChange(tagCard));\n }\n\n static getStaticData() {\n return {\n acceptedBy: 'actions',\n name: 'Send email',\n id: 'ActionSendEmail',\n adapter: 'email',\n title: 'Sends an email',\n helpDialog: 'You can use %s in the text to display current trigger value or %id to display the triggered object ID',\n }\n }\n\n getData() {\n return ActionSendEmail.getStaticData();\n }\n}\n\nexport default ActionSendEmail;\n","import GenericBlock from '../GenericBlock';\nimport { I18n } from '@iobroker/adapter-react-v5';\n\nclass ActionTelegram extends GenericBlock {\n constructor(props) {\n super(props, ActionTelegram.getStaticData());\n this.cachePromises = {};\n }\n\n static compile(config, context) {\n let text = (config.text || '').replace(/\"/g, '\\\\\"');\n if (!text) {\n return `// no text defined\n_sendToFrontEnd(${config._id}, {text: 'No text defined'});`;\n } else {\n return `// Telegram ${text || ''}\n\\t\\tconst subActionVar${config._id} = \"${(text || '').replace(/\"/g, '\\\\\"')}\"${GenericBlock.getReplacesInText(context)};\n\\t\\t_sendToFrontEnd(${config._id}, {text: subActionVar${config._id}});\n\\t\\tsendTo(\"${config.instance}\", \"send\", ${config.user && config.user !== '_' ? `{user: \"${(config.user || '').replace(/\"/g, '\\\\\"')}\", text: subActionVar${config._id}}` : `subActionVar${config._id}`});`;\n }\n }\n\n renderDebug(debugMessage) {\n return `${I18n.t('Sent:')} ${debugMessage.data.text}`;\n }\n\n onValueChanged(value, attr) {\n if (attr === 'instance') {\n this._setUsers(value);\n }\n }\n\n _setUsers(instance) {\n instance = instance || this.state.settings.instance || 'telegram.0';\n this.cachePromises[instance] = this.cachePromises[instance] || this.props.socket.getState(`${instance}.communicate.users`);\n if (!this.state.settings._id) {\n return this.setState({\n inputs: [\n {\n nameRender: 'renderSelect',\n adapter: 'telegram',\n frontText: 'Instance:',\n defaultValue: 'telegram.0',\n attr: 'instance',\n },\n {\n nameRender: 'renderSelect',\n attr: 'user',\n options: [{title: 'telegram.0', value: 'telegram.0'}],\n defaultValue: '',\n frontText: 'User:',\n },\n {\n nameRender: 'renderModalInput',\n attr: 'text',\n defaultValue: 'Hallo',\n nameBlock: '',\n frontText: 'Text:',\n }\n ]\n }, () => super.onTagChange());\n }\n\n this.cachePromises[instance]\n .then(users => {\n try {\n users = users?.val ? JSON.parse(users.val) : null;\n users = users && Object.keys(users).map(user => ({title: users[user].userName || users[user].firstName, value: user}));\n users = users || [];\n users.unshift({ title: 'all', value: '' });\n } catch (e) {\n users = [{ title: 'all', value: '' }];\n }\n\n this.setState({\n inputs: [\n {\n nameRender: 'renderInstance',\n adapter: 'telegram',\n frontText: 'Instance:',\n defaultValue: 'telegram.0',\n attr: 'instance',\n },\n {\n nameRender: 'renderSelect',\n attr: 'user',\n options: users,\n defaultValue: '_',\n frontText: 'User:',\n },\n {\n nameRender: 'renderModalInput',\n attr: 'text',\n defaultValue: 'Hallo',\n nameBlock: '',\n frontText: 'Text:',\n },\n ]\n }, () => super.onTagChange());\n });\n }\n\n onTagChange(tagCard) {\n this._setUsers();\n }\n\n static getStaticData() {\n return {\n acceptedBy: 'actions',\n name: 'Telegram',\n id: 'ActionTelegram',\n adapter: 'telegram',\n title: 'Sends message via telegram',\n helpDialog: 'You can use %s in the text to display current trigger value or %id to display the triggered object ID',\n }\n }\n\n getData() {\n return ActionTelegram.getStaticData();\n }\n}\n\nexport default ActionTelegram;\n","import GenericBlock from '../GenericBlock';\n\nclass ActionPushover extends GenericBlock {\n constructor(props) {\n super(props, ActionPushover.getStaticData());\n this.cachePromises = {};\n }\n\n static compile(config, context) {\n let text = (config.text || '').replace(/\"/g, '\\\\\"');\n if (!text) {\n return `// no text defined\n_sendToFrontEnd(${config._id}, {text: 'No text defined'});`;\n } else {\n return `// Pushover ${config.text || ''}\n\\t\\tconst subActionVar${config._id} = \"${text}\"${GenericBlock.getReplacesInText(context)};\n\\t\\t_sendToFrontEnd(${config._id}, {text: subActionVar${config._id}}); \n\\t\\tsendTo(\"${config.instance}\", \"send\", {\n\\t\\t message: subActionVar${config._id},\n\\t\\t title: \"${(config.title || '').replace(/\"/g, '\\\\\"')}\"${GenericBlock.getReplacesInText(context)},\n\\t\\t sound: \"${config.sound}\",\n\\t\\t priority: ${config.priority}\n\\t\\t});`;\n }\n }\n\n renderDebug(debugMessage) {\n return `Sent: ${debugMessage.data.text}`;\n }\n\n onTagChange(tagCard) {\n this.setState({\n inputs: [\n {\n nameRender: 'renderInstance',\n adapter: 'pushover',\n frontText: 'Instance:',\n defaultValue: 'pushover.0',\n attr: 'instance',\n },\n {\n nameRender: 'renderModalInput',\n attr: 'text',\n defaultValue: 'Hello',\n nameBlock: '',\n frontText: 'Text:',\n },\n {\n nameRender: 'renderText',\n attr: 'title',\n defaultValue: 'ioBroker',\n frontText: 'Title:',\n },\n {\n nameRender: 'renderSelect',\n attr: 'sound',\n defaultValue: 'magic',\n frontText: 'Sound:',\n doNotTranslate: true,\n options: [\n { value: 'pushover', title: 'pushover' },\n { value: 'bike', title: 'bike' },\n { value: 'bugle', title: 'bugle' },\n { value: 'cashregister', title: 'cashregister' },\n { value: 'classical', title: 'classical' },\n { value: 'cosmic', title: 'cosmic' },\n { value: 'falling', title: 'falling' },\n { value: 'gamelan', title: 'gamelan' },\n { value: 'incoming', title: 'incoming' },\n { value: 'intermission', title: 'intermission' },\n { value: 'magic', title: 'magic' },\n { value: 'mechanical', title: 'mechanical' },\n { value: 'pianobar', title: 'pianobar' },\n { value: 'siren', title: 'siren' },\n { value: 'spacealarm', title: 'spacealarm' },\n { value: 'tugboat', title: 'tugboat' },\n { value: 'alien', title: 'alien' },\n { value: 'climb', title: 'climb' },\n { value: 'persistent', title: 'persistent' },\n { value: 'echo', title: 'echo' },\n { value: 'updown', title: 'updown' },\n { value: 'none', title: 'none' },\n ]\n },\n {\n nameRender: 'renderSelect',\n attr: 'priority',\n defaultValue: -1,\n frontText: 'Priority:',\n options: [\n { value: -1, title: 'quiet' },\n { value: 0, title: 'normal' },\n { value: 1, title: 'high-priority' },\n { value: 2, title: 'acknowledgment' },\n ]\n }\n ]\n }, () => super.onTagChange());\n }\n\n static getStaticData() {\n return {\n acceptedBy: 'actions',\n name: 'Pushover',\n id: 'ActionPushover',\n adapter: 'pushover',\n title: 'Sends message via pushover',\n helpDialog: 'You can use %s in the text to display current trigger value or %id to display the triggered object ID',\n }\n }\n\n getData() {\n return ActionPushover.getStaticData();\n }\n}\n\nexport default ActionPushover;\n","import GenericBlock from '../GenericBlock';\nimport { I18n } from '@iobroker/adapter-react-v5';\n\nclass ActionWhatsappcmb extends GenericBlock {\n constructor(props) {\n super(props, ActionWhatsappcmb.getStaticData());\n this.cachePromises = {};\n }\n\n static compile(config, context) {\n let text = (config.text || '').replace(/\"/g, '\\\\\"');\n if (!text) {\n return `// no text defined\n_sendToFrontEnd(${config._id}, {text: 'No text defined'});`;\n } else {\n return `// whatsapp ${text || ''}\n\\t\\tconst subActionVar${config._id} = \"${(text || '').replace(/\"/g, '\\\\\"')}\"${GenericBlock.getReplacesInText(context)};\n\\t\\t_sendToFrontEnd(${config._id}, {text: subActionVar${config._id}});\n\\t\\tsendTo(\"${config.instance}\", \"send\", {text: subActionVar${config._id}${config.phone ? `, phone: \"${config.phone.replace(/\"/g, '\\\\\"')}\"` : ''}});`;\n }\n }\n\n renderDebug(debugMessage) {\n return `${I18n.t('Sent:')} ${debugMessage.data.text}`;\n }\n\n onTagChange(tagCard) {\n this.setState({\n inputs: [\n {\n nameRender: 'renderInstance',\n adapter: 'whatsapp-cmb',\n frontText: 'Instance:',\n defaultValue: 'whatsapp-cmb.0',\n attr: 'instance',\n },\n {\n nameRender: 'renderModalInput',\n attr: 'text',\n defaultValue: 'Hello',\n nameBlock: '',\n frontText: 'Text:',\n },\n {\n nameRender: 'renderText',\n attr: 'phone',\n defaultValue: '',\n frontText: 'Phone:',\n backText: '(optional)',\n }\n ]\n }, () => super.onTagChange());\n }\n\n static getStaticData() {\n return {\n acceptedBy: 'actions',\n name: 'Whatsapp-cmb',\n id: 'ActionWhatsappcmb',\n adapter: 'whatsapp-cmb',\n title: 'Sends message via whatsapp-cmb',\n helpDialog: 'You can use %s in the text to display current trigger value or %id to display the triggered object ID',\n }\n }\n\n getData() {\n return ActionWhatsappcmb.getStaticData();\n }\n}\n\nexport default ActionWhatsappcmb;\n","import GenericBlock from '../GenericBlock';\n\nclass ActionPushsafer extends GenericBlock {\n constructor(props) {\n super(props, ActionPushsafer.getStaticData());\n this.cachePromises = {};\n }\n\n static compile(config, context) {\n let text = (config.text || '').replace(/\"/g, '\\\\\"');\n if (!text) {\n return `// no text defined\n_sendToFrontEnd(${config._id}, {text: 'No text defined'});`;\n } else {\n return `// Pushsafer ${config.text || ''}\n\\t\\tconst subActionVar${config._id} = \"${text}\"${GenericBlock.getReplacesInText(context)};\n\\t\\t_sendToFrontEnd(${config._id}, {text: subActionVar${config._id}}); \n\\t\\tsendTo(\"${config.instance}\", \"send\", {\n\\t\\t message: subActionVar${config._id},\n\\t\\t title: \"${(config.title || '').replace(/\"/g, '\\\\\"')}\"${GenericBlock.getReplacesInText(context)},\n\\t\\t ${config.device ? `device: \"${config.device}\",` : ''}\n\\t\\t ${config.sound && config.sound !== '_' ? `sound: \"${config.sound}\",` : ''}\n\\t\\t priority: ${config.priority},\n\\t\\t ${config.vibration && config.vibration !== '_' ? `vibration: ${config.vibration},` : ''}\n\\t\\t});`;\n }\n }\n\n renderDebug(debugMessage) {\n return `Sent: ${debugMessage.data.text}`;\n }\n\n onTagChange(tagCard) {\n this.setState({\n inputs: [\n {\n nameRender: 'renderInstance',\n adapter: 'pushsafer',\n frontText: 'Instance:',\n defaultValue: 'pushsafer.0',\n attr: 'instance',\n },\n {\n nameRender: 'renderModalInput',\n attr: 'text',\n defaultValue: 'Hello',\n nameBlock: '',\n frontText: 'Text:',\n },\n {\n nameRender: 'renderText',\n attr: 'title',\n defaultValue: 'ioBroker',\n frontText: 'Title:',\n },\n {\n nameRender: 'renderSelect',\n attr: 'sound',\n defaultValue: 'magic',\n frontText: 'Sound:',\n doNotTranslate: true,\n options: [\n { value: '_', title: 'Device Default' },\n { value: '0', title: 'Silent' },\n { value: '1', title: 'Ahem (IM)' },\n { value: '2', title: 'Applause (Mail)' },\n { value: '3', title: 'Arrow (Reminder)' },\n { value: '4', title: 'Baby (SMS)' },\n { value: '5', title: 'Bell (Alarm)' },\n { value: '6', title: 'Bicycle (Alarm2)' },\n { value: '7', title: 'Boing (Alarm3)' },\n { value: '8', title: 'Buzzer (Alarm4)' },\n { value: '9', title: 'Camera (Alarm5)' },\n { value: '10', title: 'Car Horn (Alarm6)' },\n { value: '11', title: 'Cash Register (Alarm7)' },\n { value: '12', title: 'Chime (Alarm8)' },\n { value: '13', title: 'Creaky Door (Alarm9)' },\n { value: '14', title: 'Cuckoo Clock (Alarm10)' },\n { value: '15', title: 'Disconnect (Call)' },\n { value: '16', title: 'Dog (Call2)' },\n { value: '17', title: 'Doorbell (Call3)' },\n { value: '18', title: 'Fanfare (Call4)' },\n { value: '19', title: 'Gun Shot (Call5)' },\n { value: '20', title: 'Honk (Call6)' },\n { value: '21', title: 'Jaw Harp (Call7)' },\n { value: '22', title: 'Morse (Call8)' },\n { value: '23', title: 'Electricity (Call9)' },\n { value: '24', title: 'Radio Tuner (Call10)' },\n { value: '25', title: 'Sirens' },\n { value: '26', title: 'Military Trumpets' },\n { value: '27', title: 'Ufo' },\n { value: '28', title: 'Whah Whah Whah' },\n { value: '29', title: 'Man Saying Goodbye' },\n { value: '30', title: 'Man Saying Hello' },\n { value: '31', title: 'Man Saying No' },\n { value: '32', title: 'Man Saying Ok' },\n { value: '33', title: 'Man Saying Ooohhhweee' },\n { value: '34', title: 'Man Saying Warning' },\n { value: '35', title: 'Man Saying Welcome' },\n { value: '36', title: 'Man Saying Yeah' },\n { value: '37', title: 'Man Saying Yes' },\n { value: '38', title: 'Beep short' },\n { value: '39', title: 'Weeeee short' },\n { value: '40', title: 'Cut in and out short' },\n { value: '41', title: 'Finger flicking glas short' },\n { value: '42', title: 'Wa Wa Waaaa short' },\n { value: '43', title: 'Laser short' },\n { value: '44', title: 'Wind Chime short' },\n { value: '45', title: 'Echo short' },\n { value: '46', title: 'Zipper short' },\n { value: '47', title: 'HiHat short' },\n { value: '48', title: 'Beep 2 short' },\n { value: '49', title: 'Beep 3 short' },\n { value: '50', title: 'Beep 4 short' },\n { value: '51', title: 'The Alarm is armed' },\n { value: '52', title: 'The Alarm is disarmed' },\n { value: '53', title: 'The Backup is ready' },\n { value: '54', title: 'The Door is closed' },\n { value: '55', title: 'The Door is opend' },\n { value: '56', title: 'The Window is closed' },\n { value: '57', title: 'The Window is open' },\n { value: '58', title: 'The Light is off' },\n { value: '59', title: 'The Light is on' },\n { value: '60', title: 'The Doorbell rings' },\n { value: '61', title: 'Pager short' },\n { value: '62', title: 'Pager long' },\n ]\n },\n {\n nameRender: 'renderSelect',\n attr: 'priority',\n defaultValue: 0,\n frontText: 'Priority:',\n options: [\n { value: -2, title: 'lowest priority' },\n { value: -1, title: 'lower priority' },\n { value: 0, title: 'normal priority' },\n { value: 1, title: 'high priority' },\n { value: 2, title: 'highest priority' },\n ]\n },\n {\n nameRender: 'renderSelect',\n attr: 'vibration',\n defaultValue: 0,\n frontText: 'Vibration:',\n options: [\n { value: '_', title: 'default' },\n { value: 1, title: '1' },\n { value: 2, title: '2' },\n { value: 3, title: '3' },\n ]\n }\n ]\n }, () => super.onTagChange());\n }\n\n static getStaticData() {\n return {\n acceptedBy: 'actions',\n name: 'Pushsafer',\n id: 'ActionPushsafer',\n adapter: 'pushsafer',\n title: 'Sends message via Pushsafer',\n helpDialog: 'You can use %s in the text to display current trigger value or %id to display the triggered object ID',\n }\n }\n\n getData() {\n return ActionPushsafer.getStaticData();\n }\n}\n\nexport default ActionPushsafer;\n","// eslint-disable-next-line no-unused-vars\n\nconst STANDARD_FUNCTION_STATE = `async function (obj) {\n \"__%%DEBUG_TRIGGER%%__\";\n __%%CONDITIONS_VARS%%__\n const _cond = __%%CONDITION%%__;\n \n \"__%%DEBUG_CONDITIONS%%__\";\n \n if (_cond) {\n__%%THEN%%__\n } else {\n__%%ELSE%%__\n }\n}`;\nconst STANDARD_FUNCTION_STATE_ONCHANGE = `async function (obj) {\n \"__%%DEBUG_TRIGGER%%__\";\n __%%CONDITIONS_VARS%%__\n const _cond = __%%CONDITION%%__;\n \n \"__%%DEBUG_CONDITIONS%%__\";\n \n if (__%%STATE%%__ === false && _cond) {\n __%%STATE%%__ = true; \n__%%THEN%%__\n } else if (__%%STATE%%__ === true && !_cond) {\n __%%STATE%%__ = false; \n__%%ELSE%%__\n }\n}`;\nconst STANDARD_FUNCTION =\n`async function () {\n \"__%%DEBUG_TRIGGER%%__\";\n __%%CONDITIONS_VARS%%__\n const _cond = __%%CONDITION%%__;\n \n \"__%%DEBUG_CONDITIONS%%__\";\n \n if (_cond) {\n__%%THEN%%__\n } else {\n__%%ELSE%%__\n }\n}`;\n\nconst STANDARD_FUNCTION_ONCHANGE =\n`async function () {\n \"__%%DEBUG_TRIGGER%%__\";\n __%%CONDITIONS_VARS%%__\n const _cond = __%%CONDITION%%__;\n \n \"__%%DEBUG_CONDITIONS%%__\";\n \n if (__%%STATE%%__ === false && _cond) {\n __%%STATE%%__ = true; \n__%%THEN%%__\n } else if (__%%STATE%%__ === true && !_cond) {\n __%%STATE%%__ = false; \n__%%ELSE%%__\n }\n}`;\n\nconst NO_FUNCTION = `\"__%%DEBUG_TRIGGER%%__\";\n__%%CONDITIONS_VARS%%__\nconst _cond = __%%CONDITION%%__;\n\n\"__%%DEBUG_CONDITIONS%%__\";\n\nif (_cond) {\n__%%THEN%%__\n} else {\n__%%ELSE%%__\n}`;\n\nconst DEFAULT_RULE = {\n triggers: [],\n conditions: [[]],\n justCheck: false,\n actions: {\n then: [],\n 'else': []\n }\n};\n\nfunction compileTriggers(json, context, blocks) {\n const triggers = [];\n let jsonTriggers = json.triggers;\n if (!jsonTriggers.length) {\n jsonTriggers = [{id: 'TriggerScriptSave'}];\n }\n\n const vars = [];\n let prelines = [];\n let hist = json.conditions.find(conds => conds.find(cond => cond.tagCard === '()'));\n\n jsonTriggers.forEach((trigger, i) => {\n const found = findBlock(trigger.id, blocks);\n if (found) {\n const _context = {\n trigger,\n condition: {},\n justCheck: hist ? false : (json.justCheck || (!json.conditions.length || !json.conditions[0].length)),\n conditionsDebug: [],\n conditionsVars: [],\n conditionsStates: [],\n };\n const text = found.compile(trigger, _context);\n const conditions = compileConditions(json.conditions, _context, blocks);\n const then = compileActions(json.actions.then, _context, blocks);\n const _else = compileActions(json.actions.else, _context, blocks);\n\n // find indent\n vars.push(`cond${i}`);\n\n if (_context.prelines && _context.prelines.length) {\n _context.prelines.forEach(line => prelines.push(line));\n }\n\n if (text.includes(' __%%CONDITIONS_VARS%%__')) {\n _context.conditionsVars = _context.conditionsVars.map((v, i) => i ? ` ${v}` : v);\n _context.conditionsDebug = _context.conditionsDebug.map((v, i) => i ? ` ${v}` : v);\n }\n\n triggers.push(\n text\n .replace('__%%CONDITIONS_VARS%%__', _context.conditionsVars.join('\\n'))\n .replace('\"__%%DEBUG_CONDITIONS%%__\";', _context.conditionsDebug.join('\\n'))\n .replace('__%%CONDITION%%__', conditions)\n .replace('__%%THEN%%__', then || '// ignore')\n .replace('__%%ELSE%%__', _else || '// ignore')\n .replace(/__%%STATE%%__/g, 'cond' + i)\n );\n }\n });\n\n let text = triggers.join('\\n\\n');\n\n if (!json.justCheck || hist) {\n text = `${vars.map(v => `let ${v} = false;`).join('\\n')}\\n\\n${text}`;\n }\n if (prelines) {\n text = `${prelines.join('\\n')}\\n\\n${text}`;\n }\n\n return text;\n}\n\nfunction findBlock(type, blocks) {\n return blocks.find(block => block.getStaticData && block.getStaticData().id === type);\n}\n\nfunction compileActions(actions, context, blocks) {\n let result = [];\n actions && actions.forEach(action => {\n const found = findBlock(action.id, blocks);\n if (found) {\n result.push(found.compile(action, context));\n }\n });\n return `\\t\\t${result.join('\\n\\n\\t\\t')}` || '';\n}\n\nfunction compileConditions(conditions, context, blocks) {\n let result = [];\n let i = 0;\n conditions && conditions.forEach(ors => {\n if (ors.hasOwnProperty('length') && ors.length) {\n const _ors = [];\n _ors && ors.forEach(block => {\n const found = findBlock(block.id, blocks);\n if (found) {\n context.condition.index = i++;\n _ors.push(found.compile(block, context));\n }\n });\n result.push(`(${_ors.join(') &&\\n (')})`);\n } else {\n const found = findBlock(ors.id, blocks);\n if (found) {\n context.condition.index = i++;\n result.push(found.compile(ors, context));\n }\n }\n });\n\n if (!result.length) {\n return 'true';\n } else\n if (result.length === 1) {\n return result[0] || 'true';\n } else {\n return `(${result.join(') || (')})`;\n }\n}\n\nfunction compile(json, blocks) {\n return compileTriggers(json, null, blocks);\n}\n\n// eslint-disable-next-line no-unused-vars\nfunction code2json(code) {\n if (!code) {\n return DEFAULT_RULE;\n } else {\n const lines = code.split('\\n');\n try {\n let json = lines.pop().replace(/^\\/\\//, '');\n json = JSON.parse(json);\n if (!json.triggers) {\n json = DEFAULT_RULE;\n }\n return json;\n } catch (e) {\n return DEFAULT_RULE;\n }\n }\n}\n\n// eslint-disable-next-line no-unused-vars\nfunction json2code(json, blocks) {\n let code = '';\n\n const compiled = compile(json, blocks);\n code += compiled;\n\n code += `\\n/*\\nconst demo = ${JSON.stringify(json, null, 2)\n .replace(/\\*\\//g, '* /')};\\n*/\\n`;\n\n return `${code}\\n//${JSON.stringify(json)}`;\n}\n\nconst Compile = {\n code2json,\n json2code,\n compile,\n STANDARD_FUNCTION,\n STANDARD_FUNCTION_ONCHANGE,\n STANDARD_FUNCTION_STATE,\n STANDARD_FUNCTION_STATE_ONCHANGE,\n NO_FUNCTION,\n};\n\nexport default Compile;","import GenericBlock from '../GenericBlock';\nimport I18n from \"@iobroker/adapter-react-v5/i18n\";\nimport Compile from '../../helpers/Compile';\n\nclass TriggerScriptSave extends GenericBlock {\n constructor(props) {\n super(props, TriggerScriptSave.getStaticData());\n }\n\n static compile(config /* , context */) {\n return Compile.NO_FUNCTION.replace('\"__%%DEBUG_TRIGGER%%__\"', `_sendToFrontEnd(${config._id}, {trigger: true})`);\n }\n\n renderDebug(/* debugMessage */) {\n return I18n.t('Triggered');\n }\n\n onTagChange(tagCard) {\n this.setState({\n inputs: [\n {\n nameRender: 'renderNameText',\n defaultValue: 'On script save or adapter start',\n attr: 'script',\n },\n ],\n }, () => super.onTagChange());\n }\n\n static getStaticData() {\n return {\n acceptedBy: 'triggers',\n name: 'Start script',\n id: 'TriggerScriptSave',\n icon: 'PlayArrow',\n title: 'Triggers the on script saving or the javascript instance restart',\n }\n }\n\n getData() {\n return TriggerScriptSave.getStaticData();\n }\n}\n\nexport default TriggerScriptSave;\n","import React from 'react';\nimport SunCalc from 'suncalc2';\n\nimport GenericBlock from '../GenericBlock';\nimport Compile from '../../helpers/Compile';\nimport CustomInput from '../CustomInput';\nimport CustomButton from '../CustomButton';\nimport CustomModal from '../CustomModal';\n\nimport ComplexCron from '@iobroker/adapter-react-v5/Components/ComplexCron';\nimport Schedule from '@iobroker/adapter-react-v5/Components/Schedule';\nimport convertCronToText from '@iobroker/adapter-react-v5/Components/SimpleCron/cronText';\nimport { I18n } from '@iobroker/adapter-react-v5';\n\nconst DEFAULT_WIZARD = '{\"time\":{\"start\":\"00:00\",\"end\":\"24:00\",\"mode\":\"hours\",\"interval\":1},\"period\":{\"days\":1}}';\n\nclass TriggerScheduleBlock extends GenericBlock {\n constructor(props) {\n super(props, TriggerScheduleBlock.getStaticData());\n this.coordinates = null;\n }\n\n static compile(config, context) {\n let text = '';\n let func = context.justCheck ? Compile.STANDARD_FUNCTION_STATE : Compile.STANDARD_FUNCTION_STATE_ONCHANGE;\n func = func.replace('\"__%%DEBUG_TRIGGER%%__\"', `_sendToFrontEnd(${config._id}, {trigger: true})`);\n\n if (config.tagCard === 'interval') {\n text = `setInterval(${func}, ${config.interval || 1} * ${config.unit === 's' ? 1000 : (config.unit === 'm' ? 60000 : 3600000)});`;\n } else if (config.tagCard === 'cron') {\n text = `schedule(\"${config.cron}\", ${func});`;\n } else if (config.tagCard === 'at') {\n const [hours, minutes] = (config.at || '').split(':');\n let dow = '*';\n if (config?.dow?.length && !config.dow.includes('_')) {\n const _dow = [...config.dow].map(item => parseInt(item, 10));\n _dow.sort();\n\n let intervals = [];\n let start = _dow[0];\n let i = 1\n for (; i < _dow.length; i++) {\n if (_dow[i] - _dow[i - 1] > 1) {\n if (start === _dow[i - 1]) {\n intervals.push(start);\n } else if (_dow[i - 1] - start === 1) {\n intervals.push(start + ',' + _dow[i - 1]);\n } else {\n intervals.push(start + '-' + _dow[i - 1]);\n }\n\n start = _dow[i];\n } else if (i === _dow.length - 1) {\n if (start === _dow[i - 1] || _dow[i] - start === 1) {\n intervals.push(start + ',' + _dow[i]);\n } else {\n intervals.push(start + '-' + _dow[i]);\n }\n }\n }\n\n dow = intervals.join(',')\n }\n text = `schedule(\"${minutes || '0'} ${hours || '0'} * * ${dow}\", ${func});`;\n } else if (config.tagCard === 'astro') {\n text = `schedule({astro: \"${config.astro}\", shift: ${config.offset ? config.offsetValue : 0}}, ${func});`;\n } else if (config.tagCard === 'wizard') {\n text = `schedule('${config.wizard}', ${func});`;\n }\n\n return text;\n }\n\n static _time2String(time) {\n if (!time) {\n return '--:--';\n }\n return `${time.getHours().toString().padStart(2, '0')}:${time.getMinutes().toString().padStart(2, '0')}`;\n }\n\n async _setAstro(astro, offset, offsetValue) {\n astro = astro || this.state.settings.astro || 'solarNoon';\n offset = offset === undefined ? this.state.settings.offset : offset;\n offsetValue = offsetValue === undefined ? this.state.settings.offsetValue : offsetValue;\n\n offsetValue = parseInt(offsetValue, 10) || 0;\n\n if (!this.coordinates) {\n await this.props.socket.getObject('system.adapter.javascript.0')\n .then(({ native: { latitude, longitude } }) => {\n if (!latitude && !longitude) {\n return this.props.socket.getObject('system.config')\n .then(obj => {\n if (obj && (obj.common.latitude || obj.common.longitude)) {\n this.coordinates = {\n latitude: obj.common.latitude,\n longitude: obj.common.longitude\n }\n } else {\n this.coordinates = null;\n }\n });\n } else {\n this.coordinates = {\n latitude,\n longitude\n }\n }\n });\n }\n\n const sunValue = this.coordinates && SunCalc.getTimes(new Date(), this.coordinates.latitude, this.coordinates.longitude);\n const options = sunValue ? Object.keys(sunValue).map(name => ({\n value: name,\n title: name,\n title2: `[${TriggerScheduleBlock._time2String(sunValue[name])}]`,\n order: sunValue ? TriggerScheduleBlock._time2String(sunValue[name]) : '??:??',\n })) : [];\n options.sort((a, b) => a.order > b.order ? 1 : (a.order < b.order ? -1 : 0));\n\n // calculate time text\n let time = '--:--';\n if (astro && sunValue && sunValue[astro]) {\n const astroTime = new Date(sunValue[astro]);\n offset && astroTime.setMinutes(astroTime.getMinutes() + parseInt(offsetValue, 10));\n time = `(at ${TriggerScheduleBlock._time2String(astroTime)})`; // translate\n }\n\n let inputs;\n\n if (offset) {\n inputs = [\n {\n frontText: 'at',\n attr: 'astro',\n nameRender: 'renderSelect',\n options,\n defaultValue: 'solarNoon',\n },\n {\n backText: 'with offset',\n nameRender: 'renderCheckbox',\n attr: 'offset',\n },\n {\n backText: offsetValue === 1 ? 'minute' : 'minutes', // translate\n frontText: 'offset',\n nameRender: 'renderNumber',\n defaultValue: 0,\n attr: 'offsetValue',\n noHelperText: true,\n },\n {\n nameRender: 'renderNameText',\n attr: 'textTime',\n defaultValue: time,\n }\n ];\n } else {\n inputs = [\n {\n frontText: 'at', // translate\n attr: 'astro',\n nameRender: 'renderSelect',\n options,\n defaultValue: 'solarNoon',\n },\n {\n backText: 'with offset', // translate\n nameRender: 'renderCheckbox',\n attr: 'offset',\n },\n {\n nameRender: 'renderNameText',\n attr: 'textTime',\n defaultValue: time,\n }\n ];\n }\n\n this.setState({ inputs }, () => super.onTagChange());\n }\n\n async _setInterval(interval) {\n interval = parseInt(interval || this.state.settings.interval, 10) || 30;\n let options;\n if (interval === 1) {\n options = [\n { value: 's', title: 'second' },\n { value: 'm', title: 'minute' },\n { value: 'h', title: 'hour' },\n ];\n } else {\n options = [\n { value: 's', title: 'seconds' },\n { value: 'm', title: 'minutes' },\n { value: 'h', title: 'hours' },\n ];\n }\n\n this.setState({\n inputs: [\n {\n nameRender: 'renderNumber',\n prefix: {\n en: 'every',\n },\n attr: 'interval',\n frontText: 'every',\n defaultValue: 30,\n className: 'block-input-interval',\n },\n {\n nameRender: 'renderSelect',\n attr: 'unit',\n defaultValue: 's',\n options,\n }\n ]\n }, () => super.onTagChange());\n }\n\n renderDebug(debugMessage) {\n return I18n.t('Triggered');\n }\n\n onValueChanged(value, attr) {\n if (this.state.settings.tagCard === 'astro') {\n if (attr === 'astro') {\n this._setAstro(value);\n } else if (attr === 'offset') {\n this._setAstro(undefined, value);\n } else if (attr === 'offsetValue') {\n this._setAstro(undefined, undefined, value);\n }\n } else if (this.state.settings.tagCard === 'interval') {\n if (attr === 'interval') {\n this._setInterval(value);\n }\n }\n }\n\n renderCron(input, value, onChange) {\n const { className } = this.props;\n let textCron = '';\n const { settings } = this.state;\n const { attr } = input;\n return \n
\n
\n {this.renderText({\n attr: attr,\n defaultValue: value\n }, !!settings[attr] ? settings[attr] : value, onChange)}\n
\n
this.setState({ openDialog: true })}\n />\n \n
{\n await onChange(textCron, attr);\n await onChange(convertCronToText(textCron, I18n.getLanguage()), 'addText');\n this.setState({ openDialog: false });\n }}\n onClose={() => this.setState({ openDialog: false })}>\n textCron = el}\n language={I18n.getLanguage()}\n />\n \n {this.renderNameText({\n defaultValue: I18n.t('every hour at 0 minutes'),\n attr: 'addText',\n signature: true,\n doNotTranslate: true,\n }, !!settings['addText'] ? settings['addText'] : I18n.t('every hour at 0 minutes'), onChange)}\n
;\n }\n\n renderWizard(input, value, onChange) {\n const { className } = this.props;\n const { attr } = input;\n let wizardText = '';\n let wizard = null;\n\n return \n
\n onChange(el)}\n customValue\n />\n this.setState({ openDialog: true })}\n />\n
\n
\n this.setState({ openDialog: false }, () =>\n onChange({\n [`${attr}Text`]: wizardText,\n [attr]: wizard,\n }))}\n onClose={() => this.setState({ openDialog: false })}>\n {\n wizardText = text;\n wizard = typeof val === 'object' ? JSON.parse(JSON.stringify(val)) : JSON.parse(val);\n wizard.valid = wizard.valid || {};\n wizard.valid.from = wizard.valid.from || Schedule.now2string();\n wizard = JSON.stringify(wizard);\n }} />\n \n
;\n }\n\n onTagChange(tagCard) {\n tagCard = tagCard || this.state.settings.tagCard;\n switch (tagCard) {\n case 'interval':\n this._setInterval();\n break;\n\n case 'cron':\n this.setState({\n inputs: [\n {\n nameRender: 'renderCron',\n attr: 'cron',\n defaultValue: '0 * * * *',\n }\n ]\n }, () => super.onTagChange());\n break;\n\n case 'wizard':\n const wizard = JSON.parse(DEFAULT_WIZARD);\n wizard.valid = wizard.valid || {};\n wizard.valid.from = wizard.valid.from || Schedule.now2string();\n\n this.setState({\n inputs: [\n {\n nameRender: 'renderWizard',\n attr: 'wizard',\n defaultValue: JSON.stringify(wizard),\n },\n ],\n }, () => super.onTagChange(null, () => {\n const wizardText = Schedule.state2text(this.state.settings.wizard || wizard);\n if (this.state.settings.wizardText !== wizardText) {\n const settings = JSON.parse(JSON.stringify(this.state.settings));\n settings.wizardText = wizardText;\n this.setState({ settings });\n this.props.onChange(settings);\n }\n }));\n break;\n\n case 'at':\n this.setState({\n inputs: [\n {\n nameRender: 'renderTime',\n prefix: 'at',\n attr: 'at',\n defaultValue: '07:30',\n },\n {\n nameRender: 'renderSelect',\n attr: 'dow',\n default: '',\n multiple: true,\n defaultValue: ['_', '1', '2', '3', '4', '5', '6', '0'],\n options: [\n { value: '_', title: 'Every day', only: true },\n { value: '1', title: 'Monday', titleShort: 'Mo' },\n { value: '2', title: 'Tuesday', titleShort: 'Tu' },\n { value: '3', title: 'Wednesday', titleShort: 'We' },\n { value: '4', title: 'Thursday', titleShort: 'Th' },\n { value: '5', title: 'Friday', titleShort: 'Fr' },\n { value: '6', title: 'Saturday', titleShort: 'Sa' },\n { value: '0', title: 'Sunday', titleShort: 'Su' },\n ]\n }\n ]\n }, () => super.onTagChange());\n break;\n\n case 'astro':\n this._setAstro();\n break;\n\n default:\n break;\n }\n }\n\n static getStaticData() {\n return {\n acceptedBy: 'triggers',\n name: 'Schedule',\n id: 'TriggerScheduleBlock',\n icon: 'AccessTime',\n tagCardArray: ['cron', 'wizard', 'interval', 'at', 'astro'],\n title: 'Triggers the rule periodically or on some specific time',\n }\n }\n\n getData() {\n return TriggerScheduleBlock.getStaticData();\n }\n}\n\nexport default TriggerScheduleBlock;\n","import React from 'react';\nimport withStyles from '@mui/styles/withStyles';\n\nimport GenericBlock from '../GenericBlock';\nimport Compile from '../../helpers/Compile';\nimport Button from '@mui/material/Button';\nimport Switch from '@mui/material/Switch';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport TextField from '@mui/material/TextField';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport Slide from '@mui/material/Slide';\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport Checkbox from '@mui/material/Checkbox';\n\nimport { MdCancel as IconCancel } from 'react-icons/md';\nimport { MdCheck as IconCheck } from 'react-icons/md';\n\nimport { I18n } from '@iobroker/adapter-react-v5';\n\nconst styles = theme => ({\n valueAck: {\n color: '#b02323',\n },\n valueNotAck: {\n color: '#12ac15',\n },\n});\n\nconst Transition = React.forwardRef((props, ref) =>\n );\n\nclass TriggerState extends GenericBlock {\n constructor(props) {\n super(props, TriggerState.getStaticData());\n this.inputRef = React.createRef();\n }\n\n static compile(config, context) {\n let func = context.justCheck ? Compile.STANDARD_FUNCTION_STATE : Compile.STANDARD_FUNCTION_STATE_ONCHANGE;\n func = func.replace('\"__%%DEBUG_TRIGGER%%__\"', `_sendToFrontEnd(${config._id}, {val: obj.state.val, ack: obj.state.ack, valOld: obj.oldState && obj.oldState.val, ackOld: obj.oldState && obj.oldState.ack})`);\n return `on({id: \"${config.oid || ''}\", change: \"${config.tagCard === 'on update' ? 'any' : 'ne'}\"}, ${func});`\n }\n\n static renderValue(val) {\n if (val === null) {\n return 'null';\n } else if (val === undefined) {\n return 'undefined';\n } else if (Array.isArray(val)) {\n return val.join(', ');\n } else if (typeof val === 'object') {\n return JSON.stringify(val);\n } else {\n return val.toString();\n }\n }\n\n renderDebug(debugMessage) {\n if (debugMessage.data.valOld !== undefined) {\n return {I18n.t('Triggered')} {TriggerState.renderValue(debugMessage.data.valOld)} → {TriggerState.renderValue(debugMessage.data.val)};\n } else {\n return {I18n.t('Triggered')} {TriggerState.renderValue(debugMessage.data.val)};\n }\n }\n\n onWriteValue() {\n this.setState({openSimulate: false});\n let simulateValue = this.state.simulateValue;\n window.localStorage.setItem(`javascript.app.${this.state.settings.oid}_ack`, this.state.simulateAck);\n\n if (this.state.settings.oidType === 'boolean') {\n simulateValue = simulateValue === true || simulateValue === 'true' || simulateValue === '1';\n } else if (this.state.settings.oidType === 'number') {\n simulateValue = parseFloat(simulateValue) || 0;\n }\n\n window.localStorage.setItem(`javascript.app.${this.state.settings.oid}`, simulateValue);\n this.props.socket.setState(this.state.settings.oid, { val: simulateValue, ack: !!this.state.simulateAck });\n }\n\n renderWriteState() {\n return <>\n \n \n >;\n }\n\n onTagChange(tagCard) {\n this.setState({\n inputs: [\n {\n nameRender: 'renderObjectID',\n attr: 'oid',\n defaultValue: '',\n },\n {\n nameRender: 'renderWriteState',\n },\n ]\n }, () => {\n super.onTagChange();\n });\n }\n\n static getStaticData() {\n return {\n acceptedBy: 'triggers',\n name: 'State',\n id: 'TriggerState',\n icon: 'FlashOn',\n tagCardArray: ['on change', 'on update'],\n title: 'Triggers the rule on update or change of some state', // translate\n }\n }\n\n getData() {\n return TriggerState.getStaticData();\n }\n}\nexport default withStyles(styles)(TriggerState);\n","import React from 'react';\n\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogContentText from '@mui/material/DialogContentText';\nimport DialogActions from '@mui/material/DialogActions';\n\nimport { I18n } from '@iobroker/adapter-react-v5';\n\nimport GenericBlock from '../GenericBlock';\n\nimport HysteresisImage from '../../../assets/hysteresis.png';\n\nconst HYSTERESIS = `function __hysteresis(val, limit, state, hist, comp) {\n let cond1, cond2;\n if (comp === '>') {\n cond1 = val > limit + hist;\n cond2 = val <= limit - hist;\n } else if (comp === '<') {\n cond1 = val < limit - hist;\n cond2 = val >= limit + hist;\n } else if (comp === '>=') {\n cond1 = val >= limit + hist;\n cond2 = val < limit - hist;\n } else if (comp === '<=') {\n cond1 = val <= limit - hist;\n cond2 = val > limit + hist;\n } else if (comp === '=') {\n cond1 = val <= limit + hist && val > limit - hist;\n cond2 = val > limit + hist || val <= limit - hist;\n } else if (comp === '<>') {\n cond1 = val > limit + hist || val <= limit - hist;\n cond2 = val <= limit + hist && val > limit - hist;\n }\n \n if (!state && cond1) {\n return true;\n } else if (state && cond2) {\n return false;\n } else {\n return state;\n }\n}`;\n\nclass ConditionState extends GenericBlock {\n constructor(props) {\n super(props, ConditionState.getStaticData());\n }\n\n isAllTriggersOnState() {\n return this.props.userRules?.triggers?.find(item => item.id === 'TriggerState') &&\n !this.props.userRules?.triggers?.find(item => item.id !== 'TriggerState');\n }\n\n static compile(config, context) {\n let value = config.value;\n if (value === null || value === undefined) {\n value = false;\n }\n let debugValue = '';\n\n let result;\n if (config.tagCard === '()') {\n context.prelines = context.prelines || [];\n !context.prelines.find(item => item !== HYSTERESIS) && context.prelines.push(HYSTERESIS);\n if (config.useTrigger) {\n debugValue = 'obj.state.val';\n if (value === '') {\n value = 0;\n }\n result = `__hysteresis(subCondVar${config._id}, ${value}, __%%STATE%%__, ${config.hist}, \"${config.histComp}\")`;\n } else {\n debugValue = `(await getStateAsync(\"${config.oid}\")).val`;\n if (value === '') {\n value = 0;\n }\n if (typeof value === 'string' && parseFloat(value.trim()).toString() !== value.trim()) {\n value = `\"${value}\"`;\n }\n\n result = `__hysteresis(subCondVar${config._id}, ${value}, __%%STATE%%__, ${config.hist}, \"${config.histComp}\")`;\n }\n } else\n if (config.tagCard !== 'includes') {\n const compare = config.tagCard === '=' ? '==' : (config.tagCard === '<>' ? '!=' : config.tagCard);\n if (config.useTrigger) {\n debugValue = 'obj.state.val';\n if (context?.trigger?.oidType === 'string') {\n value = value.replace(/\"/g, '\\\\\"');\n result = `subCondVar${config._id} ${compare} \"${value}\"`;\n } else {\n if (value === '') {\n value = 0;\n }\n if (typeof value === 'string' && parseFloat(value.trim()).toString() !== value.trim()) {\n value = `\"${value}\"`;\n }\n result = `subCondVar${config._id} ${compare} ${value}`;\n }\n } else {\n debugValue = `(await getStateAsync(\"${config.oid}\")).val`;\n if (config.oidType === 'string') {\n value = value.replace(/\"/g, '\\\\\"');\n result = `subCondVar${config._id} ${compare} \"${value}\"`;\n } else {\n if (value === '') {\n value = 0;\n }\n if (typeof value === 'string' && parseFloat(value.trim()).toString() !== value.trim()) {\n value = `\"${value}\"`;\n }\n result = `subCondVar${config._id} ${compare} ${value}`;\n }\n }\n } else {\n if (config.useTrigger) {\n debugValue = 'obj.state.val';\n if (context?.trigger?.oidType === 'string') {\n value = value.replace(/\"/g, '\\\\\"');\n result = `obj.state.val.includes(\"${value}\")`;\n } else {\n result = `false`;\n }\n } else {\n debugValue = `(await getStateAsync(\"${config.oid}\")).val`;\n if (config.oidType === 'string') {\n value = value.replace(/\"/g, '\\\\\"');\n result = `subCondVar${config._id}.includes(\"${value}\")`;\n } else {\n result = `false`;\n }\n }\n }\n context.conditionsStates.push({ name: `subCondVar${config._id}`, id: config.oid });\n context.conditionsVars.push(`const subCondVar${config._id} = ${debugValue};`);\n context.conditionsVars.push(`const subCond${config._id} = ${result};`);\n context.conditionsDebug.push(`_sendToFrontEnd(${config._id}, {result: subCond${config._id}, value: subCondVar${config._id}, compareWith: \"${value}\"});`);\n return `subCond${config._id}`;\n }\n\n renderDebug(debugMessage) {\n const condition = this.state.settings.tagCard;\n if (condition === '()') {\n // TODO\n } else {\n return `${debugMessage.data.result.toString().toUpperCase()} [${debugMessage.data.value} ${condition} ${debugMessage.data.compareWith}]`;\n }\n\n return I18n.t('Triggered');\n }\n\n onShowHelp = () => this.setState({showHysteresisHelp: true});\n\n _setInputs(useTrigger, tagCard, oidType, oidUnit, oidStates) {\n const isAllTriggersOnState = this.isAllTriggersOnState();\n\n tagCard = tagCard || this.state.settings.tagCard;\n oidType = oidType || this.state.settings.oidType;\n oidUnit = oidUnit || this.state.settings.oidUnit;\n oidStates = oidStates || this.state.settings.oidStates;\n\n if (isAllTriggersOnState && useTrigger && this.props.userRules?.triggers?.length === 1) {\n oidType = this.props.userRules.triggers[0].oidType;\n oidUnit = this.props.userRules.triggers[0].oidUnit;\n oidStates = this.props.userRules.triggers[0].oidStates;\n }\n\n const _tagCardArray = ConditionState.getStaticData().tagCardArray;\n const tag = _tagCardArray.find(item => item.title === tagCard);\n let tagCardArray;\n let options = null;\n\n if (oidType === 'number') {\n tagCardArray = [\n {\n title: '=',\n title2: '[equal]',\n text: 'equal to',\n },\n {\n title: '>=',\n title2: '[greater or equal]',\n text: 'greater or equal',\n },\n {\n title: '>',\n title2: '[greater]',\n text: 'greater than',\n },\n {\n title: '<=',\n title2: '[less or equal]',\n text: 'less or equal',\n },\n {\n title: '<',\n title2: '[less]',\n text: 'less than',\n },\n {\n title: '<>',\n title2: '[not equal]',\n text: 'not equal to',\n },\n {\n title: '()',\n title2: '[hysteresis]',\n text: 'hysteresis',\n },\n ];\n\n if (oidStates) {\n options = Object.keys(oidStates).map(val => ({ value: val, title: oidStates[val] }));\n }\n } else if (oidType === 'boolean') {\n tagCardArray = [\n {\n title: '=',\n title2: '[equal]',\n text: 'equal to',\n },\n {\n title: '<>',\n title2: '[not equal]',\n text: 'not equal to',\n }\n ];\n options = [\n { title: 'false', value: false },\n { title: 'true', value: true },\n ];\n } else {\n tagCardArray = [\n {\n title: '=',\n title2: '[equal]',\n text: 'equal to',\n },\n {\n title: '>=',\n title2: '[greater or equal]',\n text: 'greater or equal',\n },\n {\n title: '>',\n title2: '[greater]',\n text: 'greater than',\n },\n {\n title: '<=',\n title2: '[less or equal]',\n text: 'less or equal',\n },\n {\n title: '<',\n title2: '[less]',\n text: 'less than',\n },\n {\n title: '<>',\n title2: '[not equal]',\n text: 'not equal to',\n },\n {\n title: '.',\n title2: '[includes]',\n text: 'includes',\n }\n ];\n if (oidStates) {\n options = Object.keys(oidStates).map(val => ({ value: val, title: oidStates[val] }));\n }\n }\n\n let settings = null;\n if (!tagCardArray.find(item => item.title === tagCard)) {\n tagCard = tagCardArray[0].title;\n settings = settings || { ...this.state.settings };\n settings.tagCard = tagCard;\n }\n\n let inputs;\n let renderText = {\n nameRender: 'renderText',\n defaultValue: '',\n attr: 'value',\n frontText: tagCard === '()' ? 'Limit' : (tag?.text || 'compare with'),\n doNotTranslateBack: true,\n backText: oidUnit,\n };\n\n if (options) {\n renderText = {\n nameRender: 'renderSelect',\n defaultValue: options[0].value,\n options,\n attr: 'value',\n frontText: tag?.text || 'compare with',\n doNotTranslateBack: true,\n backText: oidUnit,\n };\n if (!options.find(item => item.value === this.state.settings.value)) {\n settings = settings || { ...this.state.settings };\n settings.value = options[0].value;\n }\n if (options.length <= 2) {\n tagCardArray = [\n {\n title: '=',\n title2: '[equal]',\n text: 'equal to',\n },\n {\n title: '<>',\n title2: '[not equal]',\n text: 'not equal to',\n }\n ];\n }\n }\n\n if (isAllTriggersOnState && useTrigger) {\n inputs = [\n {\n backText: 'use trigger value',\n nameRender: 'renderCheckbox',\n attr: 'useTrigger',\n defaultValue: false,\n },\n renderText,\n ];\n } else if (isAllTriggersOnState) {\n inputs = [\n {\n backText: 'use trigger value',\n nameRender: 'renderCheckbox',\n attr: 'useTrigger',\n },\n {\n nameRender: 'renderObjectID',\n attr: 'oid',\n defaultValue: '',\n },\n renderText,\n ];\n } else {\n inputs = [\n {\n nameRender: 'renderObjectID',\n attr: 'oid',\n defaultValue: '',\n },\n renderText,\n ];\n }\n\n if (tagCard === '()') {\n inputs.splice(1, 0, {\n nameRender: 'renderDialog',\n icon: 'HelpOutline',\n frontText: 'Explanation',\n onShowDialog: this.onShowHelp,\n });\n inputs.splice(2, 0, {\n nameRender: 'renderSelect',\n attr: 'histComp',\n defaultValue: '>',\n frontText: 'Condition',\n doNotTranslate: true,\n options: [\n { title: '>', value: '>' },\n { title: '>=', value: '>=' },\n { title: '<', value: '<' },\n { title: '<=', value: '<=' },\n { title: '=', value: '=' },\n { title: '<>', value: '<>' },\n ]\n });\n inputs.push({\n frontText: 'Δ',\n doNotTranslate: true,\n nameRender: 'renderNumber',\n noHelperText: true,\n attr: 'hist',\n defaultValue: 1,\n doNotTranslateBack: true,\n backText: oidUnit,\n });\n }\n\n const state = {\n iconTag: true,\n tagCardArray,\n inputs,\n };\n\n this.setState(state,() =>\n super.onTagChange(null, () => {\n if (settings) {\n this.setState({settings});\n this.props.onChange(settings);\n }\n }));\n }\n\n onValueChanged(value, attr, context) {\n if (typeof value === 'object') {\n this._setInputs(value.useTrigger, value.tagCard, value.oidType, value.states);\n } else {\n if (attr === 'useTrigger') {\n this._setInputs(value);\n } else if (attr === 'oidType') {\n this._setInputs(value, undefined, value);\n } else if (attr === 'oidUnit') {\n this._setInputs(value, undefined, undefined, value);\n } else if (attr === 'oidStates') {\n this._setInputs(value, undefined, undefined, undefined, value);\n }\n }\n }\n\n onUpdate() {\n this._setInputs(this.state.settings.useTrigger);\n }\n\n onTagChange(tagCard) {\n this._setInputs(this.state.settings.useTrigger, tagCard);\n }\n\n static getStaticData() {\n return {\n acceptedBy: 'conditions',\n name: 'State condition',\n id: 'ConditionState',\n icon: 'Shuffle',\n tagCardArray: [\n {\n title: '=',\n title2: '[equal]',\n text: 'equal to',\n },\n {\n title: '>=',\n title2: '[greater or equal]',\n text: 'greater or equal',\n },\n {\n title: '>',\n title2: '[greater]',\n text: 'greater than',\n },\n {\n title: '<=',\n title2: '[less or equal]',\n text: 'less or equal',\n },\n {\n title: '<',\n title2: '[less]',\n text: 'less than',\n },\n {\n title: '<>',\n title2: '[not equal]',\n text: 'not equal to',\n },\n {\n title: '.',\n title2: '[includes]',\n text: 'includes',\n },\n {\n title: '()',\n title2: '[hysteresis]',\n text: 'hysteresis',\n }\n ],\n title: 'Compares the state value with user defined value',\n }\n }\n\n getData() {\n return ConditionState.getStaticData();\n }\n\n renderSpecific() {\n if (this.state.showHysteresisHelp) {\n return ;\n } else {\n return null;\n }\n }\n}\n\nexport default ConditionState;\n","import GenericBlock from '../GenericBlock';\n\nconst DAYS = [\n 31, // 1\n 29, // 2\n 31, // 3\n 30, // 4\n 31, // 5\n 30, // 6\n 31, // 7\n 31, // 8\n 30, // 9\n 31, // 10\n 30, // 11\n 31, // 12\n];\n\nclass ConditionTime extends GenericBlock {\n constructor(props) {\n super(props, ConditionTime.getStaticData());\n }\n\n static compile(config, context) {\n const compare = config.tagCard === '=' ? '===' : (config.tagCard === '<>' ? '!==' : config.tagCard);\n let cond;\n\n if (config.withDate) {\n let [month, date] = (config.date || '01.01').toString().split('.');\n date = parseInt(date, 10) || 0;\n month = parseInt(month, 10) || 0;\n if (month > 12) {\n month = 12;\n } else if (month < 0) {\n month = 0;\n }\n\n if (date > DAYS[month]) {\n date = DAYS[month];\n } else if (date < 0) {\n date = 0;\n }\n if (date && month) {\n cond = `formatDate(Date.now(), 'MM.DD-hh:mm') ${compare} \"${config.date}-${config.time}\"`;\n } else if (date === 0 && month) {\n cond = `formatDate(Date.now(), 'MM-hh:mm') ${compare} \"${month.toString().padStart(2, '0')}-${config.time}\"`;\n } else if (month === 0 && date) {\n cond = `formatDate(Date.now(), 'DD-hh:mm') ${compare} \"${date.toString().padStart(2, '0')}-${config.time}\"`;\n } else {\n cond = `formatDate(Date.now(), 'hh:mm') ${compare} \"${config.time}\"`;\n }\n } else {\n cond = `formatDate(Date.now(), 'hh:mm') ${compare} \"${config.time}\"`;\n }\n context.conditionsVars.push(`const subCond${config._id} = ${cond};`);\n context.conditionsDebug.push(`_sendToFrontEnd(${config._id}, {result: subCond${config._id}});`);\n return `subCond${config._id}`;\n }\n\n _setInputs(tagCard, withDate, ) {\n withDate = withDate === undefined ? this.state.settings.withDate : withDate;\n tagCard = tagCard || this.state.settings.tagCard;\n const tagCardArray = ConditionTime.getStaticData().tagCardArray;\n const tag = tagCardArray.find(item => item.title === tagCard);\n const inputs = [\n {\n nameRender: 'renderNameText',\n attr: 'interval',\n defaultValue: 'Actual time of day',\n },\n {\n frontText: tag?.text || tagCard,\n nameRender: 'renderTime',\n attr: 'time',\n defaultValue: '12:00',\n },\n {\n frontText: 'with date',\n nameRender: 'renderCheckbox',\n attr: 'withDate',\n defaultValue: false,\n }\n ];\n if (withDate) {\n inputs.push({\n nameRender: 'renderDate',\n attr: 'date',\n defaultValue: '01.01',\n });\n }\n this.setState({\n inputs,\n iconTag:true\n }, () => super.onTagChange());\n }\n\n onValueChanged(value, attr) {\n if (attr === 'withDate') {\n this._setInputs(undefined, value);\n }\n }\n\n onTagChange(tagCard) {\n this._setInputs(tagCard);\n }\n\n static getStaticData() {\n return {\n acceptedBy: 'conditions',\n name: 'Time condition',\n id: 'ConditionTime',\n icon: 'Shuffle',\n tagCardArray: [\n {\n title: '=',\n title2: '[equal]',\n text: 'equal to',\n },\n {\n title: '>=',\n title2: '[greater or equal]',\n text: 'greater or equal',\n },\n {\n title: '>',\n title2: '[greater]',\n text: 'greater than',\n },\n {\n title: '<=',\n title2: '[less or equal]',\n text: 'less or equal',\n },\n {\n title: '<',\n title2: '[less]',\n text: 'less than',\n },\n {\n title: '<>',\n title2: '[not equal]',\n text: 'not equal to',\n }\n ],\n title: 'Compares current time with the user specific time',\n }\n }\n\n getData() {\n return ConditionTime.getStaticData();\n }\n}\n\nexport default ConditionTime;\n","import GenericBlock from '../GenericBlock';\nimport SunCalc from 'suncalc2';\nimport { I18n } from '@iobroker/adapter-react-v5';\n\nclass ConditionAstronomical extends GenericBlock {\n constructor(props) {\n super(props, ConditionAstronomical.getStaticData());\n this.coordinates = null;\n }\n\n static compile(config, context) {\n const compare = config.tagCard === '=' ? '===' : (config.tagCard === '<>' ? '!==' : config.tagCard);\n let offset;\n if (config.offset) {\n offset = parseInt(config.offsetValue, 10) || 0;\n }\n const cond = `formatDate(Date.now(), 'hh:mm') ${compare} formatDate(getAstroDate(\"${config.astro}\"${offset ? `, undefined, ${offset}` : ''}), 'hh:mm')`;\n context.conditionsVars.push(`const subCond${config._id} = ${cond};`);\n context.conditionsDebug.push(`_sendToFrontEnd(${config._id}, {result: ${cond}});`);\n return cond;\n }\n\n static _time2String(time) {\n if (!time) {\n return '--:--';\n }\n return `${time.getHours().toString().padStart(2, '0')}:${time.getMinutes().toString().padStart(2, '0')}`;\n }\n\n onValueChanged(value, attr) {\n if (attr === 'astro') {\n this._setAstro(value);\n } else if (attr === 'offset') {\n this._setAstro(undefined, value);\n } else if (attr === 'offsetValue') {\n this._setAstro(undefined, undefined, value);\n }\n }\n\n async _setAstro(astro, offset, offsetValue) {\n astro = astro || this.state.settings.astro || 'solarNoon';\n offset = offset === undefined ? this.state.settings.offset : offset;\n offsetValue = offsetValue === undefined ? this.state.settings.offsetValue : offsetValue;\n\n offsetValue = parseInt(offsetValue, 10) || 0;\n if (!this.coordinates) {\n await this.props.socket.getObject('system.adapter.javascript.0')\n .then(({ native: { latitude, longitude } }) => {\n if (!latitude && !longitude) {\n return this.props.socket.getObject('system.config')\n .then(obj => {\n if (obj && (obj.common.latitude || obj.common.longitude)) {\n this.coordinates = {\n latitude: obj.common.latitude,\n longitude: obj.common.longitude,\n }\n } else {\n this.coordinates = null;\n }\n });\n } else {\n this.coordinates = {\n latitude,\n longitude,\n };\n }\n });\n }\n const sunValue = this.coordinates && SunCalc.getTimes(new Date(), this.coordinates.latitude, this.coordinates.longitude);\n const options = sunValue ? Object.keys(sunValue).map(name => ({\n value: name,\n title: name,\n title2: `[${ConditionAstronomical._time2String(sunValue[name])}]`,\n order: ConditionAstronomical._time2String(sunValue[name]),\n })) : [];\n options.sort((a, b) => a.order > b.order ? 1 : (a.order < b.order ? -1 : 0));\n\n // calculate time text\n const tagCardArray = ConditionAstronomical.getStaticData().tagCardArray;\n const tag = tagCardArray.find(item => item.title === this.state.settings.tagCard);\n\n let time = '--:--';\n if (astro && sunValue && sunValue[astro]) {\n const astroTime = new Date(sunValue[astro]);\n offset && astroTime.setMinutes(astroTime.getMinutes() + parseInt(offsetValue, 10));\n time = `(${I18n.t(tag.text)} ${ConditionAstronomical._time2String(astroTime)})`;\n }\n\n let inputs;\n\n if (offset) {\n inputs = [\n {\n nameRender: 'renderNameText',\n defaultValue: 'Actual time of day',\n attr: 'text',\n },\n {\n frontText: tag.text,\n attr: 'astro',\n nameRender: 'renderSelect',\n options,\n doNotTranslate2: true,\n defaultValue: 'solarNoon',\n },\n {\n backText: 'with offset',\n nameRender: 'renderCheckbox',\n attr: 'offset',\n },\n {\n backText: offsetValue === 1 ? 'minute' : 'minutes',\n frontText: 'offset',\n nameRender: 'renderNumber',\n defaultValue: 0,\n attr: 'offsetValue',\n noHelperText: true,\n },\n {\n nameRender: 'renderNameText',\n attr: 'textTime',\n doNotTranslate: true,\n defaultValue: time,\n },\n ];\n } else {\n inputs = [\n {\n nameRender: 'renderNameText',\n defaultValue: 'Actual time of day',\n attr: 'text',\n },\n {\n frontText: tag.text,\n attr: 'astro',\n nameRender: 'renderSelect',\n options,\n doNotTranslate2: true,\n defaultValue: 'solarNoon',\n },\n {\n backText: 'with offset',\n nameRender: 'renderCheckbox',\n attr: 'offset',\n },\n {\n nameRender: 'renderNameText',\n attr: 'textTime',\n doNotTranslate: true,\n defaultValue: time,\n },\n ];\n }\n\n this.setState({ inputs }, () => super.onTagChange());\n }\n\n onTagChange(tagCard) {\n this._setAstro();\n }\n\n static getStaticData() {\n return {\n acceptedBy: 'conditions',\n name: 'Astronomical',\n id: 'ConditionAstronomical',\n icon: 'Brightness3',\n tagCardArray: [\n {\n title: '=',\n title2: '[equal]',\n text: 'equal to',\n },\n {\n title: '>=',\n title2: '[greater or equal]',\n text: 'greater or equal to',\n },\n {\n title: '>',\n title2: '[greater]',\n text: 'greater than',\n },\n {\n title: '<=',\n title2: '[less or equal]',\n text: 'less or equal to',\n },\n {\n title: '<',\n title2: '[less]',\n text: 'less than',\n },\n {\n title: '<>',\n title2: '[not equal]',\n text: 'not equal to',\n },\n ],\n title: 'Compares current time with astronomical event',\n }\n }\n\n getData() {\n return ConditionAstronomical.getStaticData();\n }\n}\n\nexport default ConditionAstronomical;\n","import GenericBlock from '../GenericBlock';\nimport withStyles from '@mui/styles/withStyles';\nimport { I18n } from '@iobroker/adapter-react-v5';\n\nconst styles = theme => ({\n valueAck: {\n color: '#b02323',\n },\n valueNotAck: {\n color: '#12ac15',\n },\n});\n\nclass ActionSetState extends GenericBlock {\n constructor(props) {\n super(props, ActionSetState.getStaticData());\n }\n\n isAllTriggersOnState() {\n return this.props.userRules?.triggers?.find(item => item.id === 'TriggerState') &&\n !this.props.userRules?.triggers?.find(item => item.id !== 'TriggerState');\n }\n\n static compile(config, context) {\n let value = config.value;\n if (config.useTrigger) {\n value = config.toggle ? '!obj.state.val' : 'obj.state.val';\n } else {\n if (value === undefined || value === null) {\n value = '';\n }\n\n if (typeof config.value === 'string' &&\n parseFloat(config.value).toString() !== config.value &&\n config.value !== 'true' &&\n config.value !== 'false'\n ) {\n value = `\"${value.replace(/\"/g, '\\\\\"')}\"${GenericBlock.getReplacesInText(context)}`;\n }\n }\n let v;\n\n if (config.toggle && !config.useTrigger) {\n v = `const subActionVar${config._id} = !(await getStateAsync(\"${config.oid}\")).val`;\n } else {\n v = `const subActionVar${config._id} = ${value}`;\n }\n return `// set state ${config.oid} to ${config.toggle && !config.useTrigger ? 'toggle' : value} \n\\t\\t${v};\n\\t\\t_sendToFrontEnd(${config._id}, {val: subActionVar${config._id}, ack: ${config.tagCard === 'update'}});\n\\t\\tawait setStateAsync(\"${config.oid}\", subActionVar${config._id}, ${config.tagCard === 'update'});`;\n }\n\n static renderValue(val) {\n if (val === null) {\n return 'null';\n } else if (val === undefined) {\n return 'undefined';\n } else if (Array.isArray(val)) {\n return val.join(', ');\n } else if (typeof val === 'object') {\n return JSON.stringify(val);\n } else {\n return val.toString();\n }\n }\n\n renderDebug(debugMessage) {\n return {I18n.t('Set:')} {ActionSetState.renderValue(debugMessage.data.val)};\n }\n\n _setInputs(useTrigger, toggle) {\n const isAllTriggersOnState = this.isAllTriggersOnState();\n\n toggle = toggle === undefined ? this.state.settings.toggle : toggle;\n useTrigger = useTrigger === undefined ? this.state.settings.useTrigger : useTrigger;\n let type = '';\n let options;\n const {oidType, oidUnit, oidStates, oidMax, oidMin, oidRole, oidWrite, oidStep} = this.state.settings;\n let settings;\n\n if (oidType) {\n if (oidType === 'number') {\n type = 'number';\n if (oidMax !== undefined && oidMin !== undefined) {\n type = 'slider';\n }\n } else if (oidType === 'boolean') {\n type = 'boolean';\n if (oidRole && oidRole.includes('button') && oidWrite) {\n type = 'button';\n }\n } else {\n type = '';\n if (oidRole && oidRole.includes('color')) {\n type = 'color';\n }\n }\n\n if (oidStates) {\n options = Object.keys(oidStates).map(val => ({ value: val, title: oidStates[val] }));\n type = 'select';\n }\n }\n\n let inputs;\n if (isAllTriggersOnState && useTrigger) {\n inputs = [\n {\n backText: 'use trigger value',\n nameRender: 'renderCheckbox',\n attr: 'useTrigger',\n defaultValue: false,\n },\n ];\n if (type === 'boolean') {\n inputs.push({\n backText: 'toggle value',\n attr: 'toggle',\n nameRender: 'renderCheckbox',\n defaultValue: false,\n });\n }\n } else {\n switch (type) {\n case 'number':\n inputs = [{\n backText: oidUnit || '',\n frontText: 'with',\n nameRender: 'renderNumber',\n defaultValue: oidMax === undefined ? 0 : oidMax,\n attr: 'value'\n }];\n if (this.state.settings.value !== undefined && isNaN(parseFloat(this.state.settings.value))) {\n settings = { value: oidMax === undefined ? 0 : oidMax };\n }\n break;\n\n case 'slider':\n inputs = [{\n nameRender: 'renderSlider',\n defaultValue: oidMax,\n min: oidMin,\n max: oidMax,\n unit: oidUnit,\n step: oidStep,\n attr: 'value'\n }];\n const f = parseFloat(this.state.settings.value);\n if (this.state.settings.value !== undefined &&\n (isNaN(f) || f < oidMin || f > oidMax)\n ) {\n settings = { value: oidMax };\n }\n break;\n\n case 'select':\n inputs = [{\n nameRender: 'renderSelect',\n frontText: 'with',\n options,\n defaultValue: options[0].value,\n attr: 'value'\n }];\n if (this.state.settings.value !== undefined && !options.find(item => item.value === this.state.settings.value)) {\n settings = { value: options[0].value };\n }\n break;\n\n case 'boolean':\n inputs = [\n {\n backText: 'toggle value',\n attr: 'toggle',\n nameRender: 'renderCheckbox',\n defaultValue: false,\n }\n ];\n if (!toggle) {\n inputs.push({\n backText: 'true',\n frontText: 'false',\n nameRender: 'renderSwitch',\n defaultValue: false,\n attr: 'value'\n });\n }\n\n if (this.state.settings.value !== undefined && this.state.settings.value !== false && this.state.settings.value !== true) {\n settings = { value: false };\n }\n break;\n\n case 'button':\n inputs = [{\n nameRender: 'renderButton',\n defaultValue: true,\n attr: 'value'\n }];\n if (this.state.settings.value !== undefined && this.state.settings.value !== true) {\n settings = { value: true };\n }\n break;\n\n case 'color':\n inputs = [{\n nameRender: 'renderColor',\n frontText: 'with',\n defaultValue: '#FFFFFF',\n attr: 'value'\n }];\n if (this.state.settings.value !== undefined &&\n (\n typeof this.state.settings.value !== 'string' ||\n (typeof this.state.settings.value.startsWith('#') &&\n typeof this.state.settings.value.startsWith('rgb'))\n )) {\n settings = { value: '#FFFFFF' };\n }\n break;\n\n default:\n inputs = [{\n backText: oidUnit || '',\n frontText: 'with',\n nameRender: 'renderText',\n defaultValue: '',\n attr: 'value'\n }];\n break;\n }\n\n if (isAllTriggersOnState) {\n inputs.unshift({\n backText: 'use trigger value',\n nameRender: 'renderCheckbox',\n attr: 'useTrigger',\n });\n }\n }\n\n return { inputs, newSettings: settings };\n }\n\n onTagChange(tagCard, cb, ignore, toggle, useTrigger) {\n useTrigger = useTrigger === undefined ? this.state.settings.useTrigger : useTrigger;\n const { inputs, newSettings } = this._setInputs(useTrigger, toggle);\n inputs.unshift({\n nameRender: 'renderObjectID',\n attr: 'oid',\n defaultValue: '',\n checkReadOnly: true,\n });\n\n this.setState({ inputs }, () =>\n super.onTagChange(null, () => {\n if (newSettings) {\n const settings = JSON.parse(JSON.stringify(this.state.settings));\n Object.assign(settings, newSettings);\n this.setState(settings);\n this.props.onChange(settings);\n }\n }));\n }\n\n onValueChanged(value, attr, context) {\n this.onTagChange(undefined, undefined, undefined, attr === 'toggle' ? value : undefined, attr === 'useTrigger' ? value : undefined);\n }\n\n onUpdate() {\n this.onTagChange();\n }\n\n static getStaticData() {\n return {\n acceptedBy: 'actions',\n name: 'Set state action',\n id: 'ActionSetState',\n icon: 'PlayForWork',\n tagCardArray: ['control', 'update'],\n title: 'Control or update some state',\n helpDialog: 'You can use %s in the value to use the current trigger value or %id to display the triggered object ID',\n }\n }\n\n getData() {\n return ActionSetState.getStaticData();\n }\n}\n\nexport default withStyles(styles)(ActionSetState);\n","import GenericBlock from '../GenericBlock';\n\nclass ActionExec extends GenericBlock {\n constructor(props) {\n super(props, ActionExec.getStaticData());\n }\n\n static compile(config, context) {\n return `// exec \"${config.exec}\"\n\\t\\tconst subActionVar${config._id} = \"${(config.exec || '').replace(/\"/g, '\\\\\"')}\"${GenericBlock.getReplacesInText(context)};\n\\t\\t_sendToFrontEnd(${config._id}, {exec: subActionVar${config._id}});\n\\t\\tconsole.log(subActionVar${config._id});`;\n }\n\n renderDebug(debugMessage) {\n return `Exec: ${debugMessage.data.exec}`;\n }\n\n onTagChange(tagCard) {\n this.setState({\n inputs: [\n {\n nameRender: 'renderModalInput',\n attr: 'exec',\n defaultValue: 'ls /opt/iobroker',\n nameBlock: 'Shell command',\n }\n ]\n }, () => super.onTagChange(tagCard));\n }\n\n static getStaticData() {\n return {\n acceptedBy: 'actions',\n name: 'Exec',\n id: 'ActionExec',\n icon: 'Apps',\n title: 'Executes some shell command',\n helpDialog: 'You can use %s in the command to use current trigger value or %id to use the triggered object ID',\n }\n }\n\n getData() {\n return ActionExec.getStaticData();\n }\n}\n\nexport default ActionExec;\n","import GenericBlock from '../GenericBlock';\n\nclass ActionHTTPCall extends GenericBlock {\n constructor(props) {\n super(props, ActionHTTPCall.getStaticData());\n }\n\n static compile(config, context) {\n return `// HTTP request ${config.url}\n\\t\\tconst subActionVar${config._id} = \"${(config.url || '').replace(/\"/g, '\\\\\"')}\"${GenericBlock.getReplacesInText(context)};\n\\t\\t_sendToFrontEnd(${config._id}, {url: subActionVar${config._id}});\n\\t\\trequest(subActionVar${config._id});`;\n }\n\n renderDebug(debugMessage) {\n return `URL: ${debugMessage.data.url}`;\n }\n\n onTagChange(tagCard) {\n this.setState({\n inputs: [\n {\n nameRender: 'renderModalInput',\n attr: 'url',\n defaultValue: 'http://mydevice.com?...',\n nameBlock: 'URL',\n }\n ]\n }, () => super.onTagChange(tagCard));\n }\n\n static getStaticData() {\n return {\n acceptedBy: 'actions',\n name: 'HTTP Call',\n id: 'ActionHTTPCall',\n icon: 'Language',\n title: 'Make a HTTP get request',\n helpDialog: 'You can use %s in the URL to use current trigger value or %id to use the triggered object ID',\n }\n }\n\n getData() {\n return ActionHTTPCall.getStaticData();\n }\n}\n\nexport default ActionHTTPCall;\n","import GenericBlock from '../GenericBlock';\nimport { I18n } from '@iobroker/adapter-react-v5';\n\nclass ActionPrintText extends GenericBlock {\n constructor(props) {\n super(props, ActionPrintText.getStaticData());\n }\n\n static compile(config, context) {\n return `// Log ${config.text}\n\\t\\tconst subActionVar${config._id} = \"${(config.text || '').replace(/\"/g, '\\\\\"')}\"${GenericBlock.getReplacesInText(context)};\n\\t\\t_sendToFrontEnd(${config._id}, {text: subActionVar${config._id}});\n\\t\\tconsole.log(subActionVar${config._id});`;\n }\n\n renderDebug(debugMessage) {\n return I18n.t('Log: %s', debugMessage.data.text);\n }\n\n onTagChange(tagCard) {\n this.setState({\n inputs: [\n {\n nameRender: 'renderModalInput',\n attr: 'text',\n defaultValue: 'My device triggered',\n nameBlock: 'Log text',\n }\n ]\n }, () => super.onTagChange(tagCard));\n }\n\n static getStaticData() {\n return {\n acceptedBy: 'actions',\n name: 'Log text',\n id: 'ActionPrintText',\n icon: 'Subject',\n title: 'Print some text in log',\n helpDialog: 'You can use %s in the text to display current trigger value or %id to display the triggered object ID',\n }\n }\n\n getData() {\n return ActionPrintText.getStaticData();\n }\n}\n\nexport default ActionPrintText;\n","import GenericBlock from '../GenericBlock';\nimport I18n from \"@iobroker/adapter-react-v5/i18n\";\n\nclass ActionPause extends GenericBlock {\n constructor(props) {\n super(props, ActionPause.getStaticData());\n }\n\n static compile(config, context) {\n const ms = config.unit === 'ms' ? 1 : (config.unit === 's' ? 1000 : (config.unit === 'm' ? 60000 : 3600000))\n\n return `// pause for ${ms}ms\n\\t\\t_sendToFrontEnd(${config._id}, {paused: true});\\n\n\\t\\tawait wait(${config.pause} * ${ms});\\n\n\\t\\t_sendToFrontEnd(${config._id}, {paused: false});`;\n }\n\n renderDebug(debugMessage) {\n return I18n.t('Paused: %s', debugMessage.data.paused);\n }\n\n _getOptions(pause) {\n pause = pause === undefined ? this.state.settings.pause : pause;\n if (pause === 1 || pause === '1') {\n return [\n { value: 'ms', title: 'millisecond' },\n { value: 's', title: 'second' },\n { value: 'm', title: 'minute' },\n { value: 'h', title: 'hour' },\n ];\n } else {\n return [\n { value: 'ms', title: 'milliseconds' },\n { value: 's', title: 'seconds' },\n { value: 'm', title: 'minutes' },\n { value: 'h', title: 'hours' },\n ];\n }\n }\n\n _setInputs(pause) {\n this.setState({\n inputs: [\n {\n nameRender: 'renderNumber',\n attr: 'pause',\n defaultValue: 100,\n noHelperText: true,\n },\n {\n nameRender: 'renderSelect',\n attr: 'unit',\n defaultValue: 'ms',\n options: this._getOptions(pause),\n },\n ]\n }, () => super.onTagChange());\n }\n\n onValueChanged(value, attr) {\n if (attr === 'pause') {\n this._setInputs(value);\n }\n }\n\n onTagChange(tagCard) {\n this._setInputs();\n }\n\n static getStaticData() {\n return {\n acceptedBy: 'actions',\n name: 'Pause',\n id: 'ActionPause',\n icon: 'Pause',\n title: 'Make a pause between actions',\n }\n }\n\n getData() {\n return ActionPause.getStaticData();\n }\n}\n\nexport default ActionPause;\n","import GenericBlock from '../GenericBlock';\nimport { I18n } from '@iobroker/adapter-react-v5';\n\nclass ActionFunction extends GenericBlock {\n constructor(props) {\n super(props, ActionFunction.getStaticData());\n }\n\n static compile(config, context) {\n const lines = (config.func || '')\n .split('\\n')\n .map((line, i) => ` ${line}`);\n\n lines.unshift(`\\t\\t_sendToFrontEnd(${config._id}, {func: 'executed'});`);\n lines.unshift(`// user function`);\n\n return lines.join('\\n');\n }\n\n renderDebug(debugMessage) {\n return I18n.t('Function: executed');\n }\n\n onTagChange(tagCard) {\n this.setState({\n inputs: [\n {\n nameRender: 'renderModalInput',\n attr: 'func',\n noTextEdit: true,\n defaultValue: 'console.log(\"Test\")',\n nameBlock: 'Function',\n }\n ]\n }, () => super.onTagChange(tagCard));\n }\n\n static getStaticData() {\n return {\n acceptedBy: 'actions',\n name: 'User function',\n id: 'ActionFunction',\n icon: 'Functions',\n title: 'Write your own code',\n helpDialog: 'This is advances option. You can write your own code here and it will be executed on trigger',\n }\n }\n\n getData() {\n return ActionFunction.getStaticData();\n }\n}\n\nexport default ActionFunction;\n","import GenericBlock from '../GenericBlock';\nimport { I18n } from '@iobroker/adapter-react-v5';\n\nclass ActionSetStateDelayed extends GenericBlock {\n constructor(props) {\n super(props, ActionSetStateDelayed.getStaticData());\n }\n\n isAllTriggersOnState() {\n return this.props.userRules?.triggers?.find(item => item.id === 'TriggerState') &&\n !this.props.userRules?.triggers?.find(item => item.id !== 'TriggerState');\n }\n\n static compile(config, context) {\n let value = config.value;\n if (config.useTrigger) {\n value = config.toggle ? '!obj.state.val' : 'obj.state.val';\n } else {\n if (value === undefined || value === null) {\n value = '';\n }\n\n if (typeof config.value === 'string' &&\n parseFloat(config.value).toString() !== config.value &&\n config.value !== 'true' &&\n config.value !== 'false'\n ) {\n value = `\"${value.replace(/\"/g, '\\\\\"')}\"${GenericBlock.getReplacesInText(context)}`;\n }\n }\n let v;\n if (config.toggle && !config.useTrigger) {\n v = `const subActionVar${config._id} = !(await getStateAsync(\"${config.oid}\")).val`;\n } else {\n v = `const subActionVar${config._id} = ${value}`;\n }\n\n return `// set delayed state ${config.oid} to ${config.toggle && !config.useTrigger ? 'toggle' : value} with delay of ${config.delay}ms\n\\t\\t${v};\n\\t\\t_sendToFrontEnd(${config._id}, {val: subActionVar${config._id}, ack: ${config.tagCard === 'update'}});\n\\t\\tsetStateDelayed(\"${config.oid}\", subActionVar${config._id}, ${config.tagCard === 'update'}, ${parseInt(config.delay, 10)}, ${config.clearRunning ? 'true' : 'false'});`;\n }\n\n static renderValue(val) {\n if (val === null) {\n return 'null';\n } else if (val === undefined) {\n return 'undefined';\n } else if (Array.isArray(val)) {\n return val.join(', ');\n } else if (typeof val === 'object') {\n return JSON.stringify(val);\n } else {\n return val.toString();\n }\n }\n\n renderDebug(debugMessage) {\n return {I18n.t('Set:')} {ActionSetStateDelayed.renderValue(debugMessage.data.val)};\n }\n\n _setInputs(useTrigger, toggle) {\n const isAllTriggersOnState = this.isAllTriggersOnState();\n\n toggle = toggle === undefined ? this.state.settings.toggle : toggle;\n useTrigger = useTrigger === undefined ? this.state.settings.useTrigger : useTrigger;\n let type = '';\n let options;\n const { oidType, oidUnit, oidStates, oidMax, oidMin, oidRole, oidWrite, oidStep } = this.state.settings;\n let settings;\n\n if (oidType) {\n if (oidType === 'number') {\n type = 'number';\n if (oidMax !== undefined && oidMin !== undefined) {\n type = 'slider';\n }\n } else if (oidType === 'boolean') {\n type = 'boolean';\n if (oidRole && oidRole.includes('button') && oidWrite) {\n type = 'button';\n }\n } else {\n type = '';\n if (oidRole && oidRole.includes('color')) {\n type = 'color';\n }\n }\n\n if (oidStates) {\n options = Object.keys(oidStates).map(val => ({ value: val, title: oidStates[val] }));\n type = 'select';\n }\n }\n let inputs;\n if (isAllTriggersOnState && useTrigger) {\n inputs = [\n {\n backText: 'use trigger value',\n nameRender: 'renderCheckbox',\n attr: 'useTrigger',\n defaultValue: false,\n },\n ];\n if (type === 'boolean') {\n inputs.push({\n backText: 'toggle value',\n attr: 'toggle',\n nameRender: 'renderCheckbox',\n defaultValue: false,\n });\n }\n } else {\n switch (type) {\n case 'number':\n inputs = [{\n backText: oidUnit || '',\n frontText: 'with',\n nameRender: 'renderNumber',\n defaultValue: oidMax === undefined ? 0 : oidMax,\n attr: 'value',\n }];\n if (this.state.settings.value !== undefined && isNaN(parseFloat(this.state.settings.value))) {\n settings = { value: oidMax === undefined ? 0 : oidMax };\n }\n break;\n\n case 'slider':\n inputs = [{\n nameRender: 'renderSlider',\n defaultValue: oidMax,\n min: oidMin,\n max: oidMax,\n unit: oidUnit,\n step: oidStep,\n attr: 'value',\n }];\n const f = parseFloat(this.state.settings.value);\n if (this.state.settings.value !== undefined &&\n (isNaN(f) || f < oidMin || f > oidMax)\n ) {\n settings = { value: oidMax };\n }\n break;\n\n case 'select':\n inputs = [{\n nameRender: 'renderSelect',\n frontText: 'with',\n options,\n defaultValue: options[0].value,\n attr: 'value',\n }];\n if (this.state.settings.value !== undefined && !options.find(item => item.value === this.state.settings.value)) {\n settings = { value: options[0].value };\n }\n break;\n\n case 'boolean':\n inputs = [\n {\n backText: 'toggle value',\n attr: 'toggle',\n nameRender: 'renderCheckbox',\n defaultValue: false,\n }\n ];\n if (!toggle) {\n inputs.push({\n backText: 'true',\n frontText: 'false',\n nameRender: 'renderSwitch',\n defaultValue: false,\n attr: 'value',\n });\n }\n\n if (this.state.settings.value !== undefined && this.state.settings.value !== false && this.state.settings.value !== true) {\n settings = { value: false };\n }\n break;\n\n case 'button':\n inputs = [{\n nameRender: 'renderButton',\n defaultValue: true,\n attr: 'value',\n }];\n if (this.state.settings.value !== undefined && this.state.settings.value !== true) {\n settings = { value: true };\n }\n break;\n\n case 'color':\n inputs = [{\n nameRender: 'renderColor',\n frontText: 'with',\n defaultValue: '#FFFFFF',\n attr: 'value',\n }];\n if (this.state.settings.value !== undefined &&\n (\n typeof this.state.settings.value !== 'string' ||\n (typeof this.state.settings.value.startsWith('#') &&\n typeof this.state.settings.value.startsWith('rgb'))\n )) {\n settings = { value: '#FFFFFF' };\n }\n break;\n\n default:\n inputs = [{\n backText: oidUnit || '',\n frontText: 'with',\n nameRender: 'renderText',\n defaultValue: '',\n attr: 'value',\n }];\n break;\n }\n if (isAllTriggersOnState) {\n inputs.unshift({\n backText: 'use trigger value',\n nameRender: 'renderCheckbox',\n attr: 'useTrigger',\n });\n }\n }\n\n inputs.push({\n backText: 'ms',\n frontText: 'Delay',\n nameRender: 'renderNumber',\n defaultValue: '1000',\n noHelperText: true,\n attr: 'delay',\n });\n inputs.push({\n backText: 'clear running',\n nameRender: 'renderCheckbox',\n defaultValue: true,\n attr: 'clearRunning',\n })\n\n return { inputs, newSettings: settings };\n }\n\n onTagChange(tagCard, cb, ignore, toggle, useTrigger) {\n useTrigger = useTrigger === undefined ? this.state.settings.useTrigger : useTrigger;\n const {inputs, newSettings} = this._setInputs(useTrigger, toggle);\n inputs.unshift({\n nameRender: 'renderObjectID',\n attr: 'oid',\n defaultValue: '',\n checkReadOnly: true,\n });\n\n this.setState({inputs}, () =>\n super.onTagChange(null, () => {\n if (newSettings) {\n const settings = JSON.parse(JSON.stringify(this.state.settings));\n Object.assign(settings, newSettings);\n this.setState(settings);\n this.props.onChange(settings);\n }\n }));\n }\n\n onValueChanged(value, attr, context) {\n this.onTagChange(undefined, undefined, undefined, attr === 'toggle' ? value : undefined, attr === 'useTrigger' ? value : undefined);\n }\n\n onUpdate() {\n this.onTagChange();\n }\n\n static getStaticData() {\n return {\n acceptedBy: 'actions',\n name: 'Set with delay',\n id: 'ActionSetStateDelayed',\n icon: 'PlayForWork',\n tagCardArray: ['control', 'update'],\n title: 'Control or update some state with delay',\n helpDialog: 'You can use %s in the value to use the current trigger value or %id to display the triggered object ID',\n }\n }\n\n getData() {\n return ActionSetStateDelayed.getStaticData();\n }\n}\n\nexport default ActionSetStateDelayed;\n","import GenericBlock from '../GenericBlock';\nimport { I18n } from '@iobroker/adapter-react-v5';\n\nclass ActionOperateStates extends GenericBlock {\n constructor(props) {\n super(props, ActionOperateStates.getStaticData());\n }\n\n isAllTriggersOnState() {\n return this.props.userRules?.triggers?.find(item => item.id === 'TriggerState') &&\n !this.props.userRules?.triggers?.find(item => item.id !== 'TriggerState');\n }\n\n static compile(config, context) {\n let oid1 = `const val2_${config._id} = (await getStateAsync(\"${config.oid1}\")).val;`;\n let oid2 = `const val1_${config._id} = (await getStateAsync(\"${config.oid2}\")).val;`;\n\n return `// ${config.oid1} ${config.operation} ${config.oid2} => ${config.oidResult}\n\\t\\t ${oid1}\n\\t\\t ${oid2}\n\\t\\t_sendToFrontEnd(${config._id}, {val: val1_${config._id} ${config.operation} val2_${config._id}, ack: ${config.tagCard === 'update'}});\n\\t\\tawait setStateAsync(\"${config.oidResult}\", val1_${config._id} ${config.operation} val2_${config._id}, ${config.tagCard === 'update'});`;\n }\n\n static renderValue(val) {\n if (val === null) {\n return 'null';\n } else if (val === undefined) {\n return 'undefined';\n } else if (Array.isArray(val)) {\n return val.join(', ');\n } else if (typeof val === 'object') {\n return JSON.stringify(val);\n } else {\n return val.toString();\n }\n }\n\n renderDebug(debugMessage) {\n return {I18n.t('Set:')} {ActionOperateStates.renderValue(debugMessage.data.val)};\n }\n\n onTagChange(tagCard, cb, ignore, toggle, useTrigger) {\n const inputs = [];\n\n inputs.push({\n nameRender: 'renderObjectID',\n title: 'ID1',\n attr: 'oid1',\n defaultValue: '',\n checkReadOnly: false,\n });\n\n inputs.push({\n nameRender: 'renderSelect',\n //frontText: 'with',\n options: [\n {value: '+', title: '+'},\n {value: '-', title: '-'},\n {value: '*', title: '*'},\n {value: '/', title: '/'},\n ],\n doNotTranslate: true,\n defaultValue: '+',\n attr: 'operation'\n });\n\n inputs.push({\n nameRender: 'renderObjectID',\n title: 'ID2',\n attr: 'oid2',\n defaultValue: '',\n checkReadOnly: false,\n });\n\n inputs.push({\n nameRender: 'renderNameText',\n defaultValue: 'store in',\n attr: 'textEqual',\n });\n\n inputs.push({\n nameRender: 'renderObjectID',\n attr: 'oidResult',\n defaultValue: '',\n checkReadOnly: true,\n });\n\n this.setState({inputs}, () => super.onTagChange(null, () => {\n const settings = JSON.parse(JSON.stringify(this.state.settings));\n this.props.onChange(settings);\n }));\n }\n\n onValueChanged(value, attr, context) {\n this.onTagChange(undefined, undefined, undefined, attr === 'toggle' ? value : undefined, attr === 'useTrigger' ? value : undefined);\n }\n\n onUpdate() {\n this.onTagChange();\n }\n\n static getStaticData() {\n return {\n acceptedBy: 'actions',\n name: 'Operate two states',\n id: 'ActionOperateStates',\n icon: 'AddBox',\n tagCardArray: ['control', 'update'],\n title: 'Operations with two states',\n }\n }\n\n getData() {\n return ActionOperateStates.getStaticData();\n }\n}\n\nexport default ActionOperateStates;\n","import TriggerScriptSave from '../Blocks/TriggerScriptSave';\nimport TriggerSchedule from '../Blocks/TriggerSchedule';\nimport TriggerState from '../Blocks/TriggerState';\nimport ConditionState from '../Blocks/ConditionState';\nimport ConditionTime from '../Blocks/ConditionTime';\nimport ConditionAstronomical from '../Blocks/ConditionAstronomical';\nimport ActionSetState from '../Blocks/ActionSetState';\nimport ActionExec from '../Blocks/ActionExec';\nimport ActionHTTPCall from '../Blocks/ActionHTTPCall';\nimport ActionPrintText from '../Blocks/ActionPrintText';\nimport ActionPause from '../Blocks/ActionPause';\nimport ActionFunction from '../Blocks/ActionFunction';\nimport ActionSetStateDelayed from '../Blocks/ActionSetStateDelayed';\nimport ActionOperateStates from '../Blocks/ActionOperateStates';\n\nconst StandardBlocks = [\n TriggerSchedule,\n TriggerScriptSave,\n TriggerState,\n ConditionState,\n ConditionTime,\n ConditionAstronomical,\n ActionSetState,\n ActionExec,\n ActionHTTPCall,\n ActionPrintText,\n ActionPause,\n ActionFunction,\n ActionSetStateDelayed,\n ActionOperateStates,\n];\n\nexport default StandardBlocks;","import React, {\n createContext,\n useEffect,\n useState,\n} from 'react';\n\nimport { I18n } from '@iobroker/adapter-react-v5';\n\nimport ActionSayText from '../Blocks/ActionSayText';\nimport ActionSendEmail from '../Blocks/ActionSendEmail';\nimport ActionTelegram from '../Blocks/ActionTelegram';\nimport ActionPushover from '../Blocks/ActionPushover';\nimport ActionWhatsappcmb from '../Blocks/ActionWhatsappcmb';\nimport ActionPushsafer from '../Blocks/ActionPushsafer';\nimport StandardBlocks from '../StandardBlocks';\n\nconst ADAPTERS = {\n telegram: ActionTelegram,\n email: ActionSendEmail,\n sayit: ActionSayText,\n pushover: ActionPushover,\n 'whatsapp-cmb': ActionWhatsappcmb,\n pushsafer: ActionPushsafer,\n};\n\nexport const ContextWrapperCreate = createContext();\n\nconst getOrLoadRemote = (remote, shareScope, remoteFallbackUrl = undefined) =>\n new Promise((resolve, reject) => {\n // check if remote exists on window\n if (!window[remote]) {\n // search dom to see if remote tag exists, but might still be loading (async)\n const existingRemote = document.querySelector(`[data-webpack=\"${remote}\"]`);\n // when remote is loaded...\n const onload = async () => {\n // check if it was initialized\n if (!window[remote]) {\n return reject(`Cannot load Remote \"${remote}\" to inject`);\n }\n if (!window[remote].__initialized) {\n // if share scope doesn't exist (like in webpack 4) then expect shareScope to be a manual object\n if (typeof __webpack_share_scopes__ === 'undefined') {\n // use default share scope object passed in manually\n await window[remote].init(shareScope.default);\n } else {\n // otherwise, init share scope as usual\n // eslint-disable-next-line\n await window[remote].init(__webpack_share_scopes__[shareScope]);\n }\n // mark remote as initialized\n window[remote].__initialized = true;\n }\n // resolve promise so marking remote as loaded\n resolve();\n };\n if (existingRemote) {\n // if existing remote but not loaded, hook into its onload and wait for it to be ready\n existingRemote.onload = onload;\n existingRemote.onerror = reject;\n // check if remote fallback exists as param passed to function\n // TODO: should scan public config for a matching key if no override exists\n } else if (remoteFallbackUrl) {\n // inject remote if a fallback exists and call the same onload function\n const d = document;\n const script = d.createElement('script');\n script.type = 'text/javascript';\n // mark as data-webpack so runtime can track it internally\n script.setAttribute('data-webpack', `${remote}`);\n script.async = true;\n script.onerror = reject;\n script.onload = onload;\n script.src = remoteFallbackUrl;\n d.getElementsByTagName('head')[0].appendChild(script);\n } else {\n // no remote and no fallback exist, reject\n reject(`Cannot Find Remote ${remote} to inject`);\n }\n } else {\n // remote already instantiated, resolve\n resolve();\n }\n });\n\nconst loadComponent = (remote, sharedScope, module, url) => async () => {\n await getOrLoadRemote(remote, sharedScope, url);\n const container = window[remote];\n const factory = await container.get(module);\n const Module = factory();\n return Module;\n};\n\nexport const ContextWrapper = ({ children, socket }) => {\n const [blocks, setBlocks] = useState(null);\n const [onUpdate, setOnUpdate] = useState(false);\n const [onDebugMessage, setOnDebugMessage] = useState(false);\n const [enableSimulation, setEnableSimulation] = useState(false);\n\n useEffect(() => {\n onUpdate && setOnUpdate(false);\n }, [onUpdate]);\n\n useEffect(() => {\n (async () => {\n const instances = await socket.getAdapterInstances();\n const adapters = Object.keys(ADAPTERS).filter(adapter =>\n instances.find(obj => obj?.common?.name === adapter));\n\n const adapterDynamicBlocksArray = [];\n\n // find all adapters, that have custom rule blocks\n const dynamicRules = instances.filter(obj => obj.common.javascriptRules);\n\n const alreadyCreated = [];\n for (let k in dynamicRules) {\n const obj = dynamicRules[k];\n if (alreadyCreated.includes(obj.common.name)) {\n continue;\n }\n\n let url;\n if (obj.common.javascriptRules.url.startsWith('http:') || obj.common.javascriptRules.url.startsWith('https:')) {\n url = obj.common.javascriptRules.url;\n } else if (obj.common.javascriptRules.url.startsWith('./')) {\n url = `${window.location.protocol}//${window.location.host}${obj.common.javascriptRules.url.replace(/^\\./, '')}`;\n } else {\n url = `${window.location.protocol}//${window.location.host}/adapter/${obj.common.name}/${obj.common.javascriptRules.url}`;\n }\n\n if (obj.common.javascriptRules.i18n === true) {\n // load i18n from files\n const pos = url.lastIndexOf('/');\n let i18nURL;\n if (pos !== -1) {\n i18nURL = url.substring(0, pos);\n } else {\n i18nURL = url;\n }\n const lang = I18n.getLanguage();\n const file = `${i18nURL}/i18n/${lang}.json`;\n\n await fetch(file)\n .then(data => data.json())\n .then(json => I18n.extendTranslations(json, lang))\n .catch(error => {\n if (lang !== 'en') {\n // try to load english\n return fetch(`${i18nURL}/i18n/en.json`)\n .then(data => data.json())\n .then(json => I18n.extendTranslations(json, lang))\n .catch(error => console.error(`Cannot load i18n \"${file}\": ${error}`))\n } else {\n console.log(`Cannot load i18n \"${file}\": ${error}`)\n }\n });\n } else if (obj.common.javascriptRules.i18n && typeof obj.common.javascriptRules.i18n === 'object') {\n try {\n I18n.extendTranslations(obj.common.javascriptRules.i18n);\n } catch (error) {\n console.error(`Cannot import i18n for \"${obj.common.javascriptRules.name}\": ${error}`);\n }\n }\n\n try {\n const Component = (await loadComponent(obj.common.javascriptRules.name, 'default', `./${obj.common.javascriptRules.name}`, url)()).default;\n\n if (Component) {\n adapterDynamicBlocksArray.push(Component);\n alreadyCreated.push(obj.common.name);\n ADAPTERS[obj.common.name] = null;\n }\n } catch (e) {\n console.error(`Cannot load component \"${obj.common.javascriptRules.name}\": ${e}`);\n }\n }\n\n const adapterBlocksArray = adapters.filter(adapter => ADAPTERS[adapter]).map(adapter => ADAPTERS[adapter]);\n\n setBlocks([...StandardBlocks, ...adapterBlocksArray, ...adapterDynamicBlocksArray]);\n })();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return \n {children}\n ;\n};","import React, {memo, useCallback, useContext, useEffect, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport cls from './style.module.scss';\nimport { deepCopy } from '../../helpers/deepCopy';\nimport { filterElement } from '../../helpers/filterElement';\nimport { ContextWrapperCreate } from '../ContextWrapper';\nimport { findElement } from '../../helpers/findElement';\nimport GenericBlock from '../GenericBlock';\n\n// @iobroker/javascript-block\n\nconst CurrentItem = memo(props => {\n const { setUserRules, userRules, _id, id, blockValue, active, acceptedBy, isTourOpen, setTourStep, tourStep } = props;\n const [anchorEl, setAnchorEl] = useState(null);\n const { blocks, socket, onUpdate, setOnUpdate, onDebugMessage, enableSimulation } = useContext(ContextWrapperCreate);\n\n useEffect(() => {\n console.log('New message !!' + JSON.stringify(onDebugMessage));\n }, [onDebugMessage]);\n\n\n const findElementBlocks = useCallback(id => blocks.find(el => {\n const staticData = el.getStaticData();\n return staticData.id === id;\n }), [blocks]);\n\n const onChange = useCallback(settings => {\n let newUserRules = findElement(settings, userRules, blockValue);\n newUserRules && setUserRules(newUserRules);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [userRules]);\n\n const handlePopoverOpen = event =>\n event.currentTarget !== anchorEl && setAnchorEl(event.currentTarget);\n\n const handlePopoverClose = () =>\n setAnchorEl(null);\n\n const blockInput = useMemo(() => {\n const CustomBlock = findElementBlocks(id) || GenericBlock;\n return ;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [userRules, onUpdate, onDebugMessage, enableSimulation]);\n\n const [isDelete, setIsDelete] = useState(false);\n\n return {\n if (el.ctrlKey) {\n let newItem;\n let newUserRules = deepCopy(acceptedBy, userRules, blockValue);\n if (blockValue !== \"triggers\") {\n newItem = newUserRules[acceptedBy][blockValue].find(el => el._id === _id);\n } else {\n newItem = newUserRules[acceptedBy].find(el => el._id === _id);\n }\n if (blockValue !== \"triggers\") {\n newUserRules[acceptedBy][blockValue].splice(newUserRules[acceptedBy][blockValue].indexOf(newItem), 0, { ...newItem, _id: Date.now() });\n } else {\n newUserRules[acceptedBy].splice(newUserRules[acceptedBy].indexOf(newItem), 0, { ...newItem, _id: Date.now() });\n }\n setUserRules(newUserRules);\n }\n }}\n id=\"height\"\n style={active ? { width: document.getElementById('width').clientWidth - 70 } : null}\n className={`${cls.cardStyle} ${active ? cls.cardStyleActive : null} ${isDelete ? cls.isDelete : null}`}>\n
\n {blockInput}\n {setUserRules &&
\n
{\n let newItemsSwitches = deepCopy(acceptedBy, userRules, blockValue);\n newItemsSwitches = filterElement(acceptedBy, newItemsSwitches, blockValue, _id);\n setIsDelete(true);\n setTimeout(() => {\n if (acceptedBy === 'triggers') {\n setOnUpdate(true);\n }\n setUserRules(newItemsSwitches);\n }, 300);\n }} className={cls.closeBtn} />\n
}\n
;\n});\n\nCurrentItem.defaultProps = {\n active: false\n};\n\nCurrentItem.propTypes = {\n name: PropTypes.oneOfType([PropTypes.string, PropTypes.object])\n};\n\nexport default CurrentItem;","export function findElement(settings, userRules, additionalParameter) {\n const { _id, acceptedBy } = settings;\n let block;\n\n if (!acceptedBy || !userRules[acceptedBy]) {\n console.warn('Cannot find ' + acceptedBy);\n return userRules;\n }\n\n switch (acceptedBy) {\n case 'actions':\n block = userRules[acceptedBy][additionalParameter].find(el => el._id === _id);\n if (!block) {\n console.warn('Cannot find ' + _id);\n } else {\n userRules[acceptedBy][additionalParameter][userRules[acceptedBy][additionalParameter].indexOf(block)] = settings;\n }\n return userRules;\n case 'conditions':\n block = userRules[acceptedBy][additionalParameter].find(el => el._id === _id);\n if (!block) {\n console.warn('Cannot find ' + _id);\n } else {\n userRules[acceptedBy][additionalParameter][userRules[acceptedBy][additionalParameter].indexOf(block)] = settings;\n }\n return userRules;\n default:\n block = userRules[acceptedBy].find(el => el._id === _id);\n if (!block) {\n console.warn('Cannot find ' + _id);\n } else {\n userRules[acceptedBy][userRules[acceptedBy].indexOf(block)] = settings;\n }\n return userRules;\n }\n}","import React from 'react';\nimport { useDragLayer } from 'react-dnd';\nimport CardMenu from '../CardMenu';\nimport CurrentItem from '../CurrentItem';\n\nconst layerStyles = {\n position: 'fixed',\n pointerEvents: 'none',\n zIndex: 100,\n left: 0,\n top: 0,\n width: '100%',\n height: '100%'\n};\n\nconst snapToGrid = (x, y) => {\n const snappedX = Math.round(x / 32) * 32\n const snappedY = Math.round(y / 32) * 32\n return [snappedX, snappedY]\n}\n\nconst getItemStyles = (initialOffset, currentOffset, isSnapToGrid) => {\n if (!initialOffset || !currentOffset) {\n return {\n display: 'none'\n };\n }\n let { x, y } = currentOffset;\n if (isSnapToGrid) {\n x -= initialOffset.x;\n y -= initialOffset.y;\n [x, y] = snapToGrid(x, y);\n x += initialOffset.x;\n y += initialOffset.y;\n }\n const transform = `translate(${x}px, ${y}px)`;\n return {\n transform,\n WebkitTransform: transform\n };\n}\n\nexport const CustomDragLayer = props => {\n const {\n itemType,\n isDragging,\n item,\n initialOffset,\n currentOffset,\n targetIds\n } = useDragLayer(monitor => ({\n item: monitor.getItem(),\n itemType: monitor.getItemType(),\n initialOffset: monitor.getInitialSourceClientOffset(),\n currentOffset: monitor.getSourceClientOffset(),\n isDragging: monitor.isDragging(),\n targetIds: monitor.getTargetIds()\n }));\n\n const renderItem = () => {\n switch (itemType) {\n case 'box':\n return targetIds.length ?
:\n ;\n default:\n return null;\n }\n }\n\n if (!isDragging) {\n return null;\n }\n\n return \n
\n {renderItem()}\n
\n
;\n};\n","// extracted by mini-css-extract-plugin\nexport default {\"border\":\"style_border__Zz9Km\",\"emptyBlockStyle\":\"style_emptyBlockStyle__sE5FO\",\"emptyBlock\":\"style_emptyBlock__dMBHS\",\"marginTop\":\"style_marginTop__uK9O+\",\"selectOnChange\":\"style_selectOnChange__6r-uo\",\"selectOnChangeHelp\":\"style_selectOnChangeHelp__nP0g8\",\"selectOnChangeHelpIcon\":\"style_selectOnChangeHelpIcon__r7G9x\",\"emptyBlockNone\":\"style_emptyBlockNone__DS6GG\",\"mainBlockItemRules\":\"style_mainBlockItemRules__JYCaQ\",\"nameBlockItems\":\"style_nameBlockItems__sNeEH\",\"contentBlockItem\":\"style_contentBlockItem__SQejW\",\"wrapperMargin\":\"style_wrapperMargin__v8PwE\",\"contentHeightOn\":\"style_contentHeightOn__T3ZZ-\",\"heightBlock\":\"style_heightBlock__B96p1\",\"contentHeightOff\":\"style_contentHeightOff__eaSlV\",\"cardAdd\":\"style_cardAdd__SNY3P\",\"blockCardAdd\":\"style_blockCardAdd__xHdXK\",\"addClassOverflow\":\"style_addClassOverflow__bcVva\",\"addClassHeight\":\"style_addClassHeight__GJALi\"};","import * as React from 'react';\n\nexport function useStateLocal(events, nameEvents) {\n const [state, setState] = React.useState(\n localStorage.getItem(nameEvents) ? JSON.parse(localStorage.getItem(nameEvents)) : events\n );\n\n const eventsToInstall = (newHeadCells) => {\n localStorage.setItem(nameEvents, JSON.stringify(newHeadCells));\n setState(newHeadCells);\n };\n return [state, eventsToInstall, localStorage.getItem(nameEvents) ? true : false];\n}\n","import _ from \"lodash\";\n\nconst funcSet = _.throttle(\n (setCards, userRules) => setCards(userRules)\n , 0);\n\nconst moveCard = (\n id,\n atIndex,\n cards,\n setCards,\n userRules,\n acceptedBy,\n additionally,\n hoverClientY,\n hoverMiddleY) => {\n\n const { card, index } = findCard(id, cards);\n if (index < atIndex && hoverClientY < hoverMiddleY) {\n return;\n }\n if (index > atIndex && hoverClientY > hoverMiddleY) {\n return;\n }\n if (card && index !== atIndex) {\n const copyCard = _.clone(cards);\n copyCard.splice(index, 1);\n copyCard.splice(atIndex, 0, card);\n const newTriggers = _.clone(userRules);\n switch (acceptedBy) {\n case 'actions':\n newTriggers[acceptedBy][additionally] = copyCard;\n funcSet(setCards, newTriggers);\n return;\n case 'conditions':\n newTriggers[acceptedBy][additionally] = copyCard;\n funcSet(setCards, newTriggers);\n return;\n default:\n newTriggers[acceptedBy] = copyCard;\n funcSet(setCards, newTriggers);\n return;\n }\n }\n};\nconst findCard = (id, cards) => {\n const card = cards.find((c) => c._id === id);\n return {\n card,\n index: cards.indexOf(card),\n };\n};\n\nexport { moveCard, findCard };","// extracted by mini-css-extract-plugin\nexport default {\"drag\":\"style_drag__Gq61w\",\"root\":\"style_root__nSnEB\"};","import React, { useContext, useEffect, useRef } from 'react';\n// import { I18n } from '@iobroker/adapter-react-v5';\nimport PropTypes from 'prop-types';\nimport { useDrag, useDrop } from 'react-dnd';\nimport { getEmptyImage } from 'react-dnd-html5-backend';\nimport { deepCopy } from '../../helpers/deepCopy';\nimport { filterElement } from '../../helpers/filterElement';\nimport { findCard, moveCard } from '../../helpers/cardSort';\nimport { ContextWrapperCreate } from '../ContextWrapper';\nimport cls from './style.module.scss';\n\nconst DragWrapper = ({ typeBlocks, allProperties, id, isActive, setUserRules, userRules, children, _id, blockValue }) => {\n const { setOnUpdate } = useContext(ContextWrapperCreate);\n const [{ opacity }, drag, preview] = useDrag({\n type: 'box',\n item: () => ({ ...allProperties, id, isActive, _id }),\n end: (item, monitor) => {\n let { acceptedBy } = item;\n let dropResult = monitor.getDropResult();\n let newUserRules;\n if (!dropResult) {\n if (typeof _id === 'number' && !monitor.getTargetIds().length) {\n newUserRules = deepCopy(acceptedBy, userRules, blockValue);\n newUserRules = filterElement(acceptedBy, newUserRules, blockValue, _id);\n setUserRules(newUserRules);\n }\n return null;\n }\n if (dropResult.blockValue !== blockValue) {\n let idNumber = typeof _id === 'number' ? _id : Date.now();\n newUserRules = deepCopy(acceptedBy, userRules, dropResult.blockValue);\n const newItem = { id: item.id, acceptedBy: item.acceptedBy }\n switch (acceptedBy) {\n case 'actions':\n if (blockValue) {\n newUserRules = filterElement(acceptedBy, newUserRules, blockValue, _id);\n }\n newUserRules = filterElement(acceptedBy, newUserRules, dropResult.blockValue, _id);\n newUserRules[acceptedBy][dropResult.blockValue].push({ ...newItem, _id: idNumber });\n return setUserRules(newUserRules);\n\n case 'conditions':\n if (typeof blockValue === 'number') {\n newUserRules = filterElement(acceptedBy, newUserRules, blockValue, _id);\n }\n newUserRules = filterElement(acceptedBy, newUserRules, dropResult.blockValue, _id);\n newUserRules[acceptedBy][dropResult.blockValue].push({ ...newItem, _id: idNumber });\n return setUserRules(newUserRules);\n\n default:\n setOnUpdate(true);\n newUserRules = filterElement(acceptedBy, newUserRules, dropResult.blockValue, _id);\n newUserRules[acceptedBy].push({ ...newItem, _id: idNumber });\n return setUserRules(newUserRules);\n }\n }\n },\n collect: monitor => ({\n opacity: monitor.isDragging() ? 0.4 : 1,\n isDragging: monitor.isDragging(),\n }),\n });\n const ref = useRef(null)\n const [, drop] = useDrop({\n accept: 'box',\n canDrop: () => false,\n hover({ _id: draggedId, acceptedBy }, monitor) {\n if (!ref.current) {\n return;\n }\n if (typeBlocks !== acceptedBy) {\n return\n }\n const hoverBoundingRect = ref.current?.getBoundingClientRect();\n const hoverMiddleY = (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2;\n const clientOffset = monitor.getClientOffset();\n const hoverClientY = clientOffset.y - hoverBoundingRect.top;\n\n if (!!_id && draggedId !== _id) {\n switch (acceptedBy) {\n case 'actions':\n if (blockValue === 'then' || blockValue === 'else') {\n const { index: overIndexActions } = findCard(_id, userRules[acceptedBy][blockValue]);\n if (overIndexActions !== draggedId) {\n moveCard(draggedId,\n overIndexActions,\n userRules[acceptedBy][blockValue],\n setUserRules,\n userRules,\n acceptedBy,\n blockValue,\n hoverClientY,\n hoverMiddleY\n );\n }\n }\n return;\n case 'conditions':\n if (typeof blockValue === 'number') {\n const { index: overIndexConditions } = findCard(_id, userRules[acceptedBy][blockValue]);\n if (overIndexConditions !== draggedId) {\n moveCard(draggedId,\n overIndexConditions,\n userRules[acceptedBy][blockValue],\n setUserRules,\n userRules,\n acceptedBy,\n blockValue,\n hoverClientY,\n hoverMiddleY\n );\n }\n }\n return;\n default:\n const { index: overIndex } = findCard(_id, userRules[acceptedBy]);\n if (overIndex !== draggedId) {\n moveCard(draggedId,\n overIndex,\n userRules[acceptedBy],\n setUserRules,\n userRules,\n acceptedBy,\n null,\n hoverClientY,\n hoverMiddleY\n );\n }\n return;\n }\n }\n }\n });\n useEffect(() => {\n preview(getEmptyImage(), { captureDraggingState: true });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n drag(drop(ref));\n const isMobile = window.innerWidth < 600;\n return ;\n}\n\nDragWrapper.defaultProps = {\n name: '',\n active: false,\n id: '',\n _id: null\n};\n\nDragWrapper.propTypes = {\n name: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),\n};\n\nexport default DragWrapper;","import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\n\nimport IconOk from '@mui/icons-material/Check';\n\nimport { I18n } from '@iobroker/adapter-react-v5';\n\nconst DialogHelp = ({ onClose, open }) => ;\n\nDialogHelp.defaultProps = {\n open: false,\n onClose: () => { }\n};\n\nDialogHelp.propTypes = {\n open: PropTypes.bool,\n onClose: PropTypes.func\n};\n\nexport default DialogHelp;","import React from 'react';\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogContentText from '@mui/material/DialogContentText';\nimport { I18n } from '@iobroker/adapter-react-v5';\nimport PropTypes from 'prop-types';\n\nconst DialogCondition = ({ onClose, open }) => ;\n\nDialogCondition.defaultProps = {\n open: false,\n onClose: () => { }\n};\n\nDialogCondition.propTypes = {\n open: PropTypes.bool,\n onClose: PropTypes.func\n};\n\nexport default DialogCondition;","import React, { Fragment, useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { useDrop } from 'react-dnd';\n\nimport Select from '@mui/material/Select';\nimport MenuItem from '@mui/material/MenuItem';\nimport IconButton from '@mui/material/IconButton';\nimport IconHelp from '@mui/icons-material/HelpOutline';\n\nimport { I18n, Utils } from '@iobroker/adapter-react-v5';\n\nimport cls from './style.module.scss';\nimport { deepCopy } from '../../helpers/deepCopy';\nimport CurrentItem from '../CurrentItem';\nimport { useStateLocal } from '../../hooks/useStateLocal';\nimport DragWrapper from '../DragWrapper';\nimport MaterialDynamicIcon from '../../helpers/MaterialDynamicIcon';\nimport DialogHelp from './DialogHelp';\nimport DialogCondition from './DialogCondition';\n\nconst AdditionallyContentBlockItems = ({ size, itemsSwitchesRender, blockValue, boolean, typeBlock, userRules, setUserRules, animation, setTourStep, tourStep, isTourOpen }) => {\n const [checkItem, setCheckItem] = useState(false);\n const [canDropCheck, setCanDropCheck] = useState(false);\n const [checkId, setCheckId] = useState(false);\n const [hoverBlock, setHoverBlock] = useState('');\n\n const options = useDrop({\n accept: 'box',\n drop: () => ({ blockValue }),\n hover: ({ acceptedBy, _id }, monitor) => {\n setCheckItem(acceptedBy === typeBlock);\n setCheckId(!!_id);\n setHoverBlock(monitor.getHandlerId());\n },\n canDrop: ({ acceptedBy }, monitor) => {\n setCanDropCheck(acceptedBy === typeBlock);\n return acceptedBy === typeBlock;\n },\n collect: monitor => ({\n isOver: monitor.isOver(),\n canDrop: monitor.getItem()?.acceptedBy === typeBlock,\n offset: monitor.getClientOffset(),\n targetId: monitor.targetId\n }),\n });\n\n const [{ canDrop, isOver, offset, targetId }, drop] = options;\n\n useEffect(() => { setHoverBlock('') }, [offset]);\n\n const isActive = canDrop && isOver;\n let backgroundColor = '';\n if (isActive) {\n backgroundColor = checkItem ? '#00fb003d' : '#fb00002e';\n } else if (canDrop) {\n backgroundColor = canDropCheck ? '#00fb003d' : '#fb00002e';\n } else if (offset) {\n backgroundColor = targetId === hoverBlock ? '#fb00002e' : '';\n }\n\n return \n
{itemsSwitchesRender[blockValue]?.map(el => (\n
\n \n ))}\n
\n
\n
;\n}\n\nAdditionallyContentBlockItems.defaultProps = {\n children: null,\n boolean: true,\n animation: false\n};\n\nconst ContentBlockItems = ({ size, typeBlock, name, nameAdditionally, additionally, border, userRules, setUserRules, iconName, adapter, socket, setTourStep, tourStep, isTourOpen }) => {\n const [additionallyClickItems, setAdditionallyClickItems, checkLocal] = useStateLocal(typeBlock === 'actions' ? false : [], `additionallyClickItems_${typeBlock}`);\n const [showHelp, setShowHelp] = useState(false);\n const [showConditionDialog, setShowConditionDialog] = useState(false);\n\n useEffect(() => {\n if (typeBlock === 'conditions' && additionallyClickItems.length !== userRules['conditions'].length - 1) {\n let newArray = [];\n userRules['conditions'].forEach((el, idx) => {\n if (idx > 0) {\n newArray.push({\n _id: Date.now(),\n open: true,\n });\n }\n });\n setAdditionallyClickItems([...additionallyClickItems, ...newArray]);\n }\n if (typeBlock === 'actions' && !checkLocal && userRules['actions']['else'].length) {\n setAdditionallyClickItems(true);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const [animation, setAnimation] = useState(false);\n\n return \n
\n {name}\n \n {typeBlock === 'conditions' ?\n
\n \n setShowHelp(true)}>\n \n \n
\n : null}\n
\n {additionally && [...Array(typeBlock === 'actions' ? 1 : userRules.conditions.length - 1)].map((e, index) => {\n const booleanAdditionally = (value = index) => Boolean(typeBlock === 'actions' ? additionallyClickItems : additionallyClickItems.find((el, idx) => idx === value && el.open));\n return
\n {\n if (typeBlock === 'actions') {\n setAdditionallyClickItems(!additionallyClickItems);\n return null;\n }\n let newAdditionally = JSON.parse(JSON.stringify(additionallyClickItems));\n if (userRules['conditions'][index + 1].length) {\n newAdditionally[index].open = !newAdditionally[index].open\n setAdditionallyClickItems(newAdditionally);\n return null;\n }\n newAdditionally = newAdditionally.filter((el, idx) => idx !== index);\n setAdditionallyClickItems(newAdditionally);\n setAnimation(typeBlock === 'actions' ? true : index);\n setTimeout(() => {\n setAnimation(false);\n setUserRules({ ...userRules, conditions: [...userRules.conditions.filter((el, idx) => idx !== index + 1)] });\n }, 250);\n\n }}\n key={index} className={cls.blockCardAdd}>\n {booleanAdditionally() ? '-' : '+'}
\n {nameAdditionally}\n
\n
\n \n \n })}\n {additionally && typeBlock === 'conditions' &&
{\n setAdditionallyClickItems([...additionallyClickItems, {\n _id: Date.now(),\n open: true\n }]);\n setUserRules({ ...userRules, conditions: [...userRules.conditions, []] });\n setAnimation(typeBlock === 'actions' ? true : userRules.conditions.length - 1);\n setTimeout(() => setAnimation(false), 1000);\n }}\n className={cls.blockCardAdd}\n >\n {'+'}\n
\n {nameAdditionally}\n
\n
}\n
setShowHelp(false)} />\n setShowConditionDialog(false)} />\n ;\n}\n\nContentBlockItems.defaultProps = {\n children: null,\n name: '',\n nameAdditionally: '',\n additionally: false,\n border: false,\n typeBlock: '',\n};\n\nContentBlockItems.propTypes = {\n name: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),\n nameAdditionally: PropTypes.string,\n border: PropTypes.bool,\n additionally: PropTypes.bool,\n children: PropTypes.object,\n typeBlock: PropTypes.string,\n blockValue: PropTypes.string,\n userRules: PropTypes.object,\n setUserRules: PropTypes.func,\n};\n\nexport default ContentBlockItems;","// extracted by mini-css-extract-plugin\nexport default {\"menuRules\":\"style_menuRules__NRFrw\",\"switchesRenderWrapper\":\"style_switchesRenderWrapper__MHBpo\",\"menuOff\":\"style_menuOff__GV8BN\",\"menuTitle\":\"style_menuTitle__bnI7K\",\"marginAuto\":\"style_marginAuto__h3I6J\",\"inputWidth\":\"style_inputWidth__Hkd3w\",\"menuWrapper\":\"style_menuWrapper__16zE-\",\"hamburgerWrapper\":\"style_hamburgerWrapper__+AsNg\",\"hamburgerOff\":\"style_hamburgerOff__Tmmok\",\"nothingFound\":\"style_nothingFound__hm0xN\",\"resetSearch\":\"style_resetSearch__oA8LS\",\"controlPanel\":\"style_controlPanel__ojI7Z\",\"controlPanelAppBar\":\"style_controlPanelAppBar__fjB3Y\",\"addClassMenu\":\"style_addClassMenu__3n58b\",\"addClassBackground\":\"style_addClassBackground__j1FHK\",\"addClassPosition\":\"style_addClassPosition__YL+W4\"};","import React from 'react';\nimport CardMenu from '.';\nimport { deepCopy } from '../../helpers/deepCopy';\nimport DragWrapper from '../DragWrapper';\nimport { STEPS } from '../../helpers/Tour';\n\nconst CustomDragItem = props => {\n const { allProperties, allProperties: { acceptedBy, id }, setUserRules, userRules, setTourStep, tourStep, isTourOpen, onTouchMove } = props;\n return \n {\n (isTourOpen &&\n tourStep === STEPS.addScheduleByDoubleClick &&\n id === 'TriggerScheduleBlock' &&\n setTourStep(STEPS.openTagsMenu)\n );\n (isTourOpen &&\n tourStep === STEPS.addActionPrintText &&\n id === 'ActionPrintText' &&\n setTourStep(STEPS.showJavascript)\n );\n let _id = Date.now();\n let blockValue;\n switch (acceptedBy) {\n case 'actions':\n blockValue = 'then';\n break;\n\n case 'conditions':\n blockValue = userRules[acceptedBy].length - 1;\n break;\n\n default:\n break;\n }\n let newUserRules = deepCopy(acceptedBy, userRules, blockValue);\n const newItem = { id, _id, acceptedBy };\n if (blockValue !== undefined) {\n newUserRules[acceptedBy][blockValue].push({ ...newItem });\n } else {\n newUserRules[acceptedBy].push({ ...newItem });\n }\n setUserRules(newUserRules);\n }} onDoubl {...props} {...allProperties} />\n ;\n}\n\nexport default CustomDragItem;","// extracted by mini-css-extract-plugin\nexport default {\"menu_wrapper\":\"hamburgerMenu_menu_wrapper__H+bSr\",\"hamburgerMenu\":\"hamburgerMenu_hamburgerMenu__zKaBW\",\"animate\":\"hamburgerMenu_animate__CjZxq\",\"menu_conatiner_wrapper\":\"hamburgerMenu_menu_conatiner_wrapper__9BkY3\"};","import React from 'react';\nimport cls from './hamburgerMenu.module.scss';\nimport PropTypes from 'prop-types';\n\nconst HamburgerMenu = ({boolean}) => {\n return \n}\n\nHamburgerMenu.defaultProps = {\n boolean: false\n};\n\nHamburgerMenu.propTypes = {\n boolean: PropTypes.bool\n};\n\nexport default HamburgerMenu;","import React, { Fragment, useContext, useEffect } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { AppBar, ClickAwayListener, Tab, Tabs } from '@mui/material';\n\nimport { I18n, Utils } from '@iobroker/adapter-react-v5';\n\nimport cls from './style.module.scss';\n\nimport CustomInput from '../CustomInput';\nimport CustomDragItem from '../CardMenu/CustomDragItem';\nimport HamburgerMenu from '../HamburgerMenu';\nimport { useStateLocal } from '../../hooks/useStateLocal';\nimport { ContextWrapperCreate } from '../ContextWrapper';\nimport MaterialDynamicIcon from '../../helpers/MaterialDynamicIcon';\nimport { STEPS } from '../../helpers/Tour';\n\nconst Menu = ({ addClass, setAllBlocks, allBlocks, userRules, onChangeBlocks, setTourStep, tourStep, isTourOpen }) => {\n // eslint-disable-next-line no-unused-vars\n const { blocks, socket } = useContext(ContextWrapperCreate);\n const [hamburgerOnOff, setHamburgerOnOff] = useStateLocal(false, 'hamburgerOnOff');\n const [filter, setFilter] = useStateLocal({\n text: '',\n type: 'triggers',\n index: 0\n }, 'filterControlPanel');\n\n const handleChange = (event, newValue) => {\n isTourOpen && (newValue === 0 && tourStep === STEPS.selectTriggers) && setTourStep(STEPS.addScheduleByDoubleClick);\n isTourOpen && (newValue === 2 && tourStep === STEPS.selectActions) && setTourStep(STEPS.addActionPrintText);\n setFilter({\n ...filter,\n index: newValue,\n type: ['triggers', 'conditions', 'actions'][newValue]\n });\n setBlocksFunc(filter.text, ['triggers', 'conditions', 'actions'][newValue]);\n };\n\n const setBlocksFunc = (text = filter.text, typeFunc = filter.type) => {\n if (!blocks) {\n return;\n }\n let newAllBlocks = [...blocks];\n newAllBlocks = newAllBlocks.filter(el => {\n if (!text) {\n return true;\n }\n const { name } = el.getStaticData();\n return name && I18n.t(name).toLowerCase().includes(text.toLowerCase());\n });\n newAllBlocks = newAllBlocks.filter(el => typeFunc === el.getStaticData().acceptedBy);\n setAllBlocks(newAllBlocks);\n };\n\n const a11yProps = index => ({\n id: `scrollable-force-tab-${index}`,\n 'aria-controls': `scrollable-force-tabpanel-${index}`\n });\n\n useEffect(() => {\n setBlocksFunc();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [blocks]);\n return setHamburgerOnOff(true)}\n >\n \n
setHamburgerOnOff(!hamburgerOnOff)}>\n
\n
\n
\n
\n \n }\n {...a11yProps(0)} />\n }\n {...a11yProps(1)} />\n }\n {...a11yProps(2)} />\n \n \n
\n
\n
\n {allBlocks.map(el => {\n const { name, id, icon, adapter } = el.getStaticData();\n return \n setHamburgerOnOff(true)}\n setTourStep={setTourStep}\n tourStep={tourStep}\n isTourOpen={isTourOpen}\n allProperties={el.getStaticData()}\n name={name}\n icon={icon}\n adapter={adapter}\n socket={socket}\n userRules={userRules}\n setUserRules={onChangeBlocks}\n isActive={false}\n id={id}\n />\n ;\n })}\n {allBlocks.length === 0 && \n {I18n.t('Nothing found')}...\n
{\n setFilter({\n ...filter,\n text: ''\n });\n setBlocksFunc('');\n }}>{I18n.t('reset search')}
\n
}\n \n
\n
\n
{\n setFilter({ ...filter, text: value });\n setBlocksFunc(value);\n }}\n />\n \n
\n ;\n}\n\nMenu.propTypes = {\n onChange: PropTypes.func,\n code: PropTypes.string\n};\n\nexport default Menu;\n","import React, { useCallback, useContext, useEffect, useRef, useState } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { I18n, Utils } from '@iobroker/adapter-react-v5';\n\nimport cls from './style.module.scss';\n\nimport { CustomDragLayer } from './components/CustomDragLayer';\nimport ContentBlockItems from './components/ContentBlockItems';\nimport { ContextWrapperCreate } from './components/ContextWrapper';\nimport Compile from './helpers/Compile';\nimport Menu from './components/Menu';\nimport './helpers/stylesVariables.scss';\n\nimport DialogExport from '../../Dialogs/Export';\nimport DialogImport from '../../Dialogs/Import';\n\nconst RulesEditor = ({ code, onChange, themeName, setTourStep, tourStep, isTourOpen, command, scriptId, changed, running }) => {\n // eslint-disable-next-line no-unused-vars\n const { blocks, socket, setOnUpdate, setOnDebugMessage, setEnableSimulation } = useContext(ContextWrapperCreate);\n const [allBlocks, setAllBlocks] = useState([]);\n const [userRules, setUserRules] = useState(Compile.code2json(code));\n const [importExport, setImportExport] = useState('');\n const [modal, setModal] = useState(false);\n //const [jsAlive, setJsAlive] = useState(false);\n //const [jsInstance, setJsInstance] = useState(false);\n\n useEffect(() => {\n let _jsInstance;\n let _jsAlive;\n const handler = (id, obj) => {\n if (id === _jsInstance + '.alive') {\n if (_jsAlive !== obj?.val) {\n _jsAlive = obj?.val;\n //setJsAlive(_jsAlive);\n _jsAlive && socket.sendTo(_jsInstance.replace(/^system\\.adapter\\./, ''), 'rulesOn', scriptId);\n }\n } else {\n if (_jsInstance !== obj?.common?.engine) {\n _jsInstance && socket.unsubscribeState(`${_jsInstance}.alive`, handler);\n _jsAlive && socket.sendTo(_jsInstance.replace(/^system\\.adapter\\./, ''), 'rulesOn', scriptId);\n _jsInstance = obj?.common?.engine;\n //setJsInstance(_jsInstance);\n _jsInstance && socket.subscribeState(`${_jsInstance}.alive`, handler);\n }\n }\n };\n\n const handlerStatus = (id, state) => {\n if (state) {\n try {\n let msg = JSON.parse(state.val);\n // if not from previous session\n if (msg.ruleId === scriptId && Date.now() - msg.ts < 1000) {\n setOnDebugMessage({blockId: msg.blockId, data: msg.data, ts: msg.ts});\n }\n } catch (e) {\n console.error('Cannot parse: ' + state.val);\n }\n }\n };\n\n socket.getObject(scriptId)\n .then(obj => {\n _jsInstance = obj?.common?.engine;\n //setJsInstance(_jsInstance);\n socket.subscribeObject(scriptId, handler);\n _jsInstance && socket.subscribeState(`${_jsInstance}.alive`, handler);\n _jsInstance && socket.subscribeState(_jsInstance.replace(/^system\\.adapter\\./, '') + '.debug.rules', handlerStatus);\n });\n\n return function cleanup() {\n _jsInstance && socket.unsubscribeObject(`${_jsInstance}.alive`, handler);\n socket.unsubscribeState(scriptId, handler);\n _jsAlive && _jsInstance && socket.sendTo(_jsInstance.replace(/^system\\.adapter\\./, ''), 'rulesOff', scriptId);\n _jsInstance && socket.unsubscribeState(_jsInstance.replace(/^system\\.adapter\\./, '') + '.debug.rules', handlerStatus);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n setEnableSimulation(!changed && running);\n }, [changed, running, setEnableSimulation]);\n\n useEffect(() => {\n if (!!command) {\n setImportExport(command);\n if (!modal) {\n setModal(true);\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [command]);\n\n useEffect(() => {\n const newUserRules = Compile.code2json(code);\n if (JSON.stringify(newUserRules) !== JSON.stringify(userRules)) {\n setUserRules(newUserRules);\n setOnUpdate(true);\n }\n // eslint-disable-next-line\n }, [code]);\n\n useEffect(() => {\n document.getElementsByTagName('HTML')[0].className = themeName || 'blue';\n }, [themeName]);\n\n const onChangeBlocks = useCallback(json => {\n setUserRules(json);\n onChange(Compile.json2code(json, blocks));\n }, [blocks, onChange]);\n\n const ref = useRef({ clientWidth: 0 });\n const [addClass, setAddClass] = useState({ 835: false, 1035: false });\n useEffect(() => {\n if (ref.current) {\n if (ref.current.clientWidth <= 1035) {\n setAddClass({ 835: false, 1035: true });\n }\n if (ref.current.clientWidth <= 835) {\n setAddClass({ 1035: true, 835: true });\n }\n if (ref.current.clientWidth > 1035) {\n setAddClass({ 835: false, 1035: false });\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [ref.current.clientWidth])\n\n if (!blocks) {\n return null;\n }\n\n return \n {
}\n {importExport === \"export\" ?\n
setModal(false)}\n open={modal}\n text={JSON.stringify(userRules, null, 2)} /> :\n {\n setModal(false);\n if (text) {\n onChangeBlocks(JSON.parse(text));\n }\n }} />}\n {\n
\n \n \n \n }\n ;\n}\n\nRulesEditor.propTypes = {\n onChange: PropTypes.func,\n code: PropTypes.string,\n scriptId: PropTypes.string,\n setTourStep: PropTypes.func,\n tourStep: PropTypes.number,\n command: PropTypes.string,\n themeType: PropTypes.string,\n themeName: PropTypes.string,\n searchText: PropTypes.string,\n resizing: PropTypes.bool,\n\n};\n\nexport default RulesEditor;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport withStyles from '@mui/styles/withStyles';\nimport ScriptEditorComponent from '../ScriptEditorVanilaMonaco';\n\nconst styles = theme => ({\n editorDiv: {\n height: '100%',\n width: '100%',\n overflow: 'hidden',\n position: 'relative'\n },\n editor: {\n width: '100%',\n height: '100%',\n overflow: 'auto',\n },\n line: {\n width: '100%',\n whiteSpace: 'nowrap',\n },\n lineNumber: {\n width: 40,\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n display: 'inline-block',\n fontFamily: 'Lucida Console, Courier, monospace',\n textAlign: 'right',\n fontSize: 14,\n marginRight: 1,\n borderRight: '1px solid #555',\n cursor: 'pointer'\n },\n lineBreakpoint: {\n background: '#330000',\n color: 'white',\n },\n lineCode: {\n //whiteSpace: 'nowrap',\n display: 'inline-block',\n fontFamily: 'Lucida Console, Courier, monospace',\n fontSize: 14,\n margin: 0,\n whiteSpace: 'pre',\n },\n lineCurrentCode: {\n background: 'red',\n color: 'white',\n },\n lineCurrent: {\n background: '#880000',\n color: 'white',\n },\n});\n\nclass Editor extends React.Component {\n constructor(props) {\n super(props);\n\n this.state = {\n lines: (this.props.script || '').split(/\\r\\n|\\n/)\n };\n }\n\n editorDidMount(editor, monaco) {\n this.monaco = monaco;\n this.editor = editor;\n editor.focus();\n }\n\n render() {\n return \n this.props.onToggleBreakpoint(i)}\n />\n
;\n }\n}\n\nEditor.propTypes = {\n runningInstances: PropTypes.object,\n socket: PropTypes.object,\n sourceId: PropTypes.string,\n script: PropTypes.string,\n scriptName: PropTypes.string,\n adapterName: PropTypes.string,\n paused: PropTypes.bool,\n breakpoints: PropTypes.array,\n location: PropTypes.object,\n themeType: PropTypes.string,\n themeName: PropTypes.string,\n onToggleBreakpoint: PropTypes.func,\n};\n\nexport default withStyles(styles)(Editor);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport withStyles from '@mui/styles/withStyles';\n\nimport IconButton from '@mui/material/IconButton';\n\nimport {\n MdContentCopy as IconCopy,\n MdDeleteForever as IconDelete,\n MdVerticalAlignBottom as IconBottom,\n} from 'react-icons/md';\n\nimport { I18n, Utils } from '@iobroker/adapter-react-v5';\n\nconst TOOLBOX_WIDTH = 34;\n\nconst styles = theme => ({\n consoleLine: {\n fontSize: 14,\n color: theme.palette.mode === 'dark' ? '#EEE' : '#222',\n },\n console_log: {\n\n },\n console_warn: {\n backgroundColor: theme.palette.mode === 'dark' ? '#885900' : '#ffa500',\n },\n console_error: {\n backgroundColor: theme.palette.mode === 'dark' ? '#7a0000' : '#FF0000',\n },\n console_debug: {\n opacity: 0.6,\n },\n consoleSeverity: {\n verticalAlign: 'top',\n width: 50,\n textTransform: 'uppercase',\n },\n consoleTime: {\n whiteSpace: 'nowrap',\n verticalAlign: 'top',\n width: 170,\n },\n consoleText: {\n fontFamily: 'Lucida Console, Courier, monospace',\n paddingTop: 4,\n '&>pre': {\n margin: 0,\n },\n },\n logBox: {\n width: '100%',\n height: '100%',\n position: 'relative',\n overflow: 'hidden',\n },\n logBoxInner: {\n display: 'inline-block',\n color: theme.palette.mode === 'dark' ? 'white' : 'black',\n width: `calc(100% - ${TOOLBOX_WIDTH}px)`,\n height: '100%',\n //marginLeft: TOOLBOX_WIDTH,\n overflow: 'auto',\n position: 'relative',\n verticalAlign: 'top',\n },\n info: {\n background: theme.palette.mode === 'dark' ? 'darkgrey' : 'lightgrey',\n color: theme.palette.mode === 'dark' ? 'black' : 'black',\n },\n error: {\n background: '#FF0000',\n color: theme.palette.mode === 'dark' ? 'black' : 'white',\n },\n warn: {\n background: '#FF8000',\n color: theme.palette.mode === 'dark' ? 'black' : 'white',\n },\n debug: {\n background: 'gray',\n opacity: 0.8,\n color: theme.palette.mode === 'dark' ? 'black' : 'white',\n },\n silly: {\n background: 'gray',\n opacity: 0.6,\n color: theme.palette.mode === 'dark' ? 'black' : 'white',\n },\n table: {\n fontFamily: 'monospace',\n width: '100%',\n },\n toolbox: {\n //position: 'absolute',\n //top: 0,\n //left: 0,\n //marginLeft: 2,\n width: TOOLBOX_WIDTH,\n height: '100%',\n 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)',\n display: 'inline-block',\n verticalAlign: 'top',\n overflow: 'hidden',\n },\n trTime: {\n width: 90,\n },\n trSeverity: {\n width: 40,\n fontWeight: 'bold',\n },\n iconButtons: {\n width: 32,\n height: 32,\n padding: 4,\n },\n});\n\nfunction getTimeString(d) {\n let text;\n let i = d.getHours();\n if (i < 10) {\n i = '0' + i.toString();\n }\n text = i + ':';\n\n i = d.getMinutes();\n if (i < 10) {\n i = '0' + i.toString();\n }\n text += i + ':';\n i = d.getSeconds();\n if (i < 10) {\n i = '0' + i.toString();\n }\n text += i + '.';\n i = d.getMilliseconds();\n if (i < 10) {\n i = '00' + i.toString();\n } else if (i < 100) {\n i = '0' + i.toString();\n }\n text += i;\n return text;\n}\n\nclass Console extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n lines: {},\n goBottom: true,\n };\n this.messagesEnd = React.createRef();\n }\n generateLine(message) {\n return \n {getTimeString(new Date(message.ts))} | \n {message.severity} | \n {message.text} | \n
;\n }\n renderLogList(lines) {\n if (lines && lines.length) {\n return \n
\n {lines.map((line, i) => this.generateLine(line))}
\n
\n
;\n } else {\n return {I18n.t('Log outputs')}
;\n }\n }\n\n onCopy() {\n Utils.copyToClipboard(this.props.console.join('\\n'));\n }\n\n scrollToBottom() {\n this.messagesEnd && this.messagesEnd.current && this.messagesEnd.current.scrollIntoView({behavior: 'smooth'});\n }\n\n componentDidUpdate() {\n this.state.goBottom && this.scrollToBottom();\n }\n\n render() {\n const lines = this.props.console;\n return (\n \n
\n this.setState({goBottom: !this.state.goBottom})}\n color={this.state.goBottom ? 'secondary' : ''}\n size=\"medium\">\n {lines && lines.length ? this.props.onClearAllLogs()}\n size=\"medium\"> : null}\n {lines && lines.length ? this.onCopy()}\n size=\"medium\"> : null}\n
\n {this.renderLogList(lines)}\n
\n );\n }\n}\n\nConsole.propTypes = {\n theme: PropTypes.object,\n onClearAllLogs: PropTypes.func,\n console: PropTypes.array,\n};\n\nexport default withStyles(styles)(Console);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport withStyles from '@mui/styles/withStyles';\nimport SplitterLayout from 'react-splitter-layout';\nimport ReactJson from 'react-json-view';\n\nimport ListItemButton from '@mui/material/ListItemButton';\nimport ListItemText from '@mui/material/ListItemText';\nimport Input from '@mui/material/Input';\nimport InputAdornment from '@mui/material/InputAdornment';\nimport IconButton from '@mui/material/IconButton';\nimport List from '@mui/material/List';\n\nimport { MdCheck as CheckIcon } from 'react-icons/md';\nimport { MdAdd as IconAdd } from 'react-icons/md';\nimport { MdDelete as IconDelete } from 'react-icons/md';\n\nimport { I18n, Utils } from '@iobroker/adapter-react-v5';\n\nconst styles = theme => ({\n frameRoot: {\n paddingTop: 0,\n paddingBottom: 0,\n },\n frameTextRoot: {\n margin: 0,\n },\n frameTextPrimary: {\n color: theme.palette.mode === 'dark' ? '#CCC' : '#333',\n },\n frameTextSecondary: {\n fontStyle: 'italic',\n fontSize: 12,\n opacity: 0.6,\n paddingLeft: theme.spacing(1),\n },\n\n listRoot: {\n padding: 0,\n },\n\n scopeType: {\n verticalAlign: 'top',\n textTransform: 'uppercase',\n width: 50,\n },\n scopeType_local: {\n color: '#53a944'\n },\n scopeType_closure: {\n color: '#365b80'\n },\n scopeType_user: {\n color: '#a48a15'\n },\n scopeName: {\n color: '#bc5b5b',\n width: 'calc(100% - 82px)',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n },\n scopeButton: {\n width: 32\n },\n scopeValueEditable: {\n cursor: 'pointer'\n },\n selectedFrame: {\n backgroundColor: '#777',\n color: 'white'\n },\n splitter: {\n width: '100%',\n height: 'calc(100% - 36px)',\n overflow: 'hidden',\n fontSize: 12\n },\n\n toolbarScopes: {\n width: 24,\n display: 'inline-block',\n height: '100%',\n background: theme.palette.mode === 'dark' ? '#222' : '#EEE',\n verticalAlign: 'top',\n },\n scopesAfterToolbar: {\n width: 'calc(100% - 24px)',\n display: 'inline-block',\n height: '100%',\n verticalAlign: 'top',\n },\n\n scopeNameName: {\n fontWeight: 'bold',\n display: 'inline-block',\n verticalAlign: 'top',\n },\n scopeNameEqual: {\n display: 'inline-block',\n color: theme.palette.mode === 'dark' ? '#EEE' : '#222',\n verticalAlign: 'top',\n },\n scopeNameValue: {\n verticalAlign: 'top',\n display: 'inline-block',\n color: '#3b709f',\n whiteSpace: 'nowrap',\n },\n scopeButtonDel: {\n padding: 0,\n float: 'right',\n },\n\n valueNull: {\n color: '#a44a24'\n },\n valueUndefined: {\n color: '#a44a24'\n },\n valueString: {\n color: '#1e8816'\n },\n valueNumber: {\n color: '#163c88'\n },\n valueBoolean: {\n color: '#a44a24'\n },\n valueObject: {\n color: '#721b70'\n },\n valueNone: {\n color: '#8a8a8a'\n },\n valueFunc: {\n color: '#ac4343'\n }\n});\n\nclass Stack extends React.Component {\n constructor(props) {\n super(props);\n\n this.framesSize = parseFloat(window.localStorage.getItem('App.framesSize')) || 300;\n\n this.state = {\n editValue: null,\n callFrames: this.props.callFrames,\n };\n\n this.editRef = React.createRef();\n }\n\n onExpressionNameUpdate() {\n this.props.onExpressionNameUpdate(this.state.editValue.index, this.scopeValue, () => {\n this.setState({editValue: null});\n this.scopeValue = null;\n });\n }\n\n renderExpression(item, i) {\n const name = this.state.editValue && this.state.editValue.type === 'expression' && this.state.editValue.index === i ?\n this.state.editValue && this.setState({editValue: null})}\n defaultValue={item.name}\n onKeyUp={e => {\n if (e.keyCode === 13) {\n this.onExpressionNameUpdate();\n } else if (e.keyCode === 27) {\n this.setState({editValue: null});\n }\n }}\n\n onChange={e =>\n this.scopeValue = e.target.value}\n\n endAdornment={\n \n this.onExpressionNameUpdate()} size=\"medium\">\n \n \n \n }\n />\n :\n [\n {item.name}
,\n =
,\n {this.formatValue(item.value)}
\n ];\n\n return \n user | \n {\n this.scopeValue = item.name || '';\n this.setState({\n editValue: {\n type: 'expression',\n valueType: 'string',\n index: i,\n name: item.name,\n value: item.name || ''\n }\n });\n }}\n >{name} | \n this.props.onExpressionDelete(i)}\n >\n \n \n
\n }\n\n renderExpressions() {\n return this.props.expressions.map((item, i) => this.renderExpression(item, i));\n }\n\n renderOneFrameTitle(frame, i) {\n if (this.props.mainScriptId === this.props.currentScriptId && frame.location.scriptId !== this.props.mainScriptId) {\n return null;\n }\n const fileName = frame.url.split('/').pop().replace(/^script\\.js\\./, '');\n return this.props.onChangeCurrentFrame(i)}\n dense\n selected={this.props.currentFrame === i}\n classes={{ root: this.props.classes.frameRoot }}\n >\n \n ;\n }\n\n formatValue(value, forEdit) {\n if (!value) {\n if (forEdit) {\n return 'none';\n } else {\n return none;\n }\n } else if (value.type === 'function') {\n const text = value.description ? (value.description.length > 100 ? value.description.substring(0, 100) + '...' : value.description) : 'function';\n if (forEdit) {\n return text;\n } else {\n return {text};\n }\n } else if (value.value === undefined) {\n if (forEdit) {\n return 'undefined';\n } else {\n return undefined;\n }\n } else if (value.value === null) {\n if (forEdit) {\n return 'null';\n } else {\n return null;\n }\n } else if (value.type === 'string') {\n if (forEdit) {\n return value.value;\n } else {\n const text = value.value ? (value.value.length > 100 ? value.value.substring(0, 100) + '...' : value.value) : '';\n return \"{text}\";\n }\n } else if (value.type === 'boolean') {\n if (forEdit) {\n return value.value.toString();\n } else {\n return {value.value.toString()};\n }\n } else if (value.type === 'object') {\n if (forEdit) {\n return JSON.stringify(value.value);\n } else {\n return ;\n }\n } else {\n return value.value.toString();\n }\n }\n\n onWriteScopeValue() {\n if (this.scopeValue === 'true') {\n this.scopeValue = true;\n } else if (this.scopeValue === 'false') {\n this.scopeValue = false;\n } else if (this.scopeValue === 'null') {\n this.scopeValue = null;\n } else if (this.scopeValue === 'undefined') {\n this.scopeValue = undefined;\n } else\n if (parseFloat(this.scopeValue).toString() === this.scopeValue) {\n this.scopeValue = parseFloat(this.scopeValue);\n }\n\n this.props.onWriteScopeValue({\n variableName: this.state.editValue.name,\n scopeNumber: 0,\n newValue: {\n value: this.scopeValue,\n valueType: typeof this.scopeValue,\n },\n callFrameId: this.props.callFrames[this.props.currentFrame].callFrameId\n });\n\n this.setState({editValue: null});\n this.scopeValue = null;\n }\n\n componentDidUpdate() {\n //this.editRef.current?.select();\n this.editRef.current?.focus();\n }\n\n renderScope(scopeId, item, type) {\n const editable = !this.props.currentFrame && item.value && (item.value.type === 'undefined' || item.value.type === 'string' || item.value.type === 'number' || item.value.type === 'boolean' || item.value?.value === null || item.value?.value === undefined);\n\n const el = this.state.editValue && this.state.editValue.type === type && this.state.editValue.name === item.name ?\n [\n {item.name}
,\n =
,\n this.state.editValue && this.setState({editValue: null})}\n defaultValue={this.formatValue(item.value, true)}\n onKeyUp={e => {\n if (e.keyCode === 13) {\n this.onWriteScopeValue()\n } else if (e.keyCode === 27) {\n this.setState({editValue: null})\n }\n }}\n onChange={e =>\n this.scopeValue = e.target.value}\n endAdornment={\n \n this.onWriteScopeValue()} size=\"medium\">\n \n \n \n }\n />\n ]\n :\n [\n {item.name}
,\n =
,\n {this.formatValue(item.value)} ({item.value.type})
\n ];\n\n\n return \n {type} | \n {\n if (editable) {\n this.scopeValue = item.value.value;\n this.setState({\n editValue: {\n scopeId,\n type,\n valueType: item.value.type,\n name: item.name,\n value: item.value.value\n }\n });\n }\n }}\n >{el} | \n
;\n }\n\n renderScopes(frame) {\n if (!frame) {\n return null;\n } else {\n // first local\n let result = this.renderExpressions();\n\n let items = this.props.scopes?.local?.properties?.result.map(item => this.renderScope(this.props.scopes.id, item, 'local'));\n items && items.forEach(item => result.push(item));\n\n items = this.props.scopes?.closure?.properties?.result.map(item => this.renderScope(this.props.scopes.id, item, 'closure'));\n items && items.forEach(item => result.push(item));\n\n return ;\n }\n }\n\n render() {\n return this.framesSize = parseFloat(size)}\n onDragEnd={() => window.localStorage.setItem('App.framesSize', this.framesSize.toString())}\n >\n \n \n {this.props.callFrames ? this.props.callFrames.map((frame, i) =>\n this.renderOneFrameTitle(frame, i)) : null}\n
\n
\n \n
\n this.props.onExpressionAdd((i, item) => {\n this.scopeValue = item.name || '';\n this.setState({\n editValue: {\n type: 'expression',\n valueType: 'string',\n index: i,\n name: item.name,\n value: item.name || ''\n }\n });\n })}>\n
\n
\n {this.props.callFrames && this.props.callFrames.length && this.renderScopes(this.props.callFrames[this.props.currentFrame])}\n
\n
\n ;\n }\n}\n\nStack.propTypes = {\n currentScriptId: PropTypes.string,\n mainScriptId: PropTypes.string,\n scopes: PropTypes.object,\n expressions: PropTypes.array,\n callFrames: PropTypes.array,\n currentFrame: PropTypes.number,\n onChangeCurrentFrame: PropTypes.func,\n onWriteScopeValue: PropTypes.func,\n onExpressionDelete: PropTypes.func,\n onExpressionAdd: PropTypes.func,\n onExpressionNameUpdate: PropTypes.func,\n themeType: PropTypes.string,\n};\n\nexport default withStyles(styles)(Stack);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport withStyles from '@mui/styles/withStyles';\nimport SplitterLayout from 'react-splitter-layout';\n\nimport Tabs from '@mui/material/Tabs';\nimport Tab from '@mui/material/Tab';\nimport Toolbar from '@mui/material/Toolbar';\nimport LinearProgress from '@mui/material/LinearProgress';\nimport IconButton from '@mui/material/IconButton';\nimport List from '@mui/material/List';\nimport ListItemButton from '@mui/material/ListItemButton';\nimport ListItemText from '@mui/material/ListItemText';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport Dialog from '@mui/material/Dialog';\nimport Badge from '@mui/material/Badge';\n\nimport { MdClose as IconClose, MdPlayArrow as IconRun } from 'react-icons/md';\nimport { MdPause as IconPause } from 'react-icons/md';\nimport { MdArrowForward as IconNext } from 'react-icons/md';\nimport { MdArrowDownward as IconStep } from 'react-icons/md';\nimport { MdArrowUpward as IconOut } from 'react-icons/md';\nimport { MdRefresh as IconRestart } from 'react-icons/md';\nimport { MdWarning as IconException } from 'react-icons/md';\n\nimport { I18n, Utils } from '@iobroker/adapter-react-v5';\n\nimport DialogError from '../../Dialogs/Error';\nimport Editor from './Editor';\nimport Console from './Console';\nimport Stack from './Stack';\n\nconst styles = theme => ({\n root: {\n width: '100%',\n height: `calc(100% - ${theme.toolbar.height + 38/*Theme.toolbar.height */ + 5}px)`,\n overflow: 'hidden',\n position: 'relative'\n },\n toolbar: {\n minHeight: 38,//Theme.toolbar.height,\n 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)'\n },\n buttonRun: {\n color: 'green'\n },\n buttonPause: {\n color: 'orange'\n },\n buttonRestart: {\n color: 'darkgreen'\n },\n buttonStop: {\n color: 'red'\n },\n buttonNext: {\n color: 'blue'\n },\n buttonStep: {\n color: 'blue'\n },\n buttonOut: {\n color: 'blue'\n },\n buttonException: {\n\n },\n\n tabFile: {\n textTransform: 'inherit',\n color: theme.palette.mode === 'dark' ? '#DDD' : 'inherit'\n },\n tabText: {\n maxWidth: 130,\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n display: 'inline-block',\n verticalAlign: 'middle',\n },\n closeButton: {\n position: 'absolute',\n top: 8,\n right: 0,\n zIndex: 10,\n padding: 8,\n cursor: 'pointer'\n },\n\n tabsRoot: {\n minHeight: 24,\n background: theme.palette.mode === 'dark' ? '#333' : '#e6e6e6',\n color: theme.palette.mode === 'dark' ? 'white' : 'inherit'\n },\n tabRoot: {\n minHeight: 24,\n },\n\n bpListItem: {\n borderTop: '1px dashed #bfbfbf44',\n },\n monospace: {\n fontFamily: 'Courier New, monospace',\n whiteSpace: 'pre',\n fontSize: 12,\n },\n arrow: {\n color: '#fffa4f',\n },\n splitter: {\n height: 'calc(100% - 52px)',\n '& .layout-pane': {\n overflow: 'hidden',\n height: '100%'\n }\n }\n});\n\nclass Debugger extends React.Component {\n constructor(props) {\n super(props);\n let breakpoints = window.localStorage.getItem('javascript.tools.bp.' + this.props.src);\n try {\n breakpoints = breakpoints ? JSON.parse(breakpoints) : [];\n } catch (e) {\n breakpoints = [];\n }\n\n let expressions = window.localStorage.getItem('javascript.tools.exps.' + this.props.src);\n try {\n expressions = expressions ? JSON.parse(expressions) : [];\n expressions = expressions.map(name => ({name}));\n } catch (e) {\n expressions = [];\n }\n\n this.toolSize = window.localStorage ? parseFloat(window.localStorage.getItem('App.toolSize')) || 150 : 150;\n\n this.state = {\n starting: true,\n selected: null,\n tabs: {},\n script: '',\n breakpoints,\n expressions,\n running: false,\n error: '',\n started: false,\n paused: true,\n location: null,\n toolsTab: window.localStorage.getItem('javascript.tools.tab') || 'console',\n stopOnException: window.localStorage.getItem('javascript.tools.stopOnException') === 'true',\n console: [],\n finished: false,\n currentFrame: 0,\n scopes: {},\n queryBreakpoints: null,\n logErrors: 0,\n logWarnings: 0,\n logs: 0,\n };\n\n this.scripts = {};\n this.mainScriptId = null;\n }\n\n componentDidMount() {\n new Promise(resolve => {\n if (this.props.debugInstance) {\n resolve(this.props.debugInstance.instance);\n } else {\n this.props.socket.getObject(this.props.src)\n .then(obj => resolve(obj?.common?.engine?.replace('system.adapter.', '')));\n }\n })\n .then(instance =>\n this.setState({ instance }, () => {\n if (this.state.instance) {\n this.props.socket.setState(`${this.state.instance}.debug.from`, { val: '{\"cmd\": \"subscribed\"}', ack: true });\n //.then(() => );\n setTimeout(() =>\n this.props.socket.subscribeState(`${this.state.instance}.debug.from`, this.fromInstance), 200);\n } else {\n this.setState({ error: 'Unknown instance' });\n }\n }));\n }\n\n componentWillUnmount() {\n if (this.state.instance) {\n this.props.socket.unsubscribeState(`${this.state.instance}.debug.from`, this.fromInstance);\n this.props.socket.sendTo(this.state.instance, 'debugStop');\n }\n }\n\n sendToInstance(cmd) {\n this.props.socket.setState(`${this.state.instance}.debug.to`, { val: JSON.stringify(cmd), ack: false });\n }\n\n reinitBreakpoints(cb) {\n if (this.state.breakpoints.length) {\n let breakpoints = JSON.parse(JSON.stringify(this.state.breakpoints));\n breakpoints = breakpoints.map(item => item.location);\n this.setState({breakpoints: []}, () => {\n this.sendToInstance({breakpoints, cmd: 'sb'});\n if (this.state.stopOnException) {\n this.sendToInstance({cmd: 'stopOnException', state: true});\n }\n\n cb && cb();\n });\n } else if (this.state.stopOnException) {\n this.sendToInstance({cmd: 'stopOnException', state: true});\n cb && cb();\n } else {\n cb && cb();\n }\n }\n\n getLocation(context) {\n if (context.callFrames) {\n const frame = context.callFrames[0];\n return frame.location;\n }\n }\n\n readCurrentScope() {\n const frame = this.state.context?.callFrames && this.state.context.callFrames[this.state.currentFrame];\n if (frame) {\n const scopes = frame.scopeChain.filter(scope => scope.type !== 'global');\n if (scopes.length) {\n this.sendToInstance({cmd: 'scope', scopes});\n } else if (this.state.scopes.global || this.state.scopes.local || this.state.scopes.closure) {\n this.setState({scopes: {}});\n }\n }\n }\n\n readExpressions(i) {\n if (this.state.expressions.length && this.state.context?.callFrames && this.state.context.callFrames[this.state.currentFrame]) {\n if (i !== undefined) {\n this.sendToInstance({\n cmd: 'expressions',\n expressions: [this.state.expressions[i]],\n callFrameId: this.state.context.callFrames[this.state.currentFrame].callFrameId\n });\n } else {\n this.sendToInstance({\n cmd: 'expressions',\n expressions: this.state.expressions,\n callFrameId: this.state.context.callFrames[this.state.currentFrame].callFrameId\n });\n }\n }\n }\n\n fromInstance = (id, state) => {\n try {\n const data = JSON.parse(state.val);\n if (data.cmd === 'subscribed') {\n this.props.socket.sendTo(this.state.instance, 'debug', this.props.debugInstance || {scriptName: this.props.src});\n } else\n if (data.cmd === 'readyToDebug') {\n this.mainScriptId = data.scriptId;\n this.scripts[data.scriptId] = data.script;\n if (data.script.startsWith('(async () => {debugger;\\n')) {\n this.scripts[data.scriptId] = `(async () => {\\n${data.script.substring('(async () => {debugger;\\n'.length)}`;\n } else if (data.script.startsWith('debugger;')) {\n this.scripts[data.scriptId] = data.script.substring('debugger;'.length);\n }\n\n const tabs = JSON.parse(JSON.stringify(this.state.tabs));\n tabs[data.scriptId] = this.props.debugInstance ? data.url: this.props.src.replace('script.js.', '');\n\n const ts = `${Date.now()}.${Math.random() * 10000}`;\n data.context?.callFrames && data.context.callFrames.forEach((item, i) => item.id = ts + i);\n\n this.setState({\n starting: false,\n finished: false,\n selected: this.mainScriptId,\n script: this.scripts[data.scriptId],\n tabs,\n currentFrame: 0,\n started: true,\n paused: true,\n location: this.getLocation(data.context),\n context: data.context,\n }, () =>\n this.reinitBreakpoints(() => {\n this.readCurrentScope();\n this.readExpressions();\n }));\n } else if (data.cmd === 'paused') {\n const ts = `${Date.now()}.${Math.random() * 10000}`;\n data.context?.callFrames && data.context.callFrames.forEach((item, i) => item.id = ts + i);\n const location = this.getLocation(data.context);\n const tabs = JSON.parse(JSON.stringify(this.state.tabs));\n const parts = data.context.callFrames[0].url.split('iobroker.javascript');\n tabs[location.scriptId] = (parts[1] || parts[0]).replace('script.js.', '');\n\n const newState = {\n tabs,\n paused: true,\n location,\n currentFrame: 0,\n context: data.context,\n scope: {id: (data.context?.callFrames && data.context.callFrames[0] && data.context.callFrames[0].id) || 0}\n };\n\n newState.script = this.scripts[location.scriptId] === undefined ? I18n.t('loading...') : this.scripts[location.scriptId];\n newState.selected = location.scriptId;\n\n this.setState(newState, () => {\n this.readCurrentScope();\n this.readExpressions();\n if (!this.scripts[location.scriptId]) {\n this.sendToInstance({cmd: 'source', scriptId: location.scriptId});\n }\n });\n } else if (data.cmd === 'script') {\n this.scripts[data.scriptId] = data.text;\n if (this.state.selected === data.scriptId) {\n this.setState({script: this.scripts[data.scriptId]});\n }\n } else if (data.cmd === 'resumed') {\n this.setState({paused: false});\n } else if (data.cmd === 'log') {\n if (this.state.toolsTab === 'console') {\n this.console = null;\n const console = [...this.state.console];\n console.push({text: data.text, severity: data.severity, ts: data.ts});\n this.setState({console});\n } else {\n if (data.severity === 'error') {\n this.setState({logErrors: this.state.logErrors + 1});\n } else if (data.severity === 'warn') {\n this.setState({logWarnings: this.state.logWarnings + 1});\n } else {\n this.setState({logs: this.state.logs + 1});\n }\n this.console = this.console || [...this.state.console];\n this.console.push({text: data.text, severity: data.severity, ts: data.ts});\n }\n } else if (data.cmd === 'error') {\n this.setState({error: data.error});\n } else if (data.cmd === 'finished' || data.cmd === 'debugStopped') {\n this.setState({\n finished: true,\n starting: false,\n started: true,\n });\n } else if (data.cmd === 'sb') {\n const breakpoints = JSON.parse(JSON.stringify(this.state.breakpoints));\n let changed = false;\n data.breakpoints.filter(bp => bp).forEach(bp => {\n const found = breakpoints.find(item =>\n item.location.scriptId === bp.location.scriptId && item.location.lineNumber === bp.location.lineNumber);\n if (!found) {\n changed = true;\n breakpoints.push(bp);\n }\n });\n changed && window.localStorage.setItem('javascript.tools.bp.' + this.props.src, JSON.stringify(breakpoints));\n changed && this.setState({breakpoints});\n } else if (data.cmd === 'cb') {\n const breakpoints = JSON.parse(JSON.stringify(this.state.breakpoints));\n let changed = false;\n\n data.breakpoints.filter(id => id !== undefined && id !== null).forEach(id => {\n const found = breakpoints.find(item => item.id === id);\n if (found) {\n const pos = breakpoints.indexOf(found);\n breakpoints.splice(pos, 1);\n changed = true;\n }\n });\n changed && window.localStorage.setItem('javascript.tools.bp.' + this.props.src, JSON.stringify(breakpoints));\n changed && this.setState({breakpoints});\n } else if (data.cmd === 'scope') {\n //const global = data.scopes.find(scope => scope.type === 'global') || null;\n const local = data.scopes.find(scope => scope.type === 'local') || null;\n const closure = data.scopes.find(scope => scope.type === 'closure') || null;\n\n console.log(JSON.stringify(closure));\n\n this.setState({scopes: {local, closure, id: `${this.state.scope.id}_${this.state.currentFrame}`}});\n } else if (data.cmd === 'setValue') {\n const scopes = JSON.parse(JSON.stringify(this.state.scopes));\n let item;\n if (data.scopeNumber === 0) {\n item = scopes.local && scopes.local.properties && scopes.local.properties.result && scopes.local.properties.result.find(item => item.name === data.variableName);\n } else {\n item = scopes.closure && scopes.closure.properties && scopes.closure.properties.result && scopes.closure.properties.result && scopes.closure.properties.result.find(item => item.name === data.variableName);\n }\n if (item) {\n item.value.value = data.newValue.value;\n this.setState({scopes});\n }\n } else if (data.cmd === 'expressions') {\n // update values\n let expressions = JSON.parse(JSON.stringify(this.state.expressions));\n let changed = false;\n data.expressions.forEach(item => {\n const expression = expressions.find(it => it.name === item.name);\n if (expression) {\n changed = true;\n expression.value = item.result;\n }\n });\n changed && this.setState({expressions});\n\n console.log('expressions: ' + JSON.stringify(data));\n } else if (data.cmd === 'getPossibleBreakpoints') {\n if (data.breakpoints?.locations?.length === 1) {\n this.sendToInstance({breakpoints: data.breakpoints.locations, cmd: 'sb'});\n } else if (!data.breakpoints?.locations?.length) {\n window.alert('cannot set');\n } else {\n this.setState({queryBreakpoints: data.breakpoints.locations});\n }\n } else {\n console.error(`Unknown command: ${JSON.stringify(data)}`);\n }\n } catch (e) {\n\n }\n }\n\n getTextAtLocation(location) {\n let line = this.state.script.split(/\\r\\n|\\n/)[location.lineNumber];\n let arrow = '';\n if (location.columnNumber >= 10) {\n line = line.substring(location.columnNumber - 10, location.columnNumber + 20);\n arrow = ''.padStart(10, ' ') + '↑';\n } else {\n line = line.substring(0, 30 - location.columnNumber);\n arrow = ''.padStart(location.columnNumber, ' ') + '↑';\n }\n return [\n {line}
,\n {arrow}
\n ];\n }\n\n renderQueryBreakpoints() {\n if (this.state.queryBreakpoints) {\n return ;\n } else {\n return null;\n }\n }\n\n renderError() {\n if (this.state.error) {\n return this.setState({ error: '' })} text={this.state.error} />;\n } else {\n return null;\n }\n }\n\n closeTab(id, e) {\n e && e.stopPropagation();\n const tabs = JSON.parse(JSON.stringify(this.state.tabs));\n delete tabs[id];\n const newState = {tabs, script: this.scripts[this.mainScriptId], selected: this.mainScriptId};\n if (this.state.location && this.state.location.scriptId !== this.mainScriptId) {\n newState.location = null;\n }\n this.setState(newState);\n }\n\n renderTabs() {\n const disabled = !this.state.tabs || !this.state.started;\n return {\n if (this.scripts[value]) {\n this.setState({selected: value, script: this.scripts[value]});\n } else {\n this.setState({selected: value, script: 'loading...'}, () =>\n this.sendToInstance({cmd: 'source', scriptId: value}));\n }\n }}\n scrollButtons=\"auto\"\n >\n {Object.keys(this.state.tabs || [])\n .map(id => {\n let label = id;\n let title = this.state.tabs[id] || '';\n if (this.state.tabs[id]) {\n label = this.state.tabs[id].split('/').pop();\n }\n label = [\n {label}
,\n id !== this.mainScriptId && \n this.closeTab(id, e)} fontSize=\"small\" />];\n\n return ;\n })}\n ;\n }\n\n onResume() {\n this.sendToInstance({cmd: 'cont'});\n }\n\n onPause() {\n this.sendToInstance({cmd: 'pause'});\n }\n\n onNext() {\n this.sendToInstance({cmd: 'next'});\n }\n\n onStepIn() {\n this.sendToInstance({cmd: 'step'});\n }\n\n onStepOut() {\n this.sendToInstance({cmd: 'out'});\n }\n\n onRestart() {\n this.setState({started: false, starting: true}, () =>\n this.props.socket.sendTo(this.state.instance, 'debug', this.props.debugInstance || {scriptName: this.props.src}));\n }\n\n onToggleException() {\n const stopOnException = !this.state.stopOnException;\n window.localStorage.setItem('javascript.tools.stopOnException', stopOnException ? 'true' : 'false');\n this.setState({stopOnException}, () =>\n this.sendToInstance({cmd: 'stopOnException', state: stopOnException}));\n }\n\n renderToolbar() {\n const disabled = !this.state.started;\n return (\n \n this.onRestart()}\n title={I18n.t('Restart')}\n size=\"medium\">\n {\n !this.state.finished && this.state.paused ?\n this.onResume()}\n title={I18n.t('Resume execution')}\n size=\"medium\">\n :\n !this.state.finished && this.onPause()}\n title={I18n.t('Pause execution')}\n size=\"medium\">\n }\n {!this.state.finished && this.onNext()}\n title={I18n.t('Go to next line')}\n size=\"medium\">}\n {!this.state.finished && this.onStepIn()}\n title={I18n.t('Step into function')}\n size=\"medium\">}\n {!this.state.finished && this.onStepOut()}\n title={I18n.t('Step out from function')}\n size=\"medium\">}\n {!this.state.finished && this.onToggleException()}\n title={I18n.t('Stop on exception')}\n size=\"medium\">}\n {this.renderTabs()}\n \n );\n }\n\n getPossibleBreakpoints(bp) {\n const end = {...bp, columnNumber: 1000};\n this.sendToInstance({cmd: 'getPossibleBreakpoints', start: bp, end});\n }\n\n toggleBreakpoint(lineNumber) {\n let bp = this.state.breakpoints.find(item => item.location.scriptId === this.state.selected && item.location.lineNumber === lineNumber);\n if (bp) {\n const breakpoints = JSON.parse(JSON.stringify(this.state.breakpoints));\n this.setState({breakpoints}, () =>\n this.sendToInstance({breakpoints: [bp.id], cmd: 'cb'}));\n } else {\n bp = {scriptId: this.state.selected, lineNumber, columnNumber: 0};\n this.getPossibleBreakpoints(bp);\n }\n }\n\n renderCode() {\n if (this.state.script && this.state.started) {\n const breakpoints = this.state.breakpoints.filter(bp => bp.location.scriptId === this.state.selected);\n\n return this.toggleBreakpoint(i)}\n />\n }\n }\n\n renderFrames() {\n if (!this.state.paused) {\n return null;\n }\n\n return {\n this.setState({currentFrame: i, scopes: {}}, () => {\n this.readCurrentScope();\n this.readExpressions();\n })\n }}\n onWriteScopeValue={obj => {\n this.sendToInstance({\n cmd: 'setValue',\n variableName: obj.variableName,\n scopeNumber: obj.scopeNumber,\n newValue: obj.newValue,\n callFrameId: obj.callFrameId\n });\n }}\n onExpressionDelete={i => {\n const expressions = JSON.parse(JSON.stringify(this.state.expressions));\n expressions.splice(i, 1);\n this.setState({expressions});\n window.localStorage.setItem('javascript.tools.exps.' + this.props.src, JSON.stringify(expressions.map(item => item.name)));\n }}\n onExpressionAdd={cb => {\n const expressions = JSON.parse(JSON.stringify(this.state.expressions));\n expressions.push({name: '', value: {value: ''}});\n this.setState({expressions}, () => cb && cb(expressions.length - 1, this.state.expressions[expressions.length - 1]));\n }}\n onExpressionNameUpdate={(i, name, cb) => {\n const expressions = JSON.parse(JSON.stringify(this.state.expressions));\n if (!name) {\n expressions.splice(i, 1);\n } else if (expressions.find(item => item.name === name)) {\n return cb && cb(false);\n } else {\n expressions[i].name = name;\n }\n\n this.setState({expressions}, () => {\n name && this.readExpressions(i);\n cb && cb();\n });\n window.localStorage.setItem('javascript.tools.exps.' + this.props.src, JSON.stringify(expressions.map(item => item.name)));\n }}\n />;\n }\n\n renderConsole() {\n return this.setState({console: [], logErrors: 0, logWarning: 0, logs: 0})}\n />;\n }\n\n renderTools() {\n const disabled = !this.state.tabs || !this.state.started;\n\n let _console;\n if (this.state.logErrors) {\n _console = \n {I18n.t('Console')}\n ;\n } else if (this.state.logWarnings) {\n _console = \n {I18n.t('Console')}\n ;\n } else if (this.state.logs) {\n _console = \n {I18n.t('Console')}\n ;\n } else {\n _console = I18n.t('Console');\n }\n\n return \n
{\n const newState = {toolsTab: value};\n\n // load logs from buffer\n if (this.console && value === 'console') {\n newState.console = this.console;\n this.console = null;\n newState.logs = 0;\n newState.logWarnings = 0;\n newState.logErrors = 0;\n }\n\n window.localStorage.setItem('javascript.tools.tab', value);\n\n this.setState(newState);\n }}\n scrollButtons=\"auto\"\n >\n \n \n \n
\n {this.state.toolsTab === 'stack' && !disabled ? this.renderFrames() : null}\n {this.state.toolsTab === 'console' && !disabled ? this.renderConsole() : null}\n
\n
;\n }\n\n render() {\n return \n {this.state.starting ?
: null}\n {this.renderToolbar()}\n
this.toolSize = parseFloat(size)}\n onDragEnd={() => window.localStorage.setItem('App.toolSize', this.toolSize.toString())}\n //style={{width: '100%', height: 'calc(100% - 73px)', overflow: 'hidden'}}\n >\n \n {this.renderCode()}\n {this.renderQueryBreakpoints()}\n
\n \n {this.renderTools()}\n
\n \n {this.renderError()}\n
;\n }\n}\n\nDebugger.propTypes = {\n runningInstances: PropTypes.object,\n adapterName: PropTypes.string,\n src: PropTypes.string,\n socket: PropTypes.object.isRequired,\n className: PropTypes.string,\n style: PropTypes.object,\n themeType: PropTypes.string,\n theme: PropTypes.object,\n themeName: PropTypes.string,\n debugInstance: PropTypes.object,\n};\n\nexport default withStyles(styles)(Debugger);\n","import ChannelDetector from '@iobroker/type-detector';\nimport { I18n } from '@iobroker/adapter-react-v5';\nimport docs from './docs.md';\n\nlet allObjectsCache = null;\n\nconst allObjects = async socket => {\n if (allObjectsCache) {\n return allObjectsCache;\n }\n const states = await socket.getObjectView('', '\\u9999', 'state');\n const channels = await socket.getObjectView('', '\\u9999', 'channel');\n const devices = await socket.getObjectView('', '\\u9999', 'device');\n const folders = await socket.getObjectView('', '\\u9999', 'folder');\n const enums = await socket.getObjectView('', '\\u9999', 'enum');\n\n allObjectsCache = Object.values(states)\n .concat(Object.values(channels))\n .concat(Object.values(devices))\n .concat(Object.values(folders))\n .concat(Object.values(enums))\n // eslint-disable-next-line\n .reduce((obj, item) => (obj[item._id] = item, obj), {});\n\n return allObjectsCache;\n};\n\nconst getText = (text, lang) => {\n if (text && typeof text === 'object') {\n return text[lang] || text.en;\n }\n return text || '';\n};\n\nconst detectDevices = async socket => {\n const lang = I18n.getLanguage();\n const devicesObject = await allObjects(socket);\n const keys = Object.keys(devicesObject).sort();\n const detector = new ChannelDetector();\n\n const usedIds = [];\n const ignoreIndicators = ['UNREACH_STICKY']; // Ignore indicators by name\n const excludedTypes = ['info'];\n const enums = [];\n const rooms = [];\n const funcs = [];\n const list = [];\n\n keys.forEach(id => {\n if (devicesObject[id]?.type === 'enum') {\n enums.push(id);\n } else if (devicesObject[id]?.common?.smartName) {\n list.push(id);\n }\n });\n\n enums.forEach(id => {\n if (id.startsWith('enum.rooms.')) {\n rooms.push(id);\n } else if (id.startsWith('enum.functions.')) {\n funcs.push(id);\n }\n const members = devicesObject[id].common.members;\n\n if (members && members.length) {\n members.forEach(member => {\n // if an object really exists\n if (devicesObject[member]) {\n if (!list.includes(member)) {\n list.push(member);\n }\n }\n });\n }\n });\n\n const options = {\n objects: devicesObject,\n _keysOptional: keys,\n _usedIdsOptional: usedIds,\n ignoreIndicators,\n excludedTypes,\n };\n\n const result = [];\n\n // we are creating a list of devices, where each device has a following structure:\n // {\n // id: 'hm-rpc.0.KEQ0123456.1',\n // name: 'HM-RC-4-2',\n // role: 'light',\n // room: 'Living room',\n // 'function': 'light'\n // }\n\n list.forEach(id => {\n options.id = id;\n\n const controls = detector.detect(options);\n\n if (controls) {\n controls.forEach(control => {\n const stateId = control.states.find(state => state.id).id;\n // if not yet added\n if (result.find(st => st.id === stateId)) {\n return;\n }\n const deviceObject = {\n id: stateId,\n name: getText(devicesObject[stateId].common.name, lang),\n role: devicesObject[stateId].type,\n deviceType: control.type,\n states: control.states\n .filter(state => state.id)\n .map(state => ({\n id: state.id,\n name: state.name,\n role: state.defaultRole,\n type: devicesObject[state.id].common.type,\n unit: devicesObject[state.id].common.unit,\n read: devicesObject[state.id].common.read === undefined ? true : devicesObject[state.id].common.read,\n write: devicesObject[state.id].common.write === undefined ? true : devicesObject[state.id].common.write,\n })),\n };\n\n const parts = stateId.split('.');\n let channelId;\n let deviceId;\n if (devicesObject[stateId].type === 'channel' || devicesObject[stateId].type === 'state') {\n parts.pop();\n channelId = parts.join('.');\n if (devicesObject[channelId] && (devicesObject[channelId].type === 'channel' || devicesObject[stateId].type === 'folder')) {\n parts.pop();\n deviceId = parts.join('.');\n if (!devicesObject[deviceId] || (devicesObject[deviceId].type !== 'device' && devicesObject[stateId].type !== 'folder')) {\n deviceId = null;\n }\n } else {\n channelId = null;\n }\n }\n // try to detect room\n const room = rooms.find(roomId => {\n if (devicesObject[roomId].common.members.includes(stateId)) {\n return true;\n }\n if (channelId && devicesObject[roomId].common.members.includes(channelId)) {\n return true;\n }\n return deviceId && devicesObject[roomId].common.members.includes(deviceId);\n });\n if (room) {\n deviceObject.room = getText(devicesObject[room].common.name, lang);\n }\n\n // try to detect function\n const func = funcs.find(funcId => {\n if (devicesObject[funcId].common.members.includes(stateId)) {\n return true;\n }\n if (channelId && devicesObject[funcId].common.members.includes(channelId)) {\n return true;\n }\n return deviceId && devicesObject[funcId].common.members.includes(deviceId);\n });\n if (func) {\n deviceObject.function = getText(devicesObject[func].common.name, lang);\n }\n result.push(deviceObject);\n });\n }\n });\n\n // find names and icons for devices\n for (const k in result) {\n const deviceObj = result[k];\n if (deviceObj.type === 'state' || deviceObj.type === 'channel') {\n const idArray = deviceObj._id.split('.');\n idArray.pop();\n\n // read channel\n const parentObject = devicesObject[idArray.join('.')];\n if (parentObject && (parentObject.type === 'channel' || parentObject.type === 'device' || parentObject.type === 'folder')) {\n deviceObj.common.name = getText(parentObject.common?.name || deviceObj.common.name, lang);\n idArray.pop();\n // read device\n const grandParentObject = devicesObject[idArray.join('.')];\n if (grandParentObject?.type === 'device' && grandParentObject.common?.icon) {\n deviceObj.common.name = getText(grandParentObject.common?.name || deviceObj.common.name, lang);\n }\n } else {\n deviceObj.common.name = getText(parentObject?.common?.name || deviceObj.common.name, lang);\n }\n }\n }\n\n return result;\n};\n\nconst systemPrompt = async () => (await fetch(docs)).text();\nexport { systemPrompt, detectDevices };\n","import React, { useCallback, useRef, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport OpenAI from 'openai';\n\nimport {\n Button, CircularProgress, Dialog,\n DialogActions, DialogContent, DialogTitle,\n IconButton, TextField,\n} from '@mui/material';\n\nimport {\n Check, Close,\n QuestionMark as Question,\n FileCopy as Copy,\n} from '@mui/icons-material';\n\nimport { Utils, I18n } from '@iobroker/adapter-react-v5';\n\nimport { detectDevices, systemPrompt } from './OpenAiPrompt';\nimport ScriptEditorComponent from '../Components/ScriptEditorVanilaMonaco';\n\nconst LANGUAGES = {\n ru: 'Russian',\n en: 'English',\n de: 'German',\n es: 'Spanish',\n fr: 'French',\n it: 'Italian',\n pl: 'Polish',\n nl: 'Dutch',\n pt: 'Portuguese',\n uk: 'Ukrainian',\n 'zh-cn': 'Chinese',\n};\n\nconst ChatIcon = () => ;\n\nconst OpenAiDialog = props => {\n const [question, setQuestion] = useState(window.localStorage.getItem('openai-question') || '');\n const [answer, setAnswer] = useState('');\n const [open, setOpen] = useState(false);\n const [working, setWorking] = useState(false);\n const [error, setError] = useState(false);\n const [showKeyWarning, setShowKeyWarning] = useState(false);\n const devicesCache = useRef(null);\n const gptKeyCache = useRef(null);\n const docsCache = useRef(null);\n\n const ask = useCallback(async () => {\n let devices;\n if (!devicesCache.current) {\n devices = await detectDevices(props.socket);\n devicesCache.current = devices;\n console.log(`devices: ${JSON.stringify(devices, 2, null)}`);\n } else {\n devices = devicesCache.current;\n }\n let apiKey;\n if (!gptKeyCache.current) {\n const ids = Object.keys(props.runningInstances);\n for (let i = 0; i < ids.length; i++) {\n const config = await props.socket.getObject(ids[i]);\n apiKey = config.native.gptKey;\n if (apiKey) {\n break;\n }\n }\n gptKeyCache.current = apiKey;\n } else {\n apiKey = gptKeyCache.current;\n }\n\n let docs;\n if (!docsCache.current) {\n docs = await systemPrompt();\n docsCache.current = docs;\n } else {\n docs = docsCache.current;\n }\n if (!apiKey) {\n setShowKeyWarning(true);\n return;\n }\n\n setWorking(true);\n setError(false);\n\n try {\n const openai = new OpenAI({ apiKey, dangerouslyAllowBrowser: true });\n\n const chatCompletionPhase1 = await openai.chat.completions.create({\n model: 'gpt-3.5-turbo-16k',\n messages: [\n {\n role: 'system',\n content: `You are programmer. Here is a documentation:\\n\\n${docs}`,\n },\n { role: 'system', content: `Here is list of devices:\\n\\n${JSON.stringify(devices, null, 2)}` },\n {\n role: 'user',\n content: `Write code that do:\\n\\n${question}\nReturn only code.\nWrite comments in ${LANGUAGES[I18n.getLanguage()] || 'English'}.\nYou can call async function directly in the code without encapsulate them in async function as this code will be already executed in async function.\nDo not import any libraries as all functions are already imported.`,\n }],\n });\n const message = chatCompletionPhase1.choices[0].message;\n const m = message.content.match(/```(javascript|js|typescript)\\n?(.*)```(.*)/ms);\n let code;\n if (!m) {\n code = message.content;\n if (code.startsWith('`')) {\n code = code.substring(1);\n }\n if (code.endsWith('`')) {\n code = code.substring(0, code.length - 1);\n }\n } else {\n code = m[2];\n if (m[3]) {\n const comments = m[3].split('\\n').map(line => line.trim());\n // skip empty lines on start and end\n while (comments[0] === '') {\n comments.shift();\n }\n code = `${comments.map(line => `// ${line}`).join('\\n')}\\n${code}`;\n }\n }\n console.log(message);\n setAnswer(code);\n } catch (err) {\n if (err.response) {\n setError(err.response.data?.error?.message);\n }\n console.error(`Cannot request: ${err}, ${JSON.stringify(err?.response?.data || err, null, 2)}`);\n }\n\n setWorking(false);\n }, [question]);\n\n return <>\n setOpen(true)}\n >\n \n \n {showKeyWarning && }\n {open && }\n >;\n};\n\nOpenAiDialog.propTypes = {\n adapterName: PropTypes.string.isRequired,\n socket: PropTypes.object,\n runningInstances: PropTypes.object,\n themeType: PropTypes.string,\n language: PropTypes.string,\n onAddCode: PropTypes.func.isRequired,\n};\n\nexport default OpenAiDialog;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport Tour from 'reactour';\n\nimport Toolbar from '@mui/material/Toolbar';\nimport withStyles from '@mui/styles/withStyles';\nimport Button from '@mui/material/Button';\nimport IconButton from '@mui/material/IconButton';\nimport Tabs from '@mui/material/Tabs';\nimport Tab from '@mui/material/Tab';\nimport Badge from '@mui/material/Badge';\nimport Snackbar from '@mui/material/Snackbar';\nimport Menu from '@mui/material/Menu';\nimport MenuItem from '@mui/material/MenuItem';\nimport Checkbox from '@mui/material/Checkbox';\nimport Dialog from '@mui/material/Dialog';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogActions from '@mui/material/DialogActions';\nimport LinearProgress from '@mui/material/LinearProgress';\nimport Table from '@mui/material/Table';\nimport TableBody from '@mui/material/TableBody';\nimport TableCell from '@mui/material/TableCell';\nimport TableContainer from '@mui/material/TableContainer';\nimport TableHead from '@mui/material/TableHead';\nimport TableRow from '@mui/material/TableRow';\nimport Tooltip from '@mui/material/Tooltip';\nimport Paper from '@mui/material/Paper';\n\nimport { red, green } from '@mui/material/colors';\n\nimport { MdSave as IconSave } from 'react-icons/md';\nimport { MdCancel as IconCancel } from 'react-icons/md';\nimport { MdClose as IconClose } from 'react-icons/md';\nimport { MdRefresh as IconRestart } from 'react-icons/md';\nimport { MdInput as IconDoEdit } from 'react-icons/md';\nimport { FaClock as IconCron } from 'react-icons/fa';\nimport { FaClipboardList as IconSelectId } from 'react-icons/fa';\nimport { FaFileExport as IconExport } from 'react-icons/fa';\nimport { FaFileImport as IconImport } from 'react-icons/fa';\nimport { FaFlagCheckered as IconCheck } from 'react-icons/fa';\nimport { MdGpsFixed as IconLocate } from 'react-icons/md';\nimport { MdClearAll as IconCloseAll } from 'react-icons/md';\nimport { MdBuild as IconDebugMenu } from 'react-icons/md';\nimport { MdBugReport as IconDebug } from 'react-icons/md';\nimport { MdPlaylistAddCheck as IconVerbose } from 'react-icons/md';\nimport { MdBugReport as IconDebugMode } from 'react-icons/md';\nimport { MdPlayArrow as IconPlay } from 'react-icons/md';\nimport { MdPause as IconPause } from 'react-icons/md';\nimport { MdAutoAwesome as IconAstro } from 'react-icons/md';\nimport ImgJS from './assets/js.png';\nimport ImgBlockly from './assets/blockly.png';\nimport ImgTypeScript from './assets/typescript.png';\nimport ImgBlockly2Js from './assets/blockly2js.png';\nimport ImgRules2Js from './assets/rules2js.png';\nimport ImgRules from './assets/rules.png';\n\nimport {\n I18n, Utils, Cron as DialogCron, Confirm as DialogConfirm, SelectID as DialogSelectID,\n} from '@iobroker/adapter-react-v5';\n\nimport ScriptEditorComponent from './Components/ScriptEditorVanilaMonaco';\nimport BlocklyEditor from './Components/BlocklyEditor';\nimport DialogScriptEditor from './Dialogs/ScriptEditor';\nimport RulesEditor from './Components/RulesEditor';\nimport Debugger from './Components/Debugger';\nimport steps, { STEPS } from './Components/RulesEditor/helpers/Tour';\nimport OpenAiDialog from './OpenAi/OpenAiDialog';\n\nconst images = {\n 'Blockly': ImgBlockly,\n 'Javascript/js': ImgJS,\n 'Rules': ImgRules,\n def: ImgJS,\n 'TypeScript/ts': ImgTypeScript,\n};\n\nconst MENU_ITEM_HEIGHT = 48;\nconst COLOR_DEBUG = '#02a102';\nconst COLOR_VERBOSE = '#70aae9';\nconst COLOR_RUN = green[400];\nconst COLOR_PAUSE = red[400];\n\nconst styles = theme => ({\n\n toolbar: {\n minHeight: 38, // Theme.toolbar.height,\n 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)',\n },\n toolbarButtons: {\n padding: 4,\n marginLeft: 4,\n },\n toolbarButtonsDisabled: {\n filter: 'grayscale(100%)',\n opacity: 0.5,\n },\n editorDiv: {\n height: `calc(100% - ${theme.toolbar.height + 38/*Theme.toolbar.height */ + 10}px)`,\n width: '100%',\n overflow: 'hidden',\n position: 'relative',\n },\n textButton: {\n marginRight: 10,\n minHeight: 24,\n padding: '6px 16px',\n },\n saveButton: {\n background: '#ff9900',\n },\n textIcon: {\n marginLeft: theme.spacing(1),\n },\n tabIcon: {\n width: 24,\n height: 24,\n verticalAlign: 'middle',\n marginBottom: 2,\n marginRight: 2,\n borderRadius: 3,\n },\n hintIcon: {\n // fontSize: 32,\n padding: '0 8px 0 8px',\n },\n hintText: {\n // fontSize: 18\n },\n hintButton: {\n marginTop: 8,\n marginLeft: 20,\n },\n tabMenuButton: {\n position: 'absolute',\n top: 0,\n right: 0,\n },\n tabChanged: {\n color: theme.palette.secondary.main,\n },\n tabText: {\n maxWidth: 130,\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n display: 'inline-block',\n verticalAlign: 'middle',\n },\n tabChangedIcon: {\n color: '#FF0000',\n fontSize: 16,\n marginLeft: 5,\n },\n closeButton: {\n marginLeft: 5,\n },\n notRunning: {\n color: '#ffbc00',\n marginRight: theme.spacing(1),\n marginLeft: theme.spacing(1),\n },\n tabButton: {\n minHeight: 48,\n },\n tabButtonWrapper: {\n display: 'inline-block',\n },\n menuIcon: {\n width: 18,\n height: 18,\n borderRadius: 2,\n marginRight: 5,\n },\n fullHeightDialog: {\n height: 'calc(100% - 100px)',\n },\n});\n\nclass Editor extends React.Component {\n constructor(props) {\n super(props);\n\n const selected = window.localStorage.getItem('Editor.selected') || '';\n let editing = window.localStorage.getItem('Editor.editing') || '[]';\n try {\n editing = JSON.parse(editing);\n } catch (e) {\n editing = [];\n }\n if (selected && !editing.includes(selected)) {\n editing.push(selected);\n }\n\n this.tabsRef = React.createRef();\n\n this.state = {\n selected,\n editing, // array of opened scripts\n changed: {}, // for every script\n blockly: null,\n rules: null,\n debugEnabled: false,\n verboseEnabled: false,\n showCompiledCode: false,\n showSelectId: false,\n showCron: false,\n showScript: false,\n showAstro: false,\n astroEvents: null,\n insert: '',\n searchText: '',\n themeType: this.props.themeType,\n visible: props.visible,\n cmdToBlockly: '',\n cmdToRules: '',\n menuOpened: !!this.props.menuOpened,\n menuTabsOpened: false,\n menuTabsAnchorEl: null,\n runningInstances: this.props.runningInstances || {},\n showDebugMenu: false,\n toast: '',\n instancesLoaded: false,\n isTourOpen: window.localStorage.getItem('tour') !== 'true',\n tourStep: STEPS.selectTriggers,\n showAdapterDebug: false,\n };\n\n this.setChangedInAdmin();\n\n /* ----------------------- */\n // required by selectIdDialog in Blockly\n this.selectId = {\n initValue: null,\n callback: null,\n };\n this.cron = {\n initValue: null,\n callback: null,\n };\n this.scriptDialog = {\n initValue: null,\n callback: null,\n args: null,\n isReturn: false,\n };\n\n window.systemLang = I18n.getLanguage();\n window.main = {\n objects: {},\n getObject: (id, cb) => this.props.socket.getObject(id).then(obj => cb && cb(null, obj)).catch(err => cb && cb(err)),\n instances: [],\n selectIdDialog: (initValue, type, cb) => {\n if (typeof type === 'function') {\n cb = type;\n type = null;\n }\n this.selectId.callback = cb;\n this.selectId.initValue = initValue;\n this.selectId.type = type;\n this.setState({ showSelectId: true });\n },\n cronDialog: (initValue, cb) => {\n this.cron.callback = cb;\n this.cron.initValue = initValue;\n this.setState({ showCron: true });\n },\n showScriptDialog: (value, args, isReturn, cb) => {\n this.scriptDialog.callback = cb;\n this.scriptDialog.initValue = value;\n this.scriptDialog.args = args;\n this.scriptDialog.isReturn = isReturn || false;\n this.setState({ showScript: true });\n }\n };\n\n this.objects = props.objects;\n /* ----------------------- */\n\n this.scripts = {};\n\n if (!this.state.selected && this.state.editing.length) {\n this.state.selected = this.state.editing[0];\n }\n\n this.getAllAdapterInstances()\n .then(() => {\n // to enable logging\n if (this.props.onSelectedChange && this.state.selected) {\n setTimeout(() => this.props.onSelectedChange(this.state.selected, this.state.editing), 100);\n }\n });\n }\n\n getAllAdapterInstances() {\n return this.props.socket.getAdapterInstances(true)\n .then(instanceObjects => {\n const objects = {};\n const instances = instanceObjects.map(obj => {\n objects[obj._id] = obj;\n return obj._id;\n });\n window.main.objects = objects;\n window.main.instances = instances;\n this.setState({ instancesLoaded: true });\n });\n }\n\n onInstanceChanged = (id, obj) => {\n if (!id) {\n return;\n }\n\n if (!obj && window.main.instances.includes[id]) {\n delete window.main.objects[id];\n const pos = window.main.instances.indexOf(id);\n window.main.instances.splice(pos, 1);\n } else\n if (obj && obj.type === 'instance') {\n // update instances\n if (!window.main.instances.includes(id)) {\n window.main.instances.push(id);\n window.main.instances.sort();\n }\n window.main.objects[id] = obj;\n }\n };\n\n setChangedInAdmin() {\n const isChanged = Object.keys(this.state.changed).find(id => this.state.changed[id]);\n\n if (typeof window.parent !== 'undefined' && window.parent) {\n window.parent.configNotSaved = !!isChanged;\n }\n }\n\n componentDidMount() {\n window.addEventListener('beforeunload', this.onBrowserClose, false);\n this.props.socket.subscribeObject('system.adapter.*', this.onInstanceChanged);\n }\n\n componentWillUnmount() {\n window.removeEventListener('beforeunload', this.onBrowserClose);\n this.props.socket.unsubscribeObject('system.adapter.*', this.onInstanceChanged);\n }\n\n onBrowserClose = e => {\n const isChanged = Object.keys(this.scripts).find(id =>\n JSON.stringify(this.scripts[id]) !== JSON.stringify(this.props.objects[id].common));\n\n if (!!isChanged) {\n console.log('Script ' + JSON.stringify(this.scripts[isChanged]));\n const message = I18n.t('Configuration not saved.');\n e = e || window.event;\n // For IE and Firefox\n if (e) {\n e.returnValue = message;\n }\n\n // For Safari\n return message;\n }\n };\n\n removeNonExistingScripts(nextProps, newState) {\n nextProps = nextProps || this.props;\n newState = newState || {};\n\n let _changed = false;\n if (this.state.editing) {\n const isAnyNonExists = this.state.editing.find(id => !nextProps.objects[id]);\n\n if (isAnyNonExists) {\n // remove non-existing scripts\n const editing = JSON.parse(JSON.stringify(this.state.editing));\n for (let i = editing.length - 1; i >= 0; i--) {\n if (!this.objects[editing[i]]) {\n _changed = true;\n editing.splice(i, 1);\n }\n }\n if (_changed) {\n newState.editing = editing;\n }\n if (this.state.selected && !this.objects[this.state.selected]) {\n _changed = true;\n newState.selected = editing[0] || '';\n if (this.scripts[newState.selected]) {\n if (this.state.blockly !== (this.scripts[newState.selected].engineType === 'Blockly')) {\n newState.blockly = this.scripts[newState.selected].engineType === 'Blockly';\n _changed = true;\n }\n if (this.state.rules !== (this.scripts[newState.selected].engineType === 'Rules')) {\n newState.rules = this.scripts[newState.selected].engineType === 'Rules';\n _changed = true;\n }\n if (this.state.verboseEnabled !== this.scripts[newState.selected].verbose) {\n newState.verboseEnabled = this.scripts[newState.selected].verbose;\n _changed = true;\n }\n if (this.state.debugEnabled !== this.scripts[newState.selected].debug) {\n newState.debugEnabled = this.scripts[newState.selected].debug;\n _changed = true;\n }\n }\n }\n }\n }\n return _changed;\n }\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n const newState = {};\n let _changed = false;\n\n if (JSON.stringify(nextProps.runningInstances) !== JSON.stringify(this.state.runningInstances)) {\n _changed = true;\n newState.runningInstances = nextProps.runningInstances;\n }\n\n if (this.state.menuOpened !== nextProps.menuOpened) {\n newState.menuOpened = nextProps.menuOpened;\n _changed = true;\n }\n\n if (this.state.themeType !== nextProps.themeType) {\n newState.themeType = nextProps.themeType;\n _changed = true;\n }\n\n // check if all opened files still exists\n if (this.removeNonExistingScripts(nextProps, newState)) {\n _changed = true;\n }\n\n // update search text\n if (this.state.searchText !== nextProps.searchText) {\n newState.searchText = nextProps.searchText;\n _changed = true;\n }\n\n // if objects read\n if (this.objects !== nextProps.objects) {\n this.objects = nextProps.objects;\n window.main.objects = nextProps.objects;\n\n // update all scripts\n Object.keys(this.scripts).forEach(id => {\n const source = this.scripts[id].source;\n this.scripts[id] = JSON.parse(JSON.stringify(this.objects[id].common));\n this.scripts[id].source = source;\n });\n\n // if a script is blockly\n if (this.state.selected && this.objects[this.state.selected]) {\n this.scripts[this.state.selected] = this.scripts[this.state.selected] || JSON.parse(JSON.stringify(this.objects[this.state.selected].common));\n if (this.state.blockly !== (this.scripts[this.state.selected].engineType === 'Blockly')) {\n newState.blockly = this.scripts[this.state.selected].engineType === 'Blockly';\n _changed = true;\n }\n if (this.state.rules !== (this.scripts[this.state.selected].engineType === 'Rules')) {\n newState.rules = this.scripts[this.state.selected].engineType === 'Rules';\n _changed = true;\n }\n if (this.state.verboseEnabled !== this.scripts[this.state.selected].verbose) {\n newState.verboseEnabled = this.scripts[this.state.selected].verbose;\n _changed = true;\n }\n if (this.state.debugEnabled !== this.scripts[this.state.selected].debug) {\n newState.debugEnabled = this.scripts[this.state.selected].debug;\n _changed = true;\n }\n }\n\n // remove non-existing scripts\n const editing = JSON.parse(JSON.stringify(this.state.editing));\n for (let i = editing.length - 1; i >= 0; i--) {\n if (!this.objects[editing[i]]) {\n _changed = true;\n editing.splice(i, 1);\n if (this.state.changed[editing[i]] !== undefined) {\n newState.changed = newState.changed || JSON.parse(JSON.stringify(this.state.changed));\n delete newState.changed[editing[i]];\n }\n }\n }\n if (this.state.selected && !this.objects[this.state.selected]) {\n newState.selected = editing[0] || '';\n }\n if (_changed) {\n newState.editing = editing;\n }\n } else {\n // update all scripts\n for (const id in this.scripts) {\n if (!this.scripts.hasOwnProperty(id)) continue;\n if (this.objects[id] && this.objects[id].common) {\n const oldSource = this.scripts[id].source;\n const commonLocal = JSON.parse(JSON.stringify(this.scripts[id]));\n commonLocal.source = this.objects[id].common.source;\n // if anything except source was changed\n if (JSON.stringify(commonLocal) !== JSON.stringify(this.objects[id].common)) {\n this.scripts[id] = JSON.parse(JSON.stringify(this.objects[id].common));\n this.scripts[id].source = oldSource;\n }\n\n if (oldSource !== this.objects[id].common.source) {\n // take new script if it not yet changed\n if (!this.state.changed[id]) {\n // just use new value\n this.scripts[id].source = this.objects[id].common.source;\n } else {\n if (this.objects[id].from && this.objects[id].from.startsWith('system.adapter.javascript.')) {\n this.objects[id].from = 'system.adapter.admin.0';\n // show that script was changed from outside\n this.setState({ toast: I18n.t('Script %s was modified on disk.', id.split('.').pop()) });\n }\n }\n } else {\n if (this.state.changed[id]) {\n newState.changed = newState.changed || JSON.parse(JSON.stringify(this.state.changed));\n newState.changed[id] = false;\n _changed = true;\n }\n }\n } else {\n delete this.scripts[id];\n if (this.state.selected === id) {\n if (this.state.editing.indexOf(id) !== -1) {\n const editing = JSON.parse(JSON.stringify(this.state.editing));\n const pos = editing.indexOf(id);\n if (pos !== -1) {\n editing.splice(pos, 1);\n newState.editing = editing;\n _changed = true;\n }\n }\n newState.selected = this.state.editing[0] || '';\n _changed = true;\n }\n }\n }\n }\n\n if (this.state.selected !== nextProps.selected && nextProps.selected) {\n if (nextProps.selected) {\n this.scripts[nextProps.selected] = this.scripts[nextProps.selected] || JSON.parse(JSON.stringify(this.props.objects[nextProps.selected].common));\n }\n\n const nextCommon = this.props.objects[nextProps.selected] && this.props.objects[nextProps.selected].common;\n\n const changed = nextCommon && JSON.stringify(this.scripts[nextProps.selected]) !== JSON.stringify(nextCommon);\n\n const editing = JSON.parse(JSON.stringify(this.state.editing));\n if (nextProps.selected && editing.indexOf(nextProps.selected) === -1) {\n editing.push(nextProps.selected);\n this.props.onSelectedChange(nextProps.selected, editing);\n window.localStorage && window.localStorage.setItem('Editor.editing', JSON.stringify(editing));\n }\n\n _changed = true;\n newState.changed = newState.changed || JSON.parse(JSON.stringify(this.state.changed));\n newState.changed[nextProps.selected] = changed;\n newState.editing = editing;\n newState.selected = nextProps.selected;\n newState.blockly = this.scripts[nextProps.selected].engineType === 'Blockly';\n newState.rules = this.scripts[nextProps.selected].engineType === 'Rules';\n newState.verboseEnabled = this.scripts[nextProps.selected].verbose;\n newState.debugEnabled = this.scripts[nextProps.selected].debug;\n newState.showCompiledCode = false;\n } else {\n\n }\n\n if (this.state.visible !== nextProps.visible) {\n _changed = true;\n newState.visible = nextProps.visible;\n }\n\n _changed && this.setState(newState, () => this.setChangedInAdmin());\n }\n\n onRestart() {\n this.props.onRestart && this.props.onRestart(this.state.selected);\n }\n\n onStartStop() {\n const common = JSON.parse(JSON.stringify(this.scripts[this.state.selected]));\n common.enabled = !common.enabled;\n this.props.onChange && this.props.onChange(this.state.selected, common);\n }\n\n onSave() {\n if (this.state.isTourOpen && this.state.tourStep === STEPS.saveTheScript) {\n this.setState({ isTourOpen: false });\n window.localStorage.setItem('tour', 'true');\n }\n\n if (this.state.changed[this.state.selected]) {\n const changed = JSON.parse(JSON.stringify(this.state.changed));\n changed[this.state.selected] = false;\n this.setState({ changed }, () => {\n this.setChangedInAdmin();\n this.props.onChange && this.props.onChange(this.state.selected, this.scripts[this.state.selected]);\n });\n }\n }\n\n onSaveAll() {\n const changed = JSON.parse(JSON.stringify(this.state.changed));\n Object.keys(changed)\n .forEach(id => {\n if (changed[id]) {\n changed[id] = false;\n this.props.onChange && this.props.onChange(id, this.scripts[id]);\n }\n });\n\n this.setState({ changed }, () =>\n this.setChangedInAdmin());\n }\n\n onCancel() {\n this.scripts[this.state.selected] = JSON.parse(JSON.stringify(this.props.objects[this.state.selected].common));\n\n const changed = JSON.parse(JSON.stringify(this.state.changed));\n changed[this.state.selected] = false;\n\n this.setState({ changed }, () => this.setChangedInAdmin());\n }\n\n onRegisterSelect(func) {\n this.getSelect = func;\n }\n\n onConvertBlockly2JS() {\n this.showConfirmDialog(I18n.t('It will not be possible to revert this operation.'), result => {\n if (result) {\n this.scripts[this.state.selected].engineType = 'Javascript/js';\n let source = this.scripts[this.state.selected].source;\n const lines = source.split('\\n');\n lines.pop();\n this.scripts[this.state.selected].source = lines.join('\\n');\n const nowSelected = this.state.selected;\n\n const changed = JSON.parse(JSON.stringify(this.state.changed));\n changed[this.state.selected] = true;\n\n this.setState({ changed, blockly: false, selected: '' }, () => {\n this.setChangedInAdmin();\n // force update of the editor\n setTimeout(() => this.setState({ selected: nowSelected }), 100);\n });\n }\n });\n }\n\n onChange(options) {\n options = options || {};\n if (options.script !== undefined) {\n this.scripts[this.state.selected].source = options.script;\n }\n if (options.debug !== undefined) {\n this.scripts[this.state.selected].debug = options.debug;\n }\n if (options.verbose !== undefined) {\n this.scripts[this.state.selected].verbose = options.verbose;\n }\n const _changed = JSON.stringify(this.scripts[this.state.selected]) !== JSON.stringify(this.props.objects[this.state.selected].common);\n if (_changed !== (this.state.changed[this.state.selected] || false)) {\n const changed = JSON.parse(JSON.stringify(this.state.changed));\n changed[this.state.selected] = _changed;\n this.objects[this.state.selected].from = 'system.adapter.admin.0';\n this.setState({ changed }, () => this.setChangedInAdmin());\n }\n }\n\n onTabChange(event, selected) {\n if (this.props.debugMode) {\n return;\n }\n window.localStorage && window.localStorage.setItem('Editor.selected', selected);\n const common = this.scripts[selected] || (this.props.objects[selected] && this.props.objects[selected].common);\n this.setState({\n selected,\n rules: common.engineType === 'Rules',\n blockly: common.engineType === 'Blockly',\n showCompiledCode: false,\n verboseEnabled: common.verbose,\n debugEnabled: common.debug\n });\n this.props.onSelectedChange && this.props.onSelectedChange(selected, this.state.editing);\n }\n\n isScriptChanged(id) {\n return this.scripts[id] && this.props.objects[id] && JSON.stringify(this.scripts[id]) !== JSON.stringify(this.props.objects[id].common);\n }\n\n onTabClose(id, e) {\n e && e.stopPropagation();\n\n const pos = this.state.editing.indexOf(id);\n if (this.state.editing.includes(id)) {\n if (this.isScriptChanged(id)) {\n this.showConfirmDialog(I18n.t('Discard changes for %s', this.props.objects[id].common.name), ok => {\n if (ok) {\n delete this.scripts[id];\n this.onTabClose(id);\n }\n });\n } else {\n const editing = JSON.parse(JSON.stringify(this.state.editing));\n editing.splice(pos, 1);\n const newState = { editing };\n if (id === this.state.selected) {\n if (editing.length) {\n if (pos === 0 || editing.length === 1) {\n newState.selected = editing[0];\n } else {\n newState.selected = editing[pos - 1];\n }\n } else {\n newState.selected = '';\n }\n } else if (this.state.selected && !editing.length) {\n newState.selected = '';\n }\n window.localStorage && window.localStorage.setItem('Editor.editing', JSON.stringify(editing));\n if (newState.selected !== undefined) {\n newState.changed = newState.changed || JSON.parse(JSON.stringify(this.state.changed));\n newState.changed[newState.selected] = this.isScriptChanged(newState.selected);\n const common = newState.selected && (this.scripts[newState.selected] || (this.props.objects[newState.selected] && this.props.objects[newState.selected].common));\n newState.blockly = common ? common.engineType === 'Blockly' : false;\n newState.rules = common ? common.engineType === 'Rules' : false;\n newState.verboseEnabled = common ? common.verbose : false;\n newState.debugEnabled = common ? common.debug : false;\n newState.showCompiledCode = false;\n }\n\n this.setState(newState, () => {\n this.setChangedInAdmin();\n\n if (newState.selected !== undefined) {\n this.props.onSelectedChange && this.props.onSelectedChange(newState.selected, this.state.editing);\n window.localStorage && window.localStorage.setItem('Editor.selected', newState.selected);\n } else {\n this.props.onSelectedChange && this.props.onSelectedChange(this.state.selected, this.state.editing);\n }\n });\n }\n }\n }\n\n showConfirmDialog(question, cb) {\n this.confirmCallback = cb;\n this.setState({ confirm: question });\n }\n\n sendCommandToBlockly(cmd) {\n this.setState({ cmdToBlockly: cmd }, () =>\n setTimeout(() =>\n this.setState({ cmdToBlockly: '' }), 200));\n }\n\n sendCommandToRules(cmd) {\n this.setState({ cmdToRules: cmd }, () =>\n setTimeout(() =>\n this.setState({ cmdToRules: '' }), 200));\n }\n\n static getText(text) {\n if (typeof text === 'object') {\n return text[I18n.getLanguage()] || text.en;\n }\n return text;\n }\n\n getScriptFullName(id) {\n const parts = id.split('.');\n parts.shift(); // remove \"script.\"\n parts.shift(); // remove \"js.\"\n const result = [];\n let _id = 'script.js';\n for (let i = 0; i < parts.length; i++) {\n _id += `.${parts[i]}`;\n if (this.props.objects[_id] && this.props.objects[_id].common) {\n result.push(Editor.getText(this.props.objects[_id].common.name));\n } else {\n result.push(parts[i]);\n }\n }\n return `/ ${result.join(' / ')}`;\n }\n\n getTabs() {\n if (this.state.editing.length) {\n return [ this.onTabChange(event, value)}\n indicatorColor=\"primary\"\n style={{ position: 'relative', marginLeft: 10, width: this.state.editing.length > 1 ? 'calc(100% - 50px)' : '100%', display: 'inline-block' }}\n textColor=\"primary\"\n variant=\"scrollable\"\n scrollButtons=\"auto\"\n >\n {this.state.editing.map(id => {\n if (!this.props.objects[id]) {\n const label = [\n {id.split('.').pop()}
,\n this.onTabClose(id, e)} className={this.props.classes.closeButton} key=\"icon\" size=\"small\" component=\"span\">\n \n ];\n return ;\n } else {\n let text = Editor.getText(this.props.objects[id].common.name) || '';\n let title = this.getScriptFullName(id);\n if (text.length > 18) {\n text = `${text.substring(0, 15)}...`;\n }\n const changed = this.props.objects[id].common && this.scripts[id] && this.props.objects[id].common.source !== this.scripts[id].source;\n const label = [\n {text}
,\n changed ? ▣ : null,\n (!this.props.debugInstance && (!this.props.debugMode || this.state.selected !== id)) &&\n this.onTabClose(id, e)} className={this.props.classes.closeButton} key=\"icon\" size=\"small\" component=\"span\">\n \n ,\n ];\n\n return }\n href={`#${id}`}\n key={id}\n label={label}\n className={this.props.classes.tabButton}\n value={id}\n title={title}\n classes={{ wrapper: this.props.classes.tabButtonWrapper }}\n />;\n }\n })}\n {this.props.debugInstance ? : ''}\n ,\n this.state.editing.length > 1 ? {\n const editing = [this.state.selected];\n // Do not close not saved tabs\n Object.keys(this.scripts).forEach(id =>\n id !== this.state.selected &&\n JSON.stringify(this.scripts[id]) !== JSON.stringify(this.props.objects[id].common) &&\n editing.push(id)\n );\n\n window.localStorage && window.localStorage.setItem('Editor.editing', JSON.stringify(editing));\n this.setState({ menuTabsOpened: false, menuTabsAnchorEl: null, editing: editing });\n }}\n size=\"medium\">\n \n : null\n ];\n } else {\n return \n \n
;\n }\n }\n\n getDebugMenu() {\n if (!this.state.showDebugMenu) {\n return null;\n }\n\n return ;\n }\n\n getDebugBadge() {\n return [\n this.state.debugEnabled && this.state.verboseEnabled && ,\n this.state.debugEnabled && !this.state.verboseEnabled && ,\n !this.state.debugEnabled && this.state.verboseEnabled && ,\n ]\n }\n\n getAskAboutDebug() {\n if (this.state.askAboutDebug) {\n return {\n this.setState({ askAboutDebug: false }, () =>\n this.props.onDebugModeChange(true));\n }}\n ok={I18n.t('Yes')}\n cancel={I18n.t('Cancel')}\n text={I18n.t('The script will be stopped and must be activated manually after debugging. Continue?')}\n />;\n } else {\n return null;\n }\n }\n\n getToolbar() {\n const isInstanceRunning = this.state.selected && this.scripts[this.state.selected] && this.scripts[this.state.selected].engine && this.state.runningInstances[this.scripts[this.state.selected].engine];\n const isScriptRunning = this.state.selected && this.scripts[this.state.selected] && this.scripts[this.state.selected].enabled;\n\n if (this.state.selected) {\n const changedAll = Object.keys(this.state.changed).filter(id => this.state.changed[id]).length;\n const changed = this.state.changed[this.state.selected];\n return (\n \n {!this.props.debugInstance && this.state.menuOpened && this.props.onLocate && this.props.onLocate(this.state.selected)}\n size=\"medium\"\n >\n \n }\n {!this.props.debugInstance && !changed && isInstanceRunning && this.onRestart()}\n title={I18n.t('Restart')}\n size=\"medium\"\n >\n \n }\n {!this.props.debugInstance && !changed && this.onStartStop()}\n title={isScriptRunning ? I18n.t('Pause script') : I18n.t('Run script')}\n size=\"medium\"\n style={{ color: isScriptRunning ? COLOR_RUN : COLOR_PAUSE }}\n >\n {isScriptRunning ? : }\n }\n {!this.props.debugInstance && !changed && !isScriptRunning && {I18n.t('Script is not running')}}\n {!changed && isScriptRunning && !isInstanceRunning && {I18n.t('Instance is disabled')}}\n {changed && }\n {(changedAll > 1 || (changedAll === 1 && !changed)) && }\n {changed && }\n \n\n {this.state.blockly && !this.state.showCompiledCode &&\n this.sendCommandToBlockly('export')}\n size=\"medium\"\n >\n \n }\n\n {this.state.blockly && !this.state.showCompiledCode &&\n this.sendCommandToBlockly('import')}\n size=\"medium\"\n >\n \n }\n\n {this.state.blockly && !this.state.showCompiledCode &&\n this.sendCommandToBlockly('check')}\n size=\"medium\"\n >\n \n }\n\n {!this.props.debugMode && !this.state.blockly && !this.state.rules && !this.state.showCompiledCode && this.setState({ showCron: true })}\n size=\"medium\"\n >\n \n }\n {\n this.scripts[this.state.selected] &&\n this.scripts[this.state.selected].engineType !== 'Blockly' &&\n this.scripts[this.state.selected].engineType !== 'Rules' ?\n this.setState({ insert: code })}\n /> : null}\n {\n this.setState({ showAstro: true, astroEvents: null });\n\n this.props.socket.sendTo(this.scripts[this.state.selected].engine.replace('system.adapter.', ''), 'calcAstroAll', {})\n .then(astroEvents => this.setState({ astroEvents }));\n }}\n size=\"medium\"\n >\n \n \n\n {!this.props.debugMode && !this.state.blockly && !this.state.rules && !this.state.showCompiledCode && this.setState({ showSelectId: true })}\n size=\"medium\"\n >\n \n }\n\n {this.state.blockly && !this.state.rules && this.state.showCompiledCode && }\n {this.state.rules && !this.state.showCompiledCode &&\n this.sendCommandToRules('export')}\n size=\"medium\"\n >\n \n }\n {this.state.rules && !this.state.showCompiledCode &&\n this.sendCommandToRules('import')}\n size=\"medium\"\n >\n \n }\n\n {this.props.expertMode && !changed && (this.props.debugMode || (!this.state.blockly && !this.state.rules) || ((this.state.blockly || this.state.rules) && this.state.showCompiledCode)) && {\n if (!this.props.debugMode && isScriptRunning) {\n this.setState({ askAboutDebug: true })\n } else {\n this.props.onDebugModeChange(!this.props.debugMode);\n }\n }}\n size=\"medium\"\n >\n \n }\n\n {(this.state.blockly || this.state.rules) && }\n this.setState({ showDebugMenu: true, menuDebugAnchorEl: e.currentTarget })}\n size=\"medium\"\n >\n \n \n \n \n \n );\n } else {\n return null;\n }\n }\n\n getScriptEditor() {\n if (!this.props.debugMode &&\n this.state.selected &&\n this.props.objects[this.state.selected] &&\n this.state.blockly !== null &&\n (!this.state.blockly || this.state.showCompiledCode) &&\n (!this.state.rules || this.state.showCompiledCode)\n ) {\n this.scripts[this.state.selected] = this.scripts[this.state.selected] || JSON.parse(JSON.stringify(this.props.objects[this.state.selected].common));\n\n return \n this.setState({ insert: '' })}\n onForceSave={() => this.onSave()}\n searchText={this.state.searchText}\n onRegisterSelect={func => this.onRegisterSelect(func)}\n readOnly={this.state.showCompiledCode}\n changed={this.state.changed[this.state.selected]}\n code={this.scripts[this.state.selected].source || ''}\n isDark={this.state.themeType === 'dark'}\n socket={this.props.socket}\n runningInstances={this.state.runningInstances}\n onChange={newValue => this.onChange({ script: newValue })}\n language={this.scripts[this.state.selected].engineType === 'TypeScript/ts' ? 'typescript' : 'javascript'}\n />\n
;\n } else {\n return null;\n }\n }\n\n getBlocklyEditor() {\n if (!this.props.debugMode &&\n this.state.instancesLoaded &&\n this.state.selected &&\n this.props.objects[this.state.selected] &&\n this.state.blockly &&\n !this.state.showCompiledCode &&\n this.state.visible\n ) {\n this.scripts[this.state.selected] = this.scripts[this.state.selected] || JSON.parse(JSON.stringify(this.props.objects[this.state.selected].common));\n\n return \n this.onChange({ script: newValue })}\n />\n
;\n } else {\n return null;\n }\n }\n\n getRulesEditor() {\n if (!this.props.debugMode &&\n this.state.instancesLoaded &&\n this.state.selected &&\n this.props.objects[this.state.selected] &&\n this.state.rules &&\n !this.state.showCompiledCode &&\n this.state.visible\n ) {\n this.scripts[this.state.selected] = this.scripts[this.state.selected] || JSON.parse(JSON.stringify(this.props.objects[this.state.selected].common));\n const isInstanceRunning = this.state.selected && this.scripts[this.state.selected] && this.scripts[this.state.selected].engine && this.state.runningInstances[this.scripts[this.state.selected].engine];\n const isScriptRunning = this.state.selected && this.scripts[this.state.selected] && this.scripts[this.state.selected].enabled;\n\n return \n this.onChange({ script: newValue })}\n />\n
;\n } else {\n return null;\n }\n }\n\n getConfirmDialog() {\n if (this.state.confirm) {\n return {\n if (this.confirmCallback) {\n const cb = this.confirmCallback;\n this.confirmCallback = null;\n cb(result);\n }\n this.setState({ confirm: '' });\n }}\n />;\n } else {\n return null;\n }\n }\n\n getSelectIdDialog() {\n if (this.state.showSelectId) {\n let selectedId = this.selectId.callback ? this.selectId.initValue || '' : this.getSelect ? this.getSelect() : '';\n // it could be:\n // - 'id.xx'/* aksjdhsdf*/\n // - \"id.xx\"/* aksjdhsdf*/\n // - \"id.xx\"//\n let pos = selectedId.indexOf('/*');\n if (pos !== -1) {\n selectedId = selectedId.substring(0, pos);\n }\n pos = selectedId.indexOf('//');\n if (pos !== -1) {\n selectedId = selectedId.substring(0, pos);\n }\n let m = selectedId.match(/\"([^\"]+)\"/);\n if (m) {\n selectedId = m[1];\n }\n m = selectedId.match(/'([^']+)'/);\n if (m) {\n selectedId = m[1];\n }\n\n return {\n this.setState({ showSelectId: false });\n if (this.selectId.callback) {\n this.selectId.callback = null;\n }\n }}\n onOk={(selected, name) => {\n this.selectId.initValue = null;\n if (this.selectId.callback) {\n this.selectId.callback(selected);\n this.selectId.callback = null;\n } else {\n this.setState({ insert: `'${selected}'/*${name}*/` });\n }\n }}\n />;\n } else {\n return null;\n }\n }\n\n getCronDialog() {\n if (this.state.showCron) {\n return this.setState({ showCron: false })}\n onOk={cron => {\n this.cron.initValue = null;\n if (this.cron.callback) {\n this.cron.callback(cron);\n this.cron.callback = null;\n } else {\n this.setState({ insert: `'${cron}'` });\n }\n }}\n />;\n } else {\n return null;\n }\n }\n\n getAstroDialog() {\n if (this.state.showAstro) {\n return ;\n } else {\n return null;\n }\n }\n\n getEditorDialog() {\n if (this.state.showScript) {\n return {\n this.scriptDialog.initValue = null;\n if (this.scriptDialog.callback) {\n result !== false && this.scriptDialog.callback(result || '');\n this.scriptDialog.callback = null;\n }\n this.setState({ showScript: false });\n }}\n />;\n } else {\n return null;\n }\n }\n\n getToast() {\n return this.setState({ toast: '' })}\n ContentProps={{ 'aria-describedby': 'message-id' }}\n message={{this.state.toast}}\n action={[\n this.setState({ toast: '' })}\n size=\"medium\"\n >\n \n ,\n ]}\n />;\n }\n\n setTourStep = tourStep => this.setState({ tourStep });\n\n getTour() {\n if (this.state.instancesLoaded &&\n this.state.selected &&\n this.props.isAnyRulesExists === 1 &&\n this.props.objects[this.state.selected] &&\n this.state.rules &&\n this.state.visible) {\n return {\n this.setState({ isTourOpen: false });\n window.localStorage.setItem('tour', 'true');\n this.props.socket.setState('javascript.0.variables.rulesTour', { val: true, ack: true });\n }}\n //getCurrentStep={tourStep => this.setTourStep(tourStep)}\n goToStep={this.state.tourStep}\n />;\n }\n }\n\n getDebug() {\n if (this.props.debugMode) {\n const isInstanceRunning = this.state.selected && this.scripts[this.state.selected] && this.scripts[this.state.selected].engine && this.state.runningInstances[this.scripts[this.state.selected].engine];\n if (isInstanceRunning) {\n return ;\n } else {\n setTimeout(() => this.props.onDebugModeChange(false));\n return null;\n }\n } else {\n return null;\n }\n }\n\n render() {\n if (this.state.selected && this.props.objects[this.state.selected] && this.state.blockly === null && this.state.rules === null) {\n this.scripts[this.state.selected] = this.scripts[this.state.selected] || JSON.parse(JSON.stringify(this.props.objects[this.state.selected].common));\n setTimeout(() => {\n const newState = {\n blockly: this.scripts[this.state.selected].engineType === 'Blockly',\n rules: this.scripts[this.state.selected].engineType === 'Rules',\n showCompiledCode: false,\n debugEnabled: this.scripts[this.state.selected].debug,\n verboseEnabled: this.scripts[this.state.selected].verbose,\n };\n\n // check if all opened files still exists\n this.removeNonExistingScripts(null, newState);\n this.setState(newState);\n }, 100);\n }\n\n return [\n this.getTabs(),\n this.getToolbar(),\n this.getScriptEditor(),\n this.getAskAboutDebug(),\n this.getBlocklyEditor(),\n this.getRulesEditor(),\n this.getDebug(),\n this.getConfirmDialog(),\n this.getSelectIdDialog(),\n this.getCronDialog(),\n this.getEditorDialog(),\n this.getAstroDialog(),\n this.getDebugMenu(),\n this.getToast(),\n this.getTour(),\n ];\n }\n}\n\nEditor.propTypes = {\n objects: PropTypes.object.isRequired,\n instances: PropTypes.array.isRequired,\n adapterName: PropTypes.string.isRequired,\n selected: PropTypes.string.isRequired,\n onSelectedChange: PropTypes.func.isRequired,\n onRestart: PropTypes.func,\n onChange: PropTypes.func.isRequired,\n visible: PropTypes.bool,\n menuOpened: PropTypes.bool,\n onLocate: PropTypes.func,\n runningInstances: PropTypes.object,\n socket: PropTypes.object,\n searchText: PropTypes.string,\n themeName: PropTypes.string,\n themeType: PropTypes.string,\n onDebugModeChange: PropTypes.func,\n debugMode: PropTypes.bool,\n debugInstance: PropTypes.object,\n expertMode: PropTypes.bool,\n};\n\nexport default withStyles(styles)(Editor);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport withStyles from '@mui/styles/withStyles';\nimport Button from '@mui/material/Button';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogActions from '@mui/material/DialogActions';\nimport Dialog from '@mui/material/Dialog';\nimport Dropzone from 'react-dropzone';\nimport DialogError from './Error';\nimport {MdFileUpload as IconUpload} from 'react-icons/md';\nimport {MdCancel as IconNo} from 'react-icons/md';\nimport {MdPlusOne as IconPlus} from 'react-icons/md';\n\nimport IconCancel from '@mui/icons-material/Cancel';\n\nimport { I18n } from '@iobroker/adapter-react-v5';\n\nconst styles = theme => ({\n dialog: {\n height: '95%',\n },\n fullHeight: {\n height: '100%',\n overflow: 'hidden',\n },\n dropzone: {\n marginTop: 20,\n width: '100%',\n borderWidth: 5,\n borderStyle: 'dashed',\n borderColor: '#d0cccc',\n textAlign: 'center',\n boxSizing: 'border-box',\n paddingTop: 45,\n borderRadius: 10,\n height: 'calc(100% - 10px)',\n },\n dropzoneDiv: {\n width: '100%',\n height: '100%',\n },\n dropzoneRejected: {\n borderColor: '#970000',\n },\n dropzoneAccepted: {\n borderColor: '#17cd02',\n },\n icon: {\n height: '30%',\n width: '30%',\n color: '#eeeeee',\n position: 'absolute',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%,-50%)',\n zIndex: 0,\n },\n iconError: {\n color: '#ffc3c6',\n },\n iconOk: {\n color: '#aaeebc',\n },\n text: {\n top: '50%',\n left: '50%',\n transform: 'translate(-50%,-50%)',\n color: '#868686',\n position: 'absolute',\n zIndex: 1,\n },\n});\n\nclass DialogImportFile extends React.Component {\n\n constructor(props) {\n super(props);\n this.state = {\n error: '',\n imageStatus: ''\n };\n }\n\n componentDidMount() {\n setTimeout(() => {\n try {\n window.document.getElementById('import-text-area').focus();\n } catch (e) {\n\n }\n }, 100);\n }\n\n handleCancel () {\n this.props.onClose();\n }\n\n onChange(e) {\n this.setState({text: e.target.value});\n }\n\n static readFileDataUrl(file, cb) {\n const reader = new FileReader();\n reader.onload = () => {\n cb(null, {data: reader.result, name: file.name});\n };\n reader.onabort = () => {\n console.error('file reading was aborted');\n cb(I18n.t('file reading was aborted'));\n };\n reader.onerror = (e) => {\n console.error('file reading has failed');\n cb(I18n.t('file reading has failed: %s', e));\n };\n\n reader.readAsDataURL(file);\n }\n\n handleDropFile(files) {\n if (files && files.hasOwnProperty('target')) {\n files = files.target.files;\n }\n\n if (!files && !files.length) {\n return;\n }\n\n const file = files[files.length - 1];\n\n if (!file) {\n return;\n }\n DialogImportFile.readFileDataUrl(file, (err, result) => {\n if (err) {\n this.setState({error: err});\n } else {\n this.props.onClose(result && result.data);\n }\n });\n }\n\n render() {\n const classes = this.props.classes;\n const className = classes.dropzone + ' ' + (this.state.imageStatus === 'accepted' ? classes.dropzoneAccepted : (this.state.imageStatus === 'rejected' ? classes.dropzoneRejected : ''));\n\n return ;\n }\n}\n\nDialogImportFile.propTypes = {\n classes: PropTypes.object.isRequired,\n onClose: PropTypes.func,\n};\n\nexport default withStyles(styles)(DialogImportFile);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport withStyles from '@mui/styles/withStyles';\nimport SplitterLayout from 'react-splitter-layout';\n\nimport 'react-splitter-layout/lib/index.css';\n\nimport GenericApp from '@iobroker/adapter-react-v5/GenericApp';\nimport DialogMessage from '@iobroker/adapter-react-v5/Dialogs/Message';\nimport DialogConfirm from '@iobroker/adapter-react-v5/Dialogs/Confirm';\nimport { I18n, Utils, AdminConnection, Loader } from '@iobroker/adapter-react-v5';\n\nimport { MdMenu as IconMenuClosed } from 'react-icons/md';\nimport { MdArrowBack as IconMenuOpened } from 'react-icons/md';\nimport { MdVisibility as IconShowLog } from 'react-icons/md';\n\nimport SideMenu from './SideMenu';\nimport Log from './Log';\nimport Editor from './Editor';\nimport DialogError from './Dialogs/Error';\nimport DialogImportFile from './Dialogs/ImportFile';\nimport BlocklyEditor from './Components/BlocklyEditor';\nimport { ContextWrapper } from './Components/RulesEditor/components/ContextWrapper';\n\nconst styles = theme => ({\n root: {\n flexGrow: 1,\n display: 'flex',\n width: '100%',\n height: '100%',\n },\n menuDiv: {\n overflow: 'hidden',\n },\n splitterDivs: {\n '&>div': {\n overflow: 'hidden',\n width: '100%',\n height: '100%',\n },\n '& .layout-splitter': {\n background: theme.palette.mode === 'dark' ? '#595858' : '#ccc;',\n },\n },\n mainDiv: {\n width: '100%',\n height: '100%',\n overflow: 'hidden',\n },\n /*\n appBarWithMenu: {\n width: `calc(100% - ${Theme.menu.width}px)`,\n marginLeft: Theme.menu.width,\n },\n appBarWithoutMenu: {\n width: `100%`,\n marginLeft: 0,\n },\n */\n content: {\n width: '100%',\n height: '100%',\n backgroundColor: theme.palette.background && theme.palette.background.default,\n position: 'relative',\n },\n splitterDivWithMenu: {\n width: `calc(100% - 300px)`,\n height: '100%',\n },\n menuDivWithoutMenu: {\n '&>div:first-child': {\n display: 'none',\n },\n '&>.layout-splitter': {\n display: 'none',\n },\n },\n progress: {\n margin: 100,\n },\n menuOpenCloseButton: {\n position: 'absolute',\n left: 0,\n borderRadius: '0 5px 5px 0',\n top: 6,\n paddingTop: 8,\n cursor: 'pointer',\n zIndex: 1,\n height: 25,\n width: 20,\n background: theme.palette.secondary.main,\n color: theme.palette.primary.main,\n paddingLeft: 3,\n '&:hover': {\n color: 'white',\n },\n },\n showLogButton: {\n position: 'absolute',\n right: 3,\n borderRadius: '5px 5px 0 0',\n bottom: 0,\n paddingTop: 3,\n cursor: 'pointer',\n zIndex: 10,\n height: 20,\n width: 25,\n background: theme.palette.secondary.main,\n color: theme.palette.primary.main,\n paddingLeft: 8,\n '&:hover': {\n color: 'white',\n },\n },\n});\n\nclass App extends GenericApp {\n constructor(props) {\n super(props, {\n Connection: AdminConnection,\n translations: {\n en: require('./i18n/en'),\n de: require('./i18n/de'),\n es: require('./i18n/es'),\n fr: require('./i18n/fr'),\n it: require('./i18n/it'),\n nl: require('./i18n/nl'),\n pl: require('./i18n/pl'),\n pt: require('./i18n/pt'),\n ru: require('./i18n/ru'),\n uk: require('./i18n/uk'),\n 'zh-cn': require('./i18n/zh-cn'),\n },\n bottomButtons: false,\n socket: {\n autoSubscribeLog: true,\n },\n sentryDSN: window.sentryDSN,\n });\n\n // this.logIndex = 0;\n this.logSize = window.localStorage ? parseFloat(window.localStorage.getItem('App.logSize')) || 150 : 150;\n this.menuSize = window.localStorage ? parseFloat(window.localStorage.getItem('App.menuSize')) || 500 : 500;\n this.hosts = [];\n this.importFile = null;\n this.scripts = {};\n\n window.alert = message => {\n console.error(message);\n this.showError(message.toString());\n };\n }\n\n onScriptsChanged = (id, obj) => {\n if (!id) {\n return;\n }\n let changed = false;\n const newState = {};\n if (id.startsWith('script.js.')) {\n if (obj) {\n if (JSON.stringify(this.scripts[id]) !== JSON.stringify(obj)) {\n this.scripts[id] = obj;\n changed = true;\n newState.scriptsHash = this.state.scriptsHash + 1;\n }\n } else if (this.scripts[id]) {\n delete this.scripts[id];\n changed = true;\n newState.scriptsHash = this.state.scriptsHash + 1;\n }\n }\n\n changed && this.setState(newState);\n };\n\n onInstanceChanged = (id, obj) => {\n if (!id) {\n return;\n }\n let changed = false;\n const newState = {};\n\n if (id.match(/^system\\.adapter\\.[-_\\w\\d]+\\$/)) {\n // update instances\n if (id.startsWith(`system.adapter.${this.adapterName}.`)) {\n if (obj && obj.type === 'instance') {\n if (!this.state.instances.includes(id)) {\n newState.instances = [...this.state.instances];\n newState.instances.push(id);\n newState.instances.sort();\n changed = true;\n // request alive\n this.socket.subscribeState(`${obj._id}.alive`, this.onInstanceAliveChange);\n }\n } else if (!obj && this.state.instances.includes(id)) {\n this.socket.unsubscribeState(`${id}.alive`, this.onInstanceAliveChange);\n newState.instances = [...this.state.instances];\n const pos = newState.instances.indexOf(id);\n newState.instances.splice(pos, 1);\n changed = true;\n }\n }\n\n if (obj && obj[id].common && obj[id].common.blockly) {\n this.confirmCallback = result => result && window.location.reload();\n newState.confirm = I18n.t('Some blocks were updated. Reload admin?');\n changed = true;\n }\n }\n\n changed && this.setState(newState);\n };\n\n onHostChanged = (id, obj) => {\n if (!id) {\n return;\n }\n let changed = false;\n const newState = {};\n\n if (id.startsWith('system.host.')) {\n if (obj && obj.type === 'host') {\n if (!this.hosts.includes(id)) {\n this.hosts.push(id);\n this.hosts.sort();\n }\n } else if (!obj && this.hosts.includes(id)) {\n const pos = this.hosts.indexOf(id);\n this.hosts.splice(pos, 1);\n }\n }\n\n changed && this.setState(newState);\n };\n\n onConnectionReady() {\n window.systemLang = this.socket.systemLang;\n this.setState({\n ready: false,\n updateScripts: 0,\n scriptsHash: 0,\n instances: [],\n updating: false,\n resizing: false,\n selected: null,\n logMessage: {},\n editing: [],\n menuOpened: window.localStorage.getItem('App.menuOpened') !== 'false',\n menuSelectId: '',\n expertMode: window.localStorage.getItem('App.expertMode') === 'true',\n logHorzLayout: window.localStorage.getItem('App.logHorzLayout') === 'true',\n runningInstances: {},\n confirm: '',\n importFile: false,\n message: '',\n searchText: '',\n hideLog: window.localStorage.getItem('App.hideLog') === 'true',\n debugMode: false,\n debugInstance: null,\n });\n\n const newState = {};\n\n // load instances & scripts\n // Read all instances\n this.subscribeOnInstances()\n .then(result => {\n newState.instances = result.instances;\n newState.runningInstances = result.runningInstances;\n\n return this.readAdaptersWithBlockly();\n })\n .then(() => this.socket.getHosts())\n .then(hosts => {\n this.hosts = hosts.map(obj => obj._id);\n // load all scripts\n return this.readAllScripts();\n })\n .then(scripts => {\n if (window.localStorage && window.localStorage.getItem('App.expertMode') !== 'true' && window.localStorage.getItem('App.expertMode') !== 'false') {\n // detect if some global scripts exists\n if (Object.keys(scripts).find(id => id.startsWith('script.js.global.') && scripts.type === 'script')) {\n newState.expertMode = true;\n }\n }\n this.scripts = scripts;\n\n let scriptsHash = this.state.scriptsHash;\n if (this.compareScripts(scripts)) {\n scriptsHash++;\n }\n newState.scriptsHash = scriptsHash;\n newState.ready = true;\n this.socket.subscribeObject('script.*', this.onScriptsChanged);\n this.socket.subscribeObject('system.adapter.*', this.onInstanceChanged);\n this.socket.subscribeObject('system.host.*', this.onHostChanged);\n\n this.setState(newState);\n });\n }\n\n subscribeOnInstances() {\n return this.socket.getAdapterInstances(this.adapterName)\n .then(instancesArray => {\n const instances = instancesArray.map(obj => parseInt(obj._id.split('.').pop())).sort();\n const runningInstances = {};\n instances.forEach(id => runningInstances[`system.adapter.${this.adapterName}.${id}`] = false);\n\n const promises = [];\n\n // subscribe on instances\n instances.forEach(instance => {\n const instanceId = `system.adapter.${this.adapterName}.${instance}`;\n const id = `${instanceId}.alive`;\n promises.push(this.socket.getState(id)\n .then(state => {\n runningInstances[instanceId] = state ? state.val : false;\n this.socket.subscribeState(id, this.onInstanceAliveChange);\n }));\n });\n\n return Promise.all(promises)\n .then(() => ({ instances, runningInstances }));\n })\n }\n\n readAllScripts() {\n return this.socket.getObjectView('script.js.', 'script.js.\\u9999', 'channel')\n .then(folders =>\n this.socket.getObjectView('script.js.', 'script.js.\\u9999', 'script')\n .then(scripts => {\n Object.keys(scripts).forEach(id => folders[id] = scripts[id]);\n return folders;\n }));\n }\n\n readAdaptersWithBlockly() {\n return this.socket.getObjectView('system.adapter.', 'system.adapter.\\u9999', 'adapter')\n .then(adapters =>\n new Promise(resolve =>\n BlocklyEditor.loadCustomBlockly(adapters, () => resolve())));\n }\n\n onInstanceAliveChange = (id, state) => {\n if (id) {\n id = id && id.substring(0, id.length - 6); // - .alive\n\n if (this.state.runningInstances[id] !== (state ? state.val : false)) {\n const runningInstances = JSON.parse(JSON.stringify(this.state.runningInstances));\n runningInstances[id] = state ? state.val : false;\n this.setState({ runningInstances });\n }\n }\n };\n\n onToggleExpertMode(expertMode) {\n this.onExpertModeChange(expertMode);\n }\n\n compareScripts(newScripts) {\n const oldIds = Object.keys(this.scripts);\n const newIds = Object.keys(newScripts);\n if (oldIds.length !== newIds.length) {\n this.scripts = this.newScripts;\n return true;\n }\n if (JSON.stringify(oldIds) !== JSON.stringify(newIds)) {\n this.scripts = this.newScripts;\n return true;\n }\n for (let i = 0; i < oldIds.length; i++) {\n let oldScript = this.scripts[oldIds[i]].common;\n let newScript = newScripts[oldIds[i]].common;\n if (oldScript.name !== newScript.name) {\n this.scripts = this.newScripts;\n return true;\n }\n if (oldScript.engine !== newScript.engine) {\n this.scripts = this.newScripts;\n return true;\n }\n if (oldScript.engineType !== newScript.engineType) {\n this.scripts = this.newScripts;\n return true;\n }\n if (oldScript.enabled !== newScript.enabled) {\n this.scripts = this.newScripts;\n return true;\n }\n }\n }\n\n onRename(oldId, newId, newName, newInstance) {\n if (newId.trim().endsWith('.')) {\n newId = newId.replace(/\\.\\s*$/, '_');\n }\n console.log(`Rename ${oldId} => ${newId}`);\n let promise;\n this.setState({ updating: true });\n\n // Rename script.js.common.Skript_1 => script.js.common.New folder.Skript_1\n\n if (this.scripts[oldId] && this.scripts[oldId].type === 'script') {\n const common = JSON.parse(JSON.stringify(this.scripts[oldId].common));\n common.name = newName || common.name;\n if (newInstance !== undefined) {\n common.engine = `system.adapter.javascript.${newInstance}`;\n }\n // Check if the script is not a children of other script\n const parts = newId.split('.');\n parts.pop();\n const parentID = parts.join('.');\n\n if (this.scripts[parentID] && this.scripts[parentID].type === 'script') {\n parts.pop();\n newId = `${parts.join('.')}.${newId.split('.').pop()}`;\n }\n\n promise = this.updateScript(oldId, newId, common);\n } else {\n promise = this.renameGroup(oldId, newId, newName);\n }\n\n promise\n .then(() => this.setState({ updating: false }))\n .catch(err => err !== 'canceled' && this.showError(err));\n }\n\n renameGroup(id, newId, newName, _list) {\n if (!_list) {\n _list = [];\n\n // collect all elements to rename\n // find all elements\n _list = Object.keys(this.scripts).filter(_id => _id.startsWith(`${id}.`));\n\n return this.socket.getObject(id)\n .then(obj => {\n obj = obj || { common: {} };\n obj.common.name = newName || obj.common.name || id.split('.').pop();\n obj._id = newId;\n\n this.socket.delObject(id)\n .catch(() => { })\n .then(() => this.socket.setObject(newId, obj))\n .then(() => this.renameGroup(id, newId, newName, _list))\n .catch(e => console.log(e));\n })\n .catch(e => {\n console.log(e);\n const obj = {\n _id: newId,\n type: 'channel',\n common: {\n name: newName || id.split('.').pop(),\n expert: true,\n },\n native: {},\n };\n // may be it is virtual folder\n return this.socket.setObject(newId, obj)\n .then(() => this.renameGroup(id, newId, newName, _list));\n });\n } else if (_list.length) {\n let nId = _list.pop();\n\n return this.socket.getObject(nId)\n .then(obj =>\n this.socket.delObject(nId)\n .catch(() => { })\n .then(() => {\n nId = newId + nId.substring(id.length);\n obj._id = nId;\n obj.common = obj.common || {};\n obj.common.expert = true;\n return this.socket.setObject(nId, obj);\n })\n .then(() => this.renameGroup(id, newId, newName, _list))\n );\n } else {\n return Promise.resolve();\n }\n }\n\n onUpdateScript(id, common) {\n if (this.scripts[id] && this.scripts[id].type === 'script') {\n this.updateScript(id, id, common)\n .then(() => { })\n .catch(err => err !== 'canceled' && this.showError(err));\n }\n }\n\n onSelect(selected) {\n if (this.scripts[selected] && this.scripts[selected].common && this.scripts[selected].type === 'script') {\n this.setState({ selected, menuSelectId: selected }, () =>\n setTimeout(() => this.setState({ menuSelectId: '' })), 300);\n }\n }\n\n onExpertModeChange(expertMode) {\n if (this.state.expertMode !== expertMode) {\n window.localStorage && window.localStorage.setItem('App.expertMode', expertMode ? 'true' : 'false');\n this.setState({ expertMode });\n }\n }\n\n showError(err) {\n this.setState({ errorText: err ? err.toString() : '' });\n }\n\n showMessage(message) {\n this.setState({ message: message ? message.toString() : '' });\n }\n\n onDelete(id) {\n this.socket.delObject(id)\n .then(() => { })\n .catch(err =>\n this.showError(err));\n }\n\n onEdit(id) {\n if (this.state.selected !== id) {\n this.setState({ selected: id });\n }\n }\n\n onAddNew(id, name, isFolder, instance, type, source) {\n const reg = new RegExp(`^${id}\\\\.`);\n\n if (Object.keys(this.scripts).find(_id => id === _id || reg.test(id))) {\n return this.showError(I18n.t('Yet exists!'));\n }\n\n if (isFolder) {\n this.socket.setObject(id, {\n common: {\n name,\n expert: true,\n },\n type: 'channel',\n })\n .then(() =>\n setTimeout(() => this.setState({ menuSelectId: id }, () =>\n setTimeout(() => this.setState({ menuSelectId: '' })), 300), 1000))\n .catch(err => this.showError(err));\n } else {\n this.socket.setObject(id, {\n common: {\n name,\n expert: true,\n engineType: type,\n engine: `system.adapter.javascript.${instance || 0}`,\n source: source || '',\n debug: false,\n verbose: false,\n },\n type: 'script',\n })\n .then(() => setTimeout(() => this.onSelect(id), 1000))\n .catch(err => this.showError(err));\n }\n }\n\n updateScript(oldId, newId, newCommon) {\n return this.socket.getObject(oldId)\n .then(_obj => {\n const obj = { common: {} };\n\n if (newCommon.engine !== undefined) obj.common.engine = newCommon.engine;\n if (newCommon.enabled !== undefined) obj.common.enabled = newCommon.enabled;\n if (newCommon.source !== undefined) obj.common.source = newCommon.source;\n if (newCommon.debug !== undefined) obj.common.debug = newCommon.debug;\n if (newCommon.verbose !== undefined) obj.common.verbose = newCommon.verbose;\n\n obj.from = 'system.adapter.admin.0'; // we must distinguish between GUI(admin.0) and disk(javascript.0)\n\n if (oldId === newId && _obj && _obj.common && newCommon.name === _obj.common.name) {\n if (!newCommon.engineType || newCommon.engineType !== _obj.common.engineType) {\n if (newCommon.engineType !== undefined) {\n obj.common.engineType = newCommon.engineType || 'Javascript/js';\n }\n }\n obj.type = 'script';\n return this.socket.extendObject(oldId, obj);\n } else {\n // let prefix;\n\n // let parts = _obj.common.engineType.split('/');\n\n // prefix = 'script.' + (parts[1] || parts[0]) + '.';\n\n if (_obj && _obj.common) {\n _obj.common.engineType = newCommon.engineType || _obj.common.engineType || 'Javascript/js';\n return this.socket.delObject(oldId)\n .then(() => {\n if (obj.common.engine !== undefined) _obj.common.engine = obj.common.engine;\n if (obj.common.enabled !== undefined) _obj.common.enabled = obj.common.enabled;\n if (obj.common.source !== undefined) _obj.common.source = obj.common.source;\n if (obj.common.name !== undefined) _obj.common.name = obj.common.name;\n if (obj.common.debug !== undefined) _obj.common.debug = obj.common.debug;\n if (obj.common.verbose !== undefined) _obj.common.verbose = obj.common.verbose;\n\n delete _obj._rev;\n\n // Name must always exist\n _obj.common.name = newCommon.name;\n _obj.common.expert = true;\n _obj.type = 'script';\n\n _obj._id = newId; // prefix + newCommon.name.replace(/[\\s\"']/g, '_');\n\n this.socket.setObject(newId, _obj);\n });\n } else {\n _obj = obj;\n }\n\n // Name must always exist\n _obj.common.name = newCommon.name;\n _obj.common.expert = true;\n _obj.type = 'script';\n _obj._id = newId; // prefix + newCommon.name.replace(/[\\s\"']/g, '_');\n\n return this.socket.setObject(newId, _obj);\n }\n });\n }\n\n onEnableDisable(id, enabled) {\n if (this.scripts[id] && this.scripts[id].type === 'script') {\n const common = this.scripts[id].common;\n common.enabled = enabled;\n common.expert = true;\n this.updateScript(id, id, common)\n .catch(err => err !== 'canceled' && this.showError(err));\n }\n }\n\n getLiveHost(cb, _list) {\n if (!_list) {\n _list = this.hosts ? [...this.hosts] : [];\n }\n\n if (_list.length) {\n const id = _list.shift();\n this.socket.getState(`${id}.alive`)\n .then(state => {\n if (state && state.val) {\n cb(id);\n } else {\n setTimeout(() => this.getLiveHost(cb, _list));\n }\n });\n } else {\n cb();\n }\n }\n\n onExport() {\n this.getLiveHost(host => {\n if (!host) {\n return this.showError(I18n.t('No active host found'));\n }\n\n const d = new Date();\n let date = d.getFullYear();\n let m = d.getMonth() + 1;\n if (m < 10) {\n m = `0${m}`;\n }\n date += `-${m}`;\n m = d.getDate();\n if (m < 10) {\n m = `0${m}`;\n }\n date += `-${m}-`;\n\n this.socket.getRawSocket().emit('sendToHost', host, 'readObjectsAsZip', {\n adapter: 'javascript',\n id: 'script.js',\n link: `${date}scripts.zip`, // request link to file and not the data itself\n fileStorageNamespace: `admin.${this.instance}`, // new controller 5.x understands this and saves ZIP in the file store\n }, data => {\n if (typeof data === 'string') {\n // it is a link to the created file\n const a = document.createElement('a');\n if (data.startsWith('admin.')) {\n // new controller\n // actual position is http://IP:8081/adapter/javascript/index.html\n // we need http://IP:8081/files/admin.0/zip/2023-06-20-scripts.zip\n a.href = `../../files/${data}`;\n } else {\n // the data is \"system.host.HOST.zip.2020-01-26-scripts.zip\"\n const parts = data.split('.zip.');\n a.href = `./zip/${parts[0]}/${parts[1]}`;\n }\n document.body.appendChild(a);\n a.click();\n a.remove();\n } else {\n data.error && this.showError(data.error);\n if (data.data) {\n const a = document.createElement('a');\n a.href = `data: application/zip;base64,${data.data}`;\n a.download = `${date}scripts.zip`;\n document.body.appendChild(a);\n a.click();\n a.remove();\n }\n }\n });\n });\n }\n\n onImport(data) {\n this.importFile = data;\n if (data) {\n this.confirmCallback = this.onImportConfirmed.bind(this);\n this.setState({ importFile: false, confirm: I18n.t('Existing scripts will be overwritten.') });\n } else {\n this.setState({ importFile: false });\n }\n }\n\n onImportConfirmed(ok) {\n let data = this.importFile;\n this.importFile = null;\n if (ok && data) {\n data = data.split(',')[1];\n this.getLiveHost(host => {\n if (!host) {\n this.showError(I18n.t('No active host found'));\n return;\n }\n this.socket.getRawSocket().emit('sendToHost', host, 'writeObjectsAsZip', {\n data: data,\n adapter: 'javascript',\n id: 'script.js'\n }, data => {\n if (data === 'permissionError') {\n this.showError(I18n.t(data));\n } else if (!data || data.error) {\n this.showError(data ? I18n.t(data.error) : I18n.t('Unknown error'));\n } else {\n this.showMessage(I18n.t('Done'));\n }\n });\n });\n }\n }\n\n toggleLogLayout() {\n window.localStorage && window.localStorage.setItem('App.logHorzLayout', this.state.logHorzLayout ? 'false' : 'true');\n this.setState({ logHorzLayout: !this.state.logHorzLayout });\n }\n\n renderEditor() {\n const isAnyRulesExists = Object.keys(this.scripts).reduce((sum, id) =>\n sum + (this.scripts[id].common.engineType === 'Rules' ? 1 : 0), 0);\n\n return {\n if (!value) {\n this.setState({debugMode: false, debugInstance: null});\n } else {\n this.setState({debugMode: true});\n }\n }}\n visible={!this.state.resizing}\n socket={this.socket}\n adapterName={this.adapterName}\n onLocate={menuSelectId => this.setState({ menuSelectId })}\n runningInstances={this.state.runningInstances}\n menuOpened={this.state.menuOpened}\n searchText={this.state.searchText}\n themeType={this.state.themeType}\n themeName={this.state.themeName}\n theme={this.state.theme}\n expertMode={this.state.expertMode}\n onChange={(id, common) => this.onUpdateScript(id, common)}\n isAnyRulesExists={isAnyRulesExists}\n debugInstance={this.state.debugInstance}\n onSelectedChange={(id, editing) => {\n const newState = {};\n let changed = false;\n if (id !== this.state.selected) {\n changed = true;\n newState.selected = id;\n }\n if (JSON.stringify(editing) !== JSON.stringify(this.state.editing)) {\n changed = true;\n newState.editing = JSON.parse(JSON.stringify(editing));\n }\n changed && this.setState(newState);\n }}\n onRestart={id => this.socket.extendObject(id, { common: { enabled: true } })}\n selected={this.state.selected && this.scripts[this.state.selected] && this.scripts[this.state.selected].type === 'script' ? this.state.selected : ''}\n objects={this.scripts}\n instances={this.state.instances}\n />;\n }\n\n showLogButton() {\n return {\n window.localStorage.setItem('App.hideLog', 'false');\n this.setState({ hideLog: false, resizing: true });\n setTimeout(() => this.setState({ resizing: false }), 300);\n }}\n >\n \n
;\n }\n\n renderErrorDialog() {\n return this.state.errorText ?\n this.setState({ errorText: '' })}\n text={this.state.errorText}\n /> :\n null;\n }\n\n renderMain() {\n const { classes } = this.props;\n return [\n this.state.message ? this.setState({ message: '' })} text={this.state.message} /> : null,\n this.renderErrorDialog(),\n this.state.importFile ? this.onImport(data)} /> : null,\n this.state.confirm ? {\n this.state.confirm && this.setState({ confirm: '' });\n this.confirmCallback && this.confirmCallback(result);\n this.confirmCallback = null;\n }}\n text={this.state.confirm} /> : null,\n \n
{\n window.localStorage.setItem('App.menuOpened', this.state.menuOpened ? 'false' : 'true');\n this.setState({ menuOpened: !this.state.menuOpened, resizing: true });\n setTimeout(() => this.setState({ resizing: false }), 300);\n }}>\n {this.state.menuOpened ? : }\n
\n
this.setState({ resizing: true })}\n onSecondaryPaneSizeChange={size => this.state.hideLog ? 0 : this.logSize = parseFloat(size)}\n onDragEnd={() => {\n this.setState({ resizing: false });\n window.localStorage.setItem('App.logSize', this.logSize.toString());\n }}\n >\n <>\n {this.renderEditor()}\n {!this.state.debugMode && this.state.hideLog && this.showLogButton()}\n >\n {!this.state.debugMode && !this.state.hideLog && this.toggleLogLayout()}\n editing={this.state.editing}\n socket={this.socket}\n selected={this.state.selected}\n onHideLog={() => {\n window.localStorage.setItem('App.hideLog', 'true');\n this.setState({ hideLog: true, resizing: true });\n setTimeout(() => this.setState({ resizing: false }), 300);\n }}\n />}\n \n
,\n ];\n }\n\n render() {\n const { classes } = this.props;\n\n if (!this.state.ready) {\n // return ();\n return ;\n }\n\n return \n
\n this.setState({ resizing: true })}\n onSecondaryPaneSizeChange={size => this.menuSize = parseFloat(size)}\n onDragEnd={() => {\n this.setState({ resizing: false });\n window.localStorage.setItem('App.menuSize', this.menuSize.toString());\n }}\n >\n \n {\n this.setState({ debugInstance: data, debugMode: !!data });\n }}\n key=\"sidemenu\"\n scripts={this.scripts}\n scriptsHash={this.state.scriptsHash}\n instances={this.state.instances}\n update={this.state.updateScripts}\n onRename={this.onRename.bind(this)}\n onSelect={this.onSelect.bind(this)}\n socket={this.socket}\n selectId={this.state.menuSelectId}\n onEdit={this.onEdit.bind(this)}\n expertMode={this.state.expertMode}\n themeType={this.state.themeType}\n themeName={this.state.themeName}\n onThemeChange={themeName => {\n Utils.setThemeName(themeName);\n const themeType = Utils.getThemeType(themeName);\n this.setState({ themeName, themeType }, () => this.props.onThemeChange(themeName));\n }}\n runningInstances={this.state.runningInstances}\n onExpertModeChange={this.onExpertModeChange.bind(this)}\n onDelete={this.onDelete.bind(this)}\n onAddNew={this.onAddNew.bind(this)}\n onEnableDisable={this.onEnableDisable.bind(this)}\n onExport={this.onExport.bind(this)}\n width={this.menuSize}\n onImport={() => this.setState({ importFile: true })}\n onSearch={searchText => this.setState({ searchText })}\n version={this.props.version}\n />\n
\n {this.renderMain()}\n \n \n
;\n }\n}\n\nApp.propTypes = {\n version: PropTypes.string,\n onThemeChange: PropTypes.func,\n};\n\nexport default withStyles(styles)(App);\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read http://bit.ly/CRA-PWA.\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit http://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See http://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n if (\n response.status === 404 ||\n response.headers.get('content-type').indexOf('javascript') === -1\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","import React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { ThemeProvider, StyledEngineProvider } from '@mui/material/styles';\nimport { StylesProvider, createGenerateClassName } from '@mui/styles';\n\nimport './index.css';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\nimport pgk from '../package.json';\nimport theme from '@iobroker/adapter-react-v5/Theme';\n// import Utils from '@iobroker/adapter-react-v5/Components/Utils';\nimport { Utils } from '@iobroker/adapter-react-v5';\nimport { DndProvider } from 'react-dnd';\nimport { HTML5Backend } from 'react-dnd-html5-backend';\nimport { TouchBackend } from 'react-dnd-touch-backend';\n\nimport GenericBlock from './Components/RulesEditor/components/GenericBlock/index.jsx'\n\nwindow.GenericBlock = GenericBlock;\n\nwindow.adapterName = 'javascript';\nwindow.sentryDSN = 'https://504499a725eb4898930d3b9e9da95740@sentry.iobroker.net/56';\n\nlet themeName = Utils.getThemeName();\n\nconsole.log(`iobroker.${window.adapterName}@${pgk.version} using theme \"${themeName}\"`);\n\nconst generateClassName = createGenerateClassName({\n productionPrefix: 'iob',\n});\n\nfunction build() {\n const isMobile = window.innerWidth < 600;\n const container = document.getElementById('root');\n const root = createRoot(container);\n return root.render(\n \n \n \n {\n themeName = _theme;\n build();\n }}\n />\n \n \n \n );\n}\n\nbuild();\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: http://bit.ly/CRA-PWA\nserviceWorker.unregister();\n\n/*\n improved VSCode editor. This has to be down here, or we get conflicts\n between loader.js and require calls in jQuery and other loaded modules\n*/\n// loader must be after socket.io, elsewise there is no window.io\nconst loadDynamicScript = window.loadDynamicScript;\nloadDynamicScript && loadDynamicScript(window.location.port === '3000' ? window.location.protocol + '//' + window.location.hostname + ':8081/lib/js/socket.io.js' : './../../lib/js/socket.io.js', function () {\n loadDynamicScript('vs/loader.js', function () {\n loadDynamicScript('vs/configure.js', function () {\n typeof window.socketLoadedHandler === 'function' && window.socketLoadedHandler();\n });\n });\n});"],"names":["DialogRename","React","constructor","props","super","handleCancel","this","onClose","handleOk","onRename","oldId","state","id","name","instance","handleChange","setState","getId","isShowInstance","folder","instances","length","prefix","getPrefix","parts","split","pop","join","replace","componentWillReceiveProps","nextProps","render","_jsxs","Dialog","event","reason","maxWidth","fullWidth","open","children","_jsx","DialogTitle","I18n","t","DialogContent","noValidate","autoComplete","TextField","variant","style","width","autoFocus","label","value","onKeyPress","ev","key","preventDefault","setTimeout","onChange","e","target","margin","disabled","FormControl","InputLabel","htmlFor","Select","parseInt","inputProps","map","MenuItem","DialogActions","Button","onClick","color","startIcon","IconOk","IconCancel","DialogDelete","onDelete","IconDelete","fontSize","fontWeight","withStyles","theme","DialogAddNew","arguments","type","openHtml","html","lang","getLanguage","includes","window","focus","getJSCard","Card","className","classes","card","CardActionArea","CardMedia","media","image","ImgJS","title","CardContent","complexity","text","CardActions","size","getTSCard","ImgTS","getBlocklyCard","ImgBlockly","getRulesCard","ImgRules","textAlign","minWidth","display","height","minHeight","fontStyle","marginBottom","spacing","DialogNew","onAdd","existingItems","indexOf","error","parent","trim","helperText","parents","splice","names","forEach","n","i","el","find","item","push","DialogError","console","log","titleBackground","root","titleColor","DialogContentText","background","palette","main","contrastText","DialogAdapterDebug","adapterToDebug","enabled","socket","getObject","then","obj","common","setObject","_id","onDebug","jsInstance","filter","localStorage","getItem","showAskForStop","jsInstanceHost","componentDidMount","getAdapterInstances","_i$common","onlyWWW","_item$common","_item$common2","_item$common3","adapter","host","icon","concat","sort","a","b","jsInstanceObj","startsWith","renderJavascriptList","js","Grid","List","component","ListItem","button","selected","ListItemIcon","src","alt","ListItemText","primary","renderInstances","toLowerCase","onDoubleClick","container","direction","Input","filterWithButton","placeholder","setItem","endAdornment","InputAdornment","position","IconButton","IconClose","buttonIcon","marginRight","marginTop","COLOR_RUN","green","COLOR_PROBLEM","yellow","COLOR_PAUSE","red","ROOT_ID","COMMON_ID","GLOBAL_ID","NARROW_WIDTH","SELECTED_STYLE","images","def","ImgTypeScript","getObjectName","en","toString","prepareList","data","result","depth","index","ids","Object","keys","engineType","engine","modified","it","idA","idB","parentIndex","Droppable","onDrop","isOver","isOverAny","drop","useDrop","accept","undefined","collect","monitor","shallow","ref","Utils","clsx","Draggable","opacity","drag","useDrag","isDragging","transform","SideDrawer","expanded","JSON","parse","inputRef","listItems","scripts","problems","reorder","themeName","creatingScript","creatingFolder","copingScript","renaming","deleting","choosingType","errorText","menuOpened","menuAnchorEl","searchMode","expertMode","searchText","typeFilter","statusFilter","runningInstances","scriptsHash","showAdapterDebug","newExp","ensureSelectedIsVisible","filterTimer","isAllZeroInstances","getIsAllZeroInstances","problemsTimer","onProblemUpdatedBound","onProblemUpdated","bind","readProblems","cb","tasks","shift","match","that","substring","getState","err","subscribeState","componentWillUnmount","unsubscribeState","stringify","changed","val","pos","filterListStatic","isSearchEnabled","objects","newState","filteredPartly","found","source","lastIndexOf","filtered","filterList","ensureSelectedIsVisibleStatic","getDerivedStateFromProps","nState","assign","getIsAllZeroInstancesStatic","selectId","saveExpanded","showError","onToggle","stopPropagation","renderItemButtonsOnEnd","iconButtons","debugMode","iconButtonsDisabled","onEnableDisable","IconPause","IconPlay","onEdit","IconDoEdit","Promise","resolve","getTextStyle","whiteSpace","padding","overflow","flex","onDblClick","isFilteredOut","renderListItem","childrenFiltered","depthPx","marginLeft","cursor","isExpanded","iconClass","iconStyle","folderIcon","folderIconReorder","folderIconNoReorder","scriptIcon","scriptIconReorder","scriptIconNoReorder","childrenCount","script","scriptReorder","folderReorder","listItemIcon","IconFolderOpened","IconFolder","ListItemSecondaryAction","onDragFinish","newId","renderOneItem","items","element","reactChildren","renderAllItems","dense","disablePadding","mainList","onAddNew","onCopy","onAddNewFolder","getUniqueName","copyId","word","m","getUniqueFolderName","onCloseMenu","menuAnchorFilterEl","getFilterBadge","filterIcon","getMainMenu","selectedItem","Menu","anchorEl","PaperProps","maxHeight","MENU_ITEM_HEIGHT","iconDropdownMenu","onExpertModeChange","IconExpert","onExport","IconExport","onImport","IconImport","onThemeChange","newThemeName","IconDark","IconCopy","IconDebug","getToolbarButtons","toolbarSearch","clearTimeout","onSearch","toolbarButtons","float","mini","IconClear","currentTarget","IconMore","IconAdd","IconAddFolder","IconFind","IconReorder","IconEdit","version","getFolders","folders","onCollapseAll","onExpandAll","getBottomButtons","footerButtons","Blockly","IconExpandAll","footerButtonsRight","IconCollapseAll","getAdapterDebugDialog","onDebugInstance","renamingItem","copingItem","Drawer","menu","paper","drawerPaper","anchor","toolbar","Divider","DragDropContext","backend","HTML5Backend","innerMenu","footer","newName","newInstance","DialogAddNewScript","mode","lineHeight","paddingRight","iconOnTheRight","right","top","overflowX","overflowY","borderRadius","userSelect","transitionDuration","transitionProperty","paddingTop","paddingBottom","paddingLeft","expandButton","backgroundColor","getTimeString","d","getHours","getMinutes","getSeconds","getMilliseconds","gText","Log","logHandler","message","allLines","lines","editing","generateLine","severity","date","Date","ts","ms","toLocaleString","goBottom","lastIndex","messagesEnd","trTime","trSeverity","substr","scrollToBottom","current","scrollIntoView","behavior","registerLogHandler","unregisterLogHandler","componentDidUpdate","hasOwnProperty","copyToClipboard","clearLog","renderLogList","logBoxInner","table","clear","logBox","toolbox","IconBottom","onLayoutChange","layoutIcon","verticalLayout","onHideLog","IconHide","verticalAlign","info","warn","debug","silly","fontFamily","boxShadow","ScriptEditor","isDark","language","readOnly","alive","check","typingsLoaded","runningInstancesStr","monacoDiv","editor","monaco","insert","originalCode","code","typings","lastSearch","waitForMonaco","_this$monaco","_this$monaco$language","_this$monaco$language2","_this$monaco$language3","monacoLoaded","languages","typescript","typescriptDefaults","getCompilerOptions","_this$monaco2","_this$monaco2$languag","_this$monaco2$languag2","_this$monaco2$languag3","monacoCounter","loadTypings","scriptAdapterInstance","sendTo","setTypeCheck","setEditorTypings","_this$monaco3","_this$monaco3$languag","_this$monaco3$languag2","_this$monaco3$languag3","onRegisterSelect","getModel","getValueInRange","getSelection","compilerOptions","ScriptTarget","ES2015","allowJs","checkJs","noLib","lib","useUnknownInCatchVariables","moduleResolution","ModuleResolutionKind","NodeJs","setCompilerOptions","create","lineNumbers","scrollBeyondLastLine","automaticLayout","glyphMargin","breakpoints","onDidChangeModelContent","getValue","addCommand","KeyMod","CtrlCmd","KeyCode","KEY_S","onForceSave","highlightText","location","showDecorators","options","selectOnLineNumbers","setEditorOptions","setValue","onToggleBreakpoint","onMouseDown","detail","glyphMarginLeft","lineNumber","setEditorLanguage","updateOptions","lineWrap","wordWrap","typeCheck","setTheme","dispose","model","uri","path","filenameWithoutExtension","extension","newLanguage","newModel","createModel","Uri","from","setModel","noSemanticValidation","noSyntaxValidation","setDiagnosticsOptions","_this$monaco4","_this$monaco4$languag","_this$monaco4$languag2","_this$monaco4$languag3","_this$monaco5","_this$monaco5$languag","_this$monaco5$languag2","_this$monaco5$languag3","currentScriptName","isGlobalScript","test","partialDeclarationsPath","wantedTypings","filePath","content","setExtraLibs","addExtraLib","existingLibs","getExtraLibs","insertTextIntoEditor","selection","range","Range","startLineNumber","startColumn","endLineNumber","endColumn","executeEdits","forceMoveMarkers","findMatches","r","setSelection","revealLine","row","getPosition","col","column","decorations","columnNumber","isWholeLine","bp","glyphMarginClassName","deltaDecorations","initNewScript","scrollToLineIfNeeded","ranges","getVisibleRanges","revealLineInCenter","UNSAFE_componentWillReceiveProps","onInserted","newValue","_this$monaco6","_this$monaco6$languag","_this$monaco6$languag2","Fab","bottom","zIndex","IconNoCheck","forceUpdate","DialogExport","popper","file","Blob","fileName","scriptId","dialog","textArea","themeType","textAreaLight","download","rel","href","URL","createObjectURL","textDecoration","Popper","placement","transition","_ref","TransitionProps","Fade","timeout","Paper","typography","left","tabIndex","defaultProps","DialogImport","document","getElementById","readFileDataUrl","reader","FileReader","onload","onabort","onerror","readAsText","handleDropFile","files","dropzone","imageStatus","dropzoneAccepted","dropzoneRejected","fullHeight","Dropzone","maxSize","acceptClassName","rejectClassName","multiple","getRootProps","getInputProps","isDragActive","isDragReject","dropzoneDiv","IconNo","iconError","IconPlus","iconOk","IconUpload","resize","borderWidth","borderStyle","borderColor","boxSizing","toolboxXml","languageBlocklyLoaded","languageOwnLoaded","toolboxText","scriptsLoaded","searchXml","_result","tagName","attributes","nodeName","innerHTML","innerText","childNodes","node","BlocklyEditor","blockly","blocklyWorkspace","exportText","importText","someSelected","changeTimer","onResizeBind","onResize","lastCommand","blinkBlock","loadLanguages","loadJS","url","callback","scriptTag","createElement","onreadystatechange","body","appendChild","loadScripts","loadCustomBlockly","adapters","toLoad","loadXMLDoc","parseXml","DOMParser","xmlStr","parseFromString","ActiveXObject","xmlDoc","async","loadXML","searchBlocks","Xml","workspaceToDom","allBlocks","getAllBlocks","searchId","blocks","addSelect","someSelectedTime","now","removeSelect","command","blocklyCheckBlocks","badBlock","blocklyBlinkBlock","exportBlocks","importBlocks","updateBackground","loadCode","fileLang","setAttribute","readyState","getElementsByTagName","fileCustom","svgResize","jsCode2Blockly","xml","l","decodeURIComponent","atob","block","select","unselect","blocklyRemoveOrphanedShadows","isShadow","connections","getConnections_","conn","j","targetConnection","warningText","blocklyGetUnconnectedBlock","blocklyGetBlockWithWarning","sourceBlock_","INPUT_VALUE","OUTPUT_VALUE","_optional","warning","blocklyCode2JSCode","oneWay","JavaScript","workspaceToCode","dom","domToText","btoa","encodeURIComponent","xmlBlock","blockToDom","dragMode_","DRAG_FREE","deleteNext","xy","getRelativeToSurfaceXY","RTL","x","y","domToPrettyText","onImportBlocks","variables","vars","utils","textToDomDocument","nodes","createVariable","loading","xmlBlocks","textToDom","paste","onBlocklyChanged","ignoreChanges","domToWorkspace","didUpdate","addEventListener","getToolbox","inject","zoom","controls","wheel","startScale","maxScale","minScale","scaleSpeed","move","scrollbars","trashcan","grid","colour","snap","sounds","registerToolboxCategoryCallback","Procedures","flyoutCategoryNew","addChangeListener","masterEvent","Events","UI","CREATE","getElementsByClassName","_originalStyle","stroke","fill","removeEventListener","retry","outerHTML","p1","MSG","CustomBlocks","Words","HUE","_b","renderMessageDialog","DialogMessage","renderErrorDialog","renderExportDialog","renderImportDialog","DialogScriptEditor","isReturn","args","argsTitle","ScriptEditorComponent","adapterName","IconSave","ICON_CACHE","MaterialDynamicIcon","iconName","setUrl","useState","useEffect","_obj$common","Element","Icons","CardMenu","active","onTouchMove","cls","deepCopy","userRules","additionalParameter","newItemsSwitches","filterElement","CustomButton","square","CustomIcon","CustomCheckbox","customValue","switchChecked","setSwitchChecked","_Fragment","Checkbox","checked","Boolean","native","styleComponentBlock","memo","CustomInput","multiline","rows","inputText","setInputText","InputProps","SelectMod","borderBottomColor","CustomInstance","attr","onInstanceHide","setOptions","_options","unshift","renderValue","input","placeContent","title2","FormHelperText","CustomModal","titleButtonApply","titleButtonClose","onApply","textInput","defaultValue","disableEscapeKeyDown","i18n","CustomSelect","doNotTranslate","doNotTranslate2","v","onlyItem","only","titleShort","sel","valueOnly","CustomSlider","min","max","step","unit","marks","Slider","valueLabelDisplay","mark","CustomSwitch","FormControlLabel","control","Switch","CustomTime","InputLabelProps","shrink","DAYS","CustomDate","month","days","padStart","getName","STEPS","selector","GenericBlock","PureComponent","renderText","frontText","backText","nameBlock","doNotTranslateBack","Fragment","displayFlex","blockMarginTop","renderSwitch","renderNameText","signature","displayItalic","renderNumber","settings","openCheckbox","visibility","noHelperText","renderColor","renderCheckbox","renderSlider","renderButton","buttonText","findIcon","getSelectIdIcon","catch","renderObjectID","checkReadOnly","showSelectId","_obj$common2","lastObjectIdChange","write","getObjectNameFromObj","DialogSelectID","imagePrefix","dialogName","getThemeName","statesOnly","onOk","role","states","read","setOnUpdate","renderIconTag","iconTag","tagCard","tagCardArray","onChangeTag","openTagMenu","renderTime","renderSelect","renderInstance","hideAttributes","renderDialog","onShowDialog","iconDialog","renderModalInput","openModal","noTextEdit","renderDate","renderTags","isTourOpen","tourStep","setTourStep","keepMounted","tag","onTagChange","search","newTagCardArray","newSettings","newTagCard","prevProps","acceptedBy","onUpdate","onChangeInput","attribute","_attr","getData","onValueChanged","inputs","helpDialog","notFound","iconThemCard","iconThemCardSelectable","blockName","nameCard","iconHelp","helpText","IconHelp","_ref2","nameRender","controlMenuTop","renderDebugInfo","renderSpecific","oid","instanceSelectionOptions","instanceSelectionDef","debugMessage","enableSimulation","debugHideTimeout","onDebugMessage","blockId","hideTimeout","getReplacesInText","context","_context$trigger","trigger","oidType","conditionsStates","debugInfo","renderDebug","sayitEngines","params","voice","emotion","gender","ename","ssml","ActionSayText","getStaticData","compile","config","volume","ActionSendEmail","recipients","subject","ActionTelegram","cachePromises","user","_setUsers","users","_users","userName","firstName","ActionPushover","sound","priority","ActionWhatsappcmb","phone","ActionPushsafer","device","vibration","DEFAULT_RULE","triggers","conditions","justCheck","actions","compileTriggers","json","jsonTriggers","prelines","hist","conds","cond","findBlock","_context","condition","conditionsDebug","conditionsVars","ors","_ors","compileConditions","compileActions","_else","else","line","action","code2json","json2code","STANDARD_FUNCTION","STANDARD_FUNCTION_ONCHANGE","STANDARD_FUNCTION_STATE","STANDARD_FUNCTION_STATE_ONCHANGE","NO_FUNCTION","TriggerScriptSave","Compile","TriggerScheduleBlock","coordinates","func","interval","cron","_config$dow","hours","minutes","at","dow","_dow","intervals","start","astro","offset","offsetValue","wizard","_time2String","time","_setAstro","latitude","longitude","sunValue","SunCalc","order","astroTime","setMinutes","_setInterval","renderCron","textCron","alignItems","openDialog","convertCronToText","ComplexCron","cronExpression","renderWizard","wizardText","Schedule","valid","default","Transition","Slide","TriggerState","Array","isArray","valOld","ackOld","valueAck","valueNotAck","ack","onWriteValue","openSimulate","simulateValue","simulateAck","parseFloat","renderWriteState","_this$inputRef$curren","TransitionComponent","onKeyUp","keyCode","IconCheck","HYSTERESIS","ConditionState","onShowHelp","showHysteresisHelp","isAllTriggersOnState","_this$props$userRules","_this$props$userRules2","_this$props$userRules3","_this$props$userRules4","debugValue","useTrigger","histComp","compare","_context$trigger2","toUpperCase","compareWith","_setInputs","oidUnit","oidStates","_this$props$userRules5","_this$props$userRules6","HysteresisImage","ConditionTime","withDate","ConditionAstronomical","ActionSetState","toggle","oidMax","oidMin","oidRole","oidWrite","oidStep","isNaN","f","ignore","ActionExec","exec","ActionHTTPCall","ActionPrintText","ActionPause","pause","paused","_getOptions","ActionFunction","ActionSetStateDelayed","delay","clearRunning","ActionOperateStates","oid1","oid2","operation","oidResult","TriggerSchedule","ADAPTERS","telegram","email","sayit","pushover","pushsafer","ContextWrapperCreate","createContext","loadComponent","remote","sharedScope","module","shareScope","remoteFallbackUrl","reject","existingRemote","querySelector","__initialized","init","__webpack_share_scopes__","getOrLoadRemote","get","ContextWrapper","setBlocks","setOnDebugMessage","setEnableSimulation","adapterDynamicBlocksArray","dynamicRules","javascriptRules","alreadyCreated","k","protocol","i18nURL","fetch","extendTranslations","Component","adapterBlocksArray","StandardBlocks","Provider","CurrentItem","setUserRules","blockValue","setAnchorEl","useContext","findElementBlocks","useCallback","newUserRules","findElement","handlePopoverOpen","blockInput","useMemo","CustomBlock","isDelete","setIsDelete","onMouseMove","onMouseEnter","onMouseLeave","handlePopoverClose","ctrlKey","newItem","clientWidth","layerStyles","pointerEvents","getItemStyles","initialOffset","currentOffset","isSnapToGrid","snapToGrid","Math","round","WebkitTransform","CustomDragLayer","itemType","targetIds","useDragLayer","getItemType","getInitialSourceClientOffset","getSourceClientOffset","getTargetIds","useStateLocal","events","nameEvents","newHeadCells","funcSet","_","setCards","moveCard","atIndex","cards","additionally","hoverClientY","hoverMiddleY","findCard","copyCard","newTriggers","c","DragWrapper","typeBlocks","allProperties","isActive","preview","end","dropResult","getDropResult","idNumber","useRef","canDrop","hover","_ref$current","draggedId","hoverBoundingRect","getBoundingClientRect","getClientOffset","overIndexActions","overIndexConditions","overIndex","getEmptyImage","captureDraggingState","isMobile","innerWidth","DialogHelp","letterSpacing","DialogCondition","AdditionallyContentBlockItems","_itemsSwitchesRender$","itemsSwitchesRender","boolean","typeBlock","animation","checkItem","setCheckItem","canDropCheck","setCanDropCheck","checkId","setCheckId","hoverBlock","setHoverBlock","getHandlerId","_ref3","_monitor$getItem","targetId","contentBlockItem","addClassHeight","contentHeightOn","contentHeightOff","wrapperMargin","clientHeight","emptyBlockStyle","emptyBlock","emptyBlockNone","ContentBlockItems","_ref4","nameAdditionally","border","additionallyClickItems","setAdditionallyClickItems","checkLocal","showHelp","setShowHelp","showConditionDialog","setShowConditionDialog","newArray","idx","setAnimation","mainBlockItemRules","addClassOverflow","nameBlockItems","selectOnChange","_userRules","selectOnChangeHelp","selectOnChangeHelpIcon","booleanAdditionally","newAdditionally","blockCardAdd","cardAdd","onDoubl","HamburgerMenu","addClass","setAllBlocks","onChangeBlocks","hamburgerOnOff","setHamburgerOnOff","setFilter","setBlocksFunc","typeFunc","newAllBlocks","a11yProps","ClickAwayListener","mouseEvent","touchEvent","onClickAway","AppBar","Tabs","Tab","CustomDragItem","running","importExport","setImportExport","modal","setModal","_jsInstance","_jsAlive","handler","handlerStatus","msg","ruleId","_obj$common3","subscribeObject","unsubscribeObject","setAddClass","Editor","editorDidMount","editorDiv","scriptName","borderRight","lineBreakpoint","lineCode","lineCurrentCode","lineCurrent","Console","onClearAllLogs","consoleLine","console_log","console_warn","console_error","console_debug","consoleSeverity","textTransform","consoleTime","consoleText","Stack","framesSize","editValue","callFrames","editRef","onExpressionNameUpdate","scopeValue","renderExpression","onBlur","CheckIcon","scopeNameName","scopeNameEqual","scopeNameValue","formatValue","scopeType","scopeName","valueType","scopeButtonDel","onExpressionDelete","renderExpressions","expressions","renderOneFrameTitle","frame","mainScriptId","currentScriptId","ListItemButton","onChangeCurrentFrame","currentFrame","frameRoot","frameTextRoot","frameTextPrimary","secondary","frameTextSecondary","functionName","forEdit","description","valueFunc","valueUndefined","valueNull","valueString","valueBoolean","ReactJson","enableClipboard","collapsed","displayDataTypes","valueNone","onWriteScopeValue","variableName","scopeNumber","callFrameId","_this$editRef$current","renderScope","scopeId","_item$value","_item$value2","editable","scopeValueEditable","renderScopes","_this$props$scopes","_this$props$scopes$lo","_this$props$scopes$lo2","_this$props$scopes2","_this$props$scopes2$c","_this$props$scopes2$c2","scopes","local","properties","closure","SplitterLayout","customClassName","splitter","primaryIndex","secondaryMinSize","primaryMinSize","vertical","secondaryInitialSize","onSecondaryPaneSizeChange","onDragEnd","listRoot","toolbarScopes","onExpressionAdd","scopesAfterToolbar","scopeType_local","scopeType_closure","scopeType_user","textOverflow","scopeButton","selectedFrame","valueNumber","valueObject","Debugger","fromInstance","cmd","debugInstance","_data$context","tabs","random","starting","finished","started","getLocation","reinitBreakpoints","readCurrentScope","readExpressions","_data$context2","_data$context3","scope","sendToInstance","toolsTab","logErrors","logWarnings","logs","expression","_data$breakpoints","_data$breakpoints$loc","_data$breakpoints2","_data$breakpoints2$lo","locations","queryBreakpoints","alert","toolSize","stopOnException","_obj$common$engine","_this$state$context","scopeChain","global","_this$state$context2","getTextAtLocation","arrow","monospace","renderQueryBreakpoints","bpListItem","bpListPrimary","bpListSecondary","renderError","closeTab","renderTabs","indicatorColor","scrollButtons","tabText","closeButton","tabFile","onResume","onPause","onNext","onStepIn","onStepOut","onRestart","onToggleException","renderToolbar","Toolbar","buttonRestart","IconRestart","buttonRun","IconRun","buttonPause","buttonNext","IconNext","buttonStep","IconStep","buttonOut","IconOut","buttonException","IconException","getPossibleBreakpoints","toggleBreakpoint","renderCode","sourceId","renderFrames","_this$state$context3","renderConsole","logWarning","renderTools","_console","Badge","badgeContent","tabsRoot","tabRoot","LinearProgress","buttonStop","borderTop","allObjectsCache","getText","detectDevices","devicesObject","getObjectView","channels","devices","enums","values","reduce","allObjects","detector","ChannelDetector","rooms","funcs","list","_devicesObject$id","_devicesObject$id2","_devicesObject$id2$co","smartName","members","member","_keysOptional","_usedIdsOptional","ignoreIndicators","excludedTypes","detect","stateId","st","deviceObject","deviceType","defaultRole","channelId","deviceId","room","roomId","funcId","function","deviceObj","idArray","parentObject","_parentObject$common2","_parentObject$common","_grandParentObject$co","grandParentObject","_grandParentObject$co2","LANGUAGES","ru","de","es","fr","pl","nl","pt","uk","ChatIcon","viewBox","question","setQuestion","answer","setAnswer","setOpen","working","setWorking","setError","showKeyWarning","setShowKeyWarning","devicesCache","gptKeyCache","docsCache","ask","apiKey","docs","gptKey","systemPrompt","openai","OpenAI","dangerouslyAllowBrowser","chat","completions","messages","choices","comments","endsWith","_err$response","_err$response$data","_err$response$data$er","response","flexDirection","gap","Close","fullHeightDialog","Question","CircularProgress","Copy","Check","onAddCode","COLOR_DEBUG","COLOR_VERBOSE","onInstanceChanged","onBrowserClose","isChanged","returnValue","tabsRef","rules","debugEnabled","verboseEnabled","showCompiledCode","showCron","showScript","showAstro","astroEvents","visible","cmdToBlockly","cmdToRules","menuTabsOpened","menuTabsAnchorEl","showDebugMenu","toast","instancesLoaded","setChangedInAdmin","initValue","scriptDialog","systemLang","selectIdDialog","cronDialog","showScriptDialog","getAllAdapterInstances","onSelectedChange","instanceObjects","configNotSaved","removeNonExistingScripts","_changed","verbose","oldSource","commonLocal","nextCommon","onStartStop","onSave","onSaveAll","onCancel","getSelect","onConvertBlockly2JS","showConfirmDialog","nowSelected","onTabChange","isScriptChanged","onTabClose","ok","confirmCallback","confirm","sendCommandToBlockly","sendCommandToRules","getScriptFullName","getTabs","textColor","tabChanged","tabChangedIcon","wrapped","iconPosition","tabIcon","tabButton","wrapper","tabButtonWrapper","tabMenuButton","_event","IconCloseAll","hintButton","hintIcon","getDebugMenu","menuDebugAnchorEl","menuIcon","IconVerbose","getDebugBadge","getAskAboutDebug","askAboutDebug","DialogConfirm","onDebugModeChange","cancel","getToolbar","isInstanceRunning","isScriptRunning","changedAll","onLocate","IconLocate","notRunning","textButton","saveButton","textIcon","IconCron","OpenAiDialog","IconAstro","IconSelectId","IconDebugMode","toolbarButtonsDisabled","badgeMargin","IconDebugMenu","getScriptEditor","getBlocklyEditor","resizing","getRulesEditor","RulesEditor","getConfirmDialog","getSelectIdDialog","selectedId","types","getCronDialog","DialogCron","getAstroDialog","TableContainer","Table","TableHead","TableRow","TableCell","TableBody","Tooltip","toLocaleTimeString","align","serverTime","getEditorDialog","getToast","Snackbar","anchorOrigin","horizontal","autoHideDuration","ContentProps","closeToast","getTour","isAnyRulesExists","Tour","steps","isOpen","onRequestClose","goToStep","getDebug","hintText","DialogImportFile","readAsDataURL","App","GenericApp","Connection","AdminConnection","translations","require","bottomButtons","autoSubscribeLog","sentryDSN","onScriptsChanged","onInstanceAliveChange","reload","onHostChanged","hosts","logSize","menuSize","importFile","onConnectionReady","ready","updateScripts","updating","logMessage","menuSelectId","logHorzLayout","hideLog","subscribeOnInstances","readAdaptersWithBlockly","getHosts","readAllScripts","compareScripts","instancesArray","promises","instanceId","all","onToggleExpertMode","newScripts","oldIds","newIds","oldScript","newScript","promise","parentID","updateScript","renameGroup","_list","nId","delObject","expert","onUpdateScript","onSelect","showMessage","isFolder","reg","RegExp","newCommon","_obj","extendObject","_rev","getLiveHost","getFullYear","getMonth","getDate","getRawSocket","emit","link","fileStorageNamespace","click","remove","onImportConfirmed","toggleLogLayout","renderEditor","sum","showLogButton","IconShowLog","renderMain","menuOpenCloseButton","IconMenuOpened","IconMenuClosed","onDragStart","splitterDivs","menuDivWithoutMenu","mainDiv","SideMenu","update","setThemeName","getThemeType","Loader","propTypes","PropTypes","flexGrow","menuDiv","splitterDivWithMenu","progress","hostname","pgk","generateClassName","createGenerateClassName","productionPrefix","build","createRoot","StylesProvider","StyledEngineProvider","injectFirst","ThemeProvider","DndProvider","TouchBackend","_theme","navigator","serviceWorker","registration","unregister","loadDynamicScript","port","socketLoadedHandler"],"sourceRoot":""}
\ No newline at end of file
diff --git a/admin/static/js/main.4e0a684a.js b/admin/static/js/main.01873cd9.js
similarity index 90%
rename from admin/static/js/main.4e0a684a.js
rename to admin/static/js/main.01873cd9.js
index b02827c3b..e63a151fd 100644
--- a/admin/static/js/main.4e0a684a.js
+++ b/admin/static/js/main.01873cd9.js
@@ -1,2 +1,2 @@
-(()=>{var e={77569:(e,r,t)=>{Promise.all([t.e(448),t.e(983),t.e(239),t.e(223),t.e(675),t.e(944),t.e(774),t.e(956),t.e(377),t.e(17),t.e(96),t.e(819),t.e(854),t.e(564),t.e(440),t.e(412),t.e(864)]).then(t.bind(t,63541))}},r={};function t(n){var a=r[n];if(void 0!==a)return a.exports;var o=r[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}t.m=e,t.c=r,t.amdD=function(){throw new Error("define cannot be used indirect")},t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},t.f={},t.e=e=>Promise.all(Object.keys(t.f).reduce(((r,n)=>(t.f[n](e,r),r)),[])),t.u=e=>"static/js/"+e+"."+{7:"1d9b7afb",17:"c425807c",86:"1b4fca53",96:"fe9915d5",147:"ab44d2ab",164:"2c2b1075",195:"dedf4947",223:"f0c60522",239:"49f1d114",281:"fe2096fc",365:"ca66a412",377:"9347d79a",399:"f713c6bc",412:"c124454b",431:"a62490cf",440:"6b00f12e",447:"71f7415d",448:"ff20ef54",564:"3948b951",623:"8b0d671e",666:"f676e7ac",675:"d0c8b930",702:"1692c400",732:"35b8de10",772:"a28fc25b",774:"cf3edadb",791:"258dd609",805:"7c367e53",819:"e612993b",838:"bda08ddf",854:"2686e8b9",864:"4f070a1f",880:"62623dec",944:"8c3dee7b",956:"cf9b2bc3",977:"631c311a",983:"cc3c1042"}[e]+".chunk.js",t.miniCssF=e=>"static/css/"+e+".42bfc5f3.chunk.css",t.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),t.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e={};t.l=(r,n,a,o)=>{if(e[r])e[r].push(n);else{var i,l;if(void 0!==a)for(var s=document.getElementsByTagName("script"),u=0;u{i.onerror=i.onload=null,clearTimeout(f);var a=e[r];if(delete e[r],i.parentNode&&i.parentNode.removeChild(i),a&&a.forEach((e=>e(n))),t)return t(n)},f=setTimeout(c.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=c.bind(null,i.onerror),i.onload=c.bind(null,i.onload),l&&document.head.appendChild(i)}}})(),t.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{t.S={};var e={},r={};t.I=(n,a)=>{a||(a=[]);var o=r[n];if(o||(o=r[n]={}),!(a.indexOf(o)>=0)){if(a.push(o),e[n])return e[n];t.o(t.S,n)||(t.S[n]={});var i=t.S[n],l=(e,r,t,n)=>{var a=i[e]=i[e]||{},o=a[r];(!o||!o.loaded&&(!n!=!o.eager?n:"js">o.from))&&(a[r]={get:t,from:"js",eager:!!n})},s=[];if("default"===n)l("@iobroker/adapter-react-v5","4.10.1",(()=>Promise.all([t.e(448),t.e(977),t.e(239),t.e(223),t.e(623),t.e(944),t.e(956),t.e(838),t.e(17),t.e(819),t.e(854),t.e(564),t.e(440),t.e(412),t.e(732),t.e(805)]).then((()=>()=>t(26079))))),l("@mui/icons-material","5.15.12",(()=>Promise.all([t.e(448),t.e(223),t.e(675),t.e(819),t.e(854)]).then((()=>()=>t(28675))))),l("@mui/material","5.14.14",(()=>Promise.all([t.e(448),t.e(977),t.e(239),t.e(195),t.e(956),t.e(772),t.e(819),t.e(854),t.e(564),t.e(440)]).then((()=>()=>t(73772))))),l("@mui/material","5.15.12",(()=>Promise.all([t.e(448),t.e(239),t.e(223),t.e(623),t.e(195),t.e(944),t.e(774),t.e(86),t.e(819),t.e(854),t.e(440)]).then((()=>()=>t(53086))))),l("@mui/styles","5.14.14",(()=>Promise.all([t.e(983),t.e(447),t.e(819),t.e(854),t.e(564),t.e(431)]).then((()=>()=>t(70239))))),l("@mui/styles","5.15.12",(()=>Promise.all([t.e(983),t.e(377),t.e(819),t.e(854),t.e(702)]).then((()=>()=>t(55365))))),l("prop-types","15.7.2",(()=>t.e(281).then((()=>()=>t(93281))))),l("prop-types","15.8.1",(()=>t.e(7).then((()=>()=>t(52007))))),l("react-ace","10.1.0",(()=>Promise.all([t.e(399),t.e(819),t.e(854)]).then((()=>()=>t(38399))))),l("react-dom","18.2.0",(()=>Promise.all([t.e(164),t.e(819)]).then((()=>()=>t(54164))))),l("react","17.0.2",(()=>t.e(666).then((()=>()=>t(147))))),l("react","18.2.0",(()=>t.e(791).then((()=>()=>t(72791)))));return s.length?e[n]=Promise.all(s).then((()=>e[n]=1)):e[n]=1}}})(),(()=>{var e;t.g.importScripts&&(e=t.g.location+"");var r=t.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var n=r.getElementsByTagName("script");if(n.length)for(var a=n.length-1;a>-1&&!e;)e=n[a--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),t.p=e+"../../"})(),(()=>{var e=e=>{var r=e=>e.split(".").map((e=>+e==e?+e:e)),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=t[1]?r(t[1]):[];return t[2]&&(n.length++,n.push.apply(n,r(t[2]))),t[3]&&(n.push([]),n.push.apply(n,r(t[3]))),n},r=(r,t)=>{r=e(r),t=e(t);for(var n=0;;){if(n>=r.length)return n=t.length)return"u"==o;var i=t[n],l=(typeof i)[0];if(o!=l)return"o"==o&&"n"==l||"s"==l||"u"==o;if("o"!=o&&"u"!=o&&a!=i)return a{var r=e[0],t="";if(1===e.length)return"*";if(r+.5){t+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var a=1,o=1;o0?".":"")+(a=2,l);return t}var i=[];for(o=1;o{if(0 in r){t=e(t);var n=r[0],o=n<0;o&&(n=-n-1);for(var i=0,l=1,s=!0;;l++,i++){var u,d,c=l=t.length||"o"==(d=(typeof(u=t[i]))[0]))return!s||("u"==c?l>n&&!o:""==c!=o);if("u"==d){if(!s||"u"!=c)return!1}else if(s)if(c==d)if(l<=n){if(u!=r[l])return!1}else{if(o?u>r[l]:u{var n=e[t];return Object.keys(n).reduce(((e,t)=>!e||!n[e].loaded&&r(e,t)?t:e),0)},i=(e,r,t,a)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+n(a)+")",l=(e,r,t,n)=>{var l=o(e,t);return a(n,l)||s(i(e,t,l,n)),u(e[t][l])},s=e=>{"undefined"!==typeof console&&console.warn&&console.warn(e)},u=e=>(e.loaded=1,e.get()),d=e=>function(r,n,a,o){var i=t.I(r);return i&&i.then?i.then(e.bind(e,r,t.S[r],n,a,o)):e(r,t.S[r],n,a,o)},c=d(((e,r,n,a,o)=>r&&t.o(r,n)?l(r,0,n,a):o())),f={},p={4819:()=>c("default","react",[0],(()=>t.e(791).then((()=>()=>t(72791))))),15854:()=>c("default","prop-types",[0],(()=>t.e(7).then((()=>()=>t(52007))))),88564:()=>c("default","react",[0],(()=>t.e(147).then((()=>()=>t(147))))),77440:()=>c("default","react-dom",[0],(()=>t.e(164).then((()=>()=>t(54164))))),18967:()=>c("default","@mui/material",[0],(()=>Promise.all([t.e(977),t.e(195),t.e(772)]).then((()=>()=>t(73772))))),35025:()=>c("default","@mui/styles",[0],(()=>Promise.all([t.e(983),t.e(447)]).then((()=>()=>t(70239))))),58503:()=>c("default","@mui/styles",[0],(()=>Promise.all([t.e(983),t.e(377),t.e(365)]).then((()=>()=>t(55365))))),59665:()=>c("default","@mui/icons-material",[0],(()=>t.e(675).then((()=>()=>t(28675))))),75606:()=>c("default","@iobroker/adapter-react-v5",[0],(()=>Promise.all([t.e(977),t.e(623),t.e(838),t.e(732),t.e(880)]).then((()=>()=>t(26079))))),94427:()=>c("default","@mui/material",[0],(()=>Promise.all([t.e(623),t.e(195),t.e(774),t.e(86)]).then((()=>()=>t(53086))))),91305:()=>c("default","prop-types",[0],(()=>t.e(281).then((()=>()=>t(93281))))),83732:()=>c("default","react-ace",[0],(()=>t.e(399).then((()=>()=>t(38399)))))},h={412:[18967,35025,58503,59665,75606,94427],440:[77440],564:[88564],732:[83732],819:[4819],854:[15854],864:[91305]};t.f.consumes=(e,r)=>{t.o(h,e)&&h[e].forEach((e=>{if(t.o(f,e))return r.push(f[e]);var n=r=>{f[e]=0,t.m[e]=n=>{delete t.c[e],n.exports=r()}},a=r=>{delete f[e],t.m[e]=n=>{throw delete t.c[e],r}};try{var o=p[e]();o.then?r.push(f[e]=o.then(n).catch(a)):n(o)}catch(i){a(i)}}))}})(),(()=>{if("undefined"!==typeof document){var e=e=>new Promise(((r,n)=>{var a=t.miniCssF(e),o=t.p+a;if(((e,r)=>{for(var t=document.getElementsByTagName("link"),n=0;n{var o=document.createElement("link");o.rel="stylesheet",o.type="text/css",o.onerror=o.onload=t=>{if(o.onerror=o.onload=null,"load"===t.type)n();else{var i=t&&("load"===t.type?"missing":t.type),l=t&&t.target&&t.target.href||r,s=new Error("Loading CSS chunk "+e+" failed.\n("+l+")");s.code="CSS_CHUNK_LOAD_FAILED",s.type=i,s.request=l,o.parentNode&&o.parentNode.removeChild(o),a(s)}},o.href=r,t?t.parentNode.insertBefore(o,t.nextSibling):document.head.appendChild(o)})(e,o,null,r,n)})),r={179:0};t.f.miniCss=(t,n)=>{r[t]?n.push(r[t]):0!==r[t]&&{864:1}[t]&&n.push(r[t]=e(t).then((()=>{r[t]=0}),(e=>{throw delete r[t],e})))}}})(),(()=>{var e={179:0};t.f.j=(r,n)=>{var a=t.o(e,r)?e[r]:void 0;if(0!==a)if(a)n.push(a[2]);else if(/^(412|440|564|732|819|854)$/.test(r))e[r]=0;else{var o=new Promise(((t,n)=>a=e[r]=[t,n]));n.push(a[2]=o);var i=t.p+t.u(r),l=new Error;t.l(i,(n=>{if(t.o(e,r)&&(0!==(a=e[r])&&(e[r]=void 0),a)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;l.message="Loading chunk "+r+" failed.\n("+o+": "+i+")",l.name="ChunkLoadError",l.type=o,l.request=i,a[1](l)}}),"chunk-"+r,r)}};var r=(r,n)=>{var a,o,i=n[0],l=n[1],s=n[2],u=0;if(i.some((r=>0!==e[r]))){for(a in l)t.o(l,a)&&(t.m[a]=l[a]);if(s)s(t)}for(r&&r(n);u{var e={77569:(e,r,t)=>{Promise.all([t.e(448),t.e(983),t.e(239),t.e(223),t.e(675),t.e(944),t.e(774),t.e(956),t.e(377),t.e(17),t.e(96),t.e(819),t.e(854),t.e(564),t.e(440),t.e(412),t.e(864)]).then(t.bind(t,63541))}},r={};function t(n){var a=r[n];if(void 0!==a)return a.exports;var o=r[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}t.m=e,t.c=r,t.amdD=function(){throw new Error("define cannot be used indirect")},t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},t.f={},t.e=e=>Promise.all(Object.keys(t.f).reduce(((r,n)=>(t.f[n](e,r),r)),[])),t.u=e=>"static/js/"+e+"."+{7:"1d9b7afb",17:"c425807c",86:"1b4fca53",96:"fe9915d5",147:"ab44d2ab",164:"2c2b1075",195:"dedf4947",223:"f0c60522",239:"49f1d114",281:"fe2096fc",365:"ca66a412",377:"9347d79a",399:"f713c6bc",412:"c124454b",431:"a62490cf",440:"6b00f12e",447:"71f7415d",448:"ff20ef54",564:"3948b951",623:"8b0d671e",666:"f676e7ac",675:"d0c8b930",702:"1692c400",732:"35b8de10",772:"a28fc25b",774:"cf3edadb",791:"258dd609",805:"7c367e53",819:"e612993b",838:"bda08ddf",854:"2686e8b9",864:"2e977ad1",880:"62623dec",944:"8c3dee7b",956:"cf9b2bc3",977:"631c311a",983:"cc3c1042"}[e]+".chunk.js",t.miniCssF=e=>"static/css/"+e+".42bfc5f3.chunk.css",t.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),t.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e={};t.l=(r,n,a,o)=>{if(e[r])e[r].push(n);else{var i,l;if(void 0!==a)for(var s=document.getElementsByTagName("script"),d=0;d{i.onerror=i.onload=null,clearTimeout(f);var a=e[r];if(delete e[r],i.parentNode&&i.parentNode.removeChild(i),a&&a.forEach((e=>e(n))),t)return t(n)},f=setTimeout(c.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=c.bind(null,i.onerror),i.onload=c.bind(null,i.onload),l&&document.head.appendChild(i)}}})(),t.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{t.S={};var e={},r={};t.I=(n,a)=>{a||(a=[]);var o=r[n];if(o||(o=r[n]={}),!(a.indexOf(o)>=0)){if(a.push(o),e[n])return e[n];t.o(t.S,n)||(t.S[n]={});var i=t.S[n],l=(e,r,t,n)=>{var a=i[e]=i[e]||{},o=a[r];(!o||!o.loaded&&(!n!=!o.eager?n:"js">o.from))&&(a[r]={get:t,from:"js",eager:!!n})},s=[];if("default"===n)l("@iobroker/adapter-react-v5","4.10.1",(()=>Promise.all([t.e(448),t.e(977),t.e(239),t.e(223),t.e(623),t.e(944),t.e(956),t.e(838),t.e(17),t.e(819),t.e(854),t.e(564),t.e(440),t.e(412),t.e(732),t.e(805)]).then((()=>()=>t(26079))))),l("@mui/icons-material","5.15.12",(()=>Promise.all([t.e(448),t.e(223),t.e(675),t.e(819),t.e(854)]).then((()=>()=>t(28675))))),l("@mui/material","5.14.14",(()=>Promise.all([t.e(448),t.e(977),t.e(239),t.e(195),t.e(956),t.e(772),t.e(819),t.e(854),t.e(564),t.e(440)]).then((()=>()=>t(73772))))),l("@mui/material","5.15.12",(()=>Promise.all([t.e(448),t.e(239),t.e(223),t.e(623),t.e(195),t.e(944),t.e(774),t.e(86),t.e(819),t.e(854),t.e(440)]).then((()=>()=>t(53086))))),l("@mui/styles","5.14.14",(()=>Promise.all([t.e(983),t.e(447),t.e(819),t.e(854),t.e(564),t.e(431)]).then((()=>()=>t(70239))))),l("@mui/styles","5.15.12",(()=>Promise.all([t.e(983),t.e(377),t.e(819),t.e(854),t.e(702)]).then((()=>()=>t(55365))))),l("prop-types","15.7.2",(()=>t.e(281).then((()=>()=>t(93281))))),l("prop-types","15.8.1",(()=>t.e(7).then((()=>()=>t(52007))))),l("react-ace","10.1.0",(()=>Promise.all([t.e(399),t.e(819),t.e(854)]).then((()=>()=>t(38399))))),l("react-dom","18.2.0",(()=>Promise.all([t.e(164),t.e(819)]).then((()=>()=>t(54164))))),l("react","17.0.2",(()=>t.e(666).then((()=>()=>t(147))))),l("react","18.2.0",(()=>t.e(791).then((()=>()=>t(72791)))));return s.length?e[n]=Promise.all(s).then((()=>e[n]=1)):e[n]=1}}})(),(()=>{var e;t.g.importScripts&&(e=t.g.location+"");var r=t.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var n=r.getElementsByTagName("script");if(n.length)for(var a=n.length-1;a>-1&&!e;)e=n[a--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),t.p=e+"../../"})(),(()=>{var e=e=>{var r=e=>e.split(".").map((e=>+e==e?+e:e)),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=t[1]?r(t[1]):[];return t[2]&&(n.length++,n.push.apply(n,r(t[2]))),t[3]&&(n.push([]),n.push.apply(n,r(t[3]))),n},r=(r,t)=>{r=e(r),t=e(t);for(var n=0;;){if(n>=r.length)return n=t.length)return"u"==o;var i=t[n],l=(typeof i)[0];if(o!=l)return"o"==o&&"n"==l||"s"==l||"u"==o;if("o"!=o&&"u"!=o&&a!=i)return a{var r=e[0],t="";if(1===e.length)return"*";if(r+.5){t+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var a=1,o=1;o0?".":"")+(a=2,l);return t}var i=[];for(o=1;o{if(0 in r){t=e(t);var n=r[0],o=n<0;o&&(n=-n-1);for(var i=0,l=1,s=!0;;l++,i++){var d,u,c=l=t.length||"o"==(u=(typeof(d=t[i]))[0]))return!s||("u"==c?l>n&&!o:""==c!=o);if("u"==u){if(!s||"u"!=c)return!1}else if(s)if(c==u)if(l<=n){if(d!=r[l])return!1}else{if(o?d>r[l]:d{var n=e[t];return Object.keys(n).reduce(((e,t)=>!e||!n[e].loaded&&r(e,t)?t:e),0)},i=(e,r,t,a)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+n(a)+")",l=(e,r,t,n)=>{var l=o(e,t);return a(n,l)||s(i(e,t,l,n)),d(e[t][l])},s=e=>{"undefined"!==typeof console&&console.warn&&console.warn(e)},d=e=>(e.loaded=1,e.get()),u=e=>function(r,n,a,o){var i=t.I(r);return i&&i.then?i.then(e.bind(e,r,t.S[r],n,a,o)):e(r,t.S[r],n,a,o)},c=u(((e,r,n,a,o)=>r&&t.o(r,n)?l(r,0,n,a):o())),f={},p={4819:()=>c("default","react",[0],(()=>t.e(791).then((()=>()=>t(72791))))),15854:()=>c("default","prop-types",[0],(()=>t.e(7).then((()=>()=>t(52007))))),88564:()=>c("default","react",[0],(()=>t.e(147).then((()=>()=>t(147))))),77440:()=>c("default","react-dom",[0],(()=>t.e(164).then((()=>()=>t(54164))))),18967:()=>c("default","@mui/material",[0],(()=>Promise.all([t.e(977),t.e(195),t.e(772)]).then((()=>()=>t(73772))))),35025:()=>c("default","@mui/styles",[0],(()=>Promise.all([t.e(983),t.e(447)]).then((()=>()=>t(70239))))),58503:()=>c("default","@mui/styles",[0],(()=>Promise.all([t.e(983),t.e(377),t.e(365)]).then((()=>()=>t(55365))))),59665:()=>c("default","@mui/icons-material",[0],(()=>t.e(675).then((()=>()=>t(28675))))),75606:()=>c("default","@iobroker/adapter-react-v5",[0],(()=>Promise.all([t.e(977),t.e(623),t.e(838),t.e(732),t.e(880)]).then((()=>()=>t(26079))))),94427:()=>c("default","@mui/material",[0],(()=>Promise.all([t.e(623),t.e(195),t.e(774),t.e(86)]).then((()=>()=>t(53086))))),91305:()=>c("default","prop-types",[0],(()=>t.e(281).then((()=>()=>t(93281))))),83732:()=>c("default","react-ace",[0],(()=>t.e(399).then((()=>()=>t(38399)))))},h={412:[18967,35025,58503,59665,75606,94427],440:[77440],564:[88564],732:[83732],819:[4819],854:[15854],864:[91305]};t.f.consumes=(e,r)=>{t.o(h,e)&&h[e].forEach((e=>{if(t.o(f,e))return r.push(f[e]);var n=r=>{f[e]=0,t.m[e]=n=>{delete t.c[e],n.exports=r()}},a=r=>{delete f[e],t.m[e]=n=>{throw delete t.c[e],r}};try{var o=p[e]();o.then?r.push(f[e]=o.then(n).catch(a)):n(o)}catch(i){a(i)}}))}})(),(()=>{if("undefined"!==typeof document){var e=e=>new Promise(((r,n)=>{var a=t.miniCssF(e),o=t.p+a;if(((e,r)=>{for(var t=document.getElementsByTagName("link"),n=0;n{var o=document.createElement("link");o.rel="stylesheet",o.type="text/css",o.onerror=o.onload=t=>{if(o.onerror=o.onload=null,"load"===t.type)n();else{var i=t&&("load"===t.type?"missing":t.type),l=t&&t.target&&t.target.href||r,s=new Error("Loading CSS chunk "+e+" failed.\n("+l+")");s.code="CSS_CHUNK_LOAD_FAILED",s.type=i,s.request=l,o.parentNode&&o.parentNode.removeChild(o),a(s)}},o.href=r,t?t.parentNode.insertBefore(o,t.nextSibling):document.head.appendChild(o)})(e,o,null,r,n)})),r={179:0};t.f.miniCss=(t,n)=>{r[t]?n.push(r[t]):0!==r[t]&&{864:1}[t]&&n.push(r[t]=e(t).then((()=>{r[t]=0}),(e=>{throw delete r[t],e})))}}})(),(()=>{var e={179:0};t.f.j=(r,n)=>{var a=t.o(e,r)?e[r]:void 0;if(0!==a)if(a)n.push(a[2]);else if(/^(412|440|564|732|819|854)$/.test(r))e[r]=0;else{var o=new Promise(((t,n)=>a=e[r]=[t,n]));n.push(a[2]=o);var i=t.p+t.u(r),l=new Error;t.l(i,(n=>{if(t.o(e,r)&&(0!==(a=e[r])&&(e[r]=void 0),a)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;l.message="Loading chunk "+r+" failed.\n("+o+": "+i+")",l.name="ChunkLoadError",l.type=o,l.request=i,a[1](l)}}),"chunk-"+r,r)}};var r=(r,n)=>{var a,o,i=n[0],l=n[1],s=n[2],d=0;if(i.some((r=>0!==e[r]))){for(a in l)t.o(l,a)&&(t.m[a]=l[a]);if(s)s(t)}for(r&&r(n);d {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"static/js/\" + chunkId + \".\" + {\"7\":\"1d9b7afb\",\"17\":\"c425807c\",\"86\":\"1b4fca53\",\"96\":\"fe9915d5\",\"147\":\"ab44d2ab\",\"164\":\"2c2b1075\",\"195\":\"dedf4947\",\"223\":\"f0c60522\",\"239\":\"49f1d114\",\"281\":\"fe2096fc\",\"365\":\"ca66a412\",\"377\":\"9347d79a\",\"399\":\"f713c6bc\",\"412\":\"c124454b\",\"431\":\"a62490cf\",\"440\":\"6b00f12e\",\"447\":\"71f7415d\",\"448\":\"ff20ef54\",\"564\":\"3948b951\",\"623\":\"8b0d671e\",\"666\":\"f676e7ac\",\"675\":\"d0c8b930\",\"702\":\"1692c400\",\"732\":\"35b8de10\",\"772\":\"a28fc25b\",\"774\":\"cf3edadb\",\"791\":\"258dd609\",\"805\":\"7c367e53\",\"819\":\"e612993b\",\"838\":\"bda08ddf\",\"854\":\"2686e8b9\",\"864\":\"4f070a1f\",\"880\":\"62623dec\",\"944\":\"8c3dee7b\",\"956\":\"cf9b2bc3\",\"977\":\"631c311a\",\"983\":\"cc3c1042\"}[chunkId] + \".chunk.js\";\n};","// This function allow to reference async chunks\n__webpack_require__.miniCssF = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"static/css/\" + chunkId + \".\" + \"42bfc5f3\" + \".chunk.css\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.hmd = (module) => {\n\tmodule = Object.create(module);\n\tif (!module.children) module.children = [];\n\tObject.defineProperty(module, 'exports', {\n\t\tenumerable: true,\n\t\tset: () => {\n\t\t\tthrow new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);\n\t\t}\n\t});\n\treturn module;\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var inProgress = {};\nvar dataWebpackPrefix = \"js:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.S = {};\nvar initPromises = {};\nvar initTokens = {};\n__webpack_require__.I = (name, initScope) => {\n\tif(!initScope) initScope = [];\n\t// handling circular init calls\n\tvar initToken = initTokens[name];\n\tif(!initToken) initToken = initTokens[name] = {};\n\tif(initScope.indexOf(initToken) >= 0) return;\n\tinitScope.push(initToken);\n\t// only runs once\n\tif(initPromises[name]) return initPromises[name];\n\t// creates a new share scope if needed\n\tif(!__webpack_require__.o(__webpack_require__.S, name)) __webpack_require__.S[name] = {};\n\t// runs all init snippets from all modules reachable\n\tvar scope = __webpack_require__.S[name];\n\tvar warn = (msg) => {\n\t\tif (typeof console !== \"undefined\" && console.warn) console.warn(msg);\n\t};\n\tvar uniqueName = \"js\";\n\tvar register = (name, version, factory, eager) => {\n\t\tvar versions = scope[name] = scope[name] || {};\n\t\tvar activeVersion = versions[version];\n\t\tif(!activeVersion || (!activeVersion.loaded && (!eager != !activeVersion.eager ? eager : uniqueName > activeVersion.from))) versions[version] = { get: factory, from: uniqueName, eager: !!eager };\n\t};\n\tvar initExternal = (id) => {\n\t\tvar handleError = (err) => (warn(\"Initialization of sharing external failed: \" + err));\n\t\ttry {\n\t\t\tvar module = __webpack_require__(id);\n\t\t\tif(!module) return;\n\t\t\tvar initFn = (module) => (module && module.init && module.init(__webpack_require__.S[name], initScope))\n\t\t\tif(module.then) return promises.push(module.then(initFn, handleError));\n\t\t\tvar initResult = initFn(module);\n\t\t\tif(initResult && initResult.then) return promises.push(initResult['catch'](handleError));\n\t\t} catch(err) { handleError(err); }\n\t}\n\tvar promises = [];\n\tswitch(name) {\n\t\tcase \"default\": {\n\t\t\tregister(\"@iobroker/adapter-react-v5\", \"4.10.1\", () => (Promise.all([__webpack_require__.e(448), __webpack_require__.e(977), __webpack_require__.e(239), __webpack_require__.e(223), __webpack_require__.e(623), __webpack_require__.e(944), __webpack_require__.e(956), __webpack_require__.e(838), __webpack_require__.e(17), __webpack_require__.e(819), __webpack_require__.e(854), __webpack_require__.e(564), __webpack_require__.e(440), __webpack_require__.e(412), __webpack_require__.e(732), __webpack_require__.e(805)]).then(() => (() => (__webpack_require__(26079))))));\n\t\t\tregister(\"@mui/icons-material\", \"5.15.12\", () => (Promise.all([__webpack_require__.e(448), __webpack_require__.e(223), __webpack_require__.e(675), __webpack_require__.e(819), __webpack_require__.e(854)]).then(() => (() => (__webpack_require__(28675))))));\n\t\t\tregister(\"@mui/material\", \"5.14.14\", () => (Promise.all([__webpack_require__.e(448), __webpack_require__.e(977), __webpack_require__.e(239), __webpack_require__.e(195), __webpack_require__.e(956), __webpack_require__.e(772), __webpack_require__.e(819), __webpack_require__.e(854), __webpack_require__.e(564), __webpack_require__.e(440)]).then(() => (() => (__webpack_require__(73772))))));\n\t\t\tregister(\"@mui/material\", \"5.15.12\", () => (Promise.all([__webpack_require__.e(448), __webpack_require__.e(239), __webpack_require__.e(223), __webpack_require__.e(623), __webpack_require__.e(195), __webpack_require__.e(944), __webpack_require__.e(774), __webpack_require__.e(86), __webpack_require__.e(819), __webpack_require__.e(854), __webpack_require__.e(440)]).then(() => (() => (__webpack_require__(53086))))));\n\t\t\tregister(\"@mui/styles\", \"5.14.14\", () => (Promise.all([__webpack_require__.e(983), __webpack_require__.e(447), __webpack_require__.e(819), __webpack_require__.e(854), __webpack_require__.e(564), __webpack_require__.e(431)]).then(() => (() => (__webpack_require__(70239))))));\n\t\t\tregister(\"@mui/styles\", \"5.15.12\", () => (Promise.all([__webpack_require__.e(983), __webpack_require__.e(377), __webpack_require__.e(819), __webpack_require__.e(854), __webpack_require__.e(702)]).then(() => (() => (__webpack_require__(55365))))));\n\t\t\tregister(\"prop-types\", \"15.7.2\", () => (__webpack_require__.e(281).then(() => (() => (__webpack_require__(93281))))));\n\t\t\tregister(\"prop-types\", \"15.8.1\", () => (__webpack_require__.e(7).then(() => (() => (__webpack_require__(52007))))));\n\t\t\tregister(\"react-ace\", \"10.1.0\", () => (Promise.all([__webpack_require__.e(399), __webpack_require__.e(819), __webpack_require__.e(854)]).then(() => (() => (__webpack_require__(38399))))));\n\t\t\tregister(\"react-dom\", \"18.2.0\", () => (Promise.all([__webpack_require__.e(164), __webpack_require__.e(819)]).then(() => (() => (__webpack_require__(54164))))));\n\t\t\tregister(\"react\", \"17.0.2\", () => (__webpack_require__.e(666).then(() => (() => (__webpack_require__(147))))));\n\t\t\tregister(\"react\", \"18.2.0\", () => (__webpack_require__.e(791).then(() => (() => (__webpack_require__(72791))))));\n\t\t}\n\t\tbreak;\n\t}\n\tif(!promises.length) return initPromises[name] = 1;\n\treturn initPromises[name] = Promise.all(promises).then(() => (initPromises[name] = 1));\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl + \"../../\";","var parseVersion = (str) => {\n\t// see webpack/lib/util/semver.js for original code\n\tvar p=p=>{return p.split(\".\").map((p=>{return+p==p?+p:p}))},n=/^([^-+]+)?(?:-([^+]+))?(?:\\+(.+))?$/.exec(str),r=n[1]?p(n[1]):[];return n[2]&&(r.length++,r.push.apply(r,p(n[2]))),n[3]&&(r.push([]),r.push.apply(r,p(n[3]))),r;\n}\nvar versionLt = (a, b) => {\n\t// see webpack/lib/util/semver.js for original code\n\ta=parseVersion(a),b=parseVersion(b);for(var r=0;;){if(r>=a.length)return r=b.length)return\"u\"==n;var t=b[r],f=(typeof t)[0];if(n!=f)return\"o\"==n&&\"n\"==f||(\"s\"==f||\"u\"==n);if(\"o\"!=n&&\"u\"!=n&&e!=t)return e {\n\t// see webpack/lib/util/semver.js for original code\n\tvar r=range[0],n=\"\";if(1===range.length)return\"*\";if(r+.5){n+=0==r?\">=\":-1==r?\"<\":1==r?\"^\":2==r?\"~\":r>0?\"=\":\"!=\";for(var e=1,a=1;a0?\".\":\"\")+(e=2,t)}return n}var g=[];for(a=1;a {\n\t// see webpack/lib/util/semver.js for original code\n\tif(0 in range){version=parseVersion(version);var e=range[0],r=e<0;r&&(e=-e-1);for(var n=0,i=1,a=!0;;i++,n++){var f,s,g=i=version.length||\"o\"==(s=(typeof(f=version[n]))[0]))return!a||(\"u\"==g?i>e&&!r:\"\"==g!=r);if(\"u\"==s){if(!a||\"u\"!=g)return!1}else if(a)if(g==s)if(i<=e){if(f!=range[i])return!1}else{if(r?f>range[i]:f {\n\tvar scope = __webpack_require__.S[scopeName];\n\tif(!scope || !__webpack_require__.o(scope, key)) throw new Error(\"Shared module \" + key + \" doesn't exist in shared scope \" + scopeName);\n\treturn scope;\n};\nvar findVersion = (scope, key) => {\n\tvar versions = scope[key];\n\tvar key = Object.keys(versions).reduce((a, b) => {\n\t\treturn !a || versionLt(a, b) ? b : a;\n\t}, 0);\n\treturn key && versions[key]\n};\nvar findSingletonVersionKey = (scope, key) => {\n\tvar versions = scope[key];\n\treturn Object.keys(versions).reduce((a, b) => {\n\t\treturn !a || (!versions[a].loaded && versionLt(a, b)) ? b : a;\n\t}, 0);\n};\nvar getInvalidSingletonVersionMessage = (scope, key, version, requiredVersion) => {\n\treturn \"Unsatisfied version \" + version + \" from \" + (version && scope[key][version].from) + \" of shared singleton module \" + key + \" (required \" + rangeToString(requiredVersion) + \")\"\n};\nvar getSingleton = (scope, scopeName, key, requiredVersion) => {\n\tvar version = findSingletonVersionKey(scope, key);\n\treturn get(scope[key][version]);\n};\nvar getSingletonVersion = (scope, scopeName, key, requiredVersion) => {\n\tvar version = findSingletonVersionKey(scope, key);\n\tif (!satisfy(requiredVersion, version)) warn(getInvalidSingletonVersionMessage(scope, key, version, requiredVersion));\n\treturn get(scope[key][version]);\n};\nvar getStrictSingletonVersion = (scope, scopeName, key, requiredVersion) => {\n\tvar version = findSingletonVersionKey(scope, key);\n\tif (!satisfy(requiredVersion, version)) throw new Error(getInvalidSingletonVersionMessage(scope, key, version, requiredVersion));\n\treturn get(scope[key][version]);\n};\nvar findValidVersion = (scope, key, requiredVersion) => {\n\tvar versions = scope[key];\n\tvar key = Object.keys(versions).reduce((a, b) => {\n\t\tif (!satisfy(requiredVersion, b)) return a;\n\t\treturn !a || versionLt(a, b) ? b : a;\n\t}, 0);\n\treturn key && versions[key]\n};\nvar getInvalidVersionMessage = (scope, scopeName, key, requiredVersion) => {\n\tvar versions = scope[key];\n\treturn \"No satisfying version (\" + rangeToString(requiredVersion) + \") of shared module \" + key + \" found in shared scope \" + scopeName + \".\\n\" +\n\t\t\"Available versions: \" + Object.keys(versions).map((key) => {\n\t\treturn key + \" from \" + versions[key].from;\n\t}).join(\", \");\n};\nvar getValidVersion = (scope, scopeName, key, requiredVersion) => {\n\tvar entry = findValidVersion(scope, key, requiredVersion);\n\tif(entry) return get(entry);\n\tthrow new Error(getInvalidVersionMessage(scope, scopeName, key, requiredVersion));\n};\nvar warn = (msg) => {\n\tif (typeof console !== \"undefined\" && console.warn) console.warn(msg);\n};\nvar warnInvalidVersion = (scope, scopeName, key, requiredVersion) => {\n\twarn(getInvalidVersionMessage(scope, scopeName, key, requiredVersion));\n};\nvar get = (entry) => {\n\tentry.loaded = 1;\n\treturn entry.get()\n};\nvar init = (fn) => (function(scopeName, a, b, c) {\n\tvar promise = __webpack_require__.I(scopeName);\n\tif (promise && promise.then) return promise.then(fn.bind(fn, scopeName, __webpack_require__.S[scopeName], a, b, c));\n\treturn fn(scopeName, __webpack_require__.S[scopeName], a, b, c);\n});\n\nvar load = /*#__PURE__*/ init((scopeName, scope, key) => {\n\tensureExistence(scopeName, key);\n\treturn get(findVersion(scope, key));\n});\nvar loadFallback = /*#__PURE__*/ init((scopeName, scope, key, fallback) => {\n\treturn scope && __webpack_require__.o(scope, key) ? get(findVersion(scope, key)) : fallback();\n});\nvar loadVersionCheck = /*#__PURE__*/ init((scopeName, scope, key, version) => {\n\tensureExistence(scopeName, key);\n\treturn get(findValidVersion(scope, key, version) || warnInvalidVersion(scope, scopeName, key, version) || findVersion(scope, key));\n});\nvar loadSingleton = /*#__PURE__*/ init((scopeName, scope, key) => {\n\tensureExistence(scopeName, key);\n\treturn getSingleton(scope, scopeName, key);\n});\nvar loadSingletonVersionCheck = /*#__PURE__*/ init((scopeName, scope, key, version) => {\n\tensureExistence(scopeName, key);\n\treturn getSingletonVersion(scope, scopeName, key, version);\n});\nvar loadStrictVersionCheck = /*#__PURE__*/ init((scopeName, scope, key, version) => {\n\tensureExistence(scopeName, key);\n\treturn getValidVersion(scope, scopeName, key, version);\n});\nvar loadStrictSingletonVersionCheck = /*#__PURE__*/ init((scopeName, scope, key, version) => {\n\tensureExistence(scopeName, key);\n\treturn getStrictSingletonVersion(scope, scopeName, key, version);\n});\nvar loadVersionCheckFallback = /*#__PURE__*/ init((scopeName, scope, key, version, fallback) => {\n\tif(!scope || !__webpack_require__.o(scope, key)) return fallback();\n\treturn get(findValidVersion(scope, key, version) || warnInvalidVersion(scope, scopeName, key, version) || findVersion(scope, key));\n});\nvar loadSingletonFallback = /*#__PURE__*/ init((scopeName, scope, key, fallback) => {\n\tif(!scope || !__webpack_require__.o(scope, key)) return fallback();\n\treturn getSingleton(scope, scopeName, key);\n});\nvar loadSingletonVersionCheckFallback = /*#__PURE__*/ init((scopeName, scope, key, version, fallback) => {\n\tif(!scope || !__webpack_require__.o(scope, key)) return fallback();\n\treturn getSingletonVersion(scope, scopeName, key, version);\n});\nvar loadStrictVersionCheckFallback = /*#__PURE__*/ init((scopeName, scope, key, version, fallback) => {\n\tvar entry = scope && __webpack_require__.o(scope, key) && findValidVersion(scope, key, version);\n\treturn entry ? get(entry) : fallback();\n});\nvar loadStrictSingletonVersionCheckFallback = /*#__PURE__*/ init((scopeName, scope, key, version, fallback) => {\n\tif(!scope || !__webpack_require__.o(scope, key)) return fallback();\n\treturn getStrictSingletonVersion(scope, scopeName, key, version);\n});\nvar installedModules = {};\nvar moduleToHandlerMapping = {\n\t4819: () => (loadSingletonVersionCheckFallback(\"default\", \"react\", [0], () => (__webpack_require__.e(791).then(() => (() => (__webpack_require__(72791))))))),\n\t15854: () => (loadSingletonVersionCheckFallback(\"default\", \"prop-types\", [0], () => (__webpack_require__.e(7).then(() => (() => (__webpack_require__(52007))))))),\n\t88564: () => (loadSingletonVersionCheckFallback(\"default\", \"react\", [0], () => (__webpack_require__.e(147).then(() => (() => (__webpack_require__(147))))))),\n\t77440: () => (loadSingletonVersionCheckFallback(\"default\", \"react-dom\", [0], () => (__webpack_require__.e(164).then(() => (() => (__webpack_require__(54164))))))),\n\t18967: () => (loadSingletonVersionCheckFallback(\"default\", \"@mui/material\", [0], () => (Promise.all([__webpack_require__.e(977), __webpack_require__.e(195), __webpack_require__.e(772)]).then(() => (() => (__webpack_require__(73772))))))),\n\t35025: () => (loadSingletonVersionCheckFallback(\"default\", \"@mui/styles\", [0], () => (Promise.all([__webpack_require__.e(983), __webpack_require__.e(447)]).then(() => (() => (__webpack_require__(70239))))))),\n\t58503: () => (loadSingletonVersionCheckFallback(\"default\", \"@mui/styles\", [0], () => (Promise.all([__webpack_require__.e(983), __webpack_require__.e(377), __webpack_require__.e(365)]).then(() => (() => (__webpack_require__(55365))))))),\n\t59665: () => (loadSingletonVersionCheckFallback(\"default\", \"@mui/icons-material\", [0], () => (__webpack_require__.e(675).then(() => (() => (__webpack_require__(28675))))))),\n\t75606: () => (loadSingletonVersionCheckFallback(\"default\", \"@iobroker/adapter-react-v5\", [0], () => (Promise.all([__webpack_require__.e(977), __webpack_require__.e(623), __webpack_require__.e(838), __webpack_require__.e(732), __webpack_require__.e(880)]).then(() => (() => (__webpack_require__(26079))))))),\n\t94427: () => (loadSingletonVersionCheckFallback(\"default\", \"@mui/material\", [0], () => (Promise.all([__webpack_require__.e(623), __webpack_require__.e(195), __webpack_require__.e(774), __webpack_require__.e(86)]).then(() => (() => (__webpack_require__(53086))))))),\n\t91305: () => (loadSingletonVersionCheckFallback(\"default\", \"prop-types\", [0], () => (__webpack_require__.e(281).then(() => (() => (__webpack_require__(93281))))))),\n\t83732: () => (loadSingletonVersionCheckFallback(\"default\", \"react-ace\", [0], () => (__webpack_require__.e(399).then(() => (() => (__webpack_require__(38399)))))))\n};\n// no consumes in initial chunks\nvar chunkMapping = {\n\t\"412\": [\n\t\t18967,\n\t\t35025,\n\t\t58503,\n\t\t59665,\n\t\t75606,\n\t\t94427\n\t],\n\t\"440\": [\n\t\t77440\n\t],\n\t\"564\": [\n\t\t88564\n\t],\n\t\"732\": [\n\t\t83732\n\t],\n\t\"819\": [\n\t\t4819\n\t],\n\t\"854\": [\n\t\t15854\n\t],\n\t\"864\": [\n\t\t91305\n\t]\n};\n__webpack_require__.f.consumes = (chunkId, promises) => {\n\tif(__webpack_require__.o(chunkMapping, chunkId)) {\n\t\tchunkMapping[chunkId].forEach((id) => {\n\t\t\tif(__webpack_require__.o(installedModules, id)) return promises.push(installedModules[id]);\n\t\t\tvar onFactory = (factory) => {\n\t\t\t\tinstalledModules[id] = 0;\n\t\t\t\t__webpack_require__.m[id] = (module) => {\n\t\t\t\t\tdelete __webpack_require__.c[id];\n\t\t\t\t\tmodule.exports = factory();\n\t\t\t\t}\n\t\t\t};\n\t\t\tvar onError = (error) => {\n\t\t\t\tdelete installedModules[id];\n\t\t\t\t__webpack_require__.m[id] = (module) => {\n\t\t\t\t\tdelete __webpack_require__.c[id];\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t};\n\t\t\ttry {\n\t\t\t\tvar promise = moduleToHandlerMapping[id]();\n\t\t\t\tif(promise.then) {\n\t\t\t\t\tpromises.push(installedModules[id] = promise.then(onFactory)['catch'](onError));\n\t\t\t\t} else onFactory(promise);\n\t\t\t} catch(e) { onError(e); }\n\t\t});\n\t}\n}","if (typeof document === \"undefined\") return;\nvar createStylesheet = (chunkId, fullhref, oldTag, resolve, reject) => {\n\tvar linkTag = document.createElement(\"link\");\n\n\tlinkTag.rel = \"stylesheet\";\n\tlinkTag.type = \"text/css\";\n\tvar onLinkComplete = (event) => {\n\t\t// avoid mem leaks.\n\t\tlinkTag.onerror = linkTag.onload = null;\n\t\tif (event.type === 'load') {\n\t\t\tresolve();\n\t\t} else {\n\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\tvar realHref = event && event.target && event.target.href || fullhref;\n\t\t\tvar err = new Error(\"Loading CSS chunk \" + chunkId + \" failed.\\n(\" + realHref + \")\");\n\t\t\terr.code = \"CSS_CHUNK_LOAD_FAILED\";\n\t\t\terr.type = errorType;\n\t\t\terr.request = realHref;\n\t\t\tif (linkTag.parentNode) linkTag.parentNode.removeChild(linkTag)\n\t\t\treject(err);\n\t\t}\n\t}\n\tlinkTag.onerror = linkTag.onload = onLinkComplete;\n\tlinkTag.href = fullhref;\n\n\tif (oldTag) {\n\t\toldTag.parentNode.insertBefore(linkTag, oldTag.nextSibling);\n\t} else {\n\t\tdocument.head.appendChild(linkTag);\n\t}\n\treturn linkTag;\n};\nvar findStylesheet = (href, fullhref) => {\n\tvar existingLinkTags = document.getElementsByTagName(\"link\");\n\tfor(var i = 0; i < existingLinkTags.length; i++) {\n\t\tvar tag = existingLinkTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\") || tag.getAttribute(\"href\");\n\t\tif(tag.rel === \"stylesheet\" && (dataHref === href || dataHref === fullhref)) return tag;\n\t}\n\tvar existingStyleTags = document.getElementsByTagName(\"style\");\n\tfor(var i = 0; i < existingStyleTags.length; i++) {\n\t\tvar tag = existingStyleTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\");\n\t\tif(dataHref === href || dataHref === fullhref) return tag;\n\t}\n};\nvar loadStylesheet = (chunkId) => {\n\treturn new Promise((resolve, reject) => {\n\t\tvar href = __webpack_require__.miniCssF(chunkId);\n\t\tvar fullhref = __webpack_require__.p + href;\n\t\tif(findStylesheet(href, fullhref)) return resolve();\n\t\tcreateStylesheet(chunkId, fullhref, null, resolve, reject);\n\t});\n}\n// object to store loaded CSS chunks\nvar installedCssChunks = {\n\t179: 0\n};\n\n__webpack_require__.f.miniCss = (chunkId, promises) => {\n\tvar cssChunks = {\"864\":1};\n\tif(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);\n\telse if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {\n\t\tpromises.push(installedCssChunks[chunkId] = loadStylesheet(chunkId).then(() => {\n\t\t\tinstalledCssChunks[chunkId] = 0;\n\t\t}, (e) => {\n\t\t\tdelete installedCssChunks[chunkId];\n\t\t\tthrow e;\n\t\t}));\n\t}\n};\n\n// no hmr","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t179: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(!/^(412|440|564|732|819|854)$/.test(chunkId)) {\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkjs\"] = self[\"webpackChunkjs\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","// module cache are used so entry inlining is disabled\n// startup\n// Load entry module and return exports\nvar __webpack_exports__ = __webpack_require__(77569);\n"],"names":["__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","id","loaded","__webpack_modules__","call","m","c","amdD","Error","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","f","e","chunkId","Promise","all","keys","reduce","promises","u","miniCssF","g","globalThis","this","Function","window","hmd","create","children","set","obj","prop","prototype","hasOwnProperty","inProgress","l","url","done","push","script","needAttach","scripts","document","getElementsByTagName","i","length","s","getAttribute","createElement","charset","timeout","nc","setAttribute","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","doneFns","parentNode","removeChild","forEach","fn","setTimeout","bind","type","target","head","appendChild","r","Symbol","toStringTag","value","nmd","paths","S","initPromises","initTokens","I","name","initScope","initToken","indexOf","scope","register","version","factory","eager","versions","activeVersion","from","then","scriptUrl","importScripts","location","currentScript","replace","p","parseVersion","str","split","map","exec","apply","versionLt","b","t","rangeToString","range","pop","satisfy","findSingletonVersionKey","getInvalidSingletonVersionMessage","requiredVersion","getSingletonVersion","scopeName","warn","msg","console","entry","init","promise","loadSingletonVersionCheckFallback","fallback","installedModules","moduleToHandlerMapping","chunkMapping","consumes","onFactory","onError","error","loadStylesheet","resolve","reject","href","fullhref","existingLinkTags","dataHref","tag","rel","existingStyleTags","findStylesheet","oldTag","linkTag","errorType","realHref","err","code","request","insertBefore","nextSibling","createStylesheet","installedCssChunks","miniCss","installedChunks","j","installedChunkData","test","realSrc","message","webpackJsonpCallback","parentChunkLoadingFunction","data","chunkIds","moreModules","runtime","some","chunkLoadingGlobal","self"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"static/js/main.01873cd9.js","mappings":"6BAAA,2L,GCCIA,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaE,QAGrB,IAAIC,EAASN,EAAyBE,GAAY,CACjDK,GAAIL,EACJM,QAAQ,EACRH,QAAS,CAAC,GAUX,OANAI,EAAoBP,GAAUQ,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASJ,GAG3EK,EAAOE,QAAS,EAGTF,EAAOD,OACf,CAGAJ,EAAoBU,EAAIF,EAGxBR,EAAoBW,EAAIZ,EC/BxBC,EAAoBY,KAAO,WAC1B,MAAM,IAAIC,MAAM,iCACjB,ECDAb,EAAoBc,EAAKT,IACxB,IAAIU,EAASV,GAAUA,EAAOW,WAC7B,IAAOX,EAAiB,QACxB,IAAM,EAEP,OADAL,EAAoBiB,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdf,EAAoBiB,EAAI,CAACb,EAASe,KACjC,IAAI,IAAIC,KAAOD,EACXnB,EAAoBqB,EAAEF,EAAYC,KAASpB,EAAoBqB,EAAEjB,EAASgB,IAC5EE,OAAOC,eAAenB,EAASgB,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDpB,EAAoB0B,EAAI,CAAC,EAGzB1B,EAAoB2B,EAAKC,GACjBC,QAAQC,IAAIR,OAAOS,KAAK/B,EAAoB0B,GAAGM,QAAO,CAACC,EAAUb,KACvEpB,EAAoB0B,EAAEN,GAAKQ,EAASK,GAC7BA,IACL,KCNJjC,EAAoBkC,EAAKN,GAEjB,aAAeA,EAAU,IAAM,CAAC,EAAI,WAAW,GAAK,WAAW,GAAK,WAAW,GAAK,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,WAAW,IAAM,YAAYA,GAAW,YCFpqB5B,EAAoBmC,SAAYP,GAExB,cAAgBA,EAAhB,sBCHR5B,EAAoBoC,EAAI,WACvB,GAA0B,kBAAfC,WAAyB,OAAOA,WAC3C,IACC,OAAOC,MAAQ,IAAIC,SAAS,cAAb,EAChB,CAAE,MAAOZ,GACR,GAAsB,kBAAXa,OAAqB,OAAOA,MACxC,CACA,CAPuB,GCAxBxC,EAAoByC,IAAOpC,KAC1BA,EAASiB,OAAOoB,OAAOrC,IACXsC,WAAUtC,EAAOsC,SAAW,IACxCrB,OAAOC,eAAelB,EAAQ,UAAW,CACxCmB,YAAY,EACZoB,IAAK,KACJ,MAAM,IAAI/B,MAAM,0FAA4FR,EAAOC,GAAG,IAGjHD,GCTRL,EAAoBqB,EAAI,CAACwB,EAAKC,IAAUxB,OAAOyB,UAAUC,eAAevC,KAAKoC,EAAKC,G,MCAlF,IAAIG,EAAa,CAAC,EAGlBjD,EAAoBkD,EAAI,CAACC,EAAKC,EAAMhC,EAAKQ,KACxC,GAAGqB,EAAWE,GAAQF,EAAWE,GAAKE,KAAKD,OAA3C,CACA,IAAIE,EAAQC,EACZ,QAAWpD,IAARiB,EAEF,IADA,IAAIoC,EAAUC,SAASC,qBAAqB,UACpCC,EAAI,EAAGA,EAAIH,EAAQI,OAAQD,IAAK,CACvC,IAAIE,EAAIL,EAAQG,GAChB,GAAGE,EAAEC,aAAa,QAAUX,GAAOU,EAAEC,aAAa,iBAT7B,MASoE1C,EAAK,CAAEkC,EAASO,EAAG,KAAO,CACpH,CAEGP,IACHC,GAAa,GACbD,EAASG,SAASM,cAAc,WAEzBC,QAAU,QACjBV,EAAOW,QAAU,IACbjE,EAAoBkE,IACvBZ,EAAOa,aAAa,QAASnE,EAAoBkE,IAElDZ,EAAOa,aAAa,eArBE,MAqBkC/C,GAExDkC,EAAOc,IAAMjB,GAEdF,EAAWE,GAAO,CAACC,GACnB,IAAIiB,EAAmB,CAACC,EAAMC,KAE7BjB,EAAOkB,QAAUlB,EAAOmB,OAAS,KACjCC,aAAaT,GACb,IAAIU,EAAU1B,EAAWE,GAIzB,UAHOF,EAAWE,GAClBG,EAAOsB,YAActB,EAAOsB,WAAWC,YAAYvB,GACnDqB,GAAWA,EAAQG,SAASC,GAAQA,EAAGR,KACpCD,EAAM,OAAOA,EAAKC,EAAM,EAExBN,EAAUe,WAAWX,EAAiBY,KAAK,UAAM9E,EAAW,CAAE+E,KAAM,UAAWC,OAAQ7B,IAAW,MACtGA,EAAOkB,QAAUH,EAAiBY,KAAK,KAAM3B,EAAOkB,SACpDlB,EAAOmB,OAASJ,EAAiBY,KAAK,KAAM3B,EAAOmB,QACnDlB,GAAcE,SAAS2B,KAAKC,YAAY/B,EApCkB,CAoCX,C,KCvChDtD,EAAoBsF,EAAKlF,IACH,qBAAXmF,QAA0BA,OAAOC,aAC1ClE,OAAOC,eAAenB,EAASmF,OAAOC,YAAa,CAAEC,MAAO,WAE7DnE,OAAOC,eAAenB,EAAS,aAAc,CAAEqF,OAAO,GAAO,ECL9DzF,EAAoB0F,IAAOrF,IAC1BA,EAAOsF,MAAQ,GACVtF,EAAOsC,WAAUtC,EAAOsC,SAAW,IACjCtC,G,MCHRL,EAAoB4F,EAAI,CAAC,EACzB,IAAIC,EAAe,CAAC,EAChBC,EAAa,CAAC,EAClB9F,EAAoB+F,EAAI,CAACC,EAAMC,KAC1BA,IAAWA,EAAY,IAE3B,IAAIC,EAAYJ,EAAWE,GAE3B,GADIE,IAAWA,EAAYJ,EAAWE,GAAQ,CAAC,KAC5CC,EAAUE,QAAQD,IAAc,GAAnC,CAGA,GAFAD,EAAU5C,KAAK6C,GAEZL,EAAaG,GAAO,OAAOH,EAAaG,GAEvChG,EAAoBqB,EAAErB,EAAoB4F,EAAGI,KAAOhG,EAAoB4F,EAAEI,GAAQ,CAAC,GAEvF,IAAII,EAAQpG,EAAoB4F,EAAEI,GAK9BK,EAAW,CAACL,EAAMM,EAASC,EAASC,KACvC,IAAIC,EAAWL,EAAMJ,GAAQI,EAAMJ,IAAS,CAAC,EACzCU,EAAgBD,EAASH,KACzBI,IAAmBA,EAAcnG,UAAYiG,IAAUE,EAAcF,MAAQA,EAJjE,KAIsFE,EAAcC,SAAQF,EAASH,GAAW,CAAE7E,IAAK8E,EAASI,KAJhJ,KAIkKH,QAASA,GAAO,EAa/LvE,EAAW,GACf,GACM,YADC+D,EAELK,EAAS,6BAA8B,UAAU,IAAOxE,QAAQC,IAAI,CAAC9B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,IAAK3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,OAAOiF,MAAK,IAAM,IAAQ5G,EAAoB,WAC5iBqG,EAAS,sBAAuB,WAAW,IAAOxE,QAAQC,IAAI,CAAC9B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,OAAOiF,MAAK,IAAM,IAAQ5G,EAAoB,WACnPqG,EAAS,gBAAiB,WAAW,IAAOxE,QAAQC,IAAI,CAAC9B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,OAAOiF,MAAK,IAAM,IAAQ5G,EAAoB,WACzXqG,EAAS,gBAAiB,WAAW,IAAOxE,QAAQC,IAAI,CAAC9B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,IAAK3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,OAAOiF,MAAK,IAAM,IAAQ5G,EAAoB,WACpZqG,EAAS,cAAe,WAAW,IAAOxE,QAAQC,IAAI,CAAC9B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,OAAOiF,MAAK,IAAM,IAAQ5G,EAAoB,WACvQqG,EAAS,cAAe,WAAW,IAAOxE,QAAQC,IAAI,CAAC9B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,OAAOiF,MAAK,IAAM,IAAQ5G,EAAoB,WAC3OqG,EAAS,aAAc,UAAU,IAAOrG,EAAoB2B,EAAE,KAAKiF,MAAK,IAAM,IAAQ5G,EAAoB,WAC1GqG,EAAS,aAAc,UAAU,IAAOrG,EAAoB2B,EAAE,GAAGiF,MAAK,IAAM,IAAQ5G,EAAoB,WACxGqG,EAAS,YAAa,UAAU,IAAOxE,QAAQC,IAAI,CAAC9B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,OAAOiF,MAAK,IAAM,IAAQ5G,EAAoB,WAChLqG,EAAS,YAAa,UAAU,IAAOxE,QAAQC,IAAI,CAAC9B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,OAAOiF,MAAK,IAAM,IAAQ5G,EAAoB,WACpJqG,EAAS,QAAS,UAAU,IAAOrG,EAAoB2B,EAAE,KAAKiF,MAAK,IAAM,IAAQ5G,EAAoB,SACrGqG,EAAS,QAAS,UAAU,IAAOrG,EAAoB2B,EAAE,KAAKiF,MAAK,IAAM,IAAQ5G,EAAoB,WAIvG,OAAIiC,EAAS2B,OACNiC,EAAaG,GAAQnE,QAAQC,IAAIG,GAAU2E,MAAK,IAAOf,EAAaG,GAAQ,IADvDH,EAAaG,GAAQ,CA9CL,CA+C0C,C,WCvDvF,IAAIa,EACA7G,EAAoBoC,EAAE0E,gBAAeD,EAAY7G,EAAoBoC,EAAE2E,SAAW,IACtF,IAAItD,EAAWzD,EAAoBoC,EAAEqB,SACrC,IAAKoD,GAAapD,IACbA,EAASuD,gBACZH,EAAYpD,EAASuD,cAAc5C,MAC/ByC,GAAW,CACf,IAAIrD,EAAUC,EAASC,qBAAqB,UAC5C,GAAGF,EAAQI,OAEV,IADA,IAAID,EAAIH,EAAQI,OAAS,EAClBD,GAAK,IAAMkD,GAAWA,EAAYrD,EAAQG,KAAKS,GAExD,CAID,IAAKyC,EAAW,MAAM,IAAIhG,MAAM,yDAChCgG,EAAYA,EAAUI,QAAQ,OAAQ,IAAIA,QAAQ,QAAS,IAAIA,QAAQ,YAAa,KACpFjH,EAAoBkH,EAAIL,EAAY,Q,WClBpC,IAAIM,EAAgBC,IAEnB,IAAIF,EAAEA,GAAWA,EAAEG,MAAM,KAAKC,KAAKJ,IAAWA,GAAGA,GAAGA,EAAEA,IAAMpG,EAAE,sCAAsCyG,KAAKH,GAAK9B,EAAExE,EAAE,GAAGoG,EAAEpG,EAAE,IAAI,GAAG,OAAOA,EAAE,KAAKwE,EAAE1B,SAAS0B,EAAEjC,KAAKmE,MAAMlC,EAAE4B,EAAEpG,EAAE,MAAMA,EAAE,KAAKwE,EAAEjC,KAAK,IAAIiC,EAAEjC,KAAKmE,MAAMlC,EAAE4B,EAAEpG,EAAE,MAAMwE,CAAC,EAE3NmC,EAAY,CAACvG,EAAGwG,KAEnBxG,EAAEiG,EAAajG,GAAGwG,EAAEP,EAAaO,GAAG,IAAI,IAAIpC,EAAE,IAAI,CAAC,GAAGA,GAAGpE,EAAE0C,OAAO,OAAO0B,EAAEoC,EAAE9D,QAAQ,aAAa8D,EAAEpC,IAAI,GAAG,IAAI3D,EAAET,EAAEoE,GAAGxE,UAAUa,GAAG,GAAG,GAAG2D,GAAGoC,EAAE9D,OAAO,MAAM,KAAK9C,EAAE,IAAI6G,EAAED,EAAEpC,GAAG5D,UAAUiG,GAAG,GAAG,GAAG7G,GAAGY,EAAE,MAAM,KAAKZ,GAAG,KAAKY,GAAI,KAAKA,GAAG,KAAKZ,EAAG,GAAG,KAAKA,GAAG,KAAKA,GAAGa,GAAGgG,EAAE,OAAOhG,EAAEgG,EAAErC,GAAG,GAE/QsC,EAAiBC,IAEpB,IAAIvC,EAAEuC,EAAM,GAAG/G,EAAE,GAAG,GAAG,IAAI+G,EAAMjE,OAAO,MAAM,IAAI,GAAG0B,EAAE,GAAG,CAACxE,GAAG,GAAGwE,EAAE,MAAM,GAAGA,EAAE,IAAI,GAAGA,EAAE,IAAI,GAAGA,EAAE,IAAIA,EAAE,EAAE,IAAI,KAAK,IAAI,IAAI3D,EAAE,EAAET,EAAE,EAAEA,EAAE2G,EAAMjE,OAAO1C,IAAKS,IAAIb,GAAG,aAAa6G,EAAEE,EAAM3G,KAAK,GAAG,KAAKS,EAAE,EAAE,IAAI,KAAKA,EAAE,EAAEgG,GAAG,OAAO7G,CAAC,CAAC,IAAIsB,EAAE,GAAG,IAAIlB,EAAE,EAAEA,EAAE2G,EAAMjE,OAAO1C,IAAI,CAAC,IAAIyG,EAAEE,EAAM3G,GAAGkB,EAAEiB,KAAK,IAAIsE,EAAE,OAAOtG,IAAI,IAAI,IAAIsG,EAAE,IAAItG,IAAI,OAAOA,IAAI,IAAI,IAAIsG,EAAEvF,EAAE0F,MAAM,IAAI1F,EAAE0F,MAAMF,EAAcD,GAAG,CAAC,OAAOtG,IAAI,SAASA,IAAI,OAAOe,EAAE0F,MAAMb,QAAQ,aAAa,KAAK,GAElbc,EAAU,CAACF,EAAOvB,KAErB,GAAG,KAAKuB,EAAM,CAACvB,EAAQa,EAAab,GAAS,IAAI3E,EAAEkG,EAAM,GAAGvC,EAAE3D,EAAE,EAAE2D,IAAI3D,GAAGA,EAAE,GAAG,IAAI,IAAIb,EAAE,EAAE6C,EAAE,EAAEzC,GAAE,GAAIyC,IAAI7C,IAAI,CAAC,IAAIY,EAAEmC,EAAEzB,EAAEuB,EAAEkE,EAAMjE,eAAeiE,EAAMlE,IAAI,GAAG,GAAG,GAAG7C,GAAGwF,EAAQ1C,QAAQ,MAAMC,UAAUnC,EAAE4E,EAAQxF,KAAK,IAAI,OAAOI,IAAI,KAAKkB,EAAEuB,EAAEhC,IAAI2D,EAAE,IAAIlD,GAAGkD,GAAG,GAAG,KAAKzB,GAAG,IAAI3C,GAAG,KAAKkB,EAAE,OAAM,OAAQ,GAAGlB,EAAE,GAAGkB,GAAGyB,EAAE,GAAGF,GAAGhC,GAAG,GAAGD,GAAGmG,EAAMlE,GAAG,OAAM,MAAO,CAAC,GAAG2B,EAAE5D,EAAEmG,EAAMlE,GAAGjC,EAAEmG,EAAMlE,GAAG,OAAM,EAAGjC,GAAGmG,EAAMlE,KAAKzC,GAAE,EAAG,MAAM,GAAG,KAAKkB,GAAG,KAAKA,EAAE,CAAC,GAAGkD,GAAG3B,GAAGhC,EAAE,OAAM,EAAGT,GAAE,EAAGyC,GAAG,KAAK,CAAC,GAAGA,GAAGhC,GAAGkC,EAAEzB,GAAGkD,EAAE,OAAM,EAAGpE,GAAE,CAAE,KAAK,KAAKkB,GAAG,KAAKA,IAAIlB,GAAE,EAAGyC,IAAI,CAAC,CAAC,IAAIgE,EAAE,GAAGtG,EAAEsG,EAAEG,IAAI7C,KAAK0C,GAAG,IAAI7G,EAAE,EAAEA,EAAE+G,EAAMjE,OAAO9C,IAAI,CAAC,IAAIoB,EAAE2F,EAAM/G,GAAG6G,EAAEtE,KAAK,GAAGnB,EAAEb,IAAIA,IAAI,GAAGa,EAAEb,IAAIA,IAAIa,EAAE6F,EAAQ7F,EAAEoE,IAAUjF,IAAI,CAAC,QAAQA,GAAG,EAc7oB2G,EAA0B,CAAC5B,EAAOhF,KACrC,IAAIqF,EAAWL,EAAMhF,GACrB,OAAOE,OAAOS,KAAK0E,GAAUzE,QAAO,CAACd,EAAGwG,KAC/BxG,IAAOuF,EAASvF,GAAGX,QAAUkH,EAAUvG,EAAGwG,GAAMA,EAAIxG,GAC1D,EAAE,EAEF+G,EAAoC,CAAC7B,EAAOhF,EAAKkF,EAAS4B,IACtD,uBAAyB5B,EAAU,UAAYA,GAAWF,EAAMhF,GAAKkF,GAASK,MAAQ,+BAAiCvF,EAAM,cAAgBwG,EAAcM,GAAmB,IAMlLC,EAAsB,CAAC/B,EAAOgC,EAAWhH,EAAK8G,KACjD,IAAI5B,EAAU0B,EAAwB5B,EAAOhF,GAE7C,OADK2G,EAAQG,EAAiB5B,IAAU+B,EAAKJ,EAAkC7B,EAAOhF,EAAKkF,EAAS4B,IAC7FzG,EAAI2E,EAAMhF,GAAKkF,GAAS,EA2B5B+B,EAAQC,IACY,qBAAZC,SAA2BA,QAAQF,MAAME,QAAQF,KAAKC,EAAI,EAKlE7G,EAAO+G,IACVA,EAAMjI,OAAS,EACRiI,EAAM/G,OAEVgH,EAAQ1D,GAAO,SAAUqD,EAAWlH,EAAGwG,EAAG/G,GAC7C,IAAI+H,EAAU1I,EAAoB+F,EAAEqC,GACpC,OAAIM,GAAWA,EAAQ9B,KAAa8B,EAAQ9B,KAAK7B,EAAGE,KAAKF,EAAIqD,EAAWpI,EAAoB4F,EAAEwC,GAAYlH,EAAGwG,EAAG/G,IACzGoE,EAAGqD,EAAWpI,EAAoB4F,EAAEwC,GAAYlH,EAAGwG,EAAG/G,EAC7D,EAqCGgI,EAAkDF,GAAK,CAACL,EAAWhC,EAAOhF,EAAKkF,EAASsC,IACvFxC,GAAUpG,EAAoBqB,EAAE+E,EAAOhF,GACpC+G,EAAoB/B,EAAOgC,EAAWhH,EAAKkF,GADMsC,MAWrDC,EAAmB,CAAC,EACpBC,EAAyB,CAC5B,KAAM,IAAOH,EAAkC,UAAW,QAAS,CAAC,IAAI,IAAO3I,EAAoB2B,EAAE,KAAKiF,MAAK,IAAM,IAAQ5G,EAAoB,WACjJ,MAAO,IAAO2I,EAAkC,UAAW,aAAc,CAAC,IAAI,IAAO3I,EAAoB2B,EAAE,GAAGiF,MAAK,IAAM,IAAQ5G,EAAoB,WACrJ,MAAO,IAAO2I,EAAkC,UAAW,QAAS,CAAC,IAAI,IAAO3I,EAAoB2B,EAAE,KAAKiF,MAAK,IAAM,IAAQ5G,EAAoB,SAClJ,MAAO,IAAO2I,EAAkC,UAAW,YAAa,CAAC,IAAI,IAAO3I,EAAoB2B,EAAE,KAAKiF,MAAK,IAAM,IAAQ5G,EAAoB,WACtJ,MAAO,IAAO2I,EAAkC,UAAW,gBAAiB,CAAC,IAAI,IAAO9G,QAAQC,IAAI,CAAC9B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,OAAOiF,MAAK,IAAM,IAAQ5G,EAAoB,WACjO,MAAO,IAAO2I,EAAkC,UAAW,cAAe,CAAC,IAAI,IAAO9G,QAAQC,IAAI,CAAC9B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,OAAOiF,MAAK,IAAM,IAAQ5G,EAAoB,WACnM,MAAO,IAAO2I,EAAkC,UAAW,cAAe,CAAC,IAAI,IAAO9G,QAAQC,IAAI,CAAC9B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,OAAOiF,MAAK,IAAM,IAAQ5G,EAAoB,WAC/N,MAAO,IAAO2I,EAAkC,UAAW,sBAAuB,CAAC,IAAI,IAAO3I,EAAoB2B,EAAE,KAAKiF,MAAK,IAAM,IAAQ5G,EAAoB,WAChK,MAAO,IAAO2I,EAAkC,UAAW,6BAA8B,CAAC,IAAI,IAAO9G,QAAQC,IAAI,CAAC9B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,OAAOiF,MAAK,IAAM,IAAQ5G,EAAoB,WACtS,MAAO,IAAO2I,EAAkC,UAAW,gBAAiB,CAAC,IAAI,IAAO9G,QAAQC,IAAI,CAAC9B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,KAAM3B,EAAoB2B,EAAE,MAAMiF,MAAK,IAAM,IAAQ5G,EAAoB,WAC5P,MAAO,IAAO2I,EAAkC,UAAW,aAAc,CAAC,IAAI,IAAO3I,EAAoB2B,EAAE,KAAKiF,MAAK,IAAM,IAAQ5G,EAAoB,WACvJ,MAAO,IAAO2I,EAAkC,UAAW,YAAa,CAAC,IAAI,IAAO3I,EAAoB2B,EAAE,KAAKiF,MAAK,IAAM,IAAQ5G,EAAoB,YAGnJ+I,EAAe,CAClB,IAAO,CACN,MACA,MACA,MACA,MACA,MACA,OAED,IAAO,CACN,OAED,IAAO,CACN,OAED,IAAO,CACN,OAED,IAAO,CACN,MAED,IAAO,CACN,OAED,IAAO,CACN,QAGF/I,EAAoB0B,EAAEsH,SAAW,CAACpH,EAASK,KACvCjC,EAAoBqB,EAAE0H,EAAcnH,IACtCmH,EAAanH,GAASkD,SAASxE,IAC9B,GAAGN,EAAoBqB,EAAEwH,EAAkBvI,GAAK,OAAO2B,EAASoB,KAAKwF,EAAiBvI,IACtF,IAAI2I,EAAa1C,IAChBsC,EAAiBvI,GAAM,EACvBN,EAAoBU,EAAEJ,GAAOD,WACrBL,EAAoBW,EAAEL,GAC7BD,EAAOD,QAAUmG,GAAS,CAC3B,EAEG2C,EAAWC,WACPN,EAAiBvI,GACxBN,EAAoBU,EAAEJ,GAAOD,IAE5B,aADOL,EAAoBW,EAAEL,GACvB6I,CAAK,CACZ,EAED,IACC,IAAIT,EAAUI,EAAuBxI,KAClCoI,EAAQ9B,KACV3E,EAASoB,KAAKwF,EAAiBvI,GAAMoI,EAAQ9B,KAAKqC,GAAkB,MAAEC,IAChED,EAAUP,EAClB,CAAE,MAAM/G,GAAKuH,EAAQvH,EAAI,IAE3B,C,WC3MD,GAAwB,qBAAb8B,SAAX,CACA,IA6CI2F,EAAkBxH,GACd,IAAIC,SAAQ,CAACwH,EAASC,KAC5B,IAAIC,EAAOvJ,EAAoBmC,SAASP,GACpC4H,EAAWxJ,EAAoBkH,EAAIqC,EACvC,GAlBmB,EAACA,EAAMC,KAE3B,IADA,IAAIC,EAAmBhG,SAASC,qBAAqB,QAC7CC,EAAI,EAAGA,EAAI8F,EAAiB7F,OAAQD,IAAK,CAChD,IACI+F,GADAC,EAAMF,EAAiB9F,IACRG,aAAa,cAAgB6F,EAAI7F,aAAa,QACjE,GAAe,eAAZ6F,EAAIC,MAAyBF,IAAaH,GAAQG,IAAaF,GAAW,OAAOG,CACrF,CACA,IAAIE,EAAoBpG,SAASC,qBAAqB,SACtD,IAAQC,EAAI,EAAGA,EAAIkG,EAAkBjG,OAAQD,IAAK,CACjD,IAAIgG,EAEJ,IADID,GADAC,EAAME,EAAkBlG,IACTG,aAAa,gBAChByF,GAAQG,IAAaF,EAAU,OAAOG,CACvD,GAMIG,CAAeP,EAAMC,GAAW,OAAOH,IAjDrB,EAACzH,EAAS4H,EAAUO,EAAQV,EAASC,KAC3D,IAAIU,EAAUvG,SAASM,cAAc,QAErCiG,EAAQJ,IAAM,aACdI,EAAQ9E,KAAO,WAiBf8E,EAAQxF,QAAUwF,EAAQvF,OAhBJF,IAGrB,GADAyF,EAAQxF,QAAUwF,EAAQvF,OAAS,KAChB,SAAfF,EAAMW,KACTmE,QACM,CACN,IAAIY,EAAY1F,IAAyB,SAAfA,EAAMW,KAAkB,UAAYX,EAAMW,MAChEgF,EAAW3F,GAASA,EAAMY,QAAUZ,EAAMY,OAAOoE,MAAQC,EACzDW,EAAM,IAAItJ,MAAM,qBAAuBe,EAAU,cAAgBsI,EAAW,KAChFC,EAAIC,KAAO,wBACXD,EAAIjF,KAAO+E,EACXE,EAAIE,QAAUH,EACVF,EAAQpF,YAAYoF,EAAQpF,WAAWC,YAAYmF,GACvDV,EAAOa,EACR,GAGDH,EAAQT,KAAOC,EAEXO,EACHA,EAAOnF,WAAW0F,aAAaN,EAASD,EAAOQ,aAE/C9G,SAAS2B,KAAKC,YAAY2E,EAEb,EAqBbQ,CAAiB5I,EAAS4H,EAAU,KAAMH,EAASC,EAAO,IAIxDmB,EAAqB,CACxB,IAAK,GAGNzK,EAAoB0B,EAAEgJ,QAAU,CAAC9I,EAASK,KAEtCwI,EAAmB7I,GAAUK,EAASoB,KAAKoH,EAAmB7I,IACzB,IAAhC6I,EAAmB7I,IAFX,CAAC,IAAM,GAEgCA,IACtDK,EAASoB,KAAKoH,EAAmB7I,GAAWwH,EAAexH,GAASgF,MAAK,KACxE6D,EAAmB7I,GAAW,CAAC,IAC5BD,IAEH,aADO8I,EAAmB7I,GACpBD,CAAC,IAET,CArE0C,C,WCK3C,IAAIgJ,EAAkB,CACrB,IAAK,GAGN3K,EAAoB0B,EAAEkJ,EAAI,CAAChJ,EAASK,KAElC,IAAI4I,EAAqB7K,EAAoBqB,EAAEsJ,EAAiB/I,GAAW+I,EAAgB/I,QAAWzB,EACtG,GAA0B,IAAvB0K,EAGF,GAAGA,EACF5I,EAASoB,KAAKwH,EAAmB,SAEjC,GAAI,8BAA8BC,KAAKlJ,GAyBhC+I,EAAgB/I,GAAW,MAzBe,CAEhD,IAAI8G,EAAU,IAAI7G,SAAQ,CAACwH,EAASC,IAAYuB,EAAqBF,EAAgB/I,GAAW,CAACyH,EAASC,KAC1GrH,EAASoB,KAAKwH,EAAmB,GAAKnC,GAGtC,IAAIvF,EAAMnD,EAAoBkH,EAAIlH,EAAoBkC,EAAEN,GAEpDuH,EAAQ,IAAItI,MAgBhBb,EAAoBkD,EAAEC,GAfFoB,IACnB,GAAGvE,EAAoBqB,EAAEsJ,EAAiB/I,KAEf,KAD1BiJ,EAAqBF,EAAgB/I,MACR+I,EAAgB/I,QAAWzB,GACrD0K,GAAoB,CACtB,IAAIZ,EAAY1F,IAAyB,SAAfA,EAAMW,KAAkB,UAAYX,EAAMW,MAChE6F,EAAUxG,GAASA,EAAMY,QAAUZ,EAAMY,OAAOf,IACpD+E,EAAM6B,QAAU,iBAAmBpJ,EAAU,cAAgBqI,EAAY,KAAOc,EAAU,IAC1F5B,EAAMnD,KAAO,iBACbmD,EAAMjE,KAAO+E,EACbd,EAAMkB,QAAUU,EAChBF,EAAmB,GAAG1B,EACvB,CACD,GAEwC,SAAWvH,EAASA,EAC9D,CAEF,EAcF,IAAIqJ,EAAuB,CAACC,EAA4BC,KACvD,IAKIlL,EAAU2B,EALVwJ,EAAWD,EAAK,GAChBE,EAAcF,EAAK,GACnBG,EAAUH,EAAK,GAGIxH,EAAI,EAC3B,GAAGyH,EAASG,MAAMjL,GAAgC,IAAxBqK,EAAgBrK,KAAa,CACtD,IAAIL,KAAYoL,EACZrL,EAAoBqB,EAAEgK,EAAapL,KACrCD,EAAoBU,EAAET,GAAYoL,EAAYpL,IAGhD,GAAGqL,EAAsBA,EAAQtL,EAClC,CAEA,IADGkL,GAA4BA,EAA2BC,GACrDxH,EAAIyH,EAASxH,OAAQD,IACzB/B,EAAUwJ,EAASzH,GAChB3D,EAAoBqB,EAAEsJ,EAAiB/I,IAAY+I,EAAgB/I,IACrE+I,EAAgB/I,GAAS,KAE1B+I,EAAgB/I,GAAW,CAC5B,EAIG4J,EAAqBC,KAAqB,eAAIA,KAAqB,gBAAK,GAC5ED,EAAmB1G,QAAQmG,EAAqBhG,KAAK,KAAM,IAC3DuG,EAAmBnI,KAAO4H,EAAqBhG,KAAK,KAAMuG,EAAmBnI,KAAK4B,KAAKuG,G,KCvFvFxL,EAAoBkE,QAAK/D,ECGCH,EAAoB,M","sources":["index.jsx","../webpack/bootstrap","../webpack/runtime/amd define","../webpack/runtime/compat get default export","../webpack/runtime/define property getters","../webpack/runtime/ensure chunk","../webpack/runtime/get javascript chunk filename","../webpack/runtime/get mini-css chunk filename","../webpack/runtime/global","../webpack/runtime/harmony module decorator","../webpack/runtime/hasOwnProperty shorthand","../webpack/runtime/load script","../webpack/runtime/make namespace object","../webpack/runtime/node module decorator","../webpack/runtime/sharing","../webpack/runtime/publicPath","../webpack/runtime/consumes","../webpack/runtime/css loading","../webpack/runtime/jsonp chunk loading","../webpack/runtime/nonce","../webpack/startup"],"sourcesContent":["import('./bootstrap');\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// expose the module cache\n__webpack_require__.c = __webpack_module_cache__;\n\n","__webpack_require__.amdD = function () {\n\tthrow new Error('define cannot be used indirect');\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"static/js/\" + chunkId + \".\" + {\"7\":\"1d9b7afb\",\"17\":\"c425807c\",\"86\":\"1b4fca53\",\"96\":\"fe9915d5\",\"147\":\"ab44d2ab\",\"164\":\"2c2b1075\",\"195\":\"dedf4947\",\"223\":\"f0c60522\",\"239\":\"49f1d114\",\"281\":\"fe2096fc\",\"365\":\"ca66a412\",\"377\":\"9347d79a\",\"399\":\"f713c6bc\",\"412\":\"c124454b\",\"431\":\"a62490cf\",\"440\":\"6b00f12e\",\"447\":\"71f7415d\",\"448\":\"ff20ef54\",\"564\":\"3948b951\",\"623\":\"8b0d671e\",\"666\":\"f676e7ac\",\"675\":\"d0c8b930\",\"702\":\"1692c400\",\"732\":\"35b8de10\",\"772\":\"a28fc25b\",\"774\":\"cf3edadb\",\"791\":\"258dd609\",\"805\":\"7c367e53\",\"819\":\"e612993b\",\"838\":\"bda08ddf\",\"854\":\"2686e8b9\",\"864\":\"2e977ad1\",\"880\":\"62623dec\",\"944\":\"8c3dee7b\",\"956\":\"cf9b2bc3\",\"977\":\"631c311a\",\"983\":\"cc3c1042\"}[chunkId] + \".chunk.js\";\n};","// This function allow to reference async chunks\n__webpack_require__.miniCssF = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"static/css/\" + chunkId + \".\" + \"42bfc5f3\" + \".chunk.css\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.hmd = (module) => {\n\tmodule = Object.create(module);\n\tif (!module.children) module.children = [];\n\tObject.defineProperty(module, 'exports', {\n\t\tenumerable: true,\n\t\tset: () => {\n\t\t\tthrow new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);\n\t\t}\n\t});\n\treturn module;\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var inProgress = {};\nvar dataWebpackPrefix = \"js:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.S = {};\nvar initPromises = {};\nvar initTokens = {};\n__webpack_require__.I = (name, initScope) => {\n\tif(!initScope) initScope = [];\n\t// handling circular init calls\n\tvar initToken = initTokens[name];\n\tif(!initToken) initToken = initTokens[name] = {};\n\tif(initScope.indexOf(initToken) >= 0) return;\n\tinitScope.push(initToken);\n\t// only runs once\n\tif(initPromises[name]) return initPromises[name];\n\t// creates a new share scope if needed\n\tif(!__webpack_require__.o(__webpack_require__.S, name)) __webpack_require__.S[name] = {};\n\t// runs all init snippets from all modules reachable\n\tvar scope = __webpack_require__.S[name];\n\tvar warn = (msg) => {\n\t\tif (typeof console !== \"undefined\" && console.warn) console.warn(msg);\n\t};\n\tvar uniqueName = \"js\";\n\tvar register = (name, version, factory, eager) => {\n\t\tvar versions = scope[name] = scope[name] || {};\n\t\tvar activeVersion = versions[version];\n\t\tif(!activeVersion || (!activeVersion.loaded && (!eager != !activeVersion.eager ? eager : uniqueName > activeVersion.from))) versions[version] = { get: factory, from: uniqueName, eager: !!eager };\n\t};\n\tvar initExternal = (id) => {\n\t\tvar handleError = (err) => (warn(\"Initialization of sharing external failed: \" + err));\n\t\ttry {\n\t\t\tvar module = __webpack_require__(id);\n\t\t\tif(!module) return;\n\t\t\tvar initFn = (module) => (module && module.init && module.init(__webpack_require__.S[name], initScope))\n\t\t\tif(module.then) return promises.push(module.then(initFn, handleError));\n\t\t\tvar initResult = initFn(module);\n\t\t\tif(initResult && initResult.then) return promises.push(initResult['catch'](handleError));\n\t\t} catch(err) { handleError(err); }\n\t}\n\tvar promises = [];\n\tswitch(name) {\n\t\tcase \"default\": {\n\t\t\tregister(\"@iobroker/adapter-react-v5\", \"4.10.1\", () => (Promise.all([__webpack_require__.e(448), __webpack_require__.e(977), __webpack_require__.e(239), __webpack_require__.e(223), __webpack_require__.e(623), __webpack_require__.e(944), __webpack_require__.e(956), __webpack_require__.e(838), __webpack_require__.e(17), __webpack_require__.e(819), __webpack_require__.e(854), __webpack_require__.e(564), __webpack_require__.e(440), __webpack_require__.e(412), __webpack_require__.e(732), __webpack_require__.e(805)]).then(() => (() => (__webpack_require__(26079))))));\n\t\t\tregister(\"@mui/icons-material\", \"5.15.12\", () => (Promise.all([__webpack_require__.e(448), __webpack_require__.e(223), __webpack_require__.e(675), __webpack_require__.e(819), __webpack_require__.e(854)]).then(() => (() => (__webpack_require__(28675))))));\n\t\t\tregister(\"@mui/material\", \"5.14.14\", () => (Promise.all([__webpack_require__.e(448), __webpack_require__.e(977), __webpack_require__.e(239), __webpack_require__.e(195), __webpack_require__.e(956), __webpack_require__.e(772), __webpack_require__.e(819), __webpack_require__.e(854), __webpack_require__.e(564), __webpack_require__.e(440)]).then(() => (() => (__webpack_require__(73772))))));\n\t\t\tregister(\"@mui/material\", \"5.15.12\", () => (Promise.all([__webpack_require__.e(448), __webpack_require__.e(239), __webpack_require__.e(223), __webpack_require__.e(623), __webpack_require__.e(195), __webpack_require__.e(944), __webpack_require__.e(774), __webpack_require__.e(86), __webpack_require__.e(819), __webpack_require__.e(854), __webpack_require__.e(440)]).then(() => (() => (__webpack_require__(53086))))));\n\t\t\tregister(\"@mui/styles\", \"5.14.14\", () => (Promise.all([__webpack_require__.e(983), __webpack_require__.e(447), __webpack_require__.e(819), __webpack_require__.e(854), __webpack_require__.e(564), __webpack_require__.e(431)]).then(() => (() => (__webpack_require__(70239))))));\n\t\t\tregister(\"@mui/styles\", \"5.15.12\", () => (Promise.all([__webpack_require__.e(983), __webpack_require__.e(377), __webpack_require__.e(819), __webpack_require__.e(854), __webpack_require__.e(702)]).then(() => (() => (__webpack_require__(55365))))));\n\t\t\tregister(\"prop-types\", \"15.7.2\", () => (__webpack_require__.e(281).then(() => (() => (__webpack_require__(93281))))));\n\t\t\tregister(\"prop-types\", \"15.8.1\", () => (__webpack_require__.e(7).then(() => (() => (__webpack_require__(52007))))));\n\t\t\tregister(\"react-ace\", \"10.1.0\", () => (Promise.all([__webpack_require__.e(399), __webpack_require__.e(819), __webpack_require__.e(854)]).then(() => (() => (__webpack_require__(38399))))));\n\t\t\tregister(\"react-dom\", \"18.2.0\", () => (Promise.all([__webpack_require__.e(164), __webpack_require__.e(819)]).then(() => (() => (__webpack_require__(54164))))));\n\t\t\tregister(\"react\", \"17.0.2\", () => (__webpack_require__.e(666).then(() => (() => (__webpack_require__(147))))));\n\t\t\tregister(\"react\", \"18.2.0\", () => (__webpack_require__.e(791).then(() => (() => (__webpack_require__(72791))))));\n\t\t}\n\t\tbreak;\n\t}\n\tif(!promises.length) return initPromises[name] = 1;\n\treturn initPromises[name] = Promise.all(promises).then(() => (initPromises[name] = 1));\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl + \"../../\";","var parseVersion = (str) => {\n\t// see webpack/lib/util/semver.js for original code\n\tvar p=p=>{return p.split(\".\").map((p=>{return+p==p?+p:p}))},n=/^([^-+]+)?(?:-([^+]+))?(?:\\+(.+))?$/.exec(str),r=n[1]?p(n[1]):[];return n[2]&&(r.length++,r.push.apply(r,p(n[2]))),n[3]&&(r.push([]),r.push.apply(r,p(n[3]))),r;\n}\nvar versionLt = (a, b) => {\n\t// see webpack/lib/util/semver.js for original code\n\ta=parseVersion(a),b=parseVersion(b);for(var r=0;;){if(r>=a.length)return r=b.length)return\"u\"==n;var t=b[r],f=(typeof t)[0];if(n!=f)return\"o\"==n&&\"n\"==f||(\"s\"==f||\"u\"==n);if(\"o\"!=n&&\"u\"!=n&&e!=t)return e {\n\t// see webpack/lib/util/semver.js for original code\n\tvar r=range[0],n=\"\";if(1===range.length)return\"*\";if(r+.5){n+=0==r?\">=\":-1==r?\"<\":1==r?\"^\":2==r?\"~\":r>0?\"=\":\"!=\";for(var e=1,a=1;a0?\".\":\"\")+(e=2,t)}return n}var g=[];for(a=1;a {\n\t// see webpack/lib/util/semver.js for original code\n\tif(0 in range){version=parseVersion(version);var e=range[0],r=e<0;r&&(e=-e-1);for(var n=0,i=1,a=!0;;i++,n++){var f,s,g=i=version.length||\"o\"==(s=(typeof(f=version[n]))[0]))return!a||(\"u\"==g?i>e&&!r:\"\"==g!=r);if(\"u\"==s){if(!a||\"u\"!=g)return!1}else if(a)if(g==s)if(i<=e){if(f!=range[i])return!1}else{if(r?f>range[i]:f {\n\tvar scope = __webpack_require__.S[scopeName];\n\tif(!scope || !__webpack_require__.o(scope, key)) throw new Error(\"Shared module \" + key + \" doesn't exist in shared scope \" + scopeName);\n\treturn scope;\n};\nvar findVersion = (scope, key) => {\n\tvar versions = scope[key];\n\tvar key = Object.keys(versions).reduce((a, b) => {\n\t\treturn !a || versionLt(a, b) ? b : a;\n\t}, 0);\n\treturn key && versions[key]\n};\nvar findSingletonVersionKey = (scope, key) => {\n\tvar versions = scope[key];\n\treturn Object.keys(versions).reduce((a, b) => {\n\t\treturn !a || (!versions[a].loaded && versionLt(a, b)) ? b : a;\n\t}, 0);\n};\nvar getInvalidSingletonVersionMessage = (scope, key, version, requiredVersion) => {\n\treturn \"Unsatisfied version \" + version + \" from \" + (version && scope[key][version].from) + \" of shared singleton module \" + key + \" (required \" + rangeToString(requiredVersion) + \")\"\n};\nvar getSingleton = (scope, scopeName, key, requiredVersion) => {\n\tvar version = findSingletonVersionKey(scope, key);\n\treturn get(scope[key][version]);\n};\nvar getSingletonVersion = (scope, scopeName, key, requiredVersion) => {\n\tvar version = findSingletonVersionKey(scope, key);\n\tif (!satisfy(requiredVersion, version)) warn(getInvalidSingletonVersionMessage(scope, key, version, requiredVersion));\n\treturn get(scope[key][version]);\n};\nvar getStrictSingletonVersion = (scope, scopeName, key, requiredVersion) => {\n\tvar version = findSingletonVersionKey(scope, key);\n\tif (!satisfy(requiredVersion, version)) throw new Error(getInvalidSingletonVersionMessage(scope, key, version, requiredVersion));\n\treturn get(scope[key][version]);\n};\nvar findValidVersion = (scope, key, requiredVersion) => {\n\tvar versions = scope[key];\n\tvar key = Object.keys(versions).reduce((a, b) => {\n\t\tif (!satisfy(requiredVersion, b)) return a;\n\t\treturn !a || versionLt(a, b) ? b : a;\n\t}, 0);\n\treturn key && versions[key]\n};\nvar getInvalidVersionMessage = (scope, scopeName, key, requiredVersion) => {\n\tvar versions = scope[key];\n\treturn \"No satisfying version (\" + rangeToString(requiredVersion) + \") of shared module \" + key + \" found in shared scope \" + scopeName + \".\\n\" +\n\t\t\"Available versions: \" + Object.keys(versions).map((key) => {\n\t\treturn key + \" from \" + versions[key].from;\n\t}).join(\", \");\n};\nvar getValidVersion = (scope, scopeName, key, requiredVersion) => {\n\tvar entry = findValidVersion(scope, key, requiredVersion);\n\tif(entry) return get(entry);\n\tthrow new Error(getInvalidVersionMessage(scope, scopeName, key, requiredVersion));\n};\nvar warn = (msg) => {\n\tif (typeof console !== \"undefined\" && console.warn) console.warn(msg);\n};\nvar warnInvalidVersion = (scope, scopeName, key, requiredVersion) => {\n\twarn(getInvalidVersionMessage(scope, scopeName, key, requiredVersion));\n};\nvar get = (entry) => {\n\tentry.loaded = 1;\n\treturn entry.get()\n};\nvar init = (fn) => (function(scopeName, a, b, c) {\n\tvar promise = __webpack_require__.I(scopeName);\n\tif (promise && promise.then) return promise.then(fn.bind(fn, scopeName, __webpack_require__.S[scopeName], a, b, c));\n\treturn fn(scopeName, __webpack_require__.S[scopeName], a, b, c);\n});\n\nvar load = /*#__PURE__*/ init((scopeName, scope, key) => {\n\tensureExistence(scopeName, key);\n\treturn get(findVersion(scope, key));\n});\nvar loadFallback = /*#__PURE__*/ init((scopeName, scope, key, fallback) => {\n\treturn scope && __webpack_require__.o(scope, key) ? get(findVersion(scope, key)) : fallback();\n});\nvar loadVersionCheck = /*#__PURE__*/ init((scopeName, scope, key, version) => {\n\tensureExistence(scopeName, key);\n\treturn get(findValidVersion(scope, key, version) || warnInvalidVersion(scope, scopeName, key, version) || findVersion(scope, key));\n});\nvar loadSingleton = /*#__PURE__*/ init((scopeName, scope, key) => {\n\tensureExistence(scopeName, key);\n\treturn getSingleton(scope, scopeName, key);\n});\nvar loadSingletonVersionCheck = /*#__PURE__*/ init((scopeName, scope, key, version) => {\n\tensureExistence(scopeName, key);\n\treturn getSingletonVersion(scope, scopeName, key, version);\n});\nvar loadStrictVersionCheck = /*#__PURE__*/ init((scopeName, scope, key, version) => {\n\tensureExistence(scopeName, key);\n\treturn getValidVersion(scope, scopeName, key, version);\n});\nvar loadStrictSingletonVersionCheck = /*#__PURE__*/ init((scopeName, scope, key, version) => {\n\tensureExistence(scopeName, key);\n\treturn getStrictSingletonVersion(scope, scopeName, key, version);\n});\nvar loadVersionCheckFallback = /*#__PURE__*/ init((scopeName, scope, key, version, fallback) => {\n\tif(!scope || !__webpack_require__.o(scope, key)) return fallback();\n\treturn get(findValidVersion(scope, key, version) || warnInvalidVersion(scope, scopeName, key, version) || findVersion(scope, key));\n});\nvar loadSingletonFallback = /*#__PURE__*/ init((scopeName, scope, key, fallback) => {\n\tif(!scope || !__webpack_require__.o(scope, key)) return fallback();\n\treturn getSingleton(scope, scopeName, key);\n});\nvar loadSingletonVersionCheckFallback = /*#__PURE__*/ init((scopeName, scope, key, version, fallback) => {\n\tif(!scope || !__webpack_require__.o(scope, key)) return fallback();\n\treturn getSingletonVersion(scope, scopeName, key, version);\n});\nvar loadStrictVersionCheckFallback = /*#__PURE__*/ init((scopeName, scope, key, version, fallback) => {\n\tvar entry = scope && __webpack_require__.o(scope, key) && findValidVersion(scope, key, version);\n\treturn entry ? get(entry) : fallback();\n});\nvar loadStrictSingletonVersionCheckFallback = /*#__PURE__*/ init((scopeName, scope, key, version, fallback) => {\n\tif(!scope || !__webpack_require__.o(scope, key)) return fallback();\n\treturn getStrictSingletonVersion(scope, scopeName, key, version);\n});\nvar installedModules = {};\nvar moduleToHandlerMapping = {\n\t4819: () => (loadSingletonVersionCheckFallback(\"default\", \"react\", [0], () => (__webpack_require__.e(791).then(() => (() => (__webpack_require__(72791))))))),\n\t15854: () => (loadSingletonVersionCheckFallback(\"default\", \"prop-types\", [0], () => (__webpack_require__.e(7).then(() => (() => (__webpack_require__(52007))))))),\n\t88564: () => (loadSingletonVersionCheckFallback(\"default\", \"react\", [0], () => (__webpack_require__.e(147).then(() => (() => (__webpack_require__(147))))))),\n\t77440: () => (loadSingletonVersionCheckFallback(\"default\", \"react-dom\", [0], () => (__webpack_require__.e(164).then(() => (() => (__webpack_require__(54164))))))),\n\t18967: () => (loadSingletonVersionCheckFallback(\"default\", \"@mui/material\", [0], () => (Promise.all([__webpack_require__.e(977), __webpack_require__.e(195), __webpack_require__.e(772)]).then(() => (() => (__webpack_require__(73772))))))),\n\t35025: () => (loadSingletonVersionCheckFallback(\"default\", \"@mui/styles\", [0], () => (Promise.all([__webpack_require__.e(983), __webpack_require__.e(447)]).then(() => (() => (__webpack_require__(70239))))))),\n\t58503: () => (loadSingletonVersionCheckFallback(\"default\", \"@mui/styles\", [0], () => (Promise.all([__webpack_require__.e(983), __webpack_require__.e(377), __webpack_require__.e(365)]).then(() => (() => (__webpack_require__(55365))))))),\n\t59665: () => (loadSingletonVersionCheckFallback(\"default\", \"@mui/icons-material\", [0], () => (__webpack_require__.e(675).then(() => (() => (__webpack_require__(28675))))))),\n\t75606: () => (loadSingletonVersionCheckFallback(\"default\", \"@iobroker/adapter-react-v5\", [0], () => (Promise.all([__webpack_require__.e(977), __webpack_require__.e(623), __webpack_require__.e(838), __webpack_require__.e(732), __webpack_require__.e(880)]).then(() => (() => (__webpack_require__(26079))))))),\n\t94427: () => (loadSingletonVersionCheckFallback(\"default\", \"@mui/material\", [0], () => (Promise.all([__webpack_require__.e(623), __webpack_require__.e(195), __webpack_require__.e(774), __webpack_require__.e(86)]).then(() => (() => (__webpack_require__(53086))))))),\n\t91305: () => (loadSingletonVersionCheckFallback(\"default\", \"prop-types\", [0], () => (__webpack_require__.e(281).then(() => (() => (__webpack_require__(93281))))))),\n\t83732: () => (loadSingletonVersionCheckFallback(\"default\", \"react-ace\", [0], () => (__webpack_require__.e(399).then(() => (() => (__webpack_require__(38399)))))))\n};\n// no consumes in initial chunks\nvar chunkMapping = {\n\t\"412\": [\n\t\t18967,\n\t\t35025,\n\t\t58503,\n\t\t59665,\n\t\t75606,\n\t\t94427\n\t],\n\t\"440\": [\n\t\t77440\n\t],\n\t\"564\": [\n\t\t88564\n\t],\n\t\"732\": [\n\t\t83732\n\t],\n\t\"819\": [\n\t\t4819\n\t],\n\t\"854\": [\n\t\t15854\n\t],\n\t\"864\": [\n\t\t91305\n\t]\n};\n__webpack_require__.f.consumes = (chunkId, promises) => {\n\tif(__webpack_require__.o(chunkMapping, chunkId)) {\n\t\tchunkMapping[chunkId].forEach((id) => {\n\t\t\tif(__webpack_require__.o(installedModules, id)) return promises.push(installedModules[id]);\n\t\t\tvar onFactory = (factory) => {\n\t\t\t\tinstalledModules[id] = 0;\n\t\t\t\t__webpack_require__.m[id] = (module) => {\n\t\t\t\t\tdelete __webpack_require__.c[id];\n\t\t\t\t\tmodule.exports = factory();\n\t\t\t\t}\n\t\t\t};\n\t\t\tvar onError = (error) => {\n\t\t\t\tdelete installedModules[id];\n\t\t\t\t__webpack_require__.m[id] = (module) => {\n\t\t\t\t\tdelete __webpack_require__.c[id];\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t};\n\t\t\ttry {\n\t\t\t\tvar promise = moduleToHandlerMapping[id]();\n\t\t\t\tif(promise.then) {\n\t\t\t\t\tpromises.push(installedModules[id] = promise.then(onFactory)['catch'](onError));\n\t\t\t\t} else onFactory(promise);\n\t\t\t} catch(e) { onError(e); }\n\t\t});\n\t}\n}","if (typeof document === \"undefined\") return;\nvar createStylesheet = (chunkId, fullhref, oldTag, resolve, reject) => {\n\tvar linkTag = document.createElement(\"link\");\n\n\tlinkTag.rel = \"stylesheet\";\n\tlinkTag.type = \"text/css\";\n\tvar onLinkComplete = (event) => {\n\t\t// avoid mem leaks.\n\t\tlinkTag.onerror = linkTag.onload = null;\n\t\tif (event.type === 'load') {\n\t\t\tresolve();\n\t\t} else {\n\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\tvar realHref = event && event.target && event.target.href || fullhref;\n\t\t\tvar err = new Error(\"Loading CSS chunk \" + chunkId + \" failed.\\n(\" + realHref + \")\");\n\t\t\terr.code = \"CSS_CHUNK_LOAD_FAILED\";\n\t\t\terr.type = errorType;\n\t\t\terr.request = realHref;\n\t\t\tif (linkTag.parentNode) linkTag.parentNode.removeChild(linkTag)\n\t\t\treject(err);\n\t\t}\n\t}\n\tlinkTag.onerror = linkTag.onload = onLinkComplete;\n\tlinkTag.href = fullhref;\n\n\tif (oldTag) {\n\t\toldTag.parentNode.insertBefore(linkTag, oldTag.nextSibling);\n\t} else {\n\t\tdocument.head.appendChild(linkTag);\n\t}\n\treturn linkTag;\n};\nvar findStylesheet = (href, fullhref) => {\n\tvar existingLinkTags = document.getElementsByTagName(\"link\");\n\tfor(var i = 0; i < existingLinkTags.length; i++) {\n\t\tvar tag = existingLinkTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\") || tag.getAttribute(\"href\");\n\t\tif(tag.rel === \"stylesheet\" && (dataHref === href || dataHref === fullhref)) return tag;\n\t}\n\tvar existingStyleTags = document.getElementsByTagName(\"style\");\n\tfor(var i = 0; i < existingStyleTags.length; i++) {\n\t\tvar tag = existingStyleTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\");\n\t\tif(dataHref === href || dataHref === fullhref) return tag;\n\t}\n};\nvar loadStylesheet = (chunkId) => {\n\treturn new Promise((resolve, reject) => {\n\t\tvar href = __webpack_require__.miniCssF(chunkId);\n\t\tvar fullhref = __webpack_require__.p + href;\n\t\tif(findStylesheet(href, fullhref)) return resolve();\n\t\tcreateStylesheet(chunkId, fullhref, null, resolve, reject);\n\t});\n}\n// object to store loaded CSS chunks\nvar installedCssChunks = {\n\t179: 0\n};\n\n__webpack_require__.f.miniCss = (chunkId, promises) => {\n\tvar cssChunks = {\"864\":1};\n\tif(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);\n\telse if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {\n\t\tpromises.push(installedCssChunks[chunkId] = loadStylesheet(chunkId).then(() => {\n\t\t\tinstalledCssChunks[chunkId] = 0;\n\t\t}, (e) => {\n\t\t\tdelete installedCssChunks[chunkId];\n\t\t\tthrow e;\n\t\t}));\n\t}\n};\n\n// no hmr","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t179: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(!/^(412|440|564|732|819|854)$/.test(chunkId)) {\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkjs\"] = self[\"webpackChunkjs\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","// module cache are used so entry inlining is disabled\n// startup\n// Load entry module and return exports\nvar __webpack_exports__ = __webpack_require__(77569);\n"],"names":["__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","id","loaded","__webpack_modules__","call","m","c","amdD","Error","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","f","e","chunkId","Promise","all","keys","reduce","promises","u","miniCssF","g","globalThis","this","Function","window","hmd","create","children","set","obj","prop","prototype","hasOwnProperty","inProgress","l","url","done","push","script","needAttach","scripts","document","getElementsByTagName","i","length","s","getAttribute","createElement","charset","timeout","nc","setAttribute","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","doneFns","parentNode","removeChild","forEach","fn","setTimeout","bind","type","target","head","appendChild","r","Symbol","toStringTag","value","nmd","paths","S","initPromises","initTokens","I","name","initScope","initToken","indexOf","scope","register","version","factory","eager","versions","activeVersion","from","then","scriptUrl","importScripts","location","currentScript","replace","p","parseVersion","str","split","map","exec","apply","versionLt","b","t","rangeToString","range","pop","satisfy","findSingletonVersionKey","getInvalidSingletonVersionMessage","requiredVersion","getSingletonVersion","scopeName","warn","msg","console","entry","init","promise","loadSingletonVersionCheckFallback","fallback","installedModules","moduleToHandlerMapping","chunkMapping","consumes","onFactory","onError","error","loadStylesheet","resolve","reject","href","fullhref","existingLinkTags","dataHref","tag","rel","existingStyleTags","findStylesheet","oldTag","linkTag","errorType","realHref","err","code","request","insertBefore","nextSibling","createStylesheet","installedCssChunks","miniCss","installedChunks","j","installedChunkData","test","realSrc","message","webpackJsonpCallback","parentChunkLoadingFunction","data","chunkIds","moreModules","runtime","some","chunkLoadingGlobal","self"],"sourceRoot":""}
\ No newline at end of file
diff --git a/admin/tab.html b/admin/tab.html
index d2aa8215c..2c011ff2e 100644
--- a/admin/tab.html
+++ b/admin/tab.html
@@ -1 +1 @@
-Scripts%%CUSTOM_BLOCKS%%0LE42LE10010110111945013.13.1234264105011001100abc{textVariable}abc{textVariable}{textVariable}abcabcxytexttext5{listVariable}{listVariable}{listVariable}{listVariable},100500#ff0000#3333ff0.5
\ No newline at end of file
+Scripts%%CUSTOM_BLOCKS%%0LE42LE10010110111945013.13.1234264105011001100abc{textVariable}abc{textVariable}{textVariable}abcabcxytexttext5{listVariable}{listVariable}{listVariable}{listVariable},100500#ff0000#3333ff0.5
\ No newline at end of file
diff --git a/io-package.json b/io-package.json
index cbc2945f9..4681d3ff8 100644
--- a/io-package.json
+++ b/io-package.json
@@ -21,8 +21,21 @@
"AlCalzone ",
"Matthias Kleine "
],
- "version": "7.10.2",
+ "version": "7.11.0",
"news": {
+ "7.11.0": {
+ "en": "Added blockly block for read and write file\nAllow to select other object types than state in some blocks\nImproved translations\nRemoved 'type' from dropdown (is always 'state')\nUse highlight in search (instead of select)\nAdded option for httpGet to receive arraybuffer (download files)",
+ "de": "Blockaden für Lese- und Schreibdatei hinzugefügt\nLassen Sie andere Objekttypen als Zustand in einigen Blöcken auswählen\nVerbesserte Übersetzungen\n'Typ' von dropdown entfernt (ist immer 'state')\nVerwenden Sie Highlight in der Suche (anstatt auszuwählen)\nOption für httpGet zum Empfang von Arraybuffer (Download-Dateien)",
+ "ru": "Добавлено блокирование для чтения и записи файла\nПозволить выбрать другие типы объектов, чем состояние в некоторых блоках\nСовершенствование переводов\nУдалено «тип» от выпадения (всегда «государство»)\nИспользовать выделения в поиске (вместо выбора)\nДобавлена опция для httpGet для получения решетки (файлы загрузки)",
+ "pt": "Adicionado bloco blockly para ler e escrever arquivo\nPermitir selecionar outros tipos de objetos do que o estado em alguns blocos\nTraduções melhoradas\nRemovido 'tipo' de dropdown (é sempre 'estado')\nUse destaque na pesquisa (em vez de selecionar)\nAdicionado opção para httpGet para receber arraybuffer (arquivos de download)",
+ "nl": "Blokblok toegevoegd voor lezen en schrijven\nAndere objecttypes dan status in sommige blokken laten selecteren\nVerbeterde vertalingen\nVerwijderd 'type' uit dropdown (is altijd 'state')\nMarkering gebruiken bij zoeken (in plaats van selecteren)\nToegevoegde optie voor httpGet to receive arraybuffer (download bestanden)",
+ "fr": "Ajouté bloc bloc pour lire et écrire le fichier\nPermet de sélectionner d'autres types d'objets que l'état dans certains blocs\nAmélioration des traductions\nSupprimé 'type' du menu déroulant (est toujours 'état')\nUtiliser le point fort dans la recherche (au lieu de sélectionner)\nAjout de l'option pour httpGet to receive arraybuffer (télécharger les fichiers)",
+ "it": "Aggiunto blocco blocco per leggere e scrivere file\nConsentire di selezionare altri tipi di oggetti rispetto allo stato in alcuni blocchi\nTraduzioni migliorate\nRimuoveto \"tipo\" dal menu a tendina (è sempre 'stato')\nUtilizzare l'evidenziatore nella ricerca (invece di selezionare)\nAggiunta opzione per httpGet per ricevere arraybuffer (download file)",
+ "es": "Añadido bloque bloque bloque para leer y escribir archivo\nPermitir seleccionar otros tipos de objetos que el estado en algunos bloques\nMejora de las traducciones\nEliminado 'tipo' de la caída (siempre es 'estado')\nUse resaltar en la búsqueda (en lugar de seleccionar)\nOpción adicional para httpGet para recibir arraybuffer (archivos de descarga)",
+ "pl": "Dodano blokowy blok do odczytu i zapisu pliku\nPozwala wybrać inne typy obiektów niż stan w niektórych blokach\nUlepszone tłumaczenia\nUsunięty 'type' z upustu (zawsze jest 'state')\nUżyj podświetlenia w wyszukiwaniu (zamiast wybierz)\nDodano opcję httpGet do otrzymywania arraybufor (pliki do pobrania)",
+ "uk": "Додано блокнот для читання та запису файлу\nДозволяє вибрати інші типи об'єктів, ніж держава в деяких блоках\nПокращені переклади\nВилучено \"тип\" з випадаючою (це завжди 'держава')\nВикористовуйте родзинку в пошуку (замість вибору)\nДодано варіант для HTTPГет для отримання масивубуфер (завантажити файли)",
+ "zh-cn": "为读写文件添加块块\n允许在某些块中选择非状态的其他对象类型\n改进翻译\n从下拉中删除“ 类型 ” (总是“ 状态 ” )\n在搜索中使用突出显示( 而不是选择)\n添加了 httpGet 接收阵列缓冲器的选项( 下载文件)"
+ },
"7.10.2": {
"en": "Fixed httpGet/httpPost issue when using without options\nUpdated integration testing\nProtect jsonl file access",
"de": "Problem behoben httpGet/httpPost bei Verwendung ohne Optionen\nAktualisierung der Integrationstests\nSchützen Sie jsonl Dateizugriff",
@@ -100,19 +113,6 @@
"pl": "Dodano nowy blok odpowiedzi http",
"uk": "Додано новий блок для відповіді",
"zh-cn": "添加了 http 响应的新块"
- },
- "7.9.1": {
- "en": "Configurable trigger warning limit (default: 100 per script)\nAllow to use objects in create state blocks for common\nAdded warning if latitude or longitude is not configured correctly",
- "de": "Konfigurierbare Triggerwarngrenze (Standard: 100 pro Skript)\nErlauben Sie, Objekte in erstellen Zustand Blöcke für gemeinsame\nWarnung hinzugefügt, wenn Breite oder Länge nicht korrekt konfiguriert ist",
- "ru": "Настраиваемый предел триггерного предупреждения (по умолчанию: 100 за сценарий)\nПозволить использовать объекты в создании государственных блоков для общего\nДобавить предупреждение, если широта или долгота не настроены правильно",
- "pt": "Limite de aviso de gatilho configurável (padrão: 100 por script)\nPermitir usar objetos em criar blocos de estado para comum\nAdicionado aviso se a latitude ou longitude não estiver configurada corretamente",
- "nl": "Configureerbare waarschuwingslimiet voor triggers (standaard: 100 per script)\nObjecten in aanmaken van statusblokken toestaan voor gewone\nToegevoegde waarschuwing als breedte- of lengtegraad niet correct is ingesteld",
- "fr": "Limite d'avertissement de déclenchement configurable (par défaut : 100 par script)\nPermettre d'utiliser des objets dans créer des blocs d'état pour commun\nAjout d'un avertissement si la latitude ou la longitude n'est pas configurée correctement",
- "it": "Limite di avviso di trigger configurabile (default: 100 per script)\nConsentire di utilizzare oggetti in creare blocchi di stato per i comuni\nAvvertenza aggiunta se latitudine o longitudine non è configurata correttamente",
- "es": "Límite de advertencia de disparador configurable (por defecto: 100 por script)\nPermitir utilizar objetos en crear bloques estatales para uso común\nAdvertencia agregada si la latitud o longitud no está configurada correctamente",
- "pl": "Konfigurowalny limit ostrzegawczy (domyślnie: 100 na skrypt)\nPozwól używać obiektów w tworzeniu bloków stanu dla wspólnych\nDodano ostrzeżenie, jeśli szerokość lub długość geograficzna nie jest poprawnie skonfigurowana",
- "uk": "Конфігураційне обмеження попередження пропуску (default: 100 за скрипт)\nДозволяє використовувати об'єкти у створенні державних блоків для загального користування\nДодано попередження, якщо широта або довгота не налаштована правильно",
- "zh-cn": "可配置触发警告限制( 默认: 每个脚本100)\n允许在常见的创建状态块中使用对象\n如果未正确配置纬度或经度,则添加警告"
}
},
"desc": {
diff --git a/package.json b/package.json
index f996775f6..3371c7279 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "iobroker.javascript",
- "version": "7.10.2",
+ "version": "7.11.0",
"description": "Rules Engine for ioBroker",
"author": "bluefox ",
"contributors": [
diff --git a/src/package.json b/src/package.json
index 5f1f7997c..bd8da5f01 100644
--- a/src/package.json
+++ b/src/package.json
@@ -1,6 +1,6 @@
{
"name": "js",
- "version": "7.10.2",
+ "version": "7.11.0",
"private": true,
"dependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",