text: (this["webpackJsonptext2command-react"]=this["webpackJsonptext2command-react"]||[]).push([[0],{195:function(e){e.exports=JSON.parse('{"a":"2.1.1"}')},286:function(e,t,a){},372:function(e){e.exports=JSON.parse('{"Select rule":"Select rule","System":"System ","Language":"Language","Answer in id":"Answer in ID","Processor\'s id":"Processor\'s ID","Timeout for processor":"Timeout for processor","Settings":"Settings","Cancel":"Cancel","Test phrase":"Test phrase","Argument":"Argument","Confirmation text":"Confirmation text","Keywords":"Keywords","Interrupt processing":"Interrupt processing","You can use %s, that will be replaced with current value of state. %u will be replaced by unit":"You can use %s, that will be replaced with current value of state. %u will be replaced by unit","Ok":"Ok","Create Rule":"Create Rule","Are you sure?":"Are you sure?","You want to delete: %s":"You want to delete: \\"%s\\"","Refresh":"Refresh","Remove rule":"Remove rule","Search rule":"Search rule","lang_en":"english","lang_de":"German","lang_ru":"russian","ms":"ms","Create rule":"Create rule","refresh":"Refresh","Save":"Save","Do not interrupt processing":"Do not interrupt processing","Instance is not running":"Instance is not running","Create a new rule with a \\"+\\" on the left":"Create a new rule with a \\"+\\" on the left","Edit name or type of rule":"Edit name or type of rule","New rule":"New rule","Edit rule":"Edit rule","Rule":"Rule","Name":"Name","Write to response by every command":"Write to response by every command","Clone rule":"Clone the rule","Name already exist":"Name already exist","Create new rule":"Create new rule","Copy rule":"Copy rule","Please confirm or cancel changes before leaving":"Please confirm or cancel changes before leaving","You have changed rule":"You have changed rule","Save and go":"Save and go","Don\'t save and go":"Don\'t save and leave"}')},373:function(e){e.exports=JSON.parse('{"Select rule":"Regel ausw\xe4hlen","System":"System ","Language":"Sprache","Answer in id":"Antwort in ID","Processor\'s id":"Prozessor-ID","Timeout for processor":"Timeout f\xfcr den Prozessor","Settings":"Einstellungen","Cancel":"Abbrechen","Test phrase":"Test-Satz","Argument":"Argument","Confirmation text":"Best\xe4tigungstext","Keywords":"Schl\xfcsselw\xf6rter","Interrupt processing":"Verarbeitung unterbrechen","You can use %s, that will be replaced with current value of state. %u will be replaced by unit":"Sie k\xf6nnen %s verwenden, das durch den aktuellen Statuswert ersetzt wird. %u wird durch Einheit ersetzt","Ok":"Ok","Create Rule":"Regel erstellen","Are you sure?":"Wirklich sicher?","You want to delete: %s":"Sie m\xf6chten l\xf6schen: \\"%s\\"","refresh":"Aktualisieren","lang_en":"Englisch","lang_de":"Deutsch","lang_ru":"Russisch","ms":"ms","Remove rule":"Regel entfernen","Refresh":"Aktualisieren","Search rule":"Filtern","Create rule":"Regel erstellen","Save":"Speichern","Do not interrupt processing":"Weitere Regeln anwenden","Instance is not running":"Instanz l\xe4uft nicht","Create a new rule with a \\"+\\" on the left":"Erstellen Sie eine neue Regel mit einem \\"+\\" auf der linken Seite","Edit name or type of rule":"Namen oder den Regeltyp bearbeiten ","New rule":"Neue Regel","Edit rule":"Regel bearbeiten","Rule":"Regel","Name":"Name","Write to response by every command":"By jedem Befehl auf die Antwort-Zustand schreiben","Clone rule":"Regel klonen","Name already exist":"Name existiert bereits","Create new rule":"Neue Regel erstellen","Copy rule":"Regel kopieren","Please confirm or cancel changes before leaving":"Bitte best\xe4tigen oder stornieren Sie die \xc4nderungen, bevor Sie abreisen","You have changed rule":"Sie haben die Regel ge\xe4ndert","Save and go":"Speichern und loslegen","Don\'t save and go":"Nicht speichern und verlassen"}')},374:function(e){e.exports=JSON.parse('{"Select rule":"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e","System":"\u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438","Language":"\u044f\u0437\u044b\u043a","Answer in id":"\u041e\u0442\u0432\u0435\u0442 \u0432 ID","Processor\'s id":"ID \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430","Timeout for processor":"\u0422\u0430\u0439\u043c-\u0430\u0443\u0442 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430","Settings":"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438","Cancel":"\u041e\u0442\u043c\u0435\u043d\u0430","Test phrase":"\u0422\u0435\u0441\u0442\u043e\u0432\u0430\u044f \u0444\u0440\u0430\u0437\u0430","Argument":"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440","Confirmation text":"\u0422\u0435\u043a\u0441\u0442 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f","Keywords":"\u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430","Interrupt processing":"\u041f\u0440\u0435\u0440\u0432\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443","You can use %s, that will be replaced with current value of state. %u will be replaced by unit":"\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c %s, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0435\u043d \u0442\u0435\u043a\u0443\u0449\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f. %u \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0435\u043d\u043e \u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f","Ok":"Ok","Create Rule":"\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e","Are you sure?":"\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b?","You want to delete: %s":"\u0412\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c: \\"%s\\"","Refresh":"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c","Remove rule":"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e","Create rule":"\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e","Search rule":"\u041d\u0430\u0439\u0442\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u043e","lang_en":"\u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0439","lang_de":"\u041d\u0435\u043c\u0435\u0446\u043a\u0438\u0439","lang_ru":"\u0440\u0443\u0441\u0441\u043a\u0438\u0439","ms":"\u043c\u0441","Save":"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c","Do not interrupt processing":"\u041f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430","Instance is not running":"\u0418\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u044f \u043d\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u0430","Create a new rule with a \\"+\\" on the left":"\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043d\u0430\u0436\u0430\u0432 \u043d\u0430 \xab+\xbb \u0441\u043b\u0435\u0432\u0430","Edit name or type of rule":"\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u043c\u044f \u0438\u043b\u0438 \u0442\u0438\u043f \u043f\u0440\u0430\u0432\u0438\u043b\u0430","New rule":"\u041d\u043e\u0432\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e","Edit rule":"\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e","Rule":"\u043f\u0440\u0430\u0432\u0438\u043b\u043e","Name":"\u0418\u043c\u044f","refresh":"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c","Write to response by every command":"\u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u0438 \u043b\u044e\u0431\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u0435","Clone rule":"\u041a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e","Name already exist":"\u0418\u043c\u044f \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442","Create new rule":"\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e","Copy rule":"\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e","Please confirm or cancel changes before leaving":"\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435 \u0438\u043b\u0438 \u043e\u0442\u043c\u0435\u043d\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f","You have changed rule":"\u0412\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u043e","Save and go":"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438 \u0438\u0434\u0442\u0438","Don\'t save and go":"\u041d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0438 \u0443\u0439\u0442\u0438"}')},375:function(e){e.exports=JSON.parse('{"Select rule":"Selecionar regra","System":"Sistema","Language":"L\xedngua","Answer in id":"Resposta em ID","Processor\'s id":"ID do processador","Timeout for processor":"Tempo limite do processador","Settings":"Configura\xe7\xf5es","Cancel":"Cancelar","Test phrase":"Frase de teste","Argument":"Argumento","Confirmation text":"Texto de confirma\xe7\xe3o","Keywords":"Palavras-chave","Interrupt processing":"Interromper o processamento","You can use %s, that will be replaced with current value of state. %u will be replaced by unit":"Voc\xea pode usar %s, que ser\xe1 substitu\xeddo pelo valor atual do estado. %u ser\xe1 substitu\xeddo por unidade","Ok":"Ok","Create Rule":"Criar regra","Are you sure?":"Voc\xea tem certeza?","You want to delete: %s":"Voc\xea deseja excluir: \\"%s\\"","refresh":"Atualizar","lang_en":"Ingl\xeas","lang_de":"alem\xe3o","lang_ru":"russo","ms":"ms","Remove rule":"Remover regra","Refresh":"Atualizar","Search rule":"Pesquise a regra","Create rule":"Criar regra","Save":"Salve \ue051","Do not interrupt processing":"N\xe3o interrompa o processamento","Instance is not running":"Inst\xe2ncia n\xe3o est\xe1 sendo executada","Create a new rule with a \\"+\\" on the left":"Crie uma nova regra com um \\"+\\" \xe0 esquerda","Edit name or type of rule":"Editar nome ou tipo de regra","New rule":"Nova regra","Edit rule":"Editar regra","Rule":"Regra","Name":"Nome","Write to response by every command":"Escreva na resposta por todos os comandos","Clone rule":"Clone a regra","Name already exist":"Nome j\xe1 existe","Create new rule":"Criar nova regra","Copy rule":"Copiar regra","Please confirm or cancel changes before leaving":"Confirme ou cancele as altera\xe7\xf5es antes de sair","You have changed rule":"Voc\xea mudou a regra","Save and go":"Salve e v\xe1","Don\'t save and go":"N\xe3o salve e saia"}')},376:function(e){e.exports=JSON.parse('{"Select rule":"Selecteer regel","System":"Systeem","Language":"Taal","Answer in id":"Antwoord in ID","Processor\'s id":"Verwerker ID","Timeout for processor":"Time-out voor processor","Settings":"Instellingen","Cancel":"Annuleer","Test phrase":"Testzin","Argument":"Argument","Confirmation text":"Bevestigingstekst","Keywords":"Sleutelwoorden","Interrupt processing":"Verwerking onderbreken","You can use %s, that will be replaced with current value of state. %u will be replaced by unit":"U kunt %s gebruiken, dat zal worden vervangen door de huidige waarde van de staat. %u wordt vervangen door eenheid","Ok":"OK","Create Rule":"Cre\xeber regel","Are you sure?":"Weet je het zeker?","You want to delete: %s":"Je wilt verwijderen: %s","refresh":"Vernieuwen","lang_en":"Engels","lang_de":"Duitse","lang_ru":"Russisch","ms":"ms","Remove rule":"Regel verwijderen","Refresh":"Vernieuwen","Search rule":"Zoek de regel","Create rule":"Cre\xeber regel","Save":"Sparen","Do not interrupt processing":"Onderbreek de verwerking niet","Instance is not running":"Instantie is niet actief","Create a new rule with a \\"+\\" on the left":"Maak een nieuwe regel met een \\"+\\" aan de linkerkant","Edit name or type of rule":"Bewerk naam of type regel","New rule":"Nieuwe regel","Edit rule":"Regel bewerken","Rule":"Regel","Name":"Naam","Write to response by every command":"Schrijf bij elke opdracht op het antwoord","Clone rule":"Kloon de regel","Name already exist":"Naam bestaat al","Create new rule":"Maak een nieuwe regel","Copy rule":"Kopieer regel","Please confirm or cancel changes before leaving":"Bevestig of annuleer wijzigingen voordat u vertrekt","You have changed rule":"Je hebt de regel veranderd","Save and go":"Bewaar en ga","Don\'t save and go":"Sla niet op en vertrek"}')},377:function(e){e.exports=JSON.parse('{"Select rule":"S\xe9lectionnez la r\xe8gle","System":"Syst\xe8me","Language":"Langue","Answer in id":"R\xe9ponse dans l\'ID","Processor\'s id":"ID du processeur","Timeout for processor":"D\xe9lai d\'expiration pour le processeur","Settings":"Param\xe8tres","Cancel":"Annuler","Test phrase":"Expression de test","Argument":"Argument","Confirmation text":"Texte de confirmation","Keywords":"Mots cl\xe9s","Interrupt processing":"Interrompre le traitement","You can use %s, that will be replaced with current value of state. %u will be replaced by unit":"Vous pouvez utiliser %s, qui sera remplac\xe9 par la valeur actuelle de l\'\xe9tat. %u sera remplac\xe9 par l\'unit\xe9","Ok":"Ok","Create Rule":"Cr\xe9er une r\xe8gle","Are you sure?":"\xcates-vous s\xfbr?","You want to delete: %s":"Vous souhaitez supprimer: \\"%s\\"","refresh":"Rafra\xeechir","lang_en":"Anglais","lang_de":"allemand","lang_ru":"russe","ms":"ms","Remove rule":"Supprimer la r\xe8gle","Refresh":"Rafra\xeechir","Search rule":"Rechercher la r\xe8gle","Create rule":"Cr\xe9er une r\xe8gle","Save":"sauver","Do not interrupt processing":"N\'interrompez pas le traitement","Instance is not running":"L\'instance n\'est pas en cours d\'ex\xe9cution","Create a new rule with a \\"+\\" on the left":"Cr\xe9ez une nouvelle r\xe8gle avec un \\"+\\" \xe0 gauche","Edit name or type of rule":"Modifier le nom ou le type de r\xe8gle","New rule":"Nouvelle r\xe8gle","Edit rule":"Modifier la r\xe8gle","Rule":"R\xe8gle","Name":"Nom","Write to response by every command":"Ecrire \xe0 la r\xe9ponse de chaque commande","Clone rule":"Cloner la r\xe8gle","Name already exist":"Le nom existe d\xe9j\xe0","Create new rule":"Cr\xe9er une nouvelle r\xe8gle","Copy rule":"Copier la r\xe8gle","Please confirm or cancel changes before leaving":"Veuillez confirmer ou annuler les modifications avant de partir","You have changed rule":"Vous avez chang\xe9 de r\xe8gle","Save and go":"\xc9conomisez et partez","Don\'t save and go":"Ne sauvez pas et ne partez pas"}')},378:function(e){e.exports=JSON.parse('{"Select rule":"Seleziona la regola","System":"Sistema","Language":"linguaggio","Answer in id":"Risposta in ID","Processor\'s id":"ID del processore","Timeout for processor":"Timeout per processore","Settings":"impostazioni","Cancel":"Annulla","Test phrase":"Frase di prova","Argument":"Discussione","Confirmation text":"Testo di conferma","Keywords":"parole","Interrupt processing":"Interrompere l\'elaborazione","You can use %s, that will be replaced with current value of state. %u will be replaced by unit":"Puoi usare %s, che verr\xe0 sostituito con il valore corrente di stato. %u verr\xe0 sostituito dall\'unit\xe0","Ok":"Ok","Create Rule":"Crea regola","Are you sure?":"Sei sicuro?","You want to delete: %s":"Vuoi eliminare: \\"%s\\"","refresh":"ricaricare","lang_en":"Inglese","lang_de":"Tedesco","lang_ru":"russo","ms":"ms","Remove rule":"Rimuovi regola","Refresh":"ricaricare","Search rule":"Cerca la regola","Create rule":"Crea regola","Save":"Salva","Do not interrupt processing":"Non interrompere l\'elaborazione","Instance is not running":"L\'istanza non \xe8 in esecuzione","Create a new rule with a \\"+\\" on the left":"Crea una nuova regola con un \\"+\\" a sinistra","Edit name or type of rule":"Modifica il nome o il tipo di regola","New rule":"Nuova regola","Edit rule":"Modifica regola","Rule":"Regola","Name":"Nome","Write to response by every command":"Scrivi alla risposta con ogni comando","Clone rule":"Clona la regola","Name already exist":"Il nome esiste gi\xe0","Create new rule":"Crea nuova regola","Copy rule":"Copia regola","Please confirm or cancel changes before leaving":"Si prega di confermare o annullare le modifiche prima di partire","You have changed rule":"Hai cambiato regola","Save and go":"Salva e vai","Don\'t save and go":"Non salvare e vattene"}')},379:function(e){e.exports=JSON.parse('{"Select rule":"Seleccionar regla","System":"Sistema","Language":"Idioma","Answer in id":"Respuesta en ID","Processor\'s id":"ID del procesador","Timeout for processor":"Tiempo de espera para el procesador","Settings":"Configuraciones","Cancel":"Cancelar","Test phrase":"Frase de prueba","Argument":"Argumento","Confirmation text":"Texto de confirmaci\xf3n","Keywords":"Palabras clave","Interrupt processing":"Procesamiento de interrupci\xf3n","You can use %s, that will be replaced with current value of state. %u will be replaced by unit":"Puede usar %s, que se reemplazar\xe1 con el valor actual del estado. %u ser\xe1 reemplazado por unidad","Ok":"Okay","Create Rule":"Crear regla","Are you sure?":"\xbfEst\xe1s seguro?","You want to delete: %s":"Desea eliminar: \\"%s\\"","refresh":"Actualizar","lang_en":"Ingl\xe9s","lang_de":"alem\xe1n","lang_ru":"ruso","ms":"ms","Remove rule":"Eliminar regla","Refresh":"Actualizar","Search rule":"Busca la regla","Create rule":"Crear regla","Save":"Salvar","Do not interrupt processing":"No interrumpa el procesamiento.","Instance is not running":"La instancia no se est\xe1 ejecutando","Create a new rule with a \\"+\\" on the left":"Cree una nueva regla con un \\"+\\" a la izquierda","Edit name or type of rule":"Editar nombre o tipo de regla","New rule":"Nueva regla","Edit rule":"Editar regla","Rule":"Regla","Name":"Nombre","Write to response by every command":"Escribe a la respuesta por cada comando","Clone rule":"Clonar la regla","Name already exist":"El nombre ya existe","Create new rule":"Crear nueva regla","Copy rule":"Copiar regla","Please confirm or cancel changes before leaving":"Confirme o cancele los cambios antes de salir","You have changed rule":"Has cambiado de regla","Save and go":"Guardar y listo","Don\'t save and go":"No guardes y te vayas"}')},380:function(e){e.exports=JSON.parse('{"Select rule":"Wybierz regu\u0142\u0119","System":"System","Language":"J\u0119zyk","Answer in id":"Odpowiedz w ID","Processor\'s id":"ID procesora","Timeout for processor":"Limit czasu dla procesora","Settings":"Ustawienia","Cancel":"Anuluj","Test phrase":"Testowa fraza","Argument":"Argument","Confirmation text":"Tekst potwierdzaj\u0105cy","Keywords":"S\u0142owa kluczowe","Interrupt processing":"Przerwa\u0107 przetwarzanie","You can use %s, that will be replaced with current value of state. %u will be replaced by unit":"Mo\u017cesz u\u017cy\u0107 %s, kt\xf3ry zostanie zast\u0105piony bie\u017c\u0105c\u0105 warto\u015bci\u0105 stanu. %u zostanie zast\u0105pione przez jednostk\u0119","Ok":"Ok","Create Rule":"Stw\xf3rz zasad\u0119","Are you sure?":"Jeste\u015b pewny?","You want to delete: %s":"Chcesz usun\u0105\u0107: \\"%s\\"","refresh":"Od\u015bwie\u017ca\u0107","lang_en":"j\u0119zyk angielski","lang_de":"Niemiecki","lang_ru":"Rosyjski","ms":"ms","Remove rule":"Usu\u0144 regu\u0142\u0119","Refresh":"Od\u015bwie\u017ca\u0107","Search rule":"Wyszukaj regu\u0142\u0119","Create rule":"Stw\xf3rz zasad\u0119","Save":"Zapisa\u0107","Do not interrupt processing":"Nie przerywaj przetwarzania","Instance is not running":"Instancja nie dzia\u0142a","Create a new rule with a \\"+\\" on the left":"Utw\xf3rz now\u0105 regu\u0142\u0119 z \u201e+\u201d po lewej stronie","Edit name or type of rule":"Edytuj nazw\u0119 lub typ regu\u0142y","New rule":"Nowa zasada","Edit rule":"Edytuj regu\u0142\u0119","Rule":"Regu\u0142a","Name":"Imi\u0119","Write to response by every command":"Napisz odpowied\u017a na ka\u017cde polecenie","Clone rule":"Sklonuj regu\u0142\u0119","Name already exist":"Nazwa ju\u017c istnieje","Create new rule":"Utw\xf3rz now\u0105 regu\u0142\u0119","Copy rule":"Skopiuj regu\u0142\u0119","Please confirm or cancel changes before leaving":"Potwierd\u017a lub anuluj zmiany przed opuszczeniem","You have changed rule":"Zmieni\u0142e\u015b regu\u0142\u0119","Save and go":"Zapisz i id\u017a","Don\'t save and go":"Nie zapisuj i nie wychod\u017a"}')},381:function(e){e.exports=JSON.parse('{"Select rule":"\u9009\u62e9\u89c4\u5219","System":"\u7cfb\u7edf","Language":"\u8bed\u8a00","Answer in id":"\u8f93\u5165\u7b54\u6848","Processor\'s id":"\u5904\u7406\u5668ID","Timeout for processor":"\u5904\u7406\u5668\u8d85\u65f6","Settings":"\u8bbe\u5b9a\u503c","Cancel":"\u53d6\u6d88","Test phrase":"\u6d4b\u8bd5\u8bcd","Argument":"\u8bba\u636e","Confirmation text":"\u786e\u8ba4\u6587\u5b57","Keywords":"\u5173\u952e\u8bcd","Interrupt processing":"\u4e2d\u65ad\u5904\u7406","You can use %s, that will be replaced with current value of state. %u will be replaced by unit":"\u60a8\u53ef\u4ee5\u4f7f\u7528\uff05s\uff0c\u5b83\u5c06\u66ff\u6362\u4e3astate\u7684\u5f53\u524d\u503c\u3002 \uff05u\u5c06\u88ab\u5355\u4f4d\u66ff\u6362","Ok":"\u597d","Create Rule":"\u5efa\u7acb\u89c4\u5219","Are you sure?":"\u4f60\u786e\u5b9a\u5417\uff1f","You want to delete: %s":"\u60a8\u8981\u5220\u9664\uff1a\\"\uff05s\\"","refresh":"\u5237\u65b0","lang_en":"\u82f1\u8bed","lang_de":"\u5fb7\u8bed","lang_ru":"\u4fc4\u8bed","ms":"ms","Remove rule":"\u5220\u9664\u89c4\u5219","Refresh":"\u5237\u65b0","Search rule":"\u641c\u7d22\u89c4\u5219","Create rule":"\u5efa\u7acb\u89c4\u5219","Save":"\u4fdd\u5b58","Do not interrupt processing":"\u4e0d\u8981\u4e2d\u65ad\u5904\u7406","Instance is not running":"\u5b9e\u4f8b\u672a\u8fd0\u884c","Create a new rule with a \\"+\\" on the left":"\u7528\u5de6\u4fa7\u7684\u201c +\u201d\u521b\u5efa\u4e00\u4e2a\u65b0\u89c4\u5219","Edit name or type of rule":"\u7f16\u8f91\u540d\u79f0\u6216\u89c4\u5219\u7c7b\u578b","New rule":"\u65b0\u89c4\u5b9a","Edit rule":"\u4fee\u6539\u89c4\u5219","Rule":"\u89c4\u5219","Name":"\u540d\u79f0","Write to response by every command":"\u901a\u8fc7\u6bcf\u4e2a\u547d\u4ee4\u5199\u5165\u54cd\u5e94","Clone rule":"\u514b\u9686\u89c4\u5219","Name already exist":"\u540d\u79f0\u5df2\u5b58\u5728","Create new rule":"\u5efa\u7acb\u65b0\u89c4\u5219","Copy rule":"\u590d\u5236\u89c4\u5219","Please confirm or cancel changes before leaving":"\u8bf7\u786e\u8ba4\u6216\u53d6\u6d88\u66f4\u6539\uff0c\u7136\u540e\u518d\u79bb\u5f00","You have changed rule":"\u60a8\u5df2\u66f4\u6539\u89c4\u5219","Save and go":"\u4fdd\u5b58\u5e76\u8d70","Don\'t save and go":"\u4e0d\u8981\u4fdd\u5b58\u5e76\u79bb\u5f00"}')},382:function(e,t,a){"use strict";a.r(t);var n=a(0),r=a.n(n),s=a(22),i=a.n(s),o=a(53),l=a(436),c=a(425),u=Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));function d(e,t){navigator.serviceWorker.register(e).then((function(e){e.onupdatefound=function(){var a=e.installing;null!=a&&(a.onstatechange=function(){"installed"===a.state&&(navigator.serviceWorker.controller?(console.log("New content is available and will be used when all tabs for this page are closed. See http://bit.ly/CRA-PWA."),t&&t.onUpdate&&t.onUpdate(e)):(console.log("Content is cached for offline use."),t&&t.onSuccess&&t.onSuccess(e)))})}})).catch((function(e){console.error("Error during service worker registration:",e)}))}a(286);var p=a(8),h=a(56),g=a(57),m=a(61),f=a(60),v=a(7),b=a(175),j=a.n(b),O=a(12),S=a.n(O),w=a(251),x=a.n(w),y=a(26),C=a.n(y),R=a(130),k=a(45),I=a(28),N=a(52),D=a(156),z=a(158),T=a(253),E=a.n(T),A=a(438),L=a(4),B=a(137),M=(a(333),a(442)),W=a(434),P=a(266),U=a(54),_=a.n(U),F=a(217),Y=a(221),J=a(263),V=a.n(J),q=a(242),K=a(226),G=a(243),H=a(78),Z=a(433),X=a(216),$=a(219),Q=a(218),ee=a(215),te=a(238),ae=a(224),ne=a(430),re=a(227),se=a(188),ie=a(241),oe=a(437),le=a(236),ce=a(239),ue=a(193),de=a.n(ue),pe=a(192),he=a.n(pe),ge=a(259),me=a.n(ge),fe=a(39),ve=a.n(fe),be=a(261),je=a.n(be),Oe=a(154),Se=a.n(Oe),we=a(260),xe=a.n(we),ye=a(262),Ce=a.n(ye),Re=a(152),ke=a.n(Re),Ie=a(220),Ne=a(440),De=a(439),ze=a(190),Te=a(233),Ee=a(231),Ae=a(191),Le=a.n(Ae),Be=a(257),Me=a.n(Be),We=a(256),Pe=a.n(We),Ue=a(431),_e=a(2),Fe=r.a.forwardRef((function(e,t){var a,r=e.name,s=e.handleEdit,i=e.handleCopy,o=e.rule,l=e.isDragging,c=e.connectDragSource,u=e.connectDropTarget,d=e.id,p=e.selectRule,h=e.selectedRule,g=e._break,m=e.matchingRules,f=e.unsavedRules,v=e.index,b=e.theme,j=e.removeMatched,O=e.words,w=e.unique,x=Object(Ie.a)({listItem:{cursor:"pointer",transition:"background-color 0.3s linear",position:"relative",paddingTop:4,paddingBottom:12,borderBottom:"1px dashed "+b.palette.text.primary+(b.palette.text.primary.startsWith("rgb")?"":"30")},listItemText:{},listItemTextPrimary:{color:b.palette.text.primary,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},listItemTextSecondary:{textOverflow:"ellipsis",overflow:"hidden",opacity:"dark"===b.palette.type?.2:.7,fontStyle:"italic"},dot:{position:"absolute",backgroundColor:"red",top:3,right:15,height:10,fontSize:10,borderRadius:10,padding:"0 5px 5px 5px",textAlign:"center",color:"#FFF"},maximize:{color:null===(a=b.palette.error)||void 0===a?void 0:a.dark,marginTop:b.spacing(1)},ruleButton:{paddingTop:b.spacing(1.5)},editButton:{height:32},words:{fontSize:12,opacity:.5,width:"calc(100% - 40px)",position:"absolute",bottom:4,left:0,paddingLeft:17,color:b.palette.text.primary,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},emptyButton:{width:30},multiline:{marginTop:0,marginBottom:12}})(),y=Object(n.useRef)(null);c(y),u(y);var C=l?0:1;Object(n.useImperativeHandle)(t,(function(){return{getNode:function(){return y.current}}}));var R=Object(n.useCallback)((function(){return p(d)}),[d,p]),k=Object(n.useCallback)((function(){return s(d)}),[d,s]),I=Object(n.useCallback)((function(){return i(d)}),[d,i]),N=Object(n.useState)({}),z=Object(D.a)(N,2),T=z[0],E=z[1];Object(n.useEffect)((function(){if(m.length){var e=m.find((function(e){return e.indexOf===v}));e&&(setTimeout((function(){var e,t;return E({backgroundColor:"dark"===b.palette.type?null===b||void 0===b||null===(e=b.palette)||void 0===e?void 0:e.secondary.dark:null===b||void 0===b||null===(t=b.palette)||void 0===t?void 0:t.secondary.light})}),e.timer),setTimeout((function(){var e,t;E(h.id===d?{backgroundColor:null===b||void 0===b||null===(e=b.palette)||void 0===e||null===(t=e.background)||void 0===t?void 0:t.default}:{}),(g||v===m[m.length-1].indexOf)&&j()}),1500*(e.index+1)))}}),[m]);var A=o!==r&&o||"";return Object(_e.jsx)("div",{ref:y,style:Object.assign({},{opacity:C},T),children:Object(_e.jsxs)(ze.a,{onClick:R,selected:(null===h||void 0===h?void 0:h.id)===d,className:Object(L.a)((null===h||void 0===h?void 0:h.id)===d&&"rule-selected"),classes:{root:x.listItem},children:[Object(_e.jsx)(Te.a,{primary:r,secondary:A,classes:{primary:x.listItemTextPrimary,secondary:x.listItemTextSecondary,multiline:x.multiline},className:x.listItemText}),Object(_e.jsxs)(Ee.a,{children:[g?Object(_e.jsx)(q.a,{title:S.a.t("Interrupt processing"),children:Object(_e.jsx)(Pe.a,{className:Object(L.a)(x.ruleButton,x.maximize)})}):Object(_e.jsx)(q.a,{title:S.a.t("Do not interrupt processing"),children:Object(_e.jsx)(Me.a,{className:x.ruleButton,color:"primary"})}),w?Object(_e.jsx)("div",{className:x.emptyButton}):Object(_e.jsx)(q.a,{title:S.a.t("Copy rule"),children:Object(_e.jsx)(se.a,{onClick:I,size:"small",className:x.editButton,children:Object(_e.jsx)(Ue.a,{})})}),Object(_e.jsx)(q.a,{title:S.a.t("Edit name or type of rule"),children:Object(_e.jsx)(se.a,{onClick:k,size:"small",className:x.editButton,children:Object(_e.jsx)(Le.a,{})})})]}),f[d]&&Object(_e.jsx)("div",{className:x.dot,children:S.a.t("unsaved")}),Object(_e.jsxs)("div",{className:x.words,children:["[",O,"]"]})]})})})),Ye="rule",Je=Object(Ne.a)(Ye,{hover:function(e,t,a){if(!a)return null;var n=a.getNode();if(!n)return null;var r=t.getItem().index,s=e.index;if(r!==s){var i=n.getBoundingClientRect(),o=(i.bottom-i.top)/2,l=t.getClientOffset().y-i.top;r<s&&l<o||r>s&&l>o||(e.moveRule(r,s),t.getItem().index=s)}}},(function(e){return{connectDropTarget:e.dropTarget()}}))(Object(De.a)(Ye,{beginDrag:function(e){return{id:e.id,index:e.index}}},(function(e,t){return{connectDragSource:e.dragSource(),isDragging:t.isDragging()}}))(Fe)),Ve=a(68),qe=a.n(Ve),Ke=a(228),Ge=_()((function(e){return{tooltip:{fontSize:14}}}))(q.a),He=function(e){Object(m.a)(a,e);var t=Object(f.a)(a);function a(e){var r;return Object(h.a)(this,a),(r=t.call(this,e)).getDefaultSettings=function(){r.setState({localSettings:Object(p.a)({},r.props.settings)})},r.onAlive=function(e,t){t&&t.val?!r.state.alive&&r.setState({alive:!0}):r.state.alive&&r.setState({alive:!1})},r.onResponse=function(e,t){null===r.state.toast?r.setState({toast:"",toastError:!1}):t&&(t.val&&t.val.match(/^Error\.|^Fehler\.|^\u041e\u0448\u0438\u0431\u043a\u0430\./)?r.props.socket.getState("text2command."+r.props.instance+".error").then((function(e){return r.setState({toast:e&&e.val?e.val:e.val||"",toastError:!0})})):r.setState({toast:t.val||"",toastError:!1}))},r.handleTextCommand=function(e){r.setState({textCommand:e.target.value},(function(){r.testTimer&&clearTimeout(r.testTimer),r.testTimer=setTimeout((function(){var e=r.findMatchingRules();r.setState({matchingRules:e.map((function(e,t){return{indexOf:e,timer:1500*t,index:t}}))})}),500)}))},r.handleSubmit=function(e,t){(e&&"Enter"===e.key||t)&&(r.props.socket.setState("text2command.".concat(r.props.instance,".text"),r.state.textCommand).catch((function(e){return console.error(e)})),r.state.alive||r.setState({toast:S.a.t("Instance is not running"),toastError:!0}))},r.removeMatched=function(){r.setState({matchingRules:[]})},r.handleOpenSettingsModal=function(){r.setState({isSettingsDialogOpen:!0})},r.handleDialogSelectIdSubmit=function(e,t){r.setState({localSettings:Object(p.a)(Object(p.a)({},r.state.localSettings),{},Object(I.a)({},t,e))})},r.handleDelete=function(){r.props.removeRule(r.props.selectedRule.id),r.handleCloseConfirmRemoveDialog()},r.handleCloseConfirmRemoveDialog=function(){r.setState({isConfirmRemoveDialogOpen:!1})},r.handleSearch=function(e){var t=r.props.rules.filter((function(t){return t.name.toLowerCase().includes(e.target.value.toLowerCase())}));r.setState({filteredRules:t||[],searchedValue:e.target.value})},r.toggleSearch=Object(k.a)(C.a.mark((function e(){return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.setState({isSearchActive:!r.state.isSearchActive});case 2:case"end":return e.stop()}}),e)}))),r.createSettingsModal=function(){if(!r.state.isSettingsDialogOpen)return null;var e=S.a.t,t=r.props.classes,a=function(){r.setState({isSettingsDialogOpen:!1,isSettingsWasNotSaved:!0})},s=function(e,t){var a=void 0!==e.target.checked?e.target.checked:e.target.value;"language"===t&&"system"===a&&(a=""),r.setState({localSettings:Object(p.a)(Object(p.a)({},r.state.localSettings),{},Object(I.a)({},t,a))})};return Object(_e.jsxs)(X.a,{open:r.state.isSettingsDialogOpen,onClose:a,fullWidth:!0,onExited:r.getDefaultSettings,children:[Object(_e.jsx)($.a,{children:Object(_e.jsx)(H.a,{variant:"h4",component:"span",align:"center",children:e("Settings")})}),Object(_e.jsx)(Q.a,{children:Object(_e.jsx)("form",{noValidate:!0,autoComplete:"off",children:Object(_e.jsxs)(Ke.a,{container:!0,direction:"column",children:[Object(_e.jsx)(Ke.a,{item:!0,children:Object(_e.jsxs)(re.a,{fullWidth:!0,classes:{root:t.settingsItem},children:[Object(_e.jsx)(ne.a,{id:"demo-simple-select-label",children:e("Language")}),Object(_e.jsxs)(te.a,{classes:{root:t.width100},onChange:function(e){return s(e,"language")},value:r.state.localSettings.language?r.state.localSettings.language:"system",children:[Object(_e.jsx)(ae.a,{value:"system",children:e("System")}),n.Children.toArray(["en","de","ru"].map((function(t){return Object(_e.jsx)(ae.a,{value:t,children:e("lang_"+t)})})))]})]})}),Object(_e.jsxs)(Ke.a,{item:!0,children:[Object(_e.jsx)(re.a,{fullWidth:!0,classes:{root:Object(L.a)(t.settingsItem,t.selectIdText)},children:Object(_e.jsx)(G.a,{label:e("Answer in id"),value:r.state.localSettings.sayitInstance,onChange:function(e){return s(e,"sayitInstance")}})}),Object(_e.jsx)(ee.a,{variant:"outlined",className:t.selectIdButton,onClick:function(){return r.setState({showDialogSelectId:!0,selectedSettingsName:"sayitInstance",selectedId:r.state.localSettings.sayitInstance||""})},children:"..."})]}),Object(_e.jsxs)(Ke.a,{item:!0,children:[Object(_e.jsx)(re.a,{fullWidth:!0,classes:{root:Object(L.a)(t.settingsItem,t.selectIdText)},children:Object(_e.jsx)(G.a,{label:e("Processor's id"),value:r.state.localSettings.processorId,onChange:function(e){return s(e,"processorId")}})}),Object(_e.jsx)(ee.a,{variant:"outlined",className:t.selectIdButton,onClick:function(){return r.setState({showDialogSelectId:!0,selectedSettingsName:"processorId",selectedId:r.state.localSettings.processorId||""})},children:"..."})]}),Object(_e.jsx)(Ke.a,{item:!0,children:Object(_e.jsx)(re.a,{fullWidth:!0,classes:{root:t.settingsItem},children:Object(_e.jsx)(G.a,{label:e("Timeout for processor"),helperText:e("ms"),value:r.state.localSettings.processorTimeout,onChange:function(e){return s(e,"processorTimeout")}})})}),Object(_e.jsx)(Ke.a,{item:!0,children:Object(_e.jsx)(re.a,{fullWidth:!0,classes:{root:t.settingsItem},children:Object(_e.jsx)(le.a,{control:Object(_e.jsx)(ce.a,{checked:r.state.localSettings.writeEveryAnswer,onChange:function(e){return s(e,"writeEveryAnswer")}}),label:e("Write to response by every command")})})})]})})}),Object(_e.jsxs)(F.a,{children:[Object(_e.jsx)(ee.a,{variant:"contained",color:"primary",onClick:function(){return r.props.saveSettings(r.state.localSettings,a)},startIcon:Object(_e.jsx)(qe.a,{}),children:S.a.t("Ok")}),Object(_e.jsx)(ee.a,{variant:"contained",onClick:a,startIcon:Object(_e.jsx)(ve.a,{}),children:S.a.t("Cancel")})]})]})},r.mainIcons=[{icon:Object(_e.jsx)(de.a,{}),handler:function(){return r.props.handleOpen()},tooltip:S.a.t("Create rule")},{icon:Object(_e.jsx)(he.a,{}),handler:function(){return r.handleOpenSettingsModal()},tooltip:S.a.t("Settings")},{icon:Object(_e.jsx)(me.a,{}),handler:function(){return console.log("refresh")},tooltip:S.a.t("Refresh")}],r.createIcons=function(e){return e.map((function(e,t){var a=e.icon,n=e.handler,r=e.tooltip;return Object(_e.jsx)(Ge,{title:r,children:Object(_e.jsx)(se.a,{onClick:n,children:a})},t)}))},r.state={textCommand:"",matchingRules:[],isSettingsDialogOpen:!1,isConfirmRemoveDialogOpen:!1,isSearchActive:!1,filteredRules:[],searchedValue:"",localSettings:{language:r.props.settings.language||"",processorId:r.props.settings.processorId||"",processorTimeout:r.props.settings.processorTimeout||1e3,sayitInstance:r.props.settings.sayitInstance||""},toast:null,alive:!1},r}return Object(g.a)(a,[{key:"componentDidMount",value:function(){this.props.socket.subscribeState("text2command.".concat(this.props.instance,".response"),this.onResponse),this.props.socket.subscribeState("system.adapter.text2command.".concat(this.props.instance,".alive"),this.onAlive),this.props.selectedRule&&this.props.selectedRule.id&&setTimeout((function(){var e=window.document.getElementsByClassName("rule-selected");e.length&&e[0].scrollIntoView()}),50)}},{key:"componentWillUnmount",value:function(){this.props.socket.unsubscribeState("text2command.".concat(this.props.instance,".response"),this.onResponse),this.props.socket.unsubscribeState("system.adapter.text2command.".concat(this.props.instance,".alive"),this.onAlive)}},{key:"componentDidUpdate",value:function(e,t){this.props.settings!==e.settings&&this.props.settings&&this.getDefaultSettings()}},{key:"findMatchingRules",value:function(){var e=this.state.textCommand;return e?window.findMatched(e,JSON.parse(JSON.stringify(this.props.rules))):[]}},{key:"renderSelectIdDialog",value:function(){var e=this;return this.state.showDialogSelectId?Object(_e.jsx)(ke.a,{imagePrefix:"../..",socket:this.props.socket,title:"Select ID",selected:this.state.selectedId,onClose:function(){return e.setState({showDialogSelectId:!1})},onOk:function(t){return e.handleDialogSelectIdSubmit(t,e.state.selectedSettingsName)}}):null}},{key:"renderConfirmDialog",value:function(){return this.state.isConfirmRemoveDialogOpen?Object(_e.jsxs)(X.a,{open:this.state.isConfirmRemoveDialogOpen,onClose:this.handleCloseConfirmRemoveDialog,fullWidth:!0,children:[Object(_e.jsx)($.a,{children:S.a.t("Are you sure?")}),Object(_e.jsxs)(Q.a,{children:[Object(_e.jsx)(H.a,{component:"p",children:S.a.t("You want to delete: %s",this.props.selectedRule.name)}),Object(_e.jsxs)(F.a,{children:[Object(_e.jsx)(ee.a,{variant:"contained",color:"primary",autoFocus:!0,onClick:this.handleDelete,startIcon:Object(_e.jsx)(Se.a,{}),children:S.a.t("Delete")}),Object(_e.jsx)(ee.a,{variant:"contained",onClick:this.handleCloseConfirmRemoveDialog,startIcon:Object(_e.jsx)(ve.a,{}),children:S.a.t("Cancel")})]})]})]}):null}},{key:"renderToast",value:function(){var e=this;return this.state.toast?Object(_e.jsx)(ie.a,{anchorOrigin:{vertical:"top",horizontal:"right"},open:!0,autoHideDuration:4e3,onClose:function(){return e.setState({toast:""})},children:this.state.toastError?Object(_e.jsx)(oe.a,{elevation:6,variant:"filled",onClose:function(){return e.setState({toast:""})},severity:"error",children:this.state.toast}):Object(_e.jsx)(oe.a,{elevation:6,variant:"filled",onClose:function(){return e.setState({toast:""})},severity:"success",children:this.state.toast})}):null}},{key:"render",value:function(){var e=this,t=this.props,a=t.selectedRule,r=t.moveRule,s=t.handleEdit,i=t.handleCopy,o=t.rules,l=t.selectRule,c=t.classes,u=t.isMobile,d=t.closeDrawer,h=this.state,g=h.filteredRules,m=h.isSearchActive,f=h.searchedValue,v=this.createSettingsModal(),b=m&&f.length?g:o,j=[];return a&&a.id&&j.push({icon:!m&&Object(_e.jsx)(Se.a,{}),handler:function(){return e.setState({isConfirmRemoveDialogOpen:!0})},tooltip:S.a.t("Remove rule"),key:"delete"}),o.length&&j.push({icon:m?Object(_e.jsx)(xe.a,{}):Object(_e.jsx)(je.a,{}),handler:function(){return e.toggleSearch()},tooltip:S.a.t("Search rule"),key:"search"}),Object(_e.jsxs)(Z.a,{className:c.main,children:[Object(_e.jsxs)(Y.a,{position:"static",variant:"dense",classes:{root:c.toolbar},disableGutters:!0,children:[m?Object(_e.jsx)(G.a,{className:c.search,onChange:this.handleSearch,value:this.state.searchedValue,InputProps:{endAdornment:this.state.searchedValue?Object(_e.jsx)(se.a,{onClick:function(){return e.setState({searchedValue:""})},children:Object(_e.jsx)(ve.a,{})}):void 0},autoFocus:!0}):Object(_e.jsx)("div",{children:this.createIcons(this.mainIcons)}),Object(_e.jsx)("div",{children:this.createIcons(j)}),u&&Object(_e.jsx)(se.a,{className:c.closeBtn,onClick:d,children:Object(_e.jsx)(ve.a,{})}),m||this.state.alive?null:Object(_e.jsx)("div",{style:{flexGrow:1}}),m||this.state.alive?null:Object(_e.jsx)(q.a,{title:S.a.t("Instance is not running"),children:Object(_e.jsx)(Ce.a,{className:c.iconNotAlive})})]}),Object(_e.jsx)(W.a,{backend:P.a,children:Object(_e.jsx)(K.a,{className:c.list,children:b.map((function(t,o){return Object(n.createElement)(Je,Object(p.a)(Object(p.a)({theme:e.props.theme,handleEdit:s,handleCopy:i,unique:t.unique},t),{},{index:o,moveRule:r,key:t.id,selectRule:l,selectedRule:a,matchingRules:e.state.matchingRules,unsavedRules:e.props.unsavedRules,removeMatched:e.removeMatched}))}))})}),Object(_e.jsxs)(Y.a,{className:c.test,variant:"dense",disableGutters:!0,children:[Object(_e.jsx)(G.a,{onChange:this.handleTextCommand,label:S.a.t("Test phrase"),variant:"outlined",size:"small",color:"primary",className:Object(L.a)("outlined-basic",c.root),onKeyDown:this.handleSubmit,value:this.state.textCommand,inputProps:{style:{padding:"10px 10px"}},InputProps:{endAdornment:this.state.textCommand?Object(_e.jsx)(se.a,{onClick:function(){return e.setState({textCommand:""})},children:Object(_e.jsx)(ve.a,{})}):void 0}}),Object(_e.jsx)(se.a,{variant:"outlined",onClick:function(t){return e.handleSubmit(t,!0)},children:Object(_e.jsx)(V.a,{className:c.play})})]}),v,this.renderConfirmDialog(),this.renderSelectIdDialog(),this.renderToast()]})}}]),a}(n.Component),Ze=_()((function(e){return{test:{width:"100%",boxSizing:"border-box",paddingLeft:e.spacing(1)},main:{minWidth:300,overflow:"hidden",height:"100%"},toolbar:{background:e.palette.primary.main,position:"relative"},list:{height:"calc(100% - 48px - 48px - 8px)",overflowX:"hidden",overflowY:"auto",paddingTop:0},root:{width:"calc(100% - 48px)"},header:{minHeight:44,height:"auto",padding:e.spacing(1.3),border:"1px solid ".concat(e.palette.divider)},textInput:Object(I.a)({width:"60%"},e.breakpoints.down("sm"),{width:"100%"}),settingsTitle:Object(I.a)({fontSize:"20px",maxWidth:145},e.breakpoints.down("sm"),{marginBottom:e.spacing(1)}),settingsContent:Object(I.a)({},e.breakpoints.down("sm"),{flexDirection:"column",display:"flex"}),closeBtn:{position:"absolute",top:0,right:0,color:e.palette.common.white},iconNotAlive:{color:"#ffc10a",float:"right",marginRight:e.spacing(1)},search:Object(I.a)({flexBasis:"80%"},e.breakpoints.down("sm"),{flexBasis:"70%"}),settingsItem:{marginBottom:e.spacing(3)},width100:{width:"100%"},selectIdText:{width:"calc(100% - 50px)"},selectIdButton:{minWidth:40}}}))(He),Xe=a(143),$e=a(237),Qe=a(395),et=a(187),tt=a(265),at=a.n(tt),nt=a(264),rt=a.n(nt),st=a(104),it=a.n(st),ot=function(e){Object(m.a)(a,e);var t=Object(f.a)(a);function a(){var e;Object(h.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return(e=t.call.apply(t,[this].concat(r))).defaultState={words:S.a.t("Create Rule"),name:S.a.t("Create Rule"),_break:!1,editable:!1,args:[{default:S.a.t("Argument")+" 1"},{default:S.a.t("Argument")+" 2"}],ack:{name:"",default:"".concat(S.a.t("Confirmation text"))},id:0},e.state={localRule:null,showDialog:!1},e.createConfirmModalActions=function(){var t=S.a.t,a=e.props,n=a.updateConfig,r=a.classes,s=a.selectRule,i=a.pendingSelectedRuleId,o=a.clearStateOnConfirmModalUnmount,l=a.revertChangesFromConfig,c=e.state.localRule,u=function(){var t=Object(k.a)(C.a.mark((function t(){return C.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,o();case 2:e.closeConfirmDialog();case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),d=function(){var t=Object(k.a)(C.a.mark((function t(){return C.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,l(c);case 2:return t.next=4,s(i);case 4:return t.next=6,o(c.id);case 6:e.closeConfirmDialog();case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),p=function(){var t=Object(k.a)(C.a.mark((function t(){return C.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n(c);case 2:return t.next=4,s(i);case 4:return t.next=6,o();case 6:e.closeConfirmDialog();case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return Object(_e.jsxs)(re.a,{className:r.submitForm,children:[Object(_e.jsx)("div",{style:{flexGrow:1}}),Object(_e.jsx)(ee.a,{variant:"contained",onClick:p,color:"primary",startIcon:Object(_e.jsx)(qe.a,{}),className:r.saveAndGoBtn,children:t("Save and go")}),Object(_e.jsx)(ee.a,{onClick:d,variant:"contained",color:"secondary",startIcon:Object(_e.jsx)(qe.a,{}),children:t("Don't save and go")}),Object(_e.jsx)(ee.a,{variant:"contained",className:r.btnDanger,startIcon:Object(_e.jsx)(ve.a,{}),onClick:u,children:t("Cancel")})]})},e.createSaveSettingsForm=function(){var t=S.a.t,a=e.props,n=a.updateConfig,r=a.classes,s=a.revertChangesFromConfig,i=a.selectedRule,o=e.state.localRule,l=function(){var t=Object(k.a)(C.a.mark((function t(){return C.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n(o);case 2:e.setState({isLocalStateWasUpdated:!1});case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),c=function(){var t=Object(k.a)(C.a.mark((function t(){return C.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s(o);case 2:return t.next=4,e.setState({localRule:i,isLocalStateWasUpdated:!1});case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return e.state.isLocalStateWasUpdated?Object(_e.jsxs)(re.a,{className:r.submitForm,children:[Object(_e.jsx)("div",{style:{flexGrow:1}}),Object(_e.jsx)(ee.a,{onClick:l,variant:"contained",startIcon:Object(_e.jsx)(qe.a,{}),color:"primary",children:t("Save")}),Object(_e.jsx)(ee.a,{variant:"contained",className:r.btnDanger,startIcon:Object(_e.jsx)(ve.a,{}),onClick:c,children:t("Cancel")})]}):Object(_e.jsx)("div",{className:e.props.classes.emptyButtons})},e.closeConfirmDialog=function(){e.setState({isLocalStateWasUpdated:!1,confirmChanges:!1})},e.createInput=function(t){var a=t.value,n=t.label,r=t.onChange,s=t.type,i=t.onOpenSelectDialog,o=t.note,l=t.disabled,c=void 0===l?!e.state.localRule:l,u=t.keywords,d=t.key,p=t.onSwitchChange,h=t.isMobile;if((void 0===a||null===a)&&!n&&!u)return null;var g=e.props.classes;return i?Object(_e.jsxs)("div",{children:[Object(_e.jsx)(G.a,{classes:{root:g.inputOid},fullWidth:!0,label:h?n:"",size:"small",disabled:c,value:a,helperText:o||"",onChange:r},d),Object(_e.jsx)(ee.a,{onClick:function(){return i(a)},size:"small",className:g.inputOidButton,variant:"outlined",children:"..."})]}):"checkbox"!==s?Object(_e.jsx)(G.a,{classes:{root:g.textField},label:h?n:"",size:"small",disabled:c,value:a,helperText:o||"",onChange:r,className:g.rowPadding},d):Object(_e.jsxs)(re.a,{classes:{root:g.switchControl},children:[Object(_e.jsx)($e.a,{onClick:p,color:"primary",disabled:c,checked:!!a},d),h?Object(_e.jsx)(Qe.a,{children:n}):null]})},e.createOptionsData=function(){var t,a,n,r,s,i,o,l,c,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.state,d=u.localRule,p=d.args,h=d.ack,g=d.editable,m=d._break,f=S.a.t,v=e.createInput,b=e.handlers,j=function(){return void 0!==g&&!1===g};return[{title:f("Keywords"),item:v({value:(null===(t=e.state.localRule)||void 0===t?void 0:t.words)||"",onChange:b.keywordsText,keywords:!0,disabled:j(),key:"keywords",label:f("Keywords"),isMobile:e.props.isMobile}),id:1},{title:f("Interrupt processing"),item:v({type:"checkbox",value:m,onSwitchChange:b.breakOnSwitch,key:"break",label:f("Interrupt processing"),isMobile:e.props.isMobile}),id:2},{title:p&&(null===(a=p[0])||void 0===a?void 0:a.name),item:v({value:p&&(null===(n=e.state.localRule.args[0])||void 0===n?void 0:n.default),type:p&&(null===(r=p[0])||void 0===r?void 0:r.type),onOpenSelectDialog:function(t){return e.openSelectIdDialog(p&&p[0],t)},onSwitchChange:b.param1OnSwitch,key:"Param1",label:p&&(null===(s=p[0])||void 0===s?void 0:s.name),isMobile:e.props.isMobile}),id:3},{title:p&&(null===(i=p[1])||void 0===i?void 0:i.name),item:v({value:p&&(null===(o=e.state.localRule.args[1])||void 0===o?void 0:o.default),type:p&&(null===(l=p[1])||void 0===l?void 0:l.type),onChange:b.param2Text,onSwitchChange:b.param2OnSwitch,key:"Param2",label:p&&(null===(c=p[1])||void 0===c?void 0:c.name),isMobile:e.props.isMobile}),id:4},{title:f("Confirmation text"),item:v({value:h&&h.default,note:f("You can use %s, that will be replaced with current value of state. %u will be replaced by unit"),type:h&&h.type,key:"confirmationText",onChange:b.confirmText,onSwitchChange:b.confirmOnSwitch,label:f("Confirmation text"),isMobile:e.props.isMobile}),id:5}]},e.createInputHandlers=function(){var t=Object(Xe.a)(e);return{keywordsText:function(e){t.setState({localRule:Object(p.a)(Object(p.a)({},t.state.localRule),{},{words:e.target.value}),isLocalStateWasUpdated:!0})},param2Text:function(e){t.setState({localRule:Object(p.a)(Object(p.a)({},t.state.localRule),{},{args:t.state.localRule.args.map((function(t,a){return a>0?Object(p.a)(Object(p.a)({},t),{},{default:e.target.value}):t}))}),isLocalStateWasUpdated:!0})},confirmText:function(e){t.setState({localRule:Object(p.a)(Object(p.a)({},t.state.localRule),{},{ack:Object(p.a)(Object(p.a)({},t.state.localRule.ack),{},{default:e.target.value})}),isLocalStateWasUpdated:!0})},param1OnSwitch:function(){t.setState({localRule:Object(p.a)(Object(p.a)({},t.state.localRule),{},{args:t.state.localRule.args.map((function(e,t){return t?e:Object(p.a)(Object(p.a)({},e),{},{default:!e.default||!e.default})}))}),isLocalStateWasUpdated:!0})},param2OnSwitch:function(){t.setState({localRule:Object(p.a)(Object(p.a)({},t.state.localRule),{},{args:t.state.localRule.args.map((function(e,t){return t?Object(p.a)(Object(p.a)({},e),{},{default:!e.default||!e.default}):e}))}),isLocalStateWasUpdated:!0})},confirmOnSwitch:function(){t.setState({localRule:Object(p.a)(Object(p.a)({},t.state.localRule),{},{ack:Object(p.a)(Object(p.a)({},t.state.localRule.ack),{},{default:!t.state.localRule.ack.default})}),isLocalStateWasUpdated:!0})},breakOnSwitch:function(){return Object(k.a)(C.a.mark((function e(){return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.setState({localRule:Object(p.a)(Object(p.a)({},t.state.localRule),{},{_break:!t.state.localRule._break}),isLocalStateWasUpdated:!0});case 2:case"end":return e.stop()}}),e)})))()}}},e.handlers=e.createInputHandlers(),e.openSelectIdDialog=function(t,a){"id"===t.type&&e.setState({showDialog:!0,showDialogId:a})},e.onIDSelected=function(t){e.setState({localRule:Object(p.a)(Object(p.a)({},e.state.localRule),{},{args:e.state.localRule.args.map((function(e,a){return a?e:Object(p.a)(Object(p.a)({},e),{},{default:t})}))}),isLocalStateWasUpdated:!0})},e}return Object(g.a)(a,[{key:"componentDidUpdate",value:function(e,t){var a,n,r,s;if((null===(a=e.selectedRule)||void 0===a?void 0:a.name)!==(null===(n=this.props.selectedRule)||void 0===n?void 0:n.name)||(null===(r=t.localRule)||void 0===r?void 0:r.name)!==(null===(s=this.state.localRule)||void 0===s?void 0:s.name))this.props.selectedRule&&this.props.selectedRule.name?this.setState({localRule:Object(p.a)({},this.props.selectedRule)}):this.setState({localRule:null});else if(this.state.isLocalStateWasUpdated){var i=this.props.unsavedRules[this.state.localRule.id];it()(this.props.selectedRule,this.state.localRule)&&!(null===i||void 0===i?void 0:i.wasChangedGlobally)?(this.setState({isLocalStateWasUpdated:!1}),(null===i||void 0===i?void 0:i.wasChangedGlobally)||this.props.removeUnsavedRule(this.state.localRule.id)):i||this.props.pendingSelectedRuleId||this.props.setUnsavedRule(this.state.localRule.id)}else!this.state.isLocalStateWasUpdated&&this.props.unsavedRules[this.state.localRule.id]&&this.setState({isLocalStateWasUpdated:!0});if(this.props.pendingSelectedRuleId&&this.state.isLocalStateWasUpdated){if(this.props.pendingSelectedRuleId===this.state.localRule.id)return;this.setState({confirmChanges:!0})}this.props.lang!==e.lang&&this.forceUpdate()}},{key:"componentDidMount",value:function(){!this.state.localRule&&this.props.selectedRule&&this.setState({localRule:this.props.selectedRule})}},{key:"renderConfirmDialog",value:function(){return this.state.confirmChanges?Object(_e.jsxs)(X.a,{fullWidth:!0,open:this.state.confirmChanges,maxWidth:"md",children:[Object(_e.jsx)($.a,{children:S.a.t("Please confirm or cancel changes before leaving")}),Object(_e.jsxs)(Q.a,{children:[Object(_e.jsxs)(H.a,{children:[S.a.t("You have changed rule")+": "," ",Object(_e.jsx)("strong",{children:this.state.localRule.name})]}),Object(_e.jsx)(F.a,{children:this.createConfirmModalActions()})]})]}):null}},{key:"renderSelectIdDialog",value:function(){var e=this;return this.state.showDialog?Object(_e.jsx)(ke.a,{imagePrefix:"../..",socket:this.props.socket,title:"Select ID",selected:this.state.showDialogId,onClose:function(){return e.setState({showDialog:!1})},onOk:function(t){return e.onIDSelected(t)}}):null}},{key:"render",value:function(){var e=this,t=this.state.localRule,a=this.props,n=a.classes,r=a.isLeftBarOpen,s=a.toggleLeftBar,i=t?t.name:"";return this.props.selectedRule?Object(_e.jsxs)("div",{className:n.root,children:[Object(_e.jsx)(Z.a,{className:n.toggleIcon,onClick:s,children:r||this.props.isMobile?Object(_e.jsx)(rt.a,{}):Object(_e.jsx)(at.a,{})}),Object(_e.jsx)(Y.a,{position:"static",variant:"dense",className:this.props.classes.header,children:i}),Object(_e.jsxs)(Z.a,{className:Object(L.a)(n.box,this.props.isMobile?n.boxMobile:n.boxDesktop),children:[t?Object(_e.jsx)(et.a,{className:n.container,children:Object(_e.jsx)("div",{style:this.props.isMobile?{width:"100%"}:{display:"grid",gridTemplateColumns:"minmax(50px, 215px) 1fr"},children:this.createOptionsData().map((function(t){var a=t.title,r=t.item;t.id;return r?[e.props.isMobile?null:Object(_e.jsx)("div",{className:Object(L.a)(n.title,n.rowSpace),children:a},1),Object(_e.jsx)("div",{className:n.rowSpace,children:r},2)]:null}))})}):null,this.renderSelectIdDialog(),this.renderConfirmDialog()]},this.props.selectedRule?this.props.selectedRule.id:"emptyLeft"),t?Object(_e.jsx)(Y.a,{position:"static",variant:"dense",className:this.props.classes.header,children:this.createSaveSettingsForm()}):null]}):null}}],[{key:"getDerivedStateFromProps",value:function(e,t){var a,n;return!e.selectedRule&&t.localRule||e.selectedRule&&!t.localRule||(null===(a=e.selectedRule)||void 0===a?void 0:a.id)!==(null===(n=t.localRule)||void 0===n?void 0:n.id)?{localRule:Object(p.a)({},e.selectedRule)}:null}}]),a}(n.PureComponent),lt=Object(v.a)((function(e){var t;return{root:{width:"100%",height:"100%",padding:0,margin:0,position:"relative"},box:Object(I.a)({display:"inline-flex",justifyContent:"space-around",position:"relative","& .outlined-basic":{padding:"12px 10px"}},e.breakpoints.down("md"),{"& .outlined-basic":{padding:0}}),boxMobile:{padding:0,width:"100%",height:"calc(100% - 48px - 48px)",overflow:"auto"},boxDesktop:{padding:e.spacing(1),width:"calc(100% - "+e.spacing(2)+"px)",height:"calc(100% - 48px - 48px - "+e.spacing(2)+"px)",overflow:"auto"},container:Object(I.a)({width:"100%",padding:e.spacing(2),overflow:"auto"},e.breakpoints.down("md"),{width:"calc(100% - "+e.spacing(3)+"px)",padding:e.spacing(1)}),submitForm:Object(I.a)({flexDirection:"row",display:"flex",justifyContent:"right",width:"100%"},e.breakpoints.down("xs"),{flexDirection:"column"}),mainTitle:{marginBottom:"30px"},rowSpace:{marginBottom:16},title:{whiteSpace:"nowrap"},row:(t={},Object(I.a)(t,e.breakpoints.down("md"),{alignItems:"center"}),Object(I.a)(t,e.breakpoints.down("sm"),{flexDirection:"column",alignItems:"flex-start",textAlign:"center"}),t),btnDanger:Object(I.a)({marginLeft:8},e.breakpoints.down("xs"),{marginLeft:0,marginTop:e.spacing(.5)}),saveAndGoBtn:Object(I.a)({marginRight:20},e.breakpoints.down("xs"),{marginRight:0,marginBottom:e.spacing(.5)}),toggleIcon:{position:"absolute",zIndex:1,opacity:.8,top:8,left:0,backgroundColor:e.palette.primary.main,width:18,height:25,cursor:"pointer",padding:"4px 8px 4px 2px",color:"#FFF",borderRadius:"0 5px 5px 0"},switchControl:{marginTop:-5},emptyButtons:Object(I.a)({},e.breakpoints.down("sm"),{height:0}),noRulesText:{fontSize:24,color:e.palette.primary.light},header:{backgroundColor:e.palette.secondary.main,fontSize:18,fontWeight:"bold",paddingLeft:40,zIndex:0,color:"#FFF"},inputOid:{width:"calc(100% - 60px)",display:"inline-block"},inputOidButton:{minWidth:40,display:"inline-block",marginLeft:8},textField:{width:"calc(100% - 12px)"},rowPadding:{marginBottom:e.spacing(1)}}}))(ot),ct=a(435),ut=function(e){Object(m.a)(a,e);var t=Object(f.a)(a);function a(){var e;Object(h.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return(e=t.call.apply(t,[this].concat(r))).defaultRule={rule:S.a.t("Select rule"),name:S.a.t("New rule"),id:""},e.state={localRule:e.defaultRule,isDisabled:!0},e.setRuleOnMount=function(){var t=e.props,a=t.isEdit,n=t.selectedRule;a&&e.setState({localRule:n})},e.cleanState=function(){e.props.isEdit&&!e.props.isCopy&&e.props.finishEdit(e.state.localRule),e.setState({localRule:e.defaultRule})},e.getAvailableOptions=function(){var t=e.props,a=t.commands,n=t.rules,r=t.selectedRule,s=t.isEdit,i=null===a||void 0===a?void 0:a.filter((function(e){return!(e.unique&&n.find((function(t){return(null===t||void 0===t?void 0:t.rule)===e.rule})))}));return(null===r||void 0===r?void 0:r.unique)&&s?i.concat(r):i},e.getUniqueName=function(t){var a,n=(null===(a=e.props.rules)||void 0===a?void 0:a.map((function(e){return null===e||void 0===e?void 0:e.name}))).filter((function(e){return e.slice(0,e.length-2)===t})),r=e.props.commands.find((function(e){var a=e.rule,n=e.unique;return a===t&&n}));if(n.length){var s=n[n.length-1],i=s.slice(s.length-1);return s.slice(0,s.length-1)+ ++i}return r?t:"".concat(t," 1")},e.createForm=function(t){var a=e.state.localRule,n=e.props.classes,r=e.getAvailableOptions(),s=e.props.isEdit?e.props.isCopy?e.props.handleSubmitOnCopy:e.props.handleSubmitOnEdit:e.props.handleSubmitOnCreate;return Object(_e.jsxs)(ct.a,{children:[e.props.isCopy?null:Object(_e.jsxs)(re.a,{fullWidth:!0,children:[Object(_e.jsx)(ne.a,{shrink:!0,id:"rule",children:S.a.t("Rule")}),Object(_e.jsx)(te.a,{onChange:function(t){return e.setState({localRule:Object(p.a)(Object(p.a)({},a),{},{rule:t.target.value,name:e.getUniqueName(t.target.value),isError:""})})},value:a.rule,labelId:"rule",className:n.select,children:null===r||void 0===r?void 0:r.map((function(e){return Object(_e.jsx)(ae.a,{value:e.rule,children:e.rule},e.rule)}))})]}),Object(_e.jsx)(G.a,{fullWidth:!0,autoFocus:!0,id:"standard-basic",label:e.state.localRule.isError||S.a.t("Name"),value:a.name,onKeyDown:function(a){13!==a.keyCode||t||(a.preventDefault(),a.stopPropagation(),s(e.state.localRule,e.state.localRule.isError))},onChange:function(t){var n,r=null===(n=e.props.rules)||void 0===n?void 0:n.map((function(e){return null===e||void 0===e?void 0:e.name}));e.setState({localRule:Object(p.a)(Object(p.a)({},a),{},{name:t.target.value,isError:r.includes(t.target.value)?"".concat(S.a.t("Name already exist")):""})})},error:!!e.state.localRule.isError,className:n.TextField})]})},e.setDialogContent=function(){var t,a,n=e.props,r=n.handleClose,s=n.handleSubmitOnCreate,i=n.handleSubmitOnEdit,o=n.isEdit,l=n.isCopy,c=n.handleSubmitOnCopy,u=o?l?c:i:s,d=!e.state.localRule.name||!e.state.localRule.rule||e.state.localRule.name===e.defaultRule.name&&e.state.localRule.rule===e.defaultRule.rule||e.state.localRule.name===(null===(t=e.props.selectedRule)||void 0===t?void 0:t.name)&&e.state.localRule.rule===(null===(a=e.props.selectedRule)||void 0===a?void 0:a.rule);return Object(_e.jsxs)(Q.a,{children:[e.createForm(d,u),Object(_e.jsxs)(F.a,{children:[Object(_e.jsx)(ee.a,{variant:"contained",color:"primary",onClick:function(){return u(e.state.localRule,e.state.localRule.isError)},startIcon:Object(_e.jsx)(qe.a,{}),disabled:d,children:S.a.t("Ok")}),Object(_e.jsx)(ee.a,{variant:"contained",onClick:r,startIcon:Object(_e.jsx)(ve.a,{}),children:S.a.t("Cancel")})]})]})},e}return Object(g.a)(a,[{key:"componentWillUnmount",value:function(){this.cleanState()}},{key:"render",value:function(){return Object(_e.jsxs)(X.a,{open:this.props.isOpen,onClose:this.props.handleClose,onExited:this.cleanState,onEnter:this.setRuleOnMount,fullWidth:!0,children:[Object(_e.jsx)($.a,{children:S.a.t(this.props.isEdit?this.props.isCopy?"Clone rule":"Edit rule":"Create new rule")}),this.setDialogContent()]})}}]),a}(n.Component),dt=Object(v.a)((function(e){return{select:{width:"100%",marginBottom:e.spacing(2.5)},TextField:{marginBottom:e.spacing(1)}}}))(ut),pt=["name"],ht=["rules"],gt=["rules"],mt=["rules"],ft=["rules"],vt=["rules"],bt=function(e){Object(m.a)(a,e);var t=Object(f.a)(a);function a(e){var n;return Object(h.a)(this,a),(n=t.call(this,e)).getSelectedLanguageCommands=function(){var e,t,a=(null===(e=n.state)||void 0===e||null===(t=e.settings)||void 0===t?void 0:t.language)||S.a.getLanguage();return[{rule:S.a.t("Select rule"),unique:!1}].concat(Object(z.a)(Object.entries(window.commands).map((function(e){var t,n,r,s=Object(D.a)(e,2),i=s[0],o=s[1],l=(o.name,Object(N.a)(o,pt));return Object(p.a)(Object(p.a)({},l),{},{rule:null===o||void 0===o?void 0:o.name[a],template:i,unique:o.unique,words:o.words&&o.words[a],args:null===(t=o.args)||void 0===t?void 0:t.map((function(e){return Object(p.a)(Object(p.a)({},e),{},{name:e.name[a]||"",default:e.default||"checkbox"!==e.type&&""})})),ack:o.ack&&Object(p.a)(Object(p.a)({},o.ack),{},{name:o.ack.name[a],default:(null===(n=o.ack)||void 0===n?void 0:n.default)?o.ack.default[a]:"checkbox"!==(null===(r=o.ack)||void 0===r?void 0:r.type)&&""})})}))))},n.commands=n.getSelectedLanguageCommands(),n.moveRule=function(e,t){var a=n.state.rules,r=a.find((function(e,a){return a===t})),s=a.filter((function(e,a){return a!==t}));s.splice(e,0,r),n.setState({rules:s})},n.handleOpen=function(){n.setState({isOpen:!0})},n.handleClose=function(){n.setState({isOpen:!1})},n.handleSubmitOnCreate=function(e,t){if(!t){var a=Object(A.a)(),r=Object(p.a)(Object(p.a)({},e),{},{id:a,_break:!0}),s=Object(p.a)(Object(p.a)({},n.commands.find((function(e){return e.rule===r.rule}))),r),i=Object.values(n.state.unsavedRules).length;n.setState({rules:[].concat(Object(z.a)(n.state.rules),[s]),unsavedRules:Object(p.a)(Object(p.a)({},n.state.unsavedRules),{},Object(I.a)({},a,{id:a,wasChangedGlobally:!0})),selectedRule:i?n.state.selectedRule:s},(function(){i&&n.selectRule(s.id)})),n.handleClose()}},n.handleSubmitOnEdit=function(e,t){if(!t){var a=JSON.parse(JSON.stringify(n.state.unsavedRules));a[e.id]={id:e.id,wasChangedGlobally:!0},n.setState({unsavedRules:a,rules:n.updateRule(e)}),n.handleClose()}},n.handleSubmitOnCopy=function(e,t){if(!t){var a=JSON.parse(JSON.stringify(e));a.id=Object(A.a)();var r=JSON.parse(JSON.stringify(n.state.rules));r.push(a);var s=JSON.parse(JSON.stringify(n.state.unsavedRules));s[a.id]={id:a.id,wasChangedGlobally:!0},n.setState({rules:r,unsavedRules:s,selectedRule:a,isOpen:!1},(function(){n.selectRule(a.id)}))}},n.selectRule=function(e){var t=n.state,a=t.selectedRule,r=t.rules;if(a.id===e)n.isMobile&&n.setState({isLeftBarOpen:!1});else if(n.state.unsavedRules[a.id])n.setState({pendingSelectedRuleId:e});else{var s=r.find((function(t){return t.id===e}));n.setState({selectedRule:s,isLeftBarOpen:!n.isMobile&&n.state.isLeftBarOpen})}},n.updateRule=function(e){var t=JSON.parse(JSON.stringify(n.state.rules)),a=t.find((function(t){return t.id===e.id}));return t[t.indexOf(a)]=e,t},n.handleEdit=function(){n.setState({isEdit:!0}),n.handleOpen()},n.handleCopy=function(){n.setState({isCopy:!0,isEdit:!0}),n.handleOpen()},n.finishEdit=function(e){var t,a=e.rule,r=e.id,s=e.name,i=e._break,o=e.template;if(n.state.selectedRule.rule!==a){var l=n.commands.find((function(e){return e.rule===a}));t=Object(p.a)(Object(p.a)({},l),{},{name:s,rule:a,id:r,_break:i,template:o})}else t=JSON.parse(JSON.stringify(e));var c=JSON.parse(JSON.stringify(n.state.rules)),u=c.find((function(e){return e.id===t.id}));u?c[c.indexOf(u)]=t:c.push(t),n.setState({isEdit:!1,isCopy:!1,rules:c,selectedRule:t})},n.removeRule=function(e){var t=n.state.rules.filter((function(t){return t.id!==e}));n.setState({rules:t,selectedRule:t.length?t[t.length-1]:null},(function(){n.props.readConfig().then((function(t){var a=t.rules,r=Object(N.a)(t,ht),s=Object(p.a)({rules:a.filter((function(t){return t.id!==e}))},r);n.props.saveConfig(s)}))}))},n.updateConfig=function(){var e=Object(k.a)(C.a.mark((function e(t){var a,r,s,i,o,l,c,u,d,h;return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.state.unsavedRules,r=t.id,a[r],s=Object(N.a)(a,[r].map(R.a)),e.next=3,n.props.readConfig();case 3:return i=e.sent,o=i.rules,l=Object(N.a)(i,gt),c=o.find((function(e){return e.id===t.id})),u=n.updateRule(t),d=c?o.map((function(e){return e.id===t.id?n.getRuleShortData(t):e})):[].concat(Object(z.a)(o),[n.getRuleShortData(t)]),h=Object(p.a)({rules:d},l),e.next=11,n.props.saveConfig(h);case 11:n.setState({selectedRule:t||n.state.selectedRule||null,rules:u,unsavedRules:s});case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),n.getDataFromConfig=function(){return n.props.readConfig().then((function(e){var t=e.rules,a=Object(N.a)(e,mt),r=S.a.getLanguage(),s=t.map((function(e){var t,a,n,s=window.commands[e.template];return Object(p.a)(Object(p.a)({},s),{},{rule:null===s||void 0===s?void 0:s.name[r],ack:Object(p.a)(Object(p.a)({},s.ack),{},{default:e.ack||"checkbox"!==(null===(t=s.ack)||void 0===t?void 0:t.type)&&"",name:null===(a=s.ack)||void 0===a?void 0:a.name[r]}),args:null===(n=s.args)||void 0===n?void 0:n.map((function(t,a){return Object(p.a)(Object(p.a)({},t),{},{default:e.args[a]||"checkbox"!==(null===t||void 0===t?void 0:t.type)&&"",name:(null===t||void 0===t?void 0:t.name[r])||""})})),name:e.name||(null===s||void 0===s?void 0:s.name[r]),words:e.words,_break:e._break,id:e.id||Object(A.a)(),template:e.template})}));return n.setState({rules:s,ready:!0,selectedRule:s.find((function(e){return e.id===localStorage.getItem("selectedRule")}))||s[s.length-1]||null,settings:a}),e}))},n.revertChangesFromConfig=function(){var e=Object(k.a)(C.a.mark((function e(t){var a,r,s,i,o,l,c,u,d,h,g,m;return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.state.rules,s=n.state.unsavedRules,i=t.id,s[i],o=Object(N.a)(s,[i].map(R.a)),e.next=4,n.props.readConfig();case 4:l=e.sent,c=l.rules,u=Object(N.a)(l,ft),d=c.find((function(e){return e.id===t.id})),h=null===(a=n.state.unsavedRules[t.id])||void 0===a?void 0:a.wasChangedGlobally,d&&h?g=r.map((function(e){var t;return e.id===d.id?Object(p.a)(Object(p.a)({},e),{},{ack:Object(p.a)(Object(p.a)({},e.ack),{},{default:d.ack||""}),args:null===(t=e.args)||void 0===t?void 0:t.map((function(e){return Object(p.a)(Object(p.a)({},e),{},{default:d.arg||""})})),rule:window.commands[d.template].name[S.a.getLanguage()],words:d.words||"",name:d.name||"",_break:d._break||!0}):e})):d||(g=r.filter((function(e){return e.id!==t.id}))),m={rules:g||r,selectedRule:(h?g.find((function(e){return e.id===t.id})):n.state.selectedRule)||null,settings:u,unsavedRules:o},n.state.rules.length!==m.rules.length&&(m.selectedRule=m.rules[m.rules.length-1]||null),n.setState(m);case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),n.saveSettings=function(){var e=Object(k.a)(C.a.mark((function e(t,a){var r,s,i;return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.props.readConfig();case 2:return r=e.sent,s=r.rules,i=Object(p.a)({rules:s},t),e.next=7,n.props.saveConfig(i);case 7:n.setState({settings:t},(function(){return a()}));case 8:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),n.setUnsavedRule=function(e){n.setState({unsavedRules:Object(p.a)(Object(p.a)({},n.state.unsavedRules),{},Object(I.a)({},e,{id:e,wasChangedGlobally:!1}))})},n.removeUnsavedRule=function(e){var t=n.state.unsavedRules,a=(t[e],Object(N.a)(t,[e].map(R.a)));n.setState({unsavedRules:a})},n.getRuleShortData=function(e){var t=e._break,a=e.template,n=e.words,r=e.ack,s=e.args,i=e.name,o=e.id;return{words:n||"",ack:(null===r||void 0===r?void 0:r.default)||"",args:(null===s||void 0===s?void 0:s.map((function(e){return e.default})))||[],_break:t,template:a,name:i,id:o}},n.clearStateOnConfirmModalUnmount=function(e){var t=n.state.unsavedRules,a=(t[e],Object(N.a)(t,[e].map(R.a)));n.setState({pendingSelectedRuleId:!1,unsavedRules:a})},n.toggleLeftBar=function(){window.localStorage.setItem("App.menuHidden",!n.state.isLeftBarOpen),n.setState({isLeftBarOpen:!n.state.isLeftBarOpen})},n.closeDrawer=function(){n.setState({isLeftBarOpen:!1})},n.menuSize=parseFloat(window.localStorage.getItem("App.menuSize"))||350,n.state={rules:[],isOpen:!1,isEdit:!1,isCopy:!1,selectedRule:null,unsavedRules:{},ready:!1,isLeftBarOpen:"true"===window.localStorage.getItem("App.menuHidden")},n.commands=n.getSelectedLanguageCommands(),n.isMobile="sm"===n.props.width||"xs"===n.props.width,n}return Object(g.a)(a,[{key:"componentDidMount",value:function(){var e=this;this.getDataFromConfig().then((function(t){var a=t.rules,n=Object(N.a)(t,vt),r=a.map((function(e){var t,a;return e.id&&e.name?e:Object(p.a)(Object(p.a)({},e),{},{id:e.id||Object(A.a)(),name:e.name||(null===(t=window.commands[e.template])||void 0===t?void 0:t.name[S.a.getLanguage()])||(null===(a=window.commands[e.template])||void 0===a?void 0:a.name.en)})}));it()(a,r)||(e.props.saveConfig(Object(p.a)({rules:r},n)),setTimeout((function(){return e.setState({rules:r})}),50))})),this.isMobile&&this.setState({isLeftBarOpen:!0})}},{key:"componentDidUpdate",value:function(e,t){var a,n,r,s,i;if((null===(a=this.state.settings)||void 0===a?void 0:a.language)!==this.state.lang&&(null===(n=this.state.settings)||void 0===n?void 0:n.language)){var o,l=null===(o=this.state.settings)||void 0===o?void 0:o.language;S.a.setLanguage(l),this.commands=this.getSelectedLanguageCommands()}(null===(r=t.selectedRule)||void 0===r?void 0:r.id)!==(null===(s=this.state.selectedRule)||void 0===s?void 0:s.id)&&(null===(i=t.selectedRule)||void 0===i?void 0:i.id)&&this.state.selectedRule&&localStorage.setItem("selectedRule",this.state.selectedRule.id)}},{key:"renderModalDialog",value:function(){return this.state.isOpen?Object(_e.jsx)(dt,{commands:this.commands,isEdit:this.state.isEdit,isCopy:this.state.isCopy,handleSubmitOnCreate:this.handleSubmitOnCreate,handleSubmitOnEdit:this.handleSubmitOnEdit,handleSubmitOnCopy:this.handleSubmitOnCopy,handleClose:this.handleClose,isOpen:this.state.isOpen,rules:this.state.rules,selectedRule:this.state.selectedRule,finishEdit:this.finishEdit},"modal"):null}},{key:"render",value:function(){var e=this;console.log(this.state);var t=this.props.classes,a=this.state,n=a.rules,s=a.selectedRule,i=a.isLeftBarOpen;return this.state.ready?this.isMobile?Object(_e.jsxs)(r.a.Fragment,{children:[Object(_e.jsx)(M.a,{anchor:"left",open:this.state.isLeftBarOpen,onClose:this.closeDrawer,children:Object(_e.jsx)(Ze,{themeType:this.props.themeType,handleOpen:this.handleOpen,rules:n,moveRule:this.moveRule,handleEdit:this.handleEdit,handleCopy:this.handleCopy,selectRule:this.selectRule,selectedRule:s,removeRule:this.removeRule,settings:this.state.settings,socket:this.props.socket,saveSettings:this.saveSettings,theme:this.props.theme,toggleLeftBar:this.toggleLeftBar,unsavedRules:this.state.unsavedRules,isMobile:this.isMobile,closeDrawer:this.closeDrawer})}),this.state.settings&&s?Object(_e.jsx)(lt,{selectedRule:s,socket:this.props.socket,updateConfig:this.updateConfig,revertChangesFromConfig:this.revertChangesFromConfig,pendingSelectedRuleId:this.state.pendingSelectedRuleId,unsavedRules:this.state.unsavedRules,selectRule:this.selectRule,clearStateOnConfirmModalUnmount:this.clearStateOnConfirmModalUnmount,lang:this.state.settings.language,setUnsavedRule:this.setUnsavedRule,removeUnsavedRule:this.removeUnsavedRule,toggleLeftBar:this.toggleLeftBar,isLeftBarOpen:this.state.isLeftBarOpen,isMobile:this.isMobile},s.id):Object(_e.jsx)("div",{className:t.noRulesText,children:S.a.t('Create a new rule with a "+" on the left')}),this.renderModalDialog()]}):Object(_e.jsxs)(r.a.Fragment,{children:[Object(_e.jsxs)(E.a,{customClassName:Object(L.a)(i?t.hidden:t.opened,t.layout),primaryMinSize:350,primaryIndex:1,secondaryMinSize:350,onSecondaryPaneSizeChange:function(t){return e.menuSize=parseFloat(t)},onDragEnd:function(){return window.localStorage.setItem("App.menuSize",e.menuSize.toString())},secondaryInitialSize:this.menuSize,children:[Object(_e.jsx)(Ze,{handleOpen:this.handleOpen,rules:n,moveRule:this.moveRule,handleEdit:this.handleEdit,handleCopy:this.handleCopy,selectRule:this.selectRule,selectedRule:s,removeRule:this.removeRule,instance:this.props.instance,settings:this.state.settings,socket:this.props.socket,saveSettings:this.saveSettings,theme:this.props.theme,unsavedRules:this.state.unsavedRules,isMobile:this.isMobile}),this.state.settings&&s?Object(_e.jsx)(lt,{selectedRule:s,socket:this.props.socket,updateRule:this.updateRule,updateConfig:this.updateConfig,revertChangesFromConfig:this.revertChangesFromConfig,pendingSelectedRuleId:this.state.pendingSelectedRuleId,unsavedRules:this.state.unsavedRules,selectRule:this.selectRule,clearStateOnConfirmModalUnmount:this.clearStateOnConfirmModalUnmount,lang:this.state.settings.language,setUnsavedRule:this.setUnsavedRule,removeUnsavedRule:this.removeUnsavedRule,toggleLeftBar:this.toggleLeftBar,isLeftBarOpen:this.state.isLeftBarOpen,isMobile:this.isMobile}):Object(_e.jsx)("div",{className:t.noRulesText,children:S.a.t('Create a new rule with a "+" on the left')})]},"splitterLayout"),this.renderModalDialog()]}):null}}]),a}(n.PureComponent),jt=Object(v.a)((function(e){return{layout:{"& .layout-pane:first":{overflow:"hidden"}},hidden:{"& .layout-pane:first-child":{width:"0 !important"},background:e.palette.background.default},opened:{"& .layout-pane-primary":{width:""},overflow:"hidden",background:e.palette.background.default},noRulesText:{fontSize:24,color:e.palette.primary.light,textAlign:"center",paddingTop:e.spacing(2)}}}))(Object(B.a)()(bt)),Ot=function(e){Object(m.a)(n,e);var t=Object(f.a)(n);function n(e){Object(h.a)(this,n);var r=Object(p.a)({},e);return r.translations={en:a(372),de:a(373),ru:a(374),pt:a(375),nl:a(376),fr:a(377),it:a(378),es:a(379),pl:a(380),"zh-cn":a(381)},t.call(this,e,r)}return Object(g.a)(n,[{key:"onConnectionReady",value:function(){var e=this,t={};this.socket.getSystemConfig().then((function(a){return t.systemConfig=a,e.readConfig()})).then((function(t){console.log(t),e.setState({config:t,ready:!0}),t.language!==S.a.getLanguage()&&t.language&&S.a.setLanguage(t.language)})).catch((function(t){return e.showError(t)}))}},{key:"readConfig",value:function(){return this.socket.getObject("system.adapter."+this.adapterName+"."+this.instance).then((function(e){var t=e.native||{};return t.rules=t.rules||[],t.sayitInstance=t.sayitInstance||"",t.language=t.language||"",t.processorId=t.processorId||"",t.processorTimeout=t.processorTimeout||1e3,t}))}},{key:"saveConfig",value:function(e){var t=this;return this.socket.getObject("system.adapter."+this.adapterName+"."+this.instance).then((function(a){if(!it()(a.native,e))return a.native=e,t.socket.setObject("system.adapter."+t.adapterName+"."+t.instance,a)}))}},{key:"render",value:function(){return this.state.config&&this.state.ready?Object(_e.jsx)(c.a,{theme:this.state.theme,children:Object(_e.jsxs)("div",{className:"App",children:[Object(_e.jsx)(jt,{themeType:this.state.themeType,theme:this.state.theme,socket:this.socket,instance:this.instance,readConfig:this.readConfig.bind(this),saveConfig:this.saveConfig.bind(this)}),this.renderError()]})}):Object(_e.jsx)(c.a,{theme:this.state.theme,children:Object(_e.jsx)(j.a,{theme:this.state.themeType})})}}]),n}(x.a),St=Object(v.a)((function(e){return{root:{},logo:{width:32,height:32,padding:e.spacing(1),display:"inline-block"}}}))(Ot),wt=a(195),xt=a(189),yt=a.n(xt),Ct=a(83),Rt=a.n(Ct);window.adapterName="text2command";var kt=Rt.a.getThemeName();console.log("iobroker."+window.adapterName+"@"+wt.a+' using theme "'+kt+'"'),"localhost:3000"!==window.location.host&&o.e({dsn:"https://9806f910556240219f831ecfe2ee3ad1@sentry.iobroker.net/87",release:"iobroker."+window.adapterName+"@"+wt.a,integrations:[new l.a]}),function e(){return i.a.render(Object(_e.jsx)(c.a,{theme:yt()(kt),children:Object(_e.jsx)(St,{onThemeChange:function(t){kt=t,e()}})}),document.getElementById("root"))}(),function(e){if("serviceWorker"in navigator){if(new URL(".",window.location.href).origin!==window.location.origin)return;window.addEventListener("load",(function(){var t="".concat(".","/service-worker.js");u?(!function(e,t){fetch(e).then((function(a){var n=a.headers.get("content-type");404===a.status||null!=n&&-1===n.indexOf("javascript")?navigator.serviceWorker.ready.then((function(e){e.unregister().then((function(){window.location.reload()}))})):d(e,t)})).catch((function(){console.log("No internet connection found. App is running in offline mode.")}))}(t,e),navigator.serviceWorker.ready.then((function(){console.log("This web app is being served cache-first by a service worker. To learn more, visit http://bit.ly/CRA-PWA")}))):d(t,e)}))}}()}},[[382,1,2]]]);
  //# sourceMappingURL=main.084c10d2.chunk.js.map