diff --git a/README.md b/README.md index a30837d3..af690f6d 100644 --- a/README.md +++ b/README.md @@ -145,11 +145,11 @@ __Workdays__ perform action only on Monday thru Friday. If you have the [workday integration](https://www.home-assistant.io/integrations/workday/) installed, you can use it to define your own set of workdays. The workday integration and its settings will be automatically detected if it is installed. -Note that if you define holidays, they will be excluded from workdays. +Note that if you define holDays, they will be excluded from workdays. __Weekend__ perform action only on Saturday and Sunday. -If you have the workday integration installed, the weekend will be considered as the inverse as workdays. This means that holidays and your 'fixed day off' are included in the weekend setting. +If you have the workday integration installed, the weekend will be considered as the inverse as workdays. This means that holDays and your 'fixed day off' are included in the weekend setting. __Custom__ @@ -520,21 +520,22 @@ The card is available in multiple languages. The card will automatically detect Currently the following languages are supported: -| Language | Code(s) | Available from | Status / Remarks | -| ----------- | ---------- | -------------- | -------------------------------------------------------------------------------------- | -| Deutsch | de | v1.2.3 | | -| **English** | en | v1.0.0 | Default language. | -| Eesti | et | v1.4.0 | | -| Español | es, es_419 | v1.2.8 | | -| Français | fr | v1.2.3 | | -| Italiano | it | v1.7.5 | | -| Magyar | hu | v1.3.0 | | -| Polski | pl | v1.2.6 | | -| Português | pt, pt-br | v1.3.0 | Translation is brazilian Portuguese, improvements may be needed for native Portuguese. | -| Русский | ru | v1.2.8 | | -| Română | ro | v1.7.3 | | -| Nederlands | nl | v1.2.2 | | -| Norsk | no, nb, nn | v1.2.8 | | +| Language | Code(s) | Available from | Status / Remarks | +| ----------- | ---------- | -------------- | ----------------- | +| Čeština | cs | v1.8.0 | | +| Deutsch | de | v1.2.3 | | +| **English** | en | v1.0.0 | Default language. | +| Eesti | et | v1.4.0 | | +| Español | es, es_419 | v1.2.8 | | +| Français | fr | v1.2.3 | Needs updating. | +| Italiano | it | v1.7.5 | | +| Magyar | hu | v1.3.0 | | +| Polski | pl | v1.2.6 | | +| Português | pt, pt-br | v1.3.0 | Needs updating. | +| Русский | ru | v1.2.8 | Needs updating. | +| Română | ro | v1.7.3 | | +| Nederlands | nl | v1.2.2 | | +| Norsk | no, nb, nn | v1.2.8 | Needs updating. | diff --git a/dist/scheduler-card.js b/dist/scheduler-card.js index 673c6214..3191e245 100644 --- a/dist/scheduler-card.js +++ b/dist/scheduler-card.js @@ -79,7 +79,7 @@ class _{constructor(e,t,r){this.__parts=[],this.template=e,this.processor=t,this * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */const P=e=>null===e||!("object"==typeof e||"function"==typeof e),S=e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]);class k{constructor(e,t,r){this.dirty=!0,this.element=e,this.name=t,this.strings=r,this.parts=[];for(let e=0;e{try{const e={get capture(){return D=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}})();class A{constructor(e,t,r){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=r,this.__boundHandleEvent=e=>this.handleEvent(e)}setValue(e){this.__pendingValue=e}commit(){for(;f(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=g,e(this)}if(this.__pendingValue===g)return;const e=this.__pendingValue,t=this.value,r=null==e||null!=t&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),i=null!=e&&(null==t||r);r&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),i&&(this.__options=z(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=g}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const z=e=>e&&(D?{capture:e.capture,passive:e.passive,once:e.once}:e.capture) + */const P=e=>null===e||!("object"==typeof e||"function"==typeof e),S=e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]);class k{constructor(e,t,r){this.dirty=!0,this.element=e,this.name=t,this.strings=r,this.parts=[];for(let e=0;e{try{const e={get capture(){return D=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}})();class z{constructor(e,t,r){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=r,this.__boundHandleEvent=e=>this.handleEvent(e)}setValue(e){this.__pendingValue=e}commit(){for(;f(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=g,e(this)}if(this.__pendingValue===g)return;const e=this.__pendingValue,t=this.value,r=null==e||null!=t&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),i=null!=e&&(null==t||r);r&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),i&&(this.__options=A(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=g}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const A=e=>e&&(D?{capture:e.capture,passive:e.passive,once:e.once}:e.capture) /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -119,7 +119,7 @@ class _{constructor(e,t,r){this.__parts=[],this.template=e,this.processor=t,this * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -class{handleAttributeExpressions(e,t,r,i){const s=t[0];if("."===s){return new j(e,t.slice(1),r).parts}if("@"===s)return[new A(e,t.slice(1),i.eventContext)];if("?"===s)return[new O(e,t.slice(1),r)];return new k(e,t,r).parts}handleTextExpression(e){return new $(e)}}; +class{handleAttributeExpressions(e,t,r,i){const s=t[0];if("."===s){return new j(e,t.slice(1),r).parts}if("@"===s)return[new z(e,t.slice(1),i.eventContext)];if("?"===s)return[new O(e,t.slice(1),r)];return new k(e,t,r).parts}handleTextExpression(e){return new $(e)}}; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -184,9 +184,9 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");const re={};class ie extends G{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const e=this.getStyles();if(Array.isArray(e)){const t=(e,r)=>e.reduceRight((e,r)=>Array.isArray(r)?t(r,e):(e.add(r),e),r),r=t(e,new Set),i=[];r.forEach(e=>i.unshift(e)),this._styles=i}else this._styles=void 0===e?[]:[e];this._styles=this._styles.map(e=>{if(e instanceof CSSStyleSheet&&!Z){const t=Array.prototype.slice.call(e.cssRules).reduce((e,t)=>e+t.cssText,"");return new ee(String(t),X)}return e})}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?Z?this.renderRoot.adoptedStyleSheets=e.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map(e=>e.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(e){const t=this.render();super.update(e),t!==re&&this.constructor.render(t,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(e=>{const t=document.createElement("style");t.textContent=e.cssText,this.renderRoot.appendChild(t)}))}render(){return re}}ie.finalized=!0,ie.render=(e,t,r)=>{if(!r||"object"!=typeof r||!r.scopeName)throw new Error("The `scopeName` option is required.");const s=r.scopeName,a=R.has(t),n=L&&11===t.nodeType&&!!t.host,o=n&&!q.has(s),c=o?document.createDocumentFragment():t;if(((e,t,r)=>{let s=R.get(t);void 0===s&&(i(t,t.firstChild),R.set(t,s=new $(Object.assign({templateFactory:T},r))),s.appendInto(t)),s.setValue(e),s.commit()})(e,c,Object.assign({templateFactory:V(s)},r)),o){const e=R.get(c);R.delete(c);const r=e.value instanceof _?e.value.template:void 0;H(s,c,r),i(t,t.firstChild),t.appendChild(c),R.set(t,e)}!a&&n&&window.ShadyCSS.styleElement(t.host)};var se=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,ae="[^\\s]+",ne=/\[([^]*?)\]/gm;function oe(e,t){for(var r=[],i=0,s=e.length;i-1?i:null}};function le(e){for(var t=[],r=1;r3?0:(e-e%10!=10?1:0)*e%10]}},me=le({},pe),ve=function(e,t){for(void 0===t&&(t=2),e=String(e);e.length0?"-":"+")+ve(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4)},Z:function(e){var t=e.getTimezoneOffset();return(t>0?"-":"+")+ve(Math.floor(Math.abs(t)/60),2)+":"+ve(Math.abs(t)%60,2)}},ge=function(e){return+e-1},ye=[null,"[1-9]\\d?"],_e=[null,ae],be=["isPm",ae,function(e,t){var r=e.toLowerCase();return r===t.amPm[0]?0:r===t.amPm[1]?1:null}],we=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(e){var t=(e+"").match(/([+-]|\d\d)/gi);if(t){var r=60*+t[1]+parseInt(t[2],10);return"+"===t[0]?r:-r}return 0}],Ee=(ce("monthNamesShort"),ce("monthNames"),{default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"});var Pe=function(e,t,r){if(void 0===t&&(t=Ee.default),void 0===r&&(r={}),"number"==typeof e&&(e=new Date(e)),"[object Date]"!==Object.prototype.toString.call(e)||isNaN(e.getTime()))throw new Error("Invalid Date pass to format");var i=[];t=(t=Ee[t]||t).replace(ne,(function(e,t){return i.push(t),"@@@"}));var s=le(le({},me),r);return(t=t.replace(se,(function(t){return fe[t](e,s)}))).replace(/@@@/g,(function(){return i.shift()}))};(function(){try{(new Date).toLocaleDateString("i")}catch(e){return"RangeError"===e.name}})(),function(){try{(new Date).toLocaleString("i")}catch(e){return"RangeError"===e.name}}(),function(){try{(new Date).toLocaleTimeString("i")}catch(e){return"RangeError"===e.name}}();function Se(e){return e.substr(0,e.indexOf("."))}function ke(e){return e.substr(e.indexOf(".")+1)}var xe,$e,Oe,je=function(e,t,r,i){i=i||{},r=null==r?{}:r;var s=new Event(t,{bubbles:void 0===i.bubbles||i.bubbles,cancelable:Boolean(i.cancelable),composed:void 0===i.composed||i.composed});return s.detail=r,e.dispatchEvent(s),s};!function(e){e.Level="LEVEL",e.List="LIST"}(xe||(xe={})),function(e){e.Equal="is",e.Unequal="not",e.Below="below",e.Above="above"}($e||($e={})),function(e){e.Any="or",e.All="and"}(Oe||(Oe={}));var Ce={add:"hinzufügen",cancel:"abbrechen",next:"weiter",save:"speichern",delete:"löschen"},De={no_group_selected:"Wähle zuerst eine Gruppe aus",no_entity_selected:"Wähle zuerst eine Entity aus",no_groups_defined:"Es gibt keine Gruppe",no_entities_for_group:"Es gibt keine Entities in dieser Gruppe",no_actions_for_entity:"Es gibt keine Aktionen für diese Entity",no_entries_defined:"Es gibt keine Einträge"},Ae={group:"Gruppe",entity:"Entity",action:"Aktion",days:"Tage",time:"Zeit",options:"Optionen",day_type_daily:"jeden Tag",day_type_workday:"Werktags",day_type_weekend:"Wochenende",day_type_custom:"benutzerdefiniert"},ze={mon:"Mo",tue:"Di",wed:"Mi",thu:"Do",fri:"Fr",sat:"Sa",sun:"So"},Te={mon:"Montag",tue:"Dienstag",wed:"Mittwoch",thu:"Donnerstag",fri:"Freitag",sat:"Samstag",sun:"Sonntag"},Ne={and:"und",before:"vor",after:"nach"},Re={turn_on:"anschalten",turn_on_brightness:"anschalten {auf brightness}",turn_off:"ausschalten",close_cover:"schließen",open_cover:"öffnen",set_temperature:"Temperatur einstellen {auf temperature}",set_temperature_hvac_mode_heat:"aufwärmen {auf temperature}",set_temperature_hvac_mode_cool:"kühlen {auf temperature}",set_cover_position:"Position setzen {nach position}",set_hvac_mode:"Modus setzen {zu hvac_mode}",set_hvac_mode_hvac_mode_off:"ausschalten",set_preset_mode:"Voreinstellung setzen {zu preset_mode}",set_value:"Wert setzen {zu value}",select_option:"Option {option} auswählen",select_source:"Quelle {source} auswählen",start:"start",run_script:"ausführen"},Fe={brightness:"Helligkeit",temperature:"Temperatur",position:"Position",hvac_mode:"Modus",preset_mode:"Voreinstellung"},Ie={camera:"Kameras",climate:"Heizung",cover:"Beschattung",fan:"Lüfter",group:"Gruppen",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"Licht",media_player:"Media Player",scene:"Szene",switch:"Schalter",vacuum:"Staubsauger"},Me={tomorrow:"morgen",daily:"täglich",daily_except_days:"täglich außer {days}",working_days:"Werktags",weekend:"Wochenende",interval:"{startDay} bis {endDay}"},Le={absolute:"um {time}",relative:"in {time}",interval:"von {startTime} bis {endTime}",seconds:"{seconds} Sekunden",hour:"1 Stunde",hours:"{hours} Stunden",minute:"1 Minute",minutes:"{minutes} Minuten",now:"jetzt",midnight:"Mitternacht",noon:"Mittag",at_sun_event:"am {sunEvent}",sun_event_sunrise:"Sonnenaufgang",sun_event_sunset:"Sonnenuntergang"},Ve={one_additional_task:"1 weitere Aufgabe",x_additional_tasks:"{count} weitere Aufgaben"},Ue={scheduler:"Zeitplaner",actions:Ce,instructions:De,fields:Ae,days_short:ze,days_long:Te,words:Ne,services:Re,service_parameters:Fe,domains:Ie,days:Me,time:Le,misc:Ve},qe=Object.freeze({__proto__:null,scheduler:"Zeitplaner",actions:Ce,instructions:De,fields:Ae,days_short:ze,days_long:Te,words:Ne,services:Re,service_parameters:Fe,domains:Ie,days:Me,time:Le,misc:Ve,default:Ue}),He={add:"add item",cancel:"cancel",next:"next",save:"save",delete:"delete"},Qe={no_group_selected:"Select a group first",no_entity_selected:"Select an entity first",no_groups_defined:"There are no groups defined",no_entities_for_group:"There are no entities in this group",no_actions_for_entity:"There are no actions for this entity",no_entries_defined:"There are no items to show"},Be={group:"Group",entity:"Entity",action:"Action",days:"Days",time:"Time",options:"Options",day_type_daily:"daily",day_type_workday:"workdays",day_type_weekend:"weekend",day_type_custom:"custom"},Ke={mon:"mon",tue:"tue",wed:"wed",thu:"thu",fri:"fri",sat:"sat",sun:"sun"},Ge={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},We={and:"and",before:"before",after:"after"},Ye={turn_on:"turn on",turn_on_brightness:"turn on {at brightness}",turn_off:"turn off",close_cover:"close",open_cover:"open",set_temperature:"set temperature {to temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_to:"set to",set_cover_position:"set position {to position}",set_hvac_mode:"set mode {to hvac_mode}",set_hvac_mode_hvac_mode_off:"turn off",set_preset_mode:"set preset {to preset_mode}",set_value:"set value {to value}",select_option:"select option {option}",select_source:"select source {source}",start:"start",run_script:"run"},Je={brightness:"brightness",temperature:"temperature",position:"position",hvac_mode:"mode",preset_mode:"preset"},Ze={camera:"cameras",climate:"climate",cover:"covers",fan:"fans",group:"groups",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"lights",media_player:"media players",scene:"scenes",switch:"switches",vacuum:"vacuum"},Xe={tomorrow:"tomorrow",daily:"daily",daily_except_days:"every day except {days}",working_days:"working days",weekend:"weekend",interval:"{startDay} to {endDay}"},et={absolute:"at {time}",relative:"in {time}",interval:"from {startTime} to {endTime}",seconds:"{seconds} seconds",hour:"1 hour",hours:"{hours} hours",minute:"1 minute",minutes:"{minutes} minutes",now:"now",midnight:"midnight",noon:"noon",at_sun_event:"at {sunEvent}",sun_event_sunrise:"sunrise",sun_event_sunset:"sunset"},tt={one_additional_task:"1 more task",x_additional_tasks:"{count} more tasks"},rt={scheduler:"Scheduler",actions:He,instructions:Qe,fields:Be,days_short:Ke,days_long:Ge,words:We,services:Ye,service_parameters:Je,domains:Ze,days:Xe,time:et,misc:tt},it=Object.freeze({__proto__:null,scheduler:"Scheduler",actions:He,instructions:Qe,fields:Be,days_short:Ke,days_long:Ge,words:We,services:Ye,service_parameters:Je,domains:Ze,days:Xe,time:et,misc:tt,default:rt}),st={add:"Agregar",cancel:"cancelar",next:"siguiente",save:"guardar",delete:"borrar"},at={no_group_selected:"Selecciona un grupo primero",no_entity_selected:"Selecciona una entidad primero",no_groups_defined:"No hay grupos definidos",no_entities_for_group:"No hay entidades en este grupo",no_actions_for_entity:"No hay acciones para esta entidad",no_entries_defined:"No hay dispositivos definidos"},nt={group:"Grupo",entity:"Entidad",action:"Acción",days:"Días",time:"Hora",options:"Opciones",day_type_daily:"cada día",day_type_weekdays:"dias semanales",day_type_weekend:"fin de semana",day_type_custom:"personalizado"},ot={mon:"lun",tue:"mar",wed:"mie",thu:"jue",fri:"vie",sat:"sab",sun:"dom"},ct={mon:"lunes",tue:"martes",wed:"miércoles",thu:"jueves",fri:"viernes",sat:"sábado",sun:"domingo"},lt={and:"y",before:"antes",after:"después"},dt={turn_on:"encender",turn_on_brightness:"encender {a brightness}",turn_off:"apagar",close_cover:"cerrar",open_cover:"abrir",set_temperature:"establecer temperatura {a temperature}",set_temperature_hvac_mode_heat:"calentar {a temperature}",set_temperature_hvac_mode_cool:"enfriar {a temperature}",set_cover_position:"establecer posición {a position}",set_hvac_mode:"establecer modo {a hvac_mode}",set_hvac_mode_hvac_mode_off:"apagar",set_preset_mode:"establecer modo {a preset_mode}",set_value:"establecer valor {value}",select_option:"seleccionar opción {option}",select_source:"seleccionar fuente {source}",start:"empezar",run_script:"ejecutar"},ut={brightness:"brillo",temperature:"temperatura",position:"posición",hvac_mode:"modo",preset_mode:"pre-ajuste"},ht={camera:"cámaras",climate:"climatización",cover:"persiana",fan:"ventilador",group:"grupo",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"luces",media_player:"reproductor multimedia",scene:"escena",switch:"interruptor",vacuum:"aspirador"},pt={tomorrow:"mañana",daily:"a diario",daily_except_days:"todos los dias excepto {days}",working_days:"días hábiles",weekend:"fin de semana",interval:"{startDay} a {endDay}"},mt={absolute:"a las {time}",relative:"en {time}",interval:"desde las {startTime} a las {endTime}",seconds:"{seconds} segundos",hour:"1 hora",hours:"{hours} horas",minute:"1 minuto",minutes:"{minutes} minutos",now:"ahora",midnight:"medianoche",noon:"mediodía",at_sun_event:"al {sunEvent}",sun_event_sunrise:"amanecer",sun_event_sunset:"atardecer"},vt={one_additional_task:"1 tarea más",x_additional_tasks:"{count} tareas más"},ft={scheduler:"Programador",actions:st,instructions:at,fields:nt,days_short:ot,days_long:ct,words:lt,services:dt,service_parameters:ut,domains:ht,days:pt,time:mt,misc:vt},gt=Object.freeze({__proto__:null,scheduler:"Programador",actions:st,instructions:at,fields:nt,days_short:ot,days_long:ct,words:lt,services:dt,service_parameters:ut,domains:ht,days:pt,time:mt,misc:vt,default:ft}),yt={add:"lisa",cancel:"loobu",next:"edasi",save:"salvesta",delete:"kustuta"},_t={no_group_selected:"Vali grupp",no_entity_selected:"Vali olem",no_groups_defined:"Gruppe pole määratud",no_entities_for_group:"Antud grupis puuduvad olemid",no_actions_for_entity:"Selles olemis puuduvad tegevused",no_entries_defined:"Pole midagi kuvada"},bt={group:"Grupp",entity:"Olem",action:"Tegevus",days:"Päevad",time:"Aeg",options:"Suvandid",day_type_daily:"iga päev",day_type_weekdays:"tööpäevadel",day_type_weekend:"nädalavahetus",day_type_custom:"valikuline"},wt={mon:"E",tue:"T",wed:"K",thu:"N",fri:"R",sat:"L",sun:"P"},Et={mon:"Esmaspäev",tue:"Teisipäev",wed:"Kolmapäev",thu:"Neljapäev",fri:"Reede",sat:"Laupäev",sun:"Pühapäev"},Pt={and:"ja",before:"enne",after:"pärast"},St={turn_on:"lülita sisse",turn_on_brightness:"turn on {at brightness}",turn_off:"lülita välja",close_cover:"sulge",open_cover:"ava",set_temperature:"määra temperatuur {to temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"seadista asendisse {to position}",set_hvac_mode:"vali töörežiim {to hvac_mode}",set_hvac_mode_hvac_mode_off:"turn off",set_preset_mode:"eelseadistatud {to preset_mode}",set_value:"määra väärtus {value}",select_option:"valikud {option}",select_source:"vali allikas {source}",start:"alusta",run_script:"alusta"},kt={brightness:"heledus",temperature:"temperatuur",position:"asend",hvac_mode:"töörežiim",preset_mode:"eelseadistus"},xt={camera:"kaamerad",climate:"kliimaseade",cover:"(akna)katted",fan:"ventilaatorid",group:"grupid",input_boolean:"binaarsisestus",input_number:"arvsisestus",input_select:"sisendivalik",light:"valgustid",media_player:"media players",scene:"stseenid",switch:"lülitid",vacuum:"tolmuimejad"},$t={tomorrow:"homme",daily:"iga päev",daily_except_days:"iga päev välja arvatud {days}",working_days:"tööpäevadel",weekend:"nädalavahetusel",interval:"{startDay} kuni {endDay}"},Ot={absolute:"kell {time}",relative:"{time} pärast",interval:"alates {startTime} kuni {endTime}",seconds:"{seconds} sekundit",hour:"1 tund",hours:"{hours} tundi",minute:"1 minut",minutes:"{minutes} minutit",now:"kohe",midnight:"keskööl",noon:"keskpäeval",at_sun_event:"{sunEvent}",sun_event_sunrise:"päikesetõusu",sun_event_sunset:"loojangut"},jt={one_additional_task:"veel 1 ajastus",x_additional_tasks:"{count} ajastust"},Ct={scheduler:"Ajastaja",actions:yt,instructions:_t,fields:bt,days_short:wt,days_long:Et,words:Pt,services:St,service_parameters:kt,domains:xt,days:$t,time:Ot,misc:jt},Dt=Object.freeze({__proto__:null,scheduler:"Ajastaja",actions:yt,instructions:_t,fields:bt,days_short:wt,days_long:Et,words:Pt,services:St,service_parameters:kt,domains:xt,days:$t,time:Ot,misc:jt,default:Ct}),At={add:"ajouter un item",cancel:"annuler",next:"suivant",save:"sauvegarder",delete:"effacer"},zt={no_group_selected:"Sélectionner un groupe en premier",no_entity_selected:"Sélectionner une entité en premier",no_groups_defined:"Il n'y a pas de groupe défini",no_entities_for_group:"Il n'y a pas d'entité dans ce groupe",no_actions_for_entity:"Il n'y a pas d'action pour cette entité",no_entries_defined:"Il n'y a pas d'item à afficher"},Tt={group:"Groupe",entity:"Entité",action:"Action",days:"Jours",time:"Temps",options:"Options",day_type_daily:"chaque jour",day_type_weekdays:"en semaine",day_type_weekend:"weekend",day_type_custom:"sur mesure"},Nt={mon:"lun",tue:"mar",wed:"mer",thu:"jeu",fri:"ven",sat:"sam",sun:"dim"},Rt={mon:"lundi",tue:"mardi",wed:"mercredi",thu:"jeudi",fri:"vendredi",sat:"samedi",sun:"dimanche"},Ft={and:"et",before:"avant",after:"après"},It={turn_on:"allumer",turn_on_brightness:"allumer {à brightness}",turn_off:"éteindre",close_cover:"fermer",open_cover:"ouvrir",set_temperature:"régler la température {à temperature}",set_temperature_hvac_mode_heat:"heat {à temperature}",set_temperature_hvac_mode_cool:"cool {à temperature}",set_cover_position:"position définie {à position}",set_hvac_mode:"set mode {to hvac_mode}",set_hvac_mode_hvac_mode_off:"turn off",set_preset_mode:"set preset {to preset_mode}",set_value:"set value {to value}",select_option:"select option {option}",select_source:"select source {source}",start:"start",run_script:"run"},Mt={brightness:"brightness",temperature:"temperature",position:"position",hvac_mode:"mode",preset_mode:"preset"},Lt={camera:"cameras",climate:"climat",cover:"contrôleur",fan:"ventilateur",group:"groups",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"lumière",media_player:"media players",scene:"scenes",switch:"interrupteurs",vacuum:"aspirateur"},Vt={tomorrow:"tomorrow",daily:"daily",daily_except_days:"every day except {days}",working_days:"working days",weekend:"weekend",interval:"{startDay} to {endDay}"},Ut={absolute:"at {time}",relative:"in {time}",interval:"from {startTime} to {endTime}",seconds:"{seconds} seconds",hour:"1 hour",hours:"{hours} hours",minute:"1 minute",minutes:"{minutes} minutes",now:"now",midnight:"midnight",noon:"noon",at_sun_event:"at {sunEvent}",sun_event_sunrise:"sunrise",sun_event_sunset:"sunset"},qt={one_additional_task:"1 more task",x_additional_tasks:"{count} more tasks"},Ht={scheduler:"Planificateur",actions:At,instructions:zt,fields:Tt,days_short:Nt,days_long:Rt,words:Ft,services:It,service_parameters:Mt,domains:Lt,days:Vt,time:Ut,misc:qt},Qt=Object.freeze({__proto__:null,scheduler:"Planificateur",actions:At,instructions:zt,fields:Tt,days_short:Nt,days_long:Rt,words:Ft,services:It,service_parameters:Mt,domains:Lt,days:Vt,time:Ut,misc:qt,default:Ht}),Bt={add:"új időzítés",cancel:"mégse",next:"tovább",save:"mentés",delete:"törlés"},Kt={no_group_selected:"Előbb egy csoportot szükséges választani",no_entity_selected:"Előbb egy entitást szükséges választani",no_groups_defined:"Nincsenek deffiniált csoportok",no_entities_for_group:"Ebben a csoportban nem találhatók entitások",no_actions_for_entity:"Ehhez az entitáshoz nem tartoznak műveletek",no_entries_defined:"Nincs megjeleníthető elem"},Gt={group:"Csoport",entity:"Entitás",action:"Művelet",days:"Napokon",time:"Időpontban",options:"Opciók",day_type_daily:"minden nap",day_type_workday:"munkanapokon",day_type_weekend:"hétvégén",day_type_custom:"egyedi"},Wt={mon:"hét",tue:"ked",wed:"sze",thu:"csü",fri:"pén",sat:"szo",sun:"vas"},Yt={mon:"hétfő",tue:"kedd",wed:"szerda",thu:"csütörtök",fri:"péntek",sat:"szombat",sun:"vasárnap"},Jt={and:"és",before:"előtt",after:"után"},Zt={turn_on:"bekapcsolás",turn_on_brightness:"bekapcsolás {at brightness}",turn_off:"kikapcsolás",close_cover:"zárás",open_cover:"nyitás",set_temperature:"hőmérséklet {to temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"változtass pozíciót {to position}",set_hvac_mode:"mód beállítása {to hvac_mode}",set_hvac_mode_hvac_mode_off:"kikapcsolás",set_preset_mode:"preset beállítása {to preset_mode}",set_value:"érték beállítása {value}",select_option:"opció kiválasztása {option}",select_source:"forrás kiválasztása {source}",start:"kezdés",run_script:"kezdés"},Xt={brightness:"világosság",temperature:"hőmérséklet",position:"pozíció",hvac_mode:"mód",preset_mode:"preset"},er={camera:"kamera",climate:"termosztát",cover:"redőny",fan:"ventilátor",group:"csoportok",input_boolean:"logikai bemenet",input_number:"szám bemenet",input_select:"legördülő bemenet",light:"lámpa",media_player:"lejátszó",scene:"jelenetek",switch:"kapcsoló",vacuum:"pórszívó"},tr={tomorrow:"holnap",daily:"minden nap",daily_except_days:"minden nap, kivéve {days}",working_days:"munkanapokon",weekend:"hétvégén",interval:"{startDay} - {endDay}"},rr={absolute:"{time}-kor",relative:"{time} múlva",interval:"{startTime} - {endTime}",seconds:"{seconds} másodperc",hour:"1 óra",hours:"{hours} óra",minute:"1 perc",minutes:"{minutes} perc",now:"most",midnight:"éjfél",noon:"dél",at_sun_event:"{sunEvent}kor",sun_event_sunrise:"napfelkelte",sun_event_sunset:"napnyugta"},ir={one_additional_task:"még egy feladat",x_additional_tasks:"még {count} feladat"},sr={scheduler:"Időzítések",actions:Bt,instructions:Kt,fields:Gt,days_short:Wt,days_long:Yt,words:Jt,services:Zt,service_parameters:Xt,domains:er,days:tr,time:rr,misc:ir},ar=Object.freeze({__proto__:null,scheduler:"Időzítések",actions:Bt,instructions:Kt,fields:Gt,days_short:Wt,days_long:Yt,words:Jt,services:Zt,service_parameters:Xt,domains:er,days:tr,time:rr,misc:ir,default:sr}),nr={add:"aggiungi oggetto",cancel:"annulla",next:"avanti",save:"salva",delete:"cancella"},or={no_group_selected:"Seleziona prima un gruppo",no_entity_selected:"Seleziona prima un'entità",no_groups_defined:"Non ci sono gruppi definiti",no_entities_for_group:"Non ci sono entità in questo gruppo",no_actions_for_entity:"Non ci sono azioni per questa entità",no_entries_defined:"Non ci sono oggetti da visualizzare"},cr={group:"Gruppo",entity:"Entità",action:"Azione",days:"Giorni",time:"Ora",options:"Opzioni",day_type_daily:"giornaliero",day_type_workday:"giorni lavorativi",day_type_weekend:"weekend",day_type_custom:"personalizzato"},lr={mon:"lun",tue:"mar",wed:"mer",thu:"gio",fri:"ven",sat:"sab",sun:"dom"},dr={mon:"Lunedì",tue:"Martedì",wed:"Mercoledì",thu:"Giovedì",fri:"Venerdì",sat:"Sabato",sun:"Domenica"},ur={and:"e",before:"prima",after:"dopo"},hr={turn_on:"accendi",turn_on_brightness:"accendi {at brightness}",turn_off:"spegni",close_cover:"chiudi",open_cover:"apri",set_temperature:"imposta temperatura {to temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"imposta posizione {to position}",set_hvac_mode:"imposta modalità {to hvac_mode}",set_hvac_mode_hvac_mode_off:"spegni",set_preset_mode:"imposta programmazione {to preset_mode}",set_value:"imposta valore {value}",select_option:"seleziona opzione {option}",select_source:"seleziona sorgente {source}",start:"start",run_script:"run"},pr={brightness:"luminosità",temperature:"temperatura",position:"posizione",hvac_mode:"modalità",preset_mode:"programmazione"},mr={camera:"telecamere",climate:"clima",cover:"cover",fan:"ventole",group:"gruppi",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"luci",media_player:"media player",scene:"scene",switch:"interruttori",vacuum:"aspirapolveri"},vr={tomorrow:"domani",daily:"giornaliero",daily_except_days:"tutti i giorni eccetto {days}",working_days:"giorni lavorativi",weekend:"weekend",interval:"{startDay} a {endDay}"},fr={absolute:"alle {time}",relative:"entro {time}",interval:"dalle {startTime} alle {endTime}",seconds:"{seconds} second1",hour:"1 ora",hours:"{hours} ore",minute:"1 minuto",minutes:"{minutes} minuti",now:"ora",midnight:"mezzanotte",noon:"noon",at_sun_event:"all' {sunEvent}",sun_event_sunrise:"alba",sun_event_sunset:"tramonto"},gr={one_additional_task:"1 altro task",x_additional_tasks:"{count} altri task"},yr={scheduler:"Schedulatore",actions:nr,instructions:or,fields:cr,days_short:lr,days_long:dr,words:ur,services:hr,service_parameters:pr,domains:mr,days:vr,time:fr,misc:gr},_r=Object.freeze({__proto__:null,scheduler:"Schedulatore",actions:nr,instructions:or,fields:cr,days_short:lr,days_long:dr,words:ur,services:hr,service_parameters:pr,domains:mr,days:vr,time:fr,misc:gr,default:yr}),br={add:"Nieuw item",cancel:"annuleren",next:"verder",save:"opslaan",delete:"verwijder"},wr={no_group_selected:"Selecteer eerst een groep",no_entity_selected:"Selecteer eerst een entiteit",no_groups_defined:"Er zijn geen groepen gedefinieerd",no_entities_for_group:"Deze groep heeft geen entiteiten",no_actions_for_entity:"Deze entiteit heeft geen acties",no_entries_defined:"Er zijn geen items aangemaakt"},Er={group:"Groep",entity:"Entiteit",action:"Actie",days:"Dagen",time:"Tijdstip",options:"Opties",day_type_daily:"dagelijks",day_type_workday:"werkdagen",day_type_weekend:"weekend",day_type_custom:"anders"},Pr={mon:"ma",tue:"di",wed:"wo",thu:"do",fri:"vr",sat:"za",sun:"zo"},Sr={mon:"maandag",tue:"dinsdag",wed:"woensdag",thu:"donderdag",fri:"vrijdag",sat:"zaterdag",sun:"zondag"},kr={and:"en",before:"voor",after:"na"},xr={turn_on:"aanzetten",turn_on_brightness:"aanzetten {op brightness}",turn_off:"uitzetten",close_cover:"sluiten",open_cover:"openen",set_temperature:"temperatuur instellen {naar temperature}",set_temperature_hvac_mode_heat:"verwarmen {naar temperature}",set_temperature_hvac_mode_cool:"koelen {naar temperature}",set_cover_position:"positie instellen {naar position}",set_hvac_mode:"stand aanpassen {naar hvac_mode}",set_hvac_mode_hvac_mode_off:"uitzetten",set_preset_mode:"kies voorinstelling {preset_mode}",set_value:"waarde {value} instellen",select_option:"optie {option} selecteren",select_source:"ingang {source} selecteren",start:"starten",run_script:"uitvoeren"},$r={brightness:"helderheid",temperature:"temperatuur",position:"positie",hvac_mode:"stand",preset_mode:"voorinstelling"},Or={camera:"cameras",climate:"verwarming",cover:"zonwering",fan:"ventilatie",group:"groepen",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"verlichting",media_player:"mediaspelers",scene:"scènes",switch:"schakelaars",vacuum:"stofzuigers"},jr={tomorrow:"morgen",daily:"dagelijks",daily_except_days:"elke dag behalve {days}",working_days:"op werkdagen",weekend:"in het weekend",interval:"{startDay} t/m {endDay}"},Cr={absolute:"om {time}",relative:"over {time}",interval:"van {startTime} tot {endTime}",seconds:"{seconds} seconden",hour:"1 uur",hours:"{hours} uur",minute:"1 minuut",minutes:"{minutes} minuten",now:"nu",midnight:"middernacht",noon:"12 uur",at_sun_event:"bij {sunEvent}",sun_event_sunrise:"zonsopgang",sun_event_sunset:"zonsondergang"},Dr={one_additional_task:"1 overige taak",x_additional_tasks:"{count} overige taken"},Ar={scheduler:"Tijdplanner",actions:br,instructions:wr,fields:Er,days_short:Pr,days_long:Sr,words:kr,services:xr,service_parameters:$r,domains:Or,days:jr,time:Cr,misc:Dr},zr=Object.freeze({__proto__:null,scheduler:"Tijdplanner",actions:br,instructions:wr,fields:Er,days_short:Pr,days_long:Sr,words:kr,services:xr,service_parameters:$r,domains:Or,days:jr,time:Cr,misc:Dr,default:Ar}),Tr={add:"legg til",cancel:"avbryt",next:"neste",save:"lagre",delete:"slett"},Nr={no_group_selected:"Velg en gruppe først",no_entity_selected:"Velg en entitet først",no_groups_defined:"Ingen grupper definert",no_entities_for_group:"Det finnes ingen entiteter i denne gruppen",no_actions_for_entity:"Det finnes ingen handlinger for denne entiteten",no_entries_defined:"Det er ingen definerte tidsplaner å vise"},Rr={group:"Gruppe",entity:"Entitet",action:"Handling",days:"Dager",time:"Tid",options:"Valg",day_type_daily:"hver dag",day_type_weekdays:"ukedager",day_type_weekend:"weekend",day_type_custom:"egendefinert"},Fr={mon:"man",tue:"tir",wed:"ons",thu:"tor",fri:"fre",sat:"lør",sun:"søn"},Ir={mon:"mandag",tue:"tirsdag",wed:"onsdag",thu:"torsdag",fri:"fredag",sat:"lørdag",sun:"søndag"},Mr={and:"og",before:"før",after:"etter"},Lr={turn_on:"slå på",turn_on_brightness:"slå på {at brightness}",turn_off:"slå av",close_cover:"lukk",open_cover:"åpne",set_temperature:"sett temperatur {to temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"sett posisjon {to position}",set_hvac_mode:"set mode {to hvac_mode}",set_hvac_mode_hvac_mode_off:"slå av",set_preset_mode:"set preset {to preset_mode}",set_value:"set value {to value}",select_option:"select option {option}",select_source:"select source {source}",start:"start",run_script:"run"},Vr={brightness:"brightness",temperature:"temperature",position:"position",hvac_mode:"mode",preset_mode:"preset"},Ur={camera:"cameras",climate:"klima",cover:"cover",fan:"vifter",group:"groups",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",media_player:"media players",scene:"scenes",light:"lys",switch:"brytere",vacuum:"støvsugere"},qr={tomorrow:"tomorrow",daily:"daily",daily_except_days:"every day except {days}",working_days:"working days",weekend:"weekend",interval:"{startDay} to {endDay}"},Hr={absolute:"at {time}",relative:"in {time}",interval:"from {startTime} to {endTime}",seconds:"{seconds} seconds",hour:"1 hour",hours:"{hours} hours",minute:"1 minute",minutes:"{minutes} minutes",now:"now",midnight:"midnight",noon:"noon",at_sun_event:"at {sunEvent}",sun_event_sunrise:"sunrise",sun_event_sunset:"sunset"},Qr={one_additional_task:"1 more task",x_additional_tasks:"{count} more tasks"},Br={scheduler:"Tidsplan",actions:Tr,instructions:Nr,fields:Rr,days_short:Fr,days_long:Ir,words:Mr,services:Lr,service_parameters:Vr,domains:Ur,days:qr,time:Hr,misc:Qr},Kr=Object.freeze({__proto__:null,scheduler:"Tidsplan",actions:Tr,instructions:Nr,fields:Rr,days_short:Fr,days_long:Ir,words:Mr,services:Lr,service_parameters:Vr,domains:Ur,days:qr,time:Hr,misc:Qr,default:Br}),Gr={add:"dodaj",cancel:"anuluj",next:"dalej",save:"zapisz",delete:"usuń"},Wr={no_group_selected:"Najpierw wybierz grupę",no_entity_selected:"Najpierw wybierz encję",no_groups_defined:"Nie ma zdefiniowanych grup",no_entities_for_group:"Nie ma encji w tej grupie",no_actions_for_entity:"Nie ma akcji dla tej encji",no_entries_defined:"Nie ma elementów do pokazania"},Yr={group:"Grupa",entity:"Encja",action:"Akcja",days:"Dni",time:"Czas",options:"Opcje",day_type_daily:"codziennie",day_type_workday:"dni robocze",day_type_weekend:"weekend",day_type_custom:"niestandardowy"},Jr={mon:"pon.",tue:"wt.",wed:"śr.",thu:"czw.",fri:"pt.",sat:"sob.",sun:"niedz."},Zr={mon:"poniedziałek",tue:"wtorek",wed:"środa",thu:"czwartek",fri:"piątek",sat:"sobota",sun:"niedziela"},Xr={and:"oraz",before:"przed",after:"po"},ei={turn_on:"włącz",turn_on_brightness:"włącz {at brightness}",turn_off:"wyłącz",close_cover:"zamknij",open_cover:"otwórz",set_temperature:"ustaw temperaturę {to temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"ustaw pozycję {to position}",set_hvac_mode:"ustaw tryb {to hvac_mode}",set_hvac_mode_hvac_mode_off:"wyłącz",set_preset_mode:"ustaw preset {preset_mode}",set_value:"ustaw wartość {value}",select_option:"wybierz opcję {option}",select_source:"wybierz źródło {source}",start:"start",run_script:"start"},ti={brightness:"jasność",temperature:"temperatura",position:"pozycja",hvac_mode:"tryb",preset_mode:"preset"},ri={camera:"kamera",climate:"termostat",cover:"roleta",fan:"wentylator",group:"grupa",input_boolean:"wejście logiczne",input_number:"wejście liczbowe",input_select:"wybór wejścia",media_player:"odtwarzacz av",scene:"scena",light:"światło",switch:"włącznik",vacuum:"odkurzacz"},ii={tomorrow:"jutro",daily:"codziennie",daily_except_days:"codziennie za wyjątkiem {days}",working_days:"dni robocze",weekend:"weekend",interval:"{startDay} do {endDay}"},si={absolute:"o {time}",relative:"za {time}",interval:"od {startTime} do {endTime}",seconds:"{seconds} sekund(a/y)",hour:"1 godzina",hours:"{hours} godzin(y)",minute:"1 minuta",minutes:"{minutes} minut(y)",now:"teraz",midnight:"północ",noon:"południe",at_sun_event:"o {sunEvent}",sun_event_sunrise:"wschodzie",sun_event_sunset:"zachodzie"},ai={one_additional_task:"jeszcze 1 zadanie",x_additional_tasks:"{count} więcej zadań"},ni={scheduler:"Harmonogram",actions:Gr,instructions:Wr,fields:Yr,days_short:Jr,days_long:Zr,words:Xr,services:ei,service_parameters:ti,domains:ri,days:ii,time:si,misc:ai},oi=Object.freeze({__proto__:null,scheduler:"Harmonogram",actions:Gr,instructions:Wr,fields:Yr,days_short:Jr,days_long:Zr,words:Xr,services:ei,service_parameters:ti,domains:ri,days:ii,time:si,misc:ai,default:ni}),ci={add:"adicionar item",cancel:"cancelar",next:"próximo",save:"gravar",delete:"apagar"},li={no_group_selected:"Selecione um grupo primeiro",no_entity_selected:"Selecione uma entidade primeiro",no_groups_defined:"Não tem grupo definido",no_entities_for_group:"Não tem entidade no grupo",no_actions_for_entity:"Não há ações para esta entidade",no_entries_defined:"Não tem item pra mostar"},di={group:"Grupo",entity:"Entidade",action:"Ação",days:"Dias",time:"Hora",options:"Opções",day_type_daily:"todos os dias",day_type_weekdays:"dias da semana",day_type_weekend:"final da semana",day_type_custom:"personalizado"},ui={mon:"seg",tue:"ter",wed:"qua",thu:"qui",fri:"sex",sat:"sab",sun:"dom"},hi={mon:"segunda",tue:"terça",wed:"quarta",thu:"quinta",fri:"sexta",sat:"sabádo",sun:"domingo"},pi={and:"e",before:"antes",after:"depois"},mi={turn_on:"ligar",turn_on_brightness:"ligar {a brightness}",turn_off:"desligar",close_cover:"fechar",open_cover:"abrir",set_temperature:"ajustar temperatura {a temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"ajustar posição {a position}",set_hvac_mode:"set mode {to hvac_mode}",set_hvac_mode_hvac_mode_off:"turn off",set_preset_mode:"set preset {to preset_mode}",set_value:"set value {to value}",select_option:"select option {option}",select_source:"select source {source}",start:"start",run_script:"run"},vi={brightness:"Brilho",temperature:"Temperatura",position:"Posição",hvac_mode:"mode",preset_mode:"preset"},fi={camera:"cameras",climate:"ar condicionado",cover:"persiana",fan:"ventilador",group:"groups",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",media_player:"media players",scene:"scenes",light:"luz",switch:"interruptor",vacuum:"aspirador"},gi={tomorrow:"tomorrow",daily:"daily",daily_except_days:"every day except {days}",working_days:"working days",weekend:"weekend",interval:"{startDay} to {endDay}"},yi={absolute:"at {time}",relative:"in {time}",interval:"from {startTime} to {endTime}",seconds:"{seconds} seconds",hour:"1 hour",hours:"{hours} hours",minute:"1 minute",minutes:"{minutes} minutes",now:"now",midnight:"midnight",noon:"noon",at_sun_event:"at {sunEvent}",sun_event_sunrise:"sunrise",sun_event_sunset:"sunset"},_i={one_additional_task:"1 more task",x_additional_tasks:"{count} more tasks"},bi={scheduler:"Agenda",actions:ci,instructions:li,fields:di,days_short:ui,days_long:hi,words:pi,services:mi,service_parameters:vi,domains:fi,days:gi,time:yi,misc:_i},wi=Object.freeze({__proto__:null,scheduler:"Agenda",actions:ci,instructions:li,fields:di,days_short:ui,days_long:hi,words:pi,services:mi,service_parameters:vi,domains:fi,days:gi,time:yi,misc:_i,default:bi}),Ei={add:"adaugă element",cancel:"abandon",next:"următorul",save:"salvează",delete:"șterge"},Pi={no_group_selected:"Prima dată selectați un grup",no_entity_selected:"Prima dată selectați o entitate",no_groups_defined:"Nu există grupuri definite",no_entities_for_group:"Nu există entități definite în acest grup",no_actions_for_entity:"Nu există acțiuni pentru această entitate",no_entries_defined:"Nu există elemente de afișat"},Si={group:"Grup",entity:"Entitate",action:"Acțiune",days:"Zile",time:"Timp",options:"Opțiuni",day_type_daily:"zilnic",day_type_workday:"zile lucrătoare",day_type_weekend:"sfârșit de săptămână",day_type_custom:"personalizat"},ki={mon:"lun",tue:"mar",wed:"mie",thu:"joi",fri:"vin",sat:"sâm",sun:"dum"},xi={mon:"Luni",tue:"Marți",wed:"Miercuri",thu:"Joi",fri:"Vineri",sat:"Sâmbătă",sun:"Duminică"},$i={and:"și",before:"înainte",after:"după"},Oi={turn_on:"pornire",turn_on_brightness:"pornire {la brightness}",turn_off:"oprire",close_cover:"închidere",open_cover:"deschidere",set_temperature:"setare temperatură {la temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"setare poziție",set_hvac_mode:"setare mod {hvac_mode}",set_hvac_mode_hvac_mode_off:"oprire",set_preset_mode:"setare preset {preset_mode}",set_value:"setare valoare {value}",select_option:"selectare opțiune {option}",select_source:"selectare sursă {source}",start:"start",run_script:"run"},ji={brightness:"intensitate luminoasă",temperature:"temperatură",position:"poziție",hvac_mode:"mod",preset_mode:"preset"},Ci={camera:"camere",climate:"climat",cover:"jaluzele",fan:"ventilatoare",group:"grupuri",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"lumini",media_player:"media playere",scene:"scene",switch:"întrerupătpare",vacuum:"aspiratoare"},Di={tomorrow:"mâine",daily:"zilnic",daily_except_days:"zilnic cu excepția {days}",working_days:"zile lucrătoare",weekend:"sfârșit de săptămână",interval:"{startDay} până la {endDay}"},Ai={absolute:"la {time}",relative:"în {time}",interval:"de la {startTime} la {endTime}",seconds:"{seconds} secunde",hour:"1 oră",hours:"{hours} ore",minute:"1 minut",minutes:"{minutes} minute",now:"acum",midnight:"miezul nopții",noon:"amiază",at_sun_event:"la {sunEvent}",sun_event_sunrise:"răsărit",sun_event_sunset:"apus"},zi={one_additional_task:"încă o sarcină",x_additional_tasks:"încă {count} sarcini"},Ti={scheduler:"Planificator",actions:Ei,instructions:Pi,fields:Si,days_short:ki,days_long:xi,words:$i,services:Oi,service_parameters:ji,domains:Ci,days:Di,time:Ai,misc:zi},Ni={add:"добавить",cancel:"отменить",next:"далее",save:"сохранить",delete:"удалить"},Ri={no_group_selected:"Необходимо выбрать группу",no_entity_selected:"Необходимо выбрать объект",no_groups_defined:"Ни одной группы не создано",no_entities_for_group:"В этой группе нет объектов",no_actions_for_entity:"Для этого объекта нет действий",no_entries_defined:"Объекты отсутствуют"},Fi={group:"Группа",entity:"Объект",action:"Действие",days:"Дни",time:"Время",options:"Опции",day_type_daily:"ежедневно",day_type_weekdays:"по будням",day_type_weekend:"weekend",day_type_custom:"выбрать дни"},Ii={mon:"пн",tue:"вт",wed:"ср",thu:"чт",fri:"пт",sat:"сб",sun:"вс"},Mi={mon:"понедельник",tue:"вторник",wed:"среда",thu:"четверг",fri:"пятница",sat:"суббота",sun:"воскресенье"},Li={and:"и",before:"до",after:"после"},Vi={turn_on:"включить",turn_on_brightness:"включить {brightness}",turn_off:"выключить",close_cover:"закрыть",open_cover:"открыть",set_temperature:"задать температуру {temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"установить позицию {position}",set_hvac_mode:"установить режим {hvac_mode}",set_hvac_mode_hvac_mode_off:"выключить",set_preset_mode:"выбрать набор настроек {preset_mode}",set_value:"установить значение {value}",select_option:"выбрать вариант {option}",select_source:"выбрать источник {source}",start:"запуск",run_script:"run"},Ui={brightness:"Яркость",temperature:"Температура",position:"Позицию",hvac_mode:"mode",preset_mode:"preset"},qi={camera:"Камеры",climate:"Климат",cover:"Жалюзи",fan:"Вентиляторы",group:"Группы",input_boolean:"Переключатели",input_number:"Числа",input_select:"Списки",media_player:"Медиаплееры",scene:"Сцены",light:"Освещение",switch:"Выключатели",vacuum:"Пылесосы"},Hi={tomorrow:"tomorrow",daily:"daily",daily_except_days:"every day except {days}",working_days:"working days",weekend:"weekend",interval:"{startDay} to {endDay}"},Qi={absolute:"at {time}",relative:"in {time}",interval:"from {startTime} to {endTime}",seconds:"{seconds} seconds",hour:"1 hour",hours:"{hours} hours",minute:"1 minute",minutes:"{minutes} minutes",now:"now",midnight:"midnight",noon:"noon",at_sun_event:"at {sunEvent}",sun_event_sunrise:"sunrise",sun_event_sunset:"sunset"},Bi={one_additional_task:"1 more task",x_additional_tasks:"{count} more tasks"},Ki={scheduler:"Планирование",actions:Ni,instructions:Ri,fields:Fi,days_short:Ii,days_long:Mi,words:Li,services:Vi,service_parameters:Ui,domains:qi,days:Hi,time:Qi,misc:Bi},Gi={de:qe,en:it,es:gt,et:Dt,es_419:gt,fr:Qt,hu:ar,it:_r,nb:Kr,nl:zr,nn:Kr,no:Kr,pl:oi,pt:wi,pt_BR:wi,ro:Object.freeze({__proto__:null,scheduler:"Planificator",actions:Ei,instructions:Pi,fields:Si,days_short:ki,days_long:xi,words:$i,services:Oi,service_parameters:ji,domains:Ci,days:Di,time:Ai,misc:zi,default:Ti}),ru:Object.freeze({__proto__:null,scheduler:"Планирование",actions:Ni,instructions:Ri,fields:Fi,days_short:Ii,days_long:Mi,words:Li,services:Vi,service_parameters:Ui,domains:qi,days:Hi,time:Qi,misc:Bi,default:Ki})};function Wi(e,t="",r=""){const i=Yi();var s;try{if("test"==i)return"TRANSLATED";s=e.split(".").reduce((e,t)=>e[t],Gi[i])}catch(t){s=e.split(".").reduce((e,t)=>e[t],Gi.en)}if(void 0===s&&(s=e.split(".").reduce((e,t)=>e[t],Gi.en)),""!==t&&""!==r)if(Array.isArray(t)||Array.isArray(r))for(var a=0;a=0?Math.floor(e/60):Math.ceil(e/60),i=e-60*r;return i%t!=0&&(i=Math.round(i/t)*t),i>=60&&(r++,i-=60),r>=24&&(r-=24),60*r+i}function rs(e,t={}){const r=!!t.amPm&&t.amPm,i=!!t.absolute&&t.absolute;e>=1440&&(e-=1440);let s=e>=0?Math.floor(e/60):Math.ceil(e/60);const a=e-60*s;let n="";r&&(n=s>=12?"PM":"AM",(s>12||12==s&&a>0)&&(s-=12));const o=String(Math.abs(s)).padStart(2,"0"),c=String(Math.abs(a)).padStart(2,"0"),l=s<0||a<0;return{hours:o,minutes:c,time:`${l&&!i?"-":""}${o}:${c}${r?" "+n:""}`,signed:l,amPm:n}}function is(e,t={}){const r=t.stepSize?t.stepSize:1,i=!!t.signed&&t.signed,s=t.max?t.max:1440,a=ts(e,r);return a<0&&!i?e+=1440:a>=1440&&(e-=1440),a<-s?-s:a>s?s:e}function ss(e){let t,r,i;if("object"==typeof e)return ss(`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`);if(null!==(i=/^([0-9]{2}):([0-9]{2})$/.exec(e)))[t,r]=[Number(i[1]),Number(i[2])];else if(null!==(i=/^([0-9]{2})([0-9]{2})$/.exec(e)))[t,r]=[Number(i[1]),Number(i[2])];else{if(null!==(i=/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}[\+|\-][0-9]{2}:[0-9]{2}$/.exec(e))){const e=new Date(i[0]);return ss(`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`)}console.log(`failed to parse timestamp '${e}'`)}return 60*t+r}function as(e){return e.type==es.Daily?[1,2,3,4,5,6,7]:e.type==es.Workday?[1,2,3,4,5]:e.type==es.Weekend?[6,7]:e.type==es.Custom?e.custom_days:[]}function ns(e){return e==Xi.Sunrise?"sunrise":"sunset"}function os(e){let t=e.getDay();return 0==t&&(t=7),t}function cs(e,t){const r=new Date,i=Math.round((e.valueOf()-r.valueOf())/1e3);if(i<5)return Wi("time.now");if(i<60)return Wi("time.relative","{time}",Wi("time.seconds","{seconds}",String(i)));if(i<3300){const e=i%60,t=Math.round(i/60);if(e<5||e>55)return Wi("time.relative","{time}",1==t?Wi("time.minute"):Wi("time.minutes","{minutes}",String(t)));if(1==Math.floor(i/60)){const e=Math.round(i-60);return Wi("time.relative","{time}",`${Wi("time.minute")} ${Wi("words.and")} ${Wi("time.seconds","{seconds}",String(e))}`)}return Wi("time.relative","{time}",Wi("time.minutes","{minutes}",String(t)))}if(1==Math.floor(i/3600)){const e=Math.round(i/60-60);return Wi("time.relative","{time}",`${Wi("time.hour")} ${Wi("words.and")} ${Wi("time.minutes","{minutes}",String(e))}`)}const s=Math.round(i/3600);if(s<=6)return Wi("time.relative","{time}",1==s?Wi("time.hour"):Wi("time.hours","{hours}",String(s)));const a=new Date;a.setHours(0,0,0,0);const n=Math.floor((e.valueOf()-a.valueOf())/864e5),o=""+rs(ss(e),{amPm:null==t?void 0:t.amPm}).time;return 0==n?12==e.getHours()&&0==e.getMinutes()?Wi("time.absolute","{time}",Wi("time.noon")):Wi("time.absolute","{time}",o):1==n?0==e.getHours()&&0==e.getMinutes()?Wi("time.absolute","{time}",Wi("time.midnight")):12==e.getHours()&&0==e.getMinutes()?`${Wi("days.tomorrow")} ${Wi("time.absolute","{time}",Wi("time.noon"))}`:`${Wi("days.tomorrow")} ${Wi("time.absolute","{time}",o)}`:`${function(e){switch(e){case 1:return Wi("days_long.mon");case 2:return Wi("days_long.tue");case 3:return Wi("days_long.wed");case 4:return Wi("days_long.thu");case 5:return Wi("days_long.fri");case 6:return Wi("days_long.sat");case 7:return Wi("days_long.sun");default:return""}}(os(e))} ${Wi("time.absolute","{time}",o)}`}!function(e){e.Sunrise="SUNRISE",e.Sunset="SUNSET"}(Xi||(Xi={})),function(e){e.Daily="DAILY",e.Workday="WORKDAY",e.Weekend="WEEKEND",e.Custom="CUSTOM"}(es||(es={}));const ls=[{id:1,name:Wi("days_short.mon")},{id:2,name:Wi("days_short.tue")},{id:3,name:Wi("days_short.wed")},{id:4,name:Wi("days_short.thu")},{id:5,name:Wi("days_short.fri")},{id:6,name:Wi("days_short.sat")},{id:7,name:Wi("days_short.sun")}],ds=[{id:es.Daily,name:Wi("fields.day_type_daily")},{id:es.Workday,name:Wi("fields.day_type_workday")},{id:es.Weekend,name:Wi("fields.day_type_weekend")},{id:es.Custom,name:Wi("fields.day_type_custom")}];var us;!function(e){e.Overview="OVERVIEW",e.NewSchedule="NEW_SCHEDULE",e.TimePicker="TIME_PICKER",e.TimeScheme="TIME_SCHEME",e.Options="OPTIONS"}(us||(us={}));const hs={service:"turn_on",icon:"power"},ps={service:"turn_off",icon:"power-off"},ms=/^([0-9]+)?D([0-7]+)?T([0-9SRDUW]+)T?([0-9SRDUW]+)?(A[A0-9]+)+(C([C0-9]+))?(F([F0-9]+))?$/,vs=/^([0-9]{4})?([SRDUW]{2})([0-9]{4})?$/;function fs(e){var t,r,i;const s=ms.exec(e),a={time:{value:0},days:{type:es.Daily},actions:[]};if(s[1])"15"==s[1]?Object.assign(a,{days:{type:es.Workday}}):"67"==s[1]&&Object.assign(a,{days:{type:es.Weekend}});else{const e=s[2].split("").map(Number);e.sort(),1==e.length&&0==e[0]||Object.assign(a,{days:{type:es.Custom,custom_days:e.filter(e=>0!=e)}})}const n=vs.exec(s[3]);if(n?Object.assign(a,{time:{event:"SR"==n[2]?Xi.Sunrise:Xi.Sunset,value:n[1]?-ss(n[1]):ss(n[3])}}):Object.assign(a,{time:{value:ss(s[3])}}),s[4]){const e=vs.exec(s[4]);e?Object.assign(a,{endTime:{event:"SR"==e[2]?Xi.Sunrise:Xi.Sunset,value:e[1]?-ss(e[1]):ss(e[4])}}):Object.assign(a,{endTime:{value:ss(s[4])}})}const o=null===(t=s[5].match(/A[0-9]+/g))||void 0===t?void 0:t.map(e=>Number(e.substring(1)));if(Object.assign(a,{actions:o}),s[6]){let e=null===(r=s[6].match(/C[0-9]+/g))||void 0===r?void 0:r.map(e=>Number(e.substring(1)));1==(null==e?void 0:e.length)&&s[7].length>1?(e=s[7].split("").map(Number),Object.assign(a,{conditions:{type:Oe.All,items:e}})):Object.assign(a,{conditions:{type:Oe.Any,items:e}})}if(s[8]){const e=null===(i=s[8].match(/F[0-9]+/g))||void 0===i?void 0:i.map(e=>Number(e.substring(1)));Object.assign(a,{options:e})}return a}const gs=["disarmed","armed_away","armed_home","armed_night"];function ys(e){return{type:xe.Level,field:e.field,min:e.min||0,max:e.max||255,step:e.step||1,optional:e.optional||!1,unit:e.unit||""}}function _s(e){return{type:xe.List,field:e.field,options:e.options}}function bs(e,t={}){let r={value:String(e)};return t.icons&&e in t.icons&&(r=Object.assign(Object.assign({},r),{icon:t.icons[e]})),t.name&&(r=Object.assign(Object.assign({},r),{name:t.name})),r}const ws={heat:"fire",cool:"snowflake",heat_cool:"thermometer",auto:"autorenew",dry:"water-percent",fan_only:"fan"};const Es=e=>{switch(e.attributes.device_class){case"garage":return"garage";case"door":return"door-closed";case"shutter":return"window-shutter";case"blind":return"blinds";case"window":return"window-closed";default:return"window-shutter"}},Ps=e=>{switch(e.attributes.device_class){case"garage":return"garage-open";case"door":return"door-open";case"shutter":return"window-shutter-open";case"blind":return"blinds-open";case"window":return"window-open";default:return"window-shutter-open"}},Ss=["open","closed"];const ks={normal:"account-outline",eco:"leaf",away:"car-traction-control",boost:"rocket-launch-outline",comfort:"car-seat-cooler",home:"home-outline",sleep:"sleep",auto:"autorenew",baby:"baby-bottle-outline"};const xs=[{service:"unlock",icon:"lock-open-variant-outline"},{service:"lock",icon:"lock-outline"}],$s=["locked","unlocked"];function Os(e){const t=Se(e.entity_id);e.attributes.supported_features;switch(t){case"alarm_control_panel":return(e=>{const t=e.attributes.supported_features;let r=[{service:"alarm_disarm",icon:"lock-open-variant-outline"}];return 1&t&&r.push({service:"alarm_arm_home",icon:"home-outline"}),2&t&&r.push({service:"alarm_arm_away",icon:"exit-run"}),4&t&&r.push({service:"alarm_arm_night",icon:"power-sleep"}),16&t&&r.push({service:"alarm_arm_custom_bypass",icon:"shield-lock-outline"}),r})(e);case"climate":return function(e){const t=e.attributes.supported_features,r=e.attributes.preset_modes,i=e.attributes.hvac_modes,s=i.filter(e=>!["off","heat","cool","heat_cool"].includes(e)),a=ys({field:"temperature",min:e.attributes.min_temp,max:e.attributes.max_temp,step:.5});let n=[];return i.includes("off")?n.push({service:"set_hvac_mode",service_data:{hvac_mode:"off"},icon:"power"}):n.push(ps),i.includes("heat")&&1&t&&n.push({service:"set_temperature",service_data:{hvac_mode:"heat"},variable:a,icon:ws.heat}),i.includes("cool")&&1&t&&n.push({service:"set_temperature",service_data:{hvac_mode:"cool"},variable:a,icon:ws.cool}),s.length&&n.push({service:"set_hvac_mode",variable:_s({field:"hvac_mode",options:s.map(e=>bs(e,{icons:ws}))}),icon:"cog-transfer-outline"}),r&&r.length&&16&t&&n.push({service:"set_preset_mode",variable:_s({field:"preset_mode",options:r.map(e=>bs(e))}),icon:"cloud-download-outline"}),n}(e);case"cover":return function(e){const t=e.attributes.supported_features;let r=[{service:"open_cover",icon:Ps(e)},{service:"close_cover",icon:Es(e)}];return 4&t&&r.push({supported_feature:4,service:"set_cover_position",variable:ys({field:"position",min:0,max:100,unit:"%"}),icon:"ray-vertex"}),r}(e);case"fan":return function(e){const t=e.attributes.supported_features,r=e.attributes.speed_list;let i=[hs,ps];return 1&t&&r&&r.length>1&&i.push({service:"set_speed",variable:_s({field:"speed",options:r})}),2&t&&i.push({service:"oscillate",variable:_s({field:"oscillating",options:[{value:"True"},{value:"False"}]}),icon:"arrow-left-right"}),4&t&&i.push({service:"set_direction",variable:_s({field:"direction",options:[{value:"forward"},{value:"reverse"}]}),icon:"autorenew"}),i}(e);case"humidifer":return function(e){const t=e.attributes.supported_features,r=e.attributes.available_modes,i=ys({field:"humidity",min:e.attributes.min_humidity,max:e.attributes.max_humidity,step:1,unit:"%"});let s=[];return s.push({service:"set_humidity",variable:i}),r&&r.length>1&&1&t&&s.push({service:"set_mode",variable:_s({field:"mode",options:r.map(e=>bs(e,{icons:ks}))})}),s}(e);case"input_boolean":return[Object.assign(Object.assign({},hs),{icon:"flash"}),Object.assign(Object.assign({},ps),{icon:"flash-off"})];case"input_number":return function(e){return[{service:"set_value",variable:ys({field:"value",min:Number(e.attributes.min),max:Number(e.attributes.max),step:Number(e.attributes.step)}),icon:"counter"}]}(e);case"input_select":return function(e){const t=e.attributes.options;return t.length<2?[]:[{service:"select_option",variable:_s({field:"option",options:t.map(e=>({value:e}))}),icon:"counter"}]}(e);case"light":return function(e){const t=e.attributes.supported_features,r=ys({field:"brightness",min:0,max:255,unit:"%",optional:!0});let i=[];return i.push(Object.assign(Object.assign({},ps),{icon:"lightbulb-off"})),1&t?i.push(Object.assign(Object.assign({},hs),{icon:"lightbulb",variable:r})):i.push(Object.assign(Object.assign({},hs),{icon:"lightbulb"})),i}(e);case"lock":return xs;case"media_player":return function(e){const t=Array(e.attributes.source_list),r=e.attributes.supported_features;let i=[];return 128&r&&i.push(hs),256&r&&i.push(ps),2048&r&&t.length>1&&i.push({service:"select_source",variable:_s({field:"source",options:t.map(e=>({value:e}))}),icon:"music-box-multiple-outline"}),i}(e);case"scene":return[Object.assign(Object.assign({},hs),{icon:"play"})];case"script":return function(e){let t=[hs,ps];return t.push({service:ke(e.entity_id),icon:"play",name:Wi("services.run_script")}),t}(e);case"switch":return[Object.assign(Object.assign({},hs),{icon:"flash"}),Object.assign(Object.assign({},ps),{icon:"flash-off"})];case"vacuum":return function(e){const t=e.attributes.supported_features;let r=[];return 1&t&&r.push(hs),8192&t&&r.push({service:"start",icon:"play-circle-outline"}),4&t&&r.push({service:"start_pause",icon:"play-circle-outline"}),r}(e);case"water_heater":return function(e){const t=e.attributes.supported_features,r=e.attributes.operation_list,i=ys({field:"temperature",min:e.attributes.min_temp,max:e.attributes.max_temp,step:.5});let s=[];return 1&t&&s.push({service:"set_temperature",variable:i,icon:"thermometer"}),2&t&&s.push({service:"set_operation_mode",variable:_s({field:"operation_mode",options:r.map(e=>({value:e}))}),icon:"cog-transfer-outline"}),4&t&&s.push({service:"set_away_mode",variable:_s({field:"mode",options:[{value:"on",icon:"toggle-switch-outline"},{value:"off",icon:"toggle-switch-off-outline"}]}),icon:"car-traction-control"}),s}(e);default:return[]}}function js(e,t){let r=!1;if(e.match(/^[a-z0-9_\.]+$/))r=e.includes(".")?e==t:e==Se(t);else try{if(e.startsWith("/")&&e.endsWith("/")||-1!==e.indexOf("*")){e.startsWith("/")||(e=`/^${e=e.replace(/\./g,".").replace(/\*/g,".*")}$/`);r=new RegExp(e.slice(1,-1)).test(t)}}catch(e){}return r}function Cs(e,t){return!(!t.include||!t.include.length)&&(!(t.include&&!t.include.find(t=>js(t,e)))&&(!t.exclude||!t.exclude.find(t=>js(t,e))))}const Ds={alarm_control_panel:"alarm-light-outline",automation:"playlist-play",binary_sensor:"radiobox-blank",camera:"camera",climate:"home-thermometer-outline",cover:"window-shutter",device_tracker:"account",fan:"fan",group:"google-circles-communities",humidifier:"air-humidifier",input_boolean:"drawing",input_number:"ray-vertex",input_select:"format-list-bulleted",input_text:"textbox",light:"lightbulb-outline",lock:"lock-open-outline",media_player:"cast-connected",notify:"comment-alert",person:"account-outline",remote:"remote",scene:"palette-outline",script:"file-document",sensor:"eye",switch:"flash",timer:"timer",vacuum:"robot-vacuum",water_heater:"water-boiler"},As=e=>{const t=Se(e.entity_id);switch(t){case"binary_sensor":return(e=>{switch(e.attributes.device_class){case"battery":return"battery-outline";case"cold":return"snowflake";case"connectivity":return"server-network";case"door":return"door-closed";case"garage_door":return"hass:garage";case"gas":case"power":case"problem":case"safety":case"smoke":return"shield-check";case"heat":return"fire";case"light":return"brightness-5";case"lock":return"lock";case"moisture":return"water";case"motion":return"walk";case"occupancy":case"presence":return"home-outline";case"opening":return"hass:square";case"plug":return"hass:power-plug-outline";case"sound":return"music-note";case"vibration":return"vibrate";case"window":return"window-closed";default:return"radiobox-blank"}})(e);case"cover":return Es(e);case"sensor":return(e=>{switch(e.attributes.device_class){case"humidity":return"water-percent";case"illuminance":return"brightness-5";case"temperature":return"thermometer";case"power":return"flash";case"pressure":return"gauge";case"signal_strength":return"wifi";default:return"°C"==e.attributes.unit_of_measurement||"°F"==e.attributes.unit_of_measurement?"thermometer":"eye"}})(e);default:return t in Ds?Ds[t]:"folder-outline"}},zs=e=>{switch(Se(e.entity_id)){case"alarm_control_panel":return gs;case"binary_sensor":case"cover":return Ss;case"input_boolean":case"switch":return["on","off"];case"lock":return $s;case"person":return["home","not_home"];default:return}};function Ts(e,t){return e?Object.entries(e).filter(([e])=>t.includes(e)).reduce((e,[t,r])=>Object.assign(e,{[t]:r}),{}):{}}function Ns(e,t){return e?Object.entries(e).filter(([e])=>!t.includes(e)).reduce((e,[t,r])=>Object.assign(e,{[t]:r}),{}):{}}function Rs(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Fs(e){return"string"!=typeof e&&(e=String(e)),Rs(e.replace(/_/g," "))}function Is(e){if(e)return"string"!=typeof e&&(e=String(e)),e.match(/^[a-z]+:[a-z0-9-]+$/i)?e:"hass:"+e}function Ms(e){const t=e=>Object.entries(e).sort((e,t)=>e[0]>t[0]?1:-1).map(([e,r])=>[e,"object"==typeof r&&null!==r?t(r):r]).reduce((e,[t,r])=>Object.assign(e,{[t]:r}),{});let r=Ts(e,["service","service_data"]);r=t(r);return Object.values(r).map(e=>JSON.stringify(e).replace(/[\W]/g," ").split(" ").filter(e=>" "!=e&&""!=e).join("_")).join("_")}function Ls(e){const t=e.service;let r={id:"",name:e.name,icon:e.icon||"flash",service:t};return e.service_data&&Object.keys(e.service_data).length&&Object.assign(r,{service_data:e.service_data}),e.variable&&Object.assign(r,{variable:e.variable}),Object.assign(r,{id:Ms(r)}),r}function Vs(e){let t=e.entity,r=e.service;const i=Se(t),s=Se(r);i&&s?i==s&&(r=ke(r)):i||(t=s+"."+t,r=ke(r));let a=Ns(e,["service","entity","service_data"]),n={entity:t,service:r};return a=Object.assign(Object.assign({},a),e.service_data),Object.keys(a).length&&(n=Object.assign(Object.assign({},n),{service_data:a})),n}function Us(e,t){const r=e.actions.map(Ls),i=Ms(Ns(t,["entity"]));return r.map(e=>{if(e.id==i)return!0;if(e.variable&&t.service_data&&Object.keys(t.service_data).includes(e.variable.field)){let r=Object.entries(t.service_data).filter(([t])=>t!=e.variable.field).reduce((e,[t,r])=>Object.assign(e,{[t]:r}),{}),i=Object.keys(r).length?Object.assign(Object.assign({},t),{service_data:r}):Ns(t,["service_data"]);return e.id==Ms(i)}return!1}).map((e,t)=>e?t:null).filter(e=>null!==e)}function qs(e,t){const r=Us(e,t);return r.length?Ls(e.actions[r[0]]):Ls(Ns(t,["entity"]))}function Hs(e){return e.match(/^switch.schedule_[0-9a-f]{6}$/)}function Qs(e,t){if(!e)return;const r="string"==typeof e?e:e.entity_id;let i={id:r,name:e.attributes.friendly_name||ke(r),icon:"folder-outline",actions:[]};if((void 0===t.standard_configuration||t.standard_configuration)&&(i=Object.assign(Object.assign({},i),{actions:[...Os(e)],icon:As(e),states:zs(e)})),i=Object.assign(Object.assign({},i),{icon:e.attributes.icon||i.icon}),t.customize){Object.entries(t.customize).filter(([e])=>js(e,r)).map(([,e])=>e).forEach(e=>{if(i=Object.assign(Object.assign({},i),Ns(e,["actions","actions_hidden"])),e.actions&&e.actions.forEach(e=>{const t=Us(i,e);let r=i.actions;t.length?r=i.actions.map((r,i)=>t.includes(i)?Object.assign(r,e):r):i.actions.push(e),i=Object.assign(Object.assign({},i),{actions:r})}),e.actions_hidden){let t=i.actions;e.actions_hidden.forEach(e=>{t=t.filter(t=>Ls(t).id!==e)}),i=Object.assign(Object.assign({},i),{actions:t})}})}return i}function Bs(e,t,r){const i=e.entity_id;if(Hs(i))return!1;if(!(Cs(i,t)||t.groups&&t.groups.some(e=>Cs(i,e))))return!1;if(r){const i=Qs(e,t);if(!i)return!1;if(r.states&&!i.states)return!1;if(r.actions&&!i.actions.length)return!1}return!0}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function Ks(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}var Gs=Ks((function(e,t){ +(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");const re={};class ie extends G{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const e=this.getStyles();if(Array.isArray(e)){const t=(e,r)=>e.reduceRight((e,r)=>Array.isArray(r)?t(r,e):(e.add(r),e),r),r=t(e,new Set),i=[];r.forEach(e=>i.unshift(e)),this._styles=i}else this._styles=void 0===e?[]:[e];this._styles=this._styles.map(e=>{if(e instanceof CSSStyleSheet&&!Z){const t=Array.prototype.slice.call(e.cssRules).reduce((e,t)=>e+t.cssText,"");return new ee(String(t),X)}return e})}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?Z?this.renderRoot.adoptedStyleSheets=e.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map(e=>e.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(e){const t=this.render();super.update(e),t!==re&&this.constructor.render(t,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(e=>{const t=document.createElement("style");t.textContent=e.cssText,this.renderRoot.appendChild(t)}))}render(){return re}}ie.finalized=!0,ie.render=(e,t,r)=>{if(!r||"object"!=typeof r||!r.scopeName)throw new Error("The `scopeName` option is required.");const s=r.scopeName,a=R.has(t),n=L&&11===t.nodeType&&!!t.host,o=n&&!q.has(s),c=o?document.createDocumentFragment():t;if(((e,t,r)=>{let s=R.get(t);void 0===s&&(i(t,t.firstChild),R.set(t,s=new $(Object.assign({templateFactory:T},r))),s.appendInto(t)),s.setValue(e),s.commit()})(e,c,Object.assign({templateFactory:V(s)},r)),o){const e=R.get(c);R.delete(c);const r=e.value instanceof _?e.value.template:void 0;H(s,c,r),i(t,t.firstChild),t.appendChild(c),R.set(t,e)}!a&&n&&window.ShadyCSS.styleElement(t.host)};var se=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,ae="[^\\s]+",ne=/\[([^]*?)\]/gm;function oe(e,t){for(var r=[],i=0,s=e.length;i-1?i:null}};function le(e){for(var t=[],r=1;r3?0:(e-e%10!=10?1:0)*e%10]}},me=le({},pe),ve=function(e,t){for(void 0===t&&(t=2),e=String(e);e.length0?"-":"+")+ve(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4)},Z:function(e){var t=e.getTimezoneOffset();return(t>0?"-":"+")+ve(Math.floor(Math.abs(t)/60),2)+":"+ve(Math.abs(t)%60,2)}},ge=function(e){return+e-1},ye=[null,"[1-9]\\d?"],_e=[null,ae],be=["isPm",ae,function(e,t){var r=e.toLowerCase();return r===t.amPm[0]?0:r===t.amPm[1]?1:null}],we=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(e){var t=(e+"").match(/([+-]|\d\d)/gi);if(t){var r=60*+t[1]+parseInt(t[2],10);return"+"===t[0]?r:-r}return 0}],Ee=(ce("monthNamesShort"),ce("monthNames"),{default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"});var Pe=function(e,t,r){if(void 0===t&&(t=Ee.default),void 0===r&&(r={}),"number"==typeof e&&(e=new Date(e)),"[object Date]"!==Object.prototype.toString.call(e)||isNaN(e.getTime()))throw new Error("Invalid Date pass to format");var i=[];t=(t=Ee[t]||t).replace(ne,(function(e,t){return i.push(t),"@@@"}));var s=le(le({},me),r);return(t=t.replace(se,(function(t){return fe[t](e,s)}))).replace(/@@@/g,(function(){return i.shift()}))};(function(){try{(new Date).toLocaleDateString("i")}catch(e){return"RangeError"===e.name}})(),function(){try{(new Date).toLocaleString("i")}catch(e){return"RangeError"===e.name}}(),function(){try{(new Date).toLocaleTimeString("i")}catch(e){return"RangeError"===e.name}}();function Se(e){return e.substr(0,e.indexOf("."))}function ke(e){return e.substr(e.indexOf(".")+1)}var xe,$e,Oe,je=function(e,t,r,i){i=i||{},r=null==r?{}:r;var s=new Event(t,{bubbles:void 0===i.bubbles||i.bubbles,cancelable:Boolean(i.cancelable),composed:void 0===i.composed||i.composed});return s.detail=r,e.dispatchEvent(s),s};!function(e){e.Level="LEVEL",e.List="LIST"}(xe||(xe={})),function(e){e.Equal="is",e.Unequal="not",e.Below="below",e.Above="above"}($e||($e={})),function(e){e.Any="or",e.All="and"}(Oe||(Oe={}));var Ce={add:"přidat položku",cancel:"zrušit",next:"další",save:"uložit",delete:"vymazat"},De={no_group_selected:"Nejprve vyberte skupinu",no_entity_selected:"Nejprve vyberte entitu",no_groups_defined:"Nejsou definovány žádné skupiny",no_entities_for_group:"V této skupině nejsou žádné entity",no_actions_for_entity:"Pro tuto entitu neexistují žádné akce",no_entries_defined:"Nejsou žádné položky k zobrazení"},ze={group:"Skupina",entity:"Entity",action:"Akce",days:"Dny",time:"Čas",options:"Možnosti",day_type_daily:"denně",day_type_workday:"pracovní dny",day_type_weekend:"víkend",day_type_custom:"vlastní"},Ae={mon:"po",tue:"út",wed:"st",thu:"čt",fri:"pá",sat:"so",sun:"ne"},Te={mon:"Pondělí",tue:"Úterý",wed:"Středa",thu:"Čtvrtek",fri:"Pátek",sat:"Sobota",sun:"Neděle"},Ne={and:"a",before:"před",after:"po"},Re={turn_on:"zapnout",turn_on_brightness:"zapnout {na brightness}",turn_off:"vypnout",close_cover:"zavřít",open_cover:"otevřít",set_temperature:"nastavená teplota {na temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"nastavit polohu {na position}",set_hvac_mode:"nastavit režim {na hvac_mode}",set_hvac_mode_hvac_mode_off:"vypnout",set_preset_mode:"nastavit předvolbu {na preset_mode}",set_value:"nastavená hodnota {na value}",select_option:"vyberte možnost {option}",select_source:"vyberte zdroj {source}",start:"start",run_script:"run"},Fe={brightness:"jas",temperature:"teplota",position:"pozice",hvac_mode:"režim",preset_mode:"přednastavení"},Ie={camera:"kamery",climate:"klima",cover:"kryty",fan:"ventilátory",group:"skupiny",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"světla",media_player:"přehrávače médií",scene:"scény",switch:"spínače",vacuum:"vysavače"},Me={tomorrow:"zítra",daily:"denně",daily_except_days:"každý den kromě {days}",working_days:"pracovní dny",weekend:"víkend",interval:"{startDay} do {endDay}"},Le={absolute:"v {time}",relative:"v {time}",interval:"od {startTime} do {endTime}",seconds:"{seconds} sekund",hour:"1 hodina",hours:"{hours} hodin",minute:"1 minuta",minutes:"{minutes} minut",now:"nyní",midnight:"půlnoc",noon:"poledne",at_sun_event:"na {sunEvent}",sun_event_sunrise:"svítání",sun_event_sunset:"západ slunce"},Ve={one_additional_task:"1 další úkol",x_additional_tasks:"{count} více úkolů"},Ue={scheduler:"Plánovač",actions:Ce,instructions:De,fields:ze,days_short:Ae,days_long:Te,words:Ne,services:Re,service_parameters:Fe,domains:Ie,days:Me,time:Le,misc:Ve},qe=Object.freeze({__proto__:null,scheduler:"Plánovač",actions:Ce,instructions:De,fields:ze,days_short:Ae,days_long:Te,words:Ne,services:Re,service_parameters:Fe,domains:Ie,days:Me,time:Le,misc:Ve,default:Ue}),He={add:"hinzufügen",cancel:"abbrechen",next:"weiter",save:"speichern",delete:"löschen"},Qe={no_group_selected:"Wähle zuerst eine Gruppe aus",no_entity_selected:"Wähle zuerst eine Entity aus",no_groups_defined:"Es gibt keine Gruppe",no_entities_for_group:"Es gibt keine Entities in dieser Gruppe",no_actions_for_entity:"Es gibt keine Aktionen für diese Entity",no_entries_defined:"Es gibt keine Einträge"},Be={group:"Gruppe",entity:"Entity",action:"Aktion",days:"Tage",time:"Zeit",options:"Optionen",day_type_daily:"jeden Tag",day_type_workday:"Werktags",day_type_weekend:"Wochenende",day_type_custom:"benutzerdefiniert"},Ke={mon:"Mo",tue:"Di",wed:"Mi",thu:"Do",fri:"Fr",sat:"Sa",sun:"So"},Ge={mon:"Montag",tue:"Dienstag",wed:"Mittwoch",thu:"Donnerstag",fri:"Freitag",sat:"Samstag",sun:"Sonntag"},We={and:"und",before:"vor",after:"nach"},Ye={turn_on:"anschalten",turn_on_brightness:"anschalten {auf brightness}",turn_off:"ausschalten",close_cover:"schließen",open_cover:"öffnen",set_temperature:"Temperatur einstellen {auf temperature}",set_temperature_hvac_mode_heat:"aufwärmen {auf temperature}",set_temperature_hvac_mode_cool:"kühlen {auf temperature}",set_cover_position:"Position setzen {nach position}",set_hvac_mode:"Modus setzen {zu hvac_mode}",set_hvac_mode_hvac_mode_off:"ausschalten",set_preset_mode:"Voreinstellung setzen {zu preset_mode}",set_value:"Wert setzen {zu value}",select_option:"Option {option} auswählen",select_source:"Quelle {source} auswählen",start:"start",run_script:"ausführen"},Je={brightness:"Helligkeit",temperature:"Temperatur",position:"Position",hvac_mode:"Modus",preset_mode:"Voreinstellung"},Ze={camera:"Kameras",climate:"Heizung",cover:"Beschattung",fan:"Lüfter",group:"Gruppen",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"Licht",media_player:"Media Player",scene:"Szene",switch:"Schalter",vacuum:"Staubsauger"},Xe={tomorrow:"morgen",daily:"täglich",daily_except_days:"täglich außer {days}",working_days:"Werktags",weekend:"Wochenende",interval:"{startDay} bis {endDay}"},et={absolute:"um {time}",relative:"in {time}",interval:"von {startTime} bis {endTime}",seconds:"{seconds} Sekunden",hour:"1 Stunde",hours:"{hours} Stunden",minute:"1 Minute",minutes:"{minutes} Minuten",now:"jetzt",midnight:"Mitternacht",noon:"Mittag",at_sun_event:"am {sunEvent}",sun_event_sunrise:"Sonnenaufgang",sun_event_sunset:"Sonnenuntergang"},tt={one_additional_task:"1 weitere Aufgabe",x_additional_tasks:"{count} weitere Aufgaben"},rt={scheduler:"Zeitplaner",actions:He,instructions:Qe,fields:Be,days_short:Ke,days_long:Ge,words:We,services:Ye,service_parameters:Je,domains:Ze,days:Xe,time:et,misc:tt},it=Object.freeze({__proto__:null,scheduler:"Zeitplaner",actions:He,instructions:Qe,fields:Be,days_short:Ke,days_long:Ge,words:We,services:Ye,service_parameters:Je,domains:Ze,days:Xe,time:et,misc:tt,default:rt}),st={add:"add item",cancel:"cancel",next:"next",save:"save",delete:"delete"},at={no_group_selected:"Select a group first",no_entity_selected:"Select an entity first",no_groups_defined:"There are no groups defined",no_entities_for_group:"There are no entities in this group",no_actions_for_entity:"There are no actions for this entity",no_entries_defined:"There are no items to show"},nt={group:"Group",entity:"Entity",action:"Action",days:"Days",time:"Time",options:"Options",day_type_daily:"daily",day_type_workday:"workdays",day_type_weekend:"weekend",day_type_custom:"custom"},ot={mon:"mon",tue:"tue",wed:"wed",thu:"thu",fri:"fri",sat:"sat",sun:"sun"},ct={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},lt={and:"and",before:"before",after:"after"},dt={turn_on:"turn on",turn_on_brightness:"turn on {at brightness}",turn_off:"turn off",close_cover:"close",open_cover:"open",set_temperature:"set temperature {to temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_to:"set to",set_cover_position:"set position {to position}",set_hvac_mode:"set mode {to hvac_mode}",set_hvac_mode_hvac_mode_off:"turn off",set_preset_mode:"set preset {to preset_mode}",set_value:"set value {to value}",select_option:"select option {option}",select_source:"select source {source}",start:"start",run_script:"run"},ut={brightness:"brightness",temperature:"temperature",position:"position",hvac_mode:"mode",preset_mode:"preset"},ht={camera:"cameras",climate:"climate",cover:"covers",fan:"fans",group:"groups",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"lights",media_player:"media players",scene:"scenes",switch:"switches",vacuum:"vacuum"},pt={tomorrow:"tomorrow",daily:"daily",daily_except_days:"every day except {days}",working_days:"working days",weekend:"weekend",interval:"{startDay} to {endDay}"},mt={absolute:"at {time}",relative:"in {time}",interval:"from {startTime} to {endTime}",seconds:"{seconds} seconds",hour:"1 hour",hours:"{hours} hours",minute:"1 minute",minutes:"{minutes} minutes",now:"now",midnight:"midnight",noon:"noon",at_sun_event:"at {sunEvent}",sun_event_sunrise:"sunrise",sun_event_sunset:"sunset"},vt={one_additional_task:"1 more task",x_additional_tasks:"{count} more tasks"},ft={scheduler:"Scheduler",actions:st,instructions:at,fields:nt,days_short:ot,days_long:ct,words:lt,services:dt,service_parameters:ut,domains:ht,days:pt,time:mt,misc:vt},gt=Object.freeze({__proto__:null,scheduler:"Scheduler",actions:st,instructions:at,fields:nt,days_short:ot,days_long:ct,words:lt,services:dt,service_parameters:ut,domains:ht,days:pt,time:mt,misc:vt,default:ft}),yt={add:"Agregar",cancel:"cancelar",next:"siguiente",save:"guardar",delete:"borrar"},_t={no_group_selected:"Selecciona un grupo primero",no_entity_selected:"Selecciona una entidad primero",no_groups_defined:"No hay grupos definidos",no_entities_for_group:"No hay entidades en este grupo",no_actions_for_entity:"No hay acciones para esta entidad",no_entries_defined:"No hay dispositivos definidos"},bt={group:"Grupo",entity:"Entidad",action:"Acción",days:"Días",time:"Hora",options:"Opciones",day_type_daily:"cada día",day_type_weekdays:"dias semanales",day_type_weekend:"fin de semana",day_type_custom:"personalizado"},wt={mon:"lun",tue:"mar",wed:"mie",thu:"jue",fri:"vie",sat:"sab",sun:"dom"},Et={mon:"lunes",tue:"martes",wed:"miércoles",thu:"jueves",fri:"viernes",sat:"sábado",sun:"domingo"},Pt={and:"y",before:"antes",after:"después"},St={turn_on:"encender",turn_on_brightness:"encender {a brightness}",turn_off:"apagar",close_cover:"cerrar",open_cover:"abrir",set_temperature:"establecer temperatura {a temperature}",set_temperature_hvac_mode_heat:"calentar {a temperature}",set_temperature_hvac_mode_cool:"enfriar {a temperature}",set_cover_position:"establecer posición {a position}",set_hvac_mode:"establecer modo {a hvac_mode}",set_hvac_mode_hvac_mode_off:"apagar",set_preset_mode:"establecer modo {a preset_mode}",set_value:"establecer valor {value}",select_option:"seleccionar opción {option}",select_source:"seleccionar fuente {source}",start:"empezar",run_script:"ejecutar"},kt={brightness:"brillo",temperature:"temperatura",position:"posición",hvac_mode:"modo",preset_mode:"pre-ajuste"},xt={camera:"cámaras",climate:"climatización",cover:"persiana",fan:"ventilador",group:"grupo",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"luces",media_player:"reproductor multimedia",scene:"escena",switch:"interruptor",vacuum:"aspirador"},$t={tomorrow:"mañana",daily:"a diario",daily_except_days:"todos los dias excepto {days}",working_days:"días hábiles",weekend:"fin de semana",interval:"{startDay} a {endDay}"},Ot={absolute:"a las {time}",relative:"en {time}",interval:"desde las {startTime} a las {endTime}",seconds:"{seconds} segundos",hour:"1 hora",hours:"{hours} horas",minute:"1 minuto",minutes:"{minutes} minutos",now:"ahora",midnight:"medianoche",noon:"mediodía",at_sun_event:"al {sunEvent}",sun_event_sunrise:"amanecer",sun_event_sunset:"atardecer"},jt={one_additional_task:"1 tarea más",x_additional_tasks:"{count} tareas más"},Ct={scheduler:"Programador",actions:yt,instructions:_t,fields:bt,days_short:wt,days_long:Et,words:Pt,services:St,service_parameters:kt,domains:xt,days:$t,time:Ot,misc:jt},Dt=Object.freeze({__proto__:null,scheduler:"Programador",actions:yt,instructions:_t,fields:bt,days_short:wt,days_long:Et,words:Pt,services:St,service_parameters:kt,domains:xt,days:$t,time:Ot,misc:jt,default:Ct}),zt={add:"lisa",cancel:"loobu",next:"edasi",save:"salvesta",delete:"kustuta"},At={no_group_selected:"Vali grupp",no_entity_selected:"Vali olem",no_groups_defined:"Gruppe pole määratud",no_entities_for_group:"Antud grupis puuduvad olemid",no_actions_for_entity:"Selles olemis puuduvad tegevused",no_entries_defined:"Pole midagi kuvada"},Tt={group:"Grupp",entity:"Olem",action:"Tegevus",days:"Päevad",time:"Aeg",options:"Suvandid",day_type_daily:"iga päev",day_type_weekdays:"tööpäevadel",day_type_weekend:"nädalavahetus",day_type_custom:"valikuline"},Nt={mon:"E",tue:"T",wed:"K",thu:"N",fri:"R",sat:"L",sun:"P"},Rt={mon:"Esmaspäev",tue:"Teisipäev",wed:"Kolmapäev",thu:"Neljapäev",fri:"Reede",sat:"Laupäev",sun:"Pühapäev"},Ft={and:"ja",before:"enne",after:"pärast"},It={turn_on:"lülita sisse",turn_on_brightness:"turn on {at brightness}",turn_off:"lülita välja",close_cover:"sulge",open_cover:"ava",set_temperature:"määra temperatuur {to temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"seadista asendisse {to position}",set_hvac_mode:"vali töörežiim {to hvac_mode}",set_hvac_mode_hvac_mode_off:"turn off",set_preset_mode:"eelseadistatud {to preset_mode}",set_value:"määra väärtus {value}",select_option:"valikud {option}",select_source:"vali allikas {source}",start:"alusta",run_script:"alusta"},Mt={brightness:"heledus",temperature:"temperatuur",position:"asend",hvac_mode:"töörežiim",preset_mode:"eelseadistus"},Lt={camera:"kaamerad",climate:"kliimaseade",cover:"(akna)katted",fan:"ventilaatorid",group:"grupid",input_boolean:"binaarsisestus",input_number:"arvsisestus",input_select:"sisendivalik",light:"valgustid",media_player:"media players",scene:"stseenid",switch:"lülitid",vacuum:"tolmuimejad"},Vt={tomorrow:"homme",daily:"iga päev",daily_except_days:"iga päev välja arvatud {days}",working_days:"tööpäevadel",weekend:"nädalavahetusel",interval:"{startDay} kuni {endDay}"},Ut={absolute:"kell {time}",relative:"{time} pärast",interval:"alates {startTime} kuni {endTime}",seconds:"{seconds} sekundit",hour:"1 tund",hours:"{hours} tundi",minute:"1 minut",minutes:"{minutes} minutit",now:"kohe",midnight:"keskööl",noon:"keskpäeval",at_sun_event:"{sunEvent}",sun_event_sunrise:"päikesetõusu",sun_event_sunset:"loojangut"},qt={one_additional_task:"veel 1 ajastus",x_additional_tasks:"{count} ajastust"},Ht={scheduler:"Ajastaja",actions:zt,instructions:At,fields:Tt,days_short:Nt,days_long:Rt,words:Ft,services:It,service_parameters:Mt,domains:Lt,days:Vt,time:Ut,misc:qt},Qt=Object.freeze({__proto__:null,scheduler:"Ajastaja",actions:zt,instructions:At,fields:Tt,days_short:Nt,days_long:Rt,words:Ft,services:It,service_parameters:Mt,domains:Lt,days:Vt,time:Ut,misc:qt,default:Ht}),Bt={add:"ajouter un item",cancel:"annuler",next:"suivant",save:"sauvegarder",delete:"effacer"},Kt={no_group_selected:"Sélectionner un groupe en premier",no_entity_selected:"Sélectionner une entité en premier",no_groups_defined:"Il n'y a pas de groupe défini",no_entities_for_group:"Il n'y a pas d'entité dans ce groupe",no_actions_for_entity:"Il n'y a pas d'action pour cette entité",no_entries_defined:"Il n'y a pas d'item à afficher"},Gt={group:"Groupe",entity:"Entité",action:"Action",days:"Jours",time:"Temps",options:"Options",day_type_daily:"chaque jour",day_type_weekdays:"en semaine",day_type_weekend:"weekend",day_type_custom:"sur mesure"},Wt={mon:"lun",tue:"mar",wed:"mer",thu:"jeu",fri:"ven",sat:"sam",sun:"dim"},Yt={mon:"lundi",tue:"mardi",wed:"mercredi",thu:"jeudi",fri:"vendredi",sat:"samedi",sun:"dimanche"},Jt={and:"et",before:"avant",after:"après"},Zt={turn_on:"allumer",turn_on_brightness:"allumer {à brightness}",turn_off:"éteindre",close_cover:"fermer",open_cover:"ouvrir",set_temperature:"régler la température {à temperature}",set_temperature_hvac_mode_heat:"heat {à temperature}",set_temperature_hvac_mode_cool:"cool {à temperature}",set_cover_position:"position définie {à position}",set_hvac_mode:"set mode {to hvac_mode}",set_hvac_mode_hvac_mode_off:"turn off",set_preset_mode:"set preset {to preset_mode}",set_value:"set value {to value}",select_option:"select option {option}",select_source:"select source {source}",start:"start",run_script:"run"},Xt={brightness:"brightness",temperature:"temperature",position:"position",hvac_mode:"mode",preset_mode:"preset"},er={camera:"cameras",climate:"climat",cover:"contrôleur",fan:"ventilateur",group:"groups",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"lumière",media_player:"media players",scene:"scenes",switch:"interrupteurs",vacuum:"aspirateur"},tr={tomorrow:"tomorrow",daily:"daily",daily_except_days:"every day except {days}",working_days:"working days",weekend:"weekend",interval:"{startDay} to {endDay}"},rr={absolute:"at {time}",relative:"in {time}",interval:"from {startTime} to {endTime}",seconds:"{seconds} seconds",hour:"1 hour",hours:"{hours} hours",minute:"1 minute",minutes:"{minutes} minutes",now:"now",midnight:"midnight",noon:"noon",at_sun_event:"at {sunEvent}",sun_event_sunrise:"sunrise",sun_event_sunset:"sunset"},ir={one_additional_task:"1 more task",x_additional_tasks:"{count} more tasks"},sr={scheduler:"Planificateur",actions:Bt,instructions:Kt,fields:Gt,days_short:Wt,days_long:Yt,words:Jt,services:Zt,service_parameters:Xt,domains:er,days:tr,time:rr,misc:ir},ar=Object.freeze({__proto__:null,scheduler:"Planificateur",actions:Bt,instructions:Kt,fields:Gt,days_short:Wt,days_long:Yt,words:Jt,services:Zt,service_parameters:Xt,domains:er,days:tr,time:rr,misc:ir,default:sr}),nr={add:"új időzítés",cancel:"mégse",next:"tovább",save:"mentés",delete:"törlés"},or={no_group_selected:"Előbb egy csoportot szükséges választani",no_entity_selected:"Előbb egy entitást szükséges választani",no_groups_defined:"Nincsenek deffiniált csoportok",no_entities_for_group:"Ebben a csoportban nem találhatók entitások",no_actions_for_entity:"Ehhez az entitáshoz nem tartoznak műveletek",no_entries_defined:"Nincs megjeleníthető elem"},cr={group:"Csoport",entity:"Entitás",action:"Művelet",days:"Napokon",time:"Időpontban",options:"Opciók",day_type_daily:"minden nap",day_type_workday:"munkanapokon",day_type_weekend:"hétvégén",day_type_custom:"egyedi"},lr={mon:"hét",tue:"ked",wed:"sze",thu:"csü",fri:"pén",sat:"szo",sun:"vas"},dr={mon:"hétfő",tue:"kedd",wed:"szerda",thu:"csütörtök",fri:"péntek",sat:"szombat",sun:"vasárnap"},ur={and:"és",before:"előtt",after:"után"},hr={turn_on:"bekapcsolás",turn_on_brightness:"bekapcsolás {at brightness}",turn_off:"kikapcsolás",close_cover:"zárás",open_cover:"nyitás",set_temperature:"hőmérséklet {to temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"változtass pozíciót {to position}",set_hvac_mode:"mód beállítása {to hvac_mode}",set_hvac_mode_hvac_mode_off:"kikapcsolás",set_preset_mode:"preset beállítása {to preset_mode}",set_value:"érték beállítása {value}",select_option:"opció kiválasztása {option}",select_source:"forrás kiválasztása {source}",start:"kezdés",run_script:"kezdés"},pr={brightness:"világosság",temperature:"hőmérséklet",position:"pozíció",hvac_mode:"mód",preset_mode:"preset"},mr={camera:"kamera",climate:"termosztát",cover:"redőny",fan:"ventilátor",group:"csoportok",input_boolean:"logikai bemenet",input_number:"szám bemenet",input_select:"legördülő bemenet",light:"lámpa",media_player:"lejátszó",scene:"jelenetek",switch:"kapcsoló",vacuum:"pórszívó"},vr={tomorrow:"holnap",daily:"minden nap",daily_except_days:"minden nap, kivéve {days}",working_days:"munkanapokon",weekend:"hétvégén",interval:"{startDay} - {endDay}"},fr={absolute:"{time}-kor",relative:"{time} múlva",interval:"{startTime} - {endTime}",seconds:"{seconds} másodperc",hour:"1 óra",hours:"{hours} óra",minute:"1 perc",minutes:"{minutes} perc",now:"most",midnight:"éjfél",noon:"dél",at_sun_event:"{sunEvent}kor",sun_event_sunrise:"napfelkelte",sun_event_sunset:"napnyugta"},gr={one_additional_task:"még egy feladat",x_additional_tasks:"még {count} feladat"},yr={scheduler:"Időzítések",actions:nr,instructions:or,fields:cr,days_short:lr,days_long:dr,words:ur,services:hr,service_parameters:pr,domains:mr,days:vr,time:fr,misc:gr},_r=Object.freeze({__proto__:null,scheduler:"Időzítések",actions:nr,instructions:or,fields:cr,days_short:lr,days_long:dr,words:ur,services:hr,service_parameters:pr,domains:mr,days:vr,time:fr,misc:gr,default:yr}),br={add:"aggiungi oggetto",cancel:"annulla",next:"avanti",save:"salva",delete:"cancella"},wr={no_group_selected:"Seleziona prima un gruppo",no_entity_selected:"Seleziona prima un'entità",no_groups_defined:"Non ci sono gruppi definiti",no_entities_for_group:"Non ci sono entità in questo gruppo",no_actions_for_entity:"Non ci sono azioni per questa entità",no_entries_defined:"Non ci sono oggetti da visualizzare"},Er={group:"Gruppo",entity:"Entità",action:"Azione",days:"Giorni",time:"Ora",options:"Opzioni",day_type_daily:"giornaliero",day_type_workday:"giorni lavorativi",day_type_weekend:"weekend",day_type_custom:"personalizzato"},Pr={mon:"lun",tue:"mar",wed:"mer",thu:"gio",fri:"ven",sat:"sab",sun:"dom"},Sr={mon:"Lunedì",tue:"Martedì",wed:"Mercoledì",thu:"Giovedì",fri:"Venerdì",sat:"Sabato",sun:"Domenica"},kr={and:"e",before:"prima",after:"dopo"},xr={turn_on:"accendi",turn_on_brightness:"accendi {at brightness}",turn_off:"spegni",close_cover:"chiudi",open_cover:"apri",set_temperature:"imposta temperatura {to temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"imposta posizione {to position}",set_hvac_mode:"imposta modalità {to hvac_mode}",set_hvac_mode_hvac_mode_off:"spegni",set_preset_mode:"imposta programmazione {to preset_mode}",set_value:"imposta valore {value}",select_option:"seleziona opzione {option}",select_source:"seleziona sorgente {source}",start:"start",run_script:"run"},$r={brightness:"luminosità",temperature:"temperatura",position:"posizione",hvac_mode:"modalità",preset_mode:"programmazione"},Or={camera:"telecamere",climate:"clima",cover:"cover",fan:"ventole",group:"gruppi",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"luci",media_player:"media player",scene:"scene",switch:"interruttori",vacuum:"aspirapolveri"},jr={tomorrow:"domani",daily:"giornaliero",daily_except_days:"tutti i giorni eccetto {days}",working_days:"giorni lavorativi",weekend:"weekend",interval:"{startDay} a {endDay}"},Cr={absolute:"alle {time}",relative:"entro {time}",interval:"dalle {startTime} alle {endTime}",seconds:"{seconds} second1",hour:"1 ora",hours:"{hours} ore",minute:"1 minuto",minutes:"{minutes} minuti",now:"ora",midnight:"mezzanotte",noon:"noon",at_sun_event:"all' {sunEvent}",sun_event_sunrise:"alba",sun_event_sunset:"tramonto"},Dr={one_additional_task:"1 altro task",x_additional_tasks:"{count} altri task"},zr={scheduler:"Schedulatore",actions:br,instructions:wr,fields:Er,days_short:Pr,days_long:Sr,words:kr,services:xr,service_parameters:$r,domains:Or,days:jr,time:Cr,misc:Dr},Ar=Object.freeze({__proto__:null,scheduler:"Schedulatore",actions:br,instructions:wr,fields:Er,days_short:Pr,days_long:Sr,words:kr,services:xr,service_parameters:$r,domains:Or,days:jr,time:Cr,misc:Dr,default:zr}),Tr={add:"Nieuw item",cancel:"annuleren",next:"verder",save:"opslaan",delete:"verwijder"},Nr={no_group_selected:"Selecteer eerst een groep",no_entity_selected:"Selecteer eerst een entiteit",no_groups_defined:"Er zijn geen groepen gedefinieerd",no_entities_for_group:"Deze groep heeft geen entiteiten",no_actions_for_entity:"Deze entiteit heeft geen acties",no_entries_defined:"Er zijn geen items aangemaakt"},Rr={group:"Groep",entity:"Entiteit",action:"Actie",days:"Dagen",time:"Tijdstip",options:"Opties",day_type_daily:"dagelijks",day_type_workday:"werkdagen",day_type_weekend:"weekend",day_type_custom:"anders"},Fr={mon:"ma",tue:"di",wed:"wo",thu:"do",fri:"vr",sat:"za",sun:"zo"},Ir={mon:"maandag",tue:"dinsdag",wed:"woensdag",thu:"donderdag",fri:"vrijdag",sat:"zaterdag",sun:"zondag"},Mr={and:"en",before:"voor",after:"na"},Lr={turn_on:"aanzetten",turn_on_brightness:"aanzetten {op brightness}",turn_off:"uitzetten",close_cover:"sluiten",open_cover:"openen",set_temperature:"temperatuur instellen {naar temperature}",set_temperature_hvac_mode_heat:"verwarmen {naar temperature}",set_temperature_hvac_mode_cool:"koelen {naar temperature}",set_cover_position:"positie instellen {naar position}",set_hvac_mode:"stand aanpassen {naar hvac_mode}",set_hvac_mode_hvac_mode_off:"uitzetten",set_preset_mode:"kies voorinstelling {preset_mode}",set_value:"waarde {value} instellen",select_option:"optie {option} selecteren",select_source:"ingang {source} selecteren",start:"starten",run_script:"uitvoeren"},Vr={brightness:"helderheid",temperature:"temperatuur",position:"positie",hvac_mode:"stand",preset_mode:"voorinstelling"},Ur={camera:"cameras",climate:"verwarming",cover:"zonwering",fan:"ventilatie",group:"groepen",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"verlichting",media_player:"mediaspelers",scene:"scènes",switch:"schakelaars",vacuum:"stofzuigers"},qr={tomorrow:"morgen",daily:"dagelijks",daily_except_days:"elke dag behalve {days}",working_days:"op werkdagen",weekend:"in het weekend",interval:"{startDay} t/m {endDay}"},Hr={absolute:"om {time}",relative:"over {time}",interval:"van {startTime} tot {endTime}",seconds:"{seconds} seconden",hour:"1 uur",hours:"{hours} uur",minute:"1 minuut",minutes:"{minutes} minuten",now:"nu",midnight:"middernacht",noon:"12 uur",at_sun_event:"bij {sunEvent}",sun_event_sunrise:"zonsopgang",sun_event_sunset:"zonsondergang"},Qr={one_additional_task:"1 overige taak",x_additional_tasks:"{count} overige taken"},Br={scheduler:"Tijdplanner",actions:Tr,instructions:Nr,fields:Rr,days_short:Fr,days_long:Ir,words:Mr,services:Lr,service_parameters:Vr,domains:Ur,days:qr,time:Hr,misc:Qr},Kr=Object.freeze({__proto__:null,scheduler:"Tijdplanner",actions:Tr,instructions:Nr,fields:Rr,days_short:Fr,days_long:Ir,words:Mr,services:Lr,service_parameters:Vr,domains:Ur,days:qr,time:Hr,misc:Qr,default:Br}),Gr={add:"legg til",cancel:"avbryt",next:"neste",save:"lagre",delete:"slett"},Wr={no_group_selected:"Velg en gruppe først",no_entity_selected:"Velg en entitet først",no_groups_defined:"Ingen grupper definert",no_entities_for_group:"Det finnes ingen entiteter i denne gruppen",no_actions_for_entity:"Det finnes ingen handlinger for denne entiteten",no_entries_defined:"Det er ingen definerte tidsplaner å vise"},Yr={group:"Gruppe",entity:"Entitet",action:"Handling",days:"Dager",time:"Tid",options:"Valg",day_type_daily:"hver dag",day_type_weekdays:"ukedager",day_type_weekend:"weekend",day_type_custom:"egendefinert"},Jr={mon:"man",tue:"tir",wed:"ons",thu:"tor",fri:"fre",sat:"lør",sun:"søn"},Zr={mon:"mandag",tue:"tirsdag",wed:"onsdag",thu:"torsdag",fri:"fredag",sat:"lørdag",sun:"søndag"},Xr={and:"og",before:"før",after:"etter"},ei={turn_on:"slå på",turn_on_brightness:"slå på {at brightness}",turn_off:"slå av",close_cover:"lukk",open_cover:"åpne",set_temperature:"sett temperatur {to temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"sett posisjon {to position}",set_hvac_mode:"set mode {to hvac_mode}",set_hvac_mode_hvac_mode_off:"slå av",set_preset_mode:"set preset {to preset_mode}",set_value:"set value {to value}",select_option:"select option {option}",select_source:"select source {source}",start:"start",run_script:"run"},ti={brightness:"brightness",temperature:"temperature",position:"position",hvac_mode:"mode",preset_mode:"preset"},ri={camera:"cameras",climate:"klima",cover:"cover",fan:"vifter",group:"groups",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",media_player:"media players",scene:"scenes",light:"lys",switch:"brytere",vacuum:"støvsugere"},ii={tomorrow:"tomorrow",daily:"daily",daily_except_days:"every day except {days}",working_days:"working days",weekend:"weekend",interval:"{startDay} to {endDay}"},si={absolute:"at {time}",relative:"in {time}",interval:"from {startTime} to {endTime}",seconds:"{seconds} seconds",hour:"1 hour",hours:"{hours} hours",minute:"1 minute",minutes:"{minutes} minutes",now:"now",midnight:"midnight",noon:"noon",at_sun_event:"at {sunEvent}",sun_event_sunrise:"sunrise",sun_event_sunset:"sunset"},ai={one_additional_task:"1 more task",x_additional_tasks:"{count} more tasks"},ni={scheduler:"Tidsplan",actions:Gr,instructions:Wr,fields:Yr,days_short:Jr,days_long:Zr,words:Xr,services:ei,service_parameters:ti,domains:ri,days:ii,time:si,misc:ai},oi=Object.freeze({__proto__:null,scheduler:"Tidsplan",actions:Gr,instructions:Wr,fields:Yr,days_short:Jr,days_long:Zr,words:Xr,services:ei,service_parameters:ti,domains:ri,days:ii,time:si,misc:ai,default:ni}),ci={add:"dodaj",cancel:"anuluj",next:"dalej",save:"zapisz",delete:"usuń"},li={no_group_selected:"Najpierw wybierz grupę",no_entity_selected:"Najpierw wybierz encję",no_groups_defined:"Nie ma zdefiniowanych grup",no_entities_for_group:"Nie ma encji w tej grupie",no_actions_for_entity:"Nie ma akcji dla tej encji",no_entries_defined:"Nie ma elementów do pokazania"},di={group:"Grupa",entity:"Encja",action:"Akcja",days:"Dni",time:"Czas",options:"Opcje",day_type_daily:"codziennie",day_type_workday:"dni robocze",day_type_weekend:"weekend",day_type_custom:"niestandardowy"},ui={mon:"pon.",tue:"wt.",wed:"śr.",thu:"czw.",fri:"pt.",sat:"sob.",sun:"niedz."},hi={mon:"poniedziałek",tue:"wtorek",wed:"środa",thu:"czwartek",fri:"piątek",sat:"sobota",sun:"niedziela"},pi={and:"oraz",before:"przed",after:"po"},mi={turn_on:"włącz",turn_on_brightness:"włącz {at brightness}",turn_off:"wyłącz",close_cover:"zamknij",open_cover:"otwórz",set_temperature:"ustaw temperaturę {to temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"ustaw pozycję {to position}",set_hvac_mode:"ustaw tryb {to hvac_mode}",set_hvac_mode_hvac_mode_off:"wyłącz",set_preset_mode:"ustaw preset {preset_mode}",set_value:"ustaw wartość {value}",select_option:"wybierz opcję {option}",select_source:"wybierz źródło {source}",start:"start",run_script:"start"},vi={brightness:"jasność",temperature:"temperatura",position:"pozycja",hvac_mode:"tryb",preset_mode:"preset"},fi={camera:"kamera",climate:"termostat",cover:"roleta",fan:"wentylator",group:"grupa",input_boolean:"wejście logiczne",input_number:"wejście liczbowe",input_select:"wybór wejścia",media_player:"odtwarzacz av",scene:"scena",light:"światło",switch:"włącznik",vacuum:"odkurzacz"},gi={tomorrow:"jutro",daily:"codziennie",daily_except_days:"codziennie za wyjątkiem {days}",working_days:"dni robocze",weekend:"weekend",interval:"{startDay} do {endDay}"},yi={absolute:"o {time}",relative:"za {time}",interval:"od {startTime} do {endTime}",seconds:"{seconds} sekund(a/y)",hour:"1 godzina",hours:"{hours} godzin(y)",minute:"1 minuta",minutes:"{minutes} minut(y)",now:"teraz",midnight:"północ",noon:"południe",at_sun_event:"o {sunEvent}",sun_event_sunrise:"wschodzie",sun_event_sunset:"zachodzie"},_i={one_additional_task:"jeszcze 1 zadanie",x_additional_tasks:"{count} więcej zadań"},bi={scheduler:"Harmonogram",actions:ci,instructions:li,fields:di,days_short:ui,days_long:hi,words:pi,services:mi,service_parameters:vi,domains:fi,days:gi,time:yi,misc:_i},wi=Object.freeze({__proto__:null,scheduler:"Harmonogram",actions:ci,instructions:li,fields:di,days_short:ui,days_long:hi,words:pi,services:mi,service_parameters:vi,domains:fi,days:gi,time:yi,misc:_i,default:bi}),Ei={add:"adicionar item",cancel:"cancelar",next:"próximo",save:"gravar",delete:"apagar"},Pi={no_group_selected:"Selecione um grupo primeiro",no_entity_selected:"Selecione uma entidade primeiro",no_groups_defined:"Não tem grupo definido",no_entities_for_group:"Não tem entidade no grupo",no_actions_for_entity:"Não há ações para esta entidade",no_entries_defined:"Não tem item pra mostar"},Si={group:"Grupo",entity:"Entidade",action:"Ação",days:"Dias",time:"Hora",options:"Opções",day_type_daily:"todos os dias",day_type_weekdays:"dias da semana",day_type_weekend:"final da semana",day_type_custom:"personalizado"},ki={mon:"seg",tue:"ter",wed:"qua",thu:"qui",fri:"sex",sat:"sab",sun:"dom"},xi={mon:"segunda",tue:"terça",wed:"quarta",thu:"quinta",fri:"sexta",sat:"sabádo",sun:"domingo"},$i={and:"e",before:"antes",after:"depois"},Oi={turn_on:"ligar",turn_on_brightness:"ligar {a brightness}",turn_off:"desligar",close_cover:"fechar",open_cover:"abrir",set_temperature:"ajustar temperatura {a temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"ajustar posição {a position}",set_hvac_mode:"set mode {to hvac_mode}",set_hvac_mode_hvac_mode_off:"turn off",set_preset_mode:"set preset {to preset_mode}",set_value:"set value {to value}",select_option:"select option {option}",select_source:"select source {source}",start:"start",run_script:"run"},ji={brightness:"Brilho",temperature:"Temperatura",position:"Posição",hvac_mode:"mode",preset_mode:"preset"},Ci={camera:"cameras",climate:"ar condicionado",cover:"persiana",fan:"ventilador",group:"groups",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",media_player:"media players",scene:"scenes",light:"luz",switch:"interruptor",vacuum:"aspirador"},Di={tomorrow:"tomorrow",daily:"daily",daily_except_days:"every day except {days}",working_days:"working days",weekend:"weekend",interval:"{startDay} to {endDay}"},zi={absolute:"at {time}",relative:"in {time}",interval:"from {startTime} to {endTime}",seconds:"{seconds} seconds",hour:"1 hour",hours:"{hours} hours",minute:"1 minute",minutes:"{minutes} minutes",now:"now",midnight:"midnight",noon:"noon",at_sun_event:"at {sunEvent}",sun_event_sunrise:"sunrise",sun_event_sunset:"sunset"},Ai={one_additional_task:"1 more task",x_additional_tasks:"{count} more tasks"},Ti={scheduler:"Agenda",actions:Ei,instructions:Pi,fields:Si,days_short:ki,days_long:xi,words:$i,services:Oi,service_parameters:ji,domains:Ci,days:Di,time:zi,misc:Ai},Ni=Object.freeze({__proto__:null,scheduler:"Agenda",actions:Ei,instructions:Pi,fields:Si,days_short:ki,days_long:xi,words:$i,services:Oi,service_parameters:ji,domains:Ci,days:Di,time:zi,misc:Ai,default:Ti}),Ri={add:"adaugă element",cancel:"abandon",next:"următorul",save:"salvează",delete:"șterge"},Fi={no_group_selected:"Prima dată selectați un grup",no_entity_selected:"Prima dată selectați o entitate",no_groups_defined:"Nu există grupuri definite",no_entities_for_group:"Nu există entități definite în acest grup",no_actions_for_entity:"Nu există acțiuni pentru această entitate",no_entries_defined:"Nu există elemente de afișat"},Ii={group:"Grup",entity:"Entitate",action:"Acțiune",days:"Zile",time:"Timp",options:"Opțiuni",day_type_daily:"zilnic",day_type_workday:"zile lucrătoare",day_type_weekend:"sfârșit de săptămână",day_type_custom:"personalizat"},Mi={mon:"lun",tue:"mar",wed:"mie",thu:"joi",fri:"vin",sat:"sâm",sun:"dum"},Li={mon:"Luni",tue:"Marți",wed:"Miercuri",thu:"Joi",fri:"Vineri",sat:"Sâmbătă",sun:"Duminică"},Vi={and:"și",before:"înainte",after:"după"},Ui={turn_on:"pornire",turn_on_brightness:"pornire {la brightness}",turn_off:"oprire",close_cover:"închidere",open_cover:"deschidere",set_temperature:"setare temperatură {la temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"setare poziție",set_hvac_mode:"setare mod {hvac_mode}",set_hvac_mode_hvac_mode_off:"oprire",set_preset_mode:"setare preset {preset_mode}",set_value:"setare valoare {value}",select_option:"selectare opțiune {option}",select_source:"selectare sursă {source}",start:"start",run_script:"run"},qi={brightness:"intensitate luminoasă",temperature:"temperatură",position:"poziție",hvac_mode:"mod",preset_mode:"preset"},Hi={camera:"camere",climate:"climat",cover:"jaluzele",fan:"ventilatoare",group:"grupuri",input_boolean:"input_boolean",input_number:"input_number",input_select:"input_select",light:"lumini",media_player:"media playere",scene:"scene",switch:"întrerupătpare",vacuum:"aspiratoare"},Qi={tomorrow:"mâine",daily:"zilnic",daily_except_days:"zilnic cu excepția {days}",working_days:"zile lucrătoare",weekend:"sfârșit de săptămână",interval:"{startDay} până la {endDay}"},Bi={absolute:"la {time}",relative:"în {time}",interval:"de la {startTime} la {endTime}",seconds:"{seconds} secunde",hour:"1 oră",hours:"{hours} ore",minute:"1 minut",minutes:"{minutes} minute",now:"acum",midnight:"miezul nopții",noon:"amiază",at_sun_event:"la {sunEvent}",sun_event_sunrise:"răsărit",sun_event_sunset:"apus"},Ki={one_additional_task:"încă o sarcină",x_additional_tasks:"încă {count} sarcini"},Gi={scheduler:"Planificator",actions:Ri,instructions:Fi,fields:Ii,days_short:Mi,days_long:Li,words:Vi,services:Ui,service_parameters:qi,domains:Hi,days:Qi,time:Bi,misc:Ki},Wi={add:"добавить",cancel:"отменить",next:"далее",save:"сохранить",delete:"удалить"},Yi={no_group_selected:"Необходимо выбрать группу",no_entity_selected:"Необходимо выбрать объект",no_groups_defined:"Ни одной группы не создано",no_entities_for_group:"В этой группе нет объектов",no_actions_for_entity:"Для этого объекта нет действий",no_entries_defined:"Объекты отсутствуют"},Ji={group:"Группа",entity:"Объект",action:"Действие",days:"Дни",time:"Время",options:"Опции",day_type_daily:"ежедневно",day_type_weekdays:"по будням",day_type_weekend:"weekend",day_type_custom:"выбрать дни"},Zi={mon:"пн",tue:"вт",wed:"ср",thu:"чт",fri:"пт",sat:"сб",sun:"вс"},Xi={mon:"понедельник",tue:"вторник",wed:"среда",thu:"четверг",fri:"пятница",sat:"суббота",sun:"воскресенье"},es={and:"и",before:"до",after:"после"},ts={turn_on:"включить",turn_on_brightness:"включить {brightness}",turn_off:"выключить",close_cover:"закрыть",open_cover:"открыть",set_temperature:"задать температуру {temperature}",set_temperature_hvac_mode_heat:"heat {to temperature}",set_temperature_hvac_mode_cool:"cool {to temperature}",set_cover_position:"установить позицию {position}",set_hvac_mode:"установить режим {hvac_mode}",set_hvac_mode_hvac_mode_off:"выключить",set_preset_mode:"выбрать набор настроек {preset_mode}",set_value:"установить значение {value}",select_option:"выбрать вариант {option}",select_source:"выбрать источник {source}",start:"запуск",run_script:"run"},rs={brightness:"Яркость",temperature:"Температура",position:"Позицию",hvac_mode:"mode",preset_mode:"preset"},is={camera:"Камеры",climate:"Климат",cover:"Жалюзи",fan:"Вентиляторы",group:"Группы",input_boolean:"Переключатели",input_number:"Числа",input_select:"Списки",media_player:"Медиаплееры",scene:"Сцены",light:"Освещение",switch:"Выключатели",vacuum:"Пылесосы"},ss={tomorrow:"tomorrow",daily:"daily",daily_except_days:"every day except {days}",working_days:"working days",weekend:"weekend",interval:"{startDay} to {endDay}"},as={absolute:"at {time}",relative:"in {time}",interval:"from {startTime} to {endTime}",seconds:"{seconds} seconds",hour:"1 hour",hours:"{hours} hours",minute:"1 minute",minutes:"{minutes} minutes",now:"now",midnight:"midnight",noon:"noon",at_sun_event:"at {sunEvent}",sun_event_sunrise:"sunrise",sun_event_sunset:"sunset"},ns={one_additional_task:"1 more task",x_additional_tasks:"{count} more tasks"},os={scheduler:"Планирование",actions:Wi,instructions:Yi,fields:Ji,days_short:Zi,days_long:Xi,words:es,services:ts,service_parameters:rs,domains:is,days:ss,time:as,misc:ns},cs={cs:qe,de:it,en:gt,es:Dt,et:Qt,es_419:Dt,fr:ar,hu:_r,it:Ar,nb:oi,nl:Kr,nn:oi,no:oi,pl:wi,pt:Ni,pt_BR:Ni,ro:Object.freeze({__proto__:null,scheduler:"Planificator",actions:Ri,instructions:Fi,fields:Ii,days_short:Mi,days_long:Li,words:Vi,services:Ui,service_parameters:qi,domains:Hi,days:Qi,time:Bi,misc:Ki,default:Gi}),ru:Object.freeze({__proto__:null,scheduler:"Планирование",actions:Wi,instructions:Yi,fields:Ji,days_short:Zi,days_long:Xi,words:es,services:ts,service_parameters:rs,domains:is,days:ss,time:as,misc:ns,default:os})};function ls(e,t="",r=""){const i=ds();var s;try{if("test"==i)return"TRANSLATED";s=e.split(".").reduce((e,t)=>e[t],cs[i])}catch(t){s=e.split(".").reduce((e,t)=>e[t],cs.en)}if(void 0===s&&(s=e.split(".").reduce((e,t)=>e[t],cs.en)),""!==t&&""!==r)if(Array.isArray(t)||Array.isArray(r))for(var a=0;a=0?Math.floor(e/60):Math.ceil(e/60),i=e-60*r;return i%t!=0&&(i=Math.round(i/t)*t),i>=60&&(r++,i-=60),r>=24&&(r-=24),60*r+i}function fs(e,t={}){const r=!!t.amPm&&t.amPm,i=!!t.absolute&&t.absolute;e>=1440&&(e-=1440);let s=e>=0?Math.floor(e/60):Math.ceil(e/60);const a=e-60*s;let n="";r&&(n=s>=12?"PM":"AM",(s>12||12==s&&a>0)&&(s-=12));const o=String(Math.abs(s)).padStart(2,"0"),c=String(Math.abs(a)).padStart(2,"0"),l=s<0||a<0;return{hours:o,minutes:c,time:`${l&&!i?"-":""}${o}:${c}${r?" "+n:""}`,signed:l,amPm:n}}function gs(e,t={}){const r=t.stepSize?t.stepSize:1,i=!!t.signed&&t.signed,s=t.max?t.max:1440,a=vs(e,r);return a<0&&!i?e+=1440:a>=1440&&(e-=1440),a<-s?-s:a>s?s:e}function ys(e){let t,r,i;if("object"==typeof e)return ys(`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`);if(null!==(i=/^([0-9]{2}):([0-9]{2})$/.exec(e)))[t,r]=[Number(i[1]),Number(i[2])];else if(null!==(i=/^([0-9]{2})([0-9]{2})$/.exec(e)))[t,r]=[Number(i[1]),Number(i[2])];else{if(null!==(i=/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}[\+|\-][0-9]{2}:[0-9]{2}$/.exec(e))){const e=new Date(i[0]);return ys(`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`)}console.log(`failed to parse timestamp '${e}'`)}return 60*t+r}function _s(e){return e.type==ms.Daily?[1,2,3,4,5,6,7]:e.type==ms.Workday?[1,2,3,4,5]:e.type==ms.Weekend?[6,7]:e.type==ms.Custom?e.custom_days:[]}function bs(e){return e==ps.Sunrise?"sunrise":"sunset"}function ws(e){let t=e.getDay();return 0==t&&(t=7),t}function Es(e,t){const r=new Date,i=Math.round((e.valueOf()-r.valueOf())/1e3);if(i<5)return ls("time.now");if(i<60)return ls("time.relative","{time}",ls("time.seconds","{seconds}",String(i)));if(i<3300){const e=i%60,t=Math.round(i/60);if(e<5||e>55)return ls("time.relative","{time}",1==t?ls("time.minute"):ls("time.minutes","{minutes}",String(t)));if(1==Math.floor(i/60)){const e=Math.round(i-60);return ls("time.relative","{time}",`${ls("time.minute")} ${ls("words.and")} ${ls("time.seconds","{seconds}",String(e))}`)}return ls("time.relative","{time}",ls("time.minutes","{minutes}",String(t)))}if(1==Math.floor(i/3600)){const e=Math.round(i/60-60);return ls("time.relative","{time}",`${ls("time.hour")} ${ls("words.and")} ${ls("time.minutes","{minutes}",String(e))}`)}const s=Math.round(i/3600);if(s<=6)return ls("time.relative","{time}",1==s?ls("time.hour"):ls("time.hours","{hours}",String(s)));const a=new Date;a.setHours(0,0,0,0);const n=Math.floor((e.valueOf()-a.valueOf())/864e5),o=""+fs(ys(e),{amPm:null==t?void 0:t.amPm}).time;return 0==n?12==e.getHours()&&0==e.getMinutes()?ls("time.absolute","{time}",ls("time.noon")):ls("time.absolute","{time}",o):1==n?0==e.getHours()&&0==e.getMinutes()?ls("time.absolute","{time}",ls("time.midnight")):12==e.getHours()&&0==e.getMinutes()?`${ls("days.tomorrow")} ${ls("time.absolute","{time}",ls("time.noon"))}`:`${ls("days.tomorrow")} ${ls("time.absolute","{time}",o)}`:`${function(e){switch(e){case 1:return ls("days_long.mon");case 2:return ls("days_long.tue");case 3:return ls("days_long.wed");case 4:return ls("days_long.thu");case 5:return ls("days_long.fri");case 6:return ls("days_long.sat");case 7:return ls("days_long.sun");default:return""}}(ws(e))} ${ls("time.absolute","{time}",o)}`}!function(e){e.Sunrise="SUNRISE",e.Sunset="SUNSET"}(ps||(ps={})),function(e){e.Daily="DAILY",e.Workday="WORKDAY",e.Weekend="WEEKEND",e.Custom="CUSTOM"}(ms||(ms={}));const Ps=[{id:1,name:ls("days_short.mon")},{id:2,name:ls("days_short.tue")},{id:3,name:ls("days_short.wed")},{id:4,name:ls("days_short.thu")},{id:5,name:ls("days_short.fri")},{id:6,name:ls("days_short.sat")},{id:7,name:ls("days_short.sun")}],Ss=[{id:ms.Daily,name:ls("fields.day_type_daily")},{id:ms.Workday,name:ls("fields.day_type_workday")},{id:ms.Weekend,name:ls("fields.day_type_weekend")},{id:ms.Custom,name:ls("fields.day_type_custom")}];var ks;!function(e){e.Overview="OVERVIEW",e.NewSchedule="NEW_SCHEDULE",e.TimePicker="TIME_PICKER",e.TimeScheme="TIME_SCHEME",e.Options="OPTIONS"}(ks||(ks={}));const xs={service:"turn_on",icon:"power"},$s={service:"turn_off",icon:"power-off"},Os=/^([0-9]+)?D([0-7]+)?T([0-9SRDUW]+)T?([0-9SRDUW]+)?(A[A0-9]+)+(C([C0-9]+))?(F([F0-9]+))?$/,js=/^([0-9]{4})?([SRDUW]{2})([0-9]{4})?$/;function Cs(e){var t,r,i;const s=Os.exec(e),a={time:{value:0},days:{type:ms.Daily},actions:[]};if(s[1])"15"==s[1]?Object.assign(a,{days:{type:ms.Workday}}):"67"==s[1]&&Object.assign(a,{days:{type:ms.Weekend}});else{const e=s[2].split("").map(Number);e.sort(),1==e.length&&0==e[0]||Object.assign(a,{days:{type:ms.Custom,custom_days:e.filter(e=>0!=e)}})}const n=js.exec(s[3]);if(n?Object.assign(a,{time:{event:"SR"==n[2]?ps.Sunrise:ps.Sunset,value:n[1]?-ys(n[1]):ys(n[3])}}):Object.assign(a,{time:{value:ys(s[3])}}),s[4]){const e=js.exec(s[4]);e?Object.assign(a,{endTime:{event:"SR"==e[2]?ps.Sunrise:ps.Sunset,value:e[1]?-ys(e[1]):ys(e[4])}}):Object.assign(a,{endTime:{value:ys(s[4])}})}const o=null===(t=s[5].match(/A[0-9]+/g))||void 0===t?void 0:t.map(e=>Number(e.substring(1)));if(Object.assign(a,{actions:o}),s[6]){let e=null===(r=s[6].match(/C[0-9]+/g))||void 0===r?void 0:r.map(e=>Number(e.substring(1)));1==(null==e?void 0:e.length)&&s[7].length>1?(e=s[7].split("").map(Number),Object.assign(a,{conditions:{type:Oe.All,items:e}})):Object.assign(a,{conditions:{type:Oe.Any,items:e}})}if(s[8]){const e=null===(i=s[8].match(/F[0-9]+/g))||void 0===i?void 0:i.map(e=>Number(e.substring(1)));Object.assign(a,{options:e})}return a}const Ds=["disarmed","armed_away","armed_home","armed_night"];function zs(e){return{type:xe.Level,field:e.field,min:e.min||0,max:e.max||255,step:e.step||1,optional:e.optional||!1,unit:e.unit||""}}function As(e){return{type:xe.List,field:e.field,options:e.options}}function Ts(e,t={}){let r={value:String(e)};return t.icons&&e in t.icons&&(r=Object.assign(Object.assign({},r),{icon:t.icons[e]})),t.name&&(r=Object.assign(Object.assign({},r),{name:t.name})),r}const Ns={heat:"fire",cool:"snowflake",heat_cool:"thermometer",auto:"autorenew",dry:"water-percent",fan_only:"fan"};const Rs=e=>{switch(e.attributes.device_class){case"garage":return"garage";case"door":return"door-closed";case"shutter":return"window-shutter";case"blind":return"blinds";case"window":return"window-closed";default:return"window-shutter"}},Fs=e=>{switch(e.attributes.device_class){case"garage":return"garage-open";case"door":return"door-open";case"shutter":return"window-shutter-open";case"blind":return"blinds-open";case"window":return"window-open";default:return"window-shutter-open"}},Is=["open","closed"];const Ms={normal:"account-outline",eco:"leaf",away:"car-traction-control",boost:"rocket-launch-outline",comfort:"car-seat-cooler",home:"home-outline",sleep:"sleep",auto:"autorenew",baby:"baby-bottle-outline"};const Ls=[{service:"unlock",icon:"lock-open-variant-outline"},{service:"lock",icon:"lock-outline"}],Vs=["locked","unlocked"];function Us(e){const t=Se(e.entity_id);e.attributes.supported_features;switch(t){case"alarm_control_panel":return(e=>{const t=e.attributes.supported_features;let r=[{service:"alarm_disarm",icon:"lock-open-variant-outline"}];return 1&t&&r.push({service:"alarm_arm_home",icon:"home-outline"}),2&t&&r.push({service:"alarm_arm_away",icon:"exit-run"}),4&t&&r.push({service:"alarm_arm_night",icon:"power-sleep"}),16&t&&r.push({service:"alarm_arm_custom_bypass",icon:"shield-lock-outline"}),r})(e);case"climate":return function(e){const t=e.attributes.supported_features,r=e.attributes.preset_modes,i=e.attributes.hvac_modes,s=i.filter(e=>!["off","heat","cool","heat_cool"].includes(e)),a=zs({field:"temperature",min:e.attributes.min_temp,max:e.attributes.max_temp,step:.5});let n=[];return i.includes("off")?n.push({service:"set_hvac_mode",service_data:{hvac_mode:"off"},icon:"power"}):n.push($s),i.includes("heat")&&1&t&&n.push({service:"set_temperature",service_data:{hvac_mode:"heat"},variable:a,icon:Ns.heat}),i.includes("cool")&&1&t&&n.push({service:"set_temperature",service_data:{hvac_mode:"cool"},variable:a,icon:Ns.cool}),s.length&&n.push({service:"set_hvac_mode",variable:As({field:"hvac_mode",options:s.map(e=>Ts(e,{icons:Ns}))}),icon:"cog-transfer-outline"}),r&&r.length&&16&t&&n.push({service:"set_preset_mode",variable:As({field:"preset_mode",options:r.map(e=>Ts(e))}),icon:"cloud-download-outline"}),n}(e);case"cover":return function(e){const t=e.attributes.supported_features;let r=[{service:"open_cover",icon:Fs(e)},{service:"close_cover",icon:Rs(e)}];return 4&t&&r.push({supported_feature:4,service:"set_cover_position",variable:zs({field:"position",min:0,max:100,unit:"%"}),icon:"ray-vertex"}),r}(e);case"fan":return function(e){const t=e.attributes.supported_features,r=e.attributes.speed_list;let i=[xs,$s];return 1&t&&r&&r.length>1&&i.push({service:"set_speed",variable:As({field:"speed",options:r})}),2&t&&i.push({service:"oscillate",variable:As({field:"oscillating",options:[{value:"True"},{value:"False"}]}),icon:"arrow-left-right"}),4&t&&i.push({service:"set_direction",variable:As({field:"direction",options:[{value:"forward"},{value:"reverse"}]}),icon:"autorenew"}),i}(e);case"humidifer":return function(e){const t=e.attributes.supported_features,r=e.attributes.available_modes,i=zs({field:"humidity",min:e.attributes.min_humidity,max:e.attributes.max_humidity,step:1,unit:"%"});let s=[];return s.push({service:"set_humidity",variable:i}),r&&r.length>1&&1&t&&s.push({service:"set_mode",variable:As({field:"mode",options:r.map(e=>Ts(e,{icons:Ms}))})}),s}(e);case"input_boolean":return[Object.assign(Object.assign({},xs),{icon:"flash"}),Object.assign(Object.assign({},$s),{icon:"flash-off"})];case"input_number":return function(e){return[{service:"set_value",variable:zs({field:"value",min:Number(e.attributes.min),max:Number(e.attributes.max),step:Number(e.attributes.step)}),icon:"counter"}]}(e);case"input_select":return function(e){const t=e.attributes.options;return t.length<2?[]:[{service:"select_option",variable:As({field:"option",options:t.map(e=>({value:e}))}),icon:"counter"}]}(e);case"light":return function(e){const t=e.attributes.supported_features,r=zs({field:"brightness",min:0,max:255,unit:"%",optional:!0});let i=[];return i.push(Object.assign(Object.assign({},$s),{icon:"lightbulb-off"})),1&t?i.push(Object.assign(Object.assign({},xs),{icon:"lightbulb",variable:r})):i.push(Object.assign(Object.assign({},xs),{icon:"lightbulb"})),i}(e);case"lock":return Ls;case"media_player":return function(e){const t=Array(e.attributes.source_list),r=e.attributes.supported_features;let i=[];return 128&r&&i.push(xs),256&r&&i.push($s),2048&r&&t.length>1&&i.push({service:"select_source",variable:As({field:"source",options:t.map(e=>({value:e}))}),icon:"music-box-multiple-outline"}),i}(e);case"scene":return[Object.assign(Object.assign({},xs),{icon:"play"})];case"script":return function(e){let t=[xs,$s];return t.push({service:ke(e.entity_id),icon:"play",name:ls("services.run_script")}),t}(e);case"switch":return[Object.assign(Object.assign({},xs),{icon:"flash"}),Object.assign(Object.assign({},$s),{icon:"flash-off"})];case"vacuum":return function(e){const t=e.attributes.supported_features;let r=[];return 1&t&&r.push(xs),8192&t&&r.push({service:"start",icon:"play-circle-outline"}),4&t&&r.push({service:"start_pause",icon:"play-circle-outline"}),r}(e);case"water_heater":return function(e){const t=e.attributes.supported_features,r=e.attributes.operation_list,i=zs({field:"temperature",min:e.attributes.min_temp,max:e.attributes.max_temp,step:.5});let s=[];return 1&t&&s.push({service:"set_temperature",variable:i,icon:"thermometer"}),2&t&&s.push({service:"set_operation_mode",variable:As({field:"operation_mode",options:r.map(e=>({value:e}))}),icon:"cog-transfer-outline"}),4&t&&s.push({service:"set_away_mode",variable:As({field:"mode",options:[{value:"on",icon:"toggle-switch-outline"},{value:"off",icon:"toggle-switch-off-outline"}]}),icon:"car-traction-control"}),s}(e);default:return[]}}function qs(e,t){let r=!1;if(e.match(/^[a-z0-9_\.]+$/))r=e.includes(".")?e==t:e==Se(t);else try{if(e.startsWith("/")&&e.endsWith("/")||-1!==e.indexOf("*")){e.startsWith("/")||(e=`/^${e=e.replace(/\./g,".").replace(/\*/g,".*")}$/`);r=new RegExp(e.slice(1,-1)).test(t)}}catch(e){}return r}function Hs(e,t){return!(!t.include||!t.include.length)&&(!(t.include&&!t.include.find(t=>qs(t,e)))&&(!t.exclude||!t.exclude.find(t=>qs(t,e))))}const Qs={alarm_control_panel:"alarm-light-outline",automation:"playlist-play",binary_sensor:"radiobox-blank",camera:"camera",climate:"home-thermometer-outline",cover:"window-shutter",device_tracker:"account",fan:"fan",group:"google-circles-communities",humidifier:"air-humidifier",input_boolean:"drawing",input_number:"ray-vertex",input_select:"format-list-bulleted",input_text:"textbox",light:"lightbulb-outline",lock:"lock-open-outline",media_player:"cast-connected",notify:"comment-alert",person:"account-outline",remote:"remote",scene:"palette-outline",script:"file-document",sensor:"eye",switch:"flash",timer:"timer",vacuum:"robot-vacuum",water_heater:"water-boiler"},Bs=e=>{const t=Se(e.entity_id);switch(t){case"binary_sensor":return(e=>{switch(e.attributes.device_class){case"battery":return"battery-outline";case"cold":return"snowflake";case"connectivity":return"server-network";case"door":return"door-closed";case"garage_door":return"hass:garage";case"gas":case"power":case"problem":case"safety":case"smoke":return"shield-check";case"heat":return"fire";case"light":return"brightness-5";case"lock":return"lock";case"moisture":return"water";case"motion":return"walk";case"occupancy":case"presence":return"home-outline";case"opening":return"hass:square";case"plug":return"hass:power-plug-outline";case"sound":return"music-note";case"vibration":return"vibrate";case"window":return"window-closed";default:return"radiobox-blank"}})(e);case"cover":return Rs(e);case"sensor":return(e=>{switch(e.attributes.device_class){case"humidity":return"water-percent";case"illuminance":return"brightness-5";case"temperature":return"thermometer";case"power":return"flash";case"pressure":return"gauge";case"signal_strength":return"wifi";default:return"°C"==e.attributes.unit_of_measurement||"°F"==e.attributes.unit_of_measurement?"thermometer":"eye"}})(e);default:return t in Qs?Qs[t]:"folder-outline"}},Ks=e=>{switch(Se(e.entity_id)){case"alarm_control_panel":return Ds;case"binary_sensor":case"cover":return Is;case"input_boolean":case"switch":return["on","off"];case"lock":return Vs;case"person":return["home","not_home"];default:return}};function Gs(e,t){return e?Object.entries(e).filter(([e])=>t.includes(e)).reduce((e,[t,r])=>Object.assign(e,{[t]:r}),{}):{}}function Ws(e,t){return e?Object.entries(e).filter(([e])=>!t.includes(e)).reduce((e,[t,r])=>Object.assign(e,{[t]:r}),{}):{}}function Ys(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Js(e){return"string"!=typeof e&&(e=String(e)),Ys(e.replace(/_/g," "))}function Zs(e){if(e)return"string"!=typeof e&&(e=String(e)),e.match(/^[a-z]+:[a-z0-9-]+$/i)?e:"hass:"+e}function Xs(e){const t=e=>Object.entries(e).sort((e,t)=>e[0]>t[0]?1:-1).map(([e,r])=>[e,"object"==typeof r&&null!==r?t(r):r]).reduce((e,[t,r])=>Object.assign(e,{[t]:r}),{});let r=Gs(e,["service","service_data"]);r=t(r);return Object.values(r).map(e=>JSON.stringify(e).replace(/[\W]/g," ").split(" ").filter(e=>" "!=e&&""!=e).join("_")).join("_")}function ea(e){const t=e.service;let r={id:"",name:e.name,icon:e.icon||"flash",service:t};return e.service_data&&Object.keys(e.service_data).length&&Object.assign(r,{service_data:e.service_data}),e.variable&&Object.assign(r,{variable:e.variable}),Object.assign(r,{id:Xs(r)}),r}function ta(e){let t=e.entity,r=e.service;const i=Se(t),s=Se(r);i&&s?i==s&&(r=ke(r)):i||(t=s+"."+t,r=ke(r));let a=Ws(e,["service","entity","service_data"]),n={entity:t,service:r};return a=Object.assign(Object.assign({},a),e.service_data),Object.keys(a).length&&(n=Object.assign(Object.assign({},n),{service_data:a})),n}function ra(e,t){const r=e.actions.map(ea),i=Xs(Ws(t,["entity"]));return r.map(e=>{if(e.id==i)return!0;if(e.variable&&t.service_data&&Object.keys(t.service_data).includes(e.variable.field)){let r=Object.entries(t.service_data).filter(([t])=>t!=e.variable.field).reduce((e,[t,r])=>Object.assign(e,{[t]:r}),{}),i=Object.keys(r).length?Object.assign(Object.assign({},t),{service_data:r}):Ws(t,["service_data"]);return e.id==Xs(i)}return!1}).map((e,t)=>e?t:null).filter(e=>null!==e)}function ia(e,t){const r=ra(e,t);return r.length?ea(e.actions[r[0]]):ea(Ws(t,["entity"]))}function sa(e){return e.match(/^switch.schedule_[0-9a-f]{6}$/)}function aa(e,t){if(!e)return;const r="string"==typeof e?e:e.entity_id;let i={id:r,name:e.attributes.friendly_name||ke(r),icon:"folder-outline",actions:[]};if((void 0===t.standard_configuration||t.standard_configuration)&&(i=Object.assign(Object.assign({},i),{actions:[...Us(e)],icon:Bs(e),states:Ks(e)})),i=Object.assign(Object.assign({},i),{icon:e.attributes.icon||i.icon}),t.customize){Object.entries(t.customize).filter(([e])=>qs(e,r)).map(([,e])=>e).forEach(e=>{if(i=Object.assign(Object.assign({},i),Ws(e,["actions","actions_hidden"])),e.actions&&e.actions.forEach(e=>{const t=ra(i,e);let r=i.actions;t.length?r=i.actions.map((r,i)=>t.includes(i)?Object.assign(r,e):r):i.actions.push(e),i=Object.assign(Object.assign({},i),{actions:r})}),e.actions_hidden){let t=i.actions;e.actions_hidden.forEach(e=>{t=t.filter(t=>ea(t).id!==e)}),i=Object.assign(Object.assign({},i),{actions:t})}})}return i}function na(e,t,r){const i=e.entity_id;if(sa(i))return!1;if(!(Hs(i,t)||t.groups&&t.groups.some(e=>Hs(i,e))))return!1;if(r){const i=aa(e,t);if(!i)return!1;if(r.states&&!i.states)return!1;if(r.actions&&!i.actions.length)return!1}return!0}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function oa(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}var ca=oa((function(e,t){ /** @license URI.js v4.4.0 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ -!function(e){function t(){for(var e=arguments.length,t=Array(e),r=0;r1){t[0]=t[0].slice(0,-1);for(var i=t.length-1,s=1;s= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,v=String.fromCharCode;function f(e){throw new RangeError(p[e])}function g(e,t){var r=e.split("@"),i="";r.length>1&&(i=r[0]+"@",e=r[1]);var s=function(e,t){for(var r=[],i=e.length;i--;)r[i]=t(e[i]);return r}((e=e.replace(h,".")).split("."),t).join(".");return i+s}function y(e){for(var t=[],r=0,i=e.length;r=55296&&s<=56319&&r>1,e+=m(e/t);e>455;i+=36)e=m(e/35);return m(i+36*e/(e+38))},w=function(e){var t,r=[],i=e.length,s=0,a=128,n=72,o=e.lastIndexOf("-");o<0&&(o=0);for(var c=0;c=128&&f("not-basic"),r.push(e.charCodeAt(c));for(var d=o>0?o+1:0;d=i&&f("invalid-input");var v=(t=e.charCodeAt(d++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:36;(v>=36||v>m((l-s)/h))&&f("overflow"),s+=v*h;var g=p<=n?1:p>=n+26?26:p-n;if(vm(l/y)&&f("overflow"),h*=y}var _=r.length+1;n=b(s-u,_,0==u),m(s/_)>l-a&&f("overflow"),a+=m(s/_),s%=_,r.splice(s++,0,a)}return String.fromCodePoint.apply(String,r)},E=function(e){var t=[],r=(e=y(e)).length,i=128,s=0,a=72,n=!0,o=!1,c=void 0;try{for(var d,u=e[Symbol.iterator]();!(n=(d=u.next()).done);n=!0){var h=d.value;h<128&&t.push(v(h))}}catch(e){o=!0,c=e}finally{try{!n&&u.return&&u.return()}finally{if(o)throw c}}var p=t.length,g=p;for(p&&t.push("-");g=i&&$m((l-s)/O)&&f("overflow"),s+=(w-i)*O,i=w;var j=!0,C=!1,D=void 0;try{for(var A,z=e[Symbol.iterator]();!(j=(A=z.next()).done);j=!0){var T=A.value;if(Tl&&f("overflow"),T==i){for(var N=s,R=36;;R+=36){var F=R<=a?1:R>=a+26?26:R-a;if(N>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function $(e){for(var t="",r=0,i=e.length;r=194&&s<224){if(i-r>=6){var a=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&s)<<6|63&a)}else t+=e.substr(r,6);r+=6}else if(s>=224){if(i-r>=9){var n=parseInt(e.substr(r+4,2),16),o=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&s)<<12|(63&n)<<6|63&o)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function O(e,t){function r(e){var r=$(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,x).replace(t.PCT_ENCODED,s)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,x).replace(t.PCT_ENCODED,s)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,x).replace(t.PCT_ENCODED,s)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,x).replace(t.PCT_ENCODED,s)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,x).replace(t.PCT_ENCODED,s)),e}function j(e){return e.replace(/^0*(.*)/,"$1")||"0"}function C(e,t){var r=e.match(t.IPV4ADDRESS)||[],i=c(r,2)[1];return i?i.split(".").map(j).join("."):e}function D(e,t){var r=e.match(t.IPV6ADDRESS)||[],i=c(r,3),s=i[1],a=i[2];if(s){for(var n=s.toLowerCase().split("::").reverse(),o=c(n,2),l=o[0],d=o[1],u=d?d.split(":").map(j):[],h=l.split(":").map(j),p=t.IPV4ADDRESS.test(h[h.length-1]),m=p?7:8,v=h.length-m,f=Array(m),g=0;g1){var b=f.slice(0,y.index),w=f.slice(y.index+y.length);_=b.join(":")+"::"+w.join(":")}else _=f.join(":");return a&&(_+="%"+a),_}return e}var A=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,z=void 0==="".match(/(){0}/)[1];function T(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},i=!1!==t.iri?o:n;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var s=e.match(A);if(s){z?(r.scheme=s[1],r.userinfo=s[3],r.host=s[4],r.port=parseInt(s[5],10),r.path=s[6]||"",r.query=s[7],r.fragment=s[8],isNaN(r.port)&&(r.port=s[5])):(r.scheme=s[1]||void 0,r.userinfo=-1!==e.indexOf("@")?s[3]:void 0,r.host=-1!==e.indexOf("//")?s[4]:void 0,r.port=parseInt(s[5],10),r.path=s[6]||"",r.query=-1!==e.indexOf("?")?s[7]:void 0,r.fragment=-1!==e.indexOf("#")?s[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?s[4]:void 0)),r.host&&(r.host=D(C(r.host,i),i)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var a=k[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||a&&a.unicodeSupport)O(r,i);else{if(r.host&&(t.domainHost||a&&a.domainHost))try{r.host=P(r.host.replace(i.PCT_ENCODED,$).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}O(r,n)}a&&a.parse&&a.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}function N(e,t){var r=!1!==t.iri?o:n,i=[];return void 0!==e.userinfo&&(i.push(e.userinfo),i.push("@")),void 0!==e.host&&i.push(D(C(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(i.push(":"),i.push(String(e.port))),i.length?i.join(""):void 0}var R=/^\.\.?\//,F=/^\/\.(\/|$)/,I=/^\/\.\.(\/|$)/,M=/^\/?(?:.|\n)*?(?=\/|$)/;function L(e){for(var t=[];e.length;)if(e.match(R))e=e.replace(R,"");else if(e.match(F))e=e.replace(F,"/");else if(e.match(I))e=e.replace(I,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(M);if(!r)throw new Error("Unexpected dot segment condition");var i=r[0];e=e.slice(i.length),t.push(i)}return t.join("")}function V(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?o:n,i=[],s=k[(t.scheme||e.scheme||"").toLowerCase()];if(s&&s.serialize&&s.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||s&&s.domainHost)try{e.host=t.iri?S(e.host):P(e.host.replace(r.PCT_ENCODED,$).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}O(e,r),"suffix"!==t.reference&&e.scheme&&(i.push(e.scheme),i.push(":"));var a=N(e,t);if(void 0!==a&&("suffix"!==t.reference&&i.push("//"),i.push(a),e.path&&"/"!==e.path.charAt(0)&&i.push("/")),void 0!==e.path){var c=e.path;t.absolutePath||s&&s.absolutePath||(c=L(c)),void 0===a&&(c=c.replace(/^\/\//,"/%2F")),i.push(c)}return void 0!==e.query&&(i.push("?"),i.push(e.query)),void 0!==e.fragment&&(i.push("#"),i.push(e.fragment)),i.join("")}function U(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments[3],s={};return i||(e=T(V(e,r),r),t=T(V(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(s.scheme=t.scheme,s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=L(t.path||""),s.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=L(t.path||""),s.query=t.query):(t.path?("/"===t.path.charAt(0)?s.path=L(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?s.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:s.path=t.path:s.path="/"+t.path,s.path=L(s.path)),s.query=t.query):(s.path=e.path,void 0!==t.query?s.query=t.query:s.query=e.query),s.userinfo=e.userinfo,s.host=e.host,s.port=e.port),s.scheme=e.scheme),s.fragment=t.fragment,s}function q(e,t){return e&&e.toString().replace(t&&t.iri?o.PCT_ENCODED:n.PCT_ENCODED,$)}var H={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var r="https"===String(e.scheme).toLowerCase();return e.port!==(r?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},Q={scheme:"https",domainHost:H.domainHost,parse:H.parse,serialize:H.serialize};function B(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var K={scheme:"ws",domainHost:!0,parse:function(e,t){var r=e;return r.secure=B(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(e,t){if(e.port!==(B(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var r=e.resourceName.split("?"),i=c(r,2),s=i[0],a=i[1];e.path=s&&"/"!==s?s:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},G={scheme:"wss",domainHost:K.domainHost,parse:K.parse,serialize:K.serialize},W={},Y="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",J="[0-9A-Fa-f]",Z=r(r("%[EFef]"+J+"%"+J+J+"%"+J+J)+"|"+r("%[89A-Fa-f]"+J+"%"+J+J)+"|"+r("%"+J+J)),X=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),ee=new RegExp(Y,"g"),te=new RegExp(Z,"g"),re=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',X),"g"),ie=new RegExp(t("[^]",Y,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),se=ie;function ae(e){var t=$(e);return t.match(ee)?t:e}var ne={scheme:"mailto",parse:function(e,t){var r=e,i=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var s=!1,a={},n=r.query.split("&"),o=0,c=n.length;o=55296&&t<=56319&&s=t)throw new Error("Cannot access property/index "+i+" levels up, current level is "+t);return r[t-i]}if(i>t)throw new Error("Cannot access data "+i+" levels up, current level is "+t);if(a="data"+(t-i||""),!s)return a}for(var o=a,c=s.split("/"),l=0;l=0?{index:i,compiling:!0}:(i=this._compilations.length,this._compilations[i]={schema:e,root:t,baseId:r},{index:i,compiling:!1})}function Ta(e,t,r){var i=Na.call(this,e,t,r);i>=0&&this._compilations.splice(i,1)}function Na(e,t,r){for(var i=0;i%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,Ga=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,Wa=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,Ya=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Ja=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,Za=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,Xa=en;function en(e){return e="full"==e?"full":"fast",Ys.copy(en[e])}function tn(e){var t=e.match(Ua);if(!t)return!1;var r=+t[1],i=+t[2],s=+t[3];return i>=1&&i<=12&&s>=1&&s<=(2==i&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:qa[i])}function rn(e,t){var r=e.match(Ha);if(!r)return!1;var i=r[1],s=r[2],a=r[3],n=r[5];return(i<=23&&s<=59&&a<=59||23==i&&59==s&&60==a)&&(!t||n)}en.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":Ka,url:Ga,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:Qa,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:on,uuid:Wa,"json-pointer":Ya,"json-pointer-uri-fragment":Ja,"relative-json-pointer":Za},en.full={date:tn,time:rn,"date-time":function(e){var t=e.split(sn);return 2==t.length&&tn(t[0])&&rn(t[1],!0)},uri:function(e){return an.test(e)&&Ba.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":Ka,url:Ga,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:Qa,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:on,uuid:Wa,"json-pointer":Ya,"json-pointer-uri-fragment":Ja,"relative-json-pointer":Za};var sn=/t|\s/i;var an=/\/|:/;var nn=/[^\\]\\Z/;function on(e){if(nn.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}var cn=function(e,t,r){var i,s=" ",a=e.level,n=e.dataLevel,o=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(n||""),h=e.opts.$data&&o&&o.$data;h?(s+=" var schema"+a+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=o;var p="maximum"==t,m=p?"exclusiveMaximum":"exclusiveMinimum",v=e.schema[m],f=e.opts.$data&&v&&v.$data,g=p?"<":">",y=p?">":"<",_=void 0;if(!h&&"number"!=typeof o&&void 0!==o)throw new Error(t+" must be number");if(!f&&void 0!==v&&"number"!=typeof v&&"boolean"!=typeof v)throw new Error(m+" must be number or boolean");if(f){var b=e.util.getData(v.$data,n,e.dataPathArr),w="exclusive"+a,E="exclType"+a,P="exclIsNumber"+a,S="' + "+($="op"+a)+" + '";s+=" var schemaExcl"+a+" = "+b+"; ",s+=" var "+w+"; var "+E+" = typeof "+(b="schemaExcl"+a)+"; if ("+E+" != 'boolean' && "+E+" != 'undefined' && "+E+" != 'number') { ";var k;_=m;(k=k||[]).push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(_||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(s+=" , message: '"+m+" should be boolean' "),e.opts.verbose&&(s+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var x=s;s=k.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+x+"]); ":s+=" validate.errors = ["+x+"]; return false; ":s+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else if ( ",h&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),s+=" "+E+" == 'number' ? ( ("+w+" = "+i+" === undefined || "+b+" "+g+"= "+i+") ? "+u+" "+y+"= "+b+" : "+u+" "+y+" "+i+" ) : ( ("+w+" = "+b+" === true) ? "+u+" "+y+"= "+i+" : "+u+" "+y+" "+i+" ) || "+u+" !== "+u+") { var op"+a+" = "+w+" ? '"+g+"' : '"+g+"='; ",void 0===o&&(_=m,l=e.errSchemaPath+"/"+m,i=b,h=f)}else{S=g;if((P="number"==typeof v)&&h){var $="'"+S+"'";s+=" if ( ",h&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),s+=" ( "+i+" === undefined || "+v+" "+g+"= "+i+" ? "+u+" "+y+"= "+v+" : "+u+" "+y+" "+i+" ) || "+u+" !== "+u+") { "}else{P&&void 0===o?(w=!0,_=m,l=e.errSchemaPath+"/"+m,i=v,y+="="):(P&&(i=Math[p?"min":"max"](v,o)),v===(!P||i)?(w=!0,_=m,l=e.errSchemaPath+"/"+m,y+="="):(w=!1,S+="="));$="'"+S+"'";s+=" if ( ",h&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),s+=" "+u+" "+y+" "+i+" || "+u+" !== "+u+") { "}}_=_||t,(k=k||[]).push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(_||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { comparison: "+$+", limit: "+i+", exclusive: "+w+" } ",!1!==e.opts.messages&&(s+=" , message: 'should be "+S+" ",s+=h?"' + "+i:i+"'"),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";x=s;return s=k.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+x+"]); ":s+=" validate.errors = ["+x+"]; return false; ":s+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",d&&(s+=" else { "),s},ln=function(e,t,r){var i,s=" ",a=e.level,n=e.dataLevel,o=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(n||""),h=e.opts.$data&&o&&o.$data;if(h?(s+=" var schema"+a+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=o,!h&&"number"!=typeof o)throw new Error(t+" must be number");s+="if ( ",h&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),s+=" "+u+".length "+("maxItems"==t?">":"<")+" "+i+") { ";var p=t,m=m||[];m.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(p||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have ",s+="maxItems"==t?"more":"fewer",s+=" than ",s+=h?"' + "+i+" + '":""+o,s+=" items' "),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var v=s;return s=m.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+v+"]); ":s+=" validate.errors = ["+v+"]; return false; ":s+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",d&&(s+=" else { "),s},dn=function(e,t,r){var i,s=" ",a=e.level,n=e.dataLevel,o=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(n||""),h=e.opts.$data&&o&&o.$data;if(h?(s+=" var schema"+a+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=o,!h&&"number"!=typeof o)throw new Error(t+" must be number");var p="maxLength"==t?">":"<";s+="if ( ",h&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),!1===e.opts.unicode?s+=" "+u+".length ":s+=" ucs2length("+u+") ",s+=" "+p+" "+i+") { ";var m=t,v=v||[];v.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(m||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT be ",s+="maxLength"==t?"longer":"shorter",s+=" than ",s+=h?"' + "+i+" + '":""+o,s+=" characters' "),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var f=s;return s=v.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+f+"]); ":s+=" validate.errors = ["+f+"]; return false; ":s+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",d&&(s+=" else { "),s},un=function(e,t,r){var i,s=" ",a=e.level,n=e.dataLevel,o=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(n||""),h=e.opts.$data&&o&&o.$data;if(h?(s+=" var schema"+a+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=o,!h&&"number"!=typeof o)throw new Error(t+" must be number");s+="if ( ",h&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),s+=" Object.keys("+u+").length "+("maxProperties"==t?">":"<")+" "+i+") { ";var p=t,m=m||[];m.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(p||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have ",s+="maxProperties"==t?"more":"fewer",s+=" than ",s+=h?"' + "+i+" + '":""+o,s+=" properties' "),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var v=s;return s=m.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+v+"]); ":s+=" validate.errors = ["+v+"]; return false; ":s+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",d&&(s+=" else { "),s},hn={$ref:function(e,t,r){var i,s,a=" ",n=e.level,o=e.dataLevel,c=e.schema[t],l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(o||""),h="valid"+n;if("#"==c||"#/"==c)e.isRoot?(i=e.async,s="validate"):(i=!0===e.root.schema.$async,s="root.refVal[0]");else{var p=e.resolveRef(e.baseId,c,e.isRoot);if(void 0===p){var m=e.MissingRefError.message(e.baseId,c);if("fail"==e.opts.missingRefs){e.logger.error(m),(y=y||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { ref: '"+e.util.escapeQuotes(c)+"' } ",!1!==e.opts.messages&&(a+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(c)+"' "),e.opts.verbose&&(a+=" , schema: "+e.util.toQuotedString(c)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var v=a;a=y.pop(),!e.compositeRule&&d?e.async?a+=" throw new ValidationError(["+v+"]); ":a+=" validate.errors = ["+v+"]; return false; ":a+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",d&&(a+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,c,m);e.logger.warn(m),d&&(a+=" if (true) { ")}}else if(p.inline){var f=e.util.copy(e);f.level++;var g="valid"+f.level;f.schema=p.schema,f.schemaPath="",f.errSchemaPath=c,a+=" "+e.validate(f).replace(/validate\.schema/g,p.code)+" ",d&&(a+=" if ("+g+") { ")}else i=!0===p.$async||e.async&&!1!==p.$async,s=p.code}if(s){var y;(y=y||[]).push(a),a="",e.opts.passContext?a+=" "+s+".call(this, ":a+=" "+s+"( ",a+=" "+u+", (dataPath || '')",'""'!=e.errorPath&&(a+=" + "+e.errorPath);var _=a+=" , "+(o?"data"+(o-1||""):"parentData")+" , "+(o?e.dataPathArr[o]:"parentDataProperty")+", rootData) ";if(a=y.pop(),i){if(!e.async)throw new Error("async schema referenced by sync schema");d&&(a+=" var "+h+"; "),a+=" try { await "+_+"; ",d&&(a+=" "+h+" = true; "),a+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",d&&(a+=" "+h+" = false; "),a+=" } ",d&&(a+=" if ("+h+") { ")}else a+=" if (!"+_+") { if (vErrors === null) vErrors = "+s+".errors; else vErrors = vErrors.concat("+s+".errors); errors = vErrors.length; } ",d&&(a+=" else { ")}return a},allOf:function(e,t,r){var i=" ",s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),n=e.errSchemaPath+"/"+t,o=!e.opts.allErrors,c=e.util.copy(e),l="";c.level++;var d="valid"+c.level,u=c.baseId,h=!0,p=s;if(p)for(var m,v=-1,f=p.length-1;v0:e.util.schemaHasRules(m,e.RULES.all))&&(h=!1,c.schema=m,c.schemaPath=a+"["+v+"]",c.errSchemaPath=n+"/"+v,i+=" "+e.validate(c)+" ",c.baseId=u,o&&(i+=" if ("+d+") { ",l+="}"));return o&&(i+=h?" if (true) { ":" "+l.slice(0,-1)+" "),i},anyOf:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="valid"+s,h="errs__"+s,p=e.util.copy(e),m="";p.level++;var v="valid"+p.level;if(n.every((function(t){return e.opts.strictKeywords?"object"==typeof t&&Object.keys(t).length>0:e.util.schemaHasRules(t,e.RULES.all)}))){var f=p.baseId;i+=" var "+h+" = errors; var "+u+" = false; ";var g=e.compositeRule;e.compositeRule=p.compositeRule=!0;var y=n;if(y)for(var _,b=-1,w=y.length-1;b0:e.util.schemaHasRules(n,e.RULES.all);if(i+="var "+h+" = errors;var "+u+";",_){var b=e.compositeRule;e.compositeRule=p.compositeRule=!0,p.schema=n,p.schemaPath=o,p.errSchemaPath=c,i+=" var "+m+" = false; for (var "+v+" = 0; "+v+" < "+d+".length; "+v+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);var w=d+"["+v+"]";p.dataPathArr[f]=v;var E=e.validate(p);p.baseId=y,e.util.varOccurences(E,g)<2?i+=" "+e.util.varReplace(E,g,w)+" ":i+=" var "+g+" = "+w+"; "+E+" ",i+=" if ("+m+") break; } ",e.compositeRule=p.compositeRule=b,i+=" if (!"+m+") {"}else i+=" if ("+d+".length == 0) {";var P=P||[];P.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should contain a valid item' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var S=i;return i=P.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { ",_&&(i+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } "),e.opts.allErrors&&(i+=" } "),i},dependencies:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="errs__"+s,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level,v={},f={},g=e.opts.ownProperties;for(w in n)if("__proto__"!=w){var y=n[w],_=Array.isArray(y)?f:v;_[w]=y}i+="var "+u+" = errors;";var b=e.errorPath;for(var w in i+="var missing"+s+";",f)if((_=f[w]).length){if(i+=" if ( "+d+e.util.getProperty(w)+" !== undefined ",g&&(i+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(w)+"') "),l){i+=" && ( ";var E=_;if(E)for(var P=-1,S=E.length-1;P0:e.util.schemaHasRules(y,e.RULES.all))&&(i+=" "+m+" = true; if ( "+d+e.util.getProperty(w)+" !== undefined ",g&&(i+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(w)+"') "),i+=") { ",h.schema=y,h.schemaPath=o+e.util.getProperty(w),h.errSchemaPath=c+"/"+e.util.escapeFragment(w),i+=" "+e.validate(h)+" ",h.baseId=N,i+=" } ",l&&(i+=" if ("+m+") { ",p+="}"))}return l&&(i+=" "+p+" if ("+u+" == errors) {"),i},enum:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="valid"+s,h=e.opts.$data&&n&&n.$data;h&&(i+=" var schema"+s+" = "+e.util.getData(n.$data,a,e.dataPathArr)+"; ");var p="i"+s,m="schema"+s;h||(i+=" var "+m+" = validate.schema"+o+";"),i+="var "+u+";",h&&(i+=" if (schema"+s+" === undefined) "+u+" = true; else if (!Array.isArray(schema"+s+")) "+u+" = false; else {"),i+=u+" = false;for (var "+p+"=0; "+p+"<"+m+".length; "+p+"++) if (equal("+d+", "+m+"["+p+"])) { "+u+" = true; break; }",h&&(i+=" } "),i+=" if (!"+u+") { ";var v=v||[];v.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { allowedValues: schema"+s+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var f=i;return i=v.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+f+"]); ":i+=" validate.errors = ["+f+"]; return false; ":i+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" }",l&&(i+=" else { "),i},format:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||"");if(!1===e.opts.format)return l&&(i+=" if (true) { "),i;var u,h=e.opts.$data&&n&&n.$data;h?(i+=" var schema"+s+" = "+e.util.getData(n.$data,a,e.dataPathArr)+"; ",u="schema"+s):u=n;var p=e.opts.unknownFormats,m=Array.isArray(p);if(h){i+=" var "+(v="format"+s)+" = formats["+u+"]; var "+(f="isObject"+s)+" = typeof "+v+" == 'object' && !("+v+" instanceof RegExp) && "+v+".validate; var "+(g="formatType"+s)+" = "+f+" && "+v+".type || 'string'; if ("+f+") { ",e.async&&(i+=" var async"+s+" = "+v+".async; "),i+=" "+v+" = "+v+".validate; } if ( ",h&&(i+=" ("+u+" !== undefined && typeof "+u+" != 'string') || "),i+=" (","ignore"!=p&&(i+=" ("+u+" && !"+v+" ",m&&(i+=" && self._opts.unknownFormats.indexOf("+u+") == -1 "),i+=") || "),i+=" ("+v+" && "+g+" == '"+r+"' && !(typeof "+v+" == 'function' ? ",e.async?i+=" (async"+s+" ? await "+v+"("+d+") : "+v+"("+d+")) ":i+=" "+v+"("+d+") ",i+=" : "+v+".test("+d+"))))) {"}else{var v;if(!(v=e.formats[n])){if("ignore"==p)return e.logger.warn('unknown format "'+n+'" ignored in schema at path "'+e.errSchemaPath+'"'),l&&(i+=" if (true) { "),i;if(m&&p.indexOf(n)>=0)return l&&(i+=" if (true) { "),i;throw new Error('unknown format "'+n+'" is used in schema at path "'+e.errSchemaPath+'"')}var f,g=(f="object"==typeof v&&!(v instanceof RegExp)&&v.validate)&&v.type||"string";if(f){var y=!0===v.async;v=v.validate}if(g!=r)return l&&(i+=" if (true) { "),i;if(y){if(!e.async)throw new Error("async format in sync schema");i+=" if (!(await "+(_="formats"+e.util.getProperty(n)+".validate")+"("+d+"))) { "}else{i+=" if (! ";var _="formats"+e.util.getProperty(n);f&&(_+=".validate"),i+="function"==typeof v?" "+_+"("+d+") ":" "+_+".test("+d+") ",i+=") { "}}var b=b||[];b.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { format: ",i+=h?""+u:""+e.util.toQuotedString(n),i+=" } ",!1!==e.opts.messages&&(i+=" , message: 'should match format \"",i+=h?"' + "+u+" + '":""+e.util.escapeQuotes(n),i+="\"' "),e.opts.verbose&&(i+=" , schema: ",i+=h?"validate.schema"+o:""+e.util.toQuotedString(n),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var w=i;return i=b.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+w+"]); ":i+=" validate.errors = ["+w+"]; return false; ":i+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",l&&(i+=" else { "),i},if:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="valid"+s,h="errs__"+s,p=e.util.copy(e);p.level++;var m="valid"+p.level,v=e.schema.then,f=e.schema.else,g=void 0!==v&&(e.opts.strictKeywords?"object"==typeof v&&Object.keys(v).length>0:e.util.schemaHasRules(v,e.RULES.all)),y=void 0!==f&&(e.opts.strictKeywords?"object"==typeof f&&Object.keys(f).length>0:e.util.schemaHasRules(f,e.RULES.all)),_=p.baseId;if(g||y){var b;p.createErrors=!1,p.schema=n,p.schemaPath=o,p.errSchemaPath=c,i+=" var "+h+" = errors; var "+u+" = true; ";var w=e.compositeRule;e.compositeRule=p.compositeRule=!0,i+=" "+e.validate(p)+" ",p.baseId=_,p.createErrors=!0,i+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",e.compositeRule=p.compositeRule=w,g?(i+=" if ("+m+") { ",p.schema=e.schema.then,p.schemaPath=e.schemaPath+".then",p.errSchemaPath=e.errSchemaPath+"/then",i+=" "+e.validate(p)+" ",p.baseId=_,i+=" "+u+" = "+m+"; ",g&&y?i+=" var "+(b="ifClause"+s)+" = 'then'; ":b="'then'",i+=" } ",y&&(i+=" else { ")):i+=" if (!"+m+") { ",y&&(p.schema=e.schema.else,p.schemaPath=e.schemaPath+".else",p.errSchemaPath=e.errSchemaPath+"/else",i+=" "+e.validate(p)+" ",p.baseId=_,i+=" "+u+" = "+m+"; ",g&&y?i+=" var "+(b="ifClause"+s)+" = 'else'; ":b="'else'",i+=" } "),i+=" if (!"+u+") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { failingKeyword: "+b+" } ",!1!==e.opts.messages&&(i+=" , message: 'should match \"' + "+b+" + '\" schema' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&l&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+=" } ",l&&(i+=" else { ")}else l&&(i+=" if (true) { ");return i},items:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="valid"+s,h="errs__"+s,p=e.util.copy(e),m="";p.level++;var v="valid"+p.level,f="i"+s,g=p.dataLevel=e.dataLevel+1,y="data"+g,_=e.baseId;if(i+="var "+h+" = errors;var "+u+";",Array.isArray(n)){var b=e.schema.additionalItems;if(!1===b){i+=" "+u+" = "+d+".length <= "+n.length+"; ";var w=c;c=e.errSchemaPath+"/additionalItems",i+=" if (!"+u+") { ";var E=E||[];E.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+n.length+" } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have more than "+n.length+" items' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var P=i;i=E.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+P+"]); ":i+=" validate.errors = ["+P+"]; return false; ":i+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",c=w,l&&(m+="}",i+=" else { ")}var S=n;if(S)for(var k,x=-1,$=S.length-1;x<$;)if(k=S[x+=1],e.opts.strictKeywords?"object"==typeof k&&Object.keys(k).length>0:e.util.schemaHasRules(k,e.RULES.all)){i+=" "+v+" = true; if ("+d+".length > "+x+") { ";var O=d+"["+x+"]";p.schema=k,p.schemaPath=o+"["+x+"]",p.errSchemaPath=c+"/"+x,p.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,!0),p.dataPathArr[g]=x;var j=e.validate(p);p.baseId=_,e.util.varOccurences(j,y)<2?i+=" "+e.util.varReplace(j,y,O)+" ":i+=" var "+y+" = "+O+"; "+j+" ",i+=" } ",l&&(i+=" if ("+v+") { ",m+="}")}if("object"==typeof b&&(e.opts.strictKeywords?"object"==typeof b&&Object.keys(b).length>0:e.util.schemaHasRules(b,e.RULES.all))){p.schema=b,p.schemaPath=e.schemaPath+".additionalItems",p.errSchemaPath=e.errSchemaPath+"/additionalItems",i+=" "+v+" = true; if ("+d+".length > "+n.length+") { for (var "+f+" = "+n.length+"; "+f+" < "+d+".length; "+f+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,f,e.opts.jsonPointers,!0);O=d+"["+f+"]";p.dataPathArr[g]=f;j=e.validate(p);p.baseId=_,e.util.varOccurences(j,y)<2?i+=" "+e.util.varReplace(j,y,O)+" ":i+=" var "+y+" = "+O+"; "+j+" ",l&&(i+=" if (!"+v+") break; "),i+=" } } ",l&&(i+=" if ("+v+") { ",m+="}")}}else if(e.opts.strictKeywords?"object"==typeof n&&Object.keys(n).length>0:e.util.schemaHasRules(n,e.RULES.all)){p.schema=n,p.schemaPath=o,p.errSchemaPath=c,i+=" for (var "+f+" = 0; "+f+" < "+d+".length; "+f+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,f,e.opts.jsonPointers,!0);O=d+"["+f+"]";p.dataPathArr[g]=f;j=e.validate(p);p.baseId=_,e.util.varOccurences(j,y)<2?i+=" "+e.util.varReplace(j,y,O)+" ":i+=" var "+y+" = "+O+"; "+j+" ",l&&(i+=" if (!"+v+") break; "),i+=" }"}return l&&(i+=" "+m+" if ("+h+" == errors) {"),i},maximum:cn,minimum:cn,maxItems:ln,minItems:ln,maxLength:dn,minLength:dn,maxProperties:un,minProperties:un,multipleOf:function(e,t,r){var i,s=" ",a=e.level,n=e.dataLevel,o=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(n||""),h=e.opts.$data&&o&&o.$data;if(h?(s+=" var schema"+a+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=o,!h&&"number"!=typeof o)throw new Error(t+" must be number");s+="var division"+a+";if (",h&&(s+=" "+i+" !== undefined && ( typeof "+i+" != 'number' || "),s+=" (division"+a+" = "+u+" / "+i+", ",e.opts.multipleOfPrecision?s+=" Math.abs(Math.round(division"+a+") - division"+a+") > 1e-"+e.opts.multipleOfPrecision+" ":s+=" division"+a+" !== parseInt(division"+a+") ",s+=" ) ",h&&(s+=" ) "),s+=" ) { ";var p=p||[];p.push(s),s="",!1!==e.createErrors?(s+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { multipleOf: "+i+" } ",!1!==e.opts.messages&&(s+=" , message: 'should be multiple of ",s+=h?"' + "+i:i+"'"),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+m+"]); ":s+=" validate.errors = ["+m+"]; return false; ":s+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",d&&(s+=" else { "),s},not:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="errs__"+s,h=e.util.copy(e);h.level++;var p="valid"+h.level;if(e.opts.strictKeywords?"object"==typeof n&&Object.keys(n).length>0:e.util.schemaHasRules(n,e.RULES.all)){h.schema=n,h.schemaPath=o,h.errSchemaPath=c,i+=" var "+u+" = errors; ";var m,v=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1,h.opts.allErrors&&(m=h.opts.allErrors,h.opts.allErrors=!1),i+=" "+e.validate(h)+" ",h.createErrors=!0,m&&(h.opts.allErrors=m),e.compositeRule=h.compositeRule=v,i+=" if ("+p+") { ";var f=f||[];f.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var g=i;i=f.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+g+"]); ":i+=" validate.errors = ["+g+"]; return false; ":i+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { errors = "+u+"; if (vErrors !== null) { if ("+u+") vErrors.length = "+u+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else i+=" var err = ",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l&&(i+=" if (false) { ");return i},oneOf:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="valid"+s,h="errs__"+s,p=e.util.copy(e),m="";p.level++;var v="valid"+p.level,f=p.baseId,g="prevValid"+s,y="passingSchemas"+s;i+="var "+h+" = errors , "+g+" = false , "+u+" = false , "+y+" = null; ";var _=e.compositeRule;e.compositeRule=p.compositeRule=!0;var b=n;if(b)for(var w,E=-1,P=b.length-1;E0:e.util.schemaHasRules(w,e.RULES.all))?(p.schema=w,p.schemaPath=o+"["+E+"]",p.errSchemaPath=c+"/"+E,i+=" "+e.validate(p)+" ",p.baseId=f):i+=" var "+v+" = true; ",E&&(i+=" if ("+v+" && "+g+") { "+u+" = false; "+y+" = ["+y+", "+E+"]; } else { ",m+="}"),i+=" if ("+v+") { "+u+" = "+g+" = true; "+y+" = "+E+"; }";return e.compositeRule=p.compositeRule=_,i+=m+"if (!"+u+") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { passingSchemas: "+y+" } ",!1!==e.opts.messages&&(i+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&l&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+="} else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; }",e.opts.allErrors&&(i+=" } "),i},pattern:function(e,t,r){var i,s=" ",a=e.level,n=e.dataLevel,o=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(n||""),h=e.opts.$data&&o&&o.$data;h?(s+=" var schema"+a+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=o,s+="if ( ",h&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'string') || "),s+=" !"+(h?"(new RegExp("+i+"))":e.usePattern(o))+".test("+u+") ) { ";var p=p||[];p.push(s),s="",!1!==e.createErrors?(s+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { pattern: ",s+=h?""+i:""+e.util.toQuotedString(o),s+=" } ",!1!==e.opts.messages&&(s+=" , message: 'should match pattern \"",s+=h?"' + "+i+" + '":""+e.util.escapeQuotes(o),s+="\"' "),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+e.util.toQuotedString(o),s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+m+"]); ":s+=" validate.errors = ["+m+"]; return false; ":s+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",d&&(s+=" else { "),s},properties:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="errs__"+s,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level,v="key"+s,f="idx"+s,g=h.dataLevel=e.dataLevel+1,y="data"+g,_="dataProperties"+s,b=Object.keys(n||{}).filter(z),w=e.schema.patternProperties||{},E=Object.keys(w).filter(z),P=e.schema.additionalProperties,S=b.length||E.length,k=!1===P,x="object"==typeof P&&Object.keys(P).length,$=e.opts.removeAdditional,O=k||x||$,j=e.opts.ownProperties,C=e.baseId,D=e.schema.required;if(D&&(!e.opts.$data||!D.$data)&&D.length8)i+=" || validate.schema"+o+".hasOwnProperty("+v+") ";else{var T=b;if(T)for(var N=-1,R=T.length-1;N0:e.util.schemaHasRules(Z,e.RULES.all)){var X=e.util.getProperty(W),ee=(Q=d+X,K&&void 0!==Z.default);h.schema=Z,h.schemaPath=o+X,h.errSchemaPath=c+"/"+e.util.escapeFragment(W),h.errorPath=e.util.getPath(e.errorPath,W,e.opts.jsonPointers),h.dataPathArr[g]=e.util.toQuotedString(W);B=e.validate(h);if(h.baseId=C,e.util.varOccurences(B,y)<2){B=e.util.varReplace(B,y,Q);var te=Q}else{te=y;i+=" var "+y+" = "+Q+"; "}if(ee)i+=" "+B+" ";else{if(A&&A[W]){i+=" if ( "+te+" === undefined ",j&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(W)+"') "),i+=") { "+m+" = false; ";L=e.errorPath,U=c;var re,ie=e.util.escapeQuotes(W);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(L,W,e.opts.jsonPointers)),c=e.errSchemaPath+"/required",(re=re||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+ie+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+ie+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";q=i;i=re.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+q+"]); ":i+=" validate.errors = ["+q+"]; return false; ":i+=" var err = "+q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c=U,e.errorPath=L,i+=" } else { "}else l?(i+=" if ( "+te+" === undefined ",j&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(W)+"') "),i+=") { "+m+" = true; } else { "):(i+=" if ("+te+" !== undefined ",j&&(i+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(W)+"') "),i+=" ) { ");i+=" "+B+" } "}}l&&(i+=" if ("+m+") { ",p+="}")}}if(E.length){var se=E;if(se)for(var ae,ne=-1,oe=se.length-1;ne0:e.util.schemaHasRules(Z,e.RULES.all)){h.schema=Z,h.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ae),h.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ae),i+=j?" "+_+" = "+_+" || Object.keys("+d+"); for (var "+f+"=0; "+f+"<"+_+".length; "+f+"++) { var "+v+" = "+_+"["+f+"]; ":" for (var "+v+" in "+d+") { ",i+=" if ("+e.usePattern(ae)+".test("+v+")) { ",h.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers);Q=d+"["+v+"]";h.dataPathArr[g]=v;B=e.validate(h);h.baseId=C,e.util.varOccurences(B,y)<2?i+=" "+e.util.varReplace(B,y,Q)+" ":i+=" var "+y+" = "+Q+"; "+B+" ",l&&(i+=" if (!"+m+") break; "),i+=" } ",l&&(i+=" else "+m+" = true; "),i+=" } ",l&&(i+=" if ("+m+") { ",p+="}")}}}return l&&(i+=" "+p+" if ("+u+" == errors) {"),i},propertyNames:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="errs__"+s,h=e.util.copy(e);h.level++;var p="valid"+h.level;if(i+="var "+u+" = errors;",e.opts.strictKeywords?"object"==typeof n&&Object.keys(n).length>0:e.util.schemaHasRules(n,e.RULES.all)){h.schema=n,h.schemaPath=o,h.errSchemaPath=c;var m="key"+s,v="idx"+s,f="i"+s,g="' + "+m+" + '",y="data"+(h.dataLevel=e.dataLevel+1),_="dataProperties"+s,b=e.opts.ownProperties,w=e.baseId;b&&(i+=" var "+_+" = undefined; "),i+=b?" "+_+" = "+_+" || Object.keys("+d+"); for (var "+v+"=0; "+v+"<"+_+".length; "+v+"++) { var "+m+" = "+_+"["+v+"]; ":" for (var "+m+" in "+d+") { ",i+=" var startErrs"+s+" = errors; ";var E=m,P=e.compositeRule;e.compositeRule=h.compositeRule=!0;var S=e.validate(h);h.baseId=w,e.util.varOccurences(S,y)<2?i+=" "+e.util.varReplace(S,y,E)+" ":i+=" var "+y+" = "+E+"; "+S+" ",e.compositeRule=h.compositeRule=P,i+=" if (!"+p+") { for (var "+f+"=startErrs"+s+"; "+f+"0:e.util.schemaHasRules(_,e.RULES.all))||(m[m.length]=f)}}else m=n;if(h||m.length){var b=e.errorPath,w=h||m.length>=e.opts.loopRequired,E=e.opts.ownProperties;if(l)if(i+=" var missing"+s+"; ",w){h||(i+=" var "+p+" = validate.schema"+o+"; ");var P="' + "+(j="schema"+s+"["+(x="i"+s)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(b,j,e.opts.jsonPointers)),i+=" var "+u+" = true; ",h&&(i+=" if (schema"+s+" === undefined) "+u+" = true; else if (!Array.isArray(schema"+s+")) "+u+" = false; else {"),i+=" for (var "+x+" = 0; "+x+" < "+p+".length; "+x+"++) { "+u+" = "+d+"["+p+"["+x+"]] !== undefined ",E&&(i+=" && Object.prototype.hasOwnProperty.call("+d+", "+p+"["+x+"]) "),i+="; if (!"+u+") break; } ",h&&(i+=" } "),i+=" if (!"+u+") { ",(O=O||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+P+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var S=i;i=O.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else{i+=" if ( ";var k=m;if(k)for(var x=-1,$=k.length-1;x<$;){D=k[x+=1],x&&(i+=" || "),i+=" ( ( "+(N=d+(T=e.util.getProperty(D)))+" === undefined ",E&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(D)+"') "),i+=") && (missing"+s+" = "+e.util.toQuotedString(e.opts.jsonPointers?D:T)+") ) "}i+=") { ";var O;P="' + "+(j="missing"+s)+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(b,j,!0):b+" + "+j),(O=O||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+P+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";S=i;i=O.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else if(w){h||(i+=" var "+p+" = validate.schema"+o+"; ");var j;P="' + "+(j="schema"+s+"["+(x="i"+s)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(b,j,e.opts.jsonPointers)),h&&(i+=" if ("+p+" && !Array.isArray("+p+")) { var err = ",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+P+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+p+" !== undefined) { "),i+=" for (var "+x+" = 0; "+x+" < "+p+".length; "+x+"++) { if ("+d+"["+p+"["+x+"]] === undefined ",E&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", "+p+"["+x+"]) "),i+=") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+P+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",h&&(i+=" } ")}else{var C=m;if(C)for(var D,A=-1,z=C.length-1;A 1) { ";var m=e.schema.items&&e.schema.items.type,v=Array.isArray(m);if(!m||"object"==m||"array"==m||v&&(m.indexOf("object")>=0||m.indexOf("array")>=0))s+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+u+"[i], "+u+"[j])) { "+h+" = false; break outer; } } } ";else{s+=" var itemIndices = {}, item; for (;i--;) { var item = "+u+"[i]; ";var f="checkDataType"+(v?"s":"");s+=" if ("+e.util[f](m,"item",e.opts.strictNumbers,!0)+") continue; ",v&&(s+=" if (typeof item == 'string') item = '\"' + item; "),s+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}s+=" } ",p&&(s+=" } "),s+=" if (!"+h+") { ";var g=g||[];g.push(s),s="",!1!==e.createErrors?(s+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(s+=" , schema: ",s+=p?"validate.schema"+c:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var y=s;s=g.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+y+"]); ":s+=" validate.errors = ["+y+"]; return false; ":s+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",d&&(s+=" else { ")}else d&&(s+=" if (true) { ");return s},validate:ja},pn=Ys.toHash,mn=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"],vn=function(e,t){for(var r=0;r1){t[0]=t[0].slice(0,-1);for(var i=t.length-1,s=1;s= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,v=String.fromCharCode;function f(e){throw new RangeError(p[e])}function g(e,t){var r=e.split("@"),i="";r.length>1&&(i=r[0]+"@",e=r[1]);var s=function(e,t){for(var r=[],i=e.length;i--;)r[i]=t(e[i]);return r}((e=e.replace(h,".")).split("."),t).join(".");return i+s}function y(e){for(var t=[],r=0,i=e.length;r=55296&&s<=56319&&r>1,e+=m(e/t);e>455;i+=36)e=m(e/35);return m(i+36*e/(e+38))},w=function(e){var t,r=[],i=e.length,s=0,a=128,n=72,o=e.lastIndexOf("-");o<0&&(o=0);for(var c=0;c=128&&f("not-basic"),r.push(e.charCodeAt(c));for(var d=o>0?o+1:0;d=i&&f("invalid-input");var v=(t=e.charCodeAt(d++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:36;(v>=36||v>m((l-s)/h))&&f("overflow"),s+=v*h;var g=p<=n?1:p>=n+26?26:p-n;if(vm(l/y)&&f("overflow"),h*=y}var _=r.length+1;n=b(s-u,_,0==u),m(s/_)>l-a&&f("overflow"),a+=m(s/_),s%=_,r.splice(s++,0,a)}return String.fromCodePoint.apply(String,r)},E=function(e){var t=[],r=(e=y(e)).length,i=128,s=0,a=72,n=!0,o=!1,c=void 0;try{for(var d,u=e[Symbol.iterator]();!(n=(d=u.next()).done);n=!0){var h=d.value;h<128&&t.push(v(h))}}catch(e){o=!0,c=e}finally{try{!n&&u.return&&u.return()}finally{if(o)throw c}}var p=t.length,g=p;for(p&&t.push("-");g=i&&$m((l-s)/O)&&f("overflow"),s+=(w-i)*O,i=w;var j=!0,C=!1,D=void 0;try{for(var z,A=e[Symbol.iterator]();!(j=(z=A.next()).done);j=!0){var T=z.value;if(Tl&&f("overflow"),T==i){for(var N=s,R=36;;R+=36){var F=R<=a?1:R>=a+26?26:R-a;if(N>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function $(e){for(var t="",r=0,i=e.length;r=194&&s<224){if(i-r>=6){var a=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&s)<<6|63&a)}else t+=e.substr(r,6);r+=6}else if(s>=224){if(i-r>=9){var n=parseInt(e.substr(r+4,2),16),o=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&s)<<12|(63&n)<<6|63&o)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function O(e,t){function r(e){var r=$(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,x).replace(t.PCT_ENCODED,s)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,x).replace(t.PCT_ENCODED,s)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,x).replace(t.PCT_ENCODED,s)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,x).replace(t.PCT_ENCODED,s)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,x).replace(t.PCT_ENCODED,s)),e}function j(e){return e.replace(/^0*(.*)/,"$1")||"0"}function C(e,t){var r=e.match(t.IPV4ADDRESS)||[],i=c(r,2)[1];return i?i.split(".").map(j).join("."):e}function D(e,t){var r=e.match(t.IPV6ADDRESS)||[],i=c(r,3),s=i[1],a=i[2];if(s){for(var n=s.toLowerCase().split("::").reverse(),o=c(n,2),l=o[0],d=o[1],u=d?d.split(":").map(j):[],h=l.split(":").map(j),p=t.IPV4ADDRESS.test(h[h.length-1]),m=p?7:8,v=h.length-m,f=Array(m),g=0;g1){var b=f.slice(0,y.index),w=f.slice(y.index+y.length);_=b.join(":")+"::"+w.join(":")}else _=f.join(":");return a&&(_+="%"+a),_}return e}var z=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,A=void 0==="".match(/(){0}/)[1];function T(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},i=!1!==t.iri?o:n;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var s=e.match(z);if(s){A?(r.scheme=s[1],r.userinfo=s[3],r.host=s[4],r.port=parseInt(s[5],10),r.path=s[6]||"",r.query=s[7],r.fragment=s[8],isNaN(r.port)&&(r.port=s[5])):(r.scheme=s[1]||void 0,r.userinfo=-1!==e.indexOf("@")?s[3]:void 0,r.host=-1!==e.indexOf("//")?s[4]:void 0,r.port=parseInt(s[5],10),r.path=s[6]||"",r.query=-1!==e.indexOf("?")?s[7]:void 0,r.fragment=-1!==e.indexOf("#")?s[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?s[4]:void 0)),r.host&&(r.host=D(C(r.host,i),i)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var a=k[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||a&&a.unicodeSupport)O(r,i);else{if(r.host&&(t.domainHost||a&&a.domainHost))try{r.host=P(r.host.replace(i.PCT_ENCODED,$).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}O(r,n)}a&&a.parse&&a.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}function N(e,t){var r=!1!==t.iri?o:n,i=[];return void 0!==e.userinfo&&(i.push(e.userinfo),i.push("@")),void 0!==e.host&&i.push(D(C(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(i.push(":"),i.push(String(e.port))),i.length?i.join(""):void 0}var R=/^\.\.?\//,F=/^\/\.(\/|$)/,I=/^\/\.\.(\/|$)/,M=/^\/?(?:.|\n)*?(?=\/|$)/;function L(e){for(var t=[];e.length;)if(e.match(R))e=e.replace(R,"");else if(e.match(F))e=e.replace(F,"/");else if(e.match(I))e=e.replace(I,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(M);if(!r)throw new Error("Unexpected dot segment condition");var i=r[0];e=e.slice(i.length),t.push(i)}return t.join("")}function V(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?o:n,i=[],s=k[(t.scheme||e.scheme||"").toLowerCase()];if(s&&s.serialize&&s.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||s&&s.domainHost)try{e.host=t.iri?S(e.host):P(e.host.replace(r.PCT_ENCODED,$).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}O(e,r),"suffix"!==t.reference&&e.scheme&&(i.push(e.scheme),i.push(":"));var a=N(e,t);if(void 0!==a&&("suffix"!==t.reference&&i.push("//"),i.push(a),e.path&&"/"!==e.path.charAt(0)&&i.push("/")),void 0!==e.path){var c=e.path;t.absolutePath||s&&s.absolutePath||(c=L(c)),void 0===a&&(c=c.replace(/^\/\//,"/%2F")),i.push(c)}return void 0!==e.query&&(i.push("?"),i.push(e.query)),void 0!==e.fragment&&(i.push("#"),i.push(e.fragment)),i.join("")}function U(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments[3],s={};return i||(e=T(V(e,r),r),t=T(V(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(s.scheme=t.scheme,s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=L(t.path||""),s.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=L(t.path||""),s.query=t.query):(t.path?("/"===t.path.charAt(0)?s.path=L(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?s.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:s.path=t.path:s.path="/"+t.path,s.path=L(s.path)),s.query=t.query):(s.path=e.path,void 0!==t.query?s.query=t.query:s.query=e.query),s.userinfo=e.userinfo,s.host=e.host,s.port=e.port),s.scheme=e.scheme),s.fragment=t.fragment,s}function q(e,t){return e&&e.toString().replace(t&&t.iri?o.PCT_ENCODED:n.PCT_ENCODED,$)}var H={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var r="https"===String(e.scheme).toLowerCase();return e.port!==(r?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},Q={scheme:"https",domainHost:H.domainHost,parse:H.parse,serialize:H.serialize};function B(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var K={scheme:"ws",domainHost:!0,parse:function(e,t){var r=e;return r.secure=B(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(e,t){if(e.port!==(B(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var r=e.resourceName.split("?"),i=c(r,2),s=i[0],a=i[1];e.path=s&&"/"!==s?s:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},G={scheme:"wss",domainHost:K.domainHost,parse:K.parse,serialize:K.serialize},W={},Y="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",J="[0-9A-Fa-f]",Z=r(r("%[EFef]"+J+"%"+J+J+"%"+J+J)+"|"+r("%[89A-Fa-f]"+J+"%"+J+J)+"|"+r("%"+J+J)),X=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),ee=new RegExp(Y,"g"),te=new RegExp(Z,"g"),re=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',X),"g"),ie=new RegExp(t("[^]",Y,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),se=ie;function ae(e){var t=$(e);return t.match(ee)?t:e}var ne={scheme:"mailto",parse:function(e,t){var r=e,i=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var s=!1,a={},n=r.query.split("&"),o=0,c=n.length;o=55296&&t<=56319&&s=t)throw new Error("Cannot access property/index "+i+" levels up, current level is "+t);return r[t-i]}if(i>t)throw new Error("Cannot access data "+i+" levels up, current level is "+t);if(a="data"+(t-i||""),!s)return a}for(var o=a,c=s.split("/"),l=0;l=0?{index:i,compiling:!0}:(i=this._compilations.length,this._compilations[i]={schema:e,root:t,baseId:r},{index:i,compiling:!1})}function Ga(e,t,r){var i=Wa.call(this,e,t,r);i>=0&&this._compilations.splice(i,1)}function Wa(e,t,r){for(var i=0;i%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,ln=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,dn=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,un=/^(?:\/(?:[^~/]|~0|~1)*)*$/,hn=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,pn=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,mn=vn;function vn(e){return e="full"==e?"full":"fast",da.copy(vn[e])}function fn(e){var t=e.match(rn);if(!t)return!1;var r=+t[1],i=+t[2],s=+t[3];return i>=1&&i<=12&&s>=1&&s<=(2==i&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:sn[i])}function gn(e,t){var r=e.match(an);if(!r)return!1;var i=r[1],s=r[2],a=r[3],n=r[5];return(i<=23&&s<=59&&a<=59||23==i&&59==s&&60==a)&&(!t||n)}vn.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":cn,url:ln,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:nn,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:wn,uuid:dn,"json-pointer":un,"json-pointer-uri-fragment":hn,"relative-json-pointer":pn},vn.full={date:fn,time:gn,"date-time":function(e){var t=e.split(yn);return 2==t.length&&fn(t[0])&&gn(t[1],!0)},uri:function(e){return _n.test(e)&&on.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":cn,url:ln,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:nn,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:wn,uuid:dn,"json-pointer":un,"json-pointer-uri-fragment":hn,"relative-json-pointer":pn};var yn=/t|\s/i;var _n=/\/|:/;var bn=/[^\\]\\Z/;function wn(e){if(bn.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}var En=function(e,t,r){var i,s=" ",a=e.level,n=e.dataLevel,o=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(n||""),h=e.opts.$data&&o&&o.$data;h?(s+=" var schema"+a+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=o;var p="maximum"==t,m=p?"exclusiveMaximum":"exclusiveMinimum",v=e.schema[m],f=e.opts.$data&&v&&v.$data,g=p?"<":">",y=p?">":"<",_=void 0;if(!h&&"number"!=typeof o&&void 0!==o)throw new Error(t+" must be number");if(!f&&void 0!==v&&"number"!=typeof v&&"boolean"!=typeof v)throw new Error(m+" must be number or boolean");if(f){var b=e.util.getData(v.$data,n,e.dataPathArr),w="exclusive"+a,E="exclType"+a,P="exclIsNumber"+a,S="' + "+($="op"+a)+" + '";s+=" var schemaExcl"+a+" = "+b+"; ",s+=" var "+w+"; var "+E+" = typeof "+(b="schemaExcl"+a)+"; if ("+E+" != 'boolean' && "+E+" != 'undefined' && "+E+" != 'number') { ";var k;_=m;(k=k||[]).push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(_||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(s+=" , message: '"+m+" should be boolean' "),e.opts.verbose&&(s+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var x=s;s=k.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+x+"]); ":s+=" validate.errors = ["+x+"]; return false; ":s+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else if ( ",h&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),s+=" "+E+" == 'number' ? ( ("+w+" = "+i+" === undefined || "+b+" "+g+"= "+i+") ? "+u+" "+y+"= "+b+" : "+u+" "+y+" "+i+" ) : ( ("+w+" = "+b+" === true) ? "+u+" "+y+"= "+i+" : "+u+" "+y+" "+i+" ) || "+u+" !== "+u+") { var op"+a+" = "+w+" ? '"+g+"' : '"+g+"='; ",void 0===o&&(_=m,l=e.errSchemaPath+"/"+m,i=b,h=f)}else{S=g;if((P="number"==typeof v)&&h){var $="'"+S+"'";s+=" if ( ",h&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),s+=" ( "+i+" === undefined || "+v+" "+g+"= "+i+" ? "+u+" "+y+"= "+v+" : "+u+" "+y+" "+i+" ) || "+u+" !== "+u+") { "}else{P&&void 0===o?(w=!0,_=m,l=e.errSchemaPath+"/"+m,i=v,y+="="):(P&&(i=Math[p?"min":"max"](v,o)),v===(!P||i)?(w=!0,_=m,l=e.errSchemaPath+"/"+m,y+="="):(w=!1,S+="="));$="'"+S+"'";s+=" if ( ",h&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),s+=" "+u+" "+y+" "+i+" || "+u+" !== "+u+") { "}}_=_||t,(k=k||[]).push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(_||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { comparison: "+$+", limit: "+i+", exclusive: "+w+" } ",!1!==e.opts.messages&&(s+=" , message: 'should be "+S+" ",s+=h?"' + "+i:i+"'"),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";x=s;return s=k.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+x+"]); ":s+=" validate.errors = ["+x+"]; return false; ":s+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",d&&(s+=" else { "),s},Pn=function(e,t,r){var i,s=" ",a=e.level,n=e.dataLevel,o=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(n||""),h=e.opts.$data&&o&&o.$data;if(h?(s+=" var schema"+a+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=o,!h&&"number"!=typeof o)throw new Error(t+" must be number");s+="if ( ",h&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),s+=" "+u+".length "+("maxItems"==t?">":"<")+" "+i+") { ";var p=t,m=m||[];m.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(p||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have ",s+="maxItems"==t?"more":"fewer",s+=" than ",s+=h?"' + "+i+" + '":""+o,s+=" items' "),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var v=s;return s=m.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+v+"]); ":s+=" validate.errors = ["+v+"]; return false; ":s+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",d&&(s+=" else { "),s},Sn=function(e,t,r){var i,s=" ",a=e.level,n=e.dataLevel,o=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(n||""),h=e.opts.$data&&o&&o.$data;if(h?(s+=" var schema"+a+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=o,!h&&"number"!=typeof o)throw new Error(t+" must be number");var p="maxLength"==t?">":"<";s+="if ( ",h&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),!1===e.opts.unicode?s+=" "+u+".length ":s+=" ucs2length("+u+") ",s+=" "+p+" "+i+") { ";var m=t,v=v||[];v.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(m||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT be ",s+="maxLength"==t?"longer":"shorter",s+=" than ",s+=h?"' + "+i+" + '":""+o,s+=" characters' "),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var f=s;return s=v.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+f+"]); ":s+=" validate.errors = ["+f+"]; return false; ":s+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",d&&(s+=" else { "),s},kn=function(e,t,r){var i,s=" ",a=e.level,n=e.dataLevel,o=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(n||""),h=e.opts.$data&&o&&o.$data;if(h?(s+=" var schema"+a+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=o,!h&&"number"!=typeof o)throw new Error(t+" must be number");s+="if ( ",h&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),s+=" Object.keys("+u+").length "+("maxProperties"==t?">":"<")+" "+i+") { ";var p=t,m=m||[];m.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(p||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have ",s+="maxProperties"==t?"more":"fewer",s+=" than ",s+=h?"' + "+i+" + '":""+o,s+=" properties' "),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var v=s;return s=m.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+v+"]); ":s+=" validate.errors = ["+v+"]; return false; ":s+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",d&&(s+=" else { "),s},xn={$ref:function(e,t,r){var i,s,a=" ",n=e.level,o=e.dataLevel,c=e.schema[t],l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(o||""),h="valid"+n;if("#"==c||"#/"==c)e.isRoot?(i=e.async,s="validate"):(i=!0===e.root.schema.$async,s="root.refVal[0]");else{var p=e.resolveRef(e.baseId,c,e.isRoot);if(void 0===p){var m=e.MissingRefError.message(e.baseId,c);if("fail"==e.opts.missingRefs){e.logger.error(m),(y=y||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { ref: '"+e.util.escapeQuotes(c)+"' } ",!1!==e.opts.messages&&(a+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(c)+"' "),e.opts.verbose&&(a+=" , schema: "+e.util.toQuotedString(c)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var v=a;a=y.pop(),!e.compositeRule&&d?e.async?a+=" throw new ValidationError(["+v+"]); ":a+=" validate.errors = ["+v+"]; return false; ":a+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",d&&(a+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,c,m);e.logger.warn(m),d&&(a+=" if (true) { ")}}else if(p.inline){var f=e.util.copy(e);f.level++;var g="valid"+f.level;f.schema=p.schema,f.schemaPath="",f.errSchemaPath=c,a+=" "+e.validate(f).replace(/validate\.schema/g,p.code)+" ",d&&(a+=" if ("+g+") { ")}else i=!0===p.$async||e.async&&!1!==p.$async,s=p.code}if(s){var y;(y=y||[]).push(a),a="",e.opts.passContext?a+=" "+s+".call(this, ":a+=" "+s+"( ",a+=" "+u+", (dataPath || '')",'""'!=e.errorPath&&(a+=" + "+e.errorPath);var _=a+=" , "+(o?"data"+(o-1||""):"parentData")+" , "+(o?e.dataPathArr[o]:"parentDataProperty")+", rootData) ";if(a=y.pop(),i){if(!e.async)throw new Error("async schema referenced by sync schema");d&&(a+=" var "+h+"; "),a+=" try { await "+_+"; ",d&&(a+=" "+h+" = true; "),a+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",d&&(a+=" "+h+" = false; "),a+=" } ",d&&(a+=" if ("+h+") { ")}else a+=" if (!"+_+") { if (vErrors === null) vErrors = "+s+".errors; else vErrors = vErrors.concat("+s+".errors); errors = vErrors.length; } ",d&&(a+=" else { ")}return a},allOf:function(e,t,r){var i=" ",s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),n=e.errSchemaPath+"/"+t,o=!e.opts.allErrors,c=e.util.copy(e),l="";c.level++;var d="valid"+c.level,u=c.baseId,h=!0,p=s;if(p)for(var m,v=-1,f=p.length-1;v0:e.util.schemaHasRules(m,e.RULES.all))&&(h=!1,c.schema=m,c.schemaPath=a+"["+v+"]",c.errSchemaPath=n+"/"+v,i+=" "+e.validate(c)+" ",c.baseId=u,o&&(i+=" if ("+d+") { ",l+="}"));return o&&(i+=h?" if (true) { ":" "+l.slice(0,-1)+" "),i},anyOf:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="valid"+s,h="errs__"+s,p=e.util.copy(e),m="";p.level++;var v="valid"+p.level;if(n.every((function(t){return e.opts.strictKeywords?"object"==typeof t&&Object.keys(t).length>0:e.util.schemaHasRules(t,e.RULES.all)}))){var f=p.baseId;i+=" var "+h+" = errors; var "+u+" = false; ";var g=e.compositeRule;e.compositeRule=p.compositeRule=!0;var y=n;if(y)for(var _,b=-1,w=y.length-1;b0:e.util.schemaHasRules(n,e.RULES.all);if(i+="var "+h+" = errors;var "+u+";",_){var b=e.compositeRule;e.compositeRule=p.compositeRule=!0,p.schema=n,p.schemaPath=o,p.errSchemaPath=c,i+=" var "+m+" = false; for (var "+v+" = 0; "+v+" < "+d+".length; "+v+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);var w=d+"["+v+"]";p.dataPathArr[f]=v;var E=e.validate(p);p.baseId=y,e.util.varOccurences(E,g)<2?i+=" "+e.util.varReplace(E,g,w)+" ":i+=" var "+g+" = "+w+"; "+E+" ",i+=" if ("+m+") break; } ",e.compositeRule=p.compositeRule=b,i+=" if (!"+m+") {"}else i+=" if ("+d+".length == 0) {";var P=P||[];P.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should contain a valid item' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var S=i;return i=P.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { ",_&&(i+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } "),e.opts.allErrors&&(i+=" } "),i},dependencies:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="errs__"+s,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level,v={},f={},g=e.opts.ownProperties;for(w in n)if("__proto__"!=w){var y=n[w],_=Array.isArray(y)?f:v;_[w]=y}i+="var "+u+" = errors;";var b=e.errorPath;for(var w in i+="var missing"+s+";",f)if((_=f[w]).length){if(i+=" if ( "+d+e.util.getProperty(w)+" !== undefined ",g&&(i+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(w)+"') "),l){i+=" && ( ";var E=_;if(E)for(var P=-1,S=E.length-1;P0:e.util.schemaHasRules(y,e.RULES.all))&&(i+=" "+m+" = true; if ( "+d+e.util.getProperty(w)+" !== undefined ",g&&(i+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(w)+"') "),i+=") { ",h.schema=y,h.schemaPath=o+e.util.getProperty(w),h.errSchemaPath=c+"/"+e.util.escapeFragment(w),i+=" "+e.validate(h)+" ",h.baseId=N,i+=" } ",l&&(i+=" if ("+m+") { ",p+="}"))}return l&&(i+=" "+p+" if ("+u+" == errors) {"),i},enum:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="valid"+s,h=e.opts.$data&&n&&n.$data;h&&(i+=" var schema"+s+" = "+e.util.getData(n.$data,a,e.dataPathArr)+"; ");var p="i"+s,m="schema"+s;h||(i+=" var "+m+" = validate.schema"+o+";"),i+="var "+u+";",h&&(i+=" if (schema"+s+" === undefined) "+u+" = true; else if (!Array.isArray(schema"+s+")) "+u+" = false; else {"),i+=u+" = false;for (var "+p+"=0; "+p+"<"+m+".length; "+p+"++) if (equal("+d+", "+m+"["+p+"])) { "+u+" = true; break; }",h&&(i+=" } "),i+=" if (!"+u+") { ";var v=v||[];v.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { allowedValues: schema"+s+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var f=i;return i=v.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+f+"]); ":i+=" validate.errors = ["+f+"]; return false; ":i+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" }",l&&(i+=" else { "),i},format:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||"");if(!1===e.opts.format)return l&&(i+=" if (true) { "),i;var u,h=e.opts.$data&&n&&n.$data;h?(i+=" var schema"+s+" = "+e.util.getData(n.$data,a,e.dataPathArr)+"; ",u="schema"+s):u=n;var p=e.opts.unknownFormats,m=Array.isArray(p);if(h){i+=" var "+(v="format"+s)+" = formats["+u+"]; var "+(f="isObject"+s)+" = typeof "+v+" == 'object' && !("+v+" instanceof RegExp) && "+v+".validate; var "+(g="formatType"+s)+" = "+f+" && "+v+".type || 'string'; if ("+f+") { ",e.async&&(i+=" var async"+s+" = "+v+".async; "),i+=" "+v+" = "+v+".validate; } if ( ",h&&(i+=" ("+u+" !== undefined && typeof "+u+" != 'string') || "),i+=" (","ignore"!=p&&(i+=" ("+u+" && !"+v+" ",m&&(i+=" && self._opts.unknownFormats.indexOf("+u+") == -1 "),i+=") || "),i+=" ("+v+" && "+g+" == '"+r+"' && !(typeof "+v+" == 'function' ? ",e.async?i+=" (async"+s+" ? await "+v+"("+d+") : "+v+"("+d+")) ":i+=" "+v+"("+d+") ",i+=" : "+v+".test("+d+"))))) {"}else{var v;if(!(v=e.formats[n])){if("ignore"==p)return e.logger.warn('unknown format "'+n+'" ignored in schema at path "'+e.errSchemaPath+'"'),l&&(i+=" if (true) { "),i;if(m&&p.indexOf(n)>=0)return l&&(i+=" if (true) { "),i;throw new Error('unknown format "'+n+'" is used in schema at path "'+e.errSchemaPath+'"')}var f,g=(f="object"==typeof v&&!(v instanceof RegExp)&&v.validate)&&v.type||"string";if(f){var y=!0===v.async;v=v.validate}if(g!=r)return l&&(i+=" if (true) { "),i;if(y){if(!e.async)throw new Error("async format in sync schema");i+=" if (!(await "+(_="formats"+e.util.getProperty(n)+".validate")+"("+d+"))) { "}else{i+=" if (! ";var _="formats"+e.util.getProperty(n);f&&(_+=".validate"),i+="function"==typeof v?" "+_+"("+d+") ":" "+_+".test("+d+") ",i+=") { "}}var b=b||[];b.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { format: ",i+=h?""+u:""+e.util.toQuotedString(n),i+=" } ",!1!==e.opts.messages&&(i+=" , message: 'should match format \"",i+=h?"' + "+u+" + '":""+e.util.escapeQuotes(n),i+="\"' "),e.opts.verbose&&(i+=" , schema: ",i+=h?"validate.schema"+o:""+e.util.toQuotedString(n),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var w=i;return i=b.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+w+"]); ":i+=" validate.errors = ["+w+"]; return false; ":i+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",l&&(i+=" else { "),i},if:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="valid"+s,h="errs__"+s,p=e.util.copy(e);p.level++;var m="valid"+p.level,v=e.schema.then,f=e.schema.else,g=void 0!==v&&(e.opts.strictKeywords?"object"==typeof v&&Object.keys(v).length>0:e.util.schemaHasRules(v,e.RULES.all)),y=void 0!==f&&(e.opts.strictKeywords?"object"==typeof f&&Object.keys(f).length>0:e.util.schemaHasRules(f,e.RULES.all)),_=p.baseId;if(g||y){var b;p.createErrors=!1,p.schema=n,p.schemaPath=o,p.errSchemaPath=c,i+=" var "+h+" = errors; var "+u+" = true; ";var w=e.compositeRule;e.compositeRule=p.compositeRule=!0,i+=" "+e.validate(p)+" ",p.baseId=_,p.createErrors=!0,i+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",e.compositeRule=p.compositeRule=w,g?(i+=" if ("+m+") { ",p.schema=e.schema.then,p.schemaPath=e.schemaPath+".then",p.errSchemaPath=e.errSchemaPath+"/then",i+=" "+e.validate(p)+" ",p.baseId=_,i+=" "+u+" = "+m+"; ",g&&y?i+=" var "+(b="ifClause"+s)+" = 'then'; ":b="'then'",i+=" } ",y&&(i+=" else { ")):i+=" if (!"+m+") { ",y&&(p.schema=e.schema.else,p.schemaPath=e.schemaPath+".else",p.errSchemaPath=e.errSchemaPath+"/else",i+=" "+e.validate(p)+" ",p.baseId=_,i+=" "+u+" = "+m+"; ",g&&y?i+=" var "+(b="ifClause"+s)+" = 'else'; ":b="'else'",i+=" } "),i+=" if (!"+u+") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { failingKeyword: "+b+" } ",!1!==e.opts.messages&&(i+=" , message: 'should match \"' + "+b+" + '\" schema' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&l&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+=" } ",l&&(i+=" else { ")}else l&&(i+=" if (true) { ");return i},items:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="valid"+s,h="errs__"+s,p=e.util.copy(e),m="";p.level++;var v="valid"+p.level,f="i"+s,g=p.dataLevel=e.dataLevel+1,y="data"+g,_=e.baseId;if(i+="var "+h+" = errors;var "+u+";",Array.isArray(n)){var b=e.schema.additionalItems;if(!1===b){i+=" "+u+" = "+d+".length <= "+n.length+"; ";var w=c;c=e.errSchemaPath+"/additionalItems",i+=" if (!"+u+") { ";var E=E||[];E.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+n.length+" } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have more than "+n.length+" items' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var P=i;i=E.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+P+"]); ":i+=" validate.errors = ["+P+"]; return false; ":i+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",c=w,l&&(m+="}",i+=" else { ")}var S=n;if(S)for(var k,x=-1,$=S.length-1;x<$;)if(k=S[x+=1],e.opts.strictKeywords?"object"==typeof k&&Object.keys(k).length>0:e.util.schemaHasRules(k,e.RULES.all)){i+=" "+v+" = true; if ("+d+".length > "+x+") { ";var O=d+"["+x+"]";p.schema=k,p.schemaPath=o+"["+x+"]",p.errSchemaPath=c+"/"+x,p.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,!0),p.dataPathArr[g]=x;var j=e.validate(p);p.baseId=_,e.util.varOccurences(j,y)<2?i+=" "+e.util.varReplace(j,y,O)+" ":i+=" var "+y+" = "+O+"; "+j+" ",i+=" } ",l&&(i+=" if ("+v+") { ",m+="}")}if("object"==typeof b&&(e.opts.strictKeywords?"object"==typeof b&&Object.keys(b).length>0:e.util.schemaHasRules(b,e.RULES.all))){p.schema=b,p.schemaPath=e.schemaPath+".additionalItems",p.errSchemaPath=e.errSchemaPath+"/additionalItems",i+=" "+v+" = true; if ("+d+".length > "+n.length+") { for (var "+f+" = "+n.length+"; "+f+" < "+d+".length; "+f+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,f,e.opts.jsonPointers,!0);O=d+"["+f+"]";p.dataPathArr[g]=f;j=e.validate(p);p.baseId=_,e.util.varOccurences(j,y)<2?i+=" "+e.util.varReplace(j,y,O)+" ":i+=" var "+y+" = "+O+"; "+j+" ",l&&(i+=" if (!"+v+") break; "),i+=" } } ",l&&(i+=" if ("+v+") { ",m+="}")}}else if(e.opts.strictKeywords?"object"==typeof n&&Object.keys(n).length>0:e.util.schemaHasRules(n,e.RULES.all)){p.schema=n,p.schemaPath=o,p.errSchemaPath=c,i+=" for (var "+f+" = 0; "+f+" < "+d+".length; "+f+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,f,e.opts.jsonPointers,!0);O=d+"["+f+"]";p.dataPathArr[g]=f;j=e.validate(p);p.baseId=_,e.util.varOccurences(j,y)<2?i+=" "+e.util.varReplace(j,y,O)+" ":i+=" var "+y+" = "+O+"; "+j+" ",l&&(i+=" if (!"+v+") break; "),i+=" }"}return l&&(i+=" "+m+" if ("+h+" == errors) {"),i},maximum:En,minimum:En,maxItems:Pn,minItems:Pn,maxLength:Sn,minLength:Sn,maxProperties:kn,minProperties:kn,multipleOf:function(e,t,r){var i,s=" ",a=e.level,n=e.dataLevel,o=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(n||""),h=e.opts.$data&&o&&o.$data;if(h?(s+=" var schema"+a+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=o,!h&&"number"!=typeof o)throw new Error(t+" must be number");s+="var division"+a+";if (",h&&(s+=" "+i+" !== undefined && ( typeof "+i+" != 'number' || "),s+=" (division"+a+" = "+u+" / "+i+", ",e.opts.multipleOfPrecision?s+=" Math.abs(Math.round(division"+a+") - division"+a+") > 1e-"+e.opts.multipleOfPrecision+" ":s+=" division"+a+" !== parseInt(division"+a+") ",s+=" ) ",h&&(s+=" ) "),s+=" ) { ";var p=p||[];p.push(s),s="",!1!==e.createErrors?(s+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { multipleOf: "+i+" } ",!1!==e.opts.messages&&(s+=" , message: 'should be multiple of ",s+=h?"' + "+i:i+"'"),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+m+"]); ":s+=" validate.errors = ["+m+"]; return false; ":s+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",d&&(s+=" else { "),s},not:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="errs__"+s,h=e.util.copy(e);h.level++;var p="valid"+h.level;if(e.opts.strictKeywords?"object"==typeof n&&Object.keys(n).length>0:e.util.schemaHasRules(n,e.RULES.all)){h.schema=n,h.schemaPath=o,h.errSchemaPath=c,i+=" var "+u+" = errors; ";var m,v=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1,h.opts.allErrors&&(m=h.opts.allErrors,h.opts.allErrors=!1),i+=" "+e.validate(h)+" ",h.createErrors=!0,m&&(h.opts.allErrors=m),e.compositeRule=h.compositeRule=v,i+=" if ("+p+") { ";var f=f||[];f.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var g=i;i=f.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+g+"]); ":i+=" validate.errors = ["+g+"]; return false; ":i+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { errors = "+u+"; if (vErrors !== null) { if ("+u+") vErrors.length = "+u+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else i+=" var err = ",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l&&(i+=" if (false) { ");return i},oneOf:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="valid"+s,h="errs__"+s,p=e.util.copy(e),m="";p.level++;var v="valid"+p.level,f=p.baseId,g="prevValid"+s,y="passingSchemas"+s;i+="var "+h+" = errors , "+g+" = false , "+u+" = false , "+y+" = null; ";var _=e.compositeRule;e.compositeRule=p.compositeRule=!0;var b=n;if(b)for(var w,E=-1,P=b.length-1;E0:e.util.schemaHasRules(w,e.RULES.all))?(p.schema=w,p.schemaPath=o+"["+E+"]",p.errSchemaPath=c+"/"+E,i+=" "+e.validate(p)+" ",p.baseId=f):i+=" var "+v+" = true; ",E&&(i+=" if ("+v+" && "+g+") { "+u+" = false; "+y+" = ["+y+", "+E+"]; } else { ",m+="}"),i+=" if ("+v+") { "+u+" = "+g+" = true; "+y+" = "+E+"; }";return e.compositeRule=p.compositeRule=_,i+=m+"if (!"+u+") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { passingSchemas: "+y+" } ",!1!==e.opts.messages&&(i+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&l&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+="} else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; }",e.opts.allErrors&&(i+=" } "),i},pattern:function(e,t,r){var i,s=" ",a=e.level,n=e.dataLevel,o=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(n||""),h=e.opts.$data&&o&&o.$data;h?(s+=" var schema"+a+" = "+e.util.getData(o.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=o,s+="if ( ",h&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'string') || "),s+=" !"+(h?"(new RegExp("+i+"))":e.usePattern(o))+".test("+u+") ) { ";var p=p||[];p.push(s),s="",!1!==e.createErrors?(s+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { pattern: ",s+=h?""+i:""+e.util.toQuotedString(o),s+=" } ",!1!==e.opts.messages&&(s+=" , message: 'should match pattern \"",s+=h?"' + "+i+" + '":""+e.util.escapeQuotes(o),s+="\"' "),e.opts.verbose&&(s+=" , schema: ",s+=h?"validate.schema"+c:""+e.util.toQuotedString(o),s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+m+"]); ":s+=" validate.errors = ["+m+"]; return false; ":s+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",d&&(s+=" else { "),s},properties:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="errs__"+s,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level,v="key"+s,f="idx"+s,g=h.dataLevel=e.dataLevel+1,y="data"+g,_="dataProperties"+s,b=Object.keys(n||{}).filter(A),w=e.schema.patternProperties||{},E=Object.keys(w).filter(A),P=e.schema.additionalProperties,S=b.length||E.length,k=!1===P,x="object"==typeof P&&Object.keys(P).length,$=e.opts.removeAdditional,O=k||x||$,j=e.opts.ownProperties,C=e.baseId,D=e.schema.required;if(D&&(!e.opts.$data||!D.$data)&&D.length8)i+=" || validate.schema"+o+".hasOwnProperty("+v+") ";else{var T=b;if(T)for(var N=-1,R=T.length-1;N0:e.util.schemaHasRules(Z,e.RULES.all)){var X=e.util.getProperty(W),ee=(Q=d+X,K&&void 0!==Z.default);h.schema=Z,h.schemaPath=o+X,h.errSchemaPath=c+"/"+e.util.escapeFragment(W),h.errorPath=e.util.getPath(e.errorPath,W,e.opts.jsonPointers),h.dataPathArr[g]=e.util.toQuotedString(W);B=e.validate(h);if(h.baseId=C,e.util.varOccurences(B,y)<2){B=e.util.varReplace(B,y,Q);var te=Q}else{te=y;i+=" var "+y+" = "+Q+"; "}if(ee)i+=" "+B+" ";else{if(z&&z[W]){i+=" if ( "+te+" === undefined ",j&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(W)+"') "),i+=") { "+m+" = false; ";L=e.errorPath,U=c;var re,ie=e.util.escapeQuotes(W);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(L,W,e.opts.jsonPointers)),c=e.errSchemaPath+"/required",(re=re||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+ie+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+ie+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";q=i;i=re.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+q+"]); ":i+=" validate.errors = ["+q+"]; return false; ":i+=" var err = "+q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c=U,e.errorPath=L,i+=" } else { "}else l?(i+=" if ( "+te+" === undefined ",j&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(W)+"') "),i+=") { "+m+" = true; } else { "):(i+=" if ("+te+" !== undefined ",j&&(i+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(W)+"') "),i+=" ) { ");i+=" "+B+" } "}}l&&(i+=" if ("+m+") { ",p+="}")}}if(E.length){var se=E;if(se)for(var ae,ne=-1,oe=se.length-1;ne0:e.util.schemaHasRules(Z,e.RULES.all)){h.schema=Z,h.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ae),h.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ae),i+=j?" "+_+" = "+_+" || Object.keys("+d+"); for (var "+f+"=0; "+f+"<"+_+".length; "+f+"++) { var "+v+" = "+_+"["+f+"]; ":" for (var "+v+" in "+d+") { ",i+=" if ("+e.usePattern(ae)+".test("+v+")) { ",h.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers);Q=d+"["+v+"]";h.dataPathArr[g]=v;B=e.validate(h);h.baseId=C,e.util.varOccurences(B,y)<2?i+=" "+e.util.varReplace(B,y,Q)+" ":i+=" var "+y+" = "+Q+"; "+B+" ",l&&(i+=" if (!"+m+") break; "),i+=" } ",l&&(i+=" else "+m+" = true; "),i+=" } ",l&&(i+=" if ("+m+") { ",p+="}")}}}return l&&(i+=" "+p+" if ("+u+" == errors) {"),i},propertyNames:function(e,t,r){var i=" ",s=e.level,a=e.dataLevel,n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(a||""),u="errs__"+s,h=e.util.copy(e);h.level++;var p="valid"+h.level;if(i+="var "+u+" = errors;",e.opts.strictKeywords?"object"==typeof n&&Object.keys(n).length>0:e.util.schemaHasRules(n,e.RULES.all)){h.schema=n,h.schemaPath=o,h.errSchemaPath=c;var m="key"+s,v="idx"+s,f="i"+s,g="' + "+m+" + '",y="data"+(h.dataLevel=e.dataLevel+1),_="dataProperties"+s,b=e.opts.ownProperties,w=e.baseId;b&&(i+=" var "+_+" = undefined; "),i+=b?" "+_+" = "+_+" || Object.keys("+d+"); for (var "+v+"=0; "+v+"<"+_+".length; "+v+"++) { var "+m+" = "+_+"["+v+"]; ":" for (var "+m+" in "+d+") { ",i+=" var startErrs"+s+" = errors; ";var E=m,P=e.compositeRule;e.compositeRule=h.compositeRule=!0;var S=e.validate(h);h.baseId=w,e.util.varOccurences(S,y)<2?i+=" "+e.util.varReplace(S,y,E)+" ":i+=" var "+y+" = "+E+"; "+S+" ",e.compositeRule=h.compositeRule=P,i+=" if (!"+p+") { for (var "+f+"=startErrs"+s+"; "+f+"0:e.util.schemaHasRules(_,e.RULES.all))||(m[m.length]=f)}}else m=n;if(h||m.length){var b=e.errorPath,w=h||m.length>=e.opts.loopRequired,E=e.opts.ownProperties;if(l)if(i+=" var missing"+s+"; ",w){h||(i+=" var "+p+" = validate.schema"+o+"; ");var P="' + "+(j="schema"+s+"["+(x="i"+s)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(b,j,e.opts.jsonPointers)),i+=" var "+u+" = true; ",h&&(i+=" if (schema"+s+" === undefined) "+u+" = true; else if (!Array.isArray(schema"+s+")) "+u+" = false; else {"),i+=" for (var "+x+" = 0; "+x+" < "+p+".length; "+x+"++) { "+u+" = "+d+"["+p+"["+x+"]] !== undefined ",E&&(i+=" && Object.prototype.hasOwnProperty.call("+d+", "+p+"["+x+"]) "),i+="; if (!"+u+") break; } ",h&&(i+=" } "),i+=" if (!"+u+") { ",(O=O||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+P+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var S=i;i=O.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else{i+=" if ( ";var k=m;if(k)for(var x=-1,$=k.length-1;x<$;){D=k[x+=1],x&&(i+=" || "),i+=" ( ( "+(N=d+(T=e.util.getProperty(D)))+" === undefined ",E&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(D)+"') "),i+=") && (missing"+s+" = "+e.util.toQuotedString(e.opts.jsonPointers?D:T)+") ) "}i+=") { ";var O;P="' + "+(j="missing"+s)+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(b,j,!0):b+" + "+j),(O=O||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+P+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";S=i;i=O.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else if(w){h||(i+=" var "+p+" = validate.schema"+o+"; ");var j;P="' + "+(j="schema"+s+"["+(x="i"+s)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(b,j,e.opts.jsonPointers)),h&&(i+=" if ("+p+" && !Array.isArray("+p+")) { var err = ",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+P+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+p+" !== undefined) { "),i+=" for (var "+x+" = 0; "+x+" < "+p+".length; "+x+"++) { if ("+d+"["+p+"["+x+"]] === undefined ",E&&(i+=" || ! Object.prototype.hasOwnProperty.call("+d+", "+p+"["+x+"]) "),i+=") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+P+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",h&&(i+=" } ")}else{var C=m;if(C)for(var D,z=-1,A=C.length-1;z 1) { ";var m=e.schema.items&&e.schema.items.type,v=Array.isArray(m);if(!m||"object"==m||"array"==m||v&&(m.indexOf("object")>=0||m.indexOf("array")>=0))s+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+u+"[i], "+u+"[j])) { "+h+" = false; break outer; } } } ";else{s+=" var itemIndices = {}, item; for (;i--;) { var item = "+u+"[i]; ";var f="checkDataType"+(v?"s":"");s+=" if ("+e.util[f](m,"item",e.opts.strictNumbers,!0)+") continue; ",v&&(s+=" if (typeof item == 'string') item = '\"' + item; "),s+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}s+=" } ",p&&(s+=" } "),s+=" if (!"+h+") { ";var g=g||[];g.push(s),s="",!1!==e.createErrors?(s+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(s+=" , schema: ",s+=p?"validate.schema"+c:""+o,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var y=s;s=g.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+y+"]); ":s+=" validate.errors = ["+y+"]; return false; ":s+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",d&&(s+=" else { ")}else d&&(s+=" if (true) { ");return s},validate:qa},$n=da.toHash,On=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"],jn=function(e,t){for(var r=0;r{let a=Wi("services."+Ms({service:r,service_data:{[e]:t}}));a&&(i=a,delete s[e])}),!i&&s&&Object.keys(s).length&&Object.entries(s).forEach(([e])=>{let t=Wi(`services.${r}_${e}`);t&&(i=t)}),i||(i=Wi("services."+Ms({service:r}))||r);const a=i.match(/\{([^}]+)\}/);if(a){let e="";Object.keys(s).length&&Object.entries(s).forEach(([r,i])=>{a[1].includes(r)&&(e=a[1].replace(r,Un(r,i,t)))}),i=i.replace(/\{([^}]+)\}/,e)}return i}window.customCards=window.customCards||[],window.customCards.push({type:"scheduler-entity-row",name:"scheduler-entity-row",description:"Show a schedule entity in entities card."});let Hn=class extends ie{setConfig(e){this._config=e}shouldUpdate(e){const t=e.get("hass");if(t&&this._config){const e=this._config.entity;return t.states[e]!==this.hass.states[e]}return!0}render(){var e;if(!this._config||!this.hass)return I``;const t=this.hass.states[this._config.entity];if(!t)return I` + `;function ro(e,t,r){switch(e){case"position":return Number(t)+"%";case"temperature":return`${Number(t)}${r.config.unit_system.temperature}`;case"humidity":return Number(t)+"%";case"brightness":return Math.round(Number(t)/2.55)+"%";default:return""+t}}function io(e,t){if("name"in e&&e.name)return String(e.name);const r=e.service;let i,s=Object.assign({},e.service_data);s&&Object.keys(s).length&&Object.entries(s).forEach(([e,t])=>{let a=ls("services."+Xs({service:r,service_data:{[e]:t}}));a&&(i=a,delete s[e])}),!i&&s&&Object.keys(s).length&&Object.entries(s).forEach(([e])=>{let t=ls(`services.${r}_${e}`);t&&(i=t)}),i||(i=ls("services."+Xs({service:r}))||r);const a=i.match(/\{([^}]+)\}/);if(a){let e="";Object.keys(s).length&&Object.entries(s).forEach(([r,i])=>{a[1].includes(r)&&(e=a[1].replace(r,ro(r,i,t)))}),i=i.replace(/\{([^}]+)\}/,e)}return i}window.customCards=window.customCards||[],window.customCards.push({type:"scheduler-entity-row",name:"scheduler-entity-row",description:"Show a schedule entity in entities card."});let so=class extends ie{setConfig(e){this._config=e}shouldUpdate(e){const t=e.get("hass");if(t&&this._config){const e=this._config.entity;return t.states[e]!==this.hass.states[e]}return!0}render(){var e;if(!this._config||!this.hass)return I``;const t=this.hass.states[this._config.entity];if(!t)return I` Entity not found '${this._config.entity}' - `;let r=t.attributes.entries.map(fs),i=this.computeNextEntry(r),s=Vs(i.actions.map(e=>t.attributes.actions[e])[0]),a=this.hass.states[s.entity],n=this._config.name?this._config.name:a?a.attributes.friendly_name||ke(a.entity_id):"(unknown entity)",o=this._config.icon?this._config.icon:a?"folder-outline":"help-circle-outline";if(this._config.config&&s.entity in this._config.config&&this._config.config[s.entity]){n=this._config.config[s.entity].name||n,o=this._config.config[s.entity].icon||o;const e=Us(this._config.config[s.entity],s);if(e.length){const t=this._config.config[s.entity].actions[e[0]];t.icon&&(o=t.icon),s=Ls(Object.assign(Object.assign({},t),{service_data:Object.assign(Object.assign({},t.service_data||{}),s.service_data||{})}))}}(null===(e=t.attributes.friendly_name)||void 0===e?void 0:e.match(/^schedule\ #[0-9a-f]{6}$/i))||t.attributes.friendly_name;return I` + `;let r=t.attributes.entries.map(Cs),i=this.computeNextEntry(r),s=ta(i.actions.map(e=>t.attributes.actions[e])[0]),a=this.hass.states[s.entity],n=this._config.name?this._config.name:a?a.attributes.friendly_name||ke(a.entity_id):"(unknown entity)",o=this._config.icon?this._config.icon:a?"folder-outline":"help-circle-outline";if(this._config.config&&s.entity in this._config.config&&this._config.config[s.entity]){n=this._config.config[s.entity].name||n,o=this._config.config[s.entity].icon||o;const e=ra(this._config.config[s.entity],s);if(e.length){const t=this._config.config[s.entity].actions[e[0]];t.icon&&(o=t.icon),s=ea(Object.assign(Object.assign({},t),{service_data:Object.assign(Object.assign({},t.service_data||{}),s.service_data||{})}))}}(null===(e=t.attributes.friendly_name)||void 0===e?void 0:e.match(/^schedule\ #[0-9a-f]{6}$/i))||t.attributes.friendly_name;return I`
- ${Rs(Fs(n))}: ${Rs(qn(s,this.hass))} + ${Ys(Js(n))}: ${Ys(io(s,this.hass))}
- ${Rs(cs(this.computeTimestamp(i)))}
- ${r.length>1?2==r.length?Wi("misc.one_additional_task"):Wi("misc.x_additional_tasks","{count}",String(r.length-1)):""} + ${Ys(Es(this.computeTimestamp(i)))}
+ ${r.length>1?2==r.length?ls("misc.one_additional_task"):ls("misc.x_additional_tasks","{count}",String(r.length-1)):""}
- `}computeTimestamp(e){let t=new Date,r=new Date;r.setSeconds(0);let i=e.time.value;if(e.time.event){let t=this.hass.states["sun.sun"];if(!t)return new Date(0);i=(e.time.event==Xi.Sunrise?ss(t.attributes.next_rising):ss(t.attributes.next_setting))+e.time.value}let s=Math.floor(i/60),a=i-60*s;r.setHours(s),r.setMinutes(a);let n=as(e.days);for(;r.valueOf()<=t.valueOf()||!n.includes(os(r));)r.setDate(r.getDate()+1);return r}computeNextEntry(e){let t=e.map(e=>this.computeTimestamp(e)),r=-1,i=-1;return t.forEach((e,t)=>{(-1===r||e.valueOf()this.computeTimestamp(e)),r=-1,i=-1;return t.forEach((e,t)=>{(-1===r||e.valueOf()Hs(e)).map(([,e])=>e);void 0===this.config.discover_existing||this.config.discover_existing||(e=e.filter(e=>e.attributes.actions.map(e=>e.entity).every(e=>this._hass.states[e]&&Bs(this._hass.states[e],this.config)))),e.sort((e,t)=>{const r=e.attributes.next_trigger?new Date(e.attributes.next_trigger).valueOf():null,i=t.attributes.next_trigger?new Date(t.attributes.next_trigger).valueOf():null;return null!==r&&null!==i?r>i?1:rHs(e));return e.length!==this.scheduleEntities.length?(this.loadSchedules(),!0):!!e.some((e,t)=>e!==this.scheduleEntities[t])||!!e.some(e=>t.states[e]!==this._hass.states[e])}return this.loadSchedules(),!0}set hass(e){this.scheduleEntities=Object.keys(e.states).filter(e=>Hs(e)),this._hass=e}render(){return this._hass&&this.config&&this.schedules?I` + `,t([J()],so.prototype,"hass",void 0),t([J({attribute:!1,hasChanged:null==ao?void 0:ao.hasChanged})],so.prototype,"_config",void 0),so=t([W("scheduler-entity-row")],so);let no=class extends ie{constructor(){super(...arguments),this.schedules=[],this.scheduleEntities=[]}firstUpdated(){}loadSchedules(){if(!this._hass||!this.config)return;let e=Object.entries(this._hass.states).filter(([e])=>sa(e)).map(([,e])=>e);void 0===this.config.discover_existing||this.config.discover_existing||(e=e.filter(e=>e.attributes.actions.map(e=>e.entity).every(e=>this._hass.states[e]&&na(this._hass.states[e],this.config)))),e.sort((e,t)=>{const r=e.attributes.next_trigger?new Date(e.attributes.next_trigger).valueOf():null,i=t.attributes.next_trigger?new Date(t.attributes.next_trigger).valueOf():null;return null!==r&&null!==i?r>i?1:rsa(e));return e.length!==this.scheduleEntities.length?(this.loadSchedules(),!0):!!e.some((e,t)=>e!==this.scheduleEntities[t])||!!e.some(e=>t.states[e]!==this._hass.states[e])}return this.loadSchedules(),!0}set hass(e){this.scheduleEntities=Object.keys(e.states).filter(e=>sa(e)),this._hass=e}render(){return this._hass&&this.config&&this.schedules?I`
- ${void 0!==this.config.title?"string"==typeof this.config.title?this.config.title:"":Wi("scheduler")} + ${void 0!==this.config.title?"string"==typeof this.config.title?this.config.title:"":ls("scheduler")}
${this.schedules.length&&this.config.show_header_toggle?I` `:""} - `:I``}getRows(){if(!this.config||!this._hass||!this.schedules)return I``;let e=[];this.schedules.forEach(t=>e=e.concat(t.attributes.actions.map(e=>e.entity))),e=e.filter((e,t,r)=>r.indexOf(e)===t);const t=e.map(e=>[e,Qs(this._hass.states[e],this.config)]).reduce((e,[t,r])=>Object.assign(e,{[String(t)]:r}),{});return this.schedules.length?this.schedules.map(e=>e.entity_id).map(e=>{const r=this._hass.states[e];return!r.attributes.actions.map(e=>e.entity).every(e=>Cs(e,this.config))?I` + `:I``}getRows(){if(!this.config||!this._hass||!this.schedules)return I``;let e=[];this.schedules.forEach(t=>e=e.concat(t.attributes.actions.map(e=>e.entity))),e=e.filter((e,t,r)=>r.indexOf(e)===t);const t=e.map(e=>[e,aa(this._hass.states[e],this.config)]).reduce((e,[t,r])=>Object.assign(e,{[String(t)]:r}),{});return this.schedules.length?this.schedules.map(e=>e.entity_id).map(e=>{const r=this._hass.states[e];return!r.attributes.actions.map(e=>e.entity).every(e=>Hs(e,this.config))?I` this.editItemClick(e)} > - `}):I`${Wi("instructions.no_entries_defined")}`}toggleDisableAll(e){if(!this._hass||!this.schedules)return;let t=e.target.checked;this.schedules.forEach(e=>{this._hass.callService("switch",t?"turn_on":"turn_off",{entity_id:e.entity_id})})}editItemClick(e){let t=new CustomEvent("editClick",{detail:e});this.dispatchEvent(t)}newItemClick(){let e=new CustomEvent("newClick");this.dispatchEvent(e)}};function Kn(e,t){const r=[];t.groups&&t.groups.forEach(t=>{const i={id:t.name,name:t.name,icon:t.icon||"folder-outline",entities:e.filter(e=>Cs(e,t))};r.push(i)});const i=e.filter(e=>!r.some(t=>t.entities.includes(e)));return i.map(Se).filter((e,t,r)=>r.indexOf(e)===t).forEach(e=>{const s={id:e,name:e in Ji?Wi(Ji[e]):e,icon:(void 0===t.standard_configuration||t.standard_configuration)&&e in Ds?Ds[e]:"folder-outline",entities:i.filter(t=>Cs(t,{include:[e]}))};r.push(s)}),r}Bn.styles=te` - ${Vn} + `}):I`${ls("instructions.no_entries_defined")}`}toggleDisableAll(e){if(!this._hass||!this.schedules)return;let t=e.target.checked;this.schedules.forEach(e=>{this._hass.callService("switch",t?"turn_on":"turn_off",{entity_id:e.entity_id})})}editItemClick(e){let t=new CustomEvent("editClick",{detail:e});this.dispatchEvent(t)}newItemClick(){let e=new CustomEvent("newClick");this.dispatchEvent(e)}};function oo(e,t){const r=[];t.groups&&t.groups.forEach(t=>{const i={id:t.name,name:t.name,icon:t.icon||"folder-outline",entities:e.filter(e=>Hs(e,t))};r.push(i)});const i=e.filter(e=>!r.some(t=>t.entities.includes(e)));return i.map(Se).filter((e,t,r)=>r.indexOf(e)===t).forEach(e=>{const s={id:e,name:e in us?ls(us[e]):e,icon:(void 0===t.standard_configuration||t.standard_configuration)&&e in Qs?Qs[e]:"folder-outline",entities:i.filter(t=>Hs(t,{include:[e]}))};r.push(s)}),r}no.styles=te` + ${to} .card-content > * { margin: 20px 0px; } @@ -378,44 +378,44 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad hui-warning { padding: 10px 0px; } - `,t([J()],Bn.prototype,"_hass",void 0),t([J()],Bn.prototype,"config",void 0),Bn=t([W("scheduler-entities-card")],Bn);let Gn=class extends ie{constructor(){super(...arguments),this.items=[]}render(){return this.items.length?this.items.map(e=>this.createButton(e)):I` + `,t([J()],no.prototype,"_hass",void 0),t([J()],no.prototype,"config",void 0),no=t([W("scheduler-entities-card")],no);let co=class extends ie{constructor(){super(...arguments),this.items=[]}render(){return this.items.length?this.items.map(e=>this.createButton(e)):I`
`}createButton(e){let t=Array.isArray(this.value)?this.value:[this.value];"object"!=typeof e&&(e={name:String(e)});let r=void 0!==e.id?e.id:e.name;return I` - ${e.icon?I``:""} - ${Fs(e.name)} + ${e.icon?I``:""} + ${Js(e.name)} - `}selectItem(e){if(Array.isArray(this.value)){let t=Array.isArray(this.value)?this.value:[];if(t.includes(e)){if(void 0!==this.min&&t.length<=this.min)return;t=t.filter(t=>t!=e)}else t.push(e);this.value=t}else if(e==this.value){if(!this.optional)return;this.value=null}else this.value=e;let t=new CustomEvent("change");this.dispatchEvent(t)}};Gn.styles=Vn,t([J({type:Array})],Gn.prototype,"items",void 0),t([J()],Gn.prototype,"value",void 0),t([J({type:Number})],Gn.prototype,"min",void 0),t([J({type:Boolean})],Gn.prototype,"optional",void 0),Gn=t([W("button-group")],Gn);let Wn=class extends ie{getGroups(){if(!this.hass||!this.config)return[];let e=Kn(Object.values(this.hass.states).filter(e=>Bs(e,this.config,{actions:!0})).map(e=>e.entity_id),this.config);return e.sort((e,t)=>e.name.trim().toLowerCase()e.id==this.selectedGroup).entities.map(e=>Qs(this.hass.states[e],this.config)).filter(e=>e);return t.sort((e,t)=>e.name.trim().toLowerCase()e.id==this.selectedEntity).actions.map(Ls).map(e=>e.name?e:Object.assign(e,{name:qn(e,this.hass)}));return t.sort((e,t)=>e.name.trim().toLowerCase()t!=e)}else t.push(e);this.value=t}else if(e==this.value){if(!this.optional)return;this.value=null}else this.value=e;let t=new CustomEvent("change");this.dispatchEvent(t)}};co.styles=to,t([J({type:Array})],co.prototype,"items",void 0),t([J()],co.prototype,"value",void 0),t([J({type:Number})],co.prototype,"min",void 0),t([J({type:Boolean})],co.prototype,"optional",void 0),co=t([W("button-group")],co);let lo=class extends ie{getGroups(){if(!this.hass||!this.config)return[];let e=oo(Object.values(this.hass.states).filter(e=>na(e,this.config,{actions:!0})).map(e=>e.entity_id),this.config);return e.sort((e,t)=>e.name.trim().toLowerCase()e.id==this.selectedGroup).entities.map(e=>aa(this.hass.states[e],this.config)).filter(e=>e);return t.sort((e,t)=>e.name.trim().toLowerCase()e.id==this.selectedEntity).actions.map(ea).map(e=>e.name?e:Object.assign(e,{name:io(e,this.hass)}));return t.sort((e,t)=>e.name.trim().toLowerCase()
- ${void 0!==this.config.title?"string"==typeof this.config.title?this.config.title:"":Wi("scheduler")} + ${void 0!==this.config.title?"string"==typeof this.config.title?this.config.title:"":ls("scheduler")}
-
${Wi("fields.group")}
+
${ls("fields.group")}
- ${Wi("instructions.no_groups_defined")} + ${ls("instructions.no_groups_defined")} -
${Wi("fields.entity")}
+
${ls("fields.entity")}
- ${this.selectedGroup?Wi("instructions.no_entities_for_group"):Wi("instructions.no_group_selected")} + ${this.selectedGroup?ls("instructions.no_entities_for_group"):ls("instructions.no_group_selected")} -
${Wi("fields.action")}
+
${ls("fields.action")}
- ${this.selectedEntity?Wi("instructions.no_actions_for_entity"):Wi("instructions.no_entity_selected")} + ${this.selectedEntity?ls("instructions.no_actions_for_entity"):ls("instructions.no_entity_selected")} ${this.makeSchemeButton(r)}
- ${Wi("actions.next")} + ${ls("actions.next")}
`}makeSchemeButton(e){return e.length?I` @@ -424,12 +424,12 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad {this.selectedAction="make_scheme"}}> - - ${Fs("make_scheme")} + + ${Js("make_scheme")}
- `:I``}selectGroup(e){let t="string"==typeof e?e:e.target.value;this.selectedGroup=t,this.selectedEntity=void 0,this.selectedAction=void 0}selectEntity(e){let t="string"==typeof e?e:e.target.value;this.selectedEntity=t,this.selectedAction=void 0}selectAction(e){let t="string"==typeof e?e:e.target.value;this.selectedAction=t}cancelClick(){let e=new CustomEvent("cancelClick");this.dispatchEvent(e)}nextClick(){let e=new CustomEvent("nextClick",{detail:{entity:this.selectedEntity,action:this.selectedAction}});this.dispatchEvent(e)}};Wn.styles=Vn,t([J()],Wn.prototype,"hass",void 0),t([J()],Wn.prototype,"config",void 0),t([J()],Wn.prototype,"selectedGroup",void 0),t([J()],Wn.prototype,"selectedEntity",void 0),t([J()],Wn.prototype,"selectedAction",void 0),Wn=t([W("scheduler-editor-card")],Wn);let Yn=class extends ie{constructor(){super(...arguments),this._val=0,this.formatAmPm=!1,this.stepSize=10,this.maxOffset=2}set value(e){let t=this.value;this._val=e,this.requestUpdate("value",t)}get value(){return ts(this._val,this.stepSize)}updated(){let e=new CustomEvent("change",{detail:{event:this.event}});this.dispatchEvent(e)}firstUpdated(){let e=this.event?{stepSize:this.stepSize,signed:!0,max:60*this.maxOffset}:{stepSize:this.stepSize};this.value=is(this.value,e)}render(){return I` + `:I``}selectGroup(e){let t="string"==typeof e?e:e.target.value;this.selectedGroup=t,this.selectedEntity=void 0,this.selectedAction=void 0}selectEntity(e){let t="string"==typeof e?e:e.target.value;this.selectedEntity=t,this.selectedAction=void 0}selectAction(e){let t="string"==typeof e?e:e.target.value;this.selectedAction=t}cancelClick(){let e=new CustomEvent("cancelClick");this.dispatchEvent(e)}nextClick(){let e=new CustomEvent("nextClick",{detail:{entity:this.selectedEntity,action:this.selectedAction}});this.dispatchEvent(e)}};lo.styles=to,t([J()],lo.prototype,"hass",void 0),t([J()],lo.prototype,"config",void 0),t([J()],lo.prototype,"selectedGroup",void 0),t([J()],lo.prototype,"selectedEntity",void 0),t([J()],lo.prototype,"selectedAction",void 0),lo=t([W("scheduler-editor-card")],lo);let uo=class extends ie{constructor(){super(...arguments),this._val=0,this.formatAmPm=!1,this.stepSize=10,this.maxOffset=2}set value(e){let t=this.value;this._val=e,this.requestUpdate("value",t)}get value(){return vs(this._val,this.stepSize)}updated(){let e=new CustomEvent("change",{detail:{event:this.event}});this.dispatchEvent(e)}firstUpdated(){let e=this.event?{stepSize:this.stepSize,signed:!0,max:60*this.maxOffset}:{stepSize:this.stepSize};this.value=gs(this.value,e)}render(){return I`
@@ -459,17 +459,17 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad ${this.getSunModeToggle()}
- `}getHours(){return rs(this.value,{amPm:this.formatAmPm}).hours}getMinutes(){return rs(this.value,{amPm:this.formatAmPm}).minutes}hoursUp(){let e=this.event?{stepSize:this.stepSize,signed:!0,max:60*this.maxOffset}:{stepSize:this.stepSize};this.value=is(this._val+60,e)}hoursDown(){let e=this.event?{stepSize:this.stepSize,signed:!0,max:60*this.maxOffset}:{stepSize:this.stepSize};this.value=is(this._val-60,e)}minutesUp(){let e=this.event?{stepSize:this.stepSize,signed:!0,max:60*this.maxOffset}:{stepSize:this.stepSize};this.value=is(this._val+this.stepSize,e)}minutesDown(){let e=this.event?{stepSize:this.stepSize,signed:!0,max:60*this.maxOffset}:{stepSize:this.stepSize};this.value=is(this._val-this.stepSize,e)}getSunModeToggle(){return this.hass&&this.hass.states["sun.sun"]?I` + `}getHours(){return fs(this.value,{amPm:this.formatAmPm}).hours}getMinutes(){return fs(this.value,{amPm:this.formatAmPm}).minutes}hoursUp(){let e=this.event?{stepSize:this.stepSize,signed:!0,max:60*this.maxOffset}:{stepSize:this.stepSize};this.value=gs(this._val+60,e)}hoursDown(){let e=this.event?{stepSize:this.stepSize,signed:!0,max:60*this.maxOffset}:{stepSize:this.stepSize};this.value=gs(this._val-60,e)}minutesUp(){let e=this.event?{stepSize:this.stepSize,signed:!0,max:60*this.maxOffset}:{stepSize:this.stepSize};this.value=gs(this._val+this.stepSize,e)}minutesDown(){let e=this.event?{stepSize:this.stepSize,signed:!0,max:60*this.maxOffset}:{stepSize:this.stepSize};this.value=gs(this._val-this.stepSize,e)}getSunModeToggle(){return this.hass&&this.hass.states["sun.sun"]?I` - `:I``}getAmPm(){return rs(this._val,{amPm:this.formatAmPm}).amPm}getBeforeAfter(){return this.value<0?Wi("words.before"):Wi("words.after")}getSuffix(){return this.event?I` + `:I``}getAmPm(){return fs(this._val,{amPm:this.formatAmPm}).amPm}getBeforeAfter(){return this.value<0?ls("words.before"):ls("words.after")}getSuffix(){return this.event?I`
${this.getBeforeAfter()} - +
`:this.formatAmPm?I` @@ -478,7 +478,7 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad ${this.getAmPm()} - `:I``}toggleAmPm(){this._val<720?this.value=is(this._val+720):this.value=is(this._val-720)}toggleBeforeAfter(){this.value=-this._val}toggleSunriseSunset(){this.event=this.event==Xi.Sunrise?Xi.Sunset:Xi.Sunrise,this.value=this._val}toggleMode(){if(!this.hass)return;let e=this.hass.states["sun.sun"],t=ss(e.attributes.next_rising),r=ss(e.attributes.next_setting),i=this.value;if(this.event){let e=this.event==Xi.Sunrise?t:r;this.event=void 0,this.value=i+e}else{let e;Math.abs(i-t)60*this.maxOffset?this.value=60*this.maxOffset:this.value<60*-this.maxOffset&&(this.value=60*-this.maxOffset)}}};function Jn(e){return e.endTime.value-e.time.value}Yn.styles=te` + `:I``}toggleAmPm(){this._val<720?this.value=gs(this._val+720):this.value=gs(this._val-720)}toggleBeforeAfter(){this.value=-this._val}toggleSunriseSunset(){this.event=this.event==ps.Sunrise?ps.Sunset:ps.Sunrise,this.value=this._val}toggleMode(){if(!this.hass)return;let e=this.hass.states["sun.sun"],t=ys(e.attributes.next_rising),r=ys(e.attributes.next_setting),i=this.value;if(this.event){let e=this.event==ps.Sunrise?t:r;this.event=void 0,this.value=i+e}else{let e;Math.abs(i-t)60*this.maxOffset?this.value=60*this.maxOffset:this.value<60*-this.maxOffset&&(this.value=60*-this.maxOffset)}}};function ho(e){return e.endTime.value-e.time.value}uo.styles=te` div.time-picker { display: grid; grid-template-columns: min-content min-content min-content 1fr min-content; @@ -523,7 +523,7 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad --mdc-theme-primary: var(--text-primary-color); border-radius: 4px; } - `,t([J({type:Number})],Yn.prototype,"value",null),t([J()],Yn.prototype,"hass",void 0),t([J({type:String})],Yn.prototype,"event",void 0),t([J({type:Boolean})],Yn.prototype,"formatAmPm",void 0),t([J({type:Number})],Yn.prototype,"stepSize",void 0),Yn=t([W("time-picker")],Yn);let Zn=class extends ie{constructor(){super(...arguments),this.entries=[],this.actions=[],this.stepSize=10,this._activeEntry=null,this._activeThumb=null}render(){return I` + `,t([J({type:Number})],uo.prototype,"value",null),t([J()],uo.prototype,"hass",void 0),t([J({type:String})],uo.prototype,"event",void 0),t([J({type:Boolean})],uo.prototype,"formatAmPm",void 0),t([J({type:Number})],uo.prototype,"stepSize",void 0),uo=t([W("time-picker")],uo);let po=class extends ie{constructor(){super(...arguments),this.entries=[],this.actions=[],this.stepSize=10,this._activeEntry=null,this._activeThumb=null}render(){return I`
@@ -567,16 +567,16 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad `}
`}getSlots(){let e=[];return this.entries.forEach((t,r)=>{if(e.push(I` -
+
${this.getEntryAction(t)}
`),r
- ${rs(t).time} + ${fs(t).time}
-
`)}}),e}updated(){this.shadowRoot.querySelectorAll(".slider-thumb-tooltip").forEach((e,t)=>{let r=this.entries[t].endTime.value;e.innerText=rs(r).time})}getEntryAction(e){if(!this.hass)return;if(!e.action)return"";let t=this.actions.find(t=>t.id==e.action);if(e.variable&&e.variable.type==xe.Level&&t.variable){if(e.variable.enabled)return Un(t.variable.field,Number(e.variable.value),this.hass)}else if(e.variable&&e.variable.type==xe.List)return Fs(String(e.variable.value));const r=t.service;return Fs(t.name||Wi("services."+r)||r)}_handleSegmentClick(e){let t=e.target,r=Number(t.getAttribute("index"));this._activeEntry=this._activeEntry==r?null:r;let i=new CustomEvent("update",{detail:{entry:this._activeEntry}});this.dispatchEvent(i)}_handleTouchStart(e){let t;if(t=e.target,!t)return;let r=t.parentNode,i=r.parentElement,s=i.getBoundingClientRect(),a=r.previousElementSibling,n=r.nextElementSibling,o=r.querySelector(".slider-thumb-tooltip");this._activeThumb=Number(r.getAttribute("index"));const c=a.offsetWidth+n.offsetWidth,l=s.width;let d=Array.from(i.querySelectorAll(".slider-slot")),u=d.map(e=>e.offsetWidth),h=0,p=-1;d.forEach((e,t)=>{e==a?p=t:-1==p&&(h+=u[t])});var m=e=>{let t;t="undefined"!=typeof TouchEvent&&e instanceof TouchEvent?e.changedTouches[0].pageX:e.pageX;let r=t-s.left;r<0?r=0:r>s.width&&(r=s.width),r>c+h&&(r=c+h),r=1440?i=1440:ts(i,this.stepSize),o.dispatchEvent(new CustomEvent("update",{detail:{time:i}}))},v=()=>{window.removeEventListener("mousemove",m),window.removeEventListener("touchmove",m),window.removeEventListener("mouseup",v),window.removeEventListener("touchend",v),m=()=>{};let e=ss(o.innerText),t=Jn(this.entries[p])+Jn(this.entries[p+1]),r=this.entries[p].time.value,i=[...this.entries];Object.assign(i[p],{endTime:{value:e}}),Object.assign(i[p+1],{time:{value:e},endTime:{value:r+t}}),this._activeThumb=null;let s=new CustomEvent("update",{detail:{entries:i}});this.dispatchEvent(s)};window.addEventListener("mouseup",v),window.addEventListener("touchend",v),window.addEventListener("mousemove",m),window.addEventListener("touchmove",m)}_updateMarker(e){let t=e.detail,r=Number(t.time);1440==r&&(r-=1),e.target.innerText=rs(r).time}_addSlot(){let e=this.entries[this._activeEntry],t=e.time.value,r=e.endTime.value,i=ts(t+Jn(e)/2,this.stepSize),s=Object.assign({time:{value:i},endTime:{value:r},action:""},Ts(e,["entity","days"])),a=[...this.entries];Object.assign(a[this._activeEntry],{endTime:{value:i}}),a.splice(this._activeEntry+1,0,s);let n=new CustomEvent("update",{detail:{entries:a}});this.dispatchEvent(n)}_removeSlot(){let e=this._activeEntry==this.entries.length-1?this._activeEntry-1:this._activeEntry,t=Object.assign({},this.entries[e]);Object.assign(t,{endTime:this.entries[e+1].endTime});let r=[...this.entries];r.splice(e,2,t),this._activeEntry==this.entries.length&&this._activeEntry--;let i=new CustomEvent("update",{detail:{entries:r}});this.dispatchEvent(i)}};Zn.styles=te` +
`)}}),e}updated(){this.shadowRoot.querySelectorAll(".slider-thumb-tooltip").forEach((e,t)=>{let r=this.entries[t].endTime.value;e.innerText=fs(r).time})}getEntryAction(e){if(!this.hass)return;if(!e.action)return"";let t=this.actions.find(t=>t.id==e.action);if(e.variable&&e.variable.type==xe.Level&&t.variable){if(e.variable.enabled)return ro(t.variable.field,Number(e.variable.value),this.hass)}else if(e.variable&&e.variable.type==xe.List)return Js(String(e.variable.value));const r=t.service;return Js(t.name||ls("services."+r)||r)}_handleSegmentClick(e){let t=e.target,r=Number(t.getAttribute("index"));this._activeEntry=this._activeEntry==r?null:r;let i=new CustomEvent("update",{detail:{entry:this._activeEntry}});this.dispatchEvent(i)}_handleTouchStart(e){let t;if(t=e.target,!t)return;let r=t.parentNode,i=r.parentElement,s=i.getBoundingClientRect(),a=r.previousElementSibling,n=r.nextElementSibling,o=r.querySelector(".slider-thumb-tooltip");this._activeThumb=Number(r.getAttribute("index"));const c=a.offsetWidth+n.offsetWidth,l=s.width;let d=Array.from(i.querySelectorAll(".slider-slot")),u=d.map(e=>e.offsetWidth),h=0,p=-1;d.forEach((e,t)=>{e==a?p=t:-1==p&&(h+=u[t])});var m=e=>{let t;t="undefined"!=typeof TouchEvent&&e instanceof TouchEvent?e.changedTouches[0].pageX:e.pageX;let r=t-s.left;r<0?r=0:r>s.width&&(r=s.width),r>c+h&&(r=c+h),r=1440?i=1440:vs(i,this.stepSize),o.dispatchEvent(new CustomEvent("update",{detail:{time:i}}))},v=()=>{window.removeEventListener("mousemove",m),window.removeEventListener("touchmove",m),window.removeEventListener("mouseup",v),window.removeEventListener("touchend",v),m=()=>{};let e=ys(o.innerText),t=ho(this.entries[p])+ho(this.entries[p+1]),r=this.entries[p].time.value,i=[...this.entries];Object.assign(i[p],{endTime:{value:e}}),Object.assign(i[p+1],{time:{value:e},endTime:{value:r+t}}),this._activeThumb=null;let s=new CustomEvent("update",{detail:{entries:i}});this.dispatchEvent(s)};window.addEventListener("mouseup",v),window.addEventListener("touchend",v),window.addEventListener("mousemove",m),window.addEventListener("touchmove",m)}_updateMarker(e){let t=e.detail,r=Number(t.time);1440==r&&(r-=1),e.target.innerText=fs(r).time}_addSlot(){let e=this.entries[this._activeEntry],t=e.time.value,r=e.endTime.value,i=vs(t+ho(e)/2,this.stepSize),s=Object.assign({time:{value:i},endTime:{value:r},action:""},Gs(e,["entity","days"])),a=[...this.entries];Object.assign(a[this._activeEntry],{endTime:{value:i}}),a.splice(this._activeEntry+1,0,s);let n=new CustomEvent("update",{detail:{entries:a}});this.dispatchEvent(n)}_removeSlot(){let e=this._activeEntry==this.entries.length-1?this._activeEntry-1:this._activeEntry,t=Object.assign({},this.entries[e]);Object.assign(t,{endTime:this.entries[e+1].endTime});let r=[...this.entries];r.splice(e,2,t),this._activeEntry==this.entries.length&&this._activeEntry--;let i=new CustomEvent("update",{detail:{entries:r}});this.dispatchEvent(i)}};po.styles=te` div.slider-track { height: 50px; @@ -748,7 +748,7 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad --mdc-theme-primary: var(--text-primary-color); border-radius: 4px; } - `,t([J()],Zn.prototype,"hass",void 0),t([J({type:Array})],Zn.prototype,"entries",void 0),t([J({type:Array})],Zn.prototype,"actions",void 0),t([J({type:Number})],Zn.prototype,"stepSize",void 0),t([J({type:Number})],Zn.prototype,"_activeEntry",void 0),t([J({type:Number})],Zn.prototype,"_activeThumb",void 0),Zn=t([W("timeslot-editor")],Zn);let Xn=class extends ie{constructor(){super(...arguments),this.min=0,this.max=100,this.step=1,this.value=0,this.unit="",this.optional=!1,this.disabled=!1,this.scaleGain=1,this.scaleOffset=0}firstUpdated(){(async()=>{await(async()=>{if(customElements.get("ha-checkbox")&&customElements.get("ha-slider"))return;await customElements.whenDefined("partial-panel-resolver");const e=document.createElement("partial-panel-resolver");e.hass={panels:[{url_path:"tmp",component_name:"config"}]},e._updateRoutes(),await e.routerOptions.routes.tmp.load(),await customElements.whenDefined("ha-panel-config");const t=document.createElement("ha-panel-config");await t.routerOptions.routes.automation.load()})()})(),"%"==this.unit&&(this.scaleOffset=this.min,this.scaleGain=(this.max-this.min)/100,this.min=0,this.max=100),this.disabled&&!this.optional&&(this.disabled=!1),isNaN(this.value)&&(this.value=this.min),this.requestUpdate()}render(){return I` + `,t([J()],po.prototype,"hass",void 0),t([J({type:Array})],po.prototype,"entries",void 0),t([J({type:Array})],po.prototype,"actions",void 0),t([J({type:Number})],po.prototype,"stepSize",void 0),t([J({type:Number})],po.prototype,"_activeEntry",void 0),t([J({type:Number})],po.prototype,"_activeThumb",void 0),po=t([W("timeslot-editor")],po);let mo=class extends ie{constructor(){super(...arguments),this.min=0,this.max=100,this.step=1,this.value=0,this.unit="",this.optional=!1,this.disabled=!1,this.scaleGain=1,this.scaleOffset=0}firstUpdated(){(async()=>{await(async()=>{if(customElements.get("ha-checkbox")&&customElements.get("ha-slider"))return;await customElements.whenDefined("partial-panel-resolver");const e=document.createElement("partial-panel-resolver");e.hass={panels:[{url_path:"tmp",component_name:"config"}]},e._updateRoutes(),await e.routerOptions.routes.tmp.load(),await customElements.whenDefined("ha-panel-config");const t=document.createElement("ha-panel-config");await t.routerOptions.routes.automation.load()})()})(),"%"==this.unit&&(this.scaleOffset=this.min,this.scaleGain=(this.max-this.min)/100,this.min=0,this.max=100),this.disabled&&!this.optional&&(this.disabled=!1),isNaN(this.value)&&(this.value=this.min),this.requestUpdate()}render(){return I`
${this.getCheckbox()} @@ -781,8 +781,8 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad @change="${this.toggleChecked}" ?checked=${!this.disabled} > - `:I``}toggleChecked(e){let t=e.target.checked;this.disabled=!t;let r=new CustomEvent("change");this.dispatchEvent(r)}updateValue(e){let t=Number(e.target.value)*this.scaleGain+this.scaleOffset;t=Math.round(t/this.step)*this.step,this.value=t}};Xn.styles=te` - ${Vn} + `:I``}toggleChecked(e){let t=e.target.checked;this.disabled=!t;let r=new CustomEvent("change");this.dispatchEvent(r)}updateValue(e){let t=Number(e.target.value)*this.scaleGain+this.scaleOffset;t=Math.round(t/this.step)*this.step,this.value=t}};mo.styles=te` + ${to} :host { width: 100%; } @@ -790,45 +790,45 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad width: 100%; --paper-slider-pin-start-color: var(--primary-color); } - `,t([J({type:Number})],Xn.prototype,"min",void 0),t([J({type:Number})],Xn.prototype,"max",void 0),t([J({type:Number})],Xn.prototype,"step",void 0),t([J({type:Number})],Xn.prototype,"value",void 0),t([J({type:String})],Xn.prototype,"unit",void 0),t([J({type:Boolean})],Xn.prototype,"optional",void 0),t([J({type:Boolean})],Xn.prototype,"disabled",void 0),Xn=t([W("variable-slider")],Xn);let eo=class extends ie{constructor(){super(...arguments),this.entries=[],this.activeEntry=null,this.timeslots=!1,this.editItem=!1}firstUpdated(){if(this.actions&&this.hass)if(this.timeslots){let e=this.actions.map(e=>e.name?e:Object.assign(e,{name:qn(e,this.hass)}));e.sort((e,t)=>e.name.trim().toLowerCase()e.name?e:Object.assign(e,{name:io(e,this.hass)}));e.sort((e,t)=>e.name.trim().toLowerCase()
- ${void 0!==this.config.title?"string"==typeof this.config.title?this.config.title:"":Wi("scheduler")} + ${void 0!==this.config.title?"string"==typeof this.config.title?this.config.title:"":ls("scheduler")}
-
${Wi("fields.action")}
+
${ls("fields.action")}
- + - ${Rs(Fs(this.entity.name))} + ${Ys(Js(this.entity.name))}
- + - ${Rs(Fs("make_scheme"))} + ${Ys(Js("make_scheme"))}
-
${Wi("fields.days")}
- +
${ls("fields.days")}
+ - ${this.entries[0].days.type==es.Custom?I` + ${this.entries[0].days.type==ms.Custom?I`
- +
`:""} -
${Wi("fields.time")}
+
${ls("fields.time")}
-
${Wi("fields.action")}
+
${ls("fields.action")}
- e.action)}>${Wi("actions.save")} - ${this.hass.user.is_admin&&this.editItem?I`${Wi("actions.delete")}`:""} + e.action)}>${ls("actions.save")} + ${this.hass.user.is_admin&&this.editItem?I`${ls("actions.delete")}`:""} options
`:I`
- ${void 0!==this.config.title?"string"==typeof this.config.title?this.config.title:"":Wi("scheduler")} + ${void 0!==this.config.title?"string"==typeof this.config.title?this.config.title:"":ls("scheduler")}
-
${Wi("fields.action")}
+
${ls("fields.action")}
- + - ${Rs(Fs(this.entity.name))} + ${Ys(Js(this.entity.name))}
- + - ${Rs(qn(this.actions[0],this.hass))} + ${Ys(io(this.actions[0],this.hass))}
${this.getVariableEditor()} -
${Wi("fields.days")}
- +
${ls("fields.days")}
+ - ${this.entries[0].days.type==es.Custom?I` + ${this.entries[0].days.type==ms.Custom?I`
- +
`:""} -
${Wi("fields.time")}
+
${ls("fields.time")}
- ${Wi("actions.save")} - ${this.hass.user.is_admin&&this.editItem?I`${Wi("actions.delete")}`:""} + ${ls("actions.save")} + ${this.hass.user.is_admin&&this.editItem?I`${ls("actions.delete")}`:""} options
`:I``}updateActiveEntry(e){if(null===this.activeEntry)return;let t=[...this.entries];Object.assign(t[this.activeEntry],e),this.entries=t}updateTime(e){const t=e.target,r=Number(t.value),i=e.detail.event;this.updateActiveEntry({time:e.detail.event?{event:i,value:r}:{value:r}})}handlePlannerUpdate(e){if(e.detail.hasOwnProperty("entries")){const t=e.detail.entries;t.lengthe.id==this.entries[this.activeEntry].action);if(!e.variable)return I``;if(e.variable.type==xe.Level){let t=e.variable;t.unit||"temperature"!=t.field||Object.assign(t,{unit:this.hass.config.unit_system.temperature}),this.entries[this.activeEntry].variable||this.updateActiveEntry({variable:{type:xe.Level,value:t.min,enabled:!t.optional}});let r=this.entries[this.activeEntry].variable;return I`
- ${t.name||(t.field in Zi?Wi(Zi[t.field]):Fs(t.field))} + ${t.name||(t.field in hs?ls(hs[t.field]):Js(t.field))}
`}if(e.variable.type==xe.List){let t=e.variable;this.entries[this.activeEntry].variable||this.updateActiveEntry({variable:{type:xe.List,value:t.options[0].value}});let r=this.entries[this.activeEntry].variable;return I`
- ${t.name||(t.field in Zi?Wi(Zi[t.field]):Fs(t.field))} + ${t.name||(t.field in hs?ls(hs[t.field]):Js(t.field))}
Object.assign(e,{name:e.value}))} value=${r.value} @change=${this.updateListValue} > - ${Wi("instructions.no_entries_defined")} + ${ls("instructions.no_entries_defined")} - `}return I``}updateLevelValue(e){if(null===this.activeEntry)return;const t=e.target;this.updateActiveEntry({variable:{type:xe.Level,value:Number(t.value),enabled:"false"==String(t.disabled)}})}updateListValue(e){if(null===this.activeEntry)return;const t=e.target.value;this.updateActiveEntry({variable:{type:xe.List,value:t}})}selectDays(e){let t=Object.assign({},this.entries[0].days);const r=e.target.value;Object.values(es).includes(r)?(r!=es.Custom||t.custom_days||Object.assign(t,{custom_days:as(t)}),Object.assign(t,{type:r})):Object.assign(t,{custom_days:[...r]}),this.entries=this.entries.map(e=>Object.assign(e,{days:t}))}cancelClick(){let e=new CustomEvent("cancelClick");this.dispatchEvent(e)}saveClick(){let e=new CustomEvent("saveClick",{detail:this.entries});this.dispatchEvent(e)}optionsClick(){let e=new CustomEvent("optionsClick",{detail:this.entries});this.dispatchEvent(e)}deleteClick(){let e=new CustomEvent("deleteClick");this.dispatchEvent(e)}};eo.styles=te` - ${Vn} + `}return I``}updateLevelValue(e){if(null===this.activeEntry)return;const t=e.target;this.updateActiveEntry({variable:{type:xe.Level,value:Number(t.value),enabled:"false"==String(t.disabled)}})}updateListValue(e){if(null===this.activeEntry)return;const t=e.target.value;this.updateActiveEntry({variable:{type:xe.List,value:t}})}selectDays(e){let t=Object.assign({},this.entries[0].days);const r=e.target.value;Object.values(ms).includes(r)?(r!=ms.Custom||t.custom_days||Object.assign(t,{custom_days:_s(t)}),Object.assign(t,{type:r})):Object.assign(t,{custom_days:[...r]}),this.entries=this.entries.map(e=>Object.assign(e,{days:t}))}cancelClick(){let e=new CustomEvent("cancelClick");this.dispatchEvent(e)}saveClick(){let e=new CustomEvent("saveClick",{detail:this.entries});this.dispatchEvent(e)}optionsClick(){let e=new CustomEvent("optionsClick",{detail:this.entries});this.dispatchEvent(e)}deleteClick(){let e=new CustomEvent("deleteClick");this.dispatchEvent(e)}};vo.styles=te` + ${to} div.summary { display: grid; grid-template-columns: 1fr max-content 1fr; @@ -992,15 +992,15 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad } - `,t([J()],eo.prototype,"hass",void 0),t([J()],eo.prototype,"config",void 0),t([J()],eo.prototype,"entries",void 0),t([J()],eo.prototype,"actions",void 0),t([J()],eo.prototype,"entity",void 0),t([J()],eo.prototype,"activeEntry",void 0),t([J({type:Boolean})],eo.prototype,"timeslots",void 0),t([J({type:Boolean})],eo.prototype,"editItem",void 0),eo=t([W("scheduler-timepicker-card")],eo);let to=class extends ie{constructor(){super(...arguments),this.selected=!1,this.editMode=!1}render(){if(!this.item||!this.hass||!this.config)return I``;const e=this.hass.states[this.item.entity];if(!e)return I` + `,t([J()],vo.prototype,"hass",void 0),t([J()],vo.prototype,"config",void 0),t([J()],vo.prototype,"entries",void 0),t([J()],vo.prototype,"actions",void 0),t([J()],vo.prototype,"entity",void 0),t([J()],vo.prototype,"activeEntry",void 0),t([J({type:Boolean})],vo.prototype,"timeslots",void 0),t([J({type:Boolean})],vo.prototype,"editItem",void 0),vo=t([W("scheduler-timepicker-card")],vo);let fo=class extends ie{constructor(){super(...arguments),this.selected=!1,this.editMode=!1}render(){if(!this.item||!this.hass||!this.config)return I``;const e=this.hass.states[this.item.entity];if(!e)return I` Entity not found '${this.item.entity}' - `;let t=Qs(e,this.config);return I` + `;let t=aa(e,this.config);return I`
- - ${Fs(t.name)} + + ${Js(t.name)} ${this.getMatchTypeButton()} ${this.getStateButton()} @@ -1012,7 +1012,7 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad `}matchTypeButtonClick(){if(this.selected=!1,this.editMode=!1,!this.item)return;let e,t=this.item.match_type;"string"==typeof this.item.state?t==$e.Equal?e=$e.Unequal:t==$e.Unequal&&(e=$e.Equal):t==$e.Equal?e=$e.Unequal:t==$e.Unequal?e=$e.Below:t==$e.Below?e=$e.Above:t==$e.Above&&(e=$e.Equal),this.item=Object.assign(Object.assign({},this.item),{match_type:e}),this.fireEvent()}getStateButton(){return this.item?"string"==typeof this.item.state?I` - ${Fs(this.item.state)} + ${Js(this.item.state)} `:this.editMode?I`
@@ -1052,7 +1052,7 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad ${this.getState()} - `:I``}stateButtonClick(){if(!this.item||!this.config||!this.hass)return;this.selected=!1;let e=Qs(this.hass.states[this.item.entity],this.config),t=this.item.state,r=e.states;if(!r||!Array.isArray(r))return;let i=0;for(i=0;i{this.stateDecrement(a)},a)}stateIncrement(e=null){if(!this.item||!this.config||!this.hass)return;clearTimeout(this.timer);let t=Qs(this.hass.states[this.item.entity],this.config),r=Number(this.item.state),i=t.states;if(Array.isArray(i))return;let s=i.step||1;r+=s,r>i.max&&(r=i.max),r=Number((Math.round(r/s)*s).toPrecision(5)),this.item=Object.assign(Object.assign({},this.item),{state:r});let a=null!==e?Number(.9*e):300;a<50&&(a=50),this.timer=setTimeout(()=>{this.stateIncrement(a)},a)}stateUpdateStop(){clearTimeout(this.timer),this.fireEvent()}toggleEditMode(){this.editMode=!this.editMode}getState(){if(!this.item||!this.config||!this.hass)return;let e=Qs(this.hass.states[this.item.entity],this.config),t=this.item.state,r=e.states;return!Array.isArray(r)&&r.unit?`${t}${r.unit}`:t}fireEvent(){let e={item:this.item,selected:this.selected},t=new CustomEvent("change",{detail:e});this.dispatchEvent(t)}};to.styles=te` + `:I``}stateButtonClick(){if(!this.item||!this.config||!this.hass)return;this.selected=!1;let e=aa(this.hass.states[this.item.entity],this.config),t=this.item.state,r=e.states;if(!r||!Array.isArray(r))return;let i=0;for(i=0;i{this.stateDecrement(a)},a)}stateIncrement(e=null){if(!this.item||!this.config||!this.hass)return;clearTimeout(this.timer);let t=aa(this.hass.states[this.item.entity],this.config),r=Number(this.item.state),i=t.states;if(Array.isArray(i))return;let s=i.step||1;r+=s,r>i.max&&(r=i.max),r=Number((Math.round(r/s)*s).toPrecision(5)),this.item=Object.assign(Object.assign({},this.item),{state:r});let a=null!==e?Number(.9*e):300;a<50&&(a=50),this.timer=setTimeout(()=>{this.stateIncrement(a)},a)}stateUpdateStop(){clearTimeout(this.timer),this.fireEvent()}toggleEditMode(){this.editMode=!this.editMode}getState(){if(!this.item||!this.config||!this.hass)return;let e=aa(this.hass.states[this.item.entity],this.config),t=this.item.state,r=e.states;return!Array.isArray(r)&&r.unit?`${t}${r.unit}`:t}fireEvent(){let e={item:this.item,selected:this.selected},t=new CustomEvent("change",{detail:e});this.dispatchEvent(t)}};fo.styles=te` div.list-item { background: none; cursor: pointer; @@ -1109,11 +1109,11 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad .mdc-button { min-width: 20px !important; } - `,t([J()],to.prototype,"hass",void 0),t([J()],to.prototype,"config",void 0),t([J()],to.prototype,"item",void 0),t([J()],to.prototype,"selected",void 0),t([J()],to.prototype,"editMode",void 0),to=t([W("condition-entity-row")],to);let ro=class extends ie{constructor(){super(...arguments),this.entries=[],this.editItem=null,this.selectedItem=null,this.addCondition=!1}render(){var e;return this.hass&&this.config?I` + `,t([J()],fo.prototype,"hass",void 0),t([J()],fo.prototype,"config",void 0),t([J()],fo.prototype,"item",void 0),t([J()],fo.prototype,"selected",void 0),t([J()],fo.prototype,"editMode",void 0),fo=t([W("condition-entity-row")],fo);let go=class extends ie{constructor(){super(...arguments),this.entries=[],this.editItem=null,this.selectedItem=null,this.addCondition=!1}render(){var e;return this.hass&&this.config?I`
- ${void 0!==this.config.title?"string"==typeof this.config.title?this.config.title:"":Wi("scheduler")} + ${void 0!==this.config.title?"string"==typeof this.config.title?this.config.title:"":ls("scheduler")}
@@ -1171,28 +1171,28 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad ${this.addCondition?I` Confirm `:I` - ${Wi("actions.save")} + ${ls("actions.save")} back `}
- `:I``}renderAddCondition(){if(!this.addCondition||!this.hass||!this.config)return I``;let e=Kn(Object.values(this.hass.states).filter(e=>Bs(e,this.config,{states:!0})).map(e=>e.entity_id),this.config);e.sort((e,t)=>e.name.trim().toLowerCase()e.id==this.selectedGroup).entities.map(e=>Qs(this.hass.states[e],this.config)).filter(e=>e),t.sort((e,t)=>e.name.trim().toLowerCase()${Wi("fields.group")}
+ `:I``}renderAddCondition(){if(!this.addCondition||!this.hass||!this.config)return I``;let e=oo(Object.values(this.hass.states).filter(e=>na(e,this.config,{states:!0})).map(e=>e.entity_id),this.config);e.sort((e,t)=>e.name.trim().toLowerCase()e.id==this.selectedGroup).entities.map(e=>aa(this.hass.states[e],this.config)).filter(e=>e),t.sort((e,t)=>e.name.trim().toLowerCase()${ls("fields.group")}
- ${Wi("instructions.no_groups_defined")} + ${ls("instructions.no_groups_defined")} -
${Wi("fields.entity")}
+
${ls("fields.entity")}
- ${this.selectedGroup?Wi("instructions.no_entities_for_group"):Wi("instructions.no_group_selected")} + ${this.selectedGroup?ls("instructions.no_entities_for_group"):ls("instructions.no_group_selected")} `}selectGroup(e){this.selectedItem=null,this.editItem=null,this.selectedGroup=e.target.value,this.selectedEntity=void 0}selectEntity(e){this.selectedItem=null,this.editItem=null,this.selectedEntity=e.target.value}renderConditions(){var e;let t=(null===(e=this.entries[0].conditions)||void 0===e?void 0:e.items)||[];return t.length?t.map((e,t)=>I` - `):I`
No conditions yet
`}updateCondition(e,t){if(e.detail.selected)this.selectedItem=t,this.editItem=null;else{this.selectedItem==t&&(this.selectedItem=null),this.editItem!=t&&(this.editItem=t);let r=[...this.entries[0].conditions.items];r[t]=Object.assign({},e.detail.item),this.entries=this.entries.map(e=>Object.assign(e,{conditions:Object.assign(e.conditions,{items:r})}))}}addConditionClick(){this.addCondition=!this.addCondition,this.editItem=null,this.selectedItem=null}confirmConditionClick(){var e,t;if(!this.selectedEntity||!this.config||!this.hass)return;const r=Qs(this.hass.states[this.selectedEntity],this.config).states,i=Array.isArray(r)?1:r.step||1;let s=Array.isArray(r)?r[0]:Number((Math.round((r.min+r.max)/2/i)*i).toPrecision(5)),a={entity:this.selectedEntity,match_type:$e.Equal,state:s},n=(null===(e=this.entries[0].conditions)||void 0===e?void 0:e.items.length)?[...this.entries[0].conditions.items]:[],o=(null===(t=this.entries[0].conditions)||void 0===t?void 0:t.type)?this.entries[0].conditions.type:Oe.Any;n.push(a),this.entries=this.entries.map(e=>Object.assign(e,{conditions:{items:n,type:o}})),this.selectedEntity=void 0,this.selectedGroup=void 0,this.selectedItem=null,this.addCondition=!1}removeConditionClick(){if(null===this.selectedItem)return;let e=[...this.entries[0].conditions.items];e.splice(this.selectedItem,1),this.entries=this.entries.map(t=>Object.assign(t,{conditions:Object.assign(t.conditions,{items:e})})),this.selectedItem=null}conditionTypeSwitchClick(e){let t=e.target.checked?Oe.All:Oe.Any;this.entries=this.entries.map(e=>Object.assign(e,{conditions:Object.assign(e.conditions,{type:t})}))}updateName(e){let t=e.target.value;t!=this.friendlyName&&(this.friendlyName=t)}updateRunOnce(e){let t=e.target.checked,r=Object.assign({},this.entries[0].options);t?Object.assign(r,{run_once:!0}):"run_once"in r&&delete r.run_once,this.entries=this.entries.map(e=>Object.assign(e,{options:r}))}cancelClick(){if(this.addCondition)this.addCondition=!this.addCondition,this.editItem=null,this.selectedItem=null;else{let e=new CustomEvent("cancelClick");this.dispatchEvent(e)}}saveClick(){let e=new CustomEvent("saveClick",{detail:{entries:this.entries,friendlyName:this.friendlyName}});this.dispatchEvent(e)}backClick(){let e=new CustomEvent("backClick",{detail:{entries:this.entries,friendlyName:this.friendlyName}});this.dispatchEvent(e)}};ro.styles=Vn,t([J()],ro.prototype,"hass",void 0),t([J()],ro.prototype,"config",void 0),t([J()],ro.prototype,"entries",void 0),t([J()],ro.prototype,"friendlyName",void 0),t([J()],ro.prototype,"selectedGroup",void 0),t([J()],ro.prototype,"selectedEntity",void 0),t([J()],ro.prototype,"editItem",void 0),t([J()],ro.prototype,"selectedItem",void 0),t([J()],ro.prototype,"addCondition",void 0),ro=t([W("scheduler-options-card")],ro);let io=class extends ie{constructor(){super(...arguments),this.selectedDomain="",this.titleOption="standard"}setConfig(e){this._config=e,this.titleOption=this.getTitleOption()}render(){return this.hass?I` + `):I`
No conditions yet
`}updateCondition(e,t){if(e.detail.selected)this.selectedItem=t,this.editItem=null;else{this.selectedItem==t&&(this.selectedItem=null),this.editItem!=t&&(this.editItem=t);let r=[...this.entries[0].conditions.items];r[t]=Object.assign({},e.detail.item),this.entries=this.entries.map(e=>Object.assign(e,{conditions:Object.assign(e.conditions,{items:r})}))}}addConditionClick(){this.addCondition=!this.addCondition,this.editItem=null,this.selectedItem=null}confirmConditionClick(){var e,t;if(!this.selectedEntity||!this.config||!this.hass)return;const r=aa(this.hass.states[this.selectedEntity],this.config).states,i=Array.isArray(r)?1:r.step||1;let s=Array.isArray(r)?r[0]:Number((Math.round((r.min+r.max)/2/i)*i).toPrecision(5)),a={entity:this.selectedEntity,match_type:$e.Equal,state:s},n=(null===(e=this.entries[0].conditions)||void 0===e?void 0:e.items.length)?[...this.entries[0].conditions.items]:[],o=(null===(t=this.entries[0].conditions)||void 0===t?void 0:t.type)?this.entries[0].conditions.type:Oe.Any;n.push(a),this.entries=this.entries.map(e=>Object.assign(e,{conditions:{items:n,type:o}})),this.selectedEntity=void 0,this.selectedGroup=void 0,this.selectedItem=null,this.addCondition=!1}removeConditionClick(){if(null===this.selectedItem)return;let e=[...this.entries[0].conditions.items];e.splice(this.selectedItem,1),this.entries=this.entries.map(t=>Object.assign(t,{conditions:Object.assign(t.conditions,{items:e})})),this.selectedItem=null}conditionTypeSwitchClick(e){let t=e.target.checked?Oe.All:Oe.Any;this.entries=this.entries.map(e=>Object.assign(e,{conditions:Object.assign(e.conditions,{type:t})}))}updateName(e){let t=e.target.value;t!=this.friendlyName&&(this.friendlyName=t)}updateRunOnce(e){let t=e.target.checked,r=Object.assign({},this.entries[0].options);t?Object.assign(r,{run_once:!0}):"run_once"in r&&delete r.run_once,this.entries=this.entries.map(e=>Object.assign(e,{options:r}))}cancelClick(){if(this.addCondition)this.addCondition=!this.addCondition,this.editItem=null,this.selectedItem=null;else{let e=new CustomEvent("cancelClick");this.dispatchEvent(e)}}saveClick(){let e=new CustomEvent("saveClick",{detail:{entries:this.entries,friendlyName:this.friendlyName}});this.dispatchEvent(e)}backClick(){let e=new CustomEvent("backClick",{detail:{entries:this.entries,friendlyName:this.friendlyName}});this.dispatchEvent(e)}};go.styles=to,t([J()],go.prototype,"hass",void 0),t([J()],go.prototype,"config",void 0),t([J()],go.prototype,"entries",void 0),t([J()],go.prototype,"friendlyName",void 0),t([J()],go.prototype,"selectedGroup",void 0),t([J()],go.prototype,"selectedEntity",void 0),t([J()],go.prototype,"editItem",void 0),t([J()],go.prototype,"selectedItem",void 0),t([J()],go.prototype,"addCondition",void 0),go=t([W("scheduler-options-card")],go);let yo=class extends ie{constructor(){super(...arguments),this.selectedDomain="",this.titleOption="standard"}setConfig(e){this._config=e,this.titleOption=this.getTitleOption()}render(){return this.hass?I`
Title of the card
Click on a group to open it.
${this.getDomainSwitches()}
- `:I``}getTitleOption(){return this._config&&this.hass?void 0===this._config.title?"standard":"string"==typeof this._config.title?"custom":0==this._config.title?"hidden":"standard":"standard"}getTitle(){return this._config&&this.hass?void 0===this._config.title?Wi("scheduler"):"string"==typeof this._config.title?this._config.title:0==this._config.title?"":Wi("scheduler"):Wi("scheduler")}updateTitleOption(e){let t=e.target.value;if(!this._config||!this.hass)return;this.titleOption=t;let r=Object.assign({},this._config);"standard"==t?"title"in this._config&&delete r.title:"hidden"==t&&Object.assign(r,{title:!1}),this._config=r,je(this,"config-changed",{config:this._config})}updateTitle(e){if(!this._config||!this.hass)return;let t=Object.assign({},this._config),r=String(e.target.value);Object.assign(t,{title:r}),this._config=t,je(this,"config-changed",{config:this._config})}getDiscoveryOption(){if(!this._config||!this.hass)return;return!this._config.hasOwnProperty("discover_existing")||this._config.discover_existing}updateDiscoveryOption(e){let t="true"==e.target.value;if(!this._config||!this.hass)return;let r=Object.assign({},this._config);t?r.hasOwnProperty("discover_existing")&&delete r.discover_existing:Object.assign(r,{discover_existing:t}),this._config=r,je(this,"config-changed",{config:this._config})}getAmPmOption(){if(!this._config||!this.hass)return;return!!this._config.hasOwnProperty("am_pm")&&this._config.am_pm}updateAmPmOption(e){let t="true"==e.target.value;if(!this._config||!this.hass)return;let r=Object.assign({},this._config);t?Object.assign(r,{am_pm:t}):r.hasOwnProperty("am_pm")&&delete r.am_pm,this._config=r,je(this,"config-changed",{config:this._config})}getTimeStepOption(){if(!this._config||!this.hass)return;let e=this._config.hasOwnProperty("time_step")?this._config.time_step:10;return Number(e)}updateTimeStepOption(e){if(!this._config||!this.hass)return;let t=Object.assign({},this._config),r=Number(e.target.value);10==r&&t.hasOwnProperty("time_step")?delete t.time_step:Object.assign(t,{time_step:r}),this._config=t,je(this,"config-changed",{config:this._config})}getDomainSwitches(){if(!this._config||!this.hass)return;this._config.include&&this._config.include;const e=Object.values(this.hass.states).filter(e=>Hs(e.entity_id)).map(e=>Qs(e,{include:["*"]})).filter(e=>e&&e.actions.length);return e.map(e=>Se(e.id)).filter((e,t,r)=>r.indexOf(e)===t).map(t=>{let r=e.filter(e=>Se(e.id)==t).length;return r?I` + `:I``}getTitleOption(){return this._config&&this.hass?void 0===this._config.title?"standard":"string"==typeof this._config.title?"custom":0==this._config.title?"hidden":"standard":"standard"}getTitle(){return this._config&&this.hass?void 0===this._config.title?ls("scheduler"):"string"==typeof this._config.title?this._config.title:0==this._config.title?"":ls("scheduler"):ls("scheduler")}updateTitleOption(e){let t=e.target.value;if(!this._config||!this.hass)return;this.titleOption=t;let r=Object.assign({},this._config);"standard"==t?"title"in this._config&&delete r.title:"hidden"==t&&Object.assign(r,{title:!1}),this._config=r,je(this,"config-changed",{config:this._config})}updateTitle(e){if(!this._config||!this.hass)return;let t=Object.assign({},this._config),r=String(e.target.value);Object.assign(t,{title:r}),this._config=t,je(this,"config-changed",{config:this._config})}getDiscoveryOption(){if(!this._config||!this.hass)return;return!this._config.hasOwnProperty("discover_existing")||this._config.discover_existing}updateDiscoveryOption(e){let t="true"==e.target.value;if(!this._config||!this.hass)return;let r=Object.assign({},this._config);t?r.hasOwnProperty("discover_existing")&&delete r.discover_existing:Object.assign(r,{discover_existing:t}),this._config=r,je(this,"config-changed",{config:this._config})}getAmPmOption(){if(!this._config||!this.hass)return;return!!this._config.hasOwnProperty("am_pm")&&this._config.am_pm}updateAmPmOption(e){let t="true"==e.target.value;if(!this._config||!this.hass)return;let r=Object.assign({},this._config);t?Object.assign(r,{am_pm:t}):r.hasOwnProperty("am_pm")&&delete r.am_pm,this._config=r,je(this,"config-changed",{config:this._config})}getTimeStepOption(){if(!this._config||!this.hass)return;let e=this._config.hasOwnProperty("time_step")?this._config.time_step:10;return Number(e)}updateTimeStepOption(e){if(!this._config||!this.hass)return;let t=Object.assign({},this._config),r=Number(e.target.value);10==r&&t.hasOwnProperty("time_step")?delete t.time_step:Object.assign(t,{time_step:r}),this._config=t,je(this,"config-changed",{config:this._config})}getDomainSwitches(){if(!this._config||!this.hass)return;this._config.include&&this._config.include;const e=Object.values(this.hass.states).filter(e=>sa(e.entity_id)).map(e=>aa(e,{include:["*"]})).filter(e=>e&&e.actions.length);return e.map(e=>Se(e.id)).filter((e,t,r)=>r.indexOf(e)===t).map(t=>{let r=e.filter(e=>Se(e.id)==t).length;return r?I`
{this.toggleSelectDomain(t)}}> - +
@@ -1276,7 +1276,7 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad ${this.getEntitySwitches(t)}
`:""} - `:""})}getEntitySwitches(e){if(!this._config||!this.hass)return;let t=this._config.include?[...this._config.include]:[];return Object.entries(this.hass.states).filter(([t])=>Se(t)==e&&!Hs(t)).map(([e,r])=>{let i=r.attributes.friendly_name||ke(e),s=t.includes(e);return I` + `:""})}getEntitySwitches(e){if(!this._config||!this.hass)return;let t=this._config.include?[...this._config.include]:[];return Object.entries(this.hass.states).filter(([t])=>Se(t)==e&&!sa(t)).map(([e,r])=>{let i=r.attributes.friendly_name||ke(e),s=t.includes(e);return I`
this.toggleSelectEntity(e)}>
`})}toggleSelectDomain(e){this._config&&this.hass&&(this.selectedDomain!=e?this.selectedDomain=e:this.selectedDomain="")}toggleSelectEntity(e){if(!this._config||!this.hass)return;let t=this._config.include?[...this._config.include]:[];t.includes(e)?t=t.filter(t=>t!=e):t.push(e),t.sort(),this._config=Object.assign(Object.assign({},this._config),{include:t}),je(this,"config-changed",{config:this._config})}static get styles(){return te` - ${Vn} + ${to} div.row { display: flex; align-items: center; @@ -1332,7 +1332,7 @@ const Z=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad div.row ha-switch { padding: 13px 5px; } - `}};t([J()],io.prototype,"hass",void 0),t([J()],io.prototype,"_config",void 0),t([J()],io.prototype,"selectedDomain",void 0),t([J()],io.prototype,"titleOption",void 0),io=t([W("scheduler-card-editor")],io),window.customCards=window.customCards||[],window.customCards.push({type:"scheduler-card",name:"Scheduler Card",description:"Card to manage schedule entities made with scheduler-component."}),console.info(`%c SCHEDULER-CARD \n%c Version: ${"1.8.0".padEnd(8," ")}\n%c Language: ${Yi().padEnd(7," ")}`,"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray","color: white; font-weight: bold; background: dimgray"),e.SchedulerCard=class extends ie{constructor(){super(...arguments),this._view=us.Overview,this.entries=[],this.actions=[],this.editItem=null,this.scheduleEntities=[]}static getConfigElement(){return document.createElement("scheduler-card-editor")}set hass(e){this.scheduleEntities=Object.keys(e.states).filter(e=>Hs(e)),this._hass=e}shouldUpdate(e){const t=e.get("_hass");if(t){const e=Object.keys(t.states).filter(e=>Hs(e));return e.length!==this.scheduleEntities.length||(!!e.some((e,t)=>e!==this.scheduleEntities[t])||!!e.some(e=>t.states[e]!==this._hass.states[e]))}return!0}setConfig(e){!function(e){const t=Ln.validate(Mn,e),r=[];if(t||Ln.errors.forEach(e=>{let t="";const i=e.dataPath.substr(1).split("/"),s=i.pop();i.length&&(t+=`in ${i.join("/")} `),"type"==e.keyword&&(t+="type of "),s?s&&(t+=(isNaN(+s)?`'${s}'`:`[item ${s}]`)+" "):t+="card ",t+=e.message,e.params.hasOwnProperty("additionalProperty")&&(t+=` '${e.params.additionalProperty}'`),r.push(t.charAt(0).toUpperCase()+t.slice(1)+".")}),r.length)throw new Error(`Invalid configuration provided (${r.length} error(s)). ${r.join(" ")}`)}(e),this._config=e}getCardSize(){return this._hass&&this.scheduleEntities.length?6+this.scheduleEntities.length:6}render(){return this._hass&&this._config?this._view==us.Overview?I` + `}};t([J()],yo.prototype,"hass",void 0),t([J()],yo.prototype,"_config",void 0),t([J()],yo.prototype,"selectedDomain",void 0),t([J()],yo.prototype,"titleOption",void 0),yo=t([W("scheduler-card-editor")],yo),window.customCards=window.customCards||[],window.customCards.push({type:"scheduler-card",name:"Scheduler Card",description:"Card to manage schedule entities made with scheduler-component."}),console.info(`%c SCHEDULER-CARD \n%c Version: ${"1.8.0".padEnd(8," ")}\n%c Language: ${ds().padEnd(7," ")}`,"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray","color: white; font-weight: bold; background: dimgray"),e.SchedulerCard=class extends ie{constructor(){super(...arguments),this._view=ks.Overview,this.entries=[],this.actions=[],this.editItem=null,this.scheduleEntities=[]}static getConfigElement(){return document.createElement("scheduler-card-editor")}set hass(e){this.scheduleEntities=Object.keys(e.states).filter(e=>sa(e)),this._hass=e}shouldUpdate(e){const t=e.get("_hass");if(t){const e=Object.keys(t.states).filter(e=>sa(e));return e.length!==this.scheduleEntities.length||(!!e.some((e,t)=>e!==this.scheduleEntities[t])||!!e.some(e=>t.states[e]!==this._hass.states[e]))}return!0}setConfig(e){!function(e){const t=eo.validate(Xn,e),r=[];if(t||eo.errors.forEach(e=>{let t="";const i=e.dataPath.substr(1).split("/"),s=i.pop();i.length&&(t+=`in ${i.join("/")} `),"type"==e.keyword&&(t+="type of "),s?s&&(t+=(isNaN(+s)?`'${s}'`:`[item ${s}]`)+" "):t+="card ",t+=e.message,e.params.hasOwnProperty("additionalProperty")&&(t+=` '${e.params.additionalProperty}'`),r.push(t.charAt(0).toUpperCase()+t.slice(1)+".")}),r.length)throw new Error(`Invalid configuration provided (${r.length} error(s)). ${r.join(" ")}`)}(e),this._config=e}getCardSize(){return this._hass&&this.scheduleEntities.length?6+this.scheduleEntities.length:6}render(){return this._hass&&this._config?this._view==ks.Overview?I` - `:this._view==us.NewSchedule?I` + `:this._view==ks.NewSchedule?I` - `:this._view==us.TimePicker||this._view==us.TimeScheme?I` + `:this._view==ks.TimePicker||this._view==ks.TimeScheme?I` - `:this._view==us.Options?I` + `:this._view==ks.Options?I` - `:I``:I``}_addItemClick(){this._view=us.NewSchedule,this.editItem=null,this.friendlyName=void 0}_cancelEditClick(){this._view=us.Overview,this.editItem=null}_confirmItemClick(e){if(!this._hass||!this._config)return;const t=e.detail.entity;this.entity=Qs(this._hass.states[t],this._config);const r=e.detail.action;"make_scheme"!=r?(this.entries=[{entity:e.detail.entity,action:r,time:{value:ss("12:00")},days:{type:es.Daily}}],this._view=us.TimePicker,this.actions=[qs(this.entity,{service:r})]):(this.entries=[{entity:e.detail.entity,action:"",time:{value:ss("00:00")},endTime:{value:ss("08:00")},days:{type:es.Daily}},{entity:e.detail.entity,action:"",time:{value:ss("08:00")},endTime:{value:ss("16:00")},days:{type:es.Daily}},{entity:e.detail.entity,action:"",time:{value:ss("16:00")},endTime:{value:1440},days:{type:es.Daily}}],this.actions=this.entity.actions.map(Ls).filter(e=>e),this._view=us.TimeScheme)}_saveItemClick(e){if(!this._hass||!this._config)return;e&&(this.entries=e.detail);const t=[],r=[],i=[],s={};this.entries.forEach(e=>{var a;if(!e.action||!e.entity)return;const n=Qs(this._hass.states[e.entity],this._config),o=qs(n,{service:e.action}),c=function(e,t){return t.variable&&e.variable?t.variable.type==xe.Level&&e.variable.type==xe.Level?t.variable.enabled?{[e.variable.field]:Number(t.variable.value)}:{}:{[e.variable.field]:String(t.variable.value)}:{}}(o,e),l={entity:n.id,service:Se(o.service)?o.service:`${Se(n.id)}.${o.service}`,service_data:Object.assign(Object.assign({},o.service_data||{}),c)};let d=t.findIndex(e=>Ms(e)==Ms(l));-1==d&&(d=t.push(l)-1);const u={actions:[d]};e.time.event?e.time.event&&Object.assign(u,{time:{event:ns(e.time.event),offset:rs(e.time.value).time}}):Object.assign(u,{time:rs(e.time.value).time}),e.endTime&&(e.time.event?e.time.event&&Object.assign(u,{end_time:{event:ns(e.endTime.event),offset:rs(e.endTime.value).time}}):Object.assign(u,{end_time:rs(e.endTime.value).time}));let h="daily";if(e.days.type==es.Workday?h="workday":e.days.type==es.Weekend?h="weekend":e.days.type==es.Custom&&(h="custom"),e.days.type==es.Custom?Object.assign(u,{days:{type:h,list:e.days.custom_days}}):Object.assign(u,{days:{type:h}}),"conditions"in e){const t=[];null===(a=e.conditions)||void 0===a||a.items.forEach(e=>{let r=i.findIndex(t=>t===e);r<0&&(r=i.push(e)-1),t.push(r)}),Object.assign(u,{conditions:{list:t,type:e.conditions.type}})}if(e.options){const t=[];Object.entries(e.options).forEach(([e,r])=>{let i=Object.entries(s).findIndex(([t,i])=>({[e]:r}==={[t]:i}));i<0&&(Object.assign(s,{[e]:r}),i=Object.keys(s).length-1),t.push(i)}),Object.assign(u,{options:t})}r.push(u)});const a={entries:r,actions:t};i.length&&Object.assign(a,{conditions:i}),this.friendlyName&&Object.assign(a,{name:this.friendlyName}),Object.keys(s).length&&Object.assign(a,{options:s}),this.editItem?this._hass.callService("scheduler","edit",Object.assign(a,{entity_id:this.editItem})):this._hass.callService("scheduler","add",a),this.editItem=null,this._view=us.Overview}_deleteItemClick(){const e=this.editItem;this._hass.callService("scheduler","remove",{entity_id:e}),this.editItem=null,this._view=us.Overview}_editItemClick(e){if(!this._hass||!this._config)return;const t=this._hass.states[e.detail];if(!t)return;const r=t.attributes.entries.map(fs),i=t.attributes.actions[0].entity;if(this.entity=Qs(this._hass.states[i],this._config),!this.entity){const e={id:i,name:"(unknown entity)",icon:"help-circle-outline",actions:t.attributes.actions.map(e=>Vs(e)).map(e=>Ls(Ns(e,["entity"])))};this.entity=e}this.actions=this.entity.actions.map(e=>Ls(e)).filter(e=>e);const s=t.attributes.conditions||[],a=t.attributes.options||{};this.entries=r.map(e=>{const r=e.actions.filter(e=>eVs(t.attributes.actions[e])).shift(),i=qs(this.entity,r);if(!this.actions.find(e=>e.id==i.id)){let e=[...this.actions];e.push(i),this.actions=e}const n={time:e.time,endTime:e.endTime,days:e.days,entity:this.entity.id,action:i.id};if(i.variable&&r.service_data&&i.variable.field in r.service_data)if(i.variable.type==xe.Level){const e={type:xe.Level,value:Number(r.service_data[i.variable.field]),enabled:!0};Object.assign(n,{variable:e})}else{const e={type:xe.List,value:String(r.service_data[i.variable.field])};Object.assign(n,{variable:e})}return e.conditions&&e.conditions.items.length&&Object.assign(n,{conditions:{type:e.conditions.type,items:e.conditions.items.filter(e=>s.length>=e-1).map(e=>s[e])}}),e.options&&Object.keys(e.options).length&&Object.assign(n,{options:e.options.reduce((e,t)=>Object.assign(e,Ts(a,[Object.keys(a)[t]])),{})}),n}),this.editItem=t.entity_id,this.friendlyName=t.attributes.friendly_name,this.entries.every(e=>e.endTime)?(this._view=us.TimeScheme,this.entries=function(e){e.sort((e,t)=>e.time.value>t.time.value?1:-1),e=e.map(e=>e.endTime.valuet&&e.splice(r,0,Object.assign({time:{value:t},endTime:{value:i.time.value}},Ts(i,["entity","days","conditions","options"]))),t=i.endTime.value}return t<1440&&e.push(Object.assign({time:{value:t},endTime:{value:1440}},Ts(e[0],["entity","days","conditions","options"]))),e}(this.entries)):(this.actions=this.actions.filter(e=>e.id==this.entries[0].action),this._view=us.TimePicker)}_gotoOptionsClick(e){this.entries=e.detail,this._view=us.Options}_optionsBackClick(e,t){this.entries=e.detail.entries,this.friendlyName=e.detail.friendlyName,this.entries.every(e=>e.endTime)?this._view=us.TimeScheme:this._view=us.TimePicker,t&&this._saveItemClick()}},t([J()],e.SchedulerCard.prototype,"_hass",void 0),t([J()],e.SchedulerCard.prototype,"_view",void 0),t([J()],e.SchedulerCard.prototype,"entries",void 0),t([J()],e.SchedulerCard.prototype,"entity",void 0),t([J()],e.SchedulerCard.prototype,"actions",void 0),t([J()],e.SchedulerCard.prototype,"friendlyName",void 0),e.SchedulerCard=t([W("scheduler-card")],e.SchedulerCard)}({}); + `:I``:I``}_addItemClick(){this._view=ks.NewSchedule,this.editItem=null,this.friendlyName=void 0}_cancelEditClick(){this._view=ks.Overview,this.editItem=null}_confirmItemClick(e){if(!this._hass||!this._config)return;const t=e.detail.entity;this.entity=aa(this._hass.states[t],this._config);const r=e.detail.action;"make_scheme"!=r?(this.entries=[{entity:e.detail.entity,action:r,time:{value:ys("12:00")},days:{type:ms.Daily}}],this._view=ks.TimePicker,this.actions=[ia(this.entity,{service:r})]):(this.entries=[{entity:e.detail.entity,action:"",time:{value:ys("00:00")},endTime:{value:ys("08:00")},days:{type:ms.Daily}},{entity:e.detail.entity,action:"",time:{value:ys("08:00")},endTime:{value:ys("16:00")},days:{type:ms.Daily}},{entity:e.detail.entity,action:"",time:{value:ys("16:00")},endTime:{value:1440},days:{type:ms.Daily}}],this.actions=this.entity.actions.map(ea).filter(e=>e),this._view=ks.TimeScheme)}_saveItemClick(e){if(!this._hass||!this._config)return;e&&(this.entries=e.detail);const t=[],r=[],i=[],s={};this.entries.forEach(e=>{var a;if(!e.action||!e.entity)return;const n=aa(this._hass.states[e.entity],this._config),o=ia(n,{service:e.action}),c=function(e,t){return t.variable&&e.variable?t.variable.type==xe.Level&&e.variable.type==xe.Level?t.variable.enabled?{[e.variable.field]:Number(t.variable.value)}:{}:{[e.variable.field]:String(t.variable.value)}:{}}(o,e),l={entity:n.id,service:Se(o.service)?o.service:`${Se(n.id)}.${o.service}`,service_data:Object.assign(Object.assign({},o.service_data||{}),c)};let d=t.findIndex(e=>Xs(e)==Xs(l));-1==d&&(d=t.push(l)-1);const u={actions:[d]};e.time.event?e.time.event&&Object.assign(u,{time:{event:bs(e.time.event),offset:fs(e.time.value).time}}):Object.assign(u,{time:fs(e.time.value).time}),e.endTime&&(e.time.event?e.time.event&&Object.assign(u,{end_time:{event:bs(e.endTime.event),offset:fs(e.endTime.value).time}}):Object.assign(u,{end_time:fs(e.endTime.value).time}));let h="daily";if(e.days.type==ms.Workday?h="workday":e.days.type==ms.Weekend?h="weekend":e.days.type==ms.Custom&&(h="custom"),e.days.type==ms.Custom?Object.assign(u,{days:{type:h,list:e.days.custom_days}}):Object.assign(u,{days:{type:h}}),"conditions"in e){const t=[];null===(a=e.conditions)||void 0===a||a.items.forEach(e=>{let r=i.findIndex(t=>t===e);r<0&&(r=i.push(e)-1),t.push(r)}),Object.assign(u,{conditions:{list:t,type:e.conditions.type}})}if(e.options){const t=[];Object.entries(e.options).forEach(([e,r])=>{let i=Object.entries(s).findIndex(([t,i])=>({[e]:r}==={[t]:i}));i<0&&(Object.assign(s,{[e]:r}),i=Object.keys(s).length-1),t.push(i)}),Object.assign(u,{options:t})}r.push(u)});const a={entries:r,actions:t};i.length&&Object.assign(a,{conditions:i}),this.friendlyName&&Object.assign(a,{name:this.friendlyName}),Object.keys(s).length&&Object.assign(a,{options:s}),this.editItem?this._hass.callService("scheduler","edit",Object.assign(a,{entity_id:this.editItem})):this._hass.callService("scheduler","add",a),this.editItem=null,this._view=ks.Overview}_deleteItemClick(){const e=this.editItem;this._hass.callService("scheduler","remove",{entity_id:e}),this.editItem=null,this._view=ks.Overview}_editItemClick(e){if(!this._hass||!this._config)return;const t=this._hass.states[e.detail];if(!t)return;const r=t.attributes.entries.map(Cs),i=t.attributes.actions[0].entity;if(this.entity=aa(this._hass.states[i],this._config),!this.entity){const e={id:i,name:"(unknown entity)",icon:"help-circle-outline",actions:t.attributes.actions.map(e=>ta(e)).map(e=>ea(Ws(e,["entity"])))};this.entity=e}this.actions=this.entity.actions.map(e=>ea(e)).filter(e=>e);const s=t.attributes.conditions||[],a=t.attributes.options||{};this.entries=r.map(e=>{const r=e.actions.filter(e=>eta(t.attributes.actions[e])).shift(),i=ia(this.entity,r);if(!this.actions.find(e=>e.id==i.id)){let e=[...this.actions];e.push(i),this.actions=e}const n={time:e.time,endTime:e.endTime,days:e.days,entity:this.entity.id,action:i.id};if(i.variable&&r.service_data&&i.variable.field in r.service_data)if(i.variable.type==xe.Level){const e={type:xe.Level,value:Number(r.service_data[i.variable.field]),enabled:!0};Object.assign(n,{variable:e})}else{const e={type:xe.List,value:String(r.service_data[i.variable.field])};Object.assign(n,{variable:e})}return e.conditions&&e.conditions.items.length&&Object.assign(n,{conditions:{type:e.conditions.type,items:e.conditions.items.filter(e=>s.length>=e-1).map(e=>s[e])}}),e.options&&Object.keys(e.options).length&&Object.assign(n,{options:e.options.reduce((e,t)=>Object.assign(e,Gs(a,[Object.keys(a)[t]])),{})}),n}),this.editItem=t.entity_id,this.friendlyName=t.attributes.friendly_name,this.entries.every(e=>e.endTime)?(this._view=ks.TimeScheme,this.entries=function(e){e.sort((e,t)=>e.time.value>t.time.value?1:-1),e=e.map(e=>e.endTime.valuet&&e.splice(r,0,Object.assign({time:{value:t},endTime:{value:i.time.value}},Gs(i,["entity","days","conditions","options"]))),t=i.endTime.value}return t<1440&&e.push(Object.assign({time:{value:t},endTime:{value:1440}},Gs(e[0],["entity","days","conditions","options"]))),e}(this.entries)):(this.actions=this.actions.filter(e=>e.id==this.entries[0].action),this._view=ks.TimePicker)}_gotoOptionsClick(e){this.entries=e.detail,this._view=ks.Options}_optionsBackClick(e,t){this.entries=e.detail.entries,this.friendlyName=e.detail.friendlyName,this.entries.every(e=>e.endTime)?this._view=ks.TimeScheme:this._view=ks.TimePicker,t&&this._saveItemClick()}},t([J()],e.SchedulerCard.prototype,"_hass",void 0),t([J()],e.SchedulerCard.prototype,"_view",void 0),t([J()],e.SchedulerCard.prototype,"entries",void 0),t([J()],e.SchedulerCard.prototype,"entity",void 0),t([J()],e.SchedulerCard.prototype,"actions",void 0),t([J()],e.SchedulerCard.prototype,"friendlyName",void 0),e.SchedulerCard=t([W("scheduler-card")],e.SchedulerCard)}({}); diff --git a/src/localize/languages/cs.json b/src/localize/languages/cs.json index c5b94cce..085321b3 100644 --- a/src/localize/languages/cs.json +++ b/src/localize/languages/cs.json @@ -52,25 +52,29 @@ }, "services": { "turn_on": "zapnout", + "turn_on_brightness": "zapnout {na brightness}", "turn_off": "vypnout", "close_cover": "zavřít", "open_cover": "otevřít", - "set_temperature": "nastavená teplota", - "set_to": "nastaven na", - "set_position": "nastavit polohu", - "set_hvac_mode": "nastavit režim", - "set_preset_mode": "nastavit předvolbu", - "set_value": "nastavená hodnota", - "select_option": "vyberte možnost", - "select_source": "vyberte zdroj", - "start": "start" + "set_temperature": "nastavená teplota {na temperature}", + "set_temperature_hvac_mode_heat": "heat {to temperature}", + "set_temperature_hvac_mode_cool": "cool {to temperature}", + "set_cover_position": "nastavit polohu {na position}", + "set_hvac_mode": "nastavit režim {na hvac_mode}", + "set_hvac_mode_hvac_mode_off": "vypnout", + "set_preset_mode": "nastavit předvolbu {na preset_mode}", + "set_value": "nastavená hodnota {na value}", + "select_option": "vyberte možnost {option}", + "select_source": "vyberte zdroj {source}", + "start": "start", + "run_script": "run" }, "service_parameters": { "brightness": "jas", "temperature": "teplota", "position": "pozice", "hvac_mode": "režim", - "preset": "přednastavení" + "preset_mode": "přednastavení" }, "domains": { "camera": "kamery", @@ -115,4 +119,4 @@ "one_additional_task": "1 další úkol", "x_additional_tasks": "{count} více úkolů" } -} +} \ No newline at end of file diff --git a/src/localize/localize.ts b/src/localize/localize.ts index 15ab84e1..e3048530 100755 --- a/src/localize/localize.ts +++ b/src/localize/localize.ts @@ -1,5 +1,5 @@ - +import * as cs from './languages/cs.json'; import * as de from './languages/de.json'; import * as en from './languages/en.json'; import * as es from './languages/es.json'; @@ -19,6 +19,7 @@ type HassElement = { } var languages: any = { + cs: cs, de: de, en: en, es: es,