glass-easel 0.5.4 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- "use strict";var e;exports.BackendMode=void 0,(e=exports.BackendMode||(exports.BackendMode={}))[e.Shadow=1]="Shadow",e[e.Composed=2]="Composed",e[e.Domlike=3]="Domlike";var t,n=Object.freeze({__proto__:null,BM:{DYNAMIC:!0,SHADOW:!1,COMPOSED:!1,DOMLIKE:!1},get BackendMode(){return exports.BackendMode}}),o=Object.freeze({__proto__:null}),s=Object.freeze({__proto__:null});"undefined"!=typeof process&&process.env.NODE_ENV,exports.DeepCopyKind=void 0,(t=exports.DeepCopyKind||(exports.DeepCopyKind={})).None="none",t.Simple="simple",t.SimpleWithRecursion="simple-recursion";const i={defaultComponentSpace:null,externalComponent:!1,templateEngine:null,styleScope:null,extraStyleScope:null,hostNodeTagName:"wx-x",multipleSlots:!1,dynamicSlots:!1,directSlots:!1,reflectToAttributes:!1,writeFieldsToNode:!0,writeIdToDOM:!1,useMethodCallerListeners:!1,idPrefixGenerator:null,pureDataPattern:null,dataDeepCopy:exports.DeepCopyKind.Simple,propertyPassingDeepCopy:exports.DeepCopyKind.Simple,listenerChangeLifetimes:!1,virtualHost:!1,propertyEarlyInit:!1,throwGlobalError:!1,writeExtraInfoToAttr:!1,backendContext:null,devtool:null},r=(e,t)=>{const n=void 0===t?i:t;if(void 0===e&&n!==i)return n;const o=null!=e?e:{};return{externalComponent:void 0!==o.externalComponent?o.externalComponent:n.externalComponent,templateEngine:void 0!==o.templateEngine?o.templateEngine:n.templateEngine,styleScope:void 0!==o.styleScope?o.styleScope:n.styleScope,hostNodeTagName:void 0!==o.hostNodeTagName?o.hostNodeTagName:n.hostNodeTagName,extraStyleScope:void 0!==o.extraStyleScope?o.extraStyleScope:n.extraStyleScope,multipleSlots:void 0!==o.multipleSlots?o.multipleSlots:n.multipleSlots,dynamicSlots:void 0!==o.dynamicSlots?o.dynamicSlots:n.dynamicSlots,directSlots:void 0!==o.directSlots?o.directSlots:n.directSlots,reflectToAttributes:void 0!==o.reflectToAttributes?o.reflectToAttributes:n.reflectToAttributes,writeFieldsToNode:void 0!==o.writeFieldsToNode?o.writeFieldsToNode:n.writeFieldsToNode,writeIdToDOM:void 0!==o.writeIdToDOM?o.writeIdToDOM:n.writeIdToDOM,useMethodCallerListeners:void 0!==o.useMethodCallerListeners?o.useMethodCallerListeners:n.useMethodCallerListeners,idPrefixGenerator:void 0!==o.idPrefixGenerator?o.idPrefixGenerator:n.idPrefixGenerator,pureDataPattern:void 0!==o.pureDataPattern?o.pureDataPattern:n.pureDataPattern,dataDeepCopy:void 0!==o.dataDeepCopy?o.dataDeepCopy:n.dataDeepCopy,propertyPassingDeepCopy:void 0!==o.propertyPassingDeepCopy?o.propertyPassingDeepCopy:n.propertyPassingDeepCopy,listenerChangeLifetimes:void 0!==o.listenerChangeLifetimes?o.listenerChangeLifetimes:n.listenerChangeLifetimes,virtualHost:void 0!==o.virtualHost?o.virtualHost:n.virtualHost,propertyEarlyInit:void 0!==o.propertyEarlyInit?o.propertyEarlyInit:n.propertyEarlyInit}};class l{constructor(e){this.empty=!0,this._$arr=null,this._$type=e}add(e){this._$arr?this._$arr=this._$arr.concat(e):this._$arr=[e],this.empty=!1}remove(e){let t=null;if(this._$arr){const n=[],o=this._$arr;for(let s=0;s<o.length;s+=1){if(o[s]===e){n.push(...o.slice(s+1)),t=e;break}n.push(o[s])}this._$arr=n,this.empty=0===this._$arr.length}return t}call(e,t,n){const o=this._$arr;let s=!0;if(o)for(let i=0;i<o.length;i+=1){!1===c(this._$type,o[i],e,t,n)&&(s=!1)}return s}}class a{constructor(e){this.empty=!0,this._$arr=null,this._$type=e}add(e,t){const n={f:e,data:t};this._$arr?this._$arr=this._$arr.concat(n):this._$arr=[n],this.empty=!1}remove(e){let t=null;if(this._$arr){const n=[],o=this._$arr;for(let s=0;s<o.length;s+=1){const i=o[s];if(i.f===e){n.push(...o.slice(s+1)),t=i.data;break}n.push(i)}this._$arr=n,this.empty=0===this._$arr.length}return t}call(e,t,n,o,s){const i=this._$arr;let r=!0;if(i)for(let l=0;l<i.length;l+=1){const{f:a,data:d}=i[l];if(!n(d))continue;const h=c(this._$type,a,e,t,o);!1===(s?s(h):h)&&(r=!1)}return r}}let d=()=>{};function c(e,t,n,o,s){try{return t.apply(n,o)}catch(n){return void d(n,`${e||"Listener"} ${t.name||"(anonymous)"}`,s)}}const h=Symbol("TextNode"),u=Symbol("Element"),p=Symbol("NativeNode"),f=Symbol("VirtualNode"),$=Symbol("ShadowRootSymbol"),_=Symbol("Component"),g=e=>!!e&&e[h],m=e=>!!e&&e[u],v=e=>!!e&&e[p],b=e=>!!e&&e[f],S=e=>!!e&&e[$],y=e=>!!e&&e[_],C=e=>{if(m(e)){let t;return t=b(e)?`(virtual):${e.is}`:y(e)?`${e.tagName}:${e.is}`:v(e)?e.is:"(unknown)",`<${t}${(e=>{let t="";if(m(e)){null!==e._$slotName&&(t+=` (slot) name="${e._$slotName}"`),e.id&&(t+=` id="${e.id}"`),e.slot&&(t+=` slot="${e.slot}"`);const n=e.class;n&&(t+=` class="${n}"`),e.style&&(t+=` style="${e.style}"`)}return b(e)||(y(e)?Object.keys(e._$behavior._$propertyMap).forEach((n=>{t+=` ${n}="${String(e.data[n])}"`})):e.attributes.forEach((e=>{t+=` ${e.name}="${String(e.value)}"`}))),t})(e)}>`}return g(e)?e.textContent.trim():null===e?"<(null)>":void 0===e?"<(undefined)>":"<(unknown)>"},w=(e,t,n=0)=>{let o="";for(let e=n;e;e-=1)o+=" ";let s=o+C(e),i=!1;return m(e)&&(y(e)&&(i=e._$external),t?i?(s+=`\n${o} <(external)>`,e.forEachComposedChild((e=>{s+=`\n${w(e,t,n+2)}`}))):e.forEachComposedChild((e=>{s+=`\n${w(e,t,n+1)}`})):e.childNodes.forEach((e=>{s+=`\n${w(e,t,n+1)}`}))),s};let N=!1;const E=new l("error"),x=new l("warning");function k(e,t,n,o){if(!N){N=!0,y(n)&&n.triggerLifetime("error",[e]);const s=!1===E.call(e,[e,t,n,o]);if(N=!1,s)return}if(i.throwGlobalError)throw e;console.error([e instanceof Error?`${e.message}`:String(e),o?`\t@${C(o)}`:void 0,n?`\t${t||""}@${"string"==typeof n?`<${n}>`:C(n||!1)}`:void 0].filter(Boolean).join("\n"))}function O(e,t,n){x.call(null,[e,t||"",n])&&console.warn(e)}d=k;class M extends Error{constructor(e,t,n,o){super(e),this.additionalStack=t,this.relatedComponent=n,this.element=o,k(this,t,n,o)}}const L=["touchstart","touchmove","touchend","touchcancel","mousedown","mousemove","mouseout","mouseover","mouseup","click"];var D;!function(e){e[e.Fragment=0]="Fragment",e[e.Element=1]="Element",e[e.TextNode=2]="TextNode",e[e.Component=3]="Component",e[e.VirtualNode=4]="VirtualNode"}(D||(D={}));class A{constructor(){this.mode=1,this._$styleSheetIdInc=1,this._$renderCallbacks=null,this._$shadowRoot=new B}destroy(){}getWindowWidth(){return 1}getWindowHeight(){return 1}getDevicePixelRatio(){return 1}getTheme(){return"light"}registerStyleSheetContent(e,t){}appendStyleSheetPath(e,t){const n=this._$styleSheetIdInc;return this._$styleSheetIdInc+=1,n}disableStyleSheet(e){}render(e){if(this._$renderCallbacks)this._$renderCallbacks.push(e);else{const t=this._$renderCallbacks=[e];setTimeout((()=>{this._$renderCallbacks=null,t.forEach((e=>{c("Render Callback",e,this,[null])}))}),16)}}getRootNode(){return this._$shadowRoot}createFragment(){return new T(0)}onEvent(e,t){}}class T{constructor(e){this._$shadowRoot=3===e?new B:null}release(){}associateValue(e){}getShadowRoot(){return this._$shadowRoot||void 0}appendChild(e){}removeChild(e,t){}insertBefore(e,t,n){}replaceChild(e,t,n){}spliceBefore(e,t,n){}spliceAppend(e){}spliceRemove(e,t){}setId(e){}setSlotName(e){}setContainingSlot(e){}reassignContainingSlot(e,t){}spliceBeforeSlotNodes(e,t,n){}spliceRemoveSlotNodes(e,t){}spliceAppendSlotNodes(e){}setInheritSlots(){}setStyle(e){}addClass(e){}removeClass(e){}clearClasses(){}setClassAlias(e,t){}setAttribute(e,t){}removeAttribute(e){}setDataset(e,t){}setText(e){}setListenerStats(e,t,n){}setModelBindingStat(e,t){}}class B extends T{constructor(){super(4)}createElement(e,t){return new T(1)}createTextNode(e){return new T(2)}createComponent(e,t,n,o,s,i){return new T(3)}createVirtualNode(e){return new T(4)}}class I{release(){}associateValue(e){}appendChild(e){}removeChild(e,t){}insertBefore(e,t,n){}replaceChild(e,t,n){}spliceBefore(e,t,n){}spliceAppend(e){}spliceRemove(e,t){}setId(e){}setStyleScope(e,t,n){}setStyle(e){}addClass(e,t){}removeClass(e,t){}clearClasses(){}setAttribute(e,t){}removeAttribute(e){}setText(e){}getBoundingClientRect(e){setTimeout((()=>{e({left:0,top:0,width:0,height:0})}),0)}getScrollOffset(e){setTimeout((()=>{e({scrollLeft:0,scrollTop:0,scrollWidth:0,scrollHeight:0})}),0)}setListenerStats(e,t,n){}setModelBindingStat(e,t){}createIntersectionObserver(e,t,n,o){return{disconnect:()=>{}}}getContext(e){e(null)}}const R=/\s+/;class P{constructor(){this._$names=[""]}static globalScope(){return 0}register(e){const t=this._$names.length;return this._$names.push(e),t}queryName(e){return this._$names[e]}}class j{constructor(e,t,n,o,s,i){this._$externalNames=void 0,this._$externalRawAlias=null,this._$dirtyExternalNames=null,this._$rawNames=[],this._$backendNames=[],this._$backendNameScopes=[],this._$backendNamesCount=[],this._$hasAliasNames=!1,this._$element=e,this._$owner=n,this._$defaultScope=o,this._$extraScope=s,this._$rootScope=(null==n?void 0:n._$owner)?n._$rootScope:o,this._$prefixManager=i,t&&(this._$externalNames=t,this._$externalRawAlias=[])}_$resolvePrefixes(e,t){const n=this._$owner,o=null==n?void 0:n._$externalNames,s=o?o.indexOf(e):-1;if(n&&-1!==s){this._$hasAliasNames=!0;const e=n._$externalRawAlias[s];if(e)for(let o=0;o<e.length;o+=1)n._$resolvePrefixes(e[o],t)}else if("~"===e[0])t(this._$rootScope,e.slice(1));else if("^"===e[0]){let n=e.slice(1),o=this._$owner;for(;"^"===n[0];)n=n.slice(1),o=null==o?void 0:o._$owner;t((null==o?void 0:o._$owner)?o._$defaultScope:this._$rootScope,n)}else void 0!==this._$extraScope&&t(this._$extraScope,e),t(this._$defaultScope,e)}_$hasAlias(e){return!!this._$externalNames&&this._$externalNames.includes(e)}_$setAlias(e,t){if(!this._$externalNames)return;let n;if(null==t)n=[];else if(Array.isArray(t)){n=Array(t.length);for(let e=0,o=t.length;e<o;e+=1)n[e]=String(t[e])}else n=String(t).split(R).filter((e=>""!==e));const o=this._$externalNames.indexOf(e);-1!==o&&(this._$dirtyExternalNames=this._$dirtyExternalNames||[],this._$dirtyExternalNames.push(e),this._$externalRawAlias[o]=n)}_$getAlias(){return this._$externalNames}_$spreadExternalClassUpdate(){const e=this._$owner;if(!(null==e?void 0:e._$dirtyExternalNames)||!this._$hasAliasNames)return!1;const t=e._$dirtyExternalNames,n=this._$externalNames;if(n)for(let e=0;e<n.length;e+=1){const o=this._$externalRawAlias[e]||[];for(let s=0;s<t.length;s+=1)o.includes(t[s])&&(this._$dirtyExternalNames=this._$dirtyExternalNames||[],this._$dirtyExternalNames.push(n[e]))}const o=this._$rawNames.some((e=>e.some((e=>t.includes(e)))));return o&&this._$updateResolvedNames(),!!this._$dirtyExternalNames||o}_$shouldUpdateExternalClass(){if(!this._$dirtyExternalNames)return!1;if(1===this._$element.getBackendMode()){const e=this._$dirtyExternalNames;for(let t=0;t<e.length;t+=1){const n=e[t],o=this._$externalNames.indexOf(n),s=this._$externalRawAlias[o]||[];this._$element._$backendElement.setClassAlias(n,s)}return this._$dirtyExternalNames=null,!1}return!0}_$markExternalClassUpdated(){this._$dirtyExternalNames=null}_$updateResolvedNames(){const e=this._$element._$backendElement;if(!e)return!1;const t=this._$rawNames,n=this._$backendNames,o=this._$backendNameScopes,s=this._$backendNamesCount,i=[],r=[],l=[];if(this._$hasAliasNames=!1,1===this._$element.getBackendMode())for(let e=0,n=t.length;e<n;e+=1){const n=t[e];if(n)for(let e=0,t=n.length;e<t;e+=1){const t=n[e];let o=!1;for(let e=0;e<i.length;e+=1)if(t===i[e]){l[e]+=1,o=!0;break}o||(i.push(t),r.push(void 0),l.push(1))}}else for(let e=0,n=t.length;e<n;e+=1){const n=t[e];if(n)for(let e=0,t=n.length;e<t;e+=1){const t=n[e];this._$resolvePrefixes(t,((e,t)=>{for(let n=0;n<i.length;n+=1)if(t===i[n]&&e===r[n])return void(l[n]+=1);i.push(t),r.push(e),l.push(1)}))}}let a=!1;for(let t=0;t<i.length;t+=1){let l=!1;for(let e=0;e<n.length;e+=1)if(i[t]===n[e]&&r[t]===o[e]){l=!0,s[e]=0;break}l||(a=!0,this._$addClassToBackend(i[t],r[t],e))}for(let t=0;t<n.length;t+=1)0!==s[t]&&(a=!0,this._$removeClassFromBackend(n[t],o[t],e));return this._$backendNames=i,this._$backendNameScopes=r,this._$backendNamesCount=l,a}_$addClassToBackend(e,t,n){var o;if(3===this._$element.getBackendMode()){const s=void 0===t?"":null===(o=this._$prefixManager)||void 0===o?void 0:o.queryName(t),i=s?`${s}--${e}`:e;n.classList.add(i)}else 2===this._$element.getBackendMode()?n.addClass(e,t):n.addClass(e)}_$removeClassFromBackend(e,t,n){var o;if(3===this._$element.getBackendMode()){const s=t&&(null===(o=this._$prefixManager)||void 0===o?void 0:o.queryName(t)),i=s?`${s}--${e}`:e;n.classList.remove(i)}else 2===this._$element.getBackendMode()?n.removeClass(e,t):n.removeClass(e)}_$addClass(e,t,n){const o=this._$backendNames,s=this._$backendNameScopes,i=this._$backendNamesCount;let r=!1;for(let n=0;n<o.length;n+=1)if(e===o[n]&&t===s[n]){r=!0,i[n]+=1;break}r||(o.push(e),s.push(t),i.push(1),this._$addClassToBackend(e,t,n))}_$removeClass(e,t,n){const o=this._$backendNames,s=this._$backendNameScopes,i=this._$backendNamesCount;for(let r=0;r<o.length;r+=1)if(e===o[r]&&t===s[r]){i[r]<=1?(o.splice(r,1),s.splice(r,1),i.splice(r,1),this._$removeClassFromBackend(e,t,n)):i[r]-=1;break}}toggle(e,t,n=0){if(R.test(e))throw new Error("Class name contains space characters.");const o=this._$element._$backendElement,s=this._$rawNames[n]?this._$rawNames[n].indexOf(e):-1;let i=!1;if(void 0===t?-1===s:!!t){if(-1===s){const t=this._$rawNames;t[n]||(t[n]=[]);t[n].push(e),o&&(1===this._$element.getBackendMode()?this._$addClass(e,void 0,o):this._$resolvePrefixes(e,((e,t)=>{this._$addClass(t,e,o)}))),i=!0}}else if(-1!==s){const t=this._$rawNames[n];t&&t.splice(s,1),o&&(1===this._$element.getBackendMode()?this._$removeClass(e,void 0,o):this._$resolvePrefixes(e,((e,t)=>{this._$removeClass(t,e,o)}))),i=!0}return i}contains(e,t=0){const n=this._$rawNames[t]||[];for(let t=0;t<n.length;t+=1){const o=n[t];if("~"===o[0]){if(o.slice(1)===e)return!0}else if("^"===o[0]){let t=o.slice(1);for(;"^"===t[0];)t=t.slice(1);if(t===e)return!0}else if(o===e)return!0}return!1}setClassNames(e,t=0){let n;if(null==e)n=[];else if(Array.isArray(e)){n=Array(e.length);for(let t=0,o=e.length;t<o;t+=1)n[t]=String(e[t])}else n=String(e).split(R).filter((e=>""!==e));return this._$rawNames[t]=n,this._$updateResolvedNames()}getClassNames(e=0){const t=this._$rawNames[e]||[];return t?t.join(" "):""}}const U=Symbol("method");var F=Object.freeze({__proto__:null,METHOD_TAG:U});class G{constructor(e,t){this.ownerSpace=e,this._$trans=t}_$implement(e){var t;return(null===(t=this._$trans)||void 0===t?void 0:t.call(this,e))||e}}class V{constructor(){this._$traits=new WeakMap}implement(e,t){const n=e._$implement(t);this._$traits.set(e,n)}get(e){return this._$traits.get(e)}}const W=(e,t)=>{let n;n="/"!==e[0]?t.split("/").slice(0,-1).concat(e.split("/")):e.split("/");const o=[];for(let e=0;e<n.length;e+=1){const t=n[e];""!==t&&"."!==t&&(".."!==t?o.push(t):o.pop())}return o.join("/")},H=(e,t)=>{const n=e.indexOf("://");if(n>0){const t=e.indexOf("/",n+3);if(t>0){return{domain:e.slice(0,t),absPath:W(e.slice(t+1),"")}}return{domain:e.slice(0,n+3),absPath:W(e.slice(n+3),"")}}return{domain:null,absPath:W(e,t)}};class z{constructor(e,t,n){this._$callbacks=[],this._$ownerSpace=e,this._$isPub=t,this._$alias=n}add(e){this._$callbacks.push(e)}hintUsed(e){var t,n;null===(n=(t=this._$ownerSpace)._$componentWaitingListener)||void 0===n||n.call(t,this._$isPub,this._$alias,e)}remove(e){const t=this._$callbacks.indexOf(e);this._$callbacks.splice(t,1)}call(e){const t=this._$callbacks;this._$callbacks=[];for(let n=0;n<t.length;n+=1){(0,t[n])(e)}}}class K{constructor(e,t,n,o=!0){this._$behaviorList=Object.create(null),this._$pubBehaviorList=Object.create(null),this._$list=Object.create(null),this._$pubList=Object.create(null),this._$using=Object.create(null),this._$importedSpaces=Object.create(null),this._$listWaiting=Object.create(null),this._$pubListWaiting=Object.create(null),this._$groupingListWaiting=null,this._$componentWaitingListener=null,this._$allowUnusedNativeNode=!0,t&&(Object.assign(this._$list,t._$pubList),Object.assign(this._$behaviorList,t._$pubBehaviorList)),this._$defaultComponent=null!=e?e:"",this._$componentOptions=r({},null==t?void 0:t._$componentOptions),this.styleScopeManager=n||new P,this._$allowUnusedNativeNode=o}updateComponentOptions(e){this._$componentOptions=r(e,this._$componentOptions)}getComponentOptions(){return this._$componentOptions}setGlobalUsingComponent(e,t){this._$using[e]=t}importSpace(e,t,n){this._$importedSpaces[e]={space:t,privateUse:n}}getComponentByUrl(e,t){const{domain:n,absPath:o}=H(e,t),s=this.getComponent(o,!0,n);if(!s)throw new Error(`There is no component "${o}" in the space and no default component can be used`);return s}getComponentByUrlWithoutDefault(e,t){const{domain:n,absPath:o}=H(e,t);return this.getComponent(o,!1,n)||null}getComponent(e,t=!0,n=null){let o;if(n){const e=this._$importedSpaces[n];if(e){const{space:t,privateUse:n}=e;o=n?t._$list:t._$pubList}}else o=this._$list;if(o){const t=o[e];if(t)return t}if(t)return this._$list[this._$defaultComponent]}getDefaultComponent(){return this._$list[this._$defaultComponent]||null}isDefaultComponent(e){return this._$list[this._$defaultComponent]===e}getGlobalUsingComponent(e){return this._$using[e]||null}getBehaviorByUrl(e,t){const{domain:n,absPath:o}=H(e,t);return this._$getBehavior(o,n)||null}_$getBehavior(e,t=null){let n;if(t){const e=this._$importedSpaces[t];if(e){const{space:t,privateUse:o}=e;n=o?t._$behaviorList:t._$pubBehaviorList}}else n=this._$behaviorList;if(n){const t=n[e];if(t)return t}}defineComponent(e){const t=e.is;return new St(t,this).definition(e).registerComponent()}defineBehavior(e){const t=e.is;return new St(t,this).definition(e).registerBehavior()}define(e){return new St(e,this)}defineWithMethodCaller(e){return new St(e,this)}_$registerComponent(e,t){this._$list[e]=t,this._$behaviorList[e]=t.behavior;const n=this._$listWaiting[e];n&&(delete this._$listWaiting[e],this._$groupingListWaiting?this._$groupingListWaiting.push({waiting:n,comp:t}):n.call(t))}_$registerBehavior(e,t){this._$behaviorList[e]=t}startGroupRegister(){this._$groupingListWaiting=[]}endGroupRegister(){const e=this._$groupingListWaiting;if(e){this._$groupingListWaiting=null;for(let t=0;t<e.length;t+=1){const{waiting:n,comp:o}=e[t];n.call(o)}}}groupRegister(e){this.startGroupRegister();const t=c("group register",e,this,[]);return this.endGroupRegister(),t}exportComponent(e,t){const n=this._$list[t];if(!n)throw new Error(`There is no component "${t}" for aliasing`);this._$pubList[e]=n;const o=this._$pubListWaiting[e];o&&(delete this._$pubListWaiting[e],o.call(n))}getExportedComponent(e){return this._$pubList[e]}getExportedBehavior(e){return this._$pubBehaviorList[e]}exportBehavior(e,t){const n=this._$behaviorList[t];if(!n)throw new Error(`There is no behavior "${t}" for aliasing`);this._$pubBehaviorList[e]=n}_$componentWaitingList(e,t){const{domain:n,absPath:o}=H(e,t);let s,i,r;if(n){const e=this._$importedSpaces[n];if(!e)return null;if(i=e.space,r=!e.privateUse,r){if(i._$pubList[o])return null;s=i._$pubListWaiting}else{if(i._$list[o])return null;s=i._$listWaiting}}else{if(i=this,r=!1,this._$list[o])return null;s=this._$listWaiting}let l=s[o];return l||(l=s[o]=new z(i,r,o),l)}setComponentWaitingListener(e){this._$componentWaitingListener=e}createComponentByUrl(e,t,n,o){let s=t,i=null;const r=s.indexOf("#");r>=0&&(s=s.slice(0,r));const l=s.indexOf("?");l>=0&&(i=s.slice(l+1),s=s.slice(0,l));const a=this.getComponentByUrl(s,"");let d=null;n&&(d=Object.create(null),Object.keys(n).forEach((e=>{const t=n[e],o=this.getComponentByUrl(t,"");d[e]=o})));return bt.createWithGenericsAndContext(e,a,d,o,(e=>{if(i){let t=!1;i.split("&").forEach((n=>{const o=n.indexOf("=");if(o>=0){const s=decodeURIComponent(n.slice(0,o)),i=decodeURIComponent(n.slice(o+1));e._$dataGroup.replaceProperty(s,i)&&(t=!0)}})),t&&e.applyDataUpdates()}}))}defineTraitBehavior(e){return new G(this,e)}}let q=null;const X=()=>{if(q)return q;const e=new K;return q=e,e},Y=e=>{const t=e.str;for(;e.cur<t.length;){const n=t[e.cur];if(" "!==n&&"\n"!==n&&"\r"!==n&&"\t"!==n&&"\f"!==n)break;e.cur+=1}return e.cur<t.length},Z=e=>{const t=e.str;let n="";for(;e.cur<t.length;){const o=t[e.cur];if(!(o>="0"&&o<="9"))break;n+=o,e.cur+=1}if(!n)throw new Error(`data path descriptor "${t}" is illegal at char ${e.cur} (illegal index)`);return parseInt(n,10)},Q=e=>{const t=e.str;let n="";for(;e.cur<t.length;){const o=t[e.cur];if("\\"===o)if(e.cur+1===t.length);else{n+=t[e.cur+1],e.cur+=1}else if(/^[_a-zA-Z]$/.test(o))n+=o;else{if(!(o>="0"&&o<="9"))break;if(""===n)throw new Error(`data path descriptor "${t}" is illegal at char ${e.cur} (field name cannot start with digits)`);n+=o}e.cur+=1}return n},J=e=>{const t=e.str;let n="";for(;e.cur<t.length;){const o=t[e.cur];if("\\"===o)if(e.cur+1===t.length)n+="\\",e.cur+=1;else{const o=t[e.cur+1];"."===o||"["===o||"]"===o||"\\"===o?(n+=o,e.cur+=2):(n+="\\",e.cur+=1)}else{if("."===o||"["===o)break;n+=o,e.cur+=1}}return n},ee=e=>{const t=e.str;if(Y(e),"*"===t[e.cur]&&"*"===t[e.cur+1])return e.cur+=2,["**"];const n=Q(e);if(!n)throw new Error(`data path descriptor "${t}" is illegal at char ${e.cur} (first field name illegal)`);const o=[n];for(;e.cur<t.length&&Y(e);){const n=t[e.cur];if("."===n){if(e.cur+=1,Y(e),"*"===t[e.cur]&&"*"===t[e.cur+1]){o.push("**"),e.cur+=2;break}const n=Q(e);if(!n)throw new Error(`data path descriptor "${t}" is illegal at char ${e.cur} (field name illegal)`);o.push(n)}else{if("["!==n)break;{e.cur+=1,Y(e);const n=Z(e);Y(e);if("]"!==t[e.cur])throw new Error(`data path descriptor "${t}" is illegal at char ${e.cur} (illegal index)`);e.cur+=1,o.push(n)}}}return o},te=e=>{const t=(e=>{const t=e.str,n=[];for(;e.cur<t.length;){const o=t[e.cur];if("."===o){e.cur+=1;const t=J(e);""!==t&&n.push(t)}else if("["===o){e.cur+=1;const o=Z(e);if("]"!==t[e.cur]&&e.cur<t.length)throw new Error(`data path descriptor "${t}" is illegal at char ${e.cur} (illegal index)`);e.cur+=1,n.push(o)}else{const t=J(e);n.push(t)}}return 0===n.length&&n.push(""),n})({str:e,cur:0});return t},ne=e=>{if("string"!=typeof e)return e.map((e=>ee({str:e,cur:0})));const t={str:e,cur:0},n=(e=>{const t=[];for(t.push(ee(e)),Y(e);","===e.str[e.cur];)e.cur+=1,t.push(ee(e)),Y(e);return t})(t);if(t.cur!==e.length)throw new Error(`data path descriptor "${e}" is illegal at char ${t.cur}`);return n};var oe=Object.freeze({__proto__:null,parseMultiPaths:ne,parseSinglePath:te});const se=(e,t)=>{if("object"==typeof e&&null!==e){const n=t.get(e);if(void 0!==n)return n;if(Array.isArray(e)){const n=[];t.set(e,n);for(let o=0;o<e.length;o+=1)n[o]=se(e[o],t);return n}const o={};t.set(e,o);const s=Object.keys(e);for(let n=0;n<s.length;n+=1){const i=s[n];o[i]=se(e[i],t)}return o}return"symbol"==typeof e?Symbol(e.description):e},ie=e=>{if("object"==typeof e&&null!==e){if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n+=1)t[n]=ie(e[n]);return t}const t={},n=Object.keys(e);for(let o=0;o<n.length;o+=1){const s=n[o];t[s]=ie(e[s])}return t}return"symbol"==typeof e?Symbol(e.description):e},re=(e,t)=>t?se(e,new WeakMap):ie(e);var le=Object.freeze({__proto__:null,deepCopy:re,simpleDeepCopy:ie});class ae{constructor(e){this._$subtreeObserversCount=0,this.attrObservers=null,this.textObservers=null,this.childObservers=null,this.attachObservers=null,this._$boundElement=e}attachChild(e){e._$mutationObserverTarget||(e._$mutationObserverTarget=new ae(e)),this._$subtreeObserversCount>0&&e._$mutationObserverTarget.updateSubtreeCount(this._$subtreeObserversCount)}detachChild(e){e._$mutationObserverTarget&&e._$mutationObserverTarget.updateSubtreeCount(-this._$subtreeObserversCount)}updateSubtreeCount(e){this._$subtreeObserversCount+=e;this._$boundElement.childNodes.forEach((t=>{m(t)&&(t._$mutationObserverTarget||(t._$mutationObserverTarget=new ae(t)),t._$mutationObserverTarget.updateSubtreeCount(e))}))}hasSubtreeListeners(){return this._$subtreeObserversCount>0}static callAttrObservers(e,t){var n;let o=e;do{const e=o._$mutationObserverTarget;null===(n=null==e?void 0:e.attrObservers)||void 0===n||n.call(o,[t]);const s=o.parentNode;if(!s)break;if(o=s,!o._$mutationObserverTarget)break}while(o._$mutationObserverTarget._$subtreeObserversCount>0)}static callTextObservers(e,t){var n;let o=e.parentNode;for(;o;){const e=o._$mutationObserverTarget;if(!e||0===e._$subtreeObserversCount)break;null===(n=e.textObservers)||void 0===n||n.call(o,[t]),o=o.parentNode}}static callChildObservers(e,t){var n;let o=e;do{const e=o._$mutationObserverTarget;null===(n=null==e?void 0:e.childObservers)||void 0===n||n.call(o,[t]);const s=o.parentNode;if(!s)break;if(o=s,!o._$mutationObserverTarget)break}while(o._$mutationObserverTarget._$subtreeObserversCount>0)}static callAttachObservers(e,t){var n;const o=e._$mutationObserverTarget;null===(n=null==o?void 0:o.attachObservers)||void 0===n||n.call(e,[t])}}class de{constructor(e){this._$subtreeListenersCount=0,this._$boundFuncArrs=[],this._$boundTarget=null,this._$listener=e,this._$normalizedListener=null}static create(e){return new de(e)}observe(e,t={properties:!1,childList:!1,characterData:!1,subtree:!1,attachStatus:!1}){const n=this._$listener;if(!n)throw new Error("A MutationObserver can only observe once");let o;e._$mutationObserverTarget?o=e._$mutationObserverTarget:(o=new ae(e),e._$mutationObserverTarget=o),this._$listener=null;const s=t.subtree?n:function(e){e.target===this&&n.call(this,e)};this._$normalizedListener=s,this._$boundTarget=o,t.properties&&(o.attrObservers||(o.attrObservers=new l("attributeObserver")),o.attrObservers.add(s),this._$boundFuncArrs.push(o.attrObservers),this._$subtreeListenersCount+=1),t.childList&&(o.childObservers||(o.childObservers=new l("childObserver")),o.childObservers.add(s),this._$boundFuncArrs.push(o.childObservers),this._$subtreeListenersCount+=1),t.characterData&&(o.textObservers||(o.textObservers=new l("textObserver")),o.textObservers.add(s),this._$boundFuncArrs.push(o.textObservers),this._$subtreeListenersCount+=1),t.subtree&&o.updateSubtreeCount(this._$subtreeListenersCount),t.attachStatus&&(o.attachObservers||(o.attachObservers=new l("attachObserver")),o.attachObservers.add(s),this._$boundFuncArrs.push(o.attachObservers))}disconnect(){var e;null===(e=this._$boundTarget)||void 0===e||e.updateSubtreeCount(-this._$subtreeListenersCount);const t=this._$boundFuncArrs;this._$boundFuncArrs=[];const n=this._$normalizedListener;n&&t.forEach((e=>{e.remove(n)}))}}const ce=Object.prototype.hasOwnProperty;var he;exports.NormalizedPropertyType=void 0,(he=exports.NormalizedPropertyType||(exports.NormalizedPropertyType={})).Invalid="invalid",he.Any="any",he.String="string",he.Number="number",he.Boolean="boolean",he.Object="object",he.Array="array",he.Function="function";const ue=(e,t)=>{const n=Object.keys(t);for(let o=0;o<n.length;o+=1){const s=n[o];if(Object.prototype.hasOwnProperty.call(e,s))if("_"===s[0]&&O(`data field "${s}" from different behaviors is overriding or merging.`),"object"!=typeof e[s]||"object"!=typeof t[s]||null===t[s]||Array.isArray(t[s]))e[s]=t[s];else{if(Array.isArray(e[s]))e[s]=e[s].slice();else{const t=e[s],n={},o=Object.keys(t);for(let e=0;e<o.length;e+=1){const s=o[e];n[s]=t[s]}e[s]=n}ue(e[s],t[s])}else e[s]=t[s]}},pe=e=>"string"===e||e===String?"string":"number"===e||e===Number?"number":"boolean"===e||e===Boolean?"boolean":"object"===e||e===Object?"object":"array"===e||e===Array?"array":"function"===e||e===Function?"function":"any"===e||null==e?"any":"invalid",fe=(e,t,n,o)=>{const s=n.type,i=void 0===n.default?void 0:()=>c(`Property "${t}" Default`,n.default,null,[],o||void 0),r=n.optionalTypes;if(r)for(let t=0;t<r.length;t+=1)if($e(r[t],e))return e;return"string"===s?null==e?(O(`property "${t}" received type-incompatible value: expected <String> but get null value. Used default value instead.`),void 0===i?"":i()):("object"==typeof e&&O(`property "${t}" received type-incompatible value: expected <String> but got object-typed value. Force converted.`),String(e)):"number"===s?isFinite(e)?Number(e):(O("number"==typeof e?`property "${t}" received type-incompatible value: expected <Number> but got NaN or Infinity. Used default value instead.`:`property "${t}" received type-incompatible value: expected <Number> but got non-number value. Used default value instead.`),void 0===i?0:i()):"boolean"===s?!!e:"array"===s?Array.isArray(e)?e:(O(`property "${t}" received type-incompatible value: expected <Array> but got non-array value. Used default value instead.`),void 0===i?[]:i()):"object"===s?"object"==typeof e?e:(O(`property "${t}" received type-incompatible value: expected <Object> but got non-object value. Used default value instead.`),void 0===i?null:i()):"function"===s?"function"==typeof e?e:(O(`property "${t}" received type-incompatible value: expected <Function> but got non-function value. Used default value instead.`),void 0===i?function(){}:i()):void 0===e?void 0===i?null:i():e},$e=(e,t)=>{if("string"===e){if("string"!=typeof t)return!1}else if("number"===e){if(!Number.isFinite(t))return!1}else if("boolean"===e){if("boolean"!=typeof t)return!1}else if("object"===e){if("object"!=typeof t||Array.isArray(t))return!1}else if("array"===e){if("object"!=typeof t||!Array.isArray(t))return!1}else if("function"===e){if("function"!=typeof t)return!1}else if(void 0===t)return!1;return!0};var _e;!function(e){e[e.None=0]="None",e[e.Simple=1]="Simple",e[e.SimpleWithRecursion=2]="SimpleWithRecursion"}(_e||(_e={}));class ge{constructor(e){this.observerTree={sub:{}},this.observers=[],this.propFields=e}cloneSub(){const e=new ge(this.propFields);return this.observers.length>0&&(e.observerTree=ie(this.observerTree),e.observers=this.observers.slice()),e}addObserver(e,t){const n=this.observers.length;this.observers.push({path:t,f:e});for(let e=0;e<t.length;e+=1){const o=t[e];let s=this.observerTree,i=!1;for(let e=0;e<o.length;e+=1){const t=o[e];if("**"===t){i=!0;break}s.sub[t]||(s.sub[t]={sub:{}}),s=s.sub[t]}i?s.wildcard?s.wildcard.push(n):s.wildcard=[n]:s.listener?s.listener.push(n):s.listener=[n]}}}const me=(e,t,n,o)=>{const s=new Array(n.length);for(let e=0;e<n.length;e+=1){const o=n[e];let i=t;for(let e=0;e<o.length;e+=1){const t=o[e];if("**"===t)break;if("object"!=typeof i||null===i){i=void 0;break}i=i[t]}s[e]=i}c("Data Observer",o,e.getMethodCaller(),s,e||void 0)},ve=(e,t)=>{if(e.listener)for(let n=0;n<e.listener.length;n+=1){t[e.listener[n]]=!0}if(e.wildcard)for(let n=0;n<e.wildcard.length;n+=1){t[e.wildcard[n]]=!0}const n=Object.keys(e.sub);for(let o=0;o<n.length;o+=1){const s=n[o];ve(e.sub[s],t)}},be=(e,t,n)=>{let o=e,s=!0;for(let e=0;e<n.length;e+=1){const i=n[e];if(o.wildcard){const e=o.wildcard;for(let n=0;n<e.length;n+=1){t[e[n]]=!0}}if(!ce.call(o.sub,i)){s=!1;break}o=o.sub[i]}s&&ve(o,t)},Se=(e,t,n,o)=>{for(let s=0;s<e.length;s+=1){const{path:i,f:r}=e[s];t[s]&&(t[s]=!1,n&&me(n,o,i,r))}},ye=e=>e===exports.DeepCopyKind.Simple?1:e===exports.DeepCopyKind.SimpleWithRecursion?2:0;class Ce{_$generateInnerData(e){const t=this._$pureDataPattern,n=this._$dataDeepCopy;if(t||0!==n){const o={},s=Object.keys(e);for(let i=0;i<s.length;i+=1){const r=s[i],l=e[r];t&&t.test(r)||(o[r]=0===n?l:2===n?re(l,!0):ie(l))}return o}return null}constructor(e,t,n,o,s,i,r){this._$modelBindingListener=null,this._$pendingChanges=[],this._$doingUpdates=null,this._$comp=e,this.data=t,this._$pureDataPattern=n,this._$dataDeepCopy=o,this._$propertyPassingDeepCopy=s,this._$reflectToAttributes=i&&!!e,this._$propFields=r.propFields,this._$observerTree=r.observerTree,this._$observers=r.observers,this._$observerStatus=new Array(r.observers.length),this.innerData=this._$generateInnerData(t)}static create(e){return new Ce(null,e,null,0,0,!1,new ge({}))}setUpdateListener(e){this._$updateListener=e}replaceWholeData(e){this.data=e,this.innerData=this._$generateInnerData(e)}replaceDataOnPath(e,t){this._$pendingChanges.push([e,t,void 0,void 0])}spliceArrayDataOnPath(e,t,n,o){Array.isArray(o)?this._$pendingChanges.push([e,o,null!=t?t:-1,n||0]):O(`The splice insertion must be a string (on path "${e.join(".")}"). The change is ignored.`)}replaceProperty(e,t){let n=t;return!!this._$propFields[e]&&(0!==this._$propertyPassingDeepCopy&&(n=2===this._$propertyPassingDeepCopy?re(t,!0):ie(t)),this._$pendingChanges.push([[e],n,!0,void 0]),!0)}setChanges(e){this._$pendingChanges=e}getChanges(){return this._$pendingChanges}setModelBindingListener(e,t){if(this._$modelBindingListener)this._$modelBindingListener[e]=t;else{(this._$modelBindingListener=Object.create(null))[e]=t}}applyDataUpdates(e=!1){var t;const n=this._$propFields,o=this._$comp,s=this._$pureDataPattern,i=this._$dataDeepCopy,r=!!this._$doingUpdates;let l,a;this._$observers.length>0?this._$doingUpdates?(l=this._$doingUpdates.combined,a=this._$doingUpdates.prop):(this._$doingUpdates={prop:[],combined:[],count:0},l=this._$doingUpdates.combined,a=this._$doingUpdates.prop):(l=[],a=[]);const d=this._$pendingChanges;this._$pendingChanges=[];for(let t=0;t<d.length;t+=1){const r=d[t],[h,u,p,f]=r,$=void 0!==f,_=String(h[0]),g=!!s&&s.test(_),m=n[_];let v=!0;if(m&&1===h.length){const t=this.data[_];let n,s,l;if($){if(Array.isArray(t)){const e=r,o=p;n=o>=0&&o<t.length?o:t.length,e[2]=n,t.splice(n,f,...u)}else O(`An array splice change cannot be applied to a non-array value (on path "${h.join(".")}"). The change is ignored.`);s=t}else s=fe(u,_,m,this._$comp);if(!g&&this.innerData){let e;if(0===i)r[1]=e=s;else if(void 0!==n){let t;e=this.innerData[_],r[1]=t=2===i?re(u,!0):ie(u),e.splice(n,f,...t)}else r[1]=e=2===i?re(s,!0):ie(s);this.innerData[_]=e}if(this.data[_]=s,this._$reflectToAttributes){const e=o.getBackendElement();if(e){let t=s;if(m.reflectIdPrefix){const e=o.ownerShadowRoot;if(e){const n=e.getHostNode()._$idPrefix;n&&(t=`${n}--${s}`)}}const n=_.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`)),i=typeof t;"boolean"===i?s?e.setAttribute(n,""):e.removeAttribute(n):"object"===i?e.setAttribute(n,JSON.stringify(t)):e.setAttribute(n,t)}}$||!0!==p?l=t!==s:(m.comparer?(r[2]=void 0,l=!!c("Property Comparer",m.comparer,o,[u,t],null==o?void 0:o.general())):l=t!==s,v=l),!g&&l&&a.push({propName:_,prop:m,oldValue:t,newValue:s,skipModelListener:e})}else{let t,n=this.data,o=_;for(let e=1;e<h.length;e+=1){const t=h[e];Number.isFinite(t)?ce.call(n,o)&&Array.isArray(n[o])||(n[o]=[]):ce.call(n,o)&&null!==n[o]&&"object"==typeof n[o]&&!Array.isArray(n[o])||(n[o]={}),n=n[o],o=t}if($){const e=n[o];if(Array.isArray(e)){const n=r,o=p;t=o>=0&&o<e.length?o:e.length,n[2]=t,e.splice(t,f,...u)}else O(`An array splice change cannot be applied to a non-array value (on path "${h.join(".")}"). The change is ignored.`)}else n[o]=u;if(!g&&this.innerData){n=this.innerData,o=_;for(let e=1;e<h.length;e+=1){const t=h[e];Number.isFinite(t)?ce.call(n,o)&&Array.isArray(n[o])||(n[o]=[]):ce.call(n,o)&&null!==n[o]&&"object"==typeof n[o]&&!Array.isArray(n[o])||(n[o]={}),n=n[o],o=t}let e;if(0===i)r[1]=e=u;else if(void 0!==t){let s;e=n[o],r[1]=s=2===i?re(u,!0):ie(u),e.splice(t,f,...s)}else r[1]=e=2===i?re(u,!0):ie(u);n[o]=e}!g&&m&&a.push({propName:_,prop:m,oldValue:void 0,newValue:u,skipModelListener:e||!1})}be(this._$observerTree,this._$observerStatus,h),!g&&v&&l.push(r),this._$doingUpdates&&(this._$doingUpdates.count+=1)}if(!r){if(this._$doingUpdates){let e;do{e=this._$doingUpdates.count,Se(this._$observers,this._$observerStatus,o,this.data)}while(e!==this._$doingUpdates.count);this._$doingUpdates=null}if(null===(t=this._$updateListener)||void 0===t||t.call(this,this.innerData||this.data,l),o)for(let e=0;e<a.length;e+=1){const{propName:t,prop:n,oldValue:s,newValue:i,skipModelListener:r}=a[e];if(!r&&this._$modelBindingListener){const e=this._$modelBindingListener[t];e&&e(i)}n.observer&&c("Property Observer",n.observer,o.getMethodCaller(),[i,s],o),o._$mutationObserverTarget&&ae.callAttrObservers(o,{type:"properties",target:o,propertyName:t})}}}}var we;exports.EventBubbleStatus=void 0,(we=exports.EventBubbleStatus||(exports.EventBubbleStatus={}))[we.Normal=0]="Normal",we[we.NoDefault=1]="NoDefault";let Ne=Date.now(),Ee=Ne;var xe,ke;exports.EventMutLevel=void 0,(xe=exports.EventMutLevel||(exports.EventMutLevel={}))[xe.None=0]="None",xe[xe.Mut=1]="Mut",xe[xe.Final=2]="Final",function(e){e[e.NotChanged=0]="NotChanged",e[e.Failed=1]="Failed",e[e.None=2]="None",e[e.Final=3]="Final",e[e.Mut=4]="Mut"}(ke||(ke={}));class Oe{constructor(){this.listeners=Object.create(null),this.captureListeners=null}addListener(e,t,n={}){const o=n.final?2:n.mutated?1:0;let s,i,r;return n.capture||n.useCapture?this.captureListeners?s=this.captureListeners:(s=Object.create(null),this.captureListeners=s):s=this.listeners,s[e]?(r=!0,i=s[e]):(r=!1,i=s[e]={mutCount:0,finalCount:0,funcArr:new a("listener")}),i.funcArr.add(t,o),2===o?(i.finalCount+=1,r&&1!==i.finalCount?0:3):1===o?(i.mutCount+=1,!r||1===i.mutCount&&0===i.finalCount?4:0):r?0:2}removeListener(e,t,n={}){const o=n.capture||n.useCapture?this.captureListeners:this.listeners;if(!o)return 1;const s=o[e];if(!s)return 1;const i=s.funcArr.remove(t);return null===i?1:2===i?(s.finalCount-=1,0!==s.finalCount?0:s.mutCount>0?4:2):1===i?(s.mutCount-=1,0!==s.mutCount||0!==s.finalCount?0:2):0}}let Me=class e{constructor(e,t,n={}){const o=(()=>{const e=Date.now();return e<Ee&&(Ne+=e-Ee),Ee=e,e-Ne})();this._$eventName=this.type=e,this.timeStamp=o,this.detail=t,this.bubbles=n.bubbles||!1,this.composed=n.composed||!1,this._$capturePhase=n.capturePhase||!1,this._$eventBubblingControl={stopped:!1,mutated:!1,noDefault:!1},this._$originalEvent=n.originalEvent,this._$dispatched=!1,this._$handleListenerReturn=n.handleListenerReturn,n.extraFields&&Object.assign(this,n.extraFields)}getEventBubbleStatus(){return this._$eventBubblingControl.noDefault?1:0}wrapShadowedEvent(e,t,n){const o=Object.create(this);return o.target=e,o.mark=t,o.currentTarget=n,o}getEventName(){return this._$eventName}getOriginalEvent(){return this._$originalEvent}preventDefault(){this._$eventBubblingControl.noDefault=!0}defaultPrevented(){return this._$eventBubblingControl.noDefault}stopPropagation(){this._$eventBubblingControl.stopped=!0}propagationStopped(){return this._$eventBubblingControl.stopped}markMutated(){this._$eventBubblingControl.mutated=!0}mutatedMarked(){return this._$eventBubblingControl.mutated}listenerReturnHandler(){return this._$handleListenerReturn}callListener(e,t,n,o){const s=this._$eventName,i=e._$eventTarget;if(!i)return;const r=o?i.captureListeners:i.listeners;if(!r)return;const l=r[s];if(!l)return;const a=this.mutatedMarked(),d=y(n)&&n.getMethodCaller()||n,c=y(e)&&e.getMethodCaller()||e,h=this.wrapShadowedEvent(d,t,c);!1===l.funcArr.call(c,[h],(e=>!a||1!==e),y(n)?n:void 0,this._$handleListenerReturn)||l.finalCount>0?(h.stopPropagation(),h.preventDefault()):l.mutCount>0&&h.markMutated()}dispatch(e,t){if(this._$dispatched)throw new Error("Event cannot be dispatched twice");this._$dispatched=!0;const n=this.composed,o=this.bubbles,s=t&&!n,i=this._$eventBubblingControl,r=(e,t)=>{const o=e=>{let s=e;const i=e.collectMarks();for(;;){if(!1===t(s,e,i))return null;let r;if(n){if(S(s))return s.getHostNode();if(null===s.containingSlot)return null;if(s.containingSlot)r=o(s.containingSlot);else for(r=s.parentNode;null==r?void 0:r._$inheritSlots;)r=r.parentNode}else r=s.parentNode;if(!r)return null;s=r}};let s=e;for(;;){const e=o(s);if(!e)break;s=e}};if(this._$capturePhase&&!i.stopped&&!s){const t=[];r(e,((e,n,o)=>{t.push([e,n,o])}));for(let e=t.length-1;e>=0;e-=1){const[n,o,s]=t[e];if(n._$eventTarget&&(this.callListener(n,s,o,!0),i.stopped))break}}if(!i.stopped&&t&&y(e)&&e._$external&&e.shadowRoot.handleEvent(t,this),!i.stopped&&!s){let t=!0;r(e,((e,n,s)=>{if(!t&&y(e)&&e._$external){const t=e.shadowRoot;t.handleEvent(t.slot,this)}return t=!1,e._$eventTarget&&this.callListener(e,s,n,!1),o&&!i.stopped}))}}static dispatchEvent(e,t){return t.dispatch(e)}static dispatchExternalEvent(e,t,n){return n.dispatch(e,t)}static triggerEvent(t,n,o,s){const i=new e(n,o,s);e.dispatchEvent(t,i)}static triggerExternalEvent(t,n,o,s,i){const r=new e(o,s,i);e.dispatchExternalEvent(t,n,r)}};var Le;!function(e){e[e.Child=0]="Child",e[e.Descendant=1]="Descendant",e[e.CrossShadowDescendant=2]="CrossShadowDescendant"}(Le||(Le={}));const De=e=>{var t;return null===(t=e.ownerShadowRoot)||void 0===t?void 0:t.getHostNode().getRootBehavior().ownerSpace};class Ae{static _$parseSegment(e,t){const n=/^(#[_a-zA-Z][-_a-zA-Z0-9:]*|)((?:\.-?[_a-zA-Z][-_a-zA-Z0-9]*)+|)$/.exec(e);if(!n)return null;const o=n[1].slice(1),s=n[2].split(".");return s.shift(),o||s.length?{id:o,classes:s,relation:t}:null}constructor(e){this.unions=[];const t=String(e||"").split(",");for(let e=0;e<t.length;e+=1){const n=t[e].split(/( |\t|>+)/g),o=[];let s=1,i=0;for(;i<n.length;i+=1){const e=n[i];if(!e||" "===e||"\t"===e||">>"===e)continue;if(">"===e[0]){if(1!==s)break;s=3===e.length?2:0;continue}const t=Ae._$parseSegment(e,s);if(s=1,!t)break;o.push(t)}i===n.length&&(o.length&&this.unions.push(o))}}isEmpty(){return 0===this.unions.length}static _$testSelectorSegment(e,t,n,o,s,i){var r;if(n===e)return!1;const l=o[s];let a=!0;(De(n)!==t||l.id&&l.id!==n.id)&&(a=!1);const d=l.classes;for(let e=0;a&&e<d.length;e+=1)(null===(r=n.classList)||void 0===r?void 0:r.contains(d[e]))||(a=!1);if(!a&&0===i)return!1;let c=n;if(a&&0===s){if(null===e)return!0;for(c=c.parentNode;c;c=c.parentNode)if(c===e)return!0;if(2!==i)return!1;c=n,a=!1}const h=a?l.relation:i;do{c.parentNode?c=c.parentNode:2===h?c=S(c)?c.getHostNode():null:2===i?(a=!1,c=S(c)?c.getHostNode():null):c=null,c===e&&(c=null)}while(b(c));if(!c)return!1;if(a){if(Ae._$testSelectorSegment(e,t,c,o,s-1,h))return!0;if(2!==i)return!1}return Ae._$testSelectorSegment(e,t,c,o,s,i)}testSelector(e,t){if(b(t))return!1;const n=this.unions;let o;if(o=null!==e&&De(e)||De(t),void 0===o)return!1;for(let s=0;s<n.length;s+=1){const i=n[s];if(Ae._$testSelectorSegment(e,o,t,i,i.length-1,0))return!0}return!1}query(e,t){const n=[],o=(e,t,s)=>{if(this.testSelector(e,t)){if(s)return t;n.push(t)}if(y(t)){const n=t.getShadowRoot();if(n){const t=o(e,n,s);if(t&&s)return t}}const i=t.childNodes;for(let t=0;t<i.length;t+=1){const n=i[t];if(m(n)){const t=o(e,n,s);if(t&&s)return t}}return null},s=o(e,e,t);return t?s:n}}var Te;exports.StyleSegmentIndex=void 0,(Te=exports.StyleSegmentIndex||(exports.StyleSegmentIndex={}))[Te.MAIN=0]="MAIN",Te[Te.TEMPLATE_EXTRA=1]="TEMPLATE_EXTRA",Te[Te.ANIMATION_EXTRA=2]="ANIMATION_EXTRA",Te[Te.TEMP_EXTRA=3]="TEMP_EXTRA";const Be={mode:1,destroyed:!0},Ie={mode:2,destroyed:!0},Re={mode:3,destroyed:!0};class Pe{constructor(){throw new Error("Element cannot be constructed directly")}_$initialize(e,t,n,o){this._$backendElement=t,this._$destroyOnDetach=!1,this._$nodeTreeContext=o,this._$nodeId="",this._$nodeAttributes=null,this._$nodeSlot="",this._$slotName=null,this._$slotElement=null,this._$slotValues=null,this._$subtreeSlotStart=null,this._$subtreeSlotEnd=null,this._$inheritSlots=!1,this._$placeholderHandlerRemover=void 0,this._$virtual=e,this.dataset={},this._$marks=null,this._$attached=!1,this.classList=null,this._$styleSegments=[],this.parentNode=null,this.parentIndex=-1,this.childNodes=[],this.slotNodes=void 0,this.ownerShadowRoot=n,this._$mutationObserverTarget=null,this._$eventTarget=new Oe}get $$(){return this._$backendElement}get id(){return this._$nodeId}set id(e){var t;const n=String(e);if(this._$nodeId!==n){if(this._$nodeId=n,this.ownerShadowRoot){const e=this.ownerShadowRoot.getHostNode();if(this.ownerShadowRoot._$markIdCacheDirty(),e.getComponentOptions().writeIdToDOM){const t=e._$idPrefix,o=t?`${t}--${n}`:n,s=this._$backendElement;s&&(3===this.getBackendMode()?s.id=o:s.setId(o))}}i.writeExtraInfoToAttr&&(null===(t=this._$backendElement)||void 0===t||t.setAttribute("exparser:info-attr-id",n)),this._$mutationObserverTarget&&ae.callAttrObservers(this,{type:"properties",target:this,attributeName:"id"})}}get slot(){return this._$nodeSlot}set slot(e){const t=String(e);if(this._$nodeSlot===t)return;if(this._$inheritSlots)throw new Error('slots-inherited nodes do not support "slot" attribute.');this._$nodeSlot=t;const n=Pe._$getParentHostShadowRoot(this.parentNode);if(n){const e=n.getSlotMode();if(3===e)throw new Error("nodes inside dynamic slots should change binding slots through Element#setSlotElement.");if(0===e)throw new Error("nodes inside direct slots should not change slot name.");const t=Pe._$updateSubtreeSlotNodes(this.parentNode,[this],n,n,this.parentIndex);null==t||t.removeSlotNodes();const o=this.containingSlot;null==t||t.updateContainingSlot();const s=this.containingSlot;Pe.insertChildReassign(this.parentNode,this,o,s,this.parentIndex+1),null==t||t.insertSlotNodes()}this._$mutationObserverTarget&&ae.callAttrObservers(this,{type:"properties",target:this,attributeName:"slot"})}get attributes(){const e=[];return this._$nodeAttributes&&Object.entries(this._$nodeAttributes).forEach((([t,n])=>{e.push({name:t,value:n})})),e}get class(){return this.classList?this.classList.getClassNames(0):""}set class(e){this.setNodeClass(e,0)}get style(){return this._$styleSegments[0]||""}set style(e){this.setNodeStyle(e,0)}asTextNode(){return null}asElement(){return this}asNativeNode(){return v(this)?this:null}asVirtualNode(){return b(this)?this:null}asInstanceOf(e){return y(this)?this.asInstanceOf(e):null}getBackendContext(){const e=this._$nodeTreeContext;return e===Be||e===Ie||e===Re?null:e}getBackendMode(){return this._$nodeTreeContext.mode}getBackendElement(){return this._$backendElement}destroyBackendElement(){this._$backendElement&&(3!==this.getBackendMode()&&this._$backendElement.release(),this._$backendElement=null),2===this.getBackendMode()?this._$nodeTreeContext=Ie:3===this.getBackendMode()?this._$nodeTreeContext=Re:this._$nodeTreeContext=Be}destroyBackendElementOnDetach(){this._$destroyOnDetach=!0}cancelDestroyBackendElementOnDetach(){this._$destroyOnDetach=!1}isVirtual(){return this._$virtual}setNodeClass(e,t=0){var n;(null===(n=this.classList)||void 0===n?void 0:n.setClassNames(e,t))&&this._$mutationObserverTarget&&ae.callAttrObservers(this,{type:"properties",target:this,attributeName:"class"})}toggleNodeClass(e,t,n=0){var o;(null===(o=this.classList)||void 0===o?void 0:o.toggle(e,t,n))&&this._$mutationObserverTarget&&ae.callAttrObservers(this,{type:"properties",target:this,attributeName:"class"})}setNodeStyle(e,t=0){if(this._$styleSegments[t]===e)return;this._$styleSegments[t]=e;const n=this._$styleSegments.join(";");this._$backendElement&&(3===this.getBackendMode()?this._$backendElement.setAttribute("style",n):this._$backendElement.setStyle(n)),this._$mutationObserverTarget&&ae.callAttrObservers(this,{type:"properties",target:this,attributeName:"style"})}static checkAndCallAttached(e){!function e(t){if(m(t)&&!t._$attached){if(t._$attached=!0,y(t)){t.triggerLifetime("attached",[]),t._$relation&&(t._$relation.triggerLinkEvent(2,!1),t._$relation.triggerLinkEvent(4,!1),t._$relation.triggerLinkEvent(0,!1)),t._$mutationObserverTarget&&ae.callAttachObservers(t,{type:"attachStatus",target:t,status:"attached"});const n=t.getShadowRoot();n&&e(n)}const n=t.childNodes;for(let t=0;t<n.length;t+=1)e(n[t])}}(e)}static checkAndCallDetached(e){const t=[];!function e(n){if(n._$destroyOnDetach&&t.push(n),m(n)&&n._$attached)if(y(n)&&n.triggerLifetime("beforeDetach",[]),n.childNodes.forEach(e),y(n)){const t=n._$placeholderHandlerRemover;t&&t();const o=n.getShadowRoot();o&&e(o),n._$attached=!1,n.triggerLifetime("detached",[]),n._$relation&&(n._$relation.triggerLinkEvent(2,!0),n._$relation.triggerLinkEvent(4,!0),n._$relation.triggerLinkEvent(0,!0)),n._$mutationObserverTarget&&ae.callAttachObservers(n,{type:"attachStatus",target:n,status:"detached"})}else n._$attached=!1}(e);for(let e=0;e<t.length;e+=1)t[e].destroyBackendElement()}static checkAndCallMoved(e){!function e(t){if(m(t)&&t._$attached&&(t.childNodes.forEach(e),y(t))){const n=t.getShadowRoot();n&&e(n),t.triggerLifetime("moved",[]),t._$relation&&(t._$relation.triggerLinkEvent(2,!1),t._$relation.triggerLinkEvent(4,!1),t._$relation.triggerLinkEvent(0,!1))}}(e)}static checkChildObservers(e,t,n){var o;const s=e._$mutationObserverTarget;if(s&&(!(null===(o=s.childObservers)||void 0===o?void 0:o.empty)||s.hasSubtreeListeners())){const o=[n];let s;s="add"===t?{type:"childList",target:e,addedNodes:o}:"remove"===t?{type:"childList",target:e,removedNodes:o}:{type:"childList",target:e,addedNodes:o,removedNodes:o},ae.callChildObservers(e,s)}}static hasSubtreeMutationObservers(e){var t;return(null===(t=e._$mutationObserverTarget)||void 0===t?void 0:t.hasSubtreeListeners())||!1}static _$insertChildReassignSlot(e,t,n,o){if(n)if(o){const e=[...n.slotNodes];for(let t=0;t<e.length;t+=1){const s=e[t];Pe._$spliceSlotNodes(n,0,1,void 0),Pe._$spliceSlotNodes(o,-1,0,[s]),Pe._$updateContainingSlot(s,o),s._$inheritSlots||Pe.insertChildReassign(s.parentNode,s,n,o,s.parentIndex)}}else{const e=[...n.slotNodes];for(let t=0;t<e.length;t+=1){const s=e[t];Pe._$spliceSlotNodes(n,0,1,void 0),Pe._$updateContainingSlot(s,o),s._$inheritSlots||Pe.insertChildReassign(s.parentNode,s,n,null,s.parentIndex)}}else{const n=[];e.forEachNodeInSpecifiedSlot(null,(e=>{if(null!==t){if((m(e)?e._$nodeSlot:"")!==t)return}n.push(e)}));for(let e=0;e<n.length;e+=1){const t=n[e];Pe._$spliceSlotNodes(o,-1,0,[t]),Pe._$updateContainingSlot(t,o),t._$inheritSlots||Pe.insertChildReassign(t.parentNode,t,null,o,t.parentIndex)}}}static insertChildReassign(e,t,n,o,s){if(1!==e.getBackendMode()){if(n)if(o&&3===e.getBackendMode());else{const o=Pe.findNearestNonVirtual(n);if(o){const n=Pe.countNonVirtual(t);if(n){const[t,s]=n;if(3===e.getBackendMode()){const e=t._$backendElement;for(let t=1;t<s;t+=1){const t=e.nextSibling;t&&o.removeChild(t)}s>0&&o.removeChild(e)}else o.spliceRemove(t._$backendElement,s)}}}o&&Pe.insertChildComposed(e,t,void 0,!1,s)}else t._$backendElement.reassignContainingSlot(n?n._$backendElement:null,o?o._$backendElement:null)}static findNearestNonVirtual(e){let t=e;for(;null==t?void 0:t._$virtual;)t=S(t)?t.getHostNode():void 0===t.containingSlot?t.parentNode:t.containingSlot;return t?t._$backendElement:null}static countNonVirtual(e){let t=null,n=0;const o=e=>{0===n&&(t=e),n+=1};var s;return m(s=e)&&s._$virtual?s.forEachNonVirtualComposedChild(o):o(s),t?[t,n]:null}static forEachNodeInSlot(e,t){const n=e=>{if(!1===t(e,e.containingSlot))return!1;if(e._$inheritSlots){const t=e.childNodes;for(let e=0;e<t.length;e+=1)if(!n(t[e]))return!1;return!0}return!0};return n(e)}static forEachNodeInSpecificSlot(e,t,n){const o=e=>{if(e.containingSlot===t&&!1===n(e))return!1;if(e._$inheritSlots){const t=e.childNodes;for(let e=0;e<t.length;e+=1)if(!o(t[e]))return!1;return!0}return!0};return o(e)}static forEachSlotContentInSlot(e,t){const n=e=>{if(e._$inheritSlots){const t=e.childNodes;for(let e=0;e<t.length;e+=1)if(!n(t[e]))return!1;return!0}return!1!==t(e,e.containingSlot)};return n(e)}static forEachSlotContentInSpecificSlot(e,t,n){const o=e=>{if(e._$inheritSlots){const t=e.childNodes;for(let e=0;e<t.length;e+=1)if(!o(t[e]))return!1;return!0}return e.containingSlot!==t||!1!==n(e)};return o(e)}static _$findFirstNonVirtualChild(e,t){const n=null!==e._$slotName,o=n?e.slotNodes:e.childNodes;if(t>=0&&t<o.length)for(let e=t;e<o.length;e+=1){let t=null;const s=e=>(t=e,!1),i=e=>{if(!n&&e._$inheritSlots){const t=e.childNodes;for(let e=0;e<t.length;e+=1)if(!1===i(t[e]))return!1}return e._$virtual?e.forEachNonVirtualComposedChild(s):s(e)};if(i(o[e]),t)return t}const s=e=>{if(!e._$virtual)return null;const t=e.containingSlot;if(null===t)return null;if(void 0!==t)return Pe._$findFirstNonVirtualChild(t,e.slotIndex+1);if(S(e))return s(e.getHostNode());const n=e.parentNode;return n?Pe._$findFirstNonVirtualChild(n,e.parentIndex+1):null};return s(e)}static _$findFirstNonVirtualSibling(e,t){const n=e.containingSlot;if(null===n)return null;if(void 0!==n){if(!n._$virtual)return null;if(void 0!==e.slotIndex)return Pe._$findFirstNonVirtualChild(n,e.slotIndex+1);const o=Pe._$findSlotNodeInsertPosition(n,e,t);return Pe._$findFirstNonVirtualChild(n,o)}let o=e;if(S(e))return o=e.getHostNode(),o._$virtual?Pe._$findFirstNonVirtualChild(o,o.parentIndex+1):null;const s=o.parentNode;return s?Pe._$findFirstNonVirtualChild(s,t):null}static insertChildComposed(e,t,n,o,s){var r,l,a;let d=!1,c=e;for(;null==c?void 0:c._$inheritSlots;)d=!0,c=c.parentNode;if(!c)return;const h=c,u=h._$nodeTreeContext;if(u.destroyed)return;let p;y(h)?h._$external?p=h.shadowRoot.slot:d=!0:(h._$virtual&&(d=!0),p=Pe.findNearestNonVirtual(h));let f=null;const $=(i,r)=>{const l=i||(r?Pe.findNearestNonVirtual(r):null);if(3!==e.getBackendMode()&&!l)return;let a=0,c=null,h=null,p=null;if(t){const e=f||(3===u.mode?u.document.createDocumentFragment():u.createFragment());f=e;const n=t=>{e.appendChild(t._$backendElement),h=e};Pe.forEachNodeInSpecificSlot(t,r,(e=>{p||(p=e),e._$virtual?e.forEachNonVirtualComposedChild(n):n(e)}))}if(3!==e.getBackendMode()||l){if((n||d)&&(o&&n?(Pe.forEachSlotContentInSpecificSlot(n,r,(e=>{if(m(e)){const t=Pe.countNonVirtual(e);t&&(c||(c=t[0]),a+=t[1])}else c||(c=e),a+=1;return!0})),0===a&&h&&p&&(c=Pe._$findFirstNonVirtualSibling(void 0===r?t:p,s+1))):h&&p&&(c=Pe._$findFirstNonVirtualSibling(void 0===r?t:p,s))),h)if(c)if(3===u.mode){const e=c._$backendElement;l.insertBefore(h,e);for(let t=1;t<a;t+=1){const t=e.nextSibling;t&&l.removeChild(t)}a>0&&l.removeChild(e)}else l.spliceBefore(c._$backendElement,a,h);else 3===u.mode?l.appendChild(h):l.spliceAppend(h);else if(a>0)if(3===u.mode){const e=c._$backendElement;for(let t=1;t<a;t+=1){const t=e.nextSibling;t&&l.removeChild(t)}a>0&&l.removeChild(e)}else l.spliceRemove(c._$backendElement,a)}else f=null};if(void 0!==p)null===p||(d||m(t)&&t._$virtual||m(n)&&n._$virtual?$(p,void 0):o?t?p.replaceChild(t._$backendElement,n._$backendElement):p.removeChild(n._$backendElement):n?p.insertBefore(t._$backendElement,n._$backendElement):p.appendChild(t._$backendElement));else if(t&&t._$inheritSlots||o&&n&&n._$inheritSlots){const e=new Set;o&&n&&Pe.forEachSlotContentInSlot(n,((t,n)=>{e.add(n)})),t&&Pe.forEachSlotContentInSlot(t,((t,n)=>{e.add(n)})),e.forEach((e=>$(null,e)))}else t&&$(null,t.containingSlot),!o||!n||t&&n.containingSlot===t.containingSlot||$(null,n.containingSlot);3!==u.mode&&f&&f.release(),i.writeExtraInfoToAttr&&(o&&m(n)&&(null===(r=n._$backendElement)||void 0===r||r.removeAttribute("exparser:info-in-slot-of")),m(t)&&(y(e)?null===(l=t._$backendElement)||void 0===l||l.setAttribute("exparser:info-in-slot-of",e._$componentInstanceId):null===(a=t._$backendElement)||void 0===a||a.removeAttribute("exparser:info-in-slot-of")))}static _$updateSubtreeSlotsInsertion(e,t,n,o,s){if(!t||!n)return;let i=e,r=null,l=null;const a=(e,t)=>{if(e._$subtreeSlotStart){const n=e.childNodes;let o=t+1,s=n[o];for(;s&&!s._$subtreeSlotStart;)o+=1,s=n[o];return void(s?(l=s._$subtreeSlotStart,r=l.prev):(r=e._$subtreeSlotEnd,r&&(l=r.next)))}let n=e,o=e.parentNode;for(;o&&!o._$subtreeSlotStart;)n=o,o=o.parentNode;o&&a(o,n.parentIndex)};for(a(i,o),r&&(r.next=t,t.prev=r),l&&(l.prev=n,n.next=l);i;){let e=!1;if(i._$subtreeSlotStart?i._$subtreeSlotStart===l?(i._$subtreeSlotStart=t,e=!0):i._$subtreeSlotEnd===r&&(i._$subtreeSlotEnd=n,e=!0):(i._$subtreeSlotStart=t,i._$subtreeSlotEnd=n,e=!0),!e||!i.parentNode)break;i=i.parentNode}const d=i.ownerShadowRoot;(null==d?void 0:d.isConnected(i))&&d._$applySlotsInsertion(t,n,s)}static _$updateSubtreeSlotsRemoval(e,t,n,o){if(!t||!n)return;let s=e;const i=t.prev,r=n.next;for(i&&(i.next=r,t.prev=null),r&&(r.prev=i,n.next=null);s;){let e=!1;if(s._$subtreeSlotStart===t&&s._$subtreeSlotEnd===n&&(s._$subtreeSlotStart=s._$subtreeSlotEnd=null,e=!0),s._$subtreeSlotStart===t?(s._$subtreeSlotStart=r,e=!0):s._$subtreeSlotEnd===n&&(s._$subtreeSlotEnd=i,e=!0),!e||!s.parentNode)break;s=s.parentNode}const l=s.ownerShadowRoot;(null==l?void 0:l.isConnected(s))&&l._$applySlotsRemoval(t,n,o)}static _$updateSubtreeSlotsReplacement(e,t,n,o,s,i,r){if(!t||!n)return void Pe._$updateSubtreeSlotsRemoval(e,o,s,r);if(!o||!s)return void Pe._$updateSubtreeSlotsInsertion(e,t,n,i,r);let l=e;const a=o.prev,d=s.next;for(a&&(a.next=t,t.prev=a,o.prev=null),d&&(d.prev=n,n.next=d,s.next=null);l;){let e=!1;if(l._$subtreeSlotStart===o&&(l._$subtreeSlotStart=t,e=!0),l._$subtreeSlotEnd===s&&(l._$subtreeSlotEnd=n,e=!0),!e||!l.parentNode)break;l=l.parentNode}const c=l.ownerShadowRoot;(null==c?void 0:c.isConnected(l))&&(c._$applySlotsRemoval(o,s,!1),c._$applySlotsInsertion(t,n,r))}static _$updateSubtreeSlotNodes(e,t,n,o,s){if(!n&&!o)return;const i=null==n?void 0:n.getSlotMode(),r=null==o?void 0:o.getSlotMode();if(!(void 0!==i&&0!==i||void 0!==r&&0!==r))return;if(!(void 0!==i&&1!==i||void 0!==r&&1!==r)){let e=-1,i=0,r=-1;const l=[],a=t[0].containingSlot,d=null==n?void 0:n.getContainingSlot(t[0]);for(let n=0;n<t.length;n+=1){const o=t[n];Pe.forEachNodeInSlot(o,(t=>{a&&(i?i+=1:(e=t.slotIndex,i=1)),l.push(t)}))}if(d&&l.length){const e=l[0];r=Pe._$findSlotNodeInsertPosition(d,e,s)}return{updateContainingSlot:()=>{for(let e=l.length-1;e>=0;e-=1){const t=l[e];Pe._$updateContainingSlot(t,d)}},removeSlotNodes:()=>{o&&a&&i&&Pe._$spliceSlotNodes(a,e,i,void 0)},insertSlotNodes:()=>{n&&d&&l.length&&Pe._$spliceSlotNodes(d,r,0,l)}}}const l=new Map,a=new Map,d=[];for(let e=0;e<t.length;e+=1){const o=t[e];Pe.forEachNodeInSlot(o,((e,t)=>{const o=0!==i?null==n?void 0:n.getContainingSlot(e):void 0;if(t){const n=a.get(t);n?n.count+=1:a.set(t,{start:e.slotIndex,count:1})}if(o){const t=l.get(o);t?t.nodes.push(e):l.set(o,{nodes:[e],insertPos:-1})}d.push([e,o])}))}if(n&&l.size){const e=l.entries();for(let t=e.next();!t.done;t=e.next()){const[e,{nodes:n}]=t.value,o=n[0];t.value[1].insertPos=Pe._$findSlotNodeInsertPosition(e,o,s)}}return{updateContainingSlot:()=>{for(let e=d.length-1;e>=0;e-=1){const[t,n]=d[e];Pe._$updateContainingSlot(t,n)}},removeSlotNodes:()=>{if(o&&a.size){const e=a.entries();for(let t=e.next();!t.done;t=e.next()){const[e,{start:n,count:o}]=t.value;Pe._$spliceSlotNodes(e,n,o,void 0)}}},insertSlotNodes:()=>{if(n&&l.size){const e=l.entries();for(let t=e.next();!t.done;t=e.next()){const[e,{nodes:n,insertPos:o}]=t.value;Pe._$spliceSlotNodes(e,o,0,n)}}}}}static insertChildSingleOperation(e,t,n,o){var s,i,r,l,a;if(t&&e.ownerShadowRoot!==t.ownerShadowRoot)throw new Error("Cannot move the node from one shadow tree to another shadow tree.");let d=n;const c=d>=0?e.childNodes[d]:void 0;let h,u;if(h=!!o&&(!!c&&t!==c),!h&&!t)return;if(t){if(u=t.parentNode,u){const n=u.childNodes,o=t.parentIndex;n.splice(o,1);for(let e=o;e<n.length;e+=1)n[e].parentIndex=e;t.parentIndex=-1,u===e&&o<d&&(d-=1);const i=Pe._$updateSubtreeSlotNodes(e,[t],null,Pe._$getParentHostShadowRoot(u),d);null==i||i.removeSlotNodes(),3===e.getBackendMode()||(1===e.getBackendMode()?null===(s=u._$backendElement)||void 0===s||s.removeChild(t._$backendElement,o):Pe.insertChildComposed(u,null,t,!0,o)),null==i||i.updateContainingSlot()}t.parentNode=e,m(t)&&u!==e&&(u&&(null===(i=u._$mutationObserverTarget)||void 0===i||i.detachChild(t)),null===(r=e._$mutationObserverTarget)||void 0===r||r.attachChild(t))}else u=null;const p=Pe._$getParentHostShadowRoot(e),f=t?Pe._$updateSubtreeSlotNodes(e,[t],p,null,d):null,$=c&&h?Pe._$updateSubtreeSlotNodes(e,[c],null,p,d):null;if(null==f||f.updateContainingSlot(),null==$||$.removeSlotNodes(),1===e.getBackendMode()){if(e._$backendElement)if(h)t?e._$backendElement.replaceChild(t._$backendElement,c._$backendElement,d):e._$backendElement.removeChild(c._$backendElement,d);else{const n=e.childNodes[d];n?e._$backendElement.insertBefore(t._$backendElement,n._$backendElement,d):e._$backendElement.appendChild(t._$backendElement)}}else Pe.insertChildComposed(e,t,c,h,d);null==f||f.insertSlotNodes(),null==$||$.updateContainingSlot(),h&&c&&(m(c)&&(null===(l=e._$mutationObserverTarget)||void 0===l||l.detachChild(c)),c.parentNode=null,c.parentIndex=-1);const _=e.childNodes;if(t)if(d<0)_.push(t),t.parentIndex=_.length-1;else if(h)_[d]=t,t.parentIndex=d;else{_.splice(d,0,t);for(let e=d;e<_.length;e+=1)_[e].parentIndex=e}else if(h){_.splice(d,1);for(let e=d;e<_.length;e+=1)_[e].parentIndex=e}const g=t?t._$subtreeSlotStart:null,v=t?t._$subtreeSlotEnd:null,b=c?c._$subtreeSlotStart:null,S=c?c._$subtreeSlotEnd:null;t?(u&&Pe._$updateSubtreeSlotsRemoval(u,g,v,!0),h?Pe._$updateSubtreeSlotsReplacement(e,g,v,b,S,d,!!u):Pe._$updateSubtreeSlotsInsertion(e,g,v,d,!!u)):h&&c&&Pe._$updateSubtreeSlotsRemoval(e,b,S,!1),null===(a=e.ownerShadowRoot)||void 0===a||a._$markIdCacheDirty(),h&&(Pe.checkAndCallDetached(c),Pe.checkChildObservers(e,"remove",c)),t&&((null==u?void 0:u._$attached)?e._$attached?Pe.checkAndCallMoved(t):Pe.checkAndCallDetached(t):e._$attached&&Pe.checkAndCallAttached(t),u===e?Pe.checkChildObservers(e,"move",t):(u&&Pe.checkChildObservers(u,"remove",t),Pe.checkChildObservers(e,"add",t)))}static insertChildBatchRemoval(e,t,n){var o,s;const i=e.childNodes[t];let r=e;for(;null==r?void 0:r._$inheritSlots;)r=r.parentNode;const l=y(r)&&!r._$external?r.shadowRoot:null,a=e.childNodes,d=a.splice(t,n);for(let e=t;e<a.length;e+=1)a[e].parentIndex=e;const c=Pe._$updateSubtreeSlotNodes(e,d,null,l,t);if(null==c||c.removeSlotNodes(),1===e.getBackendMode())e._$backendElement&&e._$backendElement.spliceRemove(i._$backendElement,n);else for(let t=n-1;t>=0;t-=1)Pe.insertChildComposed(e,null,d[t],!0,t);for(let t=0;t<n;t+=1){const n=d[t];n.parentNode=null,n.parentIndex=-1,m(n)&&(null===(o=e._$mutationObserverTarget)||void 0===o||o.detachChild(n))}null==c||c.updateContainingSlot();let h=null,u=null;for(let e=0;e<n;e+=1){const t=d[e];h||(h=t._$subtreeSlotStart),t._$subtreeSlotEnd&&(u=t._$subtreeSlotEnd)}Pe._$updateSubtreeSlotsRemoval(e,h,u,!1),null===(s=e.ownerShadowRoot)||void 0===s||s._$markIdCacheDirty();for(let t=0;t<n;t+=1){const n=d[t];Pe.checkAndCallDetached(n),Pe.checkChildObservers(e,"remove",n)}}static insertChildBatchInsertion(e,t,n){var o,s;const i=n>=0?e.childNodes[n]:void 0;let r=e;for(;null==r?void 0:r._$inheritSlots;)r=r.parentNode;const l=y(r)&&!r._$external?r.shadowRoot:null;let a;if(1===e.getBackendMode()&&t.length>=5){a=e.getBackendContext().createFragment()}else a=null;for(let n=0;n<t.length;n+=1){const s=t[n];if(e.ownerShadowRoot!==s.ownerShadowRoot)throw new Error("Cannot move the node from one shadow tree to another shadow tree.");if(s.parentNode)throw new Error("Cannot batch-insert the node which already has a parent.");if(s.parentNode=e,m(s)&&(null===(o=e._$mutationObserverTarget)||void 0===o||o.attachChild(s)),1===e.getBackendMode()&&a){const e=s._$backendElement;a.appendChild(e)}}const d=Pe._$updateSubtreeSlotNodes(e,t,l,null,n);if(null==d||d.updateContainingSlot(),1===e.getBackendMode()){if(e._$backendElement)if(a)i?e._$backendElement.spliceBefore(i._$backendElement,0,a):e._$backendElement.spliceAppend(a),a.release();else if(i)for(let n=0;n<t.length;n+=1){const o=t[n];e._$backendElement.insertBefore(o._$backendElement,i._$backendElement)}else for(let n=0;n<t.length;n+=1){const o=t[n];e._$backendElement.appendChild(o._$backendElement)}}else{const o=n>=0?n:e.childNodes.length;for(let n=0;n<t.length;n+=1){const s=t[n];Pe.insertChildComposed(e,s,i,!1,o)}}null==d||d.insertSlotNodes();const c=e.childNodes;if(i){c.splice(n,0,...t);for(let e=n;e<c.length;e+=1)c[e].parentIndex=e}else{c.push(...t);for(let e=c.length-t.length;e<c.length;e+=1)c[e].parentIndex=e}let h=null,u=null;for(let e=0;e<t.length;e+=1){const n=t[e],o=n._$subtreeSlotStart,s=n._$subtreeSlotEnd;o&&(u?(o.prev=u,u.next=o,u=s):(h=o,u=s))}Pe._$updateSubtreeSlotsInsertion(e,h,u,n+t.length-1,!1),null===(s=e.ownerShadowRoot)||void 0===s||s._$markIdCacheDirty();for(let n=0;n<t.length;n+=1){const o=t[n];e._$attached&&Pe.checkAndCallAttached(o),Pe.checkChildObservers(e,"add",o)}}static insertChildPlaceholderReplace(e,t,n){var o,s,i,r,l,a;if(n&&e.ownerShadowRoot!==n.ownerShadowRoot)throw new Error("Cannot move the node from one shadow tree to another shadow tree.");if(n.parentNode)throw new Error("Cannot replace with the node which already has a parent.");const d=e.childNodes[t];if(!m(d))throw new Error("Cannot replace on text nodes.");if(null!==d._$slotName||null!==n._$slotName)throw new Error("Cannot replace on slot nodes.");if(d===n)return;let c;if(1===e.getBackendMode()){c=e.getBackendContext().createFragment()}else c=null;const h=d.childNodes;if(1===e.getBackendMode()&&h.length>0){const e=d._$backendElement;e&&e.spliceRemove(h[0]._$backendElement,h.length)}for(let t=0;t<h.length;t+=1){const i=h[t];if(3===e.getBackendMode());else if(1===e.getBackendMode()){const e=i._$backendElement;c.appendChild(e)}else Pe.insertChildComposed(d,null,i,!0,t);i.parentNode=n,m(i)&&(null===(o=d._$mutationObserverTarget)||void 0===o||o.detachChild(i),null===(s=e._$mutationObserverTarget)||void 0===s||s.attachChild(i))}d.childNodes=[],d.parentNode=null,d.parentIndex=-1,n.parentNode=e;const u=d.containingSlot,p=d.slotIndex;void 0!==u&&(Pe._$updateContainingSlot(n,u),u&&Pe._$spliceSlotNodes(u,p,1,void 0));const f=h.length?Pe._$updateSubtreeSlotNodes(n,h,Pe._$getParentHostShadowRoot(n),Pe._$getParentHostShadowRoot(d),0):null;if(null==f||f.updateContainingSlot(),null==f||f.removeSlotNodes(),e.childNodes[t]=n,n.parentIndex=t,1===e.getBackendMode())e._$backendElement&&(e._$backendElement.replaceChild(n._$backendElement,d._$backendElement,t),null===(i=n._$backendElement)||void 0===i||i.spliceAppend(c)),c.release();else{Pe.insertChildComposed(e,n,d,!0,t);for(let e=0;e<h.length;e+=1){const t=h[e];Pe.insertChildComposed(n,t,void 0,!1,e)}}null==f||f.insertSlotNodes(),void 0!==u&&(Pe._$updateContainingSlot(d,void 0),u&&Pe._$spliceSlotNodes(u,p,0,[n])),n._$subtreeSlotStart=d._$subtreeSlotStart,n._$subtreeSlotEnd=d._$subtreeSlotEnd,null===(r=e._$mutationObserverTarget)||void 0===r||r.detachChild(d),null===(l=e._$mutationObserverTarget)||void 0===l||l.attachChild(n),n.childNodes.push(...h);for(let e=n.childNodes.length-h.length;e<n.childNodes.length;e+=1)n.childNodes[e].parentIndex=e;if(null===(a=e.ownerShadowRoot)||void 0===a||a._$markIdCacheDirty(),e._$attached){Pe.checkAndCallDetached(d),Pe.checkChildObservers(e,"remove",d),Pe.checkAndCallAttached(n),Pe.checkChildObservers(e,"add",n);for(let t=0;t<h.length;t+=1){const n=h[t];Pe.checkAndCallMoved(n),Pe.checkChildObservers(e,"move",n)}}}appendChild(e){Pe.insertChildSingleOperation(this,e,this.childNodes.length,!1)}insertChildAt(e,t){Pe.insertChildSingleOperation(this,e,t,!1)}insertBefore(e,t){const n=t?t.parentIndex:-1;Pe.insertChildSingleOperation(this,e,n,!1)}removeChildAt(e){Pe.insertChildSingleOperation(this,null,e,!0)}removeChild(e){const t=e.parentIndex;Pe.insertChildSingleOperation(this,null,t,!0)}replaceChildAt(e,t){Pe.insertChildSingleOperation(this,e,t,!0)}replaceChild(e,t){const n=t.parentIndex;Pe.insertChildSingleOperation(this,e,n,!0)}insertChildren(e,t){Pe.insertChildBatchInsertion(this,e,t)}removeChildren(e,t){Pe.insertChildBatchRemoval(this,e,t)}selfReplaceWith(e){const t=this.parentNode;t&&Pe.insertChildPlaceholderReplace(t,this.parentIndex,e)}static _$generateIdMap(e){const t=Object.create(null);return function e(n){if(m(n)){const o=n._$nodeId;o&&(t[o]||(t[o]=n)),n.childNodes.forEach(e)}}(e),t}triggerEvent(e,t,n){Me.triggerEvent(this,e,t,n)}dispatchEvent(e){Me.dispatchEvent(this,e)}_$setListenerStats(e,t,n={}){if(!this._$backendElement)return;const o=!!n.capture||!!n.useCapture;let s;switch(t){case 2:s=0;break;case 4:s=1;break;case 3:s=2;break;default:return}this._$nodeTreeContext&&(3===this.getBackendMode()?this._$nodeTreeContext.setListenerStats(this._$backendElement,e,o,s):this._$backendElement.setListenerStats(e,o,s))}addListener(e,t,n){const o=this._$eventTarget.addListener(e,t,n);this._$setListenerStats(e,o,n),y(this)&&this._$definition._$options.listenerChangeLifetimes&&this.triggerLifetime("listenerChange",[!0,e,t,n])}removeListener(e,t,n){const o=this._$eventTarget.removeListener(e,t,n);1!==o&&(this._$setListenerStats(e,o,n),y(this)&&this._$definition._$options.listenerChangeLifetimes&&this.triggerLifetime("listenerChange",[!1,e,t,n]))}getAttribute(e){return this._$nodeAttributes&&Object.prototype.hasOwnProperty.call(this._$nodeAttributes,e)?this._$nodeAttributes[e]:null}updateAttribute(e,t){this.setAttribute(e,t)}setAttribute(e,t){let n;this._$nodeAttributes?n=this._$nodeAttributes:(n=Object.create(null),this._$nodeAttributes=n),n[e]=t;const o=this._$backendElement;o&&(3===this.getBackendMode()?!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t||null==t?"":String(t)):o.setAttribute(e,t))}removeAttribute(e){this._$nodeAttributes&&delete this._$nodeAttributes[e];const t=this._$backendElement;t&&t.removeAttribute(e)}setDataset(e,t){this.dataset[e]=t,1===this.getBackendMode()&&this._$backendElement.setDataset(e,t)}setMark(e,t){if(this._$marks)this._$marks[e]=t;else{const n={};n[e]=t,this._$marks=n}}collectMarks(){const e={};let t;for(t=this;t;t=t.parentNode){const n=t._$marks;n&&Object.keys(n).forEach((t=>{Object.prototype.hasOwnProperty.call(e,t)||(e[t]=n[t])}))}return e}static replaceDocumentElement(e,t,n){if(e._$attached)throw new Error("An attached element cannot be attached again");e._$backendElement&&t.replaceChild(e._$backendElement,n),Pe.checkAndCallAttached(e)}static pretendAttached(e){e._$attached||Pe.checkAndCallAttached(e)}static pretendDetached(e){e._$attached&&Pe.checkAndCallDetached(e)}static isAttached(e){return e._$attached}static setSlotName(e,t){var n;if(e._$inheritSlots)throw new Error("Slot-inherit mode is not usable in slot element");const o=t?String(t):"",s=e._$slotName;if(s===o)return;const i=null===s;e._$slotName=o,i&&(e._$subtreeSlotStart=e._$subtreeSlotEnd={value:e,prev:null,next:null}),1===e.getBackendMode()&&(null===(n=e._$backendElement)||void 0===n||n.setSlotName(o));const r=e.ownerShadowRoot;if(r)if(i){3===r.getSlotMode()&&(e._$slotValues=Object.create(null)),e.slotNodes=[];const t=e.parentNode;t&&Pe._$updateSubtreeSlotsInsertion(t,e._$subtreeSlotStart,e._$subtreeSlotEnd,e.parentIndex,!1)}else r.isConnected(e)&&r._$applySlotRename(e,o,s)}static getSlotName(e){const t=e._$slotName;return null===t?void 0:t}static setInheritSlots(e){if(!e._$virtual)throw new Error("Cannot set slot-inherit on non-virtual node");if(null!==e._$slotName||0!==e.childNodes.length)throw new Error("Slot-inherit mode cannot be set when the element has any child node");if(1===e.getBackendMode()){const t=e._$backendElement;t&&t.setInheritSlots()}e._$inheritSlots=!0}static getInheritSlots(e){return e._$inheritSlots}isInheritSlots(){return this._$inheritSlots}static setSlotElement(e,t){if(e._$slotElement===t)return;e._$slotElement=t;const n=Pe._$getParentHostShadowRoot(e.parentNode);if(n){const t=Pe._$updateSubtreeSlotNodes(e.parentNode,[e],n,n,e.parentIndex),o=e.containingSlot;null==t||t.updateContainingSlot(),null==t||t.removeSlotNodes();const s=e.containingSlot,i=e=>{if(m(e)&&e._$inheritSlots)for(let t=0;t<e.childNodes.length;t+=1)i(e.childNodes[t]);else Pe.insertChildReassign(e.parentNode,e,o,s,e.parentIndex)};i(e),null==t||t.insertSlotNodes()}}static _$updateContainingSlot(e,t){var n;e.containingSlot=t,1===(null===(n=e.ownerShadowRoot)||void 0===n?void 0:n.getBackendMode())&&e._$backendElement.setContainingSlot(t?t._$backendElement:t)}static _$spliceSlotNodes(e,t,n,o){const s=e.slotNodes=e.slotNodes||[],i=t>=0&&t<s.length;if(null==o?void 0:o.length)if(i){for(let e=t;e<t+n;e+=1)s[e].slotIndex=void 0;s.splice(t,n,...o);for(let e=t;e<s.length;e+=1)s[e].slotIndex=e}else{const e=s.length;s.push(...o);for(let t=e;t<s.length;t+=1)s[t].slotIndex=t}else if(n){for(let e=t;e<t+n;e+=1)s[e].slotIndex=void 0;s.splice(t,n);for(let e=t;e<s.length;e+=1)s[e].slotIndex=e}if(1===e.getBackendMode())if(null==o?void 0:o.length){const s=e._$nodeTreeContext.createFragment();for(let e=0;e<o.length;e+=1)s.appendChild(o[e]._$backendElement);i?e._$backendElement.spliceBeforeSlotNodes(t,n,s):e._$backendElement.spliceAppendSlotNodes(s),s.release()}else n&&e._$backendElement.spliceRemoveSlotNodes(t,n)}static _$findSlotNodeInsertPosition(e,t,n){const o=e.ownerShadowRoot.getHostNode(),s=e=>{let t=0,n=e;for(;n&&n!==o;)t+=1,n=n.parentNode;return t},i=s(t),r=(e,t,n,o,s,i,l)=>{if(e===o)return 0;if(e.parentNode===o.parentNode)return t-(-1===s?l:s);if(i<n){const t=e.parentNode;return r(t,t.parentIndex,n-1,o,s,i,l)}const a=n<i?e:e.parentNode,d=n<i?n:n-1,c=o.parentNode,h=i-1,u=r(a,a.parentIndex,d,c,c.parentIndex,h,l);return 0===u?-1:u},l=e.slotNodes;let a=l.length-1;for(;a>=0;a-=1){const e=l[a];if(r(e,e.parentIndex,s(e),t,t.parentIndex,i,n>=0?n-.5:l.length)<0)break}return a+1}getComposedParent(){if(S(this))return this.getHostNode();if(void 0!==this.containingSlot)return this.containingSlot;let e=this.parentNode;for(;null==e?void 0:e._$inheritSlots;)e=e.parentNode;return e}getComposedChildren(){const e=[];return this.forEachComposedChild((t=>{e.push(t)})),e}forEachComposedChild(e){if(this._$inheritSlots)return!0;if(y(this)&&!this._$external)return!1!==e(this.shadowRoot);if(null!==this._$slotName){const t=this.ownerShadowRoot;return!t||t.forEachNodeInSpecifiedSlot(this,e)}const t=n=>{for(let o=0;o<n.length;o+=1){const s=n[o];if(!1===e(s))return!1;if(s._$inheritSlots&&!t(s.childNodes))return!1}return!0};return t(this.childNodes)}forEachNonVirtualComposedChild(e){if(this._$inheritSlots)return!0;const t=t=>t._$virtual?t.forEachNonVirtualComposedChild(e):!1!==e(t);if(y(this)&&!this._$external)return t(this.shadowRoot);if(null!==this._$slotName){const e=this.ownerShadowRoot;return!e||e.forEachSlotContentInSpecifiedSlot(this,t)}const n=e=>{for(let o=0;o<e.length;o+=1){const s=e[o];if(!t(s))return!1;if(s._$inheritSlots&&!n(s.childNodes))return!1}return!0};return n(this.childNodes)}static parseSelector(e){return new Ae(e)}querySelector(e){return(e instanceof Ae?e:new Ae(e)).query(this,!0)}querySelectorAll(e){return(e instanceof Ae?e:new Ae(e)).query(this,!1)}static matchSelector(e,t){return(e instanceof Ae?e:new Ae(e)).testSelector(null,t)}matchSelector(e,t){return(e instanceof Ae?e:new Ae(e)).testSelector(this,t)}getBoundingClientRect(e){var t;const n=this._$backendElement;if(n)if(3===this.getBackendMode()){const o=n,s=(null===(t=o.getBoundingClientRect)||void 0===t?void 0:t.call(o))||{left:0,top:0,width:0,height:0};setTimeout((()=>{e(s)}),0)}else{const t=n;t.getBoundingClientRect?t.getBoundingClientRect(e):setTimeout((()=>{e({left:0,top:0,width:0,height:0})}),0)}else setTimeout((()=>{e({left:0,top:0,width:0,height:0})}),0)}getScrollOffset(e){const t=this._$backendElement;if(t)if(3===this.getBackendMode()){const n=t,o={scrollLeft:n.scrollLeft||0,scrollTop:n.scrollTop||0,scrollWidth:n.scrollWidth||0,scrollHeight:n.scrollHeight||0};setTimeout((()=>{e(o)}),0)}else{const n=t;n.getScrollOffset?n.getScrollOffset(e):setTimeout((()=>{e({scrollLeft:0,scrollTop:0,scrollWidth:0,scrollHeight:0})}),0)}else setTimeout((()=>{e({scrollLeft:0,scrollTop:0,scrollWidth:0,scrollHeight:0})}),0)}createIntersectionObserver(e,t,n,o){const s=this._$backendElement;if(s){if(e&&!e._$backendElement)return null;if(3===this.getBackendMode()){const i=this._$nodeTreeContext;return i&&i.createIntersectionObserver?i.createIntersectionObserver(s,(null==e?void 0:e._$backendElement)||null,t,n,o):null}const i=s;return i.createIntersectionObserver?i.createIntersectionObserver((null==e?void 0:e._$backendElement)||null,t,n,o):null}return null}getContext(e){const t=this._$backendElement;if(t)if(3===this.getBackendMode()){const n=this._$nodeTreeContext;(null==n?void 0:n.getContext)?n.getContext(t,e):e(null)}else{const n=t;n.getContext?n.getContext(e):e(null)}}}var je;Pe.isElement=m,Pe._$getParentHostShadowRoot=e=>{let t=e;for(;null==t?void 0:t._$inheritSlots;)t=t.parentNode;return y(t)&&!t._$external?t.shadowRoot:null},Pe.prototype[u]=!0,exports.RelationType=void 0,(je=exports.RelationType||(exports.RelationType={}))[je.Ancestor=0]="Ancestor",je[je.Descendant=1]="Descendant",je[je.ParentNonVirtualNode=2]="ParentNonVirtualNode",je[je.ChildNonVirtualNode=3]="ChildNonVirtualNode",je[je.ParentComponent=4]="ParentComponent",je[je.ChildComponent=5]="ChildComponent";const Ue=(e,t,n,o)=>{const s=e=>"function"==typeof e?e:(void 0!==e&&O(`the "${n}" relation listener is not a function (when preparing behavior "${t}").`),null);let i;if("parent"===o.type)i=4;else if("child"===o.type)i=5;else if("parent-common-node"===o.type)i=2;else if("child-common-node"===o.type)i=3;else if("ancestor"===o.type)i=0;else{if("descendant"!==o.type){const e=o.type;return O(`the "${n}" relation has an invalid relation type "${e}" (when preparing behavior "${t}").`),null}i=1}let r=null;if(o.target instanceof gt)r=o.target.behavior;else if(o.target instanceof yt||o.target instanceof G)r=o.target;else{const s=String(o.target||n),i=e.getComponentByUrlWithoutDefault(s,t);if(i)r=i.behavior;else{const t=e.getGlobalUsingComponent(s);"object"==typeof t&&null!==t&&(r=t.behavior)}}return r?{target:r,type:i,linked:s(o.linked),linkChanged:s(o.linkChanged),unlinked:s(o.unlinked),linkFailed:s(o.linkFailed)}:(O(`the target of relation "${n}" is not a valid behavior or component (when preparing behavior "${t}").`),null)};class Fe{constructor(e,t){this._$comp=e;const n=new Array(6);if(t)for(let e=0;e<6;e+=1){const o=t.definitions[e];if(o){const t=new Array(o.length);for(let e=0;e<o.length;e+=1)t[e]=null;n[e]=t}}this._$group=t,this._$sharedGroup=!0,this._$links=n}add(e){if(this._$sharedGroup){this._$sharedGroup=!1;const e=this._$group;this._$group=e?{definitions:e.definitions.slice(),keyMap:Object.assign(Object.create(null),e.keyMap)}:{definitions:new Array(6),keyMap:Object.create(null)}}const t=Symbol(""),n=this._$group.definitions,o=this._$group.keyMap,s=e.type;n[s]?(o[t]=[s,n[s].length],n[s].push(e)):(o[t]=[s,0],n[s]=[e]);const i=this._$links;return void 0===i[s]?i[s]=[null]:i[s].push(null),t}triggerLinkEvent(e,t){var n,o;const s=this._$comp,i=this._$links,r=null===(n=this._$group)||void 0===n?void 0:n.definitions[e];if(r)for(let n=0;n<r.length;n+=1){const l=i[e],a=l[n];let d=null;const h=r[n],u=h.target;if(!t){let t=s;for(;;){const n=t.parentNode;if(!n)break;if(t=n,!b(t)){if(y(t)){if(t.hasBehavior(u)){const n=t._$relation;if(n){let s;s=4===e?5:0===e?1:3;const i=null===(o=n._$group)||void 0===o?void 0:o.definitions[s];if(i){for(let e=0;e<i.length;e+=1){const n=i[e];if(n.target&&this._$comp.hasBehavior(n.target)){d={target:t,def:n};break}}if(d)break}}}if(4===e)break}if(2===e)break}}}if(l[n]=d,a){const e=a.target,t=a.def;d&&a.target===d.target&&a.def===d.def?(t.linkChanged&&c("Relation Link Changed Callback",t.linkChanged,e.getMethodCaller(),[s.getMethodCaller()],e),h.linkChanged&&c("Relation Link Changed Callback",h.linkChanged,s.getMethodCaller(),[e.getMethodCaller()],s)):(t.unlinked&&c("Relation Unlinked Callback",t.unlinked,e.getMethodCaller(),[s.getMethodCaller()],e),h.unlinked&&c("Relation Unlinked Callback",h.unlinked,s.getMethodCaller(),[e.getMethodCaller()],s))}if(d){const e=d.target,t=d.def;a&&a.target===d.target&&a.def===d.def||(t.linked&&c("Relation Linked Callback",t.linked,e.getMethodCaller(),[s.getMethodCaller()],e),h.linked&&c("Relation Linked Callback",h.linked,s.getMethodCaller(),[e.getMethodCaller()],s))}t||d||!h.linkFailed||c("Relation Link Failed Callback",h.linkFailed,s.getMethodCaller(),[],s)}}getLinkedTargets(e){var t,n,o,s;const i=null===(t=this._$group)||void 0===t?void 0:t.keyMap[e];if(!i)return O(`no relation "${String(e)}" found.`),[];const[r,l]=i;if(4===r||2===r||0===r){const e=null===(n=this._$links[r])||void 0===n?void 0:n[l];return e?[e.target]:[]}const a=[],d=this._$comp,c=null===(s=null===(o=this._$group)||void 0===o?void 0:o.definitions[r])||void 0===s?void 0:s[l],h=e=>{const t=e.childNodes;for(let e=0;e<t.length;e+=1){const n=t[e];if(m(n))if(b(n))h(n);else if(y(n)){if(n._$relation){let e;if(e=5===r?n._$relation._$links[4]:1===r?n._$relation._$links[0]:n._$relation._$links[2],e)for(let t=0;t<e.length;t+=1){const o=e[t];if(o&&o.target===d&&o.def===c){a.push(n);break}}}1===r&&h(n)}else 5!==r&&1!==r||h(n)}};return h(this._$comp),a}}class Ge extends Pe{constructor(){throw new Error("Element cannot be constructed directly")}static create(e,t,n,o){var s,r;const l=Object.create(Ge.prototype);l.is=e,l.stylingName=null!=n?n:e,l._$placeholderHandlerRemover=o;const a=t.getBackendContext();let d=null;if(a)if(3===t.getBackendMode())d=a.document.createElement(e);else if(1===t.getBackendMode())d=t._$backendShadowRoot.createElement(e,l.stylingName);else{d=a.createElement(e,l.stylingName)}l._$initialize(!1,d,t,t._$nodeTreeContext);const c=t.getHostNode(),h=c.getComponentOptions(),u=null!==(s=h.styleScope)&&void 0!==s?s:P.globalScope(),p=null!==(r=h.extraStyleScope)&&void 0!==r?r:void 0,f=c._$behavior.ownerSpace.styleScopeManager;if(l.classList=new j(l,void 0,c.classList,u,p,f),d){if(2===t.getBackendMode()&&d.setStyleScope(u,p),i.writeExtraInfoToAttr){const e=f.queryName(u);e&&d.setAttribute("exparser:info-class-prefix",`${e}--`)}3!==t.getBackendMode()?d.associateValue(l):t.getBackendContext().associateValue(d,l)}return l}setModelBindingListener(e,t){if(this._$modelBindingListeners||(this._$modelBindingListeners=Object.create(null)),!this._$modelBindingListeners[e]){const t=this.getBackendElement();if(t){const n=t=>{var n;const o=null===(n=this._$modelBindingListeners)||void 0===n?void 0:n[e];o&&o.call(this,t)};3===this.getBackendMode()?this.getBackendContext().setModelBindingStat(t,e,n):t.setModelBindingStat(e,n)}}this._$modelBindingListeners[e]=t}getModelBindingListeners(){const e=Object.create(null);return this._$modelBindingListeners&&Object.keys(this._$modelBindingListeners).forEach((t=>{e[t]=e=>{var n;const o=null===(n=this._$modelBindingListeners)||void 0===n?void 0:n[t];o&&o.call(this,e)}})),e}}Ge.isNativeNode=v,Ge.prototype[p]=!0;class Ve{constructor(e,t){this._$slotElement=null,this._$destroyOnDetach=!1,this._$subtreeSlotStart=null,this._$subtreeSlotEnd=null,this._$text=String(e);let n=null;const o=t.getBackendContext();if(o)if(3===t.getBackendMode())n=o.document.createTextNode(e);else if(1===t.getBackendMode()){n=t._$backendShadowRoot.createTextNode(e)}else{n=o.createTextNode(e)}this._$backendElement=n,this.ownerShadowRoot=t,this.parentNode=null,this.parentIndex=-1,this.containingSlot=void 0}static create(e,t){return new Ve(e,t)}asTextNode(){return this}asElement(){return null}asNativeNode(){return null}asVirtualNode(){return null}asInstanceOf(){return null}destroyBackendElement(){this._$backendElement&&(3!==this.ownerShadowRoot.getBackendMode()&&this._$backendElement.release(),this._$backendElement=null)}destroyBackendElementOnDetach(){this._$destroyOnDetach=!0}getBackendElement(){return this._$backendElement}getComposedParent(){if(void 0!==this.containingSlot)return this.containingSlot;let e=this.parentNode;for(;null==e?void 0:e._$inheritSlots;)e=e.parentNode;return e}get $$(){return this._$backendElement}get textContent(){return this._$text}set textContent(e){const t=String(e);t!==this._$text&&(this._$text=t,this._$backendElement&&(3===this.ownerShadowRoot.getBackendMode()?this._$backendElement.textContent=this._$text:this._$backendElement.setText(this._$text)),ae.callTextObservers(this,{type:"characterData",target:this}))}}Ve.isTextNode=g,Ve.prototype[h]=!0;class We extends Pe{constructor(){throw new Error("Element cannot be constructed directly")}_$initializeVirtual(e,t,n){if(this.is=String(e),n&&1===n.mode){const o=t._$backendShadowRoot.createVirtualNode(e);this._$initialize(!0,o,t,n),o.associateValue(this)}else this._$initialize(!0,null,t,t._$nodeTreeContext)}static create(e,t){const n=Object.create(We.prototype);return n._$initializeVirtual(e,t,t.getBackendContext()),n}}var He;We.isVirtualNode=b,We.prototype[f]=!0,function(e){e[e.Direct=0]="Direct",e[e.Single=1]="Single",e[e.Multiple=2]="Multiple",e[e.Dynamic=3]="Dynamic"}(He||(He={}));class ze extends We{constructor(){throw new Error("Element cannot be constructed directly")}static createShadowRoot(e){const t=Object.create(ze.prototype);let n=null;1===e.getBackendMode()&&(n=e._$backendElement.getShadowRoot()),t.is="shadow",t._$idMap=null;let o=1;const s=e.getComponentOptions();return s.multipleSlots?o=2:s.dynamicSlots?o=3:s.directSlots&&(o=0),t._$slotMode=o,1===o?t._$singleSlot=null:2===o?(t._$slots=Object.create(null),t._$slotsList=Object.create(null)):3===o&&(t._$dynamicSlotsInserted=!1,t._$dynamicSlots=new Map,t._$requiredSlotValueNames=[],t._$propertyPassingDeepCopy=ye(s.propertyPassingDeepCopy),t._$insertDynamicSlotHandler=void 0,t._$removeDynamicSlotHandler=void 0,t._$updateDynamicSlotHandler=void 0),t._$backendShadowRoot=n,t._$initialize(!0,n,t,e._$nodeTreeContext),t._$host=e,e.shadowRoot=t,null==n||n.associateValue(t),t}getHostNode(){return this._$host}createTextNode(e=""){return new Ve(e,this)}createNativeNode(e){return Ge.create(e,this)}createVirtualNode(e="virtual"){return We.create(e,this)}createNativeNodeWithInit(e,t,n,o){const s=Ge.create(e,this,t,n);return null==o||o(s),s}createComponent(e,t,n,o,s){const i=this._$host,r=i._$behavior,l=i._$genericImpls,a=r.ownerSpace,d=void 0===t?e:t,c=[r._$using[d],l&&l[d]];for(let t=0;t<c.length;t+=1){const d=c[t];if(null==d)continue;if("string"==typeof d)return this.createNativeNodeWithInit(d,e,void 0,s);let h,u;if(d.final)h=d.final;else if(null!==d.placeholder){h=_t(d.placeholder,a,d.source,l);const e=d.waiting;o&&e&&(e.add(o),e.hintUsed(i),u=()=>{e.remove(o)})}if("string"==typeof h)return this.createNativeNodeWithInit(h,e,u,s);if(h)return bt._$advancedCreate(e,h,this,null,$t(h,r,i,n),u,s)}let h=a.getGlobalUsingComponent(d);if(null===h&&a._$allowUnusedNativeNode&&""!==d&&(h=d),!h){if(h=a.getDefaultComponent(),!h)throw new M(`Cannot find component "${d}"`,void 0,this._$host);O(`Cannot find component "${d}", using default component.`,this._$host)}return"string"==typeof h?this.createNativeNodeWithInit(h,e,void 0,s):bt._$advancedCreate(e,h,this,null,$t(h,r,i,n),void 0,s)}createComponentByDef(e,t){return bt._$advancedCreate(e,t,this,null,null,void 0)}createComponentOrNativeNode(e,t,n){const o=this._$host,s=o._$behavior,i=s.ownerSpace,r=i.getGlobalUsingComponent(e);if("string"==typeof r)return this.createNativeNodeWithInit(r,e,void 0,n);if(r)return bt._$advancedCreate(e,r,this,null,$t(r,s,o,t),void 0,n);if(i._$allowUnusedNativeNode){const t=Ge.create(e,this);return null==n||n(t),t}throw new M(`Unknown tag name ${e}`,"[render]",o)}checkComponentPlaceholder(e){var t;let n;const o=this._$host._$behavior._$using[e];if(void 0!==o)n=o;else{const o=null===(t=this._$host._$genericImpls)||void 0===t?void 0:t[e];if(!o)return;n=o}return"string"!=typeof n&&(!n.final&&null!==n.placeholder)}getElementById(e){return this._$getIdMap()[e]}_$markIdCacheDirty(){this._$idMap=null}_$getIdMap(){if(this._$idMap)return this._$idMap;const e=Pe._$generateIdMap(this);return this._$idMap=e,e}getSlotElementFromName(e){const t=this._$slotMode;if(0===t)throw new Error("cannot get slot element in directSlots");if(1===t)return this._$singleSlot;if(2===t)return this._$slots[e]||null;if(3===t){const t=[];for(let n=this._$subtreeSlotStart;n;n=n.next){const o=n.value;(o._$slotName||"")===e&&t.push(o)}return t}return null}getContainingSlot(e){var t;const n=this._$slotMode;if(0===n)return(null==e?void 0:e.containingSlot)||null;if(1===n)return this._$singleSlot;if(3===n){if(!e)return null;let n=e;for(;null===(t=n.parentNode)||void 0===t?void 0:t._$inheritSlots;)n=n.parentNode;const o=n._$slotElement;if((null==o?void 0:o.ownerShadowRoot)===this)return o}if(2===n){let t;return t=m(e)?e._$nodeSlot:"",this._$slots[t]||null}return null}getSlotContentArray(e){if(null===e._$slotName)return null;const t=[];return this.forEachNodeInSpecifiedSlot(e,(e=>{t.push(e)})),t}forEachSlot(e){const t=this._$slotMode;if(0===t)throw new Error("Cannot iterate slots in directSlots");if(1===t)this._$singleSlot&&e(this._$singleSlot);else if(2===t){const t=Object.values(this._$slots);for(let n=0;n<t.length&&!1!==e(t[n]);n+=1);}else if(3===t)for(let t=this._$subtreeSlotStart;t&&!1!==e(t.value);t=t.next);}forEachNodeInSlot(e){const t=this._$host.childNodes;for(let n=0;n<t.length;n+=1)if(!Pe.forEachNodeInSlot(t[n],e))return!1;return!0}forEachNodeInSpecifiedSlot(e,t){if(e){const n=e.slotNodes;for(let e=0;e<n.length;e+=1){const o=n[e];if(!1===t(o))return!1}return!0}return this.forEachNodeInSlot(((e,n)=>null!==n||t(e)))}forEachSlotContentInSlot(e){const t=this._$host.childNodes;for(let n=0;n<t.length;n+=1)if(!Pe.forEachSlotContentInSlot(t[n],e))return!1;return!0}forEachSlotContentInSpecifiedSlot(e,t){if(e){const n=e.slotNodes;for(let e=0;e<n.length;e+=1){const o=n[e];if(!o._$inheritSlots&&!1===t(o))return!1}return!0}return this.forEachSlotContentInSlot(((e,n)=>null!==n||t(e)))}isConnected(e){if(e.ownerShadowRoot!==this)return!1;for(let t=e;t;t=t.parentNode)if(t===this)return!0;return!1}_$applyMultipleSlotInsertion(e,t,n){const o=this._$slotsList,s=this._$slots;if(o[t]){const n=o[t];let s={next:n},i=!0;for(let t=this._$subtreeSlotStart;t&&s.next&&t.value!==e;t=t.next)t.value===s.next.value&&(i=!1,s=s.next);if(i)o[t]=n.prev={value:e,prev:null,next:n};else{const t=s.next;s.next={value:e,prev:s,next:t},t&&(t.prev=s.next)}}else o[t]={value:e,prev:null,next:null};const i=s[t],r=o[t].value;i!==r&&(s[t]=r,Pe._$insertChildReassignSlot(this,t,i||null,r))}_$applyMultipleSlotsRemoval(e,t,n){const o=this._$slotsList,s=this._$slots;let i=o[t]||null;for(;i&&i.value!==e;i=i.next);if(!i)return;const r=i.prev,l=i.next;r&&(r.next=l),l&&(l.prev=r);if(!!r)return;const a=l;if(a){const i=a.value;o[t]=a,n||(s[t]=i,Pe._$insertChildReassignSlot(this,t,e,i))}else delete o[t],n||(delete s[t],Pe._$insertChildReassignSlot(this,t,e,null))}_$applySlotRename(e,t,n){const o=this._$slotMode;if(1!==o&&0!==o){if(2===o)return this._$applyMultipleSlotsRemoval(e,n,!1),void this._$applyMultipleSlotInsertion(e,t,!1);if(3===o){if(!this._$dynamicSlotsInserted)return;const n=this._$insertDynamicSlotHandler,o=this._$removeDynamicSlotHandler;this._$dynamicSlots.set(e,{updatePathTree:void 0}),null==o||o([e]),null==n||n([{slot:e,name:t,slotValues:e._$slotValues}])}}}_$applySlotsInsertion(e,t,n){const o=this._$slotMode;if(0!==o){if(1===o){const e=this._$singleSlot,t=this._$subtreeSlotStart.value;if(e===t)return;return this._$singleSlot=t,void Pe._$insertChildReassignSlot(this,null,e,t)}if(2!==o){if(3===o){if(n)return;if(!this._$dynamicSlotsInserted)return;const o=this._$insertDynamicSlotHandler,s=[];for(let n=e;n&&n!==t.next;n=n.next){const e=n.value,t=e._$slotName;this._$dynamicSlots.set(e,{updatePathTree:void 0}),s.push({slot:e,name:t,slotValues:e._$slotValues})}null==o||o(s)}}else for(let o=e;o&&o!==t.next;o=o.next){const e=o.value,t=e._$slotName;this._$applyMultipleSlotInsertion(e,t,n)}}}_$applySlotsRemoval(e,t,n){var o;const s=this._$slotMode;if(0!==s){if(1===s){if(n)return;const e=this._$singleSlot,t=(null===(o=this._$subtreeSlotStart)||void 0===o?void 0:o.value)||null;if(e===t)return;return this._$singleSlot=t,void Pe._$insertChildReassignSlot(this,null,e,t)}if(2!==s){if(3===s){if(n)return;if(!this._$dynamicSlotsInserted)return;const o=this._$removeDynamicSlotHandler,s=[];for(let n=e;n&&n!==t.next;n=n.next){const e=n.value;this._$dynamicSlots.delete(e),s.push(e)}null==o||o(s)}}else for(let o=e;o&&o!==t.next;o=o.next){const e=o.value,t=e._$slotName;this._$applyMultipleSlotsRemoval(e,t,n)}}}setDynamicSlotHandler(e,t,n,o){if(3===this._$slotMode&&(this._$requiredSlotValueNames=e,this._$insertDynamicSlotHandler=t,this._$removeDynamicSlotHandler=n,this._$updateDynamicSlotHandler=o,this._$dynamicSlotsInserted)){const e=this._$dynamicSlots.values();for(let t=e.next();!t.done;t=e.next()){const e=t.value;e.updatePathTree=e.updatePathTree||Object.create(null)}}}useDynamicSlotHandlerFrom(e){e._$insertDynamicSlotHandler&&this.setDynamicSlotHandler(e._$requiredSlotValueNames.slice(),e._$insertDynamicSlotHandler,e._$removeDynamicSlotHandler,e._$updateDynamicSlotHandler)}replaceSlotValue(e,t,n){var o;const s=e._$slotValues;if(!s)return;const i=s[t];let r=n;if(0!==this._$propertyPassingDeepCopy&&(r=2===this._$propertyPassingDeepCopy?re(n,!0):ie(n)),i===r)return;if(s[t]=r,this._$requiredSlotValueNames.indexOf(t)<0)return;const l=null===(o=this._$dynamicSlots)||void 0===o?void 0:o.get(e);l&&(l.updatePathTree||(l.updatePathTree=Object.create(null)),l.updatePathTree[t]=!0)}applySlotValueUpdates(e){var t,n;const o=null===(t=this._$dynamicSlots)||void 0===t?void 0:t.get(e),s=null==o?void 0:o.updatePathTree;s&&(o.updatePathTree=void 0,null===(n=this._$updateDynamicSlotHandler)||void 0===n||n.call(this,e,e._$slotValues,s))}applySlotUpdates(){var e;if(this._$dynamicSlotsInserted){const t=this._$dynamicSlots.entries();for(let n=t.next();!n.done;n=t.next()){const[t,o]=n.value,s=o.updatePathTree;s&&(o.updatePathTree=void 0,null===(e=this._$updateDynamicSlotHandler)||void 0===e||e.call(this,t,t._$slotValues,s))}}else{this._$dynamicSlotsInserted=!0;const e=this._$insertDynamicSlotHandler,t=[];for(let e=this._$subtreeSlotStart;e;e=e.next){const n=e.value,o=n._$slotName;this._$dynamicSlots.set(n,{updatePathTree:void 0}),t.push({slot:n,name:o,slotValues:n._$slotValues})}null==e||e(t)}}getSlotMode(){return this._$slotMode}}ze.isShadowRoot=S,ze.prototype[$]=!0;class Ke{constructor(e,t,n,o,s){this.ownerShadowRoot=o,this.elem=n,this.keyName=e,this.updateKeys(t);const i=this.items,r=this.indexes,l=[];for(let e=0;e<i.length;e+=1){const t=i[e],n=null===r?e:r[e];l.push(s(t,n))}n.insertChildren(l,-1)}updateKeys(e){let t,n;if(Array.isArray(e))t=e,n=null;else if("object"==typeof e&&null!==e){const o=Object.keys(e);t=new Array(o.length),n=new Array(o.length);for(let s=0;s<o.length;s+=1){const i=o[s],r=e[i];t[s]=r,n[s]=i}}else if("string"==typeof e){O("Use string as for-list is generally for testing. Each character is treated as an item.",this.ownerShadowRoot.getHostNode(),this.elem),t=new Array(e.length),n=null;for(let n=0;n<e.length;n+=1)t[n]=e[n]}else if("number"==typeof e){O("Use number as for-list is generally for testing. The number is used as the repeated times of the item.",this.ownerShadowRoot.getHostNode(),this.elem),t=new Array(e),n=null;for(let n=0;n<e;n+=1)t[n]=n}else O(`The for-list data is neither Array nor Object, got type "${null===e?"null":typeof e}".`,this.ownerShadowRoot.getHostNode(),this.elem),t=[],n=null;this.items=t,this.indexes=n;const o=this.keyName,s=new Array(t.length),i=Object.create(null);let r;if(null!==o){for(let e=0;e<t.length;e+=1){const n=t[e],l="*this"===o?n:null==n?void 0:n[o],a=null!=l?String(l):"";s[e]=a,void 0!==i[a]?(r||(r=Object.create(null)),r[a]=[i[a],e],delete i[a]):(null==r?void 0:r[a])?r[a].push(e):i[a]=e}if(r){const e=Object.keys(r);O(`Some keys are not unique while list updates: "${e.join('", "')}".`,this.ownerShadowRoot.getHostNode(),this.elem);for(let t=0;t<e.length;t+=1){const n=e[t],o=r[n];let l=0;for(let e=0;e<o.length;e+=1){const t=o[e];for(;void 0!==i[`${n}--${l}`];)l+=1;const r=`${n}--${l}`;i[r]=t,s[t]=r}}}}this.rawKeys=s,this.keyMap=i,this.sharedKeyMap=r}diff(e,t,n,o,s){const i=this.rawKeys,r=this.keyMap,l=this.sharedKeyMap,a=this.indexes;this.updateKeys(e);const d=this.rawKeys,c=this.sharedKeyMap,h=this.items,u=this.indexes,p=this.keyName;let f,$;if(!0===t)$=!0,f=null===p;else if(void 0===t)$=t,f=!0;else if(null===p)$=!0,f=!0;else{let e=!1;if(Array.isArray(t))e=!0;else{const n=Object.keys(t);for(let o=0;o<n.length;o+=1){const s=t[n[o]];if(!0===s||("*this"===p?s:null==s?void 0:s[p])){e=!0;break}}}if(e){$=new Array(d.length);for(let e=0;e<d.length;e+=1){const n=d[e];if(void 0!==(null==l?void 0:l[n])||void 0!==(null==c?void 0:c[n]))$[e]=!0;else{const n=t[e];void 0===n||(!0===n||("*this"===p?n:null==n?void 0:n[p])?$[e]=!0:$[e]=n)}}f=!1}else $=t,f=!1}if(f){let e;e=!!Array.isArray(t)||t;let r=0;for(;r<i.length&&r<d.length;){const t=h[r],o=null===u?r:u[r],i=null===a?r:a[r];s(t,o,!0===e||void 0===e?e:e[o],o!==i,n.childNodes[r]),r+=1}if(r<i.length)n.removeChildren(r,i.length-r);else if(r<d.length){const e=[];for(;r<d.length;r+=1){const t=h[r],n=null===u?r:u[r];e.push(o(t,n))}n.insertChildren(e,-1)}return}const _=[],g=[],m=new Array(d.length),v=new Array(d.length);let b=-1,S=-1;for(let e=0;e<d.length;e+=1){const t=d[e];if(i[b+1]===t){b+=1,S+=1,_[S]=b,g[S]=e,m[e]=S>0?g[S-1]:-1,v[e]=b;continue}const n=r[t];if(void 0===n){v[e]=-1;continue}let o=0,s=_.length;for(;o<s;){const e=Math.floor((o+s)/2);n<_[e]?s=e:o=e+1}_[s]=n,g[s]=e,m[e]=s>0?g[s-1]:-1,v[e]=n,b=n,S=s}const y=g.length;if(y===d.length&&y===i.length){let e=0;for(;e<i.length&&e<d.length;){const t=h[e],o=null===u?e:u[e],i=null===a?e:a[e];s(t,o,!0===$||void 0===$?$:$[e],o!==i,n.childNodes[e]),e+=1}return}let C=y>0?g[y-1]:-1,w=y;for(;-1!==C;)w-=1,_[w]=C,C=m[C];const N=_;let E;!function(e){e[e.Stable=0]="Stable",e[e.ForwardMove=1]="ForwardMove",e[e.BackwardMove=2]="BackwardMove"}(E||(E={}));const x=new Array(i.length),k=new Array(d.length);let O=-1;for(let e=0;e<v.length;e+=1){const t=v[e];if(e!==N[w])if(-1!==t)x[t]=t>O?2:1,k[e]=n.childNodes[t];else{const t=h[e],n=null===u?e:u[e];k[e]=o(t,n)}else O=t,w+=1,x[t]=0}let M=0,L=0,D=0;w=0;do{const e=w<N.length?N[w]:k.length,t=w<N.length?v[e]:x.length;for(;L<t;)if(void 0===x[L]){const e=L;L+=1;let o=1;for(;L<t&&void 0===x[L];)L+=1,o+=1;n.removeChildren(e+M,o),M-=o}else 2===x[L]&&(M-=1),L+=1;for(;D<e;){const o=k[D],i=v[D];if(-1===i){const o=D;D+=1;let s=1;for(;D<e&&-1===v[D];)D+=1,s+=1;n.insertChildren(k.slice(o,o+s),t+M),M+=s}else{n.insertChildAt(o,t+M);const e=h[D],r=null===u?D:u[D],l=null===a?i:a[i];s(e,r,!0===$||void 0===$?$:$[D],r!==l,o),2===x[i]&&(M+=1),D+=1}}if(w<N.length){const o=h[e],i=null===u?e:u[e],r=null===a?t:a[t];s(o,i,!0===$||void 0===$?$:$[e],i!==r,n.childNodes[t+M])}L=t+1,D=e+1,w+=1}while(w<=N.length)}}const qe=e=>e,Xe=e=>{const t=e;return t._$wxTmplArgs=t._$wxTmplArgs||{}},Ye=e=>null==e?"":String(e),Ze=e=>e.replace(/-(.|$)/g,(e=>e[1]?e[1].toUpperCase():""));class Qe{constructor(e,t,n,o){this.bindingMapDisabled=!1,this.eventObjectFilter=qe,this.changePropFilter=qe,this.eventListenerFilter=qe,this.r=(e,t,n,o,s)=>{var i;const r=t=>{if(t.startsWith("bind"))this.v(e,t.slice(4),Ye(n),!1,!1,!1,!0,s);else if(t.startsWith("captureBind"))this.v(e,t.slice(11),Ye(n),!1,!1,!0,!0,s);else if(t.startsWith("catch"))this.v(e,t.slice(5),Ye(n),!0,!1,!1,!0,s);else if(t.startsWith("captureCatch"))this.v(e,t.slice(12),Ye(n),!0,!1,!0,!0,s);else{if(!t.startsWith("on"))return!1;this.v(e,t.slice(2),Ye(n),!1,!1,!1,!0,s)}return!0};if(y(e)){const s=bt.getDataProxy(e),l=Ze(t);if(s.replaceProperty(l,n)){void 0!==o&&(null===o?s.setModelBindingListener(l,(()=>{})):s.setModelBindingListener(l,(t=>{const n=e.ownerShadowRoot.getHostNode(),s=bt.getDataProxy(n);s.replaceDataOnPath(o,t),s.applyDataUpdates(!1)})));const r=Xe(e);if(null===(i=r.changeProp)||void 0===i?void 0:i[t]){const o=r.changeProp[t],s=o.oldValue;if(s!==n){o.oldValue=n;const t=e.ownerShadowRoot.getHostNode();o.listener.call(t.getMethodCaller(),n,s,t,e)}}}else e.hasExternalClass(t)?e.setExternalClass(t,n):r(l)}else if(v(e)){if(this.fallbackListenerOnNativeNode){r(Ze(t))||e.updateAttribute(t,n)}else e.updateAttribute(t,n);o&&e.setModelBindingListener(t,(t=>{const n=e.ownerShadowRoot.getHostNode(),s=bt.getDataProxy(n);s.replaceDataOnPath(o,t),s.applyDataUpdates(!1)}))}},this.shadowRoot=e,this.procGen=t,this.fallbackListenerOnNativeNode=n,o&&(this.eventObjectFilter=o)}create(e){const{shadowRoot:t,procGen:n}=this,o=n(this,!0,e,void 0);return this.handleChildrenCreationAndInsert(o.C,t,void 0,void 0),o.B}update(e,t){const{shadowRoot:n,procGen:o}=this,s=o(this,!1,e,t);this.handleChildrenUpdate(s.C,n,void 0,void 0)}bindingMapUpdate(e,t,n){if(this.bindingMapDisabled)return!1;const o=n[e];if(!o)return!1;let s=null;for(let e=0;e<o.length;e+=1){(0,o[e])(t,(e=>{if(null!==s&&e!==s&&y(s)&&s.hasPendingChanges()){bt.getDataProxy(s).applyDataUpdates(!0)}s=e}),((e,t)=>{e.textContent=t}))}const i=s;if(null!==i&&y(i)&&i.hasPendingChanges()){bt.getDataProxy(i).applyDataUpdates(!0)}return!0}handleChildrenCreation(e,t,n){const o=[];return e(!0,((e,s)=>{if(t&&""!==n){const e=this.createDynamicPlaceholder(t);return void o.push(e)}const i=this.shadowRoot.createTextNode(e);i.destroyBackendElementOnDetach(),t&&Pe.setSlotElement(i,t),s&&s(i),o.push(i)}),((e,s,i,r,l,a)=>{if(t&&n!==(l||"")){const e=this.createDynamicPlaceholder(t);return void o.push(e)}const d=this.createCommonElement(e,s,i,r,a);if(t){Pe.setSlotElement(d,t);Xe(d).dynamicSlotNameMatched=!0}else void 0!==l&&(d.slot=l);o.push(d)}),((e,s)=>{const i=this.shadowRoot.createVirtualNode("wx:if");i.destroyBackendElementOnDetach(),Pe.setInheritSlots(i),t&&Pe.setSlotElement(i,t);Xe(i).key=e,this.handleChildrenCreationAndInsert(s,i,t,n),o.push(i)}),((e,s,i,r,l)=>{const a=this.shadowRoot,d=a.createVirtualNode("wx:for");d.destroyBackendElementOnDetach(),Pe.setInheritSlots(d),t&&Pe.setSlotElement(d,t);Xe(d).keyList=new Ke(s,e,d,a,((e,o)=>{const s=a.createVirtualNode("wx:for-item");return s.destroyBackendElementOnDetach(),Pe.setInheritSlots(s),t&&Pe.setSlotElement(d,t),this.handleChildrenCreationAndInsert(((t,n,s,i,a,d,c)=>{l(!0,e,o,void 0,void 0,r?[...r,o]:null,n,s,i,a,d,c)}),s,t,n),s})),o.push(d)}),((e,n,s)=>{const i=this.shadowRoot.createVirtualNode("slot");i.destroyBackendElementOnDetach(),Pe.setSlotName(i,Ye(e)),t?Pe.setSlotElement(i,t):void 0!==s&&(i.slot=s),n&&n(i),o.push(i)}),((e,s)=>{if(void 0!==s)if(t)if(n===s){const n=this.shadowRoot.createVirtualNode("virtual");n.destroyBackendElementOnDetach(),Pe.setSlotElement(n,t);Xe(n).dynamicSlotNameMatched=!0,this.handleChildrenCreationAndInsert(e,n,void 0,void 0),o.push(n)}else{const e=this.createDynamicPlaceholder(t);o.push(e)}else{const t=this.shadowRoot.createVirtualNode("virtual");t.destroyBackendElementOnDetach(),t.slot=s,this.handleChildrenCreationAndInsert(e,t,void 0,void 0),o.push(t)}else{const s=this.shadowRoot.createVirtualNode("virtual");s.destroyBackendElementOnDetach(),Pe.setInheritSlots(s),t&&Pe.setSlotElement(s,t),this.handleChildrenCreationAndInsert(e,s,t,n),o.push(s)}}),void 0,void 0),o}handleChildrenCreationAndInsert(e,t,n,o){const s=this.handleChildrenCreation(e,n,o);s.length&&t.insertChildren(s,-1)}handleChildrenUpdate(e,t,n,o){let s=0;const i=n?n.slotNodes.filter((e=>e.parentNode===t)):t.childNodes;e(!1,(e=>{const t=i[s];if(s+=1,n){if(!Xe(t).dynamicSlotNameMatched)return}void 0!==e&&(t.textContent=e)}),((e,r,l,a,d,c)=>{const h=i[s];if(s+=1,n){const s=Xe(h);if(o!==(d||"")){if(s.dynamicSlotNameMatched){const e=this.createDynamicPlaceholder(n);t.replaceChild(e,h)}return}if(!s.dynamicSlotNameMatched){const o=this.createCommonElement(e,r,l,a,c);Pe.setSlotElement(o,n);return Xe(o).dynamicSlotNameMatched=!0,void t.replaceChild(o,h)}}l(h,!1);let u=!1;if(y(h)){const e=this.dynamicSlotUpdate(h,c,a);if(e&&(u=!0),h.hasPendingChanges()){bt.getDataProxy(h).applyDataUpdates(!0)}null==e||e.applySlotUpdates()}n||void 0!==d&&(h.slot=d),u||this.handleChildrenUpdate(a,h,void 0,void 0)}),((e,r)=>{const l=i[s];s+=1;if(Xe(l).key===e)this.handleChildrenUpdate(r,l,n,o);else{const i=this.shadowRoot.createVirtualNode("wx:if");i.destroyBackendElementOnDetach(),Pe.setInheritSlots(i),n&&Pe.setSlotElement(i,n);Xe(i).key=e,this.handleChildrenCreationAndInsert(r,i,n,o),n?t.replaceChild(i,l):t.replaceChildAt(i,s-1)}}),((e,t,r,l,a)=>{const d=i[s];s+=1;Xe(d).keyList.diff(e,r,d,((e,t)=>{const s=this.shadowRoot.createVirtualNode("wx:for-item");return s.destroyBackendElementOnDetach(),Pe.setInheritSlots(s),n&&Pe.setSlotElement(d,n),this.handleChildrenCreationAndInsert(((n,o,s,i,r,d,c)=>{a(!0,e,t,void 0,void 0,l?[...l,t]:null,o,s,i,r,d,c)}),s,n,o),s}),((e,t,s,i,r)=>{this.handleChildrenUpdate(((n,o,r,d,c,h,u)=>{a(!1,e,t,s,!!i||void 0,l?[...l,t]:null,o,r,d,c,h,u)}),r,n,o)}))}),((e,t,o)=>{const r=i[s];s+=1,void 0!==e&&Pe.setSlotName(r,Ye(e)),n||void 0!==o&&(r.slot=o),t&&t(r),this.shadowRoot.applySlotValueUpdates(r)}),((e,r)=>{const l=i[s];if(s+=1,void 0!==r)if(n){const s=Xe(l);if(o===r)if(s.dynamicSlotNameMatched)this.handleChildrenUpdate(e,l,void 0,void 0);else{const o=this.shadowRoot.createVirtualNode("virtual");o.destroyBackendElementOnDetach(),Pe.setSlotElement(o,n);Xe(o).dynamicSlotNameMatched=!0,this.handleChildrenCreationAndInsert(e,o,void 0,void 0),t.replaceChild(o,l)}else if(s.dynamicSlotNameMatched){const e=this.createDynamicPlaceholder(n);t.replaceChild(e,l)}}else l.slot=r,this.handleChildrenUpdate(e,l,void 0,void 0);else this.handleChildrenUpdate(e,l,n,o)}),void 0,void 0)}dynamicSlotUpdate(e,t,n){const o=e.getShadowRoot();return 3===(null==o?void 0:o.getSlotMode())?(o.setDynamicSlotHandler(t||[],(t=>{const o=[];for(let e=0;e<t.length;e+=1){const{slot:s,name:i,slotValues:r}=t[e],l=this.handleChildrenCreation(((e,t,o,s,i,l,a)=>{n(!0,t,o,s,i,l,a,r,void 0)}),s,i);o.push(...l)}o.length&&e.insertChildren(o,-1)}),(t=>{if(!t.length||!t[0].slotNodes.length)return;t.sort(((e,t)=>e.slotNodes[0].parentIndex-t.slotNodes[0].parentIndex));let n=-1/0,o=-1/0;for(let s=0;s<t.length;s+=1){const i=t[s].slotNodes,r=i[0].parentIndex;o===r||(n>=0&&e.removeChildren(n,o-n),n=r),o=r+i.length}n>=0&&e.removeChildren(n,o-n)}),((t,o,s)=>{const i=t._$slotName||"";this.handleChildrenUpdate(((e,t,i,r,l,a,d)=>{n(!1,t,i,r,l,a,d,o,s)}),e,t,i)})),o):null}createDynamicPlaceholder(e){const t=this.shadowRoot.createVirtualNode("virtual");t.destroyBackendElementOnDetach(),Pe.setSlotElement(t,e);return Xe(t).dynamicSlotNameMatched=!1,t}createCommonElement(e,t,n,o,s){let i=!1;const r=e=>{const t=y(e)?this.dynamicSlotUpdate(e,s,o):null;if(t&&(i=!0),n(e,!0),y(e)){if(e.hasPendingChanges()){bt.getDataProxy(e).applyDataUpdates(!0)}null==t||t.applySlotUpdates()}},l=this.shadowRoot.createComponent(e,e,t,(()=>{var n;const o=this.shadowRoot.createComponent(e,e,t,void 0,r);o.destroyBackendElementOnDetach();const s=o.getShadowRoot(),i=y(l)?l.getShadowRoot():null,a=3===(null==i?void 0:i.getSlotMode()),d=3===(null==s?void 0:s.getSlotMode());d!==a?k(new Error(`The "dynamicSlots" option of component <${o.is}> and its placeholder <${l.is}> should be the same.`),"[render]",y(o)?o:o.is):d?null===(n=l.parentNode)||void 0===n||n.replaceChild(o,l):l.selfReplaceWith(o)}),r);return l.destroyBackendElementOnDetach(),i?this.bindingMapDisabled=!0:this.handleChildrenCreationAndInsert(o,l,void 0,void 0),l}s(e,t){e.slot=t}l(e,t,n){this.shadowRoot.replaceSlotValue(e,t,n)}i(e,t){e.id=t}c(e,t){if(y(e)){e.hasExternalClass("class")&&e.setExternalClass("class",t)}e.setNodeClass(t)}y(e,t){if(y(e)&&bt.hasProperty(e,"style")){const n=bt.getDataProxy(e),o=Ze("style");n.replaceProperty(o,t)}else e.setNodeStyle(Ye(t),0)}d(e,t,n){e.setDataset(t,n)}m(e,t,n){e.setMark(t,n)}v(e,t,n,o,s,i,r,l){const a="function"==typeof n?this.eventListenerFilter(n):Ye(n),d=t=>{const n=e.ownerShadowRoot.getHostNode();let o;const s=n.getMethodCaller(),i="function"==typeof a?a:bt.getMethod(n,a);if("function"==typeof i){const e=this.eventObjectFilter(t);o=i.call(s,e)}return o},c={final:o,mutated:s,capture:i};if(r){const n=Xe(e);n.dynEvListeners||(n.dynEvListeners={});const o=n.dynEvListeners;o[t]&&e.removeListener(t,o[t],c),o[t]=d}a&&e.addListener(t,d,c)}wl(e,t,n){y(e)&&e.triggerWorkletChangeLifetime(t,n)}p(e,t,n,o){if(y(e)&&bt.hasProperty(e,t)){const o=Xe(e);o.changeProp||(o.changeProp=Object.create(null)),o.changeProp[t]={listener:this.changePropFilter(n),oldValue:e.data[t]}}}setFnFilter(e,t){this.changePropFilter=e,this.eventListenerFilter=t}}var Je;!function(e){e[e.Data=0]="Data",e[e.Script=1]="Script",e[e.InlineScript=2]="InlineScript"}(Je||(Je={}));const et=()=>{};class tt{constructor(e,t){this.shadowRoot=e,this.procGen=t}create(e){const{shadowRoot:t,procGen:n}=this,o=n(this,!0,e,void 0);return this.handleChildrenCreation(o.C,t.shadowRootElement),o.B}bindingMapUpdate(e,t,n){const o=n[e];if(void 0!==o)for(let e=0;e<o.length;e+=1){(0,o[e])(t,(()=>{}),((e,t)=>{e.textContent=t}))}}handleChildrenCreation(e,t){let n=!0,o=!1;const s=()=>{n=!1,o=!1;const e=document.createElement("virtual");t.appendChild(e),this.shadowRoot.slot=e};e(!0,((e,i)=>{o?s():n=!1;const r=document.createTextNode(e||"");i&&i(r),t.appendChild(r)}),((e,i,r,l)=>{o?s():n=!1;const a=document.createElement(e);r(a,!0),this.handleChildrenCreation(l,a),t.appendChild(a)}),et,et,(()=>{n?(o=!0,this.shadowRoot.slot=t):s()}),(e=>{o?s():n=!1;const i=document.createElement("virtual");this.handleChildrenCreation(e,i),t.appendChild(i)}))}s(){}i(e,t){this.shadowRoot.idMap[t]=e}c(e,t){e.setAttribute("class",t)}y(e,t){e.setAttribute("style",t)}d(e,t,n){e.dataset[t]=Ye(n)}m(){}v(e,t,n,o){this.shadowRoot.setListener(e,t,(e=>{const t=this.shadowRoot.template.methods[n],s=null==t?void 0:t(e);return!o&&s}))}r(e,t,n){"boolean"==typeof n?n?e.setAttribute(t,""):e.removeAttribute(t):e.setAttribute(t,Ye(n))}p(){}setFnFilter(){}}const nt=()=>({C:(e,t,n,o,s,i)=>{i("")},B:Object.create(null)}),ot=()=>nt;class st{constructor(e){if("object"!=typeof e._$template&&void 0!==e._$template)throw new Error(`Component template of ${e.is} must be a valid compiled template (or "null" for default template).`);{const t=e._$template||{content:ot};this.genObjectGroupEnv={list:t.groupList||Object.create(null),group:t.content}}this.updateMode="",this.methods=e._$methodMap}createInstance(e){return new it(this,e)}}class it{constructor(e,t){if(3!==t.getBackendMode())throw new Error(`Component template of ${t.is} cannot be initialized since external rendering is only supported in Domlike backend currently.`);const n=t.getBackendElement();if(!n)throw new Error(`Component template of ${t.is} cannot be initialized as external components since no suitable backend element found.`);this.comp=t,this.shadowRoot=this,this.shadowRootElement=n,this.root=n,this.slot=n,this.template=e;const o=e.genObjectGroupEnv.group("")||ot();this.procGenWrapper=new tt(this,o),this.idMap=Object.create(null),this.listeners=[]}initValues(e){if(this.bindingMapGen=this.procGenWrapper.create(e),!this.bindingMapGen)throw new Error("The component template does not support binding-map-update, so it cannot be used as external components.");const t=this.shadowRootElement;if(this.slot===t&&t.childNodes.length>0){const e=document.createElement("virtual");t.appendChild(e),this.slot=e}}getIdMap(){return this.idMap}updateValues(e,t){const n=this.bindingMapGen;for(let o=0;o<t.length;o+=1){const[s]=t[o];this.procGenWrapper.bindingMapUpdate(s[0],e,n)}}setListener(e,t,n){const o=e;o._$wxTmplEv?o._$wxTmplEv[t]=n:o._$wxTmplEv={[t]:n}}handleEvent(e,t){var n;const o=e;let s=o;const i=this.shadowRootElement,r=t.getEventName(),l=t.bubbles;for(;;){const e=t.wrapShadowedEvent(o,null,s),a=null===(n=s._$wxTmplEv)||void 0===n?void 0:n[r];if(a){!1===a.call(s,e)&&(t.preventDefault(),t.stopPropagation())}if(!l||t.propagationStopped())break;if(s===i)break;const d=s.parentNode;if(!d)break;s=d}}}const rt=()=>({C:(e,t,n,o,s,i)=>{i("")},B:Object.create(null)}),lt=()=>rt;var at;!function(e){e[e.Disabled=0]="Disabled",e[e.Enabled=1]="Enabled",e[e.Forced=2]="Forced"}(at||(at={}));class dt{create(e,t){return t.externalComponent?new st(e):new ct(e)}}class ct{constructor(e){this.updateTemplate(e)}updateTemplate(e){const t=e._$template;if("object"!=typeof t&&void 0!==t)throw new Error(`Component template of ${e.is} must be a valid compiled template (or "null" for default template).`);const n=t||{content:lt};this.genObjectGroupEnv={list:n.groupList||Object.create(null),group:n.content},this.updateMode=n.updateMode||"",this.fallbackListenerOnNativeNode=n.fallbackListenerOnNativeNode||!1,this.eventObjectFilter=n.eventObjectFilter}createInstance(e,t){return new ht(this,e,t(e))}}class ht{constructor(e,t,n){this.comp=t,this.shadowRoot=n,this.shadowRoot.destroyBackendElementOnDetach(),this._$applyTemplate(e)}updateTemplate(e,t){this._$applyTemplate(e),this.shadowRoot.removeChildren(0,this.shadowRoot.childNodes.length),this.bindingMapGen=this.procGenWrapper.create(t)}_$applyTemplate(e){const t=e.genObjectGroupEnv.group("")||lt();"bindingMap"===e.updateMode?this.forceBindingMapUpdate=2:"virtualTree"===e.updateMode?this.forceBindingMapUpdate=0:this.forceBindingMapUpdate=1,this.procGenWrapper=new Qe(this.shadowRoot,t,e.fallbackListenerOnNativeNode,e.eventObjectFilter),this.bindingMapGen=void 0}initValues(e){return this.bindingMapGen=this.procGenWrapper.create(e),this.shadowRoot}updateValues(e,t){if(2===this.forceBindingMapUpdate){for(let n=0;n<t.length;n+=1)this.tryBindingMapUpdate(e,t[n]);return}if(1===this.forceBindingMapUpdate&&t.length<=1&&this.bindingMapGen&&this.tryBindingMapUpdate(e,t[0]))return;const n=Object.create(null);for(let e=0;e<t.length;e+=1){const[o,s,i,r]=t[e];let l=n;for(let e=0;e<o.length;e+=1){const t=o[e],n=l[t];if(!0===n)break;if(e===o.length-1){if(void 0===r)l[t]=!0;else{const e=i;if(void 0===n)l[t]=new Array(e);else if(!Array.isArray(n)){const o=new Array(e),s=Object.keys(n);for(let e=0;e<s.length;e+=1){const t=s[e],i=n[t],r=Number(t);o.length<r&&(o.length=r),o[t]=i}l[t]=o}const o=l[t];o.length<e&&(o.length=e);const a=new Array(s.length);a.fill(!0),o.splice(i,r,...a)}break}if(void 0===n){const e=Object.create(null);l[t]=e,l=e}else l=n}}this.procGenWrapper.update(e,n)}tryBindingMapUpdate(e,t){if(!t)return!0;const n=this.bindingMapGen;if(!n)return!1;const[o]=t;return 1===o.length&&this.procGenWrapper.bindingMapUpdate(o[0],e,n)}}let ut=null;const pt=()=>{if(ut)return ut;const e=new dt;return ut=e,e};var ft=Object.freeze({__proto__:null,DEFAULT_PROC_GEN_GROUP:lt,GlassEaselTemplateEngine:dt,getDefaultTemplateEngine:pt});const $t=(e,t,n,o)=>{const s=t.ownerSpace,i=null==n?void 0:n._$behavior._$using,r=null==n?void 0:n._$genericImpls;e._$detail||e.prepare();const l=e.behavior;let a;const d=l._$generics;if(d){const n=l._$genericDefaults;a=Object.create(null);for(let l=0;l<d.length;l+=1){const c=d[l];if(o&&Object.prototype.hasOwnProperty.call(o,c)){const n=o[c];if("string"==typeof n)if(null==i?void 0:i[n])a[c]=i[n];else if(r&&r[n])a[c]=r[n];else{const o=s.getGlobalUsingComponent(n);if("string"==typeof o)a[c]=o;else if(o)a[c]={final:o,source:t,placeholder:null,waiting:null};else{O(`Generic "${c}" value "${n}" is not valid`,e.is);const o=s.getDefaultComponent();if(!o)throw new M(`Cannot find default component for generic "${c}"`,"[prepare]",e.is);a[c]={final:o,source:t,placeholder:null,waiting:null}}}else a[c]=n}else{const o=n[c]||s.getDefaultComponent();if(!o)throw new M(`Cannot find default component for generic "${c}"`,"[prepare]",e.is);a[c]="string"==typeof o?o:{final:o,source:t,placeholder:null,waiting:null}}}}else a=null;return a},_t=(e,t,n,o)=>{const s=n._$using[e]||o&&o[e];let i=null;if(s&&("string"==typeof s?i=s:null===s.placeholder?i=s.final:O("Placeholder on generic implementation is not valid",n.is)),i)return i;let r=t.getGlobalUsingComponent(e);if(null===r&&t._$allowUnusedNativeNode&&""!==e&&(r=e),!r){if(r=t.getDefaultComponent(),!r)throw new M(`Cannot find placeholder target "${e}"`,"[prepare]",n.is);O(`Cannot find placeholder target "${e}", using default component.`,n.is)}return r};class gt{constructor(e){this.behavior=e,this.is=this.behavior.is,this._$detail=null,this._$options=r(e._$options,e.ownerSpace.getComponentOptions());const t=this._$options.templateEngine;this._$templateEngine=null!=t?t:pt()}general(){return this}getComponentOptions(){return this._$options}getComponentDependencies(){return this.behavior.getComponentDependencies()}updateTemplate(e){var t;if(!(null===(t=this._$detail)||void 0===t?void 0:t.template.updateTemplate))throw new Error(`The template engine of component "${this.is}" does not support template update`);this.behavior._$updateTemplate(e),this._$detail.template.updateTemplate(this.behavior)}isPrepared(){return!!this._$detail}prepare(){if(this._$detail)return;this.behavior.prepare();const e=this.behavior,t=this._$options,n={};if(t.writeFieldsToNode){const t=Object.keys(e._$propertyMap);for(let e=0;e<t.length;e+=1){const o=t[e];n[o]={enumerable:!0,get(){return this._$dataGroup.data[o]},set(e){const t=this._$dataGroup;t.replaceDataOnPath([o],e),t.applyDataUpdates()}}}const o=Object.keys(e._$methodMap);for(let t=0;t<o.length;t+=1){const s=o[t];n[s]={enumerable:!0,value:e._$methodMap[s]}}}const o=function(){};n.constructor={value:o,writable:!0};const s=o.prototype=Object.create(bt.prototype,n);s._$behavior=e,s._$definition=this,s._$methodMap=e._$methodMap;const i=e._$generateObserverTree();s._$lifetimeFuncs=e._$getAllLifetimeFuncs(),s._$pageLifetimeFuncs=e._$getAllPageLifetimeFuncs();const r=(e=>{if(void 0===e)return null;const t={definitions:new Array(6),keyMap:Object.create(null)},n=t.definitions,o=t.keyMap,s=Object.keys(e);for(let t=0;t<s.length;t+=1){const i=s[t],r=e[i],l=r.type;n[l]?(o[i]=[l,n[l].length],n[l].push(r)):(o[i]=[l,0],n[l]=[r])}return t})(e._$relationMap),l=ye(t.dataDeepCopy),a=ye(t.propertyPassingDeepCopy),d=this._$templateEngine.create(e,t);this._$detail={proto:s,template:d,dataGroupObserverTree:i,dataDeepCopy:l,propertyPassingDeepCopy:a,relationDefinitionGroup:r}}}let mt=1,vt=null;class bt extends Pe{constructor(){throw new Error("Element cannot be constructed directly")}general(){return this}asInstanceOf(e){return this._$behavior!==e.behavior?null:this}static register(e,t){return(t||X()).defineComponent(e)}static _$tagMethod(e){const t=e;return t[U]=!0,t}static _$isTaggedMethod(e){return"function"==typeof e&&!!e[U]}static _$advancedCreate(e,t,n,o,s,r,a){var d,h,u,p;t._$detail||t.prepare();const{proto:f,template:$,dataDeepCopy:_,propertyPassingDeepCopy:g,relationDefinitionGroup:m}=t._$detail;let v=t._$detail.dataGroupObserverTree;const b=t._$options,S=t.behavior,y=n?n.getBackendContext():o||i.backendContext||(()=>{if(vt)return vt;let e;return e=new A,vt=e,e})(),C=b.externalComponent,w=b.propertyEarlyInit,N=i.writeExtraInfoToAttr,E=b.virtualHost,x=Object.create(f);x._$genericImpls=s,x._$placeholderHandlerRemover=r,x._$external=C,x.tagName=e,x._$methodCaller=x,x._$virtual=E;let O=null;if(y)if(3===y.mode)E||(O=y.document.createElement(e));else if(2===y.mode)E||(O=y.createElement(b.hostNodeTagName,e));else if(1===y.mode){O=(n?n._$backendShadowRoot:y.getRootNode()).createComponent(e,C,E,null!==(d=b.styleScope)&&void 0!==d?d:P.globalScope(),b.extraStyleScope,S._$externalClasses)}x._$initialize(E,O,n,n?n._$nodeTreeContext:y);const L=n?n.getHostNode():void 0,D=null==L?void 0:L.getComponentOptions(),T=null!==(h=null==D?void 0:D.styleScope)&&void 0!==h?h:P.globalScope(),B=null!==(u=null==D?void 0:D.extraStyleScope)&&void 0!==u?u:void 0,I=null==L?void 0:L._$behavior.ownerSpace.styleScopeManager;if(x.classList=new j(x,S._$externalClasses,L?L.classList:null,T,B,I),O&&(2===y.mode&&O.setStyleScope(T,B,null!==(p=b.styleScope)&&void 0!==p?p:P.globalScope()),I&&N)){const e=I.queryName(T);e&&O.setAttribute("exparser:info-class-prefix",`${e}--`)}const R=$.createInstance(x,ze.createShadowRoot);if(O&&(3!==y.mode?O.associateValue(x):y.associateValue(O,x)),N&&O){const e=mt;mt+=1,x._$componentInstanceId=e,O.setAttribute("exparser:info-component-id",e)}x._$idPrefix=b.idPrefixGenerator?b.idPrefixGenerator.call(x):"";const U=S._$staticData,F=S._$data;let W;if(void 0===U)if(1===F.length){W=(0,F[0])()}else{W={};for(let e=0;e<F.length;e+=1){const t=F[e];Object.assign(W,t())}}else{W=ie(U);for(let e=0;e<F.length;e+=1){const t=F[e];Object.assign(W,t())}}const H=x._$relation=new Fe(x,m);x._$traitGroup=new V;const z=S._$traitBehaviors;if(void 0!==z)for(let e=0;e<z.length;e+=1){const{traitBehavior:t,impl:n}=z[e];x._$traitGroup.implement(t,n)}if(S._$methodCallerInit){const e=S._$methodCallerInit.call(x);x._$methodCaller=e}let K=!1;if(S._$init.length>0){let e=!0,t=!0,n=!0,o=!0;const s=x.getMethodCaller(),i={self:s,data:W,setData:x.setData.bind(x),implement:(e,t)=>{if(K)throw new M("Cannot execute init-time functions after initialization","[implement]",S.is);x._$traitGroup.implement(e,t)},relation:function(e){if(K)throw new M("Cannot execute init-time functions after initialization","[implement]",S.is);const t=e.target,n=Ue(S.ownerSpace,S.is,"undefined",e);let o;return o=n?H.add(n):Symbol("invalid"),{list:()=>H.getLinkedTargets(o).map((e=>e.getMethodCaller())),listAsTrait:t instanceof G?()=>H.getLinkedTargets(o).map((e=>e.traitBehavior(t))):void 0}},observer:(t,n)=>{if(K)throw new M("Cannot execute init-time functions after initialization","[implement]",S.is);e&&(e=!1,v=v.cloneSub());try{v.addObserver(n,ne(t))}catch(e){k(e,"observer",S.is)}},lifetime:(e,n)=>{if(K)throw new M("Cannot execute init-time functions after initialization","[implement]",S.is);t&&(t=!1,x._$lifetimeFuncs=S._$getAllLifetimeFuncs());const o=x._$lifetimeFuncs;if(o[e])o[e].add(n);else{(o[e]=new l("lifetime")).add(n)}},pageLifetime:(e,t)=>{if(K)throw new M("Cannot execute init-time functions after initialization","[implement]",S.is);n&&(n=!1,x._$pageLifetimeFuncs=S._$getAllPageLifetimeFuncs());const o=x._$pageLifetimeFuncs;if(o[e])o[e].add(t);else{(o[e]=new l("pageLifetime")).add(t)}},method:e=>bt._$tagMethod(e),listener:e=>bt._$tagMethod(e)},r=S._$init;for(let e=0;e<r.length;e+=1){const t=c("Component Init",r[e],s,[i],void 0);if(t){const e=Object.keys(t);for(let n=0;n<e.length;n+=1){const s=e[n],i=t[s];bt._$isTaggedMethod(i)&&(o&&(o=!1,x._$methodMap=Object.create(x._$methodMap)),x._$methodMap[s]=i,b.writeFieldsToNode&&(x[s]=i))}}}}K=!0;const q=R.shadowRoot;x.shadowRoot=q;const X=new Ce(x,W,b.pureDataPattern||null,_,g,b.reflectToAttributes,v);x._$dataGroup=X,w&&void 0!==a&&a(x),R.initValues(X.innerData||X.data),x._$tmplInst=R,X.setUpdateListener(((e,t)=>{R.updateValues(e,t)}));const Y=S._$listeners;if(void 0!==Y)for(let e=0;e<Y.length;e+=1){const{id:t,ev:n,listener:o}=Y[e],s=o;if("this"===t)x.addListener(n,(e=>s.call(x._$methodCaller,e)));else if(C){const e=q,o=t?e.getIdMap()[t]:e.root;o&&e.setListener(o,n,(e=>s.call(x._$methodCaller,e)))}else{const e=q,o=t?e.getElementById(t):e;o&&o.addListener(n,(e=>s.call(x._$methodCaller,e)))}}return x.triggerLifetime("created",[]),w||void 0===a||a(x),x}static createWithGenericsAndContext(e,t,n,o,s){const i=e=>{let t;return n&&(t=Object.create(null),Object.entries(n).forEach((([n,o])=>{t[n]={final:o,source:e.behavior,placeholder:null,waiting:null}}))),$t(e,e.behavior,void 0,t)};if(t)return bt._$advancedCreate(String(e),t,null,o,i(t),void 0,s);if(e instanceof gt)return bt._$advancedCreate(e.is,e,null,o,i(e),void 0);const r=X().getComponentByUrl(e,"");return bt._$advancedCreate(e,r,null,o,i(r),void 0)}static createWithGenerics(e,t,n,o){return bt.createWithGenericsAndContext(e,t,n,null,o)}static createWithContext(e,t,n,o){return bt.createWithGenericsAndContext(e,t,null,n,o)}static create(e,t,n){return bt.createWithGenericsAndContext(e,t,null,null,n)}get is(){return this._$definition.is}get properties(){return this._$dataGroup.data}get data(){return this._$dataGroup.data}set data(e){const t=this._$dataGroup;if(void 0===t)throw new M("Cannot update data before component created","data setter",this);Object.entries(e).forEach((([e,n])=>t.replaceDataOnPath([e],n))),t.applyDataUpdates()}get $(){return this._$external?this.shadowRoot.getIdMap():this.shadowRoot._$getIdMap()}getShadowRoot(){return this._$external?null:this.shadowRoot}applyTemplateUpdates(){var e;if(!(null===(e=this._$tmplInst)||void 0===e?void 0:e.updateTemplate))throw new Error(`The template engine of component "${this.is}" does not support template update`);const t=this._$dataGroup;this._$tmplInst.updateTemplate(this._$definition._$detail.template,t.innerData||t.data)}getOwnerSpace(){return this._$behavior.ownerSpace}isExternal(){return this._$external}static listProperties(e){return Object.keys(e._$behavior._$propertyMap)}static hasProperty(e,t){return!!e._$behavior._$propertyMap[t]}static getMethodsFromDef(e){return e.behavior._$methodMap}static getMethod(e,t){if(e._$definition._$options.useMethodCallerListeners&&Object.prototype.hasOwnProperty.call(e._$methodCaller,t)){const n=e._$methodCaller[t];return"function"==typeof n?n:void 0}return e._$methodMap[t]}callMethod(e,...t){const n=bt.getMethod(this,e);return null==n?void 0:n.call(this,...t)}getComponentDefinition(){return this._$definition}getComponentOptions(){return this._$definition._$options}hasBehavior(e){return e instanceof G?void 0!==this._$traitGroup.get(e):this._$behavior.hasBehavior(e)}getRootBehavior(){return this._$behavior}traitBehavior(e){return this._$traitGroup.get(e)}setMethodCaller(e){this._$methodCaller=e}getMethodCaller(){return this._$methodCaller}triggerLifetime(e,t){const n=this._$lifetimeFuncs[e];n&&n.call(this._$methodCaller,t,this)}triggerLifeTime(e,t){return this.triggerLifetime(e,t)}triggerPageLifetime(e,t){const n=o=>{if(y(o)){if(o._$pageLifetimeFuncs){const n=o._$pageLifetimeFuncs[e];n&&n.call(o._$methodCaller,t,this)}o._$external||n(o.shadowRoot)}const s=o.childNodes;for(let e=0;e<s.length;e+=1){const t=s[e];m(t)&&n(t)}};n(this)}triggerPageLifeTime(e,t){return this.triggerPageLifetime(e,t)}getRelationNodes(e){var t;return(null===(t=this._$relation)||void 0===t?void 0:t.getLinkedTargets(e))||[]}hasExternalClass(e){return this.classList._$hasAlias(e)}setExternalClass(e,t){this.scheduleExternalClassChange(e,t),this.applyExternalClassChanges()}getExternalClasses(){return this.classList._$getAlias()}scheduleExternalClassChange(e,t){this.classList._$setAlias(e,t)}applyExternalClassChanges(){if(this._$external)return;if(!this.classList._$shouldUpdateExternalClass())return;const e=t=>{if(!m(t))return;const n=t.classList;(null==n?void 0:n._$spreadExternalClassUpdate())&&y(t)&&t.applyExternalClassChanges();const o=t.childNodes;for(let t=0,n=o.length;t<n;t+=1)e(o[t]);null==n||n._$markExternalClassUpdated()};e(this.shadowRoot)}triggerWorkletChangeLifetime(e,t){this.triggerLifetime("workletChange",[e,t])}isInnerDataExcluded(e){var t;return(null===(t=this._$definition._$options.pureDataPattern)||void 0===t?void 0:t.test(e))||!1}static getInnerData(e){return e._$dataGroup.innerData}static getDataProxy(e){return e._$dataGroup}static replaceWholeData(e,t){e._$dataGroup.replaceWholeData(t)}replaceDataOnPath(e,t){const n=this._$dataGroup;if(void 0===n)throw new M("Cannot update data before component created","replaceDataOnPath",this);n.replaceDataOnPath(e,t)}spliceArrayDataOnPath(e,t,n,o){const s=this._$dataGroup;if(void 0===s)throw new M("Cannot update data before component created","spliceArrayDataOnPath",this);s.spliceArrayDataOnPath(e,t,n,o)}hasPendingChanges(){const e=this._$dataGroup;return void 0!==e&&e.getChanges().length>0}applyDataUpdates(){const e=this._$dataGroup;if(void 0===e)throw new M("Cannot update data before component created","applyDataUpdates",this);e.applyDataUpdates()}groupUpdates(e){const t=this._$dataGroup;if(void 0===t)throw new M("Cannot update data before component created","groupUpdates",this);const n=e();return t.applyDataUpdates(),n}updateData(e){const t=this._$dataGroup;if(void 0===t)throw new M("Cannot update data before component created","updateData",this);if("object"==typeof e&&null!==e){const n=Object.keys(e);for(let o=0;o<n.length;o+=1){const s=n[o];try{const n=te(s);t.replaceDataOnPath(n,e[s])}catch(e){k(e,"updateData",this)}}}}setData(e){const t=this._$dataGroup;if(void 0===t)throw new M("Cannot update data before component created","setData",this);if("object"==typeof e&&null!==e){const n=Object.keys(e);for(let o=0;o<n.length;o+=1){const s=n[o];try{const n=te(s);t.replaceDataOnPath(n,e[s])}catch(e){k(e,"setData",this)}}}t.applyDataUpdates()}}bt.isComponent=y,bt.prototype[_]=!0;class St{constructor(e,t){this._$behaviors=[],this._$traitBehaviors=[],this._$staticData=void 0,this._$data=[],this._$methods=[],this._$lifetimes=[],this._$pageLifetimes=[],this._$init=[],this._$is=e,this._$ownerSpace=t}methodCallerInit(e){return this._$methodCallerInit=e,this}behavior(e){return this._$behaviors.push(e),e._$chainingFilter?e._$chainingFilter(this):this}chainingFilter(e){return this._$chainingFilter=e,this}options(e){const t=this._$options;return this._$options=t?Object.assign(Object.assign({},t),e):e,this}implement(e,t){return this._$traitBehaviors.push({traitBehavior:e,impl:t}),this}template(e){return this._$template=e,this}usingComponents(e){return this._$using?this._$using=Object.assign(Object.assign({},this._$using),e):this._$using=e,this}placeholders(e){return this._$placeholders?this._$placeholders=Object.assign(Object.assign({},this._$placeholders),e):this._$placeholders=e,this}generics(e){return this._$generics?this._$generics=Object.assign(Object.assign({},this._$generics),e):this._$generics=e,this}externalClasses(e){return this._$externalClasses?this._$externalClasses=this._$externalClasses.concat(e):this._$externalClasses=e,this}data(e){return this._$data.push((()=>{var t;return null!==(t=c("Data Generator",e,null,[],this._$is))&&void 0!==t?t:{}})),this}staticData(e){return this._$staticData=e,this}property(e,t){return this._$properties||(this._$properties=[]),this._$properties.push({name:e,def:t}),this}methods(e){const t=Object.keys(e);for(let n=0;n<t.length;n+=1){const o=t[n],s=e[o];this._$methods.push({name:o,func:s})}return this}observer(e,t,n=!1){this._$observers||(this._$observers=[]);try{this._$observers.push({dataPaths:ne(e),func:t,once:n})}catch(e){k(e,"observer",this._$is)}return this}lifetime(e,t,n=!1){return this._$lifetimes.push({name:e,func:t,once:n}),this}pageLifetime(e,t,n=!1){return this._$pageLifetimes||(this._$pageLifetimes=[]),this._$pageLifetimes.push({name:e,func:t,once:n}),this}relation(e,t){return this._$relations||(this._$relations=[]),this._$relations.push({name:e,rel:t}),this}init(e){return this._$init.push(e),this}definition(e){e.behaviors&&this._$behaviors.push(...e.behaviors),e.options&&this.options(e.options),e.template&&this.template(e.template),e.using&&this.usingComponents(e.using),e.placeholders&&this.placeholders(e.placeholders),e.generics&&this.generics(e.generics),e.externalClasses&&this.externalClasses(e.externalClasses);const t=e.data;void 0!==t&&("function"==typeof t?this._$data.push((()=>{var e;return null!==(e=c("Data Generator",t,null,[],this._$is))&&void 0!==e?e:{}})):this._$staticData=t);const n=e.properties;if(void 0!==n){this._$properties||(this._$properties=[]);const e=Object.keys(n);for(let t=0;t<e.length;t+=1){const o=e[t],s=n[o];this._$properties.push({name:o,def:s})}}const o=e.methods;if(void 0!==o){const e=Object.keys(o);for(let t=0;t<e.length;t+=1){const n=e[t],s=o[n];this._$methods.push({name:n,func:s})}}const s=e.observers;if(void 0!==s)if(this._$observers||(this._$observers=[]),Array.isArray(s))for(let e=0;e<s.length;e+=1){const{fields:t,observer:n}=s[e];try{this._$observers.push({dataPaths:ne(null!=t?t:"**"),func:n,once:!1})}catch(e){k(e,"definition",this._$is)}}else{const e=Object.keys(s);for(let t=0;t<e.length;t+=1){const n=e[t],o=s[n];try{this._$observers.push({dataPaths:ne(n),func:o,once:!1})}catch(e){k(e,"definition",this._$is)}}}const i=e.lifetimes;if(void 0===(null==i?void 0:i.created)&&"function"==typeof e.created&&this._$lifetimes.push({name:"created",func:e.created,once:!0}),void 0===(null==i?void 0:i.attached)&&"function"==typeof e.attached&&this._$lifetimes.push({name:"attached",func:e.attached,once:!0}),void 0===(null==i?void 0:i.moved)&&"function"==typeof e.moved&&this._$lifetimes.push({name:"moved",func:e.moved,once:!0}),void 0===(null==i?void 0:i.detached)&&"function"==typeof e.detached&&this._$lifetimes.push({name:"detached",func:e.detached,once:!0}),void 0===(null==i?void 0:i.ready)&&"function"==typeof e.ready&&this._$lifetimes.push({name:"ready",func:e.ready,once:!0}),i){const e=Object.keys(i);for(let t=0;t<e.length;t+=1){const n=e[t],o=i[n];this._$lifetimes.push({name:n,func:o,once:!0})}}const r=e.pageLifetimes;if(r){this._$pageLifetimes||(this._$pageLifetimes=[]);const e=Object.keys(r);for(let t=0;t<e.length;t+=1){const n=e[t],o=r[n];this._$pageLifetimes.push({name:n,func:o,once:!0})}}this._$listeners=e.listeners;const l=e.relations;if(l){this._$relations||(this._$relations=[]);const e=Object.keys(l);for(let t=0;t<e.length;t+=1){const n=e[t],o=l[n];this._$relations.push({name:n,rel:o})}}return this}registerBehavior(){const e=this._$is,t=new yt(this);return void 0!==e&&this._$ownerSpace._$registerBehavior(e,t),t}registerComponent(){const e=this._$is,t=new yt(this),n=new gt(t);return void 0!==e&&this._$ownerSpace._$registerComponent(e,n),n}}class yt{static create(e,t){return new St(e.is,t||X()).definition(e).registerBehavior()}constructor(e){this._$unprepared=!0,this.is=e._$is||"",this.ownerSpace=e._$ownerSpace,this._$builder=e,this._$flatAncestors=new Set,this._$chainingFilter=e._$chainingFilter,this._$options=e._$options,this._$traitBehaviors=void 0,this._$template=e._$template,this._$using=Object.create(null),this._$generics=void 0,this._$genericDefaults=void 0,this._$externalClasses=e._$externalClasses,this._$staticData=void 0,this._$data=[],this._$propertyMap=Object.create(null),this._$methodMap=Object.create(null),this._$observers=[],this._$lifetimes=[],this._$pageLifetimes=void 0,this._$listeners=void 0,this._$relationMap=void 0,this._$init=[],this._$methodCallerInit=e._$methodCallerInit}general(){return this}getComponentDependencies(e){const t=new Set,n=function(e){e._$unprepared&&e.prepare();const o=Object.keys(e._$using);for(let s=0;s<o.length;s+=1){const i=o[s],r=e._$using[i];if("string"==typeof r)continue;const l=r.final;l&&!t.has(l)&&(t.add(l),n(l.behavior))}};if(n(this.general()),e){const o=Object.values(e);for(let e=0;e<o.length;e+=1){const s=o[e];"string"!=typeof s&&(t.has(s)||(t.add(s),n(s.behavior)))}}return t}static prepare(e){e.prepare()}prepare(){var e;if(!this._$unprepared)return;this._$unprepared=!1;const t=this.is,n=this.ownerSpace,o=this._$builder,s=this._$flatAncestors;if(Array.isArray(o._$behaviors))for(let e=0;e<o._$behaviors.length;e+=1){const i=o._$behaviors[e];let r=null;if(i instanceof yt)r=i;else{const e=String(i);n&&(r=n.getBehaviorByUrl(e,t)),r||k(new Error(`behavior "${e}" is not found.`),"[prepare]",t)}if(!r)continue;r._$unprepared&&yt.prepare(r);const l=r._$traitBehaviors;void 0!==l&&(this._$traitBehaviors||(this._$traitBehaviors=[]),this._$traitBehaviors.push(...l));const a=r._$staticData;a&&(this._$staticData||(this._$staticData={}),ue(this._$staticData,a)),Object.assign(this._$methodMap,r._$methodMap),Object.assign(this._$propertyMap,r._$propertyMap),this._$data.push(...r._$data);const d=r._$observers;for(let e=0;e<d.length;e+=1){const t=d[e];t.once&&this._$observers.indexOf(t)>=0||this._$observers.push(t)}const c=r._$lifetimes;for(let e=0;e<c.length;e+=1){const t=c[e];t.once&&this._$lifetimes.indexOf(t)>=0||this._$lifetimes.push(t)}const h=r._$pageLifetimes;if(void 0!==h)if(this._$pageLifetimes)for(let e=0;e<h.length;e+=1){const t=h[e];t.once&&this._$pageLifetimes.indexOf(t)>=0||this._$pageLifetimes.push(t)}else this._$pageLifetimes=h.slice();const u=r._$listeners;void 0!==u&&(this._$listeners||(this._$listeners=[]),this._$listeners.push(...u));const p=r._$relationMap;void 0!==p&&(this._$relationMap||(this._$relationMap=Object.create(null)),Object.assign(this._$relationMap,p)),this._$init.push(...r._$init),r._$flatAncestors.forEach((e=>{s.add(e)}))}const i=o._$traitBehaviors;if(void 0!==i&&(this._$traitBehaviors||(this._$traitBehaviors=[]),this._$traitBehaviors.push(...i)),"object"==typeof o._$using&&null!==o._$using){const s="object"==typeof o._$placeholders&&null!==o._$placeholders,i=Object.keys(o._$using);for(let r=0;r<i.length;r+=1){const l=i[r],a=o._$using[l];let d=null;if(s&&(d=null!==(e=o._$placeholders[l])&&void 0!==e?e:null),a instanceof gt)this._$using[l]={final:a,source:this,placeholder:d,waiting:null};else if(n){const e=String(a),o=n.getComponentByUrlWithoutDefault(e,t);if(o)this._$using[l]={final:o,source:this,placeholder:null,waiting:null};else if(null!==d){const o={final:null,source:this,placeholder:d,waiting:null},s=n._$componentWaitingList(e,t);s&&(s.add((e=>{o.final=e,o.placeholder=null,o.waiting=null})),o.waiting=s),this._$using[l]=o}else{const t=n.getGlobalUsingComponent(e);this._$using[l]="string"==typeof t?t:{final:t,source:this,placeholder:null,waiting:null}}}else k(new Error(`cannot find component "${String(a)}"`),"[prepare]",t)}}if("object"==typeof o._$generics&&null!==o._$generics){const e=this._$generics=[],s=Object.create(null);this._$genericDefaults=s;const i=Object.keys(o._$generics);for(let r=0;r<i.length;r+=1){const l=i[r],a=o._$generics[l];let d=null;const c=!0===a||null==a?void 0:a.default;if(void 0!==c)if(c instanceof gt)d=c;else if(n){const e=String(c);d=n.getComponentByUrlWithoutDefault(e,t)||n.getGlobalUsingComponent(e)}else k(new Error(`cannot define generic "${l}" without a default implementor.`),"[prepare]",t);e.push(l),s[l]=d}}const r=o._$staticData;r&&(this._$staticData?ue(this._$staticData,r):this._$staticData=r);const l=o._$methods;for(let e=0;e<l.length;e+=1){const{name:t,func:n}=l[e];this._$methodMap[t]=n}const a=o._$properties;if(void 0!==a){const e=[];for(let n=0;n<a.length;n+=1){const{name:o,def:s}=a[n],i="string"===(d=s)||d===String?{type:"string",optionalTypes:null,value:"",default:void 0,observer:null,comparer:null,reflectIdPrefix:!1}:"number"===d||d===Number?{type:"number",optionalTypes:null,value:0,default:void 0,observer:null,comparer:null,reflectIdPrefix:!1}:"boolean"===d||d===Boolean?{type:"boolean",optionalTypes:null,value:!1,default:void 0,observer:null,comparer:null,reflectIdPrefix:!1}:"object"===d||d===Object?{type:"object",optionalTypes:null,value:null,default:void 0,observer:null,comparer:null,reflectIdPrefix:!1}:"array"===d||d===Array?{type:"array",optionalTypes:null,value:[],default:void 0,observer:null,comparer:null,reflectIdPrefix:!1}:"function"===d||d===Function?{type:"function",optionalTypes:null,value(){},default:void 0,observer:null,comparer:null,reflectIdPrefix:!1}:"any"===d||null==d?{type:"any",optionalTypes:null,value:null,default:void 0,observer:null,comparer:null,reflectIdPrefix:!1}:null;let r;if(null!==i)r=i;else{const e=s;let n=pe(e.type),i=null;Array.isArray(e.optionalTypes)&&(i=e.optionalTypes.map(pe),i.length>0&&("invalid"!==n&&"any"!==n||(n=i[0]))),"invalid"===n&&k(new Error(`the type of property "${o}" is illegal`),"[prepare]",t);let l,a,d=e.value;void 0===e.value?d="string"===n?"":"number"===n?0:"boolean"!==n&&("array"===n?[]:null):void 0!==e.default&&O(`the initial value of property "${o}" is not used when its default is provided.`,t),"function"==typeof e.observer?l=e.observer:"string"==typeof e.observer?(l=this._$methodMap[e.observer]||null,l||k(new Error(`Cannot find method "${e.observer}" for observer of property "${o}".`),"[prepare]",t)):(l=null,void 0!==e.observer&&k(new Error(`The observer of property "${o}" is not a function, got "${typeof e.observer}".`),"[prepare]",t)),"function"==typeof e.comparer?a=e.comparer:(a=null,void 0!==e.comparer&&k(new Error(`the comparer of property "${o}" is not a function.`),"[prepare]",t));const c=!!e.reflectIdPrefix;r={type:n,optionalTypes:i,value:d,default:e.default,observer:l,comparer:a,reflectIdPrefix:c}}this._$propertyMap[o]=r,e.push({name:o,func:void 0===r.default?()=>ie(r.value):r.default})}this._$data.push((()=>{const n={};for(let o=0;o<e.length;o+=1){const{name:s,func:i}=e[o];n[s]=c(`Property "${s}" Default`,i,null,[],t)}return n}))}var d;this._$data.push(...o._$data);const h=o._$observers;if(void 0!==h)for(let e=0;e<h.length;e+=1){const{dataPaths:n,func:o,once:s}=h[e],i="function"==typeof o?o:this._$methodMap[o];"function"==typeof i?this._$observers.push({dataPaths:n,observer:i,once:s}):k(new Error(`the "${String(i)}" observer is not a function.`),"[prepare]",t)}const u=o._$lifetimes;this._$lifetimes.push(...u);const p=o._$pageLifetimes;p&&(this._$pageLifetimes||(this._$pageLifetimes=[]),this._$pageLifetimes.push(...p));const f=o._$listeners;if(void 0!==f){const e=Object.keys(f);if(e.length>0){this._$listeners=[];for(let n=0;n<e.length;n+=1){const o=e[n],s=f[o],i="function"==typeof s?s:this._$methodMap[s];if(i){const e=o.indexOf(".");let t,n;e>=0?(t=o.slice(0,e),n=o.slice(e+1)):(t="",n=o),this._$listeners.push({id:t,ev:n,listener:i})}else k(new Error(`the "${o}" listener is not a function or a method name`),"[prepare]",t)}}}const $=o._$relations;if(void 0!==$){this._$relationMap||(this._$relationMap=Object.create(null));for(let e=0;e<$.length;e+=1){const{name:o,rel:s}=$[e];if(null==s)continue;const i=Ue(n,t,o,s);i&&(this._$relationMap[o]=i)}}this._$init.push(...o._$init),s.add(this)}getTemplate(){return this._$template}_$updateTemplate(e){this._$template=e}hasBehavior(e){if(this._$unprepared&&this.prepare(),e instanceof yt)return this._$flatAncestors.has(e);if(this.ownerSpace){const t=this.ownerSpace.getBehaviorByUrl(e,this.is);return!!t&&this._$flatAncestors.has(t)}return!1}getMethods(){return this._$methodMap}_$generateObserverTree(){const e=new ge(this._$propertyMap),t=this._$observers;for(let n=0;n<t.length;n+=1){const{dataPaths:o,observer:s}=t[n];e.addObserver(s,o)}return e}_$getAllLifetimeFuncs(){const e=Object.create(null),t=this._$lifetimes;for(let n=0;n<t.length;n+=1){const{name:o,func:s}=t[n];if(e[o])e[o].add(s);else{(e[o]=new l("lifetime")).add(s)}}return e}_$getAllPageLifetimeFuncs(){const e=Object.create(null),t=this._$pageLifetimes;if(!t)return e;for(let n=0;n<t.length;n+=1){const{name:o,func:s}=t[n];if(e[o])e[o].add(s);else{(e[o]=new l("pageLifetime")).add(s)}}return e}}var Ct;exports.ElementIteratorType=void 0,(Ct=exports.ElementIteratorType||(exports.ElementIteratorType={})).ShadowAncestors="shadow-ancestors",Ct.ComposedAncestors="composed-ancestors",Ct.ShadowDescendantsRootFirst="shadow-descendants-root-first",Ct.ShadowDescendantsRootLast="shadow-descendants-root-last",Ct.ComposedDescendantsRootFirst="composed-descendants-root-first",Ct.ComposedDescendantsRootLast="composed-descendants-root-last";class wt{constructor(e,t,n=Pe){if(!m(e)&&!g(e))throw new Error("Element iterators can only be used in elements or text nodes");if(this._$node=e,this._$nodeTypeLimit=n||Pe,"shadow-ancestors"===t||"shadow-descendants-root-first"===t||"shadow-descendants-root-last"===t)this._$composed=!1;else{if("composed-ancestors"!==t&&"composed-descendants-root-first"!==t&&"composed-descendants-root-last"!==t)throw new Error(`Unrecognized iterator type "${String(t)}"`);this._$composed=!0}this._$isAncestor="shadow-ancestors"===t||"composed-ancestors"===t,this._$rootFirst="shadow-descendants-root-first"===t||"composed-descendants-root-first"===t}static create(e,t,n){return new wt(e,t,n)}forEach(e){const t=this._$nodeTypeLimit,n=this._$composed;if(this._$isAncestor){let o=this._$node;for(;;){if(o instanceof t&&!1===e(o))return;let s;if(s=n?o.getComposedParent():o.parentNode,!s)break;o=s}}else{const o=this._$rootFirst,s=i=>{if(o&&i instanceof t&&!1===e(i))return!1;if(m(i)){let e=!1;const t=t=>!1!==s(t)||(e=!0,!1);if(n?i.forEachComposedChild(t):i.childNodes.every(t),e)return!1}return!(!o&&i instanceof t&&!1===e(i))};s(this._$node)}}}var Nt=Object.freeze({__proto__:null});const Et=Me.triggerEvent,xt=Me.triggerExternalEvent;exports.Behavior=yt,exports.BehaviorBuilder=St,exports.ClassList=j,exports.Component=bt,exports.ComponentDefinition=gt,exports.ComponentSpace=K,exports.CurrentWindowBackendContext=class{constructor(){this.mode=3,this.document=document,this._$styleSheets=[],this._$styleSheetRegistry=Object.create(null),this._$delegatedEventListeners=Object.create(null),this._$elementEventListeners=new WeakMap,this._$elementCaptureEventListeners=new WeakMap,this._$triggedEvents=new WeakSet}destroy(){}getWindowWidth(){return document.documentElement.clientWidth}getWindowHeight(){return document.documentElement.clientHeight}getDevicePixelRatio(){return window.devicePixelRatio}getTheme(){return"light"}registerStyleSheetContent(e,t){this._$styleSheetRegistry[e]=String(t)}appendStyleSheetPath(e,t){const n=this._$styleSheetRegistry[e];if(void 0===n)throw new Error(`No style sheet registry "${e}"`);const o=document.createElement("style");o.type="text/css",o.innerHTML=n,void 0!==t&&o.setAttribute("wx-style-scope",String(t)),document.head.appendChild(o);const s=this._$styleSheets.length;return this._$styleSheets.push(o),s}disableStyleSheet(e){const t=this._$styleSheets[e];t&&document.head.removeChild(t)}render(e){window.requestAnimationFrame((()=>{c("Render Callback",e,this,[null])}))}getRootNode(){return document.body}associateValue(e,t){e.__wxElement=t}onEvent(e){this._$eventListener||this._$initEvent(),this._$eventListener=e}_$getEventDetail(e){const t={};let n=e;for(;Object.getPrototypeOf(n)!==Event.prototype;){const o=Object.keys(n);for(let n=0;n<o.length;n+=1){const s=o[n];"function"!=typeof e[s]&&(t[s]=e[s])}n=Object.getPrototypeOf(n)}return t}_$trigger(e,t,n,o,s){if(!this._$eventListener||!e.target)return;let i=e.target;for(;i&&!i.__wxElement;)i=i.parentNode;if(!i)return;1===this._$eventListener(i.__wxElement,t,n,{originalEvent:e,bubbles:o,composed:s,capturePhase:!0})&&e.preventDefault()}_$initEvent(){const e=Object.create(null);let t=!1;const n=(t,n)=>{e[n.identifier]={x:n.clientX,y:n.clientY}},o=(t,n)=>{const o=n.identifier;if(e[o]){const s=e[o];(Math.abs(s.x-n.clientX)>10||Math.abs(s.y-n.clientY)>10)&&(delete e[o],this._$trigger(t,"canceltap",s,!0,!0))}},s=(t,n)=>{const o=n.identifier;if(e[o]){const s=e[o];delete e[o],Math.abs(s.x-n.clientX)>10||Math.abs(s.y-n.clientY)>10?this._$trigger(t,"canceltap",s,!0,!0):this._$trigger(t,"tap",s,!0,!0)}},i=(t,n)=>{const o=n.identifier;if(e[o]){const n=e[o];delete e[o],this._$trigger(t,"canceltap",n,!0,!0)}},r=e=>{const t=e.changedTouches;for(let n=0;n<t.length;n+=1)s(e,t[n]);const n=e.target;n.__touchCount-=t.length,n.__touchCount<=0&&(n.__touchCount=0,n.removeEventListener("touchend",r),n.removeEventListener("touchcancel",l))},l=e=>{const t=e.changedTouches;for(let n=0;n<t.length;n+=1)i(e,t[n]);const n=e.target;n.__touchCount-=t.length,n.__touchCount<=0&&(n.__touchCount=0,n.removeEventListener("touchend",r),n.removeEventListener("touchcancel",l))};document.body.addEventListener("touchstart",(e=>{t=!0;const o=e.changedTouches;for(let e=0;e<o.length;e+=1)n(0,o[e]);const s=e.target;s.__touchCount||(s.__touchCount=0,s.addEventListener("touchend",r),s.addEventListener("touchcancel",l)),s.__touchCount+=o.length}),{capture:!0}),document.body.addEventListener("touchmove",(e=>{const t=e.changedTouches;for(let n=0;n<t.length;n+=1)o(e,t[n])}),{capture:!0}),document.body.addEventListener("mousedown",(e=>{t||n(0,{identifier:-1,clientX:e.clientX,clientY:e.clientY})}),{capture:!0}),document.body.addEventListener("mousemove",(e=>{t||o(e,{identifier:-1,clientX:e.clientX,clientY:e.clientY})}),{capture:!0}),document.body.addEventListener("mouseup",(e=>{t||s(e,{identifier:-1,clientX:e.clientX,clientY:e.clientY})}),{capture:!0})}setListenerStats(e,t,n,o){if(!e)return;const s=L.includes(t),i=2===o;if(s){if(this._$delegatedEventListeners[t])return;return this._$delegatedEventListeners[t]=!0,void document.body.addEventListener(t,(e=>{i&&e.preventDefault(),this._$trigger(e,t,this._$getEventDetail(e),e.bubbles,e.composed)}),{capture:!0})}const r=n?this._$elementCaptureEventListeners:this._$elementEventListeners;r.has(e)||r.set(e,Object.create(null));const l=r.get(e);l[t]||(l[t]=!0,e.addEventListener(t,(e=>{this._$triggedEvents.has(e)||(this._$triggedEvents.add(e),i&&e.preventDefault(),this._$trigger(e,t,this._$getEventDetail(e),e.bubbles,e.composed))})))}setModelBindingStat(e,t,n){const o=(o,s)=>{if(e._$wxArgs||(e._$wxArgs={modelListeners:Object.create(null)}),void 0===e._$wxArgs.modelListeners[t]){if(!n)return;e._$wxArgs.modelListeners[t]=n,e.addEventListener(o,(()=>{var n;const o=null===(n=e._$wxArgs)||void 0===n?void 0:n.modelListeners[t];null==o||o(s())}))}e._$wxArgs.modelListeners[t]=n},s=e.tagName;let i=!1;if("INPUT"===s){const n=e,s=n.type;"checkbox"===s||"radio"===s?"checked"===t&&(i=!0,o("change",(()=>n.checked))):"value"===t&&(i=!0,o("input",(()=>n.value)))}else if("TEXTAREA"===s){const n=e;"value"===t&&(i=!0,o("input",(()=>n.value)))}else if("SELECT"===s){const n=e;"value"===t&&(i=!0,o("change",(()=>n.value)))}i||O(`unsupported model binding on "${t}" of "${s.toLowerCase()}" element.`)}createIntersectionObserver(e,t,n,o,s){const i=new IntersectionObserver((e=>{e.forEach((e=>{s({intersectionRatio:e.intersectionRatio,boundingClientRect:e.boundingClientRect,intersectionRect:e.intersectionRect,relativeRect:e.rootBounds,time:e.time})}))}),{root:t,rootMargin:n,threshold:o});return i.observe(e),{disconnect(){i.disconnect()}}}createMediaQueryObserver(e,t){let n=null;const o=()=>{const o=(()=>{const t=document.documentElement.clientWidth,n=document.documentElement.clientHeight;return(void 0===e.width||t===e.width)&&(!(void 0!==e.maxWidth&&t>e.maxWidth)&&(!(void 0!==e.minWidth&&t<e.minWidth)&&((void 0===e.width||n===e.height)&&(!(void 0!==e.maxHeight&&n>e.maxHeight)&&(!(void 0!==e.minHeight&&n<e.minHeight)&&(t>n?"landscape":"portrait")===e.orientation)))))})();n!==o&&(n=o,t({matches:o}))};return setTimeout(o,0),window.addEventListener("resize",o),{disconnect(){window.removeEventListener("resize",o)}}}getContext(e,t){t(null)}},exports.DataGroup=Ce,exports.Element=Pe,exports.ElementIterator=wt,exports.EmptyBackendContext=A,exports.EmptyComposedBackendContext=class{constructor(){this.mode=2,this._$styleSheetIdInc=1,this._$renderCallbacks=null,this._$rootNode=new I}destroy(){}getWindowWidth(){return 1}getWindowHeight(){return 1}getDevicePixelRatio(){return 1}getTheme(){return"light"}registerStyleSheetContent(e,t){}appendStyleSheetPath(e,t){const n=this._$styleSheetIdInc;return this._$styleSheetIdInc+=1,n}disableStyleSheet(e){}render(e){if(this._$renderCallbacks)this._$renderCallbacks.push(e);else{const t=this._$renderCallbacks=[e];setTimeout((()=>{this._$renderCallbacks=null,t.forEach((e=>{c("Render Callback",e,this,[null])}))}),16)}}getRootNode(){return this._$rootNode}createElement(e,t){return new I}createTextNode(e){return new I}createFragment(){return new I}onEvent(e){}createMediaQueryObserver(e,t){return{disconnect:()=>{}}}},exports.Event=Me,exports.FuncArr=l,exports.MutationObserver=de,exports.NativeNode=Ge,exports.Observer=de,exports.ParsedSelector=Ae,exports.ShadowRoot=ze,exports.StyleScopeManager=P,exports.TextNode=Ve,exports.TraitBehavior=G,exports.VirtualNode=We,exports.addGlobalErrorListener=function(e){E.add(e)},exports.addGlobalWarningListener=function(e){x.add(e)},exports.backend=n,exports.composedBackend=o,exports.createElement=function(e,t){return bt.create(e,t||null)},exports.dataPath=oe,exports.dataUtils=le,exports.domlikeBackend=s,exports.dumpElement=(e,t)=>{console.log(w(e,t))},exports.dumpElementToString=w,exports.dumpSingleElementToString=C,exports.getDefaultComponentSpace=X,exports.globalOptions=i,exports.registerBehavior=e=>X().defineBehavior(e),exports.registerElement=e=>X().defineComponent(e),exports.removeGlobalErrorListener=function(e){E.remove(e)},exports.removeGlobalWarningListener=function(e){x.remove(e)},exports.safeCallback=c,exports.template=ft,exports.templateEngine=Nt,exports.triggerEvent=Et,exports.triggerExternalEvent=xt,exports.triggerRender=(e,t)=>{const n=e.getBackendContext();n&&((e,t)=>{e.render((()=>{"function"==typeof t&&c("render",t,e,[null])}))})(n,t||null)},exports.typeUtils=F;
1
+ "use strict";var e;exports.BackendMode=void 0,(e=exports.BackendMode||(exports.BackendMode={}))[e.Shadow=1]="Shadow",e[e.Composed=2]="Composed",e[e.Domlike=3]="Domlike";var t,n=Object.freeze({__proto__:null,BM:{DYNAMIC:!0,SHADOW:!1,COMPOSED:!1,DOMLIKE:!1},get BackendMode(){return exports.BackendMode}}),o=Object.freeze({__proto__:null}),s=Object.freeze({__proto__:null});"undefined"!=typeof process&&process.env.NODE_ENV,exports.DeepCopyKind=void 0,(t=exports.DeepCopyKind||(exports.DeepCopyKind={})).None="none",t.Simple="simple",t.SimpleWithRecursion="simple-recursion";const i={defaultComponentSpace:null,externalComponent:!1,templateEngine:null,styleScope:null,extraStyleScope:null,hostNodeTagName:"wx-x",multipleSlots:!1,dynamicSlots:!1,directSlots:!1,reflectToAttributes:!1,writeFieldsToNode:!0,writeIdToDOM:!1,useMethodCallerListeners:!1,idPrefixGenerator:null,pureDataPattern:null,dataDeepCopy:exports.DeepCopyKind.Simple,propertyPassingDeepCopy:exports.DeepCopyKind.Simple,listenerChangeLifetimes:!1,virtualHost:!1,propertyEarlyInit:!1,throwGlobalError:!1,writeExtraInfoToAttr:!1,backendContext:null,devtool:null},r=(e,t)=>{const n=void 0===t?i:t;if(void 0===e&&n!==i)return n;const o=null!=e?e:{};return{externalComponent:void 0!==o.externalComponent?o.externalComponent:n.externalComponent,templateEngine:void 0!==o.templateEngine?o.templateEngine:n.templateEngine,styleScope:void 0!==o.styleScope?o.styleScope:n.styleScope,hostNodeTagName:void 0!==o.hostNodeTagName?o.hostNodeTagName:n.hostNodeTagName,extraStyleScope:void 0!==o.extraStyleScope?o.extraStyleScope:n.extraStyleScope,multipleSlots:void 0!==o.multipleSlots?o.multipleSlots:n.multipleSlots,dynamicSlots:void 0!==o.dynamicSlots?o.dynamicSlots:n.dynamicSlots,directSlots:void 0!==o.directSlots?o.directSlots:n.directSlots,reflectToAttributes:void 0!==o.reflectToAttributes?o.reflectToAttributes:n.reflectToAttributes,writeFieldsToNode:void 0!==o.writeFieldsToNode?o.writeFieldsToNode:n.writeFieldsToNode,writeIdToDOM:void 0!==o.writeIdToDOM?o.writeIdToDOM:n.writeIdToDOM,useMethodCallerListeners:void 0!==o.useMethodCallerListeners?o.useMethodCallerListeners:n.useMethodCallerListeners,idPrefixGenerator:void 0!==o.idPrefixGenerator?o.idPrefixGenerator:n.idPrefixGenerator,pureDataPattern:void 0!==o.pureDataPattern?o.pureDataPattern:n.pureDataPattern,dataDeepCopy:void 0!==o.dataDeepCopy?o.dataDeepCopy:n.dataDeepCopy,propertyPassingDeepCopy:void 0!==o.propertyPassingDeepCopy?o.propertyPassingDeepCopy:n.propertyPassingDeepCopy,listenerChangeLifetimes:void 0!==o.listenerChangeLifetimes?o.listenerChangeLifetimes:n.listenerChangeLifetimes,virtualHost:void 0!==o.virtualHost?o.virtualHost:n.virtualHost,propertyEarlyInit:void 0!==o.propertyEarlyInit?o.propertyEarlyInit:n.propertyEarlyInit}};class l{constructor(e){this.empty=!0,this._$arr=null,this._$type=e}add(e){this._$arr?this._$arr=this._$arr.concat(e):this._$arr=[e],this.empty=!1}remove(e){let t=null;if(this._$arr){const n=[],o=this._$arr;for(let s=0;s<o.length;s+=1){if(o[s]===e){n.push(...o.slice(s+1)),t=e;break}n.push(o[s])}this._$arr=n,this.empty=0===this._$arr.length}return t}call(e,t,n){const o=this._$arr;let s=!0;if(o)for(let i=0;i<o.length;i+=1){!1===c(this._$type,o[i],e,t,n)&&(s=!1)}return s}}class a{constructor(e){this.empty=!0,this._$arr=null,this._$type=e}add(e,t){const n={f:e,data:t};this._$arr?this._$arr=this._$arr.concat(n):this._$arr=[n],this.empty=!1}remove(e){let t=null;if(this._$arr){const n=[],o=this._$arr;for(let s=0;s<o.length;s+=1){const i=o[s];if(i.f===e){n.push(...o.slice(s+1)),t=i.data;break}n.push(i)}this._$arr=n,this.empty=0===this._$arr.length}return t}call(e,t,n,o,s){const i=this._$arr;let r=!0;if(i)for(let l=0;l<i.length;l+=1){const{f:a,data:d}=i[l];if(!n(d))continue;const h=c(this._$type,a,e,t,o);!1===(s?s(h):h)&&(r=!1)}return r}}let d=()=>{};function c(e,t,n,o,s){try{return t.apply(n,o)}catch(n){return void d(n,`${e||"Listener"} ${t.name||"(anonymous)"}`,s)}}const h=Symbol("TextNode"),u=Symbol("Element"),p=Symbol("NativeNode"),f=Symbol("VirtualNode"),$=Symbol("ShadowRootSymbol"),_=Symbol("Component"),g=e=>!!e&&e[h],m=e=>!!e&&e[u],v=e=>!!e&&e[p],b=e=>!!e&&e[f],S=e=>!!e&&e[$],y=e=>!!e&&e[_],C=e=>{if(m(e)){let t;return t=b(e)?`(virtual):${e.is}`:y(e)?`${e.tagName}:${e.is}`:v(e)?e.is:"(unknown)",`<${t}${(e=>{let t="";if(m(e)){null!==e._$slotName&&(t+=` (slot) name="${e._$slotName}"`),e.id&&(t+=` id="${e.id}"`),e.slot&&(t+=` slot="${e.slot}"`);const n=e.class;n&&(t+=` class="${n}"`),e.style&&(t+=` style="${e.style}"`)}return b(e)||(y(e)?Object.keys(e._$behavior._$propertyMap).forEach((n=>{t+=` ${n}="${String(e.data[n])}"`})):e.attributes.forEach((e=>{t+=` ${e.name}="${String(e.value)}"`}))),t})(e)}>`}return g(e)?e.textContent.trim():null===e?"<(null)>":void 0===e?"<(undefined)>":"<(unknown)>"},w=(e,t,n=0)=>{let o="";for(let e=n;e;e-=1)o+=" ";let s=o+C(e),i=!1;return m(e)&&(y(e)&&(i=e._$external),t?i?(s+=`\n${o} <(external)>`,e.forEachComposedChild((e=>{s+=`\n${w(e,t,n+2)}`}))):e.forEachComposedChild((e=>{s+=`\n${w(e,t,n+1)}`})):e.childNodes.forEach((e=>{s+=`\n${w(e,t,n+1)}`}))),s};let N=!1;const E=new l("error"),x=new l("warning");function k(e,t,n,o){if(!N){N=!0,y(n)&&n.triggerLifetime("error",[e]);const s=!1===E.call(e,[e,t,n,o]);if(N=!1,s)return}if(i.throwGlobalError)throw e;console.error([e instanceof Error?`${e.message}`:String(e),o?`\t@${C(o)}`:void 0,n?`\t${t||""}@${"string"==typeof n?`<${n}>`:C(n||!1)}`:void 0].filter(Boolean).join("\n"))}function O(e,t,n){x.call(null,[e,t||"",n])&&console.warn(e)}d=k;class M extends Error{constructor(e,t,n,o){super(e),this.additionalStack=t,this.relatedComponent=n,this.element=o,k(this,t,n,o)}}const L=["touchstart","touchmove","touchend","touchcancel","mousedown","mousemove","mouseout","mouseover","mouseup","click"];var A;!function(e){e[e.Fragment=0]="Fragment",e[e.Element=1]="Element",e[e.TextNode=2]="TextNode",e[e.Component=3]="Component",e[e.VirtualNode=4]="VirtualNode"}(A||(A={}));class D{constructor(){this.mode=1,this._$styleSheetIdInc=1,this._$renderCallbacks=null,this._$shadowRoot=new I}destroy(){}getWindowWidth(){return 1}getWindowHeight(){return 1}getDevicePixelRatio(){return 1}getTheme(){return"light"}registerStyleSheetContent(e,t){}appendStyleSheetPath(e,t){const n=this._$styleSheetIdInc;return this._$styleSheetIdInc+=1,n}disableStyleSheet(e){}render(e){if(this._$renderCallbacks)this._$renderCallbacks.push(e);else{const t=this._$renderCallbacks=[e];setTimeout((()=>{this._$renderCallbacks=null,t.forEach((e=>{c("Render Callback",e,this,[null])}))}),16)}}getRootNode(){return this._$shadowRoot}createFragment(){return new T(0)}onEvent(e,t){}}class T{constructor(e){this._$shadowRoot=3===e?new I:null}release(){}associateValue(e){}getShadowRoot(){return this._$shadowRoot||void 0}appendChild(e){}removeChild(e,t){}insertBefore(e,t,n){}replaceChild(e,t,n){}spliceBefore(e,t,n){}spliceAppend(e){}spliceRemove(e,t){}setId(e){}setSlotName(e){}setContainingSlot(e){}reassignContainingSlot(e,t){}spliceBeforeSlotNodes(e,t,n){}spliceRemoveSlotNodes(e,t){}spliceAppendSlotNodes(e){}setInheritSlots(){}setStyle(e){}addClass(e){}removeClass(e){}clearClasses(){}setClassAlias(e,t){}setAttribute(e,t){}removeAttribute(e){}setDataset(e,t){}setText(e){}setListenerStats(e,t,n){}setModelBindingStat(e,t){}}class I extends T{constructor(){super(4)}createElement(e,t){return new T(1)}createTextNode(e){return new T(2)}createComponent(e,t,n,o,s,i){return new T(3)}createVirtualNode(e){return new T(4)}}class B{release(){}associateValue(e){}appendChild(e){}removeChild(e,t){}insertBefore(e,t,n){}replaceChild(e,t,n){}spliceBefore(e,t,n){}spliceAppend(e){}spliceRemove(e,t){}setId(e){}setStyleScope(e,t,n){}setStyle(e){}addClass(e,t){}removeClass(e,t){}clearClasses(){}setAttribute(e,t){}removeAttribute(e){}setText(e){}getBoundingClientRect(e){setTimeout((()=>{e({left:0,top:0,width:0,height:0})}),0)}getScrollOffset(e){setTimeout((()=>{e({scrollLeft:0,scrollTop:0,scrollWidth:0,scrollHeight:0})}),0)}setListenerStats(e,t,n){}setModelBindingStat(e,t){}createIntersectionObserver(e,t,n,o){return{disconnect:()=>{}}}getContext(e){e(null)}}const R=/\s+/;class P{constructor(){this._$names=[""]}static globalScope(){return 0}register(e){const t=this._$names.length;return this._$names.push(e),t}queryName(e){return this._$names[e]}}class j{constructor(e,t,n,o,s,i){this._$externalNames=void 0,this._$externalRawAlias=null,this._$dirtyExternalNames=null,this._$rawNames=[],this._$backendNames=[],this._$backendNameScopes=[],this._$backendNamesCount=[],this._$hasAliasNames=!1,this._$element=e,this._$owner=n,this._$defaultScope=o,this._$extraScope=s,this._$rootScope=(null==n?void 0:n._$owner)?n._$rootScope:o,this._$prefixManager=i,t&&(this._$externalNames=t,this._$externalRawAlias=[])}_$resolvePrefixes(e,t){const n=this._$owner,o=null==n?void 0:n._$externalNames,s=o?o.indexOf(e):-1;if(n&&-1!==s){this._$hasAliasNames=!0;const e=n._$externalRawAlias[s];if(e)for(let o=0;o<e.length;o+=1)n._$resolvePrefixes(e[o],t)}else if("~"===e[0])t(this._$rootScope,e.slice(1));else if("^"===e[0]){let n=e.slice(1),o=this._$owner;for(;"^"===n[0];)n=n.slice(1),o=null==o?void 0:o._$owner;t((null==o?void 0:o._$owner)?o._$defaultScope:this._$rootScope,n)}else void 0!==this._$extraScope&&t(this._$extraScope,e),t(this._$defaultScope,e)}_$hasAlias(e){return!!this._$externalNames&&this._$externalNames.includes(e)}_$setAlias(e,t){if(!this._$externalNames)return;let n;if(null==t)n=[];else if(Array.isArray(t)){n=Array(t.length);for(let e=0,o=t.length;e<o;e+=1)n[e]=String(t[e])}else n=String(t).split(R).filter((e=>""!==e));const o=this._$externalNames.indexOf(e);-1!==o&&(this._$dirtyExternalNames=this._$dirtyExternalNames||[],this._$dirtyExternalNames.push(e),this._$externalRawAlias[o]=n)}_$getAlias(){return this._$externalNames}_$spreadExternalClassUpdate(){const e=this._$owner;if(!(null==e?void 0:e._$dirtyExternalNames)||!this._$hasAliasNames)return!1;const t=e._$dirtyExternalNames,n=this._$externalNames;if(n)for(let e=0;e<n.length;e+=1){const o=this._$externalRawAlias[e]||[];for(let s=0;s<t.length;s+=1)o.includes(t[s])&&(this._$dirtyExternalNames=this._$dirtyExternalNames||[],this._$dirtyExternalNames.push(n[e]))}const o=this._$rawNames.some((e=>e.some((e=>t.includes(e)))));return o&&this._$updateResolvedNames(),!!this._$dirtyExternalNames||o}_$shouldUpdateExternalClass(){if(!this._$dirtyExternalNames)return!1;if(1===this._$element.getBackendMode()){const e=this._$dirtyExternalNames;for(let t=0;t<e.length;t+=1){const n=e[t],o=this._$externalNames.indexOf(n),s=this._$externalRawAlias[o]||[];this._$element._$backendElement.setClassAlias(n,s)}return this._$dirtyExternalNames=null,!1}return!0}_$markExternalClassUpdated(){this._$dirtyExternalNames=null}_$updateResolvedNames(){const e=this._$element._$backendElement;if(!e)return!1;const t=this._$rawNames,n=this._$backendNames,o=this._$backendNameScopes,s=this._$backendNamesCount,i=[],r=[],l=[];if(this._$hasAliasNames=!1,1===this._$element.getBackendMode())for(let e=0,n=t.length;e<n;e+=1){const n=t[e];if(n)for(let e=0,t=n.length;e<t;e+=1){const t=n[e];let o=!1;for(let e=0;e<i.length;e+=1)if(t===i[e]){l[e]+=1,o=!0;break}o||(i.push(t),r.push(void 0),l.push(1))}}else for(let e=0,n=t.length;e<n;e+=1){const n=t[e];if(n)for(let e=0,t=n.length;e<t;e+=1){const t=n[e];this._$resolvePrefixes(t,((e,t)=>{for(let n=0;n<i.length;n+=1)if(t===i[n]&&e===r[n])return void(l[n]+=1);i.push(t),r.push(e),l.push(1)}))}}let a=!1;for(let t=0;t<i.length;t+=1){let l=!1;for(let e=0;e<n.length;e+=1)if(i[t]===n[e]&&r[t]===o[e]){l=!0,s[e]=0;break}l||(a=!0,this._$addClassToBackend(i[t],r[t],e))}for(let t=0;t<n.length;t+=1)0!==s[t]&&(a=!0,this._$removeClassFromBackend(n[t],o[t],e));return this._$backendNames=i,this._$backendNameScopes=r,this._$backendNamesCount=l,a}_$addClassToBackend(e,t,n){var o;if(3===this._$element.getBackendMode()){const s=void 0===t?"":null===(o=this._$prefixManager)||void 0===o?void 0:o.queryName(t),i=s?`${s}--${e}`:e;n.classList.add(i)}else 2===this._$element.getBackendMode()?n.addClass(e,t):n.addClass(e)}_$removeClassFromBackend(e,t,n){var o;if(3===this._$element.getBackendMode()){const s=t&&(null===(o=this._$prefixManager)||void 0===o?void 0:o.queryName(t)),i=s?`${s}--${e}`:e;n.classList.remove(i)}else 2===this._$element.getBackendMode()?n.removeClass(e,t):n.removeClass(e)}_$addClass(e,t,n){const o=this._$backendNames,s=this._$backendNameScopes,i=this._$backendNamesCount;let r=!1;for(let n=0;n<o.length;n+=1)if(e===o[n]&&t===s[n]){r=!0,i[n]+=1;break}r||(o.push(e),s.push(t),i.push(1),this._$addClassToBackend(e,t,n))}_$removeClass(e,t,n){const o=this._$backendNames,s=this._$backendNameScopes,i=this._$backendNamesCount;for(let r=0;r<o.length;r+=1)if(e===o[r]&&t===s[r]){i[r]<=1?(o.splice(r,1),s.splice(r,1),i.splice(r,1),this._$removeClassFromBackend(e,t,n)):i[r]-=1;break}}toggle(e,t,n=0){if(R.test(e))throw new Error("Class name contains space characters.");const o=this._$element._$backendElement,s=this._$rawNames[n]?this._$rawNames[n].indexOf(e):-1;let i=!1;if(void 0===t?-1===s:!!t){if(-1===s){const t=this._$rawNames;t[n]||(t[n]=[]);t[n].push(e),o&&(1===this._$element.getBackendMode()?this._$addClass(e,void 0,o):this._$resolvePrefixes(e,((e,t)=>{this._$addClass(t,e,o)}))),i=!0}}else if(-1!==s){const t=this._$rawNames[n];t&&t.splice(s,1),o&&(1===this._$element.getBackendMode()?this._$removeClass(e,void 0,o):this._$resolvePrefixes(e,((e,t)=>{this._$removeClass(t,e,o)}))),i=!0}return i}contains(e,t=0){const n=this._$rawNames[t]||[];for(let t=0;t<n.length;t+=1){const o=n[t];if("~"===o[0]){if(o.slice(1)===e)return!0}else if("^"===o[0]){let t=o.slice(1);for(;"^"===t[0];)t=t.slice(1);if(t===e)return!0}else if(o===e)return!0}return!1}setClassNames(e,t=0){let n;if(null==e)n=[];else if(Array.isArray(e)){n=Array(e.length);for(let t=0,o=e.length;t<o;t+=1)n[t]=String(e[t])}else n=String(e).split(R).filter((e=>""!==e));return this._$rawNames[t]=n,this._$updateResolvedNames()}getClassNames(e=0){const t=this._$rawNames[e]||[];return t?t.join(" "):""}}const U=Symbol("method");var F=Object.freeze({__proto__:null,METHOD_TAG:U});class G{constructor(e,t){this.ownerSpace=e,this._$trans=t}_$implement(e){var t;return(null===(t=this._$trans)||void 0===t?void 0:t.call(this,e))||e}}class V{constructor(){this._$traits=new WeakMap}implement(e,t){const n=e._$implement(t);this._$traits.set(e,n)}get(e){return this._$traits.get(e)}}const W=(e,t)=>{let n;n="/"!==e[0]?t.split("/").slice(0,-1).concat(e.split("/")):e.split("/");const o=[];for(let e=0;e<n.length;e+=1){const t=n[e];""!==t&&"."!==t&&(".."!==t?o.push(t):o.pop())}return o.join("/")},H=(e,t)=>{const n=e.indexOf("://");if(n>0){const t=e.indexOf("/",n+3);if(t>0){return{domain:e.slice(0,t),absPath:W(e.slice(t+1),"")}}return{domain:e.slice(0,n+3),absPath:W(e.slice(n+3),"")}}return{domain:null,absPath:W(e,t)}};class z{constructor(e,t,n){this._$callbacks=[],this._$ownerSpace=e,this._$isPub=t,this._$alias=n}add(e){this._$callbacks.push(e)}hintUsed(e){var t,n;null===(n=(t=this._$ownerSpace)._$componentWaitingListener)||void 0===n||n.call(t,this._$isPub,this._$alias,e)}remove(e){const t=this._$callbacks.indexOf(e);this._$callbacks.splice(t,1)}call(e){const t=this._$callbacks;this._$callbacks=[];for(let n=0;n<t.length;n+=1){(0,t[n])(e)}}}class K{constructor(e,t,n,o=!0){this._$behaviorList=Object.create(null),this._$pubBehaviorList=Object.create(null),this._$list=Object.create(null),this._$pubList=Object.create(null),this._$using=Object.create(null),this._$importedSpaces=Object.create(null),this._$listWaiting=Object.create(null),this._$pubListWaiting=Object.create(null),this._$groupingListWaiting=null,this._$componentWaitingListener=null,this._$allowUnusedNativeNode=!0,t&&(Object.assign(this._$list,t._$pubList),Object.assign(this._$behaviorList,t._$pubBehaviorList)),this._$defaultComponent=null!=e?e:"",this._$componentOptions=r({},null==t?void 0:t._$componentOptions),this.styleScopeManager=n||new P,this._$allowUnusedNativeNode=o}updateComponentOptions(e){this._$componentOptions=r(e,this._$componentOptions)}getComponentOptions(){return this._$componentOptions}setGlobalUsingComponent(e,t){this._$using[e]=t}importSpace(e,t,n){this._$importedSpaces[e]={space:t,privateUse:n}}getComponentByUrl(e,t){const{domain:n,absPath:o}=H(e,t),s=this.getComponent(o,!0,n);if(!s)throw new Error(`There is no component "${o}" in the space and no default component can be used`);return s}getComponentByUrlWithoutDefault(e,t){const{domain:n,absPath:o}=H(e,t);return this.getComponent(o,!1,n)||null}getComponent(e,t=!0,n=null){let o;if(n){const e=this._$importedSpaces[n];if(e){const{space:t,privateUse:n}=e;o=n?t._$list:t._$pubList}}else o=this._$list;if(o){const t=o[e];if(t)return t}if(t)return this._$list[this._$defaultComponent]}getDefaultComponent(){return this._$list[this._$defaultComponent]||null}isDefaultComponent(e){return this._$list[this._$defaultComponent]===e}getGlobalUsingComponent(e){return this._$using[e]||null}getBehaviorByUrl(e,t){const{domain:n,absPath:o}=H(e,t);return this._$getBehavior(o,n)||null}_$getBehavior(e,t=null){let n;if(t){const e=this._$importedSpaces[t];if(e){const{space:t,privateUse:o}=e;n=o?t._$behaviorList:t._$pubBehaviorList}}else n=this._$behaviorList;if(n){const t=n[e];if(t)return t}}defineComponent(e){const t=e.is;return new yt(t,this).definition(e).registerComponent()}defineBehavior(e){const t=e.is;return new yt(t,this).definition(e).registerBehavior()}define(e){return new yt(e,this)}defineWithMethodCaller(e){return new yt(e,this)}_$registerComponent(e,t){this._$list[e]=t,this._$behaviorList[e]=t.behavior;const n=this._$listWaiting[e];n&&(delete this._$listWaiting[e],this._$groupingListWaiting?this._$groupingListWaiting.push({waiting:n,comp:t}):n.call(t))}_$registerBehavior(e,t){this._$behaviorList[e]=t}startGroupRegister(){this._$groupingListWaiting=[]}endGroupRegister(){const e=this._$groupingListWaiting;if(e){this._$groupingListWaiting=null;for(let t=0;t<e.length;t+=1){const{waiting:n,comp:o}=e[t];n.call(o)}}}groupRegister(e){this.startGroupRegister();const t=c("group register",e,this,[]);return this.endGroupRegister(),t}exportComponent(e,t){const n=this._$list[t];if(!n)throw new Error(`There is no component "${t}" for aliasing`);this._$pubList[e]=n;const o=this._$pubListWaiting[e];o&&(delete this._$pubListWaiting[e],o.call(n))}getExportedComponent(e){return this._$pubList[e]}getExportedBehavior(e){return this._$pubBehaviorList[e]}exportBehavior(e,t){const n=this._$behaviorList[t];if(!n)throw new Error(`There is no behavior "${t}" for aliasing`);this._$pubBehaviorList[e]=n}_$componentWaitingList(e,t){const{domain:n,absPath:o}=H(e,t);let s,i,r;if(n){const e=this._$importedSpaces[n];if(!e)return null;if(i=e.space,r=!e.privateUse,r){if(i._$pubList[o])return null;s=i._$pubListWaiting}else{if(i._$list[o])return null;s=i._$listWaiting}}else{if(i=this,r=!1,this._$list[o])return null;s=this._$listWaiting}let l=s[o];return l||(l=s[o]=new z(i,r,o),l)}setComponentWaitingListener(e){this._$componentWaitingListener=e}createComponentByUrl(e,t,n,o){let s=t,i=null;const r=s.indexOf("#");r>=0&&(s=s.slice(0,r));const l=s.indexOf("?");l>=0&&(i=s.slice(l+1),s=s.slice(0,l));const a=this.getComponentByUrl(s,"");let d=null;n&&(d=Object.create(null),Object.keys(n).forEach((e=>{const t=n[e],o=this.getComponentByUrl(t,"");d[e]=o})));return St.createWithGenericsAndContext(e,a,d,o,(e=>{if(i){let t=!1;i.split("&").forEach((n=>{const o=n.indexOf("=");if(o>=0){const s=decodeURIComponent(n.slice(0,o)),i=decodeURIComponent(n.slice(o+1));e._$dataGroup.replaceProperty(s,i)&&(t=!0)}})),t&&e.applyDataUpdates()}}))}defineTraitBehavior(e){return new G(this,e)}}let q=null;const X=()=>{if(q)return q;const e=new K;return q=e,e},Y=e=>{const t=e.str;for(;e.cur<t.length;){const n=t[e.cur];if(" "!==n&&"\n"!==n&&"\r"!==n&&"\t"!==n&&"\f"!==n)break;e.cur+=1}return e.cur<t.length},Z=e=>{const t=e.str;let n="";for(;e.cur<t.length;){const o=t[e.cur];if(!(o>="0"&&o<="9"))break;n+=o,e.cur+=1}if(!n)throw new Error(`data path descriptor "${t}" is illegal at char ${e.cur} (illegal index)`);return parseInt(n,10)},Q=e=>{const t=e.str;let n="";for(;e.cur<t.length;){const o=t[e.cur];if("\\"===o)if(e.cur+1===t.length);else{n+=t[e.cur+1],e.cur+=1}else if(/^[_a-zA-Z]$/.test(o))n+=o;else{if(!(o>="0"&&o<="9"))break;if(""===n)throw new Error(`data path descriptor "${t}" is illegal at char ${e.cur} (field name cannot start with digits)`);n+=o}e.cur+=1}return n},J=e=>{const t=e.str;let n="";for(;e.cur<t.length;){const o=t[e.cur];if("\\"===o)if(e.cur+1===t.length)n+="\\",e.cur+=1;else{const o=t[e.cur+1];"."===o||"["===o||"]"===o||"\\"===o?(n+=o,e.cur+=2):(n+="\\",e.cur+=1)}else{if("."===o||"["===o)break;n+=o,e.cur+=1}}return n},ee=e=>{const t=e.str;if(Y(e),"*"===t[e.cur]&&"*"===t[e.cur+1])return e.cur+=2,["**"];const n=Q(e);if(!n)throw new Error(`data path descriptor "${t}" is illegal at char ${e.cur} (first field name illegal)`);const o=[n];for(;e.cur<t.length&&Y(e);){const n=t[e.cur];if("."===n){if(e.cur+=1,Y(e),"*"===t[e.cur]&&"*"===t[e.cur+1]){o.push("**"),e.cur+=2;break}const n=Q(e);if(!n)throw new Error(`data path descriptor "${t}" is illegal at char ${e.cur} (field name illegal)`);o.push(n)}else{if("["!==n)break;{e.cur+=1,Y(e);const n=Z(e);Y(e);if("]"!==t[e.cur])throw new Error(`data path descriptor "${t}" is illegal at char ${e.cur} (illegal index)`);e.cur+=1,o.push(n)}}}return o},te=e=>{const t=(e=>{const t=e.str,n=[];for(;e.cur<t.length;){const o=t[e.cur];if("."===o){e.cur+=1;const t=J(e);""!==t&&n.push(t)}else if("["===o){e.cur+=1;const o=Z(e);if("]"!==t[e.cur]&&e.cur<t.length)throw new Error(`data path descriptor "${t}" is illegal at char ${e.cur} (illegal index)`);e.cur+=1,n.push(o)}else{const t=J(e);n.push(t)}}return 0===n.length&&n.push(""),n})({str:e,cur:0});return t},ne=e=>{if("string"!=typeof e)return e.map((e=>ee({str:e,cur:0})));const t={str:e,cur:0},n=(e=>{const t=[];for(t.push(ee(e)),Y(e);","===e.str[e.cur];)e.cur+=1,t.push(ee(e)),Y(e);return t})(t);if(t.cur!==e.length)throw new Error(`data path descriptor "${e}" is illegal at char ${t.cur}`);return n};var oe=Object.freeze({__proto__:null,parseMultiPaths:ne,parseSinglePath:te});const se=(e,t)=>{if("object"==typeof e&&null!==e){const n=t.get(e);if(void 0!==n)return n;if(Array.isArray(e)){const n=[];t.set(e,n);for(let o=0;o<e.length;o+=1)n[o]=se(e[o],t);return n}const o={};t.set(e,o);const s=Object.keys(e);for(let n=0;n<s.length;n+=1){const i=s[n];o[i]=se(e[i],t)}return o}return"symbol"==typeof e?Symbol(e.description):e},ie=e=>{if("object"==typeof e&&null!==e){if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n+=1)t[n]=ie(e[n]);return t}const t={},n=Object.keys(e);for(let o=0;o<n.length;o+=1){const s=n[o];t[s]=ie(e[s])}return t}return"symbol"==typeof e?Symbol(e.description):e},re=(e,t)=>t?se(e,new WeakMap):ie(e);var le=Object.freeze({__proto__:null,deepCopy:re,simpleDeepCopy:ie});class ae{constructor(e){this._$subtreeObserversCount=0,this.attrObservers=null,this.textObservers=null,this.childObservers=null,this.attachObservers=null,this._$boundElement=e}attachChild(e){e._$mutationObserverTarget||(e._$mutationObserverTarget=new ae(e)),this._$subtreeObserversCount>0&&e._$mutationObserverTarget.updateSubtreeCount(this._$subtreeObserversCount)}detachChild(e){e._$mutationObserverTarget&&e._$mutationObserverTarget.updateSubtreeCount(-this._$subtreeObserversCount)}updateSubtreeCount(e){this._$subtreeObserversCount+=e;this._$boundElement.childNodes.forEach((t=>{m(t)&&(t._$mutationObserverTarget||(t._$mutationObserverTarget=new ae(t)),t._$mutationObserverTarget.updateSubtreeCount(e))}))}hasSubtreeListeners(){return this._$subtreeObserversCount>0}static callAttrObservers(e,t){var n;let o=e;do{const e=o._$mutationObserverTarget;null===(n=null==e?void 0:e.attrObservers)||void 0===n||n.call(o,[t]);const s=o.parentNode;if(!s)break;if(o=s,!o._$mutationObserverTarget)break}while(o._$mutationObserverTarget._$subtreeObserversCount>0)}static callTextObservers(e,t){var n;let o=e.parentNode;for(;o;){const e=o._$mutationObserverTarget;if(!e||0===e._$subtreeObserversCount)break;null===(n=e.textObservers)||void 0===n||n.call(o,[t]),o=o.parentNode}}static callChildObservers(e,t){var n;let o=e;do{const e=o._$mutationObserverTarget;null===(n=null==e?void 0:e.childObservers)||void 0===n||n.call(o,[t]);const s=o.parentNode;if(!s)break;if(o=s,!o._$mutationObserverTarget)break}while(o._$mutationObserverTarget._$subtreeObserversCount>0)}static callAttachObservers(e,t){var n;const o=e._$mutationObserverTarget;null===(n=null==o?void 0:o.attachObservers)||void 0===n||n.call(e,[t])}}class de{constructor(e){this._$subtreeListenersCount=0,this._$boundFuncArrs=[],this._$boundTarget=null,this._$listener=e,this._$normalizedListener=null}static create(e){return new de(e)}observe(e,t={properties:!1,childList:!1,characterData:!1,subtree:!1,attachStatus:!1}){const n=this._$listener;if(!n)throw new Error("A MutationObserver can only observe once");let o;e._$mutationObserverTarget?o=e._$mutationObserverTarget:(o=new ae(e),e._$mutationObserverTarget=o),this._$listener=null;const s=t.subtree?n:function(e){e.target===this&&n.call(this,e)};this._$normalizedListener=s,this._$boundTarget=o,t.properties&&(o.attrObservers||(o.attrObservers=new l("attributeObserver")),o.attrObservers.add(s),this._$boundFuncArrs.push(o.attrObservers),this._$subtreeListenersCount+=1),t.childList&&(o.childObservers||(o.childObservers=new l("childObserver")),o.childObservers.add(s),this._$boundFuncArrs.push(o.childObservers),this._$subtreeListenersCount+=1),t.characterData&&(o.textObservers||(o.textObservers=new l("textObserver")),o.textObservers.add(s),this._$boundFuncArrs.push(o.textObservers),this._$subtreeListenersCount+=1),t.subtree&&o.updateSubtreeCount(this._$subtreeListenersCount),t.attachStatus&&(o.attachObservers||(o.attachObservers=new l("attachObserver")),o.attachObservers.add(s),this._$boundFuncArrs.push(o.attachObservers))}disconnect(){var e;null===(e=this._$boundTarget)||void 0===e||e.updateSubtreeCount(-this._$subtreeListenersCount);const t=this._$boundFuncArrs;this._$boundFuncArrs=[];const n=this._$normalizedListener;n&&t.forEach((e=>{e.remove(n)}))}}const ce=Object.prototype.hasOwnProperty;var he;exports.NormalizedPropertyType=void 0,(he=exports.NormalizedPropertyType||(exports.NormalizedPropertyType={})).Invalid="invalid",he.Any="any",he.String="string",he.Number="number",he.Boolean="boolean",he.Object="object",he.Array="array",he.Function="function";const ue=(e,t)=>{const n=Object.keys(t);for(let o=0;o<n.length;o+=1){const s=n[o];if(Object.prototype.hasOwnProperty.call(e,s))if("_"===s[0]&&O(`data field "${s}" from different behaviors is overriding or merging.`),"object"!=typeof e[s]||"object"!=typeof t[s]||null===t[s]||Array.isArray(t[s]))e[s]=t[s];else{if(Array.isArray(e[s]))e[s]=e[s].slice();else{const t=e[s],n={},o=Object.keys(t);for(let e=0;e<o.length;e+=1){const s=o[e];n[s]=t[s]}e[s]=n}ue(e[s],t[s])}else e[s]=t[s]}},pe=e=>"string"===e||e===String?"string":"number"===e||e===Number?"number":"boolean"===e||e===Boolean?"boolean":"object"===e||e===Object?"object":"array"===e||e===Array?"array":"function"===e||e===Function?"function":"any"===e||null==e?"any":"invalid",fe=(e,t,n,o)=>{const s=n.type,i=void 0===n.default?void 0:()=>c(`Property "${t}" Default`,n.default,null,[],o||void 0),r=n.optionalTypes;if(r)for(let t=0;t<r.length;t+=1)if($e(r[t],e))return e;return"string"===s?null==e?(O(`property "${t}" received type-incompatible value: expected <String> but get null value. Used default value instead.`),void 0===i?"":i()):("object"==typeof e&&O(`property "${t}" received type-incompatible value: expected <String> but got object-typed value. Force converted.`),String(e)):"number"===s?isFinite(e)?Number(e):(O("number"==typeof e?`property "${t}" received type-incompatible value: expected <Number> but got NaN or Infinity. Used default value instead.`:`property "${t}" received type-incompatible value: expected <Number> but got non-number value. Used default value instead.`),void 0===i?0:i()):"boolean"===s?!!e:"array"===s?Array.isArray(e)?e:(O(`property "${t}" received type-incompatible value: expected <Array> but got non-array value. Used default value instead.`),void 0===i?[]:i()):"object"===s?"object"==typeof e?e:(O(`property "${t}" received type-incompatible value: expected <Object> but got non-object value. Used default value instead.`),void 0===i?null:i()):"function"===s?"function"==typeof e?e:(O(`property "${t}" received type-incompatible value: expected <Function> but got non-function value. Used default value instead.`),void 0===i?function(){}:i()):void 0===e?void 0===i?null:i():e},$e=(e,t)=>{if("string"===e){if("string"!=typeof t)return!1}else if("number"===e){if(!Number.isFinite(t))return!1}else if("boolean"===e){if("boolean"!=typeof t)return!1}else if("object"===e){if("object"!=typeof t||Array.isArray(t))return!1}else if("array"===e){if("object"!=typeof t||!Array.isArray(t))return!1}else if("function"===e){if("function"!=typeof t)return!1}else if(void 0===t)return!1;return!0};var _e;!function(e){e[e.None=0]="None",e[e.Simple=1]="Simple",e[e.SimpleWithRecursion=2]="SimpleWithRecursion"}(_e||(_e={}));class ge{constructor(e){this.observerTree={sub:{}},this.observers=[],this.propFields=e}cloneSub(){const e=new ge(this.propFields);return this.observers.length>0&&(e.observerTree=ie(this.observerTree),e.observers=this.observers.slice()),e}addObserver(e,t){const n=this.observers.length;this.observers.push({path:t,f:e});for(let e=0;e<t.length;e+=1){const o=t[e];let s=this.observerTree,i=!1;for(let e=0;e<o.length;e+=1){const t=o[e];if("**"===t){i=!0;break}s.sub[t]||(s.sub[t]={sub:{}}),s=s.sub[t]}i?s.wildcard?s.wildcard.push(n):s.wildcard=[n]:s.listener?s.listener.push(n):s.listener=[n]}}}const me=(e,t,n,o)=>{const s=new Array(n.length);for(let e=0;e<n.length;e+=1){const o=n[e];let i=t;for(let e=0;e<o.length;e+=1){const t=o[e];if("**"===t)break;if("object"!=typeof i||null===i){i=void 0;break}i=i[t]}s[e]=i}c("Data Observer",o,e.getMethodCaller(),s,e||void 0)},ve=(e,t)=>{if(e.listener)for(let n=0;n<e.listener.length;n+=1){t[e.listener[n]]=!0}if(e.wildcard)for(let n=0;n<e.wildcard.length;n+=1){t[e.wildcard[n]]=!0}const n=Object.keys(e.sub);for(let o=0;o<n.length;o+=1){const s=n[o];ve(e.sub[s],t)}},be=(e,t,n)=>{let o=e,s=!0;for(let e=0;e<n.length;e+=1){const i=n[e];if(o.wildcard){const e=o.wildcard;for(let n=0;n<e.length;n+=1){t[e[n]]=!0}}if(!ce.call(o.sub,i)){s=!1;break}o=o.sub[i]}s&&ve(o,t)},Se=(e,t,n,o)=>{for(let s=0;s<e.length;s+=1){const{path:i,f:r}=e[s];t[s]&&(t[s]=!1,n&&me(n,o,i,r))}},ye=e=>e===exports.DeepCopyKind.Simple?1:e===exports.DeepCopyKind.SimpleWithRecursion?2:0;class Ce{_$generateInnerData(e){const t=this._$pureDataPattern,n=this._$dataDeepCopy;if(t||0!==n){const o={},s=Object.keys(e);for(let i=0;i<s.length;i+=1){const r=s[i],l=e[r];t&&t.test(r)||(o[r]=0===n?l:2===n?re(l,!0):ie(l))}return o}return null}constructor(e,t,n,o,s,i,r){this._$modelBindingListener=null,this._$pendingChanges=[],this._$doingUpdates=null,this._$comp=e,this.data=t,this._$pureDataPattern=n,this._$dataDeepCopy=o,this._$propertyPassingDeepCopy=s,this._$reflectToAttributes=i&&!!e,this._$propFields=r.propFields,this._$observerTree=r.observerTree,this._$observers=r.observers,this._$observerStatus=new Array(r.observers.length),this.innerData=this._$generateInnerData(t)}static create(e){return new Ce(null,e,null,0,0,!1,new ge({}))}setUpdateListener(e){this._$updateListener=e}replaceWholeData(e){this.data=e,this.innerData=this._$generateInnerData(e)}replaceDataOnPath(e,t){this._$pendingChanges.push([e,t,void 0,void 0])}spliceArrayDataOnPath(e,t,n,o){Array.isArray(o)?this._$pendingChanges.push([e,o,null!=t?t:-1,n||0]):O(`The splice insertion must be a string (on path "${e.join(".")}"). The change is ignored.`)}replaceProperty(e,t){let n=t;return!!this._$propFields[e]&&(0!==this._$propertyPassingDeepCopy&&(n=2===this._$propertyPassingDeepCopy?re(t,!0):ie(t)),this._$pendingChanges.push([[e],n,!0,void 0]),!0)}setChanges(e){this._$pendingChanges=e}getChanges(){return this._$pendingChanges}setModelBindingListener(e,t){if(this._$modelBindingListener)this._$modelBindingListener[e]=t;else{(this._$modelBindingListener=Object.create(null))[e]=t}}applyDataUpdates(e=!1){var t;const n=this._$propFields,o=this._$comp,s=this._$pureDataPattern,i=this._$dataDeepCopy,r=!!this._$doingUpdates;let l,a;this._$observers.length>0?this._$doingUpdates?(l=this._$doingUpdates.combined,a=this._$doingUpdates.prop):(this._$doingUpdates={prop:[],combined:[],count:0},l=this._$doingUpdates.combined,a=this._$doingUpdates.prop):(l=[],a=[]);const d=this._$pendingChanges;this._$pendingChanges=[];for(let t=0;t<d.length;t+=1){const r=d[t],[h,u,p,f]=r,$=void 0!==f,_=String(h[0]),g=!!s&&s.test(_),m=!g&&this.innerData,v=n[_];let b=!0;if(v&&1===h.length){const t=this.data[_];let n,s,l;if($){if(Array.isArray(t)){const e=r,o=p;n=o>=0&&o<t.length?o:t.length,e[2]=n,t.splice(n,f,...u)}else O(`An array splice change cannot be applied to a non-array value (on path "${h.join(".")}"). The change is ignored.`);s=t}else s=fe(u,_,v,this._$comp);if(m){let e;if(0===i)r[1]=e=s;else if(void 0!==n){let t;e=this.innerData[_],r[1]=t=2===i?re(u,!0):ie(u),e.splice(n,f,...t)}else r[1]=e=2===i?re(s,!0):ie(s);this.innerData[_]=e}if(this.data[_]=s,this._$reflectToAttributes){const e=o.getBackendElement();if(e){let t=s;if(v.reflectIdPrefix){const e=o.ownerShadowRoot;if(e){const n=e.getHostNode()._$idPrefix;n&&(t=`${n}--${s}`)}}const n=_.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`)),i=typeof t;"boolean"===i?s?e.setAttribute(n,""):e.removeAttribute(n):"object"===i?e.setAttribute(n,JSON.stringify(t)):e.setAttribute(n,t)}}$||!0!==p?l=t!==s:(v.comparer?(r[2]=void 0,l=!!c("Property Comparer",v.comparer,o,[u,t],null==o?void 0:o.general())):l=t!==s,b=l),!g&&l&&a.push({propName:_,prop:v,oldValue:t,newValue:s,skipModelListener:e})}else{let t,n=this.data,o=_;for(let e=1;e<h.length;e+=1){const t=h[e];Number.isFinite(t)?(ce.call(n,o)&&Array.isArray(n[o])||(n[o]=[]),m||g||t>=n[o].length&&l.push([h.slice(0,e).concat("length"),!0,void 0,void 0])):ce.call(n,o)&&null!==n[o]&&"object"==typeof n[o]&&!Array.isArray(n[o])||(n[o]={}),n=n[o],o=t}if($){const e=n.length,s=n[o];if(Array.isArray(s)){const o=r,i=p;t=i>=0&&i<s.length?i:s.length,o[2]=t,s.splice(t,f,...u),m||g||n.length===e||l.push([h.concat("length"),!0,void 0,void 0])}else O(`An array splice change cannot be applied to a non-array value (on path "${h.join(".")}"). The change is ignored.`)}else n[o]=u;if(m){n=this.innerData,o=_;for(let e=1;e<h.length;e+=1){const t=h[e];Number.isFinite(t)?(ce.call(n,o)&&Array.isArray(n[o])||(n[o]=[]),t>=n[o].length&&l.push([h.slice(0,e).concat("length"),!0,void 0,void 0])):ce.call(n,o)&&null!==n[o]&&"object"==typeof n[o]&&!Array.isArray(n[o])||(n[o]={}),n=n[o],o=t}let e;if(0===i)r[1]=e=u;else if(void 0!==t){const s=n.length;let a;e=n[o],r[1]=a=2===i?re(u,!0):ie(u),e.splice(t,f,...a),n.length!==s&&l.push([h.concat("length"),!0,void 0,void 0])}else r[1]=e=2===i?re(u,!0):ie(u);n[o]=e}!g&&v&&a.push({propName:_,prop:v,oldValue:void 0,newValue:u,skipModelListener:e||!1})}be(this._$observerTree,this._$observerStatus,h),!g&&b&&l.push(r),this._$doingUpdates&&(this._$doingUpdates.count+=1)}if(!r){if(this._$doingUpdates){let e;do{e=this._$doingUpdates.count,Se(this._$observers,this._$observerStatus,o,this.data)}while(e!==this._$doingUpdates.count);this._$doingUpdates=null}if(null===(t=this._$updateListener)||void 0===t||t.call(this,this.innerData||this.data,l),o)for(let e=0;e<a.length;e+=1){const{propName:t,prop:n,oldValue:s,newValue:i,skipModelListener:r}=a[e];if(!r&&this._$modelBindingListener){const e=this._$modelBindingListener[t];e&&e(i)}n.observer&&c("Property Observer",n.observer,o.getMethodCaller(),[i,s],o),o._$mutationObserverTarget&&ae.callAttrObservers(o,{type:"properties",target:o,propertyName:t})}}}}var we;exports.EventBubbleStatus=void 0,(we=exports.EventBubbleStatus||(exports.EventBubbleStatus={}))[we.Normal=0]="Normal",we[we.NoDefault=1]="NoDefault";let Ne=Date.now(),Ee=Ne;var xe,ke;exports.EventMutLevel=void 0,(xe=exports.EventMutLevel||(exports.EventMutLevel={}))[xe.None=0]="None",xe[xe.Mut=1]="Mut",xe[xe.Final=2]="Final",function(e){e[e.NotChanged=0]="NotChanged",e[e.Failed=1]="Failed",e[e.None=2]="None",e[e.Final=3]="Final",e[e.Mut=4]="Mut"}(ke||(ke={}));class Oe{constructor(){this.listeners=Object.create(null),this.captureListeners=null}addListener(e,t,n={}){const o=n.final?2:n.mutated?1:0;let s,i,r;return n.capture||n.useCapture?this.captureListeners?s=this.captureListeners:(s=Object.create(null),this.captureListeners=s):s=this.listeners,s[e]?(r=!0,i=s[e]):(r=!1,i=s[e]={mutCount:0,finalCount:0,funcArr:new a("listener")}),i.funcArr.add(t,o),2===o?(i.finalCount+=1,r&&1!==i.finalCount?0:3):1===o?(i.mutCount+=1,!r||1===i.mutCount&&0===i.finalCount?4:0):r?0:2}removeListener(e,t,n={}){const o=n.capture||n.useCapture?this.captureListeners:this.listeners;if(!o)return 1;const s=o[e];if(!s)return 1;const i=s.funcArr.remove(t);return null===i?1:2===i?(s.finalCount-=1,0!==s.finalCount?0:s.mutCount>0?4:2):1===i?(s.mutCount-=1,0!==s.mutCount||0!==s.finalCount?0:2):0}}let Me=class e{constructor(e,t,n={}){const o=(()=>{const e=Date.now();return e<Ee&&(Ne+=e-Ee),Ee=e,e-Ne})();this._$eventName=this.type=e,this.timeStamp=o,this.detail=t,this.bubbles=n.bubbles||!1,this.composed=n.composed||!1,this._$capturePhase=n.capturePhase||!1,this._$eventBubblingControl={stopped:!1,mutated:!1,noDefault:!1},this._$originalEvent=n.originalEvent,this._$dispatched=!1,this._$handleListenerReturn=n.handleListenerReturn,n.extraFields&&(Object.assign(this,n.extraFields),this.extraFields=n.extraFields)}getEventBubbleStatus(){return this._$eventBubblingControl.noDefault?1:0}wrapShadowedEvent(e,t,n){const o=Object.create(this);return o.target=e,o.mark=t,o.currentTarget=n,o}getEventName(){return this._$eventName}getOriginalEvent(){return this._$originalEvent}preventDefault(){this._$eventBubblingControl.noDefault=!0}defaultPrevented(){return this._$eventBubblingControl.noDefault}stopPropagation(){this._$eventBubblingControl.stopped=!0}propagationStopped(){return this._$eventBubblingControl.stopped}markMutated(){this._$eventBubblingControl.mutated=!0}mutatedMarked(){return this._$eventBubblingControl.mutated}listenerReturnHandler(){return this._$handleListenerReturn}callListener(e,t,n,o){const s=this._$eventName,i=e._$eventTarget;if(!i)return;const r=o?i.captureListeners:i.listeners;if(!r)return;const l=r[s];if(!l)return;const a=this.mutatedMarked(),d=y(n)&&n.getMethodCaller()||n,c=y(e)&&e.getMethodCaller()||e,h=this.wrapShadowedEvent(d,t,c);!1===l.funcArr.call(c,[h],(e=>!a||1!==e),y(n)?n:void 0,this._$handleListenerReturn)||l.finalCount>0?(h.stopPropagation(),h.preventDefault()):l.mutCount>0&&h.markMutated()}dispatch(e,t){if(this._$dispatched)throw new Error("Event cannot be dispatched twice");this._$dispatched=!0;const n=this.composed,o=this.bubbles,s=t&&!n,i=this._$eventBubblingControl,r=(e,t)=>{const o=e=>{let s=e;const i=e.collectMarks();for(;;){if(!1===t(s,e,i))return null;let r;if(n){if(S(s))return s.getHostNode();if(null===s.containingSlot)return null;if(s.containingSlot)r=o(s.containingSlot);else for(r=s.parentNode;null==r?void 0:r._$inheritSlots;)r=r.parentNode}else r=s.parentNode;if(!r)return null;s=r}};let s=e;for(;;){const e=o(s);if(!e)break;s=e}};if(this._$capturePhase&&!i.stopped&&!s){const t=[];r(e,((e,n,o)=>{t.push([e,n,o])}));for(let e=t.length-1;e>=0;e-=1){const[n,o,s]=t[e];if(n._$eventTarget&&(this.callListener(n,s,o,!0),i.stopped))break}}if(!i.stopped&&t&&y(e)&&e._$external&&e.shadowRoot.handleEvent(t,this),!i.stopped&&!s){let t=!0;r(e,((e,n,s)=>{if(!t&&y(e)&&e._$external){const t=e.shadowRoot;t.handleEvent(t.slot,this)}return t=!1,e._$eventTarget&&this.callListener(e,s,n,!1),o&&!i.stopped}))}}static dispatchEvent(e,t){return t.dispatch(e)}static dispatchExternalEvent(e,t,n){return n.dispatch(e,t)}static triggerEvent(t,n,o,s){const i=new e(n,o,s);e.dispatchEvent(t,i)}static triggerExternalEvent(t,n,o,s,i){const r=new e(o,s,i);e.dispatchExternalEvent(t,n,r)}};var Le;!function(e){e[e.Child=0]="Child",e[e.Descendant=1]="Descendant",e[e.CrossShadowDescendant=2]="CrossShadowDescendant"}(Le||(Le={}));const Ae=e=>{var t;return null===(t=e.ownerShadowRoot)||void 0===t?void 0:t.getHostNode().getRootBehavior().ownerSpace};class De{static _$parseSegment(e,t){const n=/^(#[_a-zA-Z][-_a-zA-Z0-9:]*|)((?:\.-?[_a-zA-Z][-_a-zA-Z0-9]*)+|)$/.exec(e);if(!n)return null;const o=n[1].slice(1),s=n[2].split(".");return s.shift(),o||s.length?{id:o,classes:s,relation:t}:null}constructor(e){this.unions=[];const t=String(e||"").split(",");for(let e=0;e<t.length;e+=1){const n=t[e].split(/( |\t|>+)/g),o=[];let s=1,i=0;for(;i<n.length;i+=1){const e=n[i];if(!e||" "===e||"\t"===e||">>"===e)continue;if(">"===e[0]){if(1!==s)break;s=3===e.length?2:0;continue}const t=De._$parseSegment(e,s);if(s=1,!t)break;o.push(t)}i===n.length&&(o.length&&this.unions.push(o))}}isEmpty(){return 0===this.unions.length}static _$testSelectorSegment(e,t,n,o,s,i){var r;if(n===e)return!1;const l=o[s];let a=!0;(Ae(n)!==t||l.id&&l.id!==n.id)&&(a=!1);const d=l.classes;for(let e=0;a&&e<d.length;e+=1)(null===(r=n.classList)||void 0===r?void 0:r.contains(d[e]))||(a=!1);if(!a&&0===i)return!1;let c=n;if(a&&0===s){if(null===e)return!0;for(c=c.parentNode;c;c=c.parentNode)if(c===e)return!0;if(2!==i)return!1;c=n,a=!1}const h=a?l.relation:i;do{c.parentNode?c=c.parentNode:2===h?c=S(c)?c.getHostNode():null:2===i?(a=!1,c=S(c)?c.getHostNode():null):c=null,c===e&&(c=null)}while(b(c));if(!c)return!1;if(a){if(De._$testSelectorSegment(e,t,c,o,s-1,h))return!0;if(2!==i)return!1}return De._$testSelectorSegment(e,t,c,o,s,i)}testSelector(e,t){if(b(t))return!1;const n=this.unions;let o;if(o=null!==e&&Ae(e)||Ae(t),void 0===o)return!1;for(let s=0;s<n.length;s+=1){const i=n[s];if(De._$testSelectorSegment(e,o,t,i,i.length-1,0))return!0}return!1}query(e,t){const n=[],o=(e,t,s)=>{if(this.testSelector(e,t)){if(s)return t;n.push(t)}if(y(t)){const n=t.getShadowRoot();if(n){const t=o(e,n,s);if(t&&s)return t}}const i=t.childNodes;for(let t=0;t<i.length;t+=1){const n=i[t];if(m(n)){const t=o(e,n,s);if(t&&s)return t}}return null},s=o(e,e,t);return t?s:n}}var Te;exports.StyleSegmentIndex=void 0,(Te=exports.StyleSegmentIndex||(exports.StyleSegmentIndex={}))[Te.MAIN=0]="MAIN",Te[Te.TEMPLATE_EXTRA=1]="TEMPLATE_EXTRA",Te[Te.ANIMATION_EXTRA=2]="ANIMATION_EXTRA",Te[Te.TEMP_EXTRA=3]="TEMP_EXTRA";const Ie={mode:1,destroyed:!0},Be={mode:2,destroyed:!0},Re={mode:3,destroyed:!0};class Pe{constructor(){throw new Error("Element cannot be constructed directly")}_$initialize(e,t,n,o){this._$backendElement=t,this._$destroyOnDetach=!1,this._$nodeTreeContext=o,this._$nodeId="",this._$nodeAttributes=null,this._$nodeSlot="",this._$slotName=null,this._$slotElement=null,this._$slotValues=null,this._$subtreeSlotStart=null,this._$subtreeSlotEnd=null,this._$inheritSlots=!1,this._$placeholderHandlerRemover=void 0,this._$virtual=e,this.dataset={},this._$marks=null,this._$attached=!1,this.classList=null,this._$styleSegments=[],this.parentNode=null,this.parentIndex=-1,this.childNodes=[],this.slotNodes=void 0,this.ownerShadowRoot=n,this._$mutationObserverTarget=null,this._$eventTarget=new Oe}get $$(){return this._$backendElement}get id(){return this._$nodeId}set id(e){var t;const n=String(e);if(this._$nodeId!==n){if(this._$nodeId=n,this.ownerShadowRoot){const e=this.ownerShadowRoot.getHostNode();if(this.ownerShadowRoot._$markIdCacheDirty(),e.getComponentOptions().writeIdToDOM){const t=e._$idPrefix,o=t?`${t}--${n}`:n,s=this._$backendElement;s&&(3===this.getBackendMode()?s.id=o:s.setId(o))}}i.writeExtraInfoToAttr&&(null===(t=this._$backendElement)||void 0===t||t.setAttribute("exparser:info-attr-id",n)),this._$mutationObserverTarget&&ae.callAttrObservers(this,{type:"properties",target:this,attributeName:"id"})}}get slot(){return this._$nodeSlot}set slot(e){const t=String(e);if(this._$nodeSlot===t)return;if(this._$inheritSlots)throw new Error('slots-inherited nodes do not support "slot" attribute.');this._$nodeSlot=t;const n=Pe._$getParentHostShadowRoot(this.parentNode);if(n){const e=n.getSlotMode();if(3===e)throw new Error("nodes inside dynamic slots should change binding slots through Element#setSlotElement.");if(0===e)throw new Error("nodes inside direct slots should not change slot name.");const t=Pe._$updateSubtreeSlotNodes(this.parentNode,[this],n,n,this.parentIndex);null==t||t.removeSlotNodes();const o=this.containingSlot;null==t||t.updateContainingSlot();const s=this.containingSlot;Pe.insertChildReassign(this.parentNode,this,o,s,this.parentIndex+1),null==t||t.insertSlotNodes()}this._$mutationObserverTarget&&ae.callAttrObservers(this,{type:"properties",target:this,attributeName:"slot"})}get attributes(){const e=[];return this._$nodeAttributes&&Object.entries(this._$nodeAttributes).forEach((([t,n])=>{e.push({name:t,value:n})})),e}get class(){return this.classList?this.classList.getClassNames(0):""}set class(e){this.setNodeClass(e,0)}get style(){return this._$styleSegments[0]||""}set style(e){this.setNodeStyle(e,0)}asTextNode(){return null}asElement(){return this}asNativeNode(){return v(this)?this:null}asVirtualNode(){return b(this)?this:null}asInstanceOf(e){return y(this)?this.asInstanceOf(e):null}getBackendContext(){const e=this._$nodeTreeContext;return e===Ie||e===Be||e===Re?null:e}getBackendMode(){return this._$nodeTreeContext.mode}getBackendElement(){return this._$backendElement}destroyBackendElement(){this._$backendElement&&(3!==this.getBackendMode()&&this._$backendElement.release(),this._$backendElement=null),2===this.getBackendMode()?this._$nodeTreeContext=Be:3===this.getBackendMode()?this._$nodeTreeContext=Re:this._$nodeTreeContext=Ie}destroyBackendElementOnDetach(){this._$destroyOnDetach=!0}cancelDestroyBackendElementOnDetach(){this._$destroyOnDetach=!1}isVirtual(){return this._$virtual}setNodeClass(e,t=0){var n;(null===(n=this.classList)||void 0===n?void 0:n.setClassNames(e,t))&&this._$mutationObserverTarget&&ae.callAttrObservers(this,{type:"properties",target:this,attributeName:"class"})}toggleNodeClass(e,t,n=0){var o;(null===(o=this.classList)||void 0===o?void 0:o.toggle(e,t,n))&&this._$mutationObserverTarget&&ae.callAttrObservers(this,{type:"properties",target:this,attributeName:"class"})}setNodeStyle(e,t=0){if(this._$styleSegments[t]===e)return;this._$styleSegments[t]=e;const n=this._$styleSegments.join(";");this._$backendElement&&(3===this.getBackendMode()?this._$backendElement.setAttribute("style",n):this._$backendElement.setStyle(n)),this._$mutationObserverTarget&&ae.callAttrObservers(this,{type:"properties",target:this,attributeName:"style"})}static checkAndCallAttached(e){!function e(t){if(m(t)&&!t._$attached){if(t._$attached=!0,y(t)){t.triggerLifetime("attached",[]),t._$relation&&(t._$relation.triggerLinkEvent(2,!1),t._$relation.triggerLinkEvent(4,!1),t._$relation.triggerLinkEvent(0,!1)),t._$mutationObserverTarget&&ae.callAttachObservers(t,{type:"attachStatus",target:t,status:"attached"});const n=t.getShadowRoot();n&&e(n)}const n=t.childNodes;for(let t=0;t<n.length;t+=1)e(n[t])}}(e)}static checkAndCallDetached(e){const t=[];!function e(n){if(n._$destroyOnDetach&&t.push(n),m(n)&&n._$attached)if(y(n)&&n.triggerLifetime("beforeDetach",[]),n.childNodes.forEach(e),y(n)){const t=n._$placeholderHandlerRemover;t&&t();const o=n.getShadowRoot();o&&e(o),n._$attached=!1,n.triggerLifetime("detached",[]),n._$relation&&(n._$relation.triggerLinkEvent(2,!0),n._$relation.triggerLinkEvent(4,!0),n._$relation.triggerLinkEvent(0,!0)),n._$mutationObserverTarget&&ae.callAttachObservers(n,{type:"attachStatus",target:n,status:"detached"})}else n._$attached=!1}(e);for(let e=0;e<t.length;e+=1)t[e].destroyBackendElement()}static checkAndCallMoved(e){!function e(t){if(m(t)&&t._$attached&&(t.childNodes.forEach(e),y(t))){const n=t.getShadowRoot();n&&e(n),t.triggerLifetime("moved",[]),t._$relation&&(t._$relation.triggerLinkEvent(2,!1),t._$relation.triggerLinkEvent(4,!1),t._$relation.triggerLinkEvent(0,!1))}}(e)}static checkChildObservers(e,t,n){var o;const s=e._$mutationObserverTarget;if(s&&(!(null===(o=s.childObservers)||void 0===o?void 0:o.empty)||s.hasSubtreeListeners())){const o=[n];let s;s="add"===t?{type:"childList",target:e,addedNodes:o}:"remove"===t?{type:"childList",target:e,removedNodes:o}:{type:"childList",target:e,addedNodes:o,removedNodes:o},ae.callChildObservers(e,s)}}static hasSubtreeMutationObservers(e){var t;return(null===(t=e._$mutationObserverTarget)||void 0===t?void 0:t.hasSubtreeListeners())||!1}static _$insertChildReassignSlot(e,t,n,o){if(n)if(o){const e=[...n.slotNodes];for(let t=0;t<e.length;t+=1){const s=e[t];Pe._$spliceSlotNodes(n,0,1,void 0),Pe._$spliceSlotNodes(o,-1,0,[s]),Pe._$updateContainingSlot(s,o),s._$inheritSlots||Pe.insertChildReassign(s.parentNode,s,n,o,s.parentIndex)}}else{const e=[...n.slotNodes];for(let t=0;t<e.length;t+=1){const s=e[t];Pe._$spliceSlotNodes(n,0,1,void 0),Pe._$updateContainingSlot(s,o),s._$inheritSlots||Pe.insertChildReassign(s.parentNode,s,n,null,s.parentIndex)}}else{const n=[];e.forEachNodeInSpecifiedSlot(null,(e=>{if(null!==t){if((m(e)?e._$nodeSlot:"")!==t)return}n.push(e)}));for(let e=0;e<n.length;e+=1){const t=n[e];Pe._$spliceSlotNodes(o,-1,0,[t]),Pe._$updateContainingSlot(t,o),t._$inheritSlots||Pe.insertChildReassign(t.parentNode,t,null,o,t.parentIndex)}}}static insertChildReassign(e,t,n,o,s){if(1!==e.getBackendMode()){if(n)if(o&&3===e.getBackendMode());else{const o=Pe.findNearestNonVirtual(n);if(o){const n=Pe.countNonVirtual(t);if(n){const[t,s]=n;if(3===e.getBackendMode()){const e=t._$backendElement;for(let t=1;t<s;t+=1){const t=e.nextSibling;t&&o.removeChild(t)}s>0&&o.removeChild(e)}else o.spliceRemove(t._$backendElement,s)}}}o&&Pe.insertChildComposed(e,t,void 0,!1,s)}else t._$backendElement.reassignContainingSlot(n?n._$backendElement:null,o?o._$backendElement:null)}static findNearestNonVirtual(e){let t=e;for(;null==t?void 0:t._$virtual;)t=S(t)?t.getHostNode():void 0===t.containingSlot?t.parentNode:t.containingSlot;return t?t._$backendElement:null}static countNonVirtual(e){let t=null,n=0;const o=e=>{0===n&&(t=e),n+=1};var s;return m(s=e)&&s._$virtual?s.forEachNonVirtualComposedChild(o):o(s),t?[t,n]:null}static forEachNodeInSlot(e,t){const n=e=>{if(!1===t(e,e.containingSlot))return!1;if(e._$inheritSlots){const t=e.childNodes;for(let e=0;e<t.length;e+=1)if(!n(t[e]))return!1;return!0}return!0};return n(e)}static forEachNodeInSpecificSlot(e,t,n){const o=e=>{if(e.containingSlot===t&&!1===n(e))return!1;if(e._$inheritSlots){const t=e.childNodes;for(let e=0;e<t.length;e+=1)if(!o(t[e]))return!1;return!0}return!0};return o(e)}static forEachSlotContentInSlot(e,t){const n=e=>{if(e._$inheritSlots){const t=e.childNodes;for(let e=0;e<t.length;e+=1)if(!n(t[e]))return!1;return!0}return!1!==t(e,e.containingSlot)};return n(e)}static forEachSlotContentInSpecificSlot(e,t,n){const o=e=>{if(e._$inheritSlots){const t=e.childNodes;for(let e=0;e<t.length;e+=1)if(!o(t[e]))return!1;return!0}return e.containingSlot!==t||!1!==n(e)};return o(e)}static _$findFirstNonVirtualChild(e,t){const n=null!==e._$slotName,o=n?e.slotNodes:e.childNodes;if(t>=0&&t<o.length)for(let e=t;e<o.length;e+=1){let t=null;const s=e=>(t=e,!1),i=e=>{if(!n&&e._$inheritSlots){const t=e.childNodes;for(let e=0;e<t.length;e+=1)if(!1===i(t[e]))return!1}return e._$virtual?e.forEachNonVirtualComposedChild(s):s(e)};if(i(o[e]),t)return t}const s=e=>{if(!e._$virtual)return null;const t=e.containingSlot;if(null===t)return null;if(void 0!==t)return Pe._$findFirstNonVirtualChild(t,e.slotIndex+1);if(S(e))return s(e.getHostNode());const n=e.parentNode;return n?Pe._$findFirstNonVirtualChild(n,e.parentIndex+1):null};return s(e)}static _$findFirstNonVirtualSibling(e,t){const n=e.containingSlot;if(null===n)return null;if(void 0!==n){if(!n._$virtual)return null;if(void 0!==e.slotIndex)return Pe._$findFirstNonVirtualChild(n,e.slotIndex+1);const o=Pe._$findSlotNodeInsertPosition(n,e,t);return Pe._$findFirstNonVirtualChild(n,o)}let o=e;if(S(e))return o=e.getHostNode(),o._$virtual?Pe._$findFirstNonVirtualChild(o,o.parentIndex+1):null;const s=o.parentNode;return s?Pe._$findFirstNonVirtualChild(s,t):null}static insertChildComposed(e,t,n,o,s){var r,l,a;let d=!1,c=e;for(;null==c?void 0:c._$inheritSlots;)d=!0,c=c.parentNode;if(!c)return;const h=c,u=h._$nodeTreeContext;if(u.destroyed)return;let p;y(h)?h._$external?p=h.shadowRoot.slot:d=!0:(h._$virtual&&(d=!0),p=Pe.findNearestNonVirtual(h));let f=null;const $=(i,r)=>{const l=i||(r?Pe.findNearestNonVirtual(r):null);if(3!==e.getBackendMode()&&!l)return;let a=0,c=null,h=null,p=null;if(t){const e=f||(3===u.mode?u.document.createDocumentFragment():u.createFragment());f=e;const n=t=>{e.appendChild(t._$backendElement),h=e};Pe.forEachNodeInSpecificSlot(t,r,(e=>{p||(p=e),e._$virtual?e.forEachNonVirtualComposedChild(n):n(e)}))}if(3!==e.getBackendMode()||l){if((n||d)&&(o&&n?(Pe.forEachSlotContentInSpecificSlot(n,r,(e=>{if(m(e)){const t=Pe.countNonVirtual(e);t&&(c||(c=t[0]),a+=t[1])}else c||(c=e),a+=1;return!0})),0===a&&h&&p&&(c=Pe._$findFirstNonVirtualSibling(void 0===r?t:p,s+1))):h&&p&&(c=Pe._$findFirstNonVirtualSibling(void 0===r?t:p,s))),h)if(c)if(3===u.mode){const e=c._$backendElement;l.insertBefore(h,e);for(let t=1;t<a;t+=1){const t=e.nextSibling;t&&l.removeChild(t)}a>0&&l.removeChild(e)}else l.spliceBefore(c._$backendElement,a,h);else 3===u.mode?l.appendChild(h):l.spliceAppend(h);else if(a>0)if(3===u.mode){const e=c._$backendElement;for(let t=1;t<a;t+=1){const t=e.nextSibling;t&&l.removeChild(t)}a>0&&l.removeChild(e)}else l.spliceRemove(c._$backendElement,a)}else f=null};if(void 0!==p)null===p||(d||m(t)&&t._$virtual||m(n)&&n._$virtual?$(p,void 0):o?t?p.replaceChild(t._$backendElement,n._$backendElement):p.removeChild(n._$backendElement):n?p.insertBefore(t._$backendElement,n._$backendElement):p.appendChild(t._$backendElement));else if(t&&t._$inheritSlots||o&&n&&n._$inheritSlots){const e=new Set;o&&n&&Pe.forEachSlotContentInSlot(n,((t,n)=>{e.add(n)})),t&&Pe.forEachSlotContentInSlot(t,((t,n)=>{e.add(n)})),e.forEach((e=>$(null,e)))}else t&&$(null,t.containingSlot),!o||!n||t&&n.containingSlot===t.containingSlot||$(null,n.containingSlot);3!==u.mode&&f&&f.release(),i.writeExtraInfoToAttr&&(o&&m(n)&&(null===(r=n._$backendElement)||void 0===r||r.removeAttribute("exparser:info-in-slot-of")),m(t)&&(y(e)?null===(l=t._$backendElement)||void 0===l||l.setAttribute("exparser:info-in-slot-of",e._$componentInstanceId):null===(a=t._$backendElement)||void 0===a||a.removeAttribute("exparser:info-in-slot-of")))}static _$updateSubtreeSlotsInsertion(e,t,n,o,s){if(!t||!n)return;let i=e,r=null,l=null;const a=(e,t)=>{if(e._$subtreeSlotStart){const n=e.childNodes;let o=t+1,s=n[o];for(;s&&!s._$subtreeSlotStart;)o+=1,s=n[o];return void(s?(l=s._$subtreeSlotStart,r=l.prev):(r=e._$subtreeSlotEnd,r&&(l=r.next)))}let n=e,o=e.parentNode;for(;o&&!o._$subtreeSlotStart;)n=o,o=o.parentNode;o&&a(o,n.parentIndex)};for(a(i,o),r&&(r.next=t,t.prev=r),l&&(l.prev=n,n.next=l);i;){let e=!1;if(i._$subtreeSlotStart?i._$subtreeSlotStart===l?(i._$subtreeSlotStart=t,e=!0):i._$subtreeSlotEnd===r&&(i._$subtreeSlotEnd=n,e=!0):(i._$subtreeSlotStart=t,i._$subtreeSlotEnd=n,e=!0),!e||!i.parentNode)break;i=i.parentNode}const d=i.ownerShadowRoot;(null==d?void 0:d.isConnected(i))&&d._$applySlotsInsertion(t,n,s)}static _$updateSubtreeSlotsRemoval(e,t,n,o){if(!t||!n)return;let s=e;const i=t.prev,r=n.next;for(i&&(i.next=r,t.prev=null),r&&(r.prev=i,n.next=null);s;){let e=!1;if(s._$subtreeSlotStart===t&&s._$subtreeSlotEnd===n&&(s._$subtreeSlotStart=s._$subtreeSlotEnd=null,e=!0),s._$subtreeSlotStart===t?(s._$subtreeSlotStart=r,e=!0):s._$subtreeSlotEnd===n&&(s._$subtreeSlotEnd=i,e=!0),!e||!s.parentNode)break;s=s.parentNode}const l=s.ownerShadowRoot;(null==l?void 0:l.isConnected(s))&&l._$applySlotsRemoval(t,n,o)}static _$updateSubtreeSlotsReplacement(e,t,n,o,s,i,r){if(!t||!n)return void Pe._$updateSubtreeSlotsRemoval(e,o,s,r);if(!o||!s)return void Pe._$updateSubtreeSlotsInsertion(e,t,n,i,r);let l=e;const a=o.prev,d=s.next;for(a&&(a.next=t,t.prev=a,o.prev=null),d&&(d.prev=n,n.next=d,s.next=null);l;){let e=!1;if(l._$subtreeSlotStart===o&&(l._$subtreeSlotStart=t,e=!0),l._$subtreeSlotEnd===s&&(l._$subtreeSlotEnd=n,e=!0),!e||!l.parentNode)break;l=l.parentNode}const c=l.ownerShadowRoot;(null==c?void 0:c.isConnected(l))&&(c._$applySlotsRemoval(o,s,!1),c._$applySlotsInsertion(t,n,r))}static _$updateSubtreeSlotNodes(e,t,n,o,s){if(!n&&!o)return;const i=null==n?void 0:n.getSlotMode(),r=null==o?void 0:o.getSlotMode();if(!(void 0!==i&&0!==i||void 0!==r&&0!==r))return;if(!(void 0!==i&&1!==i||void 0!==r&&1!==r)){let e=-1,i=0,r=-1;const l=[],a=t[0].containingSlot,d=null==n?void 0:n.getContainingSlot(t[0]);for(let n=0;n<t.length;n+=1){const o=t[n];Pe.forEachNodeInSlot(o,(t=>{a&&(i?i+=1:(e=t.slotIndex,i=1)),l.push(t)}))}if(d&&l.length){const e=l[0];r=Pe._$findSlotNodeInsertPosition(d,e,s)}return{updateContainingSlot:()=>{for(let e=l.length-1;e>=0;e-=1){const t=l[e];Pe._$updateContainingSlot(t,d)}},removeSlotNodes:()=>{o&&a&&i&&Pe._$spliceSlotNodes(a,e,i,void 0)},insertSlotNodes:()=>{n&&d&&l.length&&Pe._$spliceSlotNodes(d,r,0,l)}}}const l=new Map,a=new Map,d=[];for(let e=0;e<t.length;e+=1){const o=t[e];Pe.forEachNodeInSlot(o,((e,t)=>{const o=0!==i?null==n?void 0:n.getContainingSlot(e):void 0;if(t){const n=a.get(t);n?n.count+=1:a.set(t,{start:e.slotIndex,count:1})}if(o){const t=l.get(o);t?t.nodes.push(e):l.set(o,{nodes:[e],insertPos:-1})}d.push([e,o])}))}if(n&&l.size){const e=l.entries();for(let t=e.next();!t.done;t=e.next()){const[e,{nodes:n}]=t.value,o=n[0];t.value[1].insertPos=Pe._$findSlotNodeInsertPosition(e,o,s)}}return{updateContainingSlot:()=>{for(let e=d.length-1;e>=0;e-=1){const[t,n]=d[e];Pe._$updateContainingSlot(t,n)}},removeSlotNodes:()=>{if(o&&a.size){const e=a.entries();for(let t=e.next();!t.done;t=e.next()){const[e,{start:n,count:o}]=t.value;Pe._$spliceSlotNodes(e,n,o,void 0)}}},insertSlotNodes:()=>{if(n&&l.size){const e=l.entries();for(let t=e.next();!t.done;t=e.next()){const[e,{nodes:n,insertPos:o}]=t.value;Pe._$spliceSlotNodes(e,o,0,n)}}}}}static insertChildSingleOperation(e,t,n,o){var s,i,r,l,a;if(t&&e.ownerShadowRoot!==t.ownerShadowRoot)throw new Error("Cannot move the node from one shadow tree to another shadow tree.");let d=n;const c=d>=0?e.childNodes[d]:void 0;let h,u;if(h=!!o&&(!!c&&t!==c),!h&&!t)return;if(t){if(u=t.parentNode,u){const n=u.childNodes,o=t.parentIndex;n.splice(o,1);for(let e=o;e<n.length;e+=1)n[e].parentIndex=e;t.parentIndex=-1,u===e&&o<d&&(d-=1);const i=Pe._$updateSubtreeSlotNodes(e,[t],null,Pe._$getParentHostShadowRoot(u),d);null==i||i.removeSlotNodes(),3===e.getBackendMode()||(1===e.getBackendMode()?null===(s=u._$backendElement)||void 0===s||s.removeChild(t._$backendElement,o):Pe.insertChildComposed(u,null,t,!0,o)),null==i||i.updateContainingSlot()}t.parentNode=e,m(t)&&u!==e&&(u&&(null===(i=u._$mutationObserverTarget)||void 0===i||i.detachChild(t)),null===(r=e._$mutationObserverTarget)||void 0===r||r.attachChild(t))}else u=null;const p=Pe._$getParentHostShadowRoot(e),f=t?Pe._$updateSubtreeSlotNodes(e,[t],p,null,d):null,$=c&&h?Pe._$updateSubtreeSlotNodes(e,[c],null,p,d):null;if(null==f||f.updateContainingSlot(),null==$||$.removeSlotNodes(),1===e.getBackendMode()){if(e._$backendElement)if(h)t?e._$backendElement.replaceChild(t._$backendElement,c._$backendElement,d):e._$backendElement.removeChild(c._$backendElement,d);else{const n=e.childNodes[d];n?e._$backendElement.insertBefore(t._$backendElement,n._$backendElement,d):e._$backendElement.appendChild(t._$backendElement)}}else Pe.insertChildComposed(e,t,c,h,d);null==f||f.insertSlotNodes(),null==$||$.updateContainingSlot(),h&&c&&(m(c)&&(null===(l=e._$mutationObserverTarget)||void 0===l||l.detachChild(c)),c.parentNode=null,c.parentIndex=-1);const _=e.childNodes;if(t)if(d<0)_.push(t),t.parentIndex=_.length-1;else if(h)_[d]=t,t.parentIndex=d;else{_.splice(d,0,t);for(let e=d;e<_.length;e+=1)_[e].parentIndex=e}else if(h){_.splice(d,1);for(let e=d;e<_.length;e+=1)_[e].parentIndex=e}const g=t?t._$subtreeSlotStart:null,v=t?t._$subtreeSlotEnd:null,b=c?c._$subtreeSlotStart:null,S=c?c._$subtreeSlotEnd:null;t?(u&&Pe._$updateSubtreeSlotsRemoval(u,g,v,!0),h?Pe._$updateSubtreeSlotsReplacement(e,g,v,b,S,d,!!u):Pe._$updateSubtreeSlotsInsertion(e,g,v,d,!!u)):h&&c&&Pe._$updateSubtreeSlotsRemoval(e,b,S,!1),null===(a=e.ownerShadowRoot)||void 0===a||a._$markIdCacheDirty(),h&&(Pe.checkAndCallDetached(c),Pe.checkChildObservers(e,"remove",c)),t&&((null==u?void 0:u._$attached)?e._$attached?Pe.checkAndCallMoved(t):Pe.checkAndCallDetached(t):e._$attached&&Pe.checkAndCallAttached(t),u===e?Pe.checkChildObservers(e,"move",t):(u&&Pe.checkChildObservers(u,"remove",t),Pe.checkChildObservers(e,"add",t)))}static insertChildBatchRemoval(e,t,n){var o,s;const i=e.childNodes[t];let r=e;for(;null==r?void 0:r._$inheritSlots;)r=r.parentNode;const l=y(r)&&!r._$external?r.shadowRoot:null,a=e.childNodes,d=a.splice(t,n);for(let e=t;e<a.length;e+=1)a[e].parentIndex=e;const c=Pe._$updateSubtreeSlotNodes(e,d,null,l,t);if(null==c||c.removeSlotNodes(),1===e.getBackendMode())e._$backendElement&&e._$backendElement.spliceRemove(i._$backendElement,n);else for(let t=n-1;t>=0;t-=1)Pe.insertChildComposed(e,null,d[t],!0,t);for(let t=0;t<n;t+=1){const n=d[t];n.parentNode=null,n.parentIndex=-1,m(n)&&(null===(o=e._$mutationObserverTarget)||void 0===o||o.detachChild(n))}null==c||c.updateContainingSlot();let h=null,u=null;for(let e=0;e<n;e+=1){const t=d[e];h||(h=t._$subtreeSlotStart),t._$subtreeSlotEnd&&(u=t._$subtreeSlotEnd)}Pe._$updateSubtreeSlotsRemoval(e,h,u,!1),null===(s=e.ownerShadowRoot)||void 0===s||s._$markIdCacheDirty();for(let t=0;t<n;t+=1){const n=d[t];Pe.checkAndCallDetached(n),Pe.checkChildObservers(e,"remove",n)}}static insertChildBatchInsertion(e,t,n){var o,s;const i=n>=0?e.childNodes[n]:void 0;let r=e;for(;null==r?void 0:r._$inheritSlots;)r=r.parentNode;const l=y(r)&&!r._$external?r.shadowRoot:null;let a;if(1===e.getBackendMode()&&t.length>=5){a=e.getBackendContext().createFragment()}else a=null;for(let n=0;n<t.length;n+=1){const s=t[n];if(e.ownerShadowRoot!==s.ownerShadowRoot)throw new Error("Cannot move the node from one shadow tree to another shadow tree.");if(s.parentNode)throw new Error("Cannot batch-insert the node which already has a parent.");if(s.parentNode=e,m(s)&&(null===(o=e._$mutationObserverTarget)||void 0===o||o.attachChild(s)),1===e.getBackendMode()&&a){const e=s._$backendElement;a.appendChild(e)}}const d=Pe._$updateSubtreeSlotNodes(e,t,l,null,n);if(null==d||d.updateContainingSlot(),1===e.getBackendMode()){if(e._$backendElement)if(a)i?e._$backendElement.spliceBefore(i._$backendElement,0,a):e._$backendElement.spliceAppend(a),a.release();else if(i)for(let n=0;n<t.length;n+=1){const o=t[n];e._$backendElement.insertBefore(o._$backendElement,i._$backendElement)}else for(let n=0;n<t.length;n+=1){const o=t[n];e._$backendElement.appendChild(o._$backendElement)}}else{const o=n>=0?n:e.childNodes.length;for(let n=0;n<t.length;n+=1){const s=t[n];Pe.insertChildComposed(e,s,i,!1,o)}}null==d||d.insertSlotNodes();const c=e.childNodes;if(i){c.splice(n,0,...t);for(let e=n;e<c.length;e+=1)c[e].parentIndex=e}else{c.push(...t);for(let e=c.length-t.length;e<c.length;e+=1)c[e].parentIndex=e}let h=null,u=null;for(let e=0;e<t.length;e+=1){const n=t[e],o=n._$subtreeSlotStart,s=n._$subtreeSlotEnd;o&&(u?(o.prev=u,u.next=o,u=s):(h=o,u=s))}Pe._$updateSubtreeSlotsInsertion(e,h,u,n+t.length-1,!1),null===(s=e.ownerShadowRoot)||void 0===s||s._$markIdCacheDirty();for(let n=0;n<t.length;n+=1){const o=t[n];e._$attached&&Pe.checkAndCallAttached(o),Pe.checkChildObservers(e,"add",o)}}static insertChildPlaceholderReplace(e,t,n){var o,s,i,r,l,a;if(n&&e.ownerShadowRoot!==n.ownerShadowRoot)throw new Error("Cannot move the node from one shadow tree to another shadow tree.");if(n.parentNode)throw new Error("Cannot replace with the node which already has a parent.");const d=e.childNodes[t];if(!m(d))throw new Error("Cannot replace on text nodes.");if(null!==d._$slotName||null!==n._$slotName)throw new Error("Cannot replace on slot nodes.");if(d===n)return;let c;if(1===e.getBackendMode()){c=e.getBackendContext().createFragment()}else c=null;const h=d.childNodes;if(1===e.getBackendMode()&&h.length>0){const e=d._$backendElement;e&&e.spliceRemove(h[0]._$backendElement,h.length)}for(let t=0;t<h.length;t+=1){const i=h[t];if(3===e.getBackendMode());else if(1===e.getBackendMode()){const e=i._$backendElement;c.appendChild(e)}else Pe.insertChildComposed(d,null,i,!0,t);i.parentNode=n,m(i)&&(null===(o=d._$mutationObserverTarget)||void 0===o||o.detachChild(i),null===(s=e._$mutationObserverTarget)||void 0===s||s.attachChild(i))}d.childNodes=[],d.parentNode=null,d.parentIndex=-1,n.parentNode=e;const u=d.containingSlot,p=d.slotIndex;void 0!==u&&(Pe._$updateContainingSlot(n,u),u&&Pe._$spliceSlotNodes(u,p,1,void 0));const f=h.length?Pe._$updateSubtreeSlotNodes(n,h,Pe._$getParentHostShadowRoot(n),Pe._$getParentHostShadowRoot(d),0):null;if(null==f||f.updateContainingSlot(),null==f||f.removeSlotNodes(),e.childNodes[t]=n,n.parentIndex=t,1===e.getBackendMode())e._$backendElement&&(e._$backendElement.replaceChild(n._$backendElement,d._$backendElement,t),null===(i=n._$backendElement)||void 0===i||i.spliceAppend(c)),c.release();else{Pe.insertChildComposed(e,n,d,!0,t);for(let e=0;e<h.length;e+=1){const t=h[e];Pe.insertChildComposed(n,t,void 0,!1,e)}}null==f||f.insertSlotNodes(),void 0!==u&&(Pe._$updateContainingSlot(d,void 0),u&&Pe._$spliceSlotNodes(u,p,0,[n])),n._$subtreeSlotStart=d._$subtreeSlotStart,n._$subtreeSlotEnd=d._$subtreeSlotEnd,null===(r=e._$mutationObserverTarget)||void 0===r||r.detachChild(d),null===(l=e._$mutationObserverTarget)||void 0===l||l.attachChild(n),n.childNodes.push(...h);for(let e=n.childNodes.length-h.length;e<n.childNodes.length;e+=1)n.childNodes[e].parentIndex=e;if(null===(a=e.ownerShadowRoot)||void 0===a||a._$markIdCacheDirty(),e._$attached){Pe.checkAndCallDetached(d),Pe.checkChildObservers(e,"remove",d),Pe.checkAndCallAttached(n),Pe.checkChildObservers(e,"add",n);for(let t=0;t<h.length;t+=1){const n=h[t];Pe.checkAndCallMoved(n),Pe.checkChildObservers(e,"move",n)}}}appendChild(e){Pe.insertChildSingleOperation(this,e,this.childNodes.length,!1)}insertChildAt(e,t){Pe.insertChildSingleOperation(this,e,t,!1)}insertBefore(e,t){const n=t?t.parentIndex:-1;Pe.insertChildSingleOperation(this,e,n,!1)}removeChildAt(e){Pe.insertChildSingleOperation(this,null,e,!0)}removeChild(e){const t=e.parentIndex;Pe.insertChildSingleOperation(this,null,t,!0)}replaceChildAt(e,t){Pe.insertChildSingleOperation(this,e,t,!0)}replaceChild(e,t){const n=t.parentIndex;Pe.insertChildSingleOperation(this,e,n,!0)}insertChildren(e,t){Pe.insertChildBatchInsertion(this,e,t)}removeChildren(e,t){Pe.insertChildBatchRemoval(this,e,t)}selfReplaceWith(e){const t=this.parentNode;t&&Pe.insertChildPlaceholderReplace(t,this.parentIndex,e)}static _$generateIdMap(e){const t=Object.create(null);return function e(n){if(m(n)){const o=n._$nodeId;o&&(t[o]||(t[o]=n)),n.childNodes.forEach(e)}}(e),t}triggerEvent(e,t,n){Me.triggerEvent(this,e,t,n)}dispatchEvent(e){Me.dispatchEvent(this,e)}_$setListenerStats(e,t,n={}){if(!this._$backendElement)return;const o=!!n.capture||!!n.useCapture;let s;switch(t){case 2:s=0;break;case 4:s=1;break;case 3:s=2;break;default:return}this._$nodeTreeContext&&(3===this.getBackendMode()?this._$nodeTreeContext.setListenerStats(this._$backendElement,e,o,s):this._$backendElement.setListenerStats(e,o,s))}addListener(e,t,n){const o=this._$eventTarget.addListener(e,t,n);this._$setListenerStats(e,o,n),y(this)&&this._$definition._$options.listenerChangeLifetimes&&this.triggerLifetime("listenerChange",[!0,e,t,n])}removeListener(e,t,n){const o=this._$eventTarget.removeListener(e,t,n);1!==o&&(this._$setListenerStats(e,o,n),y(this)&&this._$definition._$options.listenerChangeLifetimes&&this.triggerLifetime("listenerChange",[!1,e,t,n]))}getAttribute(e){return this._$nodeAttributes&&Object.prototype.hasOwnProperty.call(this._$nodeAttributes,e)?this._$nodeAttributes[e]:null}updateAttribute(e,t){this.setAttribute(e,t)}setAttribute(e,t){let n;this._$nodeAttributes?n=this._$nodeAttributes:(n=Object.create(null),this._$nodeAttributes=n),n[e]=t;const o=this._$backendElement;o&&(3===this.getBackendMode()?!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t||null==t?"":String(t)):o.setAttribute(e,t))}removeAttribute(e){this._$nodeAttributes&&delete this._$nodeAttributes[e];const t=this._$backendElement;t&&t.removeAttribute(e)}setDataset(e,t){this.dataset[e]=t,1===this.getBackendMode()&&this._$backendElement.setDataset(e,t)}setMark(e,t){if(this._$marks)this._$marks[e]=t;else{const n={};n[e]=t,this._$marks=n}}collectMarks(){const e={};let t;for(t=this;t;t=t.parentNode){const n=t._$marks;n&&Object.keys(n).forEach((t=>{Object.prototype.hasOwnProperty.call(e,t)||(e[t]=n[t])}))}return e}static replaceDocumentElement(e,t,n){if(e._$attached)throw new Error("An attached element cannot be attached again");e._$backendElement&&t.replaceChild(e._$backendElement,n),Pe.checkAndCallAttached(e)}static pretendAttached(e){e._$attached||Pe.checkAndCallAttached(e)}static pretendDetached(e){e._$attached&&Pe.checkAndCallDetached(e)}static isAttached(e){return e._$attached}static setSlotName(e,t){var n;if(e._$inheritSlots)throw new Error("Slot-inherit mode is not usable in slot element");const o=t?String(t):"",s=e._$slotName;if(s===o)return;const i=null===s;e._$slotName=o,i&&(e._$subtreeSlotStart=e._$subtreeSlotEnd={value:e,prev:null,next:null}),1===e.getBackendMode()&&(null===(n=e._$backendElement)||void 0===n||n.setSlotName(o));const r=e.ownerShadowRoot;if(r)if(i){3===r.getSlotMode()&&(e._$slotValues=Object.create(null)),e.slotNodes=[];const t=e.parentNode;t&&Pe._$updateSubtreeSlotsInsertion(t,e._$subtreeSlotStart,e._$subtreeSlotEnd,e.parentIndex,!1)}else r.isConnected(e)&&r._$applySlotRename(e,o,s)}static getSlotName(e){const t=e._$slotName;return null===t?void 0:t}static setInheritSlots(e){if(!e._$virtual)throw new Error("Cannot set slot-inherit on non-virtual node");if(null!==e._$slotName||0!==e.childNodes.length)throw new Error("Slot-inherit mode cannot be set when the element has any child node");if(1===e.getBackendMode()){const t=e._$backendElement;t&&t.setInheritSlots()}e._$inheritSlots=!0}static getInheritSlots(e){return e._$inheritSlots}isInheritSlots(){return this._$inheritSlots}static setSlotElement(e,t){if(e._$slotElement===t)return;e._$slotElement=t;const n=Pe._$getParentHostShadowRoot(e.parentNode);if(n){const t=Pe._$updateSubtreeSlotNodes(e.parentNode,[e],n,n,e.parentIndex),o=e.containingSlot;null==t||t.updateContainingSlot(),null==t||t.removeSlotNodes();const s=e.containingSlot,i=e=>{if(m(e)&&e._$inheritSlots)for(let t=0;t<e.childNodes.length;t+=1)i(e.childNodes[t]);else Pe.insertChildReassign(e.parentNode,e,o,s,e.parentIndex)};i(e),null==t||t.insertSlotNodes()}}static _$updateContainingSlot(e,t){var n;e.containingSlot=t,1===(null===(n=e.ownerShadowRoot)||void 0===n?void 0:n.getBackendMode())&&e._$backendElement.setContainingSlot(t?t._$backendElement:t)}static _$spliceSlotNodes(e,t,n,o){const s=e.slotNodes=e.slotNodes||[],i=t>=0&&t<s.length;if(null==o?void 0:o.length)if(i){for(let e=t;e<t+n;e+=1)s[e].slotIndex=void 0;s.splice(t,n,...o);for(let e=t;e<s.length;e+=1)s[e].slotIndex=e}else{const e=s.length;s.push(...o);for(let t=e;t<s.length;t+=1)s[t].slotIndex=t}else if(n){for(let e=t;e<t+n;e+=1)s[e].slotIndex=void 0;s.splice(t,n);for(let e=t;e<s.length;e+=1)s[e].slotIndex=e}if(1===e.getBackendMode())if(null==o?void 0:o.length){const s=e._$nodeTreeContext.createFragment();for(let e=0;e<o.length;e+=1)s.appendChild(o[e]._$backendElement);i?e._$backendElement.spliceBeforeSlotNodes(t,n,s):e._$backendElement.spliceAppendSlotNodes(s),s.release()}else n&&e._$backendElement.spliceRemoveSlotNodes(t,n)}static _$findSlotNodeInsertPosition(e,t,n){const o=e.ownerShadowRoot.getHostNode(),s=e=>{let t=0,n=e;for(;n&&n!==o;)t+=1,n=n.parentNode;return t},i=s(t),r=(e,t,n,o,s,i,l)=>{if(e===o)return 0;if(e.parentNode===o.parentNode)return t-(-1===s?l:s);if(i<n){const t=e.parentNode;return r(t,t.parentIndex,n-1,o,s,i,l)}const a=n<i?e:e.parentNode,d=n<i?n:n-1,c=o.parentNode,h=i-1,u=r(a,a.parentIndex,d,c,c.parentIndex,h,l);return 0===u?-1:u},l=e.slotNodes;let a=l.length-1;for(;a>=0;a-=1){const e=l[a];if(r(e,e.parentIndex,s(e),t,t.parentIndex,i,n>=0?n-.5:l.length)<0)break}return a+1}getComposedParent(){if(S(this))return this.getHostNode();if(void 0!==this.containingSlot)return this.containingSlot;let e=this.parentNode;for(;null==e?void 0:e._$inheritSlots;)e=e.parentNode;return e}getComposedChildren(){const e=[];return this.forEachComposedChild((t=>{e.push(t)})),e}forEachComposedChild(e){if(this._$inheritSlots)return!0;if(y(this)&&!this._$external)return!1!==e(this.shadowRoot);if(null!==this._$slotName){const t=this.ownerShadowRoot;return!t||t.forEachNodeInSpecifiedSlot(this,e)}const t=n=>{for(let o=0;o<n.length;o+=1){const s=n[o];if(!1===e(s))return!1;if(s._$inheritSlots&&!t(s.childNodes))return!1}return!0};return t(this.childNodes)}*iterateComposedChild(){if(this._$inheritSlots)return;if(y(this)&&!this._$external)return void(yield this.shadowRoot);if(null!==this._$slotName){if(!this.ownerShadowRoot)return;const e=this.slotNodes;for(let t=0;t<e.length;t+=1)yield e[t];return}const e=function*(t){for(let n=0;n<t.length;n+=1){const o=t[n];yield o,o._$inheritSlots&&(yield*e(o.childNodes))}};yield*e(this.childNodes)}forEachNonVirtualComposedChild(e){if(this._$inheritSlots)return!0;const t=t=>t._$virtual?t.forEachNonVirtualComposedChild(e):!1!==e(t);if(y(this)&&!this._$external)return t(this.shadowRoot);if(null!==this._$slotName){const e=this.ownerShadowRoot;return!e||e.forEachSlotContentInSpecifiedSlot(this,t)}const n=e=>{for(let o=0;o<e.length;o+=1){const s=e[o];if(!t(s))return!1;if(s._$inheritSlots&&!n(s.childNodes))return!1}return!0};return n(this.childNodes)}static parseSelector(e){return new De(e)}querySelector(e){return(e instanceof De?e:new De(e)).query(this,!0)}querySelectorAll(e){return(e instanceof De?e:new De(e)).query(this,!1)}static matchSelector(e,t){return(e instanceof De?e:new De(e)).testSelector(null,t)}matchSelector(e,t){return(e instanceof De?e:new De(e)).testSelector(this,t)}getBoundingClientRect(e){var t;const n=this._$backendElement;if(n)if(3===this.getBackendMode()){const o=n,s=(null===(t=o.getBoundingClientRect)||void 0===t?void 0:t.call(o))||{left:0,top:0,width:0,height:0};setTimeout((()=>{e(s)}),0)}else{const t=n;t.getBoundingClientRect?t.getBoundingClientRect(e):setTimeout((()=>{e({left:0,top:0,width:0,height:0})}),0)}else setTimeout((()=>{e({left:0,top:0,width:0,height:0})}),0)}getScrollOffset(e){const t=this._$backendElement;if(t)if(3===this.getBackendMode()){const n=t,o={scrollLeft:n.scrollLeft||0,scrollTop:n.scrollTop||0,scrollWidth:n.scrollWidth||0,scrollHeight:n.scrollHeight||0};setTimeout((()=>{e(o)}),0)}else{const n=t;n.getScrollOffset?n.getScrollOffset(e):setTimeout((()=>{e({scrollLeft:0,scrollTop:0,scrollWidth:0,scrollHeight:0})}),0)}else setTimeout((()=>{e({scrollLeft:0,scrollTop:0,scrollWidth:0,scrollHeight:0})}),0)}createIntersectionObserver(e,t,n,o){const s=this._$backendElement;if(s){if(e&&!e._$backendElement)return null;if(3===this.getBackendMode()){const i=this._$nodeTreeContext;return i&&i.createIntersectionObserver?i.createIntersectionObserver(s,(null==e?void 0:e._$backendElement)||null,t,n,o):null}const i=s;return i.createIntersectionObserver?i.createIntersectionObserver((null==e?void 0:e._$backendElement)||null,t,n,o):null}return null}getContext(e){const t=this._$backendElement;if(t)if(3===this.getBackendMode()){const n=this._$nodeTreeContext;(null==n?void 0:n.getContext)?n.getContext(t,e):e(null)}else{const n=t;n.getContext?n.getContext(e):e(null)}}}var je;Pe.isElement=m,Pe._$getParentHostShadowRoot=e=>{let t=e;for(;null==t?void 0:t._$inheritSlots;)t=t.parentNode;return y(t)&&!t._$external?t.shadowRoot:null},Pe.prototype[u]=!0,exports.RelationType=void 0,(je=exports.RelationType||(exports.RelationType={}))[je.Ancestor=0]="Ancestor",je[je.Descendant=1]="Descendant",je[je.ParentNonVirtualNode=2]="ParentNonVirtualNode",je[je.ChildNonVirtualNode=3]="ChildNonVirtualNode",je[je.ParentComponent=4]="ParentComponent",je[je.ChildComponent=5]="ChildComponent";const Ue=(e,t,n,o)=>{const s=e=>"function"==typeof e?e:(void 0!==e&&O(`the "${n}" relation listener is not a function (when preparing behavior "${t}").`),null);let i;if("parent"===o.type)i=4;else if("child"===o.type)i=5;else if("parent-common-node"===o.type)i=2;else if("child-common-node"===o.type)i=3;else if("ancestor"===o.type)i=0;else{if("descendant"!==o.type){const e=o.type;return O(`the "${n}" relation has an invalid relation type "${e}" (when preparing behavior "${t}").`),null}i=1}let r=null;if(o.target instanceof mt)r=o.target.behavior;else if(o.target instanceof Ct||o.target instanceof G)r=o.target;else{const s=String(o.target||n),i=e.getComponentByUrlWithoutDefault(s,t);if(i)r=i.behavior;else{const t=e.getGlobalUsingComponent(s);"object"==typeof t&&null!==t&&(r=t.behavior)}}return r?{target:r,type:i,linked:s(o.linked),linkChanged:s(o.linkChanged),unlinked:s(o.unlinked),linkFailed:s(o.linkFailed)}:(O(`the target of relation "${n}" is not a valid behavior or component (when preparing behavior "${t}").`),null)};class Fe{constructor(e,t){this._$comp=e;const n=new Array(6);if(t)for(let e=0;e<6;e+=1){const o=t.definitions[e];if(o){const t=new Array(o.length);for(let e=0;e<o.length;e+=1)t[e]=null;n[e]=t}}this._$group=t,this._$sharedGroup=!0,this._$links=n}add(e){if(this._$sharedGroup){this._$sharedGroup=!1;const e=this._$group;this._$group=e?{definitions:e.definitions.slice(),keyMap:Object.assign(Object.create(null),e.keyMap)}:{definitions:new Array(6),keyMap:Object.create(null)}}const t=Symbol(""),n=this._$group.definitions,o=this._$group.keyMap,s=e.type;n[s]?(o[t]=[s,n[s].length],n[s].push(e)):(o[t]=[s,0],n[s]=[e]);const i=this._$links;return void 0===i[s]?i[s]=[null]:i[s].push(null),t}triggerLinkEvent(e,t){var n,o;const s=this._$comp,i=this._$links,r=null===(n=this._$group)||void 0===n?void 0:n.definitions[e];if(r)for(let n=0;n<r.length;n+=1){const l=i[e],a=l[n];let d=null;const h=r[n],u=h.target;if(!t){let t=s;for(;;){const n=t.parentNode;if(!n)break;if(t=n,!b(t)){if(y(t)){if(t.hasBehavior(u)){const n=t._$relation;if(n){let s;s=4===e?5:0===e?1:3;const i=null===(o=n._$group)||void 0===o?void 0:o.definitions[s];if(i){for(let e=0;e<i.length;e+=1){const n=i[e];if(n.target&&this._$comp.hasBehavior(n.target)){d={target:t,def:n};break}}if(d)break}}}if(4===e)break}if(2===e)break}}}if(l[n]=d,a){const e=a.target,t=a.def;d&&a.target===d.target&&a.def===d.def?(t.linkChanged&&c("Relation Link Changed Callback",t.linkChanged,e.getMethodCaller(),[s.getMethodCaller()],e),h.linkChanged&&c("Relation Link Changed Callback",h.linkChanged,s.getMethodCaller(),[e.getMethodCaller()],s)):(t.unlinked&&c("Relation Unlinked Callback",t.unlinked,e.getMethodCaller(),[s.getMethodCaller()],e),h.unlinked&&c("Relation Unlinked Callback",h.unlinked,s.getMethodCaller(),[e.getMethodCaller()],s))}if(d){const e=d.target,t=d.def;a&&a.target===d.target&&a.def===d.def||(t.linked&&c("Relation Linked Callback",t.linked,e.getMethodCaller(),[s.getMethodCaller()],e),h.linked&&c("Relation Linked Callback",h.linked,s.getMethodCaller(),[e.getMethodCaller()],s))}t||d||!h.linkFailed||c("Relation Link Failed Callback",h.linkFailed,s.getMethodCaller(),[],s)}}getLinkedTargets(e){var t,n,o,s;const i=null===(t=this._$group)||void 0===t?void 0:t.keyMap[e];if(!i)return O(`no relation "${String(e)}" found.`),[];const[r,l]=i;if(4===r||2===r||0===r){const e=null===(n=this._$links[r])||void 0===n?void 0:n[l];return e?[e.target]:[]}const a=[],d=this._$comp,c=null===(s=null===(o=this._$group)||void 0===o?void 0:o.definitions[r])||void 0===s?void 0:s[l],h=e=>{const t=e.childNodes;for(let e=0;e<t.length;e+=1){const n=t[e];if(m(n))if(b(n))h(n);else if(y(n)){if(n._$relation){let e;if(e=5===r?n._$relation._$links[4]:1===r?n._$relation._$links[0]:n._$relation._$links[2],e)for(let t=0;t<e.length;t+=1){const o=e[t];if(o&&o.target===d&&o.def===c){a.push(n);break}}}1===r&&h(n)}else 5!==r&&1!==r||h(n)}};return h(this._$comp),a}}class Ge extends Pe{constructor(){throw new Error("Element cannot be constructed directly")}static create(e,t,n,o){var s,r;const l=Object.create(Ge.prototype);l.is=e,l.stylingName=null!=n?n:e,l._$placeholderHandlerRemover=o;const a=t.getBackendContext();let d=null;if(a)if(3===t.getBackendMode())d=a.document.createElement(e);else if(1===t.getBackendMode())d=t._$backendShadowRoot.createElement(e,l.stylingName);else{d=a.createElement(e,l.stylingName)}l._$initialize(!1,d,t,t._$nodeTreeContext);const c=t.getHostNode(),h=c.getComponentOptions(),u=null!==(s=h.styleScope)&&void 0!==s?s:P.globalScope(),p=null!==(r=h.extraStyleScope)&&void 0!==r?r:void 0,f=c._$behavior.ownerSpace.styleScopeManager;if(l.classList=new j(l,void 0,c.classList,u,p,f),d){if(2===t.getBackendMode()&&d.setStyleScope(u,p),i.writeExtraInfoToAttr){const e=f.queryName(u);e&&d.setAttribute("exparser:info-class-prefix",`${e}--`)}3!==t.getBackendMode()?d.associateValue(l):t.getBackendContext().associateValue(d,l)}return l}setModelBindingListener(e,t){if(this._$modelBindingListeners||(this._$modelBindingListeners=Object.create(null)),!this._$modelBindingListeners[e]){const t=this.getBackendElement();if(t){const n=t=>{var n;const o=null===(n=this._$modelBindingListeners)||void 0===n?void 0:n[e];o&&o.call(this,t)};3===this.getBackendMode()?this.getBackendContext().setModelBindingStat(t,e,n):t.setModelBindingStat(e,n)}}this._$modelBindingListeners[e]=t}getModelBindingListeners(){const e=Object.create(null);return this._$modelBindingListeners&&Object.keys(this._$modelBindingListeners).forEach((t=>{e[t]=e=>{var n;const o=null===(n=this._$modelBindingListeners)||void 0===n?void 0:n[t];o&&o.call(this,e)}})),e}}Ge.isNativeNode=v,Ge.prototype[p]=!0;class Ve{constructor(e,t){this._$slotElement=null,this._$destroyOnDetach=!1,this._$subtreeSlotStart=null,this._$subtreeSlotEnd=null,this._$text=String(e);let n=null;const o=t.getBackendContext();if(o)if(3===t.getBackendMode())n=o.document.createTextNode(e);else if(1===t.getBackendMode()){n=t._$backendShadowRoot.createTextNode(e)}else{n=o.createTextNode(e)}this._$backendElement=n,this.ownerShadowRoot=t,this.parentNode=null,this.parentIndex=-1,this.containingSlot=void 0}static create(e,t){return new Ve(e,t)}asTextNode(){return this}asElement(){return null}asNativeNode(){return null}asVirtualNode(){return null}asInstanceOf(){return null}destroyBackendElement(){this._$backendElement&&(3!==this.ownerShadowRoot.getBackendMode()&&this._$backendElement.release(),this._$backendElement=null)}destroyBackendElementOnDetach(){this._$destroyOnDetach=!0}getBackendElement(){return this._$backendElement}getComposedParent(){if(void 0!==this.containingSlot)return this.containingSlot;let e=this.parentNode;for(;null==e?void 0:e._$inheritSlots;)e=e.parentNode;return e}get $$(){return this._$backendElement}get textContent(){return this._$text}set textContent(e){const t=String(e);t!==this._$text&&(this._$text=t,this._$backendElement&&(3===this.ownerShadowRoot.getBackendMode()?this._$backendElement.textContent=this._$text:this._$backendElement.setText(this._$text)),ae.callTextObservers(this,{type:"characterData",target:this}))}}Ve.isTextNode=g,Ve.prototype[h]=!0;class We extends Pe{constructor(){throw new Error("Element cannot be constructed directly")}_$initializeVirtual(e,t,n){if(this.is=String(e),n&&1===n.mode){const o=t._$backendShadowRoot.createVirtualNode(e);this._$initialize(!0,o,t,n),o.associateValue(this)}else this._$initialize(!0,null,t,t._$nodeTreeContext)}static create(e,t){const n=Object.create(We.prototype);return n._$initializeVirtual(e,t,t.getBackendContext()),n}}var He;We.isVirtualNode=b,We.prototype[f]=!0,function(e){e[e.Direct=0]="Direct",e[e.Single=1]="Single",e[e.Multiple=2]="Multiple",e[e.Dynamic=3]="Dynamic"}(He||(He={}));class ze extends We{constructor(){throw new Error("Element cannot be constructed directly")}static createShadowRoot(e){const t=Object.create(ze.prototype);let n=null;1===e.getBackendMode()&&(n=e._$backendElement.getShadowRoot()),t.is="shadow",t._$idMap=null;let o=1;const s=e.getComponentOptions();return s.multipleSlots?o=2:s.dynamicSlots?o=3:s.directSlots&&(o=0),t._$slotMode=o,1===o?t._$singleSlot=null:2===o?(t._$slots=Object.create(null),t._$slotsList=Object.create(null)):3===o&&(t._$dynamicSlotsInserted=!1,t._$dynamicSlots=new Map,t._$requiredSlotValueNames=[],t._$propertyPassingDeepCopy=ye(s.propertyPassingDeepCopy),t._$insertDynamicSlotHandler=void 0,t._$removeDynamicSlotHandler=void 0,t._$updateDynamicSlotHandler=void 0),t._$backendShadowRoot=n,t._$initialize(!0,n,t,e._$nodeTreeContext),t._$host=e,e.shadowRoot=t,null==n||n.associateValue(t),t}getHostNode(){return this._$host}createTextNode(e=""){return new Ve(e,this)}createNativeNode(e){return Ge.create(e,this)}createVirtualNode(e="virtual"){return We.create(e,this)}createNativeNodeWithInit(e,t,n,o){const s=Ge.create(e,this,t,n);return null==o||o(s),s}createComponent(e,t,n,o,s){const i=this._$host,r=i._$behavior,l=i._$genericImpls,a=r.ownerSpace,d=void 0===t?e:t,c=[r._$using[d],l&&l[d]];for(let t=0;t<c.length;t+=1){const d=c[t];if(null==d)continue;if("string"==typeof d)return this.createNativeNodeWithInit(d,e,void 0,s);let h,u;if(d.final)h=d.final;else if(null!==d.placeholder){h=gt(d.placeholder,a,d.source,l);const e=d.waiting;o&&e&&(e.add(o),e.hintUsed(i),u=()=>{e.remove(o)})}if("string"==typeof h)return this.createNativeNodeWithInit(h,e,u,s);if(h)return St._$advancedCreate(e,h,this,null,_t(h,r,i,n),u,s)}let h=a.getGlobalUsingComponent(d);if(null===h&&a._$allowUnusedNativeNode&&""!==d&&(h=d),!h){if(h=a.getDefaultComponent(),!h)throw new M(`Cannot find component "${d}"`,void 0,this._$host);O(`Cannot find component "${d}", using default component.`,this._$host)}return"string"==typeof h?this.createNativeNodeWithInit(h,e,void 0,s):St._$advancedCreate(e,h,this,null,_t(h,r,i,n),void 0,s)}createComponentByDef(e,t){return St._$advancedCreate(e,t,this,null,null,void 0)}createComponentOrNativeNode(e,t,n){const o=this._$host,s=o._$behavior,i=s.ownerSpace,r=i.getGlobalUsingComponent(e);if("string"==typeof r)return this.createNativeNodeWithInit(r,e,void 0,n);if(r)return St._$advancedCreate(e,r,this,null,_t(r,s,o,t),void 0,n);if(i._$allowUnusedNativeNode){const t=Ge.create(e,this);return null==n||n(t),t}throw new M(`Unknown tag name ${e}`,"[render]",o)}checkComponentPlaceholder(e){var t;let n;const o=this._$host._$behavior._$using[e];if(void 0!==o)n=o;else{const o=null===(t=this._$host._$genericImpls)||void 0===t?void 0:t[e];if(!o)return;n=o}return"string"!=typeof n&&(!n.final&&null!==n.placeholder)}getElementById(e){return this._$getIdMap()[e]}_$markIdCacheDirty(){this._$idMap=null}_$getIdMap(){if(this._$idMap)return this._$idMap;const e=Pe._$generateIdMap(this);return this._$idMap=e,e}getSlotElementFromName(e){const t=this._$slotMode;if(0===t)throw new Error("cannot get slot element in directSlots");if(1===t)return this._$singleSlot;if(2===t)return this._$slots[e]||null;if(3===t){const t=[];for(let n=this._$subtreeSlotStart;n;n=n.next){const o=n.value;(o._$slotName||"")===e&&t.push(o)}return t}return null}getContainingSlot(e){var t;const n=this._$slotMode;if(0===n)return(null==e?void 0:e.containingSlot)||null;if(1===n)return this._$singleSlot;if(3===n){if(!e)return null;let n=e;for(;null===(t=n.parentNode)||void 0===t?void 0:t._$inheritSlots;)n=n.parentNode;const o=n._$slotElement;if((null==o?void 0:o.ownerShadowRoot)===this)return o}if(2===n){let t;return t=m(e)?e._$nodeSlot:"",this._$slots[t]||null}return null}getSlotContentArray(e){if(null===e._$slotName)return null;const t=[];return this.forEachNodeInSpecifiedSlot(e,(e=>{t.push(e)})),t}forEachSlot(e){const t=this._$slotMode;if(0===t)throw new Error("Cannot iterate slots in directSlots");if(1===t)this._$singleSlot&&e(this._$singleSlot);else if(2===t){const t=Object.values(this._$slots);for(let n=0;n<t.length&&!1!==e(t[n]);n+=1);}else if(3===t)for(let t=this._$subtreeSlotStart;t&&!1!==e(t.value);t=t.next);}forEachNodeInSlot(e){const t=this._$host.childNodes;for(let n=0;n<t.length;n+=1)if(!Pe.forEachNodeInSlot(t[n],e))return!1;return!0}forEachNodeInSpecifiedSlot(e,t){if(e){const n=e.slotNodes;for(let e=0;e<n.length;e+=1){const o=n[e];if(!1===t(o))return!1}return!0}return this.forEachNodeInSlot(((e,n)=>null!==n||t(e)))}forEachSlotContentInSlot(e){const t=this._$host.childNodes;for(let n=0;n<t.length;n+=1)if(!Pe.forEachSlotContentInSlot(t[n],e))return!1;return!0}forEachSlotContentInSpecifiedSlot(e,t){if(e){const n=e.slotNodes;for(let e=0;e<n.length;e+=1){const o=n[e];if(!o._$inheritSlots&&!1===t(o))return!1}return!0}return this.forEachSlotContentInSlot(((e,n)=>null!==n||t(e)))}isConnected(e){if(e.ownerShadowRoot!==this)return!1;for(let t=e;t;t=t.parentNode)if(t===this)return!0;return!1}_$applyMultipleSlotInsertion(e,t,n){const o=this._$slotsList,s=this._$slots;if(o[t]){const n=o[t];let s={next:n},i=!0;for(let t=this._$subtreeSlotStart;t&&s.next&&t.value!==e;t=t.next)t.value===s.next.value&&(i=!1,s=s.next);if(i)o[t]=n.prev={value:e,prev:null,next:n};else{const t=s.next;s.next={value:e,prev:s,next:t},t&&(t.prev=s.next)}}else o[t]={value:e,prev:null,next:null};const i=s[t],r=o[t].value;i!==r&&(s[t]=r,Pe._$insertChildReassignSlot(this,t,i||null,r))}_$applyMultipleSlotsRemoval(e,t,n){const o=this._$slotsList,s=this._$slots;let i=o[t]||null;for(;i&&i.value!==e;i=i.next);if(!i)return;const r=i.prev,l=i.next;r&&(r.next=l),l&&(l.prev=r);if(!!r)return;const a=l;if(a){const i=a.value;o[t]=a,n||(s[t]=i,Pe._$insertChildReassignSlot(this,t,e,i))}else delete o[t],n||(delete s[t],Pe._$insertChildReassignSlot(this,t,e,null))}_$applySlotRename(e,t,n){const o=this._$slotMode;if(1!==o&&0!==o){if(2===o)return this._$applyMultipleSlotsRemoval(e,n,!1),void this._$applyMultipleSlotInsertion(e,t,!1);if(3===o){if(!this._$dynamicSlotsInserted)return;const n=this._$insertDynamicSlotHandler,o=this._$removeDynamicSlotHandler;this._$dynamicSlots.set(e,{updatePathTree:void 0}),null==o||o([e]),null==n||n([{slot:e,name:t,slotValues:e._$slotValues}])}}}_$applySlotsInsertion(e,t,n){const o=this._$slotMode;if(0!==o){if(1===o){const e=this._$singleSlot,t=this._$subtreeSlotStart.value;if(e===t)return;return this._$singleSlot=t,void Pe._$insertChildReassignSlot(this,null,e,t)}if(2!==o){if(3===o){if(n)return;if(!this._$dynamicSlotsInserted)return;const o=this._$insertDynamicSlotHandler,s=[];for(let n=e;n&&n!==t.next;n=n.next){const e=n.value,t=e._$slotName;this._$dynamicSlots.set(e,{updatePathTree:void 0}),s.push({slot:e,name:t,slotValues:e._$slotValues})}null==o||o(s)}}else for(let o=e;o&&o!==t.next;o=o.next){const e=o.value,t=e._$slotName;this._$applyMultipleSlotInsertion(e,t,n)}}}_$applySlotsRemoval(e,t,n){var o;const s=this._$slotMode;if(0!==s){if(1===s){if(n)return;const e=this._$singleSlot,t=(null===(o=this._$subtreeSlotStart)||void 0===o?void 0:o.value)||null;if(e===t)return;return this._$singleSlot=t,void Pe._$insertChildReassignSlot(this,null,e,t)}if(2!==s){if(3===s){if(n)return;if(!this._$dynamicSlotsInserted)return;const o=this._$removeDynamicSlotHandler,s=[];for(let n=e;n&&n!==t.next;n=n.next){const e=n.value;this._$dynamicSlots.delete(e),s.push(e)}null==o||o(s)}}else for(let o=e;o&&o!==t.next;o=o.next){const e=o.value,t=e._$slotName;this._$applyMultipleSlotsRemoval(e,t,n)}}}setDynamicSlotHandler(e,t,n,o){if(3===this._$slotMode&&(this._$requiredSlotValueNames=e,this._$insertDynamicSlotHandler=t,this._$removeDynamicSlotHandler=n,this._$updateDynamicSlotHandler=o,this._$dynamicSlotsInserted)){const e=this._$dynamicSlots.values();for(let t=e.next();!t.done;t=e.next()){const e=t.value;e.updatePathTree=e.updatePathTree||Object.create(null)}}}useDynamicSlotHandlerFrom(e){e._$insertDynamicSlotHandler&&this.setDynamicSlotHandler(e._$requiredSlotValueNames.slice(),e._$insertDynamicSlotHandler,e._$removeDynamicSlotHandler,e._$updateDynamicSlotHandler)}replaceSlotValue(e,t,n){var o;const s=e._$slotValues;if(!s)return;const i=s[t];let r=n;if(0!==this._$propertyPassingDeepCopy&&(r=2===this._$propertyPassingDeepCopy?re(n,!0):ie(n)),i===r)return;if(s[t]=r,this._$requiredSlotValueNames.indexOf(t)<0)return;const l=null===(o=this._$dynamicSlots)||void 0===o?void 0:o.get(e);l&&(l.updatePathTree||(l.updatePathTree=Object.create(null)),l.updatePathTree[t]=!0)}applySlotValueUpdates(e){var t,n;const o=null===(t=this._$dynamicSlots)||void 0===t?void 0:t.get(e),s=null==o?void 0:o.updatePathTree;s&&(o.updatePathTree=void 0,null===(n=this._$updateDynamicSlotHandler)||void 0===n||n.call(this,e,e._$slotValues,s))}applySlotUpdates(){var e;if(this._$dynamicSlotsInserted){const t=this._$dynamicSlots.entries();for(let n=t.next();!n.done;n=t.next()){const[t,o]=n.value,s=o.updatePathTree;s&&(o.updatePathTree=void 0,null===(e=this._$updateDynamicSlotHandler)||void 0===e||e.call(this,t,t._$slotValues,s))}}else{this._$dynamicSlotsInserted=!0;const e=this._$insertDynamicSlotHandler,t=[];for(let e=this._$subtreeSlotStart;e;e=e.next){const n=e.value,o=n._$slotName;this._$dynamicSlots.set(n,{updatePathTree:void 0}),t.push({slot:n,name:o,slotValues:n._$slotValues})}null==e||e(t)}}getSlotMode(){return this._$slotMode}}ze.isShadowRoot=S,ze.prototype[$]=!0;class Ke{constructor(e,t,n,o,s){this.ownerShadowRoot=o,this.elem=n,this.keyName=e,this.updateKeys(t);const i=this.items,r=this.indexes,l=[];for(let e=0;e<i.length;e+=1){const t=i[e],n=null===r?e:r[e];l.push(s(t,n))}n.insertChildren(l,-1)}updateKeys(e){let t,n;if(Array.isArray(e))t=e,n=null;else if("object"==typeof e&&null!==e){const o=Object.keys(e);t=new Array(o.length),n=new Array(o.length);for(let s=0;s<o.length;s+=1){const i=o[s],r=e[i];t[s]=r,n[s]=i}}else if("string"==typeof e){O("Use string as for-list is generally for testing. Each character is treated as an item.",this.ownerShadowRoot.getHostNode(),this.elem),t=new Array(e.length),n=null;for(let n=0;n<e.length;n+=1)t[n]=e[n]}else if("number"==typeof e){O("Use number as for-list is generally for testing. The number is used as the repeated times of the item.",this.ownerShadowRoot.getHostNode(),this.elem),t=new Array(e),n=null;for(let n=0;n<e;n+=1)t[n]=n}else O(`The for-list data is neither Array nor Object, got type "${null===e?"null":typeof e}".`,this.ownerShadowRoot.getHostNode(),this.elem),t=[],n=null;this.items=t,this.indexes=n;const o=this.keyName,s=new Array(t.length),i=Object.create(null);let r;if(null!==o){for(let e=0;e<t.length;e+=1){const n=t[e],l="*this"===o?n:null==n?void 0:n[o],a=null!=l?String(l):"";s[e]=a,void 0!==i[a]?(r||(r=Object.create(null)),r[a]=[i[a],e],delete i[a]):(null==r?void 0:r[a])?r[a].push(e):i[a]=e}if(r){const e=Object.keys(r);O(`Some keys are not unique while list updates: "${e.join('", "')}".`,this.ownerShadowRoot.getHostNode(),this.elem);for(let t=0;t<e.length;t+=1){const n=e[t],o=r[n];let l=0;for(let e=0;e<o.length;e+=1){const t=o[e];for(;void 0!==i[`${n}--${l}`];)l+=1;const r=`${n}--${l}`;i[r]=t,s[t]=r}}}}this.rawKeys=s,this.keyMap=i,this.sharedKeyMap=r}diff(e,t,n,o,s){const i=this.rawKeys,r=this.keyMap,l=this.sharedKeyMap,a=this.indexes;this.updateKeys(e);const d=this.rawKeys,c=this.sharedKeyMap,h=this.items,u=this.indexes,p=this.keyName,f="object"==typeof t&&Array.isArray(Object.getPrototypeOf(t));let $,_;if(!0===t)_=!0,$=null===p;else if(void 0===t)_=t,$=!0;else if(null===p)_=!0,$=!0;else{let e=!1;if(f)e=!0;else{const n=Object.keys(t);for(let o=0;o<n.length;o+=1){const s=t[n[o]];if(!0===s||("*this"===p?s:null==s?void 0:s[p])){e=!0;break}}}if(e){_=new Array(d.length);for(let e=0;e<d.length;e+=1){const n=d[e];if(void 0!==(null==l?void 0:l[n])||void 0!==(null==c?void 0:c[n]))_[e]=!0;else{const n=t[e];void 0===n||(!0===n||("*this"===p?n:null==n?void 0:n[p])?_[e]=!0:_[e]=n)}}$=!1}else _=t,$=!1}if($){let e;e=!!f||t;let r=0;for(;r<i.length&&r<d.length;){const t=h[r],o=null===u?r:u[r],i=null===a?r:a[r];s(t,o,!0===e||void 0===e?e:e[o],o!==i,n.childNodes[r]),r+=1}if(r<i.length)n.removeChildren(r,i.length-r);else if(r<d.length){const e=[];for(;r<d.length;r+=1){const t=h[r],n=null===u?r:u[r];e.push(o(t,n))}n.insertChildren(e,-1)}return}const g=[],m=[],v=new Array(d.length),b=new Array(d.length);let S=-1,y=-1;for(let e=0;e<d.length;e+=1){const t=d[e];if(i[S+1]===t){S+=1,y+=1,g[y]=S,m[y]=e,v[e]=y>0?m[y-1]:-1,b[e]=S;continue}const n=r[t];if(void 0===n){b[e]=-1;continue}let o=0,s=g.length;for(;o<s;){const e=Math.floor((o+s)/2);n<g[e]?s=e:o=e+1}g[s]=n,m[s]=e,v[e]=s>0?m[s-1]:-1,b[e]=n,S=n,y=s}const C=m.length;if(C===d.length&&C===i.length){let e=0;for(;e<i.length&&e<d.length;){const t=h[e],o=null===u?e:u[e],i=null===a?e:a[e];s(t,o,!0===_||void 0===_?_:_[e],o!==i,n.childNodes[e]),e+=1}return}let w=C>0?m[C-1]:-1,N=C;for(;-1!==w;)N-=1,g[N]=w,w=v[w];const E=g;let x;!function(e){e[e.Stable=0]="Stable",e[e.ForwardMove=1]="ForwardMove",e[e.BackwardMove=2]="BackwardMove"}(x||(x={}));const k=new Array(i.length),O=new Array(d.length);let M=-1;for(let e=0;e<b.length;e+=1){const t=b[e];if(e!==E[N])if(-1!==t)k[t]=t>M?2:1,O[e]=n.childNodes[t];else{const t=h[e],n=null===u?e:u[e];O[e]=o(t,n)}else M=t,N+=1,k[t]=0}let L=0,A=0,D=0;N=0;do{const e=N<E.length?E[N]:O.length,t=N<E.length?b[e]:k.length;for(;A<t;)if(void 0===k[A]){const e=A;A+=1;let o=1;for(;A<t&&void 0===k[A];)A+=1,o+=1;n.removeChildren(e+L,o),L-=o}else 2===k[A]&&(L-=1),A+=1;for(;D<e;){const o=O[D],i=b[D];if(-1===i){const o=D;D+=1;let s=1;for(;D<e&&-1===b[D];)D+=1,s+=1;n.insertChildren(O.slice(o,o+s),t+L),L+=s}else{n.insertChildAt(o,t+L);const e=h[D],r=null===u?D:u[D],l=null===a?i:a[i];s(e,r,!0===_||void 0===_?_:_[D],r!==l,o),2===k[i]&&(L+=1),D+=1}}if(N<E.length){const o=h[e],i=null===u?e:u[e],r=null===a?t:a[t];s(o,i,!0===_||void 0===_?_:_[e],i!==r,n.childNodes[t+L])}A=t+1,D=e+1,N+=1}while(N<=E.length)}}const qe=e=>e,Xe=e=>{const t=e;return t._$wxTmplArgs=t._$wxTmplArgs||{}},Ye=e=>null==e?"":String(e),Ze=e=>e.replace(/-(.|$)/g,(e=>e[1]?e[1].toUpperCase():""));class Qe{constructor(e,t,n,o){this.bindingMapDisabled=!1,this.eventObjectFilter=qe,this.changePropFilter=qe,this.eventListenerFilter=qe,this.r=(e,t,n,o,s)=>{var i;const r=t=>{if(t.startsWith("bind"))this.v(e,t.slice(4),Ye(n),!1,!1,!1,!0,s);else if(t.startsWith("captureBind"))this.v(e,t.slice(11),Ye(n),!1,!1,!0,!0,s);else if(t.startsWith("catch"))this.v(e,t.slice(5),Ye(n),!0,!1,!1,!0,s);else if(t.startsWith("captureCatch"))this.v(e,t.slice(12),Ye(n),!0,!1,!0,!0,s);else{if(!t.startsWith("on"))return!1;this.v(e,t.slice(2),Ye(n),!1,!1,!1,!0,s)}return!0};if(y(e)){const s=St.getDataProxy(e),l=Ze(t);if(s.replaceProperty(l,n)){void 0!==o&&(null===o?s.setModelBindingListener(l,(()=>{})):s.setModelBindingListener(l,(t=>{const n=e.ownerShadowRoot.getHostNode(),s=St.getDataProxy(n);s.replaceDataOnPath(o,t),s.applyDataUpdates(!1)})));const r=Xe(e);if(null===(i=r.changeProp)||void 0===i?void 0:i[t]){const o=r.changeProp[t],s=o.oldValue;if(s!==n){o.oldValue=n;const t=e.ownerShadowRoot.getHostNode();o.listener.call(t.getMethodCaller(),n,s,t,e)}}}else e.hasExternalClass(t)?e.setExternalClass(t,n):r(l)}else if(v(e)){if(this.fallbackListenerOnNativeNode){r(Ze(t))||e.updateAttribute(t,n)}else e.updateAttribute(t,n);o&&e.setModelBindingListener(t,(t=>{const n=e.ownerShadowRoot.getHostNode(),s=St.getDataProxy(n);s.replaceDataOnPath(o,t),s.applyDataUpdates(!1)}))}},this.shadowRoot=e,this.procGen=t,this.fallbackListenerOnNativeNode=n,o&&(this.eventObjectFilter=o)}create(e){const{shadowRoot:t,procGen:n}=this,o=n(this,!0,e,void 0);return this.handleChildrenCreationAndInsert(o.C,t,void 0,void 0),o.B}update(e,t){const{shadowRoot:n,procGen:o}=this,s=o(this,!1,e,t);this.handleChildrenUpdate(s.C,n,void 0,void 0)}bindingMapUpdate(e,t,n){if(this.bindingMapDisabled)return!1;const o=n[e];if(!o)return!1;let s=null;for(let e=0;e<o.length;e+=1){(0,o[e])(t,(e=>{if(null!==s&&e!==s&&y(s)&&s.hasPendingChanges()){St.getDataProxy(s).applyDataUpdates(!0)}s=e}),((e,t)=>{e.textContent=t}))}const i=s;if(null!==i&&y(i)&&i.hasPendingChanges()){St.getDataProxy(i).applyDataUpdates(!0)}return!0}handleChildrenCreation(e,t,n){const o=[];return e(!0,((e,s)=>{if(t&&""!==n){const e=this.createDynamicPlaceholder(t);return void o.push(e)}const i=this.shadowRoot.createTextNode(e);i.destroyBackendElementOnDetach(),t&&Pe.setSlotElement(i,t),s&&s(i),o.push(i)}),((e,s,i,r,l,a)=>{if(t&&n!==(l||"")){const e=this.createDynamicPlaceholder(t);return void o.push(e)}const d=this.createCommonElement(e,s,i,r,a);if(t){Pe.setSlotElement(d,t);Xe(d).dynamicSlotNameMatched=!0}else void 0!==l&&(d.slot=l);o.push(d)}),((e,s)=>{const i=this.shadowRoot.createVirtualNode("wx:if");i.destroyBackendElementOnDetach(),Pe.setInheritSlots(i),t&&Pe.setSlotElement(i,t);Xe(i).key=e,this.handleChildrenCreationAndInsert(s,i,t,n),o.push(i)}),((e,s,i,r,l)=>{const a=this.shadowRoot,d=a.createVirtualNode("wx:for");d.destroyBackendElementOnDetach(),Pe.setInheritSlots(d),t&&Pe.setSlotElement(d,t);Xe(d).keyList=new Ke(s,e,d,a,((e,o)=>{const s=a.createVirtualNode("wx:for-item");return s.destroyBackendElementOnDetach(),Pe.setInheritSlots(s),t&&Pe.setSlotElement(d,t),this.handleChildrenCreationAndInsert(((t,n,s,i,a,d,c)=>{l(!0,e,o,void 0,void 0,r?[...r,o]:null,n,s,i,a,d,c)}),s,t,n),s})),o.push(d)}),((e,n,s)=>{const i=this.shadowRoot.createVirtualNode("slot");i.destroyBackendElementOnDetach(),Pe.setSlotName(i,Ye(e)),t?Pe.setSlotElement(i,t):void 0!==s&&(i.slot=s),n&&n(i),o.push(i)}),((e,s)=>{if(void 0!==s)if(t)if(n===s){const n=this.shadowRoot.createVirtualNode("virtual");n.destroyBackendElementOnDetach(),Pe.setSlotElement(n,t);Xe(n).dynamicSlotNameMatched=!0,this.handleChildrenCreationAndInsert(e,n,void 0,void 0),o.push(n)}else{const e=this.createDynamicPlaceholder(t);o.push(e)}else{const t=this.shadowRoot.createVirtualNode("virtual");t.destroyBackendElementOnDetach(),t.slot=s,this.handleChildrenCreationAndInsert(e,t,void 0,void 0),o.push(t)}else{const s=this.shadowRoot.createVirtualNode("virtual");s.destroyBackendElementOnDetach(),Pe.setInheritSlots(s),t&&Pe.setSlotElement(s,t),this.handleChildrenCreationAndInsert(e,s,t,n),o.push(s)}}),void 0,void 0),o}handleChildrenCreationAndInsert(e,t,n,o){const s=this.handleChildrenCreation(e,n,o);s.length&&t.insertChildren(s,-1)}handleChildrenUpdate(e,t,n,o){let s=0;const i=n?n.slotNodes.filter((e=>e.parentNode===t)):t.childNodes;e(!1,(e=>{const t=i[s];if(s+=1,n){if(!Xe(t).dynamicSlotNameMatched)return}void 0!==e&&(t.textContent=e)}),((e,r,l,a,d,c)=>{const h=i[s];if(s+=1,n){const s=Xe(h);if(o!==(d||"")){if(s.dynamicSlotNameMatched){const e=this.createDynamicPlaceholder(n);t.replaceChild(e,h)}return}if(!s.dynamicSlotNameMatched){const o=this.createCommonElement(e,r,l,a,c);Pe.setSlotElement(o,n);return Xe(o).dynamicSlotNameMatched=!0,void t.replaceChild(o,h)}}l(h,!1);let u=!1;if(y(h)){const e=this.dynamicSlotUpdate(h,c,a);if(e&&(u=!0),h.hasPendingChanges()){St.getDataProxy(h).applyDataUpdates(!0)}null==e||e.applySlotUpdates()}n||void 0!==d&&(h.slot=d),u||this.handleChildrenUpdate(a,h,void 0,void 0)}),((e,r)=>{const l=i[s];s+=1;if(Xe(l).key===e)this.handleChildrenUpdate(r,l,n,o);else{const i=this.shadowRoot.createVirtualNode("wx:if");i.destroyBackendElementOnDetach(),Pe.setInheritSlots(i),n&&Pe.setSlotElement(i,n);Xe(i).key=e,this.handleChildrenCreationAndInsert(r,i,n,o),n?t.replaceChild(i,l):t.replaceChildAt(i,s-1)}}),((e,t,r,l,a)=>{const d=i[s];s+=1;Xe(d).keyList.diff(e,r,d,((e,t)=>{const s=this.shadowRoot.createVirtualNode("wx:for-item");return s.destroyBackendElementOnDetach(),Pe.setInheritSlots(s),n&&Pe.setSlotElement(d,n),this.handleChildrenCreationAndInsert(((n,o,s,i,r,d,c)=>{a(!0,e,t,void 0,void 0,l?[...l,t]:null,o,s,i,r,d,c)}),s,n,o),s}),((e,t,s,i,r)=>{this.handleChildrenUpdate(((n,o,r,d,c,h,u)=>{a(!1,e,t,s,!!i||void 0,l?[...l,t]:null,o,r,d,c,h,u)}),r,n,o)}))}),((e,t,o)=>{const r=i[s];s+=1,void 0!==e&&Pe.setSlotName(r,Ye(e)),n||void 0!==o&&(r.slot=o),t&&t(r),this.shadowRoot.applySlotValueUpdates(r)}),((e,r)=>{const l=i[s];if(s+=1,void 0!==r)if(n){const s=Xe(l);if(o===r)if(s.dynamicSlotNameMatched)this.handleChildrenUpdate(e,l,void 0,void 0);else{const o=this.shadowRoot.createVirtualNode("virtual");o.destroyBackendElementOnDetach(),Pe.setSlotElement(o,n);Xe(o).dynamicSlotNameMatched=!0,this.handleChildrenCreationAndInsert(e,o,void 0,void 0),t.replaceChild(o,l)}else if(s.dynamicSlotNameMatched){const e=this.createDynamicPlaceholder(n);t.replaceChild(e,l)}}else l.slot=r,this.handleChildrenUpdate(e,l,void 0,void 0);else this.handleChildrenUpdate(e,l,n,o)}),void 0,void 0)}dynamicSlotUpdate(e,t,n){const o=e.getShadowRoot();return 3===(null==o?void 0:o.getSlotMode())?(o.setDynamicSlotHandler(t||[],(t=>{const o=[];for(let e=0;e<t.length;e+=1){const{slot:s,name:i,slotValues:r}=t[e],l=this.handleChildrenCreation(((e,t,o,s,i,l,a)=>{n(!0,t,o,s,i,l,a,r,void 0)}),s,i);o.push(...l)}o.length&&e.insertChildren(o,-1)}),(t=>{if(!t.length||!t[0].slotNodes.length)return;t.sort(((e,t)=>e.slotNodes[0].parentIndex-t.slotNodes[0].parentIndex));let n=-1/0,o=-1/0;for(let s=0;s<t.length;s+=1){const i=t[s].slotNodes,r=i[0].parentIndex;o===r||(n>=0&&e.removeChildren(n,o-n),n=r),o=r+i.length}n>=0&&e.removeChildren(n,o-n)}),((t,o,s)=>{const i=t._$slotName||"";this.handleChildrenUpdate(((e,t,i,r,l,a,d)=>{n(!1,t,i,r,l,a,d,o,s)}),e,t,i)})),o):null}createDynamicPlaceholder(e){const t=this.shadowRoot.createVirtualNode("virtual");t.destroyBackendElementOnDetach(),Pe.setSlotElement(t,e);return Xe(t).dynamicSlotNameMatched=!1,t}createCommonElement(e,t,n,o,s){let i=!1;const r=e=>{const t=y(e)?this.dynamicSlotUpdate(e,s,o):null;if(t&&(i=!0),n(e,!0),y(e)){if(e.hasPendingChanges()){St.getDataProxy(e).applyDataUpdates(!0)}null==t||t.applySlotUpdates()}},l=this.shadowRoot.createComponent(e,e,t,(()=>{var n;const o=this.shadowRoot.createComponent(e,e,t,void 0,r);o.destroyBackendElementOnDetach();const s=o.getShadowRoot(),i=y(l)?l.getShadowRoot():null,a=3===(null==i?void 0:i.getSlotMode()),d=3===(null==s?void 0:s.getSlotMode());d!==a?k(new Error(`The "dynamicSlots" option of component <${o.is}> and its placeholder <${l.is}> should be the same.`),"[render]",y(o)?o:o.is):d?null===(n=l.parentNode)||void 0===n||n.replaceChild(o,l):l.selfReplaceWith(o)}),r);return l.destroyBackendElementOnDetach(),i?this.bindingMapDisabled=!0:this.handleChildrenCreationAndInsert(o,l,void 0,void 0),l}s(e,t){e.slot=t}l(e,t,n){this.shadowRoot.replaceSlotValue(e,t,n)}i(e,t){e.id=t}c(e,t){if(y(e)){e.hasExternalClass("class")&&e.setExternalClass("class",t)}e.setNodeClass(t)}y(e,t){if(y(e)&&St.hasProperty(e,"style")){const n=St.getDataProxy(e),o=Ze("style");n.replaceProperty(o,t)}else e.setNodeStyle(Ye(t),0)}d(e,t,n){e.setDataset(t,n)}m(e,t,n){e.setMark(t,n)}v(e,t,n,o,s,i,r,l){const a="function"==typeof n?this.eventListenerFilter(n):Ye(n),d=t=>{const n=e.ownerShadowRoot.getHostNode();let o;const s=n.getMethodCaller(),i="function"==typeof a?a:St.getMethod(n,a);if("function"==typeof i){const e=this.eventObjectFilter(t);o=i.call(s,e)}return o},c={final:o,mutated:s,capture:i};if(r){const n=Xe(e);n.dynEvListeners||(n.dynEvListeners={});const o=n.dynEvListeners;o[t]&&e.removeListener(t,o[t],c),o[t]=d}a&&e.addListener(t,d,c)}a(e,t,n){e.updateAttribute(t,n)}wl(e,t,n){y(e)&&e.triggerWorkletChangeLifetime(t,n)}p(e,t,n,o){if(y(e)&&St.hasProperty(e,t)){const o=Xe(e);o.changeProp||(o.changeProp=Object.create(null)),o.changeProp[t]={listener:this.changePropFilter(n),oldValue:e.data[t]}}}setFnFilter(e,t){this.changePropFilter=e,this.eventListenerFilter=t}}var Je;!function(e){e[e.Data=0]="Data",e[e.Script=1]="Script",e[e.InlineScript=2]="InlineScript"}(Je||(Je={}));const et=()=>{};class tt{constructor(e,t){this.shadowRoot=e,this.procGen=t}create(e){const{shadowRoot:t,procGen:n}=this,o=n(this,!0,e,void 0);return this.handleChildrenCreation(o.C,t.shadowRootElement),o.B}bindingMapUpdate(e,t,n){const o=n[e];if(void 0!==o)for(let e=0;e<o.length;e+=1){(0,o[e])(t,(()=>{}),((e,t)=>{e.textContent=t}))}}handleChildrenCreation(e,t){let n=!0,o=!1;const s=()=>{n=!1,o=!1;const e=document.createElement("virtual");t.appendChild(e),this.shadowRoot.slot=e};e(!0,((e,i)=>{o?s():n=!1;const r=document.createTextNode(e||"");i&&i(r),t.appendChild(r)}),((e,i,r,l)=>{o?s():n=!1;const a=document.createElement(e);r(a,!0),this.handleChildrenCreation(l,a),t.appendChild(a)}),et,et,(()=>{n?(o=!0,this.shadowRoot.slot=t):s()}),(e=>{o?s():n=!1;const i=document.createElement("virtual");this.handleChildrenCreation(e,i),t.appendChild(i)}))}s(){}i(e,t){this.shadowRoot.idMap[t]=e}c(e,t){e.setAttribute("class",t)}y(e,t){e.setAttribute("style",t)}d(e,t,n){e.dataset[t]=Ye(n)}m(){}v(e,t,n,o){this.shadowRoot.setListener(e,t,(e=>{const t=this.shadowRoot.template.methods[n],s=null==t?void 0:t(e);return!o&&s}))}r(e,t,n){"boolean"==typeof n?n?e.setAttribute(t,""):e.removeAttribute(t):e.setAttribute(t,Ye(n))}a(e,t,n){this.r(e,t,n)}p(){}setFnFilter(){}}const nt=()=>({C:(e,t,n,o,s,i)=>{i("")},B:Object.create(null)}),ot=()=>nt;class st{constructor(e){if("object"!=typeof e._$template&&void 0!==e._$template)throw new Error(`Component template of ${e.is} must be a valid compiled template (or "null" for default template).`);{const t=e._$template||{content:ot};this.genObjectGroupEnv={list:t.groupList||Object.create(null),group:t.content}}this.updateMode="",this.methods=e._$methodMap}createInstance(e){return new it(this,e)}}class it{constructor(e,t){if(3!==t.getBackendMode())throw new Error(`Component template of ${t.is} cannot be initialized since external rendering is only supported in Domlike backend currently.`);const n=t.getBackendElement();if(!n)throw new Error(`Component template of ${t.is} cannot be initialized as external components since no suitable backend element found.`);this.comp=t,this.shadowRoot=this,this.shadowRootElement=n,this.root=n,this.slot=n,this.template=e;const o=e.genObjectGroupEnv.group("")||ot();this.procGenWrapper=new tt(this,o),this.idMap=Object.create(null),this.listeners=[]}initValues(e){if(this.bindingMapGen=this.procGenWrapper.create(e),!this.bindingMapGen)throw new Error("The component template does not support binding-map-update, so it cannot be used as external components.");const t=this.shadowRootElement;if(this.slot===t&&t.childNodes.length>0){const e=document.createElement("virtual");t.appendChild(e),this.slot=e}}getIdMap(){return this.idMap}updateValues(e,t){const n=this.bindingMapGen;for(let o=0;o<t.length;o+=1){const[s]=t[o];this.procGenWrapper.bindingMapUpdate(s[0],e,n)}}setListener(e,t,n){const o=e;o._$wxTmplEv?o._$wxTmplEv[t]=n:o._$wxTmplEv={[t]:n}}handleEvent(e,t){var n;const o=e;let s=o;const i=this.shadowRootElement,r=t.getEventName(),l=t.bubbles;for(;;){const e=t.wrapShadowedEvent(o,null,s),a=null===(n=s._$wxTmplEv)||void 0===n?void 0:n[r];if(a){!1===a.call(s,e)&&(t.preventDefault(),t.stopPropagation())}if(!l||t.propagationStopped())break;if(s===i)break;const d=s.parentNode;if(!d)break;s=d}}}const rt=()=>({C:(e,t,n,o,s,i)=>{i("")},B:Object.create(null)}),lt=()=>rt;var at;!function(e){e[e.Disabled=0]="Disabled",e[e.Enabled=1]="Enabled",e[e.Forced=2]="Forced"}(at||(at={}));const dt=e=>String(e>>>0)===e;class ct{create(e,t){return t.externalComponent?new st(e):new ht(e)}}class ht{constructor(e){this.updateTemplate(e)}updateTemplate(e){const t=e._$template;if("object"!=typeof t&&void 0!==t)throw new Error(`Component template of ${e.is} must be a valid compiled template (or "null" for default template).`);const n=t||{content:lt};this.genObjectGroupEnv={list:n.groupList||Object.create(null),group:n.content},this.updateMode=n.updateMode||"",this.fallbackListenerOnNativeNode=n.fallbackListenerOnNativeNode||!1,this.eventObjectFilter=n.eventObjectFilter}createInstance(e,t){return new ut(this,e,t(e))}}class ut{constructor(e,t,n){this.comp=t,this.shadowRoot=n,this.shadowRoot.destroyBackendElementOnDetach(),this._$applyTemplate(e)}updateTemplate(e,t){this._$applyTemplate(e),this.shadowRoot.removeChildren(0,this.shadowRoot.childNodes.length),this.bindingMapGen=this.procGenWrapper.create(t)}_$applyTemplate(e){const t=e.genObjectGroupEnv.group("")||lt();"bindingMap"===e.updateMode?this.forceBindingMapUpdate=2:"virtualTree"===e.updateMode?this.forceBindingMapUpdate=0:this.forceBindingMapUpdate=1,this.procGenWrapper=new Qe(this.shadowRoot,t,e.fallbackListenerOnNativeNode,e.eventObjectFilter),this.bindingMapGen=void 0}initValues(e){return this.bindingMapGen=this.procGenWrapper.create(e),this.shadowRoot}updateValues(e,t){if(2===this.forceBindingMapUpdate){for(let n=0;n<t.length;n+=1)this.tryBindingMapUpdate(e,t[n]);return}if(1===this.forceBindingMapUpdate&&t.length<=1&&this.bindingMapGen&&this.tryBindingMapUpdate(e,t[0]))return;const n=Object.create(null);for(let e=0;e<t.length;e+=1){const[o,s,i,r]=t[e];let l=n;for(let e=0;e<o.length;e+=1){const t=o[e],n=l[t];if(!0===n)break;if(e===o.length-1){if(void 0===r)l[t]=!0;else{const e=i;if(void 0===n)l[t]=Object.create(new Array(e));else if(Array.isArray(Object.getPrototypeOf(n))){const t=Object.getPrototypeOf(n);t.length<e&&(t.length=e);const o=n,s=Object.keys(o);for(let e=0;e<s.length;e+=1){const n=s[e];dt(n)&&(t[Number(n)]=o[n],delete o[n])}}else{const o=new Array(e),s=Object.keys(n);let i=!1;for(let e=0;e<s.length;e+=1){const t=s[e],r=n[t];dt(t)?o[Number(t)]=r:"length"===t&&(i=!0)}const r=Object.create(o);i&&(r.length=!0),l[t]=r}const o=Object.getPrototypeOf(l[t]),a=new Array(s.length);a.fill(!0),o.splice(i,r,...a)}break}if(void 0===n){const e=Object.create(null);l[t]=e,l=e}else l=n}}this.procGenWrapper.update(e,n)}tryBindingMapUpdate(e,t){if(!t)return!0;const n=this.bindingMapGen;if(!n)return!1;const[o]=t;return 1===o.length&&this.procGenWrapper.bindingMapUpdate(o[0],e,n)}}let pt=null;const ft=()=>{if(pt)return pt;const e=new ct;return pt=e,e};var $t=Object.freeze({__proto__:null,DEFAULT_PROC_GEN_GROUP:lt,GlassEaselTemplateEngine:ct,getDefaultTemplateEngine:ft});const _t=(e,t,n,o)=>{const s=t.ownerSpace,i=null==n?void 0:n._$behavior._$using,r=null==n?void 0:n._$genericImpls;e._$detail||e.prepare();const l=e.behavior;let a;const d=l._$generics;if(d){const n=l._$genericDefaults;a=Object.create(null);for(let l=0;l<d.length;l+=1){const c=d[l];if(o&&Object.prototype.hasOwnProperty.call(o,c)){const n=o[c];if("string"==typeof n)if(null==i?void 0:i[n])a[c]=i[n];else if(r&&r[n])a[c]=r[n];else{const o=s.getGlobalUsingComponent(n);if("string"==typeof o)a[c]=o;else if(o)a[c]={final:o,source:t,placeholder:null,waiting:null};else{O(`Generic "${c}" value "${n}" is not valid`,e.is);const o=s.getDefaultComponent();if(!o)throw new M(`Cannot find default component for generic "${c}"`,"[prepare]",e.is);a[c]={final:o,source:t,placeholder:null,waiting:null}}}else a[c]=n}else{const o=n[c]||s.getDefaultComponent();if(!o)throw new M(`Cannot find default component for generic "${c}"`,"[prepare]",e.is);a[c]="string"==typeof o?o:{final:o,source:t,placeholder:null,waiting:null}}}}else a=null;return a},gt=(e,t,n,o)=>{const s=n._$using[e]||o&&o[e];let i=null;if(s&&("string"==typeof s?i=s:null===s.placeholder?i=s.final:O("Placeholder on generic implementation is not valid",n.is)),i)return i;let r=t.getGlobalUsingComponent(e);if(null===r&&t._$allowUnusedNativeNode&&""!==e&&(r=e),!r){if(r=t.getDefaultComponent(),!r)throw new M(`Cannot find placeholder target "${e}"`,"[prepare]",n.is);O(`Cannot find placeholder target "${e}", using default component.`,n.is)}return r};class mt{constructor(e){this.behavior=e,this.is=this.behavior.is,this._$detail=null,this._$options=r(e._$options,e.ownerSpace.getComponentOptions());const t=this._$options.templateEngine;this._$templateEngine=null!=t?t:ft()}general(){return this}getComponentOptions(){return this._$options}getComponentDependencies(){return this.behavior.getComponentDependencies()}updateTemplate(e){var t;if(!(null===(t=this._$detail)||void 0===t?void 0:t.template.updateTemplate))throw new Error(`The template engine of component "${this.is}" does not support template update`);this.behavior._$updateTemplate(e),this._$detail.template.updateTemplate(this.behavior)}isPrepared(){return!!this._$detail}prepare(){if(this._$detail)return;this.behavior.prepare();const e=this.behavior,t=this._$options,n={};if(t.writeFieldsToNode){const t=Object.keys(e._$propertyMap);for(let e=0;e<t.length;e+=1){const o=t[e];n[o]={enumerable:!0,get(){return this._$dataGroup.data[o]},set(e){const t=this._$dataGroup;t.replaceDataOnPath([o],e),t.applyDataUpdates()}}}const o=Object.keys(e._$methodMap);for(let t=0;t<o.length;t+=1){const s=o[t];n[s]={enumerable:!0,value:e._$methodMap[s]}}}const o=function(){};n.constructor={value:o,writable:!0};const s=o.prototype=Object.create(St.prototype,n);s._$behavior=e,s._$definition=this,s._$methodMap=e._$methodMap;const i=e._$generateObserverTree();s._$lifetimeFuncs=e._$getAllLifetimeFuncs(),s._$pageLifetimeFuncs=e._$getAllPageLifetimeFuncs();const r=(e=>{if(void 0===e)return null;const t={definitions:new Array(6),keyMap:Object.create(null)},n=t.definitions,o=t.keyMap,s=Object.keys(e);for(let t=0;t<s.length;t+=1){const i=s[t],r=e[i],l=r.type;n[l]?(o[i]=[l,n[l].length],n[l].push(r)):(o[i]=[l,0],n[l]=[r])}return t})(e._$relationMap),l=ye(t.dataDeepCopy),a=ye(t.propertyPassingDeepCopy),d=this._$templateEngine.create(e,t);this._$detail={proto:s,template:d,dataGroupObserverTree:i,dataDeepCopy:l,propertyPassingDeepCopy:a,relationDefinitionGroup:r}}}let vt=1,bt=null;class St extends Pe{constructor(){throw new Error("Element cannot be constructed directly")}general(){return this}asInstanceOf(e){return this._$behavior!==e.behavior?null:this}static register(e,t){return(t||X()).defineComponent(e)}static _$tagMethod(e){const t=e;return t[U]=!0,t}static _$isTaggedMethod(e){return"function"==typeof e&&!!e[U]}static _$advancedCreate(e,t,n,o,s,r,a){var d,h,u,p;t._$detail||t.prepare();const{proto:f,template:$,dataDeepCopy:_,propertyPassingDeepCopy:g,relationDefinitionGroup:m}=t._$detail;let v=t._$detail.dataGroupObserverTree;const b=t._$options,S=t.behavior,y=n?n.getBackendContext():o||i.backendContext||(()=>{if(bt)return bt;let e;return e=new D,bt=e,e})(),C=b.externalComponent,w=b.propertyEarlyInit,N=i.writeExtraInfoToAttr,E=b.virtualHost,x=Object.create(f);x._$genericImpls=s,x._$placeholderHandlerRemover=r,x._$external=C,x.tagName=e,x._$methodCaller=x,x._$virtual=E;let O=null;if(y)if(3===y.mode)E||(O=y.document.createElement(e));else if(2===y.mode)E||(O=y.createElement(b.hostNodeTagName,e));else if(1===y.mode){O=(n?n._$backendShadowRoot:y.getRootNode()).createComponent(e,C,E,null!==(d=b.styleScope)&&void 0!==d?d:P.globalScope(),b.extraStyleScope,S._$externalClasses)}x._$initialize(E,O,n,n?n._$nodeTreeContext:y);const L=n?n.getHostNode():void 0,A=null==L?void 0:L.getComponentOptions(),T=null!==(h=null==A?void 0:A.styleScope)&&void 0!==h?h:P.globalScope(),I=null!==(u=null==A?void 0:A.extraStyleScope)&&void 0!==u?u:void 0,B=null==L?void 0:L._$behavior.ownerSpace.styleScopeManager;if(x.classList=new j(x,S._$externalClasses,L?L.classList:null,T,I,B),O&&(2===y.mode&&O.setStyleScope(T,I,null!==(p=b.styleScope)&&void 0!==p?p:P.globalScope()),B&&N)){const e=B.queryName(T);e&&O.setAttribute("exparser:info-class-prefix",`${e}--`)}const R=$.createInstance(x,ze.createShadowRoot);if(O&&(3!==y.mode?O.associateValue(x):y.associateValue(O,x)),N&&O){const e=vt;vt+=1,x._$componentInstanceId=e,O.setAttribute("exparser:info-component-id",e)}x._$idPrefix=b.idPrefixGenerator?b.idPrefixGenerator.call(x):"";const U=S._$staticData,F=S._$data;let W;if(void 0===U)if(1===F.length){W=(0,F[0])()}else{W={};for(let e=0;e<F.length;e+=1){const t=F[e];Object.assign(W,t())}}else{W=ie(U);for(let e=0;e<F.length;e+=1){const t=F[e];Object.assign(W,t())}}const H=x._$relation=new Fe(x,m);x._$traitGroup=new V;const z=S._$traitBehaviors;if(void 0!==z)for(let e=0;e<z.length;e+=1){const{traitBehavior:t,impl:n}=z[e];x._$traitGroup.implement(t,n)}if(S._$methodCallerInit){const e=S._$methodCallerInit.call(x);x._$methodCaller=e}let K=!1;if(S._$init.length>0){let e=!0,t=!0,n=!0,o=!0;const s=x.getMethodCaller(),i={self:s,data:W,setData:x.setData.bind(x),implement:(e,t)=>{if(K)throw new M("Cannot execute init-time functions after initialization","[implement]",S.is);x._$traitGroup.implement(e,t)},relation:function(e){if(K)throw new M("Cannot execute init-time functions after initialization","[implement]",S.is);const t=e.target,n=Ue(S.ownerSpace,S.is,"undefined",e);let o;return o=n?H.add(n):Symbol("invalid"),{list:()=>H.getLinkedTargets(o).map((e=>e.getMethodCaller())),listAsTrait:t instanceof G?()=>H.getLinkedTargets(o).map((e=>e.traitBehavior(t))):void 0}},observer:(t,n)=>{if(K)throw new M("Cannot execute init-time functions after initialization","[implement]",S.is);e&&(e=!1,v=v.cloneSub());try{v.addObserver(n,ne(t))}catch(e){k(e,"observer",S.is)}},lifetime:(e,n)=>{if(K)throw new M("Cannot execute init-time functions after initialization","[implement]",S.is);t&&(t=!1,x._$lifetimeFuncs=S._$getAllLifetimeFuncs());const o=x._$lifetimeFuncs;if(o[e])o[e].add(n);else{(o[e]=new l("lifetime")).add(n)}},pageLifetime:(e,t)=>{if(K)throw new M("Cannot execute init-time functions after initialization","[implement]",S.is);n&&(n=!1,x._$pageLifetimeFuncs=S._$getAllPageLifetimeFuncs());const o=x._$pageLifetimeFuncs;if(o[e])o[e].add(t);else{(o[e]=new l("pageLifetime")).add(t)}},method:e=>St._$tagMethod(e),listener:e=>St._$tagMethod(e)},r=S._$init;for(let e=0;e<r.length;e+=1){const t=c("Component Init",r[e],s,[i],void 0);if(t){const e=Object.keys(t);for(let n=0;n<e.length;n+=1){const s=e[n],i=t[s];St._$isTaggedMethod(i)&&(o&&(o=!1,x._$methodMap=Object.create(x._$methodMap)),x._$methodMap[s]=i,b.writeFieldsToNode&&(x[s]=i))}}}}K=!0;const q=R.shadowRoot;x.shadowRoot=q;const X=new Ce(x,W,b.pureDataPattern||null,_,g,b.reflectToAttributes,v);x._$dataGroup=X,w&&void 0!==a&&a(x),R.initValues(X.innerData||X.data),x._$tmplInst=R,X.setUpdateListener(((e,t)=>{R.updateValues(e,t)}));const Y=S._$listeners;if(void 0!==Y)for(let e=0;e<Y.length;e+=1){const{id:t,ev:n,listener:o}=Y[e],s=o;if("this"===t)x.addListener(n,(e=>s.call(x._$methodCaller,e)));else if(C){const e=q,o=t?e.getIdMap()[t]:e.root;o&&e.setListener(o,n,(e=>s.call(x._$methodCaller,e)))}else{const e=q,o=t?e.getElementById(t):e;o&&o.addListener(n,(e=>s.call(x._$methodCaller,e)))}}return x.triggerLifetime("created",[]),w||void 0===a||a(x),x}static createWithGenericsAndContext(e,t,n,o,s){const i=e=>{let t;return n&&(t=Object.create(null),Object.entries(n).forEach((([n,o])=>{t[n]={final:o,source:e.behavior,placeholder:null,waiting:null}}))),_t(e,e.behavior,void 0,t)};if(t)return St._$advancedCreate(String(e),t,null,o,i(t),void 0,s);if(e instanceof mt)return St._$advancedCreate(e.is,e,null,o,i(e),void 0);const r=X().getComponentByUrl(e,"");return St._$advancedCreate(e,r,null,o,i(r),void 0)}static createWithGenerics(e,t,n,o){return St.createWithGenericsAndContext(e,t,n,null,o)}static createWithContext(e,t,n,o){return St.createWithGenericsAndContext(e,t,null,n,o)}static create(e,t,n){return St.createWithGenericsAndContext(e,t,null,null,n)}get is(){return this._$definition.is}get properties(){return this._$dataGroup.data}get data(){return this._$dataGroup.data}set data(e){const t=this._$dataGroup;if(void 0===t)throw new M("Cannot update data before component created","data setter",this);Object.entries(e).forEach((([e,n])=>t.replaceDataOnPath([e],n))),t.applyDataUpdates()}get $(){return this._$external?this.shadowRoot.getIdMap():this.shadowRoot._$getIdMap()}getShadowRoot(){return this._$external?null:this.shadowRoot}applyTemplateUpdates(){var e;if(!(null===(e=this._$tmplInst)||void 0===e?void 0:e.updateTemplate))throw new Error(`The template engine of component "${this.is}" does not support template update`);const t=this._$dataGroup;this._$tmplInst.updateTemplate(this._$definition._$detail.template,t.innerData||t.data)}getOwnerSpace(){return this._$behavior.ownerSpace}isExternal(){return this._$external}static listProperties(e){return Object.keys(e._$behavior._$propertyMap)}static hasProperty(e,t){return!!e._$behavior._$propertyMap[t]}static getMethodsFromDef(e){return e.behavior._$methodMap}static getMethod(e,t){if(e._$definition._$options.useMethodCallerListeners&&Object.prototype.hasOwnProperty.call(e._$methodCaller,t)){const n=e._$methodCaller[t];return"function"==typeof n?n:void 0}return e._$methodMap[t]}callMethod(e,...t){const n=St.getMethod(this,e);return null==n?void 0:n.call(this,...t)}getComponentDefinition(){return this._$definition}getComponentOptions(){return this._$definition._$options}hasBehavior(e){return e instanceof G?void 0!==this._$traitGroup.get(e):this._$behavior.hasBehavior(e)}getRootBehavior(){return this._$behavior}traitBehavior(e){return this._$traitGroup.get(e)}setMethodCaller(e){this._$methodCaller=e}getMethodCaller(){return this._$methodCaller}triggerLifetime(e,t){const n=this._$lifetimeFuncs[e];n&&n.call(this._$methodCaller,t,this)}triggerLifeTime(e,t){return this.triggerLifetime(e,t)}triggerPageLifetime(e,t){const n=o=>{if(y(o)){if(o._$pageLifetimeFuncs){const n=o._$pageLifetimeFuncs[e];n&&n.call(o._$methodCaller,t,this)}o._$external||n(o.shadowRoot)}const s=o.childNodes;for(let e=0;e<s.length;e+=1){const t=s[e];m(t)&&n(t)}};n(this)}triggerPageLifeTime(e,t){return this.triggerPageLifetime(e,t)}getRelationNodes(e){var t;return(null===(t=this._$relation)||void 0===t?void 0:t.getLinkedTargets(e))||[]}hasExternalClass(e){return this.classList._$hasAlias(e)}setExternalClass(e,t){this.scheduleExternalClassChange(e,t),this.applyExternalClassChanges()}getExternalClasses(){return this.classList._$getAlias()}scheduleExternalClassChange(e,t){this.classList._$setAlias(e,t)}applyExternalClassChanges(){if(this._$external)return;if(!this.classList._$shouldUpdateExternalClass())return;const e=t=>{if(!m(t))return;const n=t.classList;(null==n?void 0:n._$spreadExternalClassUpdate())&&y(t)&&t.applyExternalClassChanges();const o=t.childNodes;for(let t=0,n=o.length;t<n;t+=1)e(o[t]);null==n||n._$markExternalClassUpdated()};e(this.shadowRoot)}triggerWorkletChangeLifetime(e,t){this.triggerLifetime("workletChange",[e,t])}isInnerDataExcluded(e){var t;return(null===(t=this._$definition._$options.pureDataPattern)||void 0===t?void 0:t.test(e))||!1}static getInnerData(e){return e._$dataGroup.innerData}static getDataProxy(e){return e._$dataGroup}static replaceWholeData(e,t){e._$dataGroup.replaceWholeData(t)}replaceDataOnPath(e,t){const n=this._$dataGroup;if(void 0===n)throw new M("Cannot update data before component created","replaceDataOnPath",this);n.replaceDataOnPath(e,t)}spliceArrayDataOnPath(e,t,n,o){const s=this._$dataGroup;if(void 0===s)throw new M("Cannot update data before component created","spliceArrayDataOnPath",this);s.spliceArrayDataOnPath(e,t,n,o)}hasPendingChanges(){const e=this._$dataGroup;return void 0!==e&&e.getChanges().length>0}applyDataUpdates(){const e=this._$dataGroup;if(void 0===e)throw new M("Cannot update data before component created","applyDataUpdates",this);e.applyDataUpdates()}groupUpdates(e){const t=this._$dataGroup;if(void 0===t)throw new M("Cannot update data before component created","groupUpdates",this);const n=e();return t.applyDataUpdates(),n}updateData(e){const t=this._$dataGroup;if(void 0===t)throw new M("Cannot update data before component created","updateData",this);if("object"==typeof e&&null!==e){const n=Object.keys(e);for(let o=0;o<n.length;o+=1){const s=n[o];try{const n=te(s);t.replaceDataOnPath(n,e[s])}catch(e){k(e,"updateData",this)}}}}setData(e){const t=this._$dataGroup;if(void 0===t)throw new M("Cannot update data before component created","setData",this);if("object"==typeof e&&null!==e){const n=Object.keys(e);for(let o=0;o<n.length;o+=1){const s=n[o];try{const n=te(s);t.replaceDataOnPath(n,e[s])}catch(e){k(e,"setData",this)}}}t.applyDataUpdates()}}St.isComponent=y,St.prototype[_]=!0;class yt{constructor(e,t){this._$behaviors=[],this._$traitBehaviors=[],this._$staticData=void 0,this._$data=[],this._$methods=[],this._$lifetimes=[],this._$pageLifetimes=[],this._$init=[],this._$is=e,this._$ownerSpace=t}methodCallerInit(e){return this._$methodCallerInit=e,this}behavior(e){return this._$behaviors.push(e),e._$chainingFilter?e._$chainingFilter(this):this}chainingFilter(e){return this._$chainingFilter=e,this}options(e){const t=this._$options;return this._$options=t?Object.assign(Object.assign({},t),e):e,this}implement(e,t){return this._$traitBehaviors.push({traitBehavior:e,impl:t}),this}template(e){return this._$template=e,this}usingComponents(e){return this._$using?this._$using=Object.assign(Object.assign({},this._$using),e):this._$using=e,this}placeholders(e){return this._$placeholders?this._$placeholders=Object.assign(Object.assign({},this._$placeholders),e):this._$placeholders=e,this}generics(e){return this._$generics?this._$generics=Object.assign(Object.assign({},this._$generics),e):this._$generics=e,this}externalClasses(e){return this._$externalClasses?this._$externalClasses=this._$externalClasses.concat(e):this._$externalClasses=e,this}data(e){return this._$data.push((()=>{var t;return null!==(t=c("Data Generator",e,null,[],this._$is))&&void 0!==t?t:{}})),this}staticData(e){return this._$staticData=e,this}property(e,t){return this._$properties||(this._$properties=[]),this._$properties.push({name:e,def:t}),this}methods(e){const t=Object.keys(e);for(let n=0;n<t.length;n+=1){const o=t[n],s=e[o];this._$methods.push({name:o,func:s})}return this}observer(e,t,n=!1){this._$observers||(this._$observers=[]);try{this._$observers.push({dataPaths:ne(e),func:t,once:n})}catch(e){k(e,"observer",this._$is)}return this}lifetime(e,t,n=!1){return this._$lifetimes.push({name:e,func:t,once:n}),this}pageLifetime(e,t,n=!1){return this._$pageLifetimes||(this._$pageLifetimes=[]),this._$pageLifetimes.push({name:e,func:t,once:n}),this}relation(e,t){return this._$relations||(this._$relations=[]),this._$relations.push({name:e,rel:t}),this}init(e){return this._$init.push(e),this}definition(e){e.behaviors&&this._$behaviors.push(...e.behaviors),e.options&&this.options(e.options),e.template&&this.template(e.template),e.using&&this.usingComponents(e.using),e.placeholders&&this.placeholders(e.placeholders),e.generics&&this.generics(e.generics),e.externalClasses&&this.externalClasses(e.externalClasses);const t=e.data;void 0!==t&&("function"==typeof t?this._$data.push((()=>{var e;return null!==(e=c("Data Generator",t,null,[],this._$is))&&void 0!==e?e:{}})):this._$staticData=t);const n=e.properties;if(void 0!==n){this._$properties||(this._$properties=[]);const e=Object.keys(n);for(let t=0;t<e.length;t+=1){const o=e[t],s=n[o];this._$properties.push({name:o,def:s})}}const o=e.methods;if(void 0!==o){const e=Object.keys(o);for(let t=0;t<e.length;t+=1){const n=e[t],s=o[n];this._$methods.push({name:n,func:s})}}const s=e.observers;if(void 0!==s)if(this._$observers||(this._$observers=[]),Array.isArray(s))for(let e=0;e<s.length;e+=1){const{fields:t,observer:n}=s[e];try{this._$observers.push({dataPaths:ne(null!=t?t:"**"),func:n,once:!1})}catch(e){k(e,"definition",this._$is)}}else{const e=Object.keys(s);for(let t=0;t<e.length;t+=1){const n=e[t],o=s[n];try{this._$observers.push({dataPaths:ne(n),func:o,once:!1})}catch(e){k(e,"definition",this._$is)}}}const i=e.lifetimes;if(void 0===(null==i?void 0:i.created)&&"function"==typeof e.created&&this._$lifetimes.push({name:"created",func:e.created,once:!0}),void 0===(null==i?void 0:i.attached)&&"function"==typeof e.attached&&this._$lifetimes.push({name:"attached",func:e.attached,once:!0}),void 0===(null==i?void 0:i.moved)&&"function"==typeof e.moved&&this._$lifetimes.push({name:"moved",func:e.moved,once:!0}),void 0===(null==i?void 0:i.detached)&&"function"==typeof e.detached&&this._$lifetimes.push({name:"detached",func:e.detached,once:!0}),void 0===(null==i?void 0:i.ready)&&"function"==typeof e.ready&&this._$lifetimes.push({name:"ready",func:e.ready,once:!0}),i){const e=Object.keys(i);for(let t=0;t<e.length;t+=1){const n=e[t],o=i[n];this._$lifetimes.push({name:n,func:o,once:!0})}}const r=e.pageLifetimes;if(r){this._$pageLifetimes||(this._$pageLifetimes=[]);const e=Object.keys(r);for(let t=0;t<e.length;t+=1){const n=e[t],o=r[n];this._$pageLifetimes.push({name:n,func:o,once:!0})}}this._$listeners=e.listeners;const l=e.relations;if(l){this._$relations||(this._$relations=[]);const e=Object.keys(l);for(let t=0;t<e.length;t+=1){const n=e[t],o=l[n];this._$relations.push({name:n,rel:o})}}return this}registerBehavior(){const e=this._$is,t=new Ct(this);return void 0!==e&&this._$ownerSpace._$registerBehavior(e,t),t}extraThisFieldsType(){return this}registerComponent(){const e=this._$is,t=new Ct(this),n=new mt(t);return void 0!==e&&this._$ownerSpace._$registerComponent(e,n),n}}class Ct{static create(e,t){return new yt(e.is,t||X()).definition(e).registerBehavior()}constructor(e){this._$unprepared=!0,this.is=e._$is||"",this.ownerSpace=e._$ownerSpace,this._$builder=e,this._$flatAncestors=new Set,this._$chainingFilter=e._$chainingFilter,this._$options=e._$options,this._$traitBehaviors=void 0,this._$template=e._$template,this._$using=Object.create(null),this._$generics=void 0,this._$genericDefaults=void 0,this._$externalClasses=e._$externalClasses,this._$staticData=void 0,this._$data=[],this._$propertyMap=Object.create(null),this._$methodMap=Object.create(null),this._$observers=[],this._$lifetimes=[],this._$pageLifetimes=void 0,this._$listeners=void 0,this._$relationMap=void 0,this._$init=[],this._$methodCallerInit=e._$methodCallerInit}general(){return this}getComponentDependencies(e){const t=new Set,n=function(e){e._$unprepared&&e.prepare();const o=Object.keys(e._$using);for(let s=0;s<o.length;s+=1){const i=o[s],r=e._$using[i];if("string"==typeof r)continue;const l=r.final;l&&!t.has(l)&&(t.add(l),n(l.behavior))}};if(n(this.general()),e){const o=Object.values(e);for(let e=0;e<o.length;e+=1){const s=o[e];"string"!=typeof s&&(t.has(s)||(t.add(s),n(s.behavior)))}}return t}static prepare(e){e.prepare()}prepare(){var e;if(!this._$unprepared)return;this._$unprepared=!1;const t=this.is,n=this.ownerSpace,o=this._$builder,s=this._$flatAncestors;if(Array.isArray(o._$behaviors))for(let e=0;e<o._$behaviors.length;e+=1){const i=o._$behaviors[e];let r=null;if(i instanceof Ct)r=i;else{const e=String(i);n&&(r=n.getBehaviorByUrl(e,t)),r||k(new Error(`behavior "${e}" is not found.`),"[prepare]",t)}if(!r)continue;r._$unprepared&&Ct.prepare(r);const l=r._$traitBehaviors;void 0!==l&&(this._$traitBehaviors||(this._$traitBehaviors=[]),this._$traitBehaviors.push(...l));const a=r._$staticData;a&&(this._$staticData||(this._$staticData={}),ue(this._$staticData,a)),Object.assign(this._$methodMap,r._$methodMap),Object.assign(this._$propertyMap,r._$propertyMap),this._$data.push(...r._$data);const d=r._$observers;for(let e=0;e<d.length;e+=1){const t=d[e];t.once&&this._$observers.indexOf(t)>=0||this._$observers.push(t)}const c=r._$lifetimes;for(let e=0;e<c.length;e+=1){const t=c[e];t.once&&this._$lifetimes.indexOf(t)>=0||this._$lifetimes.push(t)}const h=r._$pageLifetimes;if(void 0!==h)if(this._$pageLifetimes)for(let e=0;e<h.length;e+=1){const t=h[e];t.once&&this._$pageLifetimes.indexOf(t)>=0||this._$pageLifetimes.push(t)}else this._$pageLifetimes=h.slice();const u=r._$listeners;void 0!==u&&(this._$listeners||(this._$listeners=[]),this._$listeners.push(...u));const p=r._$relationMap;void 0!==p&&(this._$relationMap||(this._$relationMap=Object.create(null)),Object.assign(this._$relationMap,p)),this._$init.push(...r._$init),r._$flatAncestors.forEach((e=>{s.add(e)}))}const i=o._$traitBehaviors;if(void 0!==i&&(this._$traitBehaviors||(this._$traitBehaviors=[]),this._$traitBehaviors.push(...i)),"object"==typeof o._$using&&null!==o._$using){const s="object"==typeof o._$placeholders&&null!==o._$placeholders,i=Object.keys(o._$using);for(let r=0;r<i.length;r+=1){const l=i[r],a=o._$using[l];let d=null;if(s&&(d=null!==(e=o._$placeholders[l])&&void 0!==e?e:null),a instanceof mt)this._$using[l]={final:a,source:this,placeholder:d,waiting:null};else if(n){const e=String(a),o=n.getComponentByUrlWithoutDefault(e,t);if(o)this._$using[l]={final:o,source:this,placeholder:null,waiting:null};else if(null!==d){const o={final:null,source:this,placeholder:d,waiting:null},s=n._$componentWaitingList(e,t);s&&(s.add((e=>{o.final=e,o.placeholder=null,o.waiting=null})),o.waiting=s),this._$using[l]=o}else{const t=n.getGlobalUsingComponent(e);this._$using[l]="string"==typeof t?t:{final:t,source:this,placeholder:null,waiting:null}}}else k(new Error(`cannot find component "${String(a)}"`),"[prepare]",t)}}if("object"==typeof o._$generics&&null!==o._$generics){const e=this._$generics=[],s=Object.create(null);this._$genericDefaults=s;const i=Object.keys(o._$generics);for(let r=0;r<i.length;r+=1){const l=i[r],a=o._$generics[l];let d=null;const c=!0===a||null==a?void 0:a.default;if(void 0!==c)if(c instanceof mt)d=c;else if(n){const e=String(c);d=n.getComponentByUrlWithoutDefault(e,t)||n.getGlobalUsingComponent(e)}else k(new Error(`cannot define generic "${l}" without a default implementor.`),"[prepare]",t);e.push(l),s[l]=d}}const r=o._$staticData;r&&(this._$staticData?ue(this._$staticData,r):this._$staticData=r);const l=o._$methods;for(let e=0;e<l.length;e+=1){const{name:t,func:n}=l[e];this._$methodMap[t]=n}const a=o._$properties;if(void 0!==a){const e=[];for(let n=0;n<a.length;n+=1){const{name:o,def:s}=a[n],i="string"===(d=s)||d===String?{type:"string",optionalTypes:null,value:"",default:void 0,observer:null,comparer:null,reflectIdPrefix:!1}:"number"===d||d===Number?{type:"number",optionalTypes:null,value:0,default:void 0,observer:null,comparer:null,reflectIdPrefix:!1}:"boolean"===d||d===Boolean?{type:"boolean",optionalTypes:null,value:!1,default:void 0,observer:null,comparer:null,reflectIdPrefix:!1}:"object"===d||d===Object?{type:"object",optionalTypes:null,value:null,default:void 0,observer:null,comparer:null,reflectIdPrefix:!1}:"array"===d||d===Array?{type:"array",optionalTypes:null,value:[],default:void 0,observer:null,comparer:null,reflectIdPrefix:!1}:"function"===d||d===Function?{type:"function",optionalTypes:null,value(){},default:void 0,observer:null,comparer:null,reflectIdPrefix:!1}:"any"===d||null==d?{type:"any",optionalTypes:null,value:null,default:void 0,observer:null,comparer:null,reflectIdPrefix:!1}:null;let r;if(null!==i)r=i;else{const e=s;let n=pe(e.type),i=null;Array.isArray(e.optionalTypes)&&(i=e.optionalTypes.map(pe),i.length>0&&("invalid"!==n&&"any"!==n||(n=i[0]))),"invalid"===n&&k(new Error(`the type of property "${o}" is illegal`),"[prepare]",t);let l,a,d=e.value;void 0===e.value?d="string"===n?"":"number"===n?0:"boolean"!==n&&("array"===n?[]:null):void 0!==e.default&&O(`the initial value of property "${o}" is not used when its default is provided.`,t),"function"==typeof e.observer?l=e.observer:"string"==typeof e.observer?(l=this._$methodMap[e.observer]||null,l||k(new Error(`Cannot find method "${e.observer}" for observer of property "${o}".`),"[prepare]",t)):(l=null,void 0!==e.observer&&k(new Error(`The observer of property "${o}" is not a function, got "${typeof e.observer}".`),"[prepare]",t)),"function"==typeof e.comparer?a=e.comparer:(a=null,void 0!==e.comparer&&k(new Error(`the comparer of property "${o}" is not a function.`),"[prepare]",t));const c=!!e.reflectIdPrefix;r={type:n,optionalTypes:i,value:d,default:e.default,observer:l,comparer:a,reflectIdPrefix:c}}this._$propertyMap[o]=r,e.push({name:o,func:void 0===r.default?()=>ie(r.value):r.default})}this._$data.push((()=>{const n={};for(let o=0;o<e.length;o+=1){const{name:s,func:i}=e[o];n[s]=c(`Property "${s}" Default`,i,null,[],t)}return n}))}var d;this._$data.push(...o._$data);const h=o._$observers;if(void 0!==h)for(let e=0;e<h.length;e+=1){const{dataPaths:n,func:o,once:s}=h[e],i="function"==typeof o?o:this._$methodMap[o];"function"==typeof i?this._$observers.push({dataPaths:n,observer:i,once:s}):k(new Error(`the "${String(i)}" observer is not a function.`),"[prepare]",t)}const u=o._$lifetimes;this._$lifetimes.push(...u);const p=o._$pageLifetimes;p&&(this._$pageLifetimes||(this._$pageLifetimes=[]),this._$pageLifetimes.push(...p));const f=o._$listeners;if(void 0!==f){const e=Object.keys(f);if(e.length>0){this._$listeners=[];for(let n=0;n<e.length;n+=1){const o=e[n],s=f[o],i="function"==typeof s?s:this._$methodMap[s];if(i){const e=o.indexOf(".");let t,n;e>=0?(t=o.slice(0,e),n=o.slice(e+1)):(t="",n=o),this._$listeners.push({id:t,ev:n,listener:i})}else k(new Error(`the "${o}" listener is not a function or a method name`),"[prepare]",t)}}}const $=o._$relations;if(void 0!==$){this._$relationMap||(this._$relationMap=Object.create(null));for(let e=0;e<$.length;e+=1){const{name:o,rel:s}=$[e];if(null==s)continue;const i=Ue(n,t,o,s);i&&(this._$relationMap[o]=i)}}this._$init.push(...o._$init),s.add(this)}getTemplate(){return this._$template}_$updateTemplate(e){this._$template=e}hasBehavior(e){if(this._$unprepared&&this.prepare(),e instanceof Ct)return this._$flatAncestors.has(e);if(this.ownerSpace){const t=this.ownerSpace.getBehaviorByUrl(e,this.is);return!!t&&this._$flatAncestors.has(t)}return!1}getMethods(){return this._$methodMap}_$generateObserverTree(){const e=new ge(this._$propertyMap),t=this._$observers;for(let n=0;n<t.length;n+=1){const{dataPaths:o,observer:s}=t[n];e.addObserver(s,o)}return e}_$getAllLifetimeFuncs(){const e=Object.create(null),t=this._$lifetimes;for(let n=0;n<t.length;n+=1){const{name:o,func:s}=t[n];if(e[o])e[o].add(s);else{(e[o]=new l("lifetime")).add(s)}}return e}_$getAllPageLifetimeFuncs(){const e=Object.create(null),t=this._$pageLifetimes;if(!t)return e;for(let n=0;n<t.length;n+=1){const{name:o,func:s}=t[n];if(e[o])e[o].add(s);else{(e[o]=new l("pageLifetime")).add(s)}}return e}}var wt;exports.ElementIteratorType=void 0,(wt=exports.ElementIteratorType||(exports.ElementIteratorType={})).ShadowAncestors="shadow-ancestors",wt.ComposedAncestors="composed-ancestors",wt.ShadowDescendantsRootFirst="shadow-descendants-root-first",wt.ShadowDescendantsRootLast="shadow-descendants-root-last",wt.ComposedDescendantsRootFirst="composed-descendants-root-first",wt.ComposedDescendantsRootLast="composed-descendants-root-last";class Nt{constructor(e,t,n=Pe){if(!m(e)&&!g(e))throw new Error("Element iterators can only be used in elements or text nodes");if(this._$node=e,this._$nodeTypeLimit=n||Pe,"shadow-ancestors"===t||"shadow-descendants-root-first"===t||"shadow-descendants-root-last"===t)this._$composed=!1;else{if("composed-ancestors"!==t&&"composed-descendants-root-first"!==t&&"composed-descendants-root-last"!==t)throw new Error(`Unrecognized iterator type "${String(t)}"`);this._$composed=!0}this._$isAncestor="shadow-ancestors"===t||"composed-ancestors"===t,this._$rootFirst="shadow-descendants-root-first"===t||"composed-descendants-root-first"===t}static create(e,t,n){return new Nt(e,t,n)}[Symbol.iterator](){return this._$getIterator()}*_$getIterator(){const e=this._$nodeTypeLimit,t=this._$composed;if(this._$isAncestor){let n=this._$node;for(;;){if(n instanceof e&&!1===(yield n))return;let o;if(o=t?n.getComposedParent():n.parentNode,!o)break;n=o}}else{const n=this._$rootFirst,o=function*(s){if(!(n&&s instanceof e&&!1===(yield s))){if(m(s))if(t){const e=s.iterateComposedChild();for(let t=e.next();!t.done;t=e.next())yield*o(t.value)}else{const e=s.childNodes;for(let t=0;t<e.length;t+=1){const n=e[t];yield*o(n)}}n||s instanceof e&&(yield s)}};yield*o(this._$node)}}forEach(e){const t=this._$nodeTypeLimit,n=this._$composed;if(this._$isAncestor){let o=this._$node;for(;;){if(o instanceof t&&!1===e(o))return;let s;if(s=n?o.getComposedParent():o.parentNode,!s)break;o=s}}else{const o=this._$rootFirst,s=i=>{if(o&&i instanceof t&&!1===e(i))return!1;if(m(i)){let e=!1;const t=t=>!1!==s(t)||(e=!0,!1);if(n?i.forEachComposedChild(t):i.childNodes.every(t),e)return!1}return!(!o&&i instanceof t&&!1===e(i))};s(this._$node)}}}var Et=Object.freeze({__proto__:null});const xt=Me.triggerEvent,kt=Me.triggerExternalEvent;exports.Behavior=Ct,exports.BehaviorBuilder=yt,exports.ClassList=j,exports.Component=St,exports.ComponentDefinition=mt,exports.ComponentSpace=K,exports.CurrentWindowBackendContext=class{constructor(){this.mode=3,this.document=document,this._$styleSheets=[],this._$styleSheetRegistry=Object.create(null),this._$delegatedEventListeners=Object.create(null),this._$elementEventListeners=new WeakMap,this._$elementCaptureEventListeners=new WeakMap,this._$triggedEvents=new WeakSet}destroy(){}getWindowWidth(){return document.documentElement.clientWidth}getWindowHeight(){return document.documentElement.clientHeight}getDevicePixelRatio(){return window.devicePixelRatio}getTheme(){return"light"}registerStyleSheetContent(e,t){this._$styleSheetRegistry[e]=String(t)}appendStyleSheetPath(e,t){const n=this._$styleSheetRegistry[e];if(void 0===n)throw new Error(`No style sheet registry "${e}"`);const o=document.createElement("style");o.type="text/css",o.innerHTML=n,void 0!==t&&o.setAttribute("wx-style-scope",String(t)),document.head.appendChild(o);const s=this._$styleSheets.length;return this._$styleSheets.push(o),s}disableStyleSheet(e){const t=this._$styleSheets[e];t&&document.head.removeChild(t)}render(e){window.requestAnimationFrame((()=>{c("Render Callback",e,this,[null])}))}getRootNode(){return document.body}associateValue(e,t){e.__wxElement=t}onEvent(e){this._$eventListener||this._$initEvent(),this._$eventListener=e}_$getEventDetail(e){const t={};let n=e;for(;Object.getPrototypeOf(n)!==Event.prototype;){const o=Object.keys(n);for(let n=0;n<o.length;n+=1){const s=o[n];"function"!=typeof e[s]&&(t[s]=e[s])}n=Object.getPrototypeOf(n)}return t}_$trigger(e,t,n,o,s){if(!this._$eventListener||!e.target)return;let i=e.target;for(;i&&!i.__wxElement;)i=i.parentNode;if(!i)return;1===this._$eventListener(i.__wxElement,t,n,{originalEvent:e,bubbles:o,composed:s,capturePhase:!0})&&e.preventDefault()}_$initEvent(){const e=Object.create(null);let t=!1;const n=(t,n)=>{e[n.identifier]={x:n.clientX,y:n.clientY}},o=(t,n)=>{const o=n.identifier;if(e[o]){const s=e[o];(Math.abs(s.x-n.clientX)>10||Math.abs(s.y-n.clientY)>10)&&(delete e[o],this._$trigger(t,"canceltap",s,!0,!0))}},s=(t,n)=>{const o=n.identifier;if(e[o]){const s=e[o];delete e[o],Math.abs(s.x-n.clientX)>10||Math.abs(s.y-n.clientY)>10?this._$trigger(t,"canceltap",s,!0,!0):this._$trigger(t,"tap",s,!0,!0)}},i=(t,n)=>{const o=n.identifier;if(e[o]){const n=e[o];delete e[o],this._$trigger(t,"canceltap",n,!0,!0)}},r=e=>{const t=e.changedTouches;for(let n=0;n<t.length;n+=1)s(e,t[n]);const n=e.target;n.__touchCount-=t.length,n.__touchCount<=0&&(n.__touchCount=0,n.removeEventListener("touchend",r),n.removeEventListener("touchcancel",l))},l=e=>{const t=e.changedTouches;for(let n=0;n<t.length;n+=1)i(e,t[n]);const n=e.target;n.__touchCount-=t.length,n.__touchCount<=0&&(n.__touchCount=0,n.removeEventListener("touchend",r),n.removeEventListener("touchcancel",l))};document.body.addEventListener("touchstart",(e=>{t=!0;const o=e.changedTouches;for(let e=0;e<o.length;e+=1)n(0,o[e]);const s=e.target;s.__touchCount||(s.__touchCount=0,s.addEventListener("touchend",r),s.addEventListener("touchcancel",l)),s.__touchCount+=o.length}),{capture:!0}),document.body.addEventListener("touchmove",(e=>{const t=e.changedTouches;for(let n=0;n<t.length;n+=1)o(e,t[n])}),{capture:!0}),document.body.addEventListener("mousedown",(e=>{t||n(0,{identifier:-1,clientX:e.clientX,clientY:e.clientY})}),{capture:!0}),document.body.addEventListener("mousemove",(e=>{t||o(e,{identifier:-1,clientX:e.clientX,clientY:e.clientY})}),{capture:!0}),document.body.addEventListener("mouseup",(e=>{t||s(e,{identifier:-1,clientX:e.clientX,clientY:e.clientY})}),{capture:!0})}setListenerStats(e,t,n,o){if(!e)return;const s=L.includes(t),i=2===o;if(s){if(this._$delegatedEventListeners[t])return;return this._$delegatedEventListeners[t]=!0,void document.body.addEventListener(t,(e=>{i&&e.preventDefault(),this._$trigger(e,t,this._$getEventDetail(e),e.bubbles,e.composed)}),{capture:!0})}const r=n?this._$elementCaptureEventListeners:this._$elementEventListeners;r.has(e)||r.set(e,Object.create(null));const l=r.get(e);l[t]||(l[t]=!0,e.addEventListener(t,(e=>{this._$triggedEvents.has(e)||(this._$triggedEvents.add(e),i&&e.preventDefault(),this._$trigger(e,t,this._$getEventDetail(e),e.bubbles,e.composed))})))}setModelBindingStat(e,t,n){const o=(o,s)=>{if(e._$wxArgs||(e._$wxArgs={modelListeners:Object.create(null)}),void 0===e._$wxArgs.modelListeners[t]){if(!n)return;e._$wxArgs.modelListeners[t]=n,e.addEventListener(o,(()=>{var n;const o=null===(n=e._$wxArgs)||void 0===n?void 0:n.modelListeners[t];null==o||o(s())}))}e._$wxArgs.modelListeners[t]=n},s=e.tagName;let i=!1;if("INPUT"===s){const n=e,s=n.type;"checkbox"===s||"radio"===s?"checked"===t&&(i=!0,o("change",(()=>n.checked))):"value"===t&&(i=!0,o("input",(()=>n.value)))}else if("TEXTAREA"===s){const n=e;"value"===t&&(i=!0,o("input",(()=>n.value)))}else if("SELECT"===s){const n=e;"value"===t&&(i=!0,o("change",(()=>n.value)))}i||O(`unsupported model binding on "${t}" of "${s.toLowerCase()}" element.`)}createIntersectionObserver(e,t,n,o,s){const i=new IntersectionObserver((e=>{e.forEach((e=>{s({intersectionRatio:e.intersectionRatio,boundingClientRect:e.boundingClientRect,intersectionRect:e.intersectionRect,relativeRect:e.rootBounds,time:e.time})}))}),{root:t,rootMargin:n,threshold:o});return i.observe(e),{disconnect(){i.disconnect()}}}createMediaQueryObserver(e,t){let n=null;const o=()=>{const o=(()=>{const t=document.documentElement.clientWidth,n=document.documentElement.clientHeight;return(void 0===e.width||t===e.width)&&(!(void 0!==e.maxWidth&&t>e.maxWidth)&&(!(void 0!==e.minWidth&&t<e.minWidth)&&((void 0===e.width||n===e.height)&&(!(void 0!==e.maxHeight&&n>e.maxHeight)&&(!(void 0!==e.minHeight&&n<e.minHeight)&&(t>n?"landscape":"portrait")===e.orientation)))))})();n!==o&&(n=o,t({matches:o}))};return setTimeout(o,0),window.addEventListener("resize",o),{disconnect(){window.removeEventListener("resize",o)}}}getContext(e,t){t(null)}},exports.DataGroup=Ce,exports.Element=Pe,exports.ElementIterator=Nt,exports.EmptyBackendContext=D,exports.EmptyComposedBackendContext=class{constructor(){this.mode=2,this._$styleSheetIdInc=1,this._$renderCallbacks=null,this._$rootNode=new B}destroy(){}getWindowWidth(){return 1}getWindowHeight(){return 1}getDevicePixelRatio(){return 1}getTheme(){return"light"}registerStyleSheetContent(e,t){}appendStyleSheetPath(e,t){const n=this._$styleSheetIdInc;return this._$styleSheetIdInc+=1,n}disableStyleSheet(e){}render(e){if(this._$renderCallbacks)this._$renderCallbacks.push(e);else{const t=this._$renderCallbacks=[e];setTimeout((()=>{this._$renderCallbacks=null,t.forEach((e=>{c("Render Callback",e,this,[null])}))}),16)}}getRootNode(){return this._$rootNode}createElement(e,t){return new B}createTextNode(e){return new B}createFragment(){return new B}onEvent(e){}createMediaQueryObserver(e,t){return{disconnect:()=>{}}}},exports.Event=Me,exports.FuncArr=l,exports.MutationObserver=de,exports.NativeNode=Ge,exports.Observer=de,exports.ParsedSelector=De,exports.ShadowRoot=ze,exports.StyleScopeManager=P,exports.TextNode=Ve,exports.TraitBehavior=G,exports.VirtualNode=We,exports.addGlobalErrorListener=function(e){E.add(e)},exports.addGlobalWarningListener=function(e){x.add(e)},exports.backend=n,exports.composedBackend=o,exports.createElement=function(e,t){return St.create(e,t||null)},exports.dataPath=oe,exports.dataUtils=le,exports.domlikeBackend=s,exports.dumpElement=(e,t)=>{console.log(w(e,t))},exports.dumpElementToString=w,exports.dumpSingleElementToString=C,exports.getDefaultComponentSpace=X,exports.globalOptions=i,exports.registerBehavior=e=>X().defineBehavior(e),exports.registerElement=e=>X().defineComponent(e),exports.removeGlobalErrorListener=function(e){E.remove(e)},exports.removeGlobalWarningListener=function(e){x.remove(e)},exports.safeCallback=c,exports.template=$t,exports.templateEngine=Et,exports.triggerEvent=xt,exports.triggerExternalEvent=kt,exports.triggerRender=(e,t)=>{const n=e.getBackendContext();n&&((e,t)=>{e.render((()=>{"function"==typeof t&&c("render",t,e,[null])}))})(n,t||null)},exports.typeUtils=F;
2
2
  //# sourceMappingURL=glass_easel.all.js.map