UNPKG

iobroker.lovelace

Version:

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

2 lines 19.9 kB
/*! For license information please see 23331.1a5d9b1c0146f30c.js.LICENSE.txt */ "use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[23331],{65522:function(t,e,i){i.d(e,{A:function(){return o}});i(42762);const o=t=>{var e;return null===(e=t.name)||void 0===e?void 0:e.trim()}},55931:function(t,e,i){i.d(e,{X:function(){return o}});i(42762);const o=t=>{var e;return null===(e=t.name)||void 0===e?void 0:e.trim()}},78978:function(t,e,i){i.d(e,{_:function(){return r}});i(44114),i(33110),i(27495),i(25440),i(62953);var o=i(63533);const r=(t,e)=>{if(!(e instanceof o.C5))return{warnings:[e.message],errors:void 0};const i=[],r=[];for(const o of e.failures())if(void 0===o.value)i.push(t.localize("ui.errors.config.key_missing",{key:o.path.join(".")}));else if("never"===o.type)r.push(t.localize("ui.errors.config.key_not_expected",{key:o.path.join(".")}));else{if("union"===o.type)continue;"enums"===o.type?r.push(t.localize("ui.errors.config.key_wrong_type",{key:o.path.join("."),type_correct:o.message.replace("Expected ","").split(", ")[0],type_wrong:JSON.stringify(o.value)})):r.push(t.localize("ui.errors.config.key_wrong_type",{key:o.path.join("."),type_correct:o.refinement||o.type,type_wrong:JSON.stringify(o.value)}))}return{warnings:r,errors:i}}},63130:function(t,e,i){i.d(e,{l:function(){return r}});i(3362);var o=i(50248);const r=async(t,e)=>{var i;if(navigator.clipboard)try{return void(await navigator.clipboard.writeText(t))}catch(s){}const r=e||(null===(i=(0,o.n)())||void 0===i?void 0:i.getRootNode())||document.body,n=document.createElement("textarea");n.value=t,n.setAttribute("readonly",""),n.style.position="fixed",n.style.top="0",n.style.left="0",n.style.opacity="0",r.appendChild(n),n.select(),document.execCommand("copy"),r.removeChild(n)}},19459:function(t,e,i){i.d(e,{b:function(){return o}});i(45367),i(92731),i(84864),i(57465),i(27495),i(69479),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);const o=(t,e,i)=>{if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){if(t.constructor!==e.constructor)return!1;let r,n;if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;0!==r--;)if(!o(t[r],e[r],i))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;for(r of t.entries())if(!o(r[1],e.get(r[0]),i))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!==e.length)return!1;for(r=n;0!==r--;)if(t[r]!==e[r])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const s=Object.keys(t);if(n=s.length,n!==Object.keys(e).length)return!1;for(r=n;0!==r--;)if(!Object.prototype.hasOwnProperty.call(e,s[r]))return!1;for(r=n;0!==r--;){const n=s[r];if(!o(t[n],e[n],i))return!1}if(null!=i&&i.compareSymbols){const r=Object.getOwnPropertySymbols(t),n=Object.getOwnPropertySymbols(e);if(r.length!==n.length)return!1;for(const s of r){if(!Object.prototype.hasOwnProperty.call(e,s))return!1;if(!o(t[s],e[s],i))return!1}}return!0}return t!=t&&e!=e}},10763:function(t,e,i){i.a(t,async function(t,e){try{i(3362),i(62953);var o=i(40445),r=i(53289),n=i(5124),s=i(67576),a=i(35211),l=i(1087),d=i(63130),h=i(14503),c=i(81619),u=i(18350),g=i(15717),p=i(22792),f=t([u,g]);[u,g]=f.then?(await f)():f;let y,m,_,v,b,C=t=>t;const E=t=>{if("object"!=typeof t||null===t)return!1;for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0};class w extends n.WF{setValue(t){try{this._yaml=E(t)?"":(0,r.dump)(t,{schema:this.yamlSchema,quotingType:'"',noRefs:!0})}catch(e){console.error(e,t),alert(`There was an error converting to YAML: ${e}`)}}firstUpdated(){void 0!==this.defaultValue&&this.setValue(this.defaultValue)}willUpdate(t){super.willUpdate(t),this.autoUpdate&&t.has("value")&&this.setValue(this.value)}focus(){var t,e;null!==(t=this._codeEditor)&&void 0!==t&&t.codemirror&&(null===(e=this._codeEditor)||void 0===e||e.codemirror.focus())}disableCodeEditorFullscreen(){this.disableFullscreen=!0,this._codeEditor&&(this._codeEditor.disableFullscreen=!0)}render(){return void 0===this._yaml?n.s6:(0,n.qy)(y||(y=C` ${0} <ha-code-editor .value="${0}" .readOnly="${0}" .disableFullscreen="${0}" .inDialog="${0}" mode="yaml" lint autocomplete-entities autocomplete-icons .error="${0}" @value-changed="${0}" @editor-save="${0}" dir="ltr"></ha-code-editor> ${0} `),this.label?(0,n.qy)(m||(m=C`<p>${0}${0}</p>`),this.label,this.required?" *":""):n.s6,this._yaml,this.readOnly,this.disableFullscreen,this.inDialog,!1===this.isValid,this._onChange,this._onEditorSave,this.copyClipboard||this.hasExtraActions?(0,n.qy)(_||(_=C` <div class="card-actions"> ${0} <slot name="extra-actions"></slot> </div> `),this.copyClipboard?(0,n.qy)(v||(v=C` <ha-button appearance="plain" @click="${0}"> ${0} </ha-button> `),this._copyYaml,this._i18n.localize("ui.components.yaml-editor.copy_to_clipboard")):n.s6):n.s6)}_onChange(t){var e;let i;t.stopPropagation(),this._yaml=t.detail.value;let o,n=!0,s=null;if(this._yaml)try{i=(0,r.Hh)(this._yaml,{schema:this.yamlSchema})}catch(a){n=!1,s=a,o=`${this._i18n.localize("ui.components.yaml-editor.error",{reason:a.reason})}${a.mark?` (${this._i18n.localize("ui.components.yaml-editor.error_location",{line:a.mark.line+1,column:a.mark.column+1})})`:""}`}else i={};null===(e=this._codeEditor)||void 0===e||e.setYamlError(s),this.value=i,this.isValid=n,(0,l.r)(this,"value-changed",{value:i,isValid:n,errorMsg:o})}get yaml(){return this._yaml}get codemirror(){var t;return null===(t=this._codeEditor)||void 0===t?void 0:t.codemirror}get hasComments(){var t,e;return null!==(t=null===(e=this._codeEditor)||void 0===e?void 0:e.hasComments)&&void 0!==t&&t}_onEditorSave(t){(0,l.r)(this,"editor-save"),t.stopPropagation()}async _copyYaml(){this.yaml&&(await(0,d.l)(this.yaml),(0,c.P)(this,{message:this._i18n.localize("ui.common.copied_clipboard")}))}static get styles(){return[h.RF,(0,n.AH)(b||(b=C`.card-actions{border-radius:var(--actions-border-radius,var(--ha-border-radius-square) var(--ha-border-radius-square) var(--ha-card-border-radius,var(--ha-border-radius-lg)) var(--ha-card-border-radius,var(--ha-border-radius-lg)));border:1px solid var(--divider-color);padding:5px 16px}ha-code-editor{flex-grow:1;min-height:0}`))]}constructor(...t){super(...t),this.yamlSchema=r.my,this.isValid=!0,this.autoUpdate=!1,this.readOnly=!1,this.disableFullscreen=!1,this.inDialog=!1,this.required=!1,this.copyClipboard=!1,this.hasExtraActions=!1,this._yaml=""}}(0,o.Cg)([(0,s.MZ)()],w.prototype,"value",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],w.prototype,"yamlSchema",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],w.prototype,"defaultValue",void 0),(0,o.Cg)([(0,s.MZ)({attribute:"is-valid",type:Boolean})],w.prototype,"isValid",void 0),(0,o.Cg)([(0,s.MZ)()],w.prototype,"label",void 0),(0,o.Cg)([(0,s.MZ)({attribute:"auto-update",type:Boolean})],w.prototype,"autoUpdate",void 0),(0,o.Cg)([(0,s.MZ)({attribute:"read-only",type:Boolean})],w.prototype,"readOnly",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,attribute:"disable-fullscreen"})],w.prototype,"disableFullscreen",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,attribute:"in-dialog"})],w.prototype,"inDialog",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],w.prototype,"required",void 0),(0,o.Cg)([(0,s.MZ)({attribute:"copy-clipboard",type:Boolean})],w.prototype,"copyClipboard",void 0),(0,o.Cg)([(0,s.MZ)({attribute:"has-extra-actions",type:Boolean})],w.prototype,"hasExtraActions",void 0),(0,o.Cg)([(0,s.wk)()],w.prototype,"_yaml",void 0),(0,o.Cg)([(0,s.wk)(),(0,a.Fg)({context:p.D5,subscribe:!0})],w.prototype,"_i18n",void 0),(0,o.Cg)([(0,s.P)("ha-code-editor")],w.prototype,"_codeEditor",void 0),w=(0,o.Cg)([(0,s.EM)("ha-yaml-editor")],w),e()}catch(y){e(y)}})},35632:function(t,e,i){i.a(t,async function(t,o){try{i.r(e),i.d(e,{DialogLovelaceDashboardConfigureStrategy:function(){return y}});i(3362),i(62953);var r=i(40445),n=i(5124),s=i(67576),a=i(1087),l=i(18350),d=(i(93444),i(72554)),h=i(14503),c=i(5106),u=t([l,d,c]);[l,d,c]=u.then?(await u)():u;let g,p,f=t=>t;class y extends n.WF{showDialog(t){this._params=t,this._data=t.config.strategy,this._open=!0}closeDialog(){this._open=!1}_dialogClosed(){this._params=void 0,this._data=void 0,(0,a.r)(this,"dialog-closed",{dialog:this.localName})}render(){return this._params&&this._data?(0,n.qy)(g||(g=f` <ha-dialog .open="${0}" prevent-scrim-close header-title="${0}" @closed="${0}"> <div> <hui-dashboard-strategy-element-editor .hass="${0}" .lovelace="${0}" .value="${0}" @config-changed="${0}" autofocus></hui-dashboard-strategy-element-editor> </div> <ha-dialog-footer slot="footer"> <ha-button slot="primaryAction" @click="${0}" .disabled="${0}"> ${0} </ha-button> </ha-dialog-footer> </ha-dialog> `),this._open,this.hass.localize("ui.panel.config.lovelace.dashboards.detail.new_dashboard"),this._dialogClosed,this.hass,this._params.config,this._data,this._handleConfigChanged,this._save,this._submitting,this.hass.localize("ui.common.next")):n.s6}_handleConfigChanged(t){this._data=t.detail.config}async _save(){this._data&&(this._submitting=!0,await this._params.saveConfig(Object.assign(Object.assign({},this._params.config),{},{strategy:this._data})),this._submitting=!1,this.closeDialog())}static get styles(){return[h.nA,(0,n.AH)(p||(p=f``))]}constructor(...t){super(...t),this._open=!1,this._submitting=!1}}(0,r.Cg)([(0,s.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,r.Cg)([(0,s.wk)()],y.prototype,"_params",void 0),(0,r.Cg)([(0,s.wk)()],y.prototype,"_open",void 0),(0,r.Cg)([(0,s.wk)()],y.prototype,"_submitting",void 0),(0,r.Cg)([(0,s.wk)()],y.prototype,"_data",void 0),y=(0,r.Cg)([(0,s.EM)("dialog-lovelace-dashboard-configure-strategy")],y),o()}catch(g){o(g)}})},5106:function(t,e,i){i.a(t,async function(t,e){try{i(3362);var o=i(40445),r=i(67576),n=i(15656),s=i(63277),a=t([s]);s=(a.then?(await a)():a)[0];class l extends s.U{async getConfigElement(){const t=await(0,n.Nu)("dashboard",this.configElementType);if(t&&t.getConfigElement)return t.getConfigElement()}}l=(0,o.Cg)([(0,r.EM)("hui-dashboard-strategy-element-editor")],l),e()}catch(l){e(l)}})},39039:function(t,e,i){i.d(e,{r:function(){return o}});i(16280);class o extends Error{constructor(t,e,i){super(t),this.name="GUISupportError",this.warnings=e,this.errors=i}}},91322:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{m:function(){return O}});i(18111),i(7588),i(61701),i(3362),i(62953);var r=i(40445),n=i(5124),s=i(67576),a=i(74985),l=i(1087),d=i(78978),h=i(19459),c=i(38962),u=i(65829),g=i(10763),p=i(39039),f=t([c,u,g]);[c,u,g]=f.then?(await f)():f;let y,m,_,v,b,C,E,w,$,k,x,M,S=t=>t;class O extends n.WF{get value(){return this._config}set value(t){this._config&&(0,h.b)(t,this._config,{compareSymbols:!0})||(this._config=t,this._errors=void 0,this._setConfig())}_setConfig(){if(!this._errors&&!this._yamlError)try{this._updateConfigElement()}catch(t){this._errors=[t.message]}this.updateComplete.then(()=>{var t;(0,l.r)(this,"config-changed",{config:this.value,error:null===(t=this._errors)||void 0===t?void 0:t.join(", "),guiModeAvailable:!(this.hasWarning||this.hasError||!1===this._guiSupported)})})}get hasWarning(){return void 0!==this._warnings&&this._warnings.length>0}get hasError(){return this._yamlError||void 0!==this._errors&&this._errors.length>0}get GUImode(){return this._guiMode}set GUImode(t){this._guiMode=t,this.updateComplete.then(()=>{(0,l.r)(this,"GUImode-changed",{guiMode:t,guiModeAvailable:!(this.hasWarning||this.hasError||!1===this._guiSupported)})})}toggleMode(){var t;this.GUImode||(null===(t=this._yamlEditor)||void 0===t||t.disableCodeEditorFullscreen());this.GUImode=!this.GUImode}focusYamlEditor(){var t;null!==(t=this._configElement)&&void 0!==t&&t.focusYamlEditor&&this._configElement.focusYamlEditor(),this._yamlEditor&&this._yamlEditor.focus()}async getConfigElement(){}async getConfigForm(){}renderConfigElement(){return(0,n.qy)(y||(y=S`${0}`),this._configElement)}_renderSubElement(){return(0,n.qy)(m||(m=S` <hui-sub-element-editor .hass="${0}" .config="${0}" @go-back="${0}" @config-changed="${0}"> </hui-sub-element-editor> `),this.hass,this._subElementEditorConfig,this._goBack,this._subElementChanged)}_subElementChanged(t){var e,i;t.stopPropagation();const o=t.detail.config;this._subElementEditorConfig=Object.assign(Object.assign({},this._subElementEditorConfig),{},{elementConfig:o}),null===(e=(i=this._subElementEditorConfig).saveElementConfig)||void 0===e||e.call(i,o)}_goBack(t){t.stopPropagation(),this._subElementEditorConfig=void 0}async _editSubElement(t){t.stopPropagation(),await Promise.all([i.e(92769),i.e(3283),i.e(80131),i.e(70183),i.e(67218),i.e(98470),i.e(99788),i.e(58303),i.e(21543),i.e(66283),i.e(46601),i.e(94956),i.e(26092),i.e(39005),i.e(8851),i.e(59704),i.e(25322),i.e(55392),i.e(71572),i.e(55076),i.e(36332),i.e(77563),i.e(15862),i.e(99143),i.e(97500),i.e(12009),i.e(66990),i.e(20282),i.e(87857),i.e(81804),i.e(92363),i.e(53387)]).then(i.bind(i,81287)),this._subElementEditorConfig={type:t.detail.type,elementConfig:t.detail.config,context:t.detail.context,saveElementConfig:t.detail.saveConfig}}render(){var t;return(0,n.qy)(_||(_=S` <div class="wrapper"> ${0} ${0} ${0} ${0} </div> `),this.GUImode?(0,n.qy)(v||(v=S` <div class="gui-editor" @edit-sub-element="${0}"> ${0} </div> `),this._editSubElement,this._loading?(0,n.qy)(b||(b=S` <ha-spinner class="center margin-bot"></ha-spinner> `)):(0,a.P)(this._subElementEditorConfig?this._renderSubElement():this.renderConfigElement())):(0,n.qy)(C||(C=S` <div class="yaml-editor"> <ha-yaml-editor .defaultValue="${0}" autofocus .inDialog="${0}" @value-changed="${0}" @keydown="${0}" dir="ltr"></ha-yaml-editor> </div> `),this._config,this.inDialog,this._handleYAMLChanged,this._ignoreKeydown),!1===this._guiSupported&&!1===this._loading?(0,n.qy)(E||(E=S` <ha-alert alert-type="info" .title="${0}"> ${0} <br> ${0} </ha-alert> `),this.hass.localize("ui.errors.config.visual_editor_not_supported"),this.hass.localize("ui.errors.config.visual_editor_not_supported_reason_type"),this.hass.localize("ui.errors.config.edit_in_yaml_supported")):n.s6,null!==(t=this._errors)&&void 0!==t&&t.length?(0,n.qy)(w||(w=S` <ha-alert alert-type="error" .title="${0}"> <ul> ${0} </ul> </ha-alert> `),this.hass.localize("ui.errors.config.configuration_error"),this._errors.map(t=>(0,n.qy)($||($=S`<li>${0}</li>`),t))):n.s6,this.hasWarning?(0,n.qy)(k||(k=S` <ha-alert alert-type="warning" .title="${0}"> <ul> ${0} </ul> ${0} </ha-alert> `),this.hass.localize("ui.errors.config.visual_editor_not_supported"),this._warnings.map(t=>(0,n.qy)(x||(x=S`<li>${0}</li>`),t)),this.hass.localize("ui.errors.config.edit_in_yaml_supported")):n.s6)}updated(t){super.updated(t),this._configElement&&t.has("hass")&&(this._configElement.hass=this.hass),this._configElement&&"lovelace"in this._configElement&&t.has("lovelace")&&(this._configElement.lovelace=this.lovelace),this._configElement&&t.has("context")&&(this._configElement.context=this.context)}_handleUIConfigChanged(t){if(t.stopPropagation(),!this.GUImode)return;const e=t.detail.config;Object.keys(e).forEach(t=>{void 0===e[t]&&delete e[t]}),this.value=e}_handleYAMLChanged(t){t.stopPropagation(),t.detail.isValid?(this._config=t.detail.value,this._errors=void 0,this._yamlError=!1):this._yamlError=!0,this._setConfig()}async unloadConfigElement(){this._configElement=void 0,this._guiSupported=void 0}async loadConfigElement(){if(this._configElement)return;let t=await this.getConfigElement();if(!t){const e=await this.getConfigForm();if(e){await i.e(15106).then(i.bind(i,15737)),t=document.createElement("hui-form-editor");const{schema:o,assertConfig:r,computeLabel:n,computeHelper:s}=e;t.schema=o,n&&(t.computeLabel=n),s&&(t.computeHelper=s),r&&(t.assertConfig=r)}}t?(t.hass=this.hass,"lovelace"in t&&(t.lovelace=this.lovelace),t.context=this.context,t.addEventListener("config-changed",t=>this._handleUIConfigChanged(t)),this._guiSupported=!0):this._guiSupported=!1,this._configElement=t}async _updateConfigElement(){if(!this.value)return;const t=++this._loadCount;try{if(this._errors=void 0,this._warnings=void 0,await this.loadConfigElement(),this._configElement)try{this._configElement.setConfig(this.value)}catch(i){const t=(0,d._)(this.hass,i);throw new p.r("Config is not supported",t.warnings,t.errors)}else this._guiSupported=!1,this.GUImode=!1}catch(i){if(t!==this._loadCount)return;var e;if(i instanceof p.r)this._warnings=null!==(e=i.warnings)&&void 0!==e?e:[i.message],this._errors=i.errors||void 0;else this._errors=[i.message];this.GUImode=!1}finally{this._loading=!1}}_ignoreKeydown(t){t.stopPropagation()}constructor(...t){super(...t),this.inDialog=!1,this._guiMode=!0,this._loading=!1,this._yamlError=!1,this._loadCount=0}}O.styles=(0,n.AH)(M||(M=S`:host{display:flex}.wrapper{width:100%}.gui-editor,.yaml-editor{padding:8px 0px}ha-code-editor{--code-mirror-max-height:calc(100vh - 245px)}ha-spinner{display:block;margin:auto}`)),(0,r.Cg)([(0,s.MZ)({attribute:!1})],O.prototype,"hass",void 0),(0,r.Cg)([(0,s.MZ)({attribute:!1})],O.prototype,"lovelace",void 0),(0,r.Cg)([(0,s.MZ)({attribute:!1})],O.prototype,"context",void 0),(0,r.Cg)([(0,s.MZ)({type:Boolean,attribute:"in-dialog"})],O.prototype,"inDialog",void 0),(0,r.Cg)([(0,s.wk)()],O.prototype,"_config",void 0),(0,r.Cg)([(0,s.wk)()],O.prototype,"_configElement",void 0),(0,r.Cg)([(0,s.wk)()],O.prototype,"_subElementEditorConfig",void 0),(0,r.Cg)([(0,s.wk)()],O.prototype,"_guiMode",void 0),(0,r.Cg)([(0,s.wk)()],O.prototype,"_errors",void 0),(0,r.Cg)([(0,s.wk)()],O.prototype,"_warnings",void 0),(0,r.Cg)([(0,s.wk)()],O.prototype,"_guiSupported",void 0),(0,r.Cg)([(0,s.wk)()],O.prototype,"_loading",void 0),(0,r.Cg)([(0,s.wk)()],O.prototype,"_yamlError",void 0),(0,r.Cg)([(0,s.P)("ha-yaml-editor")],O.prototype,"_yamlEditor",void 0),o()}catch(y){o(y)}})},63277:function(t,e,i){i.a(t,async function(t,o){try{i.d(e,{U:function(){return l}});i(16280),i(3362);var r=i(40445),n=i(67576),s=i(91322),a=t([s]);s=(a.then?(await a)():a)[0];class l extends s.m{get configElementType(){return this.value?this.value.type:void 0}async loadConfigElement(){if(this._configElementType!==this.configElementType){if(this.unloadConfigElement(),!this.configElementType)throw new Error(this.hass.localize("ui.errors.config.no_type_provided"));this._configElementType=this.configElementType}return super.loadConfigElement()}}(0,r.Cg)([(0,n.wk)()],l.prototype,"_configElementType",void 0),o()}catch(l){o(l)}})},36918:function(t,e,i){i.d(e,{o:function(){return o}});const o=(t,e)=>`https://www.iobroker.net/#${t.language&&t.language.split("-")[0]||"en"}/adapters/adapterref/iobroker.lovelace/README.md#`},69479:function(t,e,i){var o=i(43724),r=i(62106),n=i(65213),s=i(67979);o&&!n.correct&&(r(RegExp.prototype,"flags",{configurable:!0,get:s}),n.correct=!0)},74985:function(t,e,i){i.d(e,{P:function(){return a}});i(88454),i(29452),i(62953);var o=i(5055),r=i(42017),n=i(63937);const s=t=>(0,n.ps)(t)?t._$litType$.h:t.strings,a=(0,r.u$)(class extends r.WL{render(t){return[t]}update(t,[e]){const i=(0,n.qb)(this.it)?s(this.it):null,r=(0,n.qb)(e)?s(e):null;if(null!==i&&(null===r||i!==r)){const e=(0,n.cN)(t).pop();let r=this.et.get(i);if(void 0===r){const t=document.createDocumentFragment();r=(0,o.XX)(o.s6,t),r.setConnected(!1),this.et.set(i,r)}(0,n.mY)(r,[e]),(0,n.Dx)(r,void 0,e)}if(null!==r){if(null===i||i!==r){const e=this.et.get(r);if(void 0!==e){const i=(0,n.cN)(e).pop();(0,n.Jz)(t),(0,n.Dx)(t,void 0,i),(0,n.mY)(t,[i])}}this.it=e}else this.it=void 0;return this.render(e)}constructor(t){super(t),this.et=new WeakMap}})}}]);