diff --git a/home-assistant-polymer b/home-assistant-polymer index b0b953bfa..7e68393c8 160000 --- a/home-assistant-polymer +++ b/home-assistant-polymer @@ -1 +1 @@ -Subproject commit b0b953bfac27d68007066931e01c2238c784c636 +Subproject commit 7e68393c8469e8bf8462113a865ff4a87b8c6a8f diff --git a/supervisor/api/panel/entrypoint.js b/supervisor/api/panel/entrypoint.js index f992f9a6f..f5f2f2256 100644 --- a/supervisor/api/panel/entrypoint.js +++ b/supervisor/api/panel/entrypoint.js @@ -1,14 +1,14 @@ function loadES5() { var el = document.createElement('script'); - el.src = '/api/hassio/app/frontend_es5/entrypoint.e208210a.js'; + el.src = '/api/hassio/app/frontend_es5/entrypoint.646ba882.js'; document.body.appendChild(el); } if (/.*Version\/(?:11|12)(?:\.\d+)*.*Safari\//.test(navigator.userAgent)) { loadES5(); } else { try { - new Function("import('/api/hassio/app/frontend_latest/entrypoint.e74f1505.js')")(); + new Function("import('/api/hassio/app/frontend_latest/entrypoint.6ec72023.js')")(); } catch (err) { loadES5(); } diff --git a/supervisor/api/panel/entrypoint.js.gz b/supervisor/api/panel/entrypoint.js.gz index 36f27ee88..5f191bbba 100644 Binary files a/supervisor/api/panel/entrypoint.js.gz and b/supervisor/api/panel/entrypoint.js.gz differ diff --git a/supervisor/api/panel/frontend_es5/0c8a1a3d.js b/supervisor/api/panel/frontend_es5/0c8a1a3d.js new file mode 100644 index 000000000..cd63ffc2d --- /dev/null +++ b/supervisor/api/panel/frontend_es5/0c8a1a3d.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[914],{92914:function(r,o,e){e.r(o),e.d(o,{defaultKeymap:function(){return t.wQ},lineNumbers:function(){return d.Eu},HighlightStyle:function(){return a.Qf},tags:function(){return a.pJ},history:function(){return m.m8},historyKeymap:function(){return m.f$},rectangularSelection:function(){return u.Z},highlightSelectionMatches:function(){return g.sW},searchKeymap:function(){return g.Lp},EditorState:function(){return i.yy},Prec:function(){return i.Wl},autocompletion:function(){return s.ys},drawSelection:function(){return p.Uw},EditorView:function(){return p.tk},highlightActiveLine:function(){return p.ZO},keymap:function(){return p.$f},langs:function(){return v},langCompartment:function(){return b},readonlyCompartment:function(){return f},tabKeyBindings:function(){return x},theme:function(){return y},highlightStyle:function(){return h}});var t=e(80508),a=e(42484),c=e(17429),n=e(76697),i=e(74075),l=e(67545),p=e(91643),d=e(55987),m=e(74506),u=e(42454),g=e(86315),s=e(75254),v={jinja2:l.i.define(c.b),yaml:l.i.define(n.r)},b=new i.F6,f=new i.F6,x=[{key:"Tab",run:t.at},{key:"Shift-Tab",run:t.xi}],y=p.tk.theme({"&":{color:"var(--primary-text-color)",backgroundColor:"var(--code-editor-background-color, var(--mdc-text-field-fill-color, whitesmoke))","& ::selection":{backgroundColor:"rgba(var(--rgb-primary-color), 0.3)"},borderRadius:"var(--mdc-shape-small, 4px) var(--mdc-shape-small, 4px) 0px 0px",caretColor:"var(--secondary-text-color)",height:"var(--code-mirror-height, auto)",maxHeight:"var(--code-mirror-max-height, unset)"},"&.cm-editor.cm-focused":{outline:"none"},"&.cm-focused .cm-cursor":{borderLeftColor:"var(--secondary-text-color)"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground":{backgroundColor:"rgba(var(--rgb-primary-color), 0.3)"},".cm-activeLine":{backgroundColor:"rgba(var(--rgb-secondary-text-color), 0.1)"},".cm-scroller":{outline:"none"},".cm-content":{caretColor:"var(--secondary-text-color)",paddingTop:"16px"},".cm-panels":{backgroundColor:"var(--primary-background-color)",color:"var(--primary-text-color)"},".cm-panels.top":{borderBottom:"1px solid var(--divider-color)"},".cm-panels.bottom":{borderTop:"1px solid var(--divider-color)"},".cm-button":{border:"1px solid var(--primary-color)",padding:"0px 16px",textTransform:"uppercase",margin:"4px",background:"none",color:"var(--primary-color)",fontFamily:"var(--mdc-typography-button-font-family, var(--mdc-typography-font-family, Roboto, sans-serif))",fontSize:"var(--mdc-typography-button-font-size, 0.875rem)",height:"36px",fontWeight:"var(--mdc-typography-button-font-weight, 500)",borderRadius:"4px",letterSpacing:"var(--mdc-typography-button-letter-spacing, 0.0892857em)"},".cm-textfield":{padding:"4px 0px 5px",borderRadius:"0",fontSize:"16px",color:"var(--primary-text-color)",border:"0",background:"none",fontFamily:"Roboto",borderBottom:"1px solid var(--paper-input-container-color, var(--secondary-text-color))",margin:"4px 4px 0","& ::placeholder":{color:"var(--paper-input-container-color, var(--secondary-text-color))"},"&:focus":{outline:"none",borderBottom:"2px solid var(--primary-color)",paddingBottom:"4px"}},".cm-tooltip":{color:"var(--primary-text-color)",backgroundColor:"var(--code-editor-background-color, var(--card-background-color))",border:"1px solid var(--divider-color)",borderRadius:"var(--mdc-shape-medium, 4px)",boxShadow:"0px 5px 5px -3px rgb(0 0 0 / 20%), 0px 8px 10px 1px rgb(0 0 0 / 14%), 0px 3px 14px 2px rgb(0 0 0 / 12%)"},"& .cm-tooltip.cm-tooltip-autocomplete > ul > li":{padding:"4px 8px"},"& .cm-tooltip-autocomplete ul li[aria-selected]":{background:"var(--primary-color)",color:"var(--text-primary-color)"},".cm-completionIcon":{display:"none"},".cm-completionDetail":{fontFamily:"Roboto",color:"var(--secondary-text-color)"},"li[aria-selected] .cm-completionDetail":{color:"var(--text-primary-color)"},"& .cm-completionInfo.cm-completionInfo-right":{left:"calc(100% + 4px)"},"& .cm-tooltip.cm-completionInfo":{padding:"4px 8px",marginTop:"-5px"},".cm-selectionMatch":{backgroundColor:"rgba(var(--rgb-primary-color), 0.1)"},".cm-searchMatch":{backgroundColor:"rgba(var(--rgb-accent-color), .2)",outline:"1px solid rgba(var(--rgb-accent-color), .4)"},".cm-searchMatch.selected":{backgroundColor:"rgba(var(--rgb-accent-color), .4)",outline:"1px solid var(--accent-color)"},".cm-gutters":{backgroundColor:"var(--code-editor-gutter-color, var(--mdc-text-field-fill-color, whitesmoke))",color:"var(--paper-dialog-color, var(--secondary-text-color))",border:"none",borderRight:"1px solid var(--paper-input-container-color, var(--secondary-text-color))",paddingRight:"1px"},"&.cm-focused .cm-gutters":{borderRight:"2px solid var(--paper-input-container-focus-color, var(--primary-color))",paddingRight:"0"},".cm-gutterElement.lineNumber":{color:"inherit"}}),h=a.Qf.define([{tag:a.pJ.keyword,color:"var(--codemirror-keyword, #6262FF)"},{tag:[a.pJ.name,a.pJ.deleted,a.pJ.character,a.pJ.propertyName,a.pJ.macroName],color:"var(--codemirror-property, #905)"},{tag:[a.pJ.function(a.pJ.variableName),a.pJ.labelName],color:"var(--codemirror-variable, #07a)"},{tag:[a.pJ.color,a.pJ.constant(a.pJ.name),a.pJ.standard(a.pJ.name)],color:"var(--codemirror-qualifier, #690)"},{tag:[a.pJ.definition(a.pJ.name),a.pJ.separator],color:"var(--codemirror-def, #8DA6CE)"},{tag:[a.pJ.typeName,a.pJ.className,a.pJ.number,a.pJ.changed,a.pJ.annotation,a.pJ.modifier,a.pJ.self,a.pJ.namespace],color:"var(--codemirror-number, #ca7841)"},{tag:[a.pJ.operator,a.pJ.operatorKeyword,a.pJ.url,a.pJ.escape,a.pJ.regexp,a.pJ.link,a.pJ.special(a.pJ.string)],color:"var(--codemirror-operator, #cda869)"},{tag:a.pJ.comment,color:"var(--codemirror-comment, #777)"},{tag:a.pJ.meta,color:"var(--codemirror-meta, var(--primary-text-color))"},{tag:a.pJ.strong,fontWeight:"bold"},{tag:a.pJ.emphasis,fontStyle:"italic"},{tag:a.pJ.link,color:"var(--primary-color)",textDecoration:"underline"},{tag:a.pJ.heading,fontWeight:"bold"},{tag:a.pJ.atom,color:"var(--codemirror-atom, #F90)"},{tag:a.pJ.bool,color:"var(--codemirror-atom, #F90)"},{tag:a.pJ.special(a.pJ.variableName),color:"var(--codemirror-variable-2, #690)"},{tag:a.pJ.processingInstruction,color:"var(--secondary-text-color)"},{tag:a.pJ.string,color:"var(--codemirror-string, #07a)"},{tag:a.pJ.inserted,color:"var(--codemirror-string2, #07a)"},{tag:a.pJ.invalid,color:"var(--error-color)"}])}}]); \ No newline at end of file diff --git a/supervisor/api/panel/frontend_es5/0c8a1a3d.js.gz b/supervisor/api/panel/frontend_es5/0c8a1a3d.js.gz new file mode 100644 index 000000000..034f741ef Binary files /dev/null and b/supervisor/api/panel/frontend_es5/0c8a1a3d.js.gz differ diff --git a/supervisor/api/panel/frontend_es5/0ef95294.js b/supervisor/api/panel/frontend_es5/0ef95294.js new file mode 100644 index 000000000..ce5862cc1 --- /dev/null +++ b/supervisor/api/panel/frontend_es5/0ef95294.js @@ -0,0 +1,2 @@ +/*! For license information please see 0ef95294.js.LICENSE.txt */ +"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[442],{5442:function(t,e,n){n.r(e);var r="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,i="undefined"!=typeof global&&global.Math===Math?global:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),o=function(){if("function"==typeof requestAnimationFrame)return requestAnimationFrame.bind(i);return function(t){return setTimeout((function(){t(+Date.now())}),1e3/60)}}();var s=["top","right","bottom","left","width","height","size","weight"],a="undefined"!=typeof MutationObserver,c=r&&HTMLElement.prototype.attachShadow&&-1!==HTMLElement.prototype.attachShadow.toString().indexOf("[native code]")?HTMLElement.prototype.attachShadow:null,h=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(t,e){var n=!1,r=!1,i=0;function s(){n&&(n=!1,t()),r&&c()}function a(){o(s)}function c(){var t=Date.now();if(n){if(t-i<2)return;r=!0}else n=!0,r=!1,setTimeout(a,e);i=t}return c}(this.refresh.bind(this),20)}return t.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},t.prototype.removeObserver=function(t){var e=this.observers_,n=e.indexOf(t);~n&&e.splice(n,1),!e.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},t.prototype.updateObservers_=function(){var t=this.observers_.filter((function(t){return t.gatherActive(),t.hasActive()}));return t.forEach((function(t){return t.broadcastActive()})),t.length>0},t.prototype.connect_=function(){if(r&&!this.connected_){if(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),a){this.mutationsObserver_=new MutationObserver(this.refresh);var t={attributes:!0,childList:!0,characterData:!0,subtree:!0};if(this.mutationsObserver_.observe(document,t),c){var e=this;!function n(r){var i=r.shadowRoot;i&&(e.mutationsObserver_.observe(i,t),n(i));for(var o=r.firstElementChild;o;)n(o),o=o.nextElementSibling}(document),HTMLElement.prototype.attachShadow=function(){for(var n=[],r=0;r=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}var f=function(t,e){var n,r;try{for(var i=u(Object.keys(e)),o=i.next();!o.done;o=i.next()){var s=o.value;Object.defineProperty(t,s,{value:e[s],enumerable:!1,writable:!1,configurable:!0})}}catch(a){n={error:a}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return t},d=function(t){var e;return(null===(e=null==t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView)||i},l=m(0,0,0,0);function v(t){return"number"==typeof t?t:parseFloat(t)||0}function p(t){for(var e=[],n=1;n0},t}(),M=function(){function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=h.getInstance();this.observer_=new O(e,n,this)}return t.prototype.observe=function(t){this.observer_.observe(t)},t.prototype.unobserve=function(t){this.observer_.unobserve(t)},t.prototype.disconnect=function(){this.observer_.disconnect()},t}(),T=void 0!==i.ResizeObserver?i.ResizeObserver:M;e.default=T}}]); \ No newline at end of file diff --git a/supervisor/api/panel/frontend_es5/ccd28201.js.LICENSE.txt b/supervisor/api/panel/frontend_es5/0ef95294.js.LICENSE.txt similarity index 100% rename from supervisor/api/panel/frontend_es5/ccd28201.js.LICENSE.txt rename to supervisor/api/panel/frontend_es5/0ef95294.js.LICENSE.txt diff --git a/supervisor/api/panel/frontend_es5/0ef95294.js.gz b/supervisor/api/panel/frontend_es5/0ef95294.js.gz new file mode 100644 index 000000000..a6109cf51 Binary files /dev/null and b/supervisor/api/panel/frontend_es5/0ef95294.js.gz differ diff --git a/supervisor/api/panel/frontend_es5/1199eafb.js b/supervisor/api/panel/frontend_es5/1199eafb.js new file mode 100644 index 000000000..6045a3a10 --- /dev/null +++ b/supervisor/api/panel/frontend_es5/1199eafb.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[226],{98226:function(e,r,t){t.r(r);var n,i,o,s=t(54211),a=t(37500),c=t(80458),l=t(83849),u=t(15493);t(48811);function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function d(e,r){return D(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var n,i,o=[],s=!0,a=!1;try{for(t=t.call(e);!(s=(n=t.next()).done)&&(o.push(n.value),!r||o.length!==r);s=!0);}catch(c){a=!0,i=c}finally{try{s||null==t.return||t.return()}finally{if(a)throw i}}return o}(e,r)||C(e,r)||j()}function p(e,r){return r||(r=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(r)}}))}function h(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function m(e,r){return m=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},m(e,r)}function y(e){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=T(e);if(r){var i=T(this).constructor;t=Reflect.construct(n,arguments,i)}else t=n.apply(this,arguments);return v(this,t)}}function v(e,r){if(r&&("object"===f(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return b(e)}function b(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function k(){k=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,r){["method","field"].forEach((function(t){r.forEach((function(r){r.kind===t&&"own"===r.placement&&this.defineClassElement(e,r)}),this)}),this)},initializeClassElements:function(e,r){var t=e.prototype;["method","field"].forEach((function(n){r.forEach((function(r){var i=r.placement;if(r.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:t;this.defineClassElement(o,r)}}),this)}),this)},defineClassElement:function(e,r){var t=r.descriptor;if("field"===r.kind){var n=r.initializer;t={enumerable:t.enumerable,writable:t.writable,configurable:t.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,r.key,t)},decorateClass:function(e,r){var t=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!E(e))return t.push(e);var r=this.decorateElement(e,i);t.push(r.element),t.push.apply(t,r.extras),n.push.apply(n,r.finishers)}),this),!r)return{elements:t,finishers:n};var o=this.decorateConstructor(t,r);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,r,t){var n=r[e.placement];if(!t&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,r){for(var t=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var s=r[e.placement];s.splice(s.indexOf(e.key),1);var a=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(a)||a);e=c.element,this.addElementPlacement(e,r),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,r[n])(i)||i);if(void 0!==o.finisher&&t.push(o.finisher),void 0!==o.elements){e=o.elements;for(var s=0;se.length)&&(r=e.length);for(var t=0,n=new Array(r);t\n ',"\n "])),this.supervisor.localize("my.faq_link")))}},{kind:"method",key:"render",value:function(){return this._error?(0,a.dy)(i||(i=p([""])),this._error):(0,a.dy)(o||(o=p([""])))}},{kind:"method",key:"_createRedirectUrl",value:function(e){var r=this._createRedirectParams(e);return"".concat(e.redirect).concat(r)}},{kind:"method",key:"_createRedirectParams",value:function(e){var r=this,t=(0,u.Q2)();if(!e.params&&!Object.keys(t).length)return"";var n={};return Object.entries(e.params||{}).forEach((function(e){var i=d(e,2),o=i[0],s=i[1];if(!t[o]||!r._checkParamType(s,t[o]))throw Error();n[o]=t[o]})),"?".concat((0,u.ou)(n))}},{kind:"method",key:"_checkParamType",value:function(e,r){return"string"===e||"url"===e&&(r&&r===(0,s.N)(r))}}]}}),a.oi)},54211:function(e,r){r.N=void 0;var t=/^([^\w]*)(javascript|data|vbscript)/im,n=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,i=/^([^:]+):/gm,o=[".","/"];r.N=function(e){if(!e)return"about:blank";var r=e.replace(n,"").trim();if(function(e){return o.indexOf(e[0])>-1}(r))return r;var s=r.match(i);if(!s)return r;var a=s[0];return t.test(a)?"about:blank":r}}}]); \ No newline at end of file diff --git a/supervisor/api/panel/frontend_es5/1199eafb.js.gz b/supervisor/api/panel/frontend_es5/1199eafb.js.gz new file mode 100644 index 000000000..3b5b004f4 Binary files /dev/null and b/supervisor/api/panel/frontend_es5/1199eafb.js.gz differ diff --git a/supervisor/api/panel/frontend_es5/1d212d54.js b/supervisor/api/panel/frontend_es5/1d212d54.js deleted file mode 100644 index 9eb471682..000000000 --- a/supervisor/api/panel/frontend_es5/1d212d54.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[144],{58144:function(e,t,r){r.r(t);var n=r(37500),i=r(26767),o=r(5701),a=r(17717),s=r(14516),c=r(47181),l=r(83849),d=r(15493),u=(r(34552),r(34154)),p=r(41682),f=(r(48811),r(21625),r(50054),r(11654)),h=r(55677),m=(r(51187),r(29339),r(53973),r(11488),r(61740),r(98762),r(9381),r(22098),r(20258)),v=r(26765);function y(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,i)}var b,g,w,k,E,_=function(){var e,t=(e=regeneratorRuntime.mark((function e(t,r,n,i){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,v.g7)(t,{title:n.localize("common.restart_name","name",i.name),text:n.localize("dialog.restart_addon.text"),confirmText:n.localize("dialog.restart_addon.confirm_text"),dismissText:n.localize("common.cancel")});case 2:if(!e.sent){e.next=12;break}return e.prev=4,e.next=7,(0,u.P$)(r,i.slug);case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(4),(0,v.Ys)(t,{title:n.localize("common.failed_to_restart_name","name",i.name),text:(0,p.js)(e.t0)});case 12:case"end":return e.stop()}}),e,null,[[4,9]])})),function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){y(o,n,i,a,s,"next",e)}function s(e){y(o,n,i,a,s,"throw",e)}a(void 0)}))});return function(e,r,n,i){return t.apply(this,arguments)}}();function C(e){return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},C(e)}function x(e){return function(e){if(Array.isArray(e))return U(e)}(e)||N(e)||B(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,i)}function O(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){P(o,n,i,a,s,"next",e)}function s(e){P(o,n,i,a,s,"throw",e)}a(void 0)}))}}function S(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function A(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function D(e,t){return D=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},D(e,t)}function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=$(e);if(t){var i=$(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return T(this,r)}}function T(e,t){if(t&&("object"===C(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return z(e)}function z(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R(){R=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!V(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var d=0;d=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n ',"\n\n \n \n \n \n
\n ',""])),this._error):"",this.supervisor.localize("addon.configuration.audio.input"),this._setInputDevice,this._selectedInput,this._inputDevices&&this._inputDevices.map((function(e){return(0,n.dy)(w||(w=S(["\n \n ","\n \n "])),e.device||"",e.name)})),this.supervisor.localize("addon.configuration.audio.output"),this._setOutputDevice,this._selectedOutput,this._outputDevices&&this._outputDevices.map((function(e){return(0,n.dy)(k||(k=S(["\n ","\n "])),e.device||"",e.name)})),this._saveSettings,this.supervisor.localize("common.save"))}},{kind:"get",static:!0,key:"styles",value:function(){return[f.Qx,h.l,(0,n.iv)(E||(E=S(["\n :host,\n ha-card,\n paper-dropdown-menu {\n display: block;\n }\n paper-item {\n width: 450px;\n }\n .card-actions {\n text-align: right;\n }\n "])))]}},{kind:"method",key:"update",value:function(e){Z($(s.prototype),"update",this).call(this,e),e.has("addon")&&this._addonChanged()}},{kind:"method",key:"_setInputDevice",value:function(e){var t=e.detail.item.getAttribute("device");this._selectedInput=t}},{kind:"method",key:"_setOutputDevice",value:function(e){var t=e.detail.item.getAttribute("device");this._selectedOutput=t}},{kind:"method",key:"_addonChanged",value:(i=O(regeneratorRuntime.mark((function e(){var t,r,n,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._selectedInput=null===this.addon.audio_input?"default":this.addon.audio_input,this._selectedOutput=null===this.addon.audio_output?"default":this.addon.audio_output,!this._outputDevices){e.next=4;break}return e.abrupt("return");case 4:return t={device:"default",name:this.supervisor.localize("addon.configuration.audio.default")},e.prev=5,e.next=8,(0,m.G)(this.hass);case 8:r=e.sent,n=r.audio,i=Object.keys(n.input).map((function(e){return{device:e,name:n.input[e]}})),o=Object.keys(n.output).map((function(e){return{device:e,name:n.output[e]}})),this._inputDevices=[t].concat(x(i)),this._outputDevices=[t].concat(x(o)),e.next=21;break;case 16:e.prev=16,e.t0=e.catch(5),this._error="Failed to fetch audio hardware",this._inputDevices=[t],this._outputDevices=[t];case 21:case"end":return e.stop()}}),e,this,[[5,16]])}))),function(){return i.apply(this,arguments)})},{kind:"method",key:"_saveSettings",value:(r=O(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=t.currentTarget).progress=!0,this._error=void 0,n={audio_input:"default"===this._selectedInput?null:this._selectedInput,audio_output:"default"===this._selectedOutput?null:this._selectedOutput},e.prev=4,e.next=7,(0,u.d3)(this.hass,this.addon.slug,n);case 7:if("started"!==(null===(i=this.addon)||void 0===i?void 0:i.state)){e.next=10;break}return e.next=10,_(this,this.hass,this.supervisor,this.addon);case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(4),this._error="Failed to set addon audio device";case 15:r.progress=!1;case 16:case"end":return e.stop()}}),e,this,[[4,12]])}))),function(e){return r.apply(this,arguments)})}]}}),n.oi),r(87724);var K,Q=r(77426),Y=r(67352);r(81545),r(94254),r(83927),r(66255),r(31585);function W(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,i)}var q,G=function(){var e,t=(e=regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return K||(K=Promise.all([r.e(37),r.e(914)]).then(r.bind(r,92914))),e.abrupt("return",K);case 2:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){W(o,n,i,a,s,"next",e)}function s(e){W(o,n,i,a,s,"throw",e)}a(void 0)}))});return function(){return t.apply(this,arguments)}}();function J(e){return J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},J(e)}function X(e){return function(e){if(Array.isArray(e))return he(e)}(e)||me(e)||fe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ee(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,i)}function te(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function re(e,t){return re=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},re(e,t)}function ne(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ye(e);if(t){var i=ye(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ie(this,r)}}function ie(e,t){if(t&&("object"===J(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return oe(e)}function oe(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ae(){ae=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!le(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var d=0;d=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var d=0;d=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var d=0;d=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r",'\n \n
\n

\n ','\n

\n
\n \n \n \n ','\n \n \n
\n
\n\n
\n ',"\n ","\n ","\n
\n ",'\n
\n ',""])),this._error):"",!this._yamlMode||this._canShowSchema&&this.addon.schema||this._valid?"":(0,n.dy)(Ue||(Ue=Ye(['\n \n ',"\n \n "])),this.supervisor.localize("addon.configuration.options.invalid_yaml")),t?(0,n.dy)(Ne||(Ne=Ye(['=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var d=0;d=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n ',"\n\n \n \n \n \n \n \n \n ",'\n \n
\n ","\n \n ","\n ","
\n
\n
\n ',""])),this._error):"",this.supervisor.localize("addon.configuration.network.container"),this.supervisor.localize("addon.configuration.network.host"),this.supervisor.localize("common.description"),this._config.map((function(t){return(0,n.dy)(ft||(ft=wt(["\n \n ","\n \n \n \n ","\n \n "])),t.container,e._configChanged,e.supervisor.localize("addon.configuration.network.disabled"),t.host?String(t.host):"",t.container,e._computeDescription(t))})),this._resetTapped,this.supervisor.localize("common.reset_defaults"),this._saveTapped,this.supervisor.localize("common.save")):(0,n.dy)(dt||(dt=wt([""])))}},{kind:"method",key:"update",value:function(e){Rt(Ht(l.prototype),"update",this).call(this,e),e.has("addon")&&this._setNetworkConfig()}},{kind:"field",key:"_computeDescription",value:function(){var e=this;return function(t){var r,n,i,o,a,s;return(null===(r=e.addon.translations[e.hass.language])||void 0===r||null===(n=r.network)||void 0===n||null===(i=n[t.container])||void 0===i?void 0:i.description)||(null===(o=e.addon.translations.en)||void 0===o||null===(a=o.network)||void 0===a||null===(s=a[t.container])||void 0===s?void 0:s.description)||t.description}}},{kind:"method",key:"_setNetworkConfig",value:function(){var e=this.addon.network||{},t=this.addon.network_description||{},r=Object.keys(e).map((function(r){return{container:r,host:e[r],description:t[r]}}));this._config=r.sort((function(e,t){return e.container>t.container?1:-1}))}},{kind:"method",key:"_configChanged",value:(s=gt(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.target,this._config.forEach((function(e){e.container===r.container&&e.host!==parseInt(String(r.value),10)&&(e.host=r.value?parseInt(String(r.value),10):null)}));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{kind:"method",key:"_resetTapped",value:(i=gt(regeneratorRuntime.mark((function e(t){var r,n,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=t.currentTarget).progress=!0,n={network:null},e.prev=3,e.next=6,(0,u.d3)(this.hass,this.addon.slug,n);case 6:if(o={success:!0,response:void 0,path:"option"},(0,c.B)(this,"hass-api-called",o),"started"!==(null===(i=this.addon)||void 0===i?void 0:i.state)){e.next=11;break}return e.next=11,_(this,this.hass,this.supervisor,this.addon);case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(3),this._error=this.supervisor.localize("addon.failed_to_reset","error",(0,p.js)(e.t0));case 16:r.progress=!1;case 17:case"end":return e.stop()}}),e,this,[[3,13]])}))),function(e){return i.apply(this,arguments)})},{kind:"method",key:"_saveTapped",value:(r=gt(regeneratorRuntime.mark((function e(t){var r,n,i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=t.currentTarget).progress=!0,this._error=void 0,n={},this._config.forEach((function(e){n[e.container]=parseInt(String(e.host),10)})),i={network:n},e.prev=6,e.next=9,(0,u.d3)(this.hass,this.addon.slug,i);case 9:if(a={success:!0,response:void 0,path:"option"},(0,c.B)(this,"hass-api-called",a),"started"!==(null===(o=this.addon)||void 0===o?void 0:o.state)){e.next=14;break}return e.next=14,_(this,this.hass,this.supervisor,this.addon);case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(6),this._error=this.supervisor.localize("addon.failed_to_save","error",(0,p.js)(e.t0));case 19:r.progress=!1;case 20:case"end":return e.stop()}}),e,this,[[6,16]])}))),function(e){return r.apply(this,arguments)})},{kind:"get",static:!0,key:"styles",value:function(){return[f.Qx,h.l,(0,n.iv)(ht||(ht=wt(["\n :host {\n display: block;\n }\n ha-card {\n display: block;\n }\n .card-actions {\n display: flex;\n justify-content: space-between;\n }\n "])))]}}]}}),n.oi);var Mt,Vt,It,Lt,Ft,Bt,Ut,Nt=r(18199);function Zt(e){return Zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zt(e)}function $t(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Kt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qt(e,t){return Qt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Qt(e,t)}function Yt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Gt(e);if(t){var i=Gt(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Wt(this,r)}}function Wt(e,t){if(t&&("object"===Zt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return qt(e)}function qt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Gt(e){return Gt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Gt(e)}function Jt(){Jt=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!tr(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var d=0;d=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r"])));var e=this.addon.options&&Object.keys(this.addon.options).length||this.addon.schema&&Object.keys(this.addon.schema).length;return(0,n.dy)(Vt||(Vt=$t(['\n
\n ',"\n
\n "])),e||this.addon.network||this.addon.audio?(0,n.dy)(It||(It=$t(["\n ","\n ","\n ","\n "])),e?(0,n.dy)(Lt||(Lt=$t(["\n \n "])),this.hass,this.addon,this.supervisor):"",this.addon.network?(0,n.dy)(Ft||(Ft=$t(["\n \n "])),this.hass,this.addon,this.supervisor):"",this.addon.audio?(0,n.dy)(Bt||(Bt=$t(["\n \n "])),this.hass,this.addon,this.supervisor):""):this.supervisor.localize("addon.configuration.no_configuration"))}},{kind:"get",static:!0,key:"styles",value:function(){return[f.Qx,h.l,(0,n.iv)(Ut||(Ut=$t(["\n .content {\n margin: auto;\n padding: 8px;\n max-width: 1024px;\n }\n hassio-addon-network,\n hassio-addon-audio,\n hassio-addon-config {\n margin-bottom: 24px;\n }\n "])))]}}]}}),n.oi),r(93546);function pr(e){return pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pr(e)}function fr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function hr(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,i)}function mr(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){hr(o,n,i,a,s,"next",e)}function s(e){hr(o,n,i,a,s,"throw",e)}a(void 0)}))}}function vr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yr(e,t){return yr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},yr(e,t)}function br(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Dr(e);if(t){var i=Dr(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return gr(this,r)}}function gr(e,t){if(t&&("object"===pr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return wr(e)}function wr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kr(){kr=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Cr(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var d=0;d=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n \n ','\n
\n ',"\n
\n
\n
\n "])),this._error?(0,n.dy)(cr||(cr=fr(['',""])),this._error):"",this._content?(0,n.dy)(lr||(lr=fr([""])),this._content):(0,n.dy)(dr||(dr=fr([""])))):(0,n.dy)(ar||(ar=fr([""])))}},{kind:"get",static:!0,key:"styles",value:function(){return[f.Qx,h.l,(0,n.iv)(ur||(ur=fr(["\n ha-card {\n display: block;\n }\n .content {\n margin: auto;\n padding: 8px;\n max-width: 1024px;\n }\n ha-markdown {\n padding: 16px;\n }\n "])))]}},{kind:"method",key:"_loadData",value:(r=mr(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._error=void 0,e.prev=1,e.next=4,(0,u.ii)(this.hass,this.addon.slug);case 4:this._content=e.sent,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),this._error=this.supervisor.localize("addon.documentation.get_logs","error",(0,p.js)(e.t0));case 10:case"end":return e.stop()}}),e,this,[[1,7]])}))),function(){return r.apply(this,arguments)})}]}}),n.oi);var jr,Tr,zr=r(8636),Rr=r(63864);function Hr(e){return Hr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hr(e)}function Mr(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,i)}function Vr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Ir(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lr(e,t){return Lr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Lr(e,t)}function Fr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Nr(e);if(t){var i=Nr(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Br(this,r)}}function Br(e,t){if(t&&("object"===Hr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ur(e)}function Ur(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Nr(e){return Nr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Nr(e)}function Zr(){Zr=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Qr(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var d=0;d=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r
\n "])),this.progress,this._buttonTapped,this.disabled)}},{kind:"method",key:"_buttonTapped",value:(r=regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.progress=!0,t={method:this.method,path:this.path,data:this.data},e.prev=2,e.next=5,this.hass.callApi(this.method,this.path,this.data);case 5:r=e.sent,this.progress=!1,this._progressButton.actionSuccess(),t.success=!0,t.response=r,e.next=18;break;case 12:e.prev=12,e.t0=e.catch(2),this.progress=!1,this._progressButton.actionError(),t.success=!1,t.response=e.t0;case 18:(0,c.B)(this,"hass-api-called",t);case 19:case"end":return e.stop()}}),e,this,[[2,12]])})),i=function(){var e=this,t=arguments;return new Promise((function(n,i){var o=r.apply(e,t);function a(e){Mr(o,n,i,a,s,"next",e)}function s(e){Mr(o,n,i,a,s,"throw",e)}a(void 0)}))},function(){return i.apply(this,arguments)})},{kind:"get",static:!0,key:"styles",value:function(){return(0,n.iv)(Tr||(Tr=Vr(["\n :host([disabled]) {\n pointer-events: none;\n }\n "])))}}]}}),n.oi);customElements.define("ha-call-api-button",Jr);var Xr,en,tn,rn=r(67182);function nn(e){return nn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nn(e)}function on(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function an(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sn(e,t){return sn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},sn(e,t)}function cn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=un(e);if(t){var i=un(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ln(this,r)}}function ln(e,t){if(t&&("object"===nn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return dn(e)}function dn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function un(e){return un=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},un(e)}function pn(){pn=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!mn(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var d=0;d=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n ','\n
\n \n \n \n \n \n
\n '])),this.noText?"no-text":"",this.hasIcon?(0,n.dy)(en||(en=on(['
\n \n
']))):null)}},{kind:"get",static:!0,key:"styles",value:function(){return(0,n.iv)(tn||(tn=on(["\n ","\n .mdc-chip {\n background-color: var(\n --ha-chip-background-color,\n rgba(var(--rgb-primary-text-color), 0.15)\n );\n color: var(--ha-chip-text-color, var(--primary-text-color));\n }\n\n .mdc-chip.no-text {\n padding: 0 10px;\n }\n\n .mdc-chip:hover {\n color: var(--ha-chip-text-color, var(--primary-text-color));\n }\n\n .mdc-chip__icon--leading {\n --mdc-icon-size: 20px;\n color: var(--ha-chip-icon-color, var(--ha-chip-text-color));\n }\n .mdc-chip.no-text\n .mdc-chip__icon--leading:not(.mdc-chip__icon--leading-hidden) {\n margin-right: -4px;\n }\n "])),(0,n.$m)(rn))}}]}}),n.oi),r(14089),r(52039);var wn,kn,En,_n,Cn,xn,Pn,On,Sn,An,Dn,jn,Tn,zn,Rn,Hn,Mn,Vn,In,Ln,Fn,Bn,Un,Nn,Zn,$n,Kn,Qn,Yn,Wn,qn,Gn,Jn,Xn,ei,ti,ri,ni,ii,oi,ai=r(70203),si=(r(46586),r(21050),function(e,t){(0,c.B)(e,"show-dialog",{dialogTag:"dialog-hassio-markdown",dialogImport:function(){return r.e(884).then(r.bind(r,56884))},dialogParams:t})}),ci=(r(65180),r(34450));function li(e){return li="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},li(e)}function di(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,i)}function ui(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){di(o,n,i,a,s,"next",e)}function s(e){di(o,n,i,a,s,"throw",e)}a(void 0)}))}}function pi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function fi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hi(e,t){return hi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},hi(e,t)}function mi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Oi(e);if(t){var i=Oi(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return vi(this,r)}}function vi(e,t){if(t&&("object"===li(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return yi(e)}function yi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bi(){bi=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!ki(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var d=0;d=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n
\n
\n ','\n
\n ','\n
\n
\n
\n ','\n
\n\n
\n ',"\n\n \n \n\n
\n ',".
\n ",'\n
\n
\n
\n ',"\n ","\n
\n
\n ","\n
\n
\n ","\n ",'\n
\n
\n
\n ',"\n
\n
\n ","\n
\n
\n \n\n ","\n "])),this.addon.update_available?(0,n.dy)(kn||(kn=pi(["\n \n "])),this.hass,this.narrow,this.supervisor,this.addon.slug,this._updateComplete):"",this.addon.protected?"":(0,n.dy)(En||(En=pi(['\n \n (',")\n
\n "])),this.addon.version,this._openChangelog,this.supervisor.localize("addon.dashboard.changelog")):(0,n.dy)(Sn||(Sn=pi(['\n \n \n \n \n \n \n \n \n \n ',""])),this.addon.url,this.addon.name)),this.addon.logo?(0,n.dy)(Fn||(Fn=pi(['\n \n \n ',"\n \n \n \n\n ","\n ","\n ","\n ","\n \n "])),(0,zr.$)({"addon-options":!0,started:"started"===this.addon.state}),this.narrow,this.supervisor.localize("addon.dashboard.option.boot.title"),this.supervisor.localize("addon.dashboard.option.boot.description"),this._startOnBootToggled,"auto"===this.addon.boot,"once"!==this.addon.startup?(0,n.dy)(Un||(Un=pi(["\n \n ','\n \n \n ',"\n \n \n \n "])),this.narrow,this.supervisor.localize("addon.dashboard.option.watchdog.title"),this.supervisor.localize("addon.dashboard.option.watchdog.description"),this._watchdogToggled,this.addon.watchdog):"",this.addon.auto_update||null!==(o=this.hass.userData)&&void 0!==o&&o.showAdvanced?(0,n.dy)(Nn||(Nn=pi(["\n \n ','\n \n \n ',"\n \n \n \n "])),this.narrow,this.supervisor.localize("addon.dashboard.option.auto_update.title"),this.supervisor.localize("addon.dashboard.option.auto_update.description"),this._autoUpdateToggled,this.addon.auto_update):"",!this._computeCannotIngressSidebar&&this.addon.ingress?(0,n.dy)(Zn||(Zn=pi(["\n \n ','\n \n \n ',"\n \n \n \n "])),this.narrow,this.supervisor.localize("addon.dashboard.option.ingress_panel.title"),this.supervisor.localize("addon.dashboard.option.ingress_panel.description"),this._panelToggled,this.addon.ingress_panel):"",this._computeUsesProtectedOptions?(0,n.dy)($n||($n=pi(["\n \n ','\n \n \n ',"\n \n \n \n "])),this.narrow,this.supervisor.localize("addon.dashboard.option.protected.title"),this.supervisor.localize("addon.dashboard.option.protected.description"),this._protectionToggled,this.addon.protected):""):"","started"===this.addon.state?(0,n.dy)(Kn||(Kn=pi(["\n ','\n \n '," \n \n ",""])),this.narrow,this.supervisor.localize("addon.dashboard.hostname"),this.addon.hostname,s.map((function(e){var t;return(0,n.dy)(Qn||(Qn=pi(["\n \n "])),e.description,null!==(t=e.value)&&void 0!==t?t:0,e.tooltip)}))):"",this._error?(0,n.dy)(Yn||(Yn=pi(['',""])),this._error):"",this.addon.version||!a||this.addon.available?"":(0,ci.I)(this.supervisor.info.supported_arch,this.addon.arch)?(0,n.dy)(qn||(qn=pi(['\n \n ',"\n \n "])),this.supervisor.localize("addon.dashboard.not_available_version","core_version_installed",this.supervisor.core.version,"core_version_needed",a.homeassistant)):(0,n.dy)(Wn||(Wn=pi(['\n \n ',"\n \n "])),this.supervisor.localize("addon.dashboard.not_available_arch")),this.addon.version?this._computeIsRunning?(0,n.dy)(Gn||(Gn=pi(['\n \n \n \n ',"\n \n \n "])),this._pathWebui,this.supervisor.localize("addon.dashboard.open_web_ui")):"",this._computeShowIngressUI?(0,n.dy)(ri||(ri=pi(["\n \n ","\n \n "])),this._openIngress,this.supervisor.localize("addon.dashboard.open_web_ui")):"",this._uninstallClicked,this.supervisor.localize("addon.dashboard.uninstall"),this.addon.build?(0,n.dy)(ni||(ni=pi(['\n \n ',"\n \n "])),this.hass,this.addon.slug,this.supervisor.localize("addon.dashboard.rebuild")):""):"",this.addon.long_description?(0,n.dy)(ii||(ii=pi(['\n \n
\n '),"icon_experimental",''),"icon_deprecated",'')):this.supervisor.localize("addon.dashboard.capability.".concat(t,".description"))})}},{kind:"get",key:"_computeIsRunning",value:function(){var e;return"started"===(null===(e=this.addon)||void 0===e?void 0:e.state)}},{kind:"get",key:"_pathWebui",value:function(){return this.addon.webui&&this.addon.webui.replace("[HOST]",document.location.hostname)}},{kind:"get",key:"_computeShowWebUI",value:function(){return!this.addon.ingress&&this.addon.webui&&this._computeIsRunning}},{kind:"method",key:"_openIngress",value:function(){(0,l.c)("/hassio/ingress/".concat(this.addon.slug))}},{kind:"get",key:"_computeShowIngressUI",value:function(){return this.addon.ingress&&this._computeIsRunning}},{kind:"get",key:"_computeCannotIngressSidebar",value:function(){return!this.addon.ingress||!(0,Rr.I)(this.hass.config.version,0,92)}},{kind:"get",key:"_computeUsesProtectedOptions",value:function(){return this.addon.docker_api||this.addon.full_access||this.addon.host_pid}},{kind:"method",key:"_startOnBootToggled",value:(_=ui(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._error=void 0,t={boot:"auto"===this.addon.boot?"manual":"auto"},e.prev=2,e.next=5,(0,u.d3)(this.hass,this.addon.slug,t);case 5:r={success:!0,response:void 0,path:"option"},(0,c.B)(this,"hass-api-called",r),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),this._error=this.supervisor.localize("addon.failed_to_save","error",(0,p.js)(e.t0));case 12:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(){return _.apply(this,arguments)})},{kind:"method",key:"_watchdogToggled",value:(E=ui(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._error=void 0,t={watchdog:!this.addon.watchdog},e.prev=2,e.next=5,(0,u.d3)(this.hass,this.addon.slug,t);case 5:r={success:!0,response:void 0,path:"option"},(0,c.B)(this,"hass-api-called",r),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),this._error=this.supervisor.localize("addon.failed_to_save","error",(0,p.js)(e.t0));case 12:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(){return E.apply(this,arguments)})},{kind:"method",key:"_autoUpdateToggled",value:(k=ui(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._error=void 0,t={auto_update:!this.addon.auto_update},e.prev=2,e.next=5,(0,u.d3)(this.hass,this.addon.slug,t);case 5:r={success:!0,response:void 0,path:"option"},(0,c.B)(this,"hass-api-called",r),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),this._error=this.supervisor.localize("addon.failed_to_save","error",(0,p.js)(e.t0));case 12:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(){return k.apply(this,arguments)})},{kind:"method",key:"_protectionToggled",value:(w=ui(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._error=void 0,t={protected:!this.addon.protected},e.prev=2,e.next=5,(0,u.NI)(this.hass,this.addon.slug,t);case 5:r={success:!0,response:void 0,path:"security"},(0,c.B)(this,"hass-api-called",r),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),this._error=this.supervisor.localize("addon.failed_to_save","error",(0,p.js)(e.t0));case 12:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(){return w.apply(this,arguments)})},{kind:"method",key:"_panelToggled",value:(g=ui(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._error=void 0,t={ingress_panel:!this.addon.ingress_panel},e.prev=2,e.next=5,(0,u.d3)(this.hass,this.addon.slug,t);case 5:r={success:!0,response:void 0,path:"option"},(0,c.B)(this,"hass-api-called",r),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),this._error=this.supervisor.localize("addon.failed_to_save","error",(0,p.js)(e.t0));case 12:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(){return g.apply(this,arguments)})},{kind:"method",key:"_openChangelog",value:(b=ui(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,u.CH)(this.hass,this.addon.slug);case 3:t=e.sent,si(this,{title:this.supervisor.localize("addon.dashboard.changelog"),content:(0,ci.H)(this.addon,t)}),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),(0,v.Ys)(this,{title:this.supervisor.localize("addon.dashboard.action_error.get_changelog"),text:(0,p.js)(e.t0)});case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(){return b.apply(this,arguments)})},{kind:"method",key:"_updateComplete",value:function(){var e={success:!0,response:void 0,path:"install"};(0,c.B)(this,"hass-api-called",e)}},{kind:"method",key:"_installClicked",value:(y=ui(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=t.currentTarget).progress=!0,e.prev=2,e.next=5,(0,u.fU)(this.hass,this.addon.slug);case 5:n={success:!0,response:void 0,path:"install"},(0,c.B)(this,"hass-api-called",n),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),(0,v.Ys)(this,{title:this.supervisor.localize("addon.dashboard.action_error.install"),text:(0,p.js)(e.t0)});case 12:r.progress=!1;case 13:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(e){return y.apply(this,arguments)})},{kind:"method",key:"_stopClicked",value:(m=ui(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=t.currentTarget).progress=!0,e.prev=2,e.next=5,(0,u.ow)(this.hass,this.addon.slug);case 5:n={success:!0,response:void 0,path:"stop"},(0,c.B)(this,"hass-api-called",n),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),(0,v.Ys)(this,{title:this.supervisor.localize("addon.dashboard.action_error.stop"),text:(0,p.js)(e.t0)});case 12:r.progress=!1;case 13:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(e){return m.apply(this,arguments)})},{kind:"method",key:"_restartClicked",value:(d=ui(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=t.currentTarget).progress=!0,e.prev=2,e.next=5,(0,u.P$)(this.hass,this.addon.slug);case 5:n={success:!0,response:void 0,path:"stop"},(0,c.B)(this,"hass-api-called",n),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),(0,v.Ys)(this,{title:this.supervisor.localize("addon.dashboard.action_error.restart"),text:(0,p.js)(e.t0)});case 12:r.progress=!1;case 13:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(e){return d.apply(this,arguments)})},{kind:"method",key:"_startClicked",value:(i=ui(regeneratorRuntime.mark((function e(t){var r,n,i,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=t.currentTarget).progress=!0,e.prev=2,e.next=5,(0,u.su)(this.hass,this.addon.slug);case 5:if((n=e.sent).valid){e.next=11;break}return e.next=9,(0,v.g7)(this,{title:this.supervisor.localize("addon.dashboard.action_error.start_invalid_config"),text:n.message.split(" Got ")[0],confirm:function(){return o._openConfiguration()},confirmText:this.supervisor.localize("addon.dashboard.action_error.go_to_config"),dismissText:this.supervisor.localize("common.cancel")});case 9:return r.progress=!1,e.abrupt("return");case 11:e.next=18;break;case 13:return e.prev=13,e.t0=e.catch(2),(0,v.Ys)(this,{title:"Failed to validate addon configuration",text:(0,p.js)(e.t0)}),r.progress=!1,e.abrupt("return");case 18:return e.prev=18,e.next=21,(0,u.kP)(this.hass,this.addon.slug);case 21:return e.next=23,(0,u.AD)(this.hass,this.addon.slug);case 23:this.addon=e.sent,i={success:!0,response:void 0,path:"start"},(0,c.B)(this,"hass-api-called",i),e.next=31;break;case 28:e.prev=28,e.t1=e.catch(18),(0,v.Ys)(this,{title:this.supervisor.localize("addon.dashboard.action_error.start"),text:(0,p.js)(e.t1)});case 31:r.progress=!1;case 32:case"end":return e.stop()}}),e,this,[[2,13],[18,28]])}))),function(e){return i.apply(this,arguments)})},{kind:"method",key:"_openConfiguration",value:function(){(0,l.c)("/hassio/addon/".concat(this.addon.slug,"/config"))}},{kind:"method",key:"_uninstallClicked",value:(r=ui(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=t.currentTarget).progress=!0,e.next=4,(0,v.g7)(this,{title:this.addon.name,text:"Are you sure you want to uninstall this add-on?",confirmText:"uninstall add-on",dismissText:"no"});case 4:if(e.sent){e.next=8;break}return r.progress=!1,e.abrupt("return");case 8:return this._error=void 0,e.prev=9,e.next=12,(0,u.Yn)(this.hass,this.addon.slug);case 12:n={success:!0,response:void 0,path:"uninstall"},(0,c.B)(this,"hass-api-called",n),e.next=19;break;case 16:e.prev=16,e.t0=e.catch(9),(0,v.Ys)(this,{title:this.supervisor.localize("addon.dashboard.action_error.uninstall"),text:(0,p.js)(e.t0)});case 19:r.progress=!1;case 20:case"end":return e.stop()}}),e,this,[[9,16]])}))),function(e){return r.apply(this,arguments)})},{kind:"get",static:!0,key:"styles",value:function(){return[f.Qx,h.l,(0,n.iv)(oi||(oi=pi(['\n :host {\n display: block;\n }\n ha-card {\n display: block;\n margin-bottom: 16px;\n }\n ha-card.warning {\n background-color: var(--error-color);\n color: white;\n }\n ha-card.warning .card-header {\n color: white;\n }\n ha-card.warning .card-content {\n color: white;\n }\n ha-card.warning mwc-button {\n --mdc-theme-primary: white !important;\n }\n .warning {\n color: var(--error-color);\n --mdc-theme-primary: var(--error-color);\n }\n .light-color {\n color: var(--secondary-text-color);\n }\n .addon-header {\n padding-left: 8px;\n font-size: 24px;\n color: var(--ha-card-header-color, --primary-text-color);\n }\n .addon-version {\n float: right;\n font-size: 15px;\n vertical-align: middle;\n }\n .errors {\n color: var(--error-color);\n margin-bottom: 16px;\n }\n .description {\n margin-bottom: 16px;\n }\n img.logo {\n max-width: 100%;\n max-height: 60px;\n margin: 16px 0;\n display: block;\n }\n\n ha-switch {\n display: flex;\n }\n ha-svg-icon.running {\n color: var(--success-color);\n }\n ha-svg-icon.stopped {\n color: var(--error-color);\n }\n ha-call-api-button {\n font-weight: 500;\n color: var(--primary-color);\n }\n protection-enable mwc-button {\n --mdc-theme-primary: white;\n }\n .description a {\n color: var(--primary-color);\n }\n ha-chip {\n text-transform: capitalize;\n --ha-chip-text-color: var(--text-primary-color);\n --ha-chip-background-color: var(--primary-color);\n }\n\n .red {\n --ha-chip-background-color: var(--label-badge-red, #df4c1e);\n }\n .blue {\n --ha-chip-background-color: var(--label-badge-blue, #039be5);\n }\n .green {\n --ha-chip-background-color: var(--label-badge-green, #0da035);\n }\n .yellow {\n --ha-chip-background-color: var(--label-badge-yellow, #f4b400);\n }\n .capabilities {\n margin-bottom: 16px;\n }\n .card-actions {\n justify-content: space-between;\n display: flex;\n }\n .changelog {\n display: contents;\n }\n .changelog-link {\n color: var(--primary-color);\n text-decoration: underline;\n cursor: pointer;\n }\n ha-markdown {\n padding: 16px;\n }\n ha-settings-row {\n padding: 0;\n height: 54px;\n width: 100%;\n }\n ha-settings-row > span[slot="description"] {\n white-space: normal;\n color: var(--secondary-text-color);\n }\n ha-settings-row[three-line] {\n height: 74px;\n }\n\n .addon-options {\n max-width: 90%;\n }\n\n .addon-container {\n display: grid;\n grid-auto-flow: column;\n grid-template-columns: 60% 40%;\n }\n\n .addon-container > div:last-of-type {\n align-self: end;\n }\n\n ha-alert mwc-button {\n --mdc-theme-primary: var(--primary-text-color);\n }\n a {\n text-decoration: none;\n }\n\n update-available-card {\n padding-bottom: 16px;\n }\n\n @media (max-width: 720px) {\n ha-chip {\n line-height: 36px;\n }\n .addon-options {\n max-width: 100%;\n }\n .addon-container {\n display: block;\n }\n }\n '])))]}}]}}),n.oi);function Hi(e){return Hi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hi(e)}function Mi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Vi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ii(e,t){return Ii=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ii(e,t)}function Li(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ui(e);if(t){var i=Ui(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Fi(this,r)}}function Fi(e,t){if(t&&("object"===Hi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Bi(e)}function Bi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ui(e){return Ui=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ui(e)}function Ni(){Ni=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Ki(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var d=0;d=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n =0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var d=0;d=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r","\n \n ",'\n
\n ','\n
\n
\n ',""])),this._error):"",this._content?(0,n.dy)(Xi||(Xi=ro([""])),this._content):"",this._refresh,this.supervisor.localize("common.refresh"))}},{kind:"get",static:!0,key:"styles",value:function(){return[f.Qx,h.l,(0,n.iv)(eo||(eo=ro(["\n :host,\n ha-card {\n display: block;\n }\n "])))]}},{kind:"method",key:"_loadData",value:(i=io(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._error=void 0,e.prev=1,e.next=4,(0,u.kr)(this.hass,this.addon.slug);case 4:this._content=e.sent,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),this._error=this.supervisor.localize("addon.logs.get_logs","error",(0,p.js)(e.t0));case 10:case"end":return e.stop()}}),e,this,[[1,7]])}))),function(){return i.apply(this,arguments)})},{kind:"method",key:"_refresh",value:(r=io(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._loadData();case 2:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})}]}}),n.oi);function Co(e){return Co="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Co(e)}function xo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Po(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oo(e,t){return Oo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Oo(e,t)}function So(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=jo(e);if(t){var i=jo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ao(this,r)}}function Ao(e,t){if(t&&("object"===Co(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Do(e)}function Do(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jo(e){return jo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},jo(e)}function To(){To=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Ho(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var d=0;d=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n =0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var d=0;d=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var d=0;d=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r"])),this._error);if(!this.addon)return(0,n.dy)(ra||(ra=ca([""])));var e=[{translationKey:"addon.panel.info",path:"/hassio/addon/".concat(this.addon.slug,"/info"),iconPath:"M13.5,4A1.5,1.5 0 0,0 12,5.5A1.5,1.5 0 0,0 13.5,7A1.5,1.5 0 0,0 15,5.5A1.5,1.5 0 0,0 13.5,4M13.14,8.77C11.95,8.87 8.7,11.46 8.7,11.46C8.5,11.61 8.56,11.6 8.72,11.88C8.88,12.15 8.86,12.17 9.05,12.04C9.25,11.91 9.58,11.7 10.13,11.36C12.25,10 10.47,13.14 9.56,18.43C9.2,21.05 11.56,19.7 12.17,19.3C12.77,18.91 14.38,17.8 14.54,17.69C14.76,17.54 14.6,17.42 14.43,17.17C14.31,17 14.19,17.12 14.19,17.12C13.54,17.55 12.35,18.45 12.19,17.88C12,17.31 13.22,13.4 13.89,10.71C14,10.07 14.3,8.67 13.14,8.77Z"}];this.addon.documentation&&e.push({translationKey:"addon.panel.documentation",path:"/hassio/addon/".concat(this.addon.slug,"/documentation"),iconPath:"M13,9H18.5L13,3.5V9M6,2H14L20,8V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V4C4,2.89 4.89,2 6,2M15,18V16H6V18H15M18,14V12H6V14H18Z"}),this.addon.version&&e.push({translationKey:"addon.panel.configuration",path:"/hassio/addon/".concat(this.addon.slug,"/config"),iconPath:"M15.9,18.45C17.25,18.45 18.35,17.35 18.35,16C18.35,14.65 17.25,13.55 15.9,13.55C14.54,13.55 13.45,14.65 13.45,16C13.45,17.35 14.54,18.45 15.9,18.45M21.1,16.68L22.58,17.84C22.71,17.95 22.75,18.13 22.66,18.29L21.26,20.71C21.17,20.86 21,20.92 20.83,20.86L19.09,20.16C18.73,20.44 18.33,20.67 17.91,20.85L17.64,22.7C17.62,22.87 17.47,23 17.3,23H14.5C14.32,23 14.18,22.87 14.15,22.7L13.89,20.85C13.46,20.67 13.07,20.44 12.71,20.16L10.96,20.86C10.81,20.92 10.62,20.86 10.54,20.71L9.14,18.29C9.05,18.13 9.09,17.95 9.22,17.84L10.7,16.68L10.65,16L10.7,15.31L9.22,14.16C9.09,14.05 9.05,13.86 9.14,13.71L10.54,11.29C10.62,11.13 10.81,11.07 10.96,11.13L12.71,11.84C13.07,11.56 13.46,11.32 13.89,11.15L14.15,9.29C14.18,9.13 14.32,9 14.5,9H17.3C17.47,9 17.62,9.13 17.64,9.29L17.91,11.15C18.33,11.32 18.73,11.56 19.09,11.84L20.83,11.13C21,11.07 21.17,11.13 21.26,11.29L22.66,13.71C22.75,13.86 22.71,14.05 22.58,14.16L21.1,15.31L21.15,16L21.1,16.68M6.69,8.07C7.56,8.07 8.26,7.37 8.26,6.5C8.26,5.63 7.56,4.92 6.69,4.92A1.58,1.58 0 0,0 5.11,6.5C5.11,7.37 5.82,8.07 6.69,8.07M10.03,6.94L11,7.68C11.07,7.75 11.09,7.87 11.03,7.97L10.13,9.53C10.08,9.63 9.96,9.67 9.86,9.63L8.74,9.18L8,9.62L7.81,10.81C7.79,10.92 7.7,11 7.59,11H5.79C5.67,11 5.58,10.92 5.56,10.81L5.4,9.62L4.64,9.18L3.5,9.63C3.41,9.67 3.3,9.63 3.24,9.53L2.34,7.97C2.28,7.87 2.31,7.75 2.39,7.68L3.34,6.94L3.31,6.5L3.34,6.06L2.39,5.32C2.31,5.25 2.28,5.13 2.34,5.03L3.24,3.47C3.3,3.37 3.41,3.33 3.5,3.37L4.63,3.82L5.4,3.38L5.56,2.19C5.58,2.08 5.67,2 5.79,2H7.59C7.7,2 7.79,2.08 7.81,2.19L8,3.38L8.74,3.82L9.86,3.37C9.96,3.33 10.08,3.37 10.13,3.47L11.03,5.03C11.09,5.13 11.07,5.25 11,5.32L10.03,6.06L10.06,6.5L10.03,6.94Z"},{translationKey:"addon.panel.log",path:"/hassio/addon/".concat(this.addon.slug,"/logs"),iconPath:"M18 7C16.9 7 16 7.9 16 9V15C16 16.1 16.9 17 18 17H20C21.1 17 22 16.1 22 15V11H20V15H18V9H22V7H18M2 7V17H8V15H4V7H2M11 7C9.9 7 9 7.9 9 9V15C9 16.1 9.9 17 11 17H13C14.1 17 15 16.1 15 15V9C15 7.9 14.1 7 13 7H11M11 9H13V15H11V9Z"});var t=this._computeTail(this.route);return(0,n.dy)(na||(na=ca(["\n ',"\n \n \n "])),this.hass,this.supervisor.localize,this.narrow,t,e,this.addon.name,t,this.narrow,this.hass,this.supervisor,this.addon)}},{kind:"get",static:!0,key:"styles",value:function(){return[f.Qx,h.l,(0,n.iv)(ia||(ia=ca(["\n :host {\n color: var(--primary-text-color);\n }\n .content {\n padding: 24px 0 32px;\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n hassio-addon-info,\n hassio-addon-network,\n hassio-addon-audio,\n hassio-addon-config {\n margin-bottom: 24px;\n width: 600px;\n }\n hassio-addon-logs {\n max-width: calc(100% - 8px);\n min-width: 600px;\n }\n @media only screen and (max-width: 600px) {\n hassio-addon-info,\n hassio-addon-network,\n hassio-addon-audio,\n hassio-addon-config,\n hassio-addon-logs {\n max-width: 100%;\n min-width: 100%;\n }\n }\n "])))]}},{kind:"method",key:"firstUpdated",value:(m=sa(regeneratorRuntime.mark((function e(){var t,r,n,i=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(""!==this.route.path){e.next=8;break}if(!(t=(0,d.io)("addon"))){e.next=8;break}return e.next=5,(0,u.yt)(this.hass);case 5:r=e.sent,n=r.addons.some((function(e){return e.slug===t})),n?(0,l.c)("/hassio/addon/".concat(t),{replace:!0}):this._error=this.supervisor.localize("my.error_addon_not_found");case 8:this.addEventListener("hass-api-called",(function(e){return i._apiCalled(e)}));case 9:case"end":return e.stop()}}),e,this)}))),function(){return m.apply(this,arguments)})},{kind:"method",key:"_apiCalled",value:(i=sa(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.detail.success){e.next=2;break}return e.abrupt("return");case 2:if((n=null===(r=t.detail.path)||void 0===r?void 0:r.split("/"))&&0!==n.length){e.next=5;break}return e.abrupt("return");case 5:if(i=n[n.length-1],["uninstall","install","update","start","stop"].includes(i)&&(0,c.B)(this,"supervisor-collection-refresh",{collection:"supervisor"}),"uninstall"!==i){e.next=11;break}window.history.back(),e.next=13;break;case 11:return e.next=13,this._routeDataChanged();case 13:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{kind:"method",key:"updated",value:function(e){e.has("route")&&!this.addon&&this._routeDataChanged()}},{kind:"method",key:"_routeDataChanged",value:(r=sa(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.route.path.split("/")[1]){e.next=3;break}return e.abrupt("return");case 3:return e.prev=3,e.next=6,(0,u.AD)(this.hass,t);case 6:r=e.sent,this.addon=r,e.next=14;break;case 10:e.prev=10,e.t0=e.catch(3),this._error="Error fetching addon info: ".concat((0,p.js)(e.t0)),this.addon=void 0;case 14:case"end":return e.stop()}}),e,this,[[3,10]])}))),function(){return r.apply(this,arguments)})}]}}),n.oi)}}]); \ No newline at end of file diff --git a/supervisor/api/panel/frontend_es5/1d212d54.js.gz b/supervisor/api/panel/frontend_es5/1d212d54.js.gz deleted file mode 100644 index b1566d950..000000000 Binary files a/supervisor/api/panel/frontend_es5/1d212d54.js.gz and /dev/null differ diff --git a/supervisor/api/panel/frontend_es5/3119daa2.js b/supervisor/api/panel/frontend_es5/3119daa2.js new file mode 100644 index 000000000..b8e70bb83 --- /dev/null +++ b/supervisor/api/panel/frontend_es5/3119daa2.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[2,628],{48002:function(e,t,r){r.r(t);var n,i,o,a,s,l=r(37500),c=r(80458),d=r(14516),u=r(47181),p=(r(7164),r(85415)),f=(r(39710),r(46583),r(66255),r(17628)),h=r(11654);function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function y(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b(e,t){return b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},b(e,t)}function g(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=E(e);if(t){var i=E(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return w(this,r)}}function w(e,t){if(t&&("object"===m(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return k(e)}function k(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function P(){P=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!C(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),l=this.toElementFinisherExtras((0,i[o])(s)||s);e=l.element,this.addElementPlacement(e,t),l.finisher&&n.push(l.finisher);var c=l.extras;if(c){for(var d=0;d=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n

\n ',"\n

\n \n \n
\n \n ',":\n \n ",'\n
\n
\n \n ',":\n \n ","\n
\n ",'\n
\n \n ',":\n \n
","
\n
\n "])),e.name,e.by_id||void 0,t._dialogParams.supervisor.localize("dialog.hardware.subsystem"),e.subsystem,t._dialogParams.supervisor.localize("dialog.hardware.device_path"),e.dev_path,e.by_id?(0,l.dy)(a||(a=y(['
\n \n ',":\n \n ","\n
"])),t._dialogParams.supervisor.localize("dialog.hardware.id"),e.by_id):"",t._dialogParams.supervisor.localize("dialog.hardware.attributes"),(0,f.dump)(e.attributes,{indent:2}))})))}},{kind:"method",key:"_handleSearchChange",value:function(e){this._filter=e.detail.value}},{kind:"get",static:!0,key:"styles",value:function(){return[h.Qx,h.yu,(0,l.iv)(s||(s=y(["\n ha-icon-button {\n position: absolute;\n right: 16px;\n top: 10px;\n text-decoration: none;\n color: var(--primary-text-color);\n }\n h2 {\n margin: 18px 42px 0 18px;\n color: var(--primary-text-color);\n }\n\n ha-expansion-panel {\n margin: 4px 0;\n }\n pre,\n code {\n background-color: var(--markdown-code-background-color, none);\n border-radius: 3px;\n }\n pre {\n padding: 16px;\n overflow: auto;\n line-height: 1.45;\n font-family: var(--code-font-family, monospace);\n }\n code {\n font-size: 85%;\n padding: 0.2em 0.4em;\n }\n search-input {\n margin: 8px 16px 0;\n display: block;\n }\n .device-property {\n display: flex;\n justify-content: space-between;\n }\n .attributes {\n margin-top: 12px;\n }\n "])))]}}]}}),l.oi)},17628:function(e,t,r){r.r(t),r.d(t,{dump:function(){return n.$w}});var n=r(77426)}}]); \ No newline at end of file diff --git a/supervisor/api/panel/frontend_es5/3119daa2.js.gz b/supervisor/api/panel/frontend_es5/3119daa2.js.gz new file mode 100644 index 000000000..0aa1887f0 Binary files /dev/null and b/supervisor/api/panel/frontend_es5/3119daa2.js.gz differ diff --git a/supervisor/api/panel/frontend_es5/340c7a77.js b/supervisor/api/panel/frontend_es5/340c7a77.js new file mode 100644 index 000000000..362e64c1c --- /dev/null +++ b/supervisor/api/panel/frontend_es5/340c7a77.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[797],{12198:function(e,t,r){r.d(t,{p6:function(){return i}});var n=r(14516);r(29607);(0,n.Z)((function(e){return new Intl.DateTimeFormat(e.language,{weekday:"long",month:"long",day:"numeric"})}));var i=function(e,t){return o(t).format(e)},o=(0,n.Z)((function(e){return new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric"})}));(0,n.Z)((function(e){return new Intl.DateTimeFormat(e.language,{year:"numeric",month:"numeric",day:"numeric"})})),(0,n.Z)((function(e){return new Intl.DateTimeFormat(e.language,{day:"numeric",month:"short"})})),(0,n.Z)((function(e){return new Intl.DateTimeFormat(e.language,{month:"long",year:"numeric"})})),(0,n.Z)((function(e){return new Intl.DateTimeFormat(e.language,{month:"long"})})),(0,n.Z)((function(e){return new Intl.DateTimeFormat(e.language,{year:"numeric"})}))},44583:function(e,t,r){r.d(t,{o0:function(){return o}});var n=r(14516),i=r(65810);r(29607);var o=function(e,t){return a(t).format(e)},a=(0,n.Z)((function(e){return new Intl.DateTimeFormat("en"!==e.language||(0,i.y)(e)?e.language:"en-u-hc-h23",{year:"numeric",month:"long",day:"numeric",hour:(0,i.y)(e)?"numeric":"2-digit",minute:"2-digit",hour12:(0,i.y)(e)})}));(0,n.Z)((function(e){return new Intl.DateTimeFormat("en"!==e.language||(0,i.y)(e)?e.language:"en-u-hc-h23",{year:"numeric",month:"long",day:"numeric",hour:(0,i.y)(e)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hour12:(0,i.y)(e)})})),(0,n.Z)((function(e){return new Intl.DateTimeFormat("en"!==e.language||(0,i.y)(e)?e.language:"en-u-hc-h23",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit",hour12:(0,i.y)(e)})}))},65810:function(e,t,r){r.d(t,{y:function(){return o}});var n=r(14516),i=r(66477),o=(0,n.Z)((function(e){if(e.time_format===i.zt.language||e.time_format===i.zt.system){var t=e.time_format===i.zt.language?e.language:void 0,r=(new Date).toLocaleString(t);return r.includes("AM")||r.includes("PM")}return e.time_format===i.zt.am_pm}))},22311:function(e,t,r){r.d(t,{N:function(){return i}});var n=r(58831),i=function(e){return(0,n.M)(e.entity_id)}},83447:function(e,t,r){r.d(t,{l:function(){return n}});var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"_",r="àáäâãåăæąçćčđďèéěėëêęğǵḧìíïîįłḿǹńňñòóöôœøṕŕřßşśšșťțùúüûǘůűūųẃẍÿýźžż·/_,:;",n="aaaaaaaaacccddeeeeeeegghiiiiilmnnnnooooooprrsssssttuuuuuuuuuwxyyzzz".concat(t).concat(t).concat(t).concat(t).concat(t).concat(t),i=new RegExp(r.split("").join("|"),"g");return e.toString().toLowerCase().replace(/\s+/g,t).replace(i,(function(e){return n.charAt(r.indexOf(e))})).replace(/&/g,"".concat(t,"and").concat(t)).replace(/[^\w-]+/g,"").replace(/-/g,t).replace(new RegExp("(".concat(t,")\\1+"),"g"),"$1").replace(new RegExp("^".concat(t,"+")),"").replace(new RegExp("".concat(t,"+$")),"")}},7749:function(e,t,r){r(44577);var n,i=r(37500),o=r(80458),a=r(14516),s=r(47181),c=r(58831),l=r(91741),u=(r(77576),r(66255),r(52039),r(51346)),d=r(70483),f=r(22311);var p,h,m,y,v=(0,i.iv)(n||(p=['\n ha-state-icon[data-domain="alert"][data-state="on"],\n ha-state-icon[data-domain="automation"][data-state="on"],\n ha-state-icon[data-domain="binary_sensor"][data-state="on"],\n ha-state-icon[data-domain="calendar"][data-state="on"],\n ha-state-icon[data-domain="camera"][data-state="streaming"],\n ha-state-icon[data-domain="cover"][data-state="open"],\n ha-state-icon[data-domain="fan"][data-state="on"],\n ha-state-icon[data-domain="humidifier"][data-state="on"],\n ha-state-icon[data-domain="light"][data-state="on"],\n ha-state-icon[data-domain="input_boolean"][data-state="on"],\n ha-state-icon[data-domain="lock"][data-state="unlocked"],\n ha-state-icon[data-domain="media_player"][data-state="on"],\n ha-state-icon[data-domain="media_player"][data-state="paused"],\n ha-state-icon[data-domain="media_player"][data-state="playing"],\n ha-state-icon[data-domain="remote"][data-state="on"],\n ha-state-icon[data-domain="script"][data-state="on"],\n ha-state-icon[data-domain="sun"][data-state="above_horizon"],\n ha-state-icon[data-domain="switch"][data-state="on"],\n ha-state-icon[data-domain="timer"][data-state="active"],\n ha-state-icon[data-domain="vacuum"][data-state="cleaning"],\n ha-state-icon[data-domain="group"][data-state="on"],\n ha-state-icon[data-domain="group"][data-state="home"],\n ha-state-icon[data-domain="group"][data-state="open"],\n ha-state-icon[data-domain="group"][data-state="locked"],\n ha-state-icon[data-domain="group"][data-state="problem"] {\n color: var(--paper-item-icon-active-color, #fdd835);\n }\n\n ha-state-icon[data-domain="climate"][data-state="cooling"] {\n color: var(--cool-color, var(--state-climate-cool-color));\n }\n\n ha-state-icon[data-domain="climate"][data-state="heating"] {\n color: var(--heat-color, var(--state-climate-heat-color));\n }\n\n ha-state-icon[data-domain="climate"][data-state="drying"] {\n color: var(--dry-color, var(--state-climate-dry-color));\n }\n\n ha-state-icon[data-domain="alarm_control_panel"] {\n color: var(--alarm-color-armed, var(--label-badge-red));\n }\n ha-state-icon[data-domain="alarm_control_panel"][data-state="disarmed"] {\n color: var(--alarm-color-disarmed, var(--label-badge-green));\n }\n ha-state-icon[data-domain="alarm_control_panel"][data-state="pending"],\n ha-state-icon[data-domain="alarm_control_panel"][data-state="arming"] {\n color: var(--alarm-color-pending, var(--label-badge-yellow));\n animation: pulse 1s infinite;\n }\n ha-state-icon[data-domain="alarm_control_panel"][data-state="triggered"] {\n color: var(--alarm-color-triggered, var(--label-badge-red));\n animation: pulse 1s infinite;\n }\n\n @keyframes pulse {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n ha-state-icon[data-domain="plant"][data-state="problem"],\n ha-state-icon[data-domain="zwave"][data-state="dead"] {\n color: var(--state-icon-error-color);\n }\n\n /* Color the icon if unavailable */\n ha-state-icon[data-state="unavailable"] {\n color: var(--state-unavailable-color);\n }\n'],h||(h=p.slice(0)),n=Object.freeze(Object.defineProperties(p,{raw:{value:Object.freeze(h)}})))),b="M19,18.31V20A2,2 0 0,1 17,22H7A2,2 0 0,1 5,20V16.3C4.54,16.12 3.95,16 3,16A1,1 0 0,1 2,15A1,1 0 0,1 3,14C3.82,14 4.47,14.08 5,14.21V12.3C4.54,12.12 3.95,12 3,12A1,1 0 0,1 2,11A1,1 0 0,1 3,10C3.82,10 4.47,10.08 5,10.21V8.3C4.54,8.12 3.95,8 3,8A1,1 0 0,1 2,7A1,1 0 0,1 3,6C3.82,6 4.47,6.08 5,6.21V4A2,2 0 0,1 7,2H17A2,2 0 0,1 19,4V6.16C20.78,6.47 21.54,7.13 21.71,7.29C22.1,7.68 22.1,8.32 21.71,8.71C21.32,9.1 20.8,9.09 20.29,8.71V8.71C20.29,8.71 19.25,8 17,8C15.74,8 14.91,8.41 13.95,8.9C12.91,9.41 11.74,10 10,10C9.64,10 9.31,10 9,9.96V7.95C9.3,8 9.63,8 10,8C11.26,8 12.09,7.59 13.05,7.11C14.09,6.59 15.27,6 17,6V4H7V20H17V18C18.5,18 18.97,18.29 19,18.31M17,10C15.27,10 14.09,10.59 13.05,11.11C12.09,11.59 11.26,12 10,12C9.63,12 9.3,12 9,11.95V13.96C9.31,14 9.64,14 10,14C11.74,14 12.91,13.41 13.95,12.9C14.91,12.42 15.74,12 17,12C19.25,12 20.29,12.71 20.29,12.71V12.71C20.8,13.1 21.32,13.1 21.71,12.71C22.1,12.32 22.1,11.69 21.71,11.29C21.5,11.08 20.25,10 17,10M17,14C15.27,14 14.09,14.59 13.05,15.11C12.09,15.59 11.26,16 10,16C9.63,16 9.3,16 9,15.95V17.96C9.31,18 9.64,18 10,18C11.74,18 12.91,17.41 13.95,16.9C14.91,16.42 15.74,16 17,16C19.25,16 20.29,16.71 20.29,16.71V16.71C20.8,17.1 21.32,17.1 21.71,16.71C22.1,16.32 22.1,15.69 21.71,15.29C21.5,15.08 20.25,14 17,14Z",g="M21,19V20H3V19L5,17V11C5,7.9 7.03,5.17 10,4.29C10,4.19 10,4.1 10,4A2,2 0 0,1 12,2A2,2 0 0,1 14,4C14,4.1 14,4.19 14,4.29C16.97,5.17 19,7.9 19,11V17L21,19M14,21A2,2 0 0,1 12,23A2,2 0 0,1 10,21",w="M19,19H5V8H19M16,1V3H8V1H6V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3H18V1M17,12H12V17H17V12Z",k="M7,2V13H10V22L17,10H13L17,2H7Z",E="M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z",C="M7.27,10L9,7H14.42L15.58,5L15.5,4.5A1.5,1.5 0 0,1 17,3A1.5,1.5 0 0,1 18.5,4.5C18.5,5.21 18,5.81 17.33,5.96L16.37,7.63L17.73,10L18.59,8.5L18.5,8A1.5,1.5 0 0,1 20,6.5A1.5,1.5 0 0,1 21.5,8C21.5,8.71 21,9.3 20.35,9.46L18.89,12L20.62,15C21.39,15.07 22,15.71 22,16.5A1.5,1.5 0 0,1 20.5,18A1.5,1.5 0 0,1 19,16.5V16.24L17.73,14L16.37,16.37L17.33,18.04C18,18.19 18.5,18.79 18.5,19.5A1.5,1.5 0 0,1 17,21A1.5,1.5 0 0,1 15.5,19.5L15.58,19L14.42,17H10.58L9.42,19L9.5,19.5A1.5,1.5 0 0,1 8,21A1.5,1.5 0 0,1 6.5,19.5C6.5,18.79 7,18.19 7.67,18.04L8.63,16.37L4.38,9C3.61,8.93 3,8.29 3,7.5A1.5,1.5 0 0,1 4.5,6A1.5,1.5 0 0,1 6,7.5C6,7.59 6,7.68 6,7.76L7.27,10M10.15,9L8.42,12L10.15,15H14.85L16.58,12L14.85,9H10.15Z",P="M2,11H9.17C9.58,9.83 10.69,9 12,9C13.31,9 14.42,9.83 14.83,11H22V13H14.83C14.42,14.17 13.31,15 12,15C10.69,15 9.58,14.17 9.17,13H2V11Z",A="M16.5,21C13.5,21 12.31,16.76 11.05,12.28C10.14,9.04 9,5 7.5,5C4.11,5 4,11.93 4,12H2C2,11.63 2.06,3 7.5,3C10.5,3 11.71,7.25 12.97,11.74C13.83,14.8 15,19 16.5,19C19.94,19 20.03,12.07 20.03,12H22.03C22.03,12.37 21.97,21 16.5,21Z",_="M15 13V5A3 3 0 0 0 9 5V13A5 5 0 1 0 15 13M12 4A1 1 0 0 1 13 5V8H11V5A1 1 0 0 1 12 4Z",O="M17,3H7A2,2 0 0,0 5,5V21L12,18L19,21V5C19,3.89 18.1,3 17,3Z",S={alert:"M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z",air_quality:b,automation:"M12,2A2,2 0 0,1 14,4C14,4.74 13.6,5.39 13,5.73V7H14A7,7 0 0,1 21,14H22A1,1 0 0,1 23,15V18A1,1 0 0,1 22,19H21V20A2,2 0 0,1 19,22H5A2,2 0 0,1 3,20V19H2A1,1 0 0,1 1,18V15A1,1 0 0,1 2,14H3A7,7 0 0,1 10,7H11V5.73C10.4,5.39 10,4.74 10,4A2,2 0 0,1 12,2M7.5,13A2.5,2.5 0 0,0 5,15.5A2.5,2.5 0 0,0 7.5,18A2.5,2.5 0 0,0 10,15.5A2.5,2.5 0 0,0 7.5,13M16.5,13A2.5,2.5 0 0,0 14,15.5A2.5,2.5 0 0,0 16.5,18A2.5,2.5 0 0,0 19,15.5A2.5,2.5 0 0,0 16.5,13Z",calendar:w,camera:"M17,10.5V7A1,1 0 0,0 16,6H4A1,1 0 0,0 3,7V17A1,1 0 0,0 4,18H16A1,1 0 0,0 17,17V13.5L21,17.5V6.5L17,10.5Z",climate:"M16.95,16.95L14.83,14.83C15.55,14.1 16,13.1 16,12C16,11.26 15.79,10.57 15.43,10L17.6,7.81C18.5,9 19,10.43 19,12C19,13.93 18.22,15.68 16.95,16.95M12,5C13.57,5 15,5.5 16.19,6.4L14,8.56C13.43,8.21 12.74,8 12,8A4,4 0 0,0 8,12C8,13.1 8.45,14.1 9.17,14.83L7.05,16.95C5.78,15.68 5,13.93 5,12A7,7 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z",configurator:"M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",conversation:"M8,7A2,2 0 0,1 10,9V14A2,2 0 0,1 8,16A2,2 0 0,1 6,14V9A2,2 0 0,1 8,7M14,14C14,16.97 11.84,19.44 9,19.92V22H7V19.92C4.16,19.44 2,16.97 2,14H4A4,4 0 0,0 8,18A4,4 0 0,0 12,14H14M21.41,9.41L17.17,13.66L18.18,10H14A2,2 0 0,1 12,8V4A2,2 0 0,1 14,2H20A2,2 0 0,1 22,4V8C22,8.55 21.78,9.05 21.41,9.41Z",counter:"M4,4H20A2,2 0 0,1 22,6V18A2,2 0 0,1 20,20H4A2,2 0 0,1 2,18V6A2,2 0 0,1 4,4M4,6V18H11V6H4M20,18V6H18.76C19,6.54 18.95,7.07 18.95,7.13C18.88,7.8 18.41,8.5 18.24,8.75L15.91,11.3L19.23,11.28L19.24,12.5L14.04,12.47L14,11.47C14,11.47 17.05,8.24 17.2,7.95C17.34,7.67 17.91,6 16.5,6C15.27,6.05 15.41,7.3 15.41,7.3L13.87,7.31C13.87,7.31 13.88,6.65 14.25,6H13V18H15.58L15.57,17.14L16.54,17.13C16.54,17.13 17.45,16.97 17.46,16.08C17.5,15.08 16.65,15.08 16.5,15.08C16.37,15.08 15.43,15.13 15.43,15.95H13.91C13.91,15.95 13.95,13.89 16.5,13.89C19.1,13.89 18.96,15.91 18.96,15.91C18.96,15.91 19,17.16 17.85,17.63L18.37,18H20M8.92,16H7.42V10.2L5.62,10.76V9.53L8.76,8.41H8.92V16Z",fan:"M12,11A1,1 0 0,0 11,12A1,1 0 0,0 12,13A1,1 0 0,0 13,12A1,1 0 0,0 12,11M12.5,2C17,2 17.11,5.57 14.75,6.75C13.76,7.24 13.32,8.29 13.13,9.22C13.61,9.42 14.03,9.73 14.35,10.13C18.05,8.13 22.03,8.92 22.03,12.5C22.03,17 18.46,17.1 17.28,14.73C16.78,13.74 15.72,13.3 14.79,13.11C14.59,13.59 14.28,14 13.88,14.34C15.87,18.03 15.08,22 11.5,22C7,22 6.91,18.42 9.27,17.24C10.25,16.75 10.69,15.71 10.89,14.79C10.4,14.59 9.97,14.27 9.65,13.87C5.96,15.85 2,15.07 2,11.5C2,7 5.56,6.89 6.74,9.26C7.24,10.25 8.29,10.68 9.22,10.87C9.41,10.39 9.73,9.97 10.14,9.65C8.15,5.96 8.94,2 12.5,2Z",google_assistant:"M7,2A6,6 0 0,0 1,8A6,6 0 0,0 7,14A6,6 0 0,0 13,8A6,6 0 0,0 7,2M21.5,6A1.5,1.5 0 0,0 20,7.5A1.5,1.5 0 0,0 21.5,9A1.5,1.5 0 0,0 23,7.5A1.5,1.5 0 0,0 21.5,6M17,8A3,3 0 0,0 14,11A3,3 0 0,0 17,14A3,3 0 0,0 20,11A3,3 0 0,0 17,8M17,15A3.5,3.5 0 0,0 13.5,18.5A3.5,3.5 0 0,0 17,22A3.5,3.5 0 0,0 20.5,18.5A3.5,3.5 0 0,0 17,15Z",group:"M15,12C13.89,12 13,12.89 13,14A2,2 0 0,0 15,16A2,2 0 0,0 17,14C17,12.89 16.1,12 15,12M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M14,9C14,7.89 13.1,7 12,7C10.89,7 10,7.89 10,9A2,2 0 0,0 12,11A2,2 0 0,0 14,9M9,12A2,2 0 0,0 7,14A2,2 0 0,0 9,16A2,2 0 0,0 11,14C11,12.89 10.1,12 9,12Z",homeassistant:"M21.8,13H20V21H13V17.67L15.79,14.88L16.5,15C17.66,15 18.6,14.06 18.6,12.9C18.6,11.74 17.66,10.8 16.5,10.8A2.1,2.1 0 0,0 14.4,12.9L14.5,13.61L13,15.13V9.65C13.66,9.29 14.1,8.6 14.1,7.8A2.1,2.1 0 0,0 12,5.7A2.1,2.1 0 0,0 9.9,7.8C9.9,8.6 10.34,9.29 11,9.65V15.13L9.5,13.61L9.6,12.9A2.1,2.1 0 0,0 7.5,10.8A2.1,2.1 0 0,0 5.4,12.9A2.1,2.1 0 0,0 7.5,15L8.21,14.88L11,17.67V21H4V13H2.25C1.83,13 1.42,13 1.42,12.79C1.43,12.57 1.85,12.15 2.28,11.72L11,3C11.33,2.67 11.67,2.33 12,2.33C12.33,2.33 12.67,2.67 13,3L17,7V6H19V9L21.78,11.78C22.18,12.18 22.59,12.59 22.6,12.8C22.6,13 22.2,13 21.8,13M7.5,12A0.9,0.9 0 0,1 8.4,12.9A0.9,0.9 0 0,1 7.5,13.8A0.9,0.9 0 0,1 6.6,12.9A0.9,0.9 0 0,1 7.5,12M16.5,12C17,12 17.4,12.4 17.4,12.9C17.4,13.4 17,13.8 16.5,13.8A0.9,0.9 0 0,1 15.6,12.9A0.9,0.9 0 0,1 16.5,12M12,6.9C12.5,6.9 12.9,7.3 12.9,7.8C12.9,8.3 12.5,8.7 12,8.7C11.5,8.7 11.1,8.3 11.1,7.8C11.1,7.3 11.5,6.9 12,6.9Z",homekit:"M12,3L2,12H5V20H19V12H22L12,3M12,8.5C14.34,8.5 16.46,9.43 18,10.94L16.8,12.12C15.58,10.91 13.88,10.17 12,10.17C10.12,10.17 8.42,10.91 7.2,12.12L6,10.94C7.54,9.43 9.66,8.5 12,8.5M12,11.83C13.4,11.83 14.67,12.39 15.6,13.3L14.4,14.47C13.79,13.87 12.94,13.5 12,13.5C11.06,13.5 10.21,13.87 9.6,14.47L8.4,13.3C9.33,12.39 10.6,11.83 12,11.83M12,15.17C12.94,15.17 13.7,15.91 13.7,16.83C13.7,17.75 12.94,18.5 12,18.5C11.06,18.5 10.3,17.75 10.3,16.83C10.3,15.91 11.06,15.17 12,15.17Z",image_processing:"M18,8H6V18H18M20,20H4V6H8.5L12.04,2.5L15.5,6H20M20,4H16L12,0L8,4H4A2,2 0 0,0 2,6V20A2,2 0 0,0 4,22H20A2,2 0 0,0 22,20V6A2,2 0 0,0 20,4Z",input_button:"M13 5C15.21 5 17 6.79 17 9C17 10.5 16.2 11.77 15 12.46V11.24C15.61 10.69 16 9.89 16 9C16 7.34 14.66 6 13 6S10 7.34 10 9C10 9.89 10.39 10.69 11 11.24V12.46C9.8 11.77 9 10.5 9 9C9 6.79 10.79 5 13 5M20 20.5C19.97 21.32 19.32 21.97 18.5 22H13C12.62 22 12.26 21.85 12 21.57L8 17.37L8.74 16.6C8.93 16.39 9.2 16.28 9.5 16.28H9.7L12 18V9C12 8.45 12.45 8 13 8S14 8.45 14 9V13.47L15.21 13.6L19.15 15.79C19.68 16.03 20 16.56 20 17.14V20.5M20 2H4C2.9 2 2 2.9 2 4V12C2 13.11 2.9 14 4 14H8V12L4 12L4 4H20L20 12H18V14H20V13.96L20.04 14C21.13 14 22 13.09 22 12V4C22 2.9 21.11 2 20 2Z",input_datetime:"M15,13H16.5V15.82L18.94,17.23L18.19,18.53L15,16.69V13M19,8H5V19H9.67C9.24,18.09 9,17.07 9,16A7,7 0 0,1 16,9C17.07,9 18.09,9.24 19,9.67V8M5,21C3.89,21 3,20.1 3,19V5C3,3.89 3.89,3 5,3H6V1H8V3H16V1H18V3H19A2,2 0 0,1 21,5V11.1C22.24,12.36 23,14.09 23,16A7,7 0 0,1 16,23C14.09,23 12.36,22.24 11.1,21H5M16,11.15A4.85,4.85 0 0,0 11.15,16C11.15,18.68 13.32,20.85 16,20.85A4.85,4.85 0 0,0 20.85,16C20.85,13.32 18.68,11.15 16,11.15Z",input_number:P,input_select:E,input_text:"M17,7H22V17H17V19A1,1 0 0,0 18,20H20V22H17.5C16.95,22 16,21.55 16,21C16,21.55 15.05,22 14.5,22H12V20H14A1,1 0 0,0 15,19V5A1,1 0 0,0 14,4H12V2H14.5C15.05,2 16,2.45 16,3C16,2.45 16.95,2 17.5,2H20V4H18A1,1 0 0,0 17,5V7M2,7H13V9H4V15H13V17H2V7M20,15V9H17V15H20Z",light:"M12,2A7,7 0 0,0 5,9C5,11.38 6.19,13.47 8,14.74V17A1,1 0 0,0 9,18H15A1,1 0 0,0 16,17V14.74C17.81,13.47 19,11.38 19,9A7,7 0 0,0 12,2M9,21A1,1 0 0,0 10,22H14A1,1 0 0,0 15,21V20H9V21Z",mailbox:"M17,4H7A5,5 0 0,0 2,9V20H20A2,2 0 0,0 22,18V9A5,5 0 0,0 17,4M10,18H4V9A3,3 0 0,1 7,6A3,3 0 0,1 10,9V18M19,15H17V13H13V11H19V15M9,11H5V9H9V11Z",notify:"M9 22C8.4 22 8 21.6 8 21V18H4C2.9 18 2 17.1 2 16V4C2 2.9 2.9 2 4 2H20C21.1 2 22 2.9 22 4V16C22 17.1 21.1 18 20 18H13.9L10.2 21.7C10 21.9 9.8 22 9.5 22H9M13 11V5H11V11M13 15V13H11V15H13Z",number:P,persistent_notification:g,person:"M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z",plant:"M3,13A9,9 0 0,0 12,22C12,17 7.97,13 3,13M12,5.5A2.5,2.5 0 0,1 14.5,8A2.5,2.5 0 0,1 12,10.5A2.5,2.5 0 0,1 9.5,8A2.5,2.5 0 0,1 12,5.5M5.6,10.25A2.5,2.5 0 0,0 8.1,12.75C8.63,12.75 9.12,12.58 9.5,12.31C9.5,12.37 9.5,12.43 9.5,12.5A2.5,2.5 0 0,0 12,15A2.5,2.5 0 0,0 14.5,12.5C14.5,12.43 14.5,12.37 14.5,12.31C14.88,12.58 15.37,12.75 15.9,12.75C17.28,12.75 18.4,11.63 18.4,10.25C18.4,9.25 17.81,8.4 16.97,8C17.81,7.6 18.4,6.74 18.4,5.75C18.4,4.37 17.28,3.25 15.9,3.25C15.37,3.25 14.88,3.41 14.5,3.69C14.5,3.63 14.5,3.56 14.5,3.5A2.5,2.5 0 0,0 12,1A2.5,2.5 0 0,0 9.5,3.5C9.5,3.56 9.5,3.63 9.5,3.69C9.12,3.41 8.63,3.25 8.1,3.25A2.5,2.5 0 0,0 5.6,5.75C5.6,6.74 6.19,7.6 7.03,8C6.19,8.4 5.6,9.25 5.6,10.25M12,22A9,9 0 0,0 21,13C16,13 12,17 12,22Z",proximity:"M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12C4,14.09 4.8,16 6.11,17.41L9.88,9.88L17.41,6.11C16,4.8 14.09,4 12,4M12,20A8,8 0 0,0 20,12C20,9.91 19.2,8 17.89,6.59L14.12,14.12L6.59,17.89C8,19.2 9.91,20 12,20M12,12L11.23,11.23L9.7,14.3L12.77,12.77L12,12M12,17.5H13V19H12V17.5M15.88,15.89L16.59,15.18L17.65,16.24L16.94,16.95L15.88,15.89M17.5,12V11H19V12H17.5M12,6.5H11V5H12V6.5M8.12,8.11L7.41,8.82L6.35,7.76L7.06,7.05L8.12,8.11M6.5,12V13H5V12H6.5Z",remote:"M12,0C8.96,0 6.21,1.23 4.22,3.22L5.63,4.63C7.26,3 9.5,2 12,2C14.5,2 16.74,3 18.36,4.64L19.77,3.23C17.79,1.23 15.04,0 12,0M7.05,6.05L8.46,7.46C9.37,6.56 10.62,6 12,6C13.38,6 14.63,6.56 15.54,7.46L16.95,6.05C15.68,4.78 13.93,4 12,4C10.07,4 8.32,4.78 7.05,6.05M12,15A2,2 0 0,1 10,13A2,2 0 0,1 12,11A2,2 0 0,1 14,13A2,2 0 0,1 12,15M15,9H9A1,1 0 0,0 8,10V22A1,1 0 0,0 9,23H15A1,1 0 0,0 16,22V10A1,1 0 0,0 15,9Z",scene:"M17.5,12A1.5,1.5 0 0,1 16,10.5A1.5,1.5 0 0,1 17.5,9A1.5,1.5 0 0,1 19,10.5A1.5,1.5 0 0,1 17.5,12M14.5,8A1.5,1.5 0 0,1 13,6.5A1.5,1.5 0 0,1 14.5,5A1.5,1.5 0 0,1 16,6.5A1.5,1.5 0 0,1 14.5,8M9.5,8A1.5,1.5 0 0,1 8,6.5A1.5,1.5 0 0,1 9.5,5A1.5,1.5 0 0,1 11,6.5A1.5,1.5 0 0,1 9.5,8M6.5,12A1.5,1.5 0 0,1 5,10.5A1.5,1.5 0 0,1 6.5,9A1.5,1.5 0 0,1 8,10.5A1.5,1.5 0 0,1 6.5,12M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A1.5,1.5 0 0,0 13.5,19.5C13.5,19.11 13.35,18.76 13.11,18.5C12.88,18.23 12.73,17.88 12.73,17.5A1.5,1.5 0 0,1 14.23,16H16A5,5 0 0,0 21,11C21,6.58 16.97,3 12,3Z",script:"M17.8,20C17.4,21.2 16.3,22 15,22H5C3.3,22 2,20.7 2,19V18H5L14.2,18C14.6,19.2 15.7,20 17,20H17.8M19,2C20.7,2 22,3.3 22,5V6H20V5C20,4.4 19.6,4 19,4C18.4,4 18,4.4 18,5V18H17C16.4,18 16,17.6 16,17V16H5V5C5,3.3 6.3,2 8,2H19M8,6V8H15V6H8M8,10V12H14V10H8Z",select:E,sensor:"M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z",siren:"M12,8H4A2,2 0 0,0 2,10V14A2,2 0 0,0 4,16H5V20A1,1 0 0,0 6,21H8A1,1 0 0,0 9,20V16H12L17,20V4L12,8M21.5,12C21.5,13.71 20.54,15.26 19,16V8C20.53,8.75 21.5,10.3 21.5,12Z",simple_alarm:g,sun:"M3.55,18.54L4.96,19.95L6.76,18.16L5.34,16.74M11,22.45C11.32,22.45 13,22.45 13,22.45V19.5H11M12,5.5A6,6 0 0,0 6,11.5A6,6 0 0,0 12,17.5A6,6 0 0,0 18,11.5C18,8.18 15.31,5.5 12,5.5M20,12.5H23V10.5H20M17.24,18.16L19.04,19.95L20.45,18.54L18.66,16.74M20.45,4.46L19.04,3.05L17.24,4.84L18.66,6.26M13,0.55H11V3.5H13M4,10.5H1V12.5H4M6.76,4.84L4.96,3.05L3.55,4.46L5.34,6.26L6.76,4.84Z",timer:"M12,20A7,7 0 0,1 5,13A7,7 0 0,1 12,6A7,7 0 0,1 19,13A7,7 0 0,1 12,20M19.03,7.39L20.45,5.97C20,5.46 19.55,5 19.04,4.56L17.62,6C16.07,4.74 14.12,4 12,4A9,9 0 0,0 3,13A9,9 0 0,0 12,22C17,22 21,17.97 21,13C21,10.88 20.26,8.93 19.03,7.39M11,14H13V8H11M15,1H9V3H15V1Z",updater:"M14,13V17H10V13H7L12,8L17,13M19.35,10.03C18.67,6.59 15.64,4 12,4C9.11,4 6.6,5.64 5.35,8.03C2.34,8.36 0,10.9 0,14A6,6 0 0,0 6,20H19A5,5 0 0,0 24,15C24,12.36 21.95,10.22 19.35,10.03Z",vacuum:"M12,2C14.65,2 17.19,3.06 19.07,4.93L17.65,6.35C16.15,4.85 14.12,4 12,4C9.88,4 7.84,4.84 6.35,6.35L4.93,4.93C6.81,3.06 9.35,2 12,2M3.66,6.5L5.11,7.94C4.39,9.17 4,10.57 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12C20,10.57 19.61,9.17 18.88,7.94L20.34,6.5C21.42,8.12 22,10.04 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12C2,10.04 2.58,8.12 3.66,6.5M12,6A6,6 0 0,1 18,12C18,13.59 17.37,15.12 16.24,16.24L14.83,14.83C14.08,15.58 13.06,16 12,16C10.94,16 9.92,15.58 9.17,14.83L7.76,16.24C6.63,15.12 6,13.59 6,12A6,6 0 0,1 12,6M12,8A1,1 0 0,0 11,9A1,1 0 0,0 12,10A1,1 0 0,0 13,9A1,1 0 0,0 12,8Z",water_heater:_,weather:"M6,19A5,5 0 0,1 1,14A5,5 0 0,1 6,9C7,6.65 9.3,5 12,5C15.43,5 18.24,7.66 18.5,11.03L19,11A4,4 0 0,1 23,15A4,4 0 0,1 19,19H6M19,13H17V12A5,5 0 0,0 12,7C9.5,7 7.45,8.82 7.06,11.19C6.73,11.07 6.37,11 6,11A3,3 0 0,0 3,14A3,3 0 0,0 6,17H19A2,2 0 0,0 21,15A2,2 0 0,0 19,13Z",zone:"M12,2C15.31,2 18,4.66 18,7.95C18,12.41 12,19 12,19C12,19 6,12.41 6,7.95C6,4.66 8.69,2 12,2M12,6A2,2 0 0,0 10,8A2,2 0 0,0 12,10A2,2 0 0,0 14,8A2,2 0 0,0 12,6M20,19C20,21.21 16.42,23 12,23C7.58,23 4,21.21 4,19C4,17.71 5.22,16.56 7.11,15.83L7.75,16.74C6.67,17.19 6,17.81 6,18.5C6,19.88 8.69,21 12,21C15.31,21 18,19.88 18,18.5C18,17.81 17.33,17.19 16.25,16.74L16.89,15.83C18.78,16.56 20,17.71 20,19Z"},D={apparent_power:k,aqi:b,carbon_dioxide:"M5,7A2,2 0 0,0 3,9V15A2,2 0 0,0 5,17H8V15H5V9H8V7H5M11,7A2,2 0 0,0 9,9V15A2,2 0 0,0 11,17H13A2,2 0 0,0 15,15V9A2,2 0 0,0 13,7H11M11,9H13V15H11V9M16,10.5V12H19V13.5H17.5A1.5,1.5 0 0,0 16,15V18H20.5V16.5H17.5V15H19A1.5,1.5 0 0,0 20.5,13.5V12A1.5,1.5 0 0,0 19,10.5H16Z",carbon_monoxide:"M8 7C6.9 7 6 7.9 6 9V15C6 16.11 6.9 17 8 17H11V15H8V9H11V7H8M14 7C12.9 7 12 7.9 12 9V15C12 16.11 12.9 17 14 17H16C17.11 17 18 16.11 18 15V9C18 7.9 17.11 7 16 7H14M14 9H16V15H14V9",current:"M12.43 11C12.28 10.84 10 7 7 7S2.32 10.18 2 11V13H11.57C11.72 13.16 14 17 17 17S21.68 13.82 22 13V11H12.43M7 9C8.17 9 9.18 9.85 10 11H4.31C4.78 10.17 5.54 9 7 9M17 15C15.83 15 14.82 14.15 14 13H19.69C19.22 13.83 18.46 15 17 15Z",date:w,energy:"M11 15H6L13 1V9H18L11 23V15Z",frequency:A,gas:"M16,9V14L16,20A2,2 0 0,1 14,22H10A2,2 0 0,1 8,20V14L8,9C8,7.14 9.27,5.57 11,5.13V4H9V2H15V4H13V5.13C14.73,5.57 16,7.14 16,9Z",humidity:"M12,3.25C12,3.25 6,10 6,14C6,17.32 8.69,20 12,20A6,6 0 0,0 18,14C18,10 12,3.25 12,3.25M14.47,9.97L15.53,11.03L9.53,17.03L8.47,15.97M9.75,10A1.25,1.25 0 0,1 11,11.25A1.25,1.25 0 0,1 9.75,12.5A1.25,1.25 0 0,1 8.5,11.25A1.25,1.25 0 0,1 9.75,10M14.25,14.5A1.25,1.25 0 0,1 15.5,15.75A1.25,1.25 0 0,1 14.25,17A1.25,1.25 0 0,1 13,15.75A1.25,1.25 0 0,1 14.25,14.5Z",illuminance:"M12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6A6,6 0 0,1 18,12A6,6 0 0,1 12,18M20,15.31L23.31,12L20,8.69V4H15.31L12,0.69L8.69,4H4V8.69L0.69,12L4,15.31V20H8.69L12,23.31L15.31,20H20V15.31Z",monetary:"M3,6H21V18H3V6M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9M7,8A2,2 0 0,1 5,10V14A2,2 0 0,1 7,16H17A2,2 0 0,1 19,14V10A2,2 0 0,1 17,8H7Z",nitrogen_dioxide:C,nitrogen_monoxide:C,nitrous_oxide:C,ozone:C,pm1:C,pm10:C,pm25:C,power:k,power_factor:"M20,19H4.09L14.18,4.43L15.82,5.57L11.28,12.13C12.89,12.96 14,14.62 14,16.54C14,16.7 14,16.85 13.97,17H20V19M7.91,17H11.96C12,16.85 12,16.7 12,16.54C12,15.28 11.24,14.22 10.14,13.78L7.91,17Z",pressure:"M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,4A8,8 0 0,1 20,12C20,14.4 19,16.5 17.3,18C15.9,16.7 14,16 12,16C10,16 8.2,16.7 6.7,18C5,16.5 4,14.4 4,12A8,8 0 0,1 12,4M14,5.89C13.62,5.9 13.26,6.15 13.1,6.54L11.81,9.77L11.71,10C11,10.13 10.41,10.6 10.14,11.26C9.73,12.29 10.23,13.45 11.26,13.86C12.29,14.27 13.45,13.77 13.86,12.74C14.12,12.08 14,11.32 13.57,10.76L13.67,10.5L14.96,7.29L14.97,7.26C15.17,6.75 14.92,6.17 14.41,5.96C14.28,5.91 14.15,5.89 14,5.89M10,6A1,1 0 0,0 9,7A1,1 0 0,0 10,8A1,1 0 0,0 11,7A1,1 0 0,0 10,6M7,9A1,1 0 0,0 6,10A1,1 0 0,0 7,11A1,1 0 0,0 8,10A1,1 0 0,0 7,9M17,9A1,1 0 0,0 16,10A1,1 0 0,0 17,11A1,1 0 0,0 18,10A1,1 0 0,0 17,9Z",reactive_power:k,signal_strength:"M12,21L15.6,16.2C14.6,15.45 13.35,15 12,15C10.65,15 9.4,15.45 8.4,16.2L12,21M12,3C7.95,3 4.21,4.34 1.2,6.6L3,9C5.5,7.12 8.62,6 12,6C15.38,6 18.5,7.12 21,9L22.8,6.6C19.79,4.34 16.05,3 12,3M12,9C9.3,9 6.81,9.89 4.8,11.4L6.6,13.8C8.1,12.67 9.97,12 12,12C14.03,12 15.9,12.67 17.4,13.8L19.2,11.4C17.19,9.89 14.7,9 12,9Z",sulphur_dioxide:C,temperature:_,timestamp:"M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M16.2,16.2L11,13V7H12.5V12.2L17,14.9L16.2,16.2Z",volatile_organic_compounds:C,voltage:A},j=(new Set(["fan","input_boolean","light","switch","group","automation","humidifier"]),new Set(["camera","media_player"]),"M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.67C6,21.4 6.6,22 7.33,22H16.67A1.33,1.33 0 0,0 18,20.67V5.33C18,4.6 17.4,4 16.67,4Z"),x="M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z",T="M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z",z="M12 5.69L17 10.19V18H15V12H9V18H7V10.19L12 5.69M12 3L2 12H5V20H11V14H13V20H19V12H22L12 3Z",V="M16,7V3H14V7H10V3H8V7H8C7,7 6,8 6,9V14.5L9.5,18V21H14.5V18L18,14.5V9C18,8 17,7 16,7Z",H="M20.84 22.73L15.31 17.2L14.5 18V21H9.5V18L6 14.5V9C6 8.7 6.1 8.41 6.25 8.14L1.11 3L2.39 1.73L22.11 21.46L20.84 22.73M18 14.5V9C18 8 17 7 16 7V3H14V7H10.2L17.85 14.65L18 14.5M10 3H8V4.8L10 6.8V3Z",M="M15 13V5A3 3 0 0 0 9 5V13A5 5 0 1 0 15 13M12 4A1 1 0 0 1 13 5V8H11V5A1 1 0 0 1 12 4Z",L="M21,19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V5A2,2 0 0,1 5,3H19C20.11,3 21,3.9 21,5V19M13,18V9.5L16.5,13L17.92,11.58L12,5.66L6.08,11.58L7.5,13L11,9.5V18H13Z",R="M3,5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5C3.89,21 3,20.1 3,19V5M11,6V14.5L7.5,11L6.08,12.42L12,18.34L17.92,12.42L16.5,11L13,14.5V6H11Z",F="M6,11H10V9H14V11H18V4H6V11M18,13H6V20H18V13M6,2H18A2,2 0 0,1 20,4V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2Z",I="M6,8H10V6H14V8H18V4H6V8M18,10H6V15H18V10M6,20H18V17H6V20M6,2H18A2,2 0 0,1 20,4V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2Z",B="M13,20V4H15.03V20H13M10,20V4H12.03V20H10M5,8L9.03,12L5,16V13H2V11H5V8M20,16L16,12L20,8V11H23V13H20V16Z",Z="M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.67C6,21.4 6.6,22 7.33,22H16.67A1.33,1.33 0 0,0 18,20.67V5.33C18,4.6 17.4,4 16.67,4Z",U={10:"M16,18H8V6H16M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.67C6,21.4 6.6,22 7.33,22H16.67A1.33,1.33 0 0,0 18,20.67V5.33C18,4.6 17.4,4 16.67,4Z",20:"M16,17H8V6H16M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.67C6,21.4 6.6,22 7.33,22H16.67A1.33,1.33 0 0,0 18,20.67V5.33C18,4.6 17.4,4 16.67,4Z",30:"M16,15H8V6H16M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.67C6,21.4 6.6,22 7.33,22H16.67A1.33,1.33 0 0,0 18,20.67V5.33C18,4.6 17.4,4 16.67,4Z",40:"M16,14H8V6H16M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.67C6,21.4 6.6,22 7.33,22H16.67A1.33,1.33 0 0,0 18,20.67V5.33C18,4.6 17.4,4 16.67,4Z",50:"M16,13H8V6H16M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.67C6,21.4 6.6,22 7.33,22H16.67A1.33,1.33 0 0,0 18,20.67V5.33C18,4.6 17.4,4 16.67,4Z",60:"M16,12H8V6H16M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.67C6,21.4 6.6,22 7.33,22H16.67A1.33,1.33 0 0,0 18,20.67V5.33C18,4.6 17.4,4 16.67,4Z",70:"M16,10H8V6H16M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.67C6,21.4 6.6,22 7.33,22H16.67A1.33,1.33 0 0,0 18,20.67V5.33C18,4.6 17.4,4 16.67,4Z",80:"M16,9H8V6H16M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.67C6,21.4 6.6,22 7.33,22H16.67A1.33,1.33 0 0,0 18,20.67V5.33C18,4.6 17.4,4 16.67,4Z",90:"M16,8H8V6H16M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.67C6,21.4 6.6,22 7.33,22H16.67A1.33,1.33 0 0,0 18,20.67V5.33C18,4.6 17.4,4 16.67,4Z",100:Z},N={10:"M23.05,11H20.05V4L15.05,14H18.05V22M12,18H4L4.05,6H12.05M12.72,4H11.05V2H5.05V4H3.38A1.33,1.33 0 0,0 2.05,5.33V20.67C2.05,21.4 2.65,22 3.38,22H12.72C13.45,22 14.05,21.4 14.05,20.67V5.33A1.33,1.33 0 0,0 12.72,4Z",20:"M23.05,11H20.05V4L15.05,14H18.05V22M12.05,17H4.05V6H12.05M12.72,4H11.05V2H5.05V4H3.38A1.33,1.33 0 0,0 2.05,5.33V20.67C2.05,21.4 2.65,22 3.38,22H12.72C13.45,22 14.05,21.4 14.05,20.67V5.33A1.33,1.33 0 0,0 12.72,4Z",30:"M12,15H4V6H12M12.67,4H11V2H5V4H3.33A1.33,1.33 0 0,0 2,5.33V20.67C2,21.4 2.6,22 3.33,22H12.67C13.4,22 14,21.4 14,20.67V5.33A1.33,1.33 0 0,0 12.67,4M23,11H20V4L15,14H18V22L23,11Z",40:"M13 4H11V2H5V4H3C2.4 4 2 4.4 2 5V21C2 21.6 2.4 22 3 22H13C13.6 22 14 21.6 14 21V5C14 4.4 13.6 4 13 4M12 14.5H4V6H12V14.5M23 11H20V4L15 14H18V22",50:"M23,11H20V4L15,14H18V22M12,13H4V6H12M12.67,4H11V2H5V4H3.33A1.33,1.33 0 0,0 2,5.33V20.67C2,21.4 2.6,22 3.33,22H12.67C13.4,22 14,21.4 14,20.67V5.33A1.33,1.33 0 0,0 12.67,4Z",60:"M12,11H4V6H12M12.67,4H11V2H5V4H3.33A1.33,1.33 0 0,0 2,5.33V20.67C2,21.4 2.6,22 3.33,22H12.67C13.4,22 14,21.4 14,20.67V5.33A1.33,1.33 0 0,0 12.67,4M23,11H20V4L15,14H18V22L23,11Z",70:"M12,10H4V6H12M12.67,4H11V2H5V4H3.33A1.33,1.33 0 0,0 2,5.33V20.67C2,21.4 2.6,22 3.33,22H12.67C13.4,22 14,21.4 14,20.67V5.33A1.33,1.33 0 0,0 12.67,4M23,11H20V4L15,14H18V22L23,11Z",80:"M23,11H20V4L15,14H18V22M12,9H4V6H12M12.67,4H11V2H5V4H3.33A1.33,1.33 0 0,0 2,5.33V20.67C2,21.4 2.6,22 3.33,22H12.67C13.4,22 14,21.4 14,20.67V5.33A1.33,1.33 0 0,0 12.67,4Z",90:"M23,11H20V4L15,14H18V22M12,8H4V6H12M12.67,4H11V2H5V4H3.33A1.33,1.33 0 0,0 2,5.33V20.67C2,21.4 2.6,22 3.33,22H12.67C13.4,22 14,21.4 14,20.67V5.33A1.33,1.33 0 0,0 12.67,4Z",100:"M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.66C6,21.4 6.6,22 7.33,22H16.66C17.4,22 18,21.4 18,20.67V5.33C18,4.6 17.4,4 16.67,4M11,20V14.5H9L13,7V12.5H15"},$=function(e,t){var r=Number(e);if(isNaN(r))return"off"===e?Z:"on"===e?"M13 14H11V8H13M13 18H11V16H13M16.7 4H15V2H9V4H7.3C6.6 4 6 4.6 6 5.3V20.6C6 21.4 6.6 22 7.3 22H16.6C17.3 22 17.9 21.4 17.9 20.7V5.3C18 4.6 17.4 4 16.7 4Z":"M15.07,12.25L14.17,13.17C13.63,13.71 13.25,14.18 13.09,15H11.05C11.16,14.1 11.56,13.28 12.17,12.67L13.41,11.41C13.78,11.05 14,10.55 14,10C14,8.89 13.1,8 12,8A2,2 0 0,0 10,10H8A4,4 0 0,1 12,6A4,4 0 0,1 16,10C16,10.88 15.64,11.68 15.07,12.25M13,19H11V17H13M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.66C6,21.4 6.6,22 7.33,22H16.67C17.4,22 18,21.4 18,20.66V5.33C18,4.59 17.4,4 16.67,4Z";var n=10*Math.round(r/10);return t&&r>=10?N[n]:t?"M23.05,11H20.05V4L15.05,14H18.05V22M12,20H4L4.05,6H12.05M12.72,4H11.05V2H5.05V4H3.38A1.33,1.33 0 0,0 2.05,5.33V20.67C2.05,21.4 2.65,22 3.38,22H12.72C13.45,22 14.05,21.4 14.05,20.67V5.33A1.33,1.33 0 0,0 12.72,4Z":r<=5?"M14 20H6V6H14M14.67 4H13V2H7V4H5.33C4.6 4 4 4.6 4 5.33V20.67C4 21.4 4.6 22 5.33 22H14.67C15.4 22 16 21.4 16 20.67V5.33C16 4.6 15.4 4 14.67 4M21 7H19V13H21V8M21 15H19V17H21V15Z":U[n]},q=function(e){var t,r,n,i=null==e?void 0:e.attributes.device_class;if(i&&i in D)return D[i];if("battery"===i)return e?(r=e.state,n=t&&"on"===t.state,$(r,n)):"M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.67C6,21.4 6.6,22 7.33,22H16.67A1.33,1.33 0 0,0 18,20.67V5.33C18,4.6 17.4,4 16.67,4Z";var o=null==e?void 0:e.attributes.unit_of_measurement;return"°C"===o||"°F"===o?"M15 13V5A3 3 0 0 0 9 5V13A5 5 0 1 0 15 13M12 4A1 1 0 0 1 13 5V8H11V5A1 1 0 0 1 12 4Z":void 0},W=function(e,t,r){var n=void 0!==r?r:null==t?void 0:t.state;switch(e){case"alarm_control_panel":return function(e){switch(e){case"armed_away":return"M12,1L3,5V11C3,16.55 6.84,21.74 12,23C17.16,21.74 21,16.55 21,11V5L12,1M12,7C13.4,7 14.8,8.1 14.8,9.5V11C15.4,11 16,11.6 16,12.3V15.8C16,16.4 15.4,17 14.7,17H9.2C8.6,17 8,16.4 8,15.7V12.2C8,11.6 8.6,11 9.2,11V9.5C9.2,8.1 10.6,7 12,7M12,8.2C11.2,8.2 10.5,8.7 10.5,9.5V11H13.5V9.5C13.5,8.7 12.8,8.2 12,8.2Z";case"armed_vacation":return"M12,1L3,5V11C3,16.55 6.84,21.74 12,23C17.16,21.74 21,16.55 21,11V5L12,1M12,5.68C12.5,5.68 12.95,6.11 12.95,6.63V10.11L18,13.26V14.53L12.95,12.95V16.42L14.21,17.37V18.32L12,17.68L9.79,18.32V17.37L11.05,16.42V12.95L6,14.53V13.26L11.05,10.11V6.63C11.05,6.11 11.5,5.68 12,5.68Z";case"armed_home":return"M11,13H13V16H16V11H18L12,6L6,11H8V16H11V13M12,1L21,5V11C21,16.55 17.16,21.74 12,23C6.84,21.74 3,16.55 3,11V5L12,1Z";case"armed_night":return"M12 1L3 5V11C3 16.55 6.84 21.74 12 23C17.16 21.74 21 16.55 21 11V5L12 1M15.97 14.41C14.13 16.58 10.76 16.5 9 14.34C6.82 11.62 8.36 7.62 11.7 7C12.04 6.95 12.33 7.28 12.21 7.61C11.75 8.84 11.82 10.25 12.53 11.47C13.24 12.69 14.42 13.46 15.71 13.67C16.05 13.72 16.2 14.14 15.97 14.41Z";case"armed_custom_bypass":return"M12,12H19C18.47,16.11 15.72,19.78 12,20.92V12H5V6.3L12,3.19M12,1L3,5V11C3,16.55 6.84,21.73 12,23C17.16,21.73 21,16.55 21,11V5L12,1Z";case"pending":return"M21,11C21,16.55 17.16,21.74 12,23C6.84,21.74 3,16.55 3,11V5L12,1L21,5V11M12,21C15.75,20 19,15.54 19,11.22V6.3L12,3.18L5,6.3V11.22C5,15.54 8.25,20 12,21Z";case"triggered":return"M21,19V20H3V19L5,17V11C5,7.9 7.03,5.17 10,4.29C10,4.19 10,4.1 10,4A2,2 0 0,1 12,2A2,2 0 0,1 14,4C14,4.1 14,4.19 14,4.29C16.97,5.17 19,7.9 19,11V17L21,19M14,21A2,2 0 0,1 12,23A2,2 0 0,1 10,21M19.75,3.19L18.33,4.61C20.04,6.3 21,8.6 21,11H23C23,8.07 21.84,5.25 19.75,3.19M1,11H3C3,8.6 3.96,6.3 5.67,4.61L4.25,3.19C2.16,5.25 1,8.07 1,11Z";case"disarmed":return"M1,4.27L2.28,3L20.5,21.22L19.23,22.5L17,20.25C15.57,21.57 13.87,22.54 12,23C6.84,21.74 3,16.55 3,11V6.27L1,4.27M12,1L21,5V11C21,13.28 20.35,15.5 19.23,17.41L5.65,3.82L12,1Z";default:return"M12,1L3,5V11C3,16.55 6.84,21.74 12,23C17.16,21.74 21,16.55 21,11V5L12,1Z"}}(n);case"binary_sensor":return function(e,t){var r="off"===e;switch(null==t?void 0:t.attributes.device_class){case"battery":return r?j:"M16,20H8V6H16M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.67C6,21.4 6.6,22 7.33,22H16.67A1.33,1.33 0 0,0 18,20.67V5.33C18,4.6 17.4,4 16.67,4Z";case"battery_charging":return r?j:"M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.66C6,21.4 6.6,22 7.33,22H16.66C17.4,22 18,21.4 18,20.67V5.33C18,4.6 17.4,4 16.67,4M11,20V14.5H9L13,7V12.5H15";case"cold":return r?M:"M20.79,13.95L18.46,14.57L16.46,13.44V10.56L18.46,9.43L20.79,10.05L21.31,8.12L19.54,7.65L20,5.88L18.07,5.36L17.45,7.69L15.45,8.82L13,7.38V5.12L14.71,3.41L13.29,2L12,3.29L10.71,2L9.29,3.41L11,5.12V7.38L8.5,8.82L6.5,7.69L5.92,5.36L4,5.88L4.47,7.65L2.7,8.12L3.22,10.05L5.55,9.43L7.55,10.56V13.45L5.55,14.58L3.22,13.96L2.7,15.89L4.47,16.36L4,18.12L5.93,18.64L6.55,16.31L8.55,15.18L11,16.62V18.88L9.29,20.59L10.71,22L12,20.71L13.29,22L14.7,20.59L13,18.88V16.62L15.5,15.17L17.5,16.3L18.12,18.63L20,18.12L19.53,16.35L21.3,15.88L20.79,13.95M9.5,10.56L12,9.11L14.5,10.56V13.44L12,14.89L9.5,13.44V10.56Z";case"connectivity":return r?"M15,20A1,1 0 0,0 14,19H13V17H17A2,2 0 0,0 19,15V5A2,2 0 0,0 17,3H7A2,2 0 0,0 5,5V15A2,2 0 0,0 7,17H11V19H10A1,1 0 0,0 9,20H2V22H9A1,1 0 0,0 10,23H14A1,1 0 0,0 15,22H22V20H15M7,15V5H17V15H7M15.54,12.12L13.41,10L15.53,7.87L14.12,6.46L12,8.59L9.88,6.46L8.47,7.87L10.59,10L8.47,12.13L9.88,13.54L12,11.41L14.12,13.54L15.54,12.12Z":"M15,20A1,1 0 0,0 14,19H13V17H17A2,2 0 0,0 19,15V5A2,2 0 0,0 17,3H7A2,2 0 0,0 5,5V15A2,2 0 0,0 7,17H11V19H10A1,1 0 0,0 9,20H2V22H9A1,1 0 0,0 10,23H14A1,1 0 0,0 15,22H22V20H15M7,15V5H17V15H7M8,10.37L9.24,9.13L10.93,10.83L14.76,7L16,8.5L10.93,13.57L8,10.37Z";case"door":return r?"M16,11H18V13H16V11M12,3H19C20.11,3 21,3.89 21,5V19H22V21H2V19H10V5C10,3.89 10.89,3 12,3M12,5V19H19V5H12Z":"M12,3C10.89,3 10,3.89 10,5H3V19H2V21H22V19H21V5C21,3.89 20.11,3 19,3H12M12,5H19V19H12V5M5,11H7V13H5V11Z";case"garage_door":return r?"M19,20H17V11H7V20H5V9L12,5L19,9V20M8,12H16V14H8V12M8,15H16V17H8V15M16,18V20H8V18H16Z":"M19,20H17V11H7V20H5V9L12,5L19,9V20M8,12H16V14H8V12Z";case"power":case"plug":return r?H:V;case"gas":case"problem":case"safety":case"tamper":return r?x:"M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z";case"smoke":return r?x:"M17 19V22H15V19C15 17.9 14.1 17 13 17H10C7.2 17 5 14.8 5 12C5 10.8 5.4 9.8 6.1 8.9C3.8 8.5 2 6.4 2 4C2 3.3 2.2 2.6 2.4 2H4.8C4.3 2.5 4 3.2 4 4C4 5.7 5.3 7 7 7H10V9C8.3 9 7 10.3 7 12S8.3 15 10 15H13C15.2 15 17 16.8 17 19M17.9 8.9C20.2 8.5 22 6.4 22 4C22 3.3 21.8 2.6 21.6 2H19.2C19.7 2.5 20 3.2 20 4C20 5.7 18.7 7 17 7H15.8C15.9 7.3 16 7.6 16 8C16 9.7 14.7 11 13 11V13C15.8 13 18 15.2 18 18V22H20V18C20 15.3 18.5 13 16.2 11.8C17.1 11.1 17.7 10.1 17.9 8.9Z";case"heat":return r?M:"M17.66 11.2C17.43 10.9 17.15 10.64 16.89 10.38C16.22 9.78 15.46 9.35 14.82 8.72C13.33 7.26 13 4.85 13.95 3C13 3.23 12.17 3.75 11.46 4.32C8.87 6.4 7.85 10.07 9.07 13.22C9.11 13.32 9.15 13.42 9.15 13.55C9.15 13.77 9 13.97 8.8 14.05C8.57 14.15 8.33 14.09 8.14 13.93C8.08 13.88 8.04 13.83 8 13.76C6.87 12.33 6.69 10.28 7.45 8.64C5.78 10 4.87 12.3 5 14.47C5.06 14.97 5.12 15.47 5.29 15.97C5.43 16.57 5.7 17.17 6 17.7C7.08 19.43 8.95 20.67 10.96 20.92C13.1 21.19 15.39 20.8 17.03 19.32C18.86 17.66 19.5 15 18.56 12.72L18.43 12.46C18.22 12 17.66 11.2 17.66 11.2M14.5 17.5C14.22 17.74 13.76 18 13.4 18.1C12.28 18.5 11.16 17.94 10.5 17.28C11.69 17 12.4 16.12 12.61 15.23C12.78 14.43 12.46 13.77 12.33 13C12.21 12.26 12.23 11.63 12.5 10.94C12.69 11.32 12.89 11.7 13.13 12C13.9 13 15.11 13.44 15.37 14.8C15.41 14.94 15.43 15.08 15.43 15.23C15.46 16.05 15.1 16.95 14.5 17.5H14.5Z";case"light":return r?"M12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6A6,6 0 0,1 18,12A6,6 0 0,1 12,18M20,15.31L23.31,12L20,8.69V4H15.31L12,0.69L8.69,4H4V8.69L0.69,12L4,15.31V20H8.69L12,23.31L15.31,20H20V15.31Z":"M12,8A4,4 0 0,0 8,12A4,4 0 0,0 12,16A4,4 0 0,0 16,12A4,4 0 0,0 12,8M12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6A6,6 0 0,1 18,12A6,6 0 0,1 12,18M20,8.69V4H15.31L12,0.69L8.69,4H4V8.69L0.69,12L4,15.31V20H8.69L12,23.31L15.31,20H20V15.31L23.31,12L20,8.69Z";case"lock":return r?"M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z":"M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V10A2,2 0 0,1 6,8H15V6A3,3 0 0,0 12,3A3,3 0 0,0 9,6H7A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,17A2,2 0 0,0 14,15A2,2 0 0,0 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17Z";case"moisture":return r?"M20.84 22.73L16.29 18.18C15.2 19.3 13.69 20 12 20C8.69 20 6 17.31 6 14C6 12.67 6.67 11.03 7.55 9.44L1.11 3L2.39 1.73L22.11 21.46L20.84 22.73M18 14C18 10 12 3.25 12 3.25S10.84 4.55 9.55 6.35L17.95 14.75C18 14.5 18 14.25 18 14Z":"M12,20A6,6 0 0,1 6,14C6,10 12,3.25 12,3.25C12,3.25 18,10 18,14A6,6 0 0,1 12,20Z";case"motion":return r?"M11.4 8.2H15V10H13.2L11.4 8.2M19.67 1H18.33C18.33 3.58 20.42 5.67 23 5.67V4.33C21.16 4.33 19.67 2.84 19.67 1M21 1C21 2.11 21.9 3 23 3V1H21M17 1H15.67C15.67 5.05 18.95 8.33 23 8.33V7C19.69 7 17 4.31 17 1M10 3.8C11 3.8 11.8 3 11.8 2S11 .2 10 .2 8.2 1 8.2 2 9 3.8 10 3.8M2.39 1.73L1.11 3L3.46 5.35L2 5.8V11H3.8V7.33L5.05 6.94L5.68 7.57L2 22H3.8L6.67 13.89L9 17V22H10.8V15.59L8.31 11.05L8.5 10.37L20.84 22.73L22.11 21.46L2.39 1.73M9.38 4.87C9.08 4.37 8.54 4.03 7.92 4.03C7.75 4.03 7.58 4.06 7.42 4.11L7.34 4.14L11.35 8.15L9.38 4.87Z":"M10,0.2C9,0.2 8.2,1 8.2,2C8.2,3 9,3.8 10,3.8C11,3.8 11.8,3 11.8,2C11.8,1 11,0.2 10,0.2M15.67,1A7.33,7.33 0 0,0 23,8.33V7A6,6 0 0,1 17,1H15.67M18.33,1C18.33,3.58 20.42,5.67 23,5.67V4.33C21.16,4.33 19.67,2.84 19.67,1H18.33M21,1A2,2 0 0,0 23,3V1H21M7.92,4.03C7.75,4.03 7.58,4.06 7.42,4.11L2,5.8V11H3.8V7.33L5.91,6.67L2,22H3.8L6.67,13.89L9,17V22H10.8V15.59L8.31,11.05L9.04,8.18L10.12,10H15V8.2H11.38L9.38,4.87C9.08,4.37 8.54,4.03 7.92,4.03Z";case"occupancy":case"presence":return r?z:T;case"opening":return r?"M3,3V21H21V3":"M3,3H21V21H3V3M5,5V19H19V5H5Z";case"running":return r?"M18,18H6V6H18V18Z":"M8,5.14V19.14L19,12.14L8,5.14Z";case"sound":return r?"M4.27 3L3 4.27L12 13.27V13.55C11.41 13.21 10.73 13 10 13C7.79 13 6 14.79 6 17S7.79 21 10 21 14 19.21 14 17V15.27L19.73 21L21 19.73L4.27 3M14 7H18V3H12V8.18L14 10.18Z":"M12 3V13.55C11.41 13.21 10.73 13 10 13C7.79 13 6 14.79 6 17S7.79 21 10 21 14 19.21 14 17V7H18V3H12Z";case"update":return r?"M5.12,5H18.87L17.93,4H5.93L5.12,5M20.54,5.23C20.83,5.57 21,6 21,6.5V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V6.5C3,6 3.17,5.57 3.46,5.23L4.84,3.55C5.12,3.21 5.53,3 6,3H18C18.47,3 18.88,3.21 19.15,3.55L20.54,5.23M6,18H12V15H6V18Z":"M20.54,5.23C20.83,5.57 21,6 21,6.5V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V6.5C3,6 3.17,5.57 3.46,5.23L4.84,3.55C5.12,3.21 5.53,3 6,3H18C18.47,3 18.88,3.21 19.15,3.55L20.54,5.23M5.12,5H18.87L17.93,4H5.93L5.12,5M12,9.5L6.5,15H10V17H14V15H17.5L12,9.5Z";case"vibration":return r?"M17,19H7V5H17M17,3H7A2,2 0 0,0 5,5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V5C19,3.89 18.1,3 17,3Z":"M16,19H8V5H16M16.5,3H7.5A1.5,1.5 0 0,0 6,4.5V19.5A1.5,1.5 0 0,0 7.5,21H16.5A1.5,1.5 0 0,0 18,19.5V4.5A1.5,1.5 0 0,0 16.5,3M19,17H21V7H19M22,9V15H24V9M3,17H5V7H3M0,15H2V9H0V15Z";case"window":return r?"M6,11H10V9H14V11H18V4H6V11M18,13H6V20H18V13M6,2H18A2,2 0 0,1 20,4V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2Z":"M6,8H10V6H14V8H18V4H6V8M18,10H6V15H18V10M6,20H18V17H6V20M6,2H18A2,2 0 0,1 20,4V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2Z";default:return r?"M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z":"M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"}}(n,t);case"button":switch(null==t?void 0:t.attributes.device_class){case"restart":return"M12,4C14.1,4 16.1,4.8 17.6,6.3C20.7,9.4 20.7,14.5 17.6,17.6C15.8,19.5 13.3,20.2 10.9,19.9L11.4,17.9C13.1,18.1 14.9,17.5 16.2,16.2C18.5,13.9 18.5,10.1 16.2,7.7C15.1,6.6 13.5,6 12,6V10.6L7,5.6L12,0.6V4M6.3,17.6C3.7,15 3.3,11 5.1,7.9L6.6,9.4C5.5,11.6 5.9,14.4 7.8,16.2C8.3,16.7 8.9,17.1 9.6,17.4L9,19.4C8,19 7.1,18.4 6.3,17.6Z";case"update":return"M20.54,5.23C20.83,5.57 21,6 21,6.5V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V6.5C3,6 3.17,5.57 3.46,5.23L4.84,3.55C5.12,3.21 5.53,3 6,3H18C18.47,3 18.88,3.21 19.15,3.55L20.54,5.23M5.12,5H18.87L17.93,4H5.93L5.12,5M12,9.5L6.5,15H10V17H14V15H17.5L12,9.5Z";default:return"M13 5C15.21 5 17 6.79 17 9C17 10.5 16.2 11.77 15 12.46V11.24C15.61 10.69 16 9.89 16 9C16 7.34 14.66 6 13 6S10 7.34 10 9C10 9.89 10.39 10.69 11 11.24V12.46C9.8 11.77 9 10.5 9 9C9 6.79 10.79 5 13 5M20 20.5C19.97 21.32 19.32 21.97 18.5 22H13C12.62 22 12.26 21.85 12 21.57L8 17.37L8.74 16.6C8.93 16.39 9.2 16.28 9.5 16.28H9.7L12 18V9C12 8.45 12.45 8 13 8S14 8.45 14 9V13.47L15.21 13.6L19.15 15.79C19.68 16.03 20 16.56 20 17.14V20.5M20 2H4C2.9 2 2 2.9 2 4V12C2 13.11 2.9 14 4 14H8V12L4 12L4 4H20L20 12H18V14H20V13.96L20.04 14C21.13 14 22 13.09 22 12V4C22 2.9 21.11 2 20 2Z"}case"cover":return function(e,t){var r="closed"!==e;switch(null==t?void 0:t.attributes.device_class){case"garage":switch(e){case"opening":return L;case"closing":return R;case"closed":return"M19,20H17V11H7V20H5V9L12,5L19,9V20M8,12H16V14H8V12M8,15H16V17H8V15M16,18V20H8V18H16Z";default:return"M19,20H17V11H7V20H5V9L12,5L19,9V20M8,12H16V14H8V12Z"}case"gate":switch(e){case"opening":case"closing":return"M15 6V11H13V7H11V11H9V9H7V21H9V19H11V21H12.09C12.03 20.67 12 20.34 12 20C12 18.82 12.35 17.67 13 16.69V13H15V14.81C15.62 14.45 16.3 14.21 17 14.09V13H19V14.09C19.7 14.21 20.38 14.45 21 14.81V13H22V11H21V6H19V11H17V6H15M9 13H11V17H9V13M19 17V19H15V21H19V23L22 20L19 17Z";case"closed":return"M9 6V11H7V7H5V11H3V9H1V21H3V19H5V21H7V19H9V21H11V19H13V21H15V19H17V21H19V19H21V21H23V9H21V11H19V7H17V11H15V6H13V11H11V6H9M3 13H5V17H3V13M7 13H9V17H7V13M11 13H13V17H11V13M15 13H17V17H15V13M19 13H21V17H19V13Z";default:return"M7 21V7H5V11H3V9H1V21H3V19H5V21H7M3 17V13H5V17H3M21 9V11H19V7H17V21H19V19H21V21H23V9H21M21 17H19V13H21V17Z"}case"door":return r?"M12,3C10.89,3 10,3.89 10,5H3V19H2V21H22V19H21V5C21,3.89 20.11,3 19,3H12M12,5H19V19H12V5M5,11H7V13H5V11Z":"M16,11H18V13H16V11M12,3H19C20.11,3 21,3.89 21,5V19H22V21H2V19H10V5C10,3.89 10.89,3 12,3M12,5V19H19V5H12Z";case"damper":return r?"M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z":"M12 5C15.87 5 19 8.13 19 12C19 15.87 15.87 19 12 19C8.13 19 5 15.87 5 12C5 8.13 8.13 5 12 5M12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12C2 6.5 6.5 2 12 2M12 4C7.58 4 4 7.58 4 12C4 16.42 7.58 20 12 20C16.42 20 20 16.42 20 12C20 7.58 16.42 4 12 4Z";case"shutter":switch(e){case"opening":return L;case"closing":return R;case"closed":return"M3 4H21V8H19V20H17V8H7V20H5V8H3V4M8 9H16V11H8V9M8 12H16V14H8V12M8 15H16V17H8V15M8 18H16V20H8V18Z";default:return"M3 4H21V8H19V20H17V8H7V20H5V8H3V4M8 9H16V11H8V9Z"}case"curtain":switch(e){case"opening":return"M18,16V13H15V22H13V2H15V11H18V8L22,12L18,16M2,12L6,16V13H9V22H11V2H9V11H6V8L2,12Z";case"closing":return B;case"closed":return"M23 3H1V1H23V3M2 22H11V4H2V22M22 4H13V22H22V4Z";default:return"M23 3H1V1H23V3M2 22H6C6 19 4 17 4 17C10 13 11 4 11 4H2V22M22 4H13C13 4 14 13 20 17C20 17 18 19 18 22H22V4Z"}case"blind":case"shade":switch(e){case"opening":return L;case"closing":return R;case"closed":return"M3,2H21A1,1 0 0,1 22,3V5A1,1 0 0,1 21,6H20V13A1,1 0 0,1 19,14H13V16.17C14.17,16.58 15,17.69 15,19A3,3 0 0,1 12,22A3,3 0 0,1 9,19C9,17.69 9.83,16.58 11,16.17V14H5A1,1 0 0,1 4,13V6H3A1,1 0 0,1 2,5V3A1,1 0 0,1 3,2M12,18A1,1 0 0,0 11,19A1,1 0 0,0 12,20A1,1 0 0,0 13,19A1,1 0 0,0 12,18Z";default:return"M3 2H21C21.55 2 22 2.45 22 3V5C22 5.55 21.55 6 21 6H20V7C20 7.55 19.55 8 19 8H13V10.17C14.17 10.58 15 11.7 15 13C15 14.66 13.66 16 12 16C10.34 16 9 14.66 9 13C9 11.69 9.84 10.58 11 10.17V8H5C4.45 8 4 7.55 4 7V6H3C2.45 6 2 5.55 2 5V3C2 2.45 2.45 2 3 2M12 12C11.45 12 11 12.45 11 13C11 13.55 11.45 14 12 14C12.55 14 13 13.55 13 13C13 12.45 12.55 12 12 12Z"}case"window":switch(e){case"opening":return L;case"closing":return R;case"closed":return F;default:return I}}switch(e){case"opening":return L;case"closing":return R;case"closed":return F;default:return I}}(n,t);case"device_tracker":return"router"===(null==t?void 0:t.attributes.source_type)?"home"===n?"M4,1C2.89,1 2,1.89 2,3V7C2,8.11 2.89,9 4,9H1V11H13V9H10C11.11,9 12,8.11 12,7V3C12,1.89 11.11,1 10,1H4M4,3H10V7H4V3M3,13V18L3,20H10V18H5V13H3M14,13C12.89,13 12,13.89 12,15V19C12,20.11 12.89,21 14,21H11V23H23V21H20C21.11,21 22,20.11 22,19V15C22,13.89 21.11,13 20,13H14M14,15H20V19H14V15Z":"M4,1C2.89,1 2,1.89 2,3V7C2,8.11 2.89,9 4,9H1V11H13V9H10C11.11,9 12,8.11 12,7V3C12,1.89 11.11,1 10,1H4M4,3H10V7H4V3M14,13C12.89,13 12,13.89 12,15V19C12,20.11 12.89,21 14,21H11V23H23V21H20C21.11,21 22,20.11 22,19V15C22,13.89 21.11,13 20,13H14M3.88,13.46L2.46,14.88L4.59,17L2.46,19.12L3.88,20.54L6,18.41L8.12,20.54L9.54,19.12L7.41,17L9.54,14.88L8.12,13.46L6,15.59L3.88,13.46M14,15H20V19H14V15Z":["bluetooth","bluetooth_le"].includes(null==t?void 0:t.attributes.source_type)?"home"===n?"M19,10L17,12L19,14L21,12M14.88,16.29L13,18.17V14.41M13,5.83L14.88,7.71L13,9.58M17.71,7.71L12,2H11V9.58L6.41,5L5,6.41L10.59,12L5,17.58L6.41,19L11,14.41V22H12L17.71,16.29L13.41,12M7,12L5,10L3,12L5,14L7,12Z":"M14.88,16.29L13,18.17V14.41M13,5.83L14.88,7.71L13,9.58M17.71,7.71L12,2H11V9.58L6.41,5L5,6.41L10.59,12L5,17.58L6.41,19L11,14.41V22H12L17.71,16.29L13.41,12L17.71,7.71Z":"not_home"===n?"M6 8C6 5.79 7.79 4 10 4S14 5.79 14 8 12.21 12 10 12 6 10.21 6 8M10 14C5.58 14 2 15.79 2 18V20H13.09C13.04 19.67 13 19.34 13 19C13 17.36 13.66 15.87 14.74 14.78C13.41 14.29 11.78 14 10 14M23 19L20 16V18H16V20H20V22L23 19Z":"M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z";case"humidifier":return r&&"off"===r?"M22.1 21.5L2.4 1.7L1.1 3L3.8 5.7C3.3 6.3 3 7.1 3 8V22H18V19.9L20.8 22.7L22.1 21.5M9.6 11.5L12.4 14.3C12.1 14.7 11.6 15 11 15C9.9 15 9 14.1 9 13C9 12.4 9.3 11.9 9.6 11.5M16 17.9V20H5V8C5 7.7 5.1 7.4 5.2 7.1L8.2 10.1C7.5 10.8 7 11.9 7 13C7 15.2 8.8 17 11 17C12.1 17 13.2 16.5 13.9 15.8L16 17.9M17 13.8C17.1 12.5 19 10.5 19 10.5S21 12.7 21 14C21 15 20.2 15.9 19.2 16L17 13.8M9.2 6L7.2 4H14C16.2 4 18 5.8 18 8V9H16V8C16 6.9 15.1 6 14 6H9.2Z":"M11 9C8.79 9 7 10.79 7 13S8.79 17 11 17 15 15.21 15 13 13.21 9 11 9M11 15C9.9 15 9 14.11 9 13S9.9 11 11 11 13 11.9 13 13 12.11 15 11 15M7 4H14C16.21 4 18 5.79 18 8V9H16V8C16 6.9 15.11 6 14 6H7C5.9 6 5 6.9 5 8V20H16V18H18V22H3V8C3 5.79 4.79 4 7 4M19 10.5C19 10.5 21 12.67 21 14C21 15.1 20.1 16 19 16S17 15.1 17 14C17 12.67 19 10.5 19 10.5";case"input_boolean":return"on"===n?"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M12 20C7.59 20 4 16.41 4 12S7.59 4 12 4 20 7.59 20 12 16.41 20 12 20M16.59 7.58L10 14.17L7.41 11.59L6 13L10 17L18 9L16.59 7.58Z":"M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2C6.47,2 2,6.47 2,12C2,17.53 6.47,22 12,22C17.53,22 22,17.53 22,12C22,6.47 17.53,2 12,2M14.59,8L12,10.59L9.41,8L8,9.41L10.59,12L8,14.59L9.41,16L12,13.41L14.59,16L16,14.59L13.41,12L16,9.41L14.59,8Z";case"lock":switch(n){case"unlocked":return"M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V10A2,2 0 0,1 6,8H15V6A3,3 0 0,0 12,3A3,3 0 0,0 9,6H7A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,17A2,2 0 0,0 14,15A2,2 0 0,0 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17Z";case"jammed":return"M10 17C11.1 17 12 16.1 12 15C12 13.9 11.1 13 10 13C8.9 13 8 13.9 8 15S8.9 17 10 17M16 8C17.1 8 18 8.9 18 10V20C18 21.1 17.1 22 16 22H4C2.9 22 2 21.1 2 20V10C2 8.9 2.9 8 4 8H5V6C5 3.2 7.2 1 10 1S15 3.2 15 6V8H16M10 3C8.3 3 7 4.3 7 6V8H13V6C13 4.3 11.7 3 10 3M22 13H20V7H22V13M22 17H20V15H22V17Z";case"locking":case"unlocking":return"M8.5,2C6,2 4,4 4,6.5V7C2.89,7 2,7.89 2,9V18C2,19.11 2.89,20 4,20H8.72C10.18,21.29 12.06,22 14,22A8,8 0 0,0 22,14A8,8 0 0,0 14,6C13.66,6 13.32,6.03 13,6.08C12.76,3.77 10.82,2 8.5,2M8.5,4A2.5,2.5 0 0,1 11,6.5V7H6V6.5A2.5,2.5 0 0,1 8.5,4M14,8A6,6 0 0,1 20,14A6,6 0 0,1 14,20A6,6 0 0,1 8,14A6,6 0 0,1 14,8M13,10V15L16.64,17.19L17.42,15.9L14.5,14.15V10H13Z";default:return"M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z"}case"media_player":return"playing"===n?"M21,3H3C1.89,3 1,3.89 1,5V8H3V5H21V19H14V21H21A2,2 0 0,0 23,19V5C23,3.89 22.1,3 21,3M1,10V12A9,9 0 0,1 10,21H12C12,14.92 7.07,10 1,10M19,7H5V8.63C8.96,9.91 12.09,13.04 13.37,17H19M1,14V16A5,5 0 0,1 6,21H8A7,7 0 0,0 1,14M1,18V21H4A3,3 0 0,0 1,18Z":"M1,10V12A9,9 0 0,1 10,21H12C12,14.92 7.07,10 1,10M1,14V16A5,5 0 0,1 6,21H8A7,7 0 0,0 1,14M1,18V21H4A3,3 0 0,0 1,18M21,3H3C1.89,3 1,3.89 1,5V8H3V5H21V19H14V21H21A2,2 0 0,0 23,19V5C23,3.89 22.1,3 21,3Z";case"switch":switch(null==t?void 0:t.attributes.device_class){case"outlet":return"on"===n?"M16,7V3H14V7H10V3H8V7H8C7,7 6,8 6,9V14.5L9.5,18V21H14.5V18L18,14.5V9C18,8 17,7 16,7Z":"M20.84 22.73L15.31 17.2L14.5 18V21H9.5V18L6 14.5V9C6 8.7 6.1 8.41 6.25 8.14L1.11 3L2.39 1.73L22.11 21.46L20.84 22.73M18 14.5V9C18 8 17 7 16 7V3H14V7H10.2L17.85 14.65L18 14.5M10 3H8V4.8L10 6.8V3Z";case"switch":return"on"===n?"M17,7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7M17,15A3,3 0 0,1 14,12A3,3 0 0,1 17,9A3,3 0 0,1 20,12A3,3 0 0,1 17,15Z":"M17,7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7M7,15A3,3 0 0,1 4,12A3,3 0 0,1 7,9A3,3 0 0,1 10,12A3,3 0 0,1 7,15Z";default:return"M7,2V13H10V22L17,10H13L17,2H7Z"}case"zwave":switch(n){case"dead":return"M12,2C6.47,2 2,6.47 2,12C2,17.53 6.47,22 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2M6.76,8.82L7.82,7.76L8.88,8.82L9.94,7.76L11,8.82L9.94,9.88L11,10.94L9.94,12L8.88,10.94L7.82,12L6.76,10.94L7.82,9.88L6.76,8.82M6.89,17.5C7.69,15.46 9.67,14 12,14C14.33,14 16.31,15.46 17.11,17.5H6.89M17.24,10.94L16.18,12L15.12,10.94L14.06,12L13,10.94L14.06,9.88L13,8.82L14.06,7.76L15.12,8.82L16.18,7.76L17.24,8.82L16.18,9.88L17.24,10.94Z";case"sleeping":return"M23,12H17V10L20.39,6H17V4H23V6L19.62,10H23V12M15,16H9V14L12.39,10H9V8H15V10L11.62,14H15V16M7,20H1V18L4.39,14H1V12H7V14L3.62,18H7V20Z";case"initializing":return"M6,2H18V8H18V8L14,12L18,16V16H18V22H6V16H6V16L10,12L6,8V8H6V2M16,16.5L12,12.5L8,16.5V20H16V16.5M12,11.5L16,7.5V4H8V7.5L12,11.5M10,6H14V6.75L12,8.75L10,6.75V6Z";default:return"M16.3,10.58C13.14,10.58 10.6,13.13 10.6,16.28C10.6,19.43 13.15,22 16.3,22C19.45,22 22,19.43 22,16.28C22,13.13 19.45,10.58 16.3,10.58M18,19.08H13.19L15.81,15H13.31L14.4,13.23H19.18L16.63,17.28H19.18L18,19.08M16.3,3.93V2C8.41,2 2,8.42 2,16.31H3.92C3.94,9.46 9.5,3.93 16.3,3.93M16.3,7.74V5.82C10.5,5.82 5.81,10.53 5.81,16.31H7.73C7.75,11.58 11.59,7.74 16.3,7.74"}case"sensor":var i=q(t);if(i)return i;break;case"input_datetime":if(null==t||!t.attributes.has_date)return"M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M16.2,16.2L11,13V7H12.5V12.2L17,14.9L16.2,16.2Z";if(!t.attributes.has_time)return"M19,19H5V8H19M16,1V3H8V1H6V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3H18V1M17,12H12V17H17V12Z";break;case"sun":return"above_horizon"===(null==t?void 0:t.state)?S[e]:"M17.75,4.09L15.22,6.03L16.13,9.09L13.5,7.28L10.87,9.09L11.78,6.03L9.25,4.09L12.44,4L13.5,1L14.56,4L17.75,4.09M21.25,11L19.61,12.25L20.2,14.23L18.5,13.06L16.8,14.23L17.39,12.25L15.75,11L17.81,10.95L18.5,9L19.19,10.95L21.25,11M18.97,15.95C19.8,15.87 20.69,17.05 20.16,17.8C19.84,18.25 19.5,18.67 19.08,19.07C15.17,23 8.84,23 4.94,19.07C1.03,15.17 1.03,8.83 4.94,4.93C5.34,4.53 5.76,4.17 6.21,3.85C6.96,3.32 8.14,4.21 8.06,5.04C7.79,7.9 8.75,10.87 10.95,13.06C13.14,15.26 16.1,16.22 18.97,15.95M17.33,17.97C14.5,17.81 11.7,16.64 9.53,14.5C7.36,12.31 6.2,9.5 6.04,6.68C3.23,9.82 3.34,14.64 6.35,17.66C9.37,20.67 14.19,20.78 17.33,17.97Z"}return e in S?S[e]:(console.warn("Unable to find icon for domain ".concat(e)),O)};function Y(e){return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Y(e)}function K(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function X(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function G(e,t){return G=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},G(e,t)}function Q(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=te(e);if(t){var i=te(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return J(this,r)}}function J(e,t){if(t&&("object"===Y(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ee(e)}function ee(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function te(e){return te=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},te(e)}function re(){re=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!oe(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r"])),this.icon||(null===(t=this.state)||void 0===t?void 0:t.attributes.icon)):(0,i.dy)(y||(y=K([""])),(r=this.state)?W((0,c.M)(r.entity_id),r):O)}}]}}),i.oi);function he(e){return he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},he(e)}function me(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ye(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ve(e,t){return ve=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ve(e,t)}function be(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=je(e);if(t){var i=je(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ge(this,r)}}function ge(e,t){if(t&&("object"===he(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return we(e)}function we(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ke(){ke=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Pe(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n =0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n ',"\n "])),!!e.entity_id,e.state?(0,i.dy)(Te||(Te=Xe(['=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n \n \n \n ',"\n
']))),this.icon,this.invalid,this.value?(0,u.dy)(a||(a=D(["=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n "],i||(i=r.slice(0)),f=Object.freeze(Object.defineProperties(r,{raw:{value:Object.freeze(i)}}))),this.hass,e,this._entityPicked,H)}},{kind:"method",key:"_entityPicked",value:function(e){e.stopPropagation(),(0,a.B)(this,"value-changed",{value:{service:"scene.turn_on",target:{entity_id:e.detail.value},metadata:{}}})}}]}}),n.oi);function M(e){return void 0===e||Array.isArray(e)?e:[e]}var L,R,F;r(93017);function I(e){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I(e)}function B(e){return function(e){if(Array.isArray(e))return ne(e)}(e)||ie(e)||re(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Z(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function U(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function N(e,t){return N=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},N(e,t)}function $(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Y(e);if(t){var i=Y(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return q(this,r)}}function q(e,t){if(t&&("object"===I(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return W(e)}function W(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Y(e){return Y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Y(e)}function K(){K=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Q(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n
\n \n
\n

\n ',":\n

\n

\n ",":\n

\n \n

\n ",":\n

\n \n
\n "])),r,e._removeOption,e.hass.localize("ui.panel.config.automation.editor.actions.type.choose.remove_option"),"M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",e.hass.localize("ui.panel.config.automation.editor.actions.type.choose.option","number",r+1),e.hass.localize("ui.panel.config.automation.editor.actions.type.choose.conditions"),t.conditions,e.hass,r,e._conditionChanged,e.hass.localize("ui.panel.config.automation.editor.actions.type.choose.sequence"),e.hass,[{name:"sequence",selector:{action:{}}}],t,r,e._actionChanged)})),this._addOption,this.hass.localize("ui.panel.config.automation.editor.actions.type.choose.add_option"),this.hass.localize("ui.panel.config.automation.editor.actions.type.choose.default"),t.default||[],this._defaultChanged,this.hass)}},{kind:"method",key:"_conditionChanged",value:function(e){e.stopPropagation();var t=e.detail.value,r=e.target.idx,n=this.action.choose?B(M(this.action.choose)):[];n[r].conditions=t,(0,a.B)(this,"value-changed",{value:Object.assign({},this.action,{choose:n})})}},{kind:"method",key:"_actionChanged",value:function(e){e.stopPropagation();var t=e.detail.value.sequence,r=e.target.idx,n=this.action.choose?B(M(this.action.choose)):[];n[r].sequence=t,(0,a.B)(this,"value-changed",{value:Object.assign({},this.action,{choose:n})})}},{kind:"method",key:"_addOption",value:function(){var e=this.action.choose?B(M(this.action.choose)):[];e.push({conditions:[],sequence:[]}),(0,a.B)(this,"value-changed",{value:Object.assign({},this.action,{choose:e})})}},{kind:"method",key:"_removeOption",value:function(e){var t=e.currentTarget.idx,r=this.action.choose?B(M(this.action.choose)):[];r.splice(t,1),(0,a.B)(this,"value-changed",{value:Object.assign({},this.action,{choose:r})})}},{kind:"method",key:"_defaultChanged",value:function(e){e.stopPropagation();var t=e.detail.value;(0,a.B)(this,"value-changed",{value:Object.assign({},this.action,{default:t})})}},{kind:"get",static:!0,key:"styles",value:function(){return[g.Qx,(0,n.iv)(F||(F=Z(["\n ha-card {\n margin-top: 16px;\n }\n .add-card mwc-button {\n display: block;\n text-align: center;\n }\n ha-icon-button {\n position: absolute;\n right: 0;\n padding: 4px;\n }\n "])))]}}]}}),n.oi),r(44764);function de(e){return de="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},de(e)}function fe(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function pe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function he(e,t){return he=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},he(e,t)}function me(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=be(e);if(t){var i=be(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ye(this,r)}}function ye(e,t){if(t&&("object"===de(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ve(e)}function ve(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function be(e){return be=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},be(e)}function ge(){ge=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Ee(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n
\n
\n \n \n \n ',"\n \n \n
\n ","\n \n
\n \n "])),this._handleAction,this.hass.localize("ui.common.menu"),"M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",this._yamlMode?this.hass.localize("ui.panel.config.automation.editor.edit_ui"):this.hass.localize("ui.panel.config.automation.editor.edit_yaml"),this.hass.localize("ui.panel.config.automation.editor.actions.duplicate"),this.hass.localize("ui.panel.config.automation.editor.actions.delete"),this._warnings?(0,n.dy)(se||(se=fe(['","subtype",t.subtype?e.localize("component.".concat(t.domain,".device_automation.condition_subtype.").concat(t.subtype))||t.subtype:"")||(t.subtype?'"'.concat(t.subtype,'" ').concat(t.type):t.type)},$e=function(e,t){var r=t.entity_id?e.states[t.entity_id]:void 0;return e.localize("component.".concat(t.domain,".device_automation.trigger_type.").concat(t.type),"entity_name",r?(0,Se.C)(r):t.entity_id||"","subtype",t.subtype?e.localize("component.".concat(t.domain,".device_automation.trigger_subtype.").concat(t.subtype))||t.subtype:"")||(t.subtype?'"'.concat(t.subtype,'" ').concat(t.type):t.type)};function qe(e){return qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qe(e)}function We(e,t){return ut(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(c){s=!0,i=c}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(e,t)||ct(e,t)||st()}function Ye(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,i)}function Ke(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Xe(e,t){return Xe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Xe(e,t)}function Ge(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ft(e);if(t){var i=ft(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Qe(this,r)}}function Qe(e,t){if(t&&("object"===qe(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Je(e)}function Je(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function et(){et=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!nt(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n ","\n ","\n ","\n \n "])),this.label,t,this._automationChanged,0===this._automations.length,t===pt?(0,n.dy)(Te||(Te=Ke(["\n ","\n "])),pt,this.NO_AUTOMATION_TEXT):"",t===ht?(0,n.dy)(ze||(ze=Ke(["\n ","\n "])),ht,this.UNKNOWN_AUTOMATION_TEXT):"",this._automations.map((function(t,r){return(0,n.dy)(Ve||(Ve=Ke(["\n \n ","\n \n "])),"".concat(t.device_id,"_").concat(r),e._localizeDeviceAutomation(e.hass,t))})))}},{kind:"method",key:"updated",value:function(e){dt(ft(s.prototype),"updated",this).call(this,e),e.has("deviceId")&&this._updateDeviceInfo()}},{kind:"method",key:"_updateDeviceInfo",value:(r=regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.deviceId){e.next=6;break}return e.next=3,this._fetchDeviceAutomations(this.hass,this.deviceId);case 3:e.t0=e.sent,e.next=7;break;case 6:e.t0=[];case 7:return this._automations=e.t0,this.value&&this.value.device_id===this.deviceId||this._setValue(this._automations.length?this._automations[0]:this._createNoAutomation(this.deviceId)),this._renderEmpty=!0,e.next=12,this.updateComplete;case 12:this._renderEmpty=!1;case 13:case"end":return e.stop()}}),e,this)})),o=function(){var e=this,t=arguments;return new Promise((function(n,i){var o=r.apply(e,t);function a(e){Ye(o,n,i,a,s,"next",e)}function s(e){Ye(o,n,i,a,s,"throw",e)}a(void 0)}))},function(){return o.apply(this,arguments)})},{kind:"method",key:"_automationChanged",value:function(e){var t=e.target.value;if(t&&![ht,pt].includes(t)){var r=We(t.split("_"),2),n=r[0],i=r[1],o=this._automations[i];o.device_id===n&&this._setValue(o)}}},{kind:"method",key:"_setValue",value:function(e){this.value&&Ze(e,this.value)||((0,a.B)(this,"change"),(0,a.B)(this,"value-changed",{value:e}))}},{kind:"get",static:!0,key:"styles",value:function(){return(0,n.iv)(He||(He=Ke(["\n mwc-select {\n width: 100%;\n margin-top: 4px;\n }\n "])))}}]}}),n.oi);function yt(e){return yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yt(e)}function vt(e,t){return vt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},vt(e,t)}function bt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=kt(e);if(t){var i=kt(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return gt(this,r)}}function gt(e,t){if(t&&("object"===yt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return wt(e)}function wt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kt(e){return kt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},kt(e)}function Et(){Et=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!At(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Nt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $t(e,t){return $t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},$t(e,t)}function qt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Kt(e);if(t){var i=Kt(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Wt(this,r)}}function Wt(e,t){if(t&&("object"===Zt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Yt(e)}function Yt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Kt(e){return Kt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Kt(e)}function Xt(){Xt=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Jt(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n ",'\n ',"\n"])),!!e.area,e.name,e.area)};!function(e,t,r,n){var i=Xt();if(n)for(var o=0;o=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n \n ","\n "])),t,this._devicePicked,this.hass,this.hass.localize("ui.panel.config.automation.editor.conditions.type.device.label"),this.condition,t,this._deviceConditionPicked,this.hass,this.hass.localize("ui.panel.config.automation.editor.conditions.type.device.condition"),null!==(e=this._capabilities)&&void 0!==e&&e.extra_fields?(0,n.dy)(sr||(sr=fr(["\n \n "])),this.hass,this._extraFieldsData(this.condition,this._capabilities),this._capabilities.extra_fields,this._extraFieldsComputeLabelCallback(this.hass.localize),this._extraFieldsChanged):"")}},{kind:"method",key:"firstUpdated",value:function(){this._capabilities||this._getCapabilities(),this.condition&&(this._origCondition=this.condition)}},{kind:"method",key:"updated",value:function(e){var t=e.get("condition");t&&!Ze(t,this.condition)&&this._getCapabilities()}},{kind:"method",key:"_getCapabilities",value:(r=regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=this.condition).domain){e.next=7;break}return e.next=4,Fe(this.hass,t);case 4:e.t0=e.sent,e.next=8;break;case 7:e.t0=void 0;case 8:this._capabilities=e.t0;case 9:case"end":return e.stop()}}),e,this)})),o=function(){var e=this,t=arguments;return new Promise((function(n,i){var o=r.apply(e,t);function a(e){dr(o,n,i,a,s,"next",e)}function s(e){dr(o,n,i,a,s,"throw",e)}a(void 0)}))},function(){return o.apply(this,arguments)})},{kind:"method",key:"_devicePicked",value:function(e){e.stopPropagation(),this._deviceId=e.target.value,void 0===this._deviceId&&(0,a.B)(this,"value-changed",{value:Object.assign({},c.defaultConfig,{condition:"device"})})}},{kind:"method",key:"_deviceConditionPicked",value:function(e){e.stopPropagation();var t=e.detail.value;this._origCondition&&Ze(this._origCondition,t)&&(t=this._origCondition),(0,a.B)(this,"value-changed",{value:t})}},{kind:"method",key:"_extraFieldsChanged",value:function(e){e.stopPropagation(),(0,a.B)(this,"value-changed",{value:Object.assign({},this.condition,e.detail.value)})}},{kind:"method",key:"_extraFieldsComputeLabelCallback",value:function(e){return function(t){return e("ui.panel.config.automation.editor.conditions.type.device.extra_fields.".concat(t.name))||t.name}}},{kind:"field",static:!0,key:"styles",value:function(){return(0,n.iv)(cr||(cr=fr(["\n ha-device-picker {\n display: block;\n margin-bottom: 24px;\n }\n "])))}}]}}),n.oi);function Tr(e){return Tr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tr(e)}function zr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Vr(e){return function(e){if(Array.isArray(e))return Kr(e)}(e)||Xr(e)||Yr(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Hr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mr(e,t){return Mr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Mr(e,t)}function Lr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ir(e);if(t){var i=Ir(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Rr(this,r)}}function Rr(e,t){if(t&&("object"===Tr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Fr(e)}function Fr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ir(e){return Ir=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ir(e)}function Br(){Br=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Nr(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n
\n =0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n "],t||(t=e.slice(0)),Qr=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))),this.hass,i,o,this._valueChanged,this._computeLabelCallback)}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();var t=e.detail.value;Object.keys(t).forEach((function(e){return void 0===t[e]||""===t[e]?delete t[e]:{}})),(0,a.B)(this,"value-changed",{value:t})}},{kind:"field",key:"_computeLabelCallback",value:function(){var e=this;return function(t){switch(t.name){case"entity_id":return e.hass.localize("ui.components.entity.entity-picker.entity");case"attribute":return e.hass.localize("ui.components.entity.entity-attribute-picker.attribute");case"for":return e.hass.localize("ui.panel.config.automation.editor.triggers.type.state.for");default:return e.hass.localize("ui.panel.config.automation.editor.conditions.type.state.".concat(t.name))}}}}]}}),n.oi);function kn(e){return kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kn(e)}function En(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cn(e,t){return Cn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Cn(e,t)}function Pn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=On(e);if(t){var i=On(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return An(this,r)}}function An(e,t){if(t&&("object"===kn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _n(e)}function _n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function On(e){return On=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},On(e)}function Sn(){Sn=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!xn(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n "],t||(t=e.slice(0)),bn=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))),this.condition.conditions||[],this._valueChanged,this.hass);var e,t}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation(),(0,a.B)(this,"value-changed",{value:Object.assign({},this.condition,{conditions:e.detail.value})})}}]}}),n.oi);function Ln(e){return Ln="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ln(e)}function Rn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fn(e,t){return Fn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Fn(e,t)}function In(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Un(e);if(t){var i=Un(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Bn(this,r)}}function Bn(e,t){if(t&&("object"===Ln(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Zn(e)}function Zn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Un(e){return Un=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Un(e)}function Nn(){Nn=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Wn(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n "],t||(t=e.slice(0)),pi=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))),this.hass,this.condition,r,this._valueChanged,this._computeLabelCallback)}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();var t=e.detail.value;(0,a.B)(this,"value-changed",{value:t})}},{kind:"field",key:"_computeLabelCallback",value:function(){var e=this;return function(t){switch(t.name){case"entity_id":return e.hass.localize("ui.components.entity.entity-picker.entity");case"attribute":return e.hass.localize("ui.components.entity.entity-attribute-picker.attribute");default:return e.hass.localize("ui.panel.config.automation.editor.triggers.type.numeric_state.".concat(t.name))}}}}]}}),n.oi);function Di(e){return Di="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Di(e)}function ji(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xi(e,t){return xi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},xi(e,t)}function Ti(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Hi(e);if(t){var i=Hi(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return zi(this,r)}}function zi(e,t){if(t&&("object"===Di(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Vi(e)}function Vi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hi(e){return Hi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Hi(e)}function Mi(){Mi=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Fi(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n "],t||(t=e.slice(0)),Ni=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))),r,this.condition,this.hass,this._computeLabelCallback,this._valueChanged)}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();var t=e.detail.value;(0,a.B)(this,"value-changed",{value:t})}},{kind:"field",key:"_computeLabelCallback",value:function(){var e=this;return function(t){return e.hass.localize("ui.panel.config.automation.editor.conditions.type.sun.".concat(t.name))}}}]}}),n.oi),r(53297);function co(e){return co="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},co(e)}function lo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function uo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fo(e,t){return fo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},fo(e,t)}function po(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=yo(e);if(t){var i=yo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ho(this,r)}}function ho(e,t){if(t&&("object"===co(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return mo(e)}function mo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yo(e){return yo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},yo(e)}function vo(){vo=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!wo(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n '])),this.hass.localize("ui.panel.config.automation.editor.conditions.type.template.value_template"),e,this._valueChanged)}},{kind:"method",key:"_valueChanged",value:function(e){Oe(this,e)}},{kind:"field",static:!0,key:"styles",value:function(){return(0,n.iv)(so||(so=lo(["\n ha-textarea {\n display: block;\n }\n "])))}}]}}),n.oi);function _o(e){return _o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_o(e)}function Oo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function So(e,t){return So=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},So(e,t)}function Do(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=To(e);if(t){var i=To(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return jo(this,r)}}function jo(e,t){if(t&&("object"===_o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return xo(e)}function xo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function To(e){return To=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},To(e)}function zo(){zo=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Mo(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n "],a||(a=o.slice(0)),Ao=Object.freeze(Object.defineProperties(o,{raw:{value:Object.freeze(a)}}))),this.hass,u,l,this._valueChanged,this._computeLabelCallback)}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();var t=e.detail.value,r="input"===t.mode_after,n="input"===t.mode_before;r!==this._inputModeAfter&&(this._inputModeAfter=r,t.after=void 0),n!==this._inputModeBefore&&(this._inputModeBefore=n,t.before=void 0),Object.keys(t).forEach((function(e){return void 0===t[e]||""===t[e]?delete t[e]:{}})),(0,a.B)(this,"value-changed",{value:t})}},{kind:"field",key:"_computeLabelCallback",value:function(){var e=this;return function(t){return e.hass.localize("ui.panel.config.automation.editor.conditions.type.time.".concat(t.name))}}}]}}),n.oi);function No(e){return No="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},No(e)}function $o(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function qo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wo(e,t){return Wo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Wo(e,t)}function Yo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=aa(e);if(t){var i=aa(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ko(this,r)}}function Ko(e,t){if(t&&("object"===No(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Xo(e)}function Xo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Go(){Go=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!ea(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n ","\n "])),this.hass.localize("ui.panel.config.automation.editor.conditions.type.trigger.id"),e,this._triggerPicked,this._triggers.map((function(e){return(0,n.dy)(Zo||(Zo=$o(["\n "," \n "])),e.id,e.id)}))):this.hass.localize("ui.panel.config.automation.editor.conditions.type.trigger.no_triggers")}},{kind:"method",key:"_automationUpdated",value:function(e){this._triggers=null!=e&&e.trigger?M(e.trigger).filter((function(e){return e.id})):[]}},{kind:"method",key:"_triggerPicked",value:function(e){if(e.stopPropagation(),e.target.value){var t=e.target.value;this.condition.id!==t&&(0,a.B)(this,"value-changed",{value:Object.assign({},this.condition,{id:t})})}}}]}}),n.oi);var sa,ca,la=r(22311),ua=function(e){return"latitude"in e.attributes&&"longitude"in e.attributes};function da(e){return da="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},da(e)}function fa(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function pa(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ha(e,t){return ha=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ha(e,t)}function ma(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ba(e);if(t){var i=ba(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ya(this,r)}}function ya(e,t){if(t&&("object"===da(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return va(e)}function va(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ba(e){return ba=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ba(e)}function ga(){ga=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Ea(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n \n ',"\n \n "])),this.hass.localize("ui.panel.config.automation.editor.conditions.type.zone.entity"),t,this._entityPicked,this.hass,Oa,this.hass.localize("ui.panel.config.automation.editor.conditions.type.zone.zone"),r,this._zonePicked,this.hass,Va,this.hass.localize("ui.panel.config.automation.editor.conditions.type.zone.event"))}},{kind:"method",key:"_entityPicked",value:function(e){e.stopPropagation(),(0,a.B)(this,"value-changed",{value:Object.assign({},this.condition,{entity_id:e.detail.value})})}},{kind:"method",key:"_zonePicked",value:function(e){e.stopPropagation(),(0,a.B)(this,"value-changed",{value:Object.assign({},this.condition,{zone:e.detail.value})})}},{kind:"field",static:!0,key:"styles",value:function(){return(0,n.iv)(ca||(ca=fa(["\n ha-entity-picker {\n display: block;\n margin-bottom: 24px;\n }\n "])))}}]}}),n.oi);function Ha(e){return Ha="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ha(e)}function Ma(e,t){return es(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(c){s=!0,i=c}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(e,t)||Qa(e,t)||Ga()}function La(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Ra(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fa(e,t){return Fa=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Fa(e,t)}function Ia(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ua(e);if(t){var i=Ua(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ba(this,r)}}function Ba(e,t){if(t&&("object"===Ha(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Za(e)}function Za(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ua(e){return Ua=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ua(e)}function Na(){Na=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Wa(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n ","\n \n \n "])),-1===e?(0,n.dy)(ja||(ja=La(["\n ","\n "])),this.hass.localize("ui.panel.config.automation.editor.conditions.unsupported_condition","condition",this.condition.condition)):"",this.hass.localize("ui.panel.config.automation.editor.edit_yaml"),this.hass,this.condition,this._onYamlChange):(0,n.dy)(xa||(xa=La(["\n \n ","\n \n\n
\n ","\n
\n "])),this.hass.localize("ui.panel.config.automation.editor.conditions.type_select"),this.condition.condition,this._typeChanged,this._processedTypes(this.hass.localize).map((function(e){var t=Ma(e,2),r=t[0],i=t[1];return(0,n.dy)(Ta||(Ta=La(["\n ","\n "])),r,i)})),(0,o.h)("ha-automation-condition-".concat(this.condition.condition),{hass:this.hass,condition:this.condition})))}},{kind:"method",key:"_typeChanged",value:function(e){var t=e.target.value;if(t){var r=customElements.get("ha-automation-condition-".concat(t));t!==this.condition.condition&&(0,a.B)(this,"value-changed",{value:Object.assign({condition:t},r.defaultConfig)})}}},{kind:"method",key:"_onYamlChange",value:function(e){e.stopPropagation(),e.detail.isValid&&(0,a.B)(this,"value-changed",{value:e.detail.value,yaml:!0})}},{kind:"field",static:!0,key:"styles",value:function(){return[g.Qx,(0,n.iv)(za||(za=La(["\n mwc-select {\n margin-bottom: 24px;\n }\n "])))]}}]}}),n.oi);function ns(e){return ns="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ns(e)}function is(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function os(e,t){return os=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},os(e,t)}function as(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ls(e);if(t){var i=ls(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ss(this,r)}}function ss(e,t){if(t&&("object"===ns(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return cs(e)}function cs(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ls(e){return ls=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ls(e)}function us(){us=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!ps(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n "],t||(t=e.slice(0)),ts=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))),this.action,this.hass,this._conditionChanged);var e,t}},{kind:"method",key:"_conditionChanged",value:function(e){e.stopPropagation(),(0,a.B)(this,"value-changed",{value:e.detail.value})}}]}}),n.oi);function bs(e){return bs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bs(e)}var gs,ws=new RegExp("{%|{{"),ks=function e(t){return!!t&&("string"==typeof t?function(e){return ws.test(e)}(t):"object"===bs(t)&&(Array.isArray(t)?t:Object.values(t)).some((function(t){return t&&e(t)})))};r(47289);function Es(e){return Es="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Es(e)}function Cs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ps(e,t){return Ps=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ps(e,t)}function As(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ss(e);if(t){var i=Ss(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return _s(this,r)}}function _s(e,t){if(t&&("object"===Es(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Os(e)}function Os(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ss(e){return Ss=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ss(e)}function Ds(){Ds=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Ts(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r"],t||(t=e.slice(0)),gs=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))),this.hass.localize("ui.panel.config.automation.editor.actions.type.delay.delay"),this._timeData,this._valueChanged);var e,t}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();var t=e.detail.value;t&&(0,a.B)(this,"value-changed",{value:Object.assign({},this.action,{delay:t})})}}]}}),n.oi);function Ls(e){return Ls="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ls(e)}function Rs(e,t){return Rs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Rs(e,t)}function Fs(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Zs(e);if(t){var i=Zs(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Is(this,r)}}function Is(e,t){if(t&&("object"===Ls(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Bs(e)}function Bs(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Zs(e){return Zs=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Zs(e)}function Us(){Us=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!qs(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n \n ","\n "])),t,this._devicePicked,this.hass,this.hass.localize("ui.panel.config.automation.editor.actions.type.device_id.label"),this.action,t,this._deviceActionPicked,this.hass,this.hass.localize("ui.panel.config.automation.editor.actions.type.device_id.action"),null!==(e=this._capabilities)&&void 0!==e&&e.extra_fields?(0,n.dy)(Qs||(Qs=rc(["\n \n "])),this.hass,this._extraFieldsData(this.action,this._capabilities),this._capabilities.extra_fields,this._extraFieldsComputeLabelCallback(this.hass.localize),this._extraFieldsChanged):"")}},{kind:"method",key:"firstUpdated",value:function(){this._capabilities||this._getCapabilities(),this.action&&(this._origAction=this.action)}},{kind:"method",key:"updated",value:function(e){var t=e.get("action");t&&!Ze(t,this.action)&&(this._deviceId=void 0,this._getCapabilities())}},{kind:"method",key:"_getCapabilities",value:(r=regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.action.domain){e.next=6;break}return e.next=3,t=this.hass,r=this.action,t.callWS({type:"device_automation/action/capabilities",action:r});case 3:e.t0=e.sent,e.next=7;break;case 6:e.t0=void 0;case 7:this._capabilities=e.t0;case 8:case"end":return e.stop()}var t,r}),e,this)})),o=function(){var e=this,t=arguments;return new Promise((function(n,i){var o=r.apply(e,t);function a(e){tc(o,n,i,a,s,"next",e)}function s(e){tc(o,n,i,a,s,"throw",e)}a(void 0)}))},function(){return o.apply(this,arguments)})},{kind:"method",key:"_devicePicked",value:function(e){e.stopPropagation(),this._deviceId=e.target.value,void 0===this._deviceId&&(0,a.B)(this,"value-changed",{value:c.defaultConfig})}},{kind:"method",key:"_deviceActionPicked",value:function(e){e.stopPropagation();var t=e.detail.value;this._origAction&&Ze(this._origAction,t)&&(t=this._origAction),(0,a.B)(this,"value-changed",{value:t})}},{kind:"method",key:"_extraFieldsChanged",value:function(e){e.stopPropagation(),(0,a.B)(this,"value-changed",{value:Object.assign({},this.action,e.detail.value)})}},{kind:"method",key:"_extraFieldsComputeLabelCallback",value:function(e){return function(t){return e("ui.panel.config.automation.editor.actions.type.device_id.extra_fields.".concat(t.name))||t.name}}},{kind:"field",static:!0,key:"styles",value:function(){return(0,n.iv)(Js||(Js=rc(["\n ha-device-picker {\n display: block;\n margin-bottom: 24px;\n }\n ha-device-action-picker {\n display: block;\n }\n "])))}}]}}),n.oi),wc=function(e,t,r){return e("component.".concat(t,".title"))||(null==r?void 0:r.name)||t},kc=function(e,t){return e.callWS({type:"manifest/get",integration:t})};function Ec(e){return Ec="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ec(e)}function Cc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pc(e,t){return Pc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Pc(e,t)}function Ac(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Sc(e);if(t){var i=Sc(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return _c(this,r)}}function _c(e,t){if(t&&("object"===Ec(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Oc(e)}function Oc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Sc(e){return Sc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Sc(e)}function Dc(){Dc=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Tc(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n ",'\n ',"\n"])),e.name,e.name===e.service?"":e.service)},Ic=function(e,t,r,n){var i=Dc();if(n)for(var o=0;o=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n \n "])),this.hass.localize("ui.panel.config.automation.editor.actions.type.event.event"),t,this._eventChanged,this.hass,this.hass.localize("ui.panel.config.automation.editor.actions.type.event.service_data"),"event_data",r,this._dataChanged)}},{kind:"method",key:"_dataChanged",value:function(e){e.stopPropagation(),e.detail.isValid&&(this._actionData=e.detail.value,pw(this,e))}},{kind:"method",key:"_eventChanged",value:function(e){e.stopPropagation(),(0,a.B)(this,"value-changed",{value:Object.assign({},this.action,{event:e.target.value})})}},{kind:"get",static:!0,key:"styles",value:function(){return(0,n.iv)(Zc||(Zc=Nc(["\n ha-textfield {\n display: block;\n }\n "])))}}]}}),n.oi);var ol,al,sl,cl,ll,ul,dl=r(8636),fl=r(22814),pl=r(46749);function hl(e){return hl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hl(e)}function ml(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function yl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vl(e,t){return vl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},vl(e,t)}function bl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=kl(e);if(t){var i=kl(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return gl(this,r)}}function gl(e,t){if(t&&("object"===hl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return wl(e)}function wl(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kl(e){return kl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},kl(e)}function El(){El=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Al(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n ",""])),this.hass,null===(r=this.value)||void 0===r?void 0:r.entity_id,this.label||this.hass.localize("ui.components.selectors.media.pick_media_player"),this.disabled,this._entityChanged,m?(0,n.dy)(sl||(sl=ml(["\n ','\n
\n
\n ',"\n
\n "])),this._pickMedia,this.disabled||null===(i=this.value)||void 0===i||!i.entity_id?"disabled":"",(0,dl.$)({portrait:!(null===(o=this.value)||void 0===o||null===(a=o.metadata)||void 0===a||!a.media_class)&&"portrait"===pl.Fn[this.value.metadata.children_media_class||this.value.metadata.media_class].thumbnail_ratio}),null!==(s=this.value)&&void 0!==s&&null!==(c=s.metadata)&&void 0!==c&&c.thumbnail?(0,n.dy)(cl||(cl=ml(['\n \n =0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n "],t||(t=e.slice(0)),jl=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))),this.hass,this._getSelectorValue(this.action),this._valueChanged);var e,t}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation(),(0,a.B)(this,"value-changed",{value:{service:"media_player.play_media",target:{entity_id:e.detail.value.entity_id},data:{media_content_id:e.detail.value.media_content_id,media_content_type:e.detail.value.media_content_type},metadata:e.detail.value.metadata||{}}})}}]}}),n.oi);function Jl(e){return Jl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jl(e)}function eu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tu(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ru(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nu(e,t){return nu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},nu(e,t)}function iu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=su(e);if(t){var i=su(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ou(this,r)}}function ou(e,t){if(t&&("object"===Jl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return au(e)}function au(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function su(e){return su=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},su(e)}function cu(){cu=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!du(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n ","\n \n ","\n ","\n ","\n

\n ",":\n

\n \n "])),this.hass.localize("ui.panel.config.automation.editor.actions.type.repeat.type_select"),r,this._typeChanged,_u.map((function(t){return(0,n.dy)(Yl||(Yl=tu(["\n \n ","\n \n "])),t,e.hass.localize("ui.panel.config.automation.editor.actions.type.repeat.type.".concat(t,".label")))})),"count"===r?(0,n.dy)(Kl||(Kl=tu(["\n =0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n

',"

\n ","\n
\n ","\n ",""])),this.hass,null===(r=this._value)||void 0===r?void 0:r.service,this._serviceChanged,null==l?void 0:l.description,this._manifest?(0,n.dy)(vu||(vu=Hu([" \n \n '])),this._manifest.is_built_in?(0,xu.R)(this.hass,"/integrations/".concat(this._manifest.domain)):this._manifest.documentation,this.hass.localize("ui.components.service-control.integration_doc"),"M15.07,11.25L14.17,12.17C13.45,12.89 13,13.5 13,15H11V14.5C11,13.39 11.45,12.39 12.17,11.67L13.41,10.41C13.78,10.05 14,9.55 14,9C14,7.89 13.1,7 12,7A2,2 0 0,0 10,9H8A4,4 0 0,1 12,5A4,4 0 0,1 16,9C16,9.88 15.64,10.67 15.07,11.25M13,19H11V17H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"):"",l&&"target"in l?(0,n.dy)(bu||(bu=Hu(["\n ",'\n ','\n ',""])),this.narrow,f?(0,n.dy)(gu||(gu=Hu(['
']))):"",this.hass.localize("ui.components.service-control.target"),this.hass.localize("ui.components.service-control.target_description"),this.hass,l.target?{target:l.target}:{target:{}},this._targetChanged,null===(i=this._value)||void 0===i?void 0:i.target):d?(0,n.dy)(wu||(wu=Hu([""])),this.hass,null===(o=this._value)||void 0===o||null===(a=o.data)||void 0===a?void 0:a.entity_id,d.description,this._entityPicked):"",u?(0,n.dy)(ku||(ku=Hu([""])),this.hass,this.hass.localize("ui.components.service-control.service_data"),"data",null===(s=this._value)||void 0===s?void 0:s.data,this._dataChanged):null==l?void 0:l.fields.map((function(e){var t,r,i,o,a=rd(e);return e.selector&&(!e.advanced||c.showAdvanced||null!==(t=c._value)&&void 0!==t&&t.data&&void 0!==c._value.data[e.key])?(0,n.dy)(Eu||(Eu=Hu(["\n ",'\n ','\n ',"\n \n "])),c.narrow,a?(0,n.dy)(Pu||(Pu=Hu(["'])),e.key,c._checkedKeys.has(e.key)||(null===(r=c._value)||void 0===r?void 0:r.data)&&void 0!==c._value.data[e.key],c._checkboxChanged):f?(0,n.dy)(Cu||(Cu=Hu(['
']))):"",e.name||e.key,null==e?void 0:e.description,a&&!c._checkedKeys.has(e.key)&&(!(null!==(i=c._value)&&void 0!==i&&i.data)||void 0===c._value.data[e.key]),c.hass,e.selector,e.key,c._serviceDataChanged,null!==(o=c._value)&&void 0!==o&&o.data&&void 0!==c._value.data[e.key]?c._value.data[e.key]:e.default):""})))}},{kind:"method",key:"_checkboxChanged",value:function(e){var t,r=e.currentTarget.checked,n=e.currentTarget.key;if(r){var i,o,s;this._checkedKeys.add(n);var c,l=null===(i=this._getServiceInfo(null===(s=this._value)||void 0===s?void 0:s.service,this.hass.services))||void 0===i||null===(o=i.fields.find((function(e){return e.key===n})))||void 0===o?void 0:o.default;if(l)t=Object.assign({},null===(c=this._value)||void 0===c?void 0:c.data,Vu({},n,l))}else{var u;this._checkedKeys.delete(n),delete(t=Object.assign({},null===(u=this._value)||void 0===u?void 0:u.data))[n]}t&&(0,a.B)(this,"value-changed",{value:Object.assign({},this._value,{data:t})}),this.requestUpdate("_checkedKeys")}},{kind:"method",key:"_serviceChanged",value:function(e){var t;e.stopPropagation(),e.detail.value!==(null===(t=this._value)||void 0===t?void 0:t.service)&&(0,a.B)(this,"value-changed",{value:{service:e.detail.value||""}})}},{kind:"method",key:"_entityPicked",value:function(e){var t,r,n;e.stopPropagation();var i=e.detail.value;if((null===(t=this._value)||void 0===t||null===(r=t.data)||void 0===r?void 0:r.entity_id)!==i){var o,s;if(!i&&null!==(n=this._value)&&void 0!==n&&n.data)delete(o=Object.assign({},this._value)).data.entity_id;else o=Object.assign({},this._value,{data:Object.assign({},null===(s=this._value)||void 0===s?void 0:s.data,{entity_id:e.detail.value})});(0,a.B)(this,"value-changed",{value:o})}}},{kind:"method",key:"_targetChanged",value:function(e){var t;e.stopPropagation();var r,n=e.detail.value;(null===(t=this._value)||void 0===t?void 0:t.target)!==n&&(n?r=Object.assign({},this._value,{target:e.detail.value}):delete(r=Object.assign({},this._value)).target,(0,a.B)(this,"value-changed",{value:r}))}},{kind:"method",key:"_serviceDataChanged",value:function(e){var t,r,n,i,o;e.stopPropagation();var s=e.currentTarget.key,c=e.detail.value;if((null===(t=this._value)||void 0===t||null===(r=t.data)||void 0===r?void 0:r[s])!==c&&(null!==(n=this._value)&&void 0!==n&&null!==(i=n.data)&&void 0!==i&&i[s]||""!==c&&void 0!==c)){var l=Object.assign({},null===(o=this._value)||void 0===o?void 0:o.data,Vu({},s,c));""!==c&&void 0!==c||delete l[s],(0,a.B)(this,"value-changed",{value:Object.assign({},this._value,{data:l})})}}},{kind:"method",key:"_dataChanged",value:function(e){e.stopPropagation(),e.detail.isValid&&(0,a.B)(this,"value-changed",{value:Object.assign({},this._value,{data:e.detail.value})})}},{kind:"method",key:"_fetchManifest",value:(r=regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._manifest=void 0,e.prev=1,e.next=4,kc(this.hass,t);case 4:this._manifest=e.sent,e.next=9;break;case 7:e.prev=7,e.t0=e.catch(1);case 9:case"end":return e.stop()}}),e,this,[[1,7]])})),o=function(){var e=this,t=arguments;return new Promise((function(n,i){var o=r.apply(e,t);function a(e){zu(o,n,i,a,s,"next",e)}function s(e){zu(o,n,i,a,s,"throw",e)}a(void 0)}))},function(e){return o.apply(this,arguments)})},{kind:"get",static:!0,key:"styles",value:function(){return(0,n.iv)(Au||(Au=Hu(["\n ha-settings-row {\n padding: var(--service-control-padding, 0 16px);\n }\n ha-settings-row {\n --paper-time-input-justify-content: flex-end;\n border-top: var(\n --service-control-items-border-top,\n 1px solid var(--divider-color)\n );\n }\n ha-service-picker,\n ha-entity-picker,\n ha-yaml-editor {\n display: block;\n margin: var(--service-control-padding, 0 16px);\n }\n ha-yaml-editor {\n padding: 16px 0;\n }\n p {\n margin: var(--service-control-padding, 0 16px);\n padding: 16px 0;\n }\n :host(:not([narrow])) ha-settings-row ha-selector {\n width: 60%;\n }\n .checkbox-spacer {\n width: 32px;\n }\n ha-checkbox {\n margin-left: -16px;\n }\n .help-icon {\n color: var(--secondary-text-color);\n }\n .description {\n justify-content: space-between;\n display: flex;\n align-items: center;\n padding-right: 2px;\n }\n "])))}}]}}),n.oi);function nd(e){return nd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nd(e)}function id(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function od(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ad(e,t){return ad=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ad(e,t)}function sd(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ud(e);if(t){var i=ud(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return cd(this,r)}}function cd(e,t){if(t&&("object"===nd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ld(e)}function ld(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ud(e){return ud=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ud(e)}function dd(){dd=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!hd(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n "])),this.narrow,this.hass,this._action,null===(e=this.hass.userData)||void 0===e?void 0:e.showAdvanced,this._actionChanged)}},{kind:"method",key:"_actionChanged",value:function(e){e.detail.value===this._action&&e.stopPropagation()}},{kind:"get",static:!0,key:"styles",value:function(){return(0,n.iv)(td||(td=id(["\n ha-service-control {\n display: block;\n margin: 0 -16px;\n }\n "])))}}]}}),n.oi),r(83927),function(e,t,r,n){return e.connection.subscribeMessage(t,{type:"subscribe_trigger",trigger:r,variables:n})});function kd(e){return kd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kd(e)}function Ed(e,t){return Ed=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ed(e,t)}function Cd(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=_d(e);if(t){var i=_d(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Pd(this,r)}}function Pd(e,t){if(t&&("object"===kd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ad(e)}function Ad(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _d(e){return _d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},_d(e)}function Od(){Od=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!jd(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n \n ","\n "])),t,this._devicePicked,this.hass,this.hass.localize("ui.panel.config.automation.editor.triggers.type.device.label"),this.trigger,t,this._deviceTriggerPicked,this.hass,this.hass.localize("ui.panel.config.automation.editor.triggers.type.device.trigger"),null!==(e=this._capabilities)&&void 0!==e&&e.extra_fields?(0,n.dy)(Md||(Md=Id(["\n \n "])),this.hass,this._extraFieldsData(this.trigger,this._capabilities),this._capabilities.extra_fields,this._extraFieldsComputeLabelCallback(this.hass.localize),this._extraFieldsChanged):"")}},{kind:"method",key:"firstUpdated",value:function(){this._capabilities||this._getCapabilities(),this.trigger&&(this._origTrigger=this.trigger)}},{kind:"method",key:"updated",value:function(e){if(e.has("trigger")){var t=e.get("trigger");t&&!Ze(t,this.trigger)&&this._getCapabilities()}}},{kind:"method",key:"_getCapabilities",value:(r=regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=this.trigger).domain){e.next=7;break}return e.next=4,Ie(this.hass,t);case 4:e.t0=e.sent,e.next=8;break;case 7:e.t0=void 0;case 8:this._capabilities=e.t0;case 9:case"end":return e.stop()}}),e,this)})),o=function(){var e=this,t=arguments;return new Promise((function(n,i){var o=r.apply(e,t);function a(e){Fd(o,n,i,a,s,"next",e)}function s(e){Fd(o,n,i,a,s,"throw",e)}a(void 0)}))},function(){return o.apply(this,arguments)})},{kind:"method",key:"_devicePicked",value:function(e){e.stopPropagation(),this._deviceId=e.target.value,void 0===this._deviceId&&(0,a.B)(this,"value-changed",{value:Object.assign({},c.defaultConfig,{platform:"device"})})}},{kind:"method",key:"_deviceTriggerPicked",value:function(e){e.stopPropagation();var t=e.detail.value;this._origTrigger&&Ze(this._origTrigger,t)&&(t=this._origTrigger),this.trigger.id&&(t.id=this.trigger.id),(0,a.B)(this,"value-changed",{value:t})}},{kind:"method",key:"_extraFieldsChanged",value:function(e){e.stopPropagation(),(0,a.B)(this,"value-changed",{value:Object.assign({},this.trigger,e.detail.value)})}},{kind:"method",key:"_extraFieldsComputeLabelCallback",value:function(e){return function(t){return e("ui.panel.config.automation.editor.triggers.type.device.extra_fields.".concat(t.name))||t.name}}},{kind:"field",static:!0,key:"styles",value:function(){return(0,n.iv)(Ld||(Ld=Id(["\n ha-device-picker {\n display: block;\n margin-bottom: 24px;\n }\n "])))}}]}}),n.oi),rf=r(1460);function nf(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,i)}function of(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){nf(o,n,i,a,s,"next",e)}function s(e){nf(o,n,i,a,s,"throw",e)}a(void 0)}))}}var af,sf,cf,lf,uf=function(){var e=of(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t.callWS({type:"config/auth/list"}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),df=r(70483);function ff(e){return ff="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ff(e)}function pf(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function hf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mf(e,t){return mf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},mf(e,t)}function yf(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Sf(e);if(t){var i=Sf(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return vf(this,r)}}function vf(e,t){if(t&&("object"===ff(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return bf(e)}function bf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gf(){gf=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Ef(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r
'])),(0,df.V)({backgroundImage:"url(".concat(e,")")}));var t,r=(t=this.user.name)?t.trim().split(" ").slice(0,3).map((function(e){return e.substring(0,1)})).join(""):"?";return(0,n.dy)(cf||(cf=pf(['\n ',"\n "])),(0,dl.$)({long:r.length>2}),r)}},{kind:"method",key:"_getPersonPicture",value:function(){if(this._personEntityId=void 0,this._personPicture=void 0,this.hass&&this.user)for(var e=0,t=Object.values(this.hass.states);e=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n ","\n ","\n \n "])),this.label,this.disabled,this.value,this._userChanged,0===(null===(e=this.users)||void 0===e?void 0:e.length)?(0,n.dy)(jf||(jf=Vf(['\n ',"\n "])),this.noUserLabel||(null===(t=this.hass)||void 0===t?void 0:t.localize("ui.components.user-picker.no_user"))):"",this._sortedUsers(this.users).map((function(e){return(0,n.dy)(xf||(xf=Vf(['\n \n ',"\n \n "])),e.id,r.hass,e,e.name)})))}},{kind:"method",key:"firstUpdated",value:function(e){var t=this;Yf(Kf(r.prototype),"firstUpdated",this).call(this,e),void 0===this.users&&uf(this.hass).then((function(e){t.users=e}))}},{kind:"method",key:"_userChanged",value:function(e){var t=this,r=e.target.value;r!==this.value&&(this.value=r,setTimeout((function(){(0,a.B)(t,"value-changed",{value:r}),(0,a.B)(t,"change")}),0))}},{kind:"get",static:!0,key:"styles",value:function(){return(0,n.iv)(Tf||(Tf=Vf(["\n :host {\n display: inline-block;\n }\n mwc-list {\n display: block;\n }\n "])))}}]}}),n.oi);function tp(e){return tp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tp(e)}function rp(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,i)}function np(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){rp(o,n,i,a,s,"next",e)}function s(e){rp(o,n,i,a,s,"throw",e)}a(void 0)}))}}function ip(e){return function(e){if(Array.isArray(e))return gp(e)}(e)||wp(e)||bp(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function op(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ap(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sp(e,t){return sp=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},sp(e,t)}function cp(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ep(e);if(t){var i=Ep(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return lp(this,r)}}function lp(e,t){if(t&&("object"===tp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return up(e)}function up(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dp(){dp=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!hp(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n "])),(0,rf.l)([t],(function(){var r;return null===(r=e.value)||void 0===r?void 0:r.map((function(r,i){return(0,n.dy)(Qf||(Qf=op(["\n
\n \n \n >\n
\n "])),e.pickedUserLabel,e.hass.localize("ui.components.user-picker.remove_user"),i,e.hass,r,e._notSelectedUsersAndSelected(r,e.users,t),e._userChanged,r,e.hass.localize("ui.components.user-picker.remove_user"),"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",e._removeUser)}))})),this.pickUserLabel||this.hass.localize("ui.components.user-picker.add_user"),this.hass,t,!(null!=t&&t.length),this._addUser)}},{kind:"field",key:"_notSelectedUsers",value:function(){return(0,s.Z)((function(e,t){return t?null==e?void 0:e.filter((function(e){return!e.system_generated&&!t.includes(e.id)})):null==e?void 0:e.filter((function(e){return!e.system_generated}))}))}},{kind:"field",key:"_notSelectedUsersAndSelected",value:function(){return function(e,t,r){var n=null==t?void 0:t.find((function(t){return t.id===e}));return n?r?[].concat(ip(r),[n]):[n]:r}}},{kind:"get",key:"_currentUsers",value:function(){return this.value||[]}},{kind:"method",key:"_updateUsers",value:(o=np(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.value=t,(0,a.B)(this,"value-changed",{value:t});case 2:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{kind:"method",key:"_userChanged",value:function(e){e.stopPropagation();var t=e.currentTarget.index,r=e.detail.value,n=ip(this._currentUsers);""===r?n.splice(t,1):n.splice(t,1,r),this._updateUsers(n)}},{kind:"method",key:"_addUser",value:(r=np(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.stopPropagation(),r=t.detail.value,t.currentTarget.value="",r){e.next=5;break}return e.abrupt("return");case 5:if(!(n=this._currentUsers).includes(r)){e.next=8;break}return e.abrupt("return");case 8:this._updateUsers([].concat(ip(n),[r]));case 9:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{kind:"method",key:"_removeUser",value:function(e){var t=e.currentTarget.userId;this._updateUsers(this._currentUsers.filter((function(e){return e!==t})))}},{kind:"get",static:!0,key:"styles",value:function(){return(0,n.iv)(Jf||(Jf=op(["\n :host {\n display: block;\n }\n div {\n display: flex;\n align-items: center;\n }\n "])))}}]}}),n.oi);function Ap(e){return Ap="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ap(e)}function _p(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Op(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sp(e,t){return Sp=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Sp(e,t)}function Dp(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Tp(e);if(t){var i=Tp(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return jp(this,r)}}function jp(e,t){if(t&&("object"===Ap(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return xp(e)}function xp(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Tp(e){return Tp=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Tp(e)}function zp(){zp=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Mp(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n "],t||(t=e.slice(0)),Bp=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))),this._schema(this.hass.localize),this.trigger,this.hass,this._computeLabelCallback,this._valueChanged);var e,t}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();var t=e.detail.value;(0,a.B)(this,"value-changed",{value:t})}},{kind:"field",key:"_computeLabelCallback",value:function(){var e=this;return function(t){return e.hass.localize("ui.panel.config.automation.editor.triggers.type.geo_location.".concat(t.name))}}}]}}),n.oi);function oh(e){return oh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oh(e)}function ah(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function sh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ch(e,t){return ch=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ch(e,t)}function lh(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=fh(e);if(t){var i=fh(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return uh(this,r)}}function uh(e,t){if(t&&("object"===oh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return dh(e)}function dh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fh(e){return fh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},fh(e)}function ph(){ph=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!yh(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n "])),this._schema(this.hass.localize),this.trigger,this.hass,this._computeLabelCallback,this._valueChanged)}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();var t=e.detail.value;(0,a.B)(this,"value-changed",{value:t})}},{kind:"field",key:"_computeLabelCallback",value:function(){var e=this;return function(t){return e.hass.localize("ui.panel.config.automation.editor.triggers.type.geo_location.".concat(t.name))}}},{kind:"field",static:!0,key:"styles",value:function(){return(0,n.iv)(ih||(ih=ah(["\n label {\n display: flex;\n align-items: center;\n }\n "])))}}]}}),n.oi);function Eh(e){return Eh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Eh(e)}function Ch(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ph(e,t){return Ph=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ph(e,t)}function Ah(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Sh(e);if(t){var i=Sh(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return _h(this,r)}}function _h(e,t){if(t&&("object"===Eh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Oh(e)}function Oh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Sh(e){return Sh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Sh(e)}function Dh(){Dh=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Th(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n "],t||(t=e.slice(0)),kh=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))),Rh,this.trigger,this.hass,this._computeLabelCallback,this._valueChanged);var e,t}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();var t=e.detail.value;(0,a.B)(this,"value-changed",{value:t})}},{kind:"field",key:"_computeLabelCallback",value:function(){var e=this;return function(t){return e.hass.localize("ui.panel.config.automation.editor.triggers.type.mqtt.".concat(t.name))}}}]}}),n.oi);function Fh(e){return Fh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fh(e)}function Ih(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bh(e,t){return Bh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Bh(e,t)}function Zh(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=$h(e);if(t){var i=$h(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Uh(this,r)}}function Uh(e,t){if(t&&("object"===Fh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Nh(e)}function Nh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $h(e){return $h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},$h(e)}function qh(){qh=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Kh(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n "],t||(t=e.slice(0)),Lh=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))),this.hass,i,o,this._valueChanged,this._computeLabelCallback)}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();var t=e.detail.value;(0,a.B)(this,"value-changed",{value:t})}},{kind:"field",key:"_computeLabelCallback",value:function(){var e=this;return function(t){switch(t.name){case"entity_id":return e.hass.localize("ui.components.entity.entity-picker.entity");case"attribute":return e.hass.localize("ui.components.entity.entity-attribute-picker.attribute");case"for":return e.hass.localize("ui.panel.config.automation.editor.triggers.type.state.for");default:return e.hass.localize("ui.panel.config.automation.editor.triggers.type.numeric_state.".concat(t.name))}}}}]}}),n.oi);function tm(e){return tm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tm(e)}function rm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nm(e,t){return nm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},nm(e,t)}function im(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=sm(e);if(t){var i=sm(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return om(this,r)}}function om(e,t){if(t&&("object"===tm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return am(e)}function am(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sm(e){return sm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},sm(e)}function cm(){cm=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!dm(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n "],t||(t=e.slice(0)),em=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))),this.hass,i,o,this._valueChanged,this._computeLabelCallback)}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();var t=e.detail.value;Object.keys(t).forEach((function(e){return void 0===t[e]||""===t[e]?delete t[e]:{}})),(0,a.B)(this,"value-changed",{value:t})}},{kind:"field",key:"_computeLabelCallback",value:function(){var e=this;return function(t){return e.hass.localize("entity_id"===t.name?"ui.components.entity.entity-picker.entity":"ui.panel.config.automation.editor.triggers.type.state.".concat(t.name))}}}]}}),n.oi);function bm(e){return bm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bm(e)}function gm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wm(e,t){return wm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},wm(e,t)}function km(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Pm(e);if(t){var i=Pm(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Em(this,r)}}function Em(e,t){if(t&&("object"===bm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Cm(e)}function Cm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Pm(e){return Pm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Pm(e)}function Am(){Am=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Sm(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n "],t||(t=e.slice(0)),ym=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))),r,this.trigger,this.hass,this._computeLabelCallback,this._valueChanged)}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();var t=e.detail.value;(0,a.B)(this,"value-changed",{value:t})}},{kind:"field",key:"_computeLabelCallback",value:function(){var e=this;return function(t){return e.hass.localize("ui.panel.config.automation.editor.triggers.type.sun.".concat(t.name))}}}]}}),n.oi);function zm(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,i)}function Vm(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){zm(o,n,i,a,s,"next",e)}function s(e){zm(o,n,i,a,s,"throw",e)}a(void 0)}))}}var Hm,Mm,Lm=function(){var e=Vm(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t.callWS({type:"tag/list"}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function Rm(e){return Rm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rm(e)}function Fm(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,i)}function Im(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Bm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zm(e,t){return Zm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Zm(e,t)}function Um(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ty(e);if(t){var i=ty(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Nm(this,r)}}function Nm(e,t){if(t&&("object"===Rm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return $m(e)}function $m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qm(){qm=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Km(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n ","\n \n "])),this.hass.localize("ui.panel.config.automation.editor.triggers.type.tag.label"),0===this._tags.length,e,this._tagChanged,this._tags.map((function(e){return(0,n.dy)(Mm||(Mm=Im(["\n \n ","\n \n "])),e.id,e.name||e.id)})))}},{kind:"method",key:"_fetchTags",value:(r=regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Lm(this.hass);case 2:this._tags=e.sent,this._tags.sort((function(e,t){return(0,c.f)(e.name||e.id,t.name||t.id)}));case 4:case"end":return e.stop()}}),e,this)})),o=function(){var e=this,t=arguments;return new Promise((function(n,i){var o=r.apply(e,t);function a(e){Fm(o,n,i,a,s,"next",e)}function s(e){Fm(o,n,i,a,s,"throw",e)}a(void 0)}))},function(){return o.apply(this,arguments)})},{kind:"method",key:"_tagChanged",value:function(e){(0,a.B)(this,"value-changed",{value:Object.assign({},this.trigger,{tag_id:e.target.value})})}}]}}),n.oi);function iy(e){return iy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},iy(e)}function oy(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ay(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sy(e,t){return sy=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},sy(e,t)}function cy(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=dy(e);if(t){var i=dy(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ly(this,r)}}function ly(e,t){if(t&&("object"===iy(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return uy(e)}function uy(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dy(e){return dy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},dy(e)}function fy(){fy=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!my(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n '])),this.hass.localize("ui.panel.config.automation.editor.triggers.type.template.value_template"),e,this._valueChanged)}},{kind:"method",key:"_valueChanged",value:function(e){jb(this,e)}},{kind:"field",static:!0,key:"styles",value:function(){return(0,n.iv)(ny||(ny=oy(["\n ha-textarea {\n display: block;\n }\n "])))}}]}}),n.oi);function Ey(e){return Ey="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ey(e)}function Cy(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Py(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ay(e,t){return Ay=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ay(e,t)}function _y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Dy(e);if(t){var i=Dy(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Oy(this,r)}}function Oy(e,t){if(t&&("object"===Ey(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Sy(e)}function Sy(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Dy(e){return Dy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Dy(e)}function jy(){jy=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!zy(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n "])),this.hass,o,i,this._valueChanged,this._computeLabelCallback)}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();var t=e.detail.value;this._inputMode="input"===t.mode.value,Object.keys(t).forEach((function(e){return void 0===t[e]||""===t[e]?delete t[e]:{}})),(0,a.B)(this,"value-changed",{value:t})}},{kind:"field",key:"_computeLabelCallback",value:function(){var e=this;return function(t){return e.hass.localize("ui.panel.config.automation.editor.triggers.type.time.".concat(t.name))}}}]}}),n.oi);function Fy(e){return Fy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fy(e)}function Iy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function By(e,t){return By=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},By(e,t)}function Zy(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=$y(e);if(t){var i=$y(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Uy(this,r)}}function Uy(e,t){if(t&&("object"===Fy(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ny(e)}function Ny(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $y(e){return $y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},$y(e)}function qy(){qy=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Ky(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n "],t||(t=e.slice(0)),Ry=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))),this.hass,ev,this.trigger,this._computeLabelCallback,this._valueChanged);var e,t}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();var t=e.detail.value;(0,a.B)(this,"value-changed",{value:t})}},{kind:"field",key:"_computeLabelCallback",value:function(){var e=this;return function(t){return e.hass.localize("ui.panel.config.automation.editor.triggers.type.time_pattern.".concat(t.name))}}}]}}),n.oi),r(83447));function rv(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,i)}var nv,iv,ov=function(){var e,t=(e=regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!navigator.clipboard){e.next=9;break}return e.prev=1,e.next=4,navigator.clipboard.writeText(t);case 4:return e.abrupt("return");case 7:e.prev=7,e.t0=e.catch(1);case 9:(r=document.createElement("textarea")).value=t,document.body.appendChild(r),r.select(),document.execCommand("copy"),document.body.removeChild(r);case 15:case"end":return e.stop()}}),e,null,[[1,7]])})),function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){rv(o,n,i,a,s,"next",e)}function s(e){rv(o,n,i,a,s,"throw",e)}a(void 0)}))});return function(e){return t.apply(this,arguments)}}();function av(e){return av="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},av(e)}function sv(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,i)}function cv(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function lv(e){return function(e){if(Array.isArray(e))return Cv(e)}(e)||Pv(e)||Ev(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dv(e,t){return dv=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},dv(e,t)}function fv(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=_v(e);if(t){var i=_v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return pv(this,r)}}function pv(e,t){if(t&&("object"===av(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return hv(e)}function hv(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mv(){mv=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!bv(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n \n\n
\n "])),this._handleAction,this.hass.localize("ui.common.menu"),"M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",this.hass.localize("ui.panel.config.automation.editor.triggers.edit_id"),-1===e,t?this.hass.localize("ui.panel.config.automation.editor.edit_ui"):this.hass.localize("ui.panel.config.automation.editor.edit_yaml"),this.hass.localize("ui.panel.config.automation.editor.actions.duplicate"),this.hass.localize("ui.panel.config.automation.editor.actions.delete"),this._warnings?(0,n.dy)(Wv||(Wv=sb(['=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n
\n =0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n
\n \n \n \n \n "])),this.hass.localize("ui.panel.config.automation.editor.actions.type.wait_for_trigger.timeout"),"timeout",i||"",this._valueChanged,this.hass.localize("ui.panel.config.automation.editor.actions.type.wait_for_trigger.continue_timeout"),null==r||r,this._continueChanged,t,this.hass,"wait_for_trigger",this._valueChanged)}},{kind:"method",key:"_continueChanged",value:function(e){(0,a.B)(this,"value-changed",{value:Object.assign({},this.action,{continue_on_timeout:e.target.checked})})}},{kind:"method",key:"_valueChanged",value:function(e){pw(this,e)}},{kind:"get",static:!0,key:"styles",value:function(){return(0,n.iv)(Gb||(Gb=Jb(["\n ha-textfield {\n display: block;\n margin-bottom: 24px;\n }\n "])))}}]}}),n.oi);function mg(e){return mg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mg(e)}function yg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vg(e,t){return vg=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},vg(e,t)}function bg(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=kg(e);if(t){var i=kg(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return gg(this,r)}}function gg(e,t){if(t&&("object"===mg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return wg(e)}function wg(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kg(e){return kg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},kg(e)}function Eg(){Eg=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Ag(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n "],t||(t=e.slice(0)),hg=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))),this.hass,this.action,Bg,this._computeLabelCallback);var e,t}},{kind:"field",key:"_computeLabelCallback",value:function(){var e=this;return function(t){return e.hass.localize("ui.panel.config.automation.editor.actions.type.wait_template.".concat("continue_on_timeout"===t.name?"continue_timeout":t.name))}}}]}}),n.oi);function Zg(e){return Zg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zg(e)}function Ug(e,t){return sw(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(c){s=!0,i=c}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(e,t)||ow(e,t)||iw()}function Ng(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function $g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qg(e,t){return qg=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},qg(e,t)}function Wg(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Xg(e);if(t){var i=Xg(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Yg(this,r)}}function Yg(e,t){if(t&&("object"===Zg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Kg(e)}function Kg(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xg(e){return Xg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Xg(e)}function Gg(){Gg=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!ew(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n
\n
\n ',"\n ",'\n \n \n \n ',"\n \n \n
\n ","\n ","\n
\n \n "])),0!==this.index?(0,n.dy)(xg||(xg=Ng(["\n \n "])),this.hass.localize("ui.panel.config.automation.editor.move_up"),"M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z",this._moveUp):"",this.index!==this.totalActions-1?(0,n.dy)(Tg||(Tg=Ng(["\n \n "])),this.hass.localize("ui.panel.config.automation.editor.move_down"),"M11,4H13V16L18.5,10.5L19.92,11.92L12,19.84L4.08,11.92L5.5,10.5L11,16V4Z",this._moveDown):"",this._handleAction,this.hass.localize("ui.common.menu"),"M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",!this._uiModeAvailable,t?this.hass.localize("ui.panel.config.automation.editor.edit_ui"):this.hass.localize("ui.panel.config.automation.editor.edit_yaml"),this.hass.localize("ui.panel.config.automation.editor.actions.duplicate"),this.hass.localize("ui.panel.config.automation.editor.actions.delete"),this._warnings?(0,n.dy)(zg||(zg=Ng(['=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n
\n =0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r"])),this.disabled,this.value||[],this.hass)}},{kind:"get",static:!0,key:"styles",value:function(){return(0,n.iv)(Vw||(Vw=Mw(["\n ha-automation-action {\n display: block;\n margin-bottom: 16px;\n }\n :host([disabled]) ha-automation-action {\n opacity: var(--light-disabled-opacity);\n pointer-events: none;\n }\n "])))}}]}}),n.oi);var Gw,Qw,Jw,ek=r(7323),tk=r(69810);function rk(e){return rk="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rk(e)}function nk(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,i)}function ik(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ok(e,t){return ok=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ok(e,t)}function ak(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=lk(e);if(t){var i=lk(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return sk(this,r)}}function sk(e,t){if(t&&("object"===rk(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ck(e)}function ck(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lk(e){return lk=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},lk(e)}function uk(){uk=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!pk(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n ",'\n ',"\n"])),e.name,e.slug)};!function(e,t,r,n){var i=uk();if(n)for(var o=0;o=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r"])),this.hass,this.value,this.label)}},{kind:"field",static:!0,key:"styles",value:function(){return(0,n.iv)(wk||(wk=Ck(["\n ha-addon-picker {\n width: 100%;\n }\n "])))}}]}}),n.oi);var Rk,Fk,Ik,Bk=r(81582);r(52039);function Zk(e){return Zk="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zk(e)}function Uk(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,i)}function Nk(e){return function(e){if(Array.isArray(e))return oE(e)}(e)||aE(e)||iE(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $k(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qk(e,t){return qk=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},qk(e,t)}function Wk(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Xk(e);if(t){var i=Xk(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Yk(this,r)}}function Yk(e,t){if(t&&("object"===Zk(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Kk(e)}function Kk(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xk(e){return Xk=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Xk(e)}function Gk(){Gk=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!eE(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n ","\n"])),(0,dl.$)({"add-new":"add_new"===e.area_id}),e.name)};!function(e,t,r,n){var i=Gk();if(n)for(var o=0;o=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(n);try{for(h.s();!(p=h.n()).done;){var m=p.value;m.device_id&&(m.device_id in f||(f[m.device_id]=[]),f[m.device_id].push(m))}}catch(g){h.e(g)}finally{h.f()}u=r,d=n.filter((function(e){return e.area_id}))}else s&&(u=r),c&&(d=n.filter((function(e){return e.area_id})));i&&(u=u.filter((function(e){var t=f[e.id];return!(!t||!t.length)&&f[e.id].some((function(e){return i.includes((0,zt.M)(e.entity_id))}))})),d=d.filter((function(e){return i.includes((0,zt.M)(e.entity_id))}))),o&&(u=u.filter((function(e){var t=f[e.id];return!t||!t.length||n.every((function(e){return!o.includes((0,zt.M)(e.entity_id))}))})),d=d.filter((function(e){return!o.includes((0,zt.M)(e.entity_id))}))),a&&(u=u.filter((function(t){var r=f[t.id];return!(!r||!r.length)&&f[t.id].some((function(t){var r=e.hass.states[t.entity_id];return!!r&&(r.attributes.device_class&&a.includes(r.attributes.device_class))}))})),d=d.filter((function(t){var r=e.hass.states[t.entity_id];return r.attributes.device_class&&a.includes(r.attributes.device_class)}))),s&&(u=u.filter((function(e){return s(e)}))),c&&(d=d.filter((function(e){return c(e)})));var y,v,b=t;(u&&(y=u.filter((function(e){return e.area_id})).map((function(e){return e.area_id}))),d)&&(y=(null!==(v=y)&&void 0!==v?v:[]).concat(d.filter((function(e){return e.area_id})).map((function(e){return e.area_id}))));return y&&(b=t.filter((function(e){return y.includes(e.area_id)}))),b.length||(b=[{area_id:"no_areas",name:e.hass.localize("ui.components.area-picker.no_match"),picture:null}]),l?b:[].concat(Nk(b),[{area_id:"add_new",name:e.hass.localize("ui.components.area-picker.add_new"),picture:null}])}))}},{kind:"method",key:"updated",value:function(e){(!this._init&&this._devices&&this._areas&&this._entities||e.has("_opened")&&this._opened)&&(this._init=!0,this.comboBox.items=this._getAreas(this._areas,this._devices,this._entities,this.includeDomains,this.excludeDomains,this.includeDeviceClasses,this.deviceFilter,this.entityFilter,this.noAdd))}},{kind:"method",key:"render",value:function(){var e;return this._devices&&this._areas&&this._entities?(0,n.dy)(Ik||(Ik=sE(["\n =0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r"],i||(i=r.slice(0)),cE=Object.freeze(Object.defineProperties(r,{raw:{value:Object.freeze(i)}}))),this.hass,this.value,this.label,this._filterDevices,this._filterEntities,null!==(e=this.selector.area.entity)&&void 0!==e&&e.device_class?[this.selector.area.entity.device_class]:void 0,null!==(t=this.selector.area.entity)&&void 0!==t&&t.domain?[this.selector.area.entity.domain]:void 0,this.disabled)}},{kind:"field",key:"_filterEntities",value:function(){var e=this;return function(t){var r;return null===(r=e.selector.area.entity)||void 0===r||!r.integration||t.platform===e.selector.area.entity.integration}}},{kind:"field",key:"_filterDevices",value:function(){var e=this;return function(t){var r,n,i;return(null===(r=e.selector.area.device)||void 0===r||!r.manufacturer||t.manufacturer===e.selector.area.device.manufacturer)&&((null===(n=e.selector.area.device)||void 0===n||!n.model||t.model===e.selector.area.device.model)&&!(null!==(i=e.selector.area.device)&&void 0!==i&&i.integration&&e._configEntries&&!e._configEntries.some((function(e){return t.config_entries.includes(e.entry_id)}))))}}},{kind:"method",key:"_loadConfigEntries",value:(r=regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Bk.pB)(this.hass);case 2:this._configEntries=e.sent.filter((function(e){var r;return e.domain===(null===(r=t.selector.area.device)||void 0===r?void 0:r.integration)}));case 3:case"end":return e.stop()}}),e,this)})),o=function(){var e=this,t=arguments;return new Promise((function(n,i){var o=r.apply(e,t);function a(e){dE(o,n,i,a,s,"next",e)}function s(e){dE(o,n,i,a,s,"throw",e)}a(void 0)}))},function(){return o.apply(this,arguments)})}]}}),n.oi),r(31628),r(12198),r(44583),r(66477);var _E="^\\d{4}-(0[1-9]|1[0-2])-([12]\\d|0[1-9]|3[01])";new RegExp(_E+"$"),new RegExp(_E);var OE,SE;function DE(e){return DE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},DE(e)}function jE(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function xE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TE(e,t){return TE=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},TE(e,t)}function zE(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ME(e);if(t){var i=ME(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return VE(this,r)}}function VE(e,t){if(t&&("object"===DE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return HE(e)}function HE(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ME(e){return ME=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ME(e)}function LE(){LE=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!IE(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n "],t||(t=e.slice(0)),$E=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))),this.hass,this.selector.attribute.entity_id,this.value,this.label,this.disabled);var e,t}}]}}),(0,Bt.f)(n.oi)),r(4019);function lC(e){return lC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lC(e)}function uC(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function dC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fC(e,t){return fC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},fC(e,t)}function pC(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=yC(e);if(t){var i=yC(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return hC(this,r)}}function hC(e,t){if(t&&("object"===lC(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return mC(e)}function mC(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yC(e){return yC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},yC(e)}function vC(){vC=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!wC(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n \n "])),this.label,this.value,this._handleChange,this.disabled)}},{kind:"method",key:"_handleChange",value:function(e){var t=e.target.checked;this.value!==t&&(0,a.B)(this,"value-changed",{value:t})}},{kind:"get",static:!0,key:"styles",value:function(){return(0,n.iv)(cC||(cC=uC(["\n :host {\n height: 56px;\n display: flex;\n }\n ha-formfield {\n width: 100%;\n --mdc-typography-body2-font-size: 1em;\n }\n "])))}}]}}),n.oi);function _C(e){return _C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_C(e)}function OC(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,i)}function SC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function DC(e,t){return DC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},DC(e,t)}function jC(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=zC(e);if(t){var i=zC(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return xC(this,r)}}function xC(e,t){if(t&&("object"===_C(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return TC(e)}function TC(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zC(e){return zC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},zC(e)}function VC(){VC=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!LC(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r"],i||(i=r.slice(0)),AC=Object.freeze(Object.defineProperties(r,{raw:{value:Object.freeze(i)}}))),this.hass,this.value,this.label,this._filterDevices,null!==(e=this.selector.device.entity)&&void 0!==e&&e.device_class?[this.selector.device.entity.device_class]:void 0,null!==(t=this.selector.device.entity)&&void 0!==t&&t.domain?[this.selector.device.entity.domain]:void 0,this.disabled)}},{kind:"field",key:"_filterDevices",value:function(){var e=this;return function(t){var r,n,i;return(null===(r=e.selector.device)||void 0===r||!r.manufacturer||t.manufacturer===e.selector.device.manufacturer)&&((null===(n=e.selector.device)||void 0===n||!n.model||t.model===e.selector.device.model)&&!(null!==(i=e.selector.device)&&void 0!==i&&i.integration&&e._configEntries&&!e._configEntries.some((function(e){return t.config_entries.includes(e.entry_id)}))))}}},{kind:"method",key:"_loadConfigEntries",value:(r=regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Bk.pB)(this.hass);case 2:this._configEntries=e.sent.filter((function(e){return e.domain===t.selector.device.integration}));case 3:case"end":return e.stop()}}),e,this)})),o=function(){var e=this,t=arguments;return new Promise((function(n,i){var o=r.apply(e,t);function a(e){OC(o,n,i,a,s,"next",e)}function s(e){OC(o,n,i,a,s,"throw",e)}a(void 0)}))},function(){return o.apply(this,arguments)})}]}}),n.oi);function UC(e){return UC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},UC(e)}function NC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $C(e,t){return $C=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},$C(e,t)}function qC(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=KC(e);if(t){var i=KC(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return WC(this,r)}}function WC(e,t){if(t&&("object"===UC(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return YC(e)}function YC(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function KC(e){return KC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},KC(e)}function XC(){XC=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!JC(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n "],t||(t=e.slice(0)),ZC=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))),this.label,this.value,this.disabled,this.required);var e,t}}]}}),n.oi);function oP(e){return oP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oP(e)}function aP(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sP(e,t){return sP=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},sP(e,t)}function cP(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=dP(e);if(t){var i=dP(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return lP(this,r)}}function lP(e,t){if(t&&("object"===oP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return uP(e)}function uP(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dP(e){return dP=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},dP(e)}function fP(){fP=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!mP(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r"],t||(t=e.slice(0)),iP=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))),this.hass,this.value,this.label,this._filterEntities,this.disabled);var e,t}},{kind:"method",key:"hassSubscribe",value:function(){var e=this;return[It(this.hass.connection,(function(t){var r,n={},i=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=gP(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.platform&&(n[o.entity_id]=o.platform)}}catch(a){i.e(a)}finally{i.f()}e._entityPlaformLookup=n}))]}},{kind:"field",key:"_filterEntities",value:function(){var e=this;return function(t){var r,n,i;return(null===(r=e.selector.entity)||void 0===r||!r.domain||(0,la.N)(t)===e.selector.entity.domain)&&(!(null!==(n=e.selector.entity)&&void 0!==n&&n.device_class&&(!t.attributes.device_class||t.attributes.device_class!==e.selector.entity.device_class))&&!(null!==(i=e.selector.entity)&&void 0!==i&&i.integration&&(!e._entityPlaformLookup||e._entityPlaformLookup[t.entity_id]!==e.selector.entity.integration)))}}}]}}),(0,Bt.f)(n.oi)),r(65025);function PP(e){return PP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},PP(e)}function AP(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function _P(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OP(e,t){return OP=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},OP(e,t)}function SP(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=xP(e);if(t){var i=xP(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return DP(this,r)}}function DP(e,t){if(t&&("object"===PP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return jP(e)}function jP(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xP(e){return xP=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},xP(e)}function TP(){TP=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!HP(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r"],t||(t=e.slice(0)),IP=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))),this.hass,this.disabled,this.placeholder,this.value,this._handleChange);var e,t}},{kind:"method",key:"_handleChange",value:function(e){var t=e.target.value;e.target.isValid&&this.value!==t&&(0,a.B)(this,"value-changed",{value:t})}}]}}),n.oi);var rA,nA,iA,oA=r(32594);function aA(e){return aA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},aA(e)}function sA(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function cA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lA(e,t){return lA=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},lA(e,t)}function uA(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=pA(e);if(t){var i=pA(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return dA(this,r)}}function dA(e,t){if(t&&("object"===aA(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return fA(e)}function fA(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pA(e){return pA=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},pA(e)}function hA(){hA=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!vA(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n ","\n "])),this.label,this.value,this.helper,this.disabled,oA.U,this._valueChanged,this.selector.select.options.map((function(e){var t="object"===aA(e)?e.value:e,r="object"===aA(e)?e.label:e;return(0,n.dy)(nA||(nA=sA(["",""])),t,r)})))}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation(),!this.disabled&&e.target.value&&(0,a.B)(this,"value-changed",{value:e.target.value})}},{kind:"get",static:!0,key:"styles",value:function(){return(0,n.iv)(iA||(iA=sA(["\n mwc-select {\n width: 100%;\n }\n "])))}}]}}),n.oi);var EA,CA,PA,AA,_A,OA,SA,DA,jA,xA,TA,zA=r(67182);r(54444);function VA(e){return VA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},VA(e)}function HA(e){return function(e){if(Array.isArray(e))return e_(e)}(e)||t_(e)||JA(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function MA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function LA(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,i)}function RA(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function FA(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=JA(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function IA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function BA(e,t){return BA=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},BA(e,t)}function ZA(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=$A(e);if(t){var i=$A(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return UA(this,r)}}function UA(e,t){if(t&&("object"===VA(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return NA(e)}function NA(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $A(e){return $A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},$A(e)}function qA(){qA=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!KA(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n ',"\n ","\n ","\n
\n ",'\n
\n \n
\n \n \n \n ','\n \n \n
\n \n
\n \n \n \n ','\n \n \n
\n \n
\n \n \n \n ',"\n \n \n \n "])),null!==(e=this.value)&&void 0!==e&&e.area_id?M(this.value.area_id).map((function(e){var t=i._areas[e];return i._renderChip("area_id",e,(null==t?void 0:t.name)||e,void 0,"M12.5 7C12.5 5.89 13.39 5 14.5 5H18C19.1 5 20 5.9 20 7V9.16C18.84 9.57 18 10.67 18 11.97V14H12.5V7M6 11.96V14H11.5V7C11.5 5.89 10.61 5 9.5 5H6C4.9 5 4 5.9 4 7V9.15C5.16 9.56 6 10.67 6 11.96M20.66 10.03C19.68 10.19 19 11.12 19 12.12V15H5V12C5 10.9 4.11 10 3 10S1 10.9 1 12V17C1 18.1 1.9 19 3 19V21H5V19H19V21H21V19C22.1 19 23 18.1 23 17V12C23 10.79 21.91 9.82 20.66 10.03Z")})):"",null!==(t=this.value)&&void 0!==t&&t.device_id?M(this.value.device_id).map((function(e){var t=i._devices[e];return i._renderChip("device_id",e,t?(0,Ht.jL)(t,i.hass):e,void 0,"M3 6H21V4H3C1.9 4 1 4.9 1 6V18C1 19.1 1.9 20 3 20H7V18H3V6M13 12H9V13.78C8.39 14.33 8 15.11 8 16C8 16.89 8.39 17.67 9 18.22V20H13V18.22C13.61 17.67 14 16.88 14 16S13.61 14.33 13 13.78V12M11 17.5C10.17 17.5 9.5 16.83 9.5 16S10.17 14.5 11 14.5 12.5 15.17 12.5 16 11.83 17.5 11 17.5M22 8H16C15.5 8 15 8.5 15 9V19C15 19.5 15.5 20 16 20H22C22.5 20 23 19.5 23 19V9C23 8.5 22.5 8 22 8M21 18H17V10H21V18Z")})):"",null!==(r=this.value)&&void 0!==r&&r.entity_id?M(this.value.entity_id).map((function(e){var t=i.hass.states[e];return i._renderChip("entity_id",e,t?(0,Se.C)(t):e,t)})):"",this._renderPicker(),"area_id",this._showPicker,i_,this.hass.localize("ui.components.target-picker.add_area_id"),"device_id",this._showPicker,i_,this.hass.localize("ui.components.target-picker.add_device_id"),"entity_id",this._showPicker,i_,this.hass.localize("ui.components.target-picker.add_entity_id")):(0,n.dy)(EA||(EA=RA([""])))}},{kind:"method",key:"_showPicker",value:(r=regeneratorRuntime.mark((function e(t){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._addMode=t.currentTarget.type,e.next=3,this.updateComplete;case 3:setTimeout((function(){var e,t;null===(e=r._inputElement)||void 0===e||e.open(),null===(t=r._inputElement)||void 0===t||t.focus()}),0);case 4:case"end":return e.stop()}}),e,this)})),o=function(){var e=this,t=arguments;return new Promise((function(n,i){var o=r.apply(e,t);function a(e){LA(o,n,i,a,s,"next",e)}function s(e){LA(o,n,i,a,s,"throw",e)}a(void 0)}))},function(e){return o.apply(this,arguments)})},{kind:"method",key:"_renderChip",value:function(e,t,r,i,o){return(0,n.dy)(PA||(PA=RA(['\n \n ',"\n ",'\n \n \n ',"\n \n \n ",'\n \n \n ',"\n \n \n "])),(0,dl.$)(MA({},e,!0)),o?(0,n.dy)(AA||(AA=RA(['\n \n ',"\n "])),this.hass.localize("ui.components.target-picker.expand"),"M18.17,12L15,8.83L16.41,7.41L21,12L16.41,16.58L15,15.17L18.17,12M5.83,12L9,15.17L7.59,16.59L3,12L7.59,7.42L9,8.83L5.83,12Z",t,e,this._handleExpand,this.hass.localize("ui.components.target-picker.expand_".concat(e))),this.hass.localize("ui.components.target-picker.expand"),"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",t,e,this._handleRemove,this.hass.localize("ui.components.target-picker.remove_".concat(e)))}},{kind:"method",key:"_renderPicker",value:function(){switch(this._addMode){case"area_id":return(0,n.dy)(SA||(SA=RA(["=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.platform&&(n[o.entity_id]=o.platform)}}catch(a){i.e(a)}finally{i.f()}e._entityPlaformLookup=n}))]}},{kind:"method",key:"updated",value:function(e){var t,r;e.has("selector")&&(e.get("selector")!==this.selector&&(null!==(t=this.selector.target.device)&&void 0!==t&&t.integration||null!==(r=this.selector.target.entity)&&void 0!==r&&r.integration)&&this._loadConfigEntries())}},{kind:"method",key:"render",value:function(){var e,t;return(0,n.dy)(r_||(r_=s_([""])),this.hass,this.value,this._filterDevices,this._filterRegEntities,this._filterEntities,null!==(e=this.selector.target.entity)&&void 0!==e&&e.device_class?[this.selector.target.entity.device_class]:void 0,null!==(t=this.selector.target.entity)&&void 0!==t&&t.domain?[this.selector.target.entity.domain]:void 0,this.disabled)}},{kind:"field",key:"_filterEntities",value:function(){var e=this;return function(t){var r,n,i,o;if((null!==(r=e.selector.target.entity)&&void 0!==r&&r.integration||null!==(n=e.selector.target.device)&&void 0!==n&&n.integration)&&(!e._entityPlaformLookup||e._entityPlaformLookup[t.entity_id]!==((null===(i=e.selector.target.entity)||void 0===i?void 0:i.integration)||(null===(o=e.selector.target.device)||void 0===o?void 0:o.integration))))return!1;return!0}}},{kind:"field",key:"_filterRegEntities",value:function(){var e=this;return function(t){var r;return null===(r=e.selector.target.entity)||void 0===r||!r.integration||t.platform===e.selector.target.entity.integration}}},{kind:"field",key:"_filterDevices",value:function(){var e=this;return function(t){var r,n,i,o,a;if(null!==(r=e.selector.target.device)&&void 0!==r&&r.manufacturer&&t.manufacturer!==e.selector.target.device.manufacturer)return!1;if(null!==(n=e.selector.target.device)&&void 0!==n&&n.model&&t.model!==e.selector.target.device.model)return!1;if((null!==(i=e.selector.target.device)&&void 0!==i&&i.integration||null!==(o=e.selector.target.entity)&&void 0!==o&&o.integration)&&(null===(a=e._configEntries)||void 0===a||!a.some((function(e){return t.config_entries.includes(e.entry_id)}))))return!1;return!0}}},{kind:"method",key:"_loadConfigEntries",value:(r=regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Bk.pB)(this.hass);case 2:this._configEntries=e.sent.filter((function(e){var r,n;return e.domain===((null===(r=t.selector.target.device)||void 0===r?void 0:r.integration)||(null===(n=t.selector.target.entity)||void 0===n?void 0:n.integration))}));case 3:case"end":return e.stop()}}),e,this)})),o=function(){var e=this,t=arguments;return new Promise((function(n,i){var o=r.apply(e,t);function a(e){a_(o,n,i,a,s,"next",e)}function s(e){a_(o,n,i,a,s,"throw",e)}a(void 0)}))},function(){return o.apply(this,arguments)})},{kind:"get",static:!0,key:"styles",value:function(){return(0,n.iv)(n_||(n_=s_(["\n ha-target-picker {\n display: block;\n }\n "])))}}]}}),(0,Bt.f)(n.oi));function S_(e){return S_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S_(e)}function D_(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function j_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x_(e,t){return x_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},x_(e,t)}function T_(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=H_(e);if(t){var i=H_(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return z_(this,r)}}function z_(e,t){if(t&&("object"===S_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return V_(e)}function V_(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function H_(e){return H_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},H_(e)}function M_(){M_=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!F_(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r']))):null===(i=this.selector.text)||void 0===i?void 0:i.suffix,this.required,"password"===(null===(o=this.selector.text)||void 0===o?void 0:o.type)?(0,n.dy)(__||(__=D_([""])),"".concat(this._unmaskedPassword?"Hide":"Show"," password"),this._toggleUnmaskedPassword,this._unmaskedPassword?"M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z":"M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z"):"")}},{kind:"method",key:"_toggleUnmaskedPassword",value:function(){this._unmaskedPassword=!this._unmaskedPassword}},{kind:"method",key:"_handleChange",value:function(e){var t=e.target.value;this.value!==t&&(""!==t||this.required||(t=void 0),(0,a.B)(this,"value-changed",{value:t}))}},{kind:"get",static:!0,key:"styles",value:function(){return(0,n.iv)(O_||(O_=D_(["\n :host {\n display: block;\n position: relative;\n }\n ha-textarea,\n ha-textfield {\n width: 100%;\n }\n ha-icon-button {\n position: absolute;\n top: 16px;\n right: 16px;\n --mdc-icon-button-size: 24px;\n --mdc-icon-size: 20px;\n color: var(--secondary-text-color);\n }\n "])))}}]}}),n.oi);var N_,$_=r(65810);r(12545);function q_(e){return q_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},q_(e)}function W_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Y_(e,t){return Y_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Y_(e,t)}function K_(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Q_(e);if(t){var i=Q_(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return X_(this,r)}}function X_(e,t){if(t&&("object"===q_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return G_(e)}function G_(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Q_(e){return Q_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Q_(e)}function J_(){J_=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!rO(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r12&&s<24&&(a=String(s-12).padStart(2,"0")),i&&0===s&&(a="12"),(0,n.dy)(N_||(t=["\n \n "],r||(r=t.slice(0)),N_=Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(r)}}))),this.label,Number(a),Number(o[1]),Number(o[2]),i?12:24,i&&(s>=12?"PM":"AM"),this.disabled,this._timeChanged,this.enableSecond)}},{kind:"method",key:"_timeChanged",value:function(e){e.stopPropagation();var t=e.detail.value,r=(0,$_.y)(this.locale),n=t.hours||0;t&&r&&("PM"===t.amPm&&n<12&&(n+=12),"AM"===t.amPm&&12===n&&(n=0));var i="".concat(n.toString().padStart(2,"0"),":").concat(t.minutes?t.minutes.toString().padStart(2,"0"):"00",":").concat(t.seconds?t.seconds.toString().padStart(2,"0"):"00");i!==this.value&&(this.value=i,(0,a.B)(this,"change"),(0,a.B)(this,"value-changed",{value:i}))}}]}}),n.oi);function cO(e){return cO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cO(e)}function lO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uO(e,t){return uO=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},uO(e,t)}function dO(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=hO(e);if(t){var i=hO(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return fO(this,r)}}function fO(e,t){if(t&&("object"===cO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return pO(e)}function pO(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hO(e){return hO=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},hO(e)}function mO(){mO=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!bO(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n "],t||(t=e.slice(0)),sO=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))),this.value,this.hass.locale,this.disabled,this.label);var e,t}}]}}),n.oi);function PO(e){return PO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},PO(e)}function AO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _O(e,t){return _O=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_O(e,t)}function OO(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=jO(e);if(t){var i=jO(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return SO(this,r)}}function SO(e,t){if(t&&("object"===PO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return DO(e)}function DO(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jO(e){return jO=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},jO(e)}function xO(){xO=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!VO(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n "],t||(t=e.slice(0)),CO=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))),this.label,this.value,this.selector.icon.fallbackPath,this.selector.icon.placeholder,this._valueChanged);var e,t}},{kind:"method",key:"_valueChanged",value:function(e){(0,a.B)(this,"value-changed",{value:e.detail.value})}}]}}),n.oi);function ZO(e){return ZO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ZO(e)}function UO(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function NO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $O(e,t){return $O=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},$O(e,t)}function qO(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=KO(e);if(t){var i=KO(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return WO(this,r)}}function WO(e,t){if(t&&("object"===ZO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return YO(e)}function YO(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function KO(e){return KO=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},KO(e)}function XO(){XO=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!JO(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r',"\n ","\n \n "])),this.label||"".concat(this.hass.localize("ui.panel.lovelace.editor.card.generic.theme")," (").concat(this.hass.localize("ui.panel.lovelace.editor.card.config.optional"),")"),this.value,this._changed,oA.U,this.hass.localize("ui.panel.lovelace.editor.card.generic.no_theme"),Object.keys(this.hass.themes.themes).sort().map((function(e){return(0,n.dy)(IO||(IO=UO(["",""])),e,e)})))}},{kind:"get",static:!0,key:"styles",value:function(){return(0,n.iv)(BO||(BO=UO(["\n mwc-select {\n width: 100%;\n }\n "])))}},{kind:"method",key:"_changed",value:function(e){this.hass&&""!==e.target.value&&(this.value="remove"===e.target.value?void 0:e.target.value,(0,a.B)(this,"value-changed",{value:this.value}))}}]}}),n.oi);function oS(e){return oS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oS(e)}function aS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sS(e,t){return sS=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},sS(e,t)}function cS(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=dS(e);if(t){var i=dS(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return lS(this,r)}}function lS(e,t){if(t&&("object"===oS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return uS(e)}function uS(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dS(e){return dS=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},dS(e)}function fS(){fS=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!mS(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n "],t||(t=e.slice(0)),iS=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))),this.hass,this.value,this.label);var e,t}}]}}),n.oi);function kS(e){return kS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kS(e)}function ES(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CS(e,t){return CS=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},CS(e,t)}function PS(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=OS(e);if(t){var i=OS(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return AS(this,r)}}function AS(e,t){if(t&&("object"===kS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _S(e)}function _S(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function OS(e){return OS=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},OS(e)}function SS(){SS=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!xS(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function c(t,e,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=i.maxScanDistance||u,s=i.brackets||h,c=(0,a.qz)(t),v=c.resolve(e,n);return(r=l(v.type,n,s))?f(t,e,n,v,r,s):d(t,e,n,c,v.type,o,s)}function f(t,e,n,r,i,o){var a=r.parent,s={from:r.from,to:r.to},u=0,h=null==a?void 0:a.cursor;if(h&&(n<0?h.childBefore(r.from):h.childAfter(r.to)))do{if(n<0?h.to<=r.from:h.from>=r.to){if(0==u&&i.indexOf(h.type.name)>-1)return{start:s,end:{from:h.from,to:h.to},matched:!0};if(l(h.type,n,o))u++;else if(l(h.type,-n,o)&&0==--u)return{start:s,end:{from:h.from,to:h.to},matched:!1}}}while(n<0?h.prevSibling():h.nextSibling());return{start:s,matched:!1}}function d(t,e,n,r,i,o,a){var s=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),u=a.indexOf(s);if(u<0||u%2==0!=n>0)return null;for(var h={from:n<0?e-1:e,to:n>0?e+1:e},l=t.doc.iterRange(e,n>0?t.doc.length:0),c=0,f=0;!l.next().done&&f<=o;){var d=l.value;n<0&&(f+=d.length);for(var v=e+f*n,p=n>0?0:d.length-1,g=n>0?d.length:-1;p!=g;p+=n){var m=a.indexOf(d[p]);if(!(m<0||r.resolve(v+p,1).type!=i))if(m%2==0==n>0)c++;else{if(1==c)return{start:h,end:{from:v+p,to:v+p+1},matched:m>>1==u>>1};c--}}n>0&&(f+=d.length)}return l.done?{start:h,matched:!1}:null}function v(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return p(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function C(t,e,n){for(var i=(0,a.qz)(t).resolveInner(e.head),o=n?s.md.closedBy:s.md.openedBy,u=e.head;;){var h=n?i.childAfter(u):i.childBefore(u);if(!h)break;A(t,h,o)?i=h:u=n?h.to:h.from}var l,f;return f=i.type.prop(o)&&(l=n?c(t,i.from,1):c(t,i.to,-1))&&l.matched?n?l.end.to:l.end.from:n?i.to:i.from,r.jT.cursor(f,n?-1:1)}function M(t,e){return y(t,(function(n){if(!n.empty)return k(n,e);var r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)}))}var O=function(t){return M(t,!1)},T=function(t){return M(t,!0)};function D(t,e){return y(t,(function(n){return n.empty?t.moveVertically(n,e,t.dom.clientHeight):k(n,e)}))}var E=function(t){return D(t,!1)},P=function(t){return D(t,!0)};function R(t,e,n){var i=t.visualLineAt(e.head),o=t.moveToLineBoundary(e,n);if(o.head==e.head&&o.head!=(n?i.to:i.from)&&(o=t.moveToLineBoundary(e,n,!1)),!n&&o.head==i.from&&i.length){var a=/^\s*/.exec(t.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;a&&e.head!=i.from+a&&(o=r.jT.cursor(i.from+a))}return o}var L=function(t){return y(t,(function(e){return R(t,e,!0)}))},B=function(t){return y(t,(function(e){return R(t,e,!1)}))};function I(t,e,n){var i=!1,o=g(t.selection,(function(e){var o=c(t,e.head,-1)||c(t,e.head,1)||e.head>0&&c(t,e.head-1,1)||e.headn&&(o="delete.forward"),n=Math.min(n,a),i=Math.max(i,a)}return n==i?{range:t}:{changes:{from:n,to:i},range:r.jT.cursor(n)}}));return!a.changes.empty&&(i(n.update(a,{scrollIntoView:!0,userEvent:o})),!0)}function tt(t,e,n){if(t instanceof o.tk){var r,i=v(t.pluginField(o.BF.atomicRanges));try{for(i.s();!(r=i.n()).done;){r.value.between(e,e,(function(t,r){te&&(e=n?r:t)}))}}catch(a){i.e(a)}finally{i.f()}}return e}var et=function(t,e){return Z(t,(function(n){var r,o,s=t.state,u=s.doc.lineAt(n);if(!e&&n>u.from&&n=a.number){var u=n[n.length-1];u.to=s.to,u.ranges.push(o)}else n.push({from:a.from,to:s.to,ranges:[o]});r=s.number+1}}catch(h){i.e(h)}finally{i.f()}return n}function ut(t,e,n){if(t.readOnly)return!1;var i,o=[],a=[],s=v(st(t));try{for(s.s();!(i=s.n()).done;){var u=i.value;if(n?u.to!=t.doc.length:0!=u.from){var h=t.doc.lineAt(n?u.to+1:u.from-1),l=h.length+1;if(n){o.push({from:u.to,to:h.to},{from:u.from,insert:h.text+t.lineBreak});var c,f=v(u.ranges);try{for(f.s();!(c=f.n()).done;){var d=c.value;a.push(r.jT.range(Math.min(t.doc.length,d.anchor+l),Math.min(t.doc.length,d.head+l)))}}catch(y){f.e(y)}finally{f.f()}}else{o.push({from:h.from,to:u.from},{from:u.to,insert:t.lineBreak+h.text});var p,g=v(u.ranges);try{for(g.s();!(p=g.n()).done;){var m=p.value;a.push(r.jT.range(m.anchor-l,m.head-l))}}catch(y){g.e(y)}finally{g.f()}}}}}catch(y){s.e(y)}finally{s.f()}return!!o.length&&(e(t.update({changes:o,scrollIntoView:!0,selection:r.jT.create(a,t.selection.mainIndex),userEvent:"move.line"})),!0)}function ht(t,e,n){if(t.readOnly)return!1;var r,i=[],o=v(st(t));try{for(o.s();!(r=o.n()).done;){var a=r.value;n?i.push({from:a.from,insert:t.doc.slice(a.from,a.to)+t.lineBreak}):i.push({from:a.to,insert:t.lineBreak+t.doc.slice(a.from,a.to)})}}catch(s){o.e(s)}finally{o.f()}return e(t.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}var lt=ct(!1);function ct(t){return function(e){var n=e.state,o=e.dispatch;if(n.readOnly)return!1;var u=n.changeByRange((function(e){var o=e.from,u=e.to,h=n.doc.lineAt(o),l=!t&&o==u&&function(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};var n,r=(0,a.qz)(t).resolveInner(e),i=r.childBefore(e),o=r.childAfter(e);return i&&o&&i.to<=e&&o.from>=e&&(n=i.type.prop(s.md.closedBy))&&n.indexOf(o.name)>-1&&t.doc.lineAt(i.to).from==t.doc.lineAt(o.from).from?{from:i.to,to:o.from}:null}(n,o);t&&(o=u=(u<=h.to?h:n.doc.lineAt(u)).to);var c=new a.Gn(n,{simulateBreak:o,simulateDoubleBreak:!!l}),f=(0,a.K0)(c,o);for(null==f&&(f=/^\s*/.exec(n.doc.lineAt(o).text)[0].length);uh.from&&on&&(i.empty||i.to>s.from)&&(e(s,o,i),n=s.number),a=s.to+1}var u=t.changes(o);return{changes:o,range:r.jT.range(u.mapPos(i.anchor,1),u.mapPos(i.head,1))}}))}var dt=function(t){var e=t.state,n=t.dispatch;return!e.readOnly&&(n(e.update(ft(e,(function(t,n){n.push({from:t.from,insert:e.facet(a.c)})})),{userEvent:"input.indent"})),!0)},vt=function(t){var e=t.state,n=t.dispatch;return!e.readOnly&&(n(e.update(ft(e,(function(t,n){var r=/^\s*/.exec(t.text)[0];if(r){for(var o=(0,i.IS)(r,e.tabSize),s=0,u=(0,a.SS)(e,Math.max(0,o-(0,a.y1)(e)));s1?o=r.jT.create([i.main]):i.main.empty||(o=r.jT.create([r.jT.cursor(i.main.head)])),!!o&&(n(m(e,o)),!0)}},{key:"Mod-Enter",run:ct(!0)},{key:"Alt-l",mac:"Ctrl-l",run:function(t){var e=t.state,n=t.dispatch,i=st(e).map((function(t){var n=t.from,i=t.to;return r.jT.range(n,Math.min(i+1,e.doc.length))}));return n(e.update({selection:r.jT.create(i),userEvent:"select"})),!0}},{key:"Mod-i",run:function(t){var e=t.state,n=t.dispatch,i=g(e.selection,(function(t){for(var n,i=(0,a.qz)(e).resolveInner(t.head,1);!(i.from=t.to||i.to>t.to&&i.from<=t.from)&&(null===(n=i.parent)||void 0===n?void 0:n.parent);)i=i.parent;return r.jT.range(i.to,i.from)}));return n(m(e,i)),!0},preventDefault:!0},{key:"Mod-[",run:vt},{key:"Mod-]",run:dt},{key:"Mod-Alt-\\",run:function(t){var e=t.state,n=t.dispatch;if(e.readOnly)return!1;var r=Object.create(null),i=new a.Gn(e,{overrideIndentation:function(t){var e=r[t];return null==e?-1:e}}),o=ft(e,(function(t,n,o){var s=(0,a.K0)(i,t.from);if(null!=s){/\S/.test(t.text)||(s=0);var u=/^\s*/.exec(t.text)[0],h=(0,a.SS)(e,s);(u!=h||o.from0?n--:rn?n:Math.max(0,e-1),!1)}))}},{mac:"Mod-Delete",run:at}].concat([{key:"Ctrl-b",run:w,shift:V,preventDefault:!0},{key:"Ctrl-f",run:x,shift:_},{key:"Ctrl-p",run:O,shift:W},{key:"Ctrl-n",run:T,shift:q},{key:"Ctrl-a",run:function(t){return y(t,(function(e){return r.jT.cursor(t.visualLineAt(e.head).from,1)}))},shift:function(t){return N(t,(function(e){return r.jT.cursor(t.visualLineAt(e.head).from)}))}},{key:"Ctrl-e",run:function(t){return y(t,(function(e){return r.jT.cursor(t.visualLineAt(e.head).to,-1)}))},shift:function(t){return N(t,(function(e){return r.jT.cursor(t.visualLineAt(e.head).to)}))}},{key:"Ctrl-d",run:rt},{key:"Ctrl-h",run:nt},{key:"Ctrl-k",run:at},{key:"Ctrl-Alt-h",run:ot},{key:"Ctrl-o",run:function(t){var e=t.state,n=t.dispatch;if(e.readOnly)return!1;var o=e.changeByRange((function(t){return{changes:{from:t.from,to:t.to,insert:i.xv.of(["",""])},range:r.jT.cursor(t.from)}}));return n(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:function(t){var e=t.state,n=t.dispatch;if(e.readOnly)return!1;var o=e.changeByRange((function(t){if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};var n=t.from,o=e.doc.lineAt(n),a=n==o.from?n-1:(0,i.cp)(o.text,n-o.from,!1)+o.from,s=n==o.to?n+1:(0,i.cp)(o.text,n-o.from,!0)+o.from;return{changes:{from:a,to:s,insert:e.doc.slice(n,s).append(e.doc.slice(a,n))},range:r.jT.cursor(s)}}));return!o.changes.empty&&(n(e.update(o,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Alt-<",run:J},{key:"Alt->",run:X},{key:"Ctrl-v",run:P},{key:"Alt-v",run:E}].map((function(t){return{mac:t.key,run:t.run,shift:t.shift}}))))},55987:function(t,e,n){n.d(e,{Eu:function(){return B}});var r=n(91643),i=n(67037),o=n(74075);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return u(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nthis.i;)t.dom.removeChild(t.elements.pop().dom)}}]),t}(),O=function(){function t(e,n){var r=this;h(this,t),this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");var i=function(t){r.dom.addEventListener(t,(function(r){var i=e.visualLineAtHeight(r.clientY,e.contentDOM.getBoundingClientRect().top);n.domEventHandlers[t](e,i,r)&&r.preventDefault()}))};for(var o in n.domEventHandlers)i(o);this.markers=A(n.markers(e)),n.initialSpacer&&(this.spacer=new T(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}return c(t,[{key:"update",value:function(t){var e=this.markers;if(this.markers=A(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){var n=this.config.updateSpacer(this.spacer.markers[0],t);n!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[n])}var r=t.view.viewport;return!i.Xs.eq(this.markers,e,r.from,r.to)}}]),t}(),T=function(){function t(e,n,r,i){h(this,t),this.height=-1,this.above=0,this.dom=document.createElement("div"),this.update(e,n,r,i)}return c(t,[{key:"update",value:function(t,e,n,r){if(this.height!=e&&(this.dom.style.height=(this.height=e)+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),this.markers!=r){this.markers=r;for(var i;i=this.dom.lastChild;)i.remove();var o,a="cm-gutterElement",u=s(r);try{for(u.s();!(o=u.n()).done;){var h=o.value;h.toDOM&&this.dom.appendChild(h.toDOM(t));var l=h.elementClass;l&&(a+=" "+l)}}catch(c){u.e(c)}finally{u.f()}this.dom.className=a}}}]),t}();var D=o.r$.define(),E=o.r$.define({combine:function(t){return(0,o.BO)(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers:function(t,e){var n=Object.assign({},t),r=function(t){var r=n[t],i=e[t];n[t]=r?function(t,e,n){return r(t,e,n)||i(t,e,n)}:i};for(var i in e)r(i);return n}})}}),P=function(t){f(n,t);var e=v(n);function n(t){var r;return h(this,n),(r=e.call(this)).number=t,r}return c(n,[{key:"eq",value:function(t){return this.number==t.number}},{key:"toDOM",value:function(t){return document.createTextNode(this.number)}}]),n}(m);function R(t,e){return t.state.facet(E).formatNumber(e,t.state)}var L=k.compute([E],(function(t){return{class:"cm-lineNumbers",renderEmptyElements:!1,markers:function(t){return t.state.facet(D)},lineMarker:function(t,e,n){return n.some((function(t){return t.toDOM}))?null:new P(R(t,t.state.doc.lineAt(e.from).number))},initialSpacer:function(t){return new P(R(t,I(t.state.doc.lines)))},updateSpacer:function(t,e){var n=R(e.view,I(e.view.state.doc.lines));return n==t.number?t:new P(n)},domEventHandlers:t.facet(E).domEventHandlers}}));function B(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[E.of(t),x(),L]}function I(t){for(var e=9;e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n-1?e:m.get(e.base||e,e.modified.concat(t).sort((function(t,e){return t.id-e.id})))}}}]),t}(),g=0,m=function(){function t(){c(this,t),this.instances=[],this.id=g++}return d(t,null,[{key:"get",value:function(e,n){if(!n.length)return e;var r=n[0].instances.find((function(t){return t.base==e&&(r=n,i=t.modified,r.length==i.length&&r.every((function(t,e){return t==i[e]})));var r,i}));if(r)return r;var i,o=[],a=new p(o,e,n),s=h(n);try{for(s.s();!(i=s.n()).done;){i.value.instances.push(a)}}catch(m){s.e(m)}finally{s.f()}var u,l=y(n),c=h(e.set);try{for(c.s();!(u=c.n()).done;){var f,d=u.value,v=h(l);try{for(v.s();!(f=v.n()).done;){var g=f.value;o.push(t.get(d,g))}}catch(m){v.e(m)}finally{v.f()}}}catch(m){c.e(m)}finally{c.f()}return a}}]),t}();function y(t){for(var e=[t],n=0;n0&&c+3==a.length){u=1;break}var f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!f)throw new RangeError("Invalid path: "+a);if(s.push("*"==f[0]?null:'"'==f[0][0]?JSON.parse(f[0]):f[0]),(c+=f[0].length)==a.length)break;var d=a[c++];if(c==a.length&&"!"==d){u=0;break}if("/"!=d)throw new RangeError("Invalid path: "+a);l=a.slice(c)}var v=s.length-1,p=s[v];if(!p)throw new RangeError("Invalid path: "+a);var g=new A(r,u,v>0?s.slice(0,v):null);e[p]=g.sort(e[p])}}}catch(m){o.e(m)}finally{o.f()}}return b.add(e)}var b=new r.md,w=a.r$.define({combine:function(t){return t.length?C.combinedMatch(t):null}}),x=a.r$.define({combine:function(t){return t.length?t[0].match:null}});function S(t){return t.facet(w)||t.facet(x)}var A=function(){function t(e,n,r,i){c(this,t),this.tags=e,this.mode=n,this.context=r,this.next=i}return d(t,[{key:"sort",value:function(t){return!t||t.depththis.at&&(this.at=t),this.class=e)}},{key:"flush",value:function(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}},{key:"highlightRange",value:function(t,e,n,i,o,a){var s=t.type,u=t.from,l=t.to;if(!(u>=n||l<=e)){T[o]=s.name,s.isTop&&(a=s);for(var c=i,f=s.prop(b),d=!1;f;){if(!f.context||P(f.context,T,o)){var v,p=h(f.tags);try{for(p.s();!(v=p.n()).done;){var g=v.value,m=this.style(g,a);m&&(c&&(c+=" "),c+=m,1==f.mode?i+=(i?" ":"")+m:0==f.mode&&(d=!0))}}catch(D){p.e(D)}finally{p.f()}break}f=f.next}if(this.startSpan(t.from,c),!d){var y=t.tree&&t.tree.prop(r.md.mounted);if(y&&y.overlay){for(var k=t.node.enter(y.overlay[0].from+u,1),w=t.firstChild(),x=0,S=u;;x++){var A=x=C)&&t.nextSibling()););if(!A||C>n)break;(S=A.to+u)>e&&(this.highlightRange(k.cursor,Math.max(e,A.from+u),Math.min(n,S),i,o,y.tree.type),this.startSpan(S,c))}w&&t.parent()}else if(t.firstChild()){do{if(!(t.to<=e)){if(t.from>=n)break;this.highlightRange(t,e,n,i,o+1,a),this.startSpan(Math.min(n,t.to),c)}}while(t.nextSibling());t.parent()}}}}}]),t}();function E(t,e,n,r,i){var o=new D(e,r,i);o.highlightRange(t.cursor(),e,n,"",0,t.type),o.flush(n)}function P(t,e,n){if(t.length>n-1)return!1;for(var r=n-1,i=t.length-1;i>=0;i--,r--){var o=t[i];if(o&&o!=e[r])return!1}return!0}var R=p.define,L=R(),B=R(),I=R(B),N=R(B),j=R(),V=R(j),_=R(j),H=R(),z=R(H),W=R(),q=R(),F=R(),$=R(F),K=R(),U={comment:L,lineComment:R(L),blockComment:R(L),docComment:R(L),name:B,variableName:R(B),typeName:I,tagName:R(I),propertyName:N,attributeName:R(N),className:R(B),labelName:R(B),namespace:R(B),macroName:R(B),literal:j,string:V,docString:R(V),character:R(V),attributeValue:R(V),number:_,integer:R(_),float:R(_),bool:R(j),regexp:R(j),escape:R(j),color:R(j),url:R(j),keyword:W,self:R(W),null:R(W),atom:R(W),unit:R(W),modifier:R(W),operatorKeyword:R(W),controlKeyword:R(W),definitionKeyword:R(W),operator:q,derefOperator:R(q),arithmeticOperator:R(q),logicOperator:R(q),bitwiseOperator:R(q),compareOperator:R(q),updateOperator:R(q),definitionOperator:R(q),typeOperator:R(q),controlOperator:R(q),punctuation:F,separator:R(F),bracket:$,angleBracket:R($),squareBracket:R($),paren:R($),brace:R($),content:H,heading:z,heading1:R(z),heading2:R(z),heading3:R(z),heading4:R(z),heading5:R(z),heading6:R(z),contentSeparator:R(H),list:R(H),quote:R(H),emphasis:R(H),strong:R(H),link:R(H),monospace:R(H),strikethrough:R(H),inserted:R(),deleted:R(),changed:R(),invalid:R(),meta:K,documentMeta:R(K),annotation:R(K),processingInstruction:R(K),definition:p.defineModifier(),constant:p.defineModifier(),function:p.defineModifier(),standard:p.defineModifier(),local:p.defineModifier(),special:p.defineModifier()};U.link,U.heading,U.emphasis,U.strong,U.strikethrough,U.keyword,U.atom,U.bool,U.url,U.contentSeparator,U.labelName,U.literal,U.inserted,U.string,U.deleted,U.regexp,U.escape,U.string,U.variableName,U.variableName,U.typeName,U.namespace,U.className,U.variableName,U.macroName,U.propertyName,U.comment,U.meta,U.invalid,U.link,U.heading,U.emphasis,U.strong,U.keyword,U.atom,U.bool,U.url,U.labelName,U.inserted,U.deleted,U.literal,U.string,U.number,U.regexp,U.escape,U.string,U.variableName,U.variableName,U.variableName,U.variableName,U.typeName,U.namespace,U.macroName,U.propertyName,U.operator,U.comment,U.meta,U.invalid,U.punctuation},74506:function(t,e,n){n.d(e,{m8:function(){return p},f$:function(){return E}});var r=n(74075),i=n(91643);function o(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{};return[v,d.of(t),i.tk.domEventHandlers({beforeinput:function(t,e){return"historyUndo"==t.inputType?m(e):"historyRedo"==t.inputType&&y(e)}})]}function g(t,e){return function(n){var r=n.state,i=n.dispatch,o=r.field(v,!1);if(!o)return!1;var a=o.pop(t,r,e);return!!a&&(i(a),!0)}}var m=g(0,!1),y=g(1,!1),k=g(0,!0),b=g(1,!0);var w=function(){function t(e,n,r,i,o){s(this,t),this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}return h(t,[{key:"setSelAfter",value:function(e){return new t(this.changes,this.effects,this.mapped,this.startSelection,e)}},{key:"toJSON",value:function(){var t,e,n;return{changes:null===(t=this.changes)||void 0===t?void 0:t.toJSON(),mapped:null===(e=this.mapped)||void 0===e?void 0:e.toJSON(),startSelection:null===(n=this.startSelection)||void 0===n?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map((function(t){return t.toJSON()}))}}}],[{key:"fromJSON",value:function(e){return new t(e.changes&&r.as.fromJSON(e.changes),[],e.mapped&&r.n0.fromJSON(e.mapped),e.startSelection&&r.jT.fromJSON(e.startSelection),e.selectionsAfter.map(r.jT.fromJSON))}},{key:"fromTransaction",value:function(e){var n,r=A,i=o(e.startState.facet(f));try{for(i.s();!(n=i.n()).done;){var a=(0,n.value)(e);a.length&&(r=r.concat(a))}}catch(s){i.e(s)}finally{i.f()}return!r.length&&e.changes.empty?null:new t(e.changes.invert(e.startState.doc),r,void 0,e.startState.selection,A)}},{key:"selection",value:function(e){return new t(void 0,A,void 0,void 0,e)}}]),t}();function x(t,e,n,r){var i=e+1>n+20?e-n-1:0,o=t.slice(i,e);return o.push(r),o}function S(t,e){return t.length?e.length?t.concat(e):t:e}var A=[];function C(t,e){if(t.length){var n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),x(t,t.length-1,1e9,n.setSelAfter(r)))}return[w.selection([e])]}function M(t){var e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function O(t,e){if(!t.length)return t;for(var n=t.length,r=A;n;){var i=T(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){var o=t.slice(0,n);return o[n-1]=i,o}e=i.mapped,n--,r=i.selectionsAfter}return r.length?[w.selection(r)]:A}function T(t,e,n){var i=S(t.selectionsAfter.length?t.selectionsAfter.map((function(t){return t.map(e)})):A,n);if(!t.changes)return w.selection(i);var o=t.changes.map(e),a=e.mapDesc(t.changes,!0),s=t.mapped?t.mapped.composeDesc(a):a;return new w(o,r.Py.mapEffects(t.effects,e),s,t.startSelection.map(a),i)}var D=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;s(this,t),this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}return h(t,[{key:"isolate",value:function(){return this.prevTime?new t(this.done,this.undone):this}},{key:"addChanges",value:function(e,n,r,i,o){var a=this.done,s=a[a.length-1];return a=s&&s.changes&&!s.changes.empty&&e.changes&&(!s.selectionsAfter.length&&n-this.prevTime=s&&i<=u&&(r=!0)}})),r}(s.changes,e.changes)||"input.type.compose"==r)?x(a,a.length-1,o,new w(e.changes.compose(s.changes),S(e.effects,s.effects),s.mapped,s.startSelection,A)):x(a,a.length,o,e),new t(a,A,n,r)}},{key:"addSelection",value:function(e,n,r,i){var o,a,s=this.done.length?this.done[this.done.length-1].selectionsAfter:A;return s.length>0&&n-this.prevTime=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:[];p(this,t),this.data=e,this.topNode=r,i.yy.prototype.hasOwnProperty("tree")||Object.defineProperty(i.yy.prototype,"tree",{get:function(){return x(this)}}),this.parser=n,this.extension=[P.of(this),i.yy.languageData.of((function(t,e,n){return t.facet(w(t,e,n))}))].concat(o)}return m(t,[{key:"isActiveAt",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;return w(t,e,n)==this.data}},{key:"findRegions",value:function(t){var e=this,n=t.facet(P);if((null==n?void 0:n.data)==this.data)return[{from:0,to:t.doc.length}];if(!n||!n.allowsNesting)return[];var i=[];return function t(n,o){if(n.prop(y)!=e.data){var a=n.prop(r.md.mounted);if(a){if(a.tree.prop(y)==e.data){if(a.overlay){var s,u=d(a.overlay);try{for(u.s();!(s=u.n()).done;){var h=s.value;i.push({from:h.from+o,to:h.to+o})}}catch(v){u.e(v)}finally{u.f()}}else i.push({from:o,to:o+n.length});return}if(a.overlay){var l=i.length;if(t(a.tree,a.overlay[0].from+o),i.length>l)return}}for(var c=0;c1&&void 0!==arguments[1]?arguments[1]:e.length;p(this,t),this.doc=e,this.length=n,this.cursorPos=0,this.string="",this.cursor=e.iter()}return m(t,[{key:"syncTo",value:function(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}},{key:"chunk",value:function(t){return this.syncTo(t),this.string}},{key:"lineChunks",get:function(){return!0}},{key:"read",value:function(t,e){var n=this.cursorPos-this.string.length;return t=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-n,e-n)}}]),t}(),A=null,C=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0,u=arguments.length>7?arguments[7]:void 0;p(this,t),this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=a,this.skipped=s,this.scheduleOn=u,this.parse=null,this.tempSkipped=[]}return m(t,[{key:"startParse",value:function(){return this.parser.startParse(new S(this.state.doc),this.fragments)}},{key:"work",value:function(t,e){var n=this;return null!=e&&e>=this.state.doc.length&&(e=void 0),this.tree!=r.mp.empty&&(null==e?this.treeLen==this.state.doc.length:this.treeLen>=e)?(this.takeTree(),!0):this.withContext((function(){var i;n.parse||(n.parse=n.startParse()),null!=e&&(null==n.parse.stoppedAt||n.parse.stoppedAt>e)&&eo)return!1}}))}},{key:"takeTree",value:function(){var t,e,n=this;this.parse&&(t=this.parse.parsedPos)>this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext((function(){for(;!(e=n.parse.advance()););})),this.tree=e,this.fragments=this.withoutTempSkipped(r.i9.addTree(this.tree,this.fragments,!0)),this.parse=null)}},{key:"withContext",value:function(t){var e=A;A=this;try{return t()}finally{A=e}}},{key:"withoutTempSkipped",value:function(t){for(var e;e=this.tempSkipped.pop();)t=M(t,e.from,e.to);return t}},{key:"changes",value:function(e,n){var i=this.fragments,o=this.tree,a=this.treeLen,s=this.viewport,u=this.skipped;if(this.takeTree(),!e.empty){var h=[];if(e.iterChangedRanges((function(t,e,n,r){return h.push({fromA:t,toA:e,fromB:n,toB:r})})),i=r.i9.applyChanges(i,h),o=r.mp.empty,a=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){u=[];var l,c=d(this.skipped);try{for(c.s();!(l=c.n()).done;){var f=l.value,v=e.mapPos(f.from,1),p=e.mapPos(f.to,-1);vt.from&&(this.fragments=M(this.fragments,i,o),this.skipped.splice(n--,1))}return this.skipped.length=t}}],[{key:"getSkippingParser",value:function(t){return new(function(e){u(i,e);var n=l(i);function i(){return p(this,i),n.apply(this,arguments)}return m(i,[{key:"createParse",value:function(e,n,i){var o=i[0].from,a=i[i.length-1].to;return{parsedPos:o,advance:function(){var e=A;if(e){var n,s=d(i);try{for(s.s();!(n=s.n()).done;){var u=n.value;e.tempSkipped.push(u)}}catch(h){s.e(h)}finally{s.f()}t&&(e.scheduleOn=e.scheduleOn?Promise.all([e.scheduleOn,t]):t)}return this.parsedPos=a,new r.mp(r.Jq.none,[],[],a-o)},stoppedAt:null,stopAt:function(){}}}}]),i}(r._b))}},{key:"get",value:function(){return A}}]),t}();function M(t,e,n){return r.i9.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}var O=function(){function t(e){p(this,t),this.context=e,this.tree=e.tree}return m(t,[{key:"apply",value:function(e){if(!e.docChanged)return this;var n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(25,r)||n.takeTree(),new t(n)}}],[{key:"init",value:function(e){var n=new C(e.facet(P).parser,e,[],r.mp.empty,0,{from:0,to:e.doc.length},[],null);return n.work(25)||n.takeTree(),new t(n)}}]),t}();b.state=i.QQ.define({create:O.init,update:function(t,e){var n,r=d(e.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.is(b.setState))return i.value}}catch(o){r.e(o)}finally{r.f()}return e.startState.facet(P)!=e.state.facet(P)?O.init(e.state):t.apply(e)}});var T="undefined"!=typeof window&&window.requestIdleCallback||function(t,e){var n=e.timeout;return setTimeout(t,n)},D="undefined"!=typeof window&&window.cancelIdleCallback||clearTimeout,E=o.lg.fromClass(function(){function t(e){p(this,t),this.view=e,this.working=-1,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}return m(t,[{key:"update",value:function(t){var e=this.view.state.field(b.state).context;t.viewportChanged&&(e.updateViewport(t.view.viewport)&&e.reset(),this.view.viewport.to>e.treeLen&&this.scheduleWork()),t.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}},{key:"scheduleWork",value:function(){if(!(this.working>-1)){var t=this.view.state,e=t.field(b.state),n=e.context.fragments;e.tree==e.context.tree&&e.context.treeLen>=t.doc.length&&n.length&&0==n[0].from&&n[0].to>=t.doc.length||(this.working=T(this.work,{timeout:500}))}}},{key:"work",value:function(t){this.working=-1;var e=Date.now();if(this.chunkEnd=i+1e6)){var a=Math.min(this.chunkBudget,t?Math.max(25,t.timeRemaining()):100),s=o.context.work(a,i+1e6);this.chunkBudget-=Date.now()-e,(s||this.chunkBudget<=0||o.context.movedPast(i))&&(o.context.takeTree(),this.view.dispatch({effects:b.setState.of(new O(o.context))})),!s&&this.chunkBudget>0&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}}}},{key:"checkAsyncSchedule",value:function(t){var e=this;t.scheduleOn&&(t.scheduleOn.then((function(){return e.scheduleWork()})),t.scheduleOn=null)}},{key:"destroy",value:function(){this.working>=0&&D(this.working)}}]),t}(),{eventHandlers:{focus:function(){this.scheduleWork()}}}),P=i.r$.define({combine:function(t){return t.length?t[0]:null},enables:[b.state,E]}),R=i.r$.define(),L=i.r$.define({combine:function(t){if(!t.length)return" ";if(!/^(?: +|\t+)$/.test(t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return t[0]}});function B(t){var e=t.facet(L);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length}function I(t,e){var n="",r=t.tabSize;if(9==t.facet(L).charCodeAt(0))for(;e>=r;)n+="\t",e-=r;for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};p(this,t),this.state=e,this.options=n,this.unit=B(e)}return m(t,[{key:"lineAt",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.state.doc.lineAt(t),r=this.options.simulateBreak;return null!=r&&r>=n.from&&r<=n.to?(e<0?r1&&void 0!==arguments[1]?arguments[1]:1;if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";var n=this.lineAt(t,e),r=n.text,i=n.from;return r.slice(t-i,Math.min(r.length,t+100-i))}},{key:"column",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.lineAt(t,e),r=n.text,i=n.from,o=this.countColumn(r,t-i),a=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return a>-1&&(o+=a-this.countColumn(r,r.search(/\S|$/))),o}},{key:"countColumn",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.length;return(0,a.IS)(t,this.state.tabSize,e)}},{key:"lineIndent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.lineAt(t,e),r=n.text,i=n.from,o=this.options.overrideIndentation;if(o){var a=o(i);if(a>-1)return a}return this.countColumn(r,r.search(/\S|$/))}},{key:"simulatedBreak",get:function(){return this.options.simulateBreak||null}}]),t}(),V=new r.md;function _(t){var e=t.type.prop(V);if(e)return e;var n,i=t.firstChild;if(i&&(n=i.type.prop(r.md.closedBy))){var o=t.lastChild,a=o&&n.indexOf(o.name)>-1;return function(t){return F(t,!0,1,void 0,a&&!function(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}(t)?o.from:void 0)}}return null==t.parent?z:null}function H(t,e,n){for(;t;t=t.parent){var r=_(t);if(r)return r(new W(n,e,t))}return null}function z(){return 0}var W=function(t){u(n,t);var e=l(n);function n(t,r,i){var o;return p(this,n),(o=e.call(this,t.state,t.options)).base=t,o.pos=r,o.node=i,o}return m(n,[{key:"textAfter",get:function(){return this.textAfterPos(this.pos)}},{key:"baseIndent",get:function(){for(var t=this.state.doc.lineAt(this.node.from);;){for(var e=this.node.resolve(t.from);e.parent&&e.parent.from==e.from;)e=e.parent;if(q(e,this.node))break;t=this.state.doc.lineAt(e.from)}return this.lineIndent(t.from)}},{key:"continue",value:function(){var t=this.node.parent;return t?H(t,this.pos,this.base):0}}]),n}(j);function q(t,e){for(var n=e;n;n=n.parent)if(t==n)return!0;return!1}function F(t,e,n,r,i){var o=t.textAfter,a=o.match(/^\s*/)[0].length,s=r&&o.slice(a,a+r.length)==r||i==t.pos+a,u=e?function(t){var e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;for(var i=t.options.simulateBreak,o=t.state.doc.lineAt(n.from),a=null==i||i<=o.from?o.to:Math.min(o.to,i),s=n.to;;){var u=e.childAfter(s);if(!u||u==r)return null;if(!u.type.isSkipped)return u.from!?|~^]/,o=/^[:\[\(\{]/,a=["true","false"],s=/^(\d[+\-\*\/])?\d+(\.\d+)?/;function u(t,e){var n=t.peek();if(e.incomment)return t.skipTo("#}")?(t.eatWhile(/\#|}/),e.incomment=!1):t.skipToEnd(),"comment";if(e.intag){if(e.operator){if(e.operator=!1,t.match(a))return"atom";if(t.match(s))return"number"}if(e.sign){if(e.sign=!1,t.match(a))return"atom";if(t.match(s))return"number"}if(e.instring)return n==e.instring&&(e.instring=!1),t.next(),"string";if("'"==n||'"'==n)return e.instring=n,t.next(),"string";if(t.match(e.intag+"}")||t.eat("-")&&t.match(e.intag+"}"))return e.intag=!1,"tag";if(t.match(i))return e.operator=!0,"operator";if(t.match(o))e.sign=!0;else if(t.eat(" ")||t.sol()){if(t.match(r))return"keyword";if(t.match(a))return"atom";if(t.match(s))return"number";t.sol()&&t.next()}else t.next();return"variable"}if(t.eat("{")){if(t.eat("#"))return e.incomment=!0,t.skipTo("#}")?(t.eatWhile(/\#|}/),e.incomment=!1):t.skipToEnd(),"comment";if(n=t.eat(/\{|%/))return e.intag=n,"{"==n&&(e.intag="}"),t.eat("-"),"tag"}t.next()}r=new RegExp("(("+r.join(")|(")+"))\\b"),a=new RegExp("(("+a.join(")|(")+"))\\b");var h={startState:function(){return{tokenize:u}},token:function(t,e){return e.tokenize(t,e)},languageData:{commentTokens:{block:{open:"{#",close:"#}"}}}}},76697:function(t,e,n){n.d(e,{r:function(){return i}});var r=new RegExp("\\b(("+["true","false","on","off","yes","no"].join(")|(")+"))$","i"),i={token:function(t,e){var n=t.peek(),i=e.escaped;if(e.escaped=!1,"#"==n&&(0==t.pos||/\s/.test(t.string.charAt(t.pos-1))))return t.skipToEnd(),"comment";if(t.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(e.literal&&t.indentation()>e.keyCol)return t.skipToEnd(),"string";if(e.literal&&(e.literal=!1),t.sol()){if(e.keyCol=0,e.pair=!1,e.pairStart=!1,t.match("---"))return"def";if(t.match("..."))return"def";if(t.match(/^\s*-\s+/))return"meta"}if(t.match(/^(\{|\}|\[|\])/))return"{"==n?e.inlinePairs++:"}"==n?e.inlinePairs--:"["==n?e.inlineList++:e.inlineList--,"meta";if(e.inlineList>0&&!i&&","==n)return t.next(),"meta";if(e.inlinePairs>0&&!i&&","==n)return e.keyCol=0,e.pair=!1,e.pairStart=!1,t.next(),"meta";if(e.pairStart){if(t.match(/^\s*(\||\>)\s*/))return e.literal=!0,"meta";if(t.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable";if(0==e.inlinePairs&&t.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(e.inlinePairs>0&&t.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(t.match(r))return"keyword"}return!e.pair&&t.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(e.pair=!0,e.keyCol=t.indentation(),"atom"):e.pair&&t.match(/^:\s*/)?(e.pairStart=!0,"meta"):(e.pairStart=!1,e.escaped="\\"==n,t.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}},languageData:{commentTokens:{line:"#"}}}},67037:function(t,e,n){n.d(e,{Xs:function(){return d},f_:function(){return p},uU:function(){return h}});var r=n(74075);function i(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:t;return new l(t,e,this)}}]),t}();h.prototype.startSide=h.prototype.endSide=0,h.prototype.point=!1,h.prototype.mapMode=r.gc.TrackDel;var l=function t(e,n,r){a(this,t),this.from=e,this.to=n,this.value=r};function c(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}var f=function(){function t(e,n,r,i){a(this,t),this.from=e,this.to=n,this.value=r,this.maxPoint=i}return u(t,[{key:"length",get:function(){return this.to[this.to.length-1]}},{key:"findIndex",value:function(t,e,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=n?this.to:this.from,o=r,a=i.length;;){if(o==a)return o;var s=o+a>>1,u=i[s]-t||(n?this.value[s].endSide:this.value[s].startSide)-e;if(s==o)return u>=0?o:a;u>=0?a=s:o=s+1}}},{key:"between",value:function(t,e,n,r){for(var i=this.findIndex(e,-1e9,!0),o=this.findIndex(n,1e9,!1,i);i(d=n.mapPos(c,h.endSide))||f==d&&h.startSide>0&&h.endSide<=0)continue;(d-f||h.endSide-h.startSide)<0||(a<0&&(a=f),h.point&&(s=Math.max(s,d-f)),r.push(h),i.push(f-a),o.push(d-a))}return{mapped:r.length?new t(i,o,r,s):null,pos:a}}}]),t}(),d=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.empty,i=arguments.length>3?arguments[3]:void 0;a(this,t),this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}return u(t,[{key:"length",get:function(){var t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}},{key:"size",get:function(){if(this.isEmpty)return 0;var t,e=this.nextLayer.size,n=i(this.chunk);try{for(n.s();!(t=n.n()).done;){e+=t.value.value.length}}catch(r){n.e(r)}finally{n.f()}return e}},{key:"chunkEnd",value:function(t){return this.chunkPos[t]+this.chunk[t].length}},{key:"update",value:function(e){var n=e.add,r=void 0===n?[]:n,i=e.sort,o=void 0!==i&&i,a=e.filterFrom,s=void 0===a?0:a,u=e.filterTo,h=void 0===u?this.length:u,f=e.filter;if(0==r.length&&!f)return this;if(o&&r.slice().sort(c),this.isEmpty)return r.length?t.of(r):this;for(var d=new m(this,null,-1).goto(0),v=0,g=[],y=new p;d.value||v=0){var k=r[v++];y.addInner(k.from,k.to,k.value)||g.push(k)}else 1==d.rangeIndex&&d.chunkIndexthis.chunkEnd(d.chunkIndex)||hd.to||h=i&&t<=i+o.length&&!1===o.between(i,t-i,e-i,n))return}this.nextLayer.between(t,e,n)}}},{key:"iter",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return y.from([this]).goto(t)}},{key:"isEmpty",get:function(){return this.nextLayer==this}}],[{key:"iter",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return y.from(t).goto(e)}},{key:"compare",value:function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,o=t.filter((function(t){return t.maxPoint>=500||!t.isEmpty&&e.indexOf(t)<0&&t.maxPoint>=i})),a=e.filter((function(e){return e.maxPoint>=500||!e.isEmpty&&t.indexOf(e)<0&&e.maxPoint>=i})),s=g(o,a),u=new b(o,s,i),h=new b(a,s,i);n.iterGaps((function(t,e,n){return w(u,t,h,e,n,r)})),n.empty&&0==n.length&&w(u,0,h,0,0,r)}},{key:"eq",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0;null==r&&(r=1e9);var i=t.filter((function(t){return!t.isEmpty&&e.indexOf(t)<0})),o=e.filter((function(e){return!e.isEmpty&&t.indexOf(e)<0}));if(i.length!=o.length)return!1;if(!i.length)return!0;for(var a=g(i,o),s=new b(i,a,0).goto(n),u=new b(o,a,0).goto(n);;){if(s.to!=u.to||!x(s.active,u.active)||s.point&&(!u.point||!s.point.eq(u.point)))return!1;if(s.to>=r)return!0;s.next(),u.next()}}},{key:"spans",value:function(t,e,n,r){for(var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,o=new b(t,null,i).goto(e),a=e,s=o.openStart;;){var u=Math.min(o.to,n);if(o.point?(r.point(a,u,o.point,o.activeForPoint(o.to),s),s=o.openEnd(u)+(o.to>u?1:0)):u>a&&(r.span(a,u,o.active,s),s=o.openEnd(u)),o.to>n)break;a=o.to,o.next()}return s}},{key:"of",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=new p,o=i(t instanceof l?[t]:n?v(t):t);try{for(o.s();!(e=o.n()).done;){var a=e.value;r.add(a.from,a.to,a.value)}}catch(s){o.e(s)}finally{o.f()}return r.finish()}}]),t}();function v(t){if(t.length>1)for(var e=t[0],n=1;n0)return t.slice().sort(c);e=r}return t}d.empty=new d([],[],null,-1),d.empty.nextLayer=d.empty;var p=function(){function t(){a(this,t),this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}return u(t,[{key:"finishChunk",value:function(t){this.chunks.push(new f(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}},{key:"add",value:function(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new t)).add(e,n,r)}},{key:"addInner",value:function(t,e,n){var r=t-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(t-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(r<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=n,this.lastFrom=t,this.lastTo=e,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0)}},{key:"addChunk",value:function(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);var n=e.value.length-1;return this.last=e.value[n],this.lastFrom=e.from[n]+t,this.lastTo=e.to[n]+t,!0}},{key:"finish",value:function(){return this.finishInner(d.empty)}},{key:"finishInner",value:function(t){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return t;var e=new d(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}]),t}();function g(t,e){var n,r=new Map,o=i(t);try{for(o.s();!(n=o.n()).done;)for(var a=n.value,s=0;s3&&void 0!==arguments[3]?arguments[3]:0;a(this,t),this.layer=e,this.skip=n,this.minPoint=r,this.rank=i}return u(t,[{key:"startSide",get:function(){return this.value?this.value.startSide:0}},{key:"endSide",get:function(){return this.value?this.value.endSide:0}},{key:"goto",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1e9;return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,e,!1),this}},{key:"gotoInner",value:function(t,e,n){for(;this.chunkIndex=this.minPoint)break}}},{key:"setRangeIndex",value:function(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex1&&void 0!==arguments[1]?arguments[1]:-1e9,r=i(this.heap);try{for(r.s();!(e=r.n()).done;){var o=e.value;o.goto(t,n)}}catch(s){r.e(s)}finally{r.f()}for(var a=this.heap.length>>1;a>=0;a--)k(this.heap,a);return this.next(),this}},{key:"forward",value:function(t,e){var n,r=i(this.heap);try{for(r.s();!(n=r.n()).done;){n.value.forward(t,e)}}catch(a){r.e(a)}finally{r.f()}for(var o=this.heap.length>>1;o>=0;o--)k(this.heap,o);(this.to-t||this.value.endSide-e)<0&&this.next()}},{key:"next",value:function(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{var t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),k(this.heap,0)}}}],[{key:"from",value:function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,i=[],o=0;o=r&&i.push(new m(a,n,r,o));return 1==i.length?i[0]:new t(i)}}]),t}();function k(t,e){for(var n=t[e];;){var r=1+(e<<1);if(r>=t.length)break;var i=t[r];if(r+1=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}var b=function(){function t(e,n,r){a(this,t),this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=y.from(e,n,r)}return u(t,[{key:"goto",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1e9;return this.cursor.goto(t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this}},{key:"forward",value:function(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e)}},{key:"removeActive",value:function(t){S(this.active,t),S(this.activeTo,t),S(this.activeRank,t),this.minActive=C(this.active,this.activeTo)}},{key:"addActive",value:function(t){for(var e=0,n=this.cursor,r=n.value,i=n.to,o=n.rank;e-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>t){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&S(n,i)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}var o=this.cursor.value;if(o.point){if(!(e&&this.cursor.to==this.to&&this.cursor.fromt&&this.forward(this.to,this.endSide);break}this.cursor.next()}else this.addActive(n),this.cursor.next()}}if(n){for(var a=0;a=0&&!(this.activeRank[n]t||this.activeTo[n]==t&&this.active[n].endSide>=this.point.endSide)&&e.push(this.active[n]);return e.reverse()}},{key:"openEnd",value:function(t){for(var e=0,n=this.activeTo.length-1;n>=0&&this.activeTo[n]>t;n--)e++;return e}}]),t}();function w(t,e,n,r,i,o){t.goto(e),n.goto(r);for(var a=r+i,s=r,u=r-e;;){var h=t.to+u-n.to||t.endSide-n.endSide,l=h<0?t.to+u:n.to,c=Math.min(l,a);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&x(t.activeForPoint(t.to+u),n.activeForPoint(n.to))||o.comparePoint(s,c,t.point,n.point):c>s&&!x(t.active,n.active)&&o.compareRange(s,c,t.active,n.active),l>a)break;s=l,h<=0&&t.next(),h>=0&&n.next()}}function x(t,e){if(t.length!=e.length)return!1;for(var n=0;n=e;r--)t[r+1]=t[r];t[e]=n}function C(t,e){for(var n=-1,r=1e9,i=0;ia?-1:i==r.length?function(t,e){var n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}(t,e.clientX):(0,o.IS)(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:s,off:i}}function u(t,e){var n=s(t,e),i=t.state.selection;return n?{update:function(t){if(t.docChanged){var e=t.changes.mapPos(t.startState.doc.line(n.line).from),r=t.state.doc.lineAt(e);n={line:r.number,col:n.col,off:Math.min(n.off,r.length)},i=i.map(t.changes)}},get:function(e,u,h){var l=s(t,e);if(!l)return i;var c=function(t,e,n){var i=Math.min(e.line,n.line),s=Math.max(e.line,n.line),u=[];if(e.off>a||n.off>a||e.col<0||n.col<0)for(var h=Math.min(e.off,n.off),l=Math.max(e.off,n.off),c=i;c<=s;c++){var f=t.doc.line(c);f.length<=l&&u.push(r.jT.range(f.from+h,f.to+l))}else for(var d=Math.min(e.col,n.col),v=Math.max(e.col,n.col),p=i;p<=s;p++){var g=t.doc.line(p),m=(0,o.Gz)(g.text,d,t.tabSize,!0);if(m>-1){var y=(0,o.Gz)(g.text,v,t.tabSize);u.push(r.jT.range(g.from+m,g.from+y))}}return u}(t.state,n,l);return c.length?h?r.jT.create(c.concat(i.ranges)):r.jT.create(c):i}}:null}function h(t){var e=(null==t?void 0:t.eventFilter)||function(t){return t.altKey&&0==t.button};return i.tk.mouseSelectionStyle.of((function(t,n){return e(n)?u(t,n):null}))}},86315:function(t,e,n){n.d(e,{sW:function(){return J},Lp:function(){return wt}});var r=n(91643),i=n(74075);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n-1?n.panels[r]:null}var f=r.lg.fromClass(function(){function t(e){o(this,t),this.input=e.state.facet(g),this.specs=this.input.filter((function(t){return t})),this.panels=this.specs.map((function(t){return t(e)}));var n=e.state.facet(l);this.top=new d(e,!0,n.topContainer),this.bottom=new d(e,!1,n.bottomContainer),this.top.sync(this.panels.filter((function(t){return t.top}))),this.bottom.sync(this.panels.filter((function(t){return!t.top})));var r,i=u(this.panels);try{for(i.s();!(r=i.n()).done;){var a=r.value;a.dom.classList.add("cm-panel"),a.mount&&a.mount()}}catch(s){i.e(s)}finally{i.f()}}return s(t,[{key:"update",value:function(t){var e=t.state.facet(l);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new d(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new d(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();var n=t.state.facet(g);if(n!=this.input){var r,i=n.filter((function(t){return t})),o=[],a=[],s=[],h=[],c=u(i);try{for(c.s();!(r=c.n()).done;){var f=r.value,v=this.specs.indexOf(f),p=void 0;v<0?(p=f(t.view),h.push(p)):(p=this.panels[v]).update&&p.update(t),o.push(p),(p.top?a:s).push(p)}}catch(S){c.e(S)}finally{c.f()}this.specs=i,this.panels=o,this.top.sync(a),this.bottom.sync(s);for(var m=0,y=h;m=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function D(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(u){s=!0,i=u}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(t,e)||E(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(t,e){if(t){if("string"==typeof t)return P(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?P(t,e):void 0}}function P(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length,o=arguments.length>4?arguments[4]:void 0;R(this,t),this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=o?function(t){return o(I(t))}:I,this.query=this.normalize(n)}return B(t,[{key:"peek",value:function(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return(0,w.gm)(this.buffer,this.bufferPos)}},{key:"next",value:function(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}},{key:"nextOverlapping",value:function(){for(;;){var t=this.peek();if(t<0)return this.done=!0,this;var e=(0,w.bg)(t),n=this.bufferStart+this.bufferPos;this.bufferPos+=(0,w.nZ)(t);for(var r=this.normalize(e),i=0,o=n;;i++){var a=r.charCodeAt(i),s=this.match(a,o);if(s)return this.value=s,this;if(i==r.length-1)break;o==n&&i3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:e.length;if(R(this,t),this.to=o,this.curLine="",this.done=!1,this.value=j,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new W(e,n,r,i,o);this.re=new RegExp(n,V+((null==r?void 0:r.ignoreCase)?"i":"")),this.iter=e.iter();var a=e.lineAt(i);this.curLineStart=a.from,this.matchPos=i,this.getLine(this.curLineStart)}return B(t,[{key:"getLine",value:function(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}},{key:"nextLine",value:function(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}},{key:"next",value:function(){for(var t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;var e=this.matchPos<=this.to&&this.re.exec(this.curLine);if(e){var n=this.curLineStart+e.index,r=n+e[0].length;if(this.matchPos=r+(n==r?1:0),n==this.curLine.length&&this.nextLine(),nthis.value.to)return this.value={from:n,to:r,match:e},this;t=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length=r||i.to<=n){var o=new t(n,e.sliceString(n,r));return H.set(e,o),o}if(i.from==n&&i.to==r)return i;var a=i.text,s=i.from;return s>n&&(a=e.sliceString(n,s)+a,s=n),i.to=this.to?this.to:this.text.lineAt(t).to}},{key:"next",value:function(){for(;;){var t=this.re.lastIndex=this.matchPos-this.flat.from,e=this.re.exec(this.flat.text);if(e&&!e[0]&&e.index==t&&(this.re.lastIndex=t+1,e=this.re.exec(this.flat.text)),e&&this.flat.tothis.flat.text.length-10&&(e=null),e){var n=this.flat.from+e.index,r=n+e[0].length;return this.value={from:n,to:r,match:e},this.matchPos=r+(n==r?1:0),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=z.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}]),t}();function q(t){var e=k("input",{class:"cm-textfield",name:"line"});function n(){var n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(n){var r=t.state,o=r.doc.lineAt(r.selection.main.head),a=D(n,5),s=a[1],u=a[2],h=a[3],l=a[4],c=h?+h.slice(1):0,f=u?+u:o.number;if(u&&l){var d=f/100;s&&(d=d*("-"==s?-1:1)+o.number/r.doc.lines),f=Math.round(r.doc.lines*d)}else u&&s&&(f=f*("-"==s?-1:1)+o.number);var v=r.doc.line(Math.max(1,Math.min(r.doc.lines,f)));t.dispatch({effects:F.of(!1),selection:i.jT.cursor(v.from+Math.max(0,Math.min(c,v.length))),scrollIntoView:!0}),t.focus()}}return{dom:k("form",{class:"cm-gotoLine",onkeydown:function(e){27==e.keyCode?(e.preventDefault(),t.dispatch({effects:F.of(!1)}),t.focus()):13==e.keyCode&&(e.preventDefault(),n())},onsubmit:function(t){t.preventDefault(),n()}},k("label",t.state.phrase("Go to line"),": ",e)," ",k("button",{class:"cm-button",type:"submit"},t.state.phrase("go"))),pos:-10}}var F=i.Py.define(),$=i.QQ.define({create:function(){return!0},update:function(t,e){var n,r=T(e.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.is(F)&&(t=i.value)}}catch(o){r.e(o)}finally{r.f()}return t},provide:function(t){return g.from(t,(function(t){return t?q:null}))}}),K=r.tk.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),U={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100},G=i.r$.define({combine:function(t){return(0,i.BO)(t,U,{highlightWordAroundCursor:function(t,e){return t||e},minSelectionLength:Math.min,maxMatches:Math.min})}});function J(t){var e=[Z,Y];return t&&e.push(G.of(t)),e}var X=r.p.mark({class:"cm-selectionMatch"}),Q=r.p.mark({class:"cm-selectionMatch cm-selectionMatch-main"}),Y=r.lg.fromClass(function(){function t(e){R(this,t),this.decorations=this.getDeco(e)}return B(t,[{key:"update",value:function(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}},{key:"getDeco",value:function(t){var e=t.state.facet(G),n=t.state,o=n.selection;if(o.ranges.length>1)return r.p.none;var a,s=o.main,u=null;if(s.empty){if(!e.highlightWordAroundCursor)return r.p.none;var h=n.wordAt(s.head);if(!h)return r.p.none;u=n.charCategorizer(s.head),a=n.sliceDoc(h.from,h.to)}else{var l=s.to-s.from;if(l200)return r.p.none;if(!(a=n.sliceDoc(s.from,s.to).trim()))return r.p.none}var c,f=[],d=T(t.visibleRanges);try{for(d.s();!(c=d.n()).done;)for(var v=c.value,p=new N(n.doc,a,v.from,v.to);!p.next().done;){var g=p.value,m=g.from,y=g.to;if((!u||(0==m||u(n.sliceDoc(m-1,m))!=i.D0.Word)&&(y==n.doc.length||u(n.sliceDoc(y,y+1))!=i.D0.Word))&&(u&&m<=s.from&&y>=s.to?f.push(Q.range(m,y)):(m>=s.to||y<=s.from)&&f.push(X.range(m,y)),f.length>e.maxMatches))return r.p.none}}catch(k){d.e(k)}finally{d.f()}return r.p.set(f)}}]),t}(),{decorations:function(t){return t.decorations}}),Z=r.tk.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}});var tt=i.r$.define({combine:function(t){var e=t.some((function(t){return t.matchCase}));return{top:t.some((function(t){return t.top})),matchCase:void 0===e||e}}});var et=function(){function t(e,n,r){R(this,t),this.search=e,this.replace=n,this.caseInsensitive=r}return B(t,[{key:"eq",value:function(t){return this.search==t.search&&this.replace==t.replace&&this.caseInsensitive==t.caseInsensitive&&this.constructor==t.constructor}}]),t}(),nt=function(t){x(n,t);var e=A(n);function n(t,r,i){var o;return R(this,n),(o=e.call(this,t,r,i)).unquoted=t.replace(/\\([nrt\\])/g,(function(t,e){return"n"==e?"\n":"r"==e?"\r":"t"==e?"\t":"\\"})),o}return B(n,[{key:"cursor",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length;return new N(t,this.unquoted,e,n,this.caseInsensitive?function(t){return t.toLowerCase()}:void 0)}},{key:"nextMatch",value:function(t,e,n){var r=this.cursor(t,n).nextOverlapping();return r.done&&(r=this.cursor(t,0,e).nextOverlapping()),r.done?null:r.value}},{key:"prevMatchInRange",value:function(t,e,n){for(var r=n;;){for(var i=Math.max(e,r-1e4-this.unquoted.length),o=this.cursor(t,i,r),a=null;!o.nextOverlapping().done;)a=o.value;if(a)return a;if(i==e)return null;r-=1e4}}},{key:"prevMatch",value:function(t,e,n){return this.prevMatchInRange(t,0,e)||this.prevMatchInRange(t,n,t.length)}},{key:"getReplacement",value:function(t){return this.replace}},{key:"matchAll",value:function(t,e){for(var n=this.cursor(t),r=[];!n.next().done;){if(r.length>=e)return null;r.push(n.value)}return r}},{key:"highlight",value:function(t,e,n,r){for(var i=this.cursor(t,Math.max(0,e-this.unquoted.length),Math.min(n+this.unquoted.length,t.length));!i.next().done;)r(i.value.from,i.value.to)}},{key:"valid",get:function(){return!!this.search}}]),n}(et),rt=function(t){x(n,t);var e=A(n);function n(t,r,i){var o;return R(this,n),(o=e.call(this,t,r,i)).valid=!!t&&function(t){try{return new RegExp(t,V),!0}catch(e){return!1}}(t),o}return B(n,[{key:"cursor",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length;return new _(t,this.search,this.caseInsensitive?{ignoreCase:!0}:void 0,e,n)}},{key:"nextMatch",value:function(t,e,n){var r=this.cursor(t,n).next();return r.done&&(r=this.cursor(t,0,e).next()),r.done?null:r.value}},{key:"prevMatchInRange",value:function(t,e,n){for(var r=1;;r++){for(var i=Math.max(e,n-1e4*r),o=this.cursor(t,i,n),a=null;!o.next().done;)a=o.value;if(a&&(i==e||a.from>i+10))return a;if(i==e)return null}}},{key:"prevMatch",value:function(t,e,n){return this.prevMatchInRange(t,0,e)||this.prevMatchInRange(t,n,t.length)}},{key:"getReplacement",value:function(t){return this.replace.replace(/\$([$&\d+])/g,(function(e,n){return"$"==n?"$":"&"==n?t.match[0]:"0"!=n&&+n=e)return null;r.push(n.value)}return r}},{key:"highlight",value:function(t,e,n,r){for(var i=this.cursor(t,Math.max(0,e-250),Math.min(n+250,t.length));!i.next().done;)r(i.value.from,i.value.to)}}]),n}(et),it=i.Py.define(),ot=i.Py.define(),at=i.QQ.define({create:function(t){return new st(yt(t),mt)},update:function(t,e){var n,r=T(e.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.is(it)?t=new st(i.value,t.panel):i.is(ot)&&(t=new st(t.query,i.value?mt:null))}}catch(o){r.e(o)}finally{r.f()}return t},provide:function(t){return g.from(t,(function(t){return t.panel}))}}),st=function t(e,n){R(this,t),this.query=e,this.panel=n},ut=r.p.mark({class:"cm-searchMatch"}),ht=r.p.mark({class:"cm-searchMatch cm-searchMatch-selected"}),lt=r.lg.fromClass(function(){function t(e){R(this,t),this.view=e,this.decorations=this.highlight(e.state.field(at))}return B(t,[{key:"update",value:function(t){var e=t.state.field(at);(e!=t.startState.field(at)||t.docChanged||t.selectionSet)&&(this.decorations=this.highlight(e))}},{key:"highlight",value:function(t){var e=t.query;if(!t.panel||!e.valid)return r.p.none;for(var n=this.view,i=new m.f_,o=0,a=n.visibleRanges,s=a.length;oa[o+1].from-500;)l=a[++o].to;e.highlight(n.state.doc,h,l,(function(t,e){var r=n.state.selection.ranges.some((function(n){return n.from==t&&n.to==e}));i.add(t,e,r?ht:ut)}))}return i.finish()}}]),t}(),{decorations:function(t){return t.decorations}});function ct(t){return function(e){var n=e.state.field(at,!1);return n&&n.query.valid?t(e,n):kt(e)}}var ft=ct((function(t,e){var n=e.query,r=t.state.selection.main,i=r.from,o=r.to,a=n.nextMatch(t.state.doc,i,o);return!(!a||a.from==i&&a.to==o)&&(t.dispatch({selection:{anchor:a.from,head:a.to},scrollIntoView:!0,effects:At(t,a)}),!0)})),dt=ct((function(t,e){var n=e.query,r=t.state,i=r.selection.main,o=i.from,a=i.to,s=n.prevMatch(r.doc,o,a);return!!s&&(t.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0,effects:At(t,s)}),!0)})),vt=ct((function(t,e){var n=e.query.matchAll(t.state.doc,1e3);return!(!n||!n.length)&&(t.dispatch({selection:i.jT.create(n.map((function(t){return i.jT.range(t.from,t.to)})))}),!0)})),pt=ct((function(t,e){var n=e.query,r=t.state,i=r.selection.main,o=i.from,a=i.to;if(r.readOnly)return!1;var s=n.nextMatch(r.doc,o,o);if(!s)return!1;var u,h,l=[];if(s.from==o&&s.to==a&&(h=r.toText(n.getReplacement(s)),l.push({from:s.from,to:s.to,insert:h}),s=n.nextMatch(r.doc,s.from,s.to)),s){var c=0==l.length||l[0].from>=s.to?0:s.to-s.from-h.length;u={anchor:s.from-c,head:s.to-c}}return t.dispatch({changes:l,selection:u,scrollIntoView:!!u,effects:s?At(t,s):void 0}),!0})),gt=ct((function(t,e){var n=e.query;if(t.state.readOnly)return!1;var r=n.matchAll(t.state.doc,1e9).map((function(t){return{from:t.from,to:t.to,insert:n.getReplacement(t)}}));return!!r.length&&(t.dispatch({changes:r}),!0)}));function mt(t){var e=t.state.field(at).query;return{dom:xt({view:t,query:e,updateQuery:function(n){e.eq(n)||(e=n,t.dispatch({effects:it.of(e)}))}}),mount:function(){this.dom.querySelector("[name=search]").select()},pos:80,top:t.state.facet(tt).top}}function yt(t,e){var n,r=t.selection.main,i=r.empty||r.to>r.from+100?"":t.sliceDoc(r.from,r.to),o=null!==(n=null==e?void 0:e.caseInsensitive)&&void 0!==n?n:!t.facet(tt).matchCase;return e&&!i?e:new nt(i.replace(/\n/g,"\\n"),"",o)}var kt=function(t){var e=t.state.field(at,!1);if(e&&e.panel){var n=c(t,mt);if(!n)return!1;var r=n.dom.querySelector("[name=search]");r.focus(),r.select()}else t.dispatch({effects:[ot.of(!0),e?it.of(yt(t.state,e.query)):i.Py.appendConfig.of(Mt)]});return!0},bt=function(t){var e=t.state.field(at,!1);if(!e||!e.panel)return!1;var n=c(t,mt);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:ot.of(!1)}),!0},wt=[{key:"Mod-f",run:kt,scope:"editor search-panel"},{key:"F3",run:ft,shift:dt,scope:"editor search-panel"},{key:"Mod-g",run:ft,shift:dt,scope:"editor search-panel"},{key:"Escape",run:bt,scope:"editor search-panel"},{key:"Mod-Shift-l",run:function(t){var e=t.state,n=t.dispatch,r=e.selection;if(r.ranges.length>1||r.main.empty)return!1;for(var o=r.main,a=o.from,s=o.to,u=[],h=0,l=new N(e.doc,e.sliceDoc(a,s));!l.next().done;){if(u.length>1e3)return!1;l.value.from==a&&(h=u.length),u.push(i.jT.range(l.value.from,l.value.to))}return n(e.update({selection:i.jT.create(u,h)})),!0}},{key:"Alt-g",run:function(t){var e=c(t,q);if(!e){var n=[F.of(!0)];null==t.state.field($,!1)&&n.push(i.Py.appendConfig.of([$,K])),t.dispatch({effects:n}),e=c(t,q)}return e&&e.dom.querySelector("input").focus(),!0}},{key:"Mod-d",run:function(t){var e=t.state,n=t.dispatch,r=e.selection.ranges;if(r.some((function(t){return t.from===t.to})))return function(t){var e=t.state,n=t.dispatch,r=e.selection,o=i.jT.create(r.ranges.map((function(t){return e.wordAt(t.head)||i.jT.cursor(t.head)})),r.mainIndex);return!o.eq(r)&&(n(e.update({selection:o})),!0)}({state:e,dispatch:n});var o=e.sliceDoc(r[0].from,r[0].to);if(e.selection.ranges.some((function(t){return e.sliceDoc(t.from,t.to)!=o})))return!1;var a=function(t,e){for(var n=t.selection,r=n.main,i=n.ranges,o=t.wordAt(r.head),a=o&&o.from==r.from&&o.to==r.to,s=function(n,r){if(r.next(),!r.done){if(n&&i.some((function(t){return t.from==r.value.from})))return h=r,u=n,"continue";if(a){var o=t.wordAt(r.value.from);if(!o||o.from!=r.value.from||o.to!=r.value.to)return h=r,u=n,"continue"}return u=n,h=r,{v:r.value}}if(n)return h=r,u=n,{v:null};r=new N(t.doc,e,0,Math.max(0,i[i.length-1].from-1)),u=n=!0,h=r},u=!1,h=new N(t.doc,e,i[i.length-1].to);;){var l=s(u,h);if("continue"!==l&&"object"===O(l))return l.v}}(e,o);return!!a&&(n(e.update({selection:e.selection.addRange(i.jT.range(a.from,a.to),!1),scrollIntoView:!0})),!0)},preventDefault:!0}];function xt(t){function e(e){return t.view.state.phrase(e)}var n=k("input",{value:t.query.search,placeholder:e("Find"),"aria-label":e("Find"),class:"cm-textfield",name:"search",onchange:s,onkeyup:s}),i=k("input",{value:t.query.replace,placeholder:e("Replace"),"aria-label":e("Replace"),class:"cm-textfield",name:"replace",onchange:s,onkeyup:s}),o=k("input",{type:"checkbox",name:"case",checked:!t.query.caseInsensitive,onchange:s}),a=k("input",{type:"checkbox",name:"re",checked:t.query instanceof rt,onchange:s});function s(){t.updateQuery(new(a.checked?rt:nt)(n.value,i.value,!o.checked))}function u(t,e,n){return k("button",{class:"cm-button",name:t,onclick:e,type:"button"},n)}return k("div",{onkeydown:function(e){(0,r.$1)(t.view,e,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==n?(e.preventDefault(),(e.shiftKey?dt:ft)(t.view)):13==e.keyCode&&e.target==i&&(e.preventDefault(),pt(t.view))},class:"cm-search"},[n,u("next",(function(){return ft(t.view)}),[e("next")]),u("prev",(function(){return dt(t.view)}),[e("previous")]),u("select",(function(){return vt(t.view)}),[e("all")]),k("label",null,[o,e("match case")]),k("label",null,[a,e("regexp")]),k("br"),i,u("replace",(function(){return pt(t.view)}),[e("replace")]),u("replaceAll",(function(){return gt(t.view)}),[e("replace all")]),k("button",{name:"close",onclick:function(){return bt(t.view)},"aria-label":e("close"),type:"button"},["×"])])}var St=/[\s\.,:;?!]/;function At(t,e){var n=e.from,i=e.to,o=t.state.doc.lineAt(n).from,a=t.state.doc.lineAt(i).to,s=Math.max(o,n-30),u=Math.min(a,i+30),h=t.state.sliceDoc(s,u);if(s!=o)for(var l=0;l<30;l++)if(!St.test(h[l+1])&&St.test(h[l])){h=h.slice(l);break}if(u!=a)for(var c=h.length-1;c>h.length-30;c--)if(!St.test(h[c-1])&&St.test(h[c])){h=h.slice(0,c);break}return r.tk.announce.of("".concat(t.state.phrase("current match"),". ").concat(h," ").concat(t.state.phrase("on line")," ").concat(t.state.doc.lineAt(n).number))}var Ct=r.tk.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Mt=[at,i.Wl.fallback(lt),Ct]},74075:function(t,e,n){n.d(e,{q6:function(){return et},n0:function(){return g},as:function(){return m},D0:function(){return dt},F6:function(){return W},jT:function(){return C},yy:function(){return gt},r$:function(){return D},gc:function(){return p},Wl:function(){return H},Py:function(){return it},QQ:function(){return L},YW:function(){return ot},BO:function(){return mt}});var r=n(51686);function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function o(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]&&arguments[1];b(this,t,e)}},{key:"invertedDesc",get:function(){for(var e=[],n=0;n1&&void 0!==arguments[1]&&arguments[1];return t.empty?this:w(this,t,e)}},{key:"mapPos",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p.Simple,r=0,i=0,o=0;ot)return i+(t-r);i+=a}else{if(n!=p.Simple&&u>=t&&(n==p.TrackDel&&rt||n==p.TrackBefore&&rt))return null;if(u>t||u==t&&e<0&&!a)return t==r||e<0?i:i+s;i+=s}r=u}if(t>r)throw new RangeError("Position ".concat(t," is out of range for changeset of length ").concat(r));return i}},{key:"touchesRange",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=0,r=0;n=0&&r<=e&&a>=t)return!(re)||"cover";r=a}return!1}},{key:"toString",value:function(){for(var t="",e=0;e=0?":"+r:"")}return t}},{key:"toJSON",value:function(){return this.sections}}],[{key:"fromJSON",value:function(e){if(!Array.isArray(e)||e.length%2||e.some((function(t){return"number"!=typeof t})))throw new RangeError("Invalid JSON representation of ChangeDesc");return new t(e)}}]),t}(),m=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(n,t);var e=u(n);function n(t,r){var i;return c(this,n),(i=e.call(this,t)).inserted=r,i}return d(n,[{key:"apply",value:function(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return b(this,(function(e,n,r,i,o){return t=t.replace(r,r+(n-e),o)}),!1),t}},{key:"mapDesc",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return w(this,t,e,!0)}},{key:"invert",value:function(t){for(var e=this.sections.slice(),i=[],o=0,a=0;o=0){e[o]=u,e[o+1]=s;for(var h=o>>1;i.length1&&void 0!==arguments[1]&&arguments[1];return t.empty?this:w(this,t,e,!0)}},{key:"iterChanges",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];b(this,t,e)}},{key:"desc",get:function(){return new g(this.sections)}},{key:"filter",value:function(t){var e=[],r=[],i=[],o=new S(this);t:for(var a=0,s=0;;){for(var u=a==t.length?1e9:t[a++];s0&&k(r,e,o.text),o.forward(h),s+=h}for(var c=t[a++];s>1].toJSON()))}return t}}],[{key:"of",value:function(t,e,i){var a=[],s=[],u=0,h=null;function l(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(t||a.length){um||p<0||m>e)throw new RangeError("Invalid change range ".concat(p," to ").concat(m," (in doc of length ").concat(e,")"));var w=b?"string"==typeof b?r.xv.of(b.split(i||v)):b:r.xv.empty,x=w.length;if(p==m&&0==x)return;pu&&y(a,p-u,-1),y(a,m-p,x),k(s,a,w),u=m}}(t),l(!h),h}},{key:"empty",value:function(t){return new n(t?[t,-1]:[],[])}},{key:"fromJSON",value:function(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");for(var e=[],i=[],o=0;o3&&void 0!==arguments[3]&&arguments[3];if(!(0==e&&n<=0)){var i=t.length-2;i>=0&&n<=0&&n==t[i+1]?t[i]+=e:0==e&&0==t[i]?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}}function k(t,e,n){if(0!=n.length){var i=e.length-2>>1;if(i>1])),!(n||s==t.sections.length||t.sections[s+1]<0);)u=t.sections[s++],h=t.sections[s++];e(o,l,a,c,f),o=l,a=c}}}function w(t,e,n){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=[],o=r?[]:null,a=new S(t),s=new S(e),u=0,h=0;;)if(-1==a.ins)u+=a.len,a.next();else if(-1==s.ins&&h=0&&(a.done||hh&&!a.done&&u+a.len=0)){if(a.done&&s.done)return o?new m(i,o):new g(i);throw new Error("Mismatched change set lengths")}for(var c=0,f=u+a.len;;)if(s.ins>=0&&h>u&&h+s.len2&&void 0!==arguments[2]&&arguments[2],r=[],i=n?[]:null,o=new S(t),a=new S(e),s=!1;;){if(o.done&&a.done)return i?new m(r,i):new g(r);if(0==o.ins)y(r,o.len,0,s),o.next();else if(0!=a.len||a.done){if(o.done||a.done)throw new Error("Mismatched change set lengths");var u=Math.min(o.len2,a.len),h=r.length;if(-1==o.ins){var l=-1==a.ins?-1:a.off?0:a.ins;y(r,u,l,s),i&&l&&k(i,r,a.text)}else-1==a.ins?(y(r,o.off?0:o.len,u,s),i&&k(i,r,o.textBit(u))):(y(r,o.off?0:o.len,a.off?0:a.ins,s),i&&!a.off&&k(i,r,a.text));s=(o.ins>u||a.ins>=0&&a.len>u)&&(s||r.length>h),o.forward2(u),a.forward(u)}else y(r,0,a.ins,s),i&&k(i,r,a.text),a.next()}}var S=function(){function t(e){c(this,t),this.set=e,this.i=0,this.next()}return d(t,[{key:"next",value:function(){var t=this.set.sections;this.i>1;return e>=t.length?r.xv.empty:t[e]}},{key:"textBit",value:function(t){var e=this.set.inserted,n=this.i-2>>1;return n>=e.length&&!t?r.xv.empty:e[n].slice(this.off,null==t?void 0:this.off+t)}},{key:"forward",value:function(t){t==this.len?this.next():(this.len-=t,this.off+=t)}},{key:"forward2",value:function(t){-1==this.ins?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}]),t}(),A=function(){function t(e,n,r){c(this,t),this.from=e,this.to=n,this.flags=r}return d(t,[{key:"anchor",get:function(){return 16&this.flags?this.to:this.from}},{key:"head",get:function(){return 16&this.flags?this.from:this.to}},{key:"empty",get:function(){return this.from==this.to}},{key:"assoc",get:function(){return 4&this.flags?-1:8&this.flags?1:0}},{key:"bidiLevel",get:function(){var t=3&this.flags;return 3==t?null:t}},{key:"goalColumn",get:function(){var t=this.flags>>5;return 33554431==t?void 0:t}},{key:"map",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,r=e.mapPos(this.from,n),i=e.mapPos(this.to,n);return r==this.from&&i==this.to?this:new t(r,i,this.flags)}},{key:"extend",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(t<=this.anchor&&e>=this.anchor)return C.range(t,e);var n=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return C.range(this.anchor,n)}},{key:"eq",value:function(t){return this.anchor==t.anchor&&this.head==t.head}},{key:"toJSON",value:function(){return{anchor:this.anchor,head:this.head}}}],[{key:"fromJSON",value:function(t){if(!t||"number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid JSON representation for SelectionRange");return C.range(t.anchor,t.head)}}]),t}(),C=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;c(this,t),this.ranges=e,this.mainIndex=n}return d(t,[{key:"map",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return e.empty?this:t.create(this.ranges.map((function(t){return t.map(e,n)})),this.mainIndex)}},{key:"eq",value:function(t){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(var e=0;e1&&void 0!==arguments[1])||arguments[1];return t.create([e].concat(this.ranges),n?0:this.mainIndex+1)}},{key:"replaceRange",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.mainIndex,r=this.ranges.slice();return r[n]=e,t.create(r,this.mainIndex)}},{key:"toJSON",value:function(){return{ranges:this.ranges.map((function(t){return t.toJSON()})),main:this.mainIndex}}}],[{key:"fromJSON",value:function(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new t(e.ranges.map((function(t){return A.fromJSON(t)})),e.main)}},{key:"single",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return new t([t.range(e,n)],0)}},{key:"create",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0==e.length)throw new RangeError("A selection needs at least one range");for(var r=0,i=0;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;return new A(t,t,(0==e?0:e<0?4:8)|(null==n?3:Math.min(2,n))|(null!=r?r:33554431)<<5)}},{key:"range",value:function(t,e,n){var r=(null!=n?n:33554431)<<5;return e1&&void 0!==arguments[1]?arguments[1]:0,n=t[e];t.sort((function(t,e){return t.from-e.from})),e=t.indexOf(n);for(var r=1;ri.head?C.range(s,a):C.range(a,s))}}return new C(t,e)}function O(t,e){var n,r=o(t.ranges);try{for(r.s();!(n=r.n()).done;){if(n.value.to>e)throw new RangeError("Selection points outside of document")}}catch(i){r.e(i)}finally{r.f()}}var T=0,D=function(){function t(e,n,r,i,o){c(this,t),this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.extensions=o,this.id=T++,this.default=e([])}return d(t,[{key:"of",value:function(t){return new P([],this,0,t)}},{key:"compute",value:function(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new P(t,this,1,e)}},{key:"computeN",value:function(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new P(t,this,2,e)}},{key:"from",value:function(t,e){return e||(e=function(t){return t}),this.compute([t],(function(n){return e(n.field(t))}))}}],[{key:"define",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new t(e.combine||function(t){return t},e.compareInput||function(t,e){return t===e},e.compare||(e.combine?function(t,e){return t===e}:E),!!e.static,e.enables)}}]),t}();function E(t,e){return t==e||t.length==e.length&&t.every((function(t,n){return t===e[n]}))}var P=function(){function t(e,n,r,i){c(this,t),this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=T++}return d(t,[{key:"dynamicSlot",value:function(t){var e,n,r=this.value,i=this.facet.compareInput,a=t[this.id]>>1,s=2==this.type,u=!1,h=!1,l=[],c=o(this.dependencies);try{for(c.s();!(n=c.n()).done;){var f=n.value;"doc"==f?u=!0:"selection"==f?h=!0:0==(1&(null!==(e=t[f.id])&&void 0!==e?e:1))&&l.push(t[f.id])}}catch(d){c.e(d)}finally{c.f()}return function(t,e){var n=t.values[a];if(n===$)return t.values[a]=r(t),1;if(e&&(u&&e.docChanged||h&&(e.docChanged||e.selection)||l.some((function(e){return(1&K(t,e))>0})))){var o=r(t);if(s?!function(t,e,n){if(t.length!=e.length)return!1;for(var r=0;r>1;return function(t,r){var i=t.values[n];if(i===$)return t.values[n]=e.create(t),1;if(r){var o=e.updateF(i,r);if(!e.compareF(i,o))return t.values[n]=o,1}return 0}}},{key:"init",value:function(t){return[this,R.of({field:this,create:t})]}},{key:"extension",get:function(){return this}}],[{key:"define",value:function(e){var n=new t(T++,e.create,e.update,e.compare||function(t,e){return t===e},e);return e.provide&&(n.provides=e.provide(n)),n}}]),t}(),B=4,I=3,N=2,j=1,V=0;function _(t){return function(e){return new z(e,t)}}var H={lowest:_(B),low:_(I),default:_(N),high:_(j),highest:_(V),fallback:_(B),extend:_(j),override:_(V)},z=function t(e,n){c(this,t),this.inner=e,this.prec=n},W=function(){function t(){c(this,t)}return d(t,[{key:"of",value:function(t){return new q(this,t)}},{key:"reconfigure",value:function(e){return t.reconfigure.of({compartment:this,extension:e})}},{key:"get",value:function(t){return t.config.compartments.get(this)}}]),t}(),q=function t(e,n){c(this,t),this.compartment=e,this.inner=n},F=function(){function t(e,n,r,i,o){for(c(this,t),this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.statusTemplate=[];this.statusTemplate.length>1]}}],[{key:"resolve",value:function(e,n,r){var i,a=[],s=Object.create(null),u=new Map,h=o(function(t,e,n){var r=[[],[],[],[],[]],i=new Map;function a(t,s){var u=i.get(t);if(null!=u){if(u>=s)return;var h=r[u].indexOf(t);h>-1&&r[u].splice(h,1),t instanceof q&&n.delete(t.compartment)}if(i.set(t,s),Array.isArray(t)){var l,c=o(t);try{for(c.s();!(l=c.n()).done;){a(l.value,s)}}catch(v){c.e(v)}finally{c.f()}}else if(t instanceof q){if(n.has(t.compartment))throw new RangeError("Duplicate use of compartment in extensions");var f=e.get(t.compartment)||t.inner;n.set(t.compartment,f),a(f,s)}else if(t instanceof z)a(t.inner,t.prec);else if(t instanceof L)r[s].push(t),t.provides&&a(t.provides,s);else if(t instanceof P)r[s].push(t),t.facet.extensions&&a(t.facet.extensions,s);else{var d=t.extension;if(!d)throw new Error("Unrecognized extension value in extension set (".concat(t,"). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks."));a(d,s)}}return a(t,N),r.reduce((function(t,e){return t.concat(e)}))}(e,n,u));try{for(h.s();!(i=h.n()).done;){var l=i.value;l instanceof L?a.push(l):(s[l.facet.id]||(s[l.facet.id]=[])).push(l)}}catch(k){h.e(k)}finally{h.f()}for(var c=Object.create(null),f=[],d=[],v=function(){var t=g[p];c[t.id]=d.length<<1,d.push((function(e){return t.slot(e)}))},p=0,g=a;p>1;return function(t){var n,u=t.values[s],h=u===$,l=o(a);try{for(l.s();!(n=l.n()).done;)1&K(t,n.value)&&(h=!0)}catch(k){l.e(k)}finally{l.f()}if(!h)return 0;for(var c=[],f=0;f>1,r=t.status[n];if(4==r)throw new Error("Cyclic dependency between fields and/or facets");if(2&r)return r;t.status[n]=4;var i=t.config.dynamicSlots[n](t,t.applying);return t.status[n]=2|i}function U(t,e){return 1&e?t.config.staticValues[e>>1]:t.values[e>>1]}var G=D.define(),J=D.define({combine:function(t){return t.some((function(t){return t}))},static:!0}),X=D.define({combine:function(t){return t.length?t[0]:void 0},static:!0}),Q=D.define(),Y=D.define(),Z=D.define(),tt=D.define({combine:function(t){return!!t.length&&t[0]}}),et=function(){function t(e,n){c(this,t),this.type=e,this.value=n}return d(t,null,[{key:"define",value:function(){return new nt}}]),t}(),nt=function(){function t(){c(this,t)}return d(t,[{key:"of",value:function(t){return new et(this,t)}}]),t}(),rt=function(){function t(e){c(this,t),this.map=e}return d(t,[{key:"of",value:function(t){return new it(this,t)}}]),t}(),it=function(){function t(e,n){c(this,t),this.type=e,this.value=n}return d(t,[{key:"map",value:function(e){var n=this.type.map(this.value,e);return void 0===n?void 0:n==this.value?this:new t(this.type,n)}},{key:"is",value:function(t){return this.type==t}}],[{key:"define",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new rt(t.map||function(t){return t})}},{key:"mapEffects",value:function(t,e){if(!t.length)return t;var n,r=[],i=o(t);try{for(i.s();!(n=i.n()).done;){var a=n.value.map(e);a&&r.push(a)}}catch(s){i.e(s)}finally{i.f()}return r}}]),t}();it.reconfigure=it.define(),it.appendConfig=it.define();var ot=function(){function t(e,n,r,i,o,a){c(this,t),this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=a,this._doc=null,this._state=null,r&&O(r,n.newLength),o.some((function(e){return e.type==t.time}))||(this.annotations=o.concat(t.time.of(Date.now())))}return d(t,[{key:"newDoc",get:function(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}},{key:"newSelection",get:function(){return this.selection||this.startState.selection.map(this.changes)}},{key:"state",get:function(){return this._state||this.startState.applyTransaction(this),this._state}},{key:"annotation",value:function(t){var e,n=o(this.annotations);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r.type==t)return r.value}}catch(i){n.e(i)}finally{n.f()}}},{key:"docChanged",get:function(){return!this.changes.empty}},{key:"reconfigured",get:function(){return this.startState.config!=this.state.config}},{key:"isUserEvent",value:function(e){var n=this.annotation(t.userEvent);return!(!n||!(n==e||n.length>e.length&&n.slice(0,e.length)==e&&"."==n[e.length]))}}]),t}();function at(t,e){for(var n=[],r=0,i=0;;){var o=void 0,a=void 0;if(r=t[r]))o=t[r++],a=t[r++];else{if(!(i=0;i--){var o=n[i](t);o&&Object.keys(o).length&&(r=st(t,ut(e,o,t.changes.newLength),!0))}return r==t?t:new ot(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}(n?function(t){var e,n=t.startState,r=!0,i=o(n.facet(Q));try{for(i.s();!(e=i.n()).done;){var a=(0,e.value)(t);if(!1===a){r=!1;break}Array.isArray(a)&&(r=!0===r?a:at(r,a))}}catch(d){i.e(d)}finally{i.f()}if(!0!==r){var s,u;if(!1===r)u=t.changes.invertedDesc,s=m.empty(n.doc.length);else{var h=t.changes.filter(r);s=h.changes,u=h.filtered.invertedDesc}t=new ot(n,s,t.selection&&t.selection.map(u),it.mapEffects(t.effects,u),t.annotations,t.scrollIntoView)}for(var l=n.facet(Y),c=l.length-1;c>=0;c--){var f=l[c](t);t=f instanceof ot?f:Array.isArray(f)&&1==f.length&&f[0]instanceof ot?f[0]:ht(n,ct(f),!1)}return t}(s):s)}ot.time=et.define(),ot.userEvent=et.define(),ot.addToHistory=et.define(),ot.remote=et.define();var lt=[];function ct(t){return null==t?lt:Array.isArray(t)?t:[t]}var ft,dt=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(dt||(dt={})),vt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{ft=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(yt){}function pt(t){return function(e){if(!/\S/.test(e))return dt.Space;if(function(t){if(ft)return ft.test(t);for(var e=0;e"€"&&(n.toUpperCase()!=n.toLowerCase()||vt.test(n)))return!0}return!1}(e))return dt.Word;for(var n=0;n-1)return dt.Word;return dt.Other}}var gt=function(){function t(e,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;c(this,t),this.config=e,this.doc=n,this.selection=r,this.values=i,this.applying=null,this.status=e.statusTemplate.slice(),this.applying=o,o&&(o._state=this);for(var a=0;a1&&void 0!==arguments[1])||arguments[1],n=this.config.address[t.id];if(null!=n)return K(this,n),U(this,n);if(e)throw new RangeError("Field is not present in this state")}},{key:"update",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n>1]=U(this,v))}r=new t(i,this.doc,this.selection,c,null).values}new t(i,e.newDoc,e.newSelection,r,e)}},{key:"replaceSelection",value:function(t){return"string"==typeof t&&(t=this.toText(t)),this.changeByRange((function(e){return{changes:{from:e.from,to:e.to,insert:t},range:C.cursor(e.from+t.length)}}))}},{key:"changeByRange",value:function(t){for(var e=this.selection,n=t(e.ranges[0]),r=this.changes(n.changes),i=[n.range],o=ct(n.effects),a=1;a0&&void 0!==arguments[0]?arguments[0]:[];return e instanceof m?e:m.of(e,this.doc.length,this.facet(t.lineSeparator))}},{key:"toText",value:function(e){return r.xv.of(e.split(this.facet(t.lineSeparator)||v))}},{key:"sliceDoc",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.doc.length;return this.doc.sliceString(t,e,this.lineBreak)}},{key:"facet",value:function(t){var e=this.config.address[t.id];return null==e?t.default:(K(this,e),U(this,e))}},{key:"toJSON",value:function(t){var e={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(var n in t){var r=t[n];r instanceof L&&(e[n]=r.spec.toJSON(this.field(t[n]),this))}return e}},{key:"tabSize",get:function(){return this.facet(t.tabSize)}},{key:"lineBreak",get:function(){return this.facet(t.lineSeparator)||"\n"}},{key:"readOnly",get:function(){return this.facet(tt)}},{key:"phrase",value:function(e){var n,r=o(this.facet(t.phrases));try{for(r.s();!(n=r.n()).done;){var i=n.value;if(Object.prototype.hasOwnProperty.call(i,e))return i[e]}}catch(a){r.e(a)}finally{r.f()}return e}},{key:"languageDataAt",value:function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,i=[],a=o(this.facet(G));try{for(a.s();!(n=a.n()).done;){var s,u=n.value,h=o(u(this,e,r));try{for(h.s();!(s=h.n()).done;){var l=s.value;Object.prototype.hasOwnProperty.call(l,t)&&i.push(l[t])}}catch(c){h.e(c)}finally{h.f()}}}catch(c){a.e(c)}finally{a.f()}return i}},{key:"charCategorizer",value:function(t){return pt(this.languageDataAt("wordChars",t).join(""))}},{key:"wordAt",value:function(t){for(var e=this.doc.lineAt(t),n=e.text,i=e.from,o=e.length,a=this.charCategorizer(t),s=t-i,u=t-i;s>0;){var h=(0,r.cp)(n,s,!1);if(a(n.slice(h,s))!=dt.Word)break;s=h}for(;u1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(!e||"string"!=typeof e.doc)throw new RangeError("Invalid JSON representation for EditorState");var i=[];if(r){var o=function(t){var n=r[t],o=e[t];i.push(n.init((function(t){return n.spec.fromJSON(o,t)})))};for(var a in r)o(a)}return t.create({doc:e.doc,selection:C.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}},{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=F.resolve(e.extensions||[],new Map),i=e.doc instanceof r.xv?e.doc:r.xv.of((e.doc||"").split(n.staticFacet(t.lineSeparator)||v)),o=e.selection?e.selection instanceof C?e.selection:C.single(e.selection.anchor,e.selection.head):C.single(0);return O(o,i.length),n.staticFacet(J)||(o=o.asSingle()),new t(n,i,o,n.dynamicSlots.map((function(t){return $})))}}]),t}();function mt(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={},a=o(t);try{for(a.s();!(n=a.n()).done;)for(var s=n.value,u=0,h=Object.keys(s);u=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function h(t,e){if(t){if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void 0}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length);for(var o=i,a=r;a=this.string.length}},{key:"sol",value:function(){return 0==this.pos}},{key:"peek",value:function(){return this.string.charAt(this.pos)||void 0}},{key:"next",value:function(){if(this.pose}},{key:"eatSpace",value:function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}},{key:"skipToEnd",value:function(){this.pos=this.string.length}},{key:"skipTo",value:function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0}},{key:"backUp",value:function(t){this.pos-=t}},{key:"column",value:function(){return this.lastColumnPos0?null:(i&&!1!==e&&(this.pos+=i[0].length),i)}},{key:"current",value:function(){return this.string.slice(this.start,this.pos)}}]),t}();function S(t){if("object"!=m(t))return t;var e={};for(var n in t){var r=t[n];e[n]=r instanceof Array?r.slice():r}return e}var A=function(t){c(n,t);var e=d(n);function n(t){var i;y(this,n);var a,s,u=(0,o.kU)(t.languageData),h={token:(s=t).token,blankLine:s.blankLine||function(){},startState:s.startState||function(){return!0},copyState:s.copyState||S,indent:s.indent||function(){return null},languageData:s.languageData||{}},l=new(function(t){c(n,t);var e=d(n);function n(){return y(this,n),e.apply(this,arguments)}return b(n,[{key:"createParse",value:function(t,e,n){return new O(a,t,e,n)}}]),n}(r._b));return i=e.call(this,u,l,function(t){var e=r.Jq.define({id:E.length,name:"Document",props:[o.mi.add((function(){return t}))]});return E.push(e),e}(u),[o.tK.of((function(t,e){return i.getIndent(t,e)}))]),a=p(i),i.streamParser=h,i.stateAfter=new r.md({perNode:!0}),i}return b(n,[{key:"getIndent",value:function(t,e){for(var n=(0,o.qz)(t.state),r=n.resolve(e);r&&r.type!=this.topNode;)r=r.parent;if(!r)return null;var i,a,s=C(this,n,0,r.from,e);if(s?(a=s.state,i=s.pos+1):(a=this.streamParser.startState(t.unit),i=0),e-i>1e4)return null;for(;i=i&&n+e.length<=o&&e.prop(t.stateAfter);if(a)return{state:t.streamParser.copyState(a),pos:n+e.length};for(var s=e.children.length-1;s>=0;s--){var u=e.children[s],h=n+e.positions[s],l=u instanceof r.mp&&h=e.length)return e;o||e.type!=t.topNode||(o=!0);for(var a=e.children.length-1;a>=0;a--){var s=e.positions[a]+n,u=e.children[a],h=void 0;if(sn&&C(t,h.tree,0-h.offset,n,c),d=void 0;if(f&&(d=M(t,h.tree,n+h.offset,f.pos+h.offset,!1)))return{state:f.state,tree:d}}}catch(v){s.e(v)}finally{s.f()}return{state:t.streamParser.startState(i?(0,o.y1)(i):4),tree:r.mp.empty}}(e,i,h,null==s?void 0:s.state),c=l.state,f=l.tree;this.state=c,this.parsedPos=this.chunkStart=h+f.length,f.length&&(this.chunks.push(f),this.chunkPos.push(0)),s&&this.parsedPos=e?this.finish():t&&this.parsedPos>t.viewport.to?(t.skipUntilInView(this.parsedPos,e),this.finish()):null}},{key:"stopAt",value:function(t){this.stoppedAt=t}},{key:"lineAfter",value:function(t){var e=this.input.chunk(t);if(this.input.lineChunks)"\n"==e&&(e="");else{var n=e.indexOf("\n");n>-1&&(e=e.slice(0,n))}return t+e.length<=this.to?e:e.slice(0,this.to-t)}},{key:"nextLine",value:function(){for(var t=this.parsedPos,e=this.lineAfter(t),n=t+e.length,r=this.rangeIndex;;){var i=this.ranges[r].to;if(i>=n)break;if(e=e.slice(0,i-(n-e.length)),++r==this.ranges.length)break;var o=this.ranges[r].from,a=this.lineAfter(o);e+=a,n=o+a.length}return{line:e,end:n}}},{key:"skipGapsTo",value:function(t,e,n){for(;;){var r=this.ranges[this.rangeIndex].to,i=t+e;if(n>0?r>i:r>=i)break;e+=this.ranges[++this.rangeIndex].from-r}return e}},{key:"emitToken",value:function(t,e,n,r,i){if(this.ranges.length>1){e+=i=this.skipGapsTo(e,i,1);var o=this.chunk.length;n+=i=this.skipGapsTo(n,i,-1),r+=this.chunk.length-o}return this.chunk.push(t,e,n,r),i}},{key:"parseLine",value:function(t){var e=this.nextLine(),n=e.line,r=e.end,i=0,a=this.lang.streamParser,s=new x(n,t?t.state.tabSize:4,t?(0,o.y1)(t.state):2);if(s.eol())a.blankLine(this.state,s.indentUnit);else for(;!s.eol();){var u=T(a.token,s,this.state);u&&(i=this.emitToken(L(u),this.parsedPos+s.start,this.parsedPos+s.pos,4,i))}this.parsedPos=r,this.parsedPose.start)return i}throw new Error("Stream parser failed to advance stream.")}var D=Object.create(null),E=[r.Jq.none],P=new r.Lj(E),R=[];function L(t){return t?D[t]||(D[t]=function(t){var e,n=null,o=u(t.split("."));try{for(o.s();!(e=o.n()).done;){var s=e.value,h=i.pJ[s];h?"function"==typeof h?n?n=h(n):_(s,"Modifier ".concat(s," used at start of tag")):n?_(s,"Tag ".concat(s," used as modifier")):n=h:_(s,"Unknown highlighting tag ".concat(s))}}catch(f){o.e(f)}finally{o.f()}if(!n)return 0;var l=t.replace(/ /g,"_"),c=r.Jq.define({id:E.length,name:l,props:[(0,i.Gv)(a({},l,n))]});return E.push(c),c.id}(t)):0}for(var B=0,I=[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","typeName"],["attribute","propertyName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]];B-1||(R.push(t),console.warn(e))}},51686:function(t,e,n){function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(u){s=!0,i=u}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(t,e)||a(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=a(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}function a(t,e){if(t){if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(t,e):void 0}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt)return m[e-1]<=t;return!1}function b(t){return t>=127462&&t<=127487}function w(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(n?x:S)(t,e)}function x(t,e){if(e==t.length)return e;e&&A(t.charCodeAt(e))&&C(t.charCodeAt(e-1))&&e--;var n=M(t,e);for(e+=T(n);e=0&&b(M(t,o));)i++,o-=2;if(i%2==0)break;e+=2}}return e}function S(t,e){for(;e>0;){var n=x(t,e-2);if(n=56320&&t<57344}function C(t){return t>=55296&&t<56320}function M(t,e){var n=t.charCodeAt(e);if(!C(n)||e+1==t.length)return n;var r=t.charCodeAt(e+1);return A(r)?r-56320+(n-55296<<10)+65536:n}function O(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}function T(t){return t<65536?1:2}function D(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,r=0,i=0;i=e)return i;if(i==t.length)break;o+=9==t.charCodeAt(i)?n-o%n:1,i=w(t,i)}return!0===r?-1:t.length}var P=function(){function t(){v(this,t)}return g(t,[{key:"lineAt",value:function(t){if(t<0||t>this.length)throw new RangeError("Invalid position ".concat(t," in document of length ").concat(this.length));return this.lineInner(t,!1,1,0)}},{key:"line",value:function(t){if(t<1||t>this.lines)throw new RangeError("Invalid line number ".concat(t," in ").concat(this.lines,"-line document"));return this.lineInner(t,!0,1,0)}},{key:"replace",value:function(t,e,n){var r=[];return this.decompose(0,t,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(e,this.length,r,1),L.from(r,this.length-(e-t)+n.length)}},{key:"append",value:function(t){return this.replace(this.length,this.length,t)}},{key:"slice",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=[];return this.decompose(t,e,n,0),L.from(n,e-t)}},{key:"eq",value:function(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;for(var e=this.scanIdentical(t,1),n=this.length-this.scanIdentical(t,-1),r=new j(this),i=new j(t),o=e,a=e;;){if(r.next(o),i.next(o),o=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}},{key:"iter",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return new j(this,t)}},{key:"iterRange",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length;return new V(this,t,e)}},{key:"iterLines",value:function(t,e){var n;if(null==t)n=this.iter();else{null==e&&(e=this.lines+1);var r=this.line(t).from;n=this.iterRange(r,Math.max(r,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new _(n)}},{key:"toString",value:function(){return this.sliceString(0)}},{key:"toJSON",value:function(){var t=[];return this.flatten(t),t}}],[{key:"of",value:function(e){if(0==e.length)throw new RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new R(e):L.from(R.split(e,[])):t.empty}}]),t}(),R=function(t){h(n,t);var e=c(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:B(t);return v(this,n),(r=e.call(this)).text=t,r.length=i,r}return g(n,[{key:"lines",get:function(){return this.text.length}},{key:"children",get:function(){return null}},{key:"lineInner",value:function(t,e,n,r){for(var i=0;;i++){var o=this.text[i],a=r+o.length;if((e?n:a)>=t)return new H(r,a,n,o);r=a+1,n++}}},{key:"decompose",value:function(t,e,r,i){var o=t<=0&&e>=this.length?this:new n(N(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(1&i){var a=r.pop(),s=I(o.text,a.text.slice(),0,o.length);if(s.length<=32)r.push(new n(s,a.length+o.length));else{var u=s.length>>1;r.push(new n(s.slice(0,u)),new n(s.slice(u)))}}else r.push(o)}},{key:"replace",value:function(t,e,r){if(!(r instanceof n))return u(d(n.prototype),"replace",this).call(this,t,e,r);var i=I(this.text,I(r.text,N(this.text,0,t)),e),o=this.length+r.length-(e-t);return i.length<=32?new n(i,o):L.from(n.split(i,[]),o)}},{key:"sliceString",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"\n",r="",i=0,o=0;i<=e&&ot&&o&&(r+=n),ti&&(r+=a.slice(Math.max(0,t-i),e-i)),i=s+1}return r}},{key:"flatten",value:function(t){var e,n=o(this.text);try{for(n.s();!(e=n.n()).done;){var r=e.value;t.push(r)}}catch(i){n.e(i)}finally{n.f()}}},{key:"scanIdentical",value:function(){return 0}}],[{key:"split",value:function(t,e){var r,i=[],a=-1,s=o(t);try{for(s.s();!(r=s.n()).done;){var u=r.value;i.push(u),a+=u.length+1,32==i.length&&(e.push(new n(i,a)),i=[],a=-1)}}catch(h){s.e(h)}finally{s.f()}return a>-1&&e.push(new n(i,a)),e}}]),n}(P),L=function(t){h(n,t);var e=c(n);function n(t,r){var i;v(this,n),(i=e.call(this)).children=t,i.length=r,i.lines=0;var a,s=o(t);try{for(s.s();!(a=s.n()).done;){var u=a.value;i.lines+=u.lines}}catch(h){s.e(h)}finally{s.f()}return i}return g(n,[{key:"lineInner",value:function(t,e,n,r){for(var i=0;;i++){var o=this.children[i],a=r+o.length,s=n+o.lines-1;if((e?s:a)>=t)return o.lineInner(t,e,n,r);r=a+1,n=s+1}}},{key:"decompose",value:function(t,e,n,r){for(var i=0,o=0;o<=e&&i=o){var u=r&((o<=t?1:0)|(s>=e?2:0));o>=t&&s<=e&&!u?n.push(a):a.decompose(t-o,e-o,n,u)}o=s+1}}},{key:"replace",value:function(t,e,r){if(r.lines=o&&e<=s){var h=a.replace(t-o,e-o,r),l=this.lines-a.lines+h.lines;if(h.lines>4&&h.lines>l>>6){var c=this.children.slice();return c[i]=h,new n(c,this.length-(e-t)+r.length)}return u(d(n.prototype),"replace",this).call(this,o,s,h)}o=s+1}return u(d(n.prototype),"replace",this).call(this,t,e,r)}},{key:"sliceString",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"\n",r="",i=0,o=0;it&&i&&(r+=n),to&&(r+=a.sliceString(t-o,e-o,n)),o=s+1}return r}},{key:"flatten",value:function(t){var e,n=o(this.children);try{for(n.s();!(e=n.n()).done;){e.value.flatten(t)}}catch(r){n.e(r)}finally{n.f()}}},{key:"scanIdentical",value:function(t,e){if(!(t instanceof n))return 0;for(var r=0,o=i(e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1],4),a=o[0],s=o[1],u=o[2],h=o[3];;a+=e,s+=e){if(a==u||s==h)return r;var l=this.children[a],c=t.children[s];if(l!=c)return r+l.scanIdentical(c,e);r+=l.length+1}}}],[{key:"from",value:function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.reduce((function(t,e){return t+e.length+1}),-1),i=0,a=o(t);try{for(a.s();!(e=a.n()).done;){var s=e.value;i+=s.lines}}catch(A){a.e(A)}finally{a.f()}if(i<32){var u,h=[],l=o(t);try{for(l.s();!(u=l.n()).done;){var c=u.value;c.flatten(h)}}catch(A){l.e(A)}finally{l.f()}return new R(h,r)}var f=Math.max(32,i>>5),d=f<<1,v=f>>1,p=[],g=0,m=-1,y=[];function k(t){var e;if(t.lines>d&&t instanceof n){var r,i=o(t.children);try{for(i.s();!(r=i.n()).done;){k(r.value)}}catch(A){i.e(A)}finally{i.f()}}else t.lines>v&&(g>v||!g)?(b(),p.push(t)):t instanceof R&&g&&(e=y[y.length-1])instanceof R&&t.lines+e.lines<=32?(g+=t.lines,m+=t.length+1,y[y.length-1]=new R(e.text.concat(t.text),e.length+1+t.length)):(g+t.lines>f&&b(),g+=t.lines,m+=t.length+1,y.push(t))}function b(){0!=g&&(p.push(1==y.length?y[0]:n.from(y,m)),m=-1,g=y.length=0)}var w,x=o(t);try{for(x.s();!(w=x.n()).done;){var S=w.value;k(S)}}catch(A){x.e(A)}finally{x.f()}return b(),1==p.length?p[0]:new n(p,r)}}]),n}(P);function B(t){var e,n=-1,r=o(t);try{for(r.s();!(e=r.n()).done;){n+=e.value.length+1}}catch(i){r.e(i)}finally{r.f()}return n}function I(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e9,i=0,o=0,a=!0;o=n&&(u>r&&(s=s.slice(0,r-i)),i1&&void 0!==arguments[1]?arguments[1]:1;v(this,t),this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof R?e.text.length:e.children.length)<<1]}return g(t,[{key:"nextInner",value:function(t,e){for(this.done=this.lineBreak=!1;;){var n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],o=i>>1,a=r instanceof R?r.text.length:r.children.length;if(o==(e>0?a:0)){if(0==n)return this.done=!0,this.value="",this;e>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&i)==(e>0?0:1)){if(this.offsets[n]+=e,0==t)return this.lineBreak=!0,this.value="\n",this;t--}else if(r instanceof R){var s=r.text[o+(e<0?-1:0)];if(this.offsets[n]+=e,s.length>Math.max(0,t))return this.value=0==t?s:e>0?s.slice(t):s.slice(0,s.length-t),this;t-=s.length}else{var u=r.children[o+(e<0?-1:0)];t>u.length?(t-=u.length,this.offsets[n]+=e):(e<0&&this.offsets[n]--,this.nodes.push(u),this.offsets.push(e>0?1:(u instanceof R?u.text.length:u.children.length)<<1))}}}},{key:"next",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}]),t}(),V=function(){function t(e,n,r){v(this,t),this.value="",this.done=!1,this.cursor=new j(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}return g(t,[{key:"nextInner",value:function(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);var n=e<0?this.pos-this.from:this.to-this.pos;t>n&&(t=n),n-=t;var r=this.cursor.next(t).value;return this.pos+=(r.length+t)*e,this.value=r.length<=n?r:e<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}},{key:"next",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}},{key:"lineBreak",get:function(){return this.cursor.lineBreak&&""!=this.value}}]),t}(),_=function(){function t(e){v(this,t),this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}return g(t,[{key:"next",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.inner.next(t),n=e.done,r=e.lineBreak,i=e.value;return n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}},{key:"lineBreak",get:function(){return!1}}]),t}();"undefined"!=typeof Symbol&&(P.prototype[Symbol.iterator]=function(){return this.iter()},j.prototype[Symbol.iterator]=V.prototype[Symbol.iterator]=_.prototype[Symbol.iterator]=function(){return this});var H=function(){function t(e,n,r,i){v(this,t),this.from=e,this.to=n,this.number=r,this.text=i}return g(t,[{key:"length",get:function(){return this.to-this.from}}]),t}()},91643:function(t,e,n){n.d(e,{kH:function(){return Et},p:function(){return Pt},Nm:function(){return we},tk:function(){return lr},BF:function(){return ee},lg:function(){return ie},Uw:function(){return Pr},ZO:function(){return Hr},$f:function(){return xr},$1:function(){return Cr}});for(var r=n(74075),i=n(51686),o=n(28450),a=n(67037),s={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",229:"q"},u={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},h="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),l="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),c="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),f="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),d="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),v=h&&(f||+h[1]<57)||c&&f,p=0;p<10;p++)s[48+p]=s[96+p]=String(p);for(p=1;p<=24;p++)s[p+111]="F"+p;for(p=65;p<=90;p++)s[p]=String.fromCharCode(p+32),u[p]=String.fromCharCode(p);for(var g in s)u.hasOwnProperty(g)||(u[g]=s[g]);function m(t){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},m(t)}function y(t,e,n){return y="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=A(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}},y(t,e,n||t)}function k(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&b(t,e)}function b(t,e){return b=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},b(t,e)}function w(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=A(t);if(e){var i=A(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return x(this,n)}}function x(t,e){if(e&&("object"===m(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return S(t)}function S(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function A(t){return A=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},A(t)}function C(t){return function(t){if(Array.isArray(t))return T(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||O(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=O(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function O(t,e){if(t){if("string"==typeof t)return T(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?T(t,e):void 0}}function T(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:e,r=q||(q=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}function G(t,e,n){var r={key:e,code:e,keyCode:n,which:n,cancelable:!0},i=new KeyboardEvent("keydown",r);i.synthetic=!0,t.dispatchEvent(i);var o=new KeyboardEvent("keyup",r);return o.synthetic=!0,t.dispatchEvent(o),i.defaultPrevented||o.defaultPrevented}function J(t){for(;t;){if(t&&(9==t.nodeType||11==t.nodeType&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}var X=function(){function t(e,n){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];D(this,t),this.node=e,this.offset=n,this.precise=r}return P(t,null,[{key:"before",value:function(e,n){return new t(e.parentNode,j(e),n)}},{key:"after",value:function(e,n){return new t(e.parentNode,j(e)+1,n)}}]),t}(),Q=[],Y=function(){function t(){D(this,t),this.parent=null,this.dom=null,this.dirty=2}return P(t,[{key:"editorView",get:function(){if(!this.parent)throw new Error("Accessing view in orphan content view");return this.parent.editorView}},{key:"overrideDOMText",get:function(){return null}},{key:"posAtStart",get:function(){return this.parent?this.parent.posBefore(this):0}},{key:"posAtEnd",get:function(){return this.posAtStart+this.length}},{key:"posBefore",value:function(t){var e,n=this.posAtStart,r=M(this.children);try{for(r.s();!(e=r.n()).done;){var i=e.value;if(i==t)return n;n+=i.length+i.breakAfter}}catch(o){r.e(o)}finally{r.f()}throw new RangeError("Invalid child in posBefore")}},{key:"posAfter",value:function(t){return this.posBefore(t)+t.length}},{key:"coordsAt",value:function(t,e){return null}},{key:"sync",value:function(e){var n;if(2&this.dirty){var r,i=this.dom,o=i.firstChild,a=M(this.children);try{for(a.s();!(r=a.n()).done;){var s=r.value;if(s.dirty&&(s.dom||!o||(null===(n=t.get(o))||void 0===n?void 0:n.parent)||s.reuseDOM(o),s.sync(e),s.dirty=0),e&&!e.written&&e.node==i&&o!=s.dom&&(e.written=!0),s.dom.parentNode==i){for(;o&&o!=s.dom;)o=Z(o);o=s.dom.nextSibling}else i.insertBefore(s.dom,o)}}catch(c){a.e(c)}finally{a.f()}for(o&&e&&e.node==i&&(e.written=!0);o;)o=Z(o)}else if(1&this.dirty){var u,h=M(this.children);try{for(h.s();!(u=h.n()).done;){var l=u.value;l.dirty&&(l.sync(e),l.dirty=0)}}catch(c){h.e(c)}finally{h.f()}}}},{key:"reuseDOM",value:function(t){return!1}},{key:"localPosFromDOM",value:function(e,n){var r;if(e==this.dom)r=this.dom.childNodes[n];else{for(var i=0==_(e)?0:0==n?-1:1;;){var o=e.parentNode;if(o==this.dom)break;0==i&&o.firstChild!=o.lastChild&&(i=e==o.firstChild?-1:1),e=o}r=i<0?e:e.nextSibling}if(r==this.dom.firstChild)return 0;for(;r&&!t.get(r);)r=r.nextSibling;if(!r)return this.length;for(var a=0,s=0;;a++){var u=this.children[a];if(u.dom==r)return s;s+=u.length+u.breakAfter}}},{key:"domBoundsAround",value:function(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=-1,i=-1,o=-1,a=-1,s=0,u=n,h=n;se)return l.domBoundsAround(t,e,u);if(c>=t&&-1==r&&(r=s,i=u),u>e&&l.dom.parentNode==this.dom){o=s,a=h;break}h=c,u=c+l.breakAfter}return{from:i,to:a<0?n+this.length:a,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}},{key:"markDirty",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.dirty|=2,this.markParentsDirty(t)}},{key:"markParentsDirty",value:function(t){for(var e=this.parent;e;e=e.parent){if(t&&(e.dirty|=2),1&e.dirty)return;e.dirty|=1,t=!1}}},{key:"setParent",value:function(t){this.parent!=t&&(this.parent=t,this.dirty&&this.markParentsDirty(!0))}},{key:"setDOM",value:function(t){this.dom&&(this.dom.cmView=null),this.dom=t,t.cmView=this}},{key:"rootView",get:function(){for(var t=this;;){var e=t.parent;if(!e)return t;t=e}}},{key:"replaceChildren",value:function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Q;this.markDirty();for(var i=t;i0&&void 0!==arguments[0]?arguments[0]:this.length;return new tt(this.children,t,this.children.length)}},{key:"childPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.childCursor().findPos(t,e)}},{key:"toString",value:function(){var t=this.constructor.name.replace("View","");return t+(this.children.length?"("+this.children.join()+")":this.length?"["+("Text"==t?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}},{key:"isEditable",get:function(){return!0}}],[{key:"get",value:function(t){return t.cmView}}]),t}();function Z(t){var e=t.nextSibling;return t.parentNode.removeChild(t),e}Y.prototype.breakAfter=0;var tt=function(){function t(e,n,r){D(this,t),this.children=e,this.pos=n,this.i=r,this.off=0}return P(t,[{key:"findPos",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;;){if(t>this.pos||t==this.pos&&(e>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=t-this.pos,this;var n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}]),t}(),et=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(u){s=!0,i=u}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(t,e)||O(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}("undefined"!=typeof navigator?[navigator,document]:[{userAgent:"",vendor:"",platform:""},{documentElement:{style:{}}}],2),nt=et[0],rt=et[1],it=/Edge\/(\d+)/.exec(nt.userAgent),ot=/MSIE \d/.test(nt.userAgent),at=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(nt.userAgent),st=!!(ot||at||it),ut=!st&&/gecko\/(\d+)/i.test(nt.userAgent),ht=!st&&/Chrome\/(\d+)/.exec(nt.userAgent),lt="webkitFontSmoothing"in rt.documentElement.style,ct=!st&&/Apple Computer/.test(nt.vendor),ft=ct&&(/Mobile\/\w+/.test(nt.userAgent)||nt.maxTouchPoints>2),dt={mac:ft||/Mac/.test(nt.platform),windows:/Win/.test(nt.platform),linux:/Linux|X11/.test(nt.platform),ie:st,ie_version:ot?rt.documentMode||6:at?+at[1]:it?+it[1]:0,gecko:ut,gecko_version:ut?+(/Firefox\/(\d+)/.exec(nt.userAgent)||[0,0])[1]:0,chrome:!!ht,chrome_version:ht?+ht[1]:0,ios:ft,android:/Android\b/.test(nt.userAgent),webkit:lt,safari:ct,webkit_version:lt?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=rt.documentElement.style.tabSize?"tab-size":"-moz-tab-size"},vt=[],pt=function(t){k(n,t);var e=w(n);function n(){return D(this,n),e.apply(this,arguments)}return P(n,[{key:"become",value:function(t){return!1}},{key:"getSide",value:function(){return 0}}]),n}(Y);pt.prototype.children=vt;var gt=function(t){k(n,t);var e=w(n);function n(t){var r;return D(this,n),(r=e.call(this)).text=t,r}return P(n,[{key:"length",get:function(){return this.text.length}},{key:"createDOM",value:function(t){this.setDOM(t||document.createTextNode(this.text))}},{key:"sync",value:function(t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}},{key:"reuseDOM",value:function(t){return 3==t.nodeType&&(this.createDOM(t),!0)}},{key:"merge",value:function(t,e,r){return(!r||r instanceof n&&!(this.length-(e-t)+r.length>256))&&(this.text=this.text.slice(0,t)+(r?r.text:"")+this.text.slice(e),this.markDirty(),!0)}},{key:"slice",value:function(t){var e=new n(this.text.slice(t));return this.text=this.text.slice(0,t),e}},{key:"localPosFromDOM",value:function(t,e){return t==this.dom?e:e?this.text.length:0}},{key:"domAtPos",value:function(t){return new X(this.dom,t)}},{key:"domBoundsAround",value:function(t,e,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}},{key:"coordsAt",value:function(t,e){return yt(this.dom,t,e)}}]),n}(pt),mt=function(t){k(n,t);var e=w(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;D(this,n),(r=e.call(this)).mark=t,r.children=i,r.length=o;var a,s=M(i);try{for(s.s();!(a=s.n()).done;){var u=a.value;u.setParent(S(r))}}catch(h){s.e(h)}finally{s.f()}return r}return P(n,[{key:"createDOM",value:function(){var t=document.createElement(this.mark.tagName);if(this.mark.class&&(t.className=this.mark.class),this.mark.attrs)for(var e in this.mark.attrs)t.setAttribute(e,this.mark.attrs[e]);this.setDOM(t)}},{key:"sync",value:function(t){(!this.dom||4&this.dirty)&&this.createDOM(),y(A(n.prototype),"sync",this).call(this,t)}},{key:"merge",value:function(t,e,r,i,o){return(!r||!(!(r instanceof n&&r.mark.eq(this.mark))||t&&i<=0||et&&r.push(i=t&&(o=a),i=h,a++}}catch(c){s.e(c)}finally{s.f()}var l=this.length-t;return this.length=t,o>-1&&this.replaceChildren(o,this.children.length),new n(this.mark,r,l)}},{key:"domAtPos",value:function(t){return St(this.dom,this.children,t)}},{key:"coordsAt",value:function(t,e){return Ct(this,t,e)}}]),n}(pt);function yt(t,e,n){var r=t.nodeValue.length;e>r&&(e=r);var i=e,o=e,a=0;0==e&&n<0||e==r&&n>=0?dt.chrome||dt.gecko||(e?(i--,a=1):(o++,a=-1)):n<0?i--:o++;var s=U(t,i,o).getClientRects();if(!s.length)return H;var u=s[(a?a<0:n>=0)?0:s.length-1];return dt.safari&&!a&&0==u.width&&(u=Array.prototype.find.call(s,(function(t){return t.width}))||u),a?z(u,a<0):u}var kt=function(t){k(n,t);var e=w(n);function n(t,r,i){var o;return D(this,n),(o=e.call(this)).widget=t,o.length=r,o.side=i,o}return P(n,[{key:"slice",value:function(t){var e=n.create(this.widget,this.length-t,this.side);return this.length-=t,e}},{key:"sync",value:function(){this.dom&&this.widget.updateDOM(this.dom)||(this.setDOM(this.widget.toDOM(this.editorView)),this.dom.contentEditable="false")}},{key:"getSide",value:function(){return this.side}},{key:"merge",value:function(t,e,r,i,o){return!(r&&(!(r instanceof n&&this.widget.compare(r.widget))||t>0&&i<=0||e0?n.length-1:0;r=n[i],!(t>0?0==i:i==n.length-1||r.top0?-1:1);return 0==t&&e>0||t==this.length&&e<=0?r:z(r,0==t)}},{key:"isEditable",get:function(){return!1}}],[{key:"create",value:function(t,e,r){return new(t.customView||n)(t,e,r)}}]),n}(pt),bt=function(t){k(n,t);var e=w(n);function n(){return D(this,n),e.apply(this,arguments)}return P(n,[{key:"domAtPos",value:function(t){return new X(this.widget.text,t)}},{key:"sync",value:function(){this.dom||this.setDOM(this.widget.toDOM())}},{key:"localPosFromDOM",value:function(t,e){return e?3==t.nodeType?Math.min(e,this.length):this.length:0}},{key:"ignoreMutation",value:function(){return!1}},{key:"overrideDOMText",get:function(){return null}},{key:"coordsAt",value:function(t,e){return yt(this.widget.text,t,e)}},{key:"isEditable",get:function(){return!0}}]),n}(kt),wt=function(t){k(n,t);var e=w(n);function n(t){var r;return D(this,n),(r=e.call(this)).side=t,r}return P(n,[{key:"length",get:function(){return 0}},{key:"merge",value:function(){return!1}},{key:"become",value:function(t){return t instanceof n&&t.side==this.side}},{key:"slice",value:function(){return new n(this.side)}},{key:"sync",value:function(){this.dom?this.dirty&&"​"!=this.dom.nodeValue&&(this.dom.nodeValue="​"):this.setDOM(document.createTextNode("​"))}},{key:"getSide",value:function(){return this.side}},{key:"domAtPos",value:function(t){return X.before(this.dom)}},{key:"domBoundsAround",value:function(){return null}},{key:"coordsAt",value:function(t){var e=I(this.dom);return e[e.length-1]}},{key:"overrideDOMText",get:function(){return i.xv.of([this.dom.nodeValue.replace(/\u200b/g,"")])}}]),n}(pt);function xt(t,e,n,r,i,o){var a,s=t.childCursor(),u=s.findPos(n,1),h=u.i,l=u.off,c=s.findPos(e,-1),f=c.i,d=c.off,v=e-n,p=M(r);try{for(p.s();!(a=p.n()).done;){v+=a.value.length}}catch(x){p.e(x)}finally{p.f()}t.length+=v;var g=t.children;if(f==h&&d){var m=g[f];if(1==r.length&&m.merge(d,l,r[0],i,o))return;if(0==r.length)return void m.merge(d,l,null,i,o);var y=m.slice(l);y.merge(0,0,r[r.length-1],0,o)?r[r.length-1]=y:r.push(y),h++,o=l=0}if(l){var k=g[h];r.length&&k.merge(0,l,r[r.length-1],0,o)?(r.pop(),o=r.length?0:i):k.merge(0,l,null,0,0)}else hi&&n0;r--){var s=e[r-1].dom;if(s.parentNode==t)return X.after(s)}return new X(t,0)}function At(t,e,n){var r,i=t.children;n>0&&e instanceof mt&&i.length&&(r=i[i.length-1])instanceof mt&&r.mark.eq(e.mark)?At(r,e.children[0],n-1):(i.push(e),e.setParent(t)),t.length+=e.length}function Ct(t,e,n){for(var r=0,i=0;i0?a>=e:a>e)&&(e0)){var u=0;if(a==r){if(o.getSide()<=0)continue;u=n=-o.getSide()}var h=o.coordsAt(e-r,n);return u&&h?z(h,n<0):h}r=a}var l=t.dom.lastChild;if(!l)return t.dom.getBoundingClientRect();var c=I(l);return c[c.length-1]}function Mt(t,e){for(var n in t)"class"==n&&e.class?e.class+=" "+t.class:"style"==n&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}function Ot(t,e){if(t==e)return!0;if(!t||!e)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!=r.length)return!1;for(var i=0,o=n;i-1}}],[{key:"mark",value:function(t){return new Rt(t)}},{key:"widget",value:function(t){var e=t.side||0;return t.block&&(e+=200000001*(e>0?1:-1)),new Bt(t,e,e,!!t.block,t.widget||null,!1)}},{key:"replace",value:function(t){var e=!!t.block,n=It(t),r=n.start,i=n.end;return new Bt(t,e?-2e8*(r?2:1):1e8*(r?-1:1),e?2e8*(i?2:1):1e8*(i?1:-1),e,t.widget||null,!0)}},{key:"line",value:function(t){return new Lt(t)}},{key:"set",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return a.Xs.of(t,e)}}]),n}(a.uU);Pt.none=a.Xs.empty;var Rt=function(t){k(n,t);var e=w(n);function n(t){var r;D(this,n);var i=It(t),o=i.start,a=i.end;return(r=e.call(this,1e8*(o?-1:1),1e8*(a?1:-1),null,t)).tagName=t.tagName||"span",r.class=t.class||"",r.attrs=t.attributes||null,r}return P(n,[{key:"eq",value:function(t){return this==t||t instanceof n&&this.tagName==t.tagName&&this.class==t.class&&Ot(this.attrs,t.attrs)}},{key:"range",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(t>=e)throw new RangeError("Mark decorations may not be empty");return y(A(n.prototype),"range",this).call(this,t,e)}}]),n}(Pt);Rt.prototype.point=!1;var Lt=function(t){k(n,t);var e=w(n);function n(t){return D(this,n),e.call(this,-1e8,-1e8,null,t)}return P(n,[{key:"eq",value:function(t){return t instanceof n&&Ot(this.spec.attributes,t.spec.attributes)}},{key:"range",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(e!=t)throw new RangeError("Line decoration ranges must be zero-length");return y(A(n.prototype),"range",this).call(this,t,e)}}]),n}(Pt);Lt.prototype.mapMode=r.gc.TrackBefore,Lt.prototype.point=!0;var Bt=function(t){k(n,t);var e=w(n);function n(t,i,o,a,s,u){var h;return D(this,n),(h=e.call(this,i,o,s,t)).block=a,h.isReplace=u,h.mapMode=a?i<0?r.gc.TrackBefore:r.gc.TrackAfter:r.gc.TrackDel,h}return P(n,[{key:"type",get:function(){return this.startSide=5}},{key:"eq",value:function(t){return t instanceof n&&(e=this.widget,r=t.widget,e==r||!!(e&&r&&e.compare(r)))&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide;var e,r}},{key:"range",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return y(A(n.prototype),"range",this).call(this,t,e)}}]),n}(Pt);function It(t){var e=t.inclusiveStart,n=t.inclusiveEnd;return null==e&&(e=t.inclusive),null==n&&(n=t.inclusive),{start:e||!1,end:n||!1}}function Nt(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=n.length-1;i>=0&&n[i]+r>t?n[i]=Math.max(n[i],e):n.push(t,e)}Bt.prototype.point=!0;var jt=function(t){k(n,t);var e=w(n);function n(){var t;return D(this,n),(t=e.apply(this,arguments)).children=[],t.length=0,t.prevAttrs=void 0,t.attrs=null,t.breakAfter=0,t}return P(n,[{key:"merge",value:function(t,e,r,i,o,a){if(r){if(!(r instanceof n))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),xt(this,t,e,r?r.children:Vt,o,a),!0}},{key:"split",value:function(t){var e=new n;if(e.breakAfter=this.breakAfter,0==this.length)return e;var r=this.childPos(t),i=r.i,o=r.off;o&&(e.append(this.children[i].slice(o),0),this.children[i].merge(o,this.children[i].length,null,0,0),i++);for(var a=i;a0&&0==this.children[i-1].length;)this.children[i-1].parent=null,i--;return this.children.length=i,this.markDirty(),this.length=t,e}},{key:"transferDOM",value:function(t){this.dom&&(t.setDOM(this.dom),t.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}},{key:"setDeco",value:function(t){Ot(this.attrs,t)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=t)}},{key:"append",value:function(t,e){At(this,t,e)}},{key:"addLineDeco",value:function(t){var e=t.spec.attributes,n=t.spec.class;e&&(this.attrs=Mt(e,this.attrs||{})),n&&(this.attrs=Mt(e,{class:n}))}},{key:"domAtPos",value:function(t){return St(this.dom,this.children,t)}},{key:"sync",value:function(t){var e;(!this.dom||4&this.dirty)&&(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(Tt(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),y(A(n.prototype),"sync",this).call(this,t);for(var r=this.dom.lastChild;r&&Y.get(r)instanceof mt;)r=r.lastChild;if(!r||"BR"!=r.nodeName&&0==(null===(e=Y.get(r))||void 0===e?void 0:e.isEditable)&&(!dt.ios||!this.children.some((function(t){return t instanceof gt})))){var i=document.createElement("BR");i.cmIgnore=!0,this.dom.appendChild(i)}}},{key:"measureTextSize",value:function(){if(0==this.children.length||this.length>20)return null;var t,e=0,n=M(this.children);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(!(r instanceof gt))return null;var i=I(r.dom);if(1!=i.length)return null;e+=i[0].width}}catch(o){n.e(o)}finally{n.f()}return{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length}}},{key:"coordsAt",value:function(t,e){return Ct(this,t,e)}},{key:"match",value:function(t){return!1}},{key:"type",get:function(){return Et.Text}}],[{key:"find",value:function(t,e){for(var r=0,i=0;;r++){var o=t.children[r],a=i+o.length;if(a>=e){if(o instanceof n)return o;if(o.length)return null}i=a+o.breakAfter}}}]),n}(Y),Vt=[],_t=function(t){k(n,t);var e=w(n);function n(t,r,i){var o;return D(this,n),(o=e.call(this)).widget=t,o.length=r,o.type=i,o.breakAfter=0,o}return P(n,[{key:"merge",value:function(t,e,r,i,o,a){return!(r&&(!(r instanceof n&&this.widget.compare(r.widget))||t>0&&o<=0||e0;){if(this.textOff==this.text.length){var r=this.cursor.next(this.skip),i=r.value,o=r.lineBreak,a=r.done;if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer([]),this.curLine=null,t--;continue}this.text=i,this.textOff=0}var s=Math.min(this.text.length-this.textOff,t,512);this.flushBuffer(e),this.getLine().append(zt(new gt(this.text.slice(this.textOff,this.textOff+s)),e),n),this.atCursorPos=!0,this.textOff+=s,t-=s,n=0}}},{key:"span",value:function(t,e,n,r){this.buildText(e-t,n,r),this.pos=e,this.openStart<0&&(this.openStart=r)}},{key:"point",value:function(t,e,n,r,i){var o=e-t;if(n instanceof Bt)if(n.block){var a=n.type;a!=Et.WidgetAfter||this.posCovered()||this.getLine(),this.addBlockWidget(new _t(n.widget||new Wt("div"),o,a))}else{var s=kt.create(n.widget||new Wt("span"),o,n.startSide),u=this.atCursorPos&&!s.isEditable&&i<=r.length&&(t0),h=!s.isEditable&&(t0;e--){var r=t[e-1];if(!(r.fromA>n.toA)){if(r.toAl)break;o+=2}if(!u)return r;new t(u.fromA,u.toA,u.fromB,u.toB).addToSet(r),a=u.toA,s=u.toB}}}]),t}(),fe=function(){function t(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:qt;D(this,t),this.view=e,this.state=n,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=r.as.empty(this.startState.doc.length);var o,a=M(i);try{for(a.s();!(o=a.n()).done;){var s=o.value;this.changes=this.changes.compose(s.changes)}}catch(l){a.e(l)}finally{a.f()}var u=[];this.changes.iterChangedRanges((function(t,e,n,r){return u.push(new ce(t,e,n,r))})),this.changedRanges=u;var h=e.hasFocus;h!=e.inputState.notifiedFocused&&(e.inputState.notifiedFocused=h,this.flags|=1),this.docChanged&&(this.flags|=2)}return P(t,[{key:"viewportChanged",get:function(){return(4&this.flags)>0}},{key:"heightChanged",get:function(){return(2&this.flags)>0}},{key:"geometryChanged",get:function(){return this.docChanged||(10&this.flags)>0}},{key:"focusChanged",get:function(){return(1&this.flags)>0}},{key:"docChanged",get:function(){return this.transactions.some((function(t){return t.docChanged}))}},{key:"selectionSet",get:function(){return this.transactions.some((function(t){return t.selection}))}},{key:"empty",get:function(){return 0==this.flags&&0==this.transactions.length}}]),t}(),de=function(t){k(n,t);var e=w(n);function n(t){var r;return D(this,n),(r=e.call(this)).view=t,r.compositionDeco=Pt.none,r.decorations=[],r.minWidth=0,r.minWidthFrom=0,r.minWidthTo=0,r.impreciseAnchor=null,r.impreciseHead=null,r.setDOM(t.contentDOM),r.children=[new jt],r.children[0].setParent(S(r)),r.updateInner([new ce(0,0,0,t.state.doc.length)],r.updateDeco(),0),r}return P(n,[{key:"root",get:function(){return this.view.root}},{key:"editorView",get:function(){return this.view}},{key:"length",get:function(){return this.view.state.doc.length}},{key:"update",value:function(t){var e=this,n=t.changedRanges;this.minWidth>0&&n.length&&(n.every((function(t){var n=t.fromA;return t.toAe.minWidthTo}))?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=0),this.view.inputState.composing<0?this.compositionDeco=Pt.none:t.transactions.length&&(this.compositionDeco=function(t,e){var n=t.observer.selectionRange,r=n.focusNode&&me(n.focusNode,n.focusOffset,0);if(!r)return Pt.none;var i,o,a=t.docView.nearest(r),s=r;if(a instanceof pt){for(;a.parent instanceof pt;)a=a.parent;o=(i=a.posAtStart)+a.length,s=a.dom}else{if(!(a instanceof jt))return Pt.none;for(;s.parentNode!=a.dom;)s=s.parentNode;for(var u=s.previousSibling;u&&!Y.get(u);)u=u.previousSibling;i=o=u?Y.get(u).posAtEnd:a.posAtStart}var h=e.mapPos(i,1),l=Math.max(h,e.mapPos(o,-1)),c=r.nodeValue,f=t.state;if(l-h=this.view.viewport.from&&t.state.selection.main.to<=this.view.viewport.to?(this.updateSelection(u,f),!1):(this.updateInner(n,l,t.startState.doc.length,u,f),!0)}},{key:"reset",value:function(t){var e=this;this.dirty&&(this.view.observer.ignore((function(){return e.view.docView.sync()})),this.dirty=0),t&&this.updateSelection()}},{key:"updateInner",value:function(t,e,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];this.updateChildren(t,e,n);var a=this.view.observer;a.ignore((function(){r.dom.style.height=r.view.viewState.domHeight+"px",r.dom.style.minWidth=r.minWidth?r.minWidth+"px":"";var t=dt.chrome||dt.ios?{node:a.selectionRange.focusNode,written:!1}:void 0;r.sync(t),r.dirty=0,t&&(t.written||a.selectionRange.focusNode!=t.node)&&(i=!0),r.updateSelection(i,o),r.dom.style.height=""}));var s=[];if(this.view.viewport.from||this.view.viewport.to=0?t[i]:null;if(!o)break;var a=o.fromA,s=o.toA,u=o.fromB,h=o.toB,l=Ht.build(this.view.state.doc,u,h,e),c=l.content,f=l.breakAtStart,d=l.openStart,v=l.openEnd,p=r.findPos(s,1),g=p.i,m=p.off,y=r.findPos(a,-1),k=y.i,b=y.off;this.replaceRange(k,b,g,m,c,f,d,v)}}},{key:"replaceRange",value:function(t,e,n,r,i,o,a,s){var u=this.children[t],h=i.length?i[i.length-1]:null,l=h?h.breakAfter:o;if(t!=n||o||l||!(i.length<2)||!u.merge(e,r,i.length?h:null,0==e,a,s)){var c=this.children[n];for(r0&&(!o&&i.length&&u.merge(e,u.length,i[0],!1,a,0)?u.breakAfter=i.shift().breakAfter:(e0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(!n&&!this.mayControlSelection()||dt.ios&&this.view.inputState.rapidCompositionStart)){var r=this.view.state.selection.main,i=this.domAtPos(r.anchor),o=r.empty?i:this.domAtPos(r.head);if(dt.gecko&&r.empty&&ve(i)){var a=document.createTextNode("");this.view.observer.ignore((function(){return i.node.insertBefore(a,i.node.childNodes[i.offset]||null)})),i=o=new X(a,0),e=!0}var s=this.view.observer.selectionRange;!e&&s.focusNode&&N(i.node,i.offset,s.anchorNode,s.anchorOffset)&&N(o.node,o.offset,s.focusNode,s.focusOffset)||(this.view.observer.ignore((function(){dt.android&&dt.chrome&&t.dom.contains(s.focusNode)&&be(s.focusNode,t.dom)&&(t.dom.blur(),t.dom.focus({preventScroll:!0}));var e=R(t.root);if(r.empty){if(dt.gecko){var n=ye(i.node,i.offset);if(n&&3!=n){var a=me(i.node,i.offset,1==n?1:-1);a&&(i=new X(a,1==n?0:a.nodeValue.length))}}e.collapse(i.node,i.offset),null!=r.bidiLevel&&null!=s.cursorBidiLevel&&(s.cursorBidiLevel=r.bidiLevel)}else if(e.extend)e.collapse(i.node,i.offset),e.extend(o.node,o.offset);else{var u=document.createRange();if(r.anchor>r.head){var h=[o,i];i=h[0],o=h[1]}u.setEnd(o.node,o.offset),u.setStart(i.node,i.offset),e.removeAllRanges(),e.addRange(u)}})),this.view.observer.setSelectionRange(i,o)),this.impreciseAnchor=i.precise?null:new X(s.anchorNode,s.anchorOffset),this.impreciseHead=o.precise?null:new X(s.focusNode,s.focusOffset)}}},{key:"enforceCursorAssoc",value:function(){if(!this.view.composing){var t=this.view.state.selection.main,e=R(this.root);if(t.empty&&t.assoc&&e.modify){var n=jt.find(this,t.head);if(n){var r=n.posAtStart;if(t.head!=r&&t.head!=r+n.length){var i=this.coordsAt(t.head,-1),o=this.coordsAt(t.head,1);if(i&&o&&!(i.bottom>o.top)){var a=this.domAtPos(t.head+t.assoc);e.collapse(a.node,a.offset),e.modify("move",t.assoc<0?"forward":"backward","lineboundary")}}}}}}},{key:"mayControlSelection",value:function(){return this.view.state.facet(Zt)?this.root.activeElement==this.dom:B(this.dom,this.view.observer.selectionRange)}},{key:"nearest",value:function(t){for(var e=t;e;){var n=Y.get(e);if(n&&n.rootView==this)return n;e=e.parentNode}return null}},{key:"posFromDOM",value:function(t,e){var n=this.nearest(t);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(t,e)+n.posAtStart}},{key:"domAtPos",value:function(t){for(var e=this.childCursor().findPos(t,-1),n=e.i,r=e.off;no||t==o&&i.type!=Et.WidgetBefore&&i.type!=Et.WidgetAfter&&(!r||2==e||this.children[r-1].breakAfter||this.children[r-1].type==Et.WidgetBefore&&e>-2))return i.coordsAt(t-o,e);n=o}}},{key:"measureVisibleLineHeights",value:function(){for(var t=[],e=this.view.viewState.viewport,n=e.from,r=e.to,i=Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=0,a=0;ar)break;if(o>=n){t.push(s.dom.getBoundingClientRect().height);var h=s.dom.scrollWidth;h>i&&(this.minWidth=i=h,this.minWidthFrom=o,this.minWidthTo=u)}o=u+s.breakAfter}return t}},{key:"measureTextSize",value:function(){var t,e=this,n=M(this.children);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r instanceof jt){var i=r.measureTextSize();if(i)return i}}}catch(u){n.e(u)}finally{n.f()}var o,a,s=document.createElement("div");return s.className="cm-line",s.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((function(){e.dom.appendChild(s);var t=I(s.firstChild)[0];o=s.getBoundingClientRect().height,a=t?t.width/27:7,s.remove()})),{lineHeight:o,charWidth:a}}},{key:"childCursor",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.length,e=this.children.length;return e&&(t-=this.children[--e].length),new tt(this.children,t,e)}},{key:"computeBlockGapDeco",value:function(){for(var t=[],e=this.view.viewState,n=0,r=0;;r++){var i=r==e.viewports.length?null:e.viewports[r],o=i?i.from-1:this.length;if(o>n){var a=e.lineAt(o,0).bottom-e.lineAt(n,0).top;t.push(Pt.replace({widget:new pe(a),block:!0,inclusive:!0}).range(n,o))}if(!i)break;n=i.to+1}return Pt.set(t)}},{key:"updateDeco",value:function(){return this.decorations=[].concat(C(this.view.pluginField(ee.decorations)),C(this.view.state.facet(he)),[this.compositionDeco,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco])}},{key:"scrollIntoView",value:function(t){var e,n=t.range,r=t.center,i=this.coordsAt(n.head,n.empty?n.assoc:n.head>n.anchor?-1:1);if(i){!n.empty&&(e=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,e.left),top:Math.min(i.top,e.top),right:Math.max(i.right,e.right),bottom:Math.max(i.bottom,e.bottom)});var o,a=0,s=0,u=0,h=0,l=M(this.view.pluginField(ee.scrollMargins));try{for(l.s();!(o=l.n()).done;){var c=o.value;if(c){var f=c.left,d=c.right,v=c.top,p=c.bottom;null!=f&&(a=Math.max(a,f)),null!=d&&(s=Math.max(s,d)),null!=v&&(u=Math.max(u,v)),null!=p&&(h=Math.max(h,p))}}}catch(g){l.e(g)}finally{l.f()}!function(t,e,n,r){for(var i=t.ownerDocument,o=i.defaultView,a=t;a;)if(1==a.nodeType){var s=void 0,u=a==i.body;if(u)s=W(o);else{if(a.scrollHeight<=a.clientHeight&&a.scrollWidth<=a.clientWidth){a=a.parentNode;continue}var h=a.getBoundingClientRect();s={left:h.left,right:h.left+a.clientWidth,top:h.top,bottom:h.top+a.clientHeight}}var l=0,c=0;if(r){var f=e.bottom-e.top,d=s.bottom-s.top;c=(f<=d?e.top+f/2-d/2:n<0?e.top-5:e.bottom+5-d)-s.top,Math.abs(c)<=1&&(c=0)}else e.top0&&e.bottom>s.bottom+c&&(c=e.bottom-s.bottom+c+5)):e.bottom>s.bottom&&(c=e.bottom-s.bottom+5,n<0&&e.top-c0&&e.right>s.right+l&&(l=e.right-s.right+l+5)):e.right>s.right&&(l=e.right-s.right+5,n<0&&e.left0&&n<=0)e=_(t=t.childNodes[e-1]);else{if(!(1==t.nodeType&&e=0))return null;t=t.childNodes[e],e=0}}}function ye(t,e){return 1!=t.nodeType?0:(e&&"false"==t.childNodes[e-1].contentEditable?1:0)|(e=e){if(a.level==n)return o;(i<0||(0!=r?r<0?a.frome:t[i].level>a.level))&&(i=o)}}if(i<0)throw new RangeError("Index out of range");return i}}]),t}(),je=[];function Ve(t,e){var n=t.length,r=e==xe?1:2,i=e==xe?2:1;if(!t||1==r&&!Ie.test(t))return _e(n);for(var o=0,a=r,s=r;o=0;x-=3)if(Te[x+1]==-m){var S=Te[x+2],A=2&S?r:4&S?1&S?i:r:0;A&&(je[k]=je[Te[x]]=A),b=x;break}}else{if(189==Te.length)break;Te[b++]=k,Te[b++]=g,Te[b++]=w}else if(2==(y=je[k])||1==y){var C=y==r;w=C?0:1;for(var M=b-3;M>=0;M-=3){var O=Te[M+2];if(2&O)break;if(C)Te[M+2]|=2;else{if(4&O)break;Te[M+2]|=4}}}for(var T=0;TI;){for(var V=j,_=2!=je[--j];j>I&&_==(2!=je[j-1]);)j--;L.push(new Ne(j,V,_?2:1))}else L.push(new Ne(I,B,0))}else for(var H=0;Ht?e.left-t:Math.max(0,t-e.right)}function qe(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function Fe(t,e){return t.tope.top+1}function $e(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function Ue(t,e,n){for(var r,i,o,a,s,u,h,l,c=t.firstChild;c;c=c.nextSibling)for(var f=I(c),d=0;dg||a==g&&o>p)&&(r=c,i=v,o=p,a=g),0==p?n>v.bottom&&(!h||h.bottomv.top)&&(u=c,l=v):h&&Fe(h,v)?h=Ke(h,v.bottom):l&&Fe(l,v)&&(l=$e(l,v.top))}if(h&&h.bottom>=n?(r=s,i=h):l&&l.top<=n&&(r=u,i=l),!r)return{node:t,offset:0};var m=Math.max(i.left,Math.min(i.right,e));return 3==r.nodeType?Ge(r,m,n):o||"true"!=r.contentEditable?{node:t,offset:Array.prototype.indexOf.call(t.childNodes,r)+(e>=(i.left+i.right)/2?1:0)}:Ue(r,m,n)}function Ge(t,e,n){for(var r=t.nodeValue.length,i=-1,o=1e9,a=0,s=0;sn?l.top-n:n-l.bottom)-1;if(l.left-1<=e&&l.right+1>=e&&c=(l.left+l.right)/2,d=f;if(dt.chrome||dt.gecko)U(t,s).getBoundingClientRect().left==l.right&&(d=!f);if(c<=0)return{node:t,offset:s+(d?1:0)};i=s+(d?1:0),o=c}}}return{node:t,offset:i>-1?i:a>0?t.nodeValue.length:0}}function Je(t,e,n){for(var r,i,o=e.x,a=e.y,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,u=t.contentDOM.getBoundingClientRect(),h=t.defaultLineHeight/2,l=!1;;){if((i=t.blockAtHeight(a,u.top)).top>a||i.bottoma?-1:1,a=Math.min(i.bottom-h,Math.max(i.top+h,a)),l)return n?null:0;l=!0}if(i.type==Et.Text)break;a=s>0?i.bottom+h:i.top-h}var c=i.from;if(o=Math.max(u.left+1,Math.min(u.right-1,o)),ct.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:Xe(t,u,i,o,a);var f,d=t.dom.ownerDocument,v=(t.root.elementFromPoint?t.root:d).elementFromPoint(o,a),p=-1;if(v&&t.contentDOM.contains(v)&&0!=(null===(r=t.docView.nearest(v))||void 0===r?void 0:r.isEditable))if(d.caretPositionFromPoint){var g=d.caretPositionFromPoint(o,a);g&&(f=g.offsetNode,p=g.offset)}else if(d.caretRangeFromPoint){var m=d.caretRangeFromPoint(o,a);m&&(f=m.startContainer,p=m.startOffset,dt.safari&&Qe(f,p,o)&&(f=void 0))}if(!f||!t.docView.dom.contains(f)){var y=jt.find(t.docView,c),k=Ue(y.dom,o,a);f=k.node,p=k.offset}return t.docView.posFromDOM(f,p)}function Xe(t,e,n,r,o){var a=Math.round((r-e.left)*t.defaultCharacterWidth);t.lineWrapping&&n.height>1.5*t.defaultLineHeight&&(a+=Math.floor((o-n.top)/t.defaultLineHeight)*t.viewState.heightOracle.lineLength);var s=t.state.sliceDoc(n.from,n.to);return n.from+(0,i.Gz)(s,a,t.state.tabSize)}function Qe(t,e,n){var r;if(3!=t.nodeType||e!=(r=t.nodeValue.length))return!1;for(var i=t.nextSibling;i;i=i.nextSibling)if(1!=i.nodeType||"BR"!=i.nodeName)return!1;return U(t,r-1,r).getBoundingClientRect().left>n}function Ye(t,e,n,i){var o=t.state.doc.lineAt(e.head),a=i&&t.lineWrapping?t.coordsAtPos(e.assoc<0&&e.head>o.from?e.head-1:e.head):null;if(a){var s=t.dom.getBoundingClientRect(),u=t.posAtCoords({x:n==(t.textDirection==we.LTR)?s.right-1:s.left+1,y:(a.top+a.bottom)/2});if(null!=u)return r.jT.cursor(u,n?-1:1)}var h=jt.find(t.docView,e.head),l=h?n?h.posAtEnd:h.posAtStart:n?o.to:o.from;return r.jT.cursor(l,n?-1:1)}function Ze(t,e,n,i){for(var o=t.state.doc.lineAt(e.head),a=t.bidiSpans(o),s=e,u=null;;){var h=ze(o,a,t.textDirection,s,n),l=He;if(!h){if(o.number==(n?t.state.doc.lines:1))return s;l="\n",o=t.state.doc.line(o.number+(n?1:-1)),a=t.bidiSpans(o),h=r.jT.cursor(n?o.from:o.to)}if(u){if(!u(l))return s}else{if(!i)return h;u=i(l)}s=h}}function tn(t,e,n){for(var i=t.pluginField(ee.atomicRanges);;){var o,a=!1,s=M(i);try{for(s.s();!(o=s.n()).done;){o.value.between(n.from-1,n.from+1,(function(t,i,o){n.from>t&&n.fromn.from?r.jT.cursor(t,1):r.jT.cursor(i,-1),a=!0)}))}}catch(u){s.e(u)}finally{s.f()}if(!a)return n}}var en=function(){function t(e){var n=this;D(this,t),this.lastKeyCode=0,this.lastKeyTime=0,this.pendingAndroidKey=void 0,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.lastContextMenu=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.rapidCompositionStart=!1,this.mouseSelection=null;var r=function(t){var r=sn[t];e.contentDOM.addEventListener(t,(function(i){"keydown"==t&&n.keydown(e,i)||an(e,i)&&!n.ignoreDuringComposition(i)&&(n.mustFlushObserver(i)&&e.observer.forceFlush(),n.runCustomHandlers(t,e,i)?i.preventDefault():r(e,i))})),n.registeredEvents.push(t)};for(var i in sn)r(i);this.notifiedFocused=e.hasFocus,this.ensureHandlers(e),dt.safari&&e.contentDOM.addEventListener("input",(function(){return null}))}return P(t,[{key:"setSelectionOrigin",value:function(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}},{key:"ensureHandlers",value:function(t){var e,n=this,r=M(this.customHandlers=t.pluginField(oe));try{for(r.s();!(e=r.n()).done;){var i=e.value,o=function(e){n.registeredEvents.indexOf(e)<0&&"scroll"!=e&&(n.registeredEvents.push(e),t.contentDOM.addEventListener(e,(function(r){an(t,r)&&n.runCustomHandlers(e,t,r)&&r.preventDefault()})))};for(var a in i.handlers)o(a)}}catch(s){r.e(s)}finally{r.f()}}},{key:"runCustomHandlers",value:function(t,e,n){var r,i=M(this.customHandlers);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=o.handlers[t],s=!1;if(a){try{s=a.call(o.plugin,n,e)}catch(u){Yt(e.state,u)}if(s||n.defaultPrevented)return dt.android&&"keydown"==t&&13==n.keyCode&&e.observer.flushSoon(),!0}}}catch(h){i.e(h)}finally{i.f()}return!1}},{key:"runScrollHandlers",value:function(t,e){var n,r=M(this.customHandlers);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i.handlers.scroll;if(o)try{o.call(i.plugin,e,t)}catch(a){Yt(t.state,a)}}}catch(s){r.e(s)}finally{r.f()}}},{key:"keydown",value:function(t,e){var n,r=this;return this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),!!this.screenKeyEvent(t,e)||!(!dt.ios||!(n=nn.find((function(t){return t.keyCode==e.keyCode})))||e.ctrlKey||e.altKey||e.metaKey||e.synthetic)&&(this.pendingIOSKey=n,setTimeout((function(){return r.flushIOSKey(t)}),250),!0)}},{key:"flushIOSKey",value:function(t){var e=this.pendingIOSKey;return!!e&&(this.pendingIOSKey=void 0,G(t.contentDOM,e.key,e.keyCode))}},{key:"setPendingAndroidKey",value:function(t,e){var n=this;this.pendingAndroidKey=e,requestAnimationFrame((function(){var e=n.pendingAndroidKey;if(e){n.pendingAndroidKey=void 0,t.observer.processRecords();var r=t.state;G(t.contentDOM,e.key,e.keyCode),t.state==r&&t.docView.reset(!0)}}))}},{key:"ignoreDuringComposition",value:function(t){return!!/^key/.test(t.type)&&(this.composing>0||!!(dt.safari&&Date.now()-this.compositionEndedAt<500)&&(this.compositionEndedAt=0,!0))}},{key:"screenKeyEvent",value:function(t,e){var n=9==e.keyCode&&Date.now()=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}(n,i)&&null,!1===this.dragging&&(i.preventDefault(),this.select(i))}return P(t,[{key:"move",value:function(t){if(0==t.buttons)return this.destroy();!1===this.dragging&&this.select(this.lastEvent=t)}},{key:"up",value:function(t){null==this.dragging&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}},{key:"destroy",value:function(){var t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.inputState.mouseSelection=null}},{key:"select",value:function(t){var e=this.style.get(t,this.extend,this.multiple);e.eq(this.view.state.selection)&&e.main.assoc==this.view.state.selection.main.assoc||this.view.dispatch({selection:e,userEvent:"select.pointer",scrollIntoView:!0})}},{key:"update",value:function(t){var e=this;t.docChanged&&this.dragging&&(this.dragging=this.dragging.map(t.changes)),this.style.update(t)&&setTimeout((function(){return e.select(e.lastEvent)}),20)}}]),t}();function an(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(var n,r=e.target;r!=t.contentDOM;r=r.parentNode)if(!r||11==r.nodeType||(n=Y.get(r))&&n.ignoreEvent(e))return!1;return!0}var sn=Object.create(null),un=dt.ie&&dt.ie_version<15||dt.ios&&dt.webkit_version<604;function hn(t,e){var n,i=t.state,o=1,a=i.toText(e),s=a.lines==i.selection.ranges.length,u=null!=wn&&i.selection.ranges.every((function(t){return t.empty}))&&wn==a.toString();if(u){var h=-1;n=i.changeByRange((function(t){var n=i.doc.lineAt(t.from);if(n.from==h)return{range:t};h=n.from;var u=i.toText((s?a.line(o++).text:e)+i.lineBreak);return{changes:{from:n.from,insert:u},range:r.jT.cursor(t.from+u.length)}}))}else n=s?i.changeByRange((function(t){var e=a.line(o++);return{changes:{from:t.from,to:t.to,insert:e.text},range:r.jT.cursor(t.from+e.length)}})):i.replaceSelection(a);t.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}sn.keydown=function(t,e){t.inputState.setSelectionOrigin("select")};var ln=0;function cn(t,e,n,o){if(1==o)return r.jT.cursor(e,n);if(2==o)return function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=t.charCategorizer(e),a=t.doc.lineAt(e),s=e-a.from;if(0==a.length)return r.jT.cursor(e);0==s?n=1:s==a.length&&(n=-1);var u=s,h=s;n<0?u=(0,i.cp)(a.text,s,!1):h=(0,i.cp)(a.text,s);for(var l=o(a.text.slice(u,h));u>0;){var c=(0,i.cp)(a.text,u,!1);if(o(a.text.slice(c,u))!=l)break;u=c}for(;hDate.now()-2e3)){var n,i=null,o=M(t.state.facet(Kt));try{for(o.s();!(n=o.n()).done;){if(i=(0,n.value)(t,e))break}}catch(a){o.e(a)}finally{o.f()}i||0!=e.button||(i=function(t,e){var n=pn(t,e),i=function(t){if(!gn)return t.detail;var e=mn,n=kn;return mn=t,kn=Date.now(),yn=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(yn+1)%3:1}(e),o=t.state.selection,a=n,s=e;return{update:function(t){t.changes&&(n&&(n.pos=t.changes.mapPos(n.pos)),o=o.map(t.changes),s=null)},get:function(e,u,h){var l;if(s&&e.clientX==s.clientX&&e.clientY==s.clientY?l=a:(l=a=pn(t,e),s=e),!l||!n)return o;var c=cn(t,l.pos,l.bias,i);if(n.pos!=l.pos&&!u){var f=cn(t,n.pos,n.bias,i),d=Math.min(f.from,c.from),v=Math.max(f.to,c.to);c=d=e.top&&t<=e.bottom},dn=function(t,e,n){return fn(e,n)&&t>=n.left&&t<=n.right};function vn(t,e,n,r){var i=jt.find(t.docView,e);if(!i)return 1;var o=e-i.posAtStart;if(0==o)return 1;if(o==i.length)return-1;var a=i.coordsAt(o,-1);if(a&&dn(n,r,a))return-1;var s=i.coordsAt(o,1);return s&&dn(n,r,s)?1:a&&fn(r,a)?-1:1}function pn(t,e){var n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:vn(t,n,e.clientX,e.clientY)}}var gn=dt.ie&&dt.ie_version<=11,mn=null,yn=0,kn=0;function bn(t,e,n,r){var i=t.posAtCoords({x:e.clientX,y:e.clientY});if(null!=i&&n){e.preventDefault();var o=t.inputState.mouseSelection,a=r&&o&&o.dragging&&o.dragMove?{from:o.dragging.from,to:o.dragging.to}:null,s={from:i,insert:n},u=t.state.changes(a?[a,s]:s);t.focus(),t.dispatch({changes:u,selection:{anchor:u.mapPos(i,-1),head:u.mapPos(i,1)},userEvent:a?"move.drop":"input.drop"})}}sn.dragstart=function(t,e){var n=t.state.selection.main,r=t.inputState.mouseSelection;r&&(r.dragging=n),e.dataTransfer&&(e.dataTransfer.setData("Text",t.state.sliceDoc(n.from,n.to)),e.dataTransfer.effectAllowed="copyMove")},sn.drop=function(t,e){if(e.dataTransfer){if(t.state.readOnly)return e.preventDefault();var n=e.dataTransfer.files;n&&n.length?function(){e.preventDefault();for(var r=Array(n.length),i=0,o=function(){++i==n.length&&bn(t,e,r.filter((function(t){return null!=t})).join(t.state.lineBreak),!1)},a=function(t){var e=new FileReader;e.onerror=o,e.onload=function(){/[\x00-\x08\x0e-\x1f]{2}/.test(e.result)||(r[t]=e.result),o()},e.readAsText(n[t])},s=0;su&&(n.push(c.text),r.push({from:c.from,to:Math.min(t.doc.length,c.to+1)})),u=c.number}}catch(f){h.e(f)}finally{h.f()}i=!0}return{text:n.join(t.lineBreak),ranges:r,linewise:i}}(t.state),r=n.text,i=n.ranges,o=n.linewise;if(r||o){wn=o?r:null;var a=un?null:e.clipboardData;a?(e.preventDefault(),a.clearData(),a.setData("text/plain",r)):function(t,e){var n=t.dom.parentNode;if(n){var r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout((function(){r.remove(),t.focus()}),50)}}(t,r),"cut"!=e.type||t.state.readOnly||t.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"})}},sn.focus=sn.blur=function(t){setTimeout((function(){t.hasFocus!=t.inputState.notifiedFocused&&t.update([])}),10)},sn.beforeprint=function(t){t.viewState.printing=!0,t.requestMeasure(),setTimeout((function(){t.viewState.printing=!1,t.requestMeasure()}),2e3)},sn.compositionstart=sn.compositionupdate=function(t){null==t.inputState.compositionFirstChange&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.docView.compositionDeco.size&&(t.observer.flush(),xn(t,!0)),t.inputState.composing=0)},sn.compositionend=function(t){t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionFirstChange=null,setTimeout((function(){t.inputState.composing<0&&xn(t,!1)}),50)},sn.contextmenu=function(t){t.inputState.lastContextMenu=Date.now()},sn.beforeinput=function(t,e){var n,r;if(dt.chrome&&dt.android&&(r=nn.find((function(t){return t.inputType==e.inputType})))&&(t.inputState.setPendingAndroidKey(t,r),"Backspace"==r.key||"Delete"==r.key)){var i=(null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0;setTimeout((function(){var e;((null===(e=window.visualViewport)||void 0===e?void 0:e.height)||0)>i+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())}),100)}};var Sn=["pre-wrap","normal","pre-line"],An=function(){function t(){D(this,t),this.doc=i.xv.empty,this.lineWrapping=!1,this.direction=we.LTR,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.lineLength=30,this.heightChanged=!1}return P(t,[{key:"heightForGap",value:function(t,e){var n=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(n+=Math.ceil((e-t-n*this.lineLength*.5)/this.lineLength)),this.lineHeight*n}},{key:"heightForLine",value:function(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}},{key:"setDoc",value:function(t){return this.doc=t,this}},{key:"mustRefresh",value:function(t,e,n){for(var r=!1,i=0;i-1!=this.lineWrapping||this.direction!=n}},{key:"refresh",value:function(t,e,n,r,i,o){var a=Sn.indexOf(t)>-1,s=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=a||this.direction!=e;if(this.lineWrapping=a,this.direction=e,this.lineHeight=n,this.charWidth=r,this.lineLength=i,s){this.heightSamples={};for(var u=0;u2&&void 0!==arguments[2]?arguments[2]:2;D(this,t),this.length=e,this.height=n,this.flags=r}return P(t,[{key:"outdated",get:function(){return(2&this.flags)>0},set:function(t){this.flags=(t?2:0)|-3&this.flags}},{key:"setHeight",value:function(t,e){this.height!=e&&(Math.abs(this.height-e)>1e-4&&(t.heightChanged=!0),this.height=e)}},{key:"replace",value:function(e,n,r){return t.of(r)}},{key:"decomposeLeft",value:function(t,e){e.push(this)}},{key:"decomposeRight",value:function(t,e){e.push(this)}},{key:"applyChanges",value:function(t,e,n,r){for(var i=this,o=r.length-1;o>=0;o--){var a=r[o],s=a.fromA,u=a.toA,h=a.fromB,l=a.toB,c=i.lineAt(s,On.ByPosNoHeight,e,0,0),f=c.to>=u?c:i.lineAt(u,On.ByPosNoHeight,e,0,0);for(l+=f.to-u,u=f.to;o>0&&c.from<=r[o-1].toA;)s=r[o-1].fromA,h=r[o-1].fromB,o--,s2*o){var a=e[n-1];a.break?e.splice(--n,1,a.left,null,a.right):e.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else{if(!(o>2*i))break;var s=e[r];s.break?e.splice(r,1,s.left,null,s.right):e.splice(r,1,s.left,s.right),r+=2+s.break,o-=s.size}else if(i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>3?arguments[3]:void 0;return n&&n.from<=e&&n.more&&this.setHeight(t,n.heights[n.index++]),this.outdated=!1,this}},{key:"toString",value:function(){return"block(".concat(this.length,")")}}]),n}(Tn),En=function(t){k(n,t);var e=w(n);function n(t,r){var i;return D(this,n),(i=e.call(this,t,r,Et.Text)).collapsed=0,i.widgetHeight=0,i}return P(n,[{key:"replace",value:function(t,e,r){var i=r[0];return 1==r.length&&(i instanceof n||i instanceof Pn&&4&i.flags)&&Math.abs(this.length-i.length)<10?(i instanceof Pn?i=new n(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):Tn.of(r)}},{key:"updateHeight",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;return r&&r.from<=e&&r.more?this.setHeight(t,r.heights[r.index++]):(n||this.outdated)&&this.setHeight(t,Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))),this.outdated=!1,this}},{key:"toString",value:function(){return"line(".concat(this.length).concat(this.collapsed?-this.collapsed:"").concat(this.widgetHeight?":"+this.widgetHeight:"",")")}}]),n}(Dn),Pn=function(t){k(n,t);var e=w(n);function n(t){return D(this,n),e.call(this,t,0)}return P(n,[{key:"lines",value:function(t,e){var n=t.lineAt(e).number,r=t.lineAt(e+this.length).number;return{firstLine:n,lastLine:r,lineHeight:this.height/(r-n+1)}}},{key:"blockAt",value:function(t,e,n,r){var i=this.lines(e,r),o=i.firstLine,a=i.lastLine,s=i.lineHeight,u=Math.max(0,Math.min(a-o,Math.floor((t-n)/s))),h=e.line(o+u),l=h.from,c=h.length;return new Mn(l,c,n+s*u,s,Et.Text)}},{key:"lineAt",value:function(t,e,n,r,i){if(e==On.ByHeight)return this.blockAt(t,n,r,i);if(e==On.ByPosNoHeight){var o=n.lineAt(t),a=o.from,s=o.to;return new Mn(a,s-a,0,0,Et.Text)}var u=this.lines(n,i),h=u.firstLine,l=u.lineHeight,c=n.lineAt(t),f=c.from,d=c.length,v=c.number;return new Mn(f,d,r+l*(v-h),l,Et.Text)}},{key:"forEachLine",value:function(t,e,n,r,i,o){for(var a=this.lines(n,i),s=a.firstLine,u=a.lineHeight,h=Math.max(t,i),l=Math.min(i+this.length,e);h<=l;){var c=n.lineAt(h);h==t&&(r+=u*(c.number-s)),o(new Mn(c.from,c.length,r,u,Et.Text)),r+=u,h=c.to+1}}},{key:"replace",value:function(t,e,r){var i=this.length-e;if(i>0){var o=r[r.length-1];o instanceof n?r[r.length-1]=new n(o.length+i):r.push(null,new n(i-1))}if(t>0){var a=r[0];a instanceof n?r[0]=new n(t+a.length):r.unshift(new n(t-1),null)}return Tn.of(r)}},{key:"decomposeLeft",value:function(t,e){e.push(new n(t-1),null)}},{key:"decomposeRight",value:function(t,e){e.push(null,new n(this.length-t-1))}},{key:"updateHeight",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,o=e+this.length;if(i&&i.from<=e+this.length&&i.more){var a=[],s=Math.max(e,i.from);for(i.from>e&&a.push(new n(i.from-e-1).updateHeight(t,e));s<=o&&i.more;){var u=t.doc.lineAt(s).length;a.length&&a.push(null);var h=new En(u,i.heights[i.index++]);h.outdated=!1,a.push(h),s+=u+1}return s<=o&&a.push(null,new n(o-s).updateHeight(t,s)),t.heightChanged=!0,Tn.of(a)}return(r||this.outdated)&&(this.setHeight(t,t.heightForGap(e,e+this.length)),this.outdated=!1),this}},{key:"toString",value:function(){return"gap(".concat(this.length,")")}}]),n}(Tn),Rn=function(t){k(n,t);var e=w(n);function n(t,r,i){var o;return D(this,n),(o=e.call(this,t.length+r+i.length,t.height+i.height,r|(t.outdated||i.outdated?2:0))).left=t,o.right=i,o.size=t.size+i.size,o}return P(n,[{key:"break",get:function(){return 1&this.flags}},{key:"blockAt",value:function(t,e,n,r){var i=n+this.left.height;return ta))return u;var h=e==On.ByPosNoHeight?On.ByPosNoHeight:On.ByPos;return s?u.join(this.right.lineAt(a,h,n,o,a)):this.left.lineAt(a,h,n,r,i).join(u)}},{key:"forEachLine",value:function(t,e,n,r,i,o){var a=r+this.left.height,s=i+this.left.length+this.break;if(this.break)t=s&&this.right.forEachLine(t,e,n,a,s,o);else{var u=this.lineAt(s,On.ByPos,n,r,i);t=t&&u.from<=e&&o(u),e>u.to&&this.right.forEachLine(u.to+1,e,n,a,s,o)}}},{key:"replace",value:function(t,e,n){var r=this.left.length+this.break;if(ethis.left.length)return this.balanced(this.left,this.right.replace(t-r,e-r,n));var i=[];t>0&&this.decomposeLeft(t,i);var o,a=i.length,s=M(n);try{for(s.s();!(o=s.n()).done;){var u=o.value;i.push(u)}}catch(l){s.e(l)}finally{s.f()}if(t>0&&Ln(i,a-1),e=++n&&e.push(null),t>n&&this.right.decomposeLeft(t-n,e)}},{key:"decomposeRight",value:function(t,e){var n=this.left.length,r=n+this.break;if(t>=r)return this.right.decomposeRight(t-r,e);t2*e.size||e.size>2*t.size?Tn.of(this.break?[t,null,e]:[t,e]):(this.left=t,this.right=e,this.height=t.height+e.height,this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this.break+e.length,this)}},{key:"updateHeight",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,i=this.left,o=this.right,a=e+i.length+this.break,s=null;return r&&r.from<=e+i.length&&r.more?s=i=i.updateHeight(t,e,n,r):i.updateHeight(t,e,n),r&&r.from<=a+o.length&&r.more?s=o=o.updateHeight(t,a,n,r):o.updateHeight(t,a,n),s?this.balanced(i,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}},{key:"toString",value:function(){return this.left+(this.break?" ":"-")+this.right}}]),n}(Tn);function Ln(t,e){var n,r;null==t[e]&&(n=t[e-1])instanceof Pn&&(r=t[e+1])instanceof Pn&&t.splice(e-1,3,new Pn(n.length+1+r.length))}var Bn=function(){function t(e,n){D(this,t),this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}return P(t,[{key:"isCovered",get:function(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}},{key:"span",value:function(t,e){if(this.lineStart>-1){var n=Math.min(e,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof En?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new En(n-this.pos,-1)),this.writtenTo=n,e>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=e}},{key:"point",value:function(t,e,n){if(t=5)&&this.addLineDeco(r,i)}else e>t&&this.span(t,e);this.lineEnd>-1&&this.lineEnd-1)){var t=this.oracle.doc.lineAt(this.pos),e=t.from,n=t.to;this.lineStart=e,this.lineEnd=n,this.writtenToe&&this.nodes.push(new En(this.pos-e,-1)),this.writtenTo=this.pos}}},{key:"blankContent",value:function(t,e){var n=new Pn(e-t);return this.oracle.doc.lineAt(t).to==e&&(n.flags|=4),n}},{key:"ensureLine",value:function(){this.enterLine();var t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof En)return t;var e=new En(0,-1);return this.nodes.push(e),e}},{key:"addBlock",value:function(t){this.enterLine(),t.type!=Et.WidgetAfter||this.isCovered||this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,t.type!=Et.WidgetBefore&&(this.covering=t)}},{key:"addLineDeco",value:function(t,e){var n=this.ensureLine();n.length+=e,n.collapsed+=e,n.widgetHeight=Math.max(n.widgetHeight,t),this.writtenTo=this.pos=this.pos+e}},{key:"finish",value:function(t){var e=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||e instanceof En||this.isCovered?(this.writtenTo1&&void 0!==arguments[1]&&arguments[1];D(this,t),this.range=e,this.center=n}return P(t,[{key:"map",value:function(e){return e.empty?this:new t(this.range.map(e),this.center)}}]),t}(),Hn=function(){function t(e){D(this,t),this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentWidth=0,this.heightOracle=new An,this.scaler=$n,this.scrollTarget=null,this.printing=!1,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1,this.heightMap=Tn.empty().applyChanges(e.facet(he),i.xv.empty,this.heightOracle.setDoc(e.doc),[new ce(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Pt.set(this.lineGaps.map((function(t){return t.draw(!1)}))),this.computeVisibleRanges()}return P(t,[{key:"updateForViewport",value:function(){for(var t=this,e=[this.viewport],n=this.state.selection.main,r=function(r){var i=r?n.head:n.anchor;if(!e.some((function(t){var e=t.from,n=t.to;return i>=e&&i<=n}))){var o=t.lineAt(i,0),a=o.from,s=o.to;e.push(new zn(a,s))}},i=0;i<=1;i++)r(i);this.viewports=e.sort((function(t,e){return t.from-e.from})),this.scaler=this.heightMap.height<=7e6?$n:new Kn(this.heightOracle.doc,this.heightMap,this.viewports)}},{key:"update",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.state;this.state=t.state;var i=this.state.facet(he),o=t.changedRanges,a=ce.extendWithRanges(o,In(t.startState.facet(he),i,t?t.changes:r.as.empty(this.state.doc.length))),s=this.heightMap.height;this.heightMap=this.heightMap.applyChanges(i,n.doc,this.heightOracle.setDoc(this.state.doc),a),this.heightMap.height!=s&&(t.flags|=2);var u=a.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.range.headu.to)||!this.viewportIsAppropriate(u))&&(u=this.getViewport(0,e)),this.viewport=u,this.updateForViewport(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(),e&&(this.scrollTarget=e),!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&(this.mustEnforceCursorAssoc=!0)}},{key:"measure",value:function(t,e){var n=t.dom,r="",i=we.LTR,o=0;if(!e){var a=window.getComputedStyle(n);r=a.whiteSpace,i="rtl"==a.direction?we.RTL:we.LTR;var s=parseInt(a.paddingTop)||0,u=parseInt(a.paddingBottom)||0;this.paddingTop==s&&this.paddingBottom==u||(o|=8,this.paddingTop=s,this.paddingBottom=u)}var h=this.printing?{top:-1e8,bottom:1e8,left:-1e8,right:1e8}:function(t,e){for(var n=t.getBoundingClientRect(),r=Math.max(0,n.left),i=Math.min(innerWidth,n.right),o=Math.max(0,n.top),a=Math.min(innerHeight,n.bottom),s=t.ownerDocument.body,u=t.parentNode;u&&u!=s;)if(1==u.nodeType){var h=u,l=window.getComputedStyle(h);if((h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth)&&"visible"!=l.overflow){var c=h.getBoundingClientRect();r=Math.max(r,c.left),i=Math.min(i,c.right),o=Math.max(o,c.top),a=Math.min(a,c.bottom)}u="absolute"==l.position||"fixed"==l.position?h.offsetParent:h.parentNode}else{if(11!=u.nodeType)break;u=u.host}return{left:r-n.left,right:i-n.left,top:o-(n.top+e),bottom:a-(n.top+e)}}(n,this.paddingTop),l=h.top-this.pixelViewport.top,c=h.bottom-this.pixelViewport.bottom;if(this.pixelViewport=h,this.inView=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left,!this.inView)return 0;var f=t.measureVisibleLineHeights(),d=!1,v=0,p=this.heightOracle;if(!e){var g=t.dom.clientWidth;if(p.mustRefresh(f,r,i)||p.lineWrapping&&Math.abs(g-this.contentWidth)>p.charWidth){var m=t.measureTextSize(),y=m.lineHeight,k=m.charWidth;(d=p.refresh(r,i,y,k,g/k,f))&&(t.minWidth=0,o|=8)}this.contentWidth!=g&&(this.contentWidth=g,o|=8),l>0&&c>0?v=Math.max(l,c):l<0&&c<0&&(v=Math.min(l,c))}return p.heightChanged=!1,this.heightMap=this.heightMap.updateHeight(p,0,d,new Cn(this.viewport.from,f)),p.heightChanged&&(o|=2),(!this.viewportIsAppropriate(this.viewport,v)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to))&&(this.viewport=this.getViewport(v,this.scrollTarget)),this.updateForViewport(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(d?[]:this.lineGaps)),o|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.enforceCursorAssoc()),o}},{key:"visibleTop",get:function(){return this.scaler.fromDOM(this.pixelViewport.top,0)}},{key:"visibleBottom",get:function(){return this.scaler.fromDOM(this.pixelViewport.bottom,0)}},{key:"getViewport",value:function(t,e){var n=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),r=this.heightMap,i=this.state.doc,o=this.visibleTop,a=this.visibleBottom,s=new zn(r.lineAt(o-1e3*n,On.ByHeight,i,0,0).from,r.lineAt(a+1e3*(1-n),On.ByHeight,i,0,0).to);if(e){var u=e.range.head,h=a-o;if(us.to){var l,c=r.lineAt(u,On.ByPos,i,0,0);l=e.center?(c.top+c.bottom)/2-h/2:u1&&void 0!==arguments[1]?arguments[1]:0,i=this.heightMap.lineAt(e,On.ByPos,this.state.doc,0,0),o=i.top,a=this.heightMap.lineAt(n,On.ByPos,this.state.doc,0,0),s=a.bottom,u=this.visibleTop,h=this.visibleBottom;return(0==e||o<=u-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||s>=h+Math.max(10,Math.min(r,250)))&&o>u-2e3&&si&&(r.push({from:i,to:t}),o+=t-i),i=e}},20),ir.from&&c.push({from:r.from,to:o}),s=r.from&&f.from<=r.to&&Fn(c,f.from-10,f.from+10),!f.empty&&f.to>=r.from&&f.to<=r.to&&Fn(c,f.to-10,f.to+10);for(var d=function(){var o=p[v],a=o.from,s=o.to;s-a>1e3&&n.push(function(t,e){var n,r=M(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(e(i))return i}}catch(o){r.e(o)}finally{r.f()}return}(t,(function(t){return t.from>=r.from&&t.to<=r.to&&Math.abs(t.from-a)<1e3&&Math.abs(t.to-s)<1e3}))||new jn(a,s,e.gapSize(r,a,s,i)))},v=0,p=c;v=1)return r[r.length-1].to;for(var i=Math.floor(n*e),o=0;;o++){var a=r[o],s=a.from,u=a.to-s;if(i<=u)return s+i;i-=u}}function qn(t,e){var n,r=0,i=M(t.ranges);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=o.from,s=o.to;if(e<=s){r+=e-a;break}r+=s-a}}catch(u){i.e(u)}finally{i.f()}return r/t.total}function Fn(t,e,n){for(var r=0;re){var o=[];i.fromn&&o.push({from:n,to:i.to}),t.splice.apply(t,[r,1].concat(o)),r+=o.length-1}}}var $n={toDOM:function(t){return t},fromDOM:function(t){return t},scale:1},Kn=function(){function t(e,n,r){D(this,t);var i=0,o=0,a=0;this.viewports=r.map((function(t){var r=t.from,o=t.to,a=n.lineAt(r,On.ByPos,e,0,0).top,s=n.lineAt(o,On.ByPos,e,0,0).bottom;return i+=s-a,{from:r,to:o,top:a,bottom:s,domTop:0,domBottom:0}})),this.scale=(7e6-i)/(n.height-i);var s,u=M(this.viewports);try{for(u.s();!(s=u.n()).done;){var h=s.value;h.domTop=a+(h.top-o)*this.scale,a=h.domBottom=h.domTop+(h.bottom-h.top),o=h.bottom}}catch(l){u.e(l)}finally{u.f()}}return P(t,[{key:"toDOM",value:function(t,e){t-=e;for(var n=0,r=0,i=0;;n++){var o=n-1}}),Xn=o.V.newName(),Qn=o.V.newName(),Yn=o.V.newName(),Zn={"&light":"."+Qn,"&dark":"."+Yn};function tr(t,e,n){return new o.V(e,{finish:function(e){return/&/.test(e)?e.replace(/&\w*/,(function(e){if("&"==e)return t;if(!n||!n[e])throw new RangeError("Unsupported selector: ".concat(e));return n[e]})):t+" "+e}})}var er=tr("."+Xn,{"&.cm-editor":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,minHeight:"100%",display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace:"pre-wrap",wordBreak:"break-word",overflowWrap:"anywhere"},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 4px"},".cm-selectionLayer":{zIndex:-1,contain:"size style"},".cm-selectionBackground":{position:"absolute"},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{zIndex:100,contain:"size style",pointerEvents:"none"},"&.cm-focused .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},".cm-cursor":{position:"absolute",borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none",display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},"&.cm-focused .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#f3f9ff"},"&dark .cm-activeLine":{backgroundColor:"#223039"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-placeholder":{color:"#888",display:"inline-block"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"3px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Zn),nr={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},rr=dt.ie&&dt.ie_version<=11,ir=function(){function t(e,n,r){var i=this;D(this,t),this.view=e,this.onChange=n,this.onScrollChanged=r,this.active=!1,this.ignoreSelection=new F,this.delayedFlush=-1,this.queue=[],this.lastFlush=0,this.scrollTargets=[],this.intersection=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this._selectionRange=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver((function(t){var n,r=M(t);try{for(r.s();!(n=r.n()).done;){var o=n.value;i.queue.push(o)}}catch(a){r.e(a)}finally{r.f()}i._selectionRange=null,(dt.ie&&dt.ie_version<=11||dt.ios&&e.composing)&&t.some((function(t){return"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length}))?i.flushSoon():i.flush()})),rr&&(this.onCharData=function(t){i.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),i.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.start(),this.onScroll=this.onScroll.bind(this),window.addEventListener("scroll",this.onScroll),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver((function(t){i.parentCheck<0&&(i.parentCheck=setTimeout(i.listenForScroll.bind(i),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=i.intersecting&&(i.intersecting=!i.intersecting,i.intersecting!=i.view.inView&&i.onScrollChanged(document.createEvent("Event")))}),{}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver((function(t){t.length>0&&t[t.length-1].intersectionRatio>0&&i.onScrollChanged(document.createEvent("Event"))}),{})),this.listenForScroll()}return P(t,[{key:"onScroll",value:function(t){this.intersecting&&this.flush(),this.onScrollChanged(t)}},{key:"updateGaps",value:function(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((function(e,n){return e!=t[n]})))){this.gapIntersection.disconnect();var e,n=M(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.gapIntersection.observe(r)}}catch(i){n.e(i)}finally{n.f()}this.gaps=t}}},{key:"onSelectionChange",value:function(t){this.lastFlush=0&&(window.clearTimeout(this.delayedFlush),this.delayedFlush=-1,this.flush())}},{key:"processRecords",value:function(){var t,e=this.queue,n=M(this.observer.takeRecords());try{for(n.s();!(t=n.n()).done;){var r=t.value;e.push(r)}}catch(c){n.e(c)}finally{n.f()}e.length&&(this.queue=[]);var i,o=-1,a=-1,s=!1,u=M(e);try{for(u.s();!(i=u.n()).done;){var h=i.value,l=this.readMutation(h);l&&(l.typeOver&&(s=!0),-1==o?(o=l.from,a=l.to):(o=Math.min(l.from,o),a=Math.max(l.to,a)))}}catch(c){u.e(c)}finally{u.f()}return{from:o,to:a,typeOver:s}}},{key:"flush",value:function(){if(!(this.delayedFlush>=0||this.view.inputState.pendingAndroidKey)){this.lastFlush=Date.now();var t=this.processRecords(),e=t.from,n=t.to,r=t.typeOver,i=this.selectionRange,o=!this.ignoreSelection.eq(i)&&B(this.dom,i);if(!(e<0)||o){var a=this.view.state;this.onChange(e,n,r),this.view.state==a&&this.view.docView.reset(o),this.clearSelection()}}}},{key:"readMutation",value:function(t){var e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;if(e.markDirty("attributes"==t.type),"attributes"==t.type&&(e.dirty|=4),"childList"==t.type){var n=or(e,t.previousSibling||t.target.previousSibling,-1),r=or(e,t.nextSibling||t.target.nextSibling,1);return{from:n?e.posAfter(n):e.posAtStart,to:r?e.posBefore(r):e.posAtEnd,typeOver:!1}}return"characterData"==t.type?{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}},{key:"destroy",value:function(){this.stop(),this.intersection&&this.intersection.disconnect(),this.gapIntersection&&this.gapIntersection.disconnect();var t,e=M(this.scrollTargets);try{for(e.s();!(t=e.n()).done;){t.value.removeEventListener("scroll",this.onScroll)}}catch(n){e.e(n)}finally{e.f()}window.removeEventListener("scroll",this.onScroll),clearTimeout(this.parentCheck)}}]),t}();function or(t,e,n){for(;e;){var r=Y.get(e);if(r&&r.parent==t)return r;var i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function ar(t,e,n,i){var o,a,s=t.state.selection.main;if(e>-1){var u=t.docView.domBoundsAround(e,n,0);if(!u||t.state.readOnly)return;var h=u.from,l=u.to,c=t.docView.impreciseHead||t.docView.impreciseAnchor?[]:function(t){var e=[];if(t.root.activeElement!=t.contentDOM)return e;var n=t.observer.selectionRange,r=n.anchorNode,i=n.anchorOffset,o=n.focusNode,a=n.focusOffset;r&&(e.push(new hr(r,i)),o==r&&a==i||e.push(new hr(o,a)));return e}(t),f=new sr(c,t);f.readRange(u.startDOM,u.endDOM),a=function(t,e){if(0==t.length)return null;var n=t[0].pos,i=2==t.length?t[1].pos:n;return n>-1&&i>-1?r.jT.single(n+e,i+e):null}(c,h);var d=s.from,v=null;(8===t.inputState.lastKeyCode&&t.inputState.lastKeyTime>Date.now()-100||dt.android&&f.text.length0&&s>0&&t.charCodeAt(a-1)==e.charCodeAt(s-1);)a--,s--;if("end"==r){n-=a+Math.max(0,o-Math.min(a,s))-o}if(a=a?o-n:0)+(s-a),a=o}else if(s=s?o-n:0)+(a-s),s=o}return{from:o,toA:a,toB:s}}(t.state.sliceDoc(h,l),f.text,d-h,v);p&&(o={from:h+p.from,to:h+p.toA,insert:t.state.toText(f.text.slice(p.from,p.toB))})}else if(t.hasFocus||!t.state.facet(Zt)){var g=t.observer.selectionRange,m=t.docView,y=m.impreciseHead,k=m.impreciseAnchor,b=y&&y.node==g.focusNode&&y.offset==g.focusOffset||!L(t.contentDOM,g.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(g.focusNode,g.focusOffset),w=k&&k.node==g.anchorNode&&k.offset==g.anchorOffset||!L(t.contentDOM,g.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(g.anchorNode,g.anchorOffset);b==s.head&&w==s.anchor||(a=r.jT.single(w,b))}if(o||a)if(!o&&i&&!s.empty&&a&&a.main.empty?o={from:s.from,to:s.to,insert:t.state.doc.slice(s.from,s.to)}:o&&o.from>=s.from&&o.to<=s.to&&(o.from!=s.from||o.to!=s.to)&&s.to-s.from-(o.to-o.from)<=4&&(o={from:s.from,to:s.to,insert:t.state.doc.slice(s.from,o.from).append(o.insert).append(t.state.doc.slice(o.to,s.to))}),o){var x=t.state;if(dt.ios&&t.inputState.flushIOSKey(t))return;var S,A=o.insert.toString();if(t.state.facet(Jt).some((function(e){return e(t,o.from,o.to,A)})))return;if(t.inputState.composing>=0&&t.inputState.composing++,o.from>=s.from&&o.to<=s.to&&o.to-o.from>=(s.to-s.from)/3&&(!a||a.main.empty&&a.main.from==o.from+o.insert.length)){var C=s.fromo.to?x.sliceDoc(o.to,s.to):"";S=x.replaceSelection(t.state.toText(C+o.insert.sliceString(0,void 0,t.state.lineBreak)+M))}else{var O=x.changes(o);S={changes:O,selection:a&&!x.selection.main.eq(a.main)&&a.main.to<=O.newLength?x.selection.replaceRange(a.main):void 0}}var T="input.type";t.composing&&(T+=".compose",t.inputState.compositionFirstChange&&(T+=".start",t.inputState.compositionFirstChange=!1)),t.dispatch(S,{scrollIntoView:!0,userEvent:T})}else if(a&&!a.main.eq(s)){var D=!1,E="select";t.inputState.lastSelectionTime>Date.now()-50&&("select"==t.inputState.lastSelectionOrigin&&(D=!0),E=t.inputState.lastSelectionOrigin),t.dispatch({selection:a,scrollIntoView:D,userEvent:E})}}var sr=function(){function t(e,n){D(this,t),this.points=e,this.view=n,this.text="",this.lineBreak=n.state.lineBreak}return P(t,[{key:"readRange",value:function(t,e){if(t){for(var n=t.parentNode,r=t;;){this.findPointBefore(n,r),this.readNode(r);var i=r.nextSibling;if(i==e)break;var o=Y.get(r),a=Y.get(i);(o&&a?o.breakAfter:(o?o.breakAfter:ur(r))||ur(i)&&("BR"!=r.nodeName||r.cmIgnore))&&(this.text+=this.lineBreak),r=i}this.findPointBefore(n,e)}}},{key:"readNode",value:function(t){if(!t.cmIgnore){var e,n=Y.get(t),r=n&&n.overrideDOMText;null!=r?e=r.sliceString(0,void 0,this.lineBreak):3==t.nodeType?e=t.nodeValue:"BR"==t.nodeName?e=t.nextSibling?this.lineBreak:"":1==t.nodeType&&this.readRange(t.firstChild,null),null!=e&&(this.findPointIn(t,e.length),this.text+=e,dt.chrome&&13==this.view.inputState.lastKeyCode&&!t.nextSibling&&/\n\n$/.test(this.text)&&(this.text=this.text.slice(0,-1)))}}},{key:"findPointBefore",value:function(t,e){var n,r=M(this.points);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.node==t&&t.childNodes[i.offset]==e&&(i.pos=this.text.length)}}catch(o){r.e(o)}finally{r.f()}}},{key:"findPointIn",value:function(t,e){var n,r=M(this.points);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.node==t&&(i.pos=this.text.length+Math.min(i.offset,e))}}catch(o){r.e(o)}finally{r.f()}}}]),t}();function ur(t){return 1==t.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}var hr=function t(e,n){D(this,t),this.node=e,this.offset=n,this.pos=-1};var lr=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};D(this,t),this.plugins=[],this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: absolute; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),this._dispatch=n.dispatch||function(t){return e.update([t])},this.dispatch=this.dispatch.bind(this),this.root=n.root||J(n.parent)||document,this.viewState=new Hn(n.state||r.yy.create()),this.plugins=this.state.facet(re).map((function(t){return new ae(t).update(e)})),this.observer=new ir(this,(function(t,n,r){ar(e,t,n,r)}),(function(t){e.inputState.runScrollHandlers(e,t),e.observer.intersecting&&e.measure()})),this.inputState=new en(this),this.docView=new de(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,vr(),this.requestMeasure(),n.parent&&n.parent.appendChild(this.dom)}return P(t,[{key:"state",get:function(){return this.viewState.state}},{key:"viewport",get:function(){return this.viewState.viewport}},{key:"visibleRanges",get:function(){return this.viewState.visibleRanges}},{key:"inView",get:function(){return this.viewState.inView}},{key:"composing",get:function(){return this.inputState.composing>0}},{key:"dispatch",value:function(){var t;this._dispatch(1==arguments.length&&(arguments.length<=0?void 0:arguments[0])instanceof r.YW?arguments.length<=0?void 0:arguments[0]:(t=this.state).update.apply(t,arguments))}},{key:"update",value:function(t){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");var e,n,i=!1,o=this.state,a=M(t);try{for(a.s();!(n=a.n()).done;){var s=n.value;if(s.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=s.state}}catch(y){a.e(y)}finally{a.f()}if(this.destroyed)this.viewState.state=o;else{if(o.facet(r.yy.phrases)!=this.state.facet(r.yy.phrases))return this.setState(o);e=new fe(this,o,t);var u=null;try{this.updateState=2;var h,l=M(t);try{for(l.s();!(h=l.n()).done;){var c=h.value;if(u&&(u=u.map(c.changes)),c.scrollIntoView){var f=c.state.selection.main;u=new _n(f.empty?f:r.jT.cursor(f.head,f.head>f.anchor?-1:1))}var d,v=M(c.effects);try{for(v.s();!(d=v.n()).done;){var p=d.value;p.is(Xt)?u=new _n(p.value):p.is(Qt)&&(u=new _n(p.value,!0))}}catch(y){v.e(y)}finally{v.f()}}}catch(y){l.e(y)}finally{l.f()}this.viewState.update(e,u),this.bidiCache=mr.update(this.bidiCache,e.changes),e.empty||(this.updatePlugins(e),this.inputState.update(e)),i=this.docView.update(e),this.state.facet(le)!=this.styleModules&&this.mountStyles(),this.updateAttrs(),this.showAnnouncements(t)}finally{this.updateState=0}if((i||u||this.viewState.mustEnforceCursorAssoc)&&this.requestMeasure(),!e.empty){var g,m=M(this.state.facet(Gt));try{for(m.s();!(g=m.n()).done;){(0,g.value)(e)}}catch(y){m.e(y)}finally{m.f()}}}}},{key:"setState",value:function(t){var e=this;if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)this.viewState.state=t;else{this.updateState=2;try{var n,r=M(this.plugins);try{for(r.s();!(n=r.n()).done;){n.value.destroy(this)}}catch(i){r.e(i)}finally{r.f()}this.viewState=new Hn(t),this.plugins=t.facet(re).map((function(t){return new ae(t).update(e)})),this.docView=new de(this),this.inputState.ensureHandlers(this),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}this.requestMeasure()}}},{key:"updatePlugins",value:function(t){var e=t.startState.facet(re),n=t.state.facet(re);if(e!=n){var r,i=[],o=M(n);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=e.indexOf(a);if(s<0)i.push(new ae(a));else{var u=this.plugins[s];u.mustUpdate=t,i.push(u)}}}catch(p){o.e(p)}finally{o.f()}var h,l=M(this.plugins);try{for(l.s();!(h=l.n()).done;){var c=h.value;c.mustUpdate!=t&&c.destroy(this)}}catch(p){l.e(p)}finally{l.f()}this.plugins=i,this.inputState.ensureHandlers(this)}else{var f,d=M(this.plugins);try{for(d.s();!(f=d.n()).done;){f.value.mustUpdate=t}}catch(p){d.e(p)}finally{d.f()}}for(var v=0;v0&&void 0!==arguments[0])||arguments[0];if(!this.destroyed){this.measureScheduled>-1&&cancelAnimationFrame(this.measureScheduled),this.measureScheduled=-1,e&&this.observer.flush();var n=null;try{for(var r=0;;r++){this.updateState=1;var i=this.viewport,o=this.viewState.measure(this.docView,r>0);if(!o&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(r>5){console.warn("Viewport failed to stabilize");break}var a=[];if(!(4&o)){var s=[a,this.measureRequests];this.measureRequests=s[0],a=s[1]}var u=a.map((function(e){try{return e.read(t)}catch(n){return Yt(t.state,n),gr}})),h=new fe(this,this.state);h.flags|=o,n?n.flags|=o:n=h,this.updateState=2,h.empty||(this.updatePlugins(h),this.inputState.update(h)),this.updateAttrs(),o&&this.docView.update(h);for(var l=0;l-1&&this.measure(!1)}},{key:"requestMeasure",value:function(t){var e=this;if(this.measureScheduled<0&&(this.measureScheduled=requestAnimationFrame((function(){return e.measure()}))),t){if(null!=t.key)for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0;return this.viewState.lineAt(t,e)}},{key:"contentHeight",get:function(){return this.viewState.contentHeight}},{key:"moveByChar",value:function(t,e,n){return tn(this,t,Ze(this,t,e,n))}},{key:"moveByGroup",value:function(t,e){var n=this;return tn(this,t,Ze(this,t,e,(function(e){return function(t,e,n){var i=t.state.charCategorizer(e),o=i(n);return function(t){var e=i(t);return o==r.D0.Space&&(o=e),o==e}}(n,t.head,e)})))}},{key:"moveToLineBoundary",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return Ye(this,t,e,n)}},{key:"moveVertically",value:function(t,e,n){return tn(this,t,function(t,e,n,i){var o=e.head,a=n?1:-1;if(o==(n?t.state.doc.length:0))return r.jT.cursor(o);var s,u=e.goalColumn,h=t.contentDOM.getBoundingClientRect(),l=t.coordsAtPos(o);if(l)null==u&&(u=l.left-h.left),s=a<0?l.top:l.bottom;else{var c=t.viewState.lineAt(o,t.dom.getBoundingClientRect().top);null==u&&(u=Math.min(h.right-h.left,t.defaultCharacterWidth*(o-c.from))),s=a<0?c.top:c.bottom}for(var f=h.left+u,d=null!=i?i:t.defaultLineHeight>>1,v=0;;v+=10){var p=s+(d+v)*a,g=Je(t,{x:f,y:p},!1,a);if(ph.bottom||(a<0?go))return r.jT.cursor(g,void 0,void 0,u)}}(this,t,e,n))}},{key:"scrollPosIntoView",value:function(t){this.dispatch({effects:Xt.of(r.jT.cursor(t))})}},{key:"domAtPos",value:function(t){return this.docView.domAtPos(t)}},{key:"posAtDOM",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.posFromDOM(t,e)}},{key:"posAtCoords",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.readMeasured(),Je(this,t,e)}},{key:"coordsAtPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.readMeasured();var n=this.docView.coordsAt(t,e);if(!n||n.left==n.right)return n;var r=this.state.doc.lineAt(t),i=this.bidiSpans(r),o=i[Ne.find(i,t-r.from,-1,e)];return z(n,o.dir==we.LTR==e>0)}},{key:"defaultCharacterWidth",get:function(){return this.viewState.heightOracle.charWidth}},{key:"defaultLineHeight",get:function(){return this.viewState.heightOracle.lineHeight}},{key:"textDirection",get:function(){return this.viewState.heightOracle.direction}},{key:"lineWrapping",get:function(){return this.viewState.heightOracle.lineWrapping}},{key:"bidiSpans",value:function(t){if(t.length>cr)return _e(t.length);var e,n=this.textDirection,r=M(this.bidiCache);try{for(r.s();!(e=r.n()).done;){var i=e.value;if(i.from==t.from&&i.dir==n)return i.order}}catch(a){r.e(a)}finally{r.f()}var o=Ve(t.text,this.textDirection);return this.bidiCache.push(new mr(t.from,t.to,n,o)),o}},{key:"hasFocus",get:function(){var t;return(document.hasFocus()||dt.safari&&(null===(t=this.inputState)||void 0===t?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}},{key:"focus",value:function(){var t=this;this.observer.ignore((function(){K(t.contentDOM),t.docView.updateSelection()}))}},{key:"destroy",value:function(){var t,e=M(this.plugins);try{for(e.s();!(t=e.n()).done;){t.value.destroy(this)}}catch(n){e.e(n)}finally{e.f()}this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}}],[{key:"domEventHandlers",value:function(t){return ie.define((function(){return{}}),{eventHandlers:t})}},{key:"theme",value:function(t,e){var n=o.V.newName(),r=[Gn.of(n),le.of(tr(".".concat(n),t))];return e&&e.dark&&r.push(Jn.of(!0)),r}},{key:"baseTheme",value:function(t){return r.Wl.lowest(le.of(tr("."+Xn,t,Zn)))}}]),t}();lr.scrollTo=Xt,lr.centerOn=Qt,lr.styleModule=le,lr.inputHandler=Jt,lr.exceptionSink=Ut,lr.updateListener=Gt,lr.editable=Zt,lr.mouseSelectionStyle=Kt,lr.dragMovesSelection=$t,lr.clickAddsSelectionRange=Ft,lr.decorations=he,lr.contentAttributes=ue,lr.editorAttributes=se,lr.lineWrapping=lr.contentAttributes.of({class:"cm-lineWrapping"}),lr.announce=r.Py.define();var cr=4096;function fr(t,e){return null==t?e.getBoundingClientRect().top:t}var dr=-1;function vr(){window.addEventListener("resize",(function(){-1==dr&&(dr=setTimeout(pr,50))}))}function pr(){dr=-1;for(var t=document.querySelectorAll(".cm-content"),e=0;e1&&void 0!==arguments[1]?arguments[1]:yr,r=Object.create(null),i=Object.create(null),o=function(t,e){var n=i[t];if(null==n)i[t]=e;else if(n!=e)throw new Error("Key binding "+t+" is used both as a regular binding and as a multi-stroke prefix")},a=function(t,e,i,a){for(var s=r[t]||(r[t]=Object.create(null)),u=e.split(/ (?!$)/).map((function(t){return kr(t,n)})),h=function(e){var n=u.slice(0,e).join(" ");o(n,!0),s[n]||(s[n]={preventDefault:!0,commands:[function(e){var r=Mr={view:e,prefix:n,scope:t};return setTimeout((function(){Mr==r&&(Mr=null)}),Or),!0}]})},l=1;l0&&void 0!==arguments[0]?arguments[0]:{};return[Er.of(t),Lr,Ir]}var Rr=function(){function t(e,n,r,i,o){D(this,t),this.left=e,this.top=n,this.width=r,this.height=i,this.className=o}return P(t,[{key:"draw",value:function(){var t=document.createElement("div");return t.className=this.className,this.adjust(t),t}},{key:"adjust",value:function(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width>=0&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}},{key:"eq",value:function(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}}]),t}(),Lr=ie.fromClass(function(){function t(e){D(this,t),this.view=e,this.rangePieces=[],this.cursors=[],this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.selectionLayer=e.scrollDOM.appendChild(document.createElement("div")),this.selectionLayer.className="cm-selectionLayer",this.selectionLayer.setAttribute("aria-hidden","true"),this.cursorLayer=e.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-cursorLayer",this.cursorLayer.setAttribute("aria-hidden","true"),e.requestMeasure(this.measureReq),this.setBlinkRate()}return P(t,[{key:"setBlinkRate",value:function(){this.cursorLayer.style.animationDuration=this.view.state.facet(Er).cursorBlinkRate+"ms"}},{key:"update",value:function(t){var e=t.startState.facet(Er)!=t.state.facet(Er);(e||t.selectionSet||t.geometryChanged||t.viewportChanged)&&this.view.requestMeasure(this.measureReq),t.transactions.some((function(t){return t.scrollIntoView}))&&(this.cursorLayer.style.animationName="cm-blink"==this.cursorLayer.style.animationName?"cm-blink2":"cm-blink"),e&&this.setBlinkRate()}},{key:"readPos",value:function(){var t,e=this,n=this.view.state,r=n.facet(Er),i=n.selection.ranges.map((function(t){return t.empty?[]:function(t,e){if(e.to<=t.viewport.from||e.from>=t.viewport.to)return[];var n=Math.max(e.from,t.viewport.from),r=Math.min(e.to,t.viewport.to),i=t.textDirection==we.LTR,o=t.contentDOM,a=o.getBoundingClientRect(),s=Nr(t),u=window.getComputedStyle(o.firstChild),h=a.left+parseInt(u.paddingLeft),l=a.right-parseInt(u.paddingRight),c=Vr(t,n),f=Vr(t,r),d=c.type==Et.Text?c:null,v=f.type==Et.Text?f:null;t.lineWrapping&&(d&&(d=jr(t,n,d)),v&&(v=jr(t,r,v)));if(d&&v&&d.from==v.from)return k(b(e.from,e.to,d));var p=d?b(e.from,null,d):w(c,!1),g=v?b(null,e.to,v):w(f,!0),m=[];return(d||c).to<(v||f).from-1?m.push(y(h,p.bottom,l,g.top)):p.bottomf&&p.from=m)break;S>g&&u(Math.max(x,g),null==e&&x<=f,Math.min(S,m),null==n&&S>=d,w.dir)}}catch(A){b.e(A)}finally{b.f()}if((g=k.to+1)>=m)break}}}catch(A){v.e(A)}finally{v.f()}return 0==s.length&&u(f,null==e,d,null==n,t.textDirection),{top:o,bottom:a,horizontal:s}}function w(t,e){var n=a.top+(e?t.top:t.bottom);return{top:n,bottom:n,horizontal:[]}}}(e.view,t)})).reduce((function(t,e){return t.concat(e)})),o=[],a=M(n.selection.ranges);try{for(a.s();!(t=a.n()).done;){var s=t.value,u=s==n.selection.main;if(s.empty?!u||Dr:r.drawRangeCursor){var h=_r(this.view,s,u);h&&o.push(h)}}}catch(l){a.e(l)}finally{a.f()}return{rangePieces:i,cursors:o}}},{key:"drawSel",value:function(t){var e=this,n=t.rangePieces,r=t.cursors;if(n.length!=this.rangePieces.length||n.some((function(t,n){return!t.eq(e.rangePieces[n])}))){this.selectionLayer.textContent="";var i,o=M(n);try{for(o.s();!(i=o.n()).done;){var a=i.value;this.selectionLayer.appendChild(a.draw())}}catch(c){o.e(c)}finally{o.f()}this.rangePieces=n}if(r.length!=this.cursors.length||r.some((function(t,n){return!t.eq(e.cursors[n])}))){var s=this.cursorLayer.children;if(s.length!==r.length){this.cursorLayer.textContent="";var u,h=M(r);try{for(h.s();!(u=h.n()).done;){var l=u.value;this.cursorLayer.appendChild(l.draw())}}catch(c){h.e(c)}finally{h.f()}}else r.forEach((function(t,e){return t.adjust(s[e])}));this.cursors=r}}},{key:"destroy",value:function(){this.selectionLayer.remove(),this.cursorLayer.remove()}}]),t}()),Br={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};Dr&&(Br[".cm-line"].caretColor="transparent !important");var Ir=r.Wl.highest(lr.theme(Br));function Nr(t){var e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==we.LTR?e.left:e.right-t.scrollDOM.clientWidth)-t.scrollDOM.scrollLeft,top:e.top-t.scrollDOM.scrollTop}}function jr(t,e,n){var i=r.jT.cursor(e);return{from:Math.max(n.from,t.moveToLineBoundary(i,!1,!0).from),to:Math.min(n.to,t.moveToLineBoundary(i,!0,!0).from),type:Et.Text}}function Vr(t,e){var n=t.visualLineAt(e);if(Array.isArray(n.type)){var r,i=M(n.type);try{for(i.s();!(r=i.n()).done;){var o=r.value;if(o.to>e||o.to==e&&(o.to==n.to||o.type==Et.Text))return o}}catch(a){i.e(a)}finally{i.f()}}return n}function _r(t,e,n){var r=t.coordsAtPos(e.head,e.assoc||1);if(!r)return null;var i=Nr(t);return new Rr(r.left-i.left,r.top-i.top,-1,r.bottom-r.top,n?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary")}function Hr(){return Wr}var zr=Pt.line({class:"cm-activeLine"}),Wr=ie.fromClass(function(){function t(e){D(this,t),this.decorations=this.getDeco(e)}return P(t,[{key:"update",value:function(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}},{key:"getDeco",value:function(t){var e,n=-1,r=[],i=M(t.state.selection.ranges);try{for(i.s();!(e=i.n()).done;){var o=e.value;if(!o.empty)return Pt.none;var a=t.visualLineAt(o.head);a.from>n&&(r.push(zr.range(a.from)),n=a.from)}}catch(s){i.e(s)}finally{i.f()}return Pt.set(r)}}]),t}(),{decorations:function(t){return t.decorations}})},97248:function(t,e,n){function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(u){s=!0,i=u}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(t,e)||o(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=o(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}function o(t,e){if(t){if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{};h(this,t),this.id=l++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||function(){throw new Error("This node type doesn't define a deserialize function")}}return u(t,[{key:"add",value:function(t){var e=this;if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof t&&(t=v.match(t)),function(n){var r=t(n);return void 0===r?null:[e,r]}}}]),t}();f.closedBy=new f({deserialize:function(t){return t.split(" ")}}),f.openedBy=new f({deserialize:function(t){return t.split(" ")}}),f.group=new f({deserialize:function(t){return t.split(" ")}}),f.contextHash=new f({perNode:!0}),f.lookAhead=new f({perNode:!0}),f.mounted=new f({perNode:!0});var d=Object.create(null),v=function(){function t(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;h(this,t),this.name=e,this.props=n,this.id=r,this.flags=i}return u(t,[{key:"prop",value:function(t){return this.props[t.id]}},{key:"isTop",get:function(){return(1&this.flags)>0}},{key:"isSkipped",get:function(){return(2&this.flags)>0}},{key:"isError",get:function(){return(4&this.flags)>0}},{key:"isAnonymous",get:function(){return(8&this.flags)>0}},{key:"is",value:function(t){if("string"==typeof t){if(this.name==t)return!0;var e=this.prop(f.group);return!!e&&e.indexOf(t)>-1}return this.id==t}}],[{key:"define",value:function(e){var n=e.props&&e.props.length?Object.create(null):d,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),o=new t(e.name||"",n,e.id,r);if(e.props){var a,s=i(e.props);try{for(s.s();!(a=s.n()).done;){var u=a.value;if(Array.isArray(u)||(u=u(o)),u){if(u[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[u[0].id]=u[1]}}}catch(h){s.e(h)}finally{s.f()}}return o}},{key:"match",value:function(t){var e=Object.create(null);for(var n in t){var r,o=i(n.split(" "));try{for(o.s();!(r=o.n()).done;){var a=r.value;e[a]=t[n]}}catch(s){o.e(s)}finally{o.f()}}return function(t){for(var n=t.prop(f.group),r=-1;r<(n?n.length:0);r++){var i=e[r<0?t.name:n[r]];if(i)return i}}}}]),t}();v.none=new v("",Object.create(null),0,8);var p=function(){function t(e){h(this,t),this.types=e;for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0,n=null!=t&&g.get(this)||this.topNode,r=new C(n);return null!=t&&(r.moveTo(t,e),g.set(this,r._tree)),r}},{key:"fullCursor",value:function(){return new C(this.topNode,1)}},{key:"topNode",get:function(){return new w(this,0,0,null)}},{key:"resolve",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.cursor(t,e).node}},{key:"resolveInner",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.topNode;;){var r=n.enter(t,e);if(!r)return n;n=r}}},{key:"iterate",value:function(t){for(var e=t.enter,n=t.leave,r=t.from,i=void 0===r?0:r,o=t.to,a=void 0===o?this.length:o,s=this.cursor(),u=function(){return s.node};;){var h=!1;if(s.from<=a&&s.to>=i&&(s.type.isAnonymous||!1!==e(s.type,s.from,s.to,u))){if(s.firstChild())continue;s.type.isAnonymous||(h=!0)}for(;h&&n&&n(s.type,s.from,s.to,u),h=s.type.isAnonymous,!s.nextSibling();){if(!s.parent())return;h=!0}}}},{key:"prop",value:function(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}},{key:"propValues",get:function(){var t=[];if(this.props)for(var e in this.props)t.push([+e,this.props[e]]);return t}},{key:"balance",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.children.length<=8?this:E(this.type,this.children,this.positions,0,this.children.length,0,this.length,(function(n,r,i){return new t(e.type,n,r,i,e.propValues)}),n.makeTree||function(e,n,r){return new t(v.none,e,n,r)})}}],[{key:"build",value:function(t){return O(t)}}]),t}();m.empty=new m(v.none,[],[],0);var y=function(){function t(e,n){h(this,t),this.buffer=e,this.index=n}return u(t,[{key:"id",get:function(){return this.buffer[this.index-4]}},{key:"start",get:function(){return this.buffer[this.index-3]}},{key:"end",get:function(){return this.buffer[this.index-2]}},{key:"size",get:function(){return this.buffer[this.index-1]}},{key:"pos",get:function(){return this.index}},{key:"next",value:function(){this.index-=4}},{key:"fork",value:function(){return new t(this.buffer,this.index)}}]),t}(),k=function(){function t(e,n,r){h(this,t),this.buffer=e,this.length=n,this.set=r}return u(t,[{key:"type",get:function(){return v.none}},{key:"toString",value:function(){for(var t=[],e=0;e0));s=o[s+3]);return a}},{key:"slice",value:function(e,n,r,i){for(var o=this.buffer,a=new Uint16Array(n-e),s=e,u=0;s=e&&ne;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}var w=function(){function t(e,n,r,i){h(this,t),this.node=e,this._from=n,this.index=r,this._parent=i}return u(t,[{key:"type",get:function(){return this.node.type}},{key:"name",get:function(){return this.node.type.name}},{key:"from",get:function(){return this._from}},{key:"to",get:function(){return this._from+this.node.length}},{key:"nextChild",value:function(e,n,r,i){for(var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=this;;){for(var s=a.node,u=s.children,h=s.positions,l=n>0?u.length:-1;e!=l;e+=n){var c=u[e],d=h[e]+a._from;if(b(i,r,d,d+c.length))if(c instanceof k){if(2&o)continue;var v=c.findChild(0,c.buffer.length,n,r-d,i);if(v>-1)return new A(new S(a,c,e,d),null,v)}else if(1&o||!c.type.isAnonymous||M(c)){var p=void 0;if(c.props&&(p=c.prop(f.mounted))&&!p.overlay)return new t(p.tree,d,e,a);var g=new t(c,d,e,a);return 1&o||!g.type.isAnonymous?g:g.nextChild(n<0?c.children.length-1:0,n,r,i)}}if(1&o||!a.type.isAnonymous)return null;if(e=a.index>=0?a.index+n:n<0?-1:a._parent.node.children.length,!(a=a._parent))return null}}},{key:"firstChild",get:function(){return this.nextChild(0,1,0,4)}},{key:"lastChild",get:function(){return this.nextChild(this.node.children.length-1,-1,0,4)}},{key:"childAfter",value:function(t){return this.nextChild(0,1,t,2)}},{key:"childBefore",value:function(t){return this.nextChild(this.node.children.length-1,-1,t,-2)}},{key:"enter",value:function(e,n){var r,o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(o&&(r=this.node.prop(f.mounted))&&r.overlay){var s,u=e-this.from,h=i(r.overlay);try{for(h.s();!(s=h.n()).done;){var l=s.value,c=l.from,d=l.to;if((n>0?c<=u:c=u:d>u))return new t(r.tree,r.overlay[0].from+this.from,-1,this)}}catch(v){h.e(v)}finally{h.f()}}return this.nextChild(0,1,e,n,a?0:2)}},{key:"nextSignificantParent",value:function(){for(var t=this;t.type.isAnonymous&&t._parent;)t=t._parent;return t}},{key:"parent",get:function(){return this._parent?this._parent.nextSignificantParent():null}},{key:"nextSibling",get:function(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}},{key:"prevSibling",get:function(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}},{key:"cursor",get:function(){return new C(this)}},{key:"tree",get:function(){return this.node}},{key:"toTree",value:function(){return this.node}},{key:"resolve",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.cursor.moveTo(t,e).node}},{key:"getChild",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=x(this,t,e,n);return r.length?r[0]:null}},{key:"getChildren",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return x(this,t,e,n)}},{key:"toString",value:function(){return this.node.toString()}}]),t}();function x(t,e,n,r){var i=t.cursor,o=[];if(!i.firstChild())return o;if(null!=n)for(;!i.type.is(n);)if(!i.nextSibling())return o;for(;;){if(null!=r&&i.type.is(r))return o;if(i.type.is(e)&&o.push(i.node),!i.nextSibling())return null==r?o:[]}}var S=function t(e,n,r,i){h(this,t),this.parent=e,this.buffer=n,this.index=r,this.start=i},A=function(){function t(e,n,r){h(this,t),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}return u(t,[{key:"name",get:function(){return this.type.name}},{key:"from",get:function(){return this.context.start+this.context.buffer.buffer[this.index+1]}},{key:"to",get:function(){return this.context.start+this.context.buffer.buffer[this.index+2]}},{key:"child",value:function(e,n,r){var i=this.context.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return o<0?null:new t(this.context,this,o)}},{key:"firstChild",get:function(){return this.child(1,0,4)}},{key:"lastChild",get:function(){return this.child(-1,0,4)}},{key:"childAfter",value:function(t){return this.child(1,t,2)}},{key:"childBefore",value:function(t){return this.child(-1,t,-2)}},{key:"enter",value:function(e,n,r){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(!i)return null;var o=this.context.buffer,a=o.findChild(this.index+4,o.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return a<0?null:new t(this.context,this,a)}},{key:"parent",get:function(){return this._parent||this.context.parent.nextSignificantParent()}},{key:"externalSibling",value:function(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}},{key:"nextSibling",get:function(){var e=this.context.buffer,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new t(this.context,this._parent,n):this.externalSibling(1)}},{key:"prevSibling",get:function(){var e=this.context.buffer,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new t(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}},{key:"cursor",get:function(){return new C(this)}},{key:"tree",get:function(){return null}},{key:"toTree",value:function(){var t=[],e=[],n=this.context.buffer,r=this.index+4,i=n.buffer[this.index+3];if(i>r){var o=n.buffer[this.index+1],a=n.buffer[this.index+2];t.push(n.slice(r,i,o,a)),e.push(0)}return new m(this.type,t,e,this.to-this.from)}},{key:"resolve",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.cursor.moveTo(t,e).node}},{key:"toString",value:function(){return this.context.buffer.childString(this.index)}},{key:"getChild",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=x(this,t,e,n);return r.length?r[0]:null}},{key:"getChildren",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return x(this,t,e,n)}}]),t}(),C=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(h(this,t),this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof w)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(var r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}return u(t,[{key:"name",get:function(){return this.type.name}},{key:"yieldNode",value:function(t){return!!t&&(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0)}},{key:"yieldBuf",value:function(t,e){this.index=t;var n=this.buffer,r=n.start,i=n.buffer;return this.type=e||i.set.types[i.buffer[t]],this.from=r+i.buffer[t+1],this.to=r+i.buffer[t+2],!0}},{key:"yield",value:function(t){return!!t&&(t instanceof w?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)))}},{key:"toString",value:function(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}},{key:"enterChild",value:function(t,e,n){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree.node.children.length-1:0,t,e,n,this.mode));var r=this.buffer.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],t,e-this.buffer.start,n);return!(i<0)&&(this.stack.push(this.index),this.yieldBuf(i))}},{key:"firstChild",value:function(){return this.enterChild(1,0,4)}},{key:"lastChild",value:function(){return this.enterChild(-1,0,4)}},{key:"childAfter",value:function(t){return this.enterChild(1,t,2)}},{key:"childBefore",value:function(t){return this.enterChild(-1,t,-2)}},{key:"enter",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return this.buffer?!!r&&this.enterChild(1,t,e):this.yield(this._tree.enter(t,e,n,r))}},{key:"parent",value:function(){if(!this.buffer)return this.yieldNode(1&this.mode?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());var t=1&this.mode?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}},{key:"sibling",value:function(t){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode));var e=this.buffer.buffer,n=this.stack.length-1;if(t<0){var r=n<0?0:this.stack[n]+4;if(this.index!=r)return this.yieldBuf(e.findChild(r,this.index,-1,0,4))}else{var i=e.buffer[this.index+3];if(i<(n<0?e.buffer.length:e.buffer[this.stack[n]+3]))return this.yieldBuf(i)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode))}},{key:"nextSibling",value:function(){return this.sibling(1)}},{key:"prevSibling",value:function(){return this.sibling(-1)}},{key:"atLastNode",value:function(t){var e,n,r=this.buffer;if(r){if(t>0){if(this.index-1)for(var s=e+t,u=t<0?-1:n.node.children.length;s!=u;s+=t){var h=n.node.children[s];if(1&this.mode||h instanceof k||!h.type.isAnonymous||M(h))return!1}}return!0}},{key:"move",value:function(t,e){if(e&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}},{key:"next",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.move(1,t)}},{key:"prev",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.move(-1,t)}},{key:"moveTo",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to=0;){for(var o=t;o;o=o._parent)if(o.index==r){if(r==this.index)return o;e=o,n=i+1;break t}r=this.stack[--i]}for(var a=n;ac;){var f=n.size;if(n.id==e&&f>=0)u.size=r,u.start=i,u.skip=a,a+=4,r+=4,n.next();else{var d=n.pos-f;if(f<0||d=h?4:0,p=n.start;for(n.next();n.pos>d;){if(n.size<0){if(-3!=n.size)break t;v+=4}else n.id>=h&&(v+=4);n.next()}i=p,r+=f,a+=v}}(e<0||r==t)&&(u.size=r,u.start=i,u.skip=a);return u.size>4?u:void 0}(l.pos-e,a))){for(var P=new Uint16Array(O.size-O.skip),R=l.pos-O.size,L=P.length;l.pos>R;)L=w(O.start,P,L);M=new k(P,x-O.start,r),D=O.start-t}else{var B=l.pos-S;l.next();for(var I=[],N=[],j=u>=h?u:-1,V=0,_=x;l.pos>B;)j>=0&&l.id==j&&l.size>=0?(l.end<=_-o&&(g(I,N,y,V,l.end,_,j,A),V=I.length,_=l.end),l.next()):p(y,B,I,N,j);if(j>=0&&V>0&&V-1&&V>0){var H=function(t){return function(e,n,r){var i,o,a=0,s=e.length-1;if(s>=0&&(i=e[s])instanceof m){if(!s&&i.type==t&&i.length==r)return i;(o=i.prop(f.lookAhead))&&(a=n[s]+i.length+o)}return b(t,e,n,r,a)}}(T);M=E(T,I,N,0,I.length,0,x-y,H,H)}else M=b(T,I,N,x-y,A-x)}n.push(M),i.push(D)}function g(t,e,n,i,o,a,s,u){for(var h=[],l=[];t.length>i;)h.push(t.pop()),l.push(e.pop()+n-o);t.push(b(r.types[s],h,l,a-o,u-a)),e.push(o-n)}function b(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5?arguments[5]:void 0;if(d){var a=[f.contextHash,d];o=o?[a].concat(o):[a]}if(i>25){var s=[f.lookAhead,i];o=o?[s].concat(o):[s]}return new m(t,e,n,r,o)}function w(t,e,n){var r=l.id,i=l.start,o=l.end,a=l.size;if(l.next(),a>=0&&r4)for(var u=l.pos-(a-4);l.pos>u;)n=w(t,e,n);e[--n]=s,e[--n]=o-t,e[--n]=i-t,e[--n]=r}else-3==a?d=r:-4==a&&(v=r);return n}for(var x=[],S=[];l.pos>0;)p(t.start||0,t.bufferStart||0,x,S,-1);var A=null!==(e=t.length)&&void 0!==e?e:x.length?S[0]+x[0].length:0;return new m(c[t.topID],x.reverse(),S.reverse(),A)}var T=new WeakMap;function D(t,e){if(!t.isAnonymous||e instanceof k||e.type!=t)return 1;var n=T.get(e);return null==n&&(n=e.children.reduce((function(e,n){return e+D(t,n)}),1),T.set(e,n)),n}function E(t,e,n,r,i,o,a,s,u){for(var h=0,l=r;l=c)break;p+=g}if(h==l+1){if(p>c){var m=n[l];e(m.children,m.positions,0,m.children.length,r[l]+s);continue}f.push(n[l])}else{var y=r[h-1]+n[h-1].length-v;f.push(E(t,n,r,l,h,v,y,null,u))}d.push(v+s-o)}}(e,n,r,i,0),(s||u)(f,d,a)}var P=function(){function t(e,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];h(this,t),this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(o?1:0)|(a?2:0)}return u(t,[{key:"openStart",get:function(){return(1&this.open)>0}},{key:"openEnd",get:function(){return(2&this.open)>0}}],[{key:"addTree",value:function(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=[new t(0,e.length,e,0,!1,o)],s=i(r);try{for(s.s();!(n=s.n()).done;){var u=n.value;u.to>e.length&&a.push(u)}}catch(h){s.e(h)}finally{s.f()}return a}},{key:"applyChanges",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:128;if(!n.length)return e;for(var i=[],o=1,a=e.length?e[0]:null,s=0,u=0,h=0;;s++){var l=s=r)for(;a&&a.from=f.from||c<=f.to||h){var d=Math.max(f.from,u)-h,v=Math.min(f.to,c)-h;f=d>=v?null:new t(d,v,f.tree,f.offset+h,s>0,!!l)}if(f&&i.push(f),a.to>c)break;a=o-1&&(this.modules.splice(a,1),r--,a=-1),-1==a){if(this.modules.splice(r++,0,o),e)for(var s=0;s\n ',"\n ","\n ","\n ","\n ","\n \n ","\n "])),(0,l.$)(o),this.renderRipple(),this.outlined?this.renderOutline():this.renderLabel(),this.renderInput(),this.renderCharCounter(t),this.renderLineRipple(),this.renderHelperText(i,n))}},{key:"renderInput",value:function(){var e=this.label?"label":void 0,t=-1===this.minLength?void 0:this.minLength,n=-1===this.maxLength?void 0:this.maxLength,r=this.autocapitalize?this.autocapitalize:void 0;return(0,c.dy)(i||(i=h(["\n \n '])),(0,u.o)(e),(0,f.a)(this.value),this.rows,this.cols,this.disabled,this.placeholder,this.required,this.readOnly,(0,u.o)(t),(0,u.o)(n),(0,u.o)(""===this.name?void 0:this.name),(0,u.o)(this.inputMode),(0,u.o)(r),this.handleInputChange,this.onInputBlur)}}])&&y(t.prototype,n),o&&y(t,o),s}(a.P);(0,o.__decorate)([(0,s.IO)("textarea")],g.prototype,"formElement",void 0),(0,o.__decorate)([(0,s.Cb)({type:Number})],g.prototype,"rows",void 0),(0,o.__decorate)([(0,s.Cb)({type:Number})],g.prototype,"cols",void 0),(0,o.__decorate)([(0,s.Cb)({converter:{fromAttribute:function(e){return null!==e&&(""===e||e)},toAttribute:function(e){return"boolean"==typeof e?e?"":null:e}}})],g.prototype,"charCounter",void 0)},96791:function(e,t,n){var r;n.d(t,{W:function(){return a}});var i,o,a=(0,n(37500).iv)(r||(i=[".mdc-text-field{height:100%}.mdc-text-field__input{resize:none}"],o||(o=i.slice(0)),r=Object.freeze(Object.defineProperties(i,{raw:{value:Object.freeze(o)}}))))},93117:function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n".concat(w.toString().replace(":host","html"),""),document.head.appendChild(O.content);var x,k,S,P=(0,m.iv)(g||(x=["\n /* prettier-ignore */\n :host {\n /* from http://codepen.io/shyndman/pen/c5394ddf2e8b2a5c9185904b57421cdb */\n --material-shadow-elevation-2dp: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n --material-shadow-elevation-3dp: 0 3px 4px 0 rgba(0, 0, 0, 0.14), 0 1px 8px 0 rgba(0, 0, 0, 0.12), 0 3px 3px -2px rgba(0, 0, 0, 0.4);\n --material-shadow-elevation-4dp: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.4);\n --material-shadow-elevation-6dp: 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12), 0 3px 5px -1px rgba(0, 0, 0, 0.4);\n --material-shadow-elevation-8dp: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.4);\n --material-shadow-elevation-12dp: 0 12px 16px 1px rgba(0, 0, 0, 0.14), 0 4px 22px 3px rgba(0, 0, 0, 0.12), 0 6px 7px -4px rgba(0, 0, 0, 0.4);\n --material-shadow-elevation-16dp: 0 16px 24px 2px rgba(0, 0, 0, 0.14), 0 6px 30px 5px rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.4);\n --material-shadow-elevation-24dp: 0 24px 38px 3px rgba(0, 0, 0, 0.14), 0 9px 46px 8px rgba(0, 0, 0, 0.12), 0 11px 15px -7px rgba(0, 0, 0, 0.4);\n }\n"],k||(k=x.slice(0)),g=Object.freeze(Object.defineProperties(x,{raw:{value:Object.freeze(k)}})))),I=document.createElement("template");I.innerHTML=""),document.head.appendChild(I.content);var C=(0,m.iv)(S||(S=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n :host {\n top: 16px;\n right: 16px;\n /* TODO (@jouni): remove unnecessary multiplication after https://github.com/vaadin/vaadin-overlay/issues/90 is fixed */\n bottom: calc(1px * var(--vaadin-overlay-viewport-bottom) + 16px);\n left: 16px;\n }\n\n [part='overlay'] {\n background-color: var(--material-background-color);\n border-radius: 4px;\n box-shadow: var(--material-shadow-elevation-4dp);\n color: var(--material-body-text-color);\n font-family: var(--material-font-family);\n font-size: var(--material-body-font-size);\n font-weight: 400;\n }\n\n [part='content'] {\n padding: 8px 0;\n }\n\n [part='backdrop'] {\n opacity: 0.2;\n animation: 0.2s vaadin-overlay-backdrop-enter;\n will-change: opacity;\n }\n\n @keyframes vaadin-overlay-backdrop-enter {\n 0% {\n opacity: 0;\n }\n }\n"])));(0,m.hC)("",C,{moduleId:"material-overlay"});var R,E=C;(0,m.hC)("",E,{moduleId:"material-menu-overlay"});var j,T=(0,m.iv)(R||(R=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n :host {\n --_vaadin-combo-box-items-container-border-width: 8px 0;\n --_vaadin-combo-box-items-container-border-style: solid;\n --_vaadin-combo-box-items-container-border-color: transparent;\n }\n\n [part='overlay'] {\n position: relative;\n overflow: visible;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n\n [part='content'] {\n padding: 0;\n }\n\n :host([loading]) [part='loader'] {\n height: 2px;\n position: absolute;\n z-index: 1;\n top: -2px;\n left: 0;\n right: 0;\n background: var(--material-background-color)\n linear-gradient(\n 90deg,\n transparent 0%,\n transparent 20%,\n var(--material-primary-color) 20%,\n var(--material-primary-color) 40%,\n transparent 40%,\n transparent 60%,\n var(--material-primary-color) 60%,\n var(--material-primary-color) 80%,\n transparent 80%,\n transparent 100%\n )\n 0 0 / 400% 100% repeat-x;\n opacity: 0;\n animation: 3s linear infinite material-combo-box-loader-progress, 0.3s 0.1s both material-combo-box-loader-fade-in;\n }\n\n [part='loader']::before {\n content: '';\n display: block;\n height: 100%;\n opacity: 0.16;\n background: var(--material-primary-color);\n }\n\n @keyframes material-combo-box-loader-fade-in {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n }\n\n @keyframes material-combo-box-loader-progress {\n 0% {\n background-position: 0 0;\n background-size: 300% 100%;\n }\n\n 33% {\n background-position: -100% 0;\n background-size: 400% 100%;\n }\n\n 67% {\n background-position: -200% 0;\n background-size: 250% 100%;\n }\n\n 100% {\n background-position: -300% 0;\n background-size: 300% 100%;\n }\n }\n\n /* RTL specific styles */\n\n @keyframes material-combo-box-loader-progress-rtl {\n 0% {\n background-position: 100% 0;\n background-size: 300% 100%;\n }\n\n 33% {\n background-position: 200% 0;\n background-size: 400% 100%;\n }\n\n 67% {\n background-position: 300% 0;\n background-size: 250% 100%;\n }\n\n 100% {\n background-position: 400% 0;\n background-size: 300% 100%;\n }\n }\n\n :host([loading][dir='rtl']) [part='loader'] {\n animation: 3s linear infinite material-combo-box-loader-progress-rtl,\n 0.3s 0.1s both material-combo-box-loader-fade-in;\n }\n"])));(0,m.hC)("vaadin-combo-box-overlay",[E,T],{moduleId:"material-combo-box-overlay"});var A,z=(0,m.iv)(j||(j=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n :host {\n display: flex;\n align-items: center;\n box-sizing: border-box;\n min-height: 36px;\n padding: 8px 32px 8px 10px;\n overflow: hidden;\n font-family: var(--material-font-family);\n font-size: var(--material-small-font-size);\n line-height: 24px;\n }\n\n /* It's the list-box's responsibility to add the focus style */\n :host([focused]) {\n outline: none;\n }\n\n /* Checkmark */\n [part='checkmark']::before {\n display: var(--_material-item-selected-icon-display, none);\n content: '';\n font-family: material-icons;\n font-size: 24px;\n line-height: 1;\n font-weight: 400;\n width: 24px;\n text-align: center;\n margin-right: 10px;\n color: var(--material-secondary-text-color);\n flex: none;\n }\n\n :host([selected]) [part='checkmark']::before {\n content: var(--material-icons-check);\n }\n\n @media (any-hover: hover) {\n :host(:hover:not([disabled])) {\n background-color: var(--material-secondary-background-color);\n }\n\n :host([focused]:not([disabled])) {\n background-color: var(--material-divider-color);\n }\n }\n\n /* Disabled */\n :host([disabled]) {\n color: var(--material-disabled-text-color);\n cursor: default;\n pointer-events: none;\n }\n\n /* RTL specific styles */\n :host([dir='rtl']) {\n padding: 8px 10px 8px 32px;\n }\n\n :host([dir='rtl']) [part='checkmark']::before {\n margin-right: 0;\n margin-left: 10px;\n }\n"])));(0,m.hC)("vaadin-item",z,{moduleId:"material-item"});var V=(0,m.iv)(A||(A=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n :host {\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n padding: 4px 10px;\n --_material-item-selected-icon-display: block;\n }\n"])));(0,m.hC)("vaadin-combo-box-item",[z,V],{moduleId:"material-combo-box-item"});var L=n(28426);function B(e,t){for(var n=0;n0?t="default":(e.scrollLeft=2,e.scrollLeft<2&&(t="negative")),document.body.removeChild(e),t}},{key:"getNormalizedScrollLeft",value:function(e,t,n){var r=n.scrollLeft;if("rtl"!==t||!e)return r;switch(e){case"negative":return n.scrollWidth-n.clientWidth+r;case"reverse":return n.scrollWidth-n.clientWidth-r}return r}},{key:"setNormalizedScrollLeft",value:function(e,t,n,r){if("rtl"===t&&e)switch(e){case"negative":n.scrollLeft=n.clientWidth-n.scrollWidth+r;break;case"reverse":n.scrollLeft=n.scrollWidth-n.clientWidth-r;break;default:n.scrollLeft=r}else n.scrollLeft=r}}],(n=null)&&B(t.prototype,n),r&&B(t,r),e}();function M(e){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M(e)}function N(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function H(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:e.getAttribute("dir");t?e.setAttribute("dir",t):null!=n&&e.removeAttribute("dir")},J=function(){return document.documentElement.getAttribute("dir")},Q=function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&F(e,t)}(o,e);var t,n,r,i=q(o);function o(){return N(this,o),i.apply(this,arguments)}return t=o,n=[{key:"connectedCallback",value:function(){$(W(o.prototype),"connectedCallback",this).call(this),this.hasAttribute("dir")||(this.__subscribe(),K(this,J(),null))}},{key:"attributeChangedCallback",value:function(e,t,n){if($(W(o.prototype),"attributeChangedCallback",this).call(this,e,t,n),"dir"===e){var r=J(),i=n===r&&-1===G.indexOf(this),a=!n&&t&&-1===G.indexOf(this),c=n!==r&&t===r;i||a?(this.__subscribe(),K(this,r,n)):c&&this.__subscribe(!1)}}},{key:"disconnectedCallback",value:function(){$(W(o.prototype),"disconnectedCallback",this).call(this),this.__subscribe(!1),this.removeAttribute("dir")}},{key:"_valueToNodeAttribute",value:function(e,t,n){("dir"!==n||""!==t||e.hasAttribute("dir"))&&$(W(o.prototype),"_valueToNodeAttribute",this).call(this,e,t,n)}},{key:"_attributeToProperty",value:function(e,t,n){"dir"!==e||t?$(W(o.prototype),"_attributeToProperty",this).call(this,e,t,n):this.dir=""}},{key:"__subscribe",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e?-1===G.indexOf(this)&&G.push(this):G.indexOf(this)>-1&&G.splice(G.indexOf(this),1)}},{key:"__getNormalizedScrollLeft",value:function(e){return D.getNormalizedScrollLeft(Y,this.getAttribute("dir")||"ltr",e)}},{key:"__setNormalizedScrollLeft",value:function(e,t){return D.setNormalizedScrollLeft(Y,this.getAttribute("dir")||"ltr",e,t)}}],r=[{key:"properties",get:function(){return{dir:{type:String,value:"",reflectToAttribute:!0}}}},{key:"finalize",value:function(){$(W(o),"finalize",this).call(this),Y||(Y=D.detectScrollType())}}],n&&H(t.prototype,n),r&&H(t,r),o}(e)};function Z(e){return Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Z(e)}function ee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function te(e,t){for(var n=0;n\n :host {\n display: block;\n }\n\n :host([hidden]) {\n display: none;\n }\n \n \n
\n \n
\n '])))}},{key:"is",get:function(){return"vaadin-combo-box-item"}},{key:"properties",get:function(){return{index:Number,item:Object,label:String,selected:{type:Boolean,value:!1,reflectToAttribute:!0},focused:{type:Boolean,value:!1,reflectToAttribute:!0},renderer:Function,_oldRenderer:Function}}},{key:"observers",get:function(){return["__rendererOrItemChanged(renderer, index, item.*, selected, focused)","__updateLabel(label, renderer)"]}}],n&&te(t.prototype,n),r&&te(t,r),o}((0,m.Tb)(Q(L.H3)));customElements.define(ce.is,ce);var se=n(20723),le=n(87529),ue=n(52521),fe=function(e){return e.test(navigator.userAgent)},de=function(e){return e.test(navigator.platform)},he=(fe(/Android/),fe(/Chrome/)&&/Google Inc/.test(navigator.vendor),fe(/Firefox/),de(/^iPad/)||de(/^Mac/)&&navigator.maxTouchPoints>1),pe=de(/^iPhone/)||he,ye=fe(/^((?!chrome|android).)*safari/i),me=function(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}();function ve(e,t){for(var n=0;n0;if(i>=0&&t.push(r),n="slot"===r.localName?r.assignedNodes({flatten:!0}):(r.shadowRoot||r).children)for(var a=0;a0&&t.length>0;)this._hasLowerTabOrder(e[0],t[0])?n.push(t.shift()):n.push(e.shift());return n.concat(e,t)}},{key:"_hasLowerTabOrder",value:function(e,t){var n=Math.max(e.tabIndex,0),r=Math.max(t.tabIndex,0);return 0===n||0===r?r>n:n>r}}],(n=null)&&ve(t.prototype,n),r&&ve(t,r),e}();function ge(e){return ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ge(e)}function we(e,t){for(var n=0;n\n :host {\n z-index: 200;\n position: fixed;\n\n /* Despite of what the names say, is just a container\n for position/sizing/alignment. The actual overlay is the overlay part. */\n\n /* Default position constraints: the entire viewport. Note: themes can\n override this to introduce gaps between the overlay and the viewport. */\n top: 0;\n right: 0;\n bottom: var(--vaadin-overlay-viewport-bottom);\n left: 0;\n\n /* Use flexbox alignment for the overlay part. */\n display: flex;\n flex-direction: column; /* makes dropdowns sizing easier */\n /* Align to center by default. */\n align-items: center;\n justify-content: center;\n\n /* Allow centering when max-width/max-height applies. */\n margin: auto;\n\n /* The host is not clickable, only the overlay part is. */\n pointer-events: none;\n\n /* Remove tap highlight on touch devices. */\n -webkit-tap-highlight-color: transparent;\n\n /* CSS API for host */\n --vaadin-overlay-viewport-bottom: 0;\n }\n\n :host([hidden]),\n :host(:not([opened]):not([closing])) {\n display: none !important;\n }\n\n [part=\'overlay\'] {\n -webkit-overflow-scrolling: touch;\n overflow: auto;\n pointer-events: auto;\n\n /* Prevent overflowing the host in MSIE 11 */\n max-width: 100%;\n box-sizing: border-box;\n\n -webkit-tap-highlight-color: initial; /* reenable tap highlight inside */\n }\n\n [part=\'backdrop\'] {\n z-index: -1;\n content: \'\';\n background: rgba(0, 0, 0, 0.5);\n position: fixed;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n pointer-events: auto;\n }\n \n\n
\n
\n
\n \n
\n
\n '])))}},{key:"is",get:function(){return"vaadin-overlay"}},{key:"properties",get:function(){return{opened:{type:Boolean,notify:!0,observer:"_openedChanged",reflectToAttribute:!0},owner:Element,renderer:Function,template:{type:Object,notify:!0},instanceProps:{type:Object},content:{type:Object,notify:!0},withBackdrop:{type:Boolean,value:!1,reflectToAttribute:!0},model:Object,modeless:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_modelessChanged"},hidden:{type:Boolean,reflectToAttribute:!0,observer:"_hiddenChanged"},focusTrap:{type:Boolean,value:!1},restoreFocusOnClose:{type:Boolean,value:!1},_mouseDownInside:{type:Boolean},_mouseUpInside:{type:Boolean},_instance:{type:Object},_originalContentPart:Object,_contentNodes:Array,_oldOwner:Element,_oldModel:Object,_oldTemplate:Object,_oldInstanceProps:Object,_oldRenderer:Object,_oldOpened:Boolean}}},{key:"observers",get:function(){return["_templateOrRendererChanged(template, renderer, owner, model, instanceProps, opened)"]}},{key:"__attachedInstances",get:function(){return Array.from(document.body.children).filter((function(e){return e instanceof o&&!e.hasAttribute("closing")})).sort((function(e,t){return e.__zIndex-t.__zIndex||0}))}}],(n=[{key:"ready",value:function(){Oe(Ie(o.prototype),"ready",this).call(this),this._observer.flush(),this.addEventListener("click",(function(){})),this.$.backdrop.addEventListener("click",(function(){}))}},{key:"_detectIosNavbar",value:function(){if(this.opened){var e=window.innerHeight,t=window.innerWidth>e,n=document.documentElement.clientHeight;t&&n>e?this.style.setProperty("--vaadin-overlay-viewport-bottom",n-e+"px"):this.style.setProperty("--vaadin-overlay-viewport-bottom","0")}}},{key:"_setTemplateFromNodes",value:function(e){this.template=e.filter((function(e){return e.localName&&"template"===e.localName}))[0]||this.template}},{key:"close",value:function(e){var t=new CustomEvent("vaadin-overlay-close",{bubbles:!0,cancelable:!0,detail:{sourceEvent:e}});this.dispatchEvent(t),t.defaultPrevented||(this.opened=!1)}},{key:"connectedCallback",value:function(){Oe(Ie(o.prototype),"connectedCallback",this).call(this),this._boundIosResizeListener&&(this._detectIosNavbar(),window.addEventListener("resize",this._boundIosResizeListener))}},{key:"disconnectedCallback",value:function(){Oe(Ie(o.prototype),"disconnectedCallback",this).call(this),this._boundIosResizeListener&&window.removeEventListener("resize",this._boundIosResizeListener)}},{key:"requestContentUpdate",value:function(){this.renderer&&this.renderer.call(this.owner,this.content,this.owner,this.model)}},{key:"_ironOverlayCanceled",value:function(e){e.preventDefault()}},{key:"_mouseDownListener",value:function(e){this._mouseDownInside=e.composedPath().indexOf(this.$.overlay)>=0}},{key:"_mouseUpListener",value:function(e){this._mouseUpInside=e.composedPath().indexOf(this.$.overlay)>=0}},{key:"_outsideClickListener",value:function(e){if(-1!==e.composedPath().indexOf(this.$.overlay)||this._mouseDownInside||this._mouseUpInside)return this._mouseDownInside=!1,void(this._mouseUpInside=!1);if(this._last){var t=new CustomEvent("vaadin-overlay-outside-click",{bubbles:!0,cancelable:!0,detail:{sourceEvent:e}});this.dispatchEvent(t),this.opened&&!t.defaultPrevented&&this.close(e)}}},{key:"_keydownListener",value:function(e){if(this._last)if("Tab"===e.key&&this.focusTrap&&!e.defaultPrevented)this._cycleTab(e.shiftKey?-1:1),e.preventDefault();else if("Escape"===e.key||"Esc"===e.key){var t=new CustomEvent("vaadin-overlay-escape-press",{bubbles:!0,cancelable:!0,detail:{sourceEvent:e}});this.dispatchEvent(t),this.opened&&!t.defaultPrevented&&this.close(e)}}},{key:"_ensureTemplatized",value:function(){this._setTemplateFromNodes(Array.from(this.children))}},{key:"_openedChanged",value:function(e,t){var n=this;this._instance||this._ensureTemplatized(),e?(this.__restoreFocusNode=this._getActiveElement(),this._animatedOpening(),(0,le.T8)(this,(function(){n.focusTrap&&!n.contains(document.activeElement)&&n._cycleTab(0,0);var e=new CustomEvent("vaadin-overlay-open",{bubbles:!0});n.dispatchEvent(e)})),this.modeless||this._addGlobalListeners()):t&&(this._animatedClosing(),this.modeless||this._removeGlobalListeners())}},{key:"_hiddenChanged",value:function(e){e&&this.hasAttribute("closing")&&this._flushAnimation("closing")}},{key:"_shouldAnimate",value:function(){var e=getComputedStyle(this).getPropertyValue("animation-name");return!("none"===getComputedStyle(this).getPropertyValue("display"))&&e&&"none"!=e}},{key:"_enqueueAnimation",value:function(e,t){var n=this,r="__".concat(e,"Handler"),i=function e(i){i&&i.target!==n||(t(),n.removeEventListener("animationend",e),delete n[r])};this[r]=i,this.addEventListener("animationend",i)}},{key:"_flushAnimation",value:function(e){var t="__".concat(e,"Handler");"function"==typeof this[t]&&this[t]()}},{key:"_animatedOpening",value:function(){var e=this;this.parentNode===document.body&&this.hasAttribute("closing")&&this._flushAnimation("closing"),this._attachOverlay(),this.modeless||this._enterModalState(),this.setAttribute("opening","");var t=function(){document.addEventListener("iron-overlay-canceled",e._boundIronOverlayCanceledListener),e.removeAttribute("opening")};this._shouldAnimate()?this._enqueueAnimation("opening",t):t()}},{key:"_attachOverlay",value:function(){this._placeholder=document.createComment("vaadin-overlay-placeholder"),this.parentNode.insertBefore(this._placeholder,this),document.body.appendChild(this),this.bringToFront()}},{key:"_animatedClosing",value:function(){var e=this;if(this.hasAttribute("opening")&&this._flushAnimation("opening"),this._placeholder){if(this._exitModalState(),this.restoreFocusOnClose&&this.__restoreFocusNode){var t=this._getActiveElement();(t===document.body||this._deepContains(t))&&this.__restoreFocusNode.focus(),this.__restoreFocusNode=null}this.setAttribute("closing","");var n=function(){document.removeEventListener("iron-overlay-canceled",e._boundIronOverlayCanceledListener),e._detachOverlay(),e.shadowRoot.querySelector('[part="overlay"]').style.removeProperty("pointer-events"),e.removeAttribute("closing")};this._shouldAnimate()?this._enqueueAnimation("closing",n):n()}}},{key:"_detachOverlay",value:function(){this._placeholder.parentNode.insertBefore(this,this._placeholder),this._placeholder.parentNode.removeChild(this._placeholder)}},{key:"_last",get:function(){return this===o.__attachedInstances.pop()}},{key:"_modelessChanged",value:function(e){e?(this._removeGlobalListeners(),this._exitModalState()):this.opened&&(this._addGlobalListeners(),this._enterModalState())}},{key:"_addGlobalListeners",value:function(){document.addEventListener("mousedown",this._boundMouseDownListener),document.addEventListener("mouseup",this._boundMouseUpListener),document.documentElement.addEventListener("click",this._boundOutsideClickListener,!0),document.addEventListener("keydown",this._boundKeydownListener)}},{key:"_enterModalState",value:function(){var e=this;"none"!==document.body.style.pointerEvents&&(this._previousDocumentPointerEvents=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),o.__attachedInstances.forEach((function(t){t!==e&&(t.shadowRoot.querySelector('[part="overlay"]').style.pointerEvents="none")}))}},{key:"_removeGlobalListeners",value:function(){document.removeEventListener("mousedown",this._boundMouseDownListener),document.removeEventListener("mouseup",this._boundMouseUpListener),document.documentElement.removeEventListener("click",this._boundOutsideClickListener,!0),document.removeEventListener("keydown",this._boundKeydownListener)}},{key:"_exitModalState",value:function(){void 0!==this._previousDocumentPointerEvents&&(document.body.style.pointerEvents=this._previousDocumentPointerEvents,delete this._previousDocumentPointerEvents);for(var e,t=o.__attachedInstances;(e=t.pop())&&(e===this||(e.shadowRoot.querySelector('[part="overlay"]').style.removeProperty("pointer-events"),e.modeless)););}},{key:"_removeOldContent",value:function(){var e=this;this.content&&this._contentNodes&&(this._observer.disconnect(),this._contentNodes.forEach((function(t){t.parentNode===e.content&&e.content.removeChild(t)})),this._originalContentPart&&(this.$.content.parentNode.replaceChild(this._originalContentPart,this.$.content),this.$.content=this._originalContentPart,this._originalContentPart=void 0),this._observer.connect(),this._contentNodes=void 0,this.content=void 0)}},{key:"_stampOverlayTemplate",value:function(e,t){this._removeOldContent(),e._Templatizer||(e._Templatizer=(0,ue.Uv)(e,this,{instanceProps:t,forwardHostProp:function(e,t){this._instance&&this._instance.forwardHostProp(e,t)}})),this._instance=new e._Templatizer({}),this._contentNodes=Array.from(this._instance.root.childNodes);var n=e._templateRoot||(e._templateRoot=e.getRootNode());if(n!==document){this.$.content.shadowRoot||this.$.content.attachShadow({mode:"open"});var r=Array.from(n.querySelectorAll("style")).reduce((function(e,t){return e+t.textContent}),"");if(r=r.replace(/:host/g,":host-nomatch")){var i=document.createElement("style");i.textContent=r,this.$.content.shadowRoot.appendChild(i),this._contentNodes.unshift(i)}this.$.content.shadowRoot.appendChild(this._instance.root),this.content=this.$.content.shadowRoot}else this.appendChild(this._instance.root),this.content=this}},{key:"_removeNewRendererOrTemplate",value:function(e,t,n,r){e!==t?this.template=void 0:n!==r&&(this.renderer=void 0)}},{key:"_templateOrRendererChanged",value:function(e,t,n,r,i,o){if(e&&t)throw this._removeNewRendererOrTemplate(e,this._oldTemplate,t,this._oldRenderer),new Error("You should only use either a renderer or a template for overlay content");var a=this._oldOwner!==n||this._oldModel!==r;this._oldModel=r,this._oldOwner=n;var c=this._oldInstanceProps!==i||this._oldTemplate!==e;this._oldInstanceProps=i,this._oldTemplate=e;var s=this._oldRenderer!==t;this._oldRenderer=t;var l=this._oldOpened!==o;this._oldOpened=o,s&&(this.content=this,this.content.innerHTML="",delete this.content._$litPart$),e&&c?this._stampOverlayTemplate(e,i):t&&(s||l||a)&&o&&this.requestContentUpdate()}},{key:"_isFocused",value:function(e){return e&&e.getRootNode().activeElement===e}},{key:"_focusedIndex",value:function(e){return(e=e||this._getFocusableElements()).indexOf(e.filter(this._isFocused).pop())}},{key:"_cycleTab",value:function(e,t){var n=this._getFocusableElements();void 0===t&&(t=this._focusedIndex(n)),(t+=e)>=n.length?t=0:t<0&&(t=n.length-1),n[t].focus()}},{key:"_getFocusableElements",value:function(){return be.getTabbableNodes(this.$.overlay)}},{key:"_getActiveElement",value:function(){for(var e=document.activeElement||document.body;e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}},{key:"_deepContains",value:function(e){if(this.contains(e))return!0;for(var t=e,n=e.ownerDocument;t&&t!==n&&t!==this;)t=t.parentNode||t.host;return t===this}},{key:"bringToFront",value:function(){var e=this,t="",n=o.__attachedInstances.filter((function(t){return t!==e})).pop();n&&(t=n.__zIndex+1),this.style.zIndex=t,this.__zIndex=t||parseFloat(getComputedStyle(this).zIndex)}}])&&we(t.prototype,n),r&&we(t,r),o}((0,m.Tb)(Q(L.H3)));function Re(e){return Re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Re(e)}function Ee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function je(e,t){for(var n=0;n(i?s:c)||l>t)}},{key:"__calculatePositionInOneDimension",value:function(e,t,n,r,i,o){var a,c=o?r.start:r.end,s=o?r.end:r.start;return Ee(a={},c,parseFloat(i.style[c]||getComputedStyle(i)[c])+(t[o?r.start:r.end]-e[n===o?r.end:r.start])*(o?-1:1)+"px"),Ee(a,s,""),a}}],r=[{key:"properties",get:function(){return{positionTarget:{type:Object,value:null},horizontalAlign:{type:String,value:"start"},verticalAlign:{type:String,value:"top"},noHorizontalOverlap:{type:Boolean,value:!1},noVerticalOverlap:{type:Boolean,value:!1}}}},{key:"observers",get:function(){return["__positionSettingsChanged(positionTarget, horizontalAlign, verticalAlign, noHorizontalOverlap, noVerticalOverlap)","__overlayOpenedChanged(opened)"]}}],n&&je(t.prototype,n),r&&je(t,r),o}(Ce));customElements.define(Xe.is,Xe);var Ke=0,Je=0,Qe=[],Ze=0,et=!1,tt=document.createTextNode("");new window.MutationObserver((function(){et=!1;for(var e=Qe.length,t=0;t=0){if(!Qe[t])throw new Error("invalid async handle: "+e);Qe[t]=null}}};function at(e,t){for(var n=0;n=8,dt={_ratio:.5,_scrollerPaddingTop:0,_scrollPosition:0,_physicalSize:0,_physicalAverage:0,_physicalAverageCount:0,_physicalTop:0,_virtualCount:0,_estScrollHeight:0,_scrollHeight:0,_viewportHeight:0,_viewportWidth:0,_physicalItems:null,_physicalSizes:null,_firstVisibleIndexVal:null,_lastVisibleIndexVal:null,_maxPages:2,_itemsPerRow:1,_itemWidth:0,_rowHeight:0,_templateCost:0,_parentModel:!0,get _physicalBottom(){return this._physicalTop+this._physicalSize},get _scrollBottom(){return this._scrollPosition+this._viewportHeight},get _virtualEnd(){return this._virtualStart+this._physicalCount-1},get _hiddenContentSize(){return(this.grid?this._physicalRows*this._rowHeight:this._physicalSize)-this._viewportHeight},get _maxScrollTop(){return this._estScrollHeight-this._viewportHeight+this._scrollOffset},get _maxVirtualStart(){var e=this._convertIndexToCompleteRow(this._virtualCount);return Math.max(0,e-this._physicalCount)},set _virtualStart(e){e=this._clamp(e,0,this._maxVirtualStart),this.grid&&(e-=e%this._itemsPerRow),this._virtualStartVal=e},get _virtualStart(){return this._virtualStartVal||0},set _physicalStart(e){(e%=this._physicalCount)<0&&(e=this._physicalCount+e),this.grid&&(e-=e%this._itemsPerRow),this._physicalStartVal=e},get _physicalStart(){return this._physicalStartVal||0},get _physicalEnd(){return(this._physicalStart+this._physicalCount-1)%this._physicalCount},set _physicalCount(e){this._physicalCountVal=e},get _physicalCount(){return this._physicalCountVal||0},get _optPhysicalSize(){return 0===this._viewportHeight?1/0:this._viewportHeight*this._maxPages},get _isVisible(){return Boolean(this.offsetWidth||this.offsetHeight)},get firstVisibleIndex(){var e=this._firstVisibleIndexVal;if(null==e){var t=this._physicalTop+this._scrollOffset;e=this._iterateItems((function(e,n){return(t+=this._getPhysicalSizeIncrement(e))>this._scrollPosition?this.grid?n-n%this._itemsPerRow:n:this.grid&&this._virtualCount-1===n?n-n%this._itemsPerRow:void 0}))||0,this._firstVisibleIndexVal=e}return e},get lastVisibleIndex(){var e=this._lastVisibleIndexVal;if(null==e){if(this.grid)e=Math.min(this._virtualCount,this.firstVisibleIndex+this._estRowsInView*this._itemsPerRow-1);else{var t=this._physicalTop+this._scrollOffset;this._iterateItems((function(n,r){t=0;if(this._scrollPosition=e,this._firstVisibleIndexVal=null,this._lastVisibleIndexVal=null,Math.abs(t)>this._physicalSize&&this._physicalSize>0){t-=this._scrollOffset;var r=Math.round(t/this._physicalAverage)*this._itemsPerRow;this._virtualStart=this._virtualStart+r,this._physicalStart=this._physicalStart+r,this._physicalTop=Math.min(Math.floor(this._virtualStart/this._itemsPerRow)*this._physicalAverage,this._scrollPosition),this._update()}else if(this._physicalCount>0){var i=this._getReusables(n);n?(this._physicalTop=i.physicalTop,this._virtualStart=this._virtualStart+i.indexes.length,this._physicalStart=this._physicalStart+i.indexes.length):(this._virtualStart=this._virtualStart-i.indexes.length,this._physicalStart=this._physicalStart-i.indexes.length),this._update(i.indexes,n?null:i.indexes),this._debounce("_increasePoolIfNeeded",this._increasePoolIfNeeded.bind(this,0),ot)}},_getReusables:function(e){var t,n,r,i=[],o=this._hiddenContentSize*this._ratio,a=this._virtualStart,c=this._virtualEnd,s=this._physicalCount,l=this._physicalTop+this._scrollOffset,u=this._physicalBottom+this._scrollOffset,f=this._scrollPosition,d=this._scrollBottom;for(e?(t=this._physicalStart,this._physicalEnd,n=f-l):(t=this._physicalEnd,this._physicalStart,n=u-d);n-=r=this._getPhysicalSizeIncrement(t),!(i.length>=s||n<=o);)if(e){if(c+i.length+1>=this._virtualCount)break;if(l+r>=f-this._scrollOffset)break;i.push(t),l+=r,t=(t+1)%s}else{if(a-i.length<=0)break;if(l+this._physicalSize-r<=d)break;i.push(t),l-=r,t=0===t?s-1:t-1}return{indexes:i,physicalTop:l-this._scrollOffset}},_update:function(e,t){if(!(e&&0===e.length||0===this._physicalCount)){if(this._manageFocus(),this._assignModels(e),this._updateMetrics(e),t)for(;t.length;){var n=t.pop();this._physicalTop-=this._getPhysicalSizeIncrement(n)}this._positionItems(),this._updateScrollerSize()}},_isClientFull:function(){return 0!=this._scrollBottom&&this._physicalBottom-1>=this._scrollBottom&&this._physicalTop<=this._scrollPosition},_increasePoolIfNeeded:function(e){var t=this._clamp(this._physicalCount+e,3,this._virtualCount-this._virtualStart);if(t=this._convertIndexToCompleteRow(t),this.grid){var n=t%this._itemsPerRow;n&&t-n<=this._physicalCount&&(t+=this._itemsPerRow),t-=n}var r=t-this._physicalCount,i=Math.round(.5*this._physicalCount);if(!(r<0)){if(r>0){var o=window.performance.now();[].push.apply(this._physicalItems,this._createPool(r));for(var a=0;athis._physicalEnd&&this._isIndexRendered(this._focusedVirtualIndex)&&this._getPhysicalIndex(this._focusedVirtualIndex)=this._virtualCount-1||0===i||(this._isClientFull()?this._physicalSize0&&(this.updateViewportBoundaries(),this._increasePoolIfNeeded(3))},_gridChanged:function(e,t){void 0!==t&&(this.notifyResize(),lt(),e&&this._updateGridMetrics())},_itemsChanged:function(e){if("items"===e.path)this._virtualStart=0,this._physicalTop=0,this._virtualCount=this.items?this.items.length:0,this._physicalIndexForKey={},this._firstVisibleIndexVal=null,this._lastVisibleIndexVal=null,this._physicalCount=this._physicalCount||0,this._physicalItems=this._physicalItems||[],this._physicalSizes=this._physicalSizes||[],this._physicalStart=0,this._scrollTop>this._scrollOffset&&this._resetScrollPosition(0),this._removeFocusedItem(),this._debounce("_render",this._render,rt);else if("items.splices"===e.path){if(this._adjustVirtualIndex(e.value.indexSplices),this._virtualCount=this.items?this.items.length:0,e.value.indexSplices.some((function(e){return e.addedCount>0||e.removed.length>0}))){var t=this._getActiveElement();this.contains(t)&&t.blur()}var n=e.value.indexSplices.some((function(e){return e.index+e.addedCount>=this._virtualStart&&e.index<=this._virtualEnd}),this);this._isClientFull()&&!n||this._debounce("_render",this._render,rt)}else"items.length"!==e.path&&this._forwardItemPath(e.path,e.value)},_iterateItems:function(e,t){var n,r,i,o;if(2===arguments.length&&t){for(o=0;o=this._physicalStart?this._virtualStart+(e-this._physicalStart):this._virtualStart+(this._physicalCount-this._physicalStart)+e},_updateMetrics:function(e){lt();var t=0,n=0,r=this._physicalAverageCount,i=this._physicalAverage;this._iterateItems((function(e,r){n+=this._physicalSizes[e],this._physicalSizes[e]=this._physicalItems[e].offsetHeight,t+=this._physicalSizes[e],this._physicalAverageCount+=this._physicalSizes[e]?1:0}),e),this.grid?(this._updateGridMetrics(),this._physicalSize=Math.ceil(this._physicalCount/this._itemsPerRow)*this._rowHeight):(n=1===this._itemsPerRow?n:Math.ceil(this._physicalCount/this._itemsPerRow)*this._rowHeight,this._physicalSize=this._physicalSize+t-n,this._itemsPerRow=1),this._physicalAverageCount!==r&&(this._physicalAverage=Math.round((i*r+t)/this._physicalAverageCount))},_updateGridMetrics:function(){this._itemWidth=this._physicalCount>0?this._physicalItems[0].getBoundingClientRect().width:200,this._rowHeight=this._physicalCount>0?this._physicalItems[0].offsetHeight:200,this._itemsPerRow=this._itemWidth?Math.floor(this._viewportWidth/this._itemWidth):this._itemsPerRow},_positionItems:function(){this._adjustScrollPosition();var e=this._physicalTop;if(this.grid){var t=this._itemsPerRow*this._itemWidth,n=(this._viewportWidth-t)/2;this._iterateItems((function(t,r){var i=r%this._itemsPerRow,o=Math.floor(i*this._itemWidth+n);this._isRTL&&(o*=-1),this.translate3d(o+"px",e+"px",0,this._physicalItems[t]),this._shouldRenderNextRow(r)&&(e+=this._rowHeight)}))}else{var r=[];this._iterateItems((function(t,n){var i=this._physicalItems[t];this.translate3d(0,e+"px",0,i),e+=this._physicalSizes[t];var o=i.id;o&&r.push(o)})),r.length&&this.setAttribute("aria-owns",r.join(" "))}},_getPhysicalSizeIncrement:function(e){return this.grid?this._computeVidx(e)%this._itemsPerRow!=this._itemsPerRow-1?0:this._rowHeight:this._physicalSizes[e]},_shouldRenderNextRow:function(e){return e%this._itemsPerRow==this._itemsPerRow-1},_adjustScrollPosition:function(){var e=0===this._virtualStart?this._physicalTop:Math.min(this._scrollPosition+this._physicalTop,0);if(0!==e){this._physicalTop=this._physicalTop-e;var t=this._scrollPosition;!ft&&t>0&&this._resetScrollPosition(t-e)}},_resetScrollPosition:function(e){this.scrollTarget&&e>=0&&(this._scrollTop=e,this._scrollPosition=this._scrollTop)},_updateScrollerSize:function(e){this.grid?this._estScrollHeight=this._virtualRowCount*this._rowHeight:this._estScrollHeight=this._physicalBottom+Math.max(this._virtualCount-this._physicalCount-this._virtualStart,0)*this._physicalAverage,((e=(e=(e=e||0===this._scrollHeight)||this._scrollPosition>=this._estScrollHeight-this._physicalSize)||this.grid&&this.$.items.style.height=this._viewportHeight)&&(this.$.items.style.height=this._estScrollHeight+"px",this._scrollHeight=this._estScrollHeight)},scrollToIndex:function(e){if(!("number"!=typeof e||e<0||e>this.items.length-1)&&(lt(),0!==this._physicalCount)){e=this._clamp(e,0,this._virtualCount-1),(!this._isIndexRendered(e)||e>=this._maxVirtualStart)&&(this._virtualStart=this.grid?e-2*this._itemsPerRow:e-1),this._manageFocus(),this._assignModels(),this._updateMetrics(),this._physicalTop=Math.floor(this._virtualStart/this._itemsPerRow)*this._physicalAverage;for(var t=this._physicalStart,n=this._virtualStart,r=0,i=this._hiddenContentSize;n=this._virtualStart&&e<=this._virtualEnd},_isIndexVisible:function(e){return e>=this.firstVisibleIndex&&e<=this.lastVisibleIndex},_getPhysicalIndex:function(e){return(this._physicalStart+(e-this._virtualStart))%this._physicalCount},_clamp:function(e,t,n){return Math.min(n,Math.max(t,e))},_debounce:function(e,t,n){var r;this._debouncers=this._debouncers||{},this._debouncers[e]=ct.debounce(this._debouncers[e],n,t.bind(this)),r=this._debouncers[e],st.add(r)}};function ht(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size-1;this.__getVisibleElements().forEach((function(r){r.__virtualIndex>=t&&r.__virtualIndex<=n&&e.__updateElement(r,r.__virtualIndex,!0)}))}},{key:"__updateElement",value:function(e,t,n){e.style.minHeight&&(e.style.minHeight=""),this.__preventElementUpdates||e.__lastUpdatedIndex===t&&!n||(this.updateElement(e,t),e.__lastUpdatedIndex=t),0===e.offsetHeight&&(e.style.minHeight="200px")}},{key:"__getIndexScrollOffset",value:function(e){var t=this.__getVisibleElements().find((function(t){return t.__virtualIndex===e}));return t?this.scrollTarget.getBoundingClientRect().top-t.getBoundingClientRect().top:void 0}},{key:"size",get:function(){return this.__size},set:function(e){var t=this;if(e!==this.size){var n,r;if(this.__preventElementUpdates=!0,e>0&&(n=this.adjustedFirstVisibleIndex,r=this.__getIndexScrollOffset(n)),this.__size=e,lt(),this._itemsChanged({path:"items"}),lt(),e>0){n=Math.min(n,e-1),this.scrollToIndex(n);var i=this.__getIndexScrollOffset(n);void 0!==r&&void 0!==i&&(this._scrollTop+=r-i)}this.elementsContainer.children.length||requestAnimationFrame((function(){return t._resizeHandler()})),this.__preventElementUpdates=!1,this._resizeHandler(),lt()}}},{key:"_scrollTop",get:function(){return this.scrollTarget.scrollTop},set:function(e){this.scrollTarget.scrollTop=e}},{key:"items",get:function(){return{length:Math.min(this.size,1e5)}}},{key:"offsetHeight",get:function(){return this.scrollTarget.offsetHeight}},{key:"$",get:function(){return{items:this.scrollContainer}}},{key:"updateViewportBoundaries",value:function(){var e=window.getComputedStyle(this.scrollTarget);this._scrollerPaddingTop=this.scrollTarget===this?0:parseInt(e["padding-top"],10),this._isRTL=Boolean("rtl"===e.direction),this._viewportWidth=this.elementsContainer.offsetWidth,this._viewportHeight=this.scrollTarget.offsetHeight,this._scrollPageHeight=this._viewportHeight-this._scrollLineHeight,this.grid&&this._updateGridMetrics()}},{key:"setAttribute",value:function(){}},{key:"_createPool",value:function(e){var t=this,n=this.createElements(e),r=document.createDocumentFragment();return n.forEach((function(e){e.style.position="absolute",r.appendChild(e),t.__resizeObserver.observe(e)})),this.elementsContainer.appendChild(r),n}},{key:"_assignModels",value:function(e){var t=this;this._iterateItems((function(e,n){var r=t._physicalItems[e];r.hidden=n>=t.size,r.hidden?delete r.__lastUpdatedIndex:(r.__virtualIndex=n+(t._vidxOffset||0),t.__updateElement(r,r.__virtualIndex))}),e)}},{key:"_isClientFull",value:function(){var t=this;return setTimeout((function(){return t.__clientFull=!0})),this.__clientFull||pt(yt(e.prototype),"_isClientFull",this).call(this)}},{key:"translate3d",value:function(e,t,n,r){r.style.transform="translateY(".concat(t,")")}},{key:"toggleScrollListener",value:function(){}},{key:"_scrollHandler",value:function(){var t=this;this._adjustVirtualIndexOffset(this._scrollTop-(this.__previousScrollTop||0)),pt(yt(e.prototype),"_scrollHandler",this).call(this),this.reorderElements&&(this.__scrollReorderDebouncer=ct.debounce(this.__scrollReorderDebouncer,nt(this.timeouts.SCROLL_REORDER),(function(){return t.__reorderElements()}))),this.__previousScrollTop=this._scrollTop}},{key:"__onWheel",value:function(e){var t=this;if(!e.ctrlKey&&!this._hasScrolledAncestor(e.target,e.deltaX,e.deltaY)){var n=e.deltaY;if(e.deltaMode===WheelEvent.DOM_DELTA_LINE?n*=this._scrollLineHeight:e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(n*=this._scrollPageHeight),this._deltaYAcc=this._deltaYAcc||0,this._wheelAnimationFrame)return this._deltaYAcc+=n,void e.preventDefault();n+=this._deltaYAcc,this._deltaYAcc=0,this._wheelAnimationFrame=!0,this.__debouncerWheelAnimationFrame=ct.debounce(this.__debouncerWheelAnimationFrame,rt,(function(){return t._wheelAnimationFrame=!1}));var r=Math.abs(e.deltaX)+Math.abs(n);this._canScroll(this.scrollTarget,e.deltaX,n)?(e.preventDefault(),this.scrollTarget.scrollTop+=n,this.scrollTarget.scrollLeft+=e.deltaX,this._hasResidualMomentum=!0,this._ignoreNewWheel=!0,this._debouncerIgnoreNewWheel=ct.debounce(this._debouncerIgnoreNewWheel,nt(this.timeouts.IGNORE_WHEEL),(function(){return t._ignoreNewWheel=!1}))):this._hasResidualMomentum&&r<=this._previousMomentum||this._ignoreNewWheel?e.preventDefault():r>this._previousMomentum&&(this._hasResidualMomentum=!1),this._previousMomentum=r}}},{key:"_hasScrolledAncestor",value:function(e,t,n){return e!==this.scrollTarget&&e!==this.scrollTarget.getRootNode().host&&(!(!this._canScroll(e,t,n)||-1===["auto","scroll"].indexOf(getComputedStyle(e).overflow))||(e!==this&&e.parentElement?this._hasScrolledAncestor(e.parentElement,t,n):void 0))}},{key:"_canScroll",value:function(e,t,n){return n>0&&e.scrollTop0||t>0&&e.scrollLeft0}},{key:"_getScrollLineHeight",value:function(){var e=document.createElement("div");e.style.fontSize="initial",e.style.display="none",document.body.appendChild(e);var t=window.getComputedStyle(e).fontSize;return document.body.removeChild(e),t?window.parseInt(t):void 0}},{key:"__getVisibleElements",value:function(){return Array.from(this.elementsContainer.children).filter((function(e){return!e.hidden}))}},{key:"__reorderElements",value:function(){var e=this;if(this.__mouseDown)this.__pendingReorder=!0;else{this.__pendingReorder=!1;var t=this._virtualStart+(this._vidxOffset||0),n=this.__getVisibleElements(),r=n.find((function(t){return t.contains(e.elementsContainer.getRootNode().activeElement)||t.contains(e.scrollTarget.getRootNode().activeElement)}))||n[0];if(r){var i=r.__virtualIndex-t,o=n.indexOf(r)-i;if(o>0)for(var a=0;a=this.size)this._vidxOffset=0;else{if(this.__skipNextVirtualIndexAdjust)return void(this.__skipNextVirtualIndexAdjust=!1);if(Math.abs(t)>1e4){var n=this._scrollTop/(this.scrollTarget.scrollHeight-this.scrollTarget.offsetHeight),r=n*this.size;this._vidxOffset=Math.round(r-n*this._virtualCount)}else{var i=this._vidxOffset;0===this._scrollTop?(this._vidxOffset=0,i!==this._vidxOffset&&pt(yt(e.prototype),"scrollToIndex",this).call(this,0)):this.firstVisibleIndex<1e3&&this._vidxOffset>0&&(this._vidxOffset-=Math.min(this._vidxOffset,100),pt(yt(e.prototype),"scrollToIndex",this).call(this,this.firstVisibleIndex+(i-this._vidxOffset)));var o=this.size-this._virtualCount;this._scrollTop>=this._maxScrollTop&&this._maxScrollTop>0?(this._vidxOffset=o,i!==this._vidxOffset&&pt(yt(e.prototype),"scrollToIndex",this).call(this,this._virtualCount-1)):this.firstVisibleIndex>this._virtualCount-1e3&&this._vidxOffset0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size-1;this.__adapter.update(e,t)}},{key:"flush",value:function(){this.__adapter.flush()}},{key:"firstVisibleIndex",get:function(){return this.__adapter.adjustedFirstVisibleIndex}},{key:"lastVisibleIndex",get:function(){return this.__adapter.adjustedLastVisibleIndex}}],n&&_t(t.prototype,n),r&&_t(t,r),e}();function gt(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0){var n=this._visibleItemsCount(),r=e;e>this.__virtualizer.lastVisibleIndex-1?(this.__virtualizer.scrollToIndex(e),r=e-n+1):e>this.__virtualizer.firstVisibleIndex&&(r=this.__virtualizer.firstVisibleIndex),this.__virtualizer.scrollToIndex(Math.max(0,r));var i=kt(this.children).find((function(e){return!e.hidden&&e.index===t.__virtualizer.lastVisibleIndex}));if(i&&e===i.index){var o=i.getBoundingClientRect(),a=this.getBoundingClientRect(),c=o.bottom-a.bottom+this._viewportTotalPaddingBottom;c>0&&(this.scrollTop+=c)}}}},{key:"__getAriaRole",value:function(e){return void 0!==e&&"option"}},{key:"__getAriaSelected",value:function(e,t){return this.__isItemFocused(e,t).toString()}},{key:"__isItemFocused",value:function(e,t){return e==t}},{key:"__isItemSelected",value:function(e,t,n){return!(e instanceof Ot)&&(n&&void 0!==e&&void 0!==t?this.get(n,e)===this.get(n,t):e===t)}},{key:"__itemsChanged",value:function(e){this.__virtualizer&&e&&(this.__virtualizer.size=e.length,this.__virtualizer.flush(),this.setAttribute("aria-setsize",e.length),this.requestContentUpdate())}},{key:"__loadingChanged",value:function(e){var t=this;this.__virtualizer&&!e&&setTimeout((function(){return t.requestContentUpdate()}))}},{key:"__focusedIndexChanged",value:function(e){this.__virtualizer&&e>=0&&(this.requestContentUpdate(),this.scrollIntoView(e))}},{key:"__rendererChanged",value:function(e,t){(e||t)&&this.requestContentUpdate()}},{key:"__createElements",value:function(e){var t=this;return kt(Array(e)).map((function(){var e=document.createElement("".concat(t.__hostTagName,"-item"));return e.addEventListener("click",t.__boundOnItemClick),e.tabIndex="-1",e.style.width="100%",e}))}},{key:"__updateElement",value:function(e,t){var n=this.items[t],r=this.focusedIndex;e.setProperties({item:n,index:this.__requestItemByIndex(n,t),label:this.getItemLabel(n),selected:this.__isItemSelected(n,this.selectedItem,this.itemIdPath),renderer:this.renderer,focused:this.__isItemFocused(r,t)}),e.id="".concat(this.__hostTagName,"-item-").concat(t),e.setAttribute("role",this.__getAriaRole(t)),e.setAttribute("aria-selected",this.__getAriaSelected(r,t)),e.setAttribute("aria-posinset",t+1),this.theme?e.setAttribute("theme",this.theme):e.removeAttribute("theme")}},{key:"__onItemClick",value:function(e){this.dispatchEvent(new CustomEvent("selection-changed",{detail:{item:e.currentTarget.item}}))}},{key:"__patchWheelOverScrolling",value:function(){var e=this;this.$.selector.addEventListener("wheel",(function(t){var n=0===e.scrollTop,r=e.scrollHeight-e.scrollTop-e.clientHeight<=1;(n&&t.deltaY<0||r&&t.deltaY>0)&&t.preventDefault()}))}},{key:"_viewportTotalPaddingBottom",get:function(){if(void 0===this._cachedViewportTotalPaddingBottom){var e=window.getComputedStyle(this.$.selector);this._cachedViewportTotalPaddingBottom=[e.paddingBottom,e.borderBottomWidth].map((function(e){return parseInt(e,10)})).reduce((function(e,t){return e+t}))}return this._cachedViewportTotalPaddingBottom}},{key:"__requestItemByIndex",value:function(e,t){return e instanceof Ot&&void 0!==t&&this.dispatchEvent(new CustomEvent("index-requested",{detail:{index:t,currentScrollerPos:this._oldScrollerPosition}})),t}},{key:"_visibleItemsCount",value:function(){return this.__virtualizer.scrollToIndex(this.__virtualizer.firstVisibleIndex),this.__virtualizer.size>0?this.__virtualizer.lastVisibleIndex-this.__virtualizer.firstVisibleIndex+1:0}}],r=[{key:"is",get:function(){return"vaadin-combo-box-scroller"}},{key:"template",get:function(){return(0,L.dy)(wt||(wt=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n \n
\n \n
\n "])))}},{key:"properties",get:function(){return{items:{type:Array,observer:"__itemsChanged"},focusedIndex:{type:Number,observer:"__focusedIndexChanged"},loading:{type:Boolean,observer:"__loadingChanged"},opened:{type:Boolean,observer:"__openedChanged"},selectedItem:{type:Object},itemIdPath:{type:String},comboBox:{type:Object},getItemLabel:{type:Object},renderer:{type:Object,observer:"__rendererChanged"},theme:{type:String}}}}],n&&Pt(t.prototype,n),r&&Pt(t,r),o}(L.H3);customElements.define(At.is,At);n(48175);var zt,Vt=n(87156),Lt=n(74460),Bt=new Set,Dt={properties:{_parentResizable:{type:Object,observer:"_parentResizableChanged"},_notifyingDescendant:{type:Boolean,value:!1}},listeners:{"iron-request-resize-notifications":"_onIronRequestResizeNotifications"},created:function(){this._interestedResizables=[],this._boundNotifyResize=this.notifyResize.bind(this),this._boundOnDescendantIronResize=this._onDescendantIronResize.bind(this)},attached:function(){this._requestResizeNotifications()},detached:function(){this._parentResizable?this._parentResizable.stopResizeNotificationsFor(this):(Bt.delete(this),window.removeEventListener("resize",this._boundNotifyResize)),this._parentResizable=null},notifyResize:function(){this.isAttached&&(this._interestedResizables.forEach((function(e){this.resizerShouldNotify(e)&&this._notifyDescendant(e)}),this),this._fireResize())},assignParentResizable:function(e){this._parentResizable&&this._parentResizable.stopResizeNotificationsFor(this),this._parentResizable=e,e&&-1===e._interestedResizables.indexOf(this)&&(e._interestedResizables.push(this),e._subscribeIronResize(this))},stopResizeNotificationsFor:function(e){var t=this._interestedResizables.indexOf(e);t>-1&&(this._interestedResizables.splice(t,1),this._unsubscribeIronResize(e))},_subscribeIronResize:function(e){e.addEventListener("iron-resize",this._boundOnDescendantIronResize)},_unsubscribeIronResize:function(e){e.removeEventListener("iron-resize",this._boundOnDescendantIronResize)},resizerShouldNotify:function(e){return!0},_onDescendantIronResize:function(e){this._notifyingDescendant?e.stopPropagation():Lt.my||this._fireResize()},_fireResize:function(){this.fire("iron-resize",null,{node:this,bubbles:!1})},_onIronRequestResizeNotifications:function(e){var t=(0,Vt.vz)(e).rootTarget;t!==this&&(t.assignParentResizable(this),this._notifyDescendant(t),e.stopPropagation())},_parentResizableChanged:function(e){e&&window.removeEventListener("resize",this._boundNotifyResize)},_notifyDescendant:function(e){this.isAttached&&(this._notifyingDescendant=!0,e.notifyResize(),this._notifyingDescendant=!1)},_requestResizeNotifications:function(){if(this.isAttached)if("loading"===document.readyState){var e=this._requestResizeNotifications.bind(this);document.addEventListener("readystatechange",(function t(){document.removeEventListener("readystatechange",t),e()}))}else this._findParent(),this._parentResizable?this._parentResizable._interestedResizables.forEach((function(e){e!==this&&e._findParent()}),this):(Bt.forEach((function(e){e!==this&&e._findParent()}),this),window.addEventListener("resize",this._boundNotifyResize),this.notifyResize())},_findParent:function(){this.assignParentResizable(null),this.fire("iron-request-resize-notifications",null,{node:this,bubbles:!0,cancelable:!0}),this._parentResizable?Bt.delete(this):Bt.add(this)}};function Mt(e){return Mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mt(e)}function Nt(e,t){for(var n=0;n=0)return this._items[e]}},{key:"indexOfLabel",value:function(e){if(this._items&&e)for(var t=0;t\n '])))}},{key:"properties",get:function(){return{opened:Boolean,positionTarget:{type:Object,observer:"_positionTargetChanged"},renderer:Function,loading:{type:Boolean,value:!1,reflectToAttribute:!0},theme:String,_selectedItem:{type:Object},_items:{type:Array},_focusedIndex:{type:Number,value:-1},focusedItem:{type:String,computed:"_getFocusedItem(_focusedIndex)"},_itemLabelPath:{type:String,value:"label"},_itemValuePath:{type:String,value:"value"},_scroller:Object,_itemIdPath:String,_overlayOpened:{type:Boolean,observer:"_openedChanged"}}}},{key:"observers",get:function(){return["_openedOrItemsChanged(opened, _items, loading)","__updateScroller(_scroller, _items, opened, loading, _selectedItem, _itemIdPath, _focusedIndex, renderer, theme)"]}}],n&&Nt(t.prototype,n),r&&Nt(t,r),o}((0,n(33367).P)(Dt,L.H3));customElements.define(Wt.is,Wt);var Yt=n(67130);function Gt(e){return Gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gt(e)}function Xt(e){return function(e){if(Array.isArray(e))return Kt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Kt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kt(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Kt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n\n :host([opened]) {\n pointer-events: auto;\n }\n \n\n \n\n \n '])))}},{key:"properties",get:function(){return{attrForValue:{type:String,value:"value"}}}}],(n=[{key:"clearElement",get:function(){return this.querySelector(".clear-button")}},{key:"ready",value:function(){Wn(Kn(o.prototype),"ready",this).call(this),this._toggleElement=this.querySelector(".toggle-button")}},{key:"connectedCallback",value:function(){Wn(Kn(o.prototype),"connectedCallback",this).call(this),this._setInputElement(this.querySelector("vaadin-text-field,.input")),this._revertInputValue()}},{key:"checkValidity",value:function(){return this.inputElement.validate?this.inputElement.validate():Wn(Kn(o.prototype),"checkValidity",this).call(this)}},{key:"_propertyForValue",get:function(){return(0,Yt.z)(this.attrForValue)}},{key:"_isClearButton",value:function(e){return Wn(Kn(o.prototype),"_isClearButton",this).call(this,e)||"input"===e.type&&!e.isTrusted||"clear-button"===e.composedPath()[0].getAttribute("part")}},{key:"_onChange",value:function(e){Wn(Kn(o.prototype),"_onChange",this).call(this,e),this._isClearButton(e)&&this._clear()}}])&&Un(t.prototype,n),r&&Un(t,r),o}(function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&en(e,t)}(o,e);var t,n,r,i=tn(o);function o(){return Jt(this,o),i.apply(this,arguments)}return t=o,n=[{key:"_dataProviderClearFilter",value:function(e,t,n){!e||this.loading||!this.filter||t&&this.autoOpenDisabled&&n===this.filter||(this.size=void 0,this._pendingRequests={},this.filter="",this.clearCache())}},{key:"ready",value:function(){var e=this;Zt(rn(o.prototype),"ready",this).call(this),this.clearCache(),this.$.dropdown.addEventListener("index-requested",(function(t){var n=t.detail.index,r=t.detail.currentScrollerPos,i=Math.floor(1.5*e.pageSize);if(!e._shouldSkipIndex(n,i,r)&&void 0!==n){var o=e._getPageForIndex(n);e._shouldLoadPage(o)&&e._loadPage(o)}}))}},{key:"_dataProviderFilterChanged",value:function(){this._shouldFetchData()&&(this.size=void 0,this._pendingRequests={},this.clearCache())}},{key:"_shouldFetchData",value:function(){return!!this.dataProvider&&(this.opened||this.filter&&this.filter.length)}},{key:"_ensureFirstPage",value:function(e){e&&this._shouldLoadPage(0)&&this._loadPage(0)}},{key:"_shouldSkipIndex",value:function(e,t,n){return 0!==n&&e>=n-t&&e<=n+t}},{key:"_shouldLoadPage",value:function(e){if(!this.filteredItems||this._forceNextRequest)return this._forceNextRequest=!1,!0;var t=this.filteredItems[e*this.pageSize];return void 0!==t?t instanceof Ot:void 0===this.size}},{key:"_loadPage",value:function(e){var t=this;if(!this._pendingRequests[e]&&this.dataProvider){this.loading=!0;var n={page:e,pageSize:this.pageSize,filter:this.filter},r=function r(i,o){if(t._pendingRequests[e]===r){if(t.filteredItems)t.splice.apply(t,["filteredItems",n.page*n.pageSize,i.length].concat(Xt(i)));else{var a=[];a.splice.apply(a,[n.page*n.pageSize,i.length].concat(Xt(i))),t.filteredItems=a}t._isValidValue(t.value)&&t._getItemValue(t.selectedItem)!==t.value&&t._selectItemForValue(t.value),t.opened||t.hasAttribute("focused")||t._commitValue(),t.size=o,delete t._pendingRequests[e],0===Object.keys(t._pendingRequests).length&&(t.loading=!1)}};this._pendingRequests[e]||(this._pendingRequests[e]=r,this.dataProvider(n,r))}}},{key:"_getPageForIndex",value:function(e){return Math.floor(e/this.pageSize)}},{key:"clearCache",value:function(){if(this.dataProvider){this._pendingRequests={};for(var e=[],t=0;t<(this.size||0);t++)e.push(this.__placeHolder);this.filteredItems=e,this._shouldFetchData()?this._loadPage(0):this._forceNextRequest=!0}}},{key:"_sizeChanged",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(this.filteredItems||[]).slice(0,e),n=0;n 0");this.clearCache()}},{key:"_dataProviderChanged",value:function(e,t){var n=this;this._ensureItemsOrDataProvider((function(){n.dataProvider=t}))}},{key:"_ensureItemsOrDataProvider",value:function(e){if(void 0!==this.items&&void 0!==this.dataProvider)throw e(),new Error("Using `items` and `dataProvider` together is not supported");this.dataProvider&&!this.filteredItems&&(this.filteredItems=[])}},{key:"_warnDataProviderValue",value:function(e,t){if(e&&""!==t&&(void 0===this.selectedItem||null===this.selectedItem)){var n=this._indexOfValue(t,this.filteredItems);(n<0||!this._getItemLabel(this.filteredItems[n]))&&console.warn("Warning: unable to determine the label for the provided `value`. Nothing to display in the text field. This usually happens when setting an initial `value` before any items are returned from the `dataProvider` callback. Consider setting `selectedItem` instead of `value`")}}},{key:"_flushPendingRequests",value:function(e){if(this._pendingRequests)for(var t=Math.ceil(e/this.pageSize),n=Object.keys(this._pendingRequests),r=0;r=t&&this._pendingRequests[i]([],e)}}}],r=[{key:"properties",get:function(){return{pageSize:{type:Number,value:50,observer:"_pageSizeChanged"},size:{type:Number,observer:"_sizeChanged"},dataProvider:{type:Object,observer:"_dataProviderChanged"},_pendingRequests:{value:function(){return{}}},__placeHolder:{value:new Ot}}}},{key:"observers",get:function(){return["_dataProviderFilterChanged(filter, dataProvider)","_dataProviderClearFilter(dataProvider, opened, value)","_warnDataProviderValue(dataProvider, value)","_ensureFirstPage(opened)"]}}],n&&Qt(t.prototype,n),r&&Qt(t,r),o}(e)}((Jn=(0,m.Tb)(L.H3),function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Bn(e,t)}(o,e);var t,n,r,i=Dn(o);function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=i.call(this))._boundOnFocusout=e._onFocusout.bind(Nn(e)),e._boundOverlaySelectedItemChanged=e._overlaySelectedItemChanged.bind(Nn(e)),e._boundOnClearButtonMouseDown=e.__onClearButtonMouseDown.bind(Nn(e)),e._boundClose=e.close.bind(Nn(e)),e._boundOnOpened=e._onOpened.bind(Nn(e)),e._boundOnClick=e._onClick.bind(Nn(e)),e._boundOnOverlayTouchAction=e._onOverlayTouchAction.bind(Nn(e)),e._boundOnTouchend=e._onTouchend.bind(Nn(e)),e}return t=o,n=[{key:"_inputElementValue",get:function(){return this.inputElement?this.inputElement[this._propertyForValue]:void 0},set:function(e){this.inputElement&&(this.inputElement[this._propertyForValue]=e)}},{key:"_inputElementChanged",value:function(e){Ln(Hn(o.prototype),"_inputElementChanged",this).call(this,e),e&&(e.autocomplete="off",e.autocapitalize="off",e.setAttribute("role","combobox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-expanded",!!this.opened),e.setAttribute("spellcheck","false"),e.setAttribute("autocorrect","off"),this._revertInputValueToValue(),this.clearElement&&this.clearElement.addEventListener("mousedown",this._boundOnClearButtonMouseDown))}},{key:"ready",value:function(){var e=this;Ln(Hn(o.prototype),"ready",this).call(this),this.addEventListener("focusout",this._boundOnFocusout),this._lastCommittedValue=this.value,this.$.dropdown.addEventListener("selection-changed",this._boundOverlaySelectedItemChanged),this.addEventListener("vaadin-combo-box-dropdown-closed",this._boundClose),this.addEventListener("vaadin-combo-box-dropdown-opened",this._boundOnOpened),this.addEventListener("click",this._boundOnClick),this.$.dropdown.addEventListener("vaadin-overlay-touch-action",this._boundOnOverlayTouchAction),this.addEventListener("touchend",this._boundOnTouchend);var t,n=function(){requestAnimationFrame((function(){e.$.dropdown.$.overlay.bringToFront()}))};this.addEventListener("mousedown",n),this.addEventListener("touchstart",n),t=this,window.Vaadin&&window.Vaadin.templateRendererCallback?window.Vaadin.templateRendererCallback(t):t.querySelector("template")&&console.warn("WARNING: \n \n ```\n\n ```js\n import {html} from '@polymer/polymer/lib/utils/html-tag.js';\n import '@polymer/iron-flex-layout/iron-flex-layout-classes.js';\n\n const template = html`\n \n \n
\n
horizontal layout center alignment
\n
\n `;\n document.body.appendChild(template.content);\n ```\n\n2. [Custom CSS\nmixins](https://github.com/PolymerElements/iron-flex-layout/blob/master/iron-flex-layout.html).\nThe mixin stylesheet includes custom CSS mixins that can be applied inside a CSS\nrule using the `@apply` function.\n\nPlease note that the old [/deep/ layout\nclasses](https://github.com/PolymerElements/iron-flex-layout/tree/master/classes)\nare deprecated, and should not be used. To continue using layout properties\ndirectly in markup, please switch to using the new `dom-module`-based\n[layout\nclasses](https://github.com/PolymerElements/iron-flex-layout/tree/master/iron-flex-layout-classes.html).\nPlease note that the new version does not use `/deep/`, and therefore requires\nyou to import the `dom-modules` in every element that needs to use them.\n\n@group Iron Elements\n@pseudoElement iron-flex-layout\n@demo demo/index.html\n*/\nconst template = html`\n\n \n\n\n \n`;\n\ntemplate.setAttribute('style', 'display: none;');\ndocument.head.appendChild(template.content);\n\nvar style = document.createElement('style');\nstyle.textContent = '[hidden] { display: none !important; }';\ndocument.head.appendChild(style);\n","/**\n@license\nCopyright (c) 2015 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at\nhttp://polymer.github.io/LICENSE.txt The complete set of authors may be found at\nhttp://polymer.github.io/AUTHORS.txt The complete set of contributors may be\nfound at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as\npart of the polymer project is also subject to an additional IP rights grant\nfound at http://polymer.github.io/PATENTS.txt\n*/\nimport '@polymer/polymer/polymer-legacy.js';\n\nimport {Polymer} from '@polymer/polymer/lib/legacy/polymer-fn.js';\nimport {html} from '@polymer/polymer/lib/utils/html-tag.js';\n\n/**\n`iron-a11y-announcer` is a singleton element that is intended to add a11y\nto features that require on-demand announcement from screen readers. In\norder to make use of the announcer, it is best to request its availability\nin the announcing element.\n\nExample:\n\n Polymer({\n\n is: 'x-chatty',\n\n attached: function() {\n // This will create the singleton element if it has not\n // been created yet:\n Polymer.IronA11yAnnouncer.requestAvailability();\n }\n });\n\nAfter the `iron-a11y-announcer` has been made available, elements can\nmake announces by firing bubbling `iron-announce` events.\n\nExample:\n\n this.fire('iron-announce', {\n text: 'This is an announcement!'\n }, { bubbles: true });\n\nNote: announcements are only audible if you have a screen reader enabled.\n\n@group Iron Elements\n@demo demo/index.html\n*/\nexport const IronA11yAnnouncer = Polymer({\n _template: html`\n \n
[[_text]]
\n`,\n\n is: 'iron-a11y-announcer',\n\n properties: {\n\n /**\n * The value of mode is used to set the `aria-live` attribute\n * for the element that will be announced. Valid values are: `off`,\n * `polite` and `assertive`.\n */\n mode: {type: String, value: 'polite'},\n\n _text: {type: String, value: ''}\n },\n\n created: function() {\n if (!IronA11yAnnouncer.instance) {\n IronA11yAnnouncer.instance = this;\n }\n\n document.body.addEventListener(\n 'iron-announce', this._onIronAnnounce.bind(this));\n },\n\n /**\n * Cause a text string to be announced by screen readers.\n *\n * @param {string} text The text that should be announced.\n */\n announce: function(text) {\n this._text = '';\n this.async(function() {\n this._text = text;\n }, 100);\n },\n\n _onIronAnnounce: function(event) {\n if (event.detail && event.detail.text) {\n this.announce(event.detail.text);\n }\n }\n});\n\nIronA11yAnnouncer.instance = null;\n\nIronA11yAnnouncer.requestAvailability = function() {\n if (!IronA11yAnnouncer.instance) {\n IronA11yAnnouncer.instance = document.createElement('iron-a11y-announcer');\n }\n\n document.body.appendChild(IronA11yAnnouncer.instance);\n};\n","/**\n@license\nCopyright (c) 2015 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at\nhttp://polymer.github.io/LICENSE.txt The complete set of authors may be found at\nhttp://polymer.github.io/AUTHORS.txt The complete set of contributors may be\nfound at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as\npart of the polymer project is also subject to an additional IP rights grant\nfound at http://polymer.github.io/PATENTS.txt\n*/\nimport '@polymer/polymer/polymer-legacy.js';\n\nimport {IronA11yAnnouncer} from '@polymer/iron-a11y-announcer/iron-a11y-announcer.js';\nimport {IronValidatableBehavior} from '@polymer/iron-validatable-behavior/iron-validatable-behavior.js';\nimport {Polymer} from '@polymer/polymer/lib/legacy/polymer-fn.js';\nimport {dom} from '@polymer/polymer/lib/legacy/polymer.dom.js';\nimport {html} from '@polymer/polymer/lib/utils/html-tag.js';\n\n/**\n`` is a wrapper to a native `` element, that adds two-way\nbinding and prevention of invalid input. To use it, you must distribute a native\n`` yourself. You can continue to use the native `input` as you would\nnormally:\n\n \n \n \n\n \n \n \n\n### Two-way binding\n\nBy default you can only get notified of changes to a native ``'s `value`\ndue to user input:\n\n \n\nThis means that if you imperatively set the value (i.e. `someNativeInput.value =\n'foo'`), no events will be fired and this change cannot be observed.\n\n`iron-input` adds the `bind-value` property that mirrors the native `input`'s\n'`value` property; this property can be used for two-way data binding.\n`bind-value` will notify if it is changed either by user input or by script.\n\n \n \n \n\nNote: this means that if you want to imperatively set the native `input`'s, you\n_must_ set `bind-value` instead, so that the wrapper `iron-input` can be\nnotified.\n\n### Validation\n\n`iron-input` uses the native `input`'s validation. For simplicity, `iron-input`\nhas a `validate()` method (which internally just checks the distributed\n`input`'s validity), which sets an `invalid` attribute that can also be used for\nstyling.\n\nTo validate automatically as you type, you can use the `auto-validate`\nattribute.\n\n`iron-input` also fires an `iron-input-validate` event after `validate()` is\ncalled. You can use it to implement a custom validator:\n\n var CatsOnlyValidator = {\n validate: function(ironInput) {\n var valid = !ironInput.bindValue || ironInput.bindValue === 'cat';\n ironInput.invalid = !valid;\n return valid;\n }\n }\n ironInput.addEventListener('iron-input-validate', function() {\n CatsOnly.validate(input2);\n });\n\nYou can also use an element implementing an\n[`IronValidatorBehavior`](/element/PolymerElements/iron-validatable-behavior).\nThis example can also be found in the demo for this element:\n\n \n \n \n\n### Preventing invalid input\n\nIt may be desirable to only allow users to enter certain characters. You can use\nthe `allowed-pattern` attribute to accomplish this. This feature is separate\nfrom validation, and `allowed-pattern` does not affect how the input is\nvalidated.\n\n // Only allow typing digits, but a valid input has exactly 5 digits.\n \n \n \n\n@demo demo/index.html\n*/\nPolymer({\n _template: html`\n \n \n`,\n\n is: 'iron-input',\n behaviors: [IronValidatableBehavior],\n\n /**\n * Fired whenever `validate()` is called.\n *\n * @event iron-input-validate\n */\n\n properties: {\n\n /**\n * Use this property instead of `value` for two-way data binding, or to\n * set a default value for the input. **Do not** use the distributed\n * input's `value` property to set a default value.\n */\n bindValue: {type: String, value: ''},\n\n /**\n * Computed property that echoes `bindValue` (mostly used for Polymer 1.0\n * backcompatibility, if you were one-way binding to the Polymer 1.0\n * `input is=\"iron-input\"` value attribute).\n */\n value: {type: String, computed: '_computeValue(bindValue)'},\n\n /**\n * Regex-like list of characters allowed as input; all characters not in the\n * list will be rejected. The recommended format should be a list of allowed\n * characters, for example, `[a-zA-Z0-9.+-!;:]`.\n *\n * This pattern represents the allowed characters for the field; as the user\n * inputs text, each individual character will be checked against the\n * pattern (rather than checking the entire value as a whole). If a\n * character is not a match, it will be rejected.\n *\n * Pasted input will have each character checked individually; if any\n * character doesn't match `allowedPattern`, the entire pasted string will\n * be rejected.\n *\n * Note: if you were using `iron-input` in 1.0, you were also required to\n * set `prevent-invalid-input`. This is no longer needed as of Polymer 2.0,\n * and will be set automatically for you if an `allowedPattern` is provided.\n *\n */\n allowedPattern: {type: String},\n\n /**\n * Set to true to auto-validate the input value as you type.\n */\n autoValidate: {type: Boolean, value: false},\n\n /**\n * The native input element.\n */\n _inputElement: Object,\n },\n\n observers: ['_bindValueChanged(bindValue, _inputElement)'],\n listeners: {'input': '_onInput', 'keypress': '_onKeypress'},\n\n created: function() {\n IronA11yAnnouncer.requestAvailability();\n this._previousValidInput = '';\n this._patternAlreadyChecked = false;\n },\n\n attached: function() {\n // If the input is added at a later time, update the internal reference.\n this._observer = dom(this).observeNodes(function(info) {\n this._initSlottedInput();\n }.bind(this));\n },\n\n detached: function() {\n if (this._observer) {\n dom(this).unobserveNodes(this._observer);\n this._observer = null;\n }\n },\n\n /**\n * Returns the distributed input element.\n */\n get inputElement() {\n return this._inputElement;\n },\n\n _initSlottedInput: function() {\n this._inputElement = this.getEffectiveChildren()[0];\n\n if (this.inputElement && this.inputElement.value) {\n this.bindValue = this.inputElement.value;\n }\n\n this.fire('iron-input-ready');\n },\n\n get _patternRegExp() {\n var pattern;\n if (this.allowedPattern) {\n pattern = new RegExp(this.allowedPattern);\n } else {\n switch (this.inputElement.type) {\n case 'number':\n pattern = /[0-9.,e-]/;\n break;\n }\n }\n return pattern;\n },\n\n /**\n * @suppress {checkTypes}\n */\n _bindValueChanged: function(bindValue, inputElement) {\n // The observer could have run before attached() when we have actually\n // initialized this property.\n if (!inputElement) {\n return;\n }\n\n if (bindValue === undefined) {\n inputElement.value = null;\n } else if (bindValue !== inputElement.value) {\n this.inputElement.value = bindValue;\n }\n\n if (this.autoValidate) {\n this.validate();\n }\n\n // manually notify because we don't want to notify until after setting value\n this.fire('bind-value-changed', {value: bindValue});\n },\n\n _onInput: function() {\n // Need to validate each of the characters pasted if they haven't\n // been validated inside `_onKeypress` already.\n if (this.allowedPattern && !this._patternAlreadyChecked) {\n var valid = this._checkPatternValidity();\n if (!valid) {\n this._announceInvalidCharacter(\n 'Invalid string of characters not entered.');\n this.inputElement.value = this._previousValidInput;\n }\n }\n this.bindValue = this._previousValidInput = this.inputElement.value;\n this._patternAlreadyChecked = false;\n },\n\n _isPrintable: function(event) {\n // What a control/printable character is varies wildly based on the browser.\n // - most control characters (arrows, backspace) do not send a `keypress`\n // event\n // in Chrome, but the *do* on Firefox\n // - in Firefox, when they do send a `keypress` event, control chars have\n // a charCode = 0, keyCode = xx (for ex. 40 for down arrow)\n // - printable characters always send a keypress event.\n // - in Firefox, printable chars always have a keyCode = 0. In Chrome, the\n // keyCode\n // always matches the charCode.\n // None of this makes any sense.\n\n // For these keys, ASCII code == browser keycode.\n var anyNonPrintable = (event.keyCode == 8) || // backspace\n (event.keyCode == 9) || // tab\n (event.keyCode == 13) || // enter\n (event.keyCode == 27); // escape\n\n // For these keys, make sure it's a browser keycode and not an ASCII code.\n var mozNonPrintable = (event.keyCode == 19) || // pause\n (event.keyCode == 20) || // caps lock\n (event.keyCode == 45) || // insert\n (event.keyCode == 46) || // delete\n (event.keyCode == 144) || // num lock\n (event.keyCode == 145) || // scroll lock\n (event.keyCode > 32 &&\n event.keyCode < 41) || // page up/down, end, home, arrows\n (event.keyCode > 111 && event.keyCode < 124); // fn keys\n\n return !anyNonPrintable && !(event.charCode == 0 && mozNonPrintable);\n },\n\n _onKeypress: function(event) {\n if (!this.allowedPattern && this.inputElement.type !== 'number') {\n return;\n }\n var regexp = this._patternRegExp;\n if (!regexp) {\n return;\n }\n\n // Handle special keys and backspace\n if (event.metaKey || event.ctrlKey || event.altKey) {\n return;\n }\n\n // Check the pattern either here or in `_onInput`, but not in both.\n this._patternAlreadyChecked = true;\n\n var thisChar = String.fromCharCode(event.charCode);\n if (this._isPrintable(event) && !regexp.test(thisChar)) {\n event.preventDefault();\n this._announceInvalidCharacter(\n 'Invalid character ' + thisChar + ' not entered.');\n }\n },\n\n _checkPatternValidity: function() {\n var regexp = this._patternRegExp;\n if (!regexp) {\n return true;\n }\n for (var i = 0; i < this.inputElement.value.length; i++) {\n if (!regexp.test(this.inputElement.value[i])) {\n return false;\n }\n }\n return true;\n },\n\n /**\n * Returns true if `value` is valid. The validator provided in `validator`\n * will be used first, then any constraints.\n * @return {boolean} True if the value is valid.\n */\n validate: function() {\n if (!this.inputElement) {\n this.invalid = false;\n return true;\n }\n\n // Use the nested input's native validity.\n var valid = this.inputElement.checkValidity();\n\n // Only do extra checking if the browser thought this was valid.\n if (valid) {\n // Empty, required input is invalid\n if (this.required && this.bindValue === '') {\n valid = false;\n } else if (this.hasValidator()) {\n valid = IronValidatableBehavior.validate.call(this, this.bindValue);\n }\n }\n\n this.invalid = !valid;\n this.fire('iron-input-validate');\n return valid;\n },\n\n _announceInvalidCharacter: function(message) {\n this.fire('iron-announce', {text: message});\n },\n\n _computeValue: function(bindValue) {\n return bindValue;\n }\n});\n","/**\n@license\nCopyright (c) 2015 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at\nhttp://polymer.github.io/LICENSE.txt The complete set of authors may be found at\nhttp://polymer.github.io/AUTHORS.txt The complete set of contributors may be\nfound at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as\npart of the polymer project is also subject to an additional IP rights grant\nfound at http://polymer.github.io/PATENTS.txt\n*/\nimport '@polymer/polymer/polymer-legacy.js';\nimport '@polymer/iron-flex-layout/iron-flex-layout.js';\nimport '@polymer/paper-styles/default-theme.js';\nimport '@polymer/paper-styles/typography.js';\n\nimport {Polymer} from '@polymer/polymer/lib/legacy/polymer-fn.js';\nimport {dom} from '@polymer/polymer/lib/legacy/polymer.dom.js';\nimport {dashToCamelCase} from '@polymer/polymer/lib/utils/case-map.js';\nimport {html} from '@polymer/polymer/lib/utils/html-tag.js';\nconst template = html`\n\n \n\n`;\ntemplate.setAttribute('style', 'display: none;');\ndocument.head.appendChild(template.content);\n\n/*\n`` is a container for a `