UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

2 lines • 193 kB
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[3656],{49684:function(e,t,r){"use strict";r.d(t,{mr:function(){return c},Vu:function(){return d},xO:function(){return f}});var n=r(68928),i=r(14516),o=r(43274),a=r(65810),s=(0,i.Z)((function(e){return new Intl.DateTimeFormat(e.language,{hour:"numeric",minute:"2-digit",hour12:(0,a.y)(e)})})),c=o.BF?function(e,t){return s(t).format(e)}:function(e,t){return(0,n.WU)(e,((0,a.y)(t)," A"))},l=(0,i.Z)((function(e){return new Intl.DateTimeFormat(e.language,{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:(0,a.y)(e)})})),d=o.BF?function(e,t){return l(t).format(e)}:function(e,t){return(0,n.WU)(e,((0,a.y)(t)," A"))},u=(0,i.Z)((function(e){return new Intl.DateTimeFormat(e.language,{weekday:"long",hour:"numeric",minute:"2-digit",hour12:(0,a.y)(e)})})),f=o.BF?function(e,t){return u(t).format(e)}:function(e,t){return(0,n.WU)(e,((0,a.y)(t)," A"))}},91168:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=function(e){return e<10?"0".concat(e):e};function i(e){var t=Math.floor(e/3600),r=Math.floor(e%3600/60),i=Math.floor(e%3600%60);return t>0?"".concat(t,":").concat(n(r),":").concat(n(i)):r>0?"".concat(r,":").concat(n(i)):i>0?""+i:null}},29171:function(e,t,r){"use strict";r.d(t,{D:function(){return l}});var n=r(56007),i=r(12198),o=r(44583),a=r(49684),s=r(45524),c=r(22311),l=function(e,t,r,l){var d=void 0!==l?l:t.state;if(d===n.lz||d===n.nZ)return e("state.default.".concat(d));if(t.attributes.unit_of_measurement)return"".concat((0,s.u)(d,r)," ").concat(t.attributes.unit_of_measurement);var u=(0,c.N)(t);if("input_datetime"===u){var f;if(!t.attributes.has_time)return f=new Date(t.attributes.year,t.attributes.month-1,t.attributes.day),(0,i.p)(f,r);if(!t.attributes.has_date){var p=new Date;return f=new Date(p.getFullYear(),p.getMonth(),p.getDay(),t.attributes.hour,t.attributes.minute),(0,a.mr)(f,r)}return f=new Date(t.attributes.year,t.attributes.month-1,t.attributes.day,t.attributes.hour,t.attributes.minute),(0,o.o)(f,r)}return"humidifier"===u&&"on"===d&&t.attributes.humidity?"".concat(t.attributes.humidity," %"):"counter"===u||"number"===u||"input_number"===u?(0,s.u)(d,r):t.attributes.device_class&&e("component.".concat(u,".state.").concat(t.attributes.device_class,".").concat(d))||e("component.".concat(u,".state._.").concat(d))||d}},45524:function(e,t,r){"use strict";r.d(t,{u:function(){return i}});var n=r(66477),i=function(e,t,r){var i;switch(null==t?void 0:t.number_format){case n.y4.comma_decimal:i=["en-US","en"];break;case n.y4.decimal_comma:i=["de","es","it"];break;case n.y4.space_comma:i=["fr","sv","cs"];break;case n.y4.system:i=void 0;break;default:i=null==t?void 0:t.language}if(Number.isNaN=Number.isNaN||function e(t){return"number"==typeof t&&e(t)},!Number.isNaN(Number(e))&&Intl&&(null==t?void 0:t.number_format)!==n.y4.none)try{return new Intl.NumberFormat(i,o(e,r)).format(Number(e))}catch(a){return console.error(a),new Intl.NumberFormat(void 0,o(e,r)).format(Number(e))}return e.toString()},o=function(e,t){var r=t||{};if("string"!=typeof e)return r;if(!t||!t.minimumFractionDigits&&!t.maximumFractionDigits){var n=e.indexOf(".")>-1?e.split(".")[1].length:0;r.minimumFractionDigits=n,r.maximumFractionDigits=n}return r}},43793:function(e,t,r){"use strict";r.d(t,{x:function(){return n}});var n=function(e,t){return e.substring(0,t.length)===t}},97389:function(e,t,r){"use strict";r.d(t,{mA:function(){return i},lj:function(){return o},U_:function(){return a},nV:function(){return s},Zm:function(){return c}});var n=r(43793),i=function(e,t,r,n){return e.callWS({type:"trace/get",domain:t,item_id:r,run_id:n})},o=function(e,t,r){return e.callWS({type:"trace/list",domain:t,item_id:r})},a=function(e,t,r){return e.callWS({type:"trace/contexts",domain:t,item_id:r})},s=function(e,t){for(var r=t.split("/").reverse(),n=e;r.length;){var i=r.pop(),o=Number(i);if(isNaN(o))n=n[i];else if(Array.isArray(n))n=n[o];else if(0!==o)throw new Error("If config is not an array, can only return index 0")}return n},c=function(e){return"trigger"===e||(0,n.x)(e,"trigger/")}},45578:function(e,t,r){"use strict";r.r(t),r.d(t,{HaAutomationTrace:function(){return No}});var n,i,o,a,s,c,l,d,u=r(68546),f=r(50424),p=r(55358),h=r(76666),m=r(13690),y=r(7323),v=r(44583),b=(r(25230),r(47181)),g=r(42141);r(52039);function k(e){return(k="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 w(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function E(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 P(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _(e,t){return(_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function x(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=D(e);if(t){var i=D(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return O(this,r)}}function O(e,t){return!t||"object"!==k(t)&&"function"!=typeof t?S(e):t}function S(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function D(e){return(D=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function T(){T=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(!j(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var d=0;d<l.length;d++)this.addElementPlacement(l[d],t);r.push.apply(r,l)}}return{element:e,finishers:n,extras:r}},decorateConstructor:function(e,t){for(var r=[],n=t.length-1;n>=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;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return F(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?F(e,t):void 0}}(t)||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.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=R(e.key),n=String(e.placement);if("static"!==n&&"prototype"!==n&&"own"!==n)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+n+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:n,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:I(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=I(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var n=(0,t[r])(e);if(void 0!==n){if("function"!=typeof n)throw new TypeError("Finishers must return a constructor.");e=n}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function A(e){var t,r=R(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var n={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(n.decorators=e.decorators),"field"===e.kind&&(n.initializer=e.value),n}function C(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function j(e){return e.decorators&&e.decorators.length}function z(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function I(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function R(e){var t=function(e,t){if("object"!==k(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==k(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===k(t)?t:String(t)}function F(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var N,B,$,M,L,U=10,q=30,W={fromAttribute:function(e){return e.split(",").map((function(e){return parseInt(e)}))},toAttribute:function(e){return e instanceof Array?e.join(","):"".concat(e)}};!function(e,t,r,n){var i=T();if(n)for(var o=0;o<n.length;o++)i=n[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),r),s=i.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},n=0;n<e.length;n++){var i,o=e[n];if("method"===o.kind&&(i=t.find(r)))if(z(o.descriptor)||z(i.descriptor)){if(j(o)||j(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(j(o)){if(j(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}C(o,i)}else t.push(o)}return t}(a.d.map(A)),e);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,p.Mo)("hat-graph")],(function(e,t){var r,u;return{F:function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_(e,t)}(n,t);var r=x(n);function n(){var t;P(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=r.call.apply(r,[this].concat(o)),e(S(t)),t}return n}(t),d:[{kind:"field",decorators:[(0,p.Cb)({type:Number})],key:"_num_items",value:function(){return 0}},{kind:"field",decorators:[(0,p.Cb)({reflect:!0,type:Boolean})],key:"branching",value:void 0},{kind:"field",decorators:[(0,p.Cb)({reflect:!0,converter:W})],key:"track_start",value:void 0},{kind:"field",decorators:[(0,p.Cb)({reflect:!0,converter:W})],key:"track_end",value:void 0},{kind:"field",decorators:[(0,p.Cb)({reflect:!0,type:Boolean})],key:"disabled",value:void 0},{kind:"field",decorators:[(0,p.Cb)({reflect:!0,type:Boolean})],key:"selected",value:void 0},{kind:"field",decorators:[(0,p.Cb)({reflect:!0,type:Boolean})],key:"short",value:function(){return!1}},{kind:"method",key:"updateChildren",value:(r=regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._num_items=this.children.length;case 1:case"end":return e.stop()}}),e,this)})),u=function(){var e=this,t=arguments;return new Promise((function(n,i){var o=r.apply(e,t);function a(e){E(o,n,i,a,s,"next",e)}function s(e){E(o,n,i,a,s,"throw",e)}a(void 0)}))},function(){return u.apply(this,arguments)})},{kind:"method",key:"render",value:function(){var e=this,t=[],r=0,d=0,u=Number.POSITIVE_INFINITY;if(this.branching)for(var p=0,m=Array.from(this.children);p<m.length;p++){var y=m[p];if("head"!==y.slot){var v=y.getBoundingClientRect();t.push({x:v.width/2+r,height:v.height,start:null!=y.getAttribute("graphStart"),end:null!=y.getAttribute("graphEnd")}),r+=v.width,d=Math.max(d,v.height),u=Math.min(u,v.height)}}return(0,f.dy)(n||(n=w(['\n      <slot name="head" @slotchange=',"> </slot>\n      ",'\n      <div id="branches">\n        ',"\n        <slot @slotchange=","></slot>\n      </div>\n\n      ","\n    "])),this.updateChildren,this.branching?(0,f.YP)(i||(i=w(['\n            <svg\n              id="top"\n              width="','"\n              height="','"\n            >\n              ','\n              <use xlink:href="#track-start" />\n            </svg>\n          '])),r,20,t.map((function(t,n){var i,a,s;return t.start?"":(0,f.YP)(o||(o=w(['\n                  <path\n                    class="','"\n                    id="','"\n                    index=','\n                    d="\n                      M '," 0\n                      L "," ",'\n                      "/>\n                '])),(0,h.$)({line:!0,track:null!==(i=null===(a=e.track_start)||void 0===a?void 0:a.includes(n))&&void 0!==i&&i}),null!==(s=e.track_start)&&void 0!==s&&s.includes(n)?"track-start":"",n,r/2,t.x,20)}))):"",this.branching?(0,f.YP)(a||(a=w(['\n              <svg\n                id="lines"\n                width="','"\n                height="','"\n              >\n                ',"\n              </svg>\n            "])),r,d,t.map((function(t,r){var n,i;return t.end?"":(0,f.YP)(s||(s=w(['\n                    <path\n                      class="','"\n                      index=','\n                      d="\n                        M '," ","\n                        l 0 ",'\n                        "/>\n                  '])),(0,h.$)({line:!0,track:null!==(n=null===(i=e.track_end)||void 0===i?void 0:i.includes(r))&&void 0!==n&&n}),r,t.x,t.height,d-t.height)}))):"",this.updateChildren,this.branching&&!this.short?(0,f.YP)(c||(c=w(['\n            <svg\n              id="bottom"\n              width="','"\n              height="','"\n            >\n              ','\n              <use xlink:href="#track-end" />\n            </svg>\n          '])),r,30,t.map((function(t,n){var i,o,a;return t.end?"":(0,f.YP)(l||(l=w(['\n                  <path\n                    class="','"\n                    id="','"\n                    index=','\n                    d="\n                      M '," 0\n                      L "," ","\n                      L "," ",'\n                      "/>\n                '])),(0,h.$)({line:!0,track:null!==(i=null===(o=e.track_end)||void 0===o?void 0:o.includes(n))&&void 0!==i&&i}),null!==(a=e.track_end)&&void 0!==a&&a.includes(n)?"track-end":"",n,t.x,t.x,U,r/2,30)}))):"")}},{kind:"get",static:!0,key:"styles",value:function(){return(0,f.iv)(d||(d=w(['\n      :host {\n        position: relative;\n        display: flex;\n        flex-direction: column;\n        align-items: center;\n        --stroke-clr: var(--stroke-color, var(--secondary-text-color));\n        --active-clr: var(--active-color, var(--primary-color));\n        --track-clr: var(--track-color, var(--accent-color));\n        --hover-clr: var(--hover-color, var(--primary-color));\n        --disabled-clr: var(--disabled-color, var(--disabled-text-color));\n        --default-trigger-color: 3, 169, 244;\n        --rgb-trigger-color: var(--trigger-color, var(--default-trigger-color));\n        --background-clr: var(--background-color, white);\n        --default-icon-clr: var(--icon-color, black);\n        --icon-clr: var(--stroke-clr);\n      }\n      :host(:focus) {\n        outline: none;\n      }\n      #branches {\n        position: relative;\n        display: flex;\n        flex-direction: column;\n        align-items: center;\n      }\n      :host([branching]) #branches {\n        flex-direction: row;\n        align-items: start;\n      }\n      :host([branching]) ::slotted(*) {\n        z-index: 1;\n      }\n      :host([branching]) ::slotted([slot="head"]) {\n        margin-bottom: ',"px;\n      }\n\n      #lines {\n        position: absolute;\n      }\n\n      path.line {\n        stroke: var(--stroke-clr);\n        stroke-width: 2;\n        fill: none;\n      }\n      path.line.track {\n        stroke: var(--track-clr);\n      }\n      :host([disabled]) path.line {\n        stroke: var(--disabled-clr);\n      }\n    "])),-10)}}]}}),f.oi);function Y(e){return(Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function V(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Z(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 H(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=se(e);if(t){var i=se(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return X(this,r)}}function X(e,t){return!t||"object"!==Y(t)&&"function"!=typeof t?K(e):t}function K(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function G(){G=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(!te(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var d=0;d<l.length;d++)this.addElementPlacement(l[d],t);r.push.apply(r,l)}}return{element:e,finishers:n,extras:r}},decorateConstructor:function(e,t){for(var r=[],n=t.length-1;n>=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;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return oe(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?oe(e,t):void 0}}(t)||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.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=ie(e.key),n=String(e.placement);if("static"!==n&&"prototype"!==n&&"own"!==n)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+n+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:n,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:ne(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=ne(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var n=(0,t[r])(e);if(void 0!==n){if("function"!=typeof n)throw new TypeError("Finishers must return a constructor.");e=n}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function Q(e){var t,r=ie(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var n={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(n.decorators=e.decorators),"field"===e.kind&&(n.initializer=e.value),n}function ee(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function te(e){return e.decorators&&e.decorators.length}function re(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function ne(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function ie(e){var t=function(e,t){if("object"!==Y(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==Y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Y(t)?t:String(t)}function oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ae(e,t,r){return(ae="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=se(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(r):i.value}})(e,t,r||e)}function se(e){return(se=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ce,le;!function(e,t,r,n){var i=G();if(n)for(var o=0;o<n.length;o++)i=n[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),r),s=i.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},n=0;n<e.length;n++){var i,o=e[n];if("method"===o.kind&&(i=t.find(r)))if(re(o.descriptor)||re(i.descriptor)){if(te(o)||te(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(te(o)){if(te(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}ee(o,i)}else t.push(o)}return t}(a.d.map(Q)),e);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,p.Mo)("hat-graph-node")],(function(e,t){var r=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&J(e,t)}(n,t);var r=H(n);function n(){var t;Z(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=r.call.apply(r,[this].concat(o)),e(K(t)),t}return n}(t);return{F:r,d:[{kind:"field",decorators:[(0,p.Cb)()],key:"iconPath",value:void 0},{kind:"field",decorators:[(0,p.Cb)({reflect:!0,type:Boolean})],key:"disabled",value:void 0},{kind:"field",decorators:[(0,p.Cb)({reflect:!0,type:Boolean})],key:"graphstart",value:void 0},{kind:"field",decorators:[(0,p.Cb)({reflect:!0,type:Boolean})],key:"nofocus",value:void 0},{kind:"field",decorators:[(0,p.Cb)({reflect:!0,type:Number})],key:"badge",value:void 0},{kind:"method",key:"connectedCallback",value:function(){ae(se(r.prototype),"connectedCallback",this).call(this),this.hasAttribute("tabindex")||this.nofocus||this.setAttribute("tabindex","0")}},{kind:"method",key:"render",value:function(){var e=q+(this.graphstart?2:11);return(0,f.YP)(N||(N=V(['\n    <svg\n    width="','px"\n    height="','px"\n    viewBox="-'," -"," "," ",'"\n    >\n      ','\n    <g class="node">\n      <circle\n        cx="0"\n        cy="0"\n        r="','"\n      />\n      }\n      ','\n      <g\n        style="pointer-events: none"\n        transform="translate('," ",')"\n      >\n        ',"\n      </g>\n    </g>\n      </svg>\n    "])),40,e,Math.ceil(20),this.graphstart?Math.ceil(e/2):Math.ceil(25),40,e,this.graphstart?"":(0,f.YP)(B||(B=V(['\n          <path\n            class="connector"\n            d="\n              M 0 ','\n              L 0 0\n            "\n            line-caps="round"\n          />\n          '])),-25),15,this.badge?(0,f.YP)($||($=V(['\n        <g class="number">\n          <circle\n            cx="8"\n            cy="','"\n            r="8"\n          ></circle>\n          <text\n            x="8"\n            y="','"\n            text-anchor="middle"\n            alignment-baseline="middle"\n          >',"</text>\n        </g>\n      "])),-15,-15,this.badge>9?"9+":this.badge):"",-12,-12,this.iconPath?(0,f.YP)(M||(M=V(['<path class="icon" d="','"/>'])),this.iconPath):"")}},{kind:"get",static:!0,key:"styles",value:function(){return(0,f.iv)(L||(L=V(["\n      :host {\n        display: flex;\n        flex-direction: column;\n      }\n      :host(.track) {\n        --stroke-clr: var(--track-clr);\n        --icon-clr: var(--default-icon-clr);\n      }\n      :host(.active) circle {\n        --stroke-clr: var(--active-clr);\n        --icon-clr: var(--default-icon-clr);\n      }\n      :host(:focus) {\n        outline: none;\n      }\n      :host(:hover) circle {\n        --stroke-clr: var(--hover-clr);\n        --icon-clr: var(--default-icon-clr);\n      }\n      :host([disabled]) circle {\n        stroke: var(--disabled-clr);\n      }\n      :host-context([disabled]) {\n        --stroke-clr: var(--disabled-clr);\n      }\n      :host([nofocus]):host-context(.active),\n      :host([nofocus]):host-context(:focus) {\n        --circle-clr: var(--active-clr);\n        --icon-clr: var(--default-icon-clr);\n      }\n      circle,\n      path.connector {\n        stroke: var(--stroke-clr);\n        stroke-width: 2;\n        fill: none;\n      }\n      circle {\n        fill: var(--background-clr);\n        stroke: var(--circle-clr, var(--stroke-clr));\n      }\n      .number circle {\n        fill: var(--track-clr);\n        stroke: none;\n        stroke-width: 0;\n      }\n      .number text {\n        font-size: smaller;\n      }\n      path.icon {\n        fill: var(--icon-clr);\n      }\n\n      :host(.triggered) svg {\n        overflow: visible;\n      }\n      :host(.triggered) circle {\n        animation: glow 10s;\n      }\n      @keyframes glow {\n        0% {\n          filter: drop-shadow(0px 0px 5px rgba(var(--rgb-trigger-color), 0));\n        }\n        10% {\n          filter: drop-shadow(0px 0px 10px rgba(var(--rgb-trigger-color), 1));\n        }\n        100% {\n          filter: drop-shadow(0px 0px 5px rgba(var(--rgb-trigger-color), 0));\n        }\n      }\n    "])))}}]}}),f.oi);function de(e){return(de="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ue(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function fe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pe(e,t){return(pe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function he(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ve(e);if(t){var i=ve(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return me(this,r)}}function me(e,t){return!t||"object"!==de(t)&&"function"!=typeof t?ye(e):t}function ye(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ve(e){return(ve=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function be(){be=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(!we(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var d=0;d<l.length;d++)this.addElementPlacement(l[d],t);r.push.apply(r,l)}}return{element:e,finishers:n,extras:r}},decorateConstructor:function(e,t){for(var r=[],n=t.length-1;n>=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;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return xe(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xe(e,t):void 0}}(t)||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.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=_e(e.key),n=String(e.placement);if("static"!==n&&"prototype"!==n&&"own"!==n)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+n+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:n,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:Pe(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=Pe(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var n=(0,t[r])(e);if(void 0!==n){if("function"!=typeof n)throw new TypeError("Finishers must return a constructor.");e=n}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function ge(e){var t,r=_e(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var n={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(n.decorators=e.decorators),"field"===e.kind&&(n.initializer=e.value),n}function ke(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function we(e){return e.decorators&&e.decorators.length}function Ee(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function Pe(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function _e(e){var t=function(e,t){if("object"!==de(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==de(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===de(t)?t:String(t)}function xe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Oe,Se,De,Te,Ae,Ce,je,ze,Ie,Re,Fe,Ne,Be,$e,Me,Le;!function(e,t,r,n){var i=be();if(n)for(var o=0;o<n.length;o++)i=n[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),r),s=i.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},n=0;n<e.length;n++){var i,o=e[n];if("method"===o.kind&&(i=t.find(r)))if(Ee(o.descriptor)||Ee(i.descriptor)){if(we(o)||we(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(we(o)){if(we(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}ke(o,i)}else t.push(o)}return t}(a.d.map(ge)),e);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,p.Mo)("hat-graph-spacer")],(function(e,t){return{F:function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&pe(e,t)}(n,t);var r=he(n);function n(){var t;fe(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=r.call.apply(r,[this].concat(o)),e(ye(t)),t}return n}(t),d:[{kind:"field",decorators:[(0,p.Cb)({reflect:!0,type:Boolean})],key:"disabled",value:void 0},{kind:"method",key:"render",value:function(){return(0,f.YP)(ce||(ce=ue(['\n    <svg\n    width="','px"\n    height="','px"\n    viewBox="-'," 0 10 ",'"\n    >\n          <path\n            class="connector"\n            d="\n              M 0 ','\n              L 0 0\n            "\n            line-caps="round"\n          />\n      }\n      </svg>\n    '])),U,41,5,41,41)}},{kind:"get",static:!0,key:"styles",value:function(){return(0,f.iv)(le||(le=ue(["\n      :host {\n        display: flex;\n        flex-direction: column;\n      }\n      :host(.track) {\n        --stroke-clr: var(--track-clr);\n        --icon-clr: var(--default-icon-clr);\n      }\n      :host-context([disabled]) {\n        --stroke-clr: var(--disabled-clr);\n      }\n      path.connector {\n        stroke: var(--stroke-clr);\n        stroke-width: 2;\n        fill: none;\n      }\n    "])))}}]}}),f.oi);function Ue(e){return(Ue="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 qe(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=nt(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function We(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 Ze(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=at(e);if(t){var i=at(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Je(this,r)}}function Je(e,t){return!t||"object"!==Ue(t)&&"function"!=typeof t?He(e):t}function He(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xe(){Xe=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(!Qe(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var d=0;d<l.length;d++)this.addElementPlacement(l[d],t);r.push.apply(r,l)}}return{element:e,finishers:n,extras:r}},decorateConstructor:function(e,t){for(var r=[],n=t.length-1;n>=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;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||nt(t)||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.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=rt(e.key),n=String(e.placement);if("static"!==n&&"prototype"!==n&&"own"!==n)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+n+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:n,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:tt(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=tt(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var n=(0,t[r])(e);if(void 0!==n){if("function"!=typeof n)throw new TypeError("Finishers must return a constructor.");e=n}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function Ke(e){var t,r=rt(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var n={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(n.decorators=e.decorators),"field"===e.kind&&(n.initializer=e.value),n}function Ge(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function Qe(e){return e.decorators&&e.decorators.length}function et(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function tt(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function rt(e){var t=function(e,t){if("object"!==Ue(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==Ue(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ue(t)?t:String(t)}function nt(e,t){if(e){if("string"==typeof e)return it(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?it(e,t):void 0}}function it(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ot(e,t,r){return(ot="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=at(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(r):i.value}})(e,t,r||e)}function at(e){return(at=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e,t,r,n){var i=Xe();if(n)for(var o=0;o<n.length;o++)i=n[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),r),s=i.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},n=0;n<e.length;n++){var i,o=e[n];if("method"===o.kind&&(i=t.find(r)))if(et(o.descriptor)||et(i.descriptor)){if(Qe(o)||Qe(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(Qe(o)){if(Qe(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}Ge(o,i)}else t.push(o)}return t}(a.d.map(Ke)),e);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,p.Mo)("hat-script-graph")],(function(e,t){var r=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ve(e,t)}(n,t);var r=Ze(n);function n(){var t;Ye(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=r.call.apply(r,[this].concat(o)),e(He(t)),t}return n}(t);return{F:r,d:[{kind:"field",decorators:[(0,p.Cb)({attribute:!1})],key:"trace",value:void 0},{kind:"field",decorators:[(0,p.Cb)({attribute:!1})],key:"selected",value:void 0},{kind:"field",decorators:[(0,p.Cb)()],key:"renderedNodes",value:function(){return{}}},{kind:"field",decorators:[(0,p.Cb)()],key:"trackedNodes",value:function(){return{}}},{kind:"method",key:"selectNode",value:function(e,t){var r=this;return function(){(0,b.B)(r,"graph-node-selected",{config:e,path:t})}}},{kind:"method",key:"render_trigger",value:function(e,t){var r="trigger/".concat(t),n=this.trace&&r in this.trace.trace;return this.renderedNodes[r]={config:e,path:r},n&&(this.trackedNodes[r]=this.renderedNodes[r]),(0,f.dy)(Oe||(Oe=We(["\n      <hat-graph-node\n        graphStart\n        @focus=","\n        class=","\n        .iconPath=","\n        tabindex=","\n      ></hat-graph-node>\n    "])),this.selectNode(e,r),(0,h.$)({track:n,active:this.selected===r}),u.AD$,n?"0":"-1")}},{kind:"method",key:"render_condition",value:function(e,t){var r="condition/".concat(t),n=this.trace.trace[r],i=void 0===(null==n?void 0:n[0].result)?0:n[0].result.result?1:2;return this.renderedNodes[r]={config:e,path:r},n&&(this.trackedNodes[r]=this.renderedNodes[r]),(0,f.dy)(Se||(Se=We(["\n      <hat-graph\n        branching\n        @focus=","\n        class=","\n        .track_start=","\n        .track_end=","\n        tabindex=",'\n        short\n      >\n        <hat-graph-node\n          slot="head"\n          class=',"\n          .iconPath=","\n          nofocus\n          graphEnd\n        ></hat-graph-node>\n        <div\n          style=","\n          graphStart\n          graphEnd\n        ></div>\n        <div></div>\n        <hat-graph-node\n          .iconPath=","\n          graphEnd\n          nofocus\n          class=","\n        ></hat-graph-node>\n      </hat-graph>\n    "])),this.selectNode(e,r),(0,h.$)({track:i,active:this.selected===r}),[i],[i],n?"-1":"0",(0,h.$)({track:void 0!==n}),u._wd,"width: ".concat(40,"px;"),u.r5M,(0,h.$)({track:2===i}))}},{kind:"method",key:"render_choose_node",value:function(e,t){var r,n,i,o=this,a=this.trace.trace[t],s=null!=a&&a[0].result?"default"===a[0].result.choice?[Array.isArray(e.choose)?e.choose.length:0]:[a[0].result.choice]:[];return(0,f.dy)(De||(De=We(["\n      <hat-graph\n        tabindex=","\n        branching\n        .track_start=","\n        .track_end=","\n        @focus=","\n        class=","\n      >\n        <hat-graph-node\n          .iconPath=","\n          class=",'\n          slot="head"\n          nofocus\n        ></hat-graph-node>\n\n        ',"\n        <hat-graph>\n          <hat-graph-spacer\n            class=","\n          ></hat-graph-spacer>\n          ","\n        </hat-graph>\n      </hat-graph>\n    "])),void 0===a?"-1":"0",s,s,this.selectNode(e,t),(0,h.$)({track:void 0!==a,active:this.selected===t}),u.g$R,(0,h.$)({track:void 0!==a}),e.choose?null===(r=(0,g.r)(e.choose))||void 0===r?void 0:r.map((function(r,n){var i,s="".concat(t,"/choose/").concat(n),c=void 0!==a&&(null===(i=a[0].result)||void 0===i?void 0:i.choice)===n;return o.renderedNodes[s]={config:e,path:s},c&&(o.trackedNodes[s]=o.renderedNodes[s]),(0,f.dy)(Te||(Te=We(["\n                <hat-graph>\n                  <hat-graph-node\n                    .iconPath=","\n                    @focus=","\n                    class=","\n                  ></hat-graph-node>\n                  ","\n                </hat-graph>\n              "])),!a||c?u.Eut:u.Ii0,o.selectNode(e,s),(0,h.$)({active:o.selected===s,track:c}),(0,g.r)(r.sequence).map((function(e,t){return o.render_node(e,"".concat(s,"/sequence/").concat(t))})))})):"",(0,h.$)({track:void 0!==a&&"default"===(null===(n=a[0].result)||void 0===n?void 0:n.choice)}),null===(i=(0,g.r)(e.default))||void 0===i?void 0:i.map((function(e,r){return o.render_node(e,"".concat(t,"/default/").concat(r))})))}},{kind:"method",key:"render_condition_node",value:function(e,t){var r=this.trace.trace[t]||void 0,n=void 0===(null==r?void 0:r[0].result)?0:r[0].result.result?1:2;return(0,f.dy)(Ae||(Ae=We(["\n      <hat-graph\n        branching\n        @focus=","\n        class=","\n        .track_start=","\n        .track_end=","\n        tabindex=",'\n        short\n      >\n        <hat-graph-node\n          slot="head"\n          class=',"\n          .iconPath=","\n          nofocus\n          graphEnd\n        ></hat-graph-node>\n        <div\n          style=","\n          graphStart\n          graphEnd\n        ></div>\n        <div></div>\n        <hat-graph-node\n          .iconPath=","\n          graphEnd\n          nofocus\n          class=","\n        ></hat-graph-node>\n      </hat-graph>\n    "])),this.selectNode(e,t),(0,h.$)({track:n,active:this.selected===t}),[n],[n],void 0===r?"-1":"0",(0,h.$)({track:Boolean(r)}),u._wd,"width: ".concat(40,"px;"),u.r5M,(0,h.$)({track:2===n}))}},{kind:"method",key:"render_delay_node",value:function(e,t){return(0,f.dy)(Ce||(Ce=We(["\n      <hat-graph-node\n        .iconPath=","\n        @focus=","\n        class=","\n        tabindex=","\n      ></hat-graph-node>\n    "])),u.clR,this.selectNode(e,t),(0,h.$)({track:t in this.trace.trace,active:this.selected===t}),this.trace&&t in this.trace.trace?"0":"-1")}},{kind:"method",key:"render_device_node",value:function(e,t){return(0,f.dy)(je||(je=We(["\n      <hat-graph-node\n        .iconPath=","\n        @focus=","\n        class=","\n        tabindex=","\n      ></hat-graph-node>\n    "])),u.p0g,this.selectNode(e,t),(0,h.$)({track:t in this.trace.trace,active:this.selected===t}),this.trace&&t in this.trace.trace?"0":"-1")}},{kind:"method",key:"render_event_node",value:function(e,t){return(0,f.dy)(ze||(ze=We(["\n      <hat-graph-node\n        .iconPath=","\n        @focus=","\n        class=","\n        tabindex=","\n      ></hat-graph-node>\n    "])),u.XW6,this.selectNode(e,t),(0,h.$)({track:t in this.trace.trace,active:this.selected===t}),this.trace&&t in this.trace.trace?"0":"-1")}},{kind:"method",key:"render_repeat_node",value:function(e,t){var r,n,i=this,o=this.trace.trace[t],a=o?[0,1]:[],s=null===(r=this.trace)||void 0===r||null===(n=r.trace["".concat(t,"/repeat/sequence/0")])||void 0===n?void 0:n.length;return(0,f.dy)(Ie||(Ie=We(["\n      <hat-graph\n        .track_start=","\n        .track_end=","\n        tabindex=","\n        branching\n        @focus=","\n        class=","\n      >\n        <hat-graph-node\n          .iconPath=","\n          class=",'\n          slot="head"\n          nofocus\n        ></hat-graph-node>\n        <hat-graph-node\n          .iconPath=',"\n          nofocus\n          class=","\n          .badge=","\n        ></hat-graph-node>\n        <hat-graph>\n          ","\n        </hat-graph>\n      </hat-graph>\n    "])),a,a,void 0===o?"-1":"0",this.selectNode(e,t),(0,h.$)({track:t in this.trace.trace,active:this.selected===t}),u.jcD,(0,h.$)({track:o}),u.XHH,(0,h.$)({track:a.includes(1)}),s,(0,g.r)(e.repeat.sequence).map((function(e,r){return i.render_node(e,"".concat(t,"/repeat/sequence/").concat(r))})))}},{kind:"method",key:"render_scene_node",value:function(e,t){return(0,f.dy)(Re||(Re=We(["\n      <hat-graph-node\n        .iconPath=","\n        @focus=","\n        class=","\n        tabindex=","\n      ></hat-graph-node>\n    "])),u.XW6,this.selectNode(e,t),(0,h.$)({track:t in this.trace.trace,active:this.selected===t}),this.trace&&t in this.trace.trace?"0":"-1")}},{kind:"method",key:"render_service_node",value:function(e,t){return(0,f.dy)(Fe||(Fe=We(["\n      <hat-graph-node\n        .iconPath=","\n        @focus=","\n        class=","\n        tabindex=","\n      ></hat-graph-node>\n    "])),u.zrb,this.selectNode(e,t),(0,h.$)({track:t in this.trace.trace,active:this.selected===t}),this.trace&&t in this.trace.trace?"0":"-1")}},{kind:"method",key:"render_wait_node",value:function(e,t){return(0,f.dy)(Ne||(Ne=We(["\n      <hat-graph-node\n        .iconPath=","\n        @focus=","\n        class=","\n        tabindex=","\n      ></hat-graph-node>\n    "])),u._yq,this.selectNode(e,t),(0,h.$)({track:t in this.trace.trace,active:this.selected===t}),this.trace&&t in this.trace.trace?"0":"-1")}},{kind:"method",key:"render_other_node",value:function(e,t){return(0,f.dy)(Be||(Be=We(["\n      <hat-graph-node\n        .iconPath=","\n        @focus=","\n        class=","\n      ></hat-graph-node>\n    "])),u.Nqu,this.selectNode(e,t),(0,h.$)({track:t in this.trace.trace,active:this.selected===t}))}},{kind:"method",key:"render_node",value:function(e,t){var r={choose:this.render_choose_node,condition:this.render_condition_node,delay:this.render_delay_node,device_id:this.render_device_node,event:this.render_event_node,repeat:this.render_repeat_node,scene:this.render_scene_node,service:this.render_service_node,wait_template:this.render_wait_node,wait_for_trigger:this.render_wait_node,other:this.render_other_node},n=r[Object.keys(r).find((function(t){return t in e}))||"other"].bind(this)(e,t);return this.renderedNodes[t]={config:e,path:t},this.trace&&t in this.trace.trace&&(this.trackedNodes[t]=this.renderedNodes[t]),n}},{kind:"method",key:"render",value:function(){var e=this,t=Object.keys(this.trackedNodes),r=this.trace&&"trigger"in this.trace.trace?void 0:[0],n=(0,g.r)(this.trace.config.trigger).map((function(t,n){return e.trace&&"trigger/".concat(n)in e.trace.trace&&(r=[n]),e.render_trigger(t,n)}));try{var i;return(0,f.dy)($e||($e=We(['\n        <hat-graph class="parent">\n          <div></div>\n          <hat-graph\n            branching\n            id="trigger"\n            .short=',"\n            .track_start=","\n            .track_end=","\n          >\n            ",'\n          </hat-graph>\n          <hat-graph id="condition">\n            ',"\n          </hat-graph>\n          ",'\n        </hat-graph>\n        <div class="actions">\n          <mwc-icon-button\n            .disabled=',"\n            @click=","\n          >\n            <ha-svg-icon .path=","></ha-svg-icon>\n          </mwc-icon-button>\n          <mwc-icon-button\n            .disabled=","\n            @click=","\n          >\n            <ha-svg-icon .path=","></ha-svg-icon>\n          </mwc-icon-button>\n        </div>\n      "])),n.length<2,r,r,n,null===(i=(0,g.r)(this.trace.config.condition))||void 0===i?void 0:i.map((function(t,r){return e.render_condition(t,r)})),(0,g.r)(this.trace.config.action).map((function(t,r){return e.render_node(t,"action/".concat(r))})),0===t.length||t[0]===this.selected,this.previousTrackedNode,u.Waq,0===t.length||t[t.length-1]===this.selected,this.nextTrackedNode,u.CW)}catch(o){return(0,f.dy)(Me||(Me=We(['\n        <div class="error">\n          Error rendering graph. Please download trace and share with the\n          developers.\n        </div>\n      '])))}}},{kind:"method",key:"update",value:function(e){e.has("trace")&&(this.renderedNodes={},this.trackedNodes={}),ot(at(r.prototype),"update",this).call(this,e)}},{kind:"method",key:"updated",value:function(e){if(ot(at(r.prototype),"updated",this).call(this,e),e.has("trace")){var t=this.trackedNodes,n=Object.keys(t);if(""===this.selected||!(this.selected in n)){var i,o=qe(n);try{for(o.s();!(i=o.n()).done;){var a=i.value;if(t[a]){(0,b.B)(this,"graph-node-selected",t[a]);break}}}catch(p){o.e(p)}finally{o.f()}}if(this.trace){var s,c=Object.keys(this.trace.trace),l={},d={},u=qe(Object.keys(this.renderedNodes).sort((function(e,t){return c.indexOf(e)-c.indexOf(t)})));try{for(u.s();!(s=u.n()).done;){var f=s.value;d[f]=this.renderedNodes[f],f in this.trackedNodes&&(l[f]=this.trackedNodes[f])}}catch(p){u.e(p)}finally{u.f()}this.renderedNodes=d,this.trackedNodes=l}}}},{kind:"method",key:"previousTrackedNode",value:function(){var e=Object.keys(this.trackedNodes),t=e.indexOf(this.selected)-1;t>=0&&(0,b.B)(this,"graph-node-selected",this.trackedNodes[e[t]])}},{kind:"method",key:"nextTrackedNode",value:function(){var e=Object.keys(this.trackedNodes),t=e.indexOf(this.selected)+1;t<e.length&&(0,b.B)(this,"graph-node-selected",this.trackedNodes[e[t]])}},{kind:"get",static:!0,key:"styles",value:function(){return(0,f.iv)(Le||(Le=We(["\n      :host {\n        display: flex;\n      }\n      .actions {\n        display: flex;\n        flex-direction: column;\n      }\n      .parent {\n        margin-left: 8px;\n      }\n      .error {\n        padding: 16px;\n        max-width: 300px;\n      }\n    "])))}}]}}),f.oi);var st,ct=r(55422),lt=r(97389),dt=r(26765),ut=r(11654),ft=r(29311),pt=r(98595);r(53822),r(10983);function ht(e){return(ht="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 mt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yt(e,t){return(yt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function vt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=kt(e);if(t){var i=kt(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return bt(this,r)}}function bt(e,t){return!t||"object"!==ht(t)&&"function"!=typeof t?gt(e):t}function gt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kt(e){return(kt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function wt(){wt=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(!_t(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var d=0;d<l.length;d++)this.addElementPlacement(l[d],t);r.push.apply(r,l)}}return{element:e,finishers:n,extras:r}},decorateConstructor:function(e,t){for(var r=[],n=t.length-1;n>=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;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return Dt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Dt(e,t):void 0}}(t)||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.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=St(e.key),n=String(e.placement);if("static"!==n&&"prototype"!==n&&"own"!==n)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+n+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:n,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:Ot(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=Ot(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var n=(0,t[r])(e);if(void 0!==n){if("function"!=typeof n)throw new TypeError("Finishers must return a constructor.");e=n}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function Et(e){var t,r=St(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var n={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(n.decorators=e.decorators),"field"===e.kind&&(n.initializer=e.value),n}function Pt(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function _t(e){return e.decorators&&e.decorators.length}function xt(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function Ot(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function St(e){var t=function(e,t){if("object"!==ht(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==ht(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ht(t)?t:String(t)}function Dt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Tt,At;!function(e,t,r,n){var i=wt();if(n)for(var o=0;o<n.length;o++)i=n[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),r),s=i.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},n=0;n<e.length;n++){var i,o=e[n];if("method"===o.kind&&(i=t.find(r)))if(xt(o.descriptor)||xt(i.descriptor)){if(_t(o)||_t(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(_t(o)){if(_t(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}Pt(o,i)}else t.push(o)}return t}(a.d.map(Et)),e);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,p.Mo)("ha-automation-trace-blueprint-config")],(function(e,t){return{F:function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&yt(e,t)}(n,t);var r=vt(n);function n(){var t;mt(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=r.call.apply(r,[this].concat(o)),e(gt(t)),t}return n}(t),d:[{kind:"field",decorators:[(0,p.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,p.Cb)()],key:"trace",value:void 0},{kind:"method",key:"render",value:function(){return(0,f.dy)(st||(e=["\n      <ha-code-editor\n        .value=","\n        readOnly\n      ></ha-code-editor>\n    "],t||(t=e.slice(0)),st=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))),(0,pt.$w)(this.trace.blueprint_inputs||"").trimRight());var e,t}}]}}),f.oi);function Ct(e){return(Ct="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 jt(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function zt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function It(e,t){return(It=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Rt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Bt(e);if(t){var i=Bt(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ft(this,r)}}function Ft(e,t){return!t||"object"!==Ct(t)&&"function"!=typeof t?Nt(e):t}function Nt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bt(e){return(Bt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function $t(){$t=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(!Ut(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var d=0;d<l.length;d++)this.addElementPlacement(l[d],t);r.push.apply(r,l)}}return{element:e,finishers:n,extras:r}},decorateConstructor:function(e,t){for(var r=[],n=t.length-1;n>=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;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return Vt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Vt(e,t):void 0}}(t)||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.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=Yt(e.key),n=String(e.placement);if("static"!==n&&"prototype"!==n&&"own"!==n)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+n+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:n,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:Wt(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=Wt(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var n=(0,t[r])(e);if(void 0!==n){if("function"!=typeof n)throw new TypeError("Finishers must return a constructor.");e=n}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function Mt(e){var t,r=Yt(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var n={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(n.decorators=e.decorators),"field"===e.kind&&(n.initializer=e.value),n}function Lt(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function Ut(e){return e.decorators&&e.decorators.length}function qt(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function Wt(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function Yt(e){var t=function(e,t){if("object"!==Ct(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==Ct(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ct(t)?t:String(t)}function Vt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Zt,Jt;!function(e,t,r,n){var i=$t();if(n)for(var o=0;o<n.length;o++)i=n[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),r),s=i.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},n=0;n<e.length;n++){var i,o=e[n];if("method"===o.kind&&(i=t.find(r)))if(qt(o.descriptor)||qt(i.descriptor)){if(Ut(o)||Ut(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(Ut(o)){if(Ut(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}Lt(o,i)}else t.push(o)}return t}(a.d.map(Mt)),e);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,p.Mo)("ha-automation-trace-config")],(function(e,t){return{F:function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&It(e,t)}(n,t);var r=Rt(n);function n(){var t;zt(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=r.call.apply(r,[this].concat(o)),e(Nt(t)),t}return n}(t),d:[{kind:"field",decorators:[(0,p.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,p.Cb)()],key:"trace",value:void 0},{kind:"method",key:"render",value:function(){return(0,f.dy)(Tt||(Tt=jt(["\n      <ha-code-editor\n        .value=","\n        readOnly\n      ></ha-code-editor>\n    "])),(0,pt.$w)(this.trace.config).trimRight())}},{kind:"get",static:!0,key:"styles",value:function(){return[(0,f.iv)(At||(At=jt([""])))]}}]}}),f.oi);function Ht(e){return(Ht="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 Xt(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Kt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gt(e,t){return(Gt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Qt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=rr(e);if(t){var i=rr(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return er(this,r)}}function er(e,t){return!t||"object"!==Ht(t)&&"function"!=typeof t?tr(e):t}function tr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rr(e){return(rr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function nr(){nr=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(!ar(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var d=0;d<l.length;d++)this.addElementPlacement(l[d],t);r.push.apply(r,l)}}return{element:e,finishers:n,extras:r}},decorateConstructor:function(e,t){for(var r=[],n=t.length-1;n>=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;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return dr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?dr(e,t):void 0}}(t)||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.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=lr(e.key),n=String(e.placement);if("static"!==n&&"prototype"!==n&&"own"!==n)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+n+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:n,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:cr(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=cr(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var n=(0,t[r])(e);if(void 0!==n){if("function"!=typeof n)throw new TypeError("Finishers must return a constructor.");e=n}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function ir(e){var t,r=lr(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var n={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(n.decorators=e.decorators),"field"===e.kind&&(n.initializer=e.value),n}function or(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function ar(e){return e.decorators&&e.decorators.length}function sr(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function cr(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function lr(e){var t=function(e,t){if("object"!==Ht(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==Ht(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ht(t)?t:String(t)}function dr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ur,fr,pr;(function(e,t,r,n){var i=nr();if(n)for(var o=0;o<n.length;o++)i=n[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),r),s=i.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},n=0;n<e.length;n++){var i,o=e[n];if("method"===o.kind&&(i=t.find(r)))if(sr(o.descriptor)||sr(i.descriptor)){if(ar(o)||ar(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(ar(o)){if(ar(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}or(o,i)}else t.push(o)}return t}(a.d.map(ir)),e);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)})([(0,p.Mo)("hat-logbook-note")],(function(e,t){return{F:function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Gt(e,t)}(n,t);var r=Qt(n);function n(){var t;Kt(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=r.call.apply(r,[this].concat(o)),e(tr(t)),t}return n}(t),d:[{kind:"method",key:"render",value:function(){return(0,f.dy)(Zt||(Zt=Xt(["\n      Not all shown logbook entries might be related to this automation.\n    "])))}},{kind:"field",static:!0,key:"styles",value:function(){return(0,f.iv)(Jt||(Jt=Xt(["\n    :host {\n      display: block;\n      text-align: center;\n      font-style: italic;\n      padding: 16px;\n      margin-top: 8px;\n    }\n  "])))}}]}}),f.oi),r(97740);function hr(e){return(hr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function mr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function yr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vr(e,t){return(vr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function br(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=wr(e);if(t){var i=wr(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return gr(this,r)}}function gr(e,t){return!t||"object"!==hr(t)&&"function"!=typeof t?kr(e):t}function kr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wr(e){return(wr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Er(){Er=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(!xr(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var d=0;d<l.length;d++)this.addElementPlacement(l[d],t);r.push.apply(r,l)}}return{element:e,finishers:n,extras:r}},decorateConstructor:function(e,t){for(var r=[],n=t.length-1;n>=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;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return Tr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Tr(e,t):void 0}}(t)||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.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=Dr(e.key),n=String(e.placement);if("static"!==n&&"prototype"!==n&&"own"!==n)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+n+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:n,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:Sr(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=Sr(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var n=(0,t[r])(e);if(void 0!==n){if("function"!=typeof n)throw new TypeError("Finishers must return a constructor.");e=n}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function Pr(e){var t,r=Dr(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var n={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(n.decorators=e.decorators),"field"===e.kind&&(n.initializer=e.value),n}function _r(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function xr(e){return e.decorators&&e.decorators.length}function Or(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function Sr(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function Dr(e){var t=function(e,t){if("object"!==hr(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==hr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===hr(t)?t:String(t)}function Tr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Ar;!function(e,t,r,n){var i=Er();if(n)for(var o=0;o<n.length;o++)i=n[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),r),s=i.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},n=0;n<e.length;n++){var i,o=e[n];if("method"===o.kind&&(i=t.find(r)))if(Or(o.descriptor)||Or(i.descriptor)){if(xr(o)||xr(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(xr(o)){if(xr(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}_r(o,i)}else t.push(o)}return t}(a.d.map(Pr)),e);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,p.Mo)("ha-automation-trace-logbook")],(function(e,t){return{F:function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&vr(e,t)}(n,t);var r=br(n);function n(){var t;yr(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=r.call.apply(r,[this].concat(o)),e(kr(t)),t}return n}(t),d:[{kind:"field",decorators:[(0,p.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,p.Cb)({type:Boolean,reflect:!0})],key:"narrow",value:void 0},{kind:"field",decorators:[(0,p.Cb)({attribute:!1})],key:"logbookEntries",value:void 0},{kind:"method",key:"render",value:function(){return this.logbookEntries.length?(0,f.dy)(ur||(ur=mr(["\n          <ha-logbook\n            relative-time\n            .hass=","\n            .entries=","\n            .narrow=","\n          ></ha-logbook>\n          <hat-logbook-note></hat-logbook-note>\n        "])),this.hass,this.logbookEntries,this.narrow):(0,f.dy)(fr||(fr=mr(['<div class="padded-box">\n          No Logbook entries found for this step.\n        </div>'])))}},{kind:"get",static:!0,key:"styles",value:function(){return[(0,f.iv)(pr||(pr=mr(["\n        .padded-box {\n          padding: 16px;\n        }\n      "])))]}}]}}),f.oi);var Cr,jr,zr,Ir,Rr,Fr,Nr,Br,$r,Mr,Lr,Ur,qr,Wr,Yr,Vr,Zr,Jr,Hr,Xr=(0,f.iv)(Ar||(Cr=["\n  .tabs {\n    background-color: var(--primary-background-color);\n    border-top: 1px solid var(--divider-color);\n    border-bottom: 1px solid var(--divider-color);\n    display: flex;\n    padding-left: 4px;\n  }\n\n  .tabs.top {\n    border-top: none;\n  }\n\n  .tabs > * {\n    padding: 2px 16px;\n    cursor: pointer;\n    position: relative;\n    bottom: -1px;\n    border: none;\n    border-bottom: 2px solid transparent;\n    user-select: none;\n    background: none;\n    color: var(--primary-text-color);\n    outline: none;\n    transition: background 15ms linear;\n  }\n\n  .tabs > *.active {\n    border-bottom-color: var(--accent-color);\n  }\n\n  .tabs > *:focus,\n  .tabs > *:hover {\n    background: var(--secondary-background-color);\n  }\n"],jr||(jr=Cr.slice(0)),Ar=Object.freeze(Object.defineProperties(Cr,{raw:{value:Object.freeze(jr)}}))));function Kr(e){return(Kr="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 Gr(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Qr(e,t){return bn(e)||function(e,t){var r=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(c){s=!0,i=c}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(e,t)||yn(e,t)||mn()}function en(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function tn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rn(e,t){return(rn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function nn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=sn(e);if(t){var i=sn(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return on(this,r)}}function on(e,t){return!t||"object"!==Kr(t)&&"function"!=typeof t?an(e):t}function an(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sn(e){return(sn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function cn(){cn=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(!un(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var d=0;d<l.length;d++)this.addElementPlacement(l[d],t);r.push.apply(r,l)}}return{element:e,finishers:n,extras:r}},decorateConstructor:function(e,t){for(var r=[],n=t.length-1;n>=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;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,bn(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||yn(t)||mn()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=hn(e.key),n=String(e.placement);if("static"!==n&&"prototype"!==n&&"own"!==n)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+n+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:n,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:pn(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=pn(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var n=(0,t[r])(e);if(void 0!==n){if("function"!=typeof n)throw new TypeError("Finishers must return a constructor.");e=n}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function ln(e){var t,r=hn(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var n={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(n.decorators=e.decorators),"field"===e.kind&&(n.initializer=e.value),n}function dn(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function un(e){return e.decorators&&e.decorators.length}function fn(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function pn(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function hn(e){var t=function(e,t){if("object"!==Kr(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==Kr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Kr(t)?t:String(t)}function mn(){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 yn(e,t){if(e){if("string"==typeof e)return vn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?vn(e,t):void 0}}function vn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function bn(e){if(Array.isArray(e))return e}!function(e,t,r,n){var i=cn();if(n)for(var o=0;o<n.length;o++)i=n[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),r),s=i.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},n=0;n<e.length;n++){var i,o=e[n];if("method"===o.kind&&(i=t.find(r)))if(fn(o.descriptor)||fn(i.descriptor)){if(un(o)||un(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(un(o)){if(un(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}dn(o,i)}else t.push(o)}return t}(a.d.map(ln)),e);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,p.Mo)("ha-automation-trace-path-details")],(function(e,t){return{F:function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&rn(e,t)}(n,t);var r=nn(n);function n(){var t;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=r.call.apply(r,[this].concat(o)),e(an(t)),t}return n}(t),d:[{kind:"field",decorators:[(0,p.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,p.Cb)({type:Boolean,reflect:!0})],key:"narrow",value:void 0},{kind:"field",decorators:[(0,p.Cb)()],key:"selected",value:void 0},{kind:"field",decorators:[(0,p.Cb)()],key:"trace",value:void 0},{kind:"field",decorators:[(0,p.Cb)()],key:"logbookEntries",value:void 0},{kind:"field",decorators:[(0,p.Cb)()],key:"renderedNodes",value:function(){return{}}},{kind:"field",decorators:[(0,p.Cb)()],key:"trackedNodes",value:void 0},{kind:"field",decorators:[(0,p.SB)()],key:"_view",value:function(){return"config"}},{kind:"method",key:"render",value:function(){var e=this;return(0,f.dy)(zr||(zr=en(['\n      <div class="padded-box trace-info">\n        ','\n      </div>\n\n      <div class="tabs top">\n        ',"\n      </div>\n      ","\n    "])),this._renderSelectedTraceInfo(),[["config","Step Config"],["changed_variables","Changed Variables"],["logbook","Related logbook entries"]].map((function(t){var r=Qr(t,2),n=r[0],i=r[1];return(0,f.dy)(Ir||(Ir=en(["\n            <button\n              .view=","\n              class=","\n              @click=","\n            >\n              ","\n            </button>\n          "])),n,(0,h.$)({active:e._view===n}),e._showTab,i)})),"config"===this._view?this._renderSelectedConfig():"changed_variables"===this._view?this._renderChangedVars():this._renderLogbook())}},{kind:"method",key:"_renderSelectedTraceInfo",value:function(){var e,t=this,r=this.trace.trace;if(null===(e=this.selected)||void 0===e||!e.path)return"Select a node on the left for more information.";var n=this.selected.path.split("/");if("default"===n[n.length-1]){var i,o,a=r[n.slice(0,n.length-1).join("/")];if(a&&"default"===(null===(i=a[0])||void 0===i||null===(o=i.result)||void 0===o?void 0:o.choice))return"The default node was executed because no choices matched."}if(!(this.selected.path in r))return"This node was not executed and so no further trace information is available.";for(var s=[],c=!1,l=function(){var e=u[d];if(c){if(e in t.renderedNodes)return"break"}else{if(e!==t.selected.path)return"continue";c=!0}var n=r[e];s.push(n.map((function(r,i){var o=r,a=(o.path,o.timestamp),s=o.result,c=o.error,l=(o.changed_variables,Gr(o,["path","timestamp","result","error","changed_variables"]));return(0,f.dy)(Rr||(Rr=en(["\n            ","\n            ","\n            Executed:\n            ","<br />\n            ","\n            ","\n          "])),e===t.selected.path?"":(0,f.dy)(Fr||(Fr=en(["<h2>","</h2>"])),e.substr(t.selected.path.length+1)),1===n.length?"":(0,f.dy)(Nr||(Nr=en(["<h3>Iteration ","</h3>"])),i+1),(0,v.E)(new Date(a),t.hass.locale),s?(0,f.dy)(Br||(Br=en(["Result:\n                  <pre>","</pre>"])),(0,pt.$w)(s)):c?(0,f.dy)($r||($r=en(['<div class="error">Error: ',"</div>"])),c):"",0===Object.keys(l).length?"":(0,f.dy)(Mr||(Mr=en(["<pre>","</pre>"])),(0,pt.$w)(l)))})))},d=0,u=Object.keys(this.trace.trace);d<u.length;d++){var p=l();if("break"===p)break}return s}},{kind:"method",key:"_renderSelectedConfig",value:function(){var e;if(null===(e=this.selected)||void 0===e||!e.path)return"";var t=(0,lt.nV)(this.trace.config,this.selected.path);return t?(0,f.dy)(Lr||(Lr=en(["<ha-code-editor\n          .value=","\n          readOnly\n        ></ha-code-editor>"])),(0,pt.$w)(t).trimRight()):"Unable to find config"}},{kind:"method",key:"_renderChangedVars",value:function(){var e=this.trace.trace[this.selected.path];return(0,f.dy)(Ur||(Ur=en(['\n      <div class="padded-box">\n        ',"\n      </div>\n    "])),e.map((function(e,t){return(0,f.dy)(qr||(qr=en(["\n            ","\n            ","\n          "])),t>0?(0,f.dy)(Wr||(Wr=en(["<p>Iteration ","</p>"])),t+1):"",0===Object.keys(e.changed_variables||{}).length?"No variables changed":(0,f.dy)(Yr||(Yr=en(["<pre>","</pre>"])),(0,pt.$w)(e.changed_variables).trimRight()))})))}},{kind:"method",key:"_renderLogbook",value:function(){var e,t=this.trace.trace,r=t[this.selected.path],n=Object.keys(this.trackedNodes),i=n.indexOf(this.selected.path);if(-1===i)return(0,f.dy)(Vr||(Vr=en(['<div class="padded-box">Node not tracked.</div>'])));if(i===n.length-1){var o=new Date(r[0].timestamp),a=this.logbookEntries.findIndex((function(e){return new Date(e.when)>=o}));e=-1===a?[]:this.logbookEntries.slice(a)}else{var s=t[n[i+1]],c=new Date(r[0].timestamp),l=new Date(s[0].timestamp);e=[];var d,u=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=yn(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(this.logbookEntries||[]);try{for(u.s();!(d=u.n()).done;){var p=d.value,h=new Date(p.when);if(h>=c){if(!(h<l))break;e.push(p)}}}catch(m){u.e(m)}finally{u.f()}}return e.length?(0,f.dy)(Zr||(Zr=en(["\n          <ha-logbook\n            relative-time\n            .hass=","\n            .entries=","\n            .narrow=","\n          ></ha-logbook>\n          <hat-logbook-note></hat-logbook-note>\n        "])),this.hass,e,this.narrow):(0,f.dy)(Jr||(Jr=en(['<div class="padded-box">\n          No Logbook entries found for this step.\n        </div>'])))}},{kind:"method",key:"_showTab",value:function(e){this._view=e.target.view}},{kind:"get",static:!0,key:"styles",value:function(){return[Xr,(0,f.iv)(Hr||(Hr=en(["\n        .padded-box {\n          margin: 16px;\n        }\n\n        :host(:not([narrow])) .trace-info {\n          min-height: 250px;\n        }\n\n        pre {\n          margin: 0;\n        }\n\n        .error {\n          color: var(--error-color);\n        }\n      "])))]}}]}}),f.oi);var gn=r(82816),kn=r(5435),wn=r(44547),En=r(91168),Pn=r(91741),_n=r(61761);function xn(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Sn(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function On(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(c){s=!0,i=c}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(e,t)||Sn(e,t)||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 Sn(e,t){if(e){if("string"==typeof e)return Dn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Dn(e,t):void 0}}function Dn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Tn,An,Cn,jn,zn,In;function Rn(e){return(Rn="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 Fn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Nn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bn(e,t){return(Bn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function $n(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Un(e);if(t){var i=Un(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Mn(this,r)}}function Mn(e,t){return!t||"object"!==Rn(t)&&"function"!=typeof t?Ln(e):t}function Ln(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 qn(){qn=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 d=0;d<l.length;d++)this.addElementPlacement(l[d],t);r.push.apply(r,l)}}return{element:e,finishers:n,extras:r}},decorateConstructor:function(e,t){for(var r=[],n=t.length-1;n>=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;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return Xn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Xn(e,t):void 0}}(t)||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.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=Hn(e.key),n=String(e.placement);if("static"!==n&&"prototype"!==n&&"own"!==n)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+n+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:n,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:Jn(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=Jn(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var n=(0,t[r])(e);if(void 0!==n){if("function"!=typeof n)throw new TypeError("Finishers must return a constructor.");e=n}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function Wn(e){var t,r=Hn(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var n={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(n.decorators=e.decorators),"field"===e.kind&&(n.initializer=e.value),n}function Yn(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function Vn(e){return e.decorators&&e.decorators.length}function Zn(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function Jn(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function Hn(e){var t=function(e,t){if("object"!==Rn(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==Rn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Rn(t)?t:String(t)}function Xn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Kn,Gn,Qn,ei,ti,ri,ni,ii,oi,ai;!function(e,t,r,n){var i=qn();if(n)for(var o=0;o<n.length;o++)i=n[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),r),s=i.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},n=0;n<e.length;n++){var i,o=e[n];if("method"===o.kind&&(i=t.find(r)))if(Zn(o.descriptor)||Zn(i.descriptor)){if(Vn(o)||Vn(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(Vn(o)){if(Vn(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}Yn(o,i)}else t.push(o)}return t}(a.d.map(Wn)),e);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,p.Mo)("ha-timeline")],(function(e,t){return{F:function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Bn(e,t)}(n,t);var r=$n(n);function n(){var t;Nn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=r.call.apply(r,[this].concat(o)),e(Ln(t)),t}return n}(t),d:[{kind:"field",decorators:[(0,p.Cb)({type:Boolean,reflect:!0})],key:"label",value:function(){return!1}},{kind:"field",decorators:[(0,p.Cb)({type:Boolean,reflect:!0})],key:"raised",value:function(){return!1}},{kind:"field",decorators:[(0,p.Cb)({type:Boolean})],key:"lastItem",value:function(){return!1}},{kind:"field",decorators:[(0,p.Cb)({type:String})],key:"icon",value:void 0},{kind:"field",decorators:[(0,p.Cb)({attribute:!1})],key:"moreItems",value:void 0},{kind:"field",decorators:[(0,p.SB)()],key:"_showMore",value:function(){return!1}},{kind:"method",key:"render",value:function(){return(0,f.dy)(Tn||(Tn=Fn(['\n      <div class="timeline-start">\n        ',"\n        ",'\n      </div>\n      <div class="content">\n        <slot></slot>\n        ',"\n      </div>\n    "])),this.label?"":(0,f.dy)(An||(An=Fn(["\n              <ha-svg-icon .path=","></ha-svg-icon>\n            "])),this.icon||u.KS$),this.lastItem?"":(0,f.dy)(Cn||(Cn=Fn(['<div class="line"></div>']))),this.moreItems?(0,f.dy)(jn||(jn=Fn(["\n              <div>\n                ","\n              </div>\n            "])),this._showMore||1===this.moreItems.length?this.moreItems:(0,f.dy)(zn||(zn=Fn(['\n                      <button class="link" @click=',">\n                        Show "," more items\n                      </button>\n                    "])),this._handleShowMore,this.moreItems.length)):"")}},{kind:"method",key:"_handleShowMore",value:function(){this._showMore=!0}},{kind:"get",static:!0,key:"styles",value:function(){return[(0,f.iv)(In||(In=Fn(["\n        :host {\n          display: flex;\n          flex-direction: row;\n        }\n        :host(:not([lastItem])) {\n          min-height: 50px;\n        }\n        :host([label]) {\n          margin-top: -8px;\n          font-style: italic;\n          color: var(--timeline-label-color, var(--secondary-text-color));\n        }\n        .timeline-start {\n          display: flex;\n          flex-direction: column;\n          align-items: center;\n          margin-right: 8px;\n          width: 24px;\n        }\n        ha-svg-icon {\n          color: var(\n            --timeline-ball-color,\n            var(--timeline-color, var(--secondary-text-color))\n          );\n          border-radius: 50%;\n        }\n        :host([raised]) ha-svg-icon {\n          transform: scale(1.3);\n        }\n        .line {\n          flex: 1;\n          width: 2px;\n          background-color: var(\n            --timeline-line-color,\n            var(--timeline-color, var(--secondary-text-color))\n          );\n          margin: 4px 0;\n        }\n        .content {\n          margin-top: 2px;\n        }\n        :host(:not([lastItem])) .content {\n          padding-bottom: 16px;\n        }\n        :host([label]) .content {\n          margin-top: 0;\n          padding-top: 6px;\n        }\n      "]))),ut.k1]}}]}}),f.oi);function si(e){return(si="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 ci(e,t){return(ci=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function li(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=wi(e);if(t){var i=wi(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return di(this,r)}}function di(e,t){return!t||"object"!==si(t)&&"function"!=typeof t?ui(e):t}function ui(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fi(){fi=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(!mi(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var d=0;d<l.length;d++)this.addElementPlacement(l[d],t);r.push.apply(r,l)}}return{element:e,finishers:n,extras:r}},decorateConstructor:function(e,t){for(var r=[],n=t.length-1;n>=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;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return gi(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?gi(e,t):void 0}}(t)||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.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=bi(e.key),n=String(e.placement);if("static"!==n&&"prototype"!==n&&"own"!==n)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+n+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:n,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:vi(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=vi(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var n=(0,t[r])(e);if(void 0!==n){if("function"!=typeof n)throw new TypeError("Finishers must return a constructor.");e=n}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function pi(e){var t,r=bi(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var n={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(n.decorators=e.decorators),"field"===e.kind&&(n.initializer=e.value),n}function hi(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function mi(e){return e.decorators&&e.decorators.length}function yi(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function vi(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function bi(e){var t=function(e,t){if("object"!==si(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==si(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===si(t)?t:String(t)}function gi(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ki(e,t,r){return(ki="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=wi(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(r):i.value}})(e,t,r||e)}function wi(e){return(wi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ei(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Pi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function xi(e,t,r){return t&&_i(e.prototype,t),r&&_i(e,r),e}function Oi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Si,Di,Ti=function(e,t){return Math.abs(t.getTime()-e.getTime())>1e3},Ai=function(){function e(t,r,n){Pi(this,e),this.hass=t,this.entries=r,Oi(this,"lastReportedTime",void 0),this.lastReportedTime=new Date(n.timestamp.start)}return xi(e,[{key:"setLastReportedTime",value:function(e){this.lastReportedTime=e}},{key:"renderTime",value:function(e,t){this.entries.push((0,f.dy)(Kn||(Kn=Ei(["\n      <ha-timeline label>\n        ","\n        later\n      </ha-timeline>\n    "])),(0,kn.Z)(e,this.hass.localize,{compareTime:t,includeTense:!1}))),this.lastReportedTime=t}},{key:"maybeRenderTime",value:function(e){return Ti(e,this.lastReportedTime)?(this.renderTime(this.lastReportedTime,e),!0):(this.lastReportedTime=e,!1)}}]),e}(),Ci=function(){function e(t,r,n){Pi(this,e),this.entries=t,this.timeTracker=r,this.logbookEntries=n,Oi(this,"curIndex",void 0),Oi(this,"pendingItems",[]),this.curIndex=n.length>0&&"automation"===n[0].domain?1:0}return xi(e,[{key:"curItem",get:function(){return this.logbookEntries[this.curIndex]}},{key:"hasNext",get:function(){return this.curIndex!==this.logbookEntries.length}},{key:"maybeRenderItem",value:function(){var e=this.curItem;this.curIndex++;var t=new Date(e.when);if(0!==this.pendingItems.length){var r=this.pendingItems[this.pendingItems.length-1][0];Ti(r,t)&&(this._renderLogbookEntries(),this.timeTracker.renderTime(r,t)),this.pendingItems.push([t,e])}else this.pendingItems.push([t,e])}},{key:"flush",value:function(){this.pendingItems.length>0&&this._renderLogbookEntries()}},{key:"_renderLogbookEntries",value:function(){this.timeTracker.maybeRenderTime(this.pendingItems[0][0]);var e,t,r=[];for(e=0;e<Math.min(this.pendingItems.length,2);e++)r.push(this._renderLogbookEntryHelper(this.pendingItems[e][1]));if(e<this.pendingItems.length)for(t=[];e<this.pendingItems.length;e++)t.push(this._renderLogbookEntryHelper(this.pendingItems[e][1]));this.entries.push((0,f.dy)(Gn||(Gn=Ei(["\n      <ha-timeline .icon="," .moreItems=",">\n        ","\n      </ha-timeline>\n    "])),u.KS$,t,r)),this.timeTracker.setLastReportedTime(this.pendingItems[this.pendingItems.length-1][0]),this.pendingItems=[]}},{key:"_renderLogbookEntryHelper",value:function(e){return(0,f.dy)(Qn||(Qn=Ei([""," (",")\n      ","<br />"])),e.name,e.entity_id,e.message||"turned ".concat(e.state))}}]),e}(),ji=function(){function e(t,r,n,i,o){Pi(this,e),this.hass=t,this.entries=r,this.trace=n,this.logbookRenderer=i,this.timeTracker=o,Oi(this,"curIndex",0),Oi(this,"keys",void 0),this.keys=Object.keys(n.trace)}return xi(e,[{key:"curItem",get:function(){return this._getItem(this.curIndex)}},{key:"hasNext",get:function(){return this.curIndex!==this.keys.length}},{key:"renderItem",value:function(){this.curIndex=this._renderItem(this.curIndex)}},{key:"_getItem",value:function(e){return this.trace.trace[this.keys[e]]}},{key:"_renderItem",value:function(e,t){var r=this._getItem(e);if((0,lt.Zm)(r[0].path))return this._handleTrigger(e,r[0]);for(var n=new Date(r[0].timestamp);this.logbookRenderer.hasNext&&new Date(this.logbookRenderer.curItem.when)<n;)this.logbookRenderer.maybeRenderItem();this.logbookRenderer.flush(),this.timeTracker.maybeRenderTime(n);var i,o=r[0].path;try{i=(0,lt.nV)(this.trace.config,o)}catch(c){return this._renderEntry(o,"Unable to extract path ".concat(o,". Download trace and report as bug")),e+1}var a=o.split("/");if(!(2===a.length)&&!t)return this._renderEntry(o,o.replace(/\//g," ")),e+1;if(t||(t=(0,wn.Pw)(i)),"choose"===t)return this._handleChoose(e);this._renderEntry(o,function(e,t,r){if(t.alias)return t.alias;if(r||(r=(0,wn.Pw)(t)),"service"===r){var n,i=t;if(i.service_template||i.service&&(0,_n.J)(i.service))n="Call a service based on a template";else{if(!i.service)return r;n="Call service ".concat(i.service)}if(i.target){for(var o=[],a=0,s=Object.entries({area_id:"areas",device_id:"devices",entity_id:"entities"});a<s.length;a++){var l=On(s[a],2),d=l[0],u=l[1];if(d in i.target){var f,p=[],h=!0,m=xn(Array.isArray(i.target[d])?i.target[d]:[i.target[d]]);try{for(m.s();!(f=m.n()).done;){var y=f.value;if((0,_n.J)(y)){o.push("templated ".concat(u)),h=!1;break}p.push(y)}}catch(c){m.e(c)}finally{m.f()}h&&o.push("".concat(u," ").concat(p.join(", ")))}}o.length>0&&(n+=" on ".concat(o.join(", ")))}return n}if("delay"===r){var v,b=t;return v="number"==typeof b.delay?"for ".concat((0,En.Z)(b.delay)):"string"==typeof b.delay?(0,_n.J)(b.delay)?"based on a template":"for ".concat(b.delay):"for ".concat(JSON.stringify(b.delay)),"Delay ".concat(v)}if("activate_scene"===r){var k=t,w=e.states[k.scene];return"Activate scene ".concat(w?(0,Pn.C)(w):k.scene)}if("wait_for_trigger"===r){var E=t;return"Wait for ".concat((0,g.r)(E.wait_for_trigger).map((function(e){return function(e){return"".concat(e.platform," trigger")}(e)})).join(", "))}if("variables"===r){var P=t;return"Define variables ".concat(Object.keys(P.variables).join(", "))}if("fire_event"===r){var _=t;return(0,_n.J)(_.event)?"Fire event based on a template":"Fire event ".concat(_.event)}return"wait_template"===r?"Wait for a template to render true":"check_condition"===r?"Test ".concat((x=t).alias?x.alias:["or","and","not"].includes(x.condition)?'multiple conditions using "'.concat(x.condition,'"'):"".concat(x.condition," condition")):r;var x}(this.hass,i,t));for(var s=e+1;s<this.keys.length&&this.keys[s].split("/").length!==a.length;s++);return s}},{key:"_handleTrigger",value:function(e,t){return this._renderEntry(t.path,"Triggered ".concat("trigger"===t.path?"manually":"by the ".concat(this.trace.trigger)," at\n    ").concat((0,v.E)(new Date(t.timestamp),this.hass.locale)),u.mdD),e+1}},{key:"_handleChoose",value:function(e){var t,r,n=this.keys[e],i=n.split("/").length,o=this._getItem(e)[0],a="default"===(null===(t=o.result)||void 0===t?void 0:t.choice),s=this._getDataFromPath(this.keys[e]).alias||"Choose";if(a)this._renderEntry(n,"".concat(s,": Default action executed"));else if(o.result){var c=this._getDataFromPath("".concat(this.keys[e],"/choose/").concat(o.result.choice)),l=c?"".concat(c.alias||"Choice ".concat(o.result.choice)," executed"):"Error: ".concat(o.error);this._renderEntry(n,"".concat(s,": ").concat(l))}else this._renderEntry(n,"".concat(s,": No action taken"));for(r=e+1;r<this.keys.length;r++){var d=this.keys[r].split("/");if(d.length<=i)return r;if(a&&"default"===d[i+1]||!a&&"sequence"===d[i+3])break}for(;r<this.keys.length;){var u=this.keys[r];if(u.split("/").length<=i)return r;r=this._renderItem(r,(0,wn.Pw)(this._getDataFromPath(u)))}return r}},{key:"_renderEntry",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.U3w;this.entries.push((0,f.dy)(ei||(ei=Ei(["\n      <ha-timeline .icon="," data-path=",">\n        ","\n      </ha-timeline>\n    "])),r,e,t))}},{key:"_getDataFromPath",value:function(e){return(0,lt.nV)(this.trace.config,e)}}]),e}();!function(e,t,r,n){var i=fi();if(n)for(var o=0;o<n.length;o++)i=n[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),r),s=i.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},n=0;n<e.length;n++){var i,o=e[n];if("method"===o.kind&&(i=t.find(r)))if(yi(o.descriptor)||yi(i.descriptor)){if(mi(o)||mi(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(mi(o)){if(mi(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}hi(o,i)}else t.push(o)}return t}(a.d.map(pi)),e);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,p.Mo)("hat-trace-timeline")],(function(e,t){var r=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ci(e,t)}(n,t);var r=li(n);function n(){var t;Pi(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=r.call.apply(r,[this].concat(o)),e(ui(t)),t}return n}(t);return{F:r,d:[{kind:"field",decorators:[(0,p.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,p.Cb)({attribute:!1})],key:"trace",value:void 0},{kind:"field",decorators:[(0,p.Cb)({attribute:!1})],key:"logbookEntries",value:void 0},{kind:"field",decorators:[(0,p.Cb)({attribute:!1})],key:"selectedPath",value:void 0},{kind:"field",decorators:[(0,p.Cb)({type:Boolean})],key:"allowPick",value:function(){return!1}},{kind:"method",key:"render",value:function(){var e=this;if(!this.trace)return(0,f.dy)(ti||(ti=Ei([""])));for(var t=[],r=new Ai(this.hass,t,this.trace),n=new Ci(t,r,this.logbookEntries||[]),i=new ji(this.hass,t,this.trace,n,r);i.hasNext;)i.renderItem();for(;n.hasNext;)n.maybeRenderItem();n.flush();var o,a=function(){return(0,v.E)(new Date(e.trace.timestamp.finish),e.hass.locale)},s=function(){return"(runtime:\n      ".concat(((new Date(e.trace.timestamp.finish).getTime()-new Date(e.trace.timestamp.start).getTime())/1e3).toFixed(2),"\n      seconds)")};if("running"===this.trace.state)o={description:"Still running",icon:u.plV};else if("debugged"===this.trace.state)o={description:"Debugged",icon:u.Oy8};else if("finished"===this.trace.script_execution)o={description:"Finished at ".concat(a()," ").concat(s()),icon:u.mdD};else if("aborted"===this.trace.script_execution)o={description:"Aborted at ".concat(a()," ").concat(s()),icon:u.fr4};else if("cancelled"===this.trace.script_execution)o={description:"Cancelled at ".concat(a()," ").concat(s()),icon:u.fr4};else{var c,l,d=!1;switch(this.trace.script_execution){case"failed_conditions":c="a condition failed";break;case"failed_single":c="only a single execution is allowed";break;case"failed_max_runs":c="maximum number of parallel runs reached";break;case"error":c="an error was encountered",d=!0,l=(0,f.dy)(ri||(ri=Ei(["<br /><br />",""])),this.trace.error);break;default:c='of unknown reason "'.concat(this.trace.script_execution,'"'),d=!0}o={description:(0,f.dy)(ni||(ni=Ei(["Stopped because "," at ","\n        ","",""])),c,a(),s(),l||""),icon:u.fr4,className:d?"error":void 0}}return o&&t.push((0,f.dy)(ii||(ii=Ei(["\n        <ha-timeline\n          lastItem\n          .icon=","\n          class=","\n        >\n          ","\n        </ha-timeline>\n      "])),o.icon,(0,gn.o)(o.className),o.description)),(0,f.dy)(oi||(oi=Ei(["",""])),t)}},{kind:"method",key:"updated",value:function(e){var t=this;if(ki(wi(r.prototype),"updated",this).call(this,e),this.allowPick&&e.has("trace")&&this.trace&&this.selectedPath&&!(this.selectedPath in this.trace.trace)){var n=this.shadowRoot.querySelector("ha-timeline[data-path]");n&&((0,b.B)(this,"value-changed",{value:n.dataset.path}),this.selectedPath=n.dataset.path)}(e.has("trace")||e.has("selectedPath"))&&this.shadowRoot.querySelectorAll("ha-timeline[data-path]").forEach((function(e){if(e.toggleAttribute("selected",t.selectedPath===e.dataset.path),t.allowPick&&0!==e.tabIndex){e.tabIndex=0;var r=function(){t.selectedPath=e.dataset.path,(0,b.B)(t,"value-changed",{value:e.dataset.path})};e.addEventListener("click",r),e.addEventListener("keydown",(function(e){"Enter"!==e.key&&" "!==e.key||r()})),e.addEventListener("mouseover",(function(){e.raised=!0})),e.addEventListener("mouseout",(function(){e.raised=!1}))}}))}},{kind:"get",static:!0,key:"styles",value:function(){return[(0,f.iv)(ai||(ai=Ei(["\n        ha-timeline[lastItem].condition {\n          --timeline-ball-color: var(--error-color);\n        }\n        ha-timeline[data-path] {\n          cursor: pointer;\n        }\n        ha-timeline[selected] {\n          --timeline-ball-color: var(--primary-color);\n        }\n        ha-timeline:focus {\n          outline: none;\n          --timeline-ball-color: var(--accent-color);\n        }\n        .error {\n          --timeline-ball-color: var(--error-color);\n          color: var(--error-color);\n        }\n      "])))]}}]}}),f.oi);function zi(e){return(zi="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 Ii(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Ri(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fi(e,t){return(Fi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ni(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Mi(e);if(t){var i=Mi(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Bi(this,r)}}function Bi(e,t){return!t||"object"!==zi(t)&&"function"!=typeof t?$i(e):t}function $i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Mi(e){return(Mi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Li(){Li=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(!Wi(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var d=0;d<l.length;d++)this.addElementPlacement(l[d],t);r.push.apply(r,l)}}return{element:e,finishers:n,extras:r}},decorateConstructor:function(e,t){for(var r=[],n=t.length-1;n>=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;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return Ji(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ji(e,t):void 0}}(t)||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.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=Zi(e.key),n=String(e.placement);if("static"!==n&&"prototype"!==n&&"own"!==n)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+n+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:n,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:Vi(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=Vi(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var n=(0,t[r])(e);if(void 0!==n){if("function"!=typeof n)throw new TypeError("Finishers must return a constructor.");e=n}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function Ui(e){var t,r=Zi(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var n={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(n.decorators=e.decorators),"field"===e.kind&&(n.initializer=e.value),n}function qi(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function Wi(e){return e.decorators&&e.decorators.length}function Yi(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function Vi(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function Zi(e){var t=function(e,t){if("object"!==zi(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==zi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===zi(t)?t:String(t)}function Ji(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Hi,Xi,Ki,Gi,Qi,eo,to,ro,no,io,oo,ao,so,co,lo,uo,fo,po;!function(e,t,r,n){var i=Li();if(n)for(var o=0;o<n.length;o++)i=n[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),r),s=i.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},n=0;n<e.length;n++){var i,o=e[n];if("method"===o.kind&&(i=t.find(r)))if(Yi(o.descriptor)||Yi(i.descriptor)){if(Wi(o)||Wi(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(Wi(o)){if(Wi(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}qi(o,i)}else t.push(o)}return t}(a.d.map(Ui)),e);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,p.Mo)("ha-automation-trace-timeline")],(function(e,t){return{F:function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Fi(e,t)}(n,t);var r=Ni(n);function n(){var t;Ri(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=r.call.apply(r,[this].concat(o)),e($i(t)),t}return n}(t),d:[{kind:"field",decorators:[(0,p.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,p.Cb)({attribute:!1})],key:"trace",value:void 0},{kind:"field",decorators:[(0,p.Cb)({attribute:!1})],key:"logbookEntries",value:void 0},{kind:"field",decorators:[(0,p.Cb)()],key:"selected",value:void 0},{kind:"method",key:"render",value:function(){return(0,f.dy)(Si||(Si=Ii(["\n      <hat-trace-timeline\n        .hass=","\n        .trace=","\n        .logbookEntries=","\n        .selectedPath=","\n        allowPick\n      >\n      </hat-trace-timeline>\n      <hat-logbook-note></hat-logbook-note>\n    "])),this.hass,this.trace,this.logbookEntries,this.selected.path)}},{kind:"get",static:!0,key:"styles",value:function(){return[(0,f.iv)(Di||(Di=Ii(["\n        :host {\n          display: block;\n          padding: 16px;\n        }\n      "])))]}}]}}),f.oi);function ho(e){return(ho="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 mo(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 yo(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){mo(o,n,i,a,s,"next",e)}function s(e){mo(o,n,i,a,s,"throw",e)}a(void 0)}))}}function vo(e,t){return Io(e)||function(e,t){var r=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(c){s=!0,i=c}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(e,t)||jo(e,t)||Co()}function bo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function go(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ko(e,t){return(ko=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function wo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Fo(e);if(t){var i=Fo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Eo(this,r)}}function Eo(e,t){return!t||"object"!==ho(t)&&"function"!=typeof t?Po(e):t}function Po(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _o(){_o=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(!So(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var d=0;d<l.length;d++)this.addElementPlacement(l[d],t);r.push.apply(r,l)}}return{element:e,finishers:n,extras:r}},decorateConstructor:function(e,t){for(var r=[],n=t.length-1;n>=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;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,Io(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||jo(t)||Co()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=Ao(e.key),n=String(e.placement);if("static"!==n&&"prototype"!==n&&"own"!==n)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+n+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:n,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:To(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=To(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var n=(0,t[r])(e);if(void 0!==n){if("function"!=typeof n)throw new TypeError("Finishers must return a constructor.");e=n}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function xo(e){var t,r=Ao(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var n={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(n.decorators=e.decorators),"field"===e.kind&&(n.initializer=e.value),n}function Oo(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function So(e){return e.decorators&&e.decorators.length}function Do(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function To(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function Ao(e){var t=function(e,t){if("object"!==ho(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==ho(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ho(t)?t:String(t)}function Co(){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 jo(e,t){if(e){if("string"==typeof e)return zo(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?zo(e,t):void 0}}function zo(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Io(e){if(Array.isArray(e))return e}function Ro(e,t,r){return(Ro="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Fo(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(r):i.value}})(e,t,r||e)}function Fo(e){return(Fo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var No=function(e,t,r,n){var i=_o();if(n)for(var o=0;o<n.length;o++)i=n[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),r),s=i.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},n=0;n<e.length;n++){var i,o=e[n];if("method"===o.kind&&(i=t.find(r)))if(Do(o.descriptor)||Do(i.descriptor)){if(So(o)||So(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(So(o)){if(So(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}Oo(o,i)}else t.push(o)}return t}(a.d.map(xo)),e);return i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,p.Mo)("ha-automation-trace")],(function(e,t){var r,n,i=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ko(e,t)}(n,t);var r=wo(n);function n(){var t;go(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=r.call.apply(r,[this].concat(o)),e(Po(t)),t}return n}(t);return{F:i,d:[{kind:"field",decorators:[(0,p.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,p.Cb)()],key:"automationId",value:void 0},{kind:"field",decorators:[(0,p.Cb)({attribute:!1})],key:"automations",value:void 0},{kind:"field",decorators:[(0,p.Cb)({type:Boolean})],key:"isWide",value:void 0},{kind:"field",decorators:[(0,p.Cb)({type:Boolean,reflect:!0})],key:"narrow",value:void 0},{kind:"field",decorators:[(0,p.Cb)({attribute:!1})],key:"route",value:void 0},{kind:"field",decorators:[(0,p.SB)()],key:"_entityId",value:void 0},{kind:"field",decorators:[(0,p.SB)()],key:"_traces",value:void 0},{kind:"field",decorators:[(0,p.SB)()],key:"_runId",value:void 0},{kind:"field",decorators:[(0,p.SB)()],key:"_selected",value:void 0},{kind:"field",decorators:[(0,p.SB)()],key:"_trace",value:void 0},{kind:"field",decorators:[(0,p.SB)()],key:"_logbookEntries",value:void 0},{kind:"field",decorators:[(0,p.SB)()],key:"_view",value:function(){return"details"}},{kind:"method",key:"render",value:function(){var e,t=this,r=this._entityId?this.hass.states[this._entityId]:void 0,n=this.shadowRoot.querySelector("hat-script-graph"),i=null==n?void 0:n.trackedNodes,o=null==n?void 0:n.renderedNodes,a=(null==r?void 0:r.attributes.friendly_name)||this._entityId;var s=(0,f.dy)(Hi||(Hi=bo(['\n      <mwc-icon-button label="Refresh" @click=',">\n        <ha-svg-icon .path=","></ha-svg-icon>\n      </mwc-icon-button>\n      <mwc-icon-button\n        .disabled=",'\n        label="Download Trace"\n        @click=',"\n      >\n        <ha-svg-icon .path=","></ha-svg-icon>\n      </mwc-icon-button>\n    "])),(function(){return t._loadTraces()}),u.jcD,!this._trace,this._downloadTrace,u.OGU);return(0,f.dy)(Xi||(Xi=bo(["\n      ","\n      <hass-tabs-subpage\n        .hass=","\n        .narrow=","\n        .route=","\n        .tabs=","\n      >\n        ",'\n        <div class="toolbar">\n          ',"\n          ","\n          ","\n        </div>\n\n        ","\n      </hass-tabs-subpage>\n    "])),"",this.hass,this.narrow,this.route,ft.configSections.automation,this.narrow?(0,f.dy)(Ki||(Ki=bo(['<span slot="header"> ',' </span>\n              <div slot="toolbar-icon">',"</div>"])),a,s):"",this.narrow?"":(0,f.dy)(Gi||(Gi=bo(["<div>\n                ",'\n                <a\n                  class="linkButton"\n                  href="/config/automation/edit/','"\n                >\n                  <mwc-icon-button label="Edit Automation" tabindex="-1">\n                    <ha-svg-icon .path=',"></ha-svg-icon>\n                  </mwc-icon-button>\n                </a>\n              </div>"])),a,this.automationId,u.r9),this._traces&&this._traces.length>0?(0,f.dy)(Qi||(Qi=bo(["\n                <div>\n                  <mwc-icon-button\n                    .disabled=",'\n                    label="Older trace"\n                    @click=',"\n                  >\n                    <ha-svg-icon .path=","></ha-svg-icon>\n                  </mwc-icon-button>\n                  <select .value="," @change=",">\n                    ","\n                  </select>\n                  <mwc-icon-button\n                    .disabled=",'\n                    label="Newer trace"\n                    @click=',"\n                  >\n                    <ha-svg-icon .path=","></ha-svg-icon>\n                  </mwc-icon-button>\n                </div>\n              "])),this._traces[this._traces.length-1].run_id===this._runId,this._pickOlderTrace,u.JXK,this._runId,this._pickTrace,(0,m.r)(this._traces,(function(e){return e.run_id}),(function(e){return(0,f.dy)(eo||(eo=bo(["<option value=",">\n                          ","\n                        </option>"])),e.run_id,(0,v.E)(new Date(e.timestamp.start),t.hass.locale))})),this._traces[0].run_id===this._runId,this._pickNewerTrace,u.RWP):"",this.narrow?"":(0,f.dy)(to||(to=bo(["<div>","</div>"])),s),void 0===this._traces?(0,f.dy)(ro||(ro=bo(['<div class="container">Loading…</div>']))):0===this._traces.length?(0,f.dy)(no||(no=bo(['<div class="container">No traces found</div>']))):void 0===this._trace?"":(0,f.dy)(io||(io=bo(['\n              <div class="main">\n                <div class="graph">\n                  <hat-script-graph\n                    .trace=',"\n                    .selected=","\n                    @graph-node-selected=",'\n                  ></hat-script-graph>\n                </div>\n\n                <div class="info">\n                  <div class="tabs top">\n                    ',"\n                    ","\n                  </div>\n                  ","\n                </div>\n              </div>\n            "])),this._trace,null===(e=this._selected)||void 0===e?void 0:e.path,this._pickNode,[["details","Step Details"],["timeline","Trace Timeline"],["logbook","Related logbook entries"],["config","Automation Config"]].map((function(e){var r=vo(e,2),n=r[0],i=r[1];return(0,f.dy)(oo||(oo=bo(['\n                        <button\n                          tabindex="0"\n                          .view=',"\n                          class=","\n                          @click=","\n                        >\n                          ","\n                        </button>\n                      "])),n,(0,h.$)({active:t._view===n}),t._showTab,i)})),this._trace.blueprint_inputs?(0,f.dy)(ao||(ao=bo(['\n                          <button\n                            tabindex="0"\n                            .view=',"\n                            class=","\n                            @click=","\n                          >\n                            Blueprint Config\n                          </div>\n                        "])),"blueprint",(0,h.$)({active:"blueprint"===this._view}),this._showTab):"",void 0===this._selected||void 0===this._logbookEntries||void 0===i?"":"details"===this._view?(0,f.dy)(so||(so=bo(["\n                        <ha-automation-trace-path-details\n                          .hass=","\n                          .narrow=","\n                          .trace=","\n                          .selected=","\n                          .logbookEntries=","\n                          .trackedNodes=","\n                          .renderedNodes=","\n                        ></ha-automation-trace-path-details>\n                      "])),this.hass,this.narrow,this._trace,this._selected,this._logbookEntries,i,o):"config"===this._view?(0,f.dy)(co||(co=bo(["\n                        <ha-automation-trace-config\n                          .hass=","\n                          .trace=","\n                        ></ha-automation-trace-config>\n                      "])),this.hass,this._trace):"logbook"===this._view?(0,f.dy)(lo||(lo=bo(["\n                        <ha-automation-trace-logbook\n                          .hass=","\n                          .narrow=","\n                          .logbookEntries=","\n                        ></ha-automation-trace-logbook>\n                      "])),this.hass,this.narrow,this._logbookEntries):"blueprint"===this._view?(0,f.dy)(uo||(uo=bo(["\n                        <ha-automation-trace-blueprint-config\n                          .hass=","\n                          .trace=","\n                        ></ha-automation-trace-blueprint-config>\n                      "])),this.hass,this._trace):(0,f.dy)(fo||(fo=bo(["\n                        <ha-automation-trace-timeline\n                          .hass=","\n                          .trace=","\n                          .logbookEntries=","\n                          .selected=","\n                          @value-changed=","\n                        ></ha-automation-trace-timeline>\n                      "])),this.hass,this._trace,this._logbookEntries,this._selected,this._timelinePathPicked)))}},{kind:"method",key:"firstUpdated",value:function(e){if(Ro(Fo(i.prototype),"firstUpdated",this).call(this,e),this.automationId){var t=new URLSearchParams(location.search);this._loadTraces(t.get("run_id")||void 0)}}},{kind:"method",key:"updated",value:function(e){var t=this;if(Ro(Fo(i.prototype),"updated",this).call(this,e),e.get("automationId")&&(this._traces=void 0,this._entityId=void 0,this._runId=void 0,this._trace=void 0,this._logbookEntries=void 0,this.automationId&&this._loadTraces()),e.has("_runId")&&this._runId&&(this._trace=void 0,this._logbookEntries=void 0,this.shadowRoot.querySelector("select").value=this._runId,this._loadTrace()),e.has("automations")&&this.automationId&&!this._entityId){var r=this.automations.find((function(e){return e.attributes.id===t.automationId}));this._entityId=null==r?void 0:r.entity_id}}},{kind:"method",key:"_pickOlderTrace",value:function(){var e=this,t=this._traces.findIndex((function(t){return t.run_id===e._runId}));this._runId=this._traces[t+1].run_id,this._selected=void 0}},{kind:"method",key:"_pickNewerTrace",value:function(){var e=this,t=this._traces.findIndex((function(t){return t.run_id===e._runId}));this._runId=this._traces[t-1].run_id,this._selected=void 0}},{kind:"method",key:"_pickTrace",value:function(e){this._runId=e.target.value,this._selected=void 0}},{kind:"method",key:"_pickNode",value:function(e){this._selected=e.detail}},{kind:"method",key:"_loadTraces",value:(n=yo(regeneratorRuntime.mark((function e(t){var r,n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,lt.lj)(this.hass,"automation",this.automationId);case 2:if(this._traces=e.sent,this._traces.reverse(),t&&(this._runId=t),!this._runId||this._traces.some((function(e){return e.run_id===n._runId}))){e.next=11;break}return this._runId=void 0,this._selected=void 0,t&&((r=new URLSearchParams(location.search)).delete("run_id"),history.replaceState(null,"","".concat(location.pathname,"?").concat(r.toString()))),e.next=11,(0,dt.Ys)(this,{text:"Chosen trace is no longer available"});case 11:!this._runId&&this._traces.length>0&&(this._runId=this._traces[0].run_id);case 12:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{kind:"method",key:"_loadTrace",value:(r=yo(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,lt.mA)(this.hass,"automation",this.automationId,this._runId);case 2:if(t=e.sent,!(0,y.p)(this.hass,"logbook")){e.next=9;break}return e.next=6,(0,ct.sS)(this.hass,t.timestamp.start,t.context.id);case 6:e.t0=e.sent,e.next=10;break;case 9:e.t0=[];case 10:this._logbookEntries=e.t0,this._trace=t;case 12:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{kind:"method",key:"_downloadTrace",value:function(){var e=document.createElement("a");e.download="trace ".concat(this._entityId," ").concat(this._trace.timestamp.start,".json"),e.href="data:application/json;charset=utf-8,".concat(encodeURI(JSON.stringify({trace:this._trace,logbookEntries:this._logbookEntries},void 0,2))),e.click()}},{kind:"method",key:"_importTrace",value:function(){var e=prompt("Enter downloaded trace");e&&(localStorage.devTrace=e,this._loadLocalTrace(e))}},{kind:"method",key:"_loadLocalStorageTrace",value:function(){localStorage.devTrace&&this._loadLocalTrace(localStorage.devTrace)}},{kind:"method",key:"_loadLocalTrace",value:function(e){var t=JSON.parse(e);this._trace=t.trace,this._logbookEntries=t.logbookEntries}},{kind:"method",key:"_showTab",value:function(e){this._view=e.target.view}},{kind:"method",key:"_timelinePathPicked",value:function(e){var t=e.detail.value,r=this.shadowRoot.querySelector("hat-script-graph").trackedNodes;r[t]&&(this._selected=r[t])}},{kind:"get",static:!0,key:"styles",value:function(){return[ut.Qx,Xr,(0,f.iv)(po||(po=bo(["\n        .toolbar {\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n          font-size: 20px;\n          height: var(--header-height);\n          padding: 0 16px;\n          background-color: var(--primary-background-color);\n          font-weight: 400;\n          color: var(--app-header-text-color, white);\n          border-bottom: var(--app-header-border-bottom, none);\n          box-sizing: border-box;\n        }\n\n        .toolbar > * {\n          display: flex;\n          align-items: center;\n        }\n\n        :host([narrow]) .toolbar > * {\n          display: contents;\n        }\n\n        .main {\n          height: calc(100% - 56px);\n          display: flex;\n          background-color: var(--card-background-color);\n        }\n\n        :host([narrow]) .main {\n          height: auto;\n          flex-direction: column;\n        }\n\n        .container {\n          padding: 16px;\n        }\n\n        .graph {\n          border-right: 1px solid var(--divider-color);\n          overflow-x: auto;\n          max-width: 50%;\n        }\n        :host([narrow]) .graph {\n          max-width: 100%;\n        }\n\n        .info {\n          flex: 1;\n          background-color: var(--card-background-color);\n        }\n\n        .linkButton {\n          color: var(--primary-text-color);\n        }\n      "])))]}}]}}),f.oi)}}]);
//# sourceMappingURL=chunk.022400120554a8e434ab.js.map