iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
16 lines • 55.7 kB
JavaScript
export const __rspack_esm_id=81969;export const __rspack_esm_ids=[81969];export const __webpack_modules__={69558(e,t,a){a.d(t,{_:()=>o});a(18111),a(7588);var i=a(5124),s=a(42017);const o=(0,s.u$)(class extends s.WL{update(e,[t,a]){return this._element&&this._element.localName===t?(a&&Object.entries(a).forEach(([e,t])=>{this._element[e]=t}),i.c0):this.render(t,a)}render(e,t){return this._element=document.createElement(e),t&&Object.entries(t).forEach(([e,t])=>{this._element[e]=t}),this._element}constructor(e){if(super(e),e.type!==s.OA.CHILD)throw new Error("dynamicElementDirective can only be used in content bindings")}})},69093(e,t,a){a.d(t,{t:()=>s});var i=a(71727);const s=e=>(0,i.m)(e.entity_id)},82286(e,t,a){a.d(t,{$:()=>i});const i=(e,t)=>s(e.attributes,t),s=(e,t)=>0!==(e.supported_features&t)},64481(e,t,a){a.d(t,{D:()=>s,J:()=>r});a(64979);let i=!1;try{i="true"===window.localStorage.getItem("disableViewTransition")}catch{}const s=e=>{i=e},o=e=>{if(!(e=>(e instanceof DOMException||e instanceof Error)&&"AbortError"===e.name)(e))throw e},r=e=>{if(!document.startViewTransition||i)return e(!1),Promise.resolve();let t=!1;try{const a=document.startViewTransition(()=>{t=!0,e(!0)});return a.ready.catch(o),a.finished.catch(o)}catch(a){return console.warn("View transition failed, falling back to direct execution.",a),t?Promise.reject(a):(e(!1),Promise.resolve())}}},93444(e,t,a){var i=a(62826),s=a(5124),o=a(22441);class r extends s.WF{render(){return s.qy` <footer> <slot name="secondaryAction"></slot> <slot name="primaryAction"></slot> </footer> `}static get styles(){return[s.AH`footer{display:flex;gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`]}}r=(0,i.Cg)([(0,o.EM)("ha-dialog-footer")],r)},76538(e,t,a){var i=a(62826),s=a(5124),o=a(22441);class r extends s.WF{render(){const e=s.qy`<div class="header-title"> <slot name="title"></slot> </div>`,t=s.qy`<div class="header-subtitle"> <slot name="subtitle"></slot> </div>`;return s.qy` <header class="header"> <div class="header-bar"> <section class="header-navigation-icon"> <slot name="navigationIcon"></slot> </section> <section class="header-content"> ${"above"===this.subtitlePosition?s.qy`${t}${e}`:s.qy`${e}${t}`} </section> <section class="header-action-items"> <slot name="actionItems"></slot> </section> </div> <slot></slot> </header> `}static get styles(){return[s.AH`:host{display:block}:host([show-border]){border-bottom:1px solid var(--mdc-dialog-scroll-divider-color,rgba(0,0,0,.12))}.header-bar{display:flex;flex-direction:row;align-items:center;padding:0 var(--ha-space-1);box-sizing:border-box}.header-content{flex:1;padding:10px var(--ha-space-1);display:flex;flex-direction:column;justify-content:center;min-height:var(--ha-space-12);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-title{height:var(--ha-dialog-header-title-height,calc(var(--ha-font-size-xl) + var(--ha-space-1)));font-size:var(--ha-font-size-xl);line-height:var(--ha-line-height-condensed);font-weight:var(--ha-font-weight-medium);color:var(--ha-dialog-header-title-color,var(--primary-text-color))}.header-subtitle{font-size:var(--ha-font-size-m);line-height:var(--ha-line-height-normal);color:var(--ha-dialog-header-subtitle-color,var(--secondary-text-color))}@media all and (min-width:450px) and (min-height:500px){.header-bar{padding:0 var(--ha-space-2)}}.header-navigation-icon{flex:none;min-width:var(--ha-space-2);height:100%;display:flex;flex-direction:row}.header-action-items{flex:none;min-width:var(--ha-space-2);height:100%;display:flex;flex-direction:row}`]}constructor(...e){super(...e),this.subtitlePosition="below",this.showBorder=!1}}(0,i.Cg)([(0,o.MZ)({type:String,attribute:"subtitle-position"})],r.prototype,"subtitlePosition",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,reflect:!0,attribute:"show-border"})],r.prototype,"showBorder",void 0),r=(0,i.Cg)([(0,o.EM)("ha-dialog-header")],r)},72554(e,t,a){a.a(e,async function(e,t){try{var i=a(62826),s=a(93900),o=a(35211),r=a(5124),n=a(22441),l=a(63672),d=a(1087),h=a(64481),c=a(22792),p=a(59992),u=a(14503),g=a(22348),m=(a(76538),a(26300)),_=e([s,m]);[s,m]=_.then?(await _)():_;const v="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";class b extends((0,p.V)(r.WF)){connectedCallback(){super.connectedCallback(),this.addEventListener("dialog-set-fullscreen",this._handleFullscreenChanged)}get scrollableElement(){return this.bodyContainer}updated(e){super.updated(e),e.has("open")&&(this._open=this.open)}render(){return r.qy` <wa-dialog .open="${this._open}" .lightDismiss="${!this.preventScrimClose}" without-header aria-labelledby="${(0,l.J)(this.ariaLabelledBy||(void 0!==this.headerTitle?"ha-dialog-title":void 0))}" aria-describedby="${(0,l.J)(this.ariaDescribedBy)}" @keydown="${this._handleKeyDown}" @wa-hide="${this._handleHide}" @wa-show="${this._handleShow}" @wa-after-show="${this._handleAfterShow}" @wa-after-hide="${this._handleAfterHide}"> ${this.withoutHeader?r.s6:r.qy`<slot name="header"> <ha-dialog-header .subtitlePosition="${this.headerSubtitlePosition}" .showBorder="${this._bodyScrolled}"> <slot name="headerNavigationIcon" slot="navigationIcon"> <ha-icon-button data-dialog="close" .label="${this._i18n?.localize?.("ui.common.close")??"Close"}" .path="${v}"></ha-icon-button> </slot> ${void 0!==this.headerTitle?r.qy`<span slot="title" class="title" id="ha-dialog-title"> ${this.headerTitle} </span>`:r.qy`<slot name="headerTitle" slot="title"></slot>`} ${void 0!==this.headerSubtitle?r.qy`<span slot="subtitle">${this.headerSubtitle}</span>`:r.qy`<slot name="headerSubtitle" slot="subtitle"></slot>`} <slot name="headerActionItems" slot="actionItems"></slot> </ha-dialog-header> </slot>`} <div class="content-wrapper"> <div class="body ha-scrollbar" @scroll="${this._handleBodyScroll}"> <slot></slot> </div> ${this.renderScrollableFades()} </div> <slot name="footer" slot="footer"></slot> </wa-dialog> `}disconnectedCallback(){this.removeEventListener("dialog-set-fullscreen",this._handleFullscreenChanged),this._setFullscreen(!1),super.disconnectedCallback(),this._open=!1}_handleFullscreenChanged(e){this._open?(0,h.J)(()=>{this._setFullscreen(e.detail)}):this._setFullscreen(e.detail)}_setFullscreen(e){this.toggleAttribute("fullscreen",e)}_handleBodyScroll(e){this._bodyScrolled=e.target.scrollTop>0}_handleKeyDown(e){"Escape"===e.key&&(this._escapePressed=!0,this.preventScrimClose&&e.preventDefault(),e.stopPropagation(),e.currentTarget.open=!1)}_handleHide(e){const t=e.detail?.source===e.target.dialog;this.preventScrimClose&&this._escapePressed&&t&&e.preventDefault(),this._escapePressed=!1}static get styles(){return[...super.styles,u.dp,r.AH`wa-dialog{--full-width:var(
--ha-dialog-width-full,
min(95vw, var(--safe-width))
);--width:min(var(--ha-dialog-width-md, 580px), var(--full-width));--spacing:var(--dialog-content-padding, var(--ha-space-6));--show-duration:var(--ha-dialog-show-duration, 200ms);--hide-duration:var(--ha-dialog-hide-duration, 200ms);--wa-color-surface-raised:var(
--ha-dialog-surface-background,
var(--card-background-color, var(--ha-color-surface-default))
);--wa-panel-border-radius:var(
--ha-dialog-border-radius,
var(--ha-border-radius-3xl)
);max-width:var(--ha-dialog-max-width,var(--safe-width))}@media (prefers-reduced-motion:reduce){wa-dialog{--show-duration:0ms;--hide-duration:0ms}}:host([width=small]) wa-dialog{--width:min(var(--ha-dialog-width-sm, 320px), var(--full-width))}:host([width=large]) wa-dialog{--width:min(var(--ha-dialog-width-lg, 1024px), var(--full-width))}:host([fullscreen]) wa-dialog,:host([width=full]) wa-dialog{--width:var(--full-width)}:host([fullscreen]) wa-dialog::part(dialog){min-height:var(--safe-height);max-height:var(--safe-height);margin-top:0;transform:none}:host([fullscreen]) .content-wrapper{overflow:hidden}:host([fullscreen]) .body{overflow:hidden;padding:0}wa-dialog::part(dialog){-webkit-backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);box-shadow:var(--dialog-box-shadow,var(--wa-shadow-l));color:var(--primary-text-color);min-width:var(--width,var(--full-width));max-width:var(--width,var(--full-width));max-height:var(--ha-dialog-max-height,calc(var(--safe-height) - var(--ha-space-20)));min-height:var(--ha-dialog-min-height);margin-top:var(--dialog-surface-margin-top,auto);transform:translate(calc(var(--safe-area-offset-left,0px) - var(--safe-area-offset-right,0px)),calc(var(--safe-area-offset-top,0px) - var(--safe-area-offset-bottom,0px)));display:flex;flex-direction:column;overflow:hidden}wa-dialog::part(dialog)::backdrop{-webkit-backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));background-color:var(--mdc-dialog-scrim-color,none)}@media all and (max-width:450px),all and (max-height:500px){:host([type=standard]){--ha-dialog-border-radius:0}:host([type=standard]) wa-dialog{--full-width:var(--ha-dialog-width-full, 100vw);--width:var(--full-width)}:host([type=standard]) wa-dialog::part(dialog){min-height:var(--ha-dialog-min-height,100vh);min-height:var(--ha-dialog-min-height,100dvh);max-height:var(--ha-dialog-max-height,100vh);max-height:var(--ha-dialog-max-height,100dvh);margin-top:0;margin-bottom:0;padding-top:var(--safe-area-inset-top);padding-bottom:var(--safe-area-inset-bottom);padding-left:var(--safe-area-inset-left);padding-right:var(--safe-area-inset-right);transform:none}}.header-title-container{display:flex;align-items:center}.header-title{margin:0;margin-bottom:0;color:var(--ha-dialog-header-title-color,var(--primary-text-color));font-size:var(
--ha-dialog-header-title-font-size,
var(--ha-font-size-2xl)
);line-height:var(
--ha-dialog-header-title-line-height,
var(--ha-line-height-condensed)
);font-weight:var(--ha-dialog-header-title-font-weight,var(--ha-font-weight-normal));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-right:var(--ha-space-3)}wa-dialog::part(body){padding:0;display:flex;flex-direction:column;max-width:100%;overflow:hidden}.content-wrapper{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.body{position:var(--dialog-content-position,relative);padding:var(--dialog-content-padding,0 var(--ha-space-6) var(--ha-space-6) var(--ha-space-6));overflow:auto;flex-grow:1}:host([flexcontent]) .body{max-width:100%;flex:1;display:flex;flex-direction:column}wa-dialog::part(footer){padding:0}::slotted([slot=footer]){display:flex;padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4) var(--ha-space-4);gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`]}constructor(...e){super(...e),this.open=!1,this.type="standard",this.width="medium",this.preventScrimClose=!1,this.headerSubtitlePosition="below",this.flexContent=!1,this.withoutHeader=!1,this._open=!1,this._bodyScrolled=!1,this._escapePressed=!1,this._handleShow=async e=>{e.eventPhase===Event.AT_TARGET&&(this._open=!0,(0,d.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{if(this._hassConfig?.auth.external&&(0,g.V)(this._hassConfig.auth.external)){const e=this.querySelector("[autofocus]");return void(null!==e&&(e.id||(e.id="ha-dialog-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:e.id}})))}this.querySelector("[autofocus]")?.focus()}))},this._handleAfterShow=e=>{e.eventPhase===Event.AT_TARGET&&(0,d.r)(this,"after-show")},this._handleAfterHide=e=>{e.eventPhase===Event.AT_TARGET&&(this._open=!1,this._setFullscreen(!1),(0,d.r)(this,"closed"))}}}(0,i.Cg)([(0,n.MZ)({attribute:"aria-labelledby"})],b.prototype,"ariaLabelledBy",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"aria-describedby"})],b.prototype,"ariaDescribedBy",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],b.prototype,"open",void 0),(0,i.Cg)([(0,n.MZ)({reflect:!0})],b.prototype,"type",void 0),(0,i.Cg)([(0,n.MZ)({type:String,reflect:!0,attribute:"width"})],b.prototype,"width",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],b.prototype,"preventScrimClose",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"header-title"})],b.prototype,"headerTitle",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"header-subtitle"})],b.prototype,"headerSubtitle",void 0),(0,i.Cg)([(0,n.MZ)({type:String,attribute:"header-subtitle-position"})],b.prototype,"headerSubtitlePosition",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],b.prototype,"flexContent",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"without-header"})],b.prototype,"withoutHeader",void 0),(0,i.Cg)([(0,n.wk)()],b.prototype,"_open",void 0),(0,i.Cg)([(0,n.P)(".body")],b.prototype,"bodyContainer",void 0),(0,i.Cg)([(0,n.wk)(),(0,o.Fg)({context:c.D5,subscribe:!0})],b.prototype,"_i18n",void 0),(0,i.Cg)([(0,n.wk)(),(0,o.Fg)({context:c.WF,subscribe:!0})],b.prototype,"_hassConfig",void 0),(0,i.Cg)([(0,n.wk)()],b.prototype,"_bodyScrolled",void 0),(0,i.Cg)([(0,n.Ls)({passive:!0})],b.prototype,"_handleBodyScroll",null),b=(0,i.Cg)([(0,n.EM)("ha-dialog")],b),t()}catch(e){t(e)}})},52763(e,t,a){a.a(e,async function(e,i){try{a.d(t,{U:()=>m});a(74423),a(18111),a(7588),a(61701);var s=a(62826),o=a(5124),r=a(22441),n=a(69558),l=a(1087),d=a(38962),h=(a(11399),e([d]));d=(h.then?(await h)():h)[0];const c={boolean:()=>a.e(81347).then(a.bind(a,46990)),constant:()=>a.e(65733).then(a.bind(a,90820)),float:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(51868),a.e(27585)]).then(a.bind(a,20676)),grid:()=>a.e(60761).then(a.bind(a,70208)),expandable:()=>a.e(45001).then(a.bind(a,40003)),integer:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(21543),a.e(86712),a.e(49985)]).then(a.bind(a,20036)),multi_select:()=>Promise.all([a.e(4801),a.e(39763),a.e(46095),a.e(34995),a.e(80131),a.e(58303),a.e(71739),a.e(24407)]).then(a.bind(a,36182)),positive_time_period_dict:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(34995),a.e(67943),a.e(16508),a.e(85462)]).then(a.bind(a,89422)),select:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(34995),a.e(3283),a.e(81034),a.e(99463),a.e(26092),a.e(4809)]).then(a.bind(a,63804)),string:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(84725),a.e(95926)]).then(a.bind(a,54753)),optional_actions:()=>Promise.all([a.e(4801),a.e(39763),a.e(34995),a.e(85351)]).then(a.bind(a,8456))},p=(e,t)=>e?!t.name||t.flatten?e:e[t.name]:void 0,u=(e,t)=>e&&t.name?e[t.name]:null,g=(e,t)=>e&&t.name?e[t.name]:null;class m extends o.WF{getFormProperties(){return{}}reportValidity(){const e=this._root;if(!e)return!0;const t=[...e.children].filter(e=>"ha-alert"!==e.localName);let a,i=!0;return this.schema.forEach((e,s)=>{const o=t[s];if(!o)return;let r=!0;if("reportValidity"in o&&"function"==typeof o.reportValidity)r=o.reportValidity();else if(e.required&&(!("type"in e)||!["boolean","constant"].includes(e.type??""))&&(!("selector"in e)||!("boolean"in e.selector)&&!("constant"in e.selector))){const t=p(this.data,e);r=null!=t&&""!==t}r||(i=!1,a||(a=o))}),a&&a.focus?.(),i}willUpdate(e){e.has("schema")&&this.schema&&this.schema.forEach(e=>{"selector"in e||c[e.type]?.()})}render(){return o.qy` <div class="root" part="root"> ${this.error&&this.error.base?o.qy` <ha-alert alert-type="error"> ${this._computeError(this.error.base,this.schema)} </ha-alert> `:""} ${this.schema.map(e=>{const t=u(this.error,e),a=g(this.warning,e);return o.qy` ${t?o.qy` <ha-alert own-margin alert-type="error"> ${this._computeError(t,e)} </ha-alert> `:a?o.qy` <ha-alert own-margin alert-type="warning"> ${this._computeWarning(a,e)} </ha-alert> `:""} ${"selector"in e?o.qy`<ha-selector .schema="${e}" .hass="${this.hass}" .narrow="${this.narrow}" .name="${e.name}" .selector="${e.selector}" .value="${p(this.data,e)}" .label="${this._computeLabel(e,this.data)}" .disabled="${e.disabled||this.disabled||!1}" .placeholder="${e.required?void 0:e.default}" .helper="${this._computeHelper(e)}" .localizeValue="${this.localizeValue}" .required="${e.required||!1}" .context="${this._generateContext(e)}"></ha-selector>`:(0,n._)(this.fieldElementName(e.type),{schema:e,data:p(this.data,e),label:this._computeLabel(e,this.data),helper:this._computeHelper(e),disabled:this.disabled||e.disabled||!1,hass:this.hass,localize:this.hass?.localize,computeLabel:this.computeLabel,computeHelper:this.computeHelper,localizeValue:this.localizeValue,context:this._generateContext(e),...this.getFormProperties()})} `})} </div> `}fieldElementName(e){return`ha-form-${e}`}_generateContext(e){if(!e.context&&!this.context)return;const t={...this.context};if(e.context)for(const[a,i]of Object.entries(e.context))t[a]=this.data[i];return t}createRenderRoot(){const e=super.createRenderRoot();return this.addValueChangedListener(e),e}addValueChangedListener(e){e.addEventListener("value-changed",e=>{e.stopPropagation();const t=e.target.schema;if(e.target===this)return;const a=!t.name||"flatten"in t&&t.flatten?e.detail.value:{[t.name]:e.detail.value};this.data={...this.data,...a},(0,l.r)(this,"value-changed",{value:this.data})})}_computeLabel(e,t){return this.computeLabel?this.computeLabel(e,t):e?e.name:""}_computeHelper(e){return this.computeHelper?this.computeHelper(e):""}_computeError(e,t){return Array.isArray(e)?o.qy`<ul> ${e.map(e=>o.qy`<li> ${this.computeError?this.computeError(e,t):e} </li>`)} </ul>`:this.computeError?this.computeError(e,t):e}_computeWarning(e,t){return this.computeWarning?this.computeWarning(e,t):e}constructor(...e){super(...e),this.narrow=!1,this.disabled=!1}}m.shadowRootOptions={mode:"open",delegatesFocus:!0},m.styles=o.AH`.root>*{display:block}.root>:not([own-margin]):not(:last-child){margin-bottom:24px}ha-alert[own-margin]{margin-bottom:4px}`,(0,s.Cg)([(0,r.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean})],m.prototype,"narrow",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],m.prototype,"data",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],m.prototype,"schema",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],m.prototype,"error",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],m.prototype,"warning",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean})],m.prototype,"disabled",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],m.prototype,"computeError",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],m.prototype,"computeWarning",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],m.prototype,"computeLabel",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],m.prototype,"computeHelper",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],m.prototype,"localizeValue",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],m.prototype,"context",void 0),(0,s.Cg)([(0,r.P)(".root")],m.prototype,"_root",void 0),m=(0,s.Cg)([(0,r.EM)("ha-form")],m),i()}catch(e){i(e)}})},11399(e,t,a){a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);var i=a(62826),s=a(5124),o=a(22441),r=a(22786),n=a(69558),l=a(95311);const d={action:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(34995),a.e(3283),a.e(80131),a.e(72130),a.e(85010),a.e(67218),a.e(58416),a.e(58303),a.e(81034),a.e(16787),a.e(54066),a.e(25950),a.e(14421),a.e(86475),a.e(26092),a.e(8851),a.e(34310),a.e(90790),a.e(12009),a.e(20282),a.e(90577),a.e(16508),a.e(48531),a.e(91123),a.e(31863),a.e(283),a.e(30513),a.e(86618)]).then(a.bind(a,6274)),addon:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(3283),a.e(26787),a.e(26092),a.e(45386),a.e(43305)]).then(a.bind(a,36784)),automation_behavior:()=>Promise.all([a.e(4801),a.e(81034),a.e(82416)]).then(a.bind(a,66034)),app:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(3283),a.e(26787),a.e(26092),a.e(45386)]).then(a.bind(a,48585)),area:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(3283),a.e(83523),a.e(26092),a.e(40404)]).then(a.bind(a,81857)),areas_display:()=>Promise.all([a.e(46095),a.e(64657),a.e(68273),a.e(64280),a.e(32838)]).then(a.bind(a,38235)),attribute:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(3283),a.e(49168),a.e(26092),a.e(67471)]).then(a.bind(a,71498)),assist_pipeline:()=>Promise.all([a.e(4801),a.e(39763),a.e(46095),a.e(34995),a.e(43048),a.e(30195)]).then(a.bind(a,83642)),boolean:()=>Promise.all([a.e(93282),a.e(19623)]).then(a.bind(a,30714)),choose:()=>a.e(93934).then(a.bind(a,58141)),color_rgb:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(7106),a.e(31524)]).then(a.bind(a,34931)),condition:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(34995),a.e(3283),a.e(72130),a.e(85010),a.e(67218),a.e(16787),a.e(54066),a.e(25950),a.e(91095),a.e(26092),a.e(8851),a.e(34310),a.e(12009),a.e(20282),a.e(90577),a.e(48531),a.e(91123),a.e(283),a.e(60066)]).then(a.bind(a,81539)),config_entry:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(3283),a.e(8706),a.e(26092),a.e(8851),a.e(36830)]).then(a.bind(a,49347)),conversation_agent:()=>Promise.all([a.e(4801),a.e(39763),a.e(46095),a.e(34995),a.e(20667),a.e(66896)]).then(a.bind(a,94215)),constant:()=>a.e(77057).then(a.bind(a,39032)),country:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(3283),a.e(84887),a.e(65799),a.e(26092),a.e(40489),a.e(45262)]).then(a.bind(a,94164)),date:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(81484),a.e(93993)]).then(a.bind(a,94351)),datetime:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(34995),a.e(95366),a.e(78229)]).then(a.bind(a,39045)),device:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(3283),a.e(16787),a.e(93162),a.e(26092),a.e(90577),a.e(90606)]).then(a.bind(a,2270)),duration:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(34995),a.e(90324),a.e(16508),a.e(21082)]).then(a.bind(a,79488)),entity:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(3283),a.e(69923),a.e(26092),a.e(8851),a.e(1535),a.e(34682)]).then(a.bind(a,73863)),entity_name:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(3283),a.e(80607),a.e(26092),a.e(85852)]).then(a.bind(a,7563)),statistic:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(3283),a.e(7390),a.e(26092),a.e(8851),a.e(54884),a.e(98206)]).then(a.bind(a,28072)),file:()=>Promise.all([a.e(4801),a.e(80764)]).then(a.bind(a,25078)),floor:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(3283),a.e(89100),a.e(54192),a.e(26092),a.e(93e3),a.e(55619)]).then(a.bind(a,9040)),label:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(3283),a.e(79808),a.e(26092),a.e(66201),a.e(58397)]).then(a.bind(a,99560)),language:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(3283),a.e(82025),a.e(26092),a.e(60293)]).then(a.bind(a,15430)),navigation:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(34995),a.e(3283),a.e(83113),a.e(99788),a.e(66716),a.e(54066),a.e(68077),a.e(26092),a.e(8851),a.e(19112),a.e(30002),a.e(59704),a.e(25322),a.e(89747),a.e(59532),a.e(52487),a.e(12009),a.e(20282),a.e(48531),a.e(79767),a.e(74942)]).then(a.bind(a,58350)),number:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(21543),a.e(4162)]).then(a.bind(a,31157)),numeric_threshold:()=>Promise.all([a.e(4801),a.e(39763),a.e(46095),a.e(34995),a.e(88992),a.e(50616)]).then(a.bind(a,18719)),object:()=>Promise.all([a.e(4801),a.e(39763),a.e(46095),a.e(72130),a.e(85010),a.e(42981),a.e(34310),a.e(46660)]).then(a.bind(a,97951)),period:()=>a.e(54234).then(a.bind(a,40929)),qr_code:()=>Promise.all([a.e(4801),a.e(51343),a.e(15251)]).then(a.bind(a,35313)),select:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(34995),a.e(3283),a.e(81034),a.e(26092),a.e(56629)]).then(a.bind(a,856)),selector:()=>a.e(77810).then(a.bind(a,13897)),serial_port:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(3283),a.e(68432),a.e(26092),a.e(90587)]).then(a.bind(a,82178)),state:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(3283),a.e(38809),a.e(26092),a.e(42684)]).then(a.bind(a,12995)),backup_location:()=>Promise.all([a.e(4801),a.e(39763),a.e(46095),a.e(34995),a.e(80131),a.e(83241),a.e(61757)]).then(a.bind(a,16360)),stt:()=>Promise.all([a.e(4801),a.e(39763),a.e(46095),a.e(34995),a.e(98286),a.e(15424)]).then(a.bind(a,42999)),target:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(3283),a.e(35040),a.e(26092),a.e(8851),a.e(33758),a.e(8697),a.e(8955),a.e(17509)]).then(a.bind(a,84909)),template:()=>Promise.all([a.e(4801),a.e(39763),a.e(72130),a.e(33387),a.e(34310),a.e(82770)]).then(a.bind(a,62166)),text:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(37694),a.e(67988)]).then(a.bind(a,47971)),time:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(34995),a.e(92351),a.e(67766)]).then(a.bind(a,42945)),icon:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(3283),a.e(86325),a.e(26092),a.e(8851),a.e(79768)]).then(a.bind(a,14885)),media:()=>Promise.all([a.e(4801),a.e(26295),a.e(91845),a.e(32376)]).then(a.bind(a,59422)),theme:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(3283),a.e(4406),a.e(26092),a.e(76696)]).then(a.bind(a,77655)),timezone:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(3283),a.e(56253),a.e(12727),a.e(26092),a.e(49386)]).then(a.bind(a,6719)),button_toggle:()=>a.e(7774).then(a.bind(a,79949)),trigger:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(34995),a.e(3283),a.e(80131),a.e(72130),a.e(85010),a.e(67218),a.e(58303),a.e(81034),a.e(16787),a.e(54066),a.e(25950),a.e(24906),a.e(26092),a.e(8851),a.e(34310),a.e(12009),a.e(20282),a.e(90577),a.e(48531),a.e(91123),a.e(31863),a.e(60597)]).then(a.bind(a,45078)),tts:()=>Promise.all([a.e(4801),a.e(39763),a.e(46095),a.e(34995),a.e(75905),a.e(85344)]).then(a.bind(a,59447)),tts_voice:()=>Promise.all([a.e(4801),a.e(39763),a.e(46095),a.e(34995),a.e(53524),a.e(98913)]).then(a.bind(a,41188)),location:()=>Promise.all([a.e(4801),a.e(87451),a.e(46146),a.e(8851),a.e(12122),a.e(78146),a.e(8740)]).then(a.bind(a,21160)),color_temp:()=>Promise.all([a.e(4801),a.e(39763),a.e(99788),a.e(21543),a.e(29628),a.e(59704),a.e(20282),a.e(42655)]).then(a.bind(a,90780)),ui_action:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(34995),a.e(3283),a.e(72130),a.e(85010),a.e(83113),a.e(58416),a.e(99788),a.e(66716),a.e(54066),a.e(25950),a.e(96529),a.e(26092),a.e(8851),a.e(19112),a.e(34310),a.e(30002),a.e(59704),a.e(25322),a.e(90790),a.e(89747),a.e(59532),a.e(52487),a.e(36332),a.e(12009),a.e(20282),a.e(48531),a.e(79767),a.e(80014)]).then(a.bind(a,38389)),ui_color:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(3283),a.e(46051),a.e(26092),a.e(78043)]).then(a.bind(a,52744)),ui_state_content:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(3283),a.e(8282),a.e(26092),a.e(52481)]).then(a.bind(a,96074))},h=new Set(["ui-action","ui-color"]);class c extends s.WF{reportValidity(){return this._selectorElement&&"reportValidity"in this._selectorElement&&"function"==typeof this._selectorElement.reportValidity?this._selectorElement?.reportValidity()??!0:!this.required||void 0!==this.value&&null!==this.value&&""!==this.value}async focus(){await this.updateComplete,this._selectorElement?.focus()}get _type(){const e=Object.keys(this.selector)[0];return h.has(e)?e.replace("-","_"):e}willUpdate(e){e.has("selector")&&this.selector&&d[this._type]?.()}render(){return s.qy` ${(0,n._)(`ha-selector-${this._type}`,{hass:this.hass,narrow:this.narrow,name:this.name,selector:this._handleLegacySelector(this.selector),value:this.value,label:this.label,placeholder:this.placeholder,disabled:this.disabled,required:this.required,helper:this.helper,context:this.context,localizeValue:this.localizeValue,id:"selector"})} `}constructor(...e){super(...e),this.narrow=!1,this.disabled=!1,this.required=!0,this._handleLegacySelector=(0,r.A)(e=>{if("entity"in e)return(0,l.UU)(e);if("device"in e)return(0,l.tD)(e);const t=Object.keys(this.selector)[0];return h.has(t)?{[t.replace("-","_")]:e[t]}:e})}}(0,i.Cg)([(0,o.MZ)({attribute:!1})],c.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],c.prototype,"narrow",void 0),(0,i.Cg)([(0,o.MZ)()],c.prototype,"name",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],c.prototype,"selector",void 0),(0,i.Cg)([(0,o.MZ)()],c.prototype,"value",void 0),(0,i.Cg)([(0,o.MZ)()],c.prototype,"label",void 0),(0,i.Cg)([(0,o.MZ)()],c.prototype,"helper",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],c.prototype,"localizeValue",void 0),(0,i.Cg)([(0,o.MZ)()],c.prototype,"placeholder",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],c.prototype,"disabled",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],c.prototype,"required",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],c.prototype,"context",void 0),(0,i.Cg)([(0,o.P)("#selector",!0)],c.prototype,"_selectorElement",void 0),c=(0,i.Cg)([(0,o.EM)("ha-selector")],c)},95311(e,t,a){a.d(t,{DF:()=>u,Lo:()=>f,MH:()=>d,MM:()=>g,Qz:()=>p,Ru:()=>_,UU:()=>v,_7:()=>c,bZ:()=>h,m0:()=>l,tD:()=>b,vX:()=>m,wY:()=>y});a(74423),a(44114),a(18111),a(22489),a(30531),a(7588),a(13579),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);var i=a(44537),s=a(69093),o=a(82286),r=a(24367),n=a(58594);const l=(e,t,a,i,s,o,r)=>{const n=[],l=[],d=[];return Object.values(a).forEach(a=>{a.labels.includes(t)&&p(e,s,i,a.area_id,o,r)&&d.push(a.area_id)}),Object.values(i).forEach(a=>{a.labels.includes(t)&&u(e.states,Object.values(s),a,o,r)&&l.push(a.id)}),Object.values(s).forEach(a=>{a.labels.includes(t)&&g(e.states[a.entity_id],o,r)&&n.push(a.entity_id)}),{areas:d,devices:l,entities:n}},d=(e,t,a,i,s)=>{const o=[];return Object.values(a).forEach(a=>{a.floor_id===t&&p(e,e.entities,e.devices,a.area_id,i,s)&&o.push(a.area_id)}),{areas:o}},h=(e,t,a,i,s,o)=>{const r=[],n=[];return Object.values(a).forEach(a=>{a.area_id===t&&u(e.states,Object.values(i),a,s,o)&&n.push(a.id)}),Object.values(i).forEach(a=>{a.area_id===t&&g(e.states[a.entity_id],s,o)&&r.push(a.entity_id)}),{devices:n,entities:r}},c=(e,t,a,i,s)=>{const o=[];return Object.values(a).forEach(a=>{a.device_id===t&&g(e.states[a.entity_id],i,s)&&o.push(a.entity_id)}),{entities:o}},p=(e,t,a,i,s,o)=>!!Object.values(a).some(a=>!(a.area_id!==i||!u(e.states,Object.values(t),a,s,o)))||Object.values(t).some(t=>!(t.area_id!==i||!g(e.states[t.entity_id],s,o))),u=(e,t,a,s,o)=>{const r=o?(0,n.fk)(o,t):void 0;if(s.target?.device&&!(0,i.e)(s.target.device).some(e=>m(e,a,r)))return!1;if(s.target?.entity){return t.filter(e=>e.device_id===a.id).some(t=>{const a=e[t.entity_id];return g(a,s,o)})}return!0},g=(e,t,a)=>!!e&&(!t.target?.entity||(0,i.e)(t.target.entity).some(t=>_(t,e,a))),m=(e,t,a)=>{const{manufacturer:i,model:s,model_id:o,integration:r}=e;return(!i||t.manufacturer===i)&&((!s||t.model===s)&&((!o||t.model_id===o)&&!(r&&a&&!a?.[t.id]?.has(r))))},_=(e,t,a)=>{const{domain:r,device_class:n,supported_features:l,unit_of_measurement:d,integration:h}=e;if(r){const e=(0,s.t)(t);if(Array.isArray(r)?!r.includes(e):e!==r)return!1}if(n){const e=t.attributes.device_class;if(e&&Array.isArray(n)?!n.includes(e):e!==n)return!1}if(l&&!(0,i.e)(l).some(e=>(0,o.$)(t,e)))return!1;if(d){const e=t.attributes.unit_of_measurement;if(!e||(Array.isArray(d)?!d.includes(e):e!==d))return!1}return!h||a?.[t.entity_id]?.domain===h},v=e=>{if(!e.entity)return{entity:null};if("filter"in e.entity)return e;const{domain:t,integration:a,device_class:i,...s}=e.entity;return t||a||i?{entity:{...s,filter:{domain:t,integration:a,device_class:i}}}:{entity:s}},b=e=>{if(!e.device)return{device:null};if("filter"in e.device)return e;const{integration:t,manufacturer:a,model:i,...s}=e.device;return t||a||i?{device:{...s,filter:{integration:t,manufacturer:a,model:i}}}:{device:s}},f=e=>{let t;if("target"in e)t=(0,i.e)(e.target?.entity);else if("entity"in e){if(e.entity?.include_entities)return;t=(0,i.e)(e.entity?.filter)}if(!t)return;const a=t.flatMap(e=>e.integration||e.device_class||e.supported_features||!e.domain?[]:(0,i.e)(e.domain).filter(e=>(0,r.z)(e)));return[...new Set(a)]},y=(e,t,a,s,o,r={target:{}})=>{if(!t)return[];const n=new Set((0,i.e)(t.entity_id)),p=new Set((0,i.e)(t.device_id)),u=new Set((0,i.e)(t.area_id)),g=new Set((0,i.e)(t.floor_id));return new Set((0,i.e)(t.label_id)).forEach(t=>{const i=l(e,t,o,s,a,r);i.devices.forEach(e=>p.add(e)),i.entities.forEach(e=>n.add(e)),i.areas.forEach(e=>u.add(e))}),g.forEach(t=>{d(e,t,o,r).areas.forEach(e=>u.add(e))}),u.forEach(t=>{const i=h(e,t,s,a,r);i.devices.forEach(e=>p.add(e)),i.entities.forEach(e=>n.add(e))}),p.forEach(t=>{c(e,t,a,r).entities.forEach(e=>n.add(e))}),Array.from(n)}},81569(e,t,a){a.d(t,{$:()=>i});const i=(e,t)=>e.callWS({type:"wake_word/info",entity_id:t})},58947(e,t,a){a.d(t,{a:()=>o});var i=a(1087);const s=()=>a.e(62756).then(a.bind(a,12911)),o=(e,t)=>{(0,i.r)(e,"show-dialog",{addHistory:!1,dialogTag:"dialog-tts-try",dialogImport:s,dialogParams:t})}},59992(e,t,a){a.d(t,{V:()=>l});var i=a(62826),s=a(88696),o=a(5124),r=a(6412),n=a(22441);const l=e=>{class t extends e{get scrollableElement(){return t.DEFAULT_SCROLLABLE_ELEMENT}firstUpdated(e){super.firstUpdated?.(e),this.scrollableElement&&this._updateScrollableState(this.scrollableElement),this._attachScrollableElement()}updated(e){super.updated?.(e),this._attachScrollableElement()}disconnectedCallback(){this._detachScrollableElement(),this._contentScrolled=!1,this._contentScrollable=!1,super.disconnectedCallback()}renderScrollableFades(e=!1){return o.qy` <div class="${(0,r.H)({"fade-top":!0,rounded:e,visible:this._contentScrolled})}"></div> <div class="${(0,r.H)({"fade-bottom":!0,rounded:e,visible:this._contentScrollable})}"></div> `}static get styles(){const e=Object.getPrototypeOf(this);var t;return[...void 0===(t=e?.styles??[])?[]:Array.isArray(t)?t:[t],o.AH`.fade-bottom,.fade-top{position:absolute;left:0;right:0;height:var(--ha-space-2);pointer-events:none;transition:opacity 180ms ease-in-out;border-radius:var(--ha-border-radius-square);opacity:0;background:linear-gradient(to bottom,var(--ha-color-shadow-scrollable-fade),transparent)}.fade-top{top:0}.fade-bottom{bottom:0;transform:rotate(180deg)}.fade-bottom.visible,.fade-top.visible{opacity:1}.fade-bottom.rounded,.fade-top.rounded{border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}.fade-top.rounded{border-top-left-radius:var(--ha-border-radius-square);border-top-right-radius:var(--ha-border-radius-square)}.fade-bottom.rounded{border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}`]}_attachScrollableElement(){const e=this.scrollableElement;e!==this._scrollTarget&&(this._detachScrollableElement(),e&&(this._scrollTarget=e,e.addEventListener("scroll",this._onScroll,{passive:!0}),this._resize.observe(e),this._updateScrollableState(e)))}_detachScrollableElement(){this._scrollTarget&&(this._scrollTarget.removeEventListener("scroll",this._onScroll),this._resize.unobserve?.(this._scrollTarget),this._scrollTarget=void 0)}_updateScrollableState(e){const t=parseFloat(getComputedStyle(e).getPropertyValue("--safe-area-inset-bottom"))||0,{scrollHeight:a=0,clientHeight:i=0,scrollTop:s=0}=e;this._contentScrollable=a-i>s+t+this.scrollFadeSafeAreaPadding}constructor(...e){super(...e),this._contentScrolled=!1,this._contentScrollable=!1,this._onScroll=e=>{const t=e.currentTarget;this._contentScrolled=(t.scrollTop??0)>this.scrollFadeThreshold,this._updateScrollableState(t)},this._resize=new s.P(this,{target:null,callback:e=>{const t=e[0]?.target;t&&this._updateScrollableState(t)}}),this.scrollFadeSafeAreaPadding=4,this.scrollFadeThreshold=4}}return t.DEFAULT_SCROLLABLE_ELEMENT=null,(0,i.Cg)([(0,n.wk)()],t.prototype,"_contentScrolled",void 0),(0,i.Cg)([(0,n.wk)()],t.prototype,"_contentScrollable",void 0),t}},24367(e,t,a){a.d(t,{L:()=>s,z:()=>o});var i=a(23832);const s=["input_boolean","input_button","input_text","input_number","input_datetime","input_select","counter","timer","schedule"],o=(0,i.g)(s)},30057(e,t,a){a.a(e,async function(e,t){try{var i=a(62826),s=a(5124),o=a(22441),r=a(22786),n=a(52763),l=e([n]);n=(l.then?(await l)():l)[0];class d extends s.WF{async focus(){await this.updateComplete,this._form?.focus()}render(){return s.qy` <div class="section"> <div class="intro"> <h3> ${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.steps.config.title")} </h3> <p> ${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.steps.config.description")} </p> </div> <ha-form .schema="${this._schema(this.supportedLanguages)}" .data="${this.data}" .hass="${this.hass}" .computeLabel="${this._computeLabel}"></ha-form> </div> `}constructor(...e){super(...e),this._schema=(0,r.A)(e=>[{name:"",type:"grid",schema:[{name:"name",required:!0,selector:{text:{}}},e?{name:"language",required:!0,selector:{language:{languages:e}}}:{name:"",type:"constant"}]}]),this._computeLabel=e=>e.name?this.hass.localize(`ui.panel.config.voice_assistants.assistants.pipeline.detail.form.${e.name}`):""}}d.styles=s.AH`.section{border:1px solid var(--divider-color);border-radius:var(--ha-border-radius-md);box-sizing:border-box;padding:16px}.intro{margin-bottom:16px}h3{font-size:var(--ha-font-size-xl);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-condensed);margin-top:0;margin-bottom:4px}p{color:var(--secondary-text-color);font-size:var(--mdc-typography-body2-font-size, var(--ha-font-size-s));margin-top:0;margin-bottom:0}`,(0,i.Cg)([(0,o.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],d.prototype,"data",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],d.prototype,"supportedLanguages",void 0),(0,i.Cg)([(0,o.P)("ha-form")],d.prototype,"_form",void 0),d=(0,i.Cg)([(0,o.EM)("assist-pipeline-detail-config")],d),t()}catch(e){t(e)}})},3996(e,t,a){a.a(e,async function(e,t){try{a(74423),a(44114);var i=a(62826),s=a(5124),o=a(22441),r=a(22786),n=a(1087),l=a(52763),d=e([l]);l=(d.then?(await d)():d)[0];class h extends s.WF{render(){return s.qy` <div class="section"> <div class="intro"> <h3> ${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.steps.conversation.title")} </h3> <p> ${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.steps.conversation.description")} </p> </div> <ha-form .schema="${this._schema(this.data?.conversation_engine,this.data?.language,this._supportedLanguages)}" .data="${this.data}" .hass="${this.hass}" .computeLabel="${this._computeLabel}" .computeHelper="${this._computeHelper}" @supported-languages-changed="${this._supportedLanguagesChanged}"></ha-form> </div> `}_supportedLanguagesChanged(e){this._supportedLanguages=e.detail.value,"*"!==this._supportedLanguages&&this._supportedLanguages?.includes(this.data?.conversation_language||"")&&this.data?.conversation_language||setTimeout(()=>{const e={...this.data};"*"===this._supportedLanguages?e.conversation_language="*":e.conversation_language=this._supportedLanguages?.[0]??null,(0,n.r)(this,"value-changed",{value:e})},0)}constructor(...e){super(...e),this._schema=(0,r.A)((e,t,a)=>{const i=[{name:"",type:"grid",schema:[{name:"conversation_engine",required:!0,selector:{conversation_agent:{language:t}}}]}];return"*"!==a&&a?.length&&i[0].schema.push({name:"conversation_language",required:!0,selector:{language:{languages:a,no_sort:!0}}}),"conversation.home_assistant"!==e&&i.push({name:"prefer_local_intents",default:!0,selector:{boolean:{}}}),i}),this._computeLabel=e=>e.name?this.hass.localize(`ui.panel.config.voice_assistants.assistants.pipeline.detail.form.${e.name}`):"",this._computeHelper=e=>e.name?this.hass.localize(`ui.panel.config.voice_assistants.assistants.pipeline.detail.form.${e.name}_description`):""}}h.styles=s.AH`.section{border:1px solid var(--divider-color);border-radius:var(--ha-border-radius-md);box-sizing:border-box;padding:16px}.intro{margin-bottom:16px}h3{font-size:var(--ha-font-size-xl);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-condensed);margin-top:0;margin-bottom:4px}p{color:var(--secondary-text-color);font-size:var(--mdc-typography-body2-font-size, var(--ha-font-size-s));margin-top:0;margin-bottom:0}`,(0,i.Cg)([(0,o.MZ)({attribute:!1})],h.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],h.prototype,"data",void 0),(0,i.Cg)([(0,o.wk)()],h.prototype,"_supportedLanguages",void 0),h=(0,i.Cg)([(0,o.EM)("assist-pipeline-detail-conversation")],h),t()}catch(e){t(e)}})},70398(e,t,a){a.a(e,async function(e,t){try{a(74423);var i=a(62826),s=a(5124),o=a(22441),r=a(22786),n=a(1087),l=a(52763),d=e([l]);l=(d.then?(await d)():d)[0];class h extends s.WF{render(){return s.qy` <div class="section"> <div class="intro"> <h3> ${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.steps.stt.title")} </h3> <p> ${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.steps.stt.description")} </p> </div> <ha-form .schema="${this._schema(this.data?.language,this._supportedLanguages)}" .data="${this.data}" .hass="${this.hass}" .computeLabel="${this._computeLabel}" @supported-languages-changed="${this._supportedLanguagesChanged}"></ha-form> </div> `}_supportedLanguagesChanged(e){this._supportedLanguages=e.detail.value,this.data?.stt_language&&this._supportedLanguages?.includes(this.data.stt_language)||setTimeout(()=>{const e={...this.data};e.stt_language=this._supportedLanguages?.[0]??null,(0,n.r)(this,"value-changed",{value:e})},0)}constructor(...e){super(...e),this._schema=(0,r.A)((e,t)=>[{name:"",type:"grid",schema:[{name:"stt_engine",selector:{stt:{language:e}}},t?.length?{name:"stt_language",required:!0,selector:{language:{languages:t,no_sort:!0}}}:{name:"",type:"constant"}]}]),this._computeLabel=e=>e.name?this.hass.localize(`ui.panel.config.voice_assistants.assistants.pipeline.detail.form.${e.name}`):""}}h.styles=s.AH`.section{border:1px solid var(--divider-color);border-radius:var(--ha-border-radius-md);box-sizing:border-box;padding:16px}.intro{margin-bottom:16px}h3{font-size:var(--ha-font-size-xl);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-condensed);margin-top:0;margin-bottom:4px}p{color:var(--secondary-text-color);font-size:var(--mdc-typography-body2-font-size, var(--ha-font-size-s));margin-top:0;margin-bottom:0}`,(0,i.Cg)([(0,o.MZ)({attribute:!1})],h.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],h.prototype,"data",void 0),(0,i.Cg)([(0,o.wk)()],h.prototype,"_supportedLanguages",void 0),h=(0,i.Cg)([(0,o.EM)("assist-pipeline-detail-stt")],h),t()}catch(e){t(e)}})},75902(e,t,a){a.a(e,async function(e,t){try{a(74423);var i=a(62826),s=a(5124),o=a(22441),r=a(22786),n=a(1087),l=a(18350),d=a(52763),h=a(58947),c=e([l,d]);[l,d]=c.then?(await c)():c;class p extends s.WF{render(){return s.qy` <div class="section"> <div class="content"> <div class="intro"> <h3> ${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.steps.tts.title")} </h3> <p> ${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.steps.tts.description")} </p> </div> <ha-form .schema="${this._schema(this.data?.language,this._supportedLanguages)}" .data="${this.data}" .hass="${this.hass}" .computeLabel="${this._computeLabel}" @supported-languages-changed="${this._supportedLanguagesChanged}"></ha-form> </div> ${this.data?.tts_engine?s.qy`<div class="footer"> <ha-button @click="${this._preview}"> ${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.try_tts")} </ha-button> </div>`:s.s6} </div> `}async _preview(){if(!this.data)return;const e=this.data.tts_engine,t=this.data.tts_language||void 0,a=this.data.tts_voice||void 0;e&&(0,h.a)(this,{engine:e,language:t,voice:a})}_supportedLanguagesChanged(e){this._supportedLanguages=e.detail.value,this.data?.tts_language&&this._supportedLanguages?.includes(this.data?.tts_language)||setTimeout(()=>{const e={...this.data};e.tts_language=this._supportedLanguages?.[0]??null,(0,n.r)(this,"value-changed",{value:e})},0)}constructor(...e){super(...e),this._schema=(0,r.A)((e,t)=>[{name:"",type:"grid",schema:[{name:"tts_engine",selector:{tts:{language:e}}},t?.length?{name:"tts_language",required:!0,selector:{language:{languages:t,no_sort:!0}}}:{name:"",type:"constant"},{name:"tts_voice",selector:{tts_voice:{}},context:{language:"tts_language",engineId:"tts_engine"},required:!0}]}]),this._computeLabel=e=>e.name?this.hass.localize(`ui.panel.config.voice_assistants.assistants.pipeline.detail.form.${e.name}`):""}}p.styles=s.AH`.section{border:1px solid var(--divider-color);border-radius:var(--ha-border-radius-md)}.content{padding:16px}.intro{margin-bottom:16px}h3{font-size:var(--ha-font-size-xl);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-condensed);margin-top:0;margin-bottom:4px}p{color:var(--secondary-text-color);font-size:var(--mdc-typography-body2-font-size, var(--ha-font-size-s));margin-top:0;margin-bottom:0}.footer{border-top:1px solid var(--divider-color);padding:8px 16px}`,(0,i.Cg)([(0,o.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],p.prototype,"data",void 0),(0,i.Cg)([(0,o.wk)()],p.prototype,"_supportedLanguages",void 0),p=(0,i.Cg)([(0,o.EM)("assist-pipeline-detail-tts")],p),t()}catch(e){t(e)}})},92291(e,t,a){a.a(e,async function(e,t){try{a(18111),a(61701),a(13579);var i=a(62826),s=a(5124),o=a(22441),r=a(22786),n=a(1087),l=a(52763),d=a(81569),h=e([l]);l=(h.then?(await h)():h)[0];class c extends s.WF{willUpdate(e){e.has("data")&&e.get("data")?.wake_word_entity!==this.data?.wake_word_entity&&(e.get("data")?.wake_word_entity&&this.data?.wake_word_id&&(0,n.r)(this,"value-changed",{value:{...this.data,wake_word_id:void 0}}),this._fetchWakeWords())}render(){return s.qy` <div class="section"> <div class="content"> <div class="intro"> <h3> ${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.steps.wakeword.title")} </h3> <p> ${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.steps.wakeword.description")} </p> <ha-alert alert-type="info"> ${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.steps.wakeword.note")} </ha-alert> </div> <ha-form .schema="${this._schema(this._wakeWords)}" .data="${this.data}" .hass="${this.hass}" .computeLabel="${this._computeLabel}"></ha-form> </div> </div> `}async _fetchWakeWords(){if(this._wakeWords=void 0,!this.data?.wake_word_entity)return;const e=this.data.wake_word_entity,t=await(0,d.$)(this.hass,e);this.data.wake_word_entity===e&&(this._wakeWords=t.wake_words,!this.data||this.data?.wake_word_id&&this._wakeWords.some(e=>e.id===this.data.wake_word_id)||(0,n.r)(this,"value-changed",{value:{...this.data,wake_word_id:this._wakeWords[0]?.id}}))}constructor(...e){super(...e),this._schema=(0,r.A)(e=>[{name:"",type:"grid",schema:[{name:"wake_word_entity",selector:{entity:{domain:"wake_word"}}},e?.length?{name:"wake_word_id",required:!0,selector:{select:{mode:"dropdown",sort:!0,options:e.map(e=>({value:e.id,label:e.name}))}}}:{name:"",type:"constant"}]}]),this._computeLabel=e=>e.name?this.hass.localize(`ui.panel.config.voice_assistants.assistants.pipeline.detail.form.${e.name}`):""}}c.styles=s.AH`.section{border:1px solid var(--divider-color);border-radius:var(--ha-border-radius-md)}.content{padding:16px}.intro{margin-bottom:16px}h3{font-size:var(--ha-font-size-xl);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-condensed);margin-top:0;margin-bottom:4px}p{color:var(--secondary-text-color);font-size:var(--mdc-typography-body2-font-size, var(--ha-font-size-s));margin-top:0;margin-bottom:0}a{color:var(--primary-color)}`,(0,i.Cg)([(0,o.MZ)({attribute:!1})],c.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],c.prototype,"data",void 0),(0,i.Cg)([(0,o.wk)()],c.prototype,"_wakeWords",void 0),c=(0,i.Cg)([(0,o.EM)("assist-pipeline-detail-wakeword")],c),t()}catch(e){t(e)}})},43528(e,t,a){a.a(e,async function(e,i){try{a.r(t),a.d(t,{DialogVoiceAssistantPipelineDetail:()=>C});a(18111),a(7588),a(13579);var s=a(62826),o=a(5124),r=a(22441),n=a(22786),l=a(1087),d=a(71727),h=a(18350),c=(a(70947),a(52763)),p=a(26300),u=a(72554),g=(a(93444),a(69150)),m=a(14503),_=a(30057),v=a(3996),b=a(70398),f=a(75902),y=a(92291),w=a(90056),x=e([h,c,p,u,_,v,b,f,y,w]);[h,c,p,u,_,v,b,f,y,w]=x.then?(await x)():x;const $="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 C extends o.WF{showDialog(e){if(this._params=e,this._open=!0,this._error=void 0,this._cloudActive=this._params.cloudActiveSubscription,this._params.pipeline&&"id"in this._params.pipeline&&this._params.pipeline.id)return this._data={prefer_local_intents:!1,...this._params.pipeline},void(this._hideWakeWord=this._params.hideWakeWord||!this._data.wake_word_entity);let t,a;if(this._hideWakeWord=!0,this._cloudActive)for(const e of Object.values(this.hass.entities))if("cloud"===e.platform)if("stt"===(0,d.m)(e.entity_id)){if(t=e.entity_id,a)break}else if("tts"===(0,d.m)(e.entity_id)&&(a=e.entity_id,t))break;this._data={...this._params.pipeline||{},language:this._params.pipeline?.language||(this.hass.config.language||this.hass.locale.language).substring(0,2),stt_engine:this._params.pipeline?.stt_engine||t,tts_engine:this._params.pipeline?.tts_engine||a}}closeDialog(){this._open=!1}_dialogClosed(){this._params=void 0,this._data=void 0,this._hideWakeWord=!1,(0,l.r)(this,"dialog-closed",{dialog:this.localName})}firstUpdated(){this._getSupportedLanguages()}async _getSupportedLanguages(){const{languages:e}=await(0,g.ds)(this.hass);this._supportedLanguages=e}render(){if(!this._params||!this._data)return o.s6;const e=this._params.pipeline&&"id"in this._params.pipeline&&!!this._params.pipeline.id,t=e&&this._params.pipeline?.name?this._params.pipeline.name:this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.add_assistant_title");return o.qy` <ha-dialog .open="${this._open}" header-title="${t}" prevent-scrim-close @closed="${this._dialogClosed}"> ${this._hideWakeWord&&!this._params.hideWakeWord&&this._hasWakeWorkEntities(this.hass.states)?o.qy`<ha-dropdown slot="headerActionItems" @wa-select="${this._handleDropdownSelect}" placement="bottom-end"> <ha-icon-button .path="${$}" slot="trigger"></ha-icon-button> <ha-dropdown-item value="show_wake_word"> ${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.add_streaming_wake_word")} </ha-dropdown-item></ha-dropdown>`:o.s6} <div class="content"> ${this._error?o.qy`<ha-alert alert-type="error">${this._error}</ha-alert>`:o.s6} <assist-pipeline-detail-config .hass="${this.hass}" .data="${this._data}" .supportedLanguages="${this._supportedLanguages}" keys="name,language" @value-changed="${this._valueChanged}" ?autofocus="${!e}"></assist-pipeline-detail-config> <assist-pipeline-detail-conversation .hass="${this.hass}" .data="${this._data}" keys="conversation_engine,conversation_language,prefer_local_intents" @value-changed="${this._valueChanged}"></assist-pipeline-detail-conversation> ${this._cloudActive||"cloud"!==this._data.tts_engine&&"cloud"!==this._data.stt_engine?o.s6:o.qy` <ha-alert alert-type="warning"> ${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.no_cloud_message")} <ha-button size="small" href="/config/cloud" slot="action"> ${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.no_cloud_action")} </ha-button> </ha-alert> `} <assist-pipeline-detail-stt .hass="${this.hass}" .data="${this._data}" keys="stt_engine,stt_language" @value-changed="${this._valueChanged}"></assist-pipeline-detail-stt> <assist-pipeline-detail-tts .hass="${this.hass}" .data="${this._data}" keys="tts_engine,tts_language,tts_voice" @value-changed="${this._valueChanged}"></assist-pipeline-detail-tts> ${this._hideWakeWord?o.s6:o.qy`<assist-pipeline-detail-wakeword .hass="${this.hass}" .data="${this._data}" keys="wake_word_entity,wake_word_id" @value-changed="${this._valueChanged}"></assist-pipeline-detail-wakeword>`} </div> <ha-dialog-footer slot="footer"> <ha-button slot="secondaryAction" appearance="plain" @click="${this.closeDialog}"> ${this.hass.localize("ui.common.cancel")} </ha-button> <ha-button slot="primaryAction" @click="${this._updatePipeline}" .loading="${this._submitting}"> ${e?this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.update_assistant_action"):this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.add_assistant_action")} </ha-button> </ha-dialog-footer> </ha-dialog> `}_handleDropdownSelect(e){const t=e.detail?.item?.value;"show_wake_word"===t&&(this._hideWakeWord=!1)}_valueChanged(e){this._error=void 0;const t={};e.currentTarget.getAttribute("keys").split(",").forEach(a=>{t[a]=e.detail.value[a]}),this._data={...this._data,...t}}async _updatePipeline(){this._submitting=!0;try{const e=this._data,t={name:e.name,language:e.language,conversation_engine:e.conversation_engine,conversation_language:e.conversation_language??null,prefer_local_intents:e.prefer_local_intents??!0,stt_engine:e.stt_engine??null,stt_language:e.stt_language??null,tts_engine:e.tts_engine??null,tts_language:e.tts_language??null,tts_voice:e.tts_voice??null,wake_word_entity:e.wake_word_entity??null,wake_word_id:e.wake_word_id??null};this._params.pipeline&&"id"in this._params.pipeline&&this._params.pipeline.id&&this._params.updatePipeline?await this._params.updatePipeline(t):this._params.createPipeline?await this._params.createPipeline(t):console.error("No createPipeline function provided"),this.closeDialog()}catch(e){this._error=e?.message||"Unknown error"}finally{this._submitting=!1}}static get styles(){return[m.nA,o.AH`.content>:not(:last-child){margin-bottom:16px;display:block}ha-alert{margin-bottom:16px;display:block}a{text-decoration:none}`]}constructor(...e){super(...e),this._open=!1,this._hideWakeWord=!1,this._submitting=!1,this._hasWakeWorkEntities=(0,n.A)(e=>Object.keys(e).some(e=>e.startsWith("wake_word.")))}}(0,s.Cg)([(0,r.MZ)({attribute:!1})],C.prototype,"hass",void 0),(0,s.Cg)([(0,r.wk)()],C.prototype,"_params",void 0),(0,s.Cg)([(0,r.wk)()],C.prototype,"_open",void 0),(0,s.Cg)([(0,r.wk)()],C.prototype,"_data",void 0),(0,s.Cg)([(0,r.wk)()],C.prototype,"_hideWakeWord",void 0),(0,s.Cg)([(0,r.wk)()],C.prototype,"_cloudActive",void 0),(0,s.Cg)([(0,r.wk)()],C.prototype,"_error",void 0),(0,s.Cg)([(0,r.wk)()],C.prototype,"_submitting",void 0),(0,s.Cg)([(0,r.wk)()],C.prototype,"_supportedLanguages",void 0),C=(0,s.Cg)([(0,r.EM)("dialog-voice-assistant-pipeline-detail")],C),i()}catch(e){i(e)}})},22348(e,t,a){a.d(t,{V:()=>s});var i=a(37177);const s=e=>!!e&&i.n},37177(e,t,a){a.d(t,{n:()=>i});const i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}};