iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
7 lines • 110 kB
JavaScript
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[37270],{17079:function(t,i,e){e.d(i,{X:function(){return a}});e(16280),e(44114);class a{hostConnected(){window.addEventListener("undo-change",this._onUndoChange)}hostDisconnected(){window.removeEventListener("undo-change",this._onUndoChange)}get canUndo(){return this._undoStack.length>0}get canRedo(){return this._redoStack.length>0}commit(t){this._undoStack.length>=this._stackLimit&&this._undoStack.shift(),this._undoStack.push(Object.assign({},t)),this._redoStack=[]}undo(){if(0===this._undoStack.length)return;this._redoStack.push(Object.assign({},this._currentConfig()));const t=this._undoStack.pop();this._apply(t),this._host.requestUpdate()}redo(){if(0===this._redoStack.length)return;this._undoStack.push(Object.assign({},this._currentConfig()));const t=this._redoStack.pop();this._apply(t),this._host.requestUpdate()}reset(){this._undoStack=[],this._redoStack=[]}constructor(t,i){this._undoStack=[],this._redoStack=[],this._stackLimit=75,this._apply=()=>{throw new Error("No apply function provided")},this._currentConfig=()=>{throw new Error("No currentConfig function provided")},this._onUndoChange=t=>{t.stopPropagation(),this.undo(),this._host.requestUpdate()},void 0!==i.stackLimit&&(this._stackLimit=i.stackLimit),this._apply=i.apply,this._currentConfig=i.currentConfig,this._host=t,t.addController(this)}}},82591:function(t,i,e){e.a(t,async function(t,a){try{e.d(i,{E2:function(){return u},Z8:function(){return g},a3:function(){return y},i:function(){return c},nR:function(){return l}});e(16280);var o=e(74487),s=e(22786),n=e(79791),r=t([o]);o=(r.then?(await r)():r)[0];const d=t=>t<10?`0${t}`:t,l=(t,i)=>{const e=i.days||0,a=i.hours||0,o=i.minutes||0,s=i.seconds||0,n=i.milliseconds||0;return e>0?`${Intl.NumberFormat(t.language,{style:"unit",unit:"day",unitDisplay:"long"}).format(e)} ${a}:${d(o)}:${d(s)}`:a>0?`${a}:${d(o)}:${d(s)}`:o>0?`${o}:${d(s)}`:s>0?Intl.NumberFormat(t.language,{style:"unit",unit:"second",unitDisplay:"long"}).format(s):n>0?Intl.NumberFormat(t.language,{style:"unit",unit:"millisecond",unitDisplay:"long"}).format(n):null},h=(0,s.A)(t=>new Intl.DurationFormat(t.language,{style:"long"})),c=(t,i)=>h(t).format(i),p=(0,s.A)(t=>new Intl.DurationFormat(t.language,{style:"digital",hoursDisplay:"auto"})),u=(t,i)=>p(t).format(i),g=["min","h","d"],v=(0,s.A)(t=>new Intl.DurationFormat(t.language,{style:"narrow",daysDisplay:"always"})),m=(0,s.A)(t=>new Intl.DurationFormat(t.language,{style:"narrow",hoursDisplay:"always"})),b=(0,s.A)(t=>new Intl.DurationFormat(t.language,{style:"narrow",minutesDisplay:"always"})),y=(t,i,e,a)=>{const o=void 0!==a?(0,n.L)(parseFloat(i),a):parseFloat(i);switch(e){case"d":{const i=Math.floor(o),e={days:i,hours:Math.floor(24*(o-i))};return v(t).format(e)}case"h":{const i=Math.floor(o),e={hours:i,minutes:Math.floor(60*(o-i))};return m(t).format(e)}case"min":{const i=Math.floor(o),e={minutes:i,seconds:Math.floor(60*(o-i))};return b(t).format(e)}default:throw new Error("Invalid duration unit")}};a()}catch(d){a(d)}})},79791:function(t,i,e){e.d(i,{L:function(){return a}});const a=(t,i=2)=>Math.round(t*10**i)/10**i},67258:function(t,i,e){e.d(i,{d:function(){return a}});const a=t=>{switch(t.language){case"cs":case"de":case"fi":case"fr":case"sk":case"sv":return" ";default:return""}}},8549:function(t,i,e){e.d(i,{A:function(){return o}});var a=e(67258);const o=(t,i)=>"°"===t?"":i&&"%"===t?(0,a.d)(i):" "},51758:function(t,i,e){e.d(i,{Z:function(){return a}});const a=t=>{const i=window.location.pathname;return t?i+"?"+t:i}},60734:function(t,i,e){e.a(t,async function(t,i){try{e(26910),e(18111),e(22489),e(61701),e(62953);var a=e(40445),o=e(5124),s=e(67576),n=e(22786),r=e(1087),d=e(52220),l=e(35891),h=e(606),c=t([h]);h=(c.then?(await c)():c)[0];let p,u,g=t=>t;class v extends o.WF{open(){this._select&&(this._select.menuOpen=!0)}render(){return this.hass?(0,o.qy)(p||(p=g` <ha-select .label="${0}" .value="${0}" .disabled="${0}" @selected="${0}" .options="${0}"> </ha-select> `),this.label||this.hass.localize("ui.components.blueprint-picker.select_blueprint"),this.value,this.disabled,this._blueprintChanged,this._processedBlueprints(this.blueprints).map(t=>({value:t.path,label:t.name}))):o.s6}firstUpdated(t){super.firstUpdated(t),void 0===this.blueprints&&(0,l.Xg)(this.hass,this.domain).then(t=>{this.blueprints=t})}_blueprintChanged(t){const i=t.detail.value;i!==this.value&&(this.value=i,setTimeout(()=>{(0,r.r)(this,"value-changed",{value:i}),(0,r.r)(this,"change")},0))}constructor(...t){super(...t),this.value="",this.domain="automation",this.disabled=!1,this._processedBlueprints=(0,n.A)(t=>{if(!t)return[];return Object.entries(t).filter(t=>!("error"in t[1])).map(([t,i])=>Object.assign(Object.assign({},i.metadata),{},{path:t})).sort((t,i)=>(0,d.xL)(t.name,i.name,this.hass.locale.language))})}}v.styles=(0,o.AH)(u||(u=g`:host{display:inline-block}ha-select{width:100%;min-width:200px;display:block}`)),(0,a.Cg)([(0,s.MZ)()],v.prototype,"label",void 0),(0,a.Cg)([(0,s.MZ)()],v.prototype,"value",void 0),(0,a.Cg)([(0,s.MZ)()],v.prototype,"domain",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],v.prototype,"blueprints",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],v.prototype,"disabled",void 0),(0,a.Cg)([(0,s.P)("ha-select")],v.prototype,"_select",void 0),v=(0,a.Cg)([(0,s.EM)("ha-blueprint-picker")],v),i()}catch(p){i(p)}})},645:function(t,i,e){e.a(t,async function(t,i){try{e(74423),e(44114),e(18111),e(7588),e(61701),e(3362),e(17642),e(58004),e(33853),e(45876),e(32475),e(15024),e(31698),e(62953);var a=e(40445),o=e(5124),s=e(67576),n=e(1087),r=e(19459),d=e(35891),l=e(71606),h=e(14503),c=(e(30716),e(11382),e(26300)),p=(e(8630),t([c]));c=(p.then?(await p)():p)[0];let u,g,v,m,b,y=t=>t;const f="M21 8H3V6H21V8M13.81 16H10V18H13.09C13.21 17.28 13.46 16.61 13.81 16M18 11H6V13H18V11M21.12 15.46L19 17.59L16.88 15.46L15.47 16.88L17.59 19L15.47 21.12L16.88 22.54L19 20.41L21.12 22.54L22.54 21.12L20.41 19L22.54 16.88L21.12 15.46Z";class w extends o.WF{willUpdate(t){super.willUpdate(t),t.has("value")&&!(0,r.b)(this.value,t.get("value"))&&this._findRelated()}render(){var t,i;return(0,o.qy)(u||(u=y` <ha-expansion-panel left-chevron .expanded="${0}" @expanded-will-change="${0}" @expanded-changed="${0}"> <div slot="header" class="header"> ${0} ${0} </div> ${0} </ha-expansion-panel> `),this.expanded,this._expandedWillChange,this._expandedChanged,this.hass.localize("ui.panel.config.blueprint.caption"),null!==(t=this.value)&&void 0!==t&&t.length?(0,o.qy)(g||(g=y`<div class="badge">${0}</div> <ha-icon-button .path="${0}" @click="${0}"></ha-icon-button>`),null===(i=this.value)||void 0===i?void 0:i.length,f,this._clearFilter):o.s6,this._blueprints&&this._shouldRender?(0,o.qy)(v||(v=y` <ha-list @selected="${0}" multi class="ha-scrollbar"> ${0} </ha-list> `),this._blueprintsSelected,Object.entries(this._blueprints).map(([t,i])=>"error"in i?o.s6:(0,o.qy)(m||(m=y`<ha-check-list-item .value="${0}" .selected="${0}"> ${0} </ha-check-list-item>`),t,(this.value||[]).includes(t),i.metadata.name||t))):o.s6)}async firstUpdated(){this.type&&(this._blueprints=await(0,d.Xg)(this.hass,this.type))}updated(t){t.has("expanded")&&this.expanded&&setTimeout(()=>{!this.narrow&&this.expanded&&(this._list.style.height=this.clientHeight-49+"px")},300)}_expandedWillChange(t){this._shouldRender=t.detail.expanded}_expandedChanged(t){this.expanded=t.detail.expanded}async _blueprintsSelected(t){const i=this._blueprints;if(!t.detail.index.size)return(0,n.r)(this,"data-table-filter-changed",{value:[],items:void 0}),void(this.value=[]);const e=[];for(const a of t.detail.index){const t=Object.keys(i)[a];e.push(t)}this.value=e}async _findRelated(){var t;if(null===(t=this.value)||void 0===t||!t.length)return this.value=[],void(0,n.r)(this,"data-table-filter-changed",{value:[],items:void 0});const i=[];for(const o of this.value)this.type&&i.push((0,l.f)(this.hass,`${this.type}_blueprint`,o));const e=await Promise.all(i),a=new Set;for(const o of e)o[this.type]&&o[this.type].forEach(t=>a.add(t));(0,n.r)(this,"data-table-filter-changed",{value:this.value,items:this.type?a:void 0})}_clearFilter(t){t.preventDefault(),this.value=void 0,(0,n.r)(this,"data-table-filter-changed",{value:void 0,items:void 0})}static get styles(){return[h.dp,(0,o.AH)(b||(b=y`:host{border-bottom:1px solid var(--divider-color)}:host([expanded]){flex:1;height:0}ha-expansion-panel{--ha-card-border-radius:var(--ha-border-radius-square);--expansion-panel-content-padding:0}.header{display:flex;align-items:center}.header ha-icon-button{margin-inline-start:auto;margin-inline-end:8px}.badge{display:inline-block;margin-left:8px;margin-inline-start:8px;margin-inline-end:0;min-width:16px;box-sizing:border-box;border-radius:var(--ha-border-radius-circle);font-size:var(--ha-font-size-xs);font-weight:var(--ha-font-weight-normal);background-color:var(--primary-color);line-height:var(--ha-line-height-normal);text-align:center;padding:0px 2px;color:var(--text-primary-color)}`))]}constructor(...t){super(...t),this.narrow=!1,this.expanded=!1,this._shouldRender=!1}}(0,a.Cg)([(0,s.MZ)({attribute:!1})],w.prototype,"hass",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],w.prototype,"value",void 0),(0,a.Cg)([(0,s.MZ)()],w.prototype,"type",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],w.prototype,"narrow",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],w.prototype,"expanded",void 0),(0,a.Cg)([(0,s.wk)()],w.prototype,"_shouldRender",void 0),(0,a.Cg)([(0,s.wk)()],w.prototype,"_blueprints",void 0),(0,a.Cg)([(0,s.P)("ha-list")],w.prototype,"_list",void 0),w=(0,a.Cg)([(0,s.EM)("ha-filter-blueprints")],w),i()}catch(u){i(u)}})},90771:function(t,i,e){e.a(t,async function(t,i){try{e(62953);var a=e(40445),o=e(5124),s=e(67576),n=e(1087),r=e(99611),d=t([r]);r=(d.then?(await d)():d)[0];let l,h,c=t=>t;class p extends o.WF{render(){return(0,o.qy)(l||(l=c`<dialog open @transitionend="${0}" style="${0}"> <div class="handle-wrapper"> <div @mousedown="${0}" @touchstart="${0}" class="handle"></div> </div> <slot></slot> </dialog>`),this._handleTransitionEnd,`\n --height: ${this._dialogViewportHeight}vh;\n --height: ${this._dialogViewportHeight}dvh;\n --max-height: ${this._dialogMaxViewpointHeight}vh;\n --max-height: ${this._dialogMaxViewpointHeight}dvh;\n --min-height: ${this._dialogMinViewpointHeight}vh;\n --min-height: ${this._dialogMinViewpointHeight}dvh;\n `,this._handleMouseDown,this._handleTouchStart)}firstUpdated(t){super.firstUpdated(t),this._openSheet()}_openSheet(){requestAnimationFrame(()=>{this._dialog.classList.add("show")})}closeSheet(){requestAnimationFrame(()=>{this._dialog.classList.remove("show")})}_handleTransitionEnd(){this._dialog.classList.contains("show")?(this._dialogViewportHeight=this._dialog.offsetHeight/window.innerHeight*100,this._dialogMaxViewpointHeight=90,this._dialogMinViewpointHeight=20):(this._dialog.close(),(0,n.r)(this,"bottom-sheet-closed"))}connectedCallback(){super.connectedCallback(),document.addEventListener("mousemove",this._handleMouseMove),document.addEventListener("mouseup",this._handleMouseUp),document.addEventListener("touchmove",this._handleTouchMove,{passive:!1}),document.addEventListener("touchend",this._handleTouchEnd),document.addEventListener("touchcancel",this._handleTouchEnd)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("mousemove",this._handleMouseMove),document.removeEventListener("mouseup",this._handleMouseUp),document.removeEventListener("touchmove",this._handleTouchMove),document.removeEventListener("touchend",this._handleTouchEnd),document.removeEventListener("touchcancel",this._handleTouchEnd)}_startDrag(t){this._dragging=!0,this._dragStartY=t,this._initialSize=this._dialog.offsetHeight/window.innerHeight*100,document.body.style.setProperty("cursor","grabbing")}_updateSize(t){const i=this._dragStartY-t,e=i/window.innerHeight*100;let a=this._initialSize+e;if(a=Math.max(10,Math.min(90,a)),a<20&&i<0)return this._endDrag(),void this.closeSheet();this._dialogViewportHeight=a}_endDrag(){this._dragging&&(this._dragging=!1,document.body.style.removeProperty("cursor"))}constructor(...t){super(...t),this._dragging=!1,this._dragStartY=0,this._initialSize=0,this._dialogMaxViewpointHeight=70,this._dialogMinViewpointHeight=55,this._handleMouseDown=t=>{this._startDrag(t.clientY)},this._handleTouchStart=t=>{t.preventDefault(),this._startDrag(t.touches[0].clientY)},this._handleMouseMove=t=>{this._dragging&&this._updateSize(t.clientY)},this._handleTouchMove=t=>{this._dragging&&(t.preventDefault(),this._updateSize(t.touches[0].clientY))},this._handleMouseUp=()=>{this._endDrag()},this._handleTouchEnd=()=>{this._endDrag()}}}p.styles=(0,o.AH)(h||(h=c`.handle-wrapper{position:absolute;top:0;width:100%;padding-bottom:2px;display:flex;justify-content:center;align-items:center;cursor:grab;touch-action:none}.handle-wrapper .handle{height:20px;width:200px;display:flex;justify-content:center;align-items:center;z-index:7;padding-bottom:76px}.handle-wrapper .handle::after{content:"";border-radius:var(--ha-border-radius-md);height:4px;background:var(--divider-color,#e0e0e0);width:80px}.handle-wrapper .handle:active::after{cursor:grabbing}dialog{height:var(--height,auto);max-height:min(var(--max-height,70vh),calc(100vh - var(--safe-area-inset-top)));max-height:min(var(--max-height,70dvh),calc(100dvh - var(--safe-area-inset-top)));min-height:var(--min-height,30vh);min-height:var(--min-height,30dvh);background-color:var(--ha-bottom-sheet-surface-background,var(--ha-color-surface-default));display:flex;flex-direction:column;top:0;inset-inline-start:0;position:fixed;width:calc(100% - 4px - var(--safe-area-inset-left) - var(--safe-area-inset-right));max-width:100%;border:none;box-shadow:var(--wa-shadow-l);padding:0;margin:0;top:auto;inset-inline-end:auto;bottom:0;inset-inline-start:0;box-shadow:0px -8px 16px rgba(0,0,0,.2);border-top-left-radius:var(--ha-bottom-sheet-border-radius,var(--ha-dialog-border-radius,var(--ha-border-radius-2xl)));border-top-right-radius:var(--ha-bottom-sheet-border-radius,var(--ha-dialog-border-radius,var(--ha-border-radius-2xl)));transform:translateY(100%);transition:transform ${0}ms ease;border-top-width:var(--ha-bottom-sheet-border-width);border-right-width:var(--ha-bottom-sheet-border-width);border-left-width:var(--ha-bottom-sheet-border-width);border-bottom-width:0;border-style:var(--ha-bottom-sheet-border-style);border-color:var(--ha-bottom-sheet-border-color);margin-left:var(--safe-area-inset-left);margin-right:var(--safe-area-inset-right)}dialog.show{transform:translateY(0)}`),300),(0,a.Cg)([(0,s.P)("dialog")],p.prototype,"_dialog",void 0),(0,a.Cg)([(0,s.wk)()],p.prototype,"_dialogMaxViewpointHeight",void 0),(0,a.Cg)([(0,s.wk)()],p.prototype,"_dialogMinViewpointHeight",void 0),(0,a.Cg)([(0,s.wk)()],p.prototype,"_dialogViewportHeight",void 0),p=(0,a.Cg)([(0,s.EM)("ha-resizable-bottom-sheet")],p),i()}catch(l){i(l)}})},65829:function(t,i,e){e.a(t,async function(t,a){try{e.r(i),e.d(i,{HaSpinner:function(){return c}});var o=e(40445),s=e(55262),n=e(5124),r=e(67576),d=t([s]);s=(d.then?(await d)():d)[0];let l,h=t=>t;class c extends s.A{updated(t){if(super.updated(t),t.has("size"))switch(this.size){case"tiny":this.style.setProperty("--ha-spinner-size","16px");break;case"small":this.style.setProperty("--ha-spinner-size","28px");break;case"medium":this.style.setProperty("--ha-spinner-size","48px");break;case"large":this.style.setProperty("--ha-spinner-size","68px");break;case void 0:this.style.removeProperty("--ha-progress-ring-size")}}static get styles(){return[s.A.styles,(0,n.AH)(l||(l=h`:host{--indicator-color:var(
--ha-spinner-indicator-color,
var(--primary-color)
);--track-color:var(--ha-spinner-divider-color, var(--divider-color));--track-width:4px;--speed:3.5s;font-size:var(--ha-spinner-size, 48px)}`))]}}(0,o.Cg)([(0,r.MZ)()],c.prototype,"size",void 0),c=(0,o.Cg)([(0,r.EM)("ha-spinner")],c),a()}catch(l){a(l)}})},35891:function(t,i,e){e.d(i,{Bs:function(){return n},Jp:function(){return o},Tk:function(){return s},Xg:function(){return a},oz:function(){return d},x1:function(){return r}});e(74423);const a=(t,i)=>t.callWS({type:"blueprint/list",domain:i}),o=(t,i)=>t.callWS({type:"blueprint/import",url:i}),s=(t,i,e,a,o,s)=>t.callWS({type:"blueprint/save",domain:i,path:e,yaml:a,source_url:o,allow_override:s}),n=(t,i,e)=>t.callWS({type:"blueprint/delete",domain:i,path:e}),r=t=>{const i=t.metadata.source_url;return i?i.includes("github.com/home-assistant")?"homeassistant":"community":"local"},d=(t,i,e,a)=>t.callWS({type:"blueprint/substitute",domain:i,path:e,input:a})},84383:function(t,i,e){e.d(i,{W:function(){return a}});const a=["condition","action"]},37325:function(t,i,e){e.d(i,{e:function(){return s}});e(3362),e(62953);var a=e(1087);const o=()=>e.e(86658).then(e.bind(e,30809)),s=(t,i)=>{(0,a.r)(t,"show-dialog",{dialogTag:"ha-dialog-automation-mode",dialogImport:o,dialogParams:i})}},64265:function(t,i,e){e.d(i,{_:function(){return s}});e(3362),e(62953);var a=e(1087);const o=()=>Promise.all([e.e(8275),e.e(66201),e.e(52808),e.e(31990)]).then(e.bind(e,45986)),s=(t,i)=>{(0,a.r)(t,"show-dialog",{dialogTag:"ha-dialog-automation-save",dialogImport:o,dialogParams:i})}},12318:function(t,i,e){e.a(t,async function(t,i){try{var a=e(40445),o=e(35211),s=e(5124),n=e(67576),r=e(1087),d=e(18350),l=(e(8034),e(22792)),h=t([d]);d=(h.then?(await h)():h)[0];let c,p,u=t=>t;class g extends s.WF{render(){return(0,s.qy)(c||(c=u` <ha-settings-row narrow> <div class="heading" slot="heading"> <span class="title" id="note-label"> ${0} </span> <ha-button @click="${0}" size="small" appearance="plain"> ${0} </ha-button> </div> <p aria-labelledby="note-label">${0}</p> </ha-settings-row> `),this._i18n.localize("ui.panel.config.automation.editor.note.label"),this._handleClick,this._i18n.localize("ui.common.edit"),this.note)}_handleClick(){(0,r.r)(this,"edit-note")}}g.styles=(0,s.AH)(p||(p=u`ha-settings-row{margin-inline:calc(-1 * var(--ha-space-4))}ha-settings-row::part(heading){padding-inline-end:0;overflow:visible}.heading{display:flex;justify-content:space-between;align-items:center}p{margin:var(--ha-space-2) 0 0;border:var(--ha-border-width-sm) solid var(--ha-color-border-neutral-quiet);padding:var(--ha-space-1) var(--ha-space-3);border-radius:var(--ha-border-radius-lg);background-color:var(--ha-color-fill-neutral-quiet-resting);white-space:pre-wrap}ha-button{margin-inline-end:calc(-1 * var(--ha-space-3))}`)),(0,a.Cg)([(0,n.MZ)()],g.prototype,"note",void 0),(0,a.Cg)([(0,n.wk)(),(0,o.Fg)({context:l.D5,subscribe:!0})],g.prototype,"_i18n",void 0),g=(0,a.Cg)([(0,n.EM)("ha-automation-note")],g),i()}catch(c){i(c)}})},70043:function(t,i,e){e.a(t,async function(t,a){try{e.d(i,{j:function(){return _},m:function(){return $}});e(18111),e(20116),e(3362),e(62953);var o=e(40445),s=e(35211),n=e(5124),r=e(67576),d=e(32172),l=e(91926),h=e(12587),c=(e(3109),e(65829)),p=e(22792),u=e(65063),g=e(42269),v=t([c]);c=(v.then?(await v)():v)[0];let m,b,y,f,w=t=>t;const $=(0,n.AH)(m||(m=w`:host{--ha-automation-editor-max-width:var(--ha-automation-editor-width, 1540px)}ha-fade-in{display:flex;justify-content:center;align-items:center;height:100%}.yaml-mode{height:100%;display:flex;flex-direction:column;padding-bottom:0}ha-yaml-editor{flex-grow:1;--actions-border-radius:var(--ha-border-radius-square);--code-mirror-height:100%;min-height:0;display:flex;flex-direction:column}p{margin-bottom:0}ha-button[slot=fab]{position:fixed;right:calc(16px + var(--safe-area-inset-right,0px));bottom:calc(-80px - var(--safe-area-inset-bottom));transition:bottom .3s;--ha-button-box-shadow:var(--ha-box-shadow-l)}ha-button[slot=fab].dirty{bottom:calc(16px + var(--safe-area-inset-bottom,0px))}ha-tooltip ha-svg-icon{width:12px}ha-tooltip .shortcut{display:inline-flex;flex-direction:row;align-items:center;gap:2px}`)),_=t=>{class i extends t{renderLoading(){return(0,n.qy)(b||(b=w` <ha-fade-in .delay="${0}"> <ha-spinner size="large"></ha-spinner> </ha-fade-in> `),500)}showSettings(){(0,g.p)(this,{entityId:this.currentEntityId,view:"settings"})}async switchUiMode(){if(this.yamlErrors){if(!(await(0,u.dk)(this,{text:(0,n.qy)(y||(y=w`${0}<br><br>${0}`),this.hass.localize("ui.panel.config.automation.editor.switch_ui_yaml_error"),this.yamlErrors),confirmText:this.hass.localize("ui.common.continue"),destructive:!0,dismissText:this.hass.localize("ui.common.cancel")})))return}this.yamlErrors=void 0,this.mode="gui"}switchYamlMode(){this.mode="yaml"}takeControlSave(){this.readOnly=!1,this.dirty=!0,this.blueprintConfig=void 0}revertBlueprint(){var t;(this.config=this.blueprintConfig,"yaml"===this.mode)&&(null===(t=this.renderRoot.querySelector("ha-yaml-editor"))||void 0===t||t.setValue(this.config));this.blueprintConfig=void 0,this.readOnly=!1}get isDirty(){return this.dirty}async promptDiscardChanges(){return this.confirmUnsavedChanged()}confirmUnsavedChanged(){return Promise.resolve(!0)}async loadConfig(t){const i=this.domainHooks,e=i.domain;try{const e=await i.fetchFileConfig(this.hass,t);this.dirty=!1,this.readOnly=!1,this.config=i.normalizeConfig(e),i.checkValidation()}catch(r){var a;if(404!==r.status_code){var o,s;const t=(null===(o=r.body)||void 0===o?void 0:o.message)||r.body||r.error||"Unknown error";return await(0,u.showAlertDialog)(this,{title:this.hass.localize(`ui.panel.config.${e}.editor.load_error_unknown`,{err_no:null!==(s=r.status_code)&&void 0!==s?s:"unknown"}),text:(0,n.qy)(f||(f=w`<pre>${0}</pre>`),t)}),void(0,l.OE)("/config")}const i=null===(a=this.entityRegistry)||void 0===a?void 0:a.find(i=>i.platform===e&&i.unique_id===t);if(i)return void(0,l.oo)(`/config/${e}/show/${i.entity_id}`,{replace:!0});await(0,u.showAlertDialog)(this,{text:this.hass.localize(`ui.panel.config.${e}.editor.load_error_not_editable`)}),(0,l.OE)("/config")}}constructor(...t){super(...t),this.isWide=!1,this.narrow=!1,this.entityId=null,this.dirty=!1,this.mode="gui",this.readOnly=!1,this.saving=!1,this.backTapped=async()=>{await this.confirmUnsavedChanged()&&(0,h.m)(()=>(0,l.OE)("/config"))}}}return(0,o.Cg)([(0,r.MZ)({attribute:!1})],i.prototype,"hass",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"is-wide",type:Boolean})],i.prototype,"isWide",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],i.prototype,"narrow",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],i.prototype,"route",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],i.prototype,"entityId",void 0),(0,o.Cg)([(0,r.wk)(),(0,s.Fg)({context:p.ih,subscribe:!0})],i.prototype,"entityRegistry",void 0),(0,o.Cg)([(0,r.wk)()],i.prototype,"dirty",void 0),(0,o.Cg)([(0,r.wk)()],i.prototype,"errors",void 0),(0,o.Cg)([(0,r.wk)()],i.prototype,"yamlErrors",void 0),(0,o.Cg)([(0,r.wk)()],i.prototype,"currentEntityId",void 0),(0,o.Cg)([(0,r.wk)()],i.prototype,"mode",void 0),(0,o.Cg)([(0,r.wk)()],i.prototype,"readOnly",void 0),(0,o.Cg)([(0,r.wk)()],i.prototype,"saving",void 0),(0,o.Cg)([(0,r.wk)()],i.prototype,"validationErrors",void 0),(0,o.Cg)([(0,r.wk)()],i.prototype,"config",void 0),(0,o.Cg)([(0,r.wk)()],i.prototype,"blueprintConfig",void 0),(0,o.Cg)([(0,r.wk)(),(0,s.Fg)({context:p.ih,subscribe:!0}),(0,d.p)({transformer:function(t){return null==t?void 0:t.find(({entity_id:t})=>t===this.currentEntityId)},watch:["currentEntityId"]})],i.prototype,"registryEntry",void 0),i};a()}catch(m){a(m)}})},89552:function(t,i,e){e.a(t,async function(t,i){try{e(62953);var a=e(40445),o=e(35211),s=e(5124),n=e(67576),r=e(91335),d=e(1087),l=e(15638),h=e(90771),c=e(88249),p=e(22792),u=e(3496),g=e(70178),v=e(82755),m=e(84713),b=e(61970),y=e(71518),f=e(44214),w=t([h,g,v,m,b,y,f]);[h,g,v,m,b,y,f]=w.then?(await w)():w;let $,_,C,M,A,H,V,k,x,L=t=>t;class z extends s.WF{updated(t){var i;(super.updated(t),t.has("config")||t.has("narrow"))&&(this.config&&!this.narrow||(null===(i=this._tinykeysUnsub)||void 0===i||i.call(this),this._tinykeysUnsub=void 0))}disconnectedCallback(){var t;super.disconnectedCallback(),this._unregisterResizeHandlers(),null===(t=this._tinykeysUnsub)||void 0===t||t.call(this)}_renderContent(){const t=this._getType();return"trigger"===t?(0,s.qy)($||($=L` <ha-automation-sidebar-trigger class="sidebar-content" .hass="${0}" .config="${0}" .isWide="${0}" .narrow="${0}" .disabled="${0}" .yamlMode="${0}" .sidebarKey="${0}" @toggle-yaml-mode="${0}" @close-sidebar="${0}"></ha-automation-sidebar-trigger> `),this.hass,this.config,this.isWide,this.narrow,this.disabled,this._yamlMode,this.sidebarKey,this._toggleYamlMode,this.triggerCloseSidebar):"condition"===t?(0,s.qy)(_||(_=L` <ha-automation-sidebar-condition class="sidebar-content" .hass="${0}" .config="${0}" .isWide="${0}" .narrow="${0}" .disabled="${0}" .yamlMode="${0}" .sidebarKey="${0}" @toggle-yaml-mode="${0}" @close-sidebar="${0}"></ha-automation-sidebar-condition> `),this.hass,this.config,this.isWide,this.narrow,this.disabled,this._yamlMode,this.sidebarKey,this._toggleYamlMode,this.triggerCloseSidebar):"action"===t?(0,s.qy)(C||(C=L` <ha-automation-sidebar-action class="sidebar-content" .hass="${0}" .config="${0}" .manifests="${0}" .isWide="${0}" .narrow="${0}" .disabled="${0}" .yamlMode="${0}" .sidebarKey="${0}" @toggle-yaml-mode="${0}" @close-sidebar="${0}"></ha-automation-sidebar-action> `),this.hass,this.config,this._manifests,this.isWide,this.narrow,this.disabled,this._yamlMode,this.sidebarKey,this._toggleYamlMode,this.triggerCloseSidebar):"option"===t?(0,s.qy)(M||(M=L` <ha-automation-sidebar-option class="sidebar-content" .hass="${0}" .config="${0}" .isWide="${0}" .narrow="${0}" .disabled="${0}" @close-sidebar="${0}"></ha-automation-sidebar-option> `),this.hass,this.config,this.isWide,this.narrow,this.disabled,this.triggerCloseSidebar):"script-field-selector"===t?(0,s.qy)(A||(A=L` <ha-automation-sidebar-script-field-selector class="sidebar-content" .hass="${0}" .config="${0}" .isWide="${0}" .narrow="${0}" .disabled="${0}" .yamlMode="${0}" .sidebarKey="${0}" @toggle-yaml-mode="${0}" @close-sidebar="${0}"></ha-automation-sidebar-script-field-selector> `),this.hass,this.config,this.isWide,this.narrow,this.disabled,this._yamlMode,this.sidebarKey,this._toggleYamlMode,this.triggerCloseSidebar):"script-field"===t?(0,s.qy)(H||(H=L` <ha-automation-sidebar-script-field class="sidebar-content" .hass="${0}" .config="${0}" .isWide="${0}" .narrow="${0}" .disabled="${0}" .yamlMode="${0}" .sidebarKey="${0}" @toggle-yaml-mode="${0}" @close-sidebar="${0}"></ha-automation-sidebar-script-field> `),this.hass,this.config,this.isWide,this.narrow,this.disabled,this._yamlMode,this.sidebarKey,this._toggleYamlMode,this.triggerCloseSidebar):s.s6}render(){return this.config?this.narrow?(0,s.qy)(V||(V=L` <ha-resizable-bottom-sheet @bottom-sheet-closed="${0}"> ${0} </ha-resizable-bottom-sheet> `),this._closeSidebar,this._renderContent()):(0,s.qy)(k||(k=L` <div class="handle ${0}" @mousedown="${0}" @touchstart="${0}" @dblclick="${0}" @focus="${0}" @blur="${0}" tabindex="0"> <div class="indicator ${0}"></div> </div> ${0} `),this._resizing?"resizing":"",this._handleMouseDown,this._handleMouseDown,this._handleDoubleClick,this._startKeyboardResizing,this._stopKeyboardResizing,this._resizing?"":"hidden",this._renderContent()):s.s6}_getType(){var t,i,e,a,o,s,n,r,d;return null!==(t=this.config)&&void 0!==t&&t.config&&((0,c.fo)(null===(i=this.config)||void 0===i?void 0:i.config)||(0,u.H4)(null===(e=this.config)||void 0===e?void 0:e.config))?"trigger":(0,c.G3)(null===(a=this.config)||void 0===a?void 0:a.config)?"condition":null!==(o=this.config)&&void 0!==o&&o.config&&(0,c.KH)(null===(s=this.config)||void 0===s?void 0:s.config)?null!==(d=this.config)&&void 0!==d&&d.config.selector?"script-field-selector":"script-field":!this.config||null!==(n=this.config)&&void 0!==n&&n.config?null!==(r=this.config)&&void 0!==r&&r.config.action?"action":void 0:"option"}triggerCloseSidebar(t){var i;(null==t||t.stopPropagation(),this.narrow)?null===(i=this._bottomSheetElement)||void 0===i||i.closeSheet():this._closeSidebar()}_closeSidebar(){var t;null===(t=this.config)||void 0===t||t.close(!0)}_startResizing(t){document.addEventListener("mousemove",this._handleMouseMove),document.addEventListener("mouseup",this._endResizing),document.addEventListener("touchmove",this._handleMouseMove,{passive:!1}),document.addEventListener("touchend",this._endResizing),document.addEventListener("touchcancel",this._endResizing),this._resizing=!0,this._resizeStartX=t}_updateSize(t){let i=this._resizeStartX-t;(0,l.qC)(this.hass.language,this.hass.translationMetadata.translations)&&(i=-i),requestAnimationFrame(()=>{(0,d.r)(this,"sidebar-resized",{deltaInPx:i})})}_unregisterResizeHandlers(){document.removeEventListener("mousemove",this._handleMouseMove),document.removeEventListener("mouseup",this._endResizing),document.removeEventListener("touchmove",this._handleMouseMove),document.removeEventListener("touchend",this._endResizing),document.removeEventListener("touchcancel",this._endResizing)}_keyboardResize(){(0,d.r)(this,"sidebar-resized",{deltaInPx:this._resizeStartX})}constructor(...t){super(...t),this.isWide=!1,this.disabled=!1,this.narrow=!1,this._yamlMode=!1,this._resizing=!1,this._resizeStartX=0,this._toggleYamlMode=()=>{var t;null===(t=this.config)||void 0===t||t.toggleYamlMode()},this._handleMouseDown=t=>{var i;t.preventDefault(),this._startResizing(null!==(i=t.touches)&&void 0!==i&&i.length?t.touches[0].clientX:t.clientX)},this._handleDoubleClick=t=>{var i;t.preventDefault(),t.stopPropagation(),this._unregisterResizeHandlers(),null===(i=this._tinykeysUnsub)||void 0===i||i.call(this),this._tinykeysUnsub=void 0,this._resizing=!1,document.body.style.removeProperty("cursor"),(0,d.r)(this,"sidebar-reset-size")},this._handleMouseMove=t=>{var i;this._updateSize(null!==(i=t.touches)&&void 0!==i&&i.length?t.touches[0].clientX:t.clientX)},this._endResizing=()=>{this._unregisterResizeHandlers(),this._resizing=!1,document.body.style.removeProperty("cursor"),(0,d.r)(this,"sidebar-resizing-stopped")},this._startKeyboardResizing=t=>{t.stopPropagation(),this._resizing=!0,this._resizeStartX=0,this._tinykeysUnsub=(0,r.Tc)(this._handleElement,{ArrowLeft:this._increaseSize,ArrowRight:this._decreaseSize})},this._stopKeyboardResizing=t=>{var i;t.stopPropagation(),this._resizing=!1,(0,d.r)(this,"sidebar-resizing-stopped"),null===(i=this._tinykeysUnsub)||void 0===i||i.call(this),this._tinykeysUnsub=void 0},this._increaseSize=t=>{t.stopPropagation(),this._resizeStartX-=(0,l.qC)(this.hass.language,this.hass.translationMetadata.translations)?10:-10,this._keyboardResize()},this._decreaseSize=t=>{t.stopPropagation(),this._resizeStartX+=(0,l.qC)(this.hass.language,this.hass.translationMetadata.translations)?10:-10,this._keyboardResize()}}}z.styles=(0,s.AH)(x||(x=L`:host{z-index:6;outline:0;height:calc(100% - var(--safe-area-inset-top,0px));--ha-card-border-radius:var(
--ha-dialog-border-radius,
var(--ha-border-radius-2xl)
);border-radius:var(--ha-card-border-radius);--ha-bottom-sheet-border-width:2px;--ha-bottom-sheet-border-style:solid;--ha-bottom-sheet-border-color:var(--primary-color);margin-top:var(--safe-area-inset-top);--ha-bottom-sheet-surface-background:var(--card-background-color)}@media all and (max-width:870px){.sidebar-content{max-height:100%}}.handle{position:absolute;margin-inline-start:-11px;height:calc(100% - (2 * var(--ha-card-border-radius)));width:24px;z-index:7;cursor:ew-resize;display:flex;align-items:center;justify-content:center;padding:var(--ha-card-border-radius) var(--ha-border-radius-square)}.handle.resizing{cursor:grabbing}.handle .indicator{background-color:var(--primary-color);height:100%;width:4px;border-radius:var(--ha-border-radius-pill);transform:scale3d(1,1,1);opacity:1;transition:transform 180ms ease-in-out,opacity 180ms ease-in-out}.handle .indicator.hidden{transform:scale3d(0,1,1);opacity:0}.handle:focus-visible{outline:0}`)),(0,a.Cg)([(0,n.MZ)({attribute:!1})],z.prototype,"hass",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],z.prototype,"config",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,attribute:"wide"})],z.prototype,"isWide",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],z.prototype,"disabled",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],z.prototype,"narrow",void 0),(0,a.Cg)([(0,n.MZ)({type:Number,attribute:"sidebar-key"})],z.prototype,"sidebarKey",void 0),(0,a.Cg)([(0,n.wk)()],z.prototype,"_yamlMode",void 0),(0,a.Cg)([(0,n.wk)()],z.prototype,"_resizing",void 0),(0,a.Cg)([(0,n.wk)(),(0,o.Fg)({context:p.uW,subscribe:!0})],z.prototype,"_manifests",void 0),(0,a.Cg)([(0,n.P)("ha-resizable-bottom-sheet")],z.prototype,"_bottomSheetElement",void 0),(0,a.Cg)([(0,n.P)(".handle")],z.prototype,"_handleElement",void 0),z=(0,a.Cg)([(0,n.EM)("ha-automation-sidebar")],z),i()}catch($){i($)}})},136:function(t,i,e){e.a(t,async function(t,a){try{e.d(i,{N:function(){return $}});e(16280),e(18111),e(7588),e(3362),e(62953);var o=e(40445),s=e(5124),n=e(67576),r=e(6412),d=e(93905),l=e(1087),h=e(51758),c=e(6030),p=e(18350),u=e(26300),g=(e(3587),e(81619)),v=e(89552),m=t([p,u,v]);[p,u,v]=m.then?(await m)():m;let b,y=t=>t;const f="M15,9H5V5H15M12,19A3,3 0 0,1 9,16A3,3 0 0,1 12,13A3,3 0 0,1 15,16A3,3 0 0,1 12,19M17,3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V7L17,3Z",w=500,$=t=>{class i extends t{connectedCallback(){super.connectedCallback(),window.addEventListener("paste",this.handlePaste)}disconnectedCallback(){window.removeEventListener("paste",this.handlePaste),super.disconnectedCallback()}renderContent(){throw new Error("Not implemented")}saveConfig(){throw new Error("Not implemented")}render(){return(0,s.qy)(b||(b=y` <div class="${0}"> <div class="content-wrapper"> <div class="content ${0}"> <slot name="alerts"></slot> ${0} </div> <div class="fab-positioner"> <ha-button slot="fab" size="large" class="${0}" .disabled="${0}" @click="${0}"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> ${0} </ha-button> </div> </div> <div class="sidebar-positioner"> <ha-automation-sidebar tabindex="-1" class="${0}" .isWide="${0}" .hass="${0}" .narrow="${0}" .config="${0}" .disabled="${0}" .sidebarKey="${0}" @value-changed="${0}" @sidebar-resized="${0}" @sidebar-resizing-stopped="${0}" @sidebar-reset-size="${0}"></ha-automation-sidebar> </div> </div> `),(0,r.H)({"has-sidebar":this.sidebarConfig&&!this.narrow}),this.sidebarConfig&&this.narrow?"has-bottom-sheet":"",this.renderContent(),this.dirty?"dirty":"",this.saving,this.saveConfig,f,this.hass.localize("ui.common.save"),(0,r.H)({hidden:!this.sidebarConfig}),this.isWide,this.hass,this.narrow,this.sidebarConfig,this.disabled,this.sidebarKey,this.sidebarConfigChanged,this.resizeSidebar,this.stopResizeSidebar,this.resetSidebarWidth)}firstUpdated(t){super.firstUpdated(t),this.style.setProperty("--sidebar-dynamic-width",`${this.sidebarWidthPx}px`);"1"===(0,c.p9)("expanded")&&(this.clearParam("expanded"),this.expandAll())}clearParam(t){window.history.replaceState(null,"",(0,h.Z)((0,c.s8)(t)))}async openSidebar(t){var i,e,a,o;null===(i=this.sidebarConfig)||void 0===i||null===(e=i.close)||void 0===e||e.call(i),this.sidebarConfig=t.detail,this.sidebarKey++,await(null===(a=this.sidebarElement)||void 0===a?void 0:a.updateComplete),null===(o=this.sidebarElement)||void 0===o||o.focus()}sidebarConfigChanged(t){t.stopPropagation(),this.sidebarConfig&&(this.sidebarConfig=Object.assign(Object.assign({},this.sidebarConfig),t.detail.value))}triggerCloseSidebar(){if(this.sidebarConfig){var t;if(this.sidebarElement)return void this.sidebarElement.triggerCloseSidebar();null===(t=this.sidebarConfig)||void 0===t||t.close(),this.sidebarKey=0}}handleCloseSidebar(){this.sidebarConfig=void 0}replaceExistingConfig(t){this.pastedConfig=t,this.showPastedToastWithUndo(),(0,l.r)(this,"value-changed",{value:Object.assign({},t)})}showPastedToastWithUndo(){}resetPastedConfig(){this.pastedConfig=void 0,(0,g.P)(this,{message:"",duration:0})}expandAll(){var t;null===(t=this.collapsableElements)||void 0===t||t.forEach(t=>{t.expandAll()})}collapseAll(){var t;null===(t=this.collapsableElements)||void 0===t||t.forEach(t=>{t.collapseAll()})}tryInsertAfterSelected(t){return!(!this.sidebarConfig||!("insertAfter"in this.sidebarConfig))&&this.sidebarConfig.insertAfter(t)}copySelectedRow(){this.sidebarConfig&&"copy"in this.sidebarConfig&&this.sidebarConfig.copy()}cutSelectedRow(){this.sidebarConfig&&"cut"in this.sidebarConfig&&this.sidebarConfig.cut()}deleteSelectedRow(){this.sidebarConfig&&"delete"in this.sidebarConfig&&this.sidebarConfig.delete()}resizeSidebar(t){t.stopPropagation();const i=t.detail.deltaInPx;var e;this._prevSidebarWidthPx||(this._prevSidebarWidthPx=(null===(e=this.sidebarElement)||void 0===e?void 0:e.clientWidth)||w);const a=i+this._prevSidebarWidthPx;this.sidebarWidthPx=a,this.style.setProperty("--sidebar-dynamic-width",`${this.sidebarWidthPx}px`)}stopResizeSidebar(t){t.stopPropagation(),this._prevSidebarWidthPx=void 0}resetSidebarWidth(t){t.stopPropagation(),this._prevSidebarWidthPx=void 0,this.sidebarWidthPx=w,this.style.setProperty("--sidebar-dynamic-width",`${this.sidebarWidthPx}px`)}constructor(...t){super(...t),this.isWide=!1,this.narrow=!1,this.disabled=!1,this.saving=!1,this.dirty=!1,this.sidebarKey=0,this.sidebarWidthPx=w,this.handlePaste=async t=>{throw new Error("Not implemented")}}}return(0,o.Cg)([(0,n.MZ)({attribute:!1})],i.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"is-wide",type:Boolean})],i.prototype,"isWide",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],i.prototype,"narrow",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],i.prototype,"disabled",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],i.prototype,"saving",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],i.prototype,"config",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],i.prototype,"dirty",void 0),(0,o.Cg)([(0,n.wk)()],i.prototype,"pastedConfig",void 0),(0,o.Cg)([(0,n.wk)()],i.prototype,"sidebarConfig",void 0),(0,o.Cg)([(0,n.wk)()],i.prototype,"sidebarKey",void 0),(0,o.Cg)([(0,d.I)({key:"automation-sidebar-width",state:!1,subscribe:!1})],i.prototype,"sidebarWidthPx",void 0),(0,o.Cg)([(0,n.P)("ha-automation-sidebar")],i.prototype,"sidebarElement",void 0),i};a()}catch(b){a(b)}})},84047:function(t,i,e){e.d(i,{Z:function(){return s}});e(3362),e(62953);var a=e(1087);const o=()=>e.e(50462).then(e.bind(e,47981)),s=(t,i)=>{(0,a.r)(t,"show-dialog",{dialogTag:"ha-dialog-paste-replace",dialogImport:o,dialogParams:i})}},14839:function(t,i,e){e.d(i,{l:function(){return s}});e(3362),e(62953);var a=e(1087);const o=()=>e.e(58938).then(e.bind(e,59502)),s=(t,i)=>{(0,a.r)(t,"show-dialog",{dialogTag:"ha-dialog-new-automation",dialogImport:o,dialogParams:i})}},70178:function(t,i,e){e.a(t,async function(t,i){try{e(74423),e(42762),e(62953);var a=e(40445),o=(e(68825),e(5124)),s=e(67576),n=e(19771),r=(e(46190),e(1087)),d=e(78978),l=(e(70947),e(30780)),h=e(95350),c=e(41570),p=e(60232),u=e(49063),g=e(12318),v=e(57116),m=e(86818),b=t([g,m,p,u]);[g,m,p,u]=b.then?(await b)():b;let y,f,w,$,_,C,M,A,H,V,k,x,L,z,S,Z=t=>t;const q="M6,2A4,4 0 0,1 10,6V8H14V6A4,4 0 0,1 18,2A4,4 0 0,1 22,6A4,4 0 0,1 18,10H16V14H18A4,4 0 0,1 22,18A4,4 0 0,1 18,22A4,4 0 0,1 14,18V16H10V18A4,4 0 0,1 6,22A4,4 0 0,1 2,18A4,4 0 0,1 6,14H8V10H6A4,4 0 0,1 2,6A4,4 0 0,1 6,2M16,18A2,2 0 0,0 18,20A2,2 0 0,0 20,18A2,2 0 0,0 18,16H16V18M14,10H10V14H14V10M6,16A2,2 0 0,0 4,18A2,2 0 0,0 6,20A2,2 0 0,0 8,18V16H6M8,6A2,2 0 0,0 6,4A2,2 0 0,0 4,6A2,2 0 0,0 6,8H8V6M18,8A2,2 0 0,0 20,6A2,2 0 0,0 18,4A2,2 0 0,0 16,6V8H18Z",E="M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z",W="M19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3M19,5V19H5V5H19M10,17L6,13L7.41,11.58L10,14.17L16.59,7.58L18,9",P="M9 22C8.45 22 8 21.55 8 21V18H4C2.9 18 2 17.11 2 16V4C2 2.89 2.9 2 4 2H20C21.11 2 22 2.9 22 4V16C22 17.11 21.11 18 20 18H13.9L10.2 21.71C10 21.9 9.75 22 9.5 22H9M10 16V19.08L13.08 16H20V4H4V16H10M15.84 8.2L14.83 9.21L12.76 7.18L13.77 6.16C13.97 5.95 14.31 5.94 14.55 6.16L15.84 7.41C16.05 7.62 16.06 7.96 15.84 8.2M8 11.91L12.17 7.72L14.24 9.8L10.08 14H8V11.91Z",O="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z",j="M19,3L13,9L15,11L22,4V3M12,12.5A0.5,0.5 0 0,1 11.5,12A0.5,0.5 0 0,1 12,11.5A0.5,0.5 0 0,1 12.5,12A0.5,0.5 0 0,1 12,12.5M6,20A2,2 0 0,1 4,18C4,16.89 4.9,16 6,16A2,2 0 0,1 8,18C8,19.11 7.1,20 6,20M6,8A2,2 0 0,1 4,6C4,4.89 4.9,4 6,4A2,2 0 0,1 8,6C8,7.11 7.1,8 6,8M9.64,7.64C9.87,7.14 10,6.59 10,6A4,4 0 0,0 6,2A4,4 0 0,0 2,6A4,4 0 0,0 6,10C6.59,10 7.14,9.87 7.64,9.64L10,12L7.64,14.36C7.14,14.13 6.59,14 6,14A4,4 0 0,0 2,18A4,4 0 0,0 6,22A4,4 0 0,0 10,18C10,17.41 9.87,16.86 9.64,16.36L12,14L19,21H22V20L9.64,7.64Z",D="M19,20H5V4H7V7H17V4H19M12,2A1,1 0 0,1 13,3A1,1 0 0,1 12,4A1,1 0 0,1 11,3A1,1 0 0,1 12,2M19,2H14.82C14.4,0.84 13.3,0 12,0C10.7,0 9.6,0.84 9.18,2H5A2,2 0 0,0 3,4V20A2,2 0 0,0 5,22H19A2,2 0 0,0 21,20V4A2,2 0 0,0 19,2Z",K="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",B="M8,5.14V19.14L19,12.14L8,5.14Z",R="M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M10,16.5L16,12L10,7.5V16.5Z",U="M3 6V8H14V6H3M3 10V12H14V10H3M20 10.1C19.9 10.1 19.7 10.2 19.6 10.3L18.6 11.3L20.7 13.4L21.7 12.4C21.9 12.2 21.9 11.8 21.7 11.6L20.4 10.3C20.3 10.2 20.2 10.1 20 10.1M18.1 11.9L12 17.9V20H14.1L20.2 13.9L18.1 11.9M3 14V16H10V14H3Z",I="M16,8H14V11H11V13H14V16H16V13H19V11H16M2,12C2,9.21 3.64,6.8 6,5.68V3.5C2.5,4.76 0,8.09 0,12C0,15.91 2.5,19.24 6,20.5V18.32C3.64,17.2 2,14.79 2,12M15,3C10.04,3 6,7.04 6,12C6,16.96 10.04,21 15,21C19.96,21 24,16.96 24,12C24,7.04 19.96,3 15,3M15,19C11.14,19 8,15.86 8,12C8,8.14 11.14,5 15,5C18.86,5 22,8.14 22,12C22,15.86 18.86,19 15,19Z",F="M18,17H10.5L12.5,15H18M6,17V14.5L13.88,6.65C14.07,6.45 14.39,6.45 14.59,6.65L16.35,8.41C16.55,8.61 16.55,8.92 16.35,9.12L8.47,17M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z",Y="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4M9,9V15H15V9";class N extends o.WF{willUpdate(t){var i;t.has("config")&&(this._warnings=void 0,this.config&&(this.yamlMode=this.config.yamlMode,this.yamlMode&&(null===(i=this.editor)||void 0===i||null===(i=i.yamlEditor)||void 0===i||i.setValue(this.config.config.action))))}render(){var t;const i=this.config.config.action,e="enabled"in i&&!1===i.enabled,a=(0,p.MS)(i),s="repeat"!==a?a:`repeat_${(0,u.m)(i.repeat)}`,r=l.L_.includes(s||""),d=this.hass.localize("ui.panel.config.automation.editor.actions.action");let g=this.hass.localize(`ui.panel.config.automation.editor.actions.type.${s}.label`)||s;if("service"===s&&i.action){var v,m,b;const[t,e]=i.action.split(".",2),a=this.hass.localize(`component.${t}.services.${e}.name`,null===(v=this.hass.services[t])||void 0===v||null===(v=v[e])||void 0===v?void 0:v.description_placeholders)||(null===(m=this.hass.services[t])||void 0===m||null===(m=m[e])||void 0===m?void 0:m.name)||g,o=null===(b=this.manifests)||void 0===b?void 0:b[t];g=!this.manifests||!o||"entity"!==o.integration_type||!o.is_built_in?`${(0,h.p$)(this.hass.localize,t)}: ${a}`:a}const N=r?this.hass.localize(`ui.panel.config.automation.editor.actions.type.${s}.description.picker`):"";return(0,o.qy)(y||(y=Z`<ha-automation-sidebar-card .hass="${0}" .isWide="${0}" .yamlMode="${0}" .warnings="${0}" .narrow="${0}" @wa-select="${0}"> <span slot="title">${0}</span> <span slot="subtitle">${0}${0}${0}</span> <ha-dropdown-item slot="menu-items" value="run"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} <span class="shortcut-placeholder ${0}"></span> </div> </ha-dropdown-item> <ha-dropdown-item slot="menu-items" value="rename" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} <span class="shortcut-placeholder ${0}"></span> </div> </ha-dropdown-item> <ha-dropdown-item slot="menu-items" value="edit_note"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} <span class="shortcut-placeholder ${0}"></span> </div> </ha-dropdown-item> <wa-divider slot="menu-items"></wa-divider> <ha-dropdown-item slot="menu-items" value="duplicate" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} <span class="shortcut-placeholder ${0}"></span> </div> </ha-dropdown-item> <ha-dropdown-item slot="menu-items" value="copy"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} ${0} </div> </ha-dropdown-item> <ha-dropdown-item slot="menu-items" value="cut" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} ${0} </div> </ha-dropdown-item> ${0} <ha-dropdown-item slot="menu-items" value="toggle_yaml_mode" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} <span class="shortcut-placeholder ${0}"></span> </div> </ha-dropdown-item> <wa-divider slot="menu-items"></wa-divider> <ha-dropdown-item slot="menu-items" value="disable" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} <span class="shortcut-placeholder ${0}"></span> </div> </ha-dropdown-item> ${0} <ha-dropdown-item slot="menu-items" value="delete" variant="danger" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} ${0} </div> </ha-dropdown-item> ${0} ${0} </ha-automation-sidebar-card>`),this.hass,this.isWide,this.yamlMode,this._warnings,this.narrow,this._handleDropdownSelect,g,d,e?(0,o.qy)(f||(f=Z` (${0})`),this.hass.localize("ui.panel.config.automation.editor.actions.disabled")):"","condition"!==s&&this.config.config.action.continue_on_error?` · ${this.hass.localize("ui.panel.config.automation.editor.actions.continue_on_error")}`:o.s6,B,this.hass.localize("ui.panel.config.automation.editor.actions.run"),c.c?"mac":"",this.disabled,F,this.hass.localize("ui.panel.config.automation.editor.triggers.rename"),c.c?"mac":"",P,this.hass.localize("ui.panel.config.automation.editor.note."+(this.config.config.action.note?"edit":"add")),c.c?"mac":"",this.disabled,I,this.hass.localize("ui.panel.config.automation.editor.actions.duplicate"),c.c?"mac":"",O,this.hass.localize("ui.panel.config.automation.editor.triggers.copy"),this.narrow?o.s6:(0,o.qy)(w||(w=Z`<span class="shortcut"> <span>${0}</span> <span>+</span> <span>C</span> </span>`),c.c?(0,o.qy)($||($=Z`<ha-svg-icon .path="${0}"></ha-svg-icon>`),q):this.hass.localize("ui.panel.config.automation.editor.ctrl")),this.disabled,j,this.hass.localize("ui.panel.config.automation.editor.triggers.cut"),this.narrow?o.s6:(0,o.qy)(_||(_=Z`<span class="shortcut"> <span>${0}</span> <span>+</span> <span>X</span> </span>`),c.c?(0,o.qy)(C||(C=Z`<ha-svg-icon .path="${0}"></ha-svg-icon>`),q):this.hass.localize("ui.panel.config.automation.editor.ctrl")),this.config.pasteAvailable()?(0,o.qy)(M||(M=Z` <ha-dropdown-item slot="menu-items" value="paste" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} ${0} </div> </ha-dropdown-item> `),this.disabled,D,this.hass.localize("ui.panel.config.automation.editor.actions.paste"),this.narrow?o.s6:(0,o.qy)(A||(A=Z`<span class="shortcut"> <span>${0}</span> <span>+</span> <span>V</span> </span>`),c.c?(0,o.qy)(H||(H=Z`<ha-svg-icon .path="${0}"></ha-svg-icon>`),q):this.hass.localize("ui.panel.config.automation.editor.ctrl"))):o.s6,!this.config.uiSupported||!!this._warnings,U,this.hass.localize("ui.panel.config.automation.editor.edit_"+(this.yamlMode?"ui":"yaml")),c.c?"mac":"",this.disabled,e?R:Y,this.hass.localize("ui.panel.config.automation.editor.actions."+(e?"enable":"disable")),c.c?"mac":"","condition"!==s?(0,o.qy)(V||(V=Z`<ha-dropdown-item slot="menu-items" value="continue_on_error" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} <span class="shortcut-placeholder ${0}"></span> </div> </ha-dropdown-item> <wa-divider slot="menu-items"></wa-divider>`),this.disabled,this.config.config.action.continue_on_error?W:E,this.hass.localize("ui.panel.config.automation.editor.actions.continue_on_error"),c.c?"mac":""):o.s6,this.disabled,K,this.hass.localize("ui.panel.config.automation.editor.actions.delete"),this.narrow?o.s6:(0,o.qy)(k||(k=Z`<span class="shortcut"> <span>${0}</span> <span>+</span> <span>${0}</span> </span>`),c.c?(0,o.qy)(x||(x=Z`<ha-svg-icon .path="${0}"></ha-svg-icon>`),q):this.hass.localize("ui.panel.config.automation.editor.ctrl"),this.hass.localize("ui.panel.config.automation.editor.del")),N&&!this.yamlMode?(0,o.qy)(L||(L=Z`<div class="description">${0}</div>`),N):(0,n.D)(this.sidebarKey,(0,o.qy)(z||(z=Z`<ha-automation-action-editor class="sidebar-editor" .hass="${0}" .action="${0}" .yamlMode="${0}" .uiSupported="${0}" @value-changed="${0}" @yaml-changed="${0}" sidebar narrow .disabled="${0}" @ui-mode-not-available="${0}"></ha-automation-action-editor>`),this.hass,i,this.yamlMode,this.config.uiSupported,this._valueChangedSidebar,this._yamlChangedSidebar,this.disabled,this._handleUiModeNotAvailable)),null!==(t=this.config.config.action.note)&&void 0!==t&&t.trim()&&!this.yamlMode?(0,o.qy)(S||(S=Z`<ha-automation-note @edit-note="${0}" .note="${0}"></ha-automation-note>`),this.config.editNote,this.config.config.action.note):o.s6)}_handleUiModeNotAvailable(t){this._warnings=(0,d._)(this.hass,t.detail).warnings,this.yamlMode||(this.yamlMode=!0)}_valueChangedSidebar(t){var i,e;t.stopPropagation(),null===(i=this.config)||void 0===i||null===(e=i.save)||void 0===e||e.call(i,t.detail.value),this.config&&(0,r.r)(this,"value-changed",{value:Object.assign(Object.assign({},this.config),{},{config:{action:t.detail.value}})})}_yamlChangedSidebar(t){var i,e;t.stopPropagation(),null===(i=this.config)||void 0===i||null===(e=i.save)||void 0===e||e.call(i,t.detail.value)}_handleDropdownSelect(t){var i;const e=null===(i=t.detail)||void 0===i||null===(i=i.item)||void 0===i?void 0:i.value;if(e)switch(e){case"rename":this.config.rename();break;case"edit_note":this.config.editNote();break;case"run":this.config.run();break;case"duplicate":this.config.duplicate();break;case"copy":this.config.copy();break;case"cut":this.config.cut();break;case"paste":this.config.paste();break;case"toggle_yaml_mode":this._toggleYamlMode();break;case"disable":this.config.disable();break;case"continue_on_error":this.config.continueOnError();break;case"delete":this.config.delete()}}constructor(...t){super(...t),this.isWide=!1,this.disabled=!1,this.yamlMode=!1,this.narrow=!1,this._toggleYamlMode=()=>{(0,r.r)(this,"toggle-yaml-mode")}}}N.styles=[v.KC,v.Lt],(0,a.Cg)([(0,s.MZ)({attribute:!1})],N.prototype,"hass",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],N.prototype,"config",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],N.prototype,"manifests",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,attribute:"wide"})],N.prototype,"isWide",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],N.prototype,"disabled",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,attribute:"yaml-mode"})],N.prototype,"yamlMode",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],N.prototype,"narrow",void 0),(0,a.Cg)([(0,s.MZ)({type:Number,attribute:"sidebar-key"})],N.prototype,"sidebarKey",void 0),(0,a.Cg)([(0,s.wk)()],N.prototype,"_warnings",void 0),(0,a.Cg)([(0,s.P)(".sidebar-editor")],N.prototype,"editor",void 0),N=(0,a.Cg)([(0,s.EM)("ha-automation-sidebar-action")],N),i()}catch(y){i(y)}})},86818:function(t,i,e){e.a(t,async function(t,i){try{e(62953);var a=e(40445),o=e(5124),s=e(67576),n=e(6412),r=e(1087),d=e(99124),l=e(57237),h=(e(76776),e(76538),e(29823)),c=e(26300),p=e(59992),u=e(14503),g=e(15702),v=t([h,c,g,p]);[h,c,g,p]=v.then?(await v)():v;let m,b,y,f=t=>t;const w="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",$="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z";class _ extends((0,p.V)(o.WF)){get scrollableElement(){return this._contentElement}render(){return(0,o.qy)(m||(m=f` <ha-card outlined class="${0}"> <ha-dialog-header> <ha-icon-button slot="navigationIcon" .label="${0}" .path="${0}" @click="${0}"></ha-icon-button> <slot slot="title" name="title"></slot> <slot slot="subtitle" name="subtitle"></slot> <slot name="overflow-menu" slot="actionItems"> <ha-dropdown @click="${0}" @keydown="${0}" placement="bottom-end"> <ha-icon-button slot="trigger" .label="${0}" .path="${0}"></ha-icon-button> <slot name="menu-items"></slot> </ha-dropdown> </slot> </ha-dialog-header> ${0} <div class="card-content ha-scrollbar"> <slot></slot> ${0} </div> </ha-card> `),(0,n.H)({mobile:!this.isWide,yaml:this.yamlMode}),this.hass.localize("ui.common.close"),w,this._closeSidebar,d.C,l.d,this.hass.localize("ui.common.menu"),$,this.warnings?(0,o.qy)(b||(b=f`<ha-automation-editor-warning .localize="${0}" .warnings="${0}"> </ha-automation-editor-warning>`),this.hass.localize,this.warnings):o.s6,this.renderScrollableFades(this.isWide))}_closeSidebar(){(0,r.r)(this,"close-sidebar")}static get styles(){return[...super.styles,u.dp,(0,o.AH)(y||(y=f`ha-card{position:relative;height:100%;width:100%;border-color:var(--primary-color);border-width:2px;display:flex;flex-direction:column}@media all and (max-width:870px){ha-card.mobile{border:none;box-shadow:none}ha-card.mobile{border-bottom-right-radius:var(--ha-border-radius-square);border-bottom-left-radius:var(--ha-border-radius-square)}}ha-dialog-header{border-radius:var(--ha-card-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0;position:relative;background-color:var(--ha-dialog-surface-background,var(--mdc-theme-surface,#fff))}.card-content{flex:1 1 auto;min-height:0;overflow:auto;margin-top:0;padding-top:0;padding-bottom:max(var(--safe-area-inset-bottom,0px),32px)}.fade-top{top:var(--ha-space-17)}@media all and (max-width:870px){.card-content{padding-bottom:42px}}`))]}constructor(...t){super(...t),this.isWide=!1,this.yamlMode=!1,this.narrow=!1}}(0,a.Cg)([(0,s.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,attribute:"wide"})],_.prototype,"isWide",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,attribute:"yaml-mode"})],_.prototype,"yamlMode",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],_.prototype,"warnings",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],_.prototype,"handleDropdownSelect",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],_.prototype,"narrow",void 0),(0,a.Cg)([(0,s.P)(".card-content")],_.prototype,"_contentElement",void 0),_=(0,a.Cg)([(0,s.EM)("ha-automation-sidebar-card")],_),i()}catch(m){i(m)}})},82755:function(t,i,e){e.a(t,async function(t,i){try{e(89463),e(74423),e(27495),e(42762),e(62953);var a=e(40445),o=(e(68825),e(5124)),s=e(67576),n=e(6412),r=e(19771),d=e(1087),l=e(78978),h=(e(70947),e(87225)),c=e(41570),p=e(49313),u=e(12318),g=e(57116),v=e(86818),m=t([p,u,v]);[p,u,v]=m.then?(await m)():m;let b,y,f,w,$,_,C,M,A,H,V,k,x,L,z=t=>t;const S="M6,2A4,4 0 0,1 10,6V8H14V6A4,4 0 0,1 18,2A4,4 0 0,1 22,6A4,4 0 0,1 18,10H16V14H18A4,4 0 0,1 22,18A4,4 0 0,1 18,22A4,4 0 0,1 14,18V16H10V18A4,4 0 0,1 6,22A4,4 0 0,1 2,18A4,4 0 0,1 6,14H8V10H6A4,4 0 0,1 2,6A4,4 0 0,1 6,2M16,18A2,2 0 0,0 18,20A2,2 0 0,0 20,18A2,2 0 0,0 18,16H16V18M14,10H10V14H14V10M6,16A2,2 0 0,0 4,18A2,2 0 0,0 6,20A2,2 0 0,0 8,18V16H6M8,6A2,2 0 0,0 6,4A2,2 0 0,0 4,6A2,2 0 0,0 6,8H8V6M18,8A2,2 0 0,0 20,6A2,2 0 0,0 18,4A2,2 0 0,0 16,6V8H18Z",Z="M9 22C8.45 22 8 21.55 8 21V18H4C2.9 18 2 17.11 2 16V4C2 2.89 2.9 2 4 2H20C21.11 2 22 2.9 22 4V16C22 17.11 21.11 18 20 18H13.9L10.2 21.71C10 21.9 9.75 22 9.5 22H9M10 16V19.08L13.08 16H20V4H4V16H10M15.84 8.2L14.83 9.21L12.76 7.18L13.77 6.16C13.97 5.95 14.31 5.94 14.55 6.16L15.84 7.41C16.05 7.62 16.06 7.96 15.84 8.2M8 11.91L12.17 7.72L14.24 9.8L10.08 14H8V11.91Z",q="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z",E="M19,3L13,9L15,11L22,4V3M12,12.5A0.5,0.5 0 0,1 11.5,12A0.5,0.5 0 0,1 12,11.5A0.5,0.5 0 0,1 12.5,12A0.5,0.5 0 0,1 12,12.5M6,20A2,2 0 0,1 4,18C4,16.89 4.9,16 6,16A2,2 0 0,1 8,18C8,19.11 7.1,20 6,20M6,8A2,2 0 0,1 4,6C4,4.89 4.9,4 6,4A2,2 0 0,1 8,6C8,7.11 7.1,8 6,8M9.64,7.64C9.87,7.14 10,6.59 10,6A4,4 0 0,0 6,2A4,4 0 0,0 2,6A4,4 0 0,0 6,10C6.59,10 7.14,9.87 7.64,9.64L10,12L7.64,14.36C7.14,14.13 6.59,14 6,14A4,4 0 0,0 2,18A4,4 0 0,0 6,22A4,4 0 0,0 10,18C10,17.41 9.87,16.86 9.64,16.36L12,14L19,21H22V20L9.64,7.64Z",W="M19,20H5V4H7V7H17V4H19M12,2A1,1 0 0,1 13,3A1,1 0 0,1 12,4A1,1 0 0,1 11,3A1,1 0 0,1 12,2M19,2H14.82C14.4,0.84 13.3,0 12,0C10.7,0 9.6,0.84 9.18,2H5A2,2 0 0,0 3,4V20A2,2 0 0,0 5,22H19A2,2 0 0,0 21,20V4A2,2 0 0,0 19,2Z",P="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",O="M6,22A3,3 0 0,1 3,19C3,18.4 3.18,17.84 3.5,17.37L9,7.81V6A1,1 0 0,1 8,5V4A2,2 0 0,1 10,2H14A2,2 0 0,1 16,4V5A1,1 0 0,1 15,6V7.81L20.5,17.37C20.82,17.84 21,18.4 21,19A3,3 0 0,1 18,22H6M5,19A1,1 0 0,0 6,20H18A1,1 0 0,0 19,19C19,18.79 18.93,18.59 18.82,18.43L16.53,14.47L14,17L8.93,11.93L5.18,18.43C5.07,18.59 5,18.79 5,19M13,10A1,1 0 0,0 12,11A1,1 0 0,0 13,12A1,1 0 0,0 14,11A1,1 0 0,0 13,10Z",j="M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M10,16.5L16,12L10,7.5V16.5Z",D="M3 6V8H14V6H3M3 10V12H14V10H3M20 10.1C19.9 10.1 19.7 10.2 19.6 10.3L18.6 11.3L20.7 13.4L21.7 12.4C21.9 12.2 21.9 11.8 21.7 11.6L20.4 10.3C20.3 10.2 20.2 10.1 20 10.1M18.1 11.9L12 17.9V20H14.1L20.2 13.9L18.1 11.9M3 14V16H10V14H3Z",K="M16,8H14V11H11V13H14V16H16V13H19V11H16M2,12C2,9.21 3.64,6.8 6,5.68V3.5C2.5,4.76 0,8.09 0,12C0,15.91 2.5,19.24 6,20.5V18.32C3.64,17.2 2,14.79 2,12M15,3C10.04,3 6,7.04 6,12C6,16.96 10.04,21 15,21C19.96,21 24,16.96 24,12C24,7.04 19.96,3 15,3M15,19C11.14,19 8,15.86 8,12C8,8.14 11.14,5 15,5C18.86,5 22,8.14 22,12C22,15.86 18.86,19 15,19Z",B="M18,17H10.5L12.5,15H18M6,17V14.5L13.88,6.65C14.07,6.45 14.39,6.45 14.59,6.65L16.35,8.41C16.55,8.61 16.55,8.92 16.35,9.12L8.47,17M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z",R="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4M9,9V15H15V9";class U extends o.WF{willUpdate(t){var i;t.has("config")&&(this._warnings=void 0,this.config&&(this.yamlMode=this.config.yamlMode,this.yamlMode&&(null===(i=this.editor)||void 0===i||null===(i=i.yamlEditor)||void 0===i||i.setValue(this.config.config))));t.has("sidebarKey")&&(this._testing=!1)}render(){var t;const i="enabled"in this.config.config&&!1===this.config.config.enabled,e=this.config.config.condition,a=h.I8.includes(e),s=this.hass.localize("ui.panel.config.automation.editor.conditions.condition"),d="condition"in this.config.config&&(0,h.ob)(this.config.config.condition),l="condition"in this.config.config&&(0,h.YQ)(this.config.config.condition),p=this.hass.localize(`ui.panel.config.automation.editor.conditions.type.${e}.label`)||this.hass.localize(`component.${d}.conditions.${l}.name`)||e,u=a?this.hass.localize(`ui.panel.config.automation.editor.conditions.type.${e}.description.picker`):"";return(0,o.qy)(b||(b=z`<ha-automation-sidebar-card .hass="${0}" .isWide="${0}" .yamlMode="${0}" .warnings="${0}" .narrow="${0}" @wa-select="${0}"> <span slot="title">${0}</span> <span slot="subtitle">${0}${0}</span> <ha-dropdown-item slot="menu-items" value="test"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} <span class="shortcut-placeholder ${0}"></span> </div> </ha-dropdown-item> <ha-dropdown-item slot="menu-items" value="rename" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} <span class="shortcut-placeholder ${0}"></span> </div> </ha-dropdown-item> <ha-dropdown-item slot="menu-items" value="edit_note" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} <span class="shortcut-placeholder ${0}"></span> </div> </ha-dropdown-item> <wa-divider slot="menu-items"></wa-divider> <ha-dropdown-item slot="menu-items" value="duplicate" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} <span class="shortcut-placeholder ${0}"></span> </div> </ha-dropdown-item> <ha-dropdown-item slot="menu-items" value="copy"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} ${0} </div> </ha-dropdown-item> <ha-dropdown-item slot="menu-items" value="cut" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} ${0} </div> </ha-dropdown-item> ${0} <ha-dropdown-item slot="menu-items" value="toggle_yaml_mode" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} <span class="shortcut-placeholder ${0}"></span> </div> </ha-dropdown-item> <wa-divider slot="menu-items"></wa-divider> <ha-dropdown-item slot="menu-items" value="disable" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} <span class="shortcut-placeholder ${0}"></span> </div> </ha-dropdown-item> <ha-dropdown-item slot="menu-items" value="delete" variant="danger" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} ${0} </div> </ha-dropdown-item> ${0} ${0} <div class="testing-wrapper"> <div class="testing ${0}"> ${0} </div> </div> </ha-automation-sidebar-card>`),this.hass,this.isWide,this.yamlMode,this._warnings,this.narrow,this._handleDropdownSelect,p,s,i?` (${this.hass.localize("ui.panel.config.automation.editor.actions.disabled")})`:"",O,this.hass.localize("ui.panel.config.automation.editor.conditions.test"),c.c?"mac":"",this.disabled,B,this.hass.localize("ui.panel.config.automation.editor.triggers.rename"),c.c?"mac":"",this.disabled,Z,this.hass.localize("ui.panel.config.automation.editor.note."+(this.config.config.note?"edit":"add")),c.c?"mac":"",this.disabled,K,this.hass.localize("ui.panel.config.automation.editor.actions.duplicate"),c.c?"mac":"",q,this.hass.localize("ui.panel.config.automation.editor.triggers.copy"),this.narrow?o.s6:(0,o.qy)(y||(y=z`<span class="shortcut"> <span>${0}</span> <span>+</span> <span>C</span> </span>`),c.c?(0,o.qy)(f||(f=z`<ha-svg-icon .path="${0}"></ha-svg-icon>`),S):this.hass.localize("ui.panel.config.automation.editor.ctrl")),this.disabled,E,this.hass.localize("ui.panel.config.automation.editor.triggers.cut"),this.narrow?o.s6:(0,o.qy)(w||(w=z`<span class="shortcut"> <span>${0}</span> <span>+</span> <span>X</span> </span>`),c.c?(0,o.qy)($||($=z`<ha-svg-icon .path="${0}"></ha-svg-icon>`),S):this.hass.localize("ui.panel.config.automation.editor.ctrl")),this.config.pasteAvailable()?(0,o.qy)(_||(_=z` <ha-dropdown-item slot="menu-items" value="paste" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} ${0} </div> </ha-dropdown-item> `),this.disabled,W,this.hass.localize("ui.panel.config.automation.editor.actions.paste"),this.narrow?o.s6:(0,o.qy)(C||(C=z`<span class="shortcut"> <span>${0}</span> <span>+</span> <span>V</span> </span>`),c.c?(0,o.qy)(M||(M=z`<ha-svg-icon .path="${0}"></ha-svg-icon>`),S):this.hass.localize("ui.panel.config.automation.editor.ctrl"))):o.s6,!this.config.uiSupported||!!this._warnings,D,this.hass.localize("ui.panel.config.automation.editor.edit_"+(this.yamlMode?"ui":"yaml")),c.c?"mac":"",this.disabled,i?j:R,this.hass.localize("ui.panel.config.automation.editor.actions."+(i?"enable":"disable")),c.c?"mac":"",this.disabled,P,this.hass.localize("ui.panel.config.automation.editor.actions.delete"),this.narrow?o.s6:(0,o.qy)(A||(A=z`<span class="shortcut"> <span>${0}</span> <span>+</span> <span>${0}</span> </span>`),c.c?(0,o.qy)(H||(H=z`<ha-svg-icon .path="${0}"></ha-svg-icon>`),S):this.hass.localize("ui.panel.config.automation.editor.ctrl"),this.hass.localize("ui.panel.config.automation.editor.del")),u&&!this.yamlMode?(0,o.qy)(V||(V=z`<div class="description">${0}</div>`),u):(0,r.D)(this.sidebarKey,(0,o.qy)(k||(k=z`<ha-automation-condition-editor class="sidebar-editor" .hass="${0}" .condition="${0}" .description="${0}" .yamlMode="${0}" .uiSupported="${0}" @value-changed="${0}" @yaml-changed="${0}" .disabled="${0}" @ui-mode-not-available="${0}" sidebar></ha-automation-condition-editor>`),this.hass,this.config.config,this.config.description,this.yamlMode,this.config.uiSupported,this._valueChangedSidebar,this._yamlChangedSidebar,this.disabled,this._handleUiModeNotAvailable)),null!==(t=this.config.config.note)&&void 0!==t&&t.trim()&&!this.yamlMode?(0,o.qy)(x||(x=z`<ha-automation-note @edit-note="${0}" .note="${0}"></ha-automation-note>`),this.config.editNote,this.config.config.note):o.s6,(0,n.H)({active:this._testing,pass:!0===this._testingResult,error:!1===this._testingResult,narrow:this.narrow}),void 0===this._testingResult?o.s6:this.hass.localize("ui.panel.config.automation.editor.conditions.testing_"+(this._testingResult?"pass":"error")))}_handleUiModeNotAvailable(t){this._warnings=(0,l._)(this.hass,t.detail).warnings,this.yamlMode||(this.yamlMode=!0)}_valueChangedSidebar(t){var i,e;t.stopPropagation(),null===(i=this.config)||void 0===i||null===(e=i.save)||void 0===e||e.call(i,t.detail.value),this.config&&(0,d.r)(this,"value-changed",{value:Object.assign(Object.assign({},this.config),{},{config:t.detail.value})})}_yamlChangedSidebar(t){var i,e;t.stopPropagation(),null===(i=this.config)||void 0===i||null===(e=i.save)||void 0===e||e.call(i,t.detail.value)}_handleDropdownSelect(t){var i;const e=null===(i=t.detail)||void 0===i||null===(i=i.item)||void 0===i?void 0:i.value;if(e)switch(e){case"rename":this.config.rename();break;case"edit_note":this.config.editNote();break;case"test":this.config.test();break;case"duplicate":this.config.duplicate();break;case"copy":this.config.copy();break;case"cut":this.config.cut();break;case"paste":this.config.paste();break;case"toggle_yaml_mode":this._toggleYamlMode();break;case"disable":this.config.disable();break;case"delete":this.config.delete()}}constructor(...t){super(...t),this.isWide=!1,this.disabled=!1,this.yamlMode=!1,this.narrow=!1,this._testing=!1,this._toggleYamlMode=()=>{(0,d.r)(this,"toggle-yaml-mode")}}}U.styles=[g.KC,g.Lt,(0,o.AH)(L||(L=z`ha-automation-sidebar-card{position:relative}.testing-wrapper{position:absolute;top:0px;right:0px;left:0px;margin:-1px;overflow:hidden;border-top-right-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-top-left-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));pointer-events:none;height:100px}.testing{--testing-color:var(--divider-color, #e0e0e0);text-transform:uppercase;font-size:var(--ha-font-size-m);font-weight:var(--ha-font-weight-bold);background-color:var(--testing-color);color:var(--text-primary-color);max-height:0px;transition:max-height .3s ease-in-out,padding-top .3s ease-in-out;text-align:center}.testing.active.narrow{padding-top:16px}.testing.active{max-height:100%}.testing.error{--testing-color:var(--accent-color)}.testing.pass{--testing-color:var(--success-color)}`))],(0,a.Cg)([(0,s.MZ)({attribute:!1})],U.prototype,"hass",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],U.prototype,"config",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,attribute:"wide"})],U.prototype,"isWide",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],U.prototype,"disabled",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,attribute:"yaml-mode"})],U.prototype,"yamlMode",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],U.prototype,"narrow",void 0),(0,a.Cg)([(0,s.MZ)({type:Number,attribute:"sidebar-key"})],U.prototype,"sidebarKey",void 0),(0,a.Cg)([(0,s.wk)()],U.prototype,"_warnings",void 0),(0,a.Cg)([(0,s.wk)()],U.prototype,"_testing",void 0),(0,a.Cg)([(0,s.wk)()],U.prototype,"_testingResult",void 0),(0,a.Cg)([(0,s.P)(".sidebar-editor")],U.prototype,"editor",void 0),U=(0,a.Cg)([(0,s.EM)("ha-automation-sidebar-condition")],U),i()}catch(b){i(b)}})},84713:function(t,i,e){e.a(t,async function(t,i){try{e(42762),e(62953);var a=e(40445),o=(e(68825),e(5124)),s=e(67576),n=(e(70947),e(67094),e(41570)),r=e(12318),d=e(57116),l=e(86818),h=t([r,l]);[r,l]=h.then?(await h)():h;let c,p,u,g,v,m,b=t=>t;const y="M6,2A4,4 0 0,1 10,6V8H14V6A4,4 0 0,1 18,2A4,4 0 0,1 22,6A4,4 0 0,1 18,10H16V14H18A4,4 0 0,1 22,18A4,4 0 0,1 18,22A4,4 0 0,1 14,18V16H10V18A4,4 0 0,1 6,22A4,4 0 0,1 2,18A4,4 0 0,1 6,14H8V10H6A4,4 0 0,1 2,6A4,4 0 0,1 6,2M16,18A2,2 0 0,0 18,20A2,2 0 0,0 20,18A2,2 0 0,0 18,16H16V18M14,10H10V14H14V10M6,16A2,2 0 0,0 4,18A2,2 0 0,0 6,20A2,2 0 0,0 8,18V16H6M8,6A2,2 0 0,0 6,4A2,2 0 0,0 4,6A2,2 0 0,0 6,8H8V6M18,8A2,2 0 0,0 20,6A2,2 0 0,0 18,4A2,2 0 0,0 16,6V8H18Z",f="M9 22C8.45 22 8 21.55 8 21V18H4C2.9 18 2 17.11 2 16V4C2 2.89 2.9 2 4 2H20C21.11 2 22 2.9 22 4V16C22 17.11 21.11 18 20 18H13.9L10.2 21.71C10 21.9 9.75 22 9.5 22H9M10 16V19.08L13.08 16H20V4H4V16H10M15.84 8.2L14.83 9.21L12.76 7.18L13.77 6.16C13.97 5.95 14.31 5.94 14.55 6.16L15.84 7.41C16.05 7.62 16.06 7.96 15.84 8.2M8 11.91L12.17 7.72L14.24 9.8L10.08 14H8V11.91Z",w="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",$="M16,8H14V11H11V13H14V16H16V13H19V11H16M2,12C2,9.21 3.64,6.8 6,5.68V3.5C2.5,4.76 0,8.09 0,12C0,15.91 2.5,19.24 6,20.5V18.32C3.64,17.2 2,14.79 2,12M15,3C10.04,3 6,7.04 6,12C6,16.96 10.04,21 15,21C19.96,21 24,16.96 24,12C24,7.04 19.96,3 15,3M15,19C11.14,19 8,15.86 8,12C8,8.14 11.14,5 15,5C18.86,5 22,8.14 22,12C22,15.86 18.86,19 15,19Z",_="M18,17H10.5L12.5,15H18M6,17V14.5L13.88,6.65C14.07,6.45 14.39,6.45 14.59,6.65L16.35,8.41C16.55,8.61 16.55,8.92 16.35,9.12L8.47,17M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z";class C extends o.WF{render(){var t;const i=this.disabled,e=this.hass.localize("ui.panel.config.automation.editor.actions.type.choose.label"),a=this.hass.localize(`ui.panel.config.automation.editor.actions.type.choose.${this.config.defaultOption?"default_":""}option_label`),s=this.hass.localize(`ui.panel.config.automation.editor.actions.type.choose.${this.config.defaultOption?"default_":""}option_description`);return(0,o.qy)(c||(c=b`<ha-automation-sidebar-card .hass="${0}" .isWide="${0}" .narrow="${0}" @wa-select="${0}"> <span slot="title">${0}</span> <span slot="subtitle">${0}</span> ${0} <div class="description">${0}</div> ${0} </ha-automation-sidebar-card>`),this.hass,this.isWide,this.narrow,this._handleDropdownSelect,a,e,this.config.defaultOption?(0,o.qy)(p||(p=b`<span slot="overflow-menu"></span>`)):(0,o.qy)(u||(u=b` <ha-dropdown-item slot="menu-items" value="rename" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} <span class="shortcut-placeholder ${0}"></span> </div> </ha-dropdown-item> <ha-dropdown-item slot="menu-items" value="edit_note" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} <span class="shortcut-placeholder ${0}"></span> </div> </ha-dropdown-item> <ha-dropdown-item slot="menu-items" value="duplicate" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} <span class="shortcut-placeholder ${0}"></span> </div> </ha-dropdown-item> <wa-divider slot="menu-items"></wa-divider> <ha-dropdown-item slot="menu-items" value="delete" .disabled="${0}" variant="danger"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} ${0} </div> </ha-dropdown-item> `),!!i,_,this.hass.localize("ui.panel.config.automation.editor.triggers.rename"),n.c?"mac":"",!!i,f,this.hass.localize("ui.panel.config.automation.editor.note."+(this.config.note?"edit":"add")),n.c?"mac":"",this.disabled,$,this.hass.localize("ui.panel.config.automation.editor.actions.duplicate"),n.c?"mac":"",this.disabled,w,this.hass.localize("ui.panel.config.automation.editor.actions.type.choose.remove_option"),this.narrow?o.s6:(0,o.qy)(g||(g=b`<span class="shortcut"> <span>${0}</span> <span>+</span> <span>${0}</span> </span>`),n.c?(0,o.qy)(v||(v=b`<ha-svg-icon slot="start" .path="${0}"></ha-svg-icon>`),y):this.hass.localize("ui.panel.config.automation.editor.ctrl"),this.hass.localize("ui.panel.config.automation.editor.del"))),s,!this.config.defaultOption&&null!==(t=this.config.note)&&void 0!==t&&t.trim()?(0,o.qy)(m||(m=b`<ha-automation-note @edit-note="${0}" .note="${0}"></ha-automation-note>`),this.config.editNote,this.config.note):o.s6)}_handleDropdownSelect(t){var i;const e=null===(i=t.detail)||void 0===i||null===(i=i.item)||void 0===i?void 0:i.value;if(e)switch(e){case"rename":this.config.rename();break;case"edit_note":this.config.editNote();break;case"duplicate":this.config.duplicate();break;case"delete":this.config.delete()}}constructor(...t){super(...t),this.isWide=!1,this.disabled=!1,this.narrow=!1}}C.styles=[d.KC,d.Lt],(0,a.Cg)([(0,s.MZ)({attribute:!1})],C.prototype,"hass",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],C.prototype,"config",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,attribute:"wide"})],C.prototype,"isWide",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],C.prototype,"disabled",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],C.prototype,"narrow",void 0),(0,a.Cg)([(0,s.P)(".sidebar-editor")],C.prototype,"editor",void 0),C=(0,a.Cg)([(0,s.EM)("ha-automation-sidebar-option")],C),i()}catch(c){i(c)}})},71518:function(t,i,e){e.a(t,async function(t,i){try{e(62953);var a=e(40445),o=e(5124),s=e(67576),n=e(19771),r=e(1087),d=(e(70947),e(41570)),l=e(50940),h=e(57116),c=e(86818),p=t([l,c]);[l,c]=p.then?(await p)():p;let u,g,v,m,b=t=>t;const y="M6,2A4,4 0 0,1 10,6V8H14V6A4,4 0 0,1 18,2A4,4 0 0,1 22,6A4,4 0 0,1 18,10H16V14H18A4,4 0 0,1 22,18A4,4 0 0,1 18,22A4,4 0 0,1 14,18V16H10V18A4,4 0 0,1 6,22A4,4 0 0,1 2,18A4,4 0 0,1 6,14H8V10H6A4,4 0 0,1 2,6A4,4 0 0,1 6,2M16,18A2,2 0 0,0 18,20A2,2 0 0,0 20,18A2,2 0 0,0 18,16H16V18M14,10H10V14H14V10M6,16A2,2 0 0,0 4,18A2,2 0 0,0 6,20A2,2 0 0,0 8,18V16H6M8,6A2,2 0 0,0 6,4A2,2 0 0,0 4,6A2,2 0 0,0 6,8H8V6M18,8A2,2 0 0,0 20,6A2,2 0 0,0 18,4A2,2 0 0,0 16,6V8H18Z",f="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",w="M3 6V8H14V6H3M3 10V12H14V10H3M20 10.1C19.9 10.1 19.7 10.2 19.6 10.3L18.6 11.3L20.7 13.4L21.7 12.4C21.9 12.2 21.9 11.8 21.7 11.6L20.4 10.3C20.3 10.2 20.2 10.1 20 10.1M18.1 11.9L12 17.9V20H14.1L20.2 13.9L18.1 11.9M3 14V16H10V14H3Z";class $ extends o.WF{willUpdate(t){var i;t.has("config")&&(this._warnings=void 0,this.config&&(this.yamlMode=this.config.yamlMode,this.yamlMode&&(null===(i=this.editor)||void 0===i||null===(i=i.yamlEditor)||void 0===i||i.setValue(this.config.config))))}render(){const t=this.hass.localize("ui.panel.config.script.editor.field.field_selector"),i=this.hass.localize(`ui.components.selectors.selector.types.${Object.keys(this.config.config.field.selector)[0]}`)||Object.keys(this.config.config.field.selector)[0];return(0,o.qy)(u||(u=b`<ha-automation-sidebar-card .hass="${0}" .isWide="${0}" .yamlMode="${0}" .warnings="${0}" .narrow="${0}" @wa-select="${0}"> <span slot="title">${0}</span> <span slot="subtitle">${0}</span> <ha-dropdown-item slot="menu-items" value="toggle_yaml_mode" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} <span class="shortcut-placeholder ${0}"></span> </div> </ha-dropdown-item> <ha-dropdown-item slot="menu-items" value="delete" .disabled="${0}" variant="danger"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} ${0} </div> </ha-dropdown-item> ${0} </ha-automation-sidebar-card>`),this.hass,this.isWide,this.yamlMode,this._warnings,this.narrow,this._handleDropdownSelect,i,t,!!this._warnings,w,this.hass.localize("ui.panel.config.automation.editor.edit_"+(this.yamlMode?"ui":"yaml")),d.c?"mac":"",this.disabled,f,this.hass.localize("ui.panel.config.automation.editor.actions.delete"),this.narrow?o.s6:(0,o.qy)(g||(g=b`<span class="shortcut"> <span>${0}</span> <span>+</span> <span>${0}</span> </span>`),d.c?(0,o.qy)(v||(v=b`<ha-svg-icon .path="${0}"></ha-svg-icon>`),y):this.hass.localize("ui.panel.config.automation.editor.ctrl"),this.hass.localize("ui.panel.config.automation.editor.del")),(0,n.D)(this.sidebarKey,(0,o.qy)(m||(m=b`<ha-script-field-selector-editor class="sidebar-editor" .hass="${0}" .field="${0}" .disabled="${0}" @value-changed="${0}" @yaml-changed="${0}" .yamlMode="${0}"></ha-script-field-selector-editor>`),this.hass,this.config.config.field,this.disabled,this._valueChangedSidebar,this._yamlChangedSidebar,this.yamlMode)))}_valueChangedSidebar(t){var i,e;t.stopPropagation(),null===(i=this.config)||void 0===i||null===(e=i.save)||void 0===e||e.call(i,Object.assign(Object.assign({},this.config.config.field),{},{key:this.config.config.key},t.detail.value)),this.config&&(0,r.r)(this,"value-changed",{value:Object.assign(Object.assign({},this.config),{},{config:{field:t.detail.value,key:this.config.config.key,excludeKeys:this.config.config.excludeKeys,selector:!0}})})}_yamlChangedSidebar(t){var i,e;t.stopPropagation(),null===(i=this.config)||void 0===i||null===(e=i.save)||void 0===e||e.call(i,t.detail.value)}_handleDropdownSelect(t){var i;const e=null===(i=t.detail)||void 0===i||null===(i=i.item)||void 0===i?void 0:i.value;if(e)switch(e){case"toggle_yaml_mode":this._toggleYamlMode();break;case"delete":this.config.delete()}}constructor(...t){super(...t),this.isWide=!1,this.disabled=!1,this.yamlMode=!1,this.narrow=!1,this._toggleYamlMode=()=>{(0,r.r)(this,"toggle-yaml-mode")}}}$.styles=h.KC,(0,a.Cg)([(0,s.MZ)({attribute:!1})],$.prototype,"hass",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],$.prototype,"config",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,attribute:"wide"})],$.prototype,"isWide",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],$.prototype,"disabled",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,attribute:"yaml-mode"})],$.prototype,"yamlMode",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],$.prototype,"narrow",void 0),(0,a.Cg)([(0,s.MZ)({type:Number,attribute:"sidebar-key"})],$.prototype,"sidebarKey",void 0),(0,a.Cg)([(0,s.wk)()],$.prototype,"_warnings",void 0),(0,a.Cg)([(0,s.P)(".sidebar-editor")],$.prototype,"editor",void 0),$=(0,a.Cg)([(0,s.EM)("ha-automation-sidebar-script-field-selector")],$),i()}catch(u){i(u)}})},61970:function(t,i,e){e.a(t,async function(t,i){try{e(89463),e(42762),e(62953);var a=e(40445),o=e(5124),s=e(67576),n=e(19771),r=e(1087),d=(e(70947),e(41570)),l=e(1404),h=e(12318),c=e(57116),p=e(86818),u=t([l,h,p]);[l,h,p]=u.then?(await u)():u;let g,v,m,b,y,f=t=>t;const w="M6,2A4,4 0 0,1 10,6V8H14V6A4,4 0 0,1 18,2A4,4 0 0,1 22,6A4,4 0 0,1 18,10H16V14H18A4,4 0 0,1 22,18A4,4 0 0,1 18,22A4,4 0 0,1 14,18V16H10V18A4,4 0 0,1 6,22A4,4 0 0,1 2,18A4,4 0 0,1 6,14H8V10H6A4,4 0 0,1 2,6A4,4 0 0,1 6,2M16,18A2,2 0 0,0 18,20A2,2 0 0,0 20,18A2,2 0 0,0 18,16H16V18M14,10H10V14H14V10M6,16A2,2 0 0,0 4,18A2,2 0 0,0 6,20A2,2 0 0,0 8,18V16H6M8,6A2,2 0 0,0 6,4A2,2 0 0,0 4,6A2,2 0 0,0 6,8H8V6M18,8A2,2 0 0,0 20,6A2,2 0 0,0 18,4A2,2 0 0,0 16,6V8H18Z",$="M9 22C8.45 22 8 21.55 8 21V18H4C2.9 18 2 17.11 2 16V4C2 2.89 2.9 2 4 2H20C21.11 2 22 2.9 22 4V16C22 17.11 21.11 18 20 18H13.9L10.2 21.71C10 21.9 9.75 22 9.5 22H9M10 16V19.08L13.08 16H20V4H4V16H10M15.84 8.2L14.83 9.21L12.76 7.18L13.77 6.16C13.97 5.95 14.31 5.94 14.55 6.16L15.84 7.41C16.05 7.62 16.06 7.96 15.84 8.2M8 11.91L12.17 7.72L14.24 9.8L10.08 14H8V11.91Z",_="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",C="M3 6V8H14V6H3M3 10V12H14V10H3M20 10.1C19.9 10.1 19.7 10.2 19.6 10.3L18.6 11.3L20.7 13.4L21.7 12.4C21.9 12.2 21.9 11.8 21.7 11.6L20.4 10.3C20.3 10.2 20.2 10.1 20 10.1M18.1 11.9L12 17.9V20H14.1L20.2 13.9L18.1 11.9M3 14V16H10V14H3Z";class M extends o.WF{willUpdate(t){var i;t.has("config")&&(this._warnings=void 0,this.config&&(this.yamlMode=this.config.yamlMode,this.yamlMode&&(null===(i=this.editor)||void 0===i||null===(i=i.yamlEditor)||void 0===i||i.setValue(this.config.config))))}render(){var t;const i=this.hass.localize("ui.panel.config.script.editor.field.label");return(0,o.qy)(g||(g=f`<ha-automation-sidebar-card .hass="${0}" .isWide="${0}" .yamlMode="${0}" .warnings="${0}" .narrow="${0}" @wa-select="${0}"> <span slot="title">${0}</span> <ha-dropdown-item slot="menu-items" value="edit_note"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} <span class="shortcut-placeholder ${0}"></span> </div> </ha-dropdown-item> <ha-dropdown-item slot="menu-items" value="toggle_yaml_mode" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} <span class="shortcut-placeholder ${0}"></span> </div> </ha-dropdown-item> <ha-dropdown-item slot="menu-items" value="delete" .disabled="${0}" variant="danger"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} ${0} </div> </ha-dropdown-item> ${0} ${0} </ha-automation-sidebar-card>`),this.hass,this.isWide,this.yamlMode,this._warnings,this.narrow,this._handleDropdownSelect,i,$,this.hass.localize("ui.panel.config.automation.editor.note."+(this.config.config.field.description?"edit":"add")),d.c?"mac":"",!!this._warnings,C,this.hass.localize("ui.panel.config.automation.editor.edit_"+(this.yamlMode?"ui":"yaml")),d.c?"mac":"",this.disabled,_,this.hass.localize("ui.panel.config.automation.editor.actions.delete"),this.narrow?o.s6:(0,o.qy)(v||(v=f`<span class="shortcut"> <span>${0}</span> <span>+</span> <span>${0}</span> </span>`),d.c?(0,o.qy)(m||(m=f`<ha-svg-icon .path="${0}"></ha-svg-icon>`),w):this.hass.localize("ui.panel.config.automation.editor.ctrl"),this.hass.localize("ui.panel.config.automation.editor.del")),(0,n.D)(this.sidebarKey,(0,o.qy)(b||(b=f`<ha-script-field-editor class="sidebar-editor" .hass="${0}" .field="${0}" .key="${0}" .excludeKeys="${0}" .disabled="${0}" .yamlMode="${0}" @value-changed="${0}" @yaml-changed="${0}"></ha-script-field-editor>`),this.hass,this.config.config.field,this.config.config.key,this.config.config.excludeKeys,this.disabled,this.yamlMode,this._valueChangedSidebar,this._yamlChangedSidebar)),null!==(t=this.config.config.field.description)&&void 0!==t&&t.trim()&&!this.yamlMode?(0,o.qy)(y||(y=f`<ha-automation-note @edit-note="${0}" .note="${0}"></ha-automation-note>`),this.config.editNote,this.config.config.field.description):o.s6)}_valueChangedSidebar(t){var i,e,a,o;(t.stopPropagation(),null===(i=this.config)||void 0===i||null===(e=i.save)||void 0===e||e.call(i,Object.assign(Object.assign({},this.config.config.field),{},{key:null!==(a=t.detail.value.key)&&void 0!==a?a:this.config.config.key},t.detail.value)),this.config)&&(0,r.r)(this,"value-changed",{value:Object.assign(Object.assign({},this.config),{},{config:{field:t.detail.value,key:null!==(o=t.detail.value.key)&&void 0!==o?o:this.config.config.key,excludeKeys:this.config.config.excludeKeys}})})}_yamlChangedSidebar(t){var i,e;t.stopPropagation(),null===(i=this.config)||void 0===i||null===(e=i.save)||void 0===e||e.call(i,t.detail.value)}_handleDropdownSelect(t){var i;const e=null===(i=t.detail)||void 0===i||null===(i=i.item)||void 0===i?void 0:i.value;if(e)switch(e){case"toggle_yaml_mode":this._toggleYamlMode();break;case"edit_note":this.config.editNote();break;case"delete":this.config.delete()}}constructor(...t){super(...t),this.isWide=!1,this.disabled=!1,this.yamlMode=!1,this.narrow=!1,this._toggleYamlMode=()=>{(0,r.r)(this,"toggle-yaml-mode")}}}M.styles=[c.KC,c.Lt],(0,a.Cg)([(0,s.MZ)({attribute:!1})],M.prototype,"hass",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],M.prototype,"config",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,attribute:"wide"})],M.prototype,"isWide",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],M.prototype,"disabled",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,attribute:"yaml-mode"})],M.prototype,"yamlMode",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],M.prototype,"narrow",void 0),(0,a.Cg)([(0,s.MZ)({type:Number,attribute:"sidebar-key"})],M.prototype,"sidebarKey",void 0),(0,a.Cg)([(0,s.wk)()],M.prototype,"_warnings",void 0),(0,a.Cg)([(0,s.P)(".sidebar-editor")],M.prototype,"editor",void 0),M=(0,a.Cg)([(0,s.EM)("ha-automation-sidebar-script-field")],M),i()}catch(g){i(g)}})},44214:function(t,i,e){e.a(t,async function(t,i){try{e(89463),e(42762),e(62953);var a=e(40445),o=(e(68825),e(5124)),s=e(67576),n=e(19771),r=e(1087),d=e(78978),l=(e(70947),e(3496)),h=e(41570),c=e(12318),p=e(57116),u=e(11489),g=e(86818),v=t([c,u,g]);[c,u,g]=v.then?(await v)():v;let m,b,y,f,w,$,_,C,M,A,H,V,k,x,L=t=>t;const z="M6,2A4,4 0 0,1 10,6V8H14V6A4,4 0 0,1 18,2A4,4 0 0,1 22,6A4,4 0 0,1 18,10H16V14H18A4,4 0 0,1 22,18A4,4 0 0,1 18,22A4,4 0 0,1 14,18V16H10V18A4,4 0 0,1 6,22A4,4 0 0,1 2,18A4,4 0 0,1 6,14H8V10H6A4,4 0 0,1 2,6A4,4 0 0,1 6,2M16,18A2,2 0 0,0 18,20A2,2 0 0,0 20,18A2,2 0 0,0 18,16H16V18M14,10H10V14H14V10M6,16A2,2 0 0,0 4,18A2,2 0 0,0 6,20A2,2 0 0,0 8,18V16H6M8,6A2,2 0 0,0 6,4A2,2 0 0,0 4,6A2,2 0 0,0 6,8H8V6M18,8A2,2 0 0,0 20,6A2,2 0 0,0 18,4A2,2 0 0,0 16,6V8H18Z",S="M9 22C8.45 22 8 21.55 8 21V18H4C2.9 18 2 17.11 2 16V4C2 2.89 2.9 2 4 2H20C21.11 2 22 2.9 22 4V16C22 17.11 21.11 18 20 18H13.9L10.2 21.71C10 21.9 9.75 22 9.5 22H9M10 16V19.08L13.08 16H20V4H4V16H10M15.84 8.2L14.83 9.21L12.76 7.18L13.77 6.16C13.97 5.95 14.31 5.94 14.55 6.16L15.84 7.41C16.05 7.62 16.06 7.96 15.84 8.2M8 11.91L12.17 7.72L14.24 9.8L10.08 14H8V11.91Z",Z="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z",q="M19,3L13,9L15,11L22,4V3M12,12.5A0.5,0.5 0 0,1 11.5,12A0.5,0.5 0 0,1 12,11.5A0.5,0.5 0 0,1 12.5,12A0.5,0.5 0 0,1 12,12.5M6,20A2,2 0 0,1 4,18C4,16.89 4.9,16 6,16A2,2 0 0,1 8,18C8,19.11 7.1,20 6,20M6,8A2,2 0 0,1 4,6C4,4.89 4.9,4 6,4A2,2 0 0,1 8,6C8,7.11 7.1,8 6,8M9.64,7.64C9.87,7.14 10,6.59 10,6A4,4 0 0,0 6,2A4,4 0 0,0 2,6A4,4 0 0,0 6,10C6.59,10 7.14,9.87 7.64,9.64L10,12L7.64,14.36C7.14,14.13 6.59,14 6,14A4,4 0 0,0 2,18A4,4 0 0,0 6,22A4,4 0 0,0 10,18C10,17.41 9.87,16.86 9.64,16.36L12,14L19,21H22V20L9.64,7.64Z",E="M19,20H5V4H7V7H17V4H19M12,2A1,1 0 0,1 13,3A1,1 0 0,1 12,4A1,1 0 0,1 11,3A1,1 0 0,1 12,2M19,2H14.82C14.4,0.84 13.3,0 12,0C10.7,0 9.6,0.84 9.18,2H5A2,2 0 0,0 3,4V20A2,2 0 0,0 5,22H19A2,2 0 0,0 21,20V4A2,2 0 0,0 19,2Z",W="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",P="M10 7V9H9V15H10V17H6V15H7V9H6V7H10M16 7C17.11 7 18 7.9 18 9V15C18 16.11 17.11 17 16 17H12V7M16 9H14V15H16V9Z",O="M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M10,16.5L16,12L10,7.5V16.5Z",j="M3 6V8H14V6H3M3 10V12H14V10H3M20 10.1C19.9 10.1 19.7 10.2 19.6 10.3L18.6 11.3L20.7 13.4L21.7 12.4C21.9 12.2 21.9 11.8 21.7 11.6L20.4 10.3C20.3 10.2 20.2 10.1 20 10.1M18.1 11.9L12 17.9V20H14.1L20.2 13.9L18.1 11.9M3 14V16H10V14H3Z",D="M16,8H14V11H11V13H14V16H16V13H19V11H16M2,12C2,9.21 3.64,6.8 6,5.68V3.5C2.5,4.76 0,8.09 0,12C0,15.91 2.5,19.24 6,20.5V18.32C3.64,17.2 2,14.79 2,12M15,3C10.04,3 6,7.04 6,12C6,16.96 10.04,21 15,21C19.96,21 24,16.96 24,12C24,7.04 19.96,3 15,3M15,19C11.14,19 8,15.86 8,12C8,8.14 11.14,5 15,5C18.86,5 22,8.14 22,12C22,15.86 18.86,19 15,19Z",K="M18,17H10.5L12.5,15H18M6,17V14.5L13.88,6.65C14.07,6.45 14.39,6.45 14.59,6.65L16.35,8.41C16.55,8.61 16.55,8.92 16.35,9.12L8.47,17M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z",B="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4M9,9V15H15V9";class R extends o.WF{willUpdate(t){var i;t.has("config")&&(this._requestShowId=!1,this._warnings=void 0,this.config&&(this.yamlMode=this.config.yamlMode,this.yamlMode&&(null===(i=this.editor)||void 0===i||null===(i=i.yamlEditor)||void 0===i||i.setValue(this.config.config))))}render(){var t;const i="enabled"in this.config.config&&!1===this.config.config.enabled,e=(0,l.H4)(this.config.config)?"list":this.config.config.trigger,a=this.hass.localize("ui.panel.config.automation.editor.triggers.trigger"),s="trigger"in this.config.config&&(0,l.zz)(this.config.config.trigger),r="trigger"in this.config.config&&(0,l.hN)(this.config.config.trigger),d=this.hass.localize(`ui.panel.config.automation.editor.triggers.type.${e}.label`)||this.hass.localize(`component.${s}.triggers.${r}.name`);return(0,o.qy)(m||(m=L` <ha-automation-sidebar-card .hass="${0}" .isWide="${0}" .yamlMode="${0}" .warnings="${0}" .narrow="${0}" @wa-select="${0}"> <span slot="title">${0}</span> <span slot="subtitle">${0}${0}</span> <ha-dropdown-item slot="menu-items" value="rename" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} <span class="shortcut-placeholder ${0}"></span> </div> </ha-dropdown-item> ${0} ${0} <wa-divider slot="menu-items"></wa-divider> <ha-dropdown-item slot="menu-items" value="duplicate" .disabled="${0}"> ${0} <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> </ha-dropdown-item> <ha-dropdown-item slot="menu-items" value="copy"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} ${0} </div> </ha-dropdown-item> <ha-dropdown-item slot="menu-items" value="cut" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} ${0} </div> </ha-dropdown-item> ${0} <ha-dropdown-item slot="menu-items" value="toggle_yaml_mode" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} <span class="shortcut-placeholder ${0}"></span> </div> </ha-dropdown-item> <wa-divider slot="menu-items"></wa-divider> <ha-dropdown-item slot="menu-items" value="disable" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} <span class="shortcut-placeholder ${0}"></span> </div> </ha-dropdown-item> <ha-dropdown-item slot="menu-items" value="delete" .disabled="${0}" variant="danger"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} ${0} </div> </ha-dropdown-item> ${0} ${0} </ha-automation-sidebar-card> `),this.hass,this.isWide,this.yamlMode,this._warnings,this.narrow,this._handleDropdownSelect,d,a,i?` (${this.hass.localize("ui.panel.config.automation.editor.actions.disabled")})`:"",this.disabled||"list"===e,K,this.hass.localize("ui.panel.config.automation.editor.triggers.rename"),h.c?"mac":"","list"!==e?(0,o.qy)(b||(b=L`<ha-dropdown-item slot="menu-items" value="edit_note" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} <span class="shortcut-placeholder ${0}"></span> </div> </ha-dropdown-item>`),this.disabled,S,this.hass.localize("ui.panel.config.automation.editor.note."+(this.config.config.note?"edit":"add")),h.c?"mac":""):o.s6,this.yamlMode||"id"in this.config.config||this._requestShowId?o.s6:(0,o.qy)(y||(y=L`<ha-dropdown-item slot="menu-items" value="show_id" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} <span class="shortcut-placeholder ${0}"></span> </div> </ha-dropdown-item>`),this.disabled||"list"===e,P,this.hass.localize("ui.panel.config.automation.editor.triggers.edit_id"),h.c?"mac":""),this.disabled,this.hass.localize("ui.panel.config.automation.editor.triggers.duplicate"),D,Z,this.hass.localize("ui.panel.config.automation.editor.triggers.copy"),this.narrow?o.s6:(0,o.qy)(f||(f=L`<span class="shortcut"> <span>${0}</span> <span>+</span> <span>C</span> </span>`),h.c?(0,o.qy)(w||(w=L`<ha-svg-icon .path="${0}"></ha-svg-icon>`),z):this.hass.localize("ui.panel.config.automation.editor.ctrl")),this.disabled,q,this.hass.localize("ui.panel.config.automation.editor.triggers.cut"),this.narrow?o.s6:(0,o.qy)($||($=L`<span class="shortcut"> <span>${0}</span> <span>+</span> <span>X</span> </span>`),h.c?(0,o.qy)(_||(_=L`<ha-svg-icon .path="${0}"></ha-svg-icon>`),z):this.hass.localize("ui.panel.config.automation.editor.ctrl")),this.config.pasteAvailable()?(0,o.qy)(C||(C=L` <ha-dropdown-item slot="menu-items" value="paste" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <div class="overflow-label"> ${0} ${0} </div> </ha-dropdown-item> `),this.disabled,E,this.hass.localize("ui.panel.config.automation.editor.actions.paste"),this.narrow?o.s6:(0,o.qy)(M||(M=L`<span class="shortcut"> <span>${0}</span> <span>+</span> <span>V</span> </span>`),h.c?(0,o.qy)(A||(A=L`<ha-svg-icon .path="${0}"></ha-svg-icon>`),z):this.hass.localize("ui.panel.config.automation.editor.ctrl"))):o.s6,!this.config.uiSupported||!!this._warnings,j,this.hass.localize("ui.panel.config.automation.editor.edit_"+(this.yamlMode?"ui":"yaml")),h.c?"mac":"",this.disabled||"list"===e,i?O:B,this.hass.localize("ui.panel.config.automation.editor.actions."+(i?"enable":"disable")),h.c?"mac":"",this.disabled,W,this.hass.localize("ui.panel.config.automation.editor.actions.delete"),this.narrow?o.s6:(0,o.qy)(H||(H=L`<span class="shortcut"> <span>${0}</span> <span>+</span> <span>${0}</span> </span>`),h.c?(0,o.qy)(V||(V=L`<ha-svg-icon .path="${0}"></ha-svg-icon>`),z):this.hass.localize("ui.panel.config.automation.editor.ctrl"),this.hass.localize("ui.panel.config.automation.editor.del")),(0,n.D)(this.sidebarKey,(0,o.qy)(k||(k=L`<ha-automation-trigger-editor class="sidebar-editor" .hass="${0}" .trigger="${0}" .description="${0}" @value-changed="${0}" @yaml-changed="${0}" .uiSupported="${0}" .showId="${0}" .yamlMode="${0}" .disabled="${0}" @ui-mode-not-available="${0}" sidebar></ha-automation-trigger-editor>`),this.hass,this.config.config,this.config.description,this._valueChangedSidebar,this._yamlChangedSidebar,this.config.uiSupported,this._requestShowId,this.yamlMode,this.disabled,this._handleUiModeNotAvailable)),(0,l.H4)(this.config.config)||null===(t=this.config.config.note)||void 0===t||!t.trim()||this.yamlMode?o.s6:(0,o.qy)(x||(x=L`<ha-automation-note @edit-note="${0}" .note="${0}"></ha-automation-note>`),this.config.editNote,this.config.config.note))}_handleUiModeNotAvailable(t){this._warnings=(0,d._)(this.hass,t.detail).warnings,this.yamlMode||(this.yamlMode=!0)}_valueChangedSidebar(t){var i,e;t.stopPropagation(),null===(i=this.config)||void 0===i||null===(e=i.save)||void 0===e||e.call(i,t.detail.value),this.config&&(0,r.r)(this,"value-changed",{value:Object.assign(Object.assign({},this.config),{},{config:t.detail.value})})}_yamlChangedSidebar(t){var i,e;t.stopPropagation(),null===(i=this.config)||void 0===i||null===(e=i.save)||void 0===e||e.call(i,t.detail.value)}_handleDropdownSelect(t){var i;const e=null===(i=t.detail)||void 0===i||null===(i=i.item)||void 0===i?void 0:i.value;if(e)switch(e){case"rename":this.config.rename();break;case"edit_note":this.config.editNote();break;case"show_id":this._showTriggerId();break;case"duplicate":this.config.duplicate();break;case"copy":this.config.copy();break;case"cut":this.config.cut();break;case"paste":this.config.paste();break;case"toggle_yaml_mode":this._toggleYamlMode();break;case"disable":this.config.disable();break;case"delete":this.config.delete()}}constructor(...t){super(...t),this.isWide=!1,this.disabled=!1,this.yamlMode=!1,this.narrow=!1,this._requestShowId=!1,this._toggleYamlMode=()=>{(0,r.r)(this,"toggle-yaml-mode")},this._showTriggerId=()=>{this._requestShowId=!0}}}R.styles=[p.KC,p.Lt],(0,a.Cg)([(0,s.MZ)({attribute:!1})],R.prototype,"hass",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],R.prototype,"config",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,attribute:"wide"})],R.prototype,"isWide",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],R.prototype,"disabled",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,attribute:"yaml-mode"})],R.prototype,"yamlMode",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],R.prototype,"narrow",void 0),(0,a.Cg)([(0,s.MZ)({type:Number,attribute:"sidebar-key"})],R.prototype,"sidebarKey",void 0),(0,a.Cg)([(0,s.wk)()],R.prototype,"_requestShowId",void 0),(0,a.Cg)([(0,s.wk)()],R.prototype,"_warnings",void 0),(0,a.Cg)([(0,s.P)(".sidebar-editor")],R.prototype,"editor",void 0),R=(0,a.Cg)([(0,s.EM)("ha-automation-sidebar-trigger")],R),i()}catch(m){i(m)}})},38119:function(t,i,e){e.a(t,async function(t,a){try{e.d(i,{D:function(){return H}});e(89463),e(18111),e(61701),e(13579),e(62953);var o=e(40445),s=e(5124),n=e(67576),r=e(1087),d=e(60734),l=(e(76776),e(65829)),h=(e(3587),e(11399),e(8034),e(14503)),c=t([d,l]);[d,l]=c.then?(await c)():c;let p,u,g,v,m,b,y,f,w,$,_,C,M,A=t=>t;class H extends s.WF{firstUpdated(t){super.firstUpdated(t),this._getBlueprints()}get _blueprint(){if(this._blueprints)return this._blueprints[this._config.use_blueprint.path]}renderCard(){var t;const i=this._blueprint;let e=!0;return(0,s.qy)(p||(p=A` <ha-card outlined class="blueprint" .header="${0}"> <div class="blueprint-picker-container"> ${0} </div> ${0} </ha-card> `),this.hass.localize("ui.panel.config.automation.editor.blueprint.header"),this._blueprints?Object.keys(this._blueprints).length?(0,s.qy)(u||(u=A` <ha-blueprint-picker .hass="${0}" .label="${0}" .blueprints="${0}" .value="${0}" .disabled="${0}" @value-changed="${0}"></ha-blueprint-picker> `),this.hass,this.hass.localize("ui.panel.config.automation.editor.blueprint.blueprint_to_use"),this._blueprints,this._config.use_blueprint.path,this.disabled,this._blueprintChanged):this.hass.localize("ui.panel.config.automation.editor.blueprint.no_blueprints"):(0,s.qy)(g||(g=A`<ha-spinner></ha-spinner>`)),this._config.use_blueprint.path?i&&"error"in i?(0,s.qy)(v||(v=A`<p class="warning padding"> There is an error in this Blueprint: ${0} </p>`),i.error):(0,s.qy)(m||(m=A`${0} ${0}`),null!=i&&i.metadata.description?(0,s.qy)(b||(b=A`<ha-markdown class="card-content" breaks .content="${0}"></ha-markdown>`),i.metadata.description):"",null!=i&&null!==(t=i.metadata)&&void 0!==t&&t.input&&Object.keys(i.metadata.input).length?Object.entries(i.metadata.input).map(([t,i])=>{if(i&&"input"in i){const a=this._renderSection(t,i);return e=!1,a}const a=this._renderSettingRow(t,i,e);return e=!0,a}):(0,s.qy)(y||(y=A`<p class="padding"> ${0} </p>`),this.hass.localize("ui.panel.config.automation.editor.blueprint.no_inputs"))):"")}_renderSection(t,i){const e=(null==i?void 0:i.name)||t,a=i.input&&Object.values(i.input).some(t=>null===t||void 0===t.default),o=!i.collapsed||a;return(0,s.qy)(f||(f=A`<ha-expansion-panel outlined .expanded="${0}" .noCollapse="${0}"> ${0} <div slot="header" role="heading" aria-level="3" class="section-header"> <ha-markdown .content="${0}"></ha-markdown> </div> <div class="content"> ${0} ${0} </div> </ha-expansion-panel>`),o,a,null!=i&&i.icon?(0,s.qy)(w||(w=A` <ha-icon slot="leading-icon" class="section-header" .icon="${0}"></ha-icon> `),i.icon):s.s6,e,null!=i&&i.description?(0,s.qy)($||($=A`<ha-markdown .content="${0}"></ha-markdown>`),i.description):s.s6,i.input?Object.entries(i.input).map(([t,i])=>this._renderSettingRow(t,i,!0)):s.s6)}_renderSettingRow(t,i,e){var a;const o=null!==(a=null==i?void 0:i.selector)&&void 0!==a?a:{text:void 0};return(0,s.qy)(_||(_=A`<ha-settings-row .narrow="${0}" class="${0}"> <span slot="heading">${0}</span> <ha-markdown slot="description" class="card-content" breaks .content="${0}"></ha-markdown> ${0} </ha-settings-row>`),this.narrow,e?"border":"",(null==i?void 0:i.name)||t,null==i?void 0:i.description,(0,s.qy)(C||(C=A`<ha-selector narrow .hass="${0}" .selector="${0}" .key="${0}" .disabled="${0}" .required="${0}" .placeholder="${0}" .value="${0}" @value-changed="${0}"></ha-selector>`),this.hass,o,t,this.disabled,void 0===(null==i?void 0:i.default),null==i?void 0:i.default,this._config.use_blueprint.input&&t in this._config.use_blueprint.input?this._config.use_blueprint.input[t]:null==i?void 0:i.default,this._inputChanged))}_blueprintChanged(t){t.stopPropagation(),this._config.use_blueprint.path!==t.detail.value&&(0,r.r)(this,"value-changed",{value:Object.assign(Object.assign({},this._config),{},{use_blueprint:{path:t.detail.value}})})}_inputChanged(t){t.stopPropagation();const i=t.target,e=i.key,a=t.detail?t.detail.value:i.value;if(this._config.use_blueprint.input&&this._config.use_blueprint.input[e]===a||!this._config.use_blueprint.input&&""===a)return;const o=Object.assign(Object.assign({},this._config.use_blueprint.input),{},{[e]:a});(0,r.r)(this,"value-changed",{value:Object.assign(Object.assign({},this._config),{},{use_blueprint:Object.assign(Object.assign({},this._config.use_blueprint),{},{input:o})})})}static get styles(){return[h.RF,(0,s.AH)(M||(M=A`:host{display:block}ha-card.blueprint{margin:0 auto;margin-bottom:64px}.padding{padding:16px}.link-button-row{padding:14px}.blueprint-picker-container{padding:0 16px 16px}ha-blueprint-picker{display:block}h3{margin:16px}.introduction{margin-top:0;margin-bottom:12px}.introduction a{color:var(--primary-color)}p{margin-bottom:0}.description{margin-bottom:16px}ha-settings-row{--settings-row-content-width:100%;--settings-row-prefix-display:contents}ha-settings-row.border{border-top:1px solid var(--divider-color)}ha-expansion-panel{margin:8px;margin-left:8px;margin-right:8px}div.section-header{display:flex;vertical-align:middle}ha-icon.section-header{padding-right:10px}ha-alert{display:block;margin-bottom:16px}`))]}constructor(...t){super(...t),this.isWide=!1,this.disabled=!1,this.narrow=!1}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],H.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"is-wide",type:Boolean})],H.prototype,"isWide",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],H.prototype,"disabled",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],H.prototype,"narrow",void 0),(0,o.Cg)([(0,n.wk)()],H.prototype,"_blueprints",void 0),H=(0,o.Cg)([(0,n.EM)("blueprint-generic-editor")],H),a()}catch(p){a(p)}})},1404:function(t,i,e){e.a(t,async function(t,i){try{e(74423),e(84864),e(57465),e(27495),e(62953);var a=e(40445),o=e(5124),s=e(67576),n=e(22786),r=e(1087),d=e(80880),l=e(38962),h=e(52763),c=e(10763),p=e(14503),u=t([l,h,c]);[l,h,c]=u.then?(await u)():u;let g,v,m,b,y=t=>t;class f extends o.WF{render(){var t;const i=this._schema(),e=Object.assign(Object.assign({},this.field),{},{key:null!==(t=this._errorKey)&&void 0!==t?t:this.key}),a={[this.key]:this.field};return(0,o.qy)(g||(g=y` ${0} `),this.yamlMode?(0,o.qy)(v||(v=y`${0} <ha-yaml-editor .defaultValue="${0}" @value-changed="${0}"></ha-yaml-editor>`),this._yamlError?(0,o.qy)(m||(m=y`<ha-alert alert-type="error"> ${0} </ha-alert>`),this.hass.localize(`ui.panel.config.script.editor.field.${this._yamlError}`)):o.s6,a,this._onYamlChange):(0,o.qy)(b||(b=y`<ha-form .schema="${0}" .data="${0}" .error="${0}" .hass="${0}" .disabled="${0}" .computeLabel="${0}" .computeError="${0}" @value-changed="${0}"></ha-form>`),i,e,this._uiError,this.hass,this.disabled,this._computeLabelCallback,this._computeError,this._valueChanged))}_maybeSetKey(t){const i=t.name!==this.field.name,e=t.key!==this.key;if(!i||e)return;const a=this.field.name?(0,d.Y)(this.field.name):this.hass.localize("ui.panel.config.script.editor.field.field")||"field";if(new RegExp(`^${a}(_\\d)?$`).test(this.key)){let i=t.name?(0,d.Y)(t.name):this.hass.localize("ui.panel.config.script.editor.field.field")||"field";if(this.excludeKeys.includes(i)){let t,e=2;do{t=`${i}_${e}`,e++}while(this.excludeKeys.includes(t));i=t}t.key=i}}_valueChanged(t){t.stopPropagation();const i=Object.assign({},t.detail.value);var e;if(this._maybeSetKey(i),!i.key||this.excludeKeys.includes(i.key))return this._uiError=i.key?{key:"key_not_unique"}:{key:"key_not_null"},void(this._errorKey=null!==(e=i.key)&&void 0!==e?e:"");this._errorKey=void 0,this._uiError=void 0,Object.keys(this.field.selector)[0]!==Object.keys(i.selector)[0]&&delete i.default,(0,r.r)(this,"value-changed",{value:i})}_onYamlChange(t){t.stopPropagation();const i=Object.assign({},t.detail.value);if("object"!=typeof i||1!==Object.keys(i).length||!i[Object.keys(i)[0]]||!i[Object.keys(i)[0]].selector)return void(this._yamlError="yaml_error");const e=Object.keys(i)[0];if(this.excludeKeys.includes(e))return void(this._yamlError="key_not_unique");this._yamlError=void 0;const a=Object.assign(Object.assign({},i[e]),{},{key:e});(0,r.r)(this,"yaml-changed",{value:a})}constructor(...t){super(...t),this.excludeKeys=[],this.disabled=!1,this.yamlMode=!1,this._schema=(0,n.A)(()=>[{name:"name",selector:{text:{}}},{name:"key",selector:{text:{}}},{name:"required",selector:{boolean:{}}}]),this._computeLabelCallback=t=>this.hass.localize(`ui.panel.config.script.editor.field.${t.name}`),this._computeError=t=>this.hass.localize(`ui.panel.config.script.editor.field.${t}`)||t}}f.styles=p.RF,(0,a.Cg)([(0,s.MZ)({attribute:!1})],f.prototype,"hass",void 0),(0,a.Cg)([(0,s.MZ)()],f.prototype,"key",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],f.prototype,"excludeKeys",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],f.prototype,"field",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],f.prototype,"disabled",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,attribute:"yaml-mode"})],f.prototype,"yamlMode",void 0),(0,a.Cg)([(0,s.wk)()],f.prototype,"_uiError",void 0),(0,a.Cg)([(0,s.wk)()],f.prototype,"_yamlError",void 0),f=(0,a.Cg)([(0,s.EM)("ha-script-field-editor")],f),i()}catch(g){i(g)}})},50940:function(t,i,e){e.a(t,async function(t,i){try{e(74423),e(44114),e(18111),e(7588),e(62953);var a=e(40445),o=e(5124),s=e(67576),n=e(22786),r=e(1087),d=e(38962),l=e(52763),h=e(10763),c=e(84383),p=e(14503),u=e(57116),g=t([d,l,h]);[d,l,h]=g.then?(await g)():g;let v,m,b,y,f,w=t=>t;class $ extends o.WF{render(){const t=this._schema(this.field.selector),i={selector:this.field.selector,default:this.field.default};return(0,o.qy)(v||(v=w` ${0} `),this.yamlMode?(0,o.qy)(m||(m=w`${0} <ha-yaml-editor .defaultValue="${0}" @value-changed="${0}"></ha-yaml-editor>`),this._yamlError?(0,o.qy)(b||(b=w`<ha-alert alert-type="error"> ${0} </ha-alert>`),this.hass.localize(`ui.panel.config.script.editor.field.${this._yamlError}`)):o.s6,i,this._onYamlChange):(0,o.qy)(y||(y=w`<ha-form .schema="${0}" .data="${0}" .error="${0}" .hass="${0}" .disabled="${0}" .computeLabel="${0}" .computeError="${0}" @value-changed="${0}" .narrow="${0}"></ha-form>`),t,i,this._uiError,this.hass,this.disabled,this._computeLabelCallback,this._computeError,this._valueChanged,this.narrow))}_valueChanged(t){t.stopPropagation();const i=Object.assign({},t.detail.value);this._uiError=void 0,this.indent||Object.keys(this.field.selector)[0]===Object.keys(i.selector)[0]||(i.default=void 0),(0,r.r)(this,"value-changed",{value:i})}_onYamlChange(t){t.stopPropagation();const i=Object.assign({},t.detail.value);"object"==typeof i&&2===Object.keys(i).length?(0,r.r)(this,"yaml-changed",{value:i}):this._yamlError="yaml_error"}_getSelectorElements(){if(this._formElement){var t;const i=null===(t=this._formElement.shadowRoot)||void 0===t?void 0:t.querySelectorAll("ha-selector"),e=[];return null==i||i.forEach(t=>{var i;e.push(...Array.from((null===(i=t.shadowRoot)||void 0===i?void 0:i.querySelectorAll("ha-selector-condition, ha-selector-action"))||[]))}),e}return[]}expandAll(){this._getSelectorElements().forEach(t=>{var i;null===(i=t.expandAll)||void 0===i||i.call(t)})}collapseAll(){this._getSelectorElements().forEach(t=>{var i;null===(i=t.collapseAll)||void 0===i||i.call(t)})}static get styles(){return[p.RF,u.aM,(0,o.AH)(f||(f=w`:host([indent]) ha-form{display:block;margin-left:12px;padding:12px 20px 16px 16px;margin-right:-4px}`))]}constructor(...t){super(...t),this.narrow=!1,this.selected=!1,this.disabled=!1,this.indent=!1,this.yamlMode=!1,this._schema=(0,n.A)(t=>[...this.indent?[]:[{name:"selector",selector:{selector:{}}}],...!t||"object"!=typeof t||!this.indent&&c.W.includes(Object.keys(t)[0])?[]:[{name:"default",selector:this.indent?{[Object.keys(t)[0]]:Object.assign(Object.assign({},t[Object.keys(t)[0]]),{},{optionsInSidebar:!0})}:t}]]),this._computeLabelCallback=t=>{var i;return null!==(i=this.hass.localize(`ui.panel.config.script.editor.field.${t.name}`))&&void 0!==i?i:t.name},this._computeError=t=>this.hass.localize(`ui.panel.config.script.editor.field.${t}`)||t}}(0,a.Cg)([(0,s.MZ)({attribute:!1})],$.prototype,"hass",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],$.prototype,"field",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],$.prototype,"narrow",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],$.prototype,"selected",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],$.prototype,"disabled",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],$.prototype,"indent",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,attribute:"yaml-mode"})],$.prototype,"yamlMode",void 0),(0,a.Cg)([(0,s.wk)()],$.prototype,"_uiError",void 0),(0,a.Cg)([(0,s.wk)()],$.prototype,"_yamlError",void 0),(0,a.Cg)([(0,s.P)("ha-form")],$.prototype,"_formElement",void 0),$=(0,a.Cg)([(0,s.EM)("ha-script-field-selector-editor")],$),i()}catch(v){i(v)}})},48646:function(t,i,e){var a=e(69565),o=e(28551),s=e(1767),n=e(50851);t.exports=function(t,i){i&&"string"==typeof t||o(t);var e=n(t);return s(o(void 0!==e?a(e,t):t))}},78350:function(t,i,e){var a=e(46518),o=e(70259),s=e(79306),n=e(48981),r=e(26198),d=e(1469);a({target:"Array",proto:!0},{flatMap:function(t){var i,e=n(this),a=r(e);return s(t),i=d(e,0),o(i,e,e,a,0,1,t,arguments.length>1?arguments[1]:void 0),i}})},30237:function(t,i,e){e(6469)("flatMap")},30531:function(t,i,e){var a=e(46518),o=e(69565),s=e(79306),n=e(28551),r=e(1767),d=e(48646),l=e(19462),h=e(9539),c=e(96395),p=e(30684),u=e(84549);var g=!c&&!p("flatMap",function(){}),v=!c&&!g&&u("flatMap",TypeError),m=c||g||v||function(){try{var t=Iterator.prototype.flatMap.call(new Map([[4,5]]).entries(),function(t){return t});t.next(),t.return()}catch(i){return!0}}(),b=l(function(){for(var t,i,e=this.iterator,a=this.mapper;;){if(i=this.inner)try{if(!(t=n(o(i.next,i.iterator))).done)return t.value;this.inner=null}catch(s){h(e,"throw",s)}if(t=n(o(this.next,e)),this.done=!!t.done)return;try{this.inner=d(a(t.value,this.counter++),!1)}catch(s){h(e,"throw",s)}}});a({target:"Iterator",proto:!0,real:!0,forced:m},{flatMap:function(t){n(this);try{s(t)}catch(i){h(this,"throw",i)}return v?o(v,this,t):new b(r(this),{mapper:t,inner:null})}})},54495:function(t,i,e){e.d(i,{OA:function(){return a.OA},WL:function(){return a.WL},u$:function(){return a.u$}});var a=e(42017)}}]);