3 lines
17 KiB
JavaScript
3 lines
17 KiB
JavaScript
/*! For license information please see 4814.4be7120528211163.js.LICENSE.txt */
|
|
export const ids=["4814"];export const modules={81036:function(e,t,n){n.d(t,{U:function(){return i}});const i=e=>e.stopPropagation()},56587:function(e,t,n){n.d(t,{D:function(){return i}});const i=(e,t,n=!1)=>{let i;const o=(...o)=>{const a=n&&!i;clearTimeout(i),i=window.setTimeout((()=>{i=void 0,e(...o)}),t),a&&e(...o)};return o.cancel=()=>{clearTimeout(i)},o}},74064:function(e,t,n){var i=n(44249),o=n(72621),a=n(65703),s=n(46289),r=n(57243),d=n(50778);(0,i.Z)([(0,d.Mo)("ha-list-item")],(function(e,t){class n extends t{constructor(...t){super(...t),e(this)}}return{F:n,d:[{kind:"method",key:"renderRipple",value:function(){return this.noninteractive?"":(0,o.Z)(n,"renderRipple",this,3)([])}},{kind:"get",static:!0,key:"styles",value:function(){return[s.W,r.iv`:host{padding-left:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-inline-start:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-right:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px));padding-inline-end:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px))}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:48px}span.material-icons:first-of-type{margin-inline-start:0px!important;margin-inline-end:var(--mdc-list-item-graphic-margin,16px)!important;direction:var(--direction)!important}span.material-icons:last-of-type{margin-inline-start:auto!important;margin-inline-end:0px!important;direction:var(--direction)!important}.mdc-deprecated-list-item__meta{display:var(--mdc-list-item-meta-display);align-items:center;flex-shrink:0}:host([graphic=icon]:not([twoline])) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,20px)!important}:host([multiline-secondary]){height:auto}:host([multiline-secondary]) .mdc-deprecated-list-item__text{padding:8px 0}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text{text-overflow:initial;white-space:normal;overflow:auto;display:inline-block;margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text{margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text::before{display:none}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text::before{display:none}:host([disabled]){color:var(--disabled-text-color)}:host([noninteractive]){pointer-events:unset}`,"rtl"===document.dir?r.iv`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`:r.iv``]}}]}}),a.K)},58130:function(e,t,n){var i=n(44249),o=n(72621),a=n(60930),s=n(9714),r=n(57243),d=n(50778),l=n(56587),c=n(30137);n(59897);(0,i.Z)([(0,d.Mo)("ha-select")],(function(e,t){class n extends t{constructor(...t){super(...t),e(this)}}return{F:n,d:[{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"icon",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({type:Boolean,reflect:!0})],key:"clearable",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({attribute:"inline-arrow",type:Boolean})],key:"inlineArrow",value:()=>!1},{kind:"method",key:"render",value:function(){return r.dy` ${(0,o.Z)(n,"render",this,3)([])} ${this.clearable&&!this.required&&!this.disabled&&this.value?r.dy`<ha-icon-button label="clear" @click="${this._clearValue}" .path="${"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"}"></ha-icon-button>`:r.Ld} `}},{kind:"method",key:"renderLeadingIcon",value:function(){return this.icon?r.dy`<span class="mdc-select__icon"><slot name="icon"></slot></span>`:r.Ld}},{kind:"method",key:"connectedCallback",value:function(){(0,o.Z)(n,"connectedCallback",this,3)([]),window.addEventListener("translations-updated",this._translationsUpdated)}},{kind:"method",key:"firstUpdated",value:async function(){(0,o.Z)(n,"firstUpdated",this,3)([]),this.inlineArrow&&this.shadowRoot?.querySelector(".mdc-select__selected-text-container")?.classList.add("inline-arrow")}},{kind:"method",key:"updated",value:function(e){if((0,o.Z)(n,"updated",this,3)([e]),e.has("inlineArrow")){const e=this.shadowRoot?.querySelector(".mdc-select__selected-text-container");this.inlineArrow?e?.classList.add("inline-arrow"):e?.classList.remove("inline-arrow")}}},{kind:"method",key:"disconnectedCallback",value:function(){(0,o.Z)(n,"disconnectedCallback",this,3)([]),window.removeEventListener("translations-updated",this._translationsUpdated)}},{kind:"method",key:"_clearValue",value:function(){!this.disabled&&this.value&&(this.valueSetDirectly=!0,this.select(-1),this.mdcFoundation.handleChange())}},{kind:"field",key:"_translationsUpdated",value(){return(0,l.D)((async()=>{await(0,c.y)(),this.layoutOptions()}),500)}},{kind:"field",static:!0,key:"styles",value:()=>[s.W,r.iv`:host([clearable]){position:relative}.mdc-select:not(.mdc-select--disabled) .mdc-select__icon{color:var(--secondary-text-color)}.mdc-select__anchor{width:var(--ha-select-min-width,200px)}.mdc-select--filled .mdc-select__anchor{height:var(--ha-select-height,56px)}.mdc-select--filled .mdc-floating-label{inset-inline-start:12px;inset-inline-end:initial;direction:var(--direction)}.mdc-select--filled.mdc-select--with-leading-icon .mdc-floating-label{inset-inline-start:48px;inset-inline-end:initial;direction:var(--direction)}.mdc-select .mdc-select__anchor{padding-inline-start:12px;padding-inline-end:0px;direction:var(--direction)}.mdc-select__anchor .mdc-floating-label--float-above{transform-origin:var(--float-start)}.mdc-select__selected-text-container{padding-inline-end:var(--select-selected-text-padding-end,0px)}:host([clearable]) .mdc-select__selected-text-container{padding-inline-end:var(--select-selected-text-padding-end,12px)}ha-icon-button{position:absolute;top:10px;right:28px;--mdc-icon-button-size:36px;--mdc-icon-size:20px;color:var(--secondary-text-color);inset-inline-start:initial;inset-inline-end:28px;direction:var(--direction)}.inline-arrow{flex-grow:0}`]}]}}),a.K)},19778:function(e,t,n){n.r(t),n.d(t,{HaConversationAgentSelector:()=>k});var i=n("44249"),o=n("57243"),a=n("50778"),s=n("72621"),r=(n("39527"),n("67670"),n("13334"),n("11297")),d=n("81036"),l=n("56587"),c=n("87055"),p=n("31762"),u=n("1275");const h=(e,t)=>e.callApi("POST","config/config_entries/options/flow",{handler:t,show_advanced_options:Boolean(e.userData?.showAdvanced)}),m=(e,t)=>e.callApi("GET",`config/config_entries/options/flow/${t}`),g=(e,t,n)=>e.callApi("POST",`config/config_entries/options/flow/${t}`,n),v=(e,t)=>e.callApi("DELETE",`config/config_entries/options/flow/${t}`);var f=n("43373");n("74064"),n("58130");var _=n("60498");const y="__NONE_OPTION__";(0,i.Z)([(0,a.Mo)("ha-conversation-agent-picker")],(function(e,t){class n extends t{constructor(...t){super(...t),e(this)}}return{F:n,d:[{kind:"field",decorators:[(0,a.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,a.Cb)()],key:"language",value:void 0},{kind:"field",decorators:[(0,a.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.Cb)({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"required",value:()=>!1},{kind:"field",decorators:[(0,a.SB)()],key:"_agents",value:void 0},{kind:"field",decorators:[(0,a.SB)()],key:"_configEntry",value:void 0},{kind:"method",key:"render",value:function(){if(!this._agents)return o.Ld;let e=this.value;if(!e&&this.required){for(const t of this._agents)if("conversation.home_assistant"===t.id&&t.supported_languages.includes(this.language)){e=t.id;break}if(!e)for(const t of this._agents)if("*"===t.supported_languages&&t.supported_languages.includes(this.language)){e=t.id;break}}return e||(e=y),o.dy` <ha-select .label="${this.label||this.hass.localize("ui.components.coversation-agent-picker.conversation_agent")}" .value="${e}" .required="${this.required}" .disabled="${this.disabled}" @selected="${this._changed}" @closed="${d.U}" fixedMenuPosition naturalMenuWidth> ${this.required?o.Ld:o.dy`<ha-list-item .value="${y}"> ${this.hass.localize("ui.components.coversation-agent-picker.none")} </ha-list-item>`} ${this._agents.map((e=>o.dy`<ha-list-item .value="${e.id}" .disabled="${"*"!==e.supported_languages&&0===e.supported_languages.length}"> ${e.name} </ha-list-item>`))}</ha-select>${this._configEntry?.supports_options?o.dy`<ha-icon-button .path="${"M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z"}" @click="${this._openOptionsFlow}"></ha-icon-button>`:""} `}},{kind:"method",key:"willUpdate",value:function(e){(0,s.Z)(n,"willUpdate",this,3)([e]),this.hasUpdated?e.has("language")&&this._debouncedUpdateAgents():this._updateAgents(),e.has("value")&&this._maybeFetchConfigEntry()}},{kind:"method",key:"_maybeFetchConfigEntry",value:async function(){if(this.value&&this.value in this.hass.entities)try{const e=await(0,_.L3)(this.hass,this.value);if(!e.config_entry_id)return void(this._configEntry=void 0);this._configEntry=(await(0,c.RQ)(this.hass,e.config_entry_id)).config_entry}catch(e){this._configEntry=void 0}else this._configEntry=void 0}},{kind:"field",key:"_debouncedUpdateAgents",value(){return(0,l.D)((()=>this._updateAgents()),500)}},{kind:"method",key:"_updateAgents",value:async function(){const{agents:e}=await(0,p.rM)(this.hass,this.language,this.hass.config.country||void 0);if(this._agents=e,!this.value)return;const t=e.find((e=>e.id===this.value));(0,r.B)(this,"supported-languages-changed",{value:t?.supported_languages}),(!t||"*"!==t.supported_languages&&0===t.supported_languages.length)&&(this.value=void 0,(0,r.B)(this,"value-changed",{value:this.value}))}},{kind:"method",key:"_openOptionsFlow",value:async function(){var e,t,n;this._configEntry&&(e=this,t=this._configEntry,n={manifest:await(0,u.t4)(this.hass,this._configEntry.domain)},(0,f.w)(e,{startFlowHandler:t.entry_id,domain:t.domain,...n},{flowType:"options_flow",showDevices:!1,createFlow:async(e,n)=>{const[i]=await Promise.all([h(e,n),e.loadFragmentTranslation("config"),e.loadBackendTranslation("options",t.domain),e.loadBackendTranslation("selector",t.domain)]);return i},fetchFlow:async(e,n)=>{const[i]=await Promise.all([m(e,n),e.loadFragmentTranslation("config"),e.loadBackendTranslation("options",t.domain),e.loadBackendTranslation("selector",t.domain)]);return i},handleFlowStep:g,deleteFlow:v,renderAbortDescription(e,n){const i=e.localize(`component.${n.translation_domain||t.domain}.options.abort.${n.reason}`,n.description_placeholders);return i?o.dy` <ha-markdown breaks allow-svg .content="${i}"></ha-markdown> `:n.reason},renderShowFormStepHeader:(e,n)=>e.localize(`component.${n.translation_domain||t.domain}.options.step.${n.step_id}.title`,n.description_placeholders)||e.localize("ui.dialogs.options_flow.form.header"),renderShowFormStepDescription(e,n){const i=e.localize(`component.${n.translation_domain||t.domain}.options.step.${n.step_id}.description`,n.description_placeholders);return i?o.dy` <ha-markdown allow-svg breaks .content="${i}"></ha-markdown> `:""},renderShowFormStepFieldLabel(e,n,i,o){if("expandable"===i.type)return e.localize(`component.${t.domain}.options.step.${n.step_id}.sections.${i.name}.name`);const a=o?.path?.[0]?`sections.${o.path[0]}.`:"";return e.localize(`component.${t.domain}.options.step.${n.step_id}.${a}data.${i.name}`)||i.name},renderShowFormStepFieldHelper(e,n,i,a){if("expandable"===i.type)return e.localize(`component.${n.translation_domain||t.domain}.options.step.${n.step_id}.sections.${i.name}.description`);const s=a?.path?.[0]?`sections.${a.path[0]}.`:"",r=e.localize(`component.${n.translation_domain||t.domain}.options.step.${n.step_id}.${s}data_description.${i.name}`,n.description_placeholders);return r?o.dy`<ha-markdown breaks .content="${r}"></ha-markdown>`:""},renderShowFormStepFieldError:(e,n,i)=>e.localize(`component.${n.translation_domain||t.domain}.options.error.${i}`,n.description_placeholders)||i,renderShowFormStepFieldLocalizeValue:(e,n,i)=>e.localize(`component.${t.domain}.selector.${i}`),renderShowFormStepSubmitButton:(e,n)=>e.localize(`component.${t.domain}.options.step.${n.step_id}.submit`)||e.localize("ui.panel.config.integrations.config_flow."+(!1===n.last_step?"next":"submit")),renderExternalStepHeader:(e,t)=>"",renderExternalStepDescription:(e,t)=>"",renderCreateEntryDescription:(e,t)=>o.dy` <p>${e.localize("ui.dialogs.options_flow.success.description")}</p> `,renderShowFormProgressHeader:(e,n)=>e.localize(`component.${t.domain}.options.step.${n.step_id}.title`)||e.localize(`component.${t.domain}.title`),renderShowFormProgressDescription(e,n){const i=e.localize(`component.${n.translation_domain||t.domain}.options.progress.${n.progress_action}`,n.description_placeholders);return i?o.dy` <ha-markdown allow-svg breaks .content="${i}"></ha-markdown> `:""},renderMenuHeader:(e,n)=>e.localize(`component.${t.domain}.options.step.${n.step_id}.title`)||e.localize(`component.${t.domain}.title`),renderMenuDescription(e,n){const i=e.localize(`component.${n.translation_domain||t.domain}.options.step.${n.step_id}.description`,n.description_placeholders);return i?o.dy` <ha-markdown allow-svg breaks .content="${i}"></ha-markdown> `:""},renderMenuOption:(e,n,i)=>e.localize(`component.${n.translation_domain||t.domain}.options.step.${n.step_id}.menu_options.${i}`,n.description_placeholders),renderLoadingDescription:(e,n)=>e.localize(`component.${t.domain}.options.loading`)||("loading_flow"===n||"loading_step"===n?e.localize(`ui.dialogs.options_flow.loading.${n}`,{integration:(0,u.Lh)(e.localize,t.domain)}):"")}))}},{kind:"get",static:!0,key:"styles",value:function(){return o.iv`:host{display:flex;align-items:center}ha-select{width:100%}ha-icon-button{color:var(--secondary-text-color)}`}},{kind:"method",key:"_changed",value:function(e){const t=e.target;!this.hass||""===t.value||t.value===this.value||void 0===this.value&&t.value===y||(this.value=t.value===y?void 0:t.value,(0,r.B)(this,"value-changed",{value:this.value}),(0,r.B)(this,"supported-languages-changed",{value:this._agents.find((e=>e.id===this.value))?.supported_languages}))}}]}}),o.oi);let k=(0,i.Z)([(0,a.Mo)("ha-selector-conversation_agent")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"selector",value:void 0},{kind:"field",decorators:[(0,a.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,a.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,a.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"required",value:()=>!0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"context",value:void 0},{kind:"method",key:"render",value:function(){return o.dy`<ha-conversation-agent-picker .hass="${this.hass}" .value="${this.value}" .language="${this.selector.conversation_agent?.language||this.context?.language}" .label="${this.label}" .helper="${this.helper}" .disabled="${this.disabled}" .required="${this.required}"></ha-conversation-agent-picker>`}},{kind:"field",static:!0,key:"styles",value:()=>o.iv`ha-conversation-agent-picker{width:100%}`}]}}),o.oi)},31762:function(e,t,n){n.d(t,{rM:function(){return o},zt:function(){return i}});let i=function(e){return e[e.CONTROL=1]="CONTROL",e}({});const o=(e,t,n)=>e.callWS({type:"conversation/agent/list",language:t,country:n})},60498:function(e,t,n){n.d(t,{L3:function(){return s},Mw:function(){return d},vA:function(){return a},w1:function(){return r}});n(39527),n(99790),n(67670);var i=n(27486),o=n(73525);n(32770);const a=(e,t)=>{if(t.name)return t.name;const n=e.states[t.entity_id];return n?(0,o.C)(n):t.original_name?t.original_name:t.entity_id},s=(e,t)=>e.callWS({type:"config/entity_registry/get",entity_id:t}),r=(0,i.Z)((e=>{const t={};for(const n of e)t[n.entity_id]=n;return t})),d=(0,i.Z)((e=>{const t={};for(const n of e)t[n.id]=n;return t}))},1275:function(e,t,n){n.d(t,{F3:function(){return o},Lh:function(){return i},t4:function(){return a}});const i=(e,t,n)=>e(`component.${t}.title`)||n?.name||t,o=(e,t)=>{const n={type:"manifest/list"};return t&&(n.integrations=t),e.callWS(n)},a=(e,t)=>e.callWS({type:"manifest/get",integration:t})},43373:function(e,t,n){n.d(t,{w:function(){return a}});var i=n(11297);const o=()=>Promise.all([n.e("6379"),n.e("3397"),n.e("2174"),n.e("1206"),n.e("2517"),n.e("9894")]).then(n.bind(n,69817)),a=(e,t,n)=>{(0,i.B)(e,"show-dialog",{dialogTag:"dialog-data-entry-flow",dialogImport:o,dialogParams:{...t,flowConfig:n,dialogParentElement:e}})}},87319:function(e,t,n){var i=n(9065),o=n(50778),a=n(65703),s=n(46289);let r=class extends a.K{};r.styles=[s.W],r=(0,i.gn)([(0,o.Mo)("mwc-list-item")],r)}};
|
|
//# sourceMappingURL=4814.4be7120528211163.js.map
|