\n "," | \n \n '," "]);return wo=function(){return e},e}function ko(){var e=_o(["\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 "]);return ko=function(){return e},e}function Eo(){var e=_o([""]);return Eo=function(){return e},e}function _o(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 xo(e,t){return(xo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Bo(e);if(t){var i=Bo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return So(this,r)}}function So(e,t){return!t||"object"!==mo(t)&&"function"!=typeof t?Co(e):t}function Co(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Do(){Do=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(!zo(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);rt.container?1:-1}))}},{kind:"method",key:"_configChanged",value:(o=bo(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 o.apply(this,arguments)})},{kind:"method",key:"_resetTapped",value:(n=bo(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,l.d3)(this.hass,this.addon.slug,n);case 6:if(o={success:!0,response:void 0,path:"option"},(0,a.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,y(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,u.js)(e.t0));case 16:r.progress=!1;case 17:case"end":return e.stop()}}),e,this,[[3,13]])}))),function(e){return n.apply(this,arguments)})},{kind:"method",key:"_saveTapped",value:(r=bo(regeneratorRuntime.mark((function e(t){var r,n,i,o,s;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,l.d3)(this.hass,this.addon.slug,i);case 9:if(s={success:!0,response:void 0,path:"option"},(0,a.B)(this,"hass-api-called",s),"started"!==(null===(o=this.addon)||void 0===o?void 0:o.state)){e.next=14;break}return e.next=14,y(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,u.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[d.Qx,f.l,(0,i.iv)(yo())]}}]}}),i.oi);var Uo=r(18199);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})(e)}function No(){var e=Ko(["\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 "]);return No=function(){return e},e}function Lo(){var e=Ko(["\n \n "]);return Lo=function(){return e},e}function Vo(){var e=Ko(["\n \n "]);return Vo=function(){return e},e}function qo(){var e=Ko(["\n \n "]);return qo=function(){return e},e}function Ho(){var e=Ko(["\n ","\n ","\n ","\n "]);return Ho=function(){return e},e}function Qo(){var e=Ko(['\n \n ',"\n \n "]);return Qo=function(){return e},e}function Yo(){var e=Ko([""]);return Yo=function(){return e},e}function Ko(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Wo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xo(e,t){return(Xo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Zo(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ea(e);if(t){var i=ea(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Go(this,r)}}function Go(e,t){return!t||"object"!==$o(t)&&"function"!=typeof t?Jo(e):t}function Jo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ea(e){return(ea=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ta(){ta=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(!ia(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"]);return da=function(){return e},e}function fa(){var e=ya([""]);return fa=function(){return e},e}function pa(){var e=ya([' '," "]);return pa=function(){return e},e}function ha(){var e=ya(['\n \n \n ','\n \n ',"\n \n \n \n "]);return ha=function(){return e},e}function ma(){var e=ya([""]);return ma=function(){return e},e}function ya(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function va(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 ba(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){va(o,n,i,a,s,"next",e)}function s(e){va(o,n,i,a,s,"throw",e)}a(void 0)}))}}function ga(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wa(e,t){return(wa=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ka(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ta(e);if(t){var i=Ta(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ea(this,r)}}function Ea(e,t){return!t||"object"!==la(t)&&"function"!=typeof t?_a(e):t}function _a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Pa(){Pa=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(!Sa(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 ']);return Ba=function(){return e},e}function Ua(e,t){for(var r=0;r bit more top margin */\n font-weight: 500;\n overflow: hidden;\n text-transform: uppercase;\n text-overflow: ellipsis;\n transition: background-color 0.3s ease-in-out;\n text-transform: var(--ha-label-badge-label-text-transform, uppercase);\n }\n .label-badge .label.big span {\n font-size: 90%;\n padding: 10% 12% 7% 12%; /* push smaller text a bit down to center vertically */\n }\n .badge-container .title {\n margin-top: 1em;\n font-size: var(--ha-label-badge-title-font-size, 0.9em);\n width: var(--ha-label-badge-title-width, 5em);\n font-weight: var(--ha-label-badge-title-font-weight, 400);\n overflow: hidden;\n text-overflow: ellipsis;\n line-height: normal;\n }\n "]);return Ya=function(){return e},e}function Ka(){var e=Ja([' '," "]);return Ka=function(){return e},e}function Wa(){var e=Ja(['\n \n ',"\n \n "]);return Wa=function(){return e},e}function Xa(){var e=Ja([" "," "]);return Xa=function(){return e},e}function Za(){var e=Ja([" "]);return Za=function(){return e},e}function Ga(){var e=Ja(['\n \n \n \n \n ',"\n ","\n \n \n ","\n \n ","\n \n "]);return Ga=function(){return e},e}function Ja(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function es(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ts(e,t){return(ts=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function rs(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=hs(e);if(t){var i=hs(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ns(this,r)}}function ns(e,t){return!t||"object"!==Qa(t)&&"function"!=typeof t?is(e):t}function is(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function os(){os=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(!cs(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);r4)}),!this.icon||this.value||this.image?"":(0,i.dy)(Za(),this.icon),this.value&&!this.image?(0,i.dy)(Xa(),this.value):"",this.label?(0,i.dy)(Wa(),(0,Ra.$)({label:!0,big:this.label.length>5}),this.label):"",this.description?(0,i.dy)(Ka(),this.description):"")}},{kind:"get",static:!0,key:"styles",value:function(){return[(0,i.iv)(Ya())]}},{kind:"method",key:"updated",value:function(e){ps(hs(r.prototype),"updated",this).call(this,e),e.has("image")&&(this.shadowRoot.getElementById("badge").style.backgroundImage=this.image?"url(".concat(this.image,")"):"")}}]}}),i.oi);customElements.define("ha-label-badge",ms);r(14089);var ys=r(70203),vs=(r(79603),r(21050),r(66903)),bs=r(7628),gs=(0,o.Z)((function(e,t){return t.some((function(t){return e.includes(t)}))}));function ws(e){return(ws="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})(e)}function ks(){var e=fc(['\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-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(--paper-green-400);\n }\n ha-svg-icon.stopped {\n color: var(--google-red-300);\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 .red {\n --ha-label-badge-color: var(--label-badge-red, #df4c1e);\n }\n .blue {\n --ha-label-badge-color: var(--label-badge-blue, #039be5);\n }\n .green {\n --ha-label-badge-color: var(--label-badge-green, #0da035);\n }\n .yellow {\n --ha-label-badge-color: var(--label-badge-yellow, #f4b400);\n }\n .security {\n margin-bottom: 16px;\n }\n .card-actions {\n justify-content: space-between;\n display: flex;\n }\n .security h3 {\n margin-bottom: 8px;\n font-weight: normal;\n }\n .security ha-label-badge {\n cursor: pointer;\n margin-right: 4px;\n --ha-label-badge-padding: 8px 0 0 0;\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 @media (max-width: 720px) {\n .addon-options {\n max-width: 100%;\n }\n .addon-container {\n display: block;\n }\n }\n ']);return ks=function(){return e},e}function Es(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 _s(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){Es(o,n,i,a,s,"next",e)}function s(e){Es(o,n,i,a,s,"throw",e)}a(void 0)}))}}function Ps(){var e=fc(['\n \n \n \n ',"\n \n "]);return xs=function(){return e},e}function Os(){var e=fc(["\n \n ","\n \n "]);return Os=function(){return e},e}function Ss(){var e=fc(["\n \n \n ',"\n \n \n "]);return Ss=function(){return e},e}function Cs(){var e=fc([" ","\n ",'\n \n ","\n \n ",""]);return Cs=function(){return e},e}function Ds(){var e=fc(["\n \n ","\n \n "]);return Ds=function(){return e},e}function js(){var e=fc(["\n \n ","\n \n "]);return js=function(){return e},e}function As(){var e=fc(['\n \n ",'\n \n \n ","\n \n "]);return As=function(){return e},e}function zs(){var e=fc(['\n \n ',"\n \n "]);return zs=function(){return e},e}function Ts(){var e=fc(['\n \n ',"\n \n "]);return Ts=function(){return e},e}function Rs(){var e=fc([' '," "]);return Rs=function(){return e},e}function Fs(){var e=fc(["\n \n "]);return Fs=function(){return e},e}function Is(){var e=fc(["\n \n ','\n \n \n ',"\n \n \n ",""]);return Is=function(){return e},e}function Ms(){var e=fc(["\n \n \n ','\n \n \n ',"\n \n \n \n "]);return Ms=function(){return e},e}function Bs(){var e=fc(["\n \n \n ','\n \n \n ',"\n \n \n \n "]);return Bs=function(){return e},e}function Us(){var e=fc(["\n \n \n ','\n \n \n ',"\n \n \n \n "]);return Us=function(){return e},e}function $s(){var e=fc(["\n \n \n ','\n \n \n ',"\n \n \n \n "]);return $s=function(){return e},e}function Ns(){var e=fc(['\n \n \n \n ','\n \n \n ',"\n \n \n \n\n ","\n ","\n ","\n ","\n \n "]);return Ns=function(){return e},e}function Ls(){var e=fc(["\n \n \n \n \n \n \n \n \n \n \n ']);return Gs=function(){return e},e}function Js(){var e=fc(['\n ',"\n "]);return Js=function(){return e},e}function ec(){var e=fc(['\n ","\n "]);return ec=function(){return e},e}function tc(){var e=fc(["\n Current version: ",'\n \n (\n '," )\n \n "]);return tc=function(){return e},e}function rc(){var e=fc([" "," "]);return rc=function(){return e},e}function nc(){var e=fc(["\n \n \n \n ','\n \n \n \n ","\n \n \n \n \n "]);return ac=function(){return e},e}function sc(){var e=fc(["\n \n ","\n \n "]);return sc=function(){return e},e}function cc(){var e=fc(['\n \n ',"\n \n "]);return cc=function(){return e},e}function lc(){var e=fc(['\n \n ',"\n \n "]);return lc=function(){return e},e}function uc(){var e=fc(['\n \n \n \n ','\n \n \n \n ","\n \n ","\n \n \n "]);return uc=function(){return e},e}function dc(){var e=fc(["\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 \n \n ","\n \n \n \n\n ","\n "]);return dc=function(){return e},e}function fc(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function pc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hc(e,t){return(hc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function mc(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 Date.prototype.toString.call(Reflect.construct(Date,[],(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 yc(this,r)}}function yc(e,t){return!t||"object"!==ws(t)&&"function"!=typeof t?vc(e):t}function vc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bc(){bc=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(!kc(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'),"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,s.c)(this,"/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,Fa.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:(P=_s(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,l.d3)(this.hass,this.addon.slug,t);case 5:r={success:!0,response:void 0,path:"option"},(0,a.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,u.js)(e.t0));case 12:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(){return P.apply(this,arguments)})},{kind:"method",key:"_watchdogToggled",value:(_=_s(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,l.d3)(this.hass,this.addon.slug,t);case 5:r={success:!0,response:void 0,path:"option"},(0,a.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,u.js)(e.t0));case 12:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(){return _.apply(this,arguments)})},{kind:"method",key:"_autoUpdateToggled",value:(E=_s(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,l.d3)(this.hass,this.addon.slug,t);case 5:r={success:!0,response:void 0,path:"option"},(0,a.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,u.js)(e.t0));case 12:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(){return E.apply(this,arguments)})},{kind:"method",key:"_protectionToggled",value:(k=_s(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,l.NI)(this.hass,this.addon.slug,t);case 5:r={success:!0,response:void 0,path:"security"},(0,a.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,u.js)(e.t0));case 12:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(){return k.apply(this,arguments)})},{kind:"method",key:"_panelToggled",value:(w=_s(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,l.d3)(this.hass,this.addon.slug,t);case 5:r={success:!0,response:void 0,path:"option"},(0,a.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,u.js)(e.t0));case 12:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(){return w.apply(this,arguments)})},{kind:"method",key:"_openChangelog",value:(g=_s(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,l.CH)(this.hass,this.addon.slug);case 3:t=e.sent,(0,vs.v)(this,{title:this.supervisor.localize("addon.dashboard.changelog"),content:t}),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),(0,h.Ys)(this,{title:this.supervisor.localize("addon.dashboard.action_error.get_changelog"),text:(0,u.js)(e.t0)});case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(){return g.apply(this,arguments)})},{kind:"method",key:"_installClicked",value:(b=_s(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,l.fU)(this.hass,this.addon.slug);case 5:n={success:!0,response:void 0,path:"install"},(0,a.B)(this,"hass-api-called",n),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),(0,h.Ys)(this,{title:this.supervisor.localize("addon.dashboard.action_error.install"),text:(0,u.js)(e.t0)});case 12:r.progress=!1;case 13:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(e){return b.apply(this,arguments)})},{kind:"method",key:"_stopClicked",value:(v=_s(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,l.ow)(this.hass,this.addon.slug);case 5:n={success:!0,response:void 0,path:"stop"},(0,a.B)(this,"hass-api-called",n),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),(0,h.Ys)(this,{title:this.supervisor.localize("addon.dashboard.action_error.stop"),text:(0,u.js)(e.t0)});case 12:r.progress=!1;case 13:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(e){return v.apply(this,arguments)})},{kind:"method",key:"_restartClicked",value:(y=_s(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,l.P$)(this.hass,this.addon.slug);case 5:n={success:!0,response:void 0,path:"stop"},(0,a.B)(this,"hass-api-called",n),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),(0,h.Ys)(this,{title:this.supervisor.localize("addon.dashboard.action_error.restart"),text:(0,u.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:"_updateClicked",value:(m=_s(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(0,bs.z)(this,{supervisor:this.supervisor,name:this.addon.name,version:this.addon.version_latest,snapshotParams:{name:"addon_".concat(this.addon.slug,"_").concat(this.addon.version),addons:[this.addon.slug],homeassistant:!1},updateHandler:function(){var e=_s(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t._updateAddon();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()});case 1:case"end":return e.stop()}}),e,this)}))),function(){return m.apply(this,arguments)})},{kind:"method",key:"_updateAddon",value:(p=_s(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,l.V_)(this.hass,this.addon.slug);case 2:(0,a.B)(this,"supervisor-colllection-refresh",{colllection:"addon"}),t={success:!0,response:void 0,path:"update"},(0,a.B)(this,"hass-api-called",t);case 5:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{kind:"method",key:"_startClicked",value:(c=_s(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,l.su)(this.hass,this.addon.slug);case 5:if((n=e.sent).valid){e.next=11;break}return e.next=9,(0,h.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,h.Ys)(this,{title:"Failed to validate addon configuration",text:(0,u.js)(e.t0)}),r.progress=!1,e.abrupt("return");case 18:return e.prev=18,e.next=21,(0,l.kP)(this.hass,this.addon.slug);case 21:return e.next=23,(0,l.AD)(this.hass,this.addon.slug);case 23:this.addon=e.sent,i={success:!0,response:void 0,path:"start"},(0,a.B)(this,"hass-api-called",i),e.next=31;break;case 28:e.prev=28,e.t1=e.catch(18),(0,h.Ys)(this,{title:this.supervisor.localize("addon.dashboard.action_error.start"),text:(0,u.js)(e.t1)});case 31:r.progress=!1;case 32:case"end":return e.stop()}}),e,this,[[2,13],[18,28]])}))),function(e){return c.apply(this,arguments)})},{kind:"method",key:"_openConfiguration",value:function(){(0,s.c)(this,"/hassio/addon/".concat(this.addon.slug,"/config"))}},{kind:"method",key:"_uninstallClicked",value:(r=_s(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,h.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,l.Yn)(this.hass,this.addon.slug);case 12:n={success:!0,response:void 0,path:"uninstall"},(0,a.B)(this,"hass-api-called",n),e.next=19;break;case 16:e.prev=16,e.t0=e.catch(9),(0,h.Ys)(this,{title:this.supervisor.localize("addon.dashboard.action_error.uninstall"),text:(0,u.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[d.Qx,f.l,(0,i.iv)(ks())]}}]}}),i.oi);function Dc(e){return(Dc="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})(e)}function jc(){var e=Tc(["\n .content {\n margin: auto;\n padding: 8px;\n max-width: 1024px;\n }\n "]);return jc=function(){return e},e}function Ac(){var e=Tc(['\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"]);return Xc=function(){return e},e}function Zc(){var e=Jc([' '," "]);return Zc=function(){return e},e}function Gc(){var e=Jc(["\n ","\n \n ",'\n \n ','\n \n \n \n ","\n \n \n \n "]);return Gc=function(){return e},e}function Jc(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function el(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 tl(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){el(o,n,i,a,s,"next",e)}function s(e){el(o,n,i,a,s,"throw",e)}a(void 0)}))}}function rl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nl(e,t){return(nl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function il(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=yl(e);if(t){var i=yl(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ol(this,r)}}function ol(e,t){return!t||"object"!==Kc(t)&&"function"!=typeof t?al(e):t}function al(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sl(){sl=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(!ul(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=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 "]);return tu=function(){return e},e}function ru(){var e=iu([""]);return ru=function(){return e},e}function nu(){var e=iu([""]);return nu=function(){return e},e}function iu(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ou(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function au(e,t){return(au=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function su(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=uu(e);if(t){var i=uu(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return cu(this,r)}}function cu(e,t){return!t||"object"!==Zl(t)&&"function"!=typeof t?lu(e):t}function lu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function uu(e){return(uu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function du(){du=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(!hu(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);re.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:o}}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,c=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}(new URLSearchParams(location.search).entries());try{for(r.s();!(e=r.n()).done;){var o=n(e.value,2),a=o[0],s=o[1];t[a]=s}}catch(c){r.e(c)}finally{r.f()}return t},s=function(e){return new URLSearchParams(window.location.search).get(e)},c=function(e){var t=new URLSearchParams;return Object.entries(e).forEach((function(e){var r=n(e,2),i=r[0],o=r[1];t.append(i,o)})),t.toString()}}}]);
-//# sourceMappingURL=chunk.590407cbed5b18fe66b5.js.map
\ No newline at end of file
+(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[80],{6080:function(e,t,r){"use strict";r.r(t);var n=r(55317),i=r(99722),o=r(14516),a=r(47181),s=r(83849),c=r(15493),l=(r(35602),r(34154)),u=r(41682),d=(r(48811),r(21625),r(50054),r(11654)),f=r(55677),p=(r(30573),r(34178),r(53973),r(51095),r(61740),r(98762),r(22098),r(20258)),h=r(26765);function m(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 y=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,h.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,l.P$)(r,i.slug);case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(4),(0,h.Ys)(t,{title:n.localize("common.failed_to_restart_name","name",i.name),text:(0,u.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){m(o,n,i,a,s,"next",e)}function s(e){m(o,n,i,a,s,"throw",e)}a(void 0)}))});return function(e,r,n,i){return t.apply(this,arguments)}}();function v(e){return(v="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})(e)}function b(e){return function(e){if(Array.isArray(e))return $(e)}(e)||N(e)||U(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 g(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 w(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){g(o,n,i,a,s,"next",e)}function s(e){g(o,n,i,a,s,"throw",e)}a(void 0)}))}}function k(){var e=O(["\n :host,\n ha-card,\n paper-dropdown-menu {\n display: block;\n }\n .errors {\n color: var(--error-color);\n margin-bottom: 16px;\n }\n paper-item {\n width: 450px;\n }\n .card-actions {\n text-align: right;\n }\n "]);return k=function(){return e},e}function E(){var e=O(["\n ","\n "]);return E=function(){return e},e}function _(){var e=O(["\n \n ","\n \n "]);return _=function(){return e},e}function P(){var e=O([' '," "]);return P=function(){return e},e}function x(){var e=O(["\n \n ',"\n\n \n \n \n \n \n \n \n ","\n \n \n \n "]);return x=function(){return e},e}function O(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function S(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})(e,t)}function D(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 Date.prototype.toString.call(Reflect.construct(Date,[],(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 j(this,r)}}function j(e,t){return!t||"object"!==v(t)&&"function"!=typeof t?A(e):t}function A(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function z(){z=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);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n ","\n \n "]);return X=function(){return e},e}function Z(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 J(e,t){return(J=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ee(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ne(e);if(t){var i=ne(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return te(this,r)}}function te(e,t){return!t||"object"!==K(t)&&"function"!=typeof t?re(e):t}function re(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ne(e){return(ne=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ie(){ie=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(!se(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',": ",""]);return he=function(){return e},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})(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 Date.prototype.toString.call(Reflect.construct(Date,[],(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){return!t||"object"!==fe(t)&&"function"!=typeof t?we(e):t}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 ',"\n \n "]);return ze=function(){return e},e}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})(e,t)}function Fe(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 Date.prototype.toString.call(Reflect.construct(Date,[],(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 Ie(this,r)}}function Ie(e,t){return!t||"object"!==Ae(t)&&"function"!=typeof t?Me(e):t}function Me(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)})(e)}function Ue(){Ue=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 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 .slider-knob > .slider-knob-inner::after {\n -webkit-transform: scale(1) translate(0, -17px) scaleX(-1) !important;\n transform: scale(1) translate(0, -17px) scaleX(-1) !important;\n }\n\n .pin > .slider-knob > .slider-knob-inner {\n font-size: var(--ha-slider-pin-font-size, 10px);\n line-height: normal;\n cursor: pointer;\n }\n\n .disabled.ring > .slider-knob > .slider-knob-inner {\n background-color: var(--paper-slider-disabled-knob-color, var(--paper-grey-400));\n border: 2px solid var(--paper-slider-disabled-knob-color, var(--paper-grey-400));\n }\n\n .pin > .slider-knob > .slider-knob-inner::before {\n top: unset;\n margin-left: unset;\n\n bottom: calc(15px + var(--calculated-paper-slider-height)/2);\n left: 50%;\n width: 2.2em;\n height: 2.2em;\n\n -webkit-transform-origin: left bottom;\n transform-origin: left bottom;\n -webkit-transform: rotate(-45deg) scale(0) translate(0);\n transform: rotate(-45deg) scale(0) translate(0);\n }\n\n .pin.expand > .slider-knob > .slider-knob-inner::before {\n -webkit-transform: rotate(-45deg) scale(1) translate(7px, -7px);\n transform: rotate(-45deg) scale(1) translate(7px, -7px);\n }\n\n .pin > .slider-knob > .slider-knob-inner::after {\n top: unset;\n font-size: unset;\n\n bottom: calc(15px + var(--calculated-paper-slider-height)/2);\n left: 50%;\n margin-left: -1.1em;\n width: 2.2em;\n height: 2.1em;\n\n -webkit-transform-origin: center bottom;\n transform-origin: center bottom;\n -webkit-transform: scale(0) translate(0);\n transform: scale(0) translate(0);\n }\n\n .pin.expand > .slider-knob > .slider-knob-inner::after {\n -webkit-transform: scale(1) translate(0, -10px);\n transform: scale(1) translate(0, -10px);\n }\n\n .slider-input {\n width: 54px;\n }\n ')),tt}}],(r=[{key:"_setImmediateValue",value:function(e){Xe(et(o.prototype),"_setImmediateValue",this).call(this,this.step>=1?Math.round(e):Math.round(100*e)/100)}},{key:"_calcStep",value:function(e){if(!this.step)return parseFloat(e);var t=Math.round((e-this.min)/this.step),r=this.step.toString(),n=r.indexOf(".");if(-1!==n){var i=Math.pow(10,r.length-n-1);return Math.round((t*this.step+this.min)*i)/i}return t*this.step+this.min}}])&&We(t.prototype,r),n&&We(t,n),o}(rt);function it(e){return(it="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})(e)}function ot(){var e=lt(["\n .flex {\n display: flex;\n }\n ha-slider {\n width: 100%;\n margin-right: 16px;\n }\n "]);return ot=function(){return e},e}function at(){var e=lt(['\n \n ',"\n \n \n \n "]);return ct=function(){return e},e}function lt(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ut(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dt(e,t){return(dt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ft(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=mt(e);if(t){var i=mt(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return pt(this,r)}}function pt(e,t){return!t||"object"!==it(t)&&"function"!=typeof t?ht(e):t}function ht(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mt(e){return(mt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function yt(){yt=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(!gt(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 "]);return Ot=function(){return e},e}function St(){var e=Ct(['\n \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 :host {\n display: block;\n @apply --paper-font-common-base;\n }\n\n paper-input {\n width: 30px;\n text-align: center;\n --paper-input-container-input: {\n /* Damn you firefox\n * Needed to hide spin num in firefox\n * http://stackoverflow.com/questions/3790935/can-i-hide-the-html5-number-input-s-spin-box\n */\n -moz-appearance: textfield;\n @apply --paper-time-input-cotnainer;\n }\n --paper-input-container-input-webkit-spinner: {\n -webkit-appearance: none;\n margin: 0;\n display: none;\n }\n --paper-input-container-shared-input-style_-_-webkit-appearance: textfield;\n }\n\n paper-dropdown-menu {\n width: 55px;\n padding: 0;\n /* Force ripple to use the whole container */\n --paper-dropdown-menu-ripple: {\n color: var(\n --paper-time-input-dropdown-ripple-color,\n var(--primary-color)\n );\n }\n --paper-input-container-input: {\n @apply --paper-font-button;\n text-align: center;\n padding-left: 5px;\n @apply --paper-time-dropdown-input-cotnainer;\n }\n --paper-input-container-underline: {\n border-color: transparent;\n }\n --paper-input-container-underline-focus: {\n border-color: transparent;\n }\n }\n\n paper-item {\n cursor: pointer;\n text-align: center;\n font-size: 14px;\n }\n\n paper-listbox {\n padding: 0;\n }\n\n label {\n @apply --paper-font-caption;\n color: var(\n --paper-input-container-color,\n var(--secondary-text-color)\n );\n }\n\n .time-input-wrap {\n @apply --layout-horizontal;\n @apply --layout-no-wrap;\n justify-content: var(--paper-time-input-justify-content, normal);\n }\n\n [hidden] {\n display: none !important;\n }\n\n #millisec {\n width: 38px;\n }\n \n\n \n \n ']);return Ht=function(){return e},e}function Qt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yt(e,t){for(var r=0;r\n ']);return tr=function(){return e},e}function rr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nr(e,t){return(nr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ir(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=sr(e);if(t){var i=sr(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return or(this,r)}}function or(e,t){return!t||"object"!==Jt(t)&&"function"!=typeof t?ar(e):t}function ar(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sr(e){return(sr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function cr(){cr=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(!dr(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);r59&&(i+=Math.floor(r/60),r%=60),"minutes"===t&&r>59&&(n+=Math.floor(r/60),r%=60),(0,a.B)(this,"value-changed",{value:Object.assign({hours:n,minutes:i,seconds:this._seconds,milliseconds:this._milliseconds},er({},t,r))})}}}]}}),i.oi);function yr(e){return(yr="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})(e)}function vr(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n \n "]);return vr=function(){return e},e}function br(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gr(e,t){return(gr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function wr(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=_r(e);if(t){var i=_r(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return kr(this,r)}}function kr(e,t){return!t||"object"!==yr(t)&&"function"!=typeof t?Er(e):t}function Er(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _r(e){return(_r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Pr(){Pr=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(!Sr(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 "]);return Vr=function(){return e},e}function qr(){var e=Hr(["\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 "]);return ln=function(){return e},e}function un(){var e=dn(["\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 "]);return Cn=function(){return e},e}function Dn(){var e=Tn(["\n ","\n ","\n "]);return Dn=function(){return e},e}function jn(){var e=Tn(["\n \n "]);return jn=function(){return e},e}function An(){var e=Tn(['\n \n ',"\n \n "]);return An=function(){return e},e}function zn(){var e=Tn(["\n ","\n ","\n "]);return zn=function(){return e},e}function Tn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}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})(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 Date.prototype.toString.call(Reflect.construct(Date,[],(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 Mn(this,r)}}function Mn(e,t){return!t||"object"!==On(t)&&"function"!=typeof t?Bn(e):t}function Bn(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)})(e)}function $n(){$n=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(!Vn(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 :host(.error-state) div.cm-wrap .cm-gutters {\n border-color: var(--error-state-color, red);\n }\n ",n=document.createElement("span"),r.appendChild(n),this.codemirror=new t.EditorView({state:t.EditorState.create({doc:this._value,extensions:[t.lineNumbers(),t.history(),t.highlightSelectionMatches(),t.keymap.of([].concat(Jn(t.defaultKeymap),Jn(t.searchKeymap),Jn(t.historyKeymap),Jn(t.tabKeyBindings),[ki])),t.tagExtension(gi,this._mode),t.theme,t.Prec.fallback(t.highlightStyle),t.tagExtension(wi,t.EditorView.editable.of(!this.readOnly)),t.EditorView.updateListener.of((function(e){return i._onUpdate(e)}))]}),root:r,parent:n});case 9:case"end":return e.stop()}}),e,this)})),n=function(){var e=this,t=arguments;return new Promise((function(n,i){var o=r.apply(e,t);function a(e){ei(o,n,i,a,s,"next",e)}function s(e){ei(o,n,i,a,s,"throw",e)}a(void 0)}))},function(){return n.apply(this,arguments)})},{kind:"method",key:"_blockKeyboardShortcuts",value:function(){this.addEventListener("keydown",(function(e){return e.stopPropagation()}))}},{kind:"method",key:"_onUpdate",value:function(e){if(e.docChanged){var t=this.value;t!==this._value&&(this._value=t,(0,a.B)(this,"value-changed",{value:this._value}))}}}]}}),i.f4);function Ei(){var e=xi([""," "]);return Ei=function(){return e},e}function _i(){var e=xi(["\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 "]);return Qi=function(){return e},e}function Yi(){var e=Zi([' '," "]);return Yi=function(){return e},e}function Ki(){var e=Zi([" "]);return Ki=function(){return e},e}function Wi(){var e=Zi([""]);return Wi=function(){return e},e}function Xi(){var e=Zi(["\n ",'\n \n \n\n \n ',"\n ","\n ","\n \n ",'\n \n \n Save ","\n \n \n \n "]);return Xi=function(){return e},e}function Zi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Gi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ji(e,t){return(Ji=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function eo(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=po(e);if(t){var i=po(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return to(this,r)}}function to(e,t){return!t||"object"!==Ni(t)&&"function"!=typeof t?ro(e):t}function ro(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function no(){no=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(!ao(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 '," "]);return wo=function(){return e},e}function ko(){var e=_o(["\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 "]);return ko=function(){return e},e}function Eo(){var e=_o([""]);return Eo=function(){return e},e}function _o(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 xo(e,t){return(xo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Bo(e);if(t){var i=Bo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return So(this,r)}}function So(e,t){return!t||"object"!==mo(t)&&"function"!=typeof t?Co(e):t}function Co(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Do(){Do=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(!zo(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);rt.container?1:-1}))}},{kind:"method",key:"_configChanged",value:(o=bo(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 o.apply(this,arguments)})},{kind:"method",key:"_resetTapped",value:(n=bo(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,l.d3)(this.hass,this.addon.slug,n);case 6:if(o={success:!0,response:void 0,path:"option"},(0,a.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,y(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,u.js)(e.t0));case 16:r.progress=!1;case 17:case"end":return e.stop()}}),e,this,[[3,13]])}))),function(e){return n.apply(this,arguments)})},{kind:"method",key:"_saveTapped",value:(r=bo(regeneratorRuntime.mark((function e(t){var r,n,i,o,s;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,l.d3)(this.hass,this.addon.slug,i);case 9:if(s={success:!0,response:void 0,path:"option"},(0,a.B)(this,"hass-api-called",s),"started"!==(null===(o=this.addon)||void 0===o?void 0:o.state)){e.next=14;break}return e.next=14,y(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,u.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[d.Qx,f.l,(0,i.iv)(yo())]}}]}}),i.oi);var Uo=r(18199);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})(e)}function No(){var e=Ko(["\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 "]);return No=function(){return e},e}function Lo(){var e=Ko(["\n \n "]);return Lo=function(){return e},e}function Vo(){var e=Ko(["\n \n "]);return Vo=function(){return e},e}function qo(){var e=Ko(["\n \n "]);return qo=function(){return e},e}function Ho(){var e=Ko(["\n ","\n ","\n ","\n "]);return Ho=function(){return e},e}function Qo(){var e=Ko(['\n \n ',"\n \n "]);return Qo=function(){return e},e}function Yo(){var e=Ko([""]);return Yo=function(){return e},e}function Ko(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Wo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xo(e,t){return(Xo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Zo(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ea(e);if(t){var i=ea(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Go(this,r)}}function Go(e,t){return!t||"object"!==$o(t)&&"function"!=typeof t?Jo(e):t}function Jo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ea(e){return(ea=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ta(){ta=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(!ia(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"]);return da=function(){return e},e}function fa(){var e=ya([""]);return fa=function(){return e},e}function pa(){var e=ya([' '," "]);return pa=function(){return e},e}function ha(){var e=ya(['\n \n \n ','\n \n ',"\n \n \n \n "]);return ha=function(){return e},e}function ma(){var e=ya([""]);return ma=function(){return e},e}function ya(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function va(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 ba(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){va(o,n,i,a,s,"next",e)}function s(e){va(o,n,i,a,s,"throw",e)}a(void 0)}))}}function ga(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wa(e,t){return(wa=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ka(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ta(e);if(t){var i=Ta(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ea(this,r)}}function Ea(e,t){return!t||"object"!==la(t)&&"function"!=typeof t?_a(e):t}function _a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Pa(){Pa=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(!Sa(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 ']);return Ba=function(){return e},e}function Ua(e,t){for(var r=0;r bit more top margin */\n font-weight: 500;\n overflow: hidden;\n text-transform: uppercase;\n text-overflow: ellipsis;\n transition: background-color 0.3s ease-in-out;\n text-transform: var(--ha-label-badge-label-text-transform, uppercase);\n }\n .label-badge .label.big span {\n font-size: 90%;\n padding: 10% 12% 7% 12%; /* push smaller text a bit down to center vertically */\n }\n .badge-container .title {\n margin-top: 1em;\n font-size: var(--ha-label-badge-title-font-size, 0.9em);\n width: var(--ha-label-badge-title-width, 5em);\n font-weight: var(--ha-label-badge-title-font-weight, 400);\n overflow: hidden;\n text-overflow: ellipsis;\n line-height: normal;\n }\n "]);return Ya=function(){return e},e}function Ka(){var e=Ja([' '," "]);return Ka=function(){return e},e}function Wa(){var e=Ja(['\n \n ',"\n \n "]);return Wa=function(){return e},e}function Xa(){var e=Ja([" "," "]);return Xa=function(){return e},e}function Za(){var e=Ja([" "]);return Za=function(){return e},e}function Ga(){var e=Ja(['\n \n \n \n \n ',"\n ","\n \n \n ","\n \n ","\n \n "]);return Ga=function(){return e},e}function Ja(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function es(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ts(e,t){return(ts=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function rs(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=hs(e);if(t){var i=hs(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ns(this,r)}}function ns(e,t){return!t||"object"!==Qa(t)&&"function"!=typeof t?is(e):t}function is(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function os(){os=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(!cs(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);r4)}),!this.icon||this.value||this.image?"":(0,i.dy)(Za(),this.icon),this.value&&!this.image?(0,i.dy)(Xa(),this.value):"",this.label?(0,i.dy)(Wa(),(0,Ra.$)({label:!0,big:this.label.length>5}),this.label):"",this.description?(0,i.dy)(Ka(),this.description):"")}},{kind:"get",static:!0,key:"styles",value:function(){return[(0,i.iv)(Ya())]}},{kind:"method",key:"updated",value:function(e){ps(hs(r.prototype),"updated",this).call(this,e),e.has("image")&&(this.shadowRoot.getElementById("badge").style.backgroundImage=this.image?"url(".concat(this.image,")"):"")}}]}}),i.oi);customElements.define("ha-label-badge",ms);r(14089);var ys=r(70203),vs=(r(79603),r(21050),r(66903)),bs=r(7628),gs=(0,o.Z)((function(e,t){return t.some((function(t){return e.includes(t)}))}));function ws(e){return(ws="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})(e)}function ks(){var e=fc(['\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-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(--paper-green-400);\n }\n ha-svg-icon.stopped {\n color: var(--google-red-300);\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 .red {\n --ha-label-badge-color: var(--label-badge-red, #df4c1e);\n }\n .blue {\n --ha-label-badge-color: var(--label-badge-blue, #039be5);\n }\n .green {\n --ha-label-badge-color: var(--label-badge-green, #0da035);\n }\n .yellow {\n --ha-label-badge-color: var(--label-badge-yellow, #f4b400);\n }\n .security {\n margin-bottom: 16px;\n }\n .card-actions {\n justify-content: space-between;\n display: flex;\n }\n .security h3 {\n margin-bottom: 8px;\n font-weight: normal;\n }\n .security ha-label-badge {\n cursor: pointer;\n margin-right: 4px;\n --ha-label-badge-padding: 8px 0 0 0;\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 @media (max-width: 720px) {\n .addon-options {\n max-width: 100%;\n }\n .addon-container {\n display: block;\n }\n }\n ']);return ks=function(){return e},e}function Es(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 _s(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){Es(o,n,i,a,s,"next",e)}function s(e){Es(o,n,i,a,s,"throw",e)}a(void 0)}))}}function Ps(){var e=fc(['\n \n \n \n ',"\n \n "]);return xs=function(){return e},e}function Os(){var e=fc(["\n \n ","\n \n "]);return Os=function(){return e},e}function Ss(){var e=fc(["\n \n \n ',"\n \n \n "]);return Ss=function(){return e},e}function Cs(){var e=fc([" ","\n ",'\n \n ","\n \n ",""]);return Cs=function(){return e},e}function Ds(){var e=fc(["\n \n ","\n \n "]);return Ds=function(){return e},e}function js(){var e=fc(["\n \n ","\n \n "]);return js=function(){return e},e}function As(){var e=fc(['\n \n ",'\n \n \n ","\n \n "]);return As=function(){return e},e}function zs(){var e=fc(['\n \n ',"\n \n "]);return zs=function(){return e},e}function Ts(){var e=fc(['\n \n ',"\n \n "]);return Ts=function(){return e},e}function Rs(){var e=fc([' '," "]);return Rs=function(){return e},e}function Fs(){var e=fc(["\n \n "]);return Fs=function(){return e},e}function Is(){var e=fc(["\n \n ','\n \n \n ',"\n \n \n ",""]);return Is=function(){return e},e}function Ms(){var e=fc(["\n \n \n ','\n \n \n ',"\n \n \n \n "]);return Ms=function(){return e},e}function Bs(){var e=fc(["\n \n \n ','\n \n \n ',"\n \n \n \n "]);return Bs=function(){return e},e}function Us(){var e=fc(["\n \n \n ','\n \n \n ',"\n \n \n \n "]);return Us=function(){return e},e}function $s(){var e=fc(["\n \n \n ','\n \n \n ',"\n \n \n \n "]);return $s=function(){return e},e}function Ns(){var e=fc(['\n \n \n \n ','\n \n \n ',"\n \n \n \n\n ","\n ","\n ","\n ","\n \n "]);return Ns=function(){return e},e}function Ls(){var e=fc(["\n \n \n \n \n \n \n \n \n \n \n ']);return Gs=function(){return e},e}function Js(){var e=fc(['\n ',"\n "]);return Js=function(){return e},e}function ec(){var e=fc(['\n ","\n "]);return ec=function(){return e},e}function tc(){var e=fc(["\n Current version: ",'\n \n (\n '," )\n \n "]);return tc=function(){return e},e}function rc(){var e=fc([" "," "]);return rc=function(){return e},e}function nc(){var e=fc(["\n \n \n \n ','\n \n \n \n ","\n \n \n \n \n "]);return ac=function(){return e},e}function sc(){var e=fc(["\n \n ","\n \n "]);return sc=function(){return e},e}function cc(){var e=fc(['\n \n ',"\n \n "]);return cc=function(){return e},e}function lc(){var e=fc(['\n \n ',"\n \n "]);return lc=function(){return e},e}function uc(){var e=fc(['\n \n \n \n ','\n \n \n \n ","\n \n ","\n \n \n "]);return uc=function(){return e},e}function dc(){var e=fc(["\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 \n \n ","\n \n \n \n\n ","\n "]);return dc=function(){return e},e}function fc(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function pc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hc(e,t){return(hc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function mc(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 Date.prototype.toString.call(Reflect.construct(Date,[],(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 yc(this,r)}}function yc(e,t){return!t||"object"!==ws(t)&&"function"!=typeof t?vc(e):t}function vc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bc(){bc=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(!kc(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'),"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,s.c)(this,"/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,Fa.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:(P=_s(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,l.d3)(this.hass,this.addon.slug,t);case 5:r={success:!0,response:void 0,path:"option"},(0,a.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,u.js)(e.t0));case 12:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(){return P.apply(this,arguments)})},{kind:"method",key:"_watchdogToggled",value:(_=_s(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,l.d3)(this.hass,this.addon.slug,t);case 5:r={success:!0,response:void 0,path:"option"},(0,a.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,u.js)(e.t0));case 12:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(){return _.apply(this,arguments)})},{kind:"method",key:"_autoUpdateToggled",value:(E=_s(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,l.d3)(this.hass,this.addon.slug,t);case 5:r={success:!0,response:void 0,path:"option"},(0,a.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,u.js)(e.t0));case 12:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(){return E.apply(this,arguments)})},{kind:"method",key:"_protectionToggled",value:(k=_s(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,l.NI)(this.hass,this.addon.slug,t);case 5:r={success:!0,response:void 0,path:"security"},(0,a.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,u.js)(e.t0));case 12:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(){return k.apply(this,arguments)})},{kind:"method",key:"_panelToggled",value:(w=_s(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,l.d3)(this.hass,this.addon.slug,t);case 5:r={success:!0,response:void 0,path:"option"},(0,a.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,u.js)(e.t0));case 12:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(){return w.apply(this,arguments)})},{kind:"method",key:"_openChangelog",value:(g=_s(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,l.CH)(this.hass,this.addon.slug);case 3:t=e.sent,(0,vs.v)(this,{title:this.supervisor.localize("addon.dashboard.changelog"),content:t}),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),(0,h.Ys)(this,{title:this.supervisor.localize("addon.dashboard.action_error.get_changelog"),text:(0,u.js)(e.t0)});case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(){return g.apply(this,arguments)})},{kind:"method",key:"_installClicked",value:(b=_s(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,l.fU)(this.hass,this.addon.slug);case 5:n={success:!0,response:void 0,path:"install"},(0,a.B)(this,"hass-api-called",n),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),(0,h.Ys)(this,{title:this.supervisor.localize("addon.dashboard.action_error.install"),text:(0,u.js)(e.t0)});case 12:r.progress=!1;case 13:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(e){return b.apply(this,arguments)})},{kind:"method",key:"_stopClicked",value:(v=_s(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,l.ow)(this.hass,this.addon.slug);case 5:n={success:!0,response:void 0,path:"stop"},(0,a.B)(this,"hass-api-called",n),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),(0,h.Ys)(this,{title:this.supervisor.localize("addon.dashboard.action_error.stop"),text:(0,u.js)(e.t0)});case 12:r.progress=!1;case 13:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(e){return v.apply(this,arguments)})},{kind:"method",key:"_restartClicked",value:(y=_s(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,l.P$)(this.hass,this.addon.slug);case 5:n={success:!0,response:void 0,path:"stop"},(0,a.B)(this,"hass-api-called",n),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),(0,h.Ys)(this,{title:this.supervisor.localize("addon.dashboard.action_error.restart"),text:(0,u.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:"_updateClicked",value:(m=_s(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(0,bs.z)(this,{supervisor:this.supervisor,name:this.addon.name,version:this.addon.version_latest,snapshotParams:{name:"addon_".concat(this.addon.slug,"_").concat(this.addon.version),addons:[this.addon.slug],homeassistant:!1},updateHandler:function(){var e=_s(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t._updateAddon();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()});case 1:case"end":return e.stop()}}),e,this)}))),function(){return m.apply(this,arguments)})},{kind:"method",key:"_updateAddon",value:(p=_s(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,l.V_)(this.hass,this.addon.slug);case 2:(0,a.B)(this,"supervisor-collection-refresh",{collection:"addon"}),t={success:!0,response:void 0,path:"update"},(0,a.B)(this,"hass-api-called",t);case 5:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{kind:"method",key:"_startClicked",value:(c=_s(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,l.su)(this.hass,this.addon.slug);case 5:if((n=e.sent).valid){e.next=11;break}return e.next=9,(0,h.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,h.Ys)(this,{title:"Failed to validate addon configuration",text:(0,u.js)(e.t0)}),r.progress=!1,e.abrupt("return");case 18:return e.prev=18,e.next=21,(0,l.kP)(this.hass,this.addon.slug);case 21:return e.next=23,(0,l.AD)(this.hass,this.addon.slug);case 23:this.addon=e.sent,i={success:!0,response:void 0,path:"start"},(0,a.B)(this,"hass-api-called",i),e.next=31;break;case 28:e.prev=28,e.t1=e.catch(18),(0,h.Ys)(this,{title:this.supervisor.localize("addon.dashboard.action_error.start"),text:(0,u.js)(e.t1)});case 31:r.progress=!1;case 32:case"end":return e.stop()}}),e,this,[[2,13],[18,28]])}))),function(e){return c.apply(this,arguments)})},{kind:"method",key:"_openConfiguration",value:function(){(0,s.c)(this,"/hassio/addon/".concat(this.addon.slug,"/config"))}},{kind:"method",key:"_uninstallClicked",value:(r=_s(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,h.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,l.Yn)(this.hass,this.addon.slug);case 12:n={success:!0,response:void 0,path:"uninstall"},(0,a.B)(this,"hass-api-called",n),e.next=19;break;case 16:e.prev=16,e.t0=e.catch(9),(0,h.Ys)(this,{title:this.supervisor.localize("addon.dashboard.action_error.uninstall"),text:(0,u.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[d.Qx,f.l,(0,i.iv)(ks())]}}]}}),i.oi);function Dc(e){return(Dc="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})(e)}function jc(){var e=Tc(["\n .content {\n margin: auto;\n padding: 8px;\n max-width: 1024px;\n }\n "]);return jc=function(){return e},e}function Ac(){var e=Tc(['\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"]);return Xc=function(){return e},e}function Zc(){var e=Jc([' '," "]);return Zc=function(){return e},e}function Gc(){var e=Jc(["\n ","\n \n ",'\n \n ','\n \n \n \n ","\n \n \n \n "]);return Gc=function(){return e},e}function Jc(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function el(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 tl(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){el(o,n,i,a,s,"next",e)}function s(e){el(o,n,i,a,s,"throw",e)}a(void 0)}))}}function rl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nl(e,t){return(nl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function il(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=yl(e);if(t){var i=yl(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ol(this,r)}}function ol(e,t){return!t||"object"!==Kc(t)&&"function"!=typeof t?al(e):t}function al(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sl(){sl=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(!ul(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=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 "]);return tu=function(){return e},e}function ru(){var e=iu([""]);return ru=function(){return e},e}function nu(){var e=iu([""]);return nu=function(){return e},e}function iu(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ou(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function au(e,t){return(au=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function su(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=uu(e);if(t){var i=uu(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return cu(this,r)}}function cu(e,t){return!t||"object"!==Zl(t)&&"function"!=typeof t?lu(e):t}function lu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function uu(e){return(uu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function du(){du=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(!hu(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);re.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:o}}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,c=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}(new URLSearchParams(location.search).entries());try{for(r.s();!(e=r.n()).done;){var o=n(e.value,2),a=o[0],s=o[1];t[a]=s}}catch(c){r.e(c)}finally{r.f()}return t},s=function(e){return new URLSearchParams(window.location.search).get(e)},c=function(e){var t=new URLSearchParams;return Object.entries(e).forEach((function(e){var r=n(e,2),i=r[0],o=r[1];t.append(i,o)})),t.toString()}}}]);
+//# sourceMappingURL=chunk.15bd96ac091ab59c3891.js.map
\ No newline at end of file
diff --git a/supervisor/api/panel/frontend_es5/chunk.15bd96ac091ab59c3891.js.gz b/supervisor/api/panel/frontend_es5/chunk.15bd96ac091ab59c3891.js.gz
new file mode 100644
index 000000000..3b5fb1a8b
Binary files /dev/null and b/supervisor/api/panel/frontend_es5/chunk.15bd96ac091ab59c3891.js.gz differ
diff --git a/supervisor/api/panel/frontend_es5/chunk.15bd96ac091ab59c3891.js.map b/supervisor/api/panel/frontend_es5/chunk.15bd96ac091ab59c3891.js.map
new file mode 100644
index 000000000..8027fe52c
--- /dev/null
+++ b/supervisor/api/panel/frontend_es5/chunk.15bd96ac091ab59c3891.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"chunk.15bd96ac091ab59c3891.js","sources":["webpack://home-assistant-frontend/chunk.15bd96ac091ab59c3891.js"],"mappings":"AAAA","sourceRoot":""}
\ No newline at end of file
diff --git a/supervisor/api/panel/frontend_es5/chunk.590407cbed5b18fe66b5.js.gz b/supervisor/api/panel/frontend_es5/chunk.590407cbed5b18fe66b5.js.gz
deleted file mode 100644
index dcd91e08f..000000000
Binary files a/supervisor/api/panel/frontend_es5/chunk.590407cbed5b18fe66b5.js.gz and /dev/null differ
diff --git a/supervisor/api/panel/frontend_es5/chunk.590407cbed5b18fe66b5.js.map b/supervisor/api/panel/frontend_es5/chunk.590407cbed5b18fe66b5.js.map
deleted file mode 100644
index 686dbd35f..000000000
--- a/supervisor/api/panel/frontend_es5/chunk.590407cbed5b18fe66b5.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"chunk.590407cbed5b18fe66b5.js","sources":["webpack://home-assistant-frontend/chunk.590407cbed5b18fe66b5.js"],"mappings":"AAAA","sourceRoot":""}
\ No newline at end of file
diff --git a/supervisor/api/panel/frontend_es5/chunk.8da5835250330bd36243.js.gz b/supervisor/api/panel/frontend_es5/chunk.8da5835250330bd36243.js.gz
deleted file mode 100644
index f922dec77..000000000
Binary files a/supervisor/api/panel/frontend_es5/chunk.8da5835250330bd36243.js.gz and /dev/null differ
diff --git a/supervisor/api/panel/frontend_es5/chunk.8da5835250330bd36243.js.map b/supervisor/api/panel/frontend_es5/chunk.8da5835250330bd36243.js.map
deleted file mode 100644
index dbdb15b72..000000000
--- a/supervisor/api/panel/frontend_es5/chunk.8da5835250330bd36243.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"chunk.8da5835250330bd36243.js","sources":["webpack://home-assistant-frontend/chunk.8da5835250330bd36243.js"],"mappings":"AAAA","sourceRoot":""}
\ No newline at end of file
diff --git a/supervisor/api/panel/frontend_es5/chunk.9f79daafe7d108c4c9cc.js b/supervisor/api/panel/frontend_es5/chunk.9f79daafe7d108c4c9cc.js
new file mode 100644
index 000000000..4277960c2
--- /dev/null
+++ b/supervisor/api/panel/frontend_es5/chunk.9f79daafe7d108c4c9cc.js
@@ -0,0 +1,2 @@
+(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[914],{92914:function(r,o,a){"use strict";a.r(o),a.d(o,{keymap:function(){return t.$f},EditorView:function(){return t.tk},EditorState:function(){return l.yy},Prec:function(){return l.Wl},tagExtension:function(){return l.kU},defaultKeymap:function(){return p.wQ},lineNumbers:function(){return d.Eu},searchKeymap:function(){return g.Lp},highlightSelectionMatches:function(){return g.sW},history:function(){return u.m8},historyKeymap:function(){return u.f$},langs:function(){return m},tabKeyBindings:function(){return s},theme:function(){return b},highlightStyle:function(){return v}});var e=a(49619),t=a(19753),n=a(11163),c=a(49413),i=a(8987),p=a(86876),l=a(77885),d=a(11254),g=a(72360),u=a(62118),m={jinja2:n.i.define(c.b),yaml:n.i.define(i.r)},s=[{key:"Tab",run:p.at},{key:"Shift-Tab",run:p.xi}],b=t.tk.theme({$:{color:"var(--primary-text-color)",backgroundColor:"var(--code-editor-background-color, var(--card-background-color))","& ::selection":{backgroundColor:"rgba(var(--rgb-primary-color), 0.3)"},height:"var(--code-mirror-height, auto)",maxHeight:"var(--code-mirror-max-height, unset)"},$scroller:{outline:"none"},$content:{caretColor:"var(--secondary-text-color)"},$$focused:{outline:"none"},"$$focused $cursor":{borderLeftColor:"#var(--secondary-text-color)"},"$$focused $selectionBackground, $selectionBackground":{backgroundColor:"rgba(var(--rgb-primary-color), 0.3)"},$panels:{backgroundColor:"var(--primary-background-color)",color:"var(--primary-text-color)"},"$panels.top":{borderBottom:"1px solid var(--divider-color)"},"$panels.bottom":{borderTop:"1px solid var(--divider-color)"},"$panel.search input":{margin:"4px 4px 0"},$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)"},$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"}},$selectionMatch:{backgroundColor:"rgba(var(--rgb-primary-color), 0.1)"},$searchMatch:{backgroundColor:"rgba(var(--rgb-accent-color), .2)",outline:"1px solid rgba(var(--rgb-accent-color), .4)"},"$searchMatch.selected":{backgroundColor:"rgba(var(--rgb-accent-color), .4)",outline:"1px solid var(--accent-color)"},$gutters:{backgroundColor:"var(--paper-dialog-background-color, var(--primary-background-color))",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"},"$$focused $gutters":{borderRight:"2px solid var(--paper-input-container-focus-color, var(--primary-color))",paddingRight:"0"},"$gutterElementags.lineNumber":{color:"inherit"}}),v=e.Qf.define({tag:e.pJ.keyword,color:"var(--codemirror-keyword, #6262FF)"},{tag:[e.pJ.name,e.pJ.deleted,e.pJ.character,e.pJ.propertyName,e.pJ.macroName],color:"var(--codemirror-property, #905)"},{tag:[e.pJ.function(e.pJ.variableName),e.pJ.labelName],color:"var(--codemirror-variable, #07a)"},{tag:[e.pJ.color,e.pJ.constant(e.pJ.name),e.pJ.standard(e.pJ.name)],color:"var(--codemirror-qualifier, #690)"},{tag:[e.pJ.definition(e.pJ.name),e.pJ.separator],color:"var(--codemirror-def, #8DA6CE)"},{tag:[e.pJ.typeName,e.pJ.className,e.pJ.number,e.pJ.changed,e.pJ.annotation,e.pJ.modifier,e.pJ.self,e.pJ.namespace],color:"var(--codemirror-number, #ca7841)"},{tag:[e.pJ.operator,e.pJ.operatorKeyword,e.pJ.url,e.pJ.escape,e.pJ.regexp,e.pJ.link,e.pJ.special(e.pJ.string)],color:"var(--codemirror-operator, #cda869)"},{tag:e.pJ.comment,color:"var(--codemirror-comment, #777)"},{tag:e.pJ.meta,color:"var(--codemirror-meta, var(--primary-text-color))"},{tag:e.pJ.strong,fontWeight:"bold"},{tag:e.pJ.emphasis,fontStyle:"italic"},{tag:e.pJ.link,color:"var(--primary-color)",textDecoration:"underline"},{tag:e.pJ.heading,fontWeight:"bold"},{tag:e.pJ.atom,color:"var(--codemirror-atom, #F90)"},{tag:e.pJ.bool,color:"var(--codemirror-atom, #F90)"},{tag:e.pJ.special(e.pJ.variableName),color:"var(--codemirror-variable-2, #690)"},{tag:e.pJ.processingInstruction,color:"var(--secondary-text-color)"},{tag:e.pJ.string,color:"var(--codemirror-string, #07a)"},{tag:e.pJ.inserted,color:"var(--codemirror-string2, #07a)"},{tag:e.pJ.invalid,color:"var(--error-color)"})}}]);
+//# sourceMappingURL=chunk.9f79daafe7d108c4c9cc.js.map
\ No newline at end of file
diff --git a/supervisor/api/panel/frontend_es5/chunk.9f79daafe7d108c4c9cc.js.gz b/supervisor/api/panel/frontend_es5/chunk.9f79daafe7d108c4c9cc.js.gz
new file mode 100644
index 000000000..0fce0dad5
Binary files /dev/null and b/supervisor/api/panel/frontend_es5/chunk.9f79daafe7d108c4c9cc.js.gz differ
diff --git a/supervisor/api/panel/frontend_es5/chunk.9f79daafe7d108c4c9cc.js.map b/supervisor/api/panel/frontend_es5/chunk.9f79daafe7d108c4c9cc.js.map
new file mode 100644
index 000000000..8848f495c
--- /dev/null
+++ b/supervisor/api/panel/frontend_es5/chunk.9f79daafe7d108c4c9cc.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"chunk.9f79daafe7d108c4c9cc.js","sources":["webpack://home-assistant-frontend/chunk.9f79daafe7d108c4c9cc.js"],"mappings":"AAAA","sourceRoot":""}
\ No newline at end of file
diff --git a/supervisor/api/panel/frontend_es5/chunk.8da5835250330bd36243.js b/supervisor/api/panel/frontend_es5/chunk.b8843e5597eb8407842b.js
similarity index 65%
rename from supervisor/api/panel/frontend_es5/chunk.8da5835250330bd36243.js
rename to supervisor/api/panel/frontend_es5/chunk.b8843e5597eb8407842b.js
index ded69f271..a6abe81e5 100644
--- a/supervisor/api/panel/frontend_es5/chunk.8da5835250330bd36243.js
+++ b/supervisor/api/panel/frontend_es5/chunk.b8843e5597eb8407842b.js
@@ -1,2 +1,2 @@
-(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[221],{86876:function(t,e,n){"use strict";n.d(e,{wQ:function(){return kt},xi:function(){return mt},at:function(){return gt}});var r=n(77885),i=n(23414),o=n(19753),a=n(64928),s=n(26856);function u(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return h(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 h(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=t[Symbol.iterator]()},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);n0&&m(e.state,s.head-1,1,i)||i.afterCursor&&(m(e.state,s.head,1,i)||s.head-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function m(t,e,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=i.maxScanDistance||c,s=i.brackets||f,u=(0,a.qz)(t),h=u.resolve(e,n);return(r=g(h.type,n,s))?y(t,e,n,h,r,s):k(t,e,n,u,h.type,o,s)}function y(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(g(h.type,n,o))u++;else if(g(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 k(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 b(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return w(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 w(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=t[Symbol.iterator]()},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 w(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 P(t,e,n){for(var i=(0,a.qz)(t).resolve(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;E(t,h,o)?i=h:u=n?h.to:h.from}var l,c;return c=i.type.prop(o)&&(l=n?m(t,i.from,1):m(t,i.to,-1))&&l.matched?n?l.end.to:l.end.from:n?i.to:i.from,r.jT.cursor(c,n?-1:1)}function R(t,e){return A(t,(function(n){return n.empty?t.moveVertically(n,e):C(n,e)}))}var B=function(t){return R(t,!1)},L=function(t){return R(t,!0)};function j(t,e){return A(t,(function(n){return n.empty?t.moveVertically(n,e,t.dom.clientHeight):C(n,e)}))}var I=function(t){return j(t,!1)},N=function(t){return j(t,!0)};function $(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 V=function(t){return A(t,(function(e){return r.jT.cursor(t.visualLineAt(e.head).from,1)}))},W=function(t){return A(t,(function(e){return r.jT.cursor(t.visualLineAt(e.head).to,-1)}))};function H(t,e,n){var i=!1,o=S(t.selection,(function(e){var o=m(t,e.head,-1)||m(t,e.head,1)||e.head>0&&m(t,e.head-1,1)||e.headh.from&&rn&&(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 pt=function(t){var e=t.state,n=t.dispatch,r=Object.create(null),i=new a.Gn(e,{overrideIndentation:function(t){var e=r[t];return null==e?-1:e}}),o=vt(e,(function(t,n,o){var s=(0,a.K0)(i,t.from);if(null!=s){var u=/^\s*/.exec(t.text)[0],h=(0,a.SS)(e,s);(u!=h||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}(e,n),h=new a.Gn(e,{simulateBreak:n,simulateDoubleBreak:!!u}),l=(0,a.K0)(h,n);null==l&&(l=/^\s*/.exec(e.doc.lineAt(n).text)[0].length);for(var c=e.doc.lineAt(n);oc.from&&n",run:nt},{key:"Ctrl-v",run:N},{key:"Alt-v",run:I}].map((function(t){return{mac:t.key,run:t.run,shift:t.shift}}))),kt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:function(t){return A(t,(function(e){return P(t.state,e,t.textDirection!=o.Nm.LTR)}))},shift:function(t){return _(t,(function(e){return P(t.state,e,t.textDirection!=o.Nm.LTR)}))}},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:function(t){return A(t,(function(e){return P(t.state,e,t.textDirection==o.Nm.LTR)}))},shift:function(t){return _(t,(function(e){return P(t.state,e,t.textDirection==o.Nm.LTR)}))}},{key:"Alt-ArrowUp",run:function(t){return ft(t.state,t.dispatch,!1)}},{key:"Shift-Alt-ArrowUp",run:function(t){return dt(t.state,t.dispatch,!1)}},{key:"Alt-ArrowDown",run:function(t){return ft(t.state,t.dispatch,!0)}},{key:"Shift-Alt-ArrowDown",run:function(t){return dt(t.state,t.dispatch,!0)}},{key:"Escape",run:function(t){var e=t.state,n=t.dispatch,i=e.selection,o=null;return i.ranges.length>1?o=r.jT.create([i.main]):i.main.empty||(o=r.jT.create([r.jT.cursor(i.main.head)])),!!o&&(n(x(e,o)),!0)}},{key:"Alt-l",run:function(t){var e=t.state,n=t.dispatch,i=ct(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),annotations:r.YW.userEvent.of("keyboardselection")})),!0}},{key:"Mod-i",run:function(t){var e=t.state,n=t.dispatch,i=S(e.selection,(function(t){for(var n,i=(0,a.qz)(e).resolve(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(x(e,i)),!0}},{key:"Mod-[",run:mt},{key:"Mod-]",run:gt},{key:"Mod-Alt-\\",run:pt},{key:"Shift-Mod-k",run:function(t){var e=t.state,n=e.changes(ct(e).map((function(t){var n=t.from,r=t.to;return n>0?n--: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,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function s(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}(),M=function(){function t(e,n){var i=this;h(this,t),this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className=(0,r.Zp)("gutter"+(this.config.style?"."+this.config.style:"")),this.elementClass=(0,r.Zp)("gutterElement"+(this.config.style?"."+this.config.style:""));var o=function(t){i.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 a in n.domEventHandlers)o(a);this.markers=A(n.markers(e)),n.initialSpacer&&(this.spacer=new O(e,0,0,[n.initialSpacer(e)],this.elementClass),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],this.elementClass)}return this.markers!=e}}]),t}(),O=function(){function t(e,n,r,i,o){h(this,t),this.height=-1,this.above=0,this.dom=document.createElement("div"),this.update(e,n,r,i,o)}return c(t,[{key:"update",value:function(t,e,n,r,i){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 o;o=this.dom.lastChild;)o.remove();var s,u=i,h=a(r);try{for(h.s();!(s=h.n()).done;){var l=s.value,c=l.toDOM(t);c&&this.dom.appendChild(c);var f=l.elementClass;f&&(u+=" "+f)}}catch(d){h.e(d)}finally{h.f()}this.dom.className=u}}}]),t}();var T=o.r$.define(),D=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}})}}),E=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(){return document.createTextNode(this.number)}}]),n}(m);function P(t,e){return t.state.facet(D).formatNumber(e,t.state)}var R,B=(R={style:"lineNumber",markers:function(t){return t.state.facet(T)},lineMarker:function(t,e,n){return n.length?null:new E(P(t,t.state.doc.lineAt(e.from).number))},initialSpacer:function(t){return new E(P(t,j(t.state.doc.lines)))},updateSpacer:function(t,e){var n=P(e.view,j(e.view.state.doc.lines));return n==t.number?t:new E(n)}},[S(),k.of(Object.assign(Object.assign({},y),R))]);function L(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[D.of(t),B]}function j(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=t[Symbol.iterator]()},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 S(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?t[0]:null}}),S=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.deptho&&a&&i(o,e,a),o=e,a=u),c)return s--,!1;O[s]=u,T[s]=n,M[s]=t.name},leave:function(t,e,r){s--;var u=O[s];if(u!=a){var h=Math.min(n,r);h>o&&a&&i(o,h,a),o=h,a=u}}})}function E(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 P=p.define,R=P(),B=P(),L=P(B),j=P(),I=P(j),N=P(j),$=P(),V=P($),W=P(),H=P(),_=P(),z=P(_),q=P(),F={comment:R,lineComment:P(R),blockComment:P(R),docComment:P(R),name:B,variableName:P(B),typeName:L,tagName:P(L),propertyName:P(B),className:P(B),labelName:P(B),namespace:P(B),macroName:P(B),literal:j,string:I,docString:P(I),character:P(I),number:N,integer:P(N),float:P(N),bool:P(j),regexp:P(j),escape:P(j),color:P(j),url:P(j),keyword:W,self:P(W),null:P(W),atom:P(W),unit:P(W),modifier:P(W),operatorKeyword:P(W),controlKeyword:P(W),definitionKeyword:P(W),operator:H,derefOperator:P(H),arithmeticOperator:P(H),logicOperator:P(H),bitwiseOperator:P(H),compareOperator:P(H),updateOperator:P(H),definitionOperator:P(H),typeOperator:P(H),controlOperator:P(H),punctuation:_,separator:P(_),bracket:z,angleBracket:P(z),squareBracket:P(z),paren:P(z),brace:P(z),content:$,heading:V,heading1:P(V),heading2:P(V),heading3:P(V),heading4:P(V),heading5:P(V),heading6:P(V),contentSeparator:P($),list:P($),quote:P($),emphasis:P($),strong:P($),link:P($),monospace:P($),inserted:P(),deleted:P(),changed:P(),invalid:P(),meta:q,documentMeta:P(q),annotation:P(q),processingInstruction:P(q),definition:p.defineModifier(),constant:p.defineModifier(),function:p.defineModifier(),standard:p.defineModifier(),local:p.defineModifier(),special:p.defineModifier()};x.define({tag:F.link,textDecoration:"underline"},{tag:F.heading,textDecoration:"underline",fontWeight:"bold"},{tag:F.emphasis,fontStyle:"italic"},{tag:F.strong,fontWeight:"bold"},{tag:F.keyword,color:"#708"},{tag:[F.atom,F.bool,F.url,F.contentSeparator,F.labelName],color:"#219"},{tag:[F.literal,F.inserted],color:"#164"},{tag:[F.string,F.deleted],color:"#a11"},{tag:[F.regexp,F.escape,F.special(F.string)],color:"#e40"},{tag:F.definition(F.variableName),color:"#00f"},{tag:F.local(F.variableName),color:"#30a"},{tag:[F.typeName,F.namespace],color:"#085"},{tag:F.className,color:"#167"},{tag:[F.special(F.variableName),F.macroName,F.local(F.variableName)],color:"#256"},{tag:F.definition(F.propertyName),color:"#00c"},{tag:F.comment,color:"#940"},{tag:F.meta,color:"#7a757a"},{tag:F.invalid,color:"#f00"})},62118:function(t,e,n){"use strict";n.d(e,{m8:function(){return p},f$:function(){return P}});var r=n(77885),i=n(19753);function o(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){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=t[Symbol.iterator]()},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);function w(t){return function(e){var n=e.field(v,!1);if(!n)return 0;var r=0==t?n.done:n.undone;return r.length-(r.length&&!r[0].changes?1:0)}}w(0),w(1);var S=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:"fromTransaction",value:function(e){var n,r=C,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,C)}},{key:"selection",value:function(e){return new t(void 0,C,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 A(t,e){return t.length?e.length?t.concat(e):t:e}var C=[];function M(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[S.selection([e])]}function O(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 T(t,e){if(!t.length)return t;for(var n=t.length,r=C;n;){var i=D(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?[S.selection(r)]:C}function D(t,e,n){var i=A(t.selectionsAfter.length?t.selectionsAfter.map((function(t){return t.map(e)})):C,n);if(!t.changes)return S.selection(i);var o=t.changes.map(e),a=e.mapDesc(t.changes,!0),s=t.mapped?t.mapped.composeDesc(a):a;return new S(o,r.Py.mapEffects(t.effects,e),s,t.startSelection.map(a),i)}var E=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 new t(a=s&&s.changes&&n-this.prevTime=s&&i<=u&&(r=!0)}})),r}(s.changes,e.changes)?x(a,a.length-1,o,new S(e.changes.compose(s.changes),A(e.effects,s.effects),s.mapped,s.startSelection,C)):x(a,a.length,o,e),C,n,r)}},{key:"addSelection",value:function(e,n,r,i){var o,a,s=this.done.length?this.done[this.done.length-1].selectionsAfter:C;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=t[Symbol.iterator]()},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);n2&&void 0!==arguments[2]?arguments[2]:[];p(this,t),this.data=e,o.yy.prototype.hasOwnProperty("tree")||Object.defineProperty(o.yy.prototype,"tree",{get:function(){return S(this)}}),this.parser=n,this.extension=[E.of(this),o.yy.languageData.of((function(t,e){return t.facet(w(t,e))}))].concat(r)}return m(t,[{key:"isActiveAt",value:function(t,e){return w(t,e)==this.data}},{key:"findRegions",value:function(t){var e=this,n=t.facet(E);if((null==n?void 0:n.data)==this.data)return[{from:0,to:t.doc.length}];if(!n||!n.allowsNesting)return[];var r=[];return S(t).iterate({enter:function(t,n,i){if(t.isTop&&t.prop(y)==e.data)return r.push({from:n,to:i}),!1}}),r}},{key:"parseString",value:function(t){for(var e,n=i.xv.of(t.split("\n")),a=this.parser.startParse(new x(n),0,new A(this.parser,o.yy.create({doc:n}),[],r.mp.empty,{from:0,to:t.length},[]));!(e=a.advance()););return e}},{key:"allowsNesting",get:function(){return!0}}]),t}();function w(t,e){var n=t.facet(E);if(!n)return null;if(!n.allowsNesting)return n.data;for(var r=S(t).resolve(e,-1);r;){var i=r.type.prop(y);if(i)return i;r=r.parent}return n.data}b.setState=o.Py.define();function S(t){var e=t.field(b.state,!1);return e?e.tree:r.mp.empty}var x=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.length;p(this,t),this.doc=e,this.length=n,this.cursorPos=0,this.string="",this.prevString="",this.cursor=e.iter()}return m(t,[{key:"syncTo",value:function(t){return t=this.length)return-1;var e=this.cursorPos-this.string.length;if(t=this.cursorPos){if(t=e-this.prevString.length)return this.prevString.charCodeAt(t-(e-this.prevString.length));e=this.syncTo(t)}return this.string.charCodeAt(t-e)}},{key:"lineAfter",value:function(t){if(t>=this.length||t<0)return"";var e=this.cursorPos-this.string.length;return(t=this.cursorPos)&&(e=this.syncTo(t)),this.cursor.lineBreak?"":this.string.slice(t-e)}},{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)}},{key:"clip",value:function(e){return new t(this.doc,e)}}]),t}(),A=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;p(this,t),this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.viewport=o,this.skipped=a,this.parse=null,this.tempSkipped=[]}return m(t,[{key:"work",value:function(t,e){if(this.tree!=r.mp.empty&&(null==e?this.tree.length==this.state.doc.length:this.tree.length>=e))return this.takeTree(),!0;this.parse||(this.parse=this.parser.startParse(new x(this.state.doc),0,this));for(var n=Date.now()+t;;){var i=this.parse.advance();if(i)return this.fragments=this.withoutTempSkipped(r.i9.addTree(i)),this.parse=null,this.tree=i,!0;if(null!=e&&this.parse.pos>=e)return this.takeTree(),!0;if(Date.now()>n)return!1}}},{key:"takeTree",value:function(){this.parse&&this.parse.pos>this.tree.length&&(this.tree=this.parse.forceFinish(),this.fragments=this.withoutTempSkipped(r.i9.addTree(this.tree,this.fragments,!0)))}},{key:"withoutTempSkipped",value:function(t){for(var e;e=this.tempSkipped.pop();)t=C(t,e.from,e.to);return t}},{key:"changes",value:function(e,n){var i=this.fragments,o=this.tree,a=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={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){u=[];var l,c=s(this.skipped);try{for(c.s();!(l=c.n()).done;){var f=l.value,d=e.mapPos(f.from,1),v=e.mapPos(f.to,-1);dt.from&&(this.fragments=C(this.fragments,i,o),this.skipped.splice(n--,1))}return this.skipped.length=t}}]),t}();function C(t,e,n){return r.i9.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}A.skippingParser={startParse:function(t,e,n){return{pos:e,advance:function(){return n.tempSkipped.push({from:e,to:t.length}),this.pos=t.length,new r.mp(r.Jq.none,[],[],t.length-e)},forceFinish:function(){return this.advance()}}}};var M=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.tree.length==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.tree.length),n.viewport.to);return n.work(25,r)||n.takeTree(),new t(n)}}],[{key:"init",value:function(e){var n=new A(e.facet(E).parser,e,[],r.mp.empty,{from:0,to:e.doc.length},[]);return n.work(25)||n.takeTree(),new t(n)}}]),t}();b.state=o.QQ.define({create:M.init,update:function(t,e){var n,r=s(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(E)!=e.state.facet(E)?M.init(e.state):t.apply(e)}});var O="undefined"!=typeof window&&window.requestIdleCallback||function(t,e){var n=e.timeout;return setTimeout(t,n)},T="undefined"!=typeof window&&window.cancelIdleCallback||clearTimeout,D=a.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){if(t.viewportChanged){var e=this.view.state.field(b.state).context;e.updateViewport(t.view.viewport)&&e.reset(),this.view.viewport.to>e.tree.length&&this.scheduleWork()}t.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork())}},{key:"scheduleWork",value:function(){if(!(this.working>-1)){var t=this.view.state;t.field(b.state).tree.length>=t.doc.length||(this.working=O(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 M(o.context))})),!s&&this.chunkBudget>0&&this.scheduleWork()}}}},{key:"destroy",value:function(){this.working>=0&&T(this.working)}}]),t}(),{eventHandlers:{focus:function(){this.scheduleWork()}}}),E=o.r$.define({combine:function(t){return t.length?t[0]:null},enables:[b.state,D]}),P=o.r$.define(),R=o.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(R);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length}function L(t,e){var n="",r=t.tabSize;if(9==t.facet(R).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:"textAfterPos",value:function(t){var e,n,r=null===(e=this.options)||void 0===e?void 0:e.simulateBreak;return t==r&&(null===(n=this.options)||void 0===n?void 0:n.simulateDoubleBreak)?"":this.state.sliceDoc(t,Math.min(t+100,null!=r&&r>t?r:1e9,this.state.doc.lineAt(t).to))}},{key:"column",value:function(t){var e,n=this.state.doc.lineAt(t),r=n.text.slice(0,t-n.from),i=this.countColumn(r,t-n.from),o=(null===(e=this.options)||void 0===e?void 0:e.overrideIndentation)?this.options.overrideIndentation(n.from):-1;return o>-1&&(i+=o-this.countColumn(r,r.search(/\S/))),i}},{key:"countColumn",value:function(t,e){return(0,i.IS)(e<0?t:t.slice(0,e),0,this.state.tabSize)}},{key:"lineIndent",value:function(t){var e,n=null===(e=this.options)||void 0===e?void 0:e.overrideIndentation;if(n){var r=n(t.from);if(r>-1)return r}return this.countColumn(t.text,t.text.search(/\S/))}}]),t}(),N=new r.md;function $(t){var e=t.type.prop(N);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 _(t,!0,1,void 0,a&&!function(t){var e,n;return t.pos==(null===(e=t.options)||void 0===e?void 0:e.simulateBreak)&&(null===(n=t.options)||void 0===n?void 0:n.simulateDoubleBreak)}(t)?o.from:void 0)}}return null==t.parent?V:null}function V(){return 0}var W=function(t){l(n,t);var e=f(n);function n(t,r,i){var o;return p(this,n),(o=e.call(this,t.state,t.options)).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(H(e,this.node))break;t=this.state.doc.lineAt(e.from)}return this.lineIndent(t)}}]),n}(I);function H(t,e){for(var n=e;n;n=n.parent)if(t==n)return!0;return!1}function _(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,n=t.node,r=n.childAfter(n.from),i=n.lastChild;if(!r)return null;for(var o=null===(e=t.options)||void 0===e?void 0:e.simulateBreak,a=t.state.doc.lineAt(r.from),s=null==o||o<=a.from?a.to:Math.min(a.to,o),u=r.to;;){var h=n.childAfter(u);if(!h||h==i)return null;if(!h.type.isSkipped)return h.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:"#}"}}}}},8987:function(t,e,n){"use strict";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:"#"}}}},13764:function(t,e,n){"use strict";n.d(e,{Xs:function(){return d},f_:function(){return v},uU:function(){return h}});var r=n(77885);function i(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){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=t[Symbol.iterator]()},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:"findIndex",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e9*e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(t<=0)return r;for(var i=e<0?this.to:this.from,o=r,a=i.length;;){if(o==a)return o;var s=o+a>>1,u=i[s]-t||(e<0?this.value[s].startSide:this.value[s].endSide)-n;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,-1),o=this.findIndex(n,1,void 0,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}}},{key:"length",get:function(){return this.to[this.to.length-1]}}]),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:"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==t.empty)return r.length?t.of(r):this;for(var d=new g(this,null,-1).goto(0),p=0,m=[],y=new v;d.value||p=0){var k=r[p++];y.addInner(k.from,k.to,k.value)||m.push(k)}else 1==d.rangeIndex&&d.chunkIndexthis.chunkEnd(d.chunkIndex)||hd.to||h=o&&e<=o+a.length&&!1===a.between(o,e-o,n-o,r))return}this.nextLayer.between(e,n,r)}}},{key:"iter",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return m.from([this]).goto(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==t.empty)return 0;var e,n=this.nextLayer.size,r=i(this.chunk);try{for(r.s();!(e=r.n()).done;){n+=e.value.value.length}}catch(o){r.e(o)}finally{r.f()}return n}}],[{key:"iter",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return m.from(t).goto(e)}},{key:"compare",value:function(e,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,a=e.filter((function(e){return e.maxPoint>=500||e!=t.empty&&n.indexOf(e)<0&&e.maxPoint>=o})),s=n.filter((function(n){return n.maxPoint>=500||n!=t.empty&&e.indexOf(n)<0&&n.maxPoint>=o})),u=p(a,s),h=new k(a,u,o),l=new k(s,u,o);r.iterGaps((function(t,e,n){return b(h,t,l,e,n,i)})),r.empty&&0==r.length&&b(h,0,l,0,0,i)}},{key:"spans",value:function(t,e,n,r){for(var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,o=new k(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 v,o=i(t instanceof l?[t]:n?t.slice().sort(c):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}();d.empty=new d([],[],null,-1),d.empty.nextLayer=d.empty;var v=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 p(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:"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:"nextChunk",value:function(){this.chunkIndex++,this.rangeIndex=0,this.next()}},{key:"compare",value:function(t){return this.from-t.from||this.startSide-t.startSide||this.to-t.to||this.endSide-t.endSide}},{key:"startSide",get:function(){return this.value?this.value.startSide:0}},{key:"endSide",get:function(){return this.value?this.value.endSide:0}}]),t}(),m=function(){function t(e){a(this,t),this.heap=e}return u(t,[{key:"goto",value:function(t){var e,n=arguments.length>1&&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--)y(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--)y(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(),y(this.heap,0)}}},{key:"startSide",get:function(){return this.value?this.value.startSide: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 g(a,n,r,o));return 1==i.length?i[0]:new t(i)}}]),t}();function y(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 k=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=m.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=A(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[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>t){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),e&&S(e,r)}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 i=this.cursor.value;if(i.point){this.point=i,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=i.endSide,this.cursor.fromt&&this.forward(this.to,this.endSide);break}this.addActive(e),this.cursor.next()}}if(e){for(var o=0;othis.pointRank);n++)(this.activeTo[n]>t||this.activeTo[n]==t&&this.active[n].endSide>this.point.endSide)&&e.push(this.active[n]);return e}},{key:"openEnd",value:function(t){for(var e=0;et;)e++;return e}}]),t}();function b(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))||o.comparePoint(s,c,t.point,n.point):c>s&&!w(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 w(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 A(t,e){for(var n=-1,r=1e9,i=0;i=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=t[Symbol.iterator]()},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 v=r.lg.fromClass(function(){function t(e){o(this,t),this.specs=e.state.facet(f),this.panels=this.specs.map((function(t){return t(e)}));var n=e.state.facet(l);this.top=new g(e,!0,n.topContainer),this.bottom=new g(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.className+=" "+p(a),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 g(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new g(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();var n=t.state.facet(f);if(n!=this.specs){var r,i=[],o=[],a=[],s=[],h=u(n);try{for(h.s();!(r=h.n()).done;){var c=r.value,d=this.specs.indexOf(c),v=void 0;d<0?(v=c(t.view),s.push(v)):(v=this.panels[d]).update&&v.update(t),i.push(v),(v.top?o:a).push(v)}}catch(x){h.e(x)}finally{h.f()}this.specs=n,this.panels=i,this.top.sync(o),this.bottom.sync(a);for(var m=0,y=s;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=t[Symbol.iterator]()},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 C(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||M(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 M(t,e){if(t){if("string"==typeof t)return O(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)?O(t,e):void 0}}function O(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;T(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(P(t))}:P,this.query=this.normalize(n)}return E(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 this.buffer.charCodeAt(this.bufferPos)}},{key:"next",value:function(){for(;;){var t=this.peek();if(t<0)return this.done=!0,this;var e=String.fromCharCode(t),n=this.bufferStart+this.bufferPos;for(this.bufferPos++;;){var r=this.peek();if(r<56320||r>=57344)break;this.bufferPos++,e+=String.fromCharCode(r)}for(var i=this.normalize(e),o=0,a=n;;o++){var s=i.charCodeAt(o),u=this.match(s,a);if(u)return this.value=u,this;if(o==i.length-1)break;a==n&&o".concat(t.state.phrase("Go to line:")," \n");var n=e.querySelector("input");function o(){var e=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(e){var r=t.state,o=r.doc.lineAt(r.selection.main.head),a=C(e,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:L.of(!1),selection:i.jT.cursor(v.from+Math.max(0,Math.min(c,v.length))),scrollIntoView:!0}),t.focus()}}return e.addEventListener("keydown",(function(e){27==e.keyCode?(e.preventDefault(),t.dispatch({effects:L.of(!1)}),t.focus()):13==e.keyCode&&(e.preventDefault(),o())})),e.addEventListener("submit",o),{dom:e,style:"gotoLine",pos:-10}}var L=i.Py.define(),j=i.QQ.define({create:function(){return!0},update:function(t,e){var n,r=A(e.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.is(L)&&(t=i.value)}}catch(o){r.e(o)}finally{r.f()}return t},provide:function(t){return f.computeN([t],(function(e){return e.field(t)?[B]:[]}))}}),I=r.tk.baseTheme({"$panel.gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),N={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100},$=i.r$.define({combine:function(t){return(0,i.BO)(t,N,{highlightWordAroundCursor:function(t,e){return t||e},minSelectionLength:Math.min,maxMatches:Math.min})}});function V(t){var e=[z,_];return t&&e.push($.of(t)),e}var W=r.p.mark({class:(0,r.Zp)("selectionMatch")}),H=r.p.mark({class:(0,r.Zp)("selectionMatch.main")}),_=r.lg.fromClass(function(){function t(e){T(this,t),this.decorations=this.getDeco(e)}return E(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($),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;if(u=n.charCategorizer(s.head),!(a=function(t,e,n){for(var r=t.lineAt(e),o=e-r.from,a=e-r.from;o>0;){var s=(0,x.cp)(r.text,o,!1);if(n(r.text.slice(s,o))!=i.D0.Word)break;o=s}for(;a200)return r.p.none;if(!(a=n.sliceDoc(s.from,s.to).trim()))return r.p.none}var l,c=[],f=A(t.visibleRanges);try{for(f.s();!(l=f.n()).done;)for(var d=l.value,v=new R(n.doc,a,d.from,d.to);!v.next().done;){var p=v.value,g=p.from,m=p.to;if((!u||(0==g||u(n.sliceDoc(g-1,g))!=i.D0.Word)&&(m==n.doc.length||u(n.sliceDoc(m,m+1))!=i.D0.Word))&&(u&&g<=s.from&&m>=s.to?c.push(H.range(g,m)):(g>=s.to||m<=s.from)&&c.push(W.range(g,m)),c.length>e.maxMatches))return r.p.none}}catch(y){f.e(y)}finally{f.f()}return r.p.set(c)}}]),t}(),{decorations:function(t){return t.decorations}}),z=r.tk.baseTheme({$selectionMatch:{backgroundColor:"#99ff7780"},"$searchMatch $selectionMatch":{backgroundColor:"transparent"}}),q=function(){function t(e,n,r){T(this,t),this.search=e,this.replace=n,this.caseInsensitive=r}return E(t,[{key:"eq",value:function(t){return this.search==t.search&&this.replace==t.replace&&this.caseInsensitive==t.caseInsensitive}},{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 R(t,this.search,e,n,this.caseInsensitive?function(t){return t.toLowerCase()}:void 0)}},{key:"valid",get:function(){return!!this.search}}]),t}(),F=i.Py.define(),U=i.Py.define(),G=i.QQ.define({create:function(){return new K(new q("","",!1),[])},update:function(t,e){var n,r=A(e.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.is(F)?t=new K(i.value,t.panel):i.is(U)&&(t=new K(t.query,i.value?[at]:[]))}}catch(o){r.e(o)}finally{r.f()}return t},provide:function(t){return f.computeN([t],(function(e){return e.field(t).panel}))}}),K=function t(e,n){T(this,t),this.query=e,this.panel=n},J=r.p.mark({class:(0,r.Zp)("searchMatch")}),Y=r.p.mark({class:(0,r.Zp)("searchMatch.selected")}),X=r.lg.fromClass(function(){function t(e){T(this,t),this.view=e,this.decorations=this.highlight(e.state.field(G))}return E(t,[{key:"update",value:function(t){var e=t.state.field(G);(e!=t.startState.field(G)||t.docChanged||t.selectionSet)&&(this.decorations=this.highlight(e))}},{key:"highlight",value:function(t){var e=t.query;if(!t.panel.length||!e.valid)return r.p.none;for(var n=this.view.state,i=this.view.viewport,o=e.cursor(n.doc,Math.max(0,i.from-e.search.length),Math.min(i.to+e.search.length,n.doc.length)),a=new k.f_,s=function(){var t=o.value,e=t.from,r=t.to,i=n.selection.ranges.some((function(t){return t.from==e&&t.to==r}));a.add(e,r,i?Y:J)};!o.next().done;)s();return a.finish()}}]),t}(),{decorations:function(t){return t.decorations}});function Q(t){return function(e){var n=e.state.field(G,!1);return n&&n.query.valid?t(e,n):st(e)}}function Z(t,e,n){var r=n.cursor(t,e).next();return r.done&&(r=n.cursor(t,0,e+n.search.length-1).next()).done?null:r.value}var tt=Q((function(t,e){var n=t.state.selection.main,r=n.from,i=n.to,o=Z(t.state.doc,t.state.selection.main.from+1,e.query);return!(!o||o.from==r&&o.to==i)&&(t.dispatch({selection:{anchor:o.from,head:o.to},scrollIntoView:!0}),ft(t),!0)}));function et(t,e,n,r){for(var i=r;;){for(var o=Math.max(n,i-1e4-t.search.length),a=t.cursor(e,o,i),s=null;!a.next().done;)s=a.value;if(s)return s;if(o==n)return null;i-=1e4}}var nt=Q((function(t,e){var n=e.query,r=t.state,i=et(n,r.doc,0,r.selection.main.to-1)||et(n,r.doc,r.selection.main.from+1,r.doc.length);return!!i&&(t.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),ft(t),!0)})),rt=Q((function(t,e){for(var n=e.query.cursor(t.state.doc),r=[];!n.next().done;)r.push(i.jT.range(n.value.from,n.value.to));return!!r.length&&(t.dispatch({selection:i.jT.create(r)}),!0)})),it=Q((function(t,e){var n=e.query,r=t.state,i=Z(r.doc,r.selection.main.from,n);if(!i)return!1;var o,a=r.selection.main,s=a.from,u=a.to,h=[];if(i.from==s&&i.to==u&&(h.push({from:i.from,to:i.to,insert:n.replace}),i=Z(r.doc,i.to,n)),i){var l=0==h.length||h[0].from>=i.to?0:i.to-i.from-n.replace.length;o={anchor:i.from-l,head:i.to-l}}return t.dispatch({changes:h,selection:o,scrollIntoView:!!o}),i&&ft(t),!0})),ot=Q((function(t,e){for(var n=e.query,r=n.cursor(t.state.doc),i=[];!r.next().done;){var o=r.value,a=o.from,s=o.to;i.push({from:a,to:s,insert:n.replace})}return!!i.length&&(t.dispatch({changes:i}),!0)}));function at(t){var e=t.state.field(G).query;return{dom:lt({view:t,query:e,updateQuery:function(n){e.eq(n)||(e=n,t.dispatch({effects:F.of(e)}))}}),mount:function(){this.dom.querySelector("[name=search]").select()},pos:80,style:"search"}}var st=function(t){var e=t.state.field(G,!1);if(e&&e.panel.length){var n=d(t,at);if(!n)return!1;n.dom.querySelector("[name=search]").focus()}else t.dispatch({effects:U.of(!0),reconfigure:e?void 0:{append:vt}});return!0},ut=function(t){var e=t.state.field(G,!1);if(!e||!e.panel.length)return!1;var n=d(t,at);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:U.of(!1)}),!0},ht=[{key:"Mod-f",run:st,scope:"editor search-panel"},{key:"F3",run:tt,shift:nt,scope:"editor search-panel"},{key:"Mod-g",run:tt,shift:nt,scope:"editor search-panel"},{key:"Escape",run:ut,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 R(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=d(t,B);return e||(t.dispatch({reconfigure:null==t.state.field(j,!1)?{append:[c(),j,I]}:void 0,effects:L.of(!0)}),e=d(t,B)),e&&e.dom.querySelector("input").focus(),!0}}];function lt(t){function e(e){return t.view.state.phrase(e)}var n=w("input",{value:t.query.search,placeholder:e("Find"),"aria-label":e("Find"),class:(0,r.Zp)("textfield"),name:"search",onchange:a,onkeyup:a}),i=w("input",{value:t.query.replace,placeholder:e("Replace"),"aria-label":e("Replace"),class:(0,r.Zp)("textfield"),name:"replace",onchange:a,onkeyup:a}),o=w("input",{type:"checkbox",name:"case",checked:!t.query.caseInsensitive,onchange:a});function a(){t.updateQuery(new q(n.value,i.value,!o.checked))}function s(t,e,n){return w("button",{class:(0,r.Zp)("button"),name:t,onclick:e},n)}return w("div",{onkeydown:function(e){(0,r.$1)(t.view,e,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==n?(e.preventDefault(),(e.shiftKey?nt:tt)(t.view)):13==e.keyCode&&e.target==i&&(e.preventDefault(),it(t.view))}},[n,s("next",(function(){return tt(t.view)}),[e("next")]),s("prev",(function(){return nt(t.view)}),[e("previous")]),s("select",(function(){return rt(t.view)}),[e("all")]),w("label",null,[o,"match case"]),w("br"),i,s("replace",(function(){return it(t.view)}),[e("replace")]),s("replaceAll",(function(){return ot(t.view)}),[e("replace all")]),w("button",{name:"close",onclick:function(){return ut(t.view)},"aria-label":e("close")},["×"]),w("div",{style:"position: absolute; top: -10000px","aria-live":"polite"})])}var ct=/[\s\.,:;?!]/;function ft(t){var e=t.state.selection.main,n=e.from,r=e.to,i=t.state.doc.lineAt(n).from,o=t.state.doc.lineAt(r).to,a=Math.max(i,n-30),s=Math.min(o,r+30),u=t.state.sliceDoc(a,s);if(a!=i)for(var h=0;h<30;h++)if(!ct.test(u[h+1])&&ct.test(u[h])){u=u.slice(h);break}if(s!=o)for(var l=u.length-1;l>u.length-30;l--)if(!ct.test(u[l-1])&&ct.test(u[l])){u=u.slice(0,l);break}var c=d(t,at);c&&c.dom.contains(t.root.activeElement)&&(c.dom.querySelector("div[aria-live]").textContent=t.state.phrase("current match")+". "+u)}var dt=r.tk.baseTheme({"$panel.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":{margin:".2em .5em .2em 0"},"& label":{fontSize:"80%"}},"$$light $searchMatch":{backgroundColor:"#ffff0054"},"$$dark $searchMatch":{backgroundColor:"#00ffff8a"},"$$light $searchMatch.selected":{backgroundColor:"#ff6a0054"},"$$dark $searchMatch.selected":{backgroundColor:"#ff00ff8a"}}),vt=[G,i.Wl.override(X),c(),dt]},77885:function(t,e,n){"use strict";n.d(e,{q6:function(){return Z},as:function(){return m},D0:function(){return ut},jT:function(){return C},yy:function(){return vt},r$:function(){return D},gc:function(){return v},Wl:function(){return V},Py:function(){return et},QQ:function(){return L},YW:function(){return rt},BO:function(){return pt},kU:function(){return _}});var r=n(23414);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})(t)}function o(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){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=t[Symbol.iterator]()},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:"composeDesc",value:function(t){return this.empty?t:t.empty?this:S(this,t)}},{key:"mapDesc",value:function(t){var e=arguments.length>1&&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]:v.Simple,r=0,i=0,o=0;ot)return i+(t-r);i+=a}else{if(n!=v.Simple&&u>=t&&(n==v.TrackDel&&rt||n==v.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:"length",get:function(){for(var t=0,e=0;e1&&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:"filter",value:function(t){var e=[],r=[],i=[],o=new x(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:"desc",get:function(){return new g(this.sections)}}],[{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||v<0||m>e)throw new RangeError("Invalid change range ".concat(v," to ").concat(m," (in doc of length ").concat(e,")"));var w=b?"string"==typeof b?r.xv.of(b.split(i||p)):b:r.xv.empty,S=w.length;if(v==m&&0==S)return;vu&&y(a,v-u,-1),y(a,m-v,S),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 x(t),s=new x(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 x(t),a=new x(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 x=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 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)}},{key:"done",get:function(){return-2==this.ins}},{key:"len2",get:function(){return this.ins<0?this.len:this.ins}},{key:"text",get:function(){var t=this.set.inserted,e=this.i-2>>1;return e>=t.length?r.xv.empty:t[e]}}]),t}(),A=function(){function t(e,n,r){c(this,t),this.from=e,this.to=n,this.flags=r}return d(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:"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:"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:"main",get:function(){return this.ranges[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){if(!e||e.reconfigure)return t.values[a]=r(t),1;if(!(u&&e.docChanged||h&&(e.docChanged||e.selection)||l.some((function(e){return(1&F(t,e))>0}))))return 0;var n=r(t),o=e.startState.values[a];return(s?function(t,e,n){if(t.length!=e.length)return!1;for(var r=0;r>1;return function(t,n){var u,h=n?n.reconfigure?n.startState.config.address[e.id]:s<<1:null,l=null==h,c=o(a);try{for(c.s();!(u=c.n()).done;){1&F(t,u.value)&&(l=!0)}}catch(k){c.e(k)}finally{c.f()}if(!l)return 0;for(var f=[],d=0;d>1;return function(t,r){if(!r)return t.values[n]=e.create(t),1;var i,o=0;if(r.reconfigure){var a=function(t,e){var n=t.config.address[e];return null==n?null:n>>1}(r.startState,e.id);i=null==a?e.create(r.startState):r.startState.values[a],o=1}else i=r.startState.values[n];var s=e.updateF(i,r);return o||e.compareF(i,s)||(o=1),o&&(t.values[n]=s),o}}},{key:"init",value:function(t){return[this,B.of({field:this,create:t})]}}],[{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}(),j=2,I=1,N=0;function $(t){return function(e){return new W(e,t)}}var V={fallback:$(3),default:$(j),extend:$(I),override:$(N)},W=function t(e,n){c(this,t),this.inner=e,this.prec=n},H=function t(e,n){c(this,t),this.tag=e,this.inner=n};function _(t,e){return new H(t,e)}var z=function(){function t(e,n,r,i,o){for(c(this,t),this.source=e,this.replacements=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.statusTemplate=[];this.statusTemplate.length>1]}}],[{key:"resolve",value:function(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.create(null),i=arguments.length>2?arguments[2]:void 0,a=[],s=Object.create(null),u=o(q(e,r));try{for(u.s();!(n=u.n()).done;){var h=n.value;h instanceof L?a.push(h):(s[h.facet.id]||(s[h.facet.id]=[])).push(h)}}catch(y){u.e(y)}finally{u.f()}for(var l=Object.create(null),c=[],f=[],d=function(){var t=p[v];l[t.id]=f.length<<1,f.push((function(e){return t.slot(e)}))},v=0,p=a;v=s)return;var h=n[u].indexOf(t);h>-1&&n[u].splice(h,1)}if(r.set(t,s),Array.isArray(t)){var l,c=o(t);try{for(c.s();!(l=c.n()).done;){a(l.value,s)}}catch(f){c.e(f)}finally{c.f()}}else if(t instanceof H){if(t.tag in i)throw new RangeError("Duplicate use of tag '".concat(String(t.tag),"' in extensions"));i[t.tag]=!0,a(e[t.tag]||t.inner,s)}else t instanceof W?a(t.inner,t.prec):t instanceof L?(n[s].push(t),t.provides&&a(t.provides,s)):t instanceof P?(n[s].push(t),t.facet.extensions&&a(t.facet.extensions,s)):a(t.extension,s)}a(t,j);var s,u,h=o((u=e,(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(u):[]).concat(Object.keys(u))));try{for(h.s();!(s=h.n()).done;){var l=s.value;!(l in i)&&"full"!=l&&e[l]&&(i[l]=!0,a(e[l],j))}}catch(c){h.e(c)}finally{h.f()}return n.reduce((function(t,e){return t.concat(e)}))}function F(t,e){if(1&e)return 2;var n=e>>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(),K=D.define({combine:function(t){return t.some((function(t){return t}))},static:!0}),J=D.define({combine:function(t){return t.length?t[0]:void 0},static:!0}),Y=D.define(),X=D.define(),Q=D.define(),Z=function(){function t(e,n){c(this,t),this.type=e,this.value=n}return d(t,null,[{key:"define",value:function(){return new tt}}]),t}(),tt=function(){function t(){c(this,t)}return d(t,[{key:"of",value:function(t){return new Z(this,t)}}]),t}(),et=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 nt(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}(),nt=function(){function t(e){c(this,t),this.map=e}return d(t,[{key:"of",value:function(t){return new et(this,t)}}]),t}(),rt=function(){function t(e,n,r,i,o,a,s){c(this,t),this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.reconfigure=a,this.scrollIntoView=s,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:"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:"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:"docChanged",get:function(){return!this.changes.empty}}]),t}();function it(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=ot(t,at(e,o,t.changes.newLength),!0))}return r==t?t:new rt(e,t.changes,t.selection,r.effects,r.annotations,r.reconfigure,r.scrollIntoView)}(n?function(t){var e,n=t.startState,r=!0,i=o(n.facet(Y));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:it(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 rt(n,s,t.selection&&t.selection.map(u),et.mapEffects(t.effects,u),t.annotations,t.reconfigure,t.scrollIntoView)}for(var l=n.facet(X),c=l.length-1;c>=0;c--){var f=l[c](t);t=f instanceof rt?f:Array.isArray(f)&&1==f.length&&f[0]instanceof rt?f[0]:st(n,lt(f),!1)}return t}(s):s)}rt.time=Z.define(),rt.userEvent=Z.define(),rt.addToHistory=Z.define();var ut,ht=[];function lt(t){return null==t?ht:Array.isArray(t)?t:[t]}!function(t){t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other"}(ut||(ut={}));var ct,ft=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{ct=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(gt){}function dt(t){return function(e){if(!/\S/.test(e))return ut.Space;if(function(t){if(ct)return ct.test(t);for(var e=0;e""&&(n.toUpperCase()!=n.toLowerCase()||ft.test(n)))return!0}return!1}(e))return ut.Word;for(var n=0;n-1)return ut.Word;return ut.Other}}var vt=function(){function t(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(c(this,t),this.config=e,this.doc=n,this.selection=r,this.applying=null,this.status=e.statusTemplate.slice(),i&&!i.reconfigure)this.values=i.startState.values.slice();else if(this.values=e.dynamicSlots.map((function(t){return null})),i)for(var o in e.address){var a=e.address[o],s=i.startState.config.address[o];null!=s&&0==(1&a)&&(this.values[a>>1]=U(i.startState,s))}this.applying=i,i&&(i._state=this);for(var u=0;u1&&void 0!==arguments[1])||arguments[1],n=this.config.address[t.id];if(null!=n)return F(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;n0&&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)||p))}},{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:(F(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)e[n]=t[n].spec.toJSON(this.field(t[n]),this);return e}},{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=[],i=o(this.facet(G));try{for(i.s();!(n=i.n()).done;){var a,s=o((0,n.value)(this,e));try{for(s.s();!(a=s.n()).done;){var u=a.value;Object.prototype.hasOwnProperty.call(u,t)&&r.push(u[t])}}catch(h){s.e(h)}finally{s.f()}}}catch(h){i.e(h)}finally{i.f()}return r}},{key:"charCategorizer",value:function(t){return dt(this.languageDataAt("wordChars",t).join(""))}},{key:"tabSize",get:function(){return this.facet(t.tabSize)}},{key:"lineBreak",get:function(){return this.facet(t.lineSeparator)||"\n"}}],[{key:"fromJSON",value:function(e){var n=arguments.length>1&&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=z.resolve(e.extensions||[]),i=e.doc instanceof r.xv?e.doc:r.xv.of((e.doc||"").split(n.staticFacet(t.lineSeparator)||p)),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(K)||(o=o.asSingle()),new t(n,i,o)}}]),t}();function pt(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=t[Symbol.iterator]()},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){if(t){if("string"==typeof t)return c(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)?c(t,e):void 0}}function c(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;return null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length),(0,a.IS)(t.slice(r,e),i,n)}var S=function(){function t(e,n,r){y(this,t),this.string=e,this.tabSize=n,this.indentUnit=r,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}return b(t,[{key:"eol",value:function(){return this.pos>=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 x(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){!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&&f(t,e)}(n,t);var e=d(n);function n(t){var i;y(this,n);var a,s=(0,o.kU)(t.languageData),u={token:(a=t).token,blankLine:a.blankLine||function(){},startState:a.startState||function(){return!0},copyState:a.copyState||x,indent:a.indent||function(){return null},languageData:a.languageData||{}};return(i=e.call(this,s,{startParse:function(t,e,n){return new O(p(i),t,e,n)}},[o.tK.of((function(t,e){return i.getIndent(t,e)}))])).streamParser=u,i.docType=function(t){var e=E.length;return E.push(new r.Jq("document",o.mi.set(Object.create(null),t),e)),e}(s),i.stateAfter=new WeakMap,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!=E[this.docType];)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&&t.stateAfter.get(e);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!=E[t.docType]||(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,u.tree,0-u.offset,n,u.to),c=void 0;if(l&&(c=M(t,u.tree,n+u.offset,l.pos+u.offset,!1)))return{state:l.state,tree:c}}}catch(f){s.e(f)}finally{s.f()}return{state:t.streamParser.startState((0,o.y1)(i)),tree:r.mp.empty}}(e,a.fragments,i,a.state),u=s.state,l=s.tree;this.state=u,this.pos=this.chunkStart=i+l.length,l.length&&(this.chunks.push(l),this.chunkPos.push(i)),this.pose.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 B(t){return t?D[t]||(D[t]=function(t){var e,n=null,o=h(t.split("."));try{for(o.s();!(e=o.n()).done;){var a=e.value,u=i.pJ[a];u?"function"==typeof u?n?n=u(n):V(a,"Modifier ".concat(a," used at start of tag")):n?V(a,"Tag ".concat(a," used as modifier")):n=u:V(a,"Unknown highlighting tag ".concat(a))}}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)(s({},l,n))]});return E.push(c),c.id}(t)):0}for(var L=0,j=[["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"]];L-1||(R.push(t),console.warn(e))}},23414:function(t,e,n){"use strict";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})(t)}function i(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){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=t[Symbol.iterator]()},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);nt)return p[e-1]<=t;return!1}function y(t){return t>=127462&&t<=127487}function k(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(n?b:w)(t,e)}function b(t,e){if(e==t.length)return e;e&&S(t.charCodeAt(e))&&x(t.charCodeAt(e-1))&&e--;var n=A(t,e);for(e+=C(n);e=0&&y(A(t,o));)i++,o-=2;if(i%2==0)break;e+=2}}return e}function w(t,e){for(;e>0;){var n=b(t,e-2);if(n=56320&&t<57344}function x(t){return t>=55296&&t<56320}function A(t,e){var n=t.charCodeAt(e);if(!x(n)||e+1==t.length)return n;var r=t.charCodeAt(e+1);return S(r)?r-56320+(n-55296<<10)+65536:n}function C(t){return t<65536?1:2}function M(t,e,n){for(var r=0;r=n)return{offset:i,leftOver:0};e+=9==t.charCodeAt(i)?r-e%r:1,i=k(t,i)}return{offset:t.length,leftOver:n-e}}var T=function(){function t(){f(this,t)}return v(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),E.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),E.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=new L(this),n=new L(t);;){if(e.next(),n.next(),e.lineBreak!=n.lineBreak||e.done!=n.done||e.value!=n.value)return!1;if(e.done)return!0}}},{key:"iter",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return new L(this,t)}},{key:"iterRange",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length;return new j(this,t,e)}},{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 D(e):E.from(D.split(e,[])):t.empty}}]),t}();"undefined"!=typeof Symbol&&(T.prototype[Symbol.iterator]=function(){return this.iter()});var D=function(t){s(n,t);var e=h(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:P(t);return f(this,n),(r=e.call(this)).text=t,r.length=i,r}return v(n,[{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 I(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(B(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(1&i){var a=r.pop(),s=R(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 a(c(n.prototype),"replace",this).call(this,t,e,r);var i=R(this.text,R(r.text,B(this.text,0,t)),e),o=this.length+r.length-(e-t);return i.length<=32?new n(i,o):E.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=i(this.text);try{for(n.s();!(e=n.n()).done;){var r=e.value;t.push(r)}}catch(o){n.e(o)}finally{n.f()}}},{key:"lines",get:function(){return this.text.length}},{key:"children",get:function(){return null}}],[{key:"split",value:function(t,e){var r,o=[],a=-1,s=i(t);try{for(s.s();!(r=s.n()).done;){var u=r.value;o.push(u),a+=u.length+1,32==o.length&&(e.push(new n(o,a)),o=[],a=-1)}}catch(h){s.e(h)}finally{s.f()}return a>-1&&e.push(new n(o,a)),e}}]),n}(T),E=function(t){s(n,t);var e=h(n);function n(t,r){var o;f(this,n),(o=e.call(this)).children=t,o.length=r,o.lines=0;var a,s=i(t);try{for(s.s();!(a=s.n()).done;){var u=a.value;o.lines+=u.lines}}catch(h){s.e(h)}finally{s.f()}return o}return v(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<=u){var h=s.replace(t-o,e-o,r),l=this.lines-s.lines+h.lines;if(h.lines>4&&h.lines>l>>6){var f=this.children.slice();return f[i]=h,new n(f,this.length-(e-t)+r.length)}return a(c(n.prototype),"replace",this).call(this,o,u,h)}o=u+1}return a(c(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=i(this.children);try{for(n.s();!(e=n.n()).done;){e.value.flatten(t)}}catch(r){n.e(r)}finally{n.f()}}}],[{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),o=0,a=i(t);try{for(a.s();!(e=a.n()).done;){var s=e.value;o+=s.lines}}catch(A){a.e(A)}finally{a.f()}if(o<32){var u,h=[],l=i(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 D(h,r)}var f=Math.max(32,o>>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,o=i(t.children);try{for(o.s();!(r=o.n()).done;){k(r.value)}}catch(A){o.e(A)}finally{o.f()}}else t.lines>v&&(g>v||!g)?(b(),p.push(t)):t instanceof D&&g&&(e=y[y.length-1])instanceof D&&t.lines+e.lines<=32?(g+=t.lines,m+=t.length+1,y[y.length-1]=new D(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,S=i(t);try{for(S.s();!(w=S.n()).done;){var x=w.value;k(x)}}catch(A){S.e(A)}finally{S.f()}return b(),1==p.length?p[0]:new n(p,r)}}]),n}(T);function P(t){var e,n=-1,r=i(t);try{for(r.s();!(e=r.n()).done;){n+=e.value.length+1}}catch(o){r.e(o)}finally{r.f()}return n}function R(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;f(this,t),this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?0:e instanceof D?e.text.length:e.children.length]}return v(t,[{key:"next",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;;){var e=this.nodes.length-1;if(e<0)return this.done=!0,this.value="",this.lineBreak=!1,this;var n=this.nodes[e],r=this.offsets[e],i=n instanceof D?n.text.length:n.children.length;if(r==(this.dir>0?i:0))this.nodes.pop(),this.offsets.pop();else if(this.lineBreak||r==(this.dir>0?0:i))if(n instanceof D){var o=n.text[r-(this.dir<0?1:0)];if(this.offsets[e]=r+=this.dir,this.lineBreak=!1,o.length>Math.max(0,t))return this.value=0==t?o:this.dir>0?o.slice(t):o.slice(0,o.length-t),this;t-=o.length}else{var a=n.children[this.dir>0?r:r-1];this.offsets[e]=r+this.dir,this.lineBreak=!1,t>a.length?t-=a.length:(this.nodes.push(a),this.offsets.push(this.dir>0?0:a instanceof D?a.text.length:a.children.length))}else{if(this.lineBreak=!0,0==t)return this.value="\n",this;t--}}}}]),t}(),j=function(){function t(e,n,r){f(this,t),this.value="",this.cursor=new L(e,n>r?-1:1),n>r?(this.skip=e.length-n,this.limit=n-r):(this.skip=n,this.limit=r-n)}return v(t,[{key:"next",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.limit<=0)this.limit=-1;else{var e=this.cursor.next(this.skip+t),n=e.value,r=e.lineBreak,i=e.done;this.skip=0,this.value=n;var o=r?1:n.length;o>this.limit&&(this.value=this.cursor.dir>0?n.slice(0,this.limit):n.slice(o-this.limit)),i||0==this.value.length?this.limit=-1:this.limit-=this.value.length}return this}},{key:"lineBreak",get:function(){return this.cursor.lineBreak}},{key:"done",get:function(){return this.limit<0}}]),t}(),I=function(){function t(e,n,r,i){f(this,t),this.from=e,this.to=n,this.number=r,this.text=i}return v(t,[{key:"length",get:function(){return this.to-this.from}}]),t}()},19753:function(t,e,n){"use strict";n.d(e,{kH:function(){return Ct},p:function(){return Ot},Nm:function(){return ke},tk:function(){return Hn},BF:function(){return ne},lg:function(){return oe},$f:function(){return Zn},$1:function(){return nr},Zp:function(){return $t}});for(var r=n(77885),i=n(23414),o=n(62038),a=n(13764),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,e,n){return(m="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}})(t,e,n||t)}function y(t){return(y="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})(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})(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 Date.prototype.toString.call(Reflect.construct(Date,[],(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 S(this,n)}}function S(t,e){return!e||"object"!==y(e)&&"function"!=typeof e?x(t):e}function x(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)})(t)}function C(t){return function(t){if(Array.isArray(t))return P(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||E(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;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=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=t[Symbol.iterator]()},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 instanceof e))throw new TypeError("Cannot call a class as a function")}function T(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n2),android:/Android\b/.test(B.userAgent),webkit:H,safari:_,webkit_version:H?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=L.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};function q(t){return t.getSelection?t.getSelection():document.getSelection()}function F(t,e){if(!e.anchorNode)return!1;try{return t.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)}catch(n){return!1}}function U(t){if(3==t.nodeType){var e=it();return e.setEnd(t,t.nodeValue.length),e.setStart(t,0),e.getClientRects()}return 1==t.nodeType?t.getClientRects():[]}function G(t,e,n,r){return!!n&&(J(t,e,n,r,-1)||J(t,e,n,r,1))}function K(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e}function J(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Y(t))){if("DIV"==t.nodeName)return!1;var o=t.parentNode;if(!o||1!=o.nodeType)return!1;e=K(t)+(i<0?0:1),t=o}else{if(1!=t.nodeType)return!1;t=t.childNodes[e+(i<0?-1:0)],e=i<0?Y(t):0}}}function Y(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}var X={left:0,right:0,top:0,bottom:0};function Q(t,e){var n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function Z(t){return{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}var tt,et=function(){function t(){O(this,t),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}return D(t,[{key:"eq",value:function(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}},{key:"set",value:function(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}}]),t}(),nt=null;function rt(t){if(t.setActive)return t.setActive();if(nt)return t.focus(nt);for(var e=[],n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(null==nt?{get preventScroll(){return nt={preventScroll:!0},!0}}:void 0),!nt){nt=!1;for(var r=0;r2&&void 0!==arguments[2])||arguments[2];O(this,t),this.node=e,this.offset=n,this.precise=r}return D(t,null,[{key:"before",value:function(e,n){return new t(e.parentNode,K(e),n)}},{key:"after",value:function(e,n){return new t(e.parentNode,K(e)+1,n)}}]),t}(),at=[],st=function(){function t(){O(this,t),this.parent=null,this.dom=null,this.dirty=2}return D(t,[{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){if(2&this.dirty){var n,r=this.dom,i=null,o=M(this.children);try{for(o.s();!(n=o.n()).done;){var a=n.value;if(a.dirty){var s=i?i.nextSibling:r.firstChild;!s||a.dom||t.get(s)||a.reuseDOM(s),a.sync(e),a.dirty=0}e&&e.node==r&&i!=a.dom&&(e.written=!0),ht(r,i,a.dom),i=a.dom}}catch(f){o.e(f)}finally{o.f()}var u=i?i.nextSibling:r.firstChild;for(u&&e&&e.node==r&&(e.written=!0);u;)u=ut(u)}else if(1&this.dirty){var h,l=M(this.children);try{for(l.s();!(h=l.n()).done;){var c=h.value;c.dirty&&(c.sync(e),c.dirty=0)}}catch(f){l.e(f)}finally{l.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==Y(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;se)return h.domBoundsAround(t,e,u);if(l>=t&&-1==r&&(r=s,i=u),l>=e&&l!=u&&-1==o){o=s,a=l;break}u=l+h.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+1].dom:null}}},{key:"markDirty",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];2&this.dirty||(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=t,t.cmView=this}},{key:"replaceChildren",value:function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:at;this.markDirty();for(var i=t;i0&&void 0!==arguments[0]?arguments[0]:this.length;return new lt(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:"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:"rootView",get:function(){for(var t=this;;){var e=t.parent;if(!e)return t;t=e}}}],[{key:"get",value:function(t){return t.cmView}}]),t}();function ut(t){var e=t.nextSibling;return t.parentNode.removeChild(t),e}function ht(t,e,n){var r=e?e.nextSibling:t.firstChild;if(n.parentNode==t)for(;r!=n;)r=ut(r);else t.insertBefore(n,r)}st.prototype.breakAfter=0;var lt=function(){function t(e,n,r){O(this,t),this.children=e,this.pos=n,this.i=r,this.off=0}return D(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}(),ct=[],ft=function(t){k(n,t);var e=w(n);function n(){return O(this,n),e.apply(this,arguments)}return D(n,[{key:"become",value:function(t){return!1}},{key:"getSide",value:function(){return 0}}]),n}(st);ft.prototype.children=ct;var dt=function(t){k(n,t);var e=w(n);function n(t){var r;return O(this,n),(r=e.call(this)).text=t,r}return D(n,[{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){return new n(this.text.slice(t))}},{key:"localPosFromDOM",value:function(t,e){return t==this.dom?e:e?this.text.length:0}},{key:"domAtPos",value:function(t){return new ot(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 pt(this.dom,t,e)}},{key:"length",get:function(){return this.text.length}}]),n}(ft),vt=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;O(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(x(r))}}catch(h){s.e(h)}finally{s.f()}return r}return D(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||this.createDOM(),m(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||ee&&r.push(ir&&(e=r);var i=e,o=e,a=0;0==e&&n<0||e==r&&n>=0?z.chrome||z.gecko||(e?(i--,a=1):(o++,a=-1)):n<0?i--:o++;var s=it();s.setEnd(t,o),s.setStart(t,i);var u=s.getClientRects();if(!u.length)return X;var h=u[(a?a<0:n>=0)?0:u.length-1];return z.safari&&!a&&0==h.width&&(h=Array.prototype.find.call(u,(function(t){return t.width}))||h),a?Q(h,a<0):h}var gt=function(t){k(n,t);var e=w(n);function n(t,r,i){var o;return O(this,n),(o=e.call(this)).widget=t,o.length=r,o.side=i,o}return D(n,[{key:"slice",value:function(t){return n.create(this.widget,this.length-t,this.side)}},{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:Q(r,0==t)}},{key:"overrideDOMText",get:function(){if(0==this.length)return i.xv.empty;for(var t=this;t.parent;)t=t.parent;var e=t.editorView,n=e&&e.state.doc,r=this.posAtStart;return n?n.slice(r,r+this.length):i.xv.empty}}],[{key:"create",value:function(t,e,r){return new(t.customView||n)(t,e,r)}}]),n}(ft),mt=function(t){k(n,t);var e=w(n);function n(){return O(this,n),e.apply(this,arguments)}return D(n,[{key:"domAtPos",value:function(t){return new ot(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:"coordsAt",value:function(t,e){return pt(this.widget.text,t,e)}},{key:"overrideDOMText",get:function(){return null}}]),n}(gt);function yt(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(S){p.e(S)}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=0):k.merge(0,l,null,0,0)}else hi&&n0;r--){var s=e[r-1].dom;if(s.parentNode==t)return ot.after(s)}return new ot(t,0)}function bt(t,e,n){var r,i=t.children;n>0&&e instanceof vt&&i.length&&(r=i[i.length-1])instanceof vt&&r.mark.eq(e.mark)?bt(r,e.children[0],n-1):(i.push(e),e.setParent(t)),t.length+=e.length}function wt(t,e,n){for(var r=0,i=0;i=e:a>e)return o.coordsAt(e-r,n);r=a}}return(t.dom.lastChild||t.dom).getBoundingClientRect()}function St(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 xt(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:"heightRelevant",get:function(){return!1}}],[{key:"mark",value:function(t){return new Tt(t)}},{key:"widget",value:function(t){var e=t.side||0;return t.block&&(e+=200000001*(e>0?1:-1)),new Et(t,e,e,!!t.block,t.widget||null,!1)}},{key:"replace",value:function(t){var e=!!t.block,n=Pt(t),r=n.start,i=n.end;return new Et(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 Dt(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);Ot.none=a.Xs.empty;var Tt=function(t){k(n,t);var e=w(n);function n(t){var r;O(this,n);var i=Pt(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 D(n,[{key:"eq",value:function(t){return this==t||t instanceof n&&this.tagName==t.tagName&&this.class==t.class&&xt(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 m(A(n.prototype),"range",this).call(this,t,e)}}]),n}(Ot);Tt.prototype.point=!1;var Dt=function(t){k(n,t);var e=w(n);function n(t){return O(this,n),e.call(this,-1e8,-1e8,null,t)}return D(n,[{key:"eq",value:function(t){return t instanceof n&&xt(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 m(A(n.prototype),"range",this).call(this,t,e)}}]),n}(Ot);Dt.prototype.mapMode=r.gc.TrackBefore,Dt.prototype.point=!0;var Et=function(t){k(n,t);var e=w(n);function n(t,i,o,a,s,u){var h;return O(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 D(n,[{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 m(A(n.prototype),"range",this).call(this,t,e)}},{key:"type",get:function(){return this.startSide=5}}]),n}(Ot);function Pt(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 Rt(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)}Et.prototype.point=!0;var Bt=r.r$.define({combine:function(t){return t.join(" ")}}),Lt=r.r$.define({combine:function(t){return t.indexOf(!0)>-1}}),jt=o.V.newName();function It(t){return t.replace(/\$\w[\w\.]*/g,(function(t){for(var e=t.slice(1).split("."),n="",r=1;r<=e.length;r++)n+=".cm-"+e.slice(0,r).join("-");return n}))}function Nt(t,e){return new o.V(e,{process:function(e){return e=It(e),/\$/.test(e)?e.replace(/\$/,t):t+" "+e},extend:function(e,n){return e=It(e),n.slice(0,t.length+1)==t+" "?t+" "+e.replace(/&/g,n.slice(t.length+1)):e.replace(/&/g,n)}})}function $t(t){if(t.indexOf(".")<0)return"cm-"+t;for(var e=t.split("."),n="",r=1;r<=e.length;r++)n+=(n?" ":"")+"cm-"+e.slice(0,r).join("-");return n}var Vt=Nt("."+jt,{$:{position:"relative !important",boxSizing:"border-box","&$focused":{outline_fallback:"1px dotted #212121",outline:"5px auto -webkit-focus-ring-color"},display:"flex !important",flexDirection:"column"},$scroller:{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},$content:{margin:0,flexGrow:2,minHeight:"100%",display:"block",whiteSpace:"pre",boxSizing:"border-box",padding:"4px 0",outline:"none"},"$$light $content":{caretColor:"black"},"$$dark $content":{caretColor:"white"},$line:{display:"block",padding:"0 2px 0 4px"},$selectionLayer:{zIndex:-1,contain:"size style"},$selectionBackground:{position:"absolute"},"$$light $selectionBackground":{background:"#d9d9d9"},"$$dark $selectionBackground":{background:"#222"},"$$focused$light $selectionBackground":{background:"#d7d4f0"},"$$focused$dark $selectionBackground":{background:"#233"},$cursorLayer:{zIndex:100,contain:"size style",pointerEvents:"none"},"$$focused $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%":{}},$cursor:{position:"absolute",borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none",display:"none"},"$$dark $cursor":{borderLeftColor:"#444"},"$$focused $cursor":{display:"block"},"$$light $activeLine":{backgroundColor:"#f3f9ff"},"$$dark $activeLine":{backgroundColor:"#223039"},"$$light $specialChar":{color:"red"},"$$dark $specialChar":{color:"#f78"},$tab:{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},$placeholder:{color:"#888",display:"inline-block"},$button:{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"3px"},"$$light $button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"$$dark $button":{backgroundImage:"linear-gradient(#555, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},$textfield:{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"$$light $textfield":{backgroundColor:"white"},"$$dark $textfield":{border:"1px solid #555",backgroundColor:"inherit"}}),Wt=$t("line"),Ht=function(t){k(n,t);var e=w(n);function n(){var t;return O(this,n),(t=e.apply(this,arguments)).children=[],t.length=0,t.prevAttrs=void 0,t.attrs=null,t.breakAfter=0,t}return D(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),yt(this,t,e,r?r.children:_t,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){xt(this.attrs,t)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=t)}},{key:"append",value:function(t,e){bt(this,t,e)}},{key:"addLineDeco",value:function(t){var e=t.spec.attributes;e&&(this.attrs=St(e,this.attrs||{}))}},{key:"domAtPos",value:function(t){return kt(this.dom,this.children,t)}},{key:"sync",value:function(t){this.dom||(this.setDOM(document.createElement("div")),this.dom.className=Wt,this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(At(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add(Wt),this.prevAttrs=void 0),m(A(n.prototype),"sync",this).call(this,t);var e=this.dom.lastChild;if(!e||"BR"!=e.nodeName&&st.get(e)instanceof gt){var r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}},{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 dt))return null;var i=U(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 wt(this,t,e)}},{key:"match",value:function(t){return!1}},{key:"type",get:function(){return Ct.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}(st),_t=[],zt=function(t){k(n,t);var e=w(n);function n(t,r,i){var o;return O(this,n),(o=e.call(this)).widget=t,o.length=r,o.type=i,o.breakAfter=0,o}return D(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||e=0;n--)t=new vt(e[n],[t],t.length);return t}},{key:"buildText",value:function(t,e,n){for(;t>0;){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.curLine=null,t--;continue}this.text=i,this.textOff=0}var s=Math.min(this.text.length-this.textOff,t,512);this.getLine().append(this.wrapMarks(new dt(this.text.slice(this.textOff,this.textOff+s)),e),n),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 Et)if(n.block){var a=n.type;a!=Ct.WidgetAfter||this.posCovered()||this.getLine(),this.addWidget(new zt(n.widget||new Ft("div"),o,a))}else{var s=this.wrapMarks(gt.create(n.widget||new Ft("span"),o,n.startSide),r);this.getLine().append(s,i)}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);o&&(this.textOff+o<=this.text.length?this.textOff+=o:(this.skip+=o-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=e),this.openStart<0&&(this.openStart=i)}}],[{key:"build",value:function(e,n,r,i){var o=new t(e,n,r);return o.openEnd=a.Xs.spans(i,n,r,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(),o}}]),t}(),Ft=function(t){k(n,t);var e=w(n);function n(t){var r;return O(this,n),(r=e.call(this)).tag=t,r}return D(n,[{key:"eq",value:function(t){return t.tag==this.tag}},{key:"toDOM",value:function(){return document.createElement(this.tag)}},{key:"updateDOM",value:function(t){return t.nodeName.toLowerCase()==this.tag}}]),n}(Mt),Ut=[],Gt=r.r$.define(),Kt=r.r$.define(),Jt=r.r$.define(),Yt=r.r$.define(),Xt=r.r$.define(),Qt=r.r$.define();function Zt(t,e,n){var r=t.facet(Yt);r.length?r[0](e):window.onerror?window.onerror(String(e),n,void 0,void 0,e):n?console.error(n+":",e):console.error(e)}var te=r.r$.define({combine:function(t){return!t.length||t[0]}}),ee=function t(e,n){O(this,t),this.field=e,this.get=n},ne=function(){function t(){O(this,t)}return D(t,[{key:"from",value:function(t){return new ee(this,t)}}],[{key:"define",value:function(){return new t}}]),t}();ne.decorations=ne.define(),ne.scrollMargins=ne.define();var re=0,ie=r.r$.define(),oe=function(){function t(e,n,r){O(this,t),this.id=e,this.create=n,this.fields=r,this.extension=ie.of(this)}return D(t,null,[{key:"define",value:function(e,n){var r=n||{},i=r.eventHandlers,o=r.provide,a=r.decorations,s=[];if(o){var u,h=M(Array.isArray(o)?o:[o]);try{for(h.s();!(u=h.n()).done;){var l=u.value;s.push(l)}}catch(c){h.e(c)}finally{h.f()}}return i&&s.push(ae.from((function(t){return{plugin:t,handlers:i}}))),a&&s.push(ne.decorations.from(a)),new t(re++,e,s)}},{key:"fromClass",value:function(e,n){return t.define((function(t){return new e(t)}),n)}}]),t}(),ae=ne.define(),se=function(){function t(e){O(this,t),this.spec=e,this.mustUpdate=null,this.value=null}return D(t,[{key:"takeField",value:function(t,e){var n,r=M(this.spec.fields);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i.field,a=i.get;o==t&&e.push(a(this.value))}}catch(s){r.e(s)}finally{r.f()}}},{key:"update",value:function(e){if(this.value){if(this.mustUpdate){var n=this.mustUpdate;if(this.mustUpdate=null,!this.value.update)return this;try{this.value.update(n)}catch(r){if(Zt(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(i){}return t.dummy}}}else try{this.value=this.spec.create(e)}catch(r){return Zt(e.state,r,"CodeMirror plugin crashed"),t.dummy}return this}},{key:"destroy",value:function(t){var e;if(null===(e=this.value)||void 0===e?void 0:e.destroy)try{this.value.destroy()}catch(n){Zt(t.state,n,"CodeMirror plugin crashed")}}}]),t}();se.dummy=new se(oe.define((function(){return{}})));var ue=r.r$.define({combine:function(t){return t.reduce((function(t,e){return St(e,t)}),{})}}),he=r.r$.define({combine:function(t){return t.reduce((function(t,e){return St(e,t)}),{})}}),le=r.r$.define(),ce=r.r$.define(),fe=function(){function t(e,n,r,i){O(this,t),this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}return D(t,[{key:"join",value:function(e){return new t(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}},{key:"addToSet",value:function(t){for(var e=t.length,n=this;e>0;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}(),de=function(){function t(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ut;O(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 fe(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 D(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||(18&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}(),ve=function(t){k(n,t);var e=w(n);function n(t){var r;return O(this,n),(r=e.call(this)).view=t,r.compositionDeco=Ot.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 Ht],r.children[0].setParent(x(r)),r.updateInner([new fe(0,0,0,t.state.doc.length)],r.updateDeco(),0),r}return D(n,[{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=Ot.none:t.transactions.length&&(this.compositionDeco=function(t,e){var n=q(t.root),r=n.focusNode&&me(n.focusNode,n.focusOffset,0);if(!r)return Ot.none;var i,o,a=t.docView.nearest(r),s=r;if(a instanceof ft){for(;a.parent instanceof ft;)a=a.parent;o=(i=a.posAtStart)+a.length,s=a.dom}else{if(!(a instanceof Ht))return Ot.none;for(;s.parentNode!=a.dom;)s=s.parentNode;for(var u=s.previousSibling;u&&!st.get(u);)u=u.previousSibling;i=o=u?st.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(h,d),!1):(this.updateInner(n,c,t.startState.doc.length,h,d),!0)}},{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),this.view.observer.ignore((function(){r.dom.style.height=r.view.viewState.domHeight+"px",r.dom.style.minWidth=r.minWidth?r.minWidth+"px":"";var t=z.chrome?{node:q(r.view.root).focusNode,written:!1}:void 0;r.sync(t),r.dirty=0,(null==t?void 0:t.written)&&(i=!0),r.updateSelection(i,o),r.dom.style.height=""}))}},{key:"updateChildren",value:function(t,e,n){for(var r=this.childCursor(n),i=t.length-1;;i--){var o=i>=0?t[i]:null;if(!o)break;var a=o.fromA,s=o.toA,u=o.fromB,h=o.toB,l=qt.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],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e||this.mayControlSelection()){var n=this.view.state.selection.main,r=this.domAtPos(n.anchor),i=this.domAtPos(n.head),o=q(this.root);(t||!o.focusNode||z.gecko&&n.empty&&ye(o.focusNode,o.focusOffset)||!G(r.node,r.offset,o.anchorNode,o.anchorOffset)||!G(i.node,i.offset,o.focusNode,o.focusOffset))&&this.view.observer.ignore((function(){if(n.empty){if(z.gecko){var t=ye(r.node,r.offset);if(t&&3!=t){var e=me(r.node,r.offset,1==t?1:-1);e&&(r=new ot(e,1==t?0:e.nodeValue.length))}}o.collapse(r.node,r.offset),null!=n.bidiLevel&&null!=o.cursorBidiLevel&&(o.cursorBidiLevel=n.bidiLevel)}else if(o.extend)o.collapse(r.node,r.offset),o.extend(i.node,i.offset);else{var a=document.createRange();if(n.anchor>n.head){var s=[i,r];r=s[0],i=s[1]}a.setEnd(i.node,i.offset),a.setStart(r.node,r.offset),o.removeAllRanges(),o.addRange(a)}})),this.impreciseAnchor=r.precise?null:new ot(o.anchorNode,o.anchorOffset),this.impreciseHead=i.precise?null:new ot(o.focusNode,o.focusOffset)}}},{key:"enforceCursorAssoc",value:function(){var t=this.view.state.selection.main,e=q(this.root);if(t.empty&&t.assoc&&e.modify){var n=Ht.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(te)?this.root.activeElement==this.dom:F(this.dom,q(this.root))}},{key:"nearest",value:function(t){for(var e=t;e;){var n=st.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==Ct.Text||!r||this.children[r-1].breakAfter))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 Ht){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=U(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 lt(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(Ot.replace({widget:new pe(a),block:!0,inclusive:!0}).range(n,o))}if(!i)break;n=i.to+1}return Ot.set(t)}},{key:"updateDeco",value:function(){return this.decorations=[this.computeBlockGapDeco(),this.view.viewState.lineGapDeco,this.compositionDeco].concat(C(this.view.state.facet(le)),C(this.view.pluginField(ne.decorations)))}},{key:"scrollPosIntoView",value:function(t,e){var n=this.coordsAt(t,e);if(n){var r,i=0,o=0,a=0,s=0,u=M(this.view.pluginField(ne.scrollMargins));try{for(u.s();!(r=u.n()).done;){var h=r.value;if(h){var l=h.left,c=h.right,f=h.top,d=h.bottom;null!=l&&(i=Math.max(i,l)),null!=c&&(o=Math.max(o,c)),null!=f&&(a=Math.max(a,f)),null!=d&&(s=Math.max(s,d))}}}catch(v){u.e(v)}finally{u.f()}!function(t,e){for(var n=t.ownerDocument.defaultView,r=t.parentNode;r;)if(1==r.nodeType){var i=void 0,o=r==document.body;if(o)i=Z(n);else{if(r.scrollHeight<=r.clientHeight&&r.scrollWidth<=r.clientWidth){r=r.parentNode;continue}var a=r.getBoundingClientRect();i={left:a.left,right:a.left+r.clientWidth,top:a.top,bottom:a.top+r.clientHeight}}var s=0,u=0;if(e.topi.bottom&&(u=e.bottom-i.bottom+5),e.lefti.right&&(s=e.right-i.right+5),s||u)if(o)n.scrollBy(s,u);else{if(u){var h=r.scrollTop;r.scrollTop+=u,u=r.scrollTop-h}if(s){var l=r.scrollLeft;r.scrollLeft+=s,s=r.scrollLeft-l}e={left:e.left-s,top:e.top-u,right:e.right-s,bottom:e.bottom-u}}if(o)break;r=r.parentNode}else{if(11!=r.nodeType)break;r=r.host}}(this.dom,{left:n.left-i,top:n.top-a,right:n.right+o,bottom:n.bottom+s})}}},{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}}]),n}(st),pe=function(t){k(n,t);var e=w(n);function n(t){var r;return O(this,n),(r=e.call(this)).height=t,r}return D(n,[{key:"toDOM",value:function(){var t=document.createElement("div");return this.updateDOM(t),t}},{key:"eq",value:function(t){return t.height==this.height}},{key:"updateDOM",value:function(t){return t.style.height=this.height+"px",!0}},{key:"estimatedHeight",get:function(){return this.height}}]),n}(Mt);var ge=function(t){k(n,t);var e=w(n);function n(t,r){var i;return O(this,n),(i=e.call(this)).top=t,i.text=r,i}return D(n,[{key:"eq",value:function(t){return this.top==t.top&&this.text==t.text}},{key:"toDOM",value:function(){return this.top}},{key:"ignoreEvent",value:function(){return!1}},{key:"customView",get:function(){return mt}}]),n}(Mt);function me(t,e,n){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&e>0&&n<=0)e=Y(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}(),Te=[];function De(t,e){var n,r=t.length,i=e==we?1:2;if(!t||1==i&&!Me.test(t))return Ee(r);for(var o=0,a=i,s=i;ox;){for(var M=C,O=2!=Te[--C];C>x&&O==(2!=Te[C-1]);)C--;w.push(new Oe(C,M,O?2:1))}else w.push(new Oe(x,S,0))}else for(var T=0;Tt?e.left-t:Math.max(0,t-e.right)}function Le(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function je(t,e){return t.tope.top+1}function Ie(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function $e(t,e,n){for(var r,i,o,a,s,u,h,l,c=t.firstChild;c;c=c.nextSibling)for(var f=U(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&&je(h,v)?h=Ne(h,v.bottom):l&&je(l,v)&&(l=Ie(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?Ve(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)}:$e(r,m,n)}function Ve(t,e,n){for(var r=t.nodeValue.length,i=it(),o=0;o=e&&u.top-1<=n&&u.bottom+1>=n)){var h=e>=(u.left+u.right)/2,l=h;if(z.chrome||z.gecko)i.setEnd(t,o),i.getBoundingClientRect().left==u.right&&(l=!h);return{node:t,offset:o+(l?1:0)}}}}return{node:t,offset:0}}function We(t,e){for(var n,r=e.x,i=e.y,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,a=t.contentDOM.getBoundingClientRect(),s=t.defaultLineHeight/2,u=!1;;){if((n=t.blockAtHeight(i,a.top)).top>i||n.bottomi?-1:1,i=Math.min(n.bottom-s,Math.max(n.top+s,i)),u)return-1;u=!0}if(n.type==Ct.Text)break;i=o>0?n.bottom+s:n.top-s}var h=n.from;if(ht.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:null;r=Math.max(a.left+1,Math.min(a.right-1,r));var l,c=t.root,f=c.elementFromPoint(r,i),d=-1;if(f&&t.contentDOM.contains(f)&&!(t.docView.nearest(f)instanceof gt))if(c.caretPositionFromPoint){var v=c.caretPositionFromPoint(r,i);v&&(l=v.offsetNode,d=v.offset)}else if(c.caretRangeFromPoint){var p=c.caretRangeFromPoint(r,i);p&&(l=p.startContainer,d=p.startOffset)}if(!l||!t.docView.dom.contains(l)){var g=Ht.find(t.docView,h),m=$e(g.dom,r,i);l=m.node,d=m.offset}return t.docView.posFromDOM(l,d)}function He(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==ke.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=Ht.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 _e(t,e,n,i){for(var o=t.state.doc.lineAt(e.head),a=t.bidiSpans(o),s=e,u=null;;){var h=Re(o,a,t.textDirection,s,n),l=Pe;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}}var ze=function(){function t(e){var n=this;O(this,t),this.lastKeyCode=0,this.lastKeyTime=0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=-1,this.compositionEndedAt=0,this.mouseSelection=null;var r=function(t){var r=Ge[t];e.contentDOM.addEventListener(t,(function(i){!Ue(e,i)||n.ignoreDuringComposition(i)||"keydown"==t&&n.screenKeyEvent(e,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 Ge)r(i);e.contentDOM.addEventListener("keydown",(function(t){e.inputState.lastKeyCode=t.keyCode,e.inputState.lastKeyTime=Date.now()})),this.notifiedFocused=e.hasFocus,this.ensureHandlers(e)}return D(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(ae));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){Ue(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){Zt(e.state,u)}if(s||n.defaultPrevented)return z.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){Zt(t.state,a)}}}catch(s){r.e(s)}finally{r.f()}}},{key:"ignoreDuringComposition",value:function(t){return!!/^key/.test(t.type)&&(this.composing>0||!!(z.safari&&t.timeStamp-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 D(t,[{key:"move",value:function(t){if(0==t.buttons)return this.destroy();!1===this.dragging&&this.select(t)}},{key:"up",value:function(t){null==this.dragging&&this.select(this.startEvent),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,annotations:r.YW.userEvent.of("pointerselection"),scrollIntoView:!0})}},{key:"update",value:function(t){t.docChanged&&this.dragging&&(this.dragging=this.dragging.map(t.changes)),this.style.update(t)}}]),t}();function Ue(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=st.get(r))&&n.ignoreEvent(e))return!1;return!0}var Ge=Object.create(null),Ke=z.ie&&z.ie_version<15||z.ios&&z.webkit_version<604;function Je(t,e){var n,i=t.state,o=1,a=i.toText(e),s=a.lines==i.selection.ranges.length;if(an&&i.selection.ranges.every((function(t){return t.empty}))&&an==a.toString()){var u=-1;n=i.changeByRange((function(t){var n=i.doc.lineAt(t.from);if(n.from==u)return{range:t};u=n.from;var h=i.toText((s?a.line(o++).text:e)+i.lineBreak);return{changes:{from:n.from,insert:h},range:r.jT.cursor(t.from+h.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,{annotations:r.YW.userEvent.of("paste"),scrollIntoView:!0})}Ge.keydown=function(t,e){(function(t){var e=(t.ctrlKey?1:0)|(t.metaKey?8:0)|(t.altKey?2:0)|(t.shiftKey?4:0),n=t.keyCode,r=z.mac&&1==e;return 8==n||r&&72==n||46==n||r&&68==n||27==n||e==(z.mac?8:1)&&(66==n||73==n||89==n||90==n)})(e)&&e.preventDefault(),t.inputState.setSelectionOrigin("keyboardselection")};var Ye=0;function Xe(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()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(on+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))},get:function(e,u,h){var l;if(e.clientX==s.clientX&&e.clientY==s.clientY?l=a:(l=a=en(t,e),s=e),!l||!n)return o;var c=Xe(t,l.pos,l.bias,i);if(n.pos!=l.pos&&!u){var f=Xe(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},Ze=function(t,e,n){return Qe(e,n)&&t>=n.left&&t<=n.right};function tn(t,e,n,r){var i=Ht.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&&Ze(n,r,a))return-1;var s=i.coordsAt(o,1);return s&&Ze(n,r,s)?1:a&&Qe(r,a)?-1:1}function en(t,e){var n=t.posAtCoords({x:e.clientX,y:e.clientY});return null==n?null:{pos:n,bias:tn(t,n,e.clientX,e.clientY)}}var nn=z.ie&&z.ie_version<=11,rn=null,on=0;Ge.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")},Ge.drop=function(t,e){if(e.dataTransfer){var n=t.posAtCoords({x:e.clientX,y:e.clientY}),i=e.dataTransfer.getData("Text");if(null!=n&&i){e.preventDefault();var o=t.inputState.mouseSelection,a=o&&o.dragging&&o.dragMove?{from:o.dragging.from,to:o.dragging.to}:null,s={from:n,insert:i},u=t.state.changes(a?[a,s]:s);t.focus(),t.dispatch({changes:u,selection:{anchor:u.mapPos(n,-1),head:u.mapPos(n,1)},annotations:r.YW.userEvent.of("drop")})}}},Ge.paste=function(t,e){t.observer.flush();var n=Ke?null:e.clipboardData,r=n&&n.getData("text/plain");r?(Je(t,r),e.preventDefault()):function(t){var e=t.dom.parentNode;if(e){var n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout((function(){t.focus(),n.remove(),Je(t,n.value)}),50)}}(t)};var an=null;function sn(t){t.docView.compositionDeco.size&&t.update([])}Ge.copy=Ge.cut=function(t,e){var n=function(t){var e,n=[],r=[],i=!1,o=M(t.selection.ranges);try{for(o.s();!(e=o.n()).done;){var a=e.value;a.empty||(n.push(t.sliceDoc(a.from,a.to)),r.push(a))}}catch(f){o.e(f)}finally{o.f()}if(!n.length){var s,u=-1,h=M(t.selection.ranges);try{for(h.s();!(s=h.n()).done;){var l=s.value.from,c=t.doc.lineAt(l);c.number>u&&(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),i=n.text,o=n.ranges,a=n.linewise;if(i){an=a?i:null;var s=Ke?null:e.clipboardData;s?(e.preventDefault(),s.clearData(),s.setData("text/plain",i)):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,i),"cut"==e.type&&t.dispatch({changes:o,scrollIntoView:!0,annotations:r.YW.userEvent.of("cut")})}},Ge.focus=Ge.blur=function(t){setTimeout((function(){t.hasFocus!=t.inputState.notifiedFocused&&t.update([])}),10)},Ge.beforeprint=function(t){t.viewState.printing=!0,t.requestMeasure(),setTimeout((function(){t.viewState.printing=!1,t.requestMeasure()}),2e3)},Ge.compositionstart=Ge.compositionupdate=function(t){t.inputState.composing<0&&(t.docView.compositionDeco.size&&(t.observer.flush(),sn(t)),t.inputState.composing=0)},Ge.compositionend=function(t){t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),setTimeout((function(){t.inputState.composing<0&&sn(t)}),50)};var un,hn=["pre-wrap","normal","pre-line"],ln=function(){function t(){O(this,t),this.doc=i.xv.empty,this.lineWrapping=!1,this.direction=ke.LTR,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.lineLength=30,this.heightChanged=!1}return D(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=hn.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;O(this,t),this.length=e,this.height=n,this.flags=r}return D(t,[{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,un.ByPosNoHeight,e,0,0),f=c.to>=u?c:i.lineAt(u,un.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--,s0},set:function(t){this.flags=(t?2:0)|-3&this.flags}}],[{key:"empty",value:function(){return new pn(0,0)}},{key:"of",value:function(e){if(1==e.length)return e[0];for(var n=0,r=e.length,i=0,o=0;;)if(n==r)if(i>2*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}(dn),pn=function(t){k(n,t);var e=w(n);function n(t,r){var i;return O(this,n),(i=e.call(this,t,r,Ct.Text)).collapsed=0,i.widgetHeight=0,i}return D(n,[{key:"replace",value:function(t,e,r){var i=r[0];return 1==r.length&&(i instanceof n||i instanceof gn&&4&i.flags)&&Math.abs(this.length-i.length)<10?(i instanceof gn?i=new n(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):dn.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}(vn),gn=function(t){k(n,t);var e=w(n);function n(t){return O(this,n),e.call(this,t,0)}return D(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 fn(l,c,n+s*u,s,Ct.Text)}},{key:"lineAt",value:function(t,e,n,r,i){if(e==un.ByHeight)return this.blockAt(t,n,r,i);if(e==un.ByPosNoHeight){var o=n.lineAt(t),a=o.from,s=o.to;return new fn(a,s-a,0,0,Ct.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 fn(f,d,r+l*(v-h),l,Ct.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 fn(c.from,c.length,r,r+=u,Ct.Text)),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 dn.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 pn(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,dn.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}(dn),mn=function(t){k(n,t);var e=w(n);function n(t,r,i){var o;return O(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 D(n,[{key:"blockAt",value:function(t,e,n,r){var i=n+this.left.height;return ta))return u;var h=e==un.ByPosNoHeight?un.ByPosNoHeight:un.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,un.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&&yn(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?dn.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}},{key:"break",get:function(){return 1&this.flags}}]),n}(dn);function yn(t,e){var n,r;null==t[e]&&(n=t[e-1])instanceof gn&&(r=t[e+1])instanceof gn&&t.splice(e-1,3,new gn(n.length+1+r.length))}var kn=function(){function t(e,n){O(this,t),this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}return D(t,[{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 pn?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new pn(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 pn(this.pos-e,-1)),this.writtenTo=this.pos}}},{key:"blankContent",value:function(t,e){var n=new gn(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 pn)return t;var e=new pn(0,-1);return this.nodes.push(e),e}},{key:"addBlock",value:function(t){this.enterLine(),t.type!=Ct.WidgetAfter||this.isCovered||this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,t.type!=Ct.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 pn||this.isCovered?(this.writtenTo=e&&i<=n}))){var o=t.lineAt(i,0),a=o.from,s=o.to;e.push(new Cn(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?Dn:new En(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(le),o=t.changedRanges,a=fe.extendWithRanges(o,bn(t.startState.facet(le),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.headu.to)||!this.viewportIsAppropriate(u))&&(u=this.getViewport(0,e)),u.eq(this.viewport)||(this.viewport=u,t.flags|=4),this.updateForViewport(),(this.lineGaps.length||this.viewport.to-this.viewport.from>15e3)&&(t.flags|=this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes)))),this.computeVisibleRanges(),e&&(this.scrollTo=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=ke.LTR;if(!e){var o=window.getComputedStyle(n);r=o.whiteSpace,i="rtl"==o.direction?ke.RTL:ke.LTR,this.paddingTop=parseInt(o.paddingTop)||0,this.paddingBottom=parseInt(o.paddingBottom)||0}var a=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.parentNode;s;)if(1==s.nodeType){if((s.scrollHeight>s.clientHeight||s.scrollWidth>s.clientWidth)&&"visible"!=window.getComputedStyle(s).overflow){var u=s.getBoundingClientRect();r=Math.max(r,u.left),i=Math.min(i,u.right),o=Math.max(o,u.top),a=Math.min(a,u.bottom)}s=s.parentNode}else{if(11!=s.nodeType)break;s=s.host}return{left:r-n.left,right:i-n.left,top:o-(n.top+e),bottom:a-(n.top+e)}}(n,this.paddingTop),s=a.top-this.pixelViewport.top,u=a.bottom-this.pixelViewport.bottom;if(this.pixelViewport=a,this.inView=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left,!this.inView)return 0;var h=t.measureVisibleLineHeights(),l=!1,c=0,f=0,d=this.heightOracle;if(!e){var v=t.dom.clientWidth;if(d.mustRefresh(h,r,i)||d.lineWrapping&&Math.abs(v-this.contentWidth)>d.charWidth){var p=t.measureTextSize(),g=p.lineHeight,m=p.charWidth;(l=d.refresh(r,i,g,m,v/m,h))&&(t.minWidth=0,f|=16)}this.contentWidth!=v&&(this.contentWidth=v,f|=16),s>0&&u>0?c=Math.max(s,u):s<0&&u<0&&(c=Math.min(s,u))}if(d.heightChanged=!1,this.heightMap=this.heightMap.updateHeight(d,0,l,new cn(this.viewport.from,h)),d.heightChanged&&(f|=2),!this.viewportIsAppropriate(this.viewport,c)||this.scrollTo&&(this.scrollTo.head | |