UNPKG

iobroker.lovelace

Version:

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

5 lines 38.2 kB
export const __webpack_ids__=["74950"];export const __webpack_modules__={95262:function(e,t,a){function i(e){return null==e||Array.isArray(e)?e:[e]}a.d(t,{r:()=>i})},49976:function(e,t,a){a.d(t,{U:()=>i});const i=e=>e.stopPropagation()},94369:function(e,t,a){a.a(e,(async function(e,i){try{a.d(t,{u:()=>r});var o=a(16485),s=a(27486),n=e([o]);o=(n.then?(await n)():n)[0];const r=(e,t)=>{try{return d(t)?.of(e)??e}catch{return e}},d=(0,s.Z)((e=>new Intl.DisplayNames(e.language,{type:"language",fallback:"code"})));i()}catch(e){i(e)}}))},99426:function(e,t,a){a.r(t);var i=a(44249),o=a(57243),s=a(15093),n=a(35359),r=a(36522);a(23334),a(37583);const d={info:"M11,9H13V7H11M12,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,2M11,17H13V11H11V17Z",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",success:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"};(0,i.Z)([(0,s.Mo)("ha-alert")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)()],key:"title",value:()=>""},{kind:"field",decorators:[(0,s.Cb)({attribute:"alert-type"})],key:"alertType",value:()=>"info"},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"dismissable",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"narrow",value:()=>!1},{kind:"method",key:"render",value:function(){return o.dy` <div class="issue-type ${(0,n.$)({[this.alertType]:!0})}" role="alert"> <div class="icon ${this.title?"":"no-title"}"> <slot name="icon"> <ha-svg-icon .path="${d[this.alertType]}"></ha-svg-icon> </slot> </div> <div class="${(0,n.$)({content:!0,narrow:this.narrow})}"> <div class="main-content"> ${this.title?o.dy`<div class="title">${this.title}</div>`:o.Ld} <slot></slot> </div> <div class="action"> <slot name="action"> ${this.dismissable?o.dy`<ha-icon-button @click="${this._dismissClicked}" label="Dismiss alert" .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>`:o.Ld} </slot> </div> </div> </div> `}},{kind:"method",key:"_dismissClicked",value:function(){(0,r.B)(this,"alert-dismissed-clicked")}},{kind:"field",static:!0,key:"styles",value:()=>o.iv`.issue-type{position:relative;padding:8px;display:flex}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:4px}.icon{z-index:1}.icon.no-title{align-self:center}.content{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:var(--float-start)}.content.narrow{flex-direction:column;align-items:flex-end}.action{z-index:1;width:min-content;--mdc-theme-primary:var(--primary-text-color)}.main-content{overflow-wrap:anywhere;word-break:break-word;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:0}.title{margin-top:2px;font-weight:700}.action ha-icon-button,.action mwc-button{--mdc-theme-primary:var(--primary-text-color);--mdc-icon-button-size:36px}.issue-type.info>.icon{color:var(--info-color)}.issue-type.info::after{background-color:var(--info-color)}.issue-type.warning>.icon{color:var(--warning-color)}.issue-type.warning::after{background-color:var(--warning-color)}.issue-type.error>.icon{color:var(--error-color)}.issue-type.error::after{background-color:var(--error-color)}.issue-type.success>.icon{color:var(--success-color)}.issue-type.success::after{background-color:var(--success-color)}:host ::slotted(ul){margin:0;padding-inline-start:20px}`}]}}),o.oi)},59826:function(e,t,a){var i=a(44249),o=a(31622),s=a(57243),n=a(15093),r=a(22344);(0,i.Z)([(0,n.Mo)("ha-button")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",static:!0,key:"styles",value:()=>[r.W,s.iv`::slotted([slot=icon]){margin-inline-start:0px;margin-inline-end:8px;direction:var(--direction);display:block}.mdc-button{height:var(--button-height,36px)}.trailing-icon{display:flex}.slot-container{overflow:var(--button-slot-container-overflow,visible)}:host([destructive]){--mdc-theme-primary:var(--error-color)}`]}]}}),o.Button)},54977:function(e,t,a){var i=a(44249),o=a(57243),s=a(15093);(0,i.Z)([(0,s.Mo)("ha-card")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)()],key:"header",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,reflect:!0})],key:"raised",value:()=>!1},{kind:"field",static:!0,key:"styles",value:()=>o.iv`:host{background:var(--ha-card-background,var(--card-background-color,#fff));-webkit-backdrop-filter:var(--ha-card-backdrop-filter,none);backdrop-filter:var(--ha-card-backdrop-filter,none);box-shadow:var(--ha-card-box-shadow,none);box-sizing:border-box;border-radius:var(--ha-card-border-radius,12px);border-width:var(--ha-card-border-width,1px);border-style:solid;border-color:var(--ha-card-border-color,var(--divider-color,#e0e0e0));color:var(--primary-text-color);display:block;transition:all .3s ease-out;position:relative}:host([raised]){border:none;box-shadow:var(--ha-card-box-shadow,0px 2px 1px -1px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 1px 3px 0px rgba(0,0,0,.12))}.card-header,:host ::slotted(.card-header){color:var(--ha-card-header-color,var(--primary-text-color));font-family:var(--ha-card-header-font-family, inherit);font-size:var(--ha-card-header-font-size, 24px);letter-spacing:-.012em;line-height:48px;padding:12px 16px 16px;display:block;margin-block-start:0px;margin-block-end:0px;font-weight:400}:host ::slotted(.card-content:not(:first-child)),slot:not(:first-child)::slotted(.card-content){padding-top:0px;margin-top:-8px}:host ::slotted(.card-content){padding:16px}:host ::slotted(.card-actions){border-top:1px solid var(--divider-color,#e8e8e8);padding:5px 16px}`},{kind:"method",key:"render",value:function(){return o.dy` ${this.header?o.dy`<h1 class="card-header">${this.header}</h1>`:o.Ld} <slot></slot> `}}]}}),o.oi)},68325:function(e,t,a){var i=a(44249),o=a(72621),s=(a(92745),a(9359),a(70104),a(57243)),n=a(15093),r=a(27486),d=a(36522),l=a(49976);a(65981);const c={key:"Mod-s",run:e=>((0,d.B)(e.dom,"editor-save"),!0)},h=e=>{const t=document.createElement("ha-icon");return t.icon=e.label,t};(0,i.Z)([(0,n.Mo)("ha-code-editor")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",key:"codemirror",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"mode",value:()=>"yaml"},{kind:"field",key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"autofocus",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({attribute:"read-only",type:Boolean})],key:"readOnly",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"linewrap",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"autocomplete-entities"})],key:"autocompleteEntities",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"autocomplete-icons"})],key:"autocompleteIcons",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"error",value:()=>!1},{kind:"field",decorators:[(0,n.SB)()],key:"_value",value:()=>""},{kind:"field",key:"_loadedCodeMirror",value:void 0},{kind:"field",key:"_iconList",value:void 0},{kind:"set",key:"value",value:function(e){this._value=e}},{kind:"get",key:"value",value:function(){return this.codemirror?this.codemirror.state.doc.toString():this._value}},{kind:"get",key:"hasComments",value:function(){if(!this.codemirror||!this._loadedCodeMirror)return!1;const e=this._loadedCodeMirror.highlightingFor(this.codemirror.state,[this._loadedCodeMirror.tags.comment]);return!!this.renderRoot.querySelector(`span.${e}`)}},{kind:"method",key:"connectedCallback",value:function(){(0,o.Z)(i,"connectedCallback",this,3)([]),this.hasUpdated&&this.requestUpdate(),this.addEventListener("keydown",l.U),this.codemirror&&!1!==this.autofocus&&this.codemirror.focus()}},{kind:"method",key:"disconnectedCallback",value:function(){(0,o.Z)(i,"disconnectedCallback",this,3)([]),this.removeEventListener("keydown",l.U),this.updateComplete.then((()=>{this.codemirror.destroy(),delete this.codemirror}))}},{kind:"method",key:"scheduleUpdate",value:async function(){this._loadedCodeMirror??=await Promise.all([a.e("83895"),a.e("93505"),a.e("51403"),a.e("84729")]).then(a.bind(a,2765)),(0,o.Z)(i,"scheduleUpdate",this,3)([])}},{kind:"method",key:"update",value:function(e){if((0,o.Z)(i,"update",this,3)([e]),!this.codemirror)return void this._createCodeMirror();const t=[];e.has("mode")&&t.push({effects:[this._loadedCodeMirror.langCompartment.reconfigure(this._mode),this._loadedCodeMirror.foldingCompartment.reconfigure(this._getFoldingExtensions())]}),e.has("readOnly")&&t.push({effects:this._loadedCodeMirror.readonlyCompartment.reconfigure(this._loadedCodeMirror.EditorView.editable.of(!this.readOnly))}),e.has("linewrap")&&t.push({effects:this._loadedCodeMirror.linewrapCompartment.reconfigure(this.linewrap?this._loadedCodeMirror.EditorView.lineWrapping:[])}),e.has("_value")&&this._value!==this.value&&t.push({changes:{from:0,to:this.codemirror.state.doc.length,insert:this._value}}),t.length>0&&this.codemirror.dispatch(...t),e.has("error")&&this.classList.toggle("error-state",this.error)}},{kind:"get",key:"_mode",value:function(){return this._loadedCodeMirror.langs[this.mode]}},{kind:"method",key:"_createCodeMirror",value:function(){if(!this._loadedCodeMirror)throw new Error("Cannot create editor before CodeMirror is loaded");const e=[this._loadedCodeMirror.lineNumbers(),this._loadedCodeMirror.history(),this._loadedCodeMirror.drawSelection(),this._loadedCodeMirror.EditorState.allowMultipleSelections.of(!0),this._loadedCodeMirror.rectangularSelection(),this._loadedCodeMirror.crosshairCursor(),this._loadedCodeMirror.highlightSelectionMatches(),this._loadedCodeMirror.highlightActiveLine(),this._loadedCodeMirror.indentationMarkers({thickness:0,activeThickness:1,colors:{activeLight:"var(--secondary-text-color)",activeDark:"var(--secondary-text-color)"}}),this._loadedCodeMirror.keymap.of([...this._loadedCodeMirror.defaultKeymap,...this._loadedCodeMirror.searchKeymap,...this._loadedCodeMirror.historyKeymap,...this._loadedCodeMirror.tabKeyBindings,c]),this._loadedCodeMirror.langCompartment.of(this._mode),this._loadedCodeMirror.haTheme,this._loadedCodeMirror.haSyntaxHighlighting,this._loadedCodeMirror.readonlyCompartment.of(this._loadedCodeMirror.EditorView.editable.of(!this.readOnly)),this._loadedCodeMirror.linewrapCompartment.of(this.linewrap?this._loadedCodeMirror.EditorView.lineWrapping:[]),this._loadedCodeMirror.EditorView.updateListener.of(this._onUpdate),this._loadedCodeMirror.foldingCompartment.of(this._getFoldingExtensions())];if(!this.readOnly){const t=[];this.autocompleteEntities&&this.hass&&t.push(this._entityCompletions.bind(this)),this.autocompleteIcons&&t.push(this._mdiCompletions.bind(this)),t.length>0&&e.push(this._loadedCodeMirror.autocompletion({override:t,maxRenderedOptions:10}))}this.codemirror=new this._loadedCodeMirror.EditorView({state:this._loadedCodeMirror.EditorState.create({doc:this._value,extensions:e}),parent:this.renderRoot})}},{kind:"field",key:"_getStates",value:()=>(0,r.Z)((e=>{if(!e)return[];return Object.keys(e).map((t=>({type:"variable",label:t,detail:e[t].attributes.friendly_name,info:`State: ${e[t].state}`})))}))},{kind:"method",key:"_entityCompletions",value:function(e){const t=e.matchBefore(/[a-z_]{3,}\.\w*/);if(!t||t.from===t.to&&!e.explicit)return null;const a=this._getStates(this.hass.states);return a&&a.length?{from:Number(t.from),options:a,validFor:/^[a-z_]{3,}\.\w*$/}:null}},{kind:"field",key:"_getIconItems",value(){return async()=>{if(!this._iconList){let e;e=(await a.e("25016").then(a.t.bind(a,58134,19))).default,this._iconList=e.map((e=>({type:"variable",label:`mdi:${e.name}`,detail:e.keywords.join(", "),info:h})))}return this._iconList}}},{kind:"method",key:"_mdiCompletions",value:async function(e){const t=e.matchBefore(/mdi:\S*/);if(!t||t.from===t.to&&!e.explicit)return null;const a=await this._getIconItems();return{from:Number(t.from),options:a,validFor:/^mdi:\S*$/}}},{kind:"field",key:"_onUpdate",value(){return e=>{e.docChanged&&(this._value=e.state.doc.toString(),(0,d.B)(this,"value-changed",{value:this._value}))}}},{kind:"field",key:"_getFoldingExtensions",value(){return()=>"yaml"===this.mode?[this._loadedCodeMirror.foldGutter(),this._loadedCodeMirror.foldingOnIndent]:[]}},{kind:"field",static:!0,key:"styles",value:()=>s.iv`:host(.error-state) .cm-gutters{border-color:var(--error-state-color,red)}`}]}}),s.fl)},65981:function(e,t,a){a.r(t),a.d(t,{HaIcon:()=>_});var i=a(44249),o=a(72621),s=a(57243),n=a(15093),r=a(36522),d=a(22381),l=a(80654),c=(a(92745),a(9359),a(31526),a(27608)),h=a(27486),u=a(37394);const f=JSON.parse('{"version":"7.4.47","parts":[{"file":"7a7139d465f1f41cb26ab851a17caa21a9331234"},{"start":"account-supervisor-circle-","file":"9561286c4c1021d46b9006596812178190a7cc1c"},{"start":"alpha-r-c","file":"eb466b7087fb2b4d23376ea9bc86693c45c500fa"},{"start":"arrow-decision-o","file":"4b3c01b7e0723b702940c5ac46fb9e555646972b"},{"start":"baby-f","file":"2611401d85450b95ab448ad1d02c1a432b409ed2"},{"start":"battery-hi","file":"89bcd31855b34cd9d31ac693fb073277e74f1f6a"},{"start":"blur-r","file":"373709cd5d7e688c2addc9a6c5d26c2d57c02c48"},{"start":"briefcase-account-","file":"a75956cf812ee90ee4f656274426aafac81e1053"},{"start":"calendar-question-","file":"3253f2529b5ebdd110b411917bacfacb5b7063e6"},{"start":"car-lig","file":"74566af3501ad6ae58ad13a8b6921b3cc2ef879d"},{"start":"cellphone-co","file":"7677f1cfb2dd4f5562a2aa6d3ae43a2e6997b21a"},{"start":"circle-slice-2","file":"70d08c50ec4522dd75d11338db57846588263ee2"},{"start":"cloud-co","file":"141d2bfa55ca4c83f4bae2812a5da59a84fec4ff"},{"start":"cog-s","file":"5a640365f8e47c609005d5e098e0e8104286d120"},{"start":"cookie-l","file":"dd85b8eb8581b176d3acf75d1bd82e61ca1ba2fc"},{"start":"currency-eur-","file":"15362279f4ebfc3620ae55f79d2830ad86d5213e"},{"start":"delete-o","file":"239434ab8df61237277d7599ebe066c55806c274"},{"start":"draw-","file":"5605918a592070803ba2ad05a5aba06263da0d70"},{"start":"emoticon-po","file":"a838cfcec34323946237a9f18e66945f55260f78"},{"start":"fan","file":"effd56103b37a8c7f332e22de8e4d67a69b70db7"},{"start":"file-question-","file":"b2424b50bd465ae192593f1c3d086c5eec893af8"},{"start":"flask-off-","file":"3b76295cde006a18f0301dd98eed8c57e1d5a425"},{"start":"food-s","file":"1c6941474cbeb1755faaaf5771440577f4f1f9c6"},{"start":"gamepad-u","file":"c6efe18db6bc9654ae3540c7dee83218a5450263"},{"start":"google-f","file":"df341afe6ad4437457cf188499cb8d2df8ac7b9e"},{"start":"head-c","file":"282121c9e45ed67f033edcc1eafd279334c00f46"},{"start":"home-pl","file":"27e8e38fc7adcacf2a210802f27d841b49c8c508"},{"start":"inbox-","file":"0f0316ec7b1b7f7ce3eaabce26c9ef619b5a1694"},{"start":"key-v","file":"ea33462be7b953ff1eafc5dac2d166b210685a60"},{"start":"leaf-circle-","file":"33db9bbd66ce48a2db3e987fdbd37fb0482145a4"},{"start":"lock-p","file":"b89e27ed39e9d10c44259362a4b57f3c579d3ec8"},{"start":"message-s","file":"7b5ab5a5cadbe06e3113ec148f044aa701eac53a"},{"start":"moti","file":"01024d78c248d36805b565e343dd98033cc3bcaf"},{"start":"newspaper-variant-o","file":"22a6ec4a4fdd0a7c0acaf805f6127b38723c9189"},{"start":"on","file":"c73d55b412f394e64632e2011a59aa05e5a1f50d"},{"start":"paw-ou","file":"3f669bf26d16752dc4a9ea349492df93a13dcfbf"},{"start":"pigg","file":"0c24edb27eb1c90b6e33fc05f34ef3118fa94256"},{"start":"printer-pos-sy","file":"41a55cda866f90b99a64395c3bb18c14983dcf0a"},{"start":"read","file":"c7ed91552a3a64c9be88c85e807404cf705b7edf"},{"start":"robot-vacuum-variant-o","file":"917d2a35d7268c0ea9ad9ecab2778060e19d90e0"},{"start":"sees","file":"6e82d9861d8fac30102bafa212021b819f303bdb"},{"start":"shoe-f","file":"e2fe7ce02b5472301418cc90a0e631f187b9f238"},{"start":"snowflake-m","file":"a28ba9f5309090c8b49a27ca20ff582a944f6e71"},{"start":"st","file":"7e92d03f095ec27e137b708b879dfd273bd735ab"},{"start":"su","file":"61c74913720f9de59a379bdca37f1d2f0dc1f9db"},{"start":"tag-plus-","file":"8f3184156a4f38549cf4c4fffba73a6a941166ae"},{"start":"timer-a","file":"baab470d11cfb3a3cd3b063ee6503a77d12a80d0"},{"start":"transit-d","file":"8561c0d9b1ac03fab360fd8fe9729c96e8693239"},{"start":"vector-arrange-b","file":"c9a3439257d4bab33d3355f1f2e11842e8171141"},{"start":"water-ou","file":"02dbccfb8ca35f39b99f5a085b095fc1275005a0"},{"start":"webc","file":"57bafd4b97341f4f2ac20a609d023719f23a619c"},{"start":"zip","file":"65ae094e8263236fa50486584a08c03497a38d93"}]}'),p=(0,h.Z)((async()=>{const e=(0,c.MT)("hass-icon-db","mdi-icon-store");{const t=await(0,c.U2)("_version",e);t?t!==f.version&&(await(0,c.ZH)(e),(0,c.t8)("_version",f.version,e)):(0,c.t8)("_version",f.version,e)}return e})),v=["mdi","hass","hassio","hademo"];let b=[];a(37583);const g={},m={},y=(0,d.D)((()=>(async e=>{const t=Object.keys(e),a=await Promise.all(Object.values(e));(await p())("readwrite",(i=>{a.forEach(((a,o)=>{Object.entries(a).forEach((([e,t])=>{i.put(t,e)})),delete e[t[o]]}))}))})(m)),2e3),k={};let _=(0,i.Z)([(0,n.Mo)("ha-icon")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,n.Cb)()],key:"icon",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_path",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_secondaryPath",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_viewBox",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_legacy",value:()=>!1},{kind:"method",key:"willUpdate",value:function(e){(0,o.Z)(i,"willUpdate",this,3)([e]),e.has("icon")&&(this._path=void 0,this._secondaryPath=void 0,this._viewBox=void 0,this._loadIcon())}},{kind:"method",key:"render",value:function(){return this.icon?this._legacy?s.dy` <iron-icon .icon="${this.icon}"></iron-icon>`:s.dy`<ha-svg-icon .path="${this._path}" .secondaryPath="${this._secondaryPath}" .viewBox="${this._viewBox}"></ha-svg-icon>`:s.Ld}},{kind:"method",key:"_loadIcon",value:async function(){if(!this.icon)return;const e=this.icon,[t,i]=this.icon.split(":",2);let o,s=i;if(!t||!s)return;if(!v.includes(t)){const a=l.g[t];return a?void(a&&"function"==typeof a.getIcon&&this._setCustomPath(a.getIcon(s),e)):void(this._legacy=!0)}if(this._legacy=!1,s in g){const e=g[s];let a;e.newName?(a=`Icon ${t}:${s} was renamed to ${t}:${e.newName}, please change your config, it will be removed in version ${e.removeIn}.`,s=e.newName):a=`Icon ${t}:${s} was removed from MDI, please replace this icon with an other icon in your config, it will be removed in version ${e.removeIn}.`,console.warn(a),(0,r.B)(this,"write_log",{level:"warning",message:a})}if(s in k)return void(this._path=k[s]);if("home-assistant"===s){const t=(await a.e("48348").then(a.bind(a,30511))).mdiHomeAssistant;return this.icon===e&&(this._path=t),void(k[s]=t)}try{o=await(e=>new Promise(((t,a)=>{if(b.push([e,t,a]),b.length>1)return;const i=p();(0,u.n)(1e3,(async()=>{(await i)("readonly",(e=>{for(const[t,a,i]of b)(0,c.RV)(e.get(t)).then((e=>a(e))).catch((e=>i(e)));b=[]}))})()).catch((e=>{for(const[,,t]of b)t(e);b=[]}))})))(s)}catch(e){o=void 0}if(o)return this.icon===e&&(this._path=o),void(k[s]=o);const n=(e=>{let t;for(const a of f.parts){if(void 0!==a.start&&e<a.start)break;t=a}return t.file})(s);if(n in m)return void this._setPath(m[n],s,e);const d=fetch(`/static/mdi/${n}.json`).then((e=>e.json()));m[n]=d,this._setPath(d,s,e),y()}},{kind:"method",key:"_setCustomPath",value:async function(e,t){const a=await e;this.icon===t&&(this._path=a.path,this._secondaryPath=a.secondaryPath,this._viewBox=a.viewBox)}},{kind:"method",key:"_setPath",value:async function(e,t,a){const i=await e;this.icon===a&&(this._path=i[t]),k[t]=i[t]}},{kind:"field",static:!0,key:"styles",value:()=>s.iv`:host{fill:currentcolor}`}]}}),s.oi)},2790:function(e,t,a){a.a(e,(async function(e,i){try{a.d(t,{getLanguageOptions:()=>b});var o=a(44249),s=a(72621),n=a(16485),r=(a(9359),a(70104),a(57243)),d=a(15093),l=a(27486),c=a(36522),h=a(49976),u=a(94369),f=a(1416),p=a(67862),v=(a(7285),a(92824),e([n,u]));[n,u]=v.then?(await v)():v;const b=(e,t,a,i)=>{let o=[];if(t){const t=p.o.translations;o=e.map((e=>{let a=t[e]?.nativeName;if(!a)try{a=new Intl.DisplayNames(e,{type:"language",fallback:"code"}).of(e)}catch(t){a=e}return{value:e,label:a}}))}else i&&(o=e.map((e=>({value:e,label:(0,u.u)(e,i)}))));return!a&&i&&o.sort(((e,t)=>(0,f.fe)(e.label,t.label,i.language))),o};(0,o.Z)([(0,d.Mo)("ha-language-picker")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",decorators:[(0,d.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Array})],key:"languages",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"required",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({attribute:"native-name",type:Boolean})],key:"nativeName",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({attribute:"no-sort",type:Boolean})],key:"noSort",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({attribute:"inline-arrow",type:Boolean})],key:"inlineArrow",value:()=>!1},{kind:"field",decorators:[(0,d.SB)()],key:"_defaultLanguages",value:()=>[]},{kind:"field",decorators:[(0,d.IO)("ha-select")],key:"_select",value:void 0},{kind:"method",key:"firstUpdated",value:function(e){(0,s.Z)(a,"firstUpdated",this,3)([e]),this._computeDefaultLanguageOptions()}},{kind:"method",key:"updated",value:function(e){(0,s.Z)(a,"updated",this,3)([e]);const t=e.has("hass")&&this.hass&&e.get("hass")&&e.get("hass").locale.language!==this.hass.locale.language;if(e.has("languages")||e.has("value")||t){if(this._select.layoutOptions(),this._select.value!==this.value&&(0,c.B)(this,"value-changed",{value:this._select.value}),!this.value)return;const e=this._getLanguagesOptions(this.languages??this._defaultLanguages,this.nativeName,this.noSort,this.hass?.locale).findIndex((e=>e.value===this.value));-1===e&&(this.value=void 0),t&&this._select.select(e)}}},{kind:"field",key:"_getLanguagesOptions",value:()=>(0,l.Z)(b)},{kind:"method",key:"_computeDefaultLanguageOptions",value:function(){this._defaultLanguages=Object.keys(p.o.translations)}},{kind:"method",key:"render",value:function(){const e=this._getLanguagesOptions(this.languages??this._defaultLanguages,this.nativeName,this.noSort,this.hass?.locale),t=this.value??(this.required?e[0]?.value:this.value);return r.dy` <ha-select .label="${this.label??(this.hass?.localize("ui.components.language-picker.language")||"Language")}" .value="${t||""}" .required="${this.required}" .disabled="${this.disabled}" @selected="${this._changed}" @closed="${h.U}" fixedMenuPosition naturalMenuWidth .inlineArrow="${this.inlineArrow}"> ${0===e.length?r.dy`<ha-list-item value="">${this.hass?.localize("ui.components.language-picker.no_languages")||"No languages"}</ha-list-item>`:e.map((e=>r.dy` <ha-list-item .value="${e.value}">${e.label}</ha-list-item> `))} </ha-select> `}},{kind:"field",static:!0,key:"styles",value:()=>r.iv`ha-select{width:100%}`},{kind:"method",key:"_changed",value:function(e){const t=e.target;""!==t.value&&t.value!==this.value&&(this.value=t.value,(0,c.B)(this,"value-changed",{value:this.value}))}}]}}),r.oi);i()}catch(e){i(e)}}))},92824:function(e,t,a){var i=a(44249),o=a(72621),s=a(60930),n=a(9714),r=a(57243),d=a(15093),l=a(22381),c=a(76320);a(23334);(0,i.Z)([(0,d.Mo)("ha-select")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,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:"field",decorators:[(0,d.Cb)()],key:"options",value:void 0},{kind:"method",key:"render",value:function(){return r.dy` ${(0,o.Z)(a,"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)(a,"connectedCallback",this,3)([]),window.addEventListener("translations-updated",this._translationsUpdated)}},{kind:"method",key:"firstUpdated",value:async function(){(0,o.Z)(a,"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)(a,"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")}e.get("options")&&(this.layoutOptions(),this.selectByValue(this.value))}},{kind:"method",key:"disconnectedCallback",value:function(){(0,o.Z)(a,"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:()=>[n.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}`]}]}}),s.K)},40917:function(e,t,a){var i=a(44249),o=a(72621),s=a(27323),n=a(33990),r=a(88540),d=a(57243),l=a(15093);(0,i.Z)([(0,l.Mo)("ha-textarea")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",decorators:[(0,l.Cb)({type:Boolean,reflect:!0})],key:"autogrow",value:()=>!1},{kind:"method",key:"updated",value:function(e){(0,o.Z)(a,"updated",this,3)([e]),this.autogrow&&e.has("value")&&(this.mdcRoot.dataset.value=this.value+'=​"')}},{kind:"field",static:!0,key:"styles",value:()=>[n.W,r.W,d.iv`:host([autogrow]) .mdc-text-field{position:relative;min-height:74px;min-width:178px;max-height:200px}:host([autogrow]) .mdc-text-field:after{content:attr(data-value);margin-top:23px;margin-bottom:9px;line-height:1.5rem;min-height:42px;padding:0px 32px 0 16px;letter-spacing:var( --mdc-typography-subtitle1-letter-spacing, .009375em );visibility:hidden;white-space:pre-wrap}:host([autogrow]) .mdc-text-field__input{position:absolute;height:calc(100% - 32px)}:host([autogrow]) .mdc-text-field.mdc-text-field--no-label:after{margin-top:16px;margin-bottom:16px}.mdc-floating-label{inset-inline-start:16px!important;inset-inline-end:initial!important;transform-origin:var(--float-start) top}@media only screen and (min-width:459px){:host([mobile-multiline]) .mdc-text-field__input{white-space:nowrap;max-height:16px}}`]}]}}),s.O)},42740:function(e,t,a){a.d(t,{KH:()=>r,T1:()=>n,rM:()=>s,zt:()=>o});var i=a(95262);let o=function(e){return e[e.CONTROL=1]="CONTROL",e}({});const s=(e,t,a)=>e.callWS({type:"conversation/agent/list",language:t,country:a}),n=(e,t,a,o)=>e.callWS({type:"conversation/agent/homeassistant/debug",sentences:(0,i.r)(t),language:a,device_id:o}),r=(e,t,a)=>e.callWS({type:"conversation/agent/homeassistant/language_scores",language:t,country:a})},80654:function(e,t,a){a.d(t,{g:()=>n});const i=window;"customIconsets"in i||(i.customIconsets={});const o=i.customIconsets,s=window;"customIcons"in s||(s.customIcons={});const n=new Proxy(s.customIcons,{get:(e,t)=>e[t]??(o[t]?{getIcon:o[t]}:void 0)})},6736:function(e,t,a){a.d(t,{f:()=>n});var i=a(44249),o=a(72621),s=(a(9359),a(52924),a(15093));const n=e=>(0,i.Z)(null,(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",key:"hassSubscribeRequiredHostProps",value:void 0},{kind:"field",key:"__unsubs",value:void 0},{kind:"method",key:"connectedCallback",value:function(){(0,o.Z)(a,"connectedCallback",this,3)([]),this._checkSubscribed()}},{kind:"method",key:"disconnectedCallback",value:function(){if((0,o.Z)(a,"disconnectedCallback",this,3)([]),this.__unsubs){for(;this.__unsubs.length;){const e=this.__unsubs.pop();e instanceof Promise?e.then((e=>e())):e()}this.__unsubs=void 0}}},{kind:"method",key:"updated",value:function(e){if((0,o.Z)(a,"updated",this,3)([e]),e.has("hass"))this._checkSubscribed();else if(this.hassSubscribeRequiredHostProps)for(const t of e.keys())if(this.hassSubscribeRequiredHostProps.includes(t))return void this._checkSubscribed()}},{kind:"method",key:"hassSubscribe",value:function(){return[]}},{kind:"method",key:"_checkSubscribed",value:function(){void 0===this.__unsubs&&this.isConnected&&void 0!==this.hass&&!this.hassSubscribeRequiredHostProps?.some((e=>void 0===this[e]))&&(this.__unsubs=this.hassSubscribe())}}]}}),e)},36515:function(e,t,a){a.a(e,(async function(e,i){try{a.r(t);var o=a(44249),s=(a(92745),a(9359),a(56475),a(1331),a(31526),a(70104),a(76848)),n=a(57243),r=a(15093),d=a(68958),l=a(94369),c=(a(99426),a(59826),a(54977),a(68325),a(2790)),h=(a(40917),a(42740)),u=a(6736),f=a(28008),p=a(58014),v=e([c,l]);[c,l]=v.then?(await v)():v;const b="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z",g="M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M9,8H11V17H9V8M13,8H15V17H13V8Z";(0,o.Z)([(0,r.Mo)("developer-tools-assist")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"narrow",value:()=>!1},{kind:"field",decorators:[(0,r.SB)()],key:"supportedLanguages",value:void 0},{kind:"field",decorators:[(0,d.t)({key:"assist_debug_language",state:!0,subscribe:!1,storage:"localStorage"})],key:"_language",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_results",value:()=>[]},{kind:"field",decorators:[(0,r.IO)("#sentences-input")],key:"_sentencesInput",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_validInput",value:()=>!1},{kind:"method",key:"_languageChanged",value:function(e){this._language=e.detail.value}},{kind:"method",key:"_handleKeyDown",value:function(e){"Enter"!==e.code||e.shiftKey||(e.preventDefault(),this._parse())}},{kind:"method",key:"_textAreaInput",value:function(e){const t=e.target.value,a=Boolean(t);a!==this._validInput&&(this._validInput=a)}},{kind:"method",key:"_parse",value:async function(){const e=this._sentencesInput.value.split("\n").filter((e=>""!==e)),{results:t}=await(0,h.T1)(this.hass,e,this._language);this._sentencesInput.value="";const a=[];e.forEach(((e,i)=>{const o=t[i];a.push({sentence:e,language:this._language,result:o})})),this._results=[...a,...this._results]}},{kind:"method",key:"_fetchLanguages",value:async function(){const{agents:e}=await(0,h.rM)(this.hass),t=e.find((e=>"conversation.home_assistant"===e.id));this.supportedLanguages="*"===t?.supported_languages?void 0:t?.supported_languages,!this._language&&this.supportedLanguages?.includes(this.hass.locale.language)?this._language=this.hass.locale.language:this._language||(this._language="en")}},{kind:"method",key:"firstUpdated",value:function(){this._fetchLanguages()}},{kind:"method",key:"render",value:function(){return n.dy` <div class="content"> <ha-card .header="${this.hass.localize("ui.panel.developer-tools.tabs.assist.title")}" class="form"> <div class="card-content"> <p class="description"> ${this.hass.localize("ui.panel.developer-tools.tabs.assist.description")} </p> ${this.supportedLanguages?n.dy` <ha-language-picker .languages="${this.supportedLanguages}" .hass="${this.hass}" .value="${this._language}" @value-changed="${this._languageChanged}"></ha-language-picker> `:n.Ld} <ha-textarea autogrow .label="${this.hass.localize("ui.panel.developer-tools.tabs.assist.sentences")}" id="sentences-input" @input="${this._textAreaInput}" @keydown="${this._handleKeyDown}"></ha-textarea> </div> <div class="card-actions"> <ha-button @click="${this._parse}" .disabled="${!this._language||!this._validInput}"> ${this.hass.localize("ui.panel.developer-tools.tabs.assist.parse_sentences")} </ha-button> </div> </ha-card> ${this._results.length?n.dy` <div class="result-toolbar"> <ha-button outlined @click="${this._clear}" destructive> <ha-svg-icon slot="icon" .path="${g}"></ha-svg-icon> ${this.hass.localize("ui.common.clear")} </ha-button> <ha-button outlined @click="${this._download}"> <ha-svg-icon slot="icon" .path="${b}"></ha-svg-icon> ${this.hass.localize("ui.panel.developer-tools.tabs.assist.download_results")} </ha-button> </div> `:""} ${this._results.map((e=>{const{sentence:t,result:a,language:i}=e,o=null!=a;return n.dy` <ha-card class="result"> <div class="card-content"> <div class="sentence"> <p>${t}</p> <p>${o?"✅":"❌"}</p> </div> <div class="info"> ${this.hass.localize("ui.panel.developer-tools.tabs.assist.language")}: ${(0,l.u)(i,this.hass.locale)} (${i}) </div> ${a?n.dy` <ha-code-editor mode="yaml" .hass="${this.hass}" .value="${(0,s.dump)(a).trimRight()}" read-only dir="ltr"></ha-code-editor> `:n.dy`<ha-alert alert-type="error"> ${this.hass.localize("ui.panel.developer-tools.tabs.assist.no_match")} </ha-alert>`} </div> </ha-card> `}))} </div> `}},{kind:"method",key:"_download",value:function(){(0,p.N)(`data:text/plain;charset=utf-8,${encodeURIComponent(JSON.stringify({results:this._results},null,2))}`,"intent_results.json")}},{kind:"method",key:"_clear",value:function(){this._results=[]}},{kind:"get",static:!0,key:"styles",value:function(){return[f.Qx,n.iv`.content{padding:28px 20px 16px;padding:max(28px,calc(12px + env(safe-area-inset-top))) max(20px,calc(4px + env(safe-area-inset-right))) max(16px,env(safe-area-inset-bottom)) max(20px,calc(4px + env(safe-area-inset-left)));max-width:1040px;margin:0 auto}.description{margin:0;margin-bottom:16px}ha-textarea{width:100%}.card-actions{text-align:right}.form{margin-bottom:16px}.result-toolbar{text-align:center;margin-bottom:16px}.result{margin-bottom:16px}.sentence{font-weight:500;margin-bottom:8px;display:flex;flex-direction:row;justify-content:space-between}.sentence p{margin:0}.info p{margin:0}ha-alert,ha-code-editor{display:block;margin-top:16px}`]}}]}}),(0,u.f)(n.oi));i()}catch(e){i(e)}}))},16485:function(e,t,a){a.a(e,(async function(e,t){try{a(92745);var i=a(61449),o=a(40574),s=a(30532),n=a(41674),r=a(49722),d=a(76632),l=a(7884),c=a(35185),h=a(60933),u=a(44180),f=a(49447);const e=async()=>{const e=(0,u.sS)(),t=[];(0,s.shouldPolyfill)()&&await Promise.all([a.e("80210"),a.e("74055")]).then(a.bind(a,98133)),(0,r.shouldPolyfill)()&&await Promise.all([a.e("83895"),a.e("75297"),a.e("80210"),a.e("60251")]).then(a.bind(a,59095)),(0,i.shouldPolyfill)(e)&&t.push(Promise.all([a.e("83895"),a.e("75297"),a.e("68250")]).then(a.bind(a,80561)).then((()=>(0,f.H)()))),(0,h.shouldPolyfill)()&&t.push(Promise.all([a.e("83895"),a.e("75297"),a.e("65578")]).then(a.bind(a,97995))),(0,o.shouldPolyfill)(e)&&t.push(Promise.all([a.e("83895"),a.e("75297"),a.e("59826")]).then(a.bind(a,31514))),(0,n.shouldPolyfill)(e)&&t.push(Promise.all([a.e("83895"),a.e("75297"),a.e("23649")]).then(a.bind(a,93840))),(0,d.shouldPolyfill)(e)&&t.push(Promise.all([a.e("83895"),a.e("75297"),a.e("42831")]).then(a.bind(a,29559))),(0,l.shouldPolyfill)(e)&&t.push(Promise.all([a.e("83895"),a.e("75297"),a.e("57377")]).then(a.bind(a,39030)).then((()=>a.e("61236").then(a.t.bind(a,4121,23))))),(0,c.shouldPolyfill)(e)&&t.push(Promise.all([a.e("83895"),a.e("75297"),a.e("13870")]).then(a.bind(a,74546))),0!==t.length&&await Promise.all(t).then((()=>(0,f.n)(e)))};await e(),t()}catch(e){t(e)}}),1)},58014:function(e,t,a){a.d(t,{N:()=>o,G:()=>s});var i=a(18117);const o=(e,t="")=>{const a=document.createElement("a");a.target="_blank",a.href=e,a.download=t,a.style.display="none",document.body.appendChild(a),a.dispatchEvent(new MouseEvent("click")),document.body.removeChild(a)},s=e=>!(e=>!!e.auth.external&&i.G)(e)||!!e.auth.external?.config.downloadFileSupported},18117:function(e,t,a){a.d(t,{G:()=>i});const i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}}; //# sourceMappingURL=74950.bdfc63210d01ffa1.js.map