glass-easel 0.14.1 → 0.15.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.
Files changed (54) hide show
  1. package/dist/glass_easel.all.es.js +1 -1
  2. package/dist/glass_easel.all.es.js.map +1 -1
  3. package/dist/glass_easel.all.global.js +2 -0
  4. package/dist/glass_easel.all.global.js.map +1 -0
  5. package/dist/glass_easel.all.js +1 -1
  6. package/dist/glass_easel.all.js.map +1 -1
  7. package/dist/glass_easel.d.ts +113 -58
  8. package/dist/glass_easel.dev.all.es.js +1 -1
  9. package/dist/glass_easel.dev.all.es.js.map +1 -1
  10. package/dist/glass_easel.dev.all.global.js +2 -0
  11. package/dist/glass_easel.dev.all.global.js.map +1 -0
  12. package/guide/zh_CN/advanced/template_engine.md +1 -1
  13. package/guide/zh_CN/appendix/backend_protocol.md +9 -3
  14. package/package.json +2 -2
  15. package/rollup.config.ts +3 -0
  16. package/src/backend/backend_protocol.ts +7 -6
  17. package/src/backend/composed_backend_protocol.ts +1 -1
  18. package/src/backend/current_window_backend_context.ts +362 -36
  19. package/src/backend/empty_backend.ts +8 -13
  20. package/src/backend/shared.ts +12 -0
  21. package/src/backend/suggested_backend_protocol.ts +16 -14
  22. package/src/behavior.ts +77 -27
  23. package/src/component.ts +72 -38
  24. package/src/component_space.ts +2 -2
  25. package/src/data_proxy.ts +13 -0
  26. package/src/element.ts +120 -119
  27. package/src/event.ts +75 -5
  28. package/src/func_arr.ts +11 -1
  29. package/src/global_options.ts +2 -6
  30. package/src/index.ts +4 -2
  31. package/src/mutation_observer.ts +7 -0
  32. package/src/relation.ts +2 -2
  33. package/src/shadow_root.ts +2 -16
  34. package/src/text_node.ts +2 -0
  35. package/src/tmpl/native_rendering.ts +1 -4
  36. package/src/tmpl/proc_gen_wrapper.ts +60 -30
  37. package/src/tmpl/proc_gen_wrapper_dom.ts +6 -3
  38. package/tests/backend/domlike.test.ts +1 -3
  39. package/tests/base/composed_backend.ts +2 -0
  40. package/tests/base/env.ts +3 -1
  41. package/tests/base/match.ts +1 -1
  42. package/tests/base/shadow_backend.ts +201 -54
  43. package/tests/core/behavior.test.ts +111 -0
  44. package/tests/core/data_update.test.ts +53 -0
  45. package/tests/core/mutation_observer.test.ts +22 -0
  46. package/tests/core/slot.test.ts +59 -0
  47. package/tests/legacy/behavior.test.js +3 -0
  48. package/tests/legacy/component.test.js +1 -10
  49. package/tests/legacy/event.test.js +0 -1
  50. package/tests/legacy/external.test.js +0 -1
  51. package/tests/legacy/slot.test.js +0 -1
  52. package/tests/legacy/virtual.test.js +0 -1
  53. package/tests/tmpl/event.test.ts +246 -14
  54. package/tests/tmpl/structure.test.ts +99 -6
@@ -1,2 +1,2 @@
1
- var e;!function(e){e[e.Shadow=1]="Shadow",e[e.Composed=2]="Composed",e[e.Domlike=3]="Domlike"}(e||(e={}));var t,n=Object.freeze({__proto__:null,BM:{DYNAMIC:!0,SHADOW:!1,COMPOSED:!1,DOMLIKE:!1},get BackendMode(){return e}}),s=Object.freeze({__proto__:null}),o=Object.freeze({__proto__:null});"undefined"!=typeof process&&process.env.NODE_ENV,function(e){e.None="none",e.Simple="simple",e.SimpleWithRecursion="simple-recursion"}(t||(t={}));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:t.Simple,propertyPassingDeepCopy:t.Simple,listenerChangeLifetimes:!1,virtualHost:!1,propertyEarlyInit:!1,throwGlobalError:!1,writeExtraInfoToAttr:!1,backendContext:null,devTools:null},r=(e,t)=>{const n=void 0===t?i:t;if(void 0===e&&n!==i)return n;const s=null!=e?e:{};return{externalComponent:void 0!==s.externalComponent?s.externalComponent:n.externalComponent,templateEngine:void 0!==s.templateEngine?s.templateEngine:n.templateEngine,styleScope:void 0!==s.styleScope?s.styleScope:n.styleScope,hostNodeTagName:void 0!==s.hostNodeTagName?s.hostNodeTagName:n.hostNodeTagName,extraStyleScope:void 0!==s.extraStyleScope?s.extraStyleScope:n.extraStyleScope,multipleSlots:void 0!==s.multipleSlots?s.multipleSlots:n.multipleSlots,dynamicSlots:void 0!==s.dynamicSlots?s.dynamicSlots:n.dynamicSlots,directSlots:void 0!==s.directSlots?s.directSlots:n.directSlots,reflectToAttributes:void 0!==s.reflectToAttributes?s.reflectToAttributes:n.reflectToAttributes,writeFieldsToNode:void 0!==s.writeFieldsToNode?s.writeFieldsToNode:n.writeFieldsToNode,writeIdToDOM:void 0!==s.writeIdToDOM?s.writeIdToDOM:n.writeIdToDOM,useMethodCallerListeners:void 0!==s.useMethodCallerListeners?s.useMethodCallerListeners:n.useMethodCallerListeners,idPrefixGenerator:void 0!==s.idPrefixGenerator?s.idPrefixGenerator:n.idPrefixGenerator,pureDataPattern:void 0!==s.pureDataPattern?s.pureDataPattern:n.pureDataPattern,dataDeepCopy:void 0!==s.dataDeepCopy?s.dataDeepCopy:n.dataDeepCopy,propertyPassingDeepCopy:void 0!==s.propertyPassingDeepCopy?s.propertyPassingDeepCopy:n.propertyPassingDeepCopy,listenerChangeLifetimes:void 0!==s.listenerChangeLifetimes?s.listenerChangeLifetimes:n.listenerChangeLifetimes,virtualHost:void 0!==s.virtualHost?s.virtualHost:n.virtualHost,propertyEarlyInit:void 0!==s.propertyEarlyInit?s.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=[],s=this._$arr;for(let o=0;o<s.length;o+=1){if(s[o]===e){n.push(...s.slice(o+1)),t=e;break}n.push(s[o])}this._$arr=n,this.empty=0===this._$arr.length}return t}call(e,t,n){const s=this._$arr;let o=!0;if(s)for(let i=0;i<s.length;i+=1){!1===c(this._$type,s[i],e,t,n)&&(o=!1)}return o}}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=[],s=this._$arr;for(let o=0;o<s.length;o+=1){const i=s[o];if(i.f===e){n.push(...s.slice(o+1)),t=i.data;break}n.push(i)}this._$arr=n,this.empty=0===this._$arr.length}return t}call(e,t,n,s,o){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,s);!1===(o?o(h):h)&&(r=!1)}return r}}let d=()=>{};function c(e,t,n,s,o){try{return t.apply(n,s)}catch(n){return void d(n,`${e||"Listener"} ${t.name||"(anonymous)"}`,o)}}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],y=e=>!!e&&e[$],S=e=>!!e&&e[_],C=e=>{if(m(e)){let t;return t=b(e)?`(virtual):${e.is}`:S(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)||(S(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 s="";for(let e=n;e;e-=1)s+=" ";let o=s+C(e),i=!1;return m(e)&&(S(e)&&(i=e._$external),t?i?(o+=`\n${s} <(external)>`,e.forEachComposedChild((e=>{o+=`\n${w(e,t,n+2)}`}))):e.forEachComposedChild((e=>{o+=`\n${w(e,t,n+1)}`})):e.childNodes.forEach((e=>{o+=`\n${w(e,t,n+1)}`}))),o},N=(e,t)=>{console.log(w(e,t))};let E=!1;const k=new l("error"),x=new l("warning");function O(e,t,n,s){if(!E){E=!0,S(n)&&n.triggerLifetime("error",[e]);const o=!1===k.call(e,[e,t,n,s]);if(E=!1,o)return}if(i.throwGlobalError)throw e;console.error([e instanceof Error?`${e.message}`:String(e),s?`\t@${C(s)}`:void 0,n?`\t${t||""}@${"string"==typeof n?`<${n}>`:C(n||!1)}`:void 0].filter(Boolean).join("\n"))}function L(e,t,n){x.call(null,[e,t||"",n])&&console.warn(e)}d=O;class A extends Error{constructor(e,t,n,s){super(e),this.additionalStack=t,this.relatedComponent=n,this.element=s,O(this,t,n,s)}}function M(e){k.add(e)}function R(e){k.remove(e)}function T(e){x.add(e)}function D(e){x.remove(e)}const B=["touchstart","touchmove","touchend","touchcancel","mousedown","mousemove","mouseout","mouseover","mouseup","mouseenter","mouseleave","click"];class I{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 window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"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}"`);if(""===n){const e=this._$styleSheets.length;return this._$styleSheets.push(void 0),e}const s=document.createElement("style");s.type="text/css",s.innerHTML=n,void 0!==t&&s.setAttribute("wx-style-scope",String(t)),document.head.appendChild(s);const o=this._$styleSheets.length;return this._$styleSheets.push(s),o}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 s=Object.keys(n);for(let n=0;n<s.length;n+=1){const o=s[n];"function"!=typeof e[o]&&(t[o]=e[o])}n=Object.getPrototypeOf(n)}return t}_$trigger(e,t,n,s,o){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:s,composed:o,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}},s=(t,n)=>{const s=n.identifier;if(e[s]){const o=e[s];(Math.abs(o.x-n.clientX)>10||Math.abs(o.y-n.clientY)>10)&&(delete e[s],this._$trigger(t,"canceltap",o,!0,!0))}},o=(t,n)=>{const s=n.identifier;if(e[s]){const o=e[s];delete e[s],Math.abs(o.x-n.clientX)>10||Math.abs(o.y-n.clientY)>10?this._$trigger(t,"canceltap",o,!0,!0):this._$trigger(t,"tap",o,!0,!0)}},i=(t,n)=>{const s=n.identifier;if(e[s]){const n=e[s];delete e[s],this._$trigger(t,"canceltap",n,!0,!0)}},r=e=>{const t=e.changedTouches;for(let n=0;n<t.length;n+=1)o(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 s=e.changedTouches;for(let e=0;e<s.length;e+=1)n(0,s[e]);const o=e.target;o.__touchCount||(o.__touchCount=0,o.addEventListener("touchend",r),o.addEventListener("touchcancel",l)),o.__touchCount+=s.length}),{capture:!0}),document.body.addEventListener("touchmove",(e=>{const t=e.changedTouches;for(let n=0;n<t.length;n+=1)s(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||s(e,{identifier:-1,clientX:e.clientX,clientY:e.clientY})}),{capture:!0}),document.body.addEventListener("mouseup",(e=>{t||o(e,{identifier:-1,clientX:e.clientX,clientY:e.clientY})}),{capture:!0})}setListenerStats(e,t,n,s){if(!e)return;const o=B.includes(t),i=2===s;if(o){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 s=(s,o)=>{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(s,(()=>{var n;const s=null===(n=e._$wxArgs)||void 0===n?void 0:n.modelListeners[t];null==s||s(o())}))}e._$wxArgs.modelListeners[t]=n},o=e.tagName;let i=!1;if("INPUT"===o){const n=e,o=n.type;"checkbox"===o||"radio"===o?"checked"===t&&(i=!0,s("change",(()=>n.checked))):"value"===t&&(i=!0,s("input",(()=>n.value)))}else if("TEXTAREA"===o){const n=e;"value"===t&&(i=!0,s("input",(()=>n.value)))}else if("SELECT"===o){const n=e;"value"===t&&(i=!0,s("change",(()=>n.value)))}i||L(`unsupported model binding on "${t}" of "${o.toLowerCase()}" element.`)}createIntersectionObserver(e,t,n,s,o){const i=new IntersectionObserver((e=>{e.forEach((e=>{o({intersectionRatio:e.intersectionRatio,boundingClientRect:e.boundingClientRect,intersectionRect:e.intersectionRect,relativeRect:e.rootBounds,time:e.time})}))}),{root:t,rootMargin:n,threshold:s});return i.observe(e),{disconnect(){i.disconnect()}}}createMediaQueryObserver(e,t){let n=null;const s=()=>{const s=(()=>{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!==s&&(n=s,t({matches:s}))};return setTimeout(s,0),window.addEventListener("resize",s),{disconnect(){window.removeEventListener("resize",s)}}}getContext(e,t){t(e)}setFocusedNode(e){e.focus()}getFocusedNode(e){let t=document.activeElement;for(;!(null==t?void 0:t.__wxElement);)t=(null==t?void 0:t.parentNode)||null;e(t)}onWindowResize(e){window.addEventListener("resize",(()=>{e({width:this.getWindowWidth(),height:this.getWindowHeight(),devicePixelRatio:this.getDevicePixelRatio()})}))}onThemeChange(e){window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(()=>{e({theme:this.getTheme()})}))}elementFromPoint(e,t,n){var s;let o=document.elementFromPoint(e,t);for(;null!==o&&!o.__wxElement;)o=(null==o?void 0:o.parentNode)||null;n(null!==(s=null==o?void 0:o.__wxElement)&&void 0!==s?s:null)}getAllComputedStyles(e,t){const n=window.getComputedStyle(e);t({properties:P(n)})}getScrollOffset(e,t){const n=e;t({scrollLeft:n.scrollLeft,scrollTop:n.scrollTop,scrollWidth:n.scrollWidth,scrollHeight:n.scrollHeight})}setScrollPosition(e,t,n,s){if(t<=0&&n<=0)e.scrollIntoView({behavior:0!==s?"smooth":"auto"});else{const{left:o,top:i}=e.getBoundingClientRect();window.scrollTo({left:o+t,top:i+n,behavior:0!==s?"smooth":"auto"})}}queryMatchedRules(e,t,n){const s=[];return j(t,((t,o,i)=>{if(o instanceof CSSStyleRule){let r=!1;const l=[];for(let e=0;e<i.length;e+=1){const t=i[e];t instanceof CSSMediaRule?(matchMedia(t.conditionText).matches||(r=!0),l.push(`@media ${t.conditionText}`)):t instanceof CSSLayerBlockRule&&l.push(`@layer ${t.name}`)}const a=o.selectorText;if(n.matches(a)){const n=o.style.cssText,i=P(o.style);s.push({sheetIndex:e,ruleIndex:t,mediaQueries:l,selector:a,properties:i,propertyText:n,weightHighBits:0,inactive:r})}}})),s}getMatchedRules(e,t){const n=e,s=document.styleSheets,o=[];for(let e=0;e<s.length;e+=1){const t=s[e];o.push(...this.queryMatchedRules(e,t,n))}const i=n.style.cssText;t({inline:P(n.style),inlineText:i,rules:o})}findStyleRule(e,t){const n=document.styleSheets[e],s=null==n?void 0:n.cssRules[t];return"CSSStyleRule"===(null==s?void 0:s.constructor.name)?s:null}replaceStyleSheetAllProperties(e,t,n,s){const o=this.findStyleRule(e,t);o?(o.style.cssText=n,s(0)):s(null)}}const P=e=>{const t=[];for(let n=0;n<e.length;n+=1){const s=e[n],o="important"===e.getPropertyPriority(s),i=e.getPropertyValue(s);t.push({name:s,value:i,important:o})}return t},j=(e,t)=>{let n=0;const s=[],o=e=>{for(let i=0;i<e.length;i+=1){const r=e[i];r instanceof CSSConditionRule||r instanceof CSSLayerBlockRule?(s.push(r),o(r.cssRules),s.pop()):(t(n,r,s),n+=1)}};o(e.cssRules)};var F;!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"}(F||(F={}));class U{constructor(){this.mode=1,this._$styleSheetIdInc=1,this._$renderCallbacks=null,this._$shadowRoot=new G}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 V(0)}onEvent(e,t){}}class V{constructor(e){this._$shadowRoot=3===e?new G: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 G extends V{constructor(){super(4)}createElement(e,t){return new V(1)}createTextNode(e){return new V(2)}createComponent(e,t,n,s,o,i){return new V(3)}createVirtualNode(e){return new V(4)}}class W{constructor(){this.mode=2,this._$styleSheetIdInc=1,this._$renderCallbacks=null,this._$rootNode=new H}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 H}createTextNode(e){return new H}createFragment(){return new H}onEvent(e){}createMediaQueryObserver(e,t){return{disconnect:()=>{}}}}class H{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,s){return{disconnect:()=>{}}}getContext(e){e(null)}}const z=/[^\s.,]+/g,q=e=>{const t=[];let n;for(z.lastIndex=0;null!==(n=z.exec(e));)t.push(String(n[0]));return t};class X{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 K{constructor(e,t,n,s,o,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=s,this._$extraScope=o,this._$rootScope=(null==n?void 0:n._$owner)?n._$rootScope:s,this._$prefixManager=i,t&&(this._$externalNames=t,this._$externalRawAlias=[])}_$resolvePrefixes(e,t){const n=this._$owner,s=null==n?void 0:n._$externalNames,o=s?s.indexOf(e):-1;if(n&&-1!==o){this._$hasAliasNames=!0;const e=n._$externalRawAlias[o];if(e)for(let s=0;s<e.length;s+=1)n._$resolvePrefixes(e[s],t)}else if("~"===e[0])t(this._$rootScope,e.slice(1));else if("^"===e[0]){let n=e.slice(1),s=this._$owner;for(;"^"===n[0];)n=n.slice(1),s=null==s?void 0:s._$owner;t((null==s?void 0:s._$owner)?s._$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,s=t.length;e<s;e+=1)n[e]=String(t[e])}else n=q(String(t));const s=this._$externalNames.indexOf(e);-1!==s&&(this._$dirtyExternalNames=this._$dirtyExternalNames||[],this._$dirtyExternalNames.push(e),this._$externalRawAlias[s]=n)}_$getAlias(){var e;const t=Object.create(null);return null===(e=this._$externalNames)||void 0===e||e.forEach(((e,n)=>{t[e]=this._$externalRawAlias[n]})),t}_$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 s=this._$externalRawAlias[e]||[];for(let o=0;o<t.length;o+=1)s.includes(t[o])&&(this._$dirtyExternalNames=this._$dirtyExternalNames||[],this._$dirtyExternalNames.push(n[e]))}const s=this._$rawNames.some((e=>e.some((e=>t.includes(e)))));return s&&this._$updateResolvedNames(),!!this._$dirtyExternalNames||s}_$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],s=this._$externalNames.indexOf(n),o=this._$externalRawAlias[s]||[];this._$element._$backendElement.setClassAlias(n,o)}return this._$dirtyExternalNames=null,!1}return!0}_$markExternalClassUpdated(){this._$dirtyExternalNames=null}_$fasterAddUpdateResolvedNames(){const e=this._$element._$backendElement;if(!e)return!1;const t=this._$rawNames;this._$hasAliasNames=!1;for(let n=0,s=t.length;n<s;n+=1){const s=t[n];if(s)for(let t=0,n=s.length;t<n;t+=1){const n=s[t];1===this._$element.getBackendMode()?this._$addClass(n,void 0,e):this._$resolvePrefixes(n,((t,n)=>{this._$addClass(n,t,e)}))}}return!0}_$updateResolvedNames(){const e=this._$element._$backendElement;if(!e)return!1;const t=this._$rawNames,n=this._$backendNames,s=this._$backendNameScopes,o=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 s=!1;for(let e=0;e<i.length;e+=1)if(t===i[e]){l[e]+=1,s=!0;break}s||(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]===s[e]){l=!0,o[e]=0;break}l||(a=!0,this._$addClassToBackend(i[t],r[t],e))}for(let t=0;t<n.length;t+=1)0!==o[t]&&(a=!0,this._$removeClassFromBackend(n[t],s[t],e));return this._$backendNames=i,this._$backendNameScopes=r,this._$backendNamesCount=l,a}_$addClassToBackend(e,t,n){var s;if(3===this._$element.getBackendMode()){const o=void 0===t?"":null===(s=this._$prefixManager)||void 0===s?void 0:s.queryName(t),i=o?`${o}--${e}`:e;n.classList.add(i)}else 2===this._$element.getBackendMode()?n.addClass(e,t):n.addClass(e)}_$removeClassFromBackend(e,t,n){var s;if(3===this._$element.getBackendMode()){const o=t&&(null===(s=this._$prefixManager)||void 0===s?void 0:s.queryName(t)),i=o?`${o}--${e}`:e;n.classList.remove(i)}else 2===this._$element.getBackendMode()?n.removeClass(e,t):n.removeClass(e)}_$addClass(e,t,n){const s=this._$backendNames,o=this._$backendNameScopes,i=this._$backendNamesCount;let r=!1;for(let n=0;n<s.length;n+=1)if(e===s[n]&&t===o[n]){r=!0,i[n]+=1;break}r||(s.push(e),o.push(t),i.push(1),this._$addClassToBackend(e,t,n))}_$removeClass(e,t,n){const s=this._$backendNames,o=this._$backendNameScopes,i=this._$backendNamesCount;for(let r=0;r<s.length;r+=1)if(e===s[r]&&t===o[r]){i[r]<=1?(s.splice(r,1),o.splice(r,1),i.splice(r,1),this._$removeClassFromBackend(e,t,n)):i[r]-=1;break}}toggle(e,t,n=0){const s=this._$element._$backendElement,o=this._$rawNames[n]?this._$rawNames[n].indexOf(e):-1;let i=!1;if(void 0===t?-1===o:!!t){if(-1===o){const t=this._$rawNames;t[n]||(t[n]=[]);t[n].push(e),s&&(1===this._$element.getBackendMode()?this._$addClass(e,void 0,s):this._$resolvePrefixes(e,((e,t)=>{this._$addClass(t,e,s)}))),i=!0}}else if(-1!==o){const t=this._$rawNames[n];t&&t.splice(o,1),s&&(1===this._$element.getBackendMode()?this._$removeClass(e,void 0,s):this._$resolvePrefixes(e,((e,t)=>{this._$removeClass(t,e,s)}))),i=!0}return i}contains(e,t=0){const n=this._$rawNames[t]||[];for(let t=0;t<n.length;t+=1){const s=n[t];if("~"===s[0]){if(s.slice(1)===e)return!0}else if("^"===s[0]){let t=s.slice(1);for(;"^"===t[0];)t=t.slice(1);if(t===e)return!0}else if(s===e)return!0}return!1}setClassNames(e,t=0){let n;n=null==e?[]:Array.isArray(e)?q(e.join(" ")):q(String(e));const s=0===this._$rawNames.length;return this._$rawNames[t]=n,s?this._$fasterAddUpdateResolvedNames():this._$updateResolvedNames()}setClassNameList(e,t=0){const n=0===this._$rawNames.length;return this._$rawNames[t]=e.filter((e=>""!==e)),n?this._$fasterAddUpdateResolvedNames():this._$updateResolvedNames()}getClassNames(e=0){const t=this._$rawNames[e]||[];return t?t.join(" "):""}}const Y=Symbol("method");var Z=Object.freeze({__proto__:null,METHOD_TAG:Y});class Q{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 J{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 ee=(e,t)=>{let n;n="/"!==e[0]?t.split("/").slice(0,-1).concat(e.split("/")):e.split("/");const s=[];for(let e=0;e<n.length;e+=1){const t=n[e];""!==t&&"."!==t&&(".."!==t?s.push(t):s.pop())}return s.join("/")},te=(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:ee(e.slice(t+1),"")}}return{domain:e.slice(0,n+3),absPath:ee(e.slice(n+3),"")}}return{domain:null,absPath:ee(e,t)}};class ne{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);-1!==t&&this._$callbacks.splice(t,1)}call(e){for(;this._$callbacks.length>0;){this._$callbacks.shift()(e)}}}class se{constructor(e,t,n,s=!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,this._$sharedStyleScope=0,this.hooks={createTextNode:(e,t)=>e(t),createNativeNode:(e,t,n)=>e(t,n),createComponent:(e,t,n)=>e(t,n)},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 X,this._$allowUnusedNativeNode=s}updateComponentOptions(e){this._$componentOptions=r(e,this._$componentOptions)}getComponentOptions(){return this._$componentOptions}setSharedStyleScope(e){this._$sharedStyleScope=e}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:s}=te(e,t),o=this.getComponent(s,!0,n);if(!o)throw new Error(`There is no component "${s}" in the space and no default component can be used`);return o}getComponentByUrlWithoutDefault(e,t){const{domain:n,absPath:s}=te(e,t);return this.getComponent(s,!1,n)||null}getComponent(e,t=!0,n=null){let s;if(n){const e=this._$importedSpaces[n];if(e){const{space:t,privateUse:n}=e;s=n?t._$list:t._$pubList}}else s=this._$list;if(s){const t=s[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:s}=te(e,t);return this._$getBehavior(s,n)||null}_$getBehavior(e,t=null){let n;if(t){const e=this._$importedSpaces[t];if(e){const{space:t,privateUse:s}=e;n=s?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 Bt(t,this).definition(e).registerComponent()}defineBehavior(e){const t=e.is;return new Bt(t,this).definition(e).registerBehavior()}define(e){return new Bt(e,this)}defineWithMethodCaller(e){return new Bt(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:s}=e[t];n.call(s)}}}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 s=this._$pubListWaiting[e];s&&(delete this._$pubListWaiting[e],s.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:s}=te(e,t);let o,i,r;if(n){const e=this._$importedSpaces[n];if(!e)return null;if(i=e.space,r=!e.privateUse,r){if(i._$pubList[s])return null;o=i._$pubListWaiting}else{if(i._$list[s])return null;o=i._$listWaiting}}else{if(i=this,r=!1,this._$list[s])return null;o=this._$listWaiting}let l=o[s];return l||(l=o[s]=new ne(i,r,s),l)}setComponentWaitingListener(e){this._$componentWaitingListener=e}createComponentByUrl(e,t,n,s){let o=t,i=null;const r=o.indexOf("#");r>=0&&(o=o.slice(0,r));const l=o.indexOf("?");l>=0&&(i=o.slice(l+1),o=o.slice(0,l));const a=this.getComponentByUrl(o,"");let d=null;n&&(d=Object.create(null),Object.keys(n).forEach((e=>{const t=n[e],s=this.getComponentByUrl(t,"");d[e]=s})));return Dt.createWithGenericsAndContext(e,a,d,s,(e=>{if(i){let t=!1;i.split("&").forEach((n=>{const s=n.indexOf("=");if(s>=0){const o=decodeURIComponent(n.slice(0,s)),i=decodeURIComponent(n.slice(s+1));e._$dataGroup.replaceProperty(o,i)&&(t=!0)}})),t&&e.applyDataUpdates()}}))}defineTraitBehavior(e){return new Q(this,e)}}let oe=null;const ie=()=>{if(oe)return oe;const e=new se;return oe=e,e},re=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},le=e=>{const t=e.str;let n="";for(;e.cur<t.length;){const s=t[e.cur];if(!(s>="0"&&s<="9"))break;n+=s,e.cur+=1}if(!n)throw new Error(`data path descriptor "${t}" is illegal at char ${e.cur} (illegal index)`);return parseInt(n,10)},ae=e=>{const t=e.str;let n="";for(;e.cur<t.length;){const s=t[e.cur];if("\\"===s)if(e.cur+1===t.length);else{n+=t[e.cur+1],e.cur+=1}else if(/^[_a-zA-Z]$/.test(s))n+=s;else{if(!(s>="0"&&s<="9"))break;if(""===n)throw new Error(`data path descriptor "${t}" is illegal at char ${e.cur} (field name cannot start with digits)`);n+=s}e.cur+=1}return n},de=e=>{const t=e.str;let n="";for(;e.cur<t.length;){const s=t[e.cur];if("\\"===s)if(e.cur+1===t.length)n+="\\",e.cur+=1;else{const s=t[e.cur+1];"."===s||"["===s||"]"===s||"\\"===s?(n+=s,e.cur+=2):(n+="\\",e.cur+=1)}else{if("."===s||"["===s)break;n+=s,e.cur+=1}}return n},ce=e=>{const t=e.str;if(re(e),"*"===t[e.cur]&&"*"===t[e.cur+1])return e.cur+=2,["**"];const n=ae(e);if(!n)throw new Error(`data path descriptor "${t}" is illegal at char ${e.cur} (first field name illegal)`);const s=[n];for(;e.cur<t.length&&re(e);){const n=t[e.cur];if("."===n){if(e.cur+=1,re(e),"*"===t[e.cur]&&"*"===t[e.cur+1]){s.push("**"),e.cur+=2;break}const n=ae(e);if(!n)throw new Error(`data path descriptor "${t}" is illegal at char ${e.cur} (field name illegal)`);s.push(n)}else{if("["!==n)break;{e.cur+=1,re(e);const n=le(e);re(e);if("]"!==t[e.cur])throw new Error(`data path descriptor "${t}" is illegal at char ${e.cur} (illegal index)`);e.cur+=1,s.push(n)}}}return s},he=e=>{const t=(e=>{const t=e.str,n=[];for(;e.cur<t.length;){const s=t[e.cur];if("."===s){e.cur+=1;const t=de(e);""!==t&&n.push(t)}else if("["===s){e.cur+=1;const s=le(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(s)}else{const t=de(e);n.push(t)}}return 0===n.length&&n.push(""),n})({str:e,cur:0});return t},ue=e=>{if("string"!=typeof e)return e.map((e=>ce({str:e,cur:0})));const t={str:e,cur:0},n=(e=>{const t=[];for(t.push(ce(e)),re(e);","===e.str[e.cur];)e.cur+=1,t.push(ce(e)),re(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 pe=Object.freeze({__proto__:null,parseMultiPaths:ue,parseSinglePath:he});const fe=(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 s=0;s<e.length;s+=1)n[s]=fe(e[s],t);return n}const s={};t.set(e,s);const o=Object.keys(e);for(let n=0;n<o.length;n+=1){const i=o[n];s[i]=fe(e[i],t)}return s}return"symbol"==typeof e?Symbol(e.description):e},$e=e=>{if("object"==typeof e&&null!==e){if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n+=1)t[n]=$e(e[n]);return t}const t={},n=Object.keys(e);for(let s=0;s<n.length;s+=1){const o=n[s];t[o]=$e(e[o])}return t}return"symbol"==typeof e?Symbol(e.description):e},_e=(e,t)=>t?fe(e,new WeakMap):$e(e);var ge;!function(e){e[e.Disabled=0]="Disabled",e[e.Enabled=1]="Enabled",e[e.Destroyed=2]="Destroyed"}(ge||(ge={}));var me=Object.freeze({__proto__:null,get AutoDestroyState(){return ge},deepCopy:_e,simpleDeepCopy:$e});class ve{constructor(e){this._$subtreeObserversCount=0,this.attrObservers=null,this.allAttrObservers=null,this.textObservers=null,this.childObservers=null,this.attachObservers=null,this._$bound=e}attachChild(e){e._$mutationObserverTarget||(e._$mutationObserverTarget=new ve(e)),this._$subtreeObserversCount>0&&e._$mutationObserverTarget.updateSubtreeCount(this._$subtreeObserversCount)}detachChild(e){e._$mutationObserverTarget&&e._$mutationObserverTarget.updateSubtreeCount(-this._$subtreeObserversCount)}updateSubtreeCount(e){this._$subtreeObserversCount+=e;const t=this._$bound;if(!m(t))return;t.childNodes.forEach((t=>{t._$mutationObserverTarget||(t._$mutationObserverTarget=new ve(t)),t._$mutationObserverTarget.updateSubtreeCount(e)}))}hasSubtreeListeners(){return this._$subtreeObserversCount>0}static callAttrObservers(e,t){var n;let s=e;do{const e=s._$mutationObserverTarget;null===(n=null==e?void 0:e.allAttrObservers)||void 0===n||n.call(s,[t]),!(null==e?void 0:e.attrObservers)||"basic"!==t.nameType&&"attribute"!==t.nameType&&"component-property"!==t.nameType||e.attrObservers.call(s,[t]);const o=s.parentNode;if(!o)break;if(s=o,!s._$mutationObserverTarget)break}while(s._$mutationObserverTarget._$subtreeObserversCount>0)}static callTextObservers(e,t){var n;let s=e;do{const e=s._$mutationObserverTarget;null===(n=null==e?void 0:e.textObservers)||void 0===n||n.call(s,[t]);const o=s.parentNode;if(!o)break;if(s=o,!s._$mutationObserverTarget)break}while(s._$mutationObserverTarget._$subtreeObserversCount>0)}static callChildObservers(e,t){var n;let s=e;do{const e=s._$mutationObserverTarget;null===(n=null==e?void 0:e.childObservers)||void 0===n||n.call(s,[t]);const o=s.parentNode;if(!o)break;if(s=o,!s._$mutationObserverTarget)break}while(s._$mutationObserverTarget._$subtreeObserversCount>0)}static callAttachObservers(e,t){var n;const s=e._$mutationObserverTarget;null===(n=null==s?void 0:s.attachObservers)||void 0===n||n.call(e,[t])}}class be{constructor(e){this._$subtreeListenersCount=0,this._$boundFuncArrs=[],this._$boundTarget=null,this._$listener=e,this._$normalizedListener=null}static create(e){return new be(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 s;e._$mutationObserverTarget?s=e._$mutationObserverTarget:(s=new ve(e),e._$mutationObserverTarget=s),this._$listener=null;const o=t.subtree?n:function(e){e.target===this&&n.call(this,e)};this._$normalizedListener=o,this._$boundTarget=s,"all"===t.properties?(s.allAttrObservers||(s.allAttrObservers=new l("attributeObserver")),s.allAttrObservers.add(o),this._$boundFuncArrs.push(s.allAttrObservers),this._$subtreeListenersCount+=1):t.properties&&(s.attrObservers||(s.attrObservers=new l("attributeObserver")),s.attrObservers.add(o),this._$boundFuncArrs.push(s.attrObservers),this._$subtreeListenersCount+=1),t.childList&&(s.childObservers||(s.childObservers=new l("childObserver")),s.childObservers.add(o),this._$boundFuncArrs.push(s.childObservers),this._$subtreeListenersCount+=1),t.characterData&&(s.textObservers||(s.textObservers=new l("textObserver")),s.textObservers.add(o),this._$boundFuncArrs.push(s.textObservers),this._$subtreeListenersCount+=1),t.subtree&&s.updateSubtreeCount(this._$subtreeListenersCount),t.attachStatus&&(s.attachObservers||(s.attachObservers=new l("attachObserver")),s.attachObservers.add(o),this._$boundFuncArrs.push(s.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)}))}}var ye=Object.freeze({__proto__:null,MutationObserver:be,MutationObserverTarget:ve});const Se=Object.prototype.hasOwnProperty;var Ce;!function(e){e.Invalid="invalid",e.Any="any",e.String="string",e.Number="number",e.Boolean="boolean",e.Object="object",e.Array="array",e.Function="function"}(Ce||(Ce={}));const we=(e,t)=>{const n=Object.keys(t);for(let s=0;s<n.length;s+=1){const o=n[s];if(Object.prototype.hasOwnProperty.call(e,o))if("_"===o[0]&&L(`data field "${o}" from different behaviors is overriding or merging.`),"object"!=typeof e[o]||"object"!=typeof t[o]||null===t[o]||Array.isArray(t[o]))e[o]=t[o];else{if(Array.isArray(e[o]))e[o]=e[o].slice();else{const t=e[o],n={},s=Object.keys(t);for(let e=0;e<s.length;e+=1){const o=s[e];n[o]=t[o]}e[o]=n}we(e[o],t[o])}else e[o]=t[o]}},Ne=e=>{switch(e){case"string":return"";case"number":return 0;case"boolean":return!1;case"array":return[];case"function":return function(){};default:return null}},Ee=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",ke=(e,t,n)=>{const s=n.type,o=n.optionalTypes;if(o)for(let t=0;t<o.length;t+=1)if(xe(o[t],e))return e;return"string"===s?null==e?(L(`property "${t}" received type-incompatible value: expected <String> but get null value. Used default value instead.`),n.defaultFn()):("object"==typeof e&&L(`property "${t}" received type-incompatible value: expected <String> but got object-typed value. Force converted.`),String(e)):"number"===s?isFinite(e)?Number(e):(L("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.`),n.defaultFn()):"boolean"===s?!!e:"array"===s?Array.isArray(e)?e:(L(`property "${t}" received type-incompatible value: expected <Array> but got non-array value. Used default value instead.`),n.defaultFn()):"object"===s?"object"==typeof e?e:(L(`property "${t}" received type-incompatible value: expected <Object> but got non-object value. Used default value instead.`),n.defaultFn()):"function"===s?"function"==typeof e?e:(L(`property "${t}" received type-incompatible value: expected <Function> but got non-function value. Used default value instead.`),n.defaultFn()):void 0===e?n.defaultFn():e},xe=(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 Oe;!function(e){e[e.None=0]="None",e[e.Simple=1]="Simple",e[e.SimpleWithRecursion=2]="SimpleWithRecursion"}(Oe||(Oe={}));class Le{constructor(e){this.observerRoot={sub:{}},this.observers=[],this.propFields=e}cloneSub(){const e=new Le(this.propFields);return this.observers.length>0&&(e.observerRoot=$e(this.observerRoot),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 s=t[e];let o=this.observerRoot,i=!1;for(let e=0;e<s.length;e+=1){const t=s[e];if("**"===t){i=!0;break}o.sub[t]||(o.sub[t]={sub:{}}),o=o.sub[t]}i?o.wildcard?o.wildcard.push(n):o.wildcard=[n]:o.listener?o.listener.push(n):o.listener=[n]}}}const Ae=(e,t,n,s)=>{const o=new Array(n.length);for(let e=0;e<n.length;e+=1){const s=n[e];let i=t;for(let e=0;e<s.length;e+=1){const t=s[e];if("**"===t)break;if("object"!=typeof i||null===i){i=void 0;break}i=i[t]}o[e]=i}c("Data Observer",s,e.getMethodCaller(),o,e||void 0)},Me=(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 s=0;s<n.length;s+=1){const o=n[s];Me(e.sub[o],t)}},Re=(e,t,n)=>{let s=e,o=!0;for(let e=0;e<n.length;e+=1){const i=n[e];if(s.wildcard){const e=s.wildcard;for(let n=0;n<e.length;n+=1){t[e[n]]=!0}}if(!Se.call(s.sub,i)){o=!1;break}s=s.sub[i]}o&&Me(s,t)},Te=(e,t,n,s)=>{for(let o=0;o<e.length;o+=1){const{path:i,f:r}=e[o];t[o]&&(t[o]=!1,n&&Ae(n,s,i,r))}},De=e=>e===t.Simple?1:e===t.SimpleWithRecursion?2:0;class Be{_$generateInnerData(e){const t=this._$pureDataPattern,n=this._$dataDeepCopy;if(t||0!==n){const s={},o=Object.keys(e);for(let i=0;i<o.length;i+=1){const r=o[i],l=e[r];t&&t.test(r)||(s[r]=0===n?l:2===n?_e(l,!0):$e(l))}return s}return null}constructor(e,t,n,s,o,i,r){this._$modelBindingListener=null,this._$pendingChanges=[],this._$doingUpdates=null,this._$recUpdateLevel=0,this._$comp=e,this.data=t,this._$pureDataPattern=n,this._$dataDeepCopy=s,this._$propertyPassingDeepCopy=o,this._$reflectToAttributes=i&&!!e,this._$propFields=r.propFields,this._$observerTree=r,this._$observerStatus=new Array(r.observers.length),this.innerData=this._$generateInnerData(t)}static create(e){return new Be(null,e,null,0,0,!1,new Le({}))}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,s){Array.isArray(s)?this._$pendingChanges.push([e,s,null!=t?t:-1,n||0]):L(`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?_e(t,!0):$e(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,s=this._$comp,o=this._$pureDataPattern,i=this._$dataDeepCopy,r=!!this._$doingUpdates;let l,a;this._$observerTree.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=!!o&&o.test(_),m=!g&&this.innerData,v=n[_];let b=!0;if(v&&1===h.length){const t=this.data[_];let n,o,l;if($){if(Array.isArray(t)){const e=r,s=p;n=s>=0&&s<t.length?s:t.length,e[2]=n,t.splice(n,f,...u)}else L(`An array splice change cannot be applied to a non-array value (on path "${h.join(".")}"). The change is ignored.`);o=t}else o=ke(u,_,v);if(m){let e;if(0===i)r[1]=e=o;else if(void 0!==n){let t;e=this.innerData[_],r[1]=t=2===i?_e(u,!0):$e(u),e.splice(n,f,...t)}else r[1]=e=2===i?_e(o,!0):$e(o);this.innerData[_]=e}if(this.data[_]=o,this._$reflectToAttributes){const e=s.getBackendElement();if(e){let t=o;if(v.reflectIdPrefix){const e=s.ownerShadowRoot;if(e){const n=e.getHostNode()._$idPrefix;n&&(t=`${n}--${o}`)}}const n=_.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`)),i=typeof t;"boolean"===i?o?e.setAttribute(n,""):e.removeAttribute(n):"object"===i?e.setAttribute(n,JSON.stringify(t)):e.setAttribute(n,t)}}$||!0!==p?l=t!==o:(v.comparer?(r[2]=void 0,l=!!c("Property Comparer",v.comparer,s,[u,t],null==s?void 0:s.general())):l=t!==o,b=l),!g&&l&&a.push({propName:_,prop:v,oldValue:t,newValue:o,skipModelListener:e})}else{let t,n=this.data,s=_;for(let e=1;e<h.length;e+=1){const t=h[e];Number.isFinite(t)?(Se.call(n,s)&&Array.isArray(n[s])||(n[s]=[]),m||g||t>=n[s].length&&l.push([h.slice(0,e).concat("length"),!0,void 0,void 0])):Se.call(n,s)&&null!==n[s]&&"object"==typeof n[s]&&!Array.isArray(n[s])||(n[s]={}),n=n[s],s=t}if($){const e=n.length,o=n[s];if(Array.isArray(o)){const s=r,i=p;t=i>=0&&i<o.length?i:o.length,s[2]=t,o.splice(t,f,...u),m||g||n.length===e||l.push([h.concat("length"),!0,void 0,void 0])}else L(`An array splice change cannot be applied to a non-array value (on path "${h.join(".")}"). The change is ignored.`)}else n[s]=u;if(m){n=this.innerData,s=_;for(let e=1;e<h.length;e+=1){const t=h[e];Number.isFinite(t)?(Se.call(n,s)&&Array.isArray(n[s])||(n[s]=[]),t>=n[s].length&&l.push([h.slice(0,e).concat("length"),!0,void 0,void 0])):Se.call(n,s)&&null!==n[s]&&"object"==typeof n[s]&&!Array.isArray(n[s])||(n[s]={}),n=n[s],s=t}let e;if(0===i)r[1]=e=u;else if(void 0!==t){const o=n.length;let a;e=n[s],r[1]=a=2===i?_e(u,!0):$e(u),e.splice(t,f,...a),n.length!==o&&l.push([h.concat("length"),!0,void 0,void 0])}else r[1]=e=2===i?_e(u,!0):$e(u);n[s]=e}!g&&v&&a.push({propName:_,prop:v,oldValue:void 0,newValue:u,skipModelListener:e||!1})}Re(this._$observerTree.observerRoot,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,Te(this._$observerTree.observers,this._$observerStatus,s,this.data)}while(e!==this._$doingUpdates.count);this._$doingUpdates=null}if(this._$recUpdateLevel>0&&s&&L(`recursive update detected: a data update is applying during another data update for component "${s.is}" - this may disorder node trees`,s),this._$recUpdateLevel+=1,null===(t=this._$updateListener)||void 0===t||t.call(this,this.innerData||this.data,l),this._$recUpdateLevel-=1,s)for(let e=0;e<a.length;e+=1){const{propName:t,prop:n,oldValue:o,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,s.getMethodCaller(),[i,o],s),s._$mutationObserverTarget&&ve.callAttrObservers(s,{type:"properties",target:s,nameType:"component-property",propertyName:t})}}}}var Ie;!function(e){e[e.Normal=0]="Normal",e[e.NoDefault=1]="NoDefault"}(Ie||(Ie={}));let Pe=Date.now(),je=Pe;var Fe,Ue;!function(e){e[e.None=0]="None",e[e.Mut=1]="Mut",e[e.Final=2]="Final"}(Fe||(Fe={})),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"}(Ue||(Ue={}));class Ve{constructor(){this.listeners=Object.create(null),this.captureListeners=null}addListener(e,t,n={}){const s=n.final?2:n.mutated?1:0;let o,i,r;return n.capture||n.useCapture?this.captureListeners?o=this.captureListeners:(o=Object.create(null),this.captureListeners=o):o=this.listeners,o[e]?(r=!0,i=o[e]):(r=!1,i=o[e]={mutCount:0,finalCount:0,funcArr:new a("listener")}),i.funcArr.add(t,s),2===s?(i.finalCount+=1,r&&1!==i.finalCount?0:3):1===s?(i.mutCount+=1,!r||1===i.mutCount&&0===i.finalCount?4:0):r?0:2}removeListener(e,t,n={}){const s=n.capture||n.useCapture?this.captureListeners:this.listeners;if(!s)return 1;const o=s[e];if(!o)return 1;const i=o.funcArr.remove(t);return null===i?1:2===i?(o.finalCount-=1,0!==o.finalCount?0:o.mutCount>0?4:2):1===i?(o.mutCount-=1,0!==o.mutCount||0!==o.finalCount?0:2):0}}let Ge=class e{constructor(e,t,n={}){const s=(()=>{const e=Date.now();return e<je&&(Pe+=e-je),je=e,e-Pe})();this._$eventName=this.type=e,this.timeStamp=s,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 s=Object.create(this);return s.target=e,s.mark=t,s.currentTarget=n,s}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,s){const o=this._$eventName,i=e._$eventTarget;if(!i)return;const r=s?i.captureListeners:i.listeners;if(!r)return;const l=r[o];if(!l)return;const a=this.mutatedMarked(),d=S(n)&&n.getMethodCaller()||n,c=S(e)&&e.getMethodCaller()||e,h=this.wrapShadowedEvent(d,t,c);!1===l.funcArr.call(c,[h],(e=>!a||1!==e),S(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,s=this.bubbles,o=t&&!n,i=this._$eventBubblingControl,r=(e,t)=>{const s=e=>{let o=e;const i=e.collectMarks();for(;;){if(!1===t(o,e,i))return null;let r;if(n){if(y(o))return o.getHostNode();if(null===o.containingSlot)return null;if(o.containingSlot)r=s(o.containingSlot);else for(r=o.parentNode;null==r?void 0:r._$inheritSlots;)r=r.parentNode}else r=o.parentNode;if(!r)return null;o=r}};let o=e;for(;;){const e=s(o);if(!e)break;o=e}};if(this._$capturePhase&&!i.stopped&&!o){const t=[];r(e,((e,n,s)=>{t.push([e,n,s])}));for(let e=t.length-1;e>=0;e-=1){const[n,s,o]=t[e];if(n._$eventTarget&&(this.callListener(n,o,s,!0),i.stopped))break}}if(!i.stopped&&t&&S(e)&&e._$external&&e.shadowRoot.handleEvent(t,this),!i.stopped&&!o){let t=!0;r(e,((e,n,o)=>{if(!t&&S(e)&&e._$external){const t=e.shadowRoot;t.handleEvent(t.slot,this)}return t=!1,e._$eventTarget&&this.callListener(e,o,n,!1),s&&!i.stopped}))}}static dispatchEvent(e,t){return t.dispatch(e)}static dispatchExternalEvent(e,t,n){return n.dispatch(e,t)}static triggerEvent(t,n,s,o){const i=new e(n,s,o);e.dispatchEvent(t,i)}static triggerExternalEvent(t,n,s,o,i){const r=new e(s,o,i);e.dispatchExternalEvent(t,n,r)}};var We;!function(e){e[e.Child=0]="Child",e[e.Descendant=1]="Descendant",e[e.CrossShadowDescendant=2]="CrossShadowDescendant"}(We||(We={}));const He=e=>{var t;return null===(t=e.ownerShadowRoot)||void 0===t?void 0:t.getHostNode().getRootBehavior().ownerSpace};class ze{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 s=n[1].slice(1),o=n[2].split(".");return o.shift(),s||o.length?{id:s,classes:o,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),s=[];let o=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!==o)break;o=3===e.length?2:0;continue}const t=ze._$parseSegment(e,o);if(o=1,!t)break;s.push(t)}i===n.length&&(s.length&&this.unions.push(s))}}isEmpty(){return 0===this.unions.length}static _$testSelectorSegment(e,t,n,s,o,i){var r;if(n===e)return!1;const l=s[o];let a=!0;(He(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===o){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=y(c)?c.getHostNode():null:2===i?(a=!1,c=y(c)?c.getHostNode():null):c=null,c===e&&(c=null)}while(b(c));if(!c)return!1;if(a){if(ze._$testSelectorSegment(e,t,c,s,o-1,h))return!0;if(2!==i)return!1}return ze._$testSelectorSegment(e,t,c,s,o,i)}testSelector(e,t){if(b(t))return!1;const n=this.unions;let s;if(s=null!==e&&He(e)||He(t),void 0===s)return!1;for(let o=0;o<n.length;o+=1){const i=n[o];if(ze._$testSelectorSegment(e,s,t,i,i.length-1,0))return!0}return!1}query(e,t){const n=[],s=(e,t,o)=>{if(this.testSelector(e,t)){if(o)return t;n.push(t)}if(S(t)){const n=t.getShadowRoot();if(n){const t=s(e,n,o);if(t&&o)return t}}const i=t.childNodes;for(let t=0;t<i.length;t+=1){const n=i[t];if(m(n)){const t=s(e,n,o);if(t&&o)return t}}return null},o=s(e,e,t);return t?o:n}}var qe;!function(e){e[e.MAIN=0]="MAIN",e[e.TEMPLATE_EXTRA=1]="TEMPLATE_EXTRA",e[e.ANIMATION_EXTRA=2]="ANIMATION_EXTRA",e[e.TEMP_EXTRA=3]="TEMP_EXTRA"}(qe||(qe={}));const Xe={mode:1,destroyed:!0},Ke={mode:2,destroyed:!0},Ye={mode:3,destroyed:!0};class Ze{constructor(){throw new Error("Element cannot be constructed directly")}_$initialize(e,t,n,s){this._$backendElement=t,this._$destroyOnRemoval=0,this._$nodeTreeContext=s,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 Ve}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,s=t?`${t}--${n}`:n,o=this._$backendElement;o&&(3===this.getBackendMode()?o.id=s:o.setId(s))}}i.writeExtraInfoToAttr&&(null===(t=this._$backendElement)||void 0===t||t.setAttribute("exparser:info-attr-id",n)),this._$mutationObserverTarget&&ve.callAttrObservers(this,{type:"properties",target:this,nameType:"basic",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=Ze._$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=Ze._$updateSubtreeSlotNodes(this.parentNode,[this],n,n,this.parentIndex);null==t||t.removeSlotNodes();const s=this.containingSlot;null==t||t.updateContainingSlot();const o=this.containingSlot;Ze.insertChildReassign(this.parentNode,this,s,o,this.parentIndex+1),null==t||t.insertSlotNodes()}this._$mutationObserverTarget&&ve.callAttrObservers(this,{type:"properties",target:this,nameType:"basic",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}asShadowRoot(){return y(this)?this:null}asGeneralComponent(){return S(this)?this:null}asInstanceOf(e){return S(this)?this.asInstanceOf(e):null}getBackendContext(){const e=this._$nodeTreeContext;return e===Xe||e===Ke||e===Ye?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=Ke:3===this.getBackendMode()?this._$nodeTreeContext=Ye:this._$nodeTreeContext=Xe}destroyBackendElementOnSubtree(){const e=function(t){for(let n=0;n<t.childNodes.length;n+=1){const s=t.childNodes[n];m(s)?e(s):s.destroyBackendElement()}if(S(t)){const n=t.getShadowRoot();n&&e(n)}t.destroyBackendElement()};e(this)}destroyBackendElementOnRemoval(){this._$destroyOnRemoval=1}cancelDestroyBackendElementOnRemoval(){this._$destroyOnRemoval=0}destroyBackendElementOnDetach(){this._$destroyOnRemoval=1}cancelDestroyBackendElementOnDetach(){this._$destroyOnRemoval=0}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&&ve.callAttrObservers(this,{type:"properties",target:this,nameType:"basic",attributeName:"class"})}setNodeClassList(e,t=0){var n;(null===(n=this.classList)||void 0===n?void 0:n.setClassNameList(e,t))&&this._$mutationObserverTarget&&ve.callAttrObservers(this,{type:"properties",target:this,nameType:"basic",attributeName:"class"})}toggleNodeClass(e,t,n=0){var s;(null===(s=this.classList)||void 0===s?void 0:s.toggle(e,t,n))&&this._$mutationObserverTarget&&ve.callAttrObservers(this,{type:"properties",target:this,nameType:"basic",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&&ve.callAttrObservers(this,{type:"properties",target:this,nameType:"basic",attributeName:"style"})}static checkAndCallAttached(e){!function e(t){if(m(t)&&!t._$attached){if(t._$attached=!0,S(t)){t.triggerLifetime("attached",[]),t._$relation&&(t._$relation.triggerLinkEvent(2,!1),t._$relation.triggerLinkEvent(4,!1),t._$relation.triggerLinkEvent(0,!1)),t._$mutationObserverTarget&&ve.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){if(function e(t){if(m(t)&&t._$attached)if(S(t)&&t.triggerLifetime("beforeDetach",[]),t.childNodes.forEach(e),S(t)){const n=t.getShadowRoot();n&&e(n),t._$attached=!1,t.triggerLifetime("detached",[]),t._$relation&&(t._$relation.triggerLinkEvent(2,!0),t._$relation.triggerLinkEvent(4,!0),t._$relation.triggerLinkEvent(0,!0)),t._$mutationObserverTarget&&ve.callAttachObservers(t,{type:"attachStatus",target:t,status:"detached"})}else t._$attached=!1}(e),m(e)){const t=function(n){if(2===e._$destroyOnRemoval)return;for(let e=0;e<n.childNodes.length;e+=1){const s=n.childNodes[e];m(s)?t(s):1===s._$destroyOnRemoval&&(s._$destroyOnRemoval=2,s.destroyBackendElement())}if(S(n)){const e=n.getShadowRoot();e&&t(e)}1===n._$destroyOnRemoval&&(n._$destroyOnRemoval=2,n.destroyBackendElement());const s=n._$placeholderHandlerRemover;"function"==typeof s&&s()};t(e)}else 1===e._$destroyOnRemoval&&(e._$destroyOnRemoval=2,e.destroyBackendElement())}static checkAndCallMoved(e){!function e(t){if(m(t)&&t._$attached&&(t.childNodes.forEach(e),S(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 s;const o=e._$mutationObserverTarget;if(o&&(!(null===(s=o.childObservers)||void 0===s?void 0:s.empty)||o.hasSubtreeListeners())){const s=[n];let o;o="add"===t?{type:"childList",target:e,addedNodes:s}:"remove"===t?{type:"childList",target:e,removedNodes:s}:{type:"childList",target:e,addedNodes:s,removedNodes:s},ve.callChildObservers(e,o)}}static hasSubtreeMutationObservers(e){var t;return(null===(t=e._$mutationObserverTarget)||void 0===t?void 0:t.hasSubtreeListeners())||!1}static _$insertChildReassignSlot(e,t,n,s){if(n)if(s){const e=[...n.slotNodes];for(let t=0;t<e.length;t+=1){const o=e[t];Ze._$spliceSlotNodes(n,0,1,void 0),Ze._$spliceSlotNodes(s,-1,0,[o]),Ze._$updateContainingSlot(o,s),o._$inheritSlots||Ze.insertChildReassign(o.parentNode,o,n,s,o.parentIndex)}}else{const e=[...n.slotNodes];for(let t=0;t<e.length;t+=1){const o=e[t];Ze._$spliceSlotNodes(n,0,1,void 0),Ze._$updateContainingSlot(o,s),o._$inheritSlots||Ze.insertChildReassign(o.parentNode,o,n,null,o.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];Ze._$spliceSlotNodes(s,-1,0,[t]),Ze._$updateContainingSlot(t,s),t._$inheritSlots||Ze.insertChildReassign(t.parentNode,t,null,s,t.parentIndex)}}}static insertChildReassign(e,t,n,s,o){if(1!==e.getBackendMode()){if(n)if(s&&3===e.getBackendMode());else{const s=Ze.findNearestNonVirtual(n);if(s){const n=Ze.countNonVirtual(t);if(n){const[t,o]=n;if(3===e.getBackendMode()){const e=t._$backendElement;for(let t=1;t<o;t+=1){const t=e.nextSibling;t&&s.removeChild(t)}o>0&&s.removeChild(e)}else s.spliceRemove(t._$backendElement,o)}}}s&&Ze.insertChildComposed(e,t,void 0,!1,o)}else t._$backendElement.reassignContainingSlot(n?n._$backendElement:null,s?s._$backendElement:null)}static findNearestNonVirtual(e){let t=e;for(;null==t?void 0:t._$virtual;)t=y(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 s=e=>{0===n&&(t=e),n+=1};var o;return m(o=e)&&o._$virtual?o.forEachNonVirtualComposedChild(s):s(o),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 s=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(!s(t[e]))return!1;return!0}return!0};return s(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 s=e=>{if(e._$inheritSlots){const t=e.childNodes;for(let e=0;e<t.length;e+=1)if(!s(t[e]))return!1;return!0}return e.containingSlot!==t||!1!==n(e)};return s(e)}static _$findFirstNonVirtualChild(e,t){const n=null!==e._$slotName,s=n?e.slotNodes:e.childNodes;if(t>=0&&t<s.length)for(let e=t;e<s.length;e+=1){let t=null;const o=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(o):o(e)};if(i(s[e]),t)return t}const o=e=>{if(!e._$virtual)return null;const t=e.containingSlot;if(null===t)return null;if(void 0!==t)return Ze._$findFirstNonVirtualChild(t,e.slotIndex+1);if(y(e))return o(e.getHostNode());const n=e.parentNode;return n?Ze._$findFirstNonVirtualChild(n,e.parentIndex+1):null};return o(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 Ze._$findFirstNonVirtualChild(n,e.slotIndex+1);const s=Ze._$findSlotNodeInsertPosition(n,e,t);return Ze._$findFirstNonVirtualChild(n,s)}let s=e;if(y(e))return s=e.getHostNode(),s._$virtual?Ze._$findFirstNonVirtualChild(s,s.parentIndex+1):null;const o=s.parentNode;return o?Ze._$findFirstNonVirtualChild(o,t):null}static insertChildComposed(e,t,n,s,o){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;S(h)?h._$external?p=h.shadowRoot.slot:d=!0:(h._$virtual&&(d=!0),p=Ze.findNearestNonVirtual(h));let f=null;const $=(i,r)=>{const l=i||(r?Ze.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};Ze.forEachNodeInSpecificSlot(t,r,(e=>{p||(p=e),e._$virtual?e.forEachNonVirtualComposedChild(n):n(e)}))}if(3!==e.getBackendMode()||l){if((n||d)&&(s&&n?(Ze.forEachSlotContentInSpecificSlot(n,r,(e=>{if(m(e)){const t=Ze.countNonVirtual(e);t&&(c||(c=t[0]),a+=t[1])}else c||(c=e),a+=1;return!0})),0===a&&h&&p&&(c=Ze._$findFirstNonVirtualSibling(void 0===r?t:p,o+1))):h&&p&&(c=Ze._$findFirstNonVirtualSibling(void 0===r?t:p,o))),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):s?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||s&&n&&n._$inheritSlots){const e=new Set;s&&n&&Ze.forEachSlotContentInSlot(n,((t,n)=>{e.add(n)})),t&&Ze.forEachSlotContentInSlot(t,((t,n)=>{e.add(n)})),e.forEach((e=>$(null,e)))}else t&&$(null,t.containingSlot),!s||!n||t&&n.containingSlot===t.containingSlot||$(null,n.containingSlot);3!==u.mode&&f&&f.release(),i.writeExtraInfoToAttr&&(s&&m(n)&&(null===(r=n._$backendElement)||void 0===r||r.removeAttribute("exparser:info-in-slot-of")),m(t)&&(S(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,s,o){if(!t||!n)return;let i=e,r=null,l=null;const a=(e,t)=>{if(e._$subtreeSlotStart){const n=e.childNodes;let s=t+1,o=n[s];for(;o&&!o._$subtreeSlotStart;)s+=1,o=n[s];return void(o?(l=o._$subtreeSlotStart,r=l.prev):(r=e._$subtreeSlotEnd,r&&(l=r.next)))}let n=e,s=e.parentNode;for(;s&&!s._$subtreeSlotStart;)n=s,s=s.parentNode;s&&a(s,n.parentIndex)};for(a(i,s),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,o)}static _$updateSubtreeSlotsRemoval(e,t,n,s){if(!t||!n)return;let o=e;const i=t.prev,r=n.next;for(i&&(i.next=r,t.prev=null),r&&(r.prev=i,n.next=null);o;){let e=!1;if(o._$subtreeSlotStart===t&&o._$subtreeSlotEnd===n&&(o._$subtreeSlotStart=o._$subtreeSlotEnd=null,e=!0),o._$subtreeSlotStart===t?(o._$subtreeSlotStart=r,e=!0):o._$subtreeSlotEnd===n&&(o._$subtreeSlotEnd=i,e=!0),!e||!o.parentNode)break;o=o.parentNode}const l=o.ownerShadowRoot;(null==l?void 0:l.isConnected(o))&&l._$applySlotsRemoval(t,n,s)}static _$updateSubtreeSlotsReplacement(e,t,n,s,o,i,r){if(!t||!n)return void Ze._$updateSubtreeSlotsRemoval(e,s,o,r);if(!s||!o)return void Ze._$updateSubtreeSlotsInsertion(e,t,n,i,r);let l=e;const a=s.prev,d=o.next;for(a&&(a.next=t,t.prev=a,s.prev=null),d&&(d.prev=n,n.next=d,o.next=null);l;){let e=!1;if(l._$subtreeSlotStart===s&&(l._$subtreeSlotStart=t,e=!0),l._$subtreeSlotEnd===o&&(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(s,o,!1),c._$applySlotsInsertion(t,n,r))}static _$updateSubtreeSlotNodes(e,t,n,s,o){if(!n&&!s)return;const i=null==n?void 0:n.getSlotMode(),r=null==s?void 0:s.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 s=t[n];Ze.forEachNodeInSlot(s,(t=>{a&&(i?i+=1:(e=t.slotIndex,i=1)),l.push(t)}))}if(d&&l.length){const e=l[0];r=Ze._$findSlotNodeInsertPosition(d,e,o)}return{updateContainingSlot:()=>{for(let e=l.length-1;e>=0;e-=1){const t=l[e];Ze._$updateContainingSlot(t,d)}},removeSlotNodes:()=>{s&&a&&i&&Ze._$spliceSlotNodes(a,e,i,void 0)},insertSlotNodes:()=>{n&&d&&l.length&&Ze._$spliceSlotNodes(d,r,0,l)}}}const l=new Map,a=new Map,d=[];for(let e=0;e<t.length;e+=1){const s=t[e];Ze.forEachNodeInSlot(s,((e,t)=>{const s=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(s){const t=l.get(s);t?t.nodes.push(e):l.set(s,{nodes:[e],insertPos:-1})}d.push([e,s])}))}if(n&&l.size){const e=l.entries();for(let t=e.next();!t.done;t=e.next()){const[e,{nodes:n}]=t.value,s=n[0];t.value[1].insertPos=Ze._$findSlotNodeInsertPosition(e,s,o)}}return{updateContainingSlot:()=>{for(let e=d.length-1;e>=0;e-=1){const[t,n]=d[e];Ze._$updateContainingSlot(t,n)}},removeSlotNodes:()=>{if(s&&a.size){const e=a.entries();for(let t=e.next();!t.done;t=e.next()){const[e,{start:n,count:s}]=t.value;Ze._$spliceSlotNodes(e,n,s,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:s}]=t.value;Ze._$spliceSlotNodes(e,s,0,n)}}}}}static insertChildSingleOperation(e,t,n,s){var o,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=!!s&&(!!c&&t!==c),!h&&!t)return;if(t){if(u=t.parentNode,u){const n=u.childNodes,s=t.parentIndex;n.splice(s,1);for(let e=s;e<n.length;e+=1)n[e].parentIndex=e;t.parentIndex=-1,u===e&&s<d&&(d-=1);const i=Ze._$updateSubtreeSlotNodes(e,[t],null,Ze._$getParentHostShadowRoot(u),d);null==i||i.removeSlotNodes(),3===e.getBackendMode()||(1===e.getBackendMode()?null===(o=u._$backendElement)||void 0===o||o.removeChild(t._$backendElement,s):Ze.insertChildComposed(u,null,t,!0,s)),null==i||i.updateContainingSlot()}t.parentNode=e,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=Ze._$getParentHostShadowRoot(e),f=t?Ze._$updateSubtreeSlotNodes(e,[t],p,null,d):null,$=c&&h?Ze._$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 Ze.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,y=c?c._$subtreeSlotEnd:null;t?(u&&Ze._$updateSubtreeSlotsRemoval(u,g,v,!0),h?Ze._$updateSubtreeSlotsReplacement(e,g,v,b,y,d,!!u):Ze._$updateSubtreeSlotsInsertion(e,g,v,d,!!u)):h&&c&&Ze._$updateSubtreeSlotsRemoval(e,b,y,!1),null===(a=e.ownerShadowRoot)||void 0===a||a._$markIdCacheDirty(),h&&(Ze.checkAndCallDetached(c),Ze.checkChildObservers(e,"remove",c)),t&&((null==u?void 0:u._$attached)?e._$attached?Ze.checkAndCallMoved(t):Ze.checkAndCallDetached(t):e._$attached&&Ze.checkAndCallAttached(t),u===e?Ze.checkChildObservers(e,"move",t):(u&&Ze.checkChildObservers(u,"remove",t),Ze.checkChildObservers(e,"add",t)))}static insertChildBatchRemoval(e,t,n){var s,o;const i=e.childNodes[t];let r=e;for(;null==r?void 0:r._$inheritSlots;)r=r.parentNode;const l=S(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=Ze._$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)Ze.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===(s=e._$mutationObserverTarget)||void 0===s||s.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)}Ze._$updateSubtreeSlotsRemoval(e,h,u,!1),null===(o=e.ownerShadowRoot)||void 0===o||o._$markIdCacheDirty();for(let t=0;t<n;t+=1){const n=d[t];Ze.checkAndCallDetached(n),Ze.checkChildObservers(e,"remove",n)}}static insertChildBatchInsertion(e,t,n){var s,o;const i=n>=0?e.childNodes[n]:void 0;let r=e;for(;null==r?void 0:r._$inheritSlots;)r=r.parentNode;const l=S(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 o=t[n];if(e.ownerShadowRoot!==o.ownerShadowRoot)throw new Error("Cannot move the node from one shadow tree to another shadow tree.");if(o.parentNode)throw new Error("Cannot batch-insert the node which already has a parent.");if(o.parentNode=e,null===(s=e._$mutationObserverTarget)||void 0===s||s.attachChild(o),1===e.getBackendMode()&&a){const e=o._$backendElement;a.appendChild(e)}}const d=Ze._$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 s=t[n];e._$backendElement.insertBefore(s._$backendElement,i._$backendElement)}else for(let n=0;n<t.length;n+=1){const s=t[n];e._$backendElement.appendChild(s._$backendElement)}}else{const s=n>=0?n:e.childNodes.length;for(let n=0;n<t.length;n+=1){const o=t[n];Ze.insertChildComposed(e,o,i,!1,s)}}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],s=n._$subtreeSlotStart,o=n._$subtreeSlotEnd;s&&(u?(s.prev=u,u.next=s,u=o):(h=s,u=o))}Ze._$updateSubtreeSlotsInsertion(e,h,u,n+t.length-1,!1),null===(o=e.ownerShadowRoot)||void 0===o||o._$markIdCacheDirty();for(let n=0;n<t.length;n+=1){const s=t[n];e._$attached&&Ze.checkAndCallAttached(s),Ze.checkChildObservers(e,"add",s)}}static insertChildPlaceholderReplace(e,t,n){var s,o,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 Ze.insertChildComposed(d,null,i,!0,t);i.parentNode=n,null===(s=d._$mutationObserverTarget)||void 0===s||s.detachChild(i),null===(o=e._$mutationObserverTarget)||void 0===o||o.attachChild(i)}d.childNodes=[],d.parentNode=null,d.parentIndex=-1,n.parentNode=e;const u=d.containingSlot,p=d.slotIndex;void 0!==u&&(Ze._$updateContainingSlot(n,u),u&&Ze._$spliceSlotNodes(u,p,1,void 0));const f=h.length?Ze._$updateSubtreeSlotNodes(n,h,Ze._$getParentHostShadowRoot(n),Ze._$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{Ze.insertChildComposed(e,n,d,!0,t);for(let e=0;e<h.length;e+=1){const t=h[e];Ze.insertChildComposed(n,t,void 0,!1,e)}}null==f||f.insertSlotNodes(),void 0!==u&&(Ze._$updateContainingSlot(d,void 0),u&&Ze._$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){Ze.checkAndCallDetached(d),Ze.checkChildObservers(e,"remove",d),Ze.checkAndCallAttached(n),Ze.checkChildObservers(e,"add",n);for(let t=0;t<h.length;t+=1){const n=h[t];Ze.checkAndCallMoved(n),Ze.checkChildObservers(e,"move",n)}}}appendChild(e){Ze.insertChildSingleOperation(this,e,this.childNodes.length,!1)}insertChildAt(e,t){Ze.insertChildSingleOperation(this,e,t,!1)}insertBefore(e,t){const n=t?t.parentIndex:-1;Ze.insertChildSingleOperation(this,e,n,!1)}removeChildAt(e){Ze.insertChildSingleOperation(this,null,e,!0)}removeChild(e){const t=e.parentIndex;Ze.insertChildSingleOperation(this,null,t,!0)}replaceChildAt(e,t){Ze.insertChildSingleOperation(this,e,t,!0)}replaceChild(e,t){const n=t.parentIndex;Ze.insertChildSingleOperation(this,e,n,!0)}insertChildren(e,t){Ze.insertChildBatchInsertion(this,e,t)}removeChildren(e,t){Ze.insertChildBatchRemoval(this,e,t)}selfReplaceWith(e){const t=this.parentNode;t&&Ze.insertChildPlaceholderReplace(t,this.parentIndex,e)}static _$generateIdMap(e){const t=Object.create(null);return function e(n){if(m(n)){const s=n._$nodeId;s&&(t[s]||(t[s]=n)),n.childNodes.forEach(e)}}(e),t}triggerEvent(e,t,n){Ge.triggerEvent(this,e,t,n)}dispatchEvent(e){Ge.dispatchEvent(this,e)}_$setListenerStats(e,t,n={}){if(!this._$backendElement)return;const s=!!n.capture||!!n.useCapture;let o;switch(t){case 2:o=0;break;case 4:o=1;break;case 3:o=2;break;default:return}this._$nodeTreeContext&&(3===this.getBackendMode()?this._$nodeTreeContext.setListenerStats(this._$backendElement,e,s,o):this._$backendElement.setListenerStats(e,s,o))}addListener(e,t,n){const s=this._$eventTarget.addListener(e,t,n);this._$setListenerStats(e,s,n),S(this)&&this._$definition._$options.listenerChangeLifetimes&&this.triggerLifetime("listenerChange",[!0,e,t,n])}removeListener(e,t,n){const s=this._$eventTarget.removeListener(e,t,n);1!==s&&(this._$setListenerStats(e,s,n),S(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 s=this._$backendElement;s&&(3===this.getBackendMode()?!1===t?s.removeAttribute(e):s.setAttribute(e,!0===t||null==t?"":String(t)):s.setAttribute(e,t)),this._$mutationObserverTarget&&ve.callAttrObservers(this,{type:"properties",target:this,nameType:"attribute",attributeName:e})}removeAttribute(e){this._$nodeAttributes&&delete this._$nodeAttributes[e];const t=this._$backendElement;t&&t.removeAttribute(e),this._$mutationObserverTarget&&ve.callAttrObservers(this,{type:"properties",target:this,nameType:"attribute",attributeName:e})}setDataset(e,t){this.dataset[e]=t,1===this.getBackendMode()&&this._$backendElement.setDataset(e,t),this._$mutationObserverTarget&&ve.callAttrObservers(this,{type:"properties",target:this,nameType:"dataset",attributeName:`data:${e}`})}setMark(e,t){if(this._$marks)this._$marks[e]=t;else{const n={};n[e]=t,this._$marks=n}this._$mutationObserverTarget&&ve.callAttrObservers(this,{type:"properties",target:this,nameType:"mark",attributeName:`mark:${e}`})}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),Ze.checkAndCallAttached(e)}static pretendAttached(e){e._$attached||Ze.checkAndCallAttached(e)}static pretendDetached(e){e._$attached&&Ze.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 s=t?String(t):"",o=e._$slotName;if(o===s)return;const i=null===o;e._$slotName=s,i&&(e._$subtreeSlotStart=e._$subtreeSlotEnd={value:e,prev:null,next:null}),1===e.getBackendMode()&&(null===(n=e._$backendElement)||void 0===n||n.setSlotName(s));const r=e.ownerShadowRoot;if(r)if(i){3===r.getSlotMode()&&(e._$slotValues=Object.create(null)),e.slotNodes=[];const t=e.parentNode;t&&Ze._$updateSubtreeSlotsInsertion(t,e._$subtreeSlotStart,e._$subtreeSlotEnd,e.parentIndex,!1)}else r.isConnected(e)&&r._$applySlotRename(e,s,o);e._$mutationObserverTarget&&ve.callAttrObservers(e,{type:"properties",target:e,nameType:"basic",attributeName:"name"})}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=Ze._$getParentHostShadowRoot(e.parentNode);if(n){const t=Ze._$updateSubtreeSlotNodes(e.parentNode,[e],n,n,e.parentIndex),s=e.containingSlot;null==t||t.updateContainingSlot(),null==t||t.removeSlotNodes();const o=e.containingSlot,i=e=>{if(m(e)&&e._$inheritSlots)for(let t=0;t<e.childNodes.length;t+=1)i(e.childNodes[t]);else Ze.insertChildReassign(e.parentNode,e,s,o,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,s){const o=e.slotNodes=e.slotNodes||[],i=t>=0&&t<o.length;if(null==s?void 0:s.length)if(i){for(let e=t;e<t+n;e+=1)o[e].slotIndex=void 0;o.splice(t,n,...s);for(let e=t;e<o.length;e+=1)o[e].slotIndex=e}else{const e=o.length;o.push(...s);for(let t=e;t<o.length;t+=1)o[t].slotIndex=t}else if(n){for(let e=t;e<t+n;e+=1)o[e].slotIndex=void 0;o.splice(t,n);for(let e=t;e<o.length;e+=1)o[e].slotIndex=e}if(1===e.getBackendMode())if(null==s?void 0:s.length){const o=e._$nodeTreeContext.createFragment();for(let e=0;e<s.length;e+=1)o.appendChild(s[e]._$backendElement);i?e._$backendElement.spliceBeforeSlotNodes(t,n,o):e._$backendElement.spliceAppendSlotNodes(o),o.release()}else n&&e._$backendElement.spliceRemoveSlotNodes(t,n)}static _$findSlotNodeInsertPosition(e,t,n){const s=e.ownerShadowRoot.getHostNode(),o=e=>{let t=0,n=e;for(;n&&n!==s;)t+=1,n=n.parentNode;return t},i=o(t),r=(e,t,n,s,o,i,l)=>{if(e===s)return 0;if(e.parentNode===s.parentNode)return t-(-1===o?l:o);if(i<n){const t=e.parentNode;return r(t,t.parentIndex,n-1,s,o,i,l)}const a=n<i?e:e.parentNode,d=n<i?n:n-1,c=s.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,o(e),t,t.parentIndex,i,n>=0?n-.5:l.length)<0)break}return a+1}getComposedParent(){if(y(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(S(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 s=0;s<n.length;s+=1){const o=n[s];if(!1===e(o))return!1;if(o._$inheritSlots&&!t(o.childNodes))return!1}return!0};return t(this.childNodes)}*iterateComposedChild(){if(this._$inheritSlots)return;if(S(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 s=t[n];yield s,s._$inheritSlots&&(yield*e(s.childNodes))}};yield*e(this.childNodes)}forEachNonVirtualComposedChild(e){if(this._$inheritSlots)return!0;const t=t=>t._$virtual?t.forEachNonVirtualComposedChild(e):!1!==e(t);if(S(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 s=0;s<e.length;s+=1){const o=e[s];if(!t(o))return!1;if(o._$inheritSlots&&!n(o.childNodes))return!1}return!0};return n(this.childNodes)}static parseSelector(e){return new ze(e)}querySelector(e){return(e instanceof ze?e:new ze(e)).query(this,!0)}querySelectorAll(e){return(e instanceof ze?e:new ze(e)).query(this,!1)}static matchSelector(e,t){return(e instanceof ze?e:new ze(e)).testSelector(null,t)}matchSelector(e,t){return(e instanceof ze?e:new ze(e)).testSelector(this,t)}getBoundingClientRect(e){var t;const n=this._$backendElement;if(n)if(3===this.getBackendMode()){const s=n,o=(null===(t=s.getBoundingClientRect)||void 0===t?void 0:t.call(s))||{left:0,top:0,width:0,height:0};setTimeout((()=>{e(o)}),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,s={scrollLeft:n.scrollLeft||0,scrollTop:n.scrollTop||0,scrollWidth:n.scrollWidth||0,scrollHeight:n.scrollHeight||0};setTimeout((()=>{e(s)}),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,s){const o=this._$backendElement;if(o){if(e&&!e._$backendElement)return null;if(3===this.getBackendMode()){const i=this._$nodeTreeContext;return i&&i.createIntersectionObserver?i.createIntersectionObserver(o,(null==e?void 0:e._$backendElement)||null,t,n,s):null}const i=o;return i.createIntersectionObserver?i.createIntersectionObserver((null==e?void 0:e._$backendElement)||null,t,n,s):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 Qe;Ze.isElement=m,Ze._$getParentHostShadowRoot=e=>{let t=e;for(;null==t?void 0:t._$inheritSlots;)t=t.parentNode;return S(t)&&!t._$external?t.shadowRoot:null},Ze.prototype[u]=!0,function(e){e[e.Ancestor=0]="Ancestor",e[e.Descendant=1]="Descendant",e[e.ParentNonVirtualNode=2]="ParentNonVirtualNode",e[e.ChildNonVirtualNode=3]="ChildNonVirtualNode",e[e.ParentComponent=4]="ParentComponent",e[e.ChildComponent=5]="ChildComponent"}(Qe||(Qe={}));const Je=(e,t,n,s)=>{const o=e=>"function"==typeof e?e:(void 0!==e&&L(`the "${n}" relation listener is not a function (when preparing behavior "${t}").`),null);let i;if("parent"===s.type)i=4;else if("child"===s.type)i=5;else if("parent-common-node"===s.type)i=2;else if("child-common-node"===s.type)i=3;else if("ancestor"===s.type)i=0;else{if("descendant"!==s.type){const e=s.type;return L(`the "${n}" relation has an invalid relation type "${e}" (when preparing behavior "${t}").`),null}i=1}let r=null;if(s.target instanceof Mt)r=s.target.behavior;else if(s.target instanceof It||s.target instanceof Q)r=s.target;else{const o=String(s.target||n),i=e.getComponentByUrlWithoutDefault(o,t);if(i)r=i.behavior;else{const t=e.getGlobalUsingComponent(o);"object"==typeof t&&null!==t&&(r=t.behavior)}}return r?{target:r,type:i,linked:o(s.linked),linkChanged:o(s.linkChanged),unlinked:o(s.unlinked),linkFailed:o(s.linkFailed)}:(L(`the target of relation "${n}" is not a valid behavior or component (when preparing behavior "${t}").`),null)};class et{constructor(e,t){this._$comp=e;const n=new Array(6);if(t)for(let e=0;e<6;e+=1){const s=t.definitions[e];if(s){const t=new Array(s.length);for(let e=0;e<s.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,s=this._$group.keyMap,o=e.type;n[o]?(s[t]=[o,n[o].length],n[o].push(e)):(s[t]=[o,0],n[o]=[e]);const i=this._$links;return void 0===i[o]?i[o]=[null]:i[o].push(null),t}triggerLinkEvent(e,t){var n,s;const o=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=o;for(;;){const n=t.parentNode;if(!n)break;if(t=n,!b(t)){if(S(t)){if(t.hasBehavior(u)){const n=t._$relation;if(n){let o;o=4===e?5:0===e?1:3;const i=null===(s=n._$group)||void 0===s?void 0:s.definitions[o];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(),[o.getMethodCaller()],e),h.linkChanged&&c("Relation Link Changed Callback",h.linkChanged,o.getMethodCaller(),[e.getMethodCaller()],o)):(t.unlinked&&c("Relation Unlinked Callback",t.unlinked,e.getMethodCaller(),[o.getMethodCaller()],e),h.unlinked&&c("Relation Unlinked Callback",h.unlinked,o.getMethodCaller(),[e.getMethodCaller()],o))}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(),[o.getMethodCaller()],e),h.linked&&c("Relation Linked Callback",h.linked,o.getMethodCaller(),[e.getMethodCaller()],o))}t||d||!h.linkFailed||c("Relation Link Failed Callback",h.linkFailed,o.getMethodCaller(),[],o)}}getLinkedTargets(e){var t,n,s,o;const i=null===(t=this._$group)||void 0===t?void 0:t.keyMap[e];if(!i)return L(`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===(o=null===(s=this._$group)||void 0===s?void 0:s.definitions[r])||void 0===o?void 0:o[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(S(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 s=e[t];if(s&&s.target===d&&s.def===c){a.push(n);break}}}1===r&&h(n)}else 5!==r&&1!==r||h(n)}};return h(this._$comp),a}}class tt extends Ze{constructor(){throw new Error("Element cannot be constructed directly")}static create(e,t,n,s){var o,r;const l=Object.create(tt.prototype);l.is=e,l.stylingName=null!=n?n:e;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),l._$placeholderHandlerRemover=s;const c=t.getHostNode(),h=c.getComponentOptions(),u=null!==(o=h.styleScope)&&void 0!==o?o:X.globalScope(),p=null!==(r=h.extraStyleScope)&&void 0!==r?r:void 0,f=c._$behavior.ownerSpace.styleScopeManager;if(l.classList=new K(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}--`)}d.__wxElement=l,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 s=null===(n=this._$modelBindingListeners)||void 0===n?void 0:n[e];s&&s.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 s=null===(n=this._$modelBindingListeners)||void 0===n?void 0:n[t];s&&s.call(this,e)}})),e}}tt.isNativeNode=v,tt.prototype[p]=!0;class nt{constructor(e,t){this._$slotElement=null,this._$destroyOnRemoval=0,this._$subtreeSlotStart=null,this._$subtreeSlotEnd=null,this._$mutationObserverTarget=null,this._$text=String(e);let n=null;const s=t.getBackendContext();if(s)if(3===t.getBackendMode())n=s.document.createTextNode(e);else if(1===t.getBackendMode()){n=t._$backendShadowRoot.createTextNode(e)}else{n=s.createTextNode(e)}this._$backendElement=n,this.ownerShadowRoot=t,this.parentNode=null,this.parentIndex=-1,this.containingSlot=void 0}static create(e,t){return new nt(e,t)}asTextNode(){return this}asElement(){return null}asNativeNode(){return null}asVirtualNode(){return null}asShadowRoot(){return null}asGeneralComponent(){return null}asInstanceOf(){return null}destroyBackendElement(){this._$backendElement&&(3!==this.ownerShadowRoot.getBackendMode()&&this._$backendElement.release(),this._$backendElement=null)}destroyBackendElementOnRemoval(){this._$destroyOnRemoval=1}cancelDestroyBackendElementOnRemoval(){this._$destroyOnRemoval=0}destroyBackendElementOnDetach(){this._$destroyOnRemoval=1}cancelDestroyBackendElementOnDetach(){this._$destroyOnRemoval=0}getBackendElement(){return this._$backendElement}getBackendContext(){return this.ownerShadowRoot.getBackendContext()}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)),this._$mutationObserverTarget&&ve.callTextObservers(this,{type:"characterData",target:this}))}}nt.isTextNode=g,nt.prototype[h]=!0;class st extends Ze{constructor(){throw new Error("Element cannot be constructed directly")}_$initializeVirtual(e,t,n){if(this.is=String(e),n&&1===n.mode){const s=t._$backendShadowRoot.createVirtualNode(e);this._$initialize(!0,s,t,n),s.__wxElement=this,s.associateValue(this)}else this._$initialize(!0,null,t,t._$nodeTreeContext)}static create(e,t){const n=Object.create(st.prototype);return n._$initializeVirtual(e,t,t.getBackendContext()),n}}var ot;st.isVirtualNode=b,st.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"}(ot||(ot={}));class it extends st{constructor(){throw new Error("Element cannot be constructed directly")}static createShadowRoot(e){const t=Object.create(it.prototype);let n=null;1===e.getBackendMode()&&(n=e._$backendElement.getShadowRoot()),t.is="shadow",t._$idMap=null;let s=1;const o=e.getComponentOptions();return o.multipleSlots?s=2:o.dynamicSlots?s=3:o.directSlots&&(s=0),t._$slotMode=s,1===s?t._$singleSlot=null:2===s?(t._$slots=Object.create(null),t._$slotsList=Object.create(null)):3===s&&(t._$dynamicSlotsInserted=!1,t._$dynamicSlots=new Map,t._$requiredSlotValueNames=[],t._$propertyPassingDeepCopy=De(o.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,t._$hooks=e.getOwnerSpace().hooks,e.shadowRoot=t,n&&(n.__wxElement=t,n.associateValue(t)),t}getHostNode(){return this._$host}createTextNode(e=""){return this._$hooks.createTextNode((e=>new nt(e,this)),e)}createNativeNode(e){return this._$hooks.createNativeNode(((e,t)=>tt.create(e,this,t)),e,e)}createVirtualNode(e="virtual"){return st.create(e,this)}createNativeNodeWithInit(e,t,n,s){const o=this._$hooks.createNativeNode(((e,t)=>tt.create(e,this,t,n)),e,t);return null==s||s(o),o}createComponent(e,t,n,s,o){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,o);let h,u;if(d.final)h=d.final;else if(null!==d.placeholder){h=At(d.placeholder,a,d.source,l);const e=d.waiting;s&&e&&(e.add(s),e.hintUsed(i),u=()=>{e.remove(s)})}if("string"==typeof h)return this.createNativeNodeWithInit(h,e,u,o);if(h)return this._$hooks.createComponent(((e,t)=>Dt._$advancedCreate(e,t,this,null,Lt(t,r,i,n),u,o)),e,h)}let h=a.getGlobalUsingComponent(d);if(null===h&&a._$allowUnusedNativeNode&&""!==d&&(h=d),!h){if(h=a.getDefaultComponent(),!h)throw new A(`Cannot find component "${d}"`,void 0,this._$host);L(`Cannot find component "${d}", using default component.`,this._$host)}return"string"==typeof h?this.createNativeNodeWithInit(h,e,void 0,o):this._$hooks.createComponent(((e,t)=>Dt._$advancedCreate(e,t,this,null,Lt(t,r,i,n),void 0,o)),e,h)}createComponentByDef(e,t){return this._$hooks.createComponent(((e,t)=>Dt._$advancedCreate(e,t,this,null,null,void 0)),e,t)}createComponentOrNativeNode(e,t,n){const s=this._$host,o=s._$behavior,i=o.ownerSpace,r=i.getGlobalUsingComponent(e);if("string"==typeof r)return this.createNativeNodeWithInit(r,e,void 0,n);if(r)return this._$hooks.createComponent(((e,i)=>Dt._$advancedCreate(e,i,this,null,Lt(i,o,s,t),void 0,n)),e,r);if(i._$allowUnusedNativeNode){const t=this._$hooks.createNativeNode((e=>tt.create(e,this)),e,e);return null==n||n(t),t}throw new A(`Unknown tag name ${e}`,"[render]",s)}checkComponentPlaceholder(e){var t;let n;const s=this._$host._$behavior._$using[e];if(void 0!==s)n=s;else{const s=null===(t=this._$host._$genericImpls)||void 0===t?void 0:t[e];if(!s)return;n=s}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=Ze._$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 s=n.value;(s._$slotName||"")===e&&t.push(s)}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 s=n._$slotElement;if((null==s?void 0:s.ownerShadowRoot)===this)return s}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(!Ze.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 s=n[e];if(!1===t(s))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(!Ze.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 s=n[e];if(!s._$inheritSlots&&!1===t(s))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 s=this._$slotsList,o=this._$slots;if(s[t]){const n=s[t];let o={next:n},i=!0;for(let t=this._$subtreeSlotStart;t&&o.next&&t.value!==e;t=t.next)t.value===o.next.value&&(i=!1,o=o.next);if(i)s[t]=n.prev={value:e,prev:null,next:n};else{const t=o.next;o.next={value:e,prev:o,next:t},t&&(t.prev=o.next)}}else s[t]={value:e,prev:null,next:null};const i=o[t],r=s[t].value;i!==r&&(o[t]=r,Ze._$insertChildReassignSlot(this,t,i||null,r))}_$applyMultipleSlotsRemoval(e,t,n){const s=this._$slotsList,o=this._$slots;let i=s[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;s[t]=a,n||(o[t]=i,Ze._$insertChildReassignSlot(this,t,e,i))}else delete s[t],n||(delete o[t],Ze._$insertChildReassignSlot(this,t,e,null))}_$applySlotRename(e,t,n){const s=this._$slotMode;if(1!==s&&0!==s){if(2===s)return this._$applyMultipleSlotsRemoval(e,n,!1),void this._$applyMultipleSlotInsertion(e,t,!1);if(3===s){if(!this._$dynamicSlotsInserted)return;const n=this._$insertDynamicSlotHandler,s=this._$removeDynamicSlotHandler;this._$dynamicSlots.set(e,{updatePathTree:void 0}),null==s||s([e]),null==n||n([{slot:e,name:t,slotValues:e._$slotValues}])}}}_$applySlotsInsertion(e,t,n){const s=this._$slotMode;if(0!==s){if(1===s){const e=this._$singleSlot,t=this._$subtreeSlotStart.value;if(e===t)return;return this._$singleSlot=t,void Ze._$insertChildReassignSlot(this,null,e,t)}if(2!==s){if(3===s){if(n)return;if(!this._$dynamicSlotsInserted)return;const s=this._$insertDynamicSlotHandler,o=[];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}),o.push({slot:e,name:t,slotValues:e._$slotValues})}null==s||s(o)}}else for(let s=e;s&&s!==t.next;s=s.next){const e=s.value,t=e._$slotName;this._$applyMultipleSlotInsertion(e,t,n)}}}_$applySlotsRemoval(e,t,n){var s;const o=this._$slotMode;if(0!==o){if(1===o){if(n)return;const e=this._$singleSlot,t=(null===(s=this._$subtreeSlotStart)||void 0===s?void 0:s.value)||null;if(e===t)return;return this._$singleSlot=t,void Ze._$insertChildReassignSlot(this,null,e,t)}if(2!==o){if(3===o){if(n)return;if(!this._$dynamicSlotsInserted)return;const s=this._$removeDynamicSlotHandler,o=[];for(let n=e;n&&n!==t.next;n=n.next){const e=n.value;this._$dynamicSlots.delete(e),o.push(e)}null==s||s(o)}}else for(let s=e;s&&s!==t.next;s=s.next){const e=s.value,t=e._$slotName;this._$applyMultipleSlotsRemoval(e,t,n)}}}setDynamicSlotHandler(e,t,n,s){if(3===this._$slotMode&&(this._$requiredSlotValueNames=e,this._$insertDynamicSlotHandler=t,this._$removeDynamicSlotHandler=n,this._$updateDynamicSlotHandler=s,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 s;const o=e._$slotValues;if(!o)return;const i=o[t];let r=n;if(0!==this._$propertyPassingDeepCopy&&(r=2===this._$propertyPassingDeepCopy?_e(n,!0):$e(n)),i===r)return;if(o[t]=r,e._$mutationObserverTarget&&ve.callAttrObservers(e,{type:"properties",target:e,nameType:"slot-value",propertyName:t}),this._$requiredSlotValueNames.indexOf(t)<0)return;const l=null===(s=this._$dynamicSlots)||void 0===s?void 0:s.get(e);l&&(l.updatePathTree||(l.updatePathTree=Object.create(null)),l.updatePathTree[t]=!0)}applySlotValueUpdates(e){var t,n;const s=null===(t=this._$dynamicSlots)||void 0===t?void 0:t.get(e),o=null==s?void 0:s.updatePathTree;o&&(s.updatePathTree=void 0,null===(n=this._$updateDynamicSlotHandler)||void 0===n||n.call(this,e,e._$slotValues,o))}applySlotUpdates(){var e;if(this._$dynamicSlotsInserted){const t=this._$dynamicSlots.entries();for(let n=t.next();!n.done;n=t.next()){const[t,s]=n.value,o=s.updatePathTree;o&&(s.updatePathTree=void 0,null===(e=this._$updateDynamicSlotHandler)||void 0===e||e.call(this,t,t._$slotValues,o))}}else{this._$dynamicSlotsInserted=!0;const e=this._$insertDynamicSlotHandler,t=[];for(let e=this._$subtreeSlotStart;e;e=e.next){const n=e.value,s=n._$slotName;this._$dynamicSlots.set(n,{updatePathTree:void 0}),t.push({slot:n,name:s,slotValues:n._$slotValues})}null==e||e(t)}}getSlotMode(){return this._$slotMode}}it.isShadowRoot=y,it.prototype[$]=!0;class rt{constructor(e,t,n,s,o){this.ownerShadowRoot=s,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(o(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 s=Object.keys(e);t=new Array(s.length),n=new Array(s.length);for(let o=0;o<s.length;o+=1){const i=s[o],r=e[i];t[o]=r,n[o]=i}}else if("string"==typeof e){L("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){L("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);const s=Number.isSafeInteger(e)&&e>=0&&e<Math.pow(2,32)?e:0;t=new Array(s),n=null;for(let e=0;e<s;e+=1)t[e]=e}else L(`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 s=this.keyName,o=new Array(t.length),i=Object.create(null);let r;if(null!==s){for(let e=0;e<t.length;e+=1){const n=t[e],l="*this"===s?n:null==n?void 0:n[s],a=null!=l?String(l):"";o[e]=a,(null==r?void 0:r[a])?r[a].push(e):void 0!==i[a]?(r||(r=Object.create(null)),r[a]=[i[a],e]):i[a]=e}if(r){const e=Object.keys(r);L(`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],s=r[n];let l=0;for(let e=1;e<s.length;e+=1){const t=s[e];for(;void 0!==i[`${n}--${l}`];)l+=1;const r=`${n}--${l}`;i[r]=t,o[t]=r}}}}this.rawKeys=o,this.keyMap=i,this.sharedKeyMap=r}diff(e,t,n,s,o){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 s=0;s<n.length;s+=1){const o=t[n[s]];if(!0===o||("*this"===p?o:null==o?void 0:o[p])){e=!0;break}}}if(e){_=new Array(d.length);for(let e=0;e<d.length;e+=1){const n=d[e];let s=!1;if(l||c)if(void 0!==(null==l?void 0:l[n])||void 0!==(null==c?void 0:c[n]))s=!0;else{const e=n.lastIndexOf("--");if(e>=0){const t=n.slice(0,e);void 0===(null==l?void 0:l[t])&&void 0===(null==c?void 0:c[t])||(s=!0)}}if(s)_[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],s=null===u?r:u[r],i=null===a?r:a[r];o(t,s,!0===e||void 0===e?e:e[s],s!==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(s(t,n))}n.insertChildren(e,-1)}return}const g=[],m=[],v=new Array(d.length),b=new Array(d.length);let y=-1,S=-1;for(let e=0;e<d.length;e+=1){const t=d[e];if(i[y+1]===t){y+=1,S+=1,g[S]=y,m[S]=e,v[e]=S>0?m[S-1]:-1,b[e]=y;continue}const n=r[t];if(void 0===n){b[e]=-1;continue}let s=0,o=g.length;for(;s<o;){const e=Math.floor((s+o)/2);n<g[e]?o=e:s=e+1}g[o]=n,m[o]=e,v[e]=o>0?m[o-1]:-1,b[e]=n,y=n,S=o}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],s=null===u?e:u[e],i=null===a?e:a[e];o(t,s,!0===_||void 0===_?_:_[e],s!==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 k;!function(e){e[e.Stable=0]="Stable",e[e.ForwardMove=1]="ForwardMove",e[e.BackwardMove=2]="BackwardMove"}(k||(k={}));const x=new Array(i.length),O=new Array(d.length);let L=-1;for(let e=0;e<b.length;e+=1){const t=b[e];if(e!==E[N])if(-1!==t)x[t]=t>L?2:1,O[e]=n.childNodes[t];else{const t=h[e],n=null===u?e:u[e];O[e]=s(t,n)}else L=t,N+=1,x[t]=0}let A=0,M=0,R=0;N=0;do{const e=N<E.length?E[N]:O.length,t=N<E.length?b[e]:x.length;for(;M<t;)if(void 0===x[M]){const e=M;M+=1;let s=1;for(;M<t&&void 0===x[M];)M+=1,s+=1;n.removeChildren(e+A,s),A-=s}else 2===x[M]&&(A-=1),M+=1;for(;R<e;){const s=O[R],i=b[R];if(-1===i){const s=R;R+=1;let o=1;for(;R<e&&-1===b[R];)R+=1,o+=1;n.insertChildren(O.slice(s,s+o),t+A),A+=o}else{s&&n.insertChildAt(s,t+A);const e=h[R],r=null===u?R:u[R],l=null===a?i:a[i];o(e,r,!0===_||void 0===_?_:_[R],r!==l,s),2===x[i]&&(A+=1),R+=1}}if(N<E.length){const s=h[e],i=null===u?e:u[e],r=null===a?t:a[t];o(s,i,!0===_||void 0===_?_:_[e],i!==r,n.childNodes[t+A])}M=t+1,R=e+1,N+=1}while(N<=E.length)}}const lt=e=>e,at=(e,t,n)=>n.apply(e,[t]),dt=e=>{const t=e;return t._$wxTmplArgs=t._$wxTmplArgs||{}},ct=e=>null==e?"":String(e),ht=e=>e.replace(/-(.|$)/g,(e=>e[1]?e[1].toUpperCase():""));class ut{constructor(e,t,n){this.bindingMapDisabled=!1,this.changePropFilter=lt,this.eventListenerWrapper=at,this.s=(e,t)=>{e.slot=t,this.tryCallPropertyChangeListener(e,"slot",t)},this.l=(e,t,n,s)=>{var o;3===this.shadowRoot.getSlotMode()?this.shadowRoot.replaceSlotValue(e,t,n):this.checkFallbackEventListener(e,t,n,s)||L(`"${t}" is not a valid event binding or slot value`,null===(o=e.ownerShadowRoot)||void 0===o?void 0:o.getHostNode(),e),this.tryCallPropertyChangeListener(e,t,n)},this.i=(e,t)=>{e.id=t,this.tryCallPropertyChangeListener(e,"id",t)},this.c=(e,t)=>{if(S(e)){e.hasExternalClass("class")&&e.setExternalClass("class",t)}e.setNodeClass(t),this.tryCallPropertyChangeListener(e,"class",t)},this.e=(e,t)=>{const n=dt(e);n.staticClasses||(n.staticClasses=new Array(t.length));const s=n.staticClasses;for(let e=0;e<t.length;e+=1){const n=t[e];"string"==typeof n&&(s[e]=n)}this.applyClassListUpdates(e)},this.ei=(e,t,n)=>{const s=dt(e);s.staticClasses||(s.staticClasses=[]);s.staticClasses[t]=n,s.staticClassesDirty=!0},this.y=(e,t)=>{if(S(e)&&Dt.hasProperty(e,"style")){const n=Dt.getDataProxy(e),s=ht("style");n.replaceProperty(s,t)}else e.setNodeStyle(ct(t),0);this.tryCallPropertyChangeListener(e,"style",t)},this.w=(e,t)=>{const n=dt(e);n.styleNameValues||(n.styleNameValues=new Array(t.length));const s=n.styleNameValues;for(let e=0;e<t.length;e+=2){const n=t[e+1];"string"==typeof n&&(s[e]=t[e],s[e+1]=n)}this.applyStyleListUpdates(e)},this.wi=(e,t,n)=>{const s=dt(e);s.styleNameValues||(s.styleNameValues=[]);s.styleNameValues[2*t+1]=n,s.styleNameValuesDirty=!0},this.d=(e,t,n)=>{e.setDataset(t,n)},this.m=(e,t,n)=>{e.setMark(t,n)},this.v=(e,t,n,s,o,i,r,l)=>{const a="function"==typeof n?n:ct(n),d=t=>{const n=e.ownerShadowRoot.getHostNode(),s=n.getMethodCaller(),o="function"==typeof a?a:Dt.getMethod(n,a);if("function"==typeof o)return this.eventListenerWrapper(s,t,o,l)},c={final:s,mutated:o,capture:i};if(r){const n=dt(e);n.dynEvListeners||(n.dynEvListeners={});const s=n.dynEvListeners;s[t]&&e.removeListener(t,s[t],c),s[t]=d}a&&e.addListener(t,d,c)},this.r=(e,t,n,s,o)=>{var i;if(S(e)){const r=Dt.getDataProxy(e),l=ht(t);r.replaceProperty(l,n)?void 0!==s&&(null===s?r.setModelBindingListener(l,(()=>{})):r.setModelBindingListener(l,(t=>{const n=e.ownerShadowRoot.getHostNode(),o=Dt.getDataProxy(n);o.replaceDataOnPath(s,t),o.applyDataUpdates(!1)}))):e.hasExternalClass(t)?e.setExternalClass(t,n):this.checkFallbackEventListener(e,l,n,o)||L(`"${l}" is not a valid property`,null===(i=e.ownerShadowRoot)||void 0===i?void 0:i.getHostNode(),e)}else if(v(e)){if(this.fallbackListenerOnNativeNode){const s=ht(t);this.checkFallbackEventListener(e,s,n,o)||e.updateAttribute(t,n)}else e.updateAttribute(t,n);s&&e.setModelBindingListener(t,(t=>{const n=e.ownerShadowRoot.getHostNode(),o=Dt.getDataProxy(n);o.replaceDataOnPath(s,t),o.applyDataUpdates(!1)}))}this.tryCallPropertyChangeListener(e,t,n)},this.a=(e,t,n)=>{e.updateAttribute(t,n),this.tryCallPropertyChangeListener(e,t,n)},this.wl=(e,t,n)=>{S(e)&&e.triggerWorkletChangeLifetime(t,n)},this.p=(e,t,n,s)=>{const o=dt(e);o.changeProp||(o.changeProp=Object.create(null)),o.changeProp[t]={listener:this.changePropFilter(n,s),oldValue:void 0}},this.shadowRoot=e,this.procGen=t,this.fallbackListenerOnNativeNode=n}create(e){const{shadowRoot:t,procGen:n}=this,s=n(this,!0,e);return this.handleChildrenCreationAndInsert(s.C,t,void 0,void 0),s.B}update(e,t){const{shadowRoot:n,procGen:s}=this,o=s(this,!1,e,t);this.handleChildrenUpdate(o.C,n,void 0,void 0)}endBindingMapUpdateForElement(e){const t=e._$wxTmplArgs;if(t&&(t.staticClassesDirty&&(t.staticClassesDirty=!1,this.applyClassListUpdates(e)),t.styleNameValuesDirty&&(t.styleNameValuesDirty=!1,this.applyStyleListUpdates(e))),S(e)&&e.hasPendingChanges()){Dt.getDataProxy(e).applyDataUpdates(!0)}}bindingMapUpdate(e,t,n){if(this.bindingMapDisabled)return!1;const s=n[e];if(!s)return!1;let o=null;for(let e=0;e<s.length;e+=1){(0,s[e])(t,(e=>{null!==o&&e!==o&&this.endBindingMapUpdateForElement(o),o=e}),((e,t)=>{e.textContent=t}))}const i=o;return null!==i&&this.endBindingMapUpdateForElement(i),!0}handleChildrenCreation(e,t,n){const s=[];return e(!0,((e,o)=>{if(t&&""!==n){const e=this.createDynamicPlaceholder(t);return void s.push(e)}const i=this.shadowRoot.createTextNode(e);i.destroyBackendElementOnRemoval(),t&&Ze.setSlotElement(i,t),o&&o(i),s.push(i)}),((e,o,i,r,l,a)=>{if(t&&n!==(l||"")){const e=this.createDynamicPlaceholder(t);return void s.push(e)}const d=this.createCommonElement(e,o,i,r,a);if(t){Ze.setSlotElement(d,t);dt(d).dynamicSlotNameMatched=!0}else void 0!==l&&(d.slot=l);s.push(d)}),((e,o)=>{const i=this.shadowRoot.createVirtualNode("wx:if");i.destroyBackendElementOnRemoval(),Ze.setInheritSlots(i),t&&Ze.setSlotElement(i,t);dt(i).key=e,this.handleChildrenCreationAndInsert(o,i,t,n),s.push(i)}),((e,o,i,r,l)=>{const a=this.shadowRoot,d=a.createVirtualNode("wx:for");d.destroyBackendElementOnRemoval(),Ze.setInheritSlots(d),t&&Ze.setSlotElement(d,t);dt(d).keyList=new rt(o,e,d,a,((e,s)=>{const o=a.createVirtualNode("wx:for-item");return o.destroyBackendElementOnRemoval(),Ze.setInheritSlots(o),t&&Ze.setSlotElement(d,t),this.handleChildrenCreationAndInsert(((t,n,o,i,a,d,c)=>{l(!0,e,s,void 0,void 0,r?[...r,s]:null,n,o,i,a,d,c)}),o,t,n),o})),s.push(d)}),((e,n,o)=>{const i=this.shadowRoot.createVirtualNode("slot");i.destroyBackendElementOnRemoval(),Ze.setSlotName(i,ct(e)),t?Ze.setSlotElement(i,t):void 0!==o&&(i.slot=o),n&&n(i),s.push(i)}),((e,o)=>{if(void 0!==o)if(t)if(n===o){const n=this.shadowRoot.createVirtualNode("virtual");n.destroyBackendElementOnRemoval(),Ze.setSlotElement(n,t);dt(n).dynamicSlotNameMatched=!0,this.handleChildrenCreationAndInsert(e,n,void 0,void 0),s.push(n)}else{const e=this.createDynamicPlaceholder(t);s.push(e)}else{const t=this.shadowRoot.createVirtualNode("virtual");t.destroyBackendElementOnRemoval(),t.slot=o,this.handleChildrenCreationAndInsert(e,t,void 0,void 0),s.push(t)}else{const o=this.shadowRoot.createVirtualNode("virtual");o.destroyBackendElementOnRemoval(),Ze.setInheritSlots(o),t&&Ze.setSlotElement(o,t),this.handleChildrenCreationAndInsert(e,o,t,n),s.push(o)}}),void 0,void 0),s}handleChildrenCreationAndInsert(e,t,n,s){const o=this.handleChildrenCreation(e,n,s);o.length&&t.insertChildren(o,-1)}handleChildrenUpdate(e,t,n,s){let o=0;const i=n?n.slotNodes.filter((e=>e.parentNode===t)):t.childNodes;e(!1,(e=>{const t=i[o];if(o+=1,t){if(n){if(!dt(t).dynamicSlotNameMatched)return}void 0!==e&&(t.textContent=e)}}),((e,r,l,a,d,c)=>{const h=i[o];if(o+=1,!h)return;if(n){const o=dt(h);if(s!==(d||"")){if(o.dynamicSlotNameMatched){const e=this.createDynamicPlaceholder(n);t.replaceChild(e,h)}return}if(!o.dynamicSlotNameMatched){const s=this.createCommonElement(e,r,l,a,c);Ze.setSlotElement(s,n);return dt(s).dynamicSlotNameMatched=!0,void t.replaceChild(s,h)}}l(h,!1);let u=!1;if(S(h)){const e=this.dynamicSlotUpdate(h,c,a);if(e&&(u=!0),h.hasPendingChanges()){Dt.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[o];if(o+=1,!l)return;const a=dt(l);if(a.key===e)this.handleChildrenUpdate(r,l,n,s);else{const i=this.shadowRoot.createVirtualNode("wx:if");i.destroyBackendElementOnRemoval(),Ze.setInheritSlots(i),n&&Ze.setSlotElement(i,n);const d=dt(i);a.key=d.key=e,this.handleChildrenCreationAndInsert(r,i,n,s),n?t.replaceChild(i,l):t.replaceChildAt(i,o-1)}}),((e,t,r,l,a)=>{const d=i[o];if(o+=1,!d)return;dt(d).keyList.diff(e,r,d,((e,t)=>{const o=this.shadowRoot.createVirtualNode("wx:for-item");return o.destroyBackendElementOnRemoval(),Ze.setInheritSlots(o),n&&Ze.setSlotElement(d,n),this.handleChildrenCreationAndInsert(((n,s,o,i,r,d,c)=>{a(!0,e,t,void 0,void 0,l?[...l,t]:null,s,o,i,r,d,c)}),o,n,s),o}),((e,t,o,i,r)=>{r&&this.handleChildrenUpdate(((n,s,r,d,c,h,u)=>{a(!1,e,t,o,!!i||void 0,l?[...l,t]:null,s,r,d,c,h,u)}),r,n,s)}))}),((e,t,s)=>{const r=i[o];o+=1,r&&(void 0!==e&&Ze.setSlotName(r,ct(e)),n||void 0!==s&&(r.slot=s),t&&t(r),this.shadowRoot.applySlotValueUpdates(r))}),((e,r)=>{const l=i[o];if(o+=1,l)if(void 0!==r)if(n){const o=dt(l);if(s===r)if(o.dynamicSlotNameMatched)this.handleChildrenUpdate(e,l,void 0,void 0);else{const s=this.shadowRoot.createVirtualNode("virtual");s.destroyBackendElementOnRemoval(),Ze.setSlotElement(s,n);dt(s).dynamicSlotNameMatched=!0,this.handleChildrenCreationAndInsert(e,s,void 0,void 0),t.replaceChild(s,l)}else if(o.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,s)}),void 0,void 0)}dynamicSlotUpdate(e,t,n){const s=e.getShadowRoot();return 3===(null==s?void 0:s.getSlotMode())?(s.setDynamicSlotHandler(t||[],(t=>{const s=[];for(let e=0;e<t.length;e+=1){const{slot:o,name:i,slotValues:r}=t[e],l=this.handleChildrenCreation(((e,t,s,o,i,l,a)=>{n(!0,t,s,o,i,l,a,r,void 0)}),o,i);s.push(...l)}s.length&&e.insertChildren(s,-1)}),(t=>{if(!t.length)return;const n=[];for(let e=0;e<t.length;e+=1)t[e].slotNodes.length&&n.push(t[e]);n.sort(((e,t)=>e.slotNodes[0].parentIndex-t.slotNodes[0].parentIndex));let s=0,o=0;for(let t=0;t<n.length;t+=1){const i=n[t].slotNodes,r=i[0].parentIndex,l=i.findLast((t=>t.parentNode===e)).parentIndex;o!==r&&(s>=0&&e.removeChildren(s,o-s),s=r),o=l+1}s!==o&&e.removeChildren(s,o-s)}),((t,s,o)=>{const i=t._$slotName||"";this.handleChildrenUpdate(((e,t,i,r,l,a,d)=>{n(!1,t,i,r,l,a,d,s,o)}),e,t,i)})),s):null}createDynamicPlaceholder(e){const t=this.shadowRoot.createVirtualNode("virtual");t.destroyBackendElementOnRemoval(),Ze.setSlotElement(t,e);return dt(t).dynamicSlotNameMatched=!1,t}checkFallbackEventListener(e,t,n,s){if(t.startsWith("bind"))this.v(e,t.slice(4),n,!1,!1,!1,!0,s);else if(t.startsWith("captureBind"))this.v(e,t.slice(11),n,!1,!1,!0,!0,s);else if(t.startsWith("catch"))this.v(e,t.slice(5),n,!0,!1,!1,!0,s);else if(t.startsWith("captureCatch"))this.v(e,t.slice(12),n,!0,!1,!0,!0,s);else{if(!t.startsWith("on"))return!1;this.v(e,t.slice(2),n,!1,!1,!1,!0,s)}return!0}createCommonElement(e,t,n,s,o){let i=!1;const r=e=>{const t=S(e)?this.dynamicSlotUpdate(e,o,s):null;if(t&&(i=!0),n(e,!0),S(e)){if(e.hasPendingChanges()){Dt.getDataProxy(e).applyDataUpdates(!0)}null==t||t.applySlotUpdates()}},l=this.shadowRoot.createComponent(e,e,t,(()=>{var n;const s=this.shadowRoot.createComponent(e,e,t,void 0,r);s.destroyBackendElementOnRemoval();const o=s.getShadowRoot(),i=S(l)?l.getShadowRoot():null,a=3===(null==i?void 0:i.getSlotMode()),d=3===(null==o?void 0:o.getSlotMode());d!==a?O(new Error(`The "dynamicSlots" option of component <${s.is}> and its placeholder <${l.is}> should be the same.`),"[render]",S(s)?s:s.is):d?null===(n=l.parentNode)||void 0===n||n.replaceChild(s,l):l.selfReplaceWith(s)}),r);return l.destroyBackendElementOnRemoval(),i?this.bindingMapDisabled=!0:this.handleChildrenCreationAndInsert(s,l,void 0,void 0),l}tryCallPropertyChangeListener(e,t,n){var s;const o=dt(e);if(null===(s=o.changeProp)||void 0===s?void 0:s[t]){const s=o.changeProp[t],i=s.oldValue;if(i!==n){s.oldValue=n;const t=e.ownerShadowRoot.getHostNode();c("Property Change Observer",s.listener,null,[n,i,t,e],t)}}}applyClassListUpdates(e){const t=dt(e).staticClasses;e.setNodeClassList(t),this.tryCallPropertyChangeListener(e,"class",t)}applyStyleListUpdates(e){const t=dt(e).styleNameValues;let n="";for(let e=0;e<t.length;e+=2){n+=`${t[e]}:${t[e+1]};`}if(S(e)&&Dt.hasProperty(e,"style")){const t=Dt.getDataProxy(e),s=ht("style");t.replaceProperty(s,n)}else e.setNodeStyle(ct(n),0);this.tryCallPropertyChangeListener(e,"style",n)}setFnFilter(e){this.changePropFilter=e}setEventListenerWrapper(e){"function"==typeof e&&(this.eventListenerWrapper=e)}devArgs(e){return(e=>{const t=e;return t._$wxTmplDevArgs=t._$wxTmplDevArgs||{}})(e)}}var pt;!function(e){e[e.Data=0]="Data",e[e.Script=1]="Script",e[e.InlineScript=2]="InlineScript"}(pt||(pt={}));const ft=()=>{};class $t{constructor(e,t){this.i=(e,t)=>{this.shadowRoot.idMap[t]=e},this.v=(e,t,n,s)=>{this.shadowRoot.setListener(e,t,(e=>{const t=this.shadowRoot.template.methods[n],o=null==t?void 0:t(e);return!s&&o}))},this.a=(e,t,n)=>{this.r(e,t,n)},this.shadowRoot=e,this.procGen=t}create(e){const{shadowRoot:t,procGen:n}=this,s=n(this,!0,e);return this.handleChildrenCreation(s.C,t.shadowRootElement),s.B}bindingMapUpdate(e,t,n){const s=n[e];if(void 0!==s)for(let e=0;e<s.length;e+=1){(0,s[e])(t,(()=>{}),((e,t)=>{e.textContent=t}))}}handleChildrenCreation(e,t){let n=!0,s=!1;const o=()=>{n=!1,s=!1;const e=document.createElement("virtual");t.appendChild(e),this.shadowRoot.slot=e};e(!0,((e,i)=>{s?o():n=!1;const r=document.createTextNode(e||"");i&&i(r),t.appendChild(r)}),((e,i,r,l)=>{s?o():n=!1;const a=document.createElement(e);r(a,!0),this.handleChildrenCreation(l,a),t.appendChild(a)}),ft,ft,(()=>{n?(s=!0,this.shadowRoot.slot=t):o()}),(e=>{s?o():n=!1;const i=document.createElement("virtual");this.handleChildrenCreation(e,i),t.appendChild(i)}))}s(){}l(){}c(e,t){e.setAttribute("class",t)}e(){}ei(){}y(e,t){e.setAttribute("style",t)}w(){}wi(){}d(e,t,n){e.dataset[t]=ct(n)}m(){}r(e,t,n){"boolean"==typeof n?n?e.setAttribute(t,""):e.removeAttribute(t):e.setAttribute(t,ct(n))}wl(){}p(){}setFnFilter(){}setEventListenerWrapper(){}devArgs(e){return(e=>{const t=e;return t._$wxTmplDevArgs=t._$wxTmplDevArgs||{}})(e)}}const _t=()=>({C:(e,t,n,s,o,i)=>{i("")},B:Object.create(null)}),gt=()=>_t;class mt{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:gt};this.genObjectGroupEnv={list:t.groupList||Object.create(null),group:t.content}}this.updateMode="",this.methods=e._$methodMap}createInstance(e){return new vt(this,e)}}class vt{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 s=e.genObjectGroupEnv.group("")||gt();this.procGenWrapper=new $t(this,s),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 s=0;s<t.length;s+=1){const[o]=t[s];this.procGenWrapper.bindingMapUpdate(o[0],e,n)}}setListener(e,t,n){const s=e;s._$wxTmplEv?s._$wxTmplEv[t]=n:s._$wxTmplEv={[t]:n}}handleEvent(e,t){var n;const s=e;let o=s;const i=this.shadowRootElement,r=t.getEventName(),l=t.bubbles;for(;;){const e=t.wrapShadowedEvent(s,null,o),a=null===(n=o._$wxTmplEv)||void 0===n?void 0:n[r];if(a){!1===a.call(o,e)&&(t.preventDefault(),t.stopPropagation())}if(!l||t.propagationStopped())break;if(o===i)break;const d=o.parentNode;if(!d)break;o=d}}}const bt=()=>({C:(e,t,n,s,o,i)=>{i("")},B:Object.create(null)}),yt=()=>bt;var St;!function(e){e[e.Disabled=0]="Disabled",e[e.Enabled=1]="Enabled",e[e.Forced=2]="Forced"}(St||(St={}));const Ct=e=>String(e>>>0)===e;class wt{create(e,t){return t.externalComponent?new mt(e):new Nt(e)}}class Nt{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:yt};this.genObjectGroupEnv={list:n.groupList||Object.create(null),group:n.content},this.updateMode=n.updateMode||"",this.fallbackListenerOnNativeNode=n.fallbackListenerOnNativeNode||!1}createInstance(e,t){return new Et(this,e,t(e))}}class Et{constructor(e,t,n){this.comp=t,this.shadowRoot=n,this.shadowRoot.destroyBackendElementOnRemoval(),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("")||yt();"bindingMap"===e.updateMode?this.forceBindingMapUpdate=2:"virtualTree"===e.updateMode?this.forceBindingMapUpdate=0:this.forceBindingMapUpdate=1,this.procGenWrapper=new ut(this.shadowRoot,t,e.fallbackListenerOnNativeNode),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[s,o,i,r]=t[e];let l=n;for(let e=0;e<s.length;e+=1){const t=s[e],n=l[t];if(!0===n)break;if(e===s.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 s=n,o=Object.keys(s);for(let e=0;e<o.length;e+=1){const n=o[e];Ct(n)&&(t[Number(n)]=s[n],delete s[n])}}else{const s=new Array(e),o=Object.keys(n);let i=!1;for(let e=0;e<o.length;e+=1){const t=o[e],r=n[t];Ct(t)?s[Number(t)]=r:"length"===t&&(i=!0)}const r=Object.create(s);i&&(r.length=!0),l[t]=r}const s=Object.getPrototypeOf(l[t]),a=new Array(o.length);a.fill(!0),s.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[s]=t;return 1===s.length&&this.procGenWrapper.bindingMapUpdate(s[0],e,n)}}let kt=null;const xt=()=>{if(kt)return kt;const e=new wt;return kt=e,e};var Ot=Object.freeze({__proto__:null,DEFAULT_PROC_GEN_GROUP:yt,get GeneralLvaluePathPrefix(){return pt},GlassEaselTemplateEngine:wt,getDefaultTemplateEngine:xt});const Lt=(e,t,n,s)=>{const o=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(s&&Object.prototype.hasOwnProperty.call(s,c)){const n=s[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 s=o.getGlobalUsingComponent(n);if("string"==typeof s)a[c]=s;else if(s)a[c]={final:s,source:t,placeholder:null,waiting:null};else{L(`Generic "${c}" value "${n}" is not valid`,e.is);const s=o.getDefaultComponent();if(!s)throw new A(`Cannot find default component for generic "${c}"`,"[prepare]",e.is);a[c]={final:s,source:t,placeholder:null,waiting:null}}}else a[c]=n}else{const s=n[c]||o.getDefaultComponent();if(!s)throw new A(`Cannot find default component for generic "${c}"`,"[prepare]",e.is);a[c]="string"==typeof s?s:{final:s,source:t,placeholder:null,waiting:null}}}}else a=null;return a},At=(e,t,n,s)=>{const o=n._$using[e]||s&&s[e];let i=null;if(o&&("string"==typeof o?i=o:null===o.placeholder?i=o.final:L("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 A(`Cannot find placeholder target "${e}"`,"[prepare]",n.is);L(`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:xt()}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 s=t[e];n[s]={enumerable:!0,get(){return this._$dataGroup.data[s]},set(e){const t=this._$dataGroup;t.replaceDataOnPath([s],e),t.applyDataUpdates()}}}const s=Object.keys(e._$methodMap);for(let t=0;t<s.length;t+=1){const o=s[t];n[o]={enumerable:!0,value:e._$methodMap[o]}}}const s=function(){};n.constructor={value:s,writable:!0};const o=s.prototype=Object.create(Dt.prototype,n);o._$behavior=e,o._$definition=this,o._$methodMap=e._$methodMap,o._$dataGroupObserverTree=e._$generateObserverTree(),o._$lifetimeFuncs=e._$getAllLifetimeFuncs(),o._$pageLifetimeFuncs=e._$getAllPageLifetimeFuncs();const i=(e=>{if(void 0===e)return null;const t={definitions:new Array(6),keyMap:Object.create(null)},n=t.definitions,s=t.keyMap,o=Object.keys(e);for(let t=0;t<o.length;t+=1){const i=o[t],r=e[i],l=r.type;n[l]?(s[i]=[l,n[l].length],n[l].push(r)):(s[i]=[l,0],n[l]=[r])}return t})(e._$relationMap),r=De(t.dataDeepCopy),l=De(t.propertyPassingDeepCopy),a=this._$templateEngine.create(e,t);this._$detail={proto:o,template:a,dataDeepCopy:r,propertyPassingDeepCopy:l,relationDefinitionGroup:i}}}let Rt=1,Tt=null;class Dt extends Ze{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||ie()).defineComponent(e)}static _$tagMethod(e){const t=e;return t[Y]=!0,t}static isTaggedMethod(e){return"function"==typeof e&&!!e[Y]}static _$advancedCreate(e,t,n,s,o,r,l){var a,d,h,u;t._$detail||t.prepare();const{proto:p,template:f,dataDeepCopy:$,propertyPassingDeepCopy:_,relationDefinitionGroup:g}=t._$detail,m=t._$options,v=t.behavior,b=n?n.getBackendContext():s||i.backendContext||(()=>{if(Tt)return Tt;let e;return e=new U,Tt=e,e})(),y=m.externalComponent,S=m.propertyEarlyInit,C=i.writeExtraInfoToAttr,w=m.virtualHost,N=Object.create(p);N._$genericImpls=o,N._$external=y,N.tagName=e,N._$methodCaller=N;const E=v.ownerSpace,k=E._$sharedStyleScope,x=m.styleScope&&m.styleScope!==k;let O=null;if(b)if(3===b.mode)w||(O=b.document.createElement(e),x&&O.setAttribute("wx-host",E.styleScopeManager.queryName(m.styleScope)));else if(2===b.mode)w||(O=b.createElement(m.hostNodeTagName,e));else if(1===b.mode){O=(n?n._$backendShadowRoot:b.getRootNode()).createComponent(e,y,w,null!==(a=m.styleScope)&&void 0!==a?a:X.globalScope(),m.extraStyleScope,v._$externalClasses)}N._$initialize(w,O,n,n?n._$nodeTreeContext:b),N._$placeholderHandlerRemover=r;const L=n?n.getHostNode():void 0,M=null==L?void 0:L.getComponentOptions(),R=null!==(d=null==M?void 0:M.styleScope)&&void 0!==d?d:X.globalScope(),T=null!==(h=null==M?void 0:M.extraStyleScope)&&void 0!==h?h:void 0,D=null==L?void 0:L._$behavior.ownerSpace.styleScopeManager;if(N.classList=new K(N,v._$externalClasses,L?L.classList:null,R,T,D),O&&(2===b.mode&&O.setStyleScope(R,T,x?null!==(u=m.styleScope)&&void 0!==u?u:X.globalScope():void 0),D&&C)){const e=D.queryName(R);e&&O.setAttribute("exparser:info-class-prefix",`${e}--`)}const B=f.createInstance(N,it.createShadowRoot);if(O&&(O.__wxElement=N,3!==b.mode?O.associateValue(N):b.associateValue(O,N)),C&&O){const e=Rt;Rt+=1,N._$componentInstanceId=e,O.setAttribute("exparser:info-component-id",e)}N._$idPrefix=m.idPrefixGenerator?m.idPrefixGenerator.call(N):"";const I=v._$staticData,P=v._$data;let j;if(void 0===I)if(1===P.length){j=(0,P[0])()}else{j={};for(let e=0;e<P.length;e+=1){const t=P[e];Object.assign(j,t())}}else{j=$e(I);for(let e=0;e<P.length;e+=1){const t=P[e];Object.assign(j,t())}}const F=N._$relation=new et(N,g);N._$traitGroup=new J;const V=v._$traitBehaviors;if(void 0!==V)for(let e=0;e<V.length;e+=1){const{traitBehavior:t,impl:n}=V[e];N._$traitGroup.implement(t,n)}if(v._$methodCallerInit){const e=v._$methodCallerInit.call(N);N._$methodCaller=e}let G=!1;if(v._$init.length>0){let e=!0;const t=N.getMethodCaller(),n={self:t,data:j,setData:N.setData.bind(N),implement:(e,t)=>{if(G)throw new A("Cannot execute init-time functions after initialization","[implement]",v.is);N._$traitGroup.implement(e,t)},relation:function(e){if(G)throw new A("Cannot execute init-time functions after initialization","[implement]",v.is);const t=e.target,n=Je(v.ownerSpace,v.is,"undefined",e);let s;return s=n?F.add(n):Symbol("invalid"),{list:()=>F.getLinkedTargets(s).map((e=>e.getMethodCaller())),listAsTrait:t instanceof Q?()=>F.getLinkedTargets(s).map((e=>e.traitBehavior(t))):void 0}},observer:(e,t)=>{if(G)throw new A("Cannot execute init-time functions after initialization","[implement]",v.is);N.dynamicAddObserver(t,e)},lifetime:(e,t)=>{if(G)throw new A("Cannot execute init-time functions after initialization","[implement]",v.is);N.addLifetimeListener(e,t)},pageLifetime:(e,t)=>{if(G)throw new A("Cannot execute init-time functions after initialization","[implement]",v.is);N.addPageLifetimeListener(e,t)},method:e=>Dt._$tagMethod(e),listener:e=>Dt._$tagMethod(e)},s=v._$init;for(let o=0;o<s.length;o+=1){const i=c("Component Init",s[o],t,[n],void 0);if(i){const t=Object.keys(i);for(let n=0;n<t.length;n+=1){const s=t[n],o=i[s];Dt.isTaggedMethod(o)&&(e&&(e=!1,N._$methodMap=Object.create(N._$methodMap)),N._$methodMap[s]=o,m.writeFieldsToNode&&(N[s]=o))}}}}G=!0;const W=B.shadowRoot;N.shadowRoot=W;const H=new Be(N,j,m.pureDataPattern||null,$,_,m.reflectToAttributes,N._$dataGroupObserverTree);N._$dataGroup=H,S&&void 0!==l&&l(N),B.initValues(H.innerData||H.data),N._$tmplInst=B,H.setUpdateListener(((e,t)=>{B.updateValues(e,t)}));const z=v._$listeners;if(void 0!==z)for(let e=0;e<z.length;e+=1){const{id:t,ev:n,listener:s}=z[e],o=s;if("this"===t)N.addListener(n,(e=>o.call(N._$methodCaller,e)));else if(y){const e=W,s=t?e.getIdMap()[t]:e.root;s&&e.setListener(s,n,(e=>o.call(N._$methodCaller,e)))}else{const e=W,s=t?e.getElementById(t):e;s&&s.addListener(n,(e=>o.call(N._$methodCaller,e)))}}return N.triggerLifetime("created",[]),S||void 0===l||l(N),N}static createWithGenericsAndContext(e,t,n,s,o){const i=e=>{let t;return n&&(t=Object.create(null),Object.entries(n).forEach((([n,s])=>{t[n]={final:s,source:e.behavior,placeholder:null,waiting:null}}))),Lt(e,e.behavior,void 0,t)};if(t)return Dt._$advancedCreate(String(e),t,null,s,i(t),void 0,o);if(e instanceof Mt)return Dt._$advancedCreate(e.is,e,null,s,i(e),void 0);const r=ie().getComponentByUrl(e,"");return Dt._$advancedCreate(e,r,null,s,i(r),void 0)}static createWithGenerics(e,t,n,s){return Dt.createWithGenericsAndContext(e,t,n,null,s)}static createWithContext(e,t,n,s){return Dt.createWithGenericsAndContext(e,t,null,n,s)}static create(e,t,n){return Dt.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 A("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=Dt.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 Q?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}addLifetimeListener(e,t){Object.prototype.hasOwnProperty.call(this,"_$lifetimeFuncs")||(this._$lifetimeFuncs=this._$behavior._$getAllLifetimeFuncs());const n=this._$lifetimeFuncs;(n[e]=n[e]||new l("lifetime")).add(t)}removeLifetimeListener(e,t){Object.prototype.hasOwnProperty.call(this,"_$lifetimeFuncs")||(this._$lifetimeFuncs=this._$behavior._$getAllLifetimeFuncs());const n=this._$lifetimeFuncs[e];null==n||n.remove(t)}triggerLifetime(e,t){const n=this._$lifetimeFuncs[e];n&&n.call(this._$methodCaller,t,this)}triggerLifeTime(e,t){return this.triggerLifetime(e,t)}addPageLifetimeListener(e,t){Object.prototype.hasOwnProperty.call(this,"_$pageLifetimeFuncs")||(this._$pageLifetimeFuncs=this._$behavior._$getAllPageLifetimeFuncs());const n=this._$pageLifetimeFuncs;(n[e]=n[e]||new l("pageLifetime")).add(t)}removePageLifetimeListener(e,t){Object.prototype.hasOwnProperty.call(this,"_$pageLifetimeFuncs")||(this._$pageLifetimeFuncs=this._$behavior._$getAllPageLifetimeFuncs());const n=this._$pageLifetimeFuncs[e];null==n||n.remove(t)}triggerPageLifetime(e,t){const n=s=>{if(S(s)){if(s._$pageLifetimeFuncs){const n=s._$pageLifetimeFuncs[e];n&&n.call(s._$methodCaller,t,this)}s._$external||n(s.shadowRoot)}const o=s.childNodes;for(let e=0;e<o.length;e+=1){const t=o[e];m(t)&&n(t)}};n(this)}triggerPageLifeTime(e,t){return this.triggerPageLifetime(e,t)}dynamicAddObserver(e,t){Object.prototype.hasOwnProperty.call(this,"_$dataGroupObserverTree")||(this._$dataGroupObserverTree=this._$dataGroupObserverTree.cloneSub(),this._$dataGroup&&(this._$dataGroup._$observerTree=this._$dataGroupObserverTree));const n=this._$dataGroupObserverTree;try{n.addObserver(e,ue(t))}catch(e){O(e,"observer",this.is)}}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(),this._$mutationObserverTarget&&ve.callAttrObservers(this,{type:"properties",target:this,nameType:"external-class",attributeName:e})}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())&&S(t)&&t.applyExternalClassChanges();const s=t.childNodes;for(let t=0,n=s.length;t<n;t+=1)e(s[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 A("Cannot update data before component created","replaceDataOnPath",this);n.replaceDataOnPath(e,t)}spliceArrayDataOnPath(e,t,n,s){const o=this._$dataGroup;if(void 0===o)throw new A("Cannot update data before component created","spliceArrayDataOnPath",this);o.spliceArrayDataOnPath(e,t,n,s)}hasPendingChanges(){const e=this._$dataGroup;return void 0!==e&&e.getChanges().length>0}applyDataUpdates(){const e=this._$dataGroup;if(void 0===e)throw new A("Cannot update data before component created","applyDataUpdates",this);e.applyDataUpdates()}groupUpdates(e){const t=this._$dataGroup;if(void 0===t)throw new A("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 A("Cannot update data before component created","updateData",this);if("object"==typeof e&&null!==e){const n=Object.keys(e);for(let s=0;s<n.length;s+=1){const o=n[s];try{const n=he(o);t.replaceDataOnPath(n,e[o])}catch(e){O(e,"updateData",this)}}}}setData(e){const t=this._$dataGroup;if(void 0===t)throw new A("Cannot update data before component created","setData",this);if("object"==typeof e&&null!==e){const n=Object.keys(e);for(let s=0;s<n.length;s+=1){const o=n[s];try{const n=he(o);t.replaceDataOnPath(n,e[o])}catch(e){O(e,"setData",this)}}}t.applyDataUpdates()}}Dt.isComponent=S,Dt.prototype[_]=!0;class Bt{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 s=t[n],o=e[s];this._$methods.push({name:s,func:o})}return this}observer(e,t,n=!1){this._$observers||(this._$observers=[]);try{this._$observers.push({dataPaths:ue(e),func:t,once:n})}catch(e){O(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 s=e[t],o=n[s];this._$properties.push({name:s,def:o})}}const s=e.methods;if(void 0!==s){const e=Object.keys(s);for(let t=0;t<e.length;t+=1){const n=e[t],o=s[n];this._$methods.push({name:n,func:o})}}const o=e.observers;if(void 0!==o)if(this._$observers||(this._$observers=[]),Array.isArray(o))for(let e=0;e<o.length;e+=1){const{fields:t,observer:n}=o[e];try{this._$observers.push({dataPaths:ue(null!=t?t:"**"),func:n,once:!1})}catch(e){O(e,"definition",this._$is)}}else{const e=Object.keys(o);for(let t=0;t<e.length;t+=1){const n=e[t],s=o[n];try{this._$observers.push({dataPaths:ue(n),func:s,once:!1})}catch(e){O(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],s=i[n];this._$lifetimes.push({name:n,func:s,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],s=r[n];this._$pageLifetimes.push({name:n,func:s,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],s=l[n];this._$relations.push({name:n,rel:s})}}return this}registerBehavior(){const e=this._$is,t=new It(this);return void 0!==e&&this._$ownerSpace._$registerBehavior(e,t),t}extraThisFieldsType(){return this}registerComponent(){const e=this._$is,t=new It(this),n=new Mt(t);return void 0!==e&&this._$ownerSpace._$registerComponent(e,n),n}}class It{static create(e,t){return new Bt(e.is,t||ie()).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 s=Object.keys(e._$using);for(let o=0;o<s.length;o+=1){const i=s[o],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 s=Object.values(e);for(let e=0;e<s.length;e+=1){const o=s[e];"string"!=typeof o&&(t.has(o)||(t.add(o),n(o.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,s=this._$builder,o=this._$flatAncestors;if(Array.isArray(s._$behaviors))for(let e=0;e<s._$behaviors.length;e+=1){const i=s._$behaviors[e];let r=null;if(i instanceof It)r=i;else{const e=String(i);n&&(r=n.getBehaviorByUrl(e,t)),r||O(new Error(`behavior "${e}" is not found.`),"[prepare]",t)}if(!r)continue;r._$unprepared&&It.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={}),we(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=>{o.add(e)}))}const i=s._$traitBehaviors;if(void 0!==i&&(this._$traitBehaviors||(this._$traitBehaviors=[]),this._$traitBehaviors.push(...i)),"object"==typeof s._$using&&null!==s._$using){const o="object"==typeof s._$placeholders&&null!==s._$placeholders,i=Object.keys(s._$using);for(let r=0;r<i.length;r+=1){const l=i[r],a=s._$using[l];let d=null;if(o&&(d=null!==(e=s._$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),s=n.getComponentByUrlWithoutDefault(e,t);if(s)this._$using[l]={final:s,source:this,placeholder:null,waiting:null};else if(null!==d){const s={final:null,source:this,placeholder:d,waiting:null},o=n._$componentWaitingList(e,t);o&&(o.add((e=>{s.final=e,s.placeholder=null,s.waiting=null})),s.waiting=o),this._$using[l]=s}else{const t=n.getGlobalUsingComponent(e);this._$using[l]="string"==typeof t?t:{final:t,source:this,placeholder:null,waiting:null}}}else O(new Error(`cannot find component "${String(a)}"`),"[prepare]",t)}}if("object"==typeof s._$generics&&null!==s._$generics){const e=this._$generics=[],o=Object.create(null);this._$genericDefaults=o;const i=Object.keys(s._$generics);for(let r=0;r<i.length;r+=1){const l=i[r],a=s._$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 O(new Error(`cannot define generic "${l}" without a default implementor.`),"[prepare]",t);e.push(l),o[l]=d}}const r=s._$staticData;r&&(this._$staticData?we(this._$staticData,r):this._$staticData=r);const l=s._$methods;for(let e=0;e<l.length;e+=1){const{name:t,func:n}=l[e];this._$methodMap[t]=n}const a=s._$properties;if(void 0!==a){const e=[];for(let n=0;n<a.length;n+=1){const{name:s,def:o}=a[n],i="string"===(d=o)||d===String?{type:"string",optionalTypes:null,defaultFn:()=>"",observer:null,comparer:null,reflectIdPrefix:!1}:"number"===d||d===Number?{type:"number",optionalTypes:null,defaultFn:()=>0,observer:null,comparer:null,reflectIdPrefix:!1}:"boolean"===d||d===Boolean?{type:"boolean",optionalTypes:null,defaultFn:()=>!1,observer:null,comparer:null,reflectIdPrefix:!1}:"object"===d||d===Object?{type:"object",optionalTypes:null,defaultFn:()=>null,observer:null,comparer:null,reflectIdPrefix:!1}:"array"===d||d===Array?{type:"array",optionalTypes:null,defaultFn:()=>[],observer:null,comparer:null,reflectIdPrefix:!1}:"function"===d||d===Function?{type:"function",optionalTypes:null,defaultFn:()=>function(){},observer:null,comparer:null,reflectIdPrefix:!1}:"any"===d||null==d?{type:"any",optionalTypes:null,defaultFn:()=>null,observer:null,comparer:null,reflectIdPrefix:!1}:null;let r,l;if(null!==i)r=i,l=i.defaultFn;else{const e=o;let n=Ee(e.type),i=null;Array.isArray(e.optionalTypes)&&(i=e.optionalTypes.map(Ee),i.length>0&&("invalid"!==n&&"any"!==n||(n=i[0]))),"invalid"===n&&O(new Error(`the type of property "${s}" is illegal`),"[prepare]",t);const a=Ne(n);"function"==typeof e.default&&void 0!==e.value&&L(`the initial value of property "${s}" is not used when its default is provided.`,t);const d="function"==typeof e.default?()=>{const n=c(`Property "${s}" Default`,e.default,null,[],t);return void 0!==n?n:$e(a)}:()=>$e(a);let h,u;l="function"==typeof e.default?d:void 0!==e.value?()=>$e(e.value):()=>$e(a),"function"==typeof e.observer?h=e.observer:"string"==typeof e.observer?(h=this._$methodMap[e.observer]||null,h||O(new Error(`Cannot find method "${e.observer}" for observer of property "${s}".`),"[prepare]",t)):(h=null,void 0!==e.observer&&O(new Error(`The observer of property "${s}" is not a function, got "${typeof e.observer}".`),"[prepare]",t)),"function"==typeof e.comparer?u=e.comparer:(u=null,void 0!==e.comparer&&O(new Error(`the comparer of property "${s}" is not a function.`),"[prepare]",t));r={type:n,optionalTypes:i,defaultFn:d,observer:h,comparer:u,reflectIdPrefix:!!e.reflectIdPrefix}}this._$propertyMap[s]=r,e.push({name:s,func:l})}this._$data.push((()=>{const t={};for(let n=0;n<e.length;n+=1){const{name:s,func:o}=e[n];t[s]=o()}return t}))}var d;this._$data.push(...s._$data);const h=s._$observers;if(void 0!==h)for(let e=0;e<h.length;e+=1){const{dataPaths:n,func:s,once:o}=h[e],i="function"==typeof s?s:this._$methodMap[s];"function"==typeof i?this._$observers.push({dataPaths:n,observer:i,once:o}):O(new Error(`the "${String(i)}" observer is not a function.`),"[prepare]",t)}const u=s._$lifetimes;this._$lifetimes.push(...u);const p=s._$pageLifetimes;p&&(this._$pageLifetimes||(this._$pageLifetimes=[]),this._$pageLifetimes.push(...p));const f=s._$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 s=e[n],o=f[s],i="function"==typeof o?o:this._$methodMap[o];if(i){const e=s.indexOf(".");let t,n;e>=0?(t=s.slice(0,e),n=s.slice(e+1)):(t="",n=s),this._$listeners.push({id:t,ev:n,listener:i})}else O(new Error(`the "${s}" listener is not a function or a method name`),"[prepare]",t)}}}const $=s._$relations;if(void 0!==$){this._$relationMap||(this._$relationMap=Object.create(null));for(let e=0;e<$.length;e+=1){const{name:s,rel:o}=$[e];if(null==o)continue;const i=Je(n,t,s,o);i&&(this._$relationMap[s]=i)}}this._$init.push(...s._$init),o.add(this)}getTemplate(){return this._$template}_$updateTemplate(e){this._$template=e}hasBehavior(e){if(this._$unprepared&&this.prepare(),e instanceof It)return this._$flatAncestors.has(e);if(this.ownerSpace){const t=this.ownerSpace.getBehaviorByUrl(e,this.is);return!!t&&this._$flatAncestors.has(t)}return!1}listProperties(){return Object.keys(this._$propertyMap)}getPropertyType(e){var t;return null===(t=this._$propertyMap[e])||void 0===t?void 0:t.type}getPropertyOptionalType(e){var t;return null===(t=this._$propertyMap[e])||void 0===t?void 0:t.optionalTypes}getMethods(){return this._$methodMap}_$generateObserverTree(){const e=new Le(this._$propertyMap),t=this._$observers;for(let n=0;n<t.length;n+=1){const{dataPaths:s,observer:o}=t[n];e.addObserver(o,s)}return e}_$getAllLifetimeFuncs(){const e=Object.create(null),t=this._$lifetimes;for(let n=0;n<t.length;n+=1){const{name:s,func:o}=t[n];if(e[s])e[s].add(o);else{(e[s]=new l("lifetime")).add(o)}}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:s,func:o}=t[n];if(e[s])e[s].add(o);else{(e[s]=new l("pageLifetime")).add(o)}}return e}}var Pt;!function(e){e.ShadowAncestors="shadow-ancestors",e.ComposedAncestors="composed-ancestors",e.ShadowDescendantsRootFirst="shadow-descendants-root-first",e.ShadowDescendantsRootLast="shadow-descendants-root-last",e.ComposedDescendantsRootFirst="composed-descendants-root-first",e.ComposedDescendantsRootLast="composed-descendants-root-last"}(Pt||(Pt={}));class jt{constructor(e,t,n=Ze){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||Ze,"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 jt(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 s;if(s=t?n.getComposedParent():n.parentNode,!s)break;n=s}}else{const n=this._$rootFirst,s=function*(o){if(!(n&&o instanceof e&&!1===(yield o))){if(m(o))if(t){const e=o.iterateComposedChild();for(let t=e.next();!t.done;t=e.next())yield*s(t.value)}else{const e=o.childNodes;for(let t=0;t<e.length;t+=1){const n=e[t];yield*s(n)}}n||o instanceof e&&(yield o)}};yield*s(this._$node)}}forEach(e){const t=this._$nodeTypeLimit,n=this._$composed;if(this._$isAncestor){let s=this._$node;for(;;){if(s instanceof t&&!1===e(s))return;let o;if(o=n?s.getComposedParent():s.parentNode,!o)break;s=o}}else{const s=this._$rootFirst,o=i=>{if(s&&i instanceof t&&!1===e(i))return!1;if(m(i)){let e=!1;const t=t=>!1!==o(t)||(e=!0,!1);if(n?i.forEachComposedChild(t):i.childNodes.every(t),e)return!1}return!(!s&&i instanceof t&&!1===e(i))};o(this._$node)}}}const Ft=(e,t)=>{const n=e.getBackendContext();n&&((e,t)=>{e.render((()=>{"function"==typeof t&&c("render",t,e,[null])}))})(n,t||null)};var Ut=Object.freeze({__proto__:null});const Vt=e=>ie().defineBehavior(e),Gt=e=>ie().defineComponent(e);function Wt(e,t){return Dt.create(e,t||null)}const Ht=Ge.triggerEvent,zt=Ge.triggerExternalEvent;export{e as BackendMode,It as Behavior,Bt as BehaviorBuilder,K as ClassList,Dt as Component,Mt as ComponentDefinition,se as ComponentSpace,I as CurrentWindowBackendContext,Be as DataGroup,t as DeepCopyKind,Ze as Element,jt as ElementIterator,Pt as ElementIteratorType,U as EmptyBackendContext,W as EmptyComposedBackendContext,Ge as Event,Ie as EventBubbleStatus,Fe as EventMutLevel,l as FuncArr,be as MutationObserver,tt as NativeNode,Ce as NormalizedPropertyType,be as Observer,ze as ParsedSelector,Qe as RelationType,it as ShadowRoot,X as StyleScopeManager,qe as StyleSegmentIndex,nt as TextNode,Q as TraitBehavior,st as VirtualNode,M as addGlobalErrorListener,T as addGlobalWarningListener,n as backend,s as composedBackend,Wt as createElement,pe as dataPath,me as dataUtils,O as dispatchError,o as domlikeBackend,N as dumpElement,w as dumpElementToString,C as dumpSingleElementToString,ie as getDefaultComponentSpace,i as globalOptions,ye as mutationObserver,Vt as registerBehavior,Gt as registerElement,R as removeGlobalErrorListener,D as removeGlobalWarningListener,c as safeCallback,Ot as template,Ut as templateEngine,Ht as triggerEvent,zt as triggerExternalEvent,Ft as triggerRender,Z as typeUtils};
1
+ var e;!function(e){e[e.Shadow=1]="Shadow",e[e.Composed=2]="Composed",e[e.Domlike=3]="Domlike"}(e||(e={}));var t,n=Object.freeze({__proto__:null,BM:{DYNAMIC:!0,SHADOW:!1,COMPOSED:!1,DOMLIKE:!1},get BackendMode(){return e}}),s=Object.freeze({__proto__:null}),o=Object.freeze({__proto__:null});!function(e){e.None="none",e.Simple="simple",e.SimpleWithRecursion="simple-recursion"}(t||(t={}));const i={defaultComponentSpace:null,externalComponent:!1,templateEngine:null,styleScope:null,extraStyleScope:null,hostNodeTagName:"wx-x",multipleSlots:!1,dynamicSlots:!1,reflectToAttributes:!1,writeFieldsToNode:!0,writeIdToDOM:!1,useMethodCallerListeners:!1,idPrefixGenerator:null,pureDataPattern:null,dataDeepCopy:t.Simple,propertyPassingDeepCopy:t.Simple,listenerChangeLifetimes:!1,virtualHost:!1,propertyEarlyInit:!1,throwGlobalError:!1,writeExtraInfoToAttr:!1,backendContext:null,devTools:null},r=(e,t)=>{const n=void 0===t?i:t;if(void 0===e&&n!==i)return n;const s=null!=e?e:{};return{externalComponent:void 0!==s.externalComponent?s.externalComponent:n.externalComponent,templateEngine:void 0!==s.templateEngine?s.templateEngine:n.templateEngine,styleScope:void 0!==s.styleScope?s.styleScope:n.styleScope,hostNodeTagName:void 0!==s.hostNodeTagName?s.hostNodeTagName:n.hostNodeTagName,extraStyleScope:void 0!==s.extraStyleScope?s.extraStyleScope:n.extraStyleScope,multipleSlots:void 0!==s.multipleSlots?s.multipleSlots:n.multipleSlots,dynamicSlots:void 0!==s.dynamicSlots?s.dynamicSlots:n.dynamicSlots,reflectToAttributes:void 0!==s.reflectToAttributes?s.reflectToAttributes:n.reflectToAttributes,writeFieldsToNode:void 0!==s.writeFieldsToNode?s.writeFieldsToNode:n.writeFieldsToNode,writeIdToDOM:void 0!==s.writeIdToDOM?s.writeIdToDOM:n.writeIdToDOM,useMethodCallerListeners:void 0!==s.useMethodCallerListeners?s.useMethodCallerListeners:n.useMethodCallerListeners,idPrefixGenerator:void 0!==s.idPrefixGenerator?s.idPrefixGenerator:n.idPrefixGenerator,pureDataPattern:void 0!==s.pureDataPattern?s.pureDataPattern:n.pureDataPattern,dataDeepCopy:void 0!==s.dataDeepCopy?s.dataDeepCopy:n.dataDeepCopy,propertyPassingDeepCopy:void 0!==s.propertyPassingDeepCopy?s.propertyPassingDeepCopy:n.propertyPassingDeepCopy,listenerChangeLifetimes:void 0!==s.listenerChangeLifetimes?s.listenerChangeLifetimes:n.listenerChangeLifetimes,virtualHost:void 0!==s.virtualHost?s.virtualHost:n.virtualHost,propertyEarlyInit:void 0!==s.propertyEarlyInit?s.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=[],s=this._$arr;for(let o=0;o<s.length;o+=1){if(s[o]===e){n.push(...s.slice(o+1)),t=e;break}n.push(s[o])}this._$arr=n,this.empty=0===this._$arr.length}return t}call(e,t,n){const s=this._$arr;let o=!0;if(s)for(let i=0;i<s.length;i+=1){!1===c(this._$type,s[i],e,t,n)&&(o=!1)}return o}}class a{constructor(e){this.empty=!0,this._$arr=null,this._$type=e}getArr(){return this._$arr}hasFunc(){return null!==this._$arr&&this._$arr.length>0}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=[],s=this._$arr;for(let o=0;o<s.length;o+=1){const i=s[o];if(i.f===e){n.push(...s.slice(o+1)),t=i.data;break}n.push(i)}this._$arr=n,this.empty=0===this._$arr.length}return t}call(e,t,n,s,o){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,s);!1===(o?o(h):h)&&(r=!1)}return r}}let d=()=>{};function c(e,t,n,s,o){try{return t.apply(n,s)}catch(n){return void d(n,`${e||"Listener"} ${t.name||"(anonymous)"}`,o)}}const h=Symbol("TextNode"),u=Symbol("Element"),p=Symbol("NativeNode"),f=Symbol("VirtualNode"),$=Symbol("ShadowRootSymbol"),g=Symbol("Component"),_=e=>!!e&&e[h],m=e=>!!e&&e[u],v=e=>!!e&&e[p],b=e=>!!e&&e[f],y=e=>!!e&&e[$],S=e=>!!e&&e[g],C=e=>{if(m(e)){let t;return t=b(e)?`(virtual):${e.is}`:S(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)||(S(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 _(e)?e.textContent.trim():null===e?"<(null)>":void 0===e?"<(undefined)>":"<(unknown)>"},w=(e,t,n=0)=>{let s="";for(let e=n;e;e-=1)s+=" ";let o=s+C(e),i=!1;return m(e)&&(S(e)&&(i=e._$external),t?i?(o+=`\n${s} <(external)>`,e.forEachComposedChild((e=>{o+=`\n${w(e,t,n+2)}`}))):e.forEachComposedChild((e=>{o+=`\n${w(e,t,n+1)}`})):e.childNodes.forEach((e=>{o+=`\n${w(e,t,n+1)}`}))),o},N=(e,t)=>{console.log(w(e,t))};let E=!1;const k=new l("error"),x=new l("warning");function O(e,t,n,s){if(!E){E=!0,S(n)&&n.triggerLifetime("error",[e]);const o=!1===k.call(e,[e,t,n,s]);if(E=!1,o)return}if(i.throwGlobalError)throw e;console.error([e instanceof Error?`${e.message}`:String(e),s?`\t@${C(s)}`:void 0,n?`\t${t||""}@${"string"==typeof n?`<${n}>`:C(n||!1)}`:void 0].filter(Boolean).join("\n"))}function L(e,t,n){x.call(null,[e,t||"",n])&&console.warn(e)}d=O;class R extends Error{constructor(e,t,n,s){super(e),this.additionalStack=t,this.relatedComponent=n,this.element=s,O(this,t,n,s)}}function A(e){k.add(e)}function M(e){k.remove(e)}function T(e){x.add(e)}function D(e){x.remove(e)}const B=["touchstart","touchmove","touchend","touchcancel","mousedown","mousemove","mouseout","mouseover","mouseup","mouseenter","mouseleave","click"],I=["before","after"];class P{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,this.iframe=null,this._stopOverlayInspectHandler=null}destroy(){}getWindowWidth(){return document.documentElement.clientWidth}getWindowHeight(){return document.documentElement.clientHeight}getDevicePixelRatio(){return window.devicePixelRatio}getTheme(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"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}"`);if(""===n){const e=this._$styleSheets.length;return this._$styleSheets.push(void 0),e}const s=document.createElement("style");s.type="text/css",s.innerHTML=n,void 0!==t&&s.setAttribute("wx-style-scope",String(t)),document.head.appendChild(s);const o=this._$styleSheets.length;return this._$styleSheets.push(s),o}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 s=Object.keys(n);for(let n=0;n<s.length;n+=1){const o=s[n];"function"!=typeof e[o]&&(t[o]=e[o])}n=Object.getPrototypeOf(n)}return t}_$trigger(e,t,n,s,o){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:s,composed:o,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}},s=(t,n)=>{const s=n.identifier;if(e[s]){const o=e[s];(Math.abs(o.x-n.clientX)>10||Math.abs(o.y-n.clientY)>10)&&(delete e[s],this._$trigger(t,"canceltap",o,!0,!0))}},o=(t,n)=>{const s=n.identifier;if(e[s]){const o=e[s];delete e[s],Math.abs(o.x-n.clientX)>10||Math.abs(o.y-n.clientY)>10?this._$trigger(t,"canceltap",o,!0,!0):this._$trigger(t,"tap",o,!0,!0)}},i=(t,n)=>{const s=n.identifier;if(e[s]){const n=e[s];delete e[s],this._$trigger(t,"canceltap",n,!0,!0)}},r=e=>{const t=e.changedTouches;for(let n=0;n<t.length;n+=1)o(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 s=e.changedTouches;for(let e=0;e<s.length;e+=1)n(0,s[e]);const o=e.target;o.__touchCount||(o.__touchCount=0,o.addEventListener("touchend",r),o.addEventListener("touchcancel",l)),o.__touchCount+=s.length}),{capture:!0}),document.body.addEventListener("touchmove",(e=>{const t=e.changedTouches;for(let n=0;n<t.length;n+=1)s(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||s(e,{identifier:-1,clientX:e.clientX,clientY:e.clientY})}),{capture:!0}),document.body.addEventListener("mouseup",(e=>{t||o(e,{identifier:-1,clientX:e.clientX,clientY:e.clientY})}),{capture:!0})}setListenerStats(e,t,n,s){if(!e)return;const o=B.includes(t),i=2===s;if(o){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))}),{capture:n}))}setModelBindingStat(e,t,n){const s=(s,o)=>{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(s,(()=>{var n;const s=null===(n=e._$wxArgs)||void 0===n?void 0:n.modelListeners[t];null==s||s(o())}))}e._$wxArgs.modelListeners[t]=n},o=e.tagName;let i=!1;if("INPUT"===o){const n=e,o=n.type;"checkbox"===o||"radio"===o?"checked"===t&&(i=!0,s("change",(()=>n.checked))):"value"===t&&(i=!0,s("input",(()=>n.value)))}else if("TEXTAREA"===o){const n=e;"value"===t&&(i=!0,s("input",(()=>n.value)))}else if("SELECT"===o){const n=e;"value"===t&&(i=!0,s("change",(()=>n.value)))}i||L(`unsupported model binding on "${t}" of "${o.toLowerCase()}" element.`)}createIntersectionObserver(e,t,n,s,o){const i=new IntersectionObserver((e=>{e.forEach((e=>{o({intersectionRatio:e.intersectionRatio,boundingClientRect:e.boundingClientRect,intersectionRect:e.intersectionRect,relativeRect:e.rootBounds,time:e.time})}))}),{root:t,rootMargin:n,threshold:s});return i.observe(e),{disconnect(){i.disconnect()}}}createMediaQueryObserver(e,t){let n=null;const s=()=>{const s=(()=>{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!==s&&(n=s,t({matches:s}))};return setTimeout(s,0),window.addEventListener("resize",s),{disconnect(){window.removeEventListener("resize",s)}}}getContext(e,t){t(e)}setFocusedNode(e){e.focus()}getFocusedNode(e){var t;let n=document.activeElement;for(;!(null==n?void 0:n.__wxElement);)n=(null==n?void 0:n.parentNode)||null;e(null!==(t=null==n?void 0:n.__wxElement)&&void 0!==t?t:null)}onWindowResize(e){window.addEventListener("resize",(()=>{e({width:this.getWindowWidth(),height:this.getWindowHeight(),devicePixelRatio:this.getDevicePixelRatio()})}))}onThemeChange(e){window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(()=>{e({theme:this.getTheme()})}))}elementFromPoint(e,t,n){var s;let o=document.elementFromPoint(e,t);for(;null!==o&&!o.__wxElement;)o=(null==o?void 0:o.parentNode)||null;n(null!==(s=null==o?void 0:o.__wxElement)&&void 0!==s?s:null)}getAllComputedStyles(e,t){const n=window.getComputedStyle(e);t({properties:F(n)})}getPseudoComputedStyles(e,t,n){const s=window.getComputedStyle(e,`::${t}`);n({properties:F(s)})}getBoxModel(e,t){const n=e.getBoundingClientRect(),s=window.getComputedStyle(e),o=parseFloat(s.marginLeft),i=parseFloat(s.marginTop),r=parseFloat(s.marginRight),l=parseFloat(s.marginBottom),a=parseFloat(s.borderLeftWidth),d=parseFloat(s.borderTopWidth),c=parseFloat(s.borderRightWidth),h=parseFloat(s.borderBottomWidth),u=parseFloat(s.paddingLeft),p=parseFloat(s.paddingTop),f=parseFloat(s.paddingRight),$=parseFloat(s.paddingBottom),g=n,_={left:g.left-o,top:g.top-i,width:g.width+r+o,height:g.height+i+l},m={left:g.left+a,top:g.top+d,width:g.width-c-a,height:g.height-d-h};t({margin:_,border:g,padding:m,content:{left:m.left+u,top:m.top+p,width:m.width-f-u,height:m.height-p-$}})}getPseudoTypes(e,t){const n=[],s=e;I.forEach((e=>{const t=`::${e}`,o=window.getComputedStyle(s,t);"none"!==o.getPropertyValue("content")&&"none"!==o.getPropertyValue("display")&&"hidden"!==o.getPropertyValue("visibility")&&n.push(e)})),t(n)}setScrollPosition(e,t,n,s){if(t<=0&&n<=0)e.scrollIntoView({behavior:0!==s?"smooth":"auto"});else{const{left:o,top:i}=e.getBoundingClientRect();window.scrollTo({left:o+t,top:i+n,behavior:0!==s?"smooth":"auto"})}}queryMatchedRules(e,t,n,s){const o=[],i=s?new RegExp(`:{1,2}${s}$`):null;return U(t,((t,s,r)=>{if(s instanceof CSSStyleRule){const l=[];for(let e=0;e<r.length;e+=1){const t=r[e];if(t instanceof CSSMediaRule){if(!matchMedia(t.conditionText).matches)return;l.push(`@media ${t.conditionText}`)}else"undefined"!=typeof CSSLayerBlockRule&&t instanceof CSSLayerBlockRule&&l.push(`@layer ${t.name}`)}const a=s.selectorText;let d=!1;const c=function(e){let t="";const n=[];let s=0,o=!1,i=!1,r=!1;for(let l=0;l<e.length;l+=1){const a=e[l];if(i)t+=a,i=!1;else if(r)"*"===a&&l<e.length-1&&"/"===e[l+1]&&(r=!1,l+=1);else if(o)"\\"===a?i=!0:a===o&&(o=!1),t+=a;else switch(a){case"/":if("*"===e[l+1]){r=!0,l+=1;break}t+=a;break;case"\\":i=!0,t+=a;break;case'"':case"'":o=a,t+=a;break;case"(":case"[":case"{":s+=1,t+=a;break;case")":case"]":case"}":s>0&&(s-=1),t+=a;break;case",":0===s?(n.push(t.trim()),t=""):t+=a;break;default:t+=a}}t.trim()&&n.push(t.trim());return n}(a).map((e=>{const t=i?i.test(e)&&n.matches(e.replace(i,"")):n.matches(e);return d||(d=t),{text:e,matches:t}}));if(!d)return;const h=s.style.cssText,u=F(s.style);o.push({sheetIndex:e,ruleIndex:t,inlineText:s.cssText,mediaQueries:l,selector:a,selectors:c,properties:u,propertyText:h,weightHighBits:0})}})),o}getMatchedRules(e,t){const n=e,s=document.styleSheets,o=[];for(let e=0;e<s.length;e+=1){const t=s[e];o.push(...this.queryMatchedRules(e,t,n))}const i=n.style.cssText;t({inline:F(n.style),inlineText:i,rules:o})}getPseudoMatchedRules(e,t,n){const s=e,o=document.styleSheets,i=[];for(let e=0;e<o.length;e+=1){const n=o[e];i.push(...this.queryMatchedRules(e,n,s,t))}n({inline:[],rules:i})}getIframe(){return this.iframe||(this.iframe=document.createElement("iframe"),this.iframe.style.display="none",document.body.appendChild(this.iframe)),this.iframe}getDefaultComputedStyles(e){const t=this.getIframe().contentWindow,n=t.document,s=n.createElement(e.tagName);n.body.appendChild(s);const o=t.getComputedStyle(s),i={};for(let e=0;e<o.length;e+=1){const t=o[e];i[t]=o.getPropertyValue(t)}return s.remove(),i}getModifiedComputedStyles(e){const t=this.getDefaultComputedStyles(e),n=window.getComputedStyle(e),s={};for(let e=0;e<n.length;e+=1){const o=n[e];["blockSize"].includes(o)||n.getPropertyValue(o)!==t[o]&&(s[o]=n.getPropertyValue(o))}return s}getInheritedRules(e,t){const n=this.getModifiedComputedStyles(e),s=window.document.documentElement,o=[];for(let t=e.parentNode;t&&t!==s;t=t.parentNode){const e=[];let s;this.getMatchedRules(t,(({rules:e})=>{s=e}));for(let t=0;t<s.length;t+=1){const o=s[t];o.properties.some((e=>e.name.replace(/-(.|$)/g,(e=>e[1]?e[1].toUpperCase():""))in n))&&e.push(o)}e.length&&o.push(e)}t({rules:o})}findStyleRule(e,t){const n=document.styleSheets[e],s=null==n?void 0:n.cssRules[t];return"CSSStyleRule"===(null==s?void 0:s.constructor.name)?s:null}replaceStyleSheetAllProperties(e,t,n,s){const o=this.findStyleRule(e,t);o?(o.style.cssText=n,s(0)):s(null)}startOverlayInspect(e){if(this._stopOverlayInspectHandler)return;const t=window.document.body.style.pointerEvents;window.document.body.style.pointerEvents="none";const n=n=>{n.preventDefault();const{x:s,y:o}=n;window.document.body.style.pointerEvents=t,this.elementFromPoint(s,o,(t=>{this._stopOverlayInspectHandler&&(window.document.body.style.pointerEvents="none",e("tap",t))}))},s=j((n=>{if("mouseout"===n.type)e("mouseout",null);else if("mousemove"===n.type){const{x:s,y:o}=n;window.document.body.style.pointerEvents=t,this.elementFromPoint(s,o,(t=>{this._stopOverlayInspectHandler&&(window.document.body.style.pointerEvents="none",e("mouseover",t))}))}}),100);window.addEventListener("click",n),window.addEventListener("mousemove",s,{passive:!0,capture:!0}),window.addEventListener("mouseout",s,{passive:!0,capture:!0}),this._stopOverlayInspectHandler=()=>{window.document.body.style.pointerEvents=t,window.removeEventListener("click",n),window.removeEventListener("mousemove",s,{capture:!0}),window.removeEventListener("mouseout",s,{capture:!0})}}stopOverlayInspect(){this._stopOverlayInspectHandler&&(this._stopOverlayInspectHandler(),this._stopOverlayInspectHandler=null)}}const j=(e,t)=>{let n=null;return(...s)=>{null!==n&&clearTimeout(n),n=setTimeout((()=>{n=null,e(...s)}),t)}},F=e=>{const t=[];for(let n=0;n<e.length;n+=1){const s=e[n],o="important"===e.getPropertyPriority(s),i=e.getPropertyValue(s);t.push({name:s,value:i,important:o})}return t},U=(e,t)=>{let n=0;const s=[],o=e=>{for(let i=0;i<e.length;i+=1){const r=e[i];r instanceof CSSConditionRule||"undefined"!=typeof CSSLayerBlockRule&&r instanceof CSSLayerBlockRule?(s.push(r),o(r.cssRules),s.pop()):(t(n,r,s),n+=1)}};o(e.cssRules)};var V;!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"}(V||(V={}));class W{constructor(){this.mode=1,this._$styleSheetIdInc=1,this._$renderCallbacks=null,this._$shadowRoot=new H}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 G(0)}onEvent(e,t){}}class G{constructor(e){this._$shadowRoot=3===e?new H: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){}setSlot(e){}setSlotName(e){}setSlotElement(e){}setExternalSlot(e){}setInheritSlots(){}setStyle(e,t){}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 H extends G{constructor(){super(4)}createElement(e,t){return new G(1)}createTextNode(e){return new G(2)}createComponent(e,t,n,s,o,i,r,l){return new G(3)}createVirtualNode(e){return new G(4)}}class z{constructor(){this.mode=2,this._$styleSheetIdInc=1,this._$renderCallbacks=null,this._$rootNode=new q}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 q}createTextNode(e){return new q}createFragment(){return new q}onEvent(e){}createMediaQueryObserver(e,t){return{disconnect:()=>{}}}}class q{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,s){return{disconnect:()=>{}}}getContext(e){e(null)}}const X=/[^\s.,]+/g,K=e=>{const t=[];let n;for(X.lastIndex=0;null!==(n=X.exec(e));)t.push(String(n[0]));return t};class Y{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 Z{constructor(e,t,n,s,o,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=s,this._$extraScope=o,this._$rootScope=(null==n?void 0:n._$owner)?n._$rootScope:s,this._$prefixManager=i,t&&(this._$externalNames=t,this._$externalRawAlias=[])}_$resolvePrefixes(e,t){const n=this._$owner,s=null==n?void 0:n._$externalNames,o=s?s.indexOf(e):-1;if(n&&-1!==o){this._$hasAliasNames=!0;const e=n._$externalRawAlias[o];if(e)for(let s=0;s<e.length;s+=1)n._$resolvePrefixes(e[s],t)}else if("~"===e[0])t(this._$rootScope,e.slice(1));else if("^"===e[0]){let n=e.slice(1),s=this._$owner;for(;"^"===n[0];)n=n.slice(1),s=null==s?void 0:s._$owner;t((null==s?void 0:s._$owner)?s._$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,s=t.length;e<s;e+=1)n[e]=String(t[e])}else n=K(String(t));const s=this._$externalNames.indexOf(e);-1!==s&&(this._$dirtyExternalNames=this._$dirtyExternalNames||[],this._$dirtyExternalNames.push(e),this._$externalRawAlias[s]=n)}_$getAlias(){var e;const t=Object.create(null);return null===(e=this._$externalNames)||void 0===e||e.forEach(((e,n)=>{t[e]=this._$externalRawAlias[n]})),t}_$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 s=this._$externalRawAlias[e]||[];for(let o=0;o<t.length;o+=1)s.includes(t[o])&&(this._$dirtyExternalNames=this._$dirtyExternalNames||[],this._$dirtyExternalNames.push(n[e]))}const s=this._$rawNames.some((e=>e.some((e=>t.includes(e)))));return s&&this._$updateResolvedNames(),!!this._$dirtyExternalNames||s}_$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],s=this._$externalNames.indexOf(n),o=this._$externalRawAlias[s]||[];this._$element._$backendElement.setClassAlias(n,o)}return this._$dirtyExternalNames=null,!1}return!0}_$markExternalClassUpdated(){this._$dirtyExternalNames=null}_$fasterAddUpdateResolvedNames(){const e=this._$element._$backendElement;if(!e)return!1;const t=this._$rawNames;this._$hasAliasNames=!1;for(let n=0,s=t.length;n<s;n+=1){const s=t[n];if(s)for(let t=0,n=s.length;t<n;t+=1){const n=s[t];1===this._$element.getBackendMode()?this._$addClass(n,void 0,e):this._$resolvePrefixes(n,((t,n)=>{this._$addClass(n,t,e)}))}}return!0}_$updateResolvedNames(){const e=this._$element._$backendElement;if(!e)return!1;const t=this._$rawNames,n=this._$backendNames,s=this._$backendNameScopes,o=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 s=!1;for(let e=0;e<i.length;e+=1)if(t===i[e]){l[e]+=1,s=!0;break}s||(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]===s[e]){l=!0,o[e]=0;break}l||(a=!0,this._$addClassToBackend(i[t],r[t],e))}for(let t=0;t<n.length;t+=1)0!==o[t]&&(a=!0,this._$removeClassFromBackend(n[t],s[t],e));return this._$backendNames=i,this._$backendNameScopes=r,this._$backendNamesCount=l,a}_$addClassToBackend(e,t,n){var s;if(3===this._$element.getBackendMode()){const o=void 0===t?"":null===(s=this._$prefixManager)||void 0===s?void 0:s.queryName(t),i=o?`${o}--${e}`:e;n.classList.add(i)}else 2===this._$element.getBackendMode()?n.addClass(e,t):n.addClass(e)}_$removeClassFromBackend(e,t,n){var s;if(3===this._$element.getBackendMode()){const o=t&&(null===(s=this._$prefixManager)||void 0===s?void 0:s.queryName(t)),i=o?`${o}--${e}`:e;n.classList.remove(i)}else 2===this._$element.getBackendMode()?n.removeClass(e,t):n.removeClass(e)}_$addClass(e,t,n){const s=this._$backendNames,o=this._$backendNameScopes,i=this._$backendNamesCount;let r=!1;for(let n=0;n<s.length;n+=1)if(e===s[n]&&t===o[n]){r=!0,i[n]+=1;break}r||(s.push(e),o.push(t),i.push(1),this._$addClassToBackend(e,t,n))}_$removeClass(e,t,n){const s=this._$backendNames,o=this._$backendNameScopes,i=this._$backendNamesCount;for(let r=0;r<s.length;r+=1)if(e===s[r]&&t===o[r]){i[r]<=1?(s.splice(r,1),o.splice(r,1),i.splice(r,1),this._$removeClassFromBackend(e,t,n)):i[r]-=1;break}}toggle(e,t,n=0){const s=this._$element._$backendElement,o=this._$rawNames[n]?this._$rawNames[n].indexOf(e):-1;let i=!1;if(void 0===t?-1===o:!!t){if(-1===o){const t=this._$rawNames;t[n]||(t[n]=[]);t[n].push(e),s&&(1===this._$element.getBackendMode()?this._$addClass(e,void 0,s):this._$resolvePrefixes(e,((e,t)=>{this._$addClass(t,e,s)}))),i=!0}}else if(-1!==o){const t=this._$rawNames[n];t&&t.splice(o,1),s&&(1===this._$element.getBackendMode()?this._$removeClass(e,void 0,s):this._$resolvePrefixes(e,((e,t)=>{this._$removeClass(t,e,s)}))),i=!0}return i}contains(e,t=0){const n=this._$rawNames[t]||[];for(let t=0;t<n.length;t+=1){const s=n[t];if("~"===s[0]){if(s.slice(1)===e)return!0}else if("^"===s[0]){let t=s.slice(1);for(;"^"===t[0];)t=t.slice(1);if(t===e)return!0}else if(s===e)return!0}return!1}setClassNames(e,t=0){let n;n=null==e?[]:Array.isArray(e)?K(e.join(" ")):K(String(e));const s=0===this._$rawNames.length;return this._$rawNames[t]=n,s?this._$fasterAddUpdateResolvedNames():this._$updateResolvedNames()}setClassNameList(e,t=0){const n=0===this._$rawNames.length;return this._$rawNames[t]=e.filter((e=>""!==e)),n?this._$fasterAddUpdateResolvedNames():this._$updateResolvedNames()}getClassNames(e=0){const t=this._$rawNames[e]||[];return t?t.join(" "):""}}const Q=Symbol("method");var J=Object.freeze({__proto__:null,METHOD_TAG:Q});class ee{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 te{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 ne=(e,t)=>{let n;n="/"!==e[0]?t.split("/").slice(0,-1).concat(e.split("/")):e.split("/");const s=[];for(let e=0;e<n.length;e+=1){const t=n[e];""!==t&&"."!==t&&(".."!==t?s.push(t):s.pop())}return s.join("/")},se=(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:ne(e.slice(t+1),"")}}return{domain:e.slice(0,n+3),absPath:ne(e.slice(n+3),"")}}return{domain:null,absPath:ne(e,t)}};class oe{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);-1!==t&&this._$callbacks.splice(t,1)}call(e){for(;this._$callbacks.length>0;){this._$callbacks.shift()(e)}}}class ie{constructor(e,t,n,s=!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,this._$sharedStyleScope=0,this.hooks={createTextNode:(e,t)=>e(t),createNativeNode:(e,t,n)=>e(t,n),createComponent:(e,t,n)=>e(t,n)},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 Y,this._$allowUnusedNativeNode=s}updateComponentOptions(e){this._$componentOptions=r(e,this._$componentOptions)}getComponentOptions(){return this._$componentOptions}setSharedStyleScope(e){this._$sharedStyleScope=e}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:s}=se(e,t),o=this.getComponent(s,!0,n);if(!o)throw new Error(`There is no component "${s}" in the space and no default component can be used`);return o}getComponentByUrlWithoutDefault(e,t){const{domain:n,absPath:s}=se(e,t);return this.getComponent(s,!1,n)||null}getComponent(e,t=!0,n=null){let s;if(n){const e=this._$importedSpaces[n];if(e){const{space:t,privateUse:n}=e;s=n?t._$list:t._$pubList}}else s=this._$list;if(s){const t=s[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:s}=se(e,t);return this._$getBehavior(s,n)||null}_$getBehavior(e,t=null){let n;if(t){const e=this._$importedSpaces[t];if(e){const{space:t,privateUse:s}=e;n=s?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 jt(t,this).definition(e).registerComponent()}defineBehavior(e){const t=e.is;return new jt(t,this).definition(e).registerBehavior()}define(e){return new jt(e,this)}defineWithMethodCaller(e){return new jt(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:s}=e[t];n.call(s)}}}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 s=this._$pubListWaiting[e];s&&(delete this._$pubListWaiting[e],s.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:s}=se(e,t);let o,i,r;if(n){const e=this._$importedSpaces[n];if(!e)return null;if(i=e.space,r=!e.privateUse,r){if(i._$pubList[s])return null;o=i._$pubListWaiting}else{if(i._$list[s])return null;o=i._$listWaiting}}else{if(i=this,r=!1,this._$list[s])return null;o=this._$listWaiting}let l=o[s];return l||(l=o[s]=new oe(i,r,s),l)}setComponentWaitingListener(e){this._$componentWaitingListener=e}createComponentByUrl(e,t,n,s){let o=t,i=null;const r=o.indexOf("#");r>=0&&(o=o.slice(0,r));const l=o.indexOf("?");l>=0&&(i=o.slice(l+1),o=o.slice(0,l));const a=this.getComponentByUrl(o,"");let d=null;n&&(d=Object.create(null),Object.keys(n).forEach((e=>{const t=n[e],s=this.getComponentByUrl(t,"");d[e]=s})));return Pt.createWithGenericsAndContext(e,a,d,s,(e=>{if(i){let t=!1;i.split("&").forEach((n=>{const s=n.indexOf("=");if(s>=0){const o=decodeURIComponent(n.slice(0,s)),i=decodeURIComponent(n.slice(s+1));e._$dataGroup.replaceProperty(o,i)&&(t=!0)}})),t&&e.applyDataUpdates()}}))}defineTraitBehavior(e){return new ee(this,e)}}let re=null;const le=()=>{if(re)return re;const e=new ie;return re=e,e},ae=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},de=e=>{const t=e.str;let n="";for(;e.cur<t.length;){const s=t[e.cur];if(!(s>="0"&&s<="9"))break;n+=s,e.cur+=1}if(!n)throw new Error(`data path descriptor "${t}" is illegal at char ${e.cur} (illegal index)`);return parseInt(n,10)},ce=e=>{const t=e.str;let n="";for(;e.cur<t.length;){const s=t[e.cur];if("\\"===s)if(e.cur+1===t.length);else{n+=t[e.cur+1],e.cur+=1}else if(/^[_a-zA-Z]$/.test(s))n+=s;else{if(!(s>="0"&&s<="9"))break;if(""===n)throw new Error(`data path descriptor "${t}" is illegal at char ${e.cur} (field name cannot start with digits)`);n+=s}e.cur+=1}return n},he=e=>{const t=e.str;let n="";for(;e.cur<t.length;){const s=t[e.cur];if("\\"===s)if(e.cur+1===t.length)n+="\\",e.cur+=1;else{const s=t[e.cur+1];"."===s||"["===s||"]"===s||"\\"===s?(n+=s,e.cur+=2):(n+="\\",e.cur+=1)}else{if("."===s||"["===s)break;n+=s,e.cur+=1}}return n},ue=e=>{const t=e.str;if(ae(e),"*"===t[e.cur]&&"*"===t[e.cur+1])return e.cur+=2,["**"];const n=ce(e);if(!n)throw new Error(`data path descriptor "${t}" is illegal at char ${e.cur} (first field name illegal)`);const s=[n];for(;e.cur<t.length&&ae(e);){const n=t[e.cur];if("."===n){if(e.cur+=1,ae(e),"*"===t[e.cur]&&"*"===t[e.cur+1]){s.push("**"),e.cur+=2;break}const n=ce(e);if(!n)throw new Error(`data path descriptor "${t}" is illegal at char ${e.cur} (field name illegal)`);s.push(n)}else{if("["!==n)break;{e.cur+=1,ae(e);const n=de(e);ae(e);if("]"!==t[e.cur])throw new Error(`data path descriptor "${t}" is illegal at char ${e.cur} (illegal index)`);e.cur+=1,s.push(n)}}}return s},pe=e=>{const t=(e=>{const t=e.str,n=[];for(;e.cur<t.length;){const s=t[e.cur];if("."===s){e.cur+=1;const t=he(e);""!==t&&n.push(t)}else if("["===s){e.cur+=1;const s=de(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(s)}else{const t=he(e);n.push(t)}}return 0===n.length&&n.push(""),n})({str:e,cur:0});return t},fe=e=>{if("string"!=typeof e)return e.map((e=>ue({str:e,cur:0})));const t={str:e,cur:0},n=(e=>{const t=[];for(t.push(ue(e)),ae(e);","===e.str[e.cur];)e.cur+=1,t.push(ue(e)),ae(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 $e=Object.freeze({__proto__:null,parseMultiPaths:fe,parseSinglePath:pe});const ge=(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 s=0;s<e.length;s+=1)n[s]=ge(e[s],t);return n}const s={};t.set(e,s);const o=Object.keys(e);for(let n=0;n<o.length;n+=1){const i=o[n];s[i]=ge(e[i],t)}return s}return"symbol"==typeof e?Symbol(e.description):e},_e=e=>{if("object"==typeof e&&null!==e){if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n+=1)t[n]=_e(e[n]);return t}const t={},n=Object.keys(e);for(let s=0;s<n.length;s+=1){const o=n[s];t[o]=_e(e[o])}return t}return"symbol"==typeof e?Symbol(e.description):e},me=(e,t)=>t?ge(e,new WeakMap):_e(e);var ve;!function(e){e[e.Disabled=0]="Disabled",e[e.Enabled=1]="Enabled",e[e.Destroyed=2]="Destroyed"}(ve||(ve={}));var be=Object.freeze({__proto__:null,get AutoDestroyState(){return ve},deepCopy:me,simpleDeepCopy:_e});class ye{constructor(e){this._$subtreeObserversCount=0,this.attrObservers=null,this.allAttrObservers=null,this.textObservers=null,this.childObservers=null,this.attachObservers=null,this._$bound=e}attachChild(e){e._$mutationObserverTarget||(e._$mutationObserverTarget=new ye(e)),this._$subtreeObserversCount>0&&e._$mutationObserverTarget.updateSubtreeCount(this._$subtreeObserversCount)}detachChild(e){e._$mutationObserverTarget&&e._$mutationObserverTarget.updateSubtreeCount(-this._$subtreeObserversCount)}updateSubtreeCount(e){this._$subtreeObserversCount+=e;const t=this._$bound;if(!m(t))return;t.childNodes.forEach((t=>{t._$mutationObserverTarget||(t._$mutationObserverTarget=new ye(t)),t._$mutationObserverTarget.updateSubtreeCount(e)}))}hasSubtreeListeners(){return this._$subtreeObserversCount>0}static callAttrObservers(e,t){var n;let s=e;do{const e=s._$mutationObserverTarget;null===(n=null==e?void 0:e.allAttrObservers)||void 0===n||n.call(s,[t]),!(null==e?void 0:e.attrObservers)||"basic"!==t.nameType&&"attribute"!==t.nameType&&"component-property"!==t.nameType||e.attrObservers.call(s,[t]);const o=s.parentNode;if(!o)break;if(s=o,!s._$mutationObserverTarget)break}while(s._$mutationObserverTarget._$subtreeObserversCount>0)}static callTextObservers(e,t){var n;let s=e;do{const e=s._$mutationObserverTarget;null===(n=null==e?void 0:e.textObservers)||void 0===n||n.call(s,[t]);const o=s.parentNode;if(!o)break;if(s=o,!s._$mutationObserverTarget)break}while(s._$mutationObserverTarget._$subtreeObserversCount>0)}static callChildObservers(e,t){var n;let s=e;do{const e=s._$mutationObserverTarget;null===(n=null==e?void 0:e.childObservers)||void 0===n||n.call(s,[t]);const o=s.parentNode;if(!o)break;if(s=o,!s._$mutationObserverTarget)break}while(s._$mutationObserverTarget._$subtreeObserversCount>0)}static callAttachObservers(e,t){var n;const s=e._$mutationObserverTarget;null===(n=null==s?void 0:s.attachObservers)||void 0===n||n.call(e,[t])}}class Se{constructor(e){this._$subtreeListenersCount=0,this._$boundFuncArrs=[],this._$boundTarget=null,this._$listener=e,this._$normalizedListener=null}static create(e){return new Se(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 s;e._$mutationObserverTarget?s=e._$mutationObserverTarget:(s=new ye(e),e._$mutationObserverTarget=s),this._$listener=null;const o=t.subtree?n:function(e){e.target===this&&n.call(this,e)};this._$normalizedListener=o,this._$boundTarget=s,"all"===t.properties?(s.allAttrObservers||(s.allAttrObservers=new l("attributeObserver")),s.allAttrObservers.add(o),this._$boundFuncArrs.push(s.allAttrObservers),this._$subtreeListenersCount+=1):t.properties&&(s.attrObservers||(s.attrObservers=new l("attributeObserver")),s.attrObservers.add(o),this._$boundFuncArrs.push(s.attrObservers),this._$subtreeListenersCount+=1),t.childList&&(s.childObservers||(s.childObservers=new l("childObserver")),s.childObservers.add(o),this._$boundFuncArrs.push(s.childObservers),this._$subtreeListenersCount+=1),t.characterData&&(s.textObservers||(s.textObservers=new l("textObserver")),s.textObservers.add(o),this._$boundFuncArrs.push(s.textObservers),this._$subtreeListenersCount+=1),t.subtree&&s.updateSubtreeCount(this._$subtreeListenersCount),t.attachStatus&&(s.attachObservers||(s.attachObservers=new l("attachObserver")),s.attachObservers.add(o),this._$boundFuncArrs.push(s.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)}))}}var Ce=Object.freeze({__proto__:null,MutationObserver:Se,MutationObserverTarget:ye});const we=Object.prototype.hasOwnProperty;var Ne;!function(e){e.Invalid="invalid",e.Any="any",e.String="string",e.Number="number",e.Boolean="boolean",e.Object="object",e.Array="array",e.Function="function"}(Ne||(Ne={}));const Ee=(e,t)=>{const n=Object.keys(t);for(let s=0;s<n.length;s+=1){const o=n[s];if(Object.prototype.hasOwnProperty.call(e,o))if("_"===o[0]&&L(`data field "${o}" from different behaviors is overriding or merging.`),"object"!=typeof e[o]||"object"!=typeof t[o]||null===t[o]||Array.isArray(t[o]))e[o]=t[o];else{if(Array.isArray(e[o]))e[o]=e[o].slice();else{const t=e[o],n={},s=Object.keys(t);for(let e=0;e<s.length;e+=1){const o=s[e];n[o]=t[o]}e[o]=n}Ee(e[o],t[o])}else e[o]=t[o]}},ke=e=>{switch(e){case"string":return"";case"number":return 0;case"boolean":return!1;case"array":return[];case"function":return function(){};default:return null}},xe=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",Oe=(e,t,n)=>{const s=n.type,o=n.optionalTypes;if(o)for(let t=0;t<o.length;t+=1)if(Le(o[t],e))return e;return"string"===s?null==e?(L(`property "${t}" received type-incompatible value: expected <String> but get null value. Used default value instead.`),n.defaultFn()):("object"==typeof e&&L(`property "${t}" received type-incompatible value: expected <String> but got object-typed value. Force converted.`),String(e)):"number"===s?isFinite(e)?Number(e):(L("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.`),n.defaultFn()):"boolean"===s?!!e:"array"===s?Array.isArray(e)?e:(L(`property "${t}" received type-incompatible value: expected <Array> but got non-array value. Used default value instead.`),n.defaultFn()):"object"===s?"object"==typeof e?e:(L(`property "${t}" received type-incompatible value: expected <Object> but got non-object value. Used default value instead.`),n.defaultFn()):"function"===s?"function"==typeof e?e:(L(`property "${t}" received type-incompatible value: expected <Function> but got non-function value. Used default value instead.`),n.defaultFn()):void 0===e?n.defaultFn():e},Le=(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 Re;!function(e){e[e.None=0]="None",e[e.Simple=1]="Simple",e[e.SimpleWithRecursion=2]="SimpleWithRecursion"}(Re||(Re={}));class Ae{constructor(e){this.observerRoot={sub:{}},this.observers=[],this.propFields=e}cloneSub(){const e=new Ae(this.propFields);return this.observers.length>0&&(e.observerRoot=_e(this.observerRoot),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 s=t[e];let o=this.observerRoot,i=!1;for(let e=0;e<s.length;e+=1){const t=s[e];if("**"===t){i=!0;break}o.sub[t]||(o.sub[t]={sub:{}}),o=o.sub[t]}i?o.wildcard?o.wildcard.push(n):o.wildcard=[n]:o.listener?o.listener.push(n):o.listener=[n]}}}const Me=(e,t,n,s)=>{const o=new Array(n.length);for(let e=0;e<n.length;e+=1){const s=n[e];let i=t;for(let e=0;e<s.length;e+=1){const t=s[e];if("**"===t)break;if("object"!=typeof i||null===i){i=void 0;break}i=i[t]}o[e]=i}c("Data Observer",s,e.getMethodCaller(),o,e||void 0)},Te=(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 s=0;s<n.length;s+=1){const o=n[s];Te(e.sub[o],t)}},De=(e,t,n)=>{let s=e,o=!0;for(let e=0;e<n.length;e+=1){const i=n[e];if(s.wildcard){const e=s.wildcard;for(let n=0;n<e.length;n+=1){t[e[n]]=!0}}if(!we.call(s.sub,i)){o=!1;break}s=s.sub[i]}o&&Te(s,t)},Be=(e,t,n,s)=>{for(let o=0;o<e.length;o+=1){const{path:i,f:r}=e[o];t[o]&&(t[o]=!1,n&&Me(n,s,i,r))}},Ie=e=>e===t.Simple?1:e===t.SimpleWithRecursion?2:0;class Pe{_$generateInnerData(e){const t=this._$pureDataPattern,n=this._$dataDeepCopy;if(t||0!==n){const s={},o=Object.keys(e);for(let i=0;i<o.length;i+=1){const r=o[i],l=e[r];t&&t.test(r)||(s[r]=0===n?l:2===n?me(l,!0):_e(l))}return s}return null}constructor(e,t,n,s,o,i,r){this._$modelBindingListener=null,this._$pendingChanges=[],this._$doingUpdates=null,this._$recUpdateLevel=0,this._$comp=e,this.data=t,this._$pureDataPattern=n,this._$dataDeepCopy=s,this._$propertyPassingDeepCopy=o,this._$reflectToAttributes=i&&!!e,this._$propFields=r.propFields,this._$observerTree=r,this._$observerStatus=new Array(r.observers.length),this.innerData=this._$generateInnerData(t)}static create(e){return new Pe(null,e,null,0,0,!1,new Ae({}))}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,s){Array.isArray(s)?this._$pendingChanges.push([e,s,null!=t?t:-1,n||0]):L(`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?me(t,!0):_e(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,s=this._$comp,o=this._$pureDataPattern,i=this._$dataDeepCopy,r=!!this._$doingUpdates;let l,a;this._$observerTree.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,g=String(h[0]),_=!!o&&o.test(g),m=!_&&this.innerData,v=n[g];let b=!0;if(v&&1===h.length){const t=this.data[g];let n,o,l;if($){if(Array.isArray(t)){const e=r,s=p;n=s>=0&&s<t.length?s:t.length,e[2]=n,t.splice(n,f,...u)}else L(`An array splice change cannot be applied to a non-array value (on path "${h.join(".")}"). The change is ignored.`);o=t}else o=Oe(u,g,v);if(m){let e;if(0===i)r[1]=e=o;else if(void 0!==n){let t;e=this.innerData[g],r[1]=t=2===i?me(u,!0):_e(u),e.splice(n,f,...t)}else r[1]=e=2===i?me(o,!0):_e(o);this.innerData[g]=e}if(this.data[g]=o,this._$reflectToAttributes){const e=s.getBackendElement();if(e){let t=o;if(v.reflectIdPrefix){const e=s.ownerShadowRoot;if(e){const n=e.getHostNode()._$idPrefix;n&&(t=`${n}--${o}`)}}const n=g.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`)),i=typeof t;"boolean"===i?o?e.setAttribute(n,""):e.removeAttribute(n):"object"===i?e.setAttribute(n,JSON.stringify(t)):e.setAttribute(n,t)}}$||!0!==p?l=t!==o:(v.comparer?(r[2]=void 0,l=!!c("Property Comparer",v.comparer,s,[u,t],null==s?void 0:s.general())):l=t!==o,b=l),!_&&l&&a.push({propName:g,prop:v,oldValue:t,newValue:o,skipModelListener:e})}else{let t,n=this.data,s=g;for(let e=1;e<h.length;e+=1){const t=h[e];Number.isFinite(t)?(we.call(n,s)&&Array.isArray(n[s])||(n[s]=[]),m||_||t>=n[s].length&&l.push([h.slice(0,e).concat("length"),!0,void 0,void 0])):we.call(n,s)&&null!==n[s]&&"object"==typeof n[s]&&!Array.isArray(n[s])||(n[s]={}),n=n[s],s=t}if($){const e=n.length,o=n[s];if(Array.isArray(o)){const s=r,i=p;t=i>=0&&i<o.length?i:o.length,s[2]=t,o.splice(t,f,...u),m||_||n.length===e||l.push([h.concat("length"),!0,void 0,void 0])}else L(`An array splice change cannot be applied to a non-array value (on path "${h.join(".")}"). The change is ignored.`)}else n[s]=u;if(m){n=this.innerData,s=g;for(let e=1;e<h.length;e+=1){const t=h[e];Number.isFinite(t)?(we.call(n,s)&&Array.isArray(n[s])||(n[s]=[]),t>=n[s].length&&l.push([h.slice(0,e).concat("length"),!0,void 0,void 0])):we.call(n,s)&&null!==n[s]&&"object"==typeof n[s]&&!Array.isArray(n[s])||(n[s]={}),n=n[s],s=t}let e;if(0===i)r[1]=e=u;else if(void 0!==t){const o=n.length;let a;e=n[s],r[1]=a=2===i?me(u,!0):_e(u),e.splice(t,f,...a),n.length!==o&&l.push([h.concat("length"),!0,void 0,void 0])}else r[1]=e=2===i?me(u,!0):_e(u);n[s]=e}!_&&v&&a.push({propName:g,prop:v,oldValue:void 0,newValue:u,skipModelListener:e||!1})}De(this._$observerTree.observerRoot,this._$observerStatus,h),!_&&b&&l.push(r),this._$doingUpdates&&(this._$doingUpdates.count+=1)}if(!r){if(this._$doingUpdates){let e;do{e=this._$doingUpdates.count,Be(this._$observerTree.observers,this._$observerStatus,s,this.data)}while(e!==this._$doingUpdates.count);this._$doingUpdates=null}if(this._$recUpdateLevel>0&&s&&L(`recursive update detected: a data update is applying during another data update for component "${s.is}" - this may disorder node trees`,s),this._$recUpdateLevel+=1,null===(t=this._$updateListener)||void 0===t||t.call(this,this.innerData||this.data,l),this._$recUpdateLevel-=1,s)for(let e=0;e<a.length;e+=1){const{propName:t,prop:n,oldValue:o,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,s.getMethodCaller(),[i,o],s),s._$mutationObserverTarget&&ye.callAttrObservers(s,{type:"properties",target:s,nameType:"component-property",propertyName:t})}}}}var je;!function(e){e[e.Normal=0]="Normal",e[e.NoDefault=1]="NoDefault"}(je||(je={}));let Fe=Date.now(),Ue=Fe;var Ve,We,Ge;!function(e){e[e.None=0]="None",e[e.Mut=1]="Mut",e[e.Final=2]="Final"}(Ve||(Ve={})),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"}(We||(We={})),function(e){e[e.None=0]="None",e[e.CapturingPhase=1]="CapturingPhase",e[e.AtTarget=2]="AtTarget",e[e.BubblingPhase=3]="BubblingPhase"}(Ge||(Ge={}));class He{constructor(){this.listeners=Object.create(null),this.captureListeners=null}addListener(e,t,n={}){const s=n.final?2:n.mutated?1:0;let o,i,r;return n.capture||n.useCapture?this.captureListeners?o=this.captureListeners:(o=Object.create(null),this.captureListeners=o):o=this.listeners,o[e]?(r=!0,i=o[e]):(r=!1,i=o[e]={mutCount:0,finalCount:0,funcArr:new a("listener")}),i.funcArr.add(t,s),2===s?(i.finalCount+=1,r&&1!==i.finalCount?0:3):1===s?(i.mutCount+=1,!r||1===i.mutCount&&0===i.finalCount?4:0):r?0:2}removeListener(e,t,n={}){const s=n.capture||n.useCapture?this.captureListeners:this.listeners;if(!s)return 1;const o=s[e];if(!o)return 1;const i=o.funcArr.remove(t);return null===i?1:2===i?(o.finalCount-=1,0!==o.finalCount?0:o.mutCount>0?4:2):1===i?(o.mutCount-=1,0!==o.mutCount||0!==o.finalCount?0:2):0}getListeners(){const e=Object.create(null),t=(t,n)=>{const s=Object.keys(t);for(let o=0;o<s.length;o+=1){const i=s[o],r=t[i];e[i]||(e[i]=[]);const l=r.funcArr.getArr();if(l)for(let t=0;t<l.length;t+=1){const s=l[t];e[i].push({listener:s.f,mutated:1===s.data,final:2===s.data,capture:n,useCapture:n})}}};return t(this.listeners,!1),this.captureListeners&&t(this.captureListeners,!1),e}}let ze=class e{constructor(e,t,n={}){this.eventPhase=0;const s=(()=>{const e=Date.now();return e<Ue&&(Fe+=e-Ue),Ue=e,e-Fe})();this._$eventName=this.type=e,this.timeStamp=s,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._$hasListener=!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,s){const o=Object.create(this);return o.target=e,o.mark=t,o.currentTarget=n,(null==s?void 0:s.getEventObject(o))||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}hasListener(){return this._$hasListener}markMutated(){this._$eventBubblingControl.mutated=!0}mutatedMarked(){return this._$eventBubblingControl.mutated}listenerReturnHandler(){return this._$handleListenerReturn}isCapturePhase(){return 1===this.eventPhase}callListener(e,t,n,s){var o;const i=this._$eventName,r=e._$eventTarget;if(!r)return;const l=s?r.captureListeners:r.listeners;if(!l)return;const a=l[i];if(!a)return;const d=this.mutatedMarked(),c=S(n)&&n.getMethodCaller()||n,h=S(e)&&e.getMethodCaller()||e;this._$hasListener||(this._$hasListener=a.funcArr.hasFunc());const u=this.wrapShadowedEvent(c,t,h,null===(o=n.ownerShadowRoot)||void 0===o?void 0:o.getHostNode());!1===a.funcArr.call(h,[u],(e=>!d||1!==e),S(n)?n:void 0,this._$handleListenerReturn)||a.finalCount>0?(u.stopPropagation(),u.preventDefault()):a.mutCount>0&&u.markMutated()}dispatch(e,t){if(this._$dispatched)throw new Error("Event cannot be dispatched twice");this._$dispatched=!0;const n=this.composed,s=this.bubbles,o=t&&!n,i=this._$eventBubblingControl,r=(e,t)=>{const s=e=>{let o=e;const i=e.collectMarks();for(;;){if(!1===t(o,e,i))return null;let r;if(n){if(y(o))return o.getHostNode();if(null===o.containingSlot)return null;if(o.containingSlot)r=s(o.containingSlot);else for(r=o.parentNode;null==r?void 0:r._$inheritSlots;)r=r.parentNode}else r=o.parentNode;if(!r)return null;o=r}};let o=e;for(;;){const e=s(o);if(!e)break;o=e}};if(this._$capturePhase&&!i.stopped&&!o){this.eventPhase=1;const t=[];r(e,((e,n,s)=>{t.push([e,n,s])}));for(let e=t.length-1;e>=0;e-=1){const[n,s,o]=t[e];if(n._$eventTarget&&(this.callListener(n,o,s,!0),i.stopped))break}}if(this.eventPhase=2,!i.stopped&&t&&S(e)&&e._$external&&e.shadowRoot.handleEvent(t,this),!i.stopped&&!o){let t=!0;r(e,((e,n,o)=>{if(!t&&S(e)&&e._$external){const t=e.shadowRoot;t.handleEvent(t.slot,this)}return t=!1,this.eventPhase=3,e._$eventTarget&&!i.stopped&&this.callListener(e,o,n,!1),s&&!i.stopped}))}return this.eventPhase=0,this.getEventBubbleStatus()}static dispatchEvent(e,t){return t.dispatch(e)}static dispatchExternalEvent(e,t,n){return n.dispatch(e,t)}static triggerEvent(t,n,s,o){const i=new e(n,s,o);return e.dispatchEvent(t,i)}static triggerExternalEvent(t,n,s,o,i){const r=new e(s,o,i);return e.dispatchExternalEvent(t,n,r)}};var qe;!function(e){e[e.Child=0]="Child",e[e.Descendant=1]="Descendant",e[e.CrossShadowDescendant=2]="CrossShadowDescendant"}(qe||(qe={}));const Xe=e=>{var t;return null===(t=e.ownerShadowRoot)||void 0===t?void 0:t.getHostNode().getRootBehavior().ownerSpace};class Ke{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 s=n[1].slice(1),o=n[2].split(".");return o.shift(),s||o.length?{id:s,classes:o,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),s=[];let o=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!==o)break;o=3===e.length?2:0;continue}const t=Ke._$parseSegment(e,o);if(o=1,!t)break;s.push(t)}i===n.length&&(s.length&&this.unions.push(s))}}isEmpty(){return 0===this.unions.length}static _$testSelectorSegment(e,t,n,s,o,i){var r;if(n===e)return!1;const l=s[o];let a=!0;(Xe(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===o){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=y(c)?c.getHostNode():null:2===i?(a=!1,c=y(c)?c.getHostNode():null):c=null,c===e&&(c=null)}while(b(c));if(!c)return!1;if(a){if(Ke._$testSelectorSegment(e,t,c,s,o-1,h))return!0;if(2!==i)return!1}return Ke._$testSelectorSegment(e,t,c,s,o,i)}testSelector(e,t){if(b(t))return!1;const n=this.unions;let s;if(s=null!==e&&Xe(e)||Xe(t),void 0===s)return!1;for(let o=0;o<n.length;o+=1){const i=n[o];if(Ke._$testSelectorSegment(e,s,t,i,i.length-1,0))return!0}return!1}query(e,t){const n=[],s=(e,t,o)=>{if(this.testSelector(e,t)){if(o)return t;n.push(t)}if(S(t)){const n=t.getShadowRoot();if(n){const t=s(e,n,o);if(t&&o)return t}}const i=t.childNodes;for(let t=0;t<i.length;t+=1){const n=i[t];if(m(n)){const t=s(e,n,o);if(t&&o)return t}}return null},o=s(e,e,t);return t?o:n}}var Ye;!function(e){e[e.MAIN=0]="MAIN",e[e.TEMPLATE_EXTRA=1]="TEMPLATE_EXTRA",e[e.ANIMATION_EXTRA=2]="ANIMATION_EXTRA",e[e.TEMP_EXTRA=3]="TEMP_EXTRA"}(Ye||(Ye={}));const Ze={mode:1,destroyed:!0,dropBackendAfterRelease:!0},Qe={mode:2,destroyed:!0,dropBackendAfterRelease:!0},Je={mode:3,destroyed:!0,dropBackendAfterRelease:!0};class et{constructor(){throw new Error("Element cannot be constructed directly")}_$initialize(e,t,n,s){this._$backendElement=t,this._$destroyOnRemoval=0,this._$nodeTreeContext=s,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 He}get $$(){return this._$backendElement}get id(){return this._$nodeId}set id(e){var t;const n=String(e);if(this._$nodeId===n)return;this._$nodeId=n;const s=this._$backendElement;if(this.ownerShadowRoot){const e=this.ownerShadowRoot.getHostNode();if(this.ownerShadowRoot._$markIdCacheDirty(),e.getComponentOptions().writeIdToDOM){const t=e._$idPrefix,o=t?`${t}--${n}`:n;s&&(3===this.getBackendMode()?s.id=o:2===this.getBackendMode()&&s.setId(o))}}1===this.getBackendMode()&&s.setId(n),i.writeExtraInfoToAttr&&(null===(t=this._$backendElement)||void 0===t||t.setAttribute("exparser:info-attr-id",n)),this._$mutationObserverTarget&&ye.callAttrObservers(this,{type:"properties",target:this,nameType:"basic",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,1===this.getBackendMode()&&this._$backendElement.setSlot(t);const n=et._$getParentHostShadowRoot(this.parentNode);if(n){if(3===n.getSlotMode())throw new Error("nodes inside dynamic slots should change binding slots through Element#setSlotElement.");const e=et._$updateSubtreeSlotNodes(this.parentNode,[this],n,n,this.parentIndex);null==e||e.removeSlotNodes();const t=this.containingSlot;null==e||e.updateContainingSlot();const s=this.containingSlot;et.insertChildReassign(this.parentNode,this,t,s,this.parentIndex+1),null==e||e.insertSlotNodes()}this._$mutationObserverTarget&&ye.callAttrObservers(this,{type:"properties",target:this,nameType:"basic",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}asShadowRoot(){return y(this)?this:null}asGeneralComponent(){return S(this)?this:null}asInstanceOf(e){return S(this)?this.asInstanceOf(e):null}getBackendContext(){const e=this._$nodeTreeContext;return e===Ze||e===Qe||e===Je?null:e}getBackendMode(){return this._$nodeTreeContext.mode}getBackendElement(){return this._$backendElement}destroyBackendElement(){this._$backendElement&&3!==this.getBackendMode()&&this._$backendElement.release(),this._$nodeTreeContext.dropBackendAfterRelease&&(this._$backendElement=null,2===this.getBackendMode()?this._$nodeTreeContext=Qe:3===this.getBackendMode()?this._$nodeTreeContext=Je:this._$nodeTreeContext=Ze)}destroyBackendElementOnSubtree(){const e=function(t){for(let n=0;n<t.childNodes.length;n+=1){const s=t.childNodes[n];m(s)?e(s):s.destroyBackendElement()}if(S(t)){const n=t.getShadowRoot();n&&e(n)}t.destroyBackendElement()};e(this)}destroyBackendElementOnRemoval(){this._$destroyOnRemoval=1}cancelDestroyBackendElementOnRemoval(){this._$destroyOnRemoval=0}destroyBackendElementOnDetach(){this._$destroyOnRemoval=1}cancelDestroyBackendElementOnDetach(){this._$destroyOnRemoval=0}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&&ye.callAttrObservers(this,{type:"properties",target:this,nameType:"basic",attributeName:"class"})}setNodeClassList(e,t=0){var n;(null===(n=this.classList)||void 0===n?void 0:n.setClassNameList(e,t))&&this._$mutationObserverTarget&&ye.callAttrObservers(this,{type:"properties",target:this,nameType:"basic",attributeName:"class"})}toggleNodeClass(e,t,n=0){var s;(null===(s=this.classList)||void 0===s?void 0:s.toggle(e,t,n))&&this._$mutationObserverTarget&&ye.callAttrObservers(this,{type:"properties",target:this,nameType:"basic",attributeName:"class"})}setNodeStyle(e,t=0){if(0===t&&this._$styleSegments[t]===e)return;this._$styleSegments[t]=e;const n=this._$styleSegments.join(";");this._$backendElement&&(3===this.getBackendMode()?this._$backendElement.setAttribute("style",n):2===this.getBackendMode()?this._$backendElement.setStyle(n):this._$backendElement.setStyle(e,t)),this._$mutationObserverTarget&&ye.callAttrObservers(this,{type:"properties",target:this,nameType:"basic",attributeName:"style"})}getNodeStyleSegments(){return this._$styleSegments}static checkAndCallAttached(e){!function e(t){if(m(t)&&!t._$attached){t._$attached=!0;const n=S(t);if(n&&(t.triggerLifetime("attached",[]),t._$relation&&(t._$relation.triggerLinkEvent(2,!1),t._$relation.triggerLinkEvent(4,!1),t._$relation.triggerLinkEvent(0,!1))),t._$mutationObserverTarget&&ye.callAttachObservers(t,{type:"attachStatus",target:t,status:"attached"}),n){const n=t.getShadowRoot();n&&e(n)}const s=t.childNodes;for(let t=0;t<s.length;t+=1)e(s[t])}}(e)}static checkAndCallDetached(e){if(function e(t){if(m(t)&&t._$attached){if(S(t)&&t.triggerLifetime("beforeDetach",[]),t.childNodes.forEach(e),S(t)){const n=t.getShadowRoot();n&&e(n),t._$attached=!1,t.triggerLifetime("detached",[]),t._$relation&&(t._$relation.triggerLinkEvent(2,!0),t._$relation.triggerLinkEvent(4,!0),t._$relation.triggerLinkEvent(0,!0))}else t._$attached=!1;t._$mutationObserverTarget&&ye.callAttachObservers(t,{type:"attachStatus",target:t,status:"detached"})}}(e),m(e)){const t=function(n){if(2===e._$destroyOnRemoval)return;for(let e=0;e<n.childNodes.length;e+=1){const s=n.childNodes[e];m(s)?t(s):1===s._$destroyOnRemoval&&(s._$destroyOnRemoval=2,s.destroyBackendElement())}if(S(n)){const e=n.getShadowRoot();e&&t(e)}1===n._$destroyOnRemoval&&(n._$destroyOnRemoval=2,n.destroyBackendElement());const s=n._$placeholderHandlerRemover;"function"==typeof s&&s()};t(e)}else 1===e._$destroyOnRemoval&&(e._$destroyOnRemoval=2,e.destroyBackendElement())}static checkAndCallMoved(e){!function e(t){if(m(t)&&t._$attached&&(t.childNodes.forEach(e),S(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 s;const o=e._$mutationObserverTarget;if(o&&(!(null===(s=o.childObservers)||void 0===s?void 0:s.empty)||o.hasSubtreeListeners())){const s=[n];let o;o="add"===t?{type:"childList",target:e,addedNodes:s}:"remove"===t?{type:"childList",target:e,removedNodes:s}:{type:"childList",target:e,addedNodes:s,removedNodes:s},ye.callChildObservers(e,o)}}static hasSubtreeMutationObservers(e){var t;return(null===(t=e._$mutationObserverTarget)||void 0===t?void 0:t.hasSubtreeListeners())||!1}static _$insertChildReassignSlot(e,t,n,s){if(n)if(s){const e=[...n.slotNodes];for(let t=0;t<e.length;t+=1){const o=e[t];et._$spliceSlotNodes(n,0,1,void 0),et._$spliceSlotNodes(s,-1,0,[o]),et._$updateContainingSlot(o,s),o._$inheritSlots||et.insertChildReassign(o.parentNode,o,n,s,o.parentIndex)}}else{const e=[...n.slotNodes];for(let t=0;t<e.length;t+=1){const o=e[t];et._$spliceSlotNodes(n,0,1,void 0),et._$updateContainingSlot(o,s),o._$inheritSlots||et.insertChildReassign(o.parentNode,o,n,null,o.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];et._$spliceSlotNodes(s,-1,0,[t]),et._$updateContainingSlot(t,s),t._$inheritSlots||et.insertChildReassign(t.parentNode,t,null,s,t.parentIndex)}}}static insertChildReassign(e,t,n,s,o){if(1!==e.getBackendMode()){if(n)if(s&&3===e.getBackendMode());else{const s=et.findNearestNonVirtual(n);if(s){const n=et.countNonVirtual(t);if(n){const[t,o]=n;if(3===e.getBackendMode()){const e=t._$backendElement;for(let t=1;t<o;t+=1){const t=e.nextSibling;t&&s.removeChild(t)}o>0&&s.removeChild(e)}else s.spliceRemove(t._$backendElement,o)}}}s&&et.insertChildComposed(e,t,void 0,!1,o)}}static findNearestNonVirtual(e){let t=e;for(;null==t?void 0:t._$virtual;)t=y(t)?t.getHostNode():void 0===t.containingSlot?t.parentNode:t.containingSlot;return S(t)&&t._$external?t.shadowRoot.slot:t?t._$backendElement:null}static countNonVirtual(e){let t=null,n=0;const s=e=>{0===n&&(t=e),n+=1};var o;return m(o=e)&&o._$virtual?o.forEachNonVirtualComposedChild(s):s(o),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 s=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(!s(t[e]))return!1;return!0}return!0};return s(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 s=e=>{if(e._$inheritSlots){const t=e.childNodes;for(let e=0;e<t.length;e+=1)if(!s(t[e]))return!1;return!0}return e.containingSlot!==t||!1!==n(e)};return s(e)}static _$findFirstNonVirtualChild(e,t){const n=null!==e._$slotName,s=n?e.slotNodes:e.childNodes;if(t>=0&&t<s.length)for(let e=t;e<s.length;e+=1){let t=null;const o=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(o):o(e)};if(i(s[e]),t)return t}const o=e=>{if(!e._$virtual)return null;const t=e.containingSlot;if(null===t)return null;if(void 0!==t)return et._$findFirstNonVirtualChild(t,e.slotIndex+1);if(y(e))return o(e.getHostNode());const n=e.parentNode;return n?et._$findFirstNonVirtualChild(n,e.parentIndex+1):null};return o(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 et._$findFirstNonVirtualChild(n,e.slotIndex+1);const s=et._$findSlotNodeInsertPosition(n,e,t);return et._$findFirstNonVirtualChild(n,s)}let s=e;if(y(e))return s=e.getHostNode(),s._$virtual?et._$findFirstNonVirtualChild(s,s.parentIndex+1):null;const o=s.parentNode;return o?et._$findFirstNonVirtualChild(o,t):null}static insertChildComposed(e,t,n,s,o){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;S(h)?h._$external?p=h.shadowRoot.slot:d=!0:(h._$virtual&&(d=!0),p=et.findNearestNonVirtual(h));let f=null;const $=(i,r)=>{const l=i||(r?et.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};et.forEachNodeInSpecificSlot(t,r,(e=>{p||(p=e),e._$virtual?e.forEachNonVirtualComposedChild(n):n(e)}))}if(3!==e.getBackendMode()||l){if((n||d)&&(s&&n?(et.forEachSlotContentInSpecificSlot(n,r,(e=>{if(m(e)){const t=et.countNonVirtual(e);t&&(c||(c=t[0]),a+=t[1])}else c||(c=e),a+=1;return!0})),0===a&&h&&p&&(c=et._$findFirstNonVirtualSibling(void 0===r?t:p,o+1))):h&&p&&(c=et._$findFirstNonVirtualSibling(void 0===r?t:p,o))),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):s?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||s&&n&&n._$inheritSlots){const e=new Set;s&&n&&et.forEachSlotContentInSlot(n,((t,n)=>{e.add(n)})),t&&et.forEachSlotContentInSlot(t,((t,n)=>{e.add(n)})),e.forEach((e=>$(null,e)))}else t&&$(null,t.containingSlot),!s||!n||t&&n.containingSlot===t.containingSlot||$(null,n.containingSlot);3!==u.mode&&f&&f.release(),i.writeExtraInfoToAttr&&(s&&m(n)&&(null===(r=n._$backendElement)||void 0===r||r.removeAttribute("exparser:info-in-slot-of")),m(t)&&(S(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,s,o){if(!t||!n)return;let i=e,r=null,l=null;const a=(e,t)=>{if(e._$subtreeSlotStart){const n=e.childNodes;let s=t+1,o=n[s];for(;o&&!o._$subtreeSlotStart;)s+=1,o=n[s];return void(o?(l=o._$subtreeSlotStart,r=l.prev):(r=e._$subtreeSlotEnd,r&&(l=r.next)))}let n=e,s=e.parentNode;for(;s&&!s._$subtreeSlotStart;)n=s,s=s.parentNode;s&&a(s,n.parentIndex)};for(a(i,s),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,o)}static _$updateSubtreeSlotsRemoval(e,t,n,s){if(!t||!n)return;let o=e;const i=t.prev,r=n.next;for(i&&(i.next=r,t.prev=null),r&&(r.prev=i,n.next=null);o;){let e=!1;if(o._$subtreeSlotStart===t&&o._$subtreeSlotEnd===n&&(o._$subtreeSlotStart=o._$subtreeSlotEnd=null,e=!0),o._$subtreeSlotStart===t?(o._$subtreeSlotStart=r,e=!0):o._$subtreeSlotEnd===n&&(o._$subtreeSlotEnd=i,e=!0),!e||!o.parentNode)break;o=o.parentNode}const l=o.ownerShadowRoot;(null==l?void 0:l.isConnected(o))&&l._$applySlotsRemoval(t,n,s)}static _$updateSubtreeSlotsReplacement(e,t,n,s,o,i,r){if(!t||!n)return void et._$updateSubtreeSlotsRemoval(e,s,o,r);if(!s||!o)return void et._$updateSubtreeSlotsInsertion(e,t,n,i,r);let l=e;const a=s.prev,d=o.next;for(a&&(a.next=t,t.prev=a,s.prev=null),d&&(d.prev=n,n.next=d,o.next=null);l;){let e=!1;if(l._$subtreeSlotStart===s&&(l._$subtreeSlotStart=t,e=!0),l._$subtreeSlotEnd===o&&(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(s,o,!1),c._$applySlotsInsertion(t,n,r))}static _$updateSubtreeSlotNodes(e,t,n,s,o){if(!n&&!s)return;const i=null==n?void 0:n.getSlotMode(),r=null==s?void 0:s.getSlotMode();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 s=t[n];et.forEachNodeInSlot(s,(t=>{a&&(i?i+=1:(e=t.slotIndex,i=1)),l.push(t)}))}if(d&&l.length){const e=l[0];r=et._$findSlotNodeInsertPosition(d,e,o)}return{updateContainingSlot:()=>{for(let e=l.length-1;e>=0;e-=1){const t=l[e];et._$updateContainingSlot(t,d)}},removeSlotNodes:()=>{s&&a&&i&&et._$spliceSlotNodes(a,e,i,void 0)},insertSlotNodes:()=>{n&&d&&l.length&&et._$spliceSlotNodes(d,r,0,l)}}}const l=new Map,a=new Map,d=[];for(let e=0;e<t.length;e+=1){const s=t[e];et.forEachNodeInSlot(s,((e,t)=>{const s=null==n?void 0:n.getContainingSlot(e);if(t){const n=a.get(t);n?n.count+=1:a.set(t,{start:e.slotIndex,count:1})}if(s){const t=l.get(s);t?t.nodes.push(e):l.set(s,{nodes:[e],insertPos:-1})}d.push([e,s])}))}if(n&&l.size){const e=l.entries();for(let t=e.next();!t.done;t=e.next()){const[e,{nodes:n}]=t.value,s=n[0];t.value[1].insertPos=et._$findSlotNodeInsertPosition(e,s,o)}}return{updateContainingSlot:()=>{for(let e=d.length-1;e>=0;e-=1){const[t,n]=d[e];et._$updateContainingSlot(t,n)}},removeSlotNodes:()=>{if(s&&a.size){const e=a.entries();for(let t=e.next();!t.done;t=e.next()){const[e,{start:n,count:s}]=t.value;et._$spliceSlotNodes(e,n,s,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:s}]=t.value;et._$spliceSlotNodes(e,s,0,n)}}}}}static insertChildSingleOperation(e,t,n,s){var o,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=!!s&&(!!c&&t!==c),!h&&!t)return;if(t){if(u=t.parentNode,u){const n=u.childNodes,s=t.parentIndex;n.splice(s,1);for(let e=s;e<n.length;e+=1)n[e].parentIndex=e;t.parentIndex=-1,u===e&&s<d&&(d-=1);const i=et._$updateSubtreeSlotNodes(e,[t],null,et._$getParentHostShadowRoot(u),d);null==i||i.removeSlotNodes(),3===e.getBackendMode()||(1===e.getBackendMode()?null===(o=u._$backendElement)||void 0===o||o.removeChild(t._$backendElement,s):et.insertChildComposed(u,null,t,!0,s)),null==i||i.updateContainingSlot()}t.parentNode=e,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=et._$getParentHostShadowRoot(e),f=t?et._$updateSubtreeSlotNodes(e,[t],p,null,d):null,$=c&&h?et._$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 et.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 g=e.childNodes;if(t)if(d<0)g.push(t),t.parentIndex=g.length-1;else if(h)g[d]=t,t.parentIndex=d;else{g.splice(d,0,t);for(let e=d;e<g.length;e+=1)g[e].parentIndex=e}else if(h){g.splice(d,1);for(let e=d;e<g.length;e+=1)g[e].parentIndex=e}const _=t?t._$subtreeSlotStart:null,v=t?t._$subtreeSlotEnd:null,b=c?c._$subtreeSlotStart:null,y=c?c._$subtreeSlotEnd:null;t?(u&&et._$updateSubtreeSlotsRemoval(u,_,v,!0),h?et._$updateSubtreeSlotsReplacement(e,_,v,b,y,d,!!u):et._$updateSubtreeSlotsInsertion(e,_,v,d,!!u)):h&&c&&et._$updateSubtreeSlotsRemoval(e,b,y,!1),null===(a=e.ownerShadowRoot)||void 0===a||a._$markIdCacheDirty(),h&&(et.checkAndCallDetached(c),et.checkChildObservers(e,"remove",c)),t&&((null==u?void 0:u._$attached)?e._$attached?et.checkAndCallMoved(t):et.checkAndCallDetached(t):e._$attached&&et.checkAndCallAttached(t),u===e?et.checkChildObservers(e,"move",t):(u&&et.checkChildObservers(u,"remove",t),et.checkChildObservers(e,"add",t)))}static insertChildBatchRemoval(e,t,n){var s,o;const i=e.childNodes[t];let r=e;for(;null==r?void 0:r._$inheritSlots;)r=r.parentNode;const l=S(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=et._$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)et.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===(s=e._$mutationObserverTarget)||void 0===s||s.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)}et._$updateSubtreeSlotsRemoval(e,h,u,!1),null===(o=e.ownerShadowRoot)||void 0===o||o._$markIdCacheDirty();for(let t=0;t<n;t+=1){const n=d[t];et.checkAndCallDetached(n),et.checkChildObservers(e,"remove",n)}}static insertChildBatchInsertion(e,t,n){var s,o;const i=n>=0?e.childNodes[n]:void 0,r=n>=0?n:e.childNodes.length;let l=e;for(;null==l?void 0:l._$inheritSlots;)l=l.parentNode;const a=S(l)&&!l._$external?l.shadowRoot:null;let d;if(1===e.getBackendMode()&&t.length>=5){d=e.getBackendContext().createFragment()}else d=null;for(let n=0;n<t.length;n+=1){const o=t[n];if(e.ownerShadowRoot!==o.ownerShadowRoot)throw new Error("Cannot move the node from one shadow tree to another shadow tree.");if(o.parentNode)throw new Error("Cannot batch-insert the node which already has a parent.");if(o.parentNode=e,null===(s=e._$mutationObserverTarget)||void 0===s||s.attachChild(o),1===e.getBackendMode()&&d){const e=o._$backendElement;d.appendChild(e)}}const c=et._$updateSubtreeSlotNodes(e,t,a,null,n);if(null==c||c.updateContainingSlot(),1===e.getBackendMode()){if(e._$backendElement)if(d)i?e._$backendElement.spliceBefore(i._$backendElement,0,d):e._$backendElement.spliceAppend(d),d.release();else if(i)for(let n=0;n<t.length;n+=1){const s=t[n];e._$backendElement.insertBefore(s._$backendElement,i._$backendElement)}else for(let n=0;n<t.length;n+=1){const s=t[n];e._$backendElement.appendChild(s._$backendElement)}}else{const s=n>=0?n:e.childNodes.length;for(let n=0;n<t.length;n+=1){const o=t[n];et.insertChildComposed(e,o,i,!1,s)}}null==c||c.insertSlotNodes();const h=e.childNodes;if(i){h.splice(n,0,...t);for(let e=n;e<h.length;e+=1)h[e].parentIndex=e}else{h.push(...t);for(let e=h.length-t.length;e<h.length;e+=1)h[e].parentIndex=e}let u=null,p=null;for(let e=0;e<t.length;e+=1){const n=t[e],s=n._$subtreeSlotStart,o=n._$subtreeSlotEnd;s&&(p?(s.prev=p,p.next=s,p=o):(u=s,p=o))}et._$updateSubtreeSlotsInsertion(e,u,p,r+t.length-1,!1),null===(o=e.ownerShadowRoot)||void 0===o||o._$markIdCacheDirty();for(let n=0;n<t.length;n+=1){const s=t[n];e._$attached&&et.checkAndCallAttached(s),et.checkChildObservers(e,"add",s)}}static insertChildPlaceholderReplace(e,t,n){var s,o,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=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()){if(!c){c=e.getBackendContext().createFragment()}const t=i._$backendElement;c.appendChild(t)}else et.insertChildComposed(d,null,i,!0,t);i.parentNode=n,null===(s=d._$mutationObserverTarget)||void 0===s||s.detachChild(i),null===(o=e._$mutationObserverTarget)||void 0===o||o.attachChild(i)}d.childNodes=[],d.parentNode=null,d.parentIndex=-1,n.parentNode=e;const u=d.containingSlot,p=d.slotIndex;void 0!==u&&(et._$updateContainingSlot(n,u),u&&et._$spliceSlotNodes(u,p,1,void 0));const f=h.length?et._$updateSubtreeSlotNodes(n,h,et._$getParentHostShadowRoot(n),et._$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),c&&(null===(i=n._$backendElement)||void 0===i||i.spliceAppend(c))),c&&c.release();else{et.insertChildComposed(e,n,d,!0,t);for(let e=0;e<h.length;e+=1){const t=h[e];et.insertChildComposed(n,t,void 0,!1,e)}}null==f||f.insertSlotNodes(),void 0!==u&&(et._$updateContainingSlot(d,void 0),u&&et._$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){et.checkAndCallDetached(d),et.checkChildObservers(e,"remove",d),et.checkAndCallAttached(n),et.checkChildObservers(e,"add",n);for(let t=0;t<h.length;t+=1){const n=h[t];et.checkAndCallMoved(n),et.checkChildObservers(e,"move",n)}}}appendChild(e){et.insertChildSingleOperation(this,e,this.childNodes.length,!1)}insertChildAt(e,t){et.insertChildSingleOperation(this,e,t,!1)}insertBefore(e,t){const n=t?t.parentIndex:-1;et.insertChildSingleOperation(this,e,n,!1)}removeChildAt(e){et.insertChildSingleOperation(this,null,e,!0)}removeChild(e){const t=e.parentIndex;et.insertChildSingleOperation(this,null,t,!0)}replaceChildAt(e,t){et.insertChildSingleOperation(this,e,t,!0)}replaceChild(e,t){const n=t.parentIndex;et.insertChildSingleOperation(this,e,n,!0)}insertChildren(e,t){et.insertChildBatchInsertion(this,e,t)}removeChildren(e,t){et.insertChildBatchRemoval(this,e,t)}selfReplaceWith(e){const t=this.parentNode;t&&et.insertChildPlaceholderReplace(t,this.parentIndex,e)}static _$generateIdMap(e){const t=Object.create(null);return function e(n){if(m(n)){const s=n._$nodeId;s&&(t[s]||(t[s]=n)),n.childNodes.forEach(e)}}(e),t}triggerEvent(e,t,n){ze.triggerEvent(this,e,t,n)}dispatchEvent(e){ze.dispatchEvent(this,e)}_$setListenerStats(e,t,n={}){if(!this._$backendElement)return;const s=!!n.capture||!!n.useCapture;let o;switch(t){case 2:o=0;break;case 4:o=1;break;case 3:o=2;break;default:return}this._$nodeTreeContext&&(3===this.getBackendMode()?this._$nodeTreeContext.setListenerStats(this._$backendElement,e,s,o):this._$backendElement.setListenerStats(e,s,o))}addListener(e,t,n){const s=this._$eventTarget.addListener(e,t,n);this._$setListenerStats(e,s,n),S(this)&&this._$definition._$options.listenerChangeLifetimes&&this.triggerLifetime("listenerChange",[!0,e,t,n])}removeListener(e,t,n){const s=this._$eventTarget.removeListener(e,t,n);1!==s&&(this._$setListenerStats(e,s,n),S(this)&&this._$definition._$options.listenerChangeLifetimes&&this.triggerLifetime("listenerChange",[!1,e,t,n]))}getListeners(){return this._$eventTarget.getListeners()}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 s=this._$backendElement;s&&(3===this.getBackendMode()?!1===t?s.removeAttribute(e):s.setAttribute(e,!0===t||null==t?"":String(t)):s.setAttribute(e,t)),this._$mutationObserverTarget&&ye.callAttrObservers(this,{type:"properties",target:this,nameType:"attribute",attributeName:e})}removeAttribute(e){this._$nodeAttributes&&delete this._$nodeAttributes[e];const t=this._$backendElement;t&&t.removeAttribute(e),this._$mutationObserverTarget&&ye.callAttrObservers(this,{type:"properties",target:this,nameType:"attribute",attributeName:e})}setDataset(e,t){this.dataset[e]=t,1===this.getBackendMode()&&this._$backendElement.setDataset(e,t),this._$mutationObserverTarget&&ye.callAttrObservers(this,{type:"properties",target:this,nameType:"dataset",attributeName:`data:${e}`})}setMark(e,t){if(this._$marks)this._$marks[e]=t;else{const n={};n[e]=t,this._$marks=n}this._$mutationObserverTarget&&ye.callAttrObservers(this,{type:"properties",target:this,nameType:"mark",attributeName:`mark:${e}`})}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),et.checkAndCallAttached(e)}static pretendAttached(e){e._$attached||et.checkAndCallAttached(e)}static pretendDetached(e){e._$attached&&et.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 s=t?String(t):"",o=e._$slotName;if(o===s)return;const i=null===o;e._$slotName=s,i&&(e._$subtreeSlotStart=e._$subtreeSlotEnd={value:e,prev:null,next:null}),1===e.getBackendMode()&&(null===(n=e._$backendElement)||void 0===n||n.setSlotName(s));const r=e.ownerShadowRoot;if(r)if(i){3===r.getSlotMode()&&(e._$slotValues=Object.create(null)),e.slotNodes=[];const t=e.parentNode;t&&et._$updateSubtreeSlotsInsertion(t,e._$subtreeSlotStart,e._$subtreeSlotEnd,e.parentIndex,!1)}else r.isConnected(e)&&r._$applySlotRename(e,s,o);e._$mutationObserverTarget&&ye.callAttrObservers(e,{type:"properties",target:e,nameType:"basic",attributeName:"name"})}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){var n;if(e._$slotElement===t)return;e._$slotElement=t,1===e.ownerShadowRoot.getBackendMode()&&(null===(n=e._$backendElement)||void 0===n||n.setSlotElement(t?t.getBackendElement():null));const s=et._$getParentHostShadowRoot(e.parentNode);if(s){const t=et._$updateSubtreeSlotNodes(e.parentNode,[e],s,s,e.parentIndex),n=e.containingSlot;null==t||t.updateContainingSlot(),null==t||t.removeSlotNodes();const o=e.containingSlot,i=e=>{if(m(e)&&e._$inheritSlots)for(let t=0;t<e.childNodes.length;t+=1)i(e.childNodes[t]);else et.insertChildReassign(e.parentNode,e,n,o,e.parentIndex)};i(e),null==t||t.insertSlotNodes()}}static getSlotElement(e){return e._$slotElement}static _$updateContainingSlot(e,t){e.containingSlot=t}static _$spliceSlotNodes(e,t,n,s){const o=e.slotNodes=e.slotNodes||[],i=t>=0&&t<o.length;if(null==s?void 0:s.length)if(i){for(let e=t;e<t+n;e+=1)o[e].slotIndex=void 0;o.splice(t,n,...s);for(let e=t;e<o.length;e+=1)o[e].slotIndex=e}else{const e=o.length;o.push(...s);for(let t=e;t<o.length;t+=1)o[t].slotIndex=t}else if(n){for(let e=t;e<t+n;e+=1)o[e].slotIndex=void 0;o.splice(t,n);for(let e=t;e<o.length;e+=1)o[e].slotIndex=e}}static _$findSlotNodeInsertPosition(e,t,n){const s=e.ownerShadowRoot.getHostNode(),o=e=>{let t=0,n=e;for(;n&&n!==s;)t+=1,n=n.parentNode;return t},i=o(t),r=(e,t,n,s,o,i,l)=>{if(e===s)return 0;if(e.parentNode===s.parentNode)return t-(-1===o?l:o);if(i<n){const t=e.parentNode;return r(t,t.parentIndex,n-1,s,o,i,l)}const a=n<i?e:e.parentNode,d=n<i?n:n-1,c=s.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,o(e),t,t.parentIndex,i,n>=0?n-.5:l.length)<0)break}return a+1}getComposedParent(){if(y(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(S(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 s=0;s<n.length;s+=1){const o=n[s];if(!1===e(o))return!1;if(o._$inheritSlots&&!t(o.childNodes))return!1}return!0};return t(this.childNodes)}*iterateComposedChild(){if(this._$inheritSlots)return;if(S(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 s=t[n];yield s,s._$inheritSlots&&(yield*e(s.childNodes))}};yield*e(this.childNodes)}forEachNonVirtualComposedChild(e){if(this._$inheritSlots)return!0;const t=t=>t._$virtual?t.forEachNonVirtualComposedChild(e):!1!==e(t);if(S(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 s=0;s<e.length;s+=1){const o=e[s];if(!t(o))return!1;if(o._$inheritSlots&&!n(o.childNodes))return!1}return!0};return n(this.childNodes)}static parseSelector(e){return new Ke(e)}querySelector(e){return(e instanceof Ke?e:new Ke(e)).query(this,!0)}querySelectorAll(e){return(e instanceof Ke?e:new Ke(e)).query(this,!1)}static matchSelector(e,t){return(e instanceof Ke?e:new Ke(e)).testSelector(null,t)}matchSelector(e,t){return(e instanceof Ke?e:new Ke(e)).testSelector(this,t)}getBoundingClientRect(e){var t;const n=this._$backendElement;if(n)if(3===this.getBackendMode()){const s=n,o=(null===(t=s.getBoundingClientRect)||void 0===t?void 0:t.call(s))||{left:0,top:0,width:0,height:0};setTimeout((()=>{e(o)}),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,s={scrollLeft:n.scrollLeft||0,scrollTop:n.scrollTop||0,scrollWidth:n.scrollWidth||0,scrollHeight:n.scrollHeight||0};setTimeout((()=>{e(s)}),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,s){const o=this._$backendElement;if(o){if(e&&!e._$backendElement)return null;if(3===this.getBackendMode()){const i=this._$nodeTreeContext;return i&&i.createIntersectionObserver?i.createIntersectionObserver(o,(null==e?void 0:e._$backendElement)||null,t,n,s):null}const i=o;return i.createIntersectionObserver?i.createIntersectionObserver((null==e?void 0:e._$backendElement)||null,t,n,s):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 tt;et.isElement=m,et._$getParentHostShadowRoot=e=>{let t=e;for(;null==t?void 0:t._$inheritSlots;)t=t.parentNode;return S(t)&&!t._$external?t.shadowRoot:null},et.prototype[u]=!0,function(e){e[e.Ancestor=0]="Ancestor",e[e.Descendant=1]="Descendant",e[e.ParentNonVirtualNode=2]="ParentNonVirtualNode",e[e.ChildNonVirtualNode=3]="ChildNonVirtualNode",e[e.ParentComponent=4]="ParentComponent",e[e.ChildComponent=5]="ChildComponent"}(tt||(tt={}));const nt=(e,t,n,s)=>{const o=e=>"function"==typeof e?e:(void 0!==e&&L(`the "${n}" relation listener is not a function (when preparing behavior "${t}").`),null);let i;if("parent"===s.type)i=4;else if("child"===s.type)i=5;else if("parent-common-node"===s.type)i=2;else if("child-common-node"===s.type)i=3;else if("ancestor"===s.type)i=0;else{if("descendant"!==s.type){const e=s.type;return L(`the "${n}" relation has an invalid relation type "${e}" (when preparing behavior "${t}").`),null}i=1}let r=null;if(s.target instanceof Dt)r=s.target.behavior;else if(s.target instanceof Ft||s.target instanceof ee)r=s.target;else{const o=String(s.target||n),i=e.getBehaviorByUrl(o,t);if(i)r=i;else{const t=e.getGlobalUsingComponent(o);"object"==typeof t&&null!==t&&(r=t.behavior)}}return r?{target:r,type:i,linked:o(s.linked),linkChanged:o(s.linkChanged),unlinked:o(s.unlinked),linkFailed:o(s.linkFailed)}:(L(`the target of relation "${n}" is not a valid behavior or component (when preparing behavior "${t}").`),null)};class st{constructor(e,t){this._$comp=e;const n=new Array(6);if(t)for(let e=0;e<6;e+=1){const s=t.definitions[e];if(s){const t=new Array(s.length);for(let e=0;e<s.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,s=this._$group.keyMap,o=e.type;n[o]?(s[t]=[o,n[o].length],n[o].push(e)):(s[t]=[o,0],n[o]=[e]);const i=this._$links;return void 0===i[o]?i[o]=[null]:i[o].push(null),t}triggerLinkEvent(e,t){var n,s;const o=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=o;for(;;){const n=t.parentNode;if(!n)break;if(t=n,!b(t)){if(S(t)){if(t.hasBehavior(u)){const n=t._$relation;if(n){let o;o=4===e?5:0===e?1:3;const i=null===(s=n._$group)||void 0===s?void 0:s.definitions[o];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(),[o.getMethodCaller()],e),h.linkChanged&&c("Relation Link Changed Callback",h.linkChanged,o.getMethodCaller(),[e.getMethodCaller()],o)):(t.unlinked&&c("Relation Unlinked Callback",t.unlinked,e.getMethodCaller(),[o.getMethodCaller()],e),h.unlinked&&c("Relation Unlinked Callback",h.unlinked,o.getMethodCaller(),[e.getMethodCaller()],o))}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(),[o.getMethodCaller()],e),h.linked&&c("Relation Linked Callback",h.linked,o.getMethodCaller(),[e.getMethodCaller()],o))}t||d||!h.linkFailed||c("Relation Link Failed Callback",h.linkFailed,o.getMethodCaller(),[],o)}}getLinkedTargets(e){var t,n,s,o;const i=null===(t=this._$group)||void 0===t?void 0:t.keyMap[e];if(!i)return L(`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===(o=null===(s=this._$group)||void 0===s?void 0:s.definitions[r])||void 0===o?void 0:o[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(S(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 s=e[t];if(s&&s.target===d&&s.def===c){a.push(n);break}}}1===r&&h(n)}else 5!==r&&1!==r||h(n)}};return h(this._$comp),a}}class ot extends et{constructor(){throw new Error("Element cannot be constructed directly")}static create(e,t,n,s){var o,r;const l=Object.create(ot.prototype);l.is=e,l.stylingName=null!=n?n:e;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),l._$placeholderHandlerRemover=s;const c=t.getHostNode(),h=c.getComponentOptions(),u=null!==(o=h.styleScope)&&void 0!==o?o:Y.globalScope(),p=null!==(r=h.extraStyleScope)&&void 0!==r?r:void 0,f=c._$behavior.ownerSpace.styleScopeManager;if(l.classList=new Z(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}--`)}d.__wxElement=l,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 s=null===(n=this._$modelBindingListeners)||void 0===n?void 0:n[e];s&&s.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 s=null===(n=this._$modelBindingListeners)||void 0===n?void 0:n[t];s&&s.call(this,e)}})),e}}ot.isNativeNode=v,ot.prototype[p]=!0;class it{constructor(e,t){this._$slotElement=null,this._$destroyOnRemoval=0,this._$subtreeSlotStart=null,this._$subtreeSlotEnd=null,this._$mutationObserverTarget=null,this._$text=String(e);let n=null;const s=t.getBackendContext();if(s)if(3===t.getBackendMode())n=s.document.createTextNode(e);else if(1===t.getBackendMode()){n=t._$backendShadowRoot.createTextNode(e)}else{n=s.createTextNode(e)}this._$backendElement=n,this.ownerShadowRoot=t,this.parentNode=null,this.parentIndex=-1,this.containingSlot=void 0}static create(e,t){return new it(e,t)}asTextNode(){return this}asElement(){return null}asNativeNode(){return null}asVirtualNode(){return null}asShadowRoot(){return null}asGeneralComponent(){return null}asInstanceOf(){return null}destroyBackendElement(){this._$backendElement&&3!==this.ownerShadowRoot.getBackendMode()&&this._$backendElement.release(),this.ownerShadowRoot._$nodeTreeContext.dropBackendAfterRelease&&(this._$backendElement=null)}destroyBackendElementOnRemoval(){this._$destroyOnRemoval=1}cancelDestroyBackendElementOnRemoval(){this._$destroyOnRemoval=0}destroyBackendElementOnDetach(){this._$destroyOnRemoval=1}cancelDestroyBackendElementOnDetach(){this._$destroyOnRemoval=0}getBackendElement(){return this._$backendElement}getBackendContext(){return this.ownerShadowRoot.getBackendContext()}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)),this._$mutationObserverTarget&&ye.callTextObservers(this,{type:"characterData",target:this}))}}it.isTextNode=_,it.prototype[h]=!0;class rt extends et{constructor(){throw new Error("Element cannot be constructed directly")}_$initializeVirtual(e,t,n){if(this.is=String(e),n&&1===n.mode){const s=t._$backendShadowRoot.createVirtualNode(e);this._$initialize(!0,s,t,n),s.__wxElement=this,s.associateValue(this)}else this._$initialize(!0,null,t,t._$nodeTreeContext)}static create(e,t){const n=Object.create(rt.prototype);return n._$initializeVirtual(e,t,t.getBackendContext()),n}}var lt;rt.isVirtualNode=b,rt.prototype[f]=!0,function(e){e[e.Single=1]="Single",e[e.Multiple=2]="Multiple",e[e.Dynamic=3]="Dynamic"}(lt||(lt={}));class at extends rt{constructor(){throw new Error("Element cannot be constructed directly")}static createShadowRoot(e){const t=Object.create(at.prototype);let n=null;1===e.getBackendMode()&&(n=e._$backendElement.getShadowRoot()),t.is="shadow",t._$idMap=null;let s=1;const o=e.getComponentOptions();return o.multipleSlots?s=2:o.dynamicSlots&&(s=3),t._$slotMode=s,1===s?t._$singleSlot=null:2===s?(t._$slots=Object.create(null),t._$slotsList=Object.create(null)):3===s&&(t._$dynamicSlotsInserted=!1,t._$dynamicSlots=new Map,t._$requiredSlotValueNames=[],t._$propertyPassingDeepCopy=Ie(o.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,t._$hooks=e.getOwnerSpace().hooks,e.shadowRoot=t,n&&(n.__wxElement=t,n.associateValue(t)),t}getHostNode(){return this._$host}createTextNode(e=""){return this._$hooks.createTextNode((e=>new it(e,this)),e)}createNativeNode(e){return this._$hooks.createNativeNode(((e,t)=>ot.create(e,this,t)),e,e)}createVirtualNode(e="virtual"){return rt.create(e,this)}createNativeNodeWithInit(e,t,n,s){const o=this._$hooks.createNativeNode(((e,t)=>ot.create(e,this,t,n)),e,t);return null==s||s(o),o}createComponent(e,t,n,s,o){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,o);let h,u;if(d.final)h=d.final;else if(null!==d.placeholder){h=Tt(d.placeholder,a,d.source,l);const e=d.waiting;s&&e&&(e.add(s),e.hintUsed(i),u=()=>{e.remove(s)})}if("string"==typeof h)return this.createNativeNodeWithInit(h,e,u,o);if(h)return this._$hooks.createComponent(((e,t)=>Pt._$advancedCreate(e,t,this,null,Mt(t,r,i,n),u,o)),e,h)}let h=a.getGlobalUsingComponent(d);if(null===h&&a._$allowUnusedNativeNode&&""!==d&&(h=d),!h){if(h=a.getDefaultComponent(),!h)throw new R(`Cannot find component "${d}"`,void 0,this._$host);L(`Cannot find component "${d}", using default component.`,this._$host)}return"string"==typeof h?this.createNativeNodeWithInit(h,e,void 0,o):this._$hooks.createComponent(((e,t)=>Pt._$advancedCreate(e,t,this,null,Mt(t,r,i,n),void 0,o)),e,h)}createComponentByDef(e,t){return this._$hooks.createComponent(((e,t)=>Pt._$advancedCreate(e,t,this,null,null,void 0)),e,t)}createComponentOrNativeNode(e,t,n){const s=this._$host,o=s._$behavior,i=o.ownerSpace,r=i.getGlobalUsingComponent(e);if("string"==typeof r)return this.createNativeNodeWithInit(r,e,void 0,n);if(r)return this._$hooks.createComponent(((e,i)=>Pt._$advancedCreate(e,i,this,null,Mt(i,o,s,t),void 0,n)),e,r);if(i._$allowUnusedNativeNode){const t=this._$hooks.createNativeNode((e=>ot.create(e,this)),e,e);return null==n||n(t),t}throw new R(`Unknown tag name ${e}`,"[render]",s)}checkComponentPlaceholder(e){var t;let n;const s=this._$host._$behavior._$using[e];if(void 0!==s)n=s;else{const s=null===(t=this._$host._$genericImpls)||void 0===t?void 0:t[e];if(!s)return;n=s}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=et._$generateIdMap(this);return this._$idMap=e,e}getSlotElementFromName(e){const t=this._$slotMode;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 s=n.value;(s._$slotName||"")===e&&t.push(s)}return t}return null}getContainingSlot(e){var t;const n=this._$slotMode;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 s=n._$slotElement;if((null==s?void 0:s.ownerShadowRoot)===this)return s}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(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(!et.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 s=n[e];if(!1===t(s))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(!et.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 s=n[e];if(!s._$inheritSlots&&!1===t(s))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 s=this._$slotsList,o=this._$slots;if(s[t]){const n=s[t];let o={next:n},i=!0;for(let t=this._$subtreeSlotStart;t&&o.next&&t.value!==e;t=t.next)t.value===o.next.value&&(i=!1,o=o.next);if(i)s[t]=n.prev={value:e,prev:null,next:n};else{const t=o.next;o.next={value:e,prev:o,next:t},t&&(t.prev=o.next)}}else s[t]={value:e,prev:null,next:null};const i=o[t],r=s[t].value;i!==r&&(o[t]=r,et._$insertChildReassignSlot(this,t,i||null,r))}_$applyMultipleSlotsRemoval(e,t,n){const s=this._$slotsList,o=this._$slots;let i=s[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;s[t]=a,n||(o[t]=i,et._$insertChildReassignSlot(this,t,e,i))}else delete s[t],n||(delete o[t],et._$insertChildReassignSlot(this,t,e,null))}_$applySlotRename(e,t,n){const s=this._$slotMode;if(1!==s){if(2===s)return this._$applyMultipleSlotsRemoval(e,n,!1),void this._$applyMultipleSlotInsertion(e,t,!1);if(3===s){if(!this._$dynamicSlotsInserted)return;const n=this._$insertDynamicSlotHandler,s=this._$removeDynamicSlotHandler;this._$dynamicSlots.set(e,{updatePathTree:void 0}),null==s||s([e]),null==n||n([{slot:e,name:t,slotValues:e._$slotValues}])}}}_$applySlotsInsertion(e,t,n){const s=this._$slotMode;if(1===s){const e=this._$singleSlot,t=this._$subtreeSlotStart.value;if(e===t)return;return this._$singleSlot=t,void et._$insertChildReassignSlot(this,null,e,t)}if(2!==s){if(3===s){if(n)return;if(!this._$dynamicSlotsInserted)return;const s=this._$insertDynamicSlotHandler,o=[];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}),o.push({slot:e,name:t,slotValues:e._$slotValues})}null==s||s(o)}}else for(let s=e;s&&s!==t.next;s=s.next){const e=s.value,t=e._$slotName;this._$applyMultipleSlotInsertion(e,t,n)}}_$applySlotsRemoval(e,t,n){var s;const o=this._$slotMode;if(1===o){if(n)return;const e=this._$singleSlot,t=(null===(s=this._$subtreeSlotStart)||void 0===s?void 0:s.value)||null;if(e===t)return;return this._$singleSlot=t,void et._$insertChildReassignSlot(this,null,e,t)}if(2!==o){if(3===o){if(n)return;if(!this._$dynamicSlotsInserted)return;const s=this._$removeDynamicSlotHandler,o=[];for(let n=e;n&&n!==t.next;n=n.next){const e=n.value;this._$dynamicSlots.delete(e),o.push(e)}null==s||s(o)}}else for(let s=e;s&&s!==t.next;s=s.next){const e=s.value,t=e._$slotName;this._$applyMultipleSlotsRemoval(e,t,n)}}setDynamicSlotHandler(e,t,n,s){if(3===this._$slotMode&&(this._$requiredSlotValueNames=e,this._$insertDynamicSlotHandler=t,this._$removeDynamicSlotHandler=n,this._$updateDynamicSlotHandler=s,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 s;const o=e._$slotValues;if(!o)return;const i=o[t];let r=n;if(0!==this._$propertyPassingDeepCopy&&(r=2===this._$propertyPassingDeepCopy?me(n,!0):_e(n)),i===r)return;if(o[t]=r,e._$mutationObserverTarget&&ye.callAttrObservers(e,{type:"properties",target:e,nameType:"slot-value",propertyName:t}),this._$requiredSlotValueNames.indexOf(t)<0)return;const l=null===(s=this._$dynamicSlots)||void 0===s?void 0:s.get(e);l&&(l.updatePathTree||(l.updatePathTree=Object.create(null)),l.updatePathTree[t]=!0)}applySlotValueUpdates(e){var t,n;const s=null===(t=this._$dynamicSlots)||void 0===t?void 0:t.get(e),o=null==s?void 0:s.updatePathTree;o&&(s.updatePathTree=void 0,null===(n=this._$updateDynamicSlotHandler)||void 0===n||n.call(this,e,e._$slotValues,o))}applySlotUpdates(){var e;if(this._$dynamicSlotsInserted){const t=this._$dynamicSlots.entries();for(let n=t.next();!n.done;n=t.next()){const[t,s]=n.value,o=s.updatePathTree;o&&(s.updatePathTree=void 0,null===(e=this._$updateDynamicSlotHandler)||void 0===e||e.call(this,t,t._$slotValues,o))}}else{this._$dynamicSlotsInserted=!0;const e=this._$insertDynamicSlotHandler,t=[];for(let e=this._$subtreeSlotStart;e;e=e.next){const n=e.value,s=n._$slotName;this._$dynamicSlots.set(n,{updatePathTree:void 0}),t.push({slot:n,name:s,slotValues:n._$slotValues})}null==e||e(t)}}getSlotMode(){return this._$slotMode}}at.isShadowRoot=y,at.prototype[$]=!0;class dt{constructor(e,t,n,s,o){this.ownerShadowRoot=s,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(o(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 s=Object.keys(e);t=new Array(s.length),n=new Array(s.length);for(let o=0;o<s.length;o+=1){const i=s[o],r=e[i];t[o]=r,n[o]=i}}else if("string"==typeof e){L("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){L("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);const s=Number.isSafeInteger(e)&&e>=0&&e<Math.pow(2,32)?e:0;t=new Array(s),n=null;for(let e=0;e<s;e+=1)t[e]=e}else L(`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 s=this.keyName,o=new Array(t.length),i=Object.create(null);let r;if(null!==s){for(let e=0;e<t.length;e+=1){const n=t[e],l="*this"===s?n:null==n?void 0:n[s],a=null!=l?String(l):"";o[e]=a,(null==r?void 0:r[a])?r[a].push(e):void 0!==i[a]?(r||(r=Object.create(null)),r[a]=[i[a],e]):i[a]=e}if(r){const e=Object.keys(r);L(`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],s=r[n];let l=0;for(let e=1;e<s.length;e+=1){const t=s[e];for(;void 0!==i[`${n}--${l}`];)l+=1;const r=`${n}--${l}`;i[r]=t,o[t]=r}}}}this.rawKeys=o,this.keyMap=i,this.sharedKeyMap=r}diff(e,t,n,s,o){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 $,g;if(!0===t)g=!0,$=null===p;else if(void 0===t)g=t,$=!0;else if(null===p)g=!0,$=!0;else{let e=!1;if(f)e=!0;else{const n=Object.keys(t);for(let s=0;s<n.length;s+=1){const o=t[n[s]];if(!0===o||("*this"===p?o:null==o?void 0:o[p])){e=!0;break}}}if(e){g=new Array(d.length);for(let e=0;e<d.length;e+=1){const n=d[e];let s=!1;if(l||c)if(void 0!==(null==l?void 0:l[n])||void 0!==(null==c?void 0:c[n]))s=!0;else{const e=n.lastIndexOf("--");if(e>=0){const t=n.slice(0,e);void 0===(null==l?void 0:l[t])&&void 0===(null==c?void 0:c[t])||(s=!0)}}if(s)g[e]=!0;else{const n=t[e];void 0===n||(!0===n||("*this"===p?n:null==n?void 0:n[p])?g[e]=!0:g[e]=n)}}$=!1}else g=t,$=!1}if($){let e;e=!!f||t;let r=0;for(;r<i.length&&r<d.length;){const t=h[r],s=null===u?r:u[r],i=null===a?r:a[r];o(t,s,!0===e||void 0===e?e:e[s],s!==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(s(t,n))}n.insertChildren(e,-1)}return}const _=[],m=[],v=new Array(d.length),b=new Array(d.length);let y=-1,S=-1;for(let e=0;e<d.length;e+=1){const t=d[e];if(i[y+1]===t){y+=1,S+=1,_[S]=y,m[S]=e,v[e]=S>0?m[S-1]:-1,b[e]=y;continue}const n=r[t];if(void 0===n){b[e]=-1;continue}let s=0,o=_.length;for(;s<o;){const e=Math.floor((s+o)/2);n<_[e]?o=e:s=e+1}_[o]=n,m[o]=e,v[e]=o>0?m[o-1]:-1,b[e]=n,y=n,S=o}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],s=null===u?e:u[e],i=null===a?e:a[e];o(t,s,!0===g||void 0===g?g:g[e],s!==i,n.childNodes[e]),e+=1}return}let w=C>0?m[C-1]:-1,N=C;for(;-1!==w;)N-=1,_[N]=w,w=v[w];const E=_;let k;!function(e){e[e.Stable=0]="Stable",e[e.ForwardMove=1]="ForwardMove",e[e.BackwardMove=2]="BackwardMove"}(k||(k={}));const x=new Array(i.length),O=new Array(d.length);let L=-1;for(let e=0;e<b.length;e+=1){const t=b[e];if(e!==E[N])if(-1!==t)x[t]=t>L?2:1,O[e]=n.childNodes[t];else{const t=h[e],n=null===u?e:u[e];O[e]=s(t,n)}else L=t,N+=1,x[t]=0}let R=0,A=0,M=0;N=0;do{const e=N<E.length?E[N]:O.length,t=N<E.length?b[e]:x.length;for(;A<t;)if(void 0===x[A]){const e=A;A+=1;let s=1;for(;A<t&&void 0===x[A];)A+=1,s+=1;n.removeChildren(e+R,s),R-=s}else 2===x[A]&&(R-=1),A+=1;for(;M<e;){const s=O[M],i=b[M];if(-1===i){const s=M;M+=1;let o=1;for(;M<e&&-1===b[M];)M+=1,o+=1;n.insertChildren(O.slice(s,s+o),t+R),R+=o}else{s&&n.insertChildAt(s,t+R);const e=h[M],r=null===u?M:u[M],l=null===a?i:a[i];o(e,r,!0===g||void 0===g?g:g[M],r!==l,s),2===x[i]&&(R+=1),M+=1}}if(N<E.length){const s=h[e],i=null===u?e:u[e],r=null===a?t:a[t];o(s,i,!0===g||void 0===g?g:g[e],i!==r,n.childNodes[t+R])}A=t+1,M=e+1,N+=1}while(N<=E.length)}}const ct=e=>e,ht=(e,t,n)=>t=>{var s;return n.call(null===(s=e.ownerShadowRoot)||void 0===s?void 0:s.getHostNode().getMethodCaller(),t)},ut=e=>{const t=e;return t._$wxTmplArgs=t._$wxTmplArgs||{}},pt=e=>null==e?"":String(e),ft=e=>e.replace(/-(.|$)/g,(e=>e[1]?e[1].toUpperCase():""));class $t{constructor(e,t,n){this.bindingMapDisabled=!1,this.changePropFilter=ct,this.eventListenerWrapper=ht,this.s=(e,t)=>{e.slot=t,this.tryCallPropertyChangeListener(e,"slot",t)},this.l=(e,t,n,s)=>{var o;3===this.shadowRoot.getSlotMode()?this.shadowRoot.replaceSlotValue(e,t,n):this.checkFallbackEventListener(e,t,n,s)||L(`"${t}" is not a valid event binding or slot value`,null===(o=e.ownerShadowRoot)||void 0===o?void 0:o.getHostNode(),e),this.tryCallPropertyChangeListener(e,t,n)},this.i=(e,t)=>{e.id=t,this.tryCallPropertyChangeListener(e,"id",t)},this.c=(e,t)=>{if(S(e)){e.hasExternalClass("class")&&e.setExternalClass("class",t)}e.setNodeClass(t),this.tryCallPropertyChangeListener(e,"class",t)},this.e=(e,t)=>{const n=ut(e);n.staticClasses||(n.staticClasses=new Array(t.length));const s=n.staticClasses;for(let e=0;e<t.length;e+=1){const n=t[e];"string"==typeof n&&(s[e]=n)}this.applyClassListUpdates(e)},this.ei=(e,t,n)=>{const s=ut(e);s.staticClasses||(s.staticClasses=[]);s.staticClasses[t]=n,s.staticClassesDirty=!0},this.y=(e,t)=>{if(S(e)&&Pt.hasProperty(e,"style")){const n=Pt.getDataProxy(e),s=ft("style");n.replaceProperty(s,t)}else e.setNodeStyle(pt(t),0);this.tryCallPropertyChangeListener(e,"style",t)},this.w=(e,t)=>{const n=ut(e);n.styleNameValues||(n.styleNameValues=new Array(t.length));const s=n.styleNameValues;for(let e=0;e<t.length;e+=2){const n=t[e+1];"string"==typeof n&&(s[e]=t[e],s[e+1]=n)}this.applyStyleListUpdates(e)},this.wi=(e,t,n)=>{const s=ut(e);s.styleNameValues||(s.styleNameValues=[]);s.styleNameValues[2*t+1]=n,s.styleNameValuesDirty=!0},this.d=(e,t,n,s)=>{if(s&&S(e)){const s=Pt.getDataProxy(e),i=`data${t[0].toUpperCase()}${t.slice(1)}`;if(s.replaceProperty(i,n));else{const i=`data-${o=t,o.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`))}`;e.hasExternalClass(i)?e.setExternalClass(i,n):s.replaceProperty(i,n)||e.setDataset(t,n)}this.tryCallPropertyChangeListener(e,t,n)}else e.setDataset(t,n);var o},this.m=(e,t,n)=>{e.setMark(t,n)},this.v=(e,t,n,s,o,i,r,l)=>{const a="function"==typeof n?n:pt(n),d=this.eventListenerWrapper(e,t,(function(...t){const n=e.ownerShadowRoot.getHostNode(),s="function"==typeof a?a:Pt.getMethod(n,a);if("function"==typeof s)return s.call(this,...t)}),s,o,i,l);d&&Object.defineProperty(d,"name",{value:"string"==typeof a?a:a.name});const c={final:s,mutated:o,capture:i};if(r){const n=ut(e);n.dynEvListeners||(n.dynEvListeners={});const s=n.dynEvListeners;s[t]&&e.removeListener(t,s[t],c),s[t]=d}a&&d&&e.addListener(t,d,c)},this.r=(e,t,n,s,o)=>{var i;if(S(e)){const r=Pt.getDataProxy(e),l=ft(t);r.replaceProperty(l,n)?void 0!==s&&(null===s?r.setModelBindingListener(l,(()=>{})):r.setModelBindingListener(l,(t=>{const n=e.ownerShadowRoot.getHostNode(),o=Pt.getDataProxy(n);o.replaceDataOnPath(s,t),o.applyDataUpdates(!1)}))):e.hasExternalClass(t)?e.setExternalClass(t,n):this.checkFallbackEventListener(e,l,n,o)||L(`"${l}" is not a valid property`,null===(i=e.ownerShadowRoot)||void 0===i?void 0:i.getHostNode(),e)}else if(v(e)){if(this.fallbackListenerOnNativeNode){const s=ft(t);this.checkFallbackEventListener(e,s,n,o)||e.updateAttribute(t,n)}else e.updateAttribute(t,n);s&&e.setModelBindingListener(t,(t=>{const n=e.ownerShadowRoot.getHostNode(),o=Pt.getDataProxy(n);o.replaceDataOnPath(s,t),o.applyDataUpdates(!1)}))}this.tryCallPropertyChangeListener(e,t,n)},this.a=(e,t,n)=>{e.updateAttribute(t,n),this.tryCallPropertyChangeListener(e,t,n)},this.wl=(e,t,n)=>{S(e)&&e.triggerWorkletChangeLifetime(t,n)},this.p=(e,t,n,s)=>{const o=ut(e);o.changeProp||(o.changeProp=Object.create(null)),o.changeProp[t]={listener:this.changePropFilter(n,s,e,t),oldValue:void 0}},this.shadowRoot=e,this.procGen=t,this.fallbackListenerOnNativeNode=n}create(e){const{shadowRoot:t,procGen:n}=this,s=n(this,!0,e);return this.handleChildrenCreationAndInsert(s.C,t,void 0,void 0),s.B}update(e,t){const{shadowRoot:n,procGen:s}=this,o=s(this,!1,e,t);this.handleChildrenUpdate(o.C,n,void 0,void 0)}endBindingMapUpdateForElement(e){const t=e._$wxTmplArgs;if(t&&(t.staticClassesDirty&&(t.staticClassesDirty=!1,this.applyClassListUpdates(e)),t.styleNameValuesDirty&&(t.styleNameValuesDirty=!1,this.applyStyleListUpdates(e))),S(e)&&e.hasPendingChanges()){Pt.getDataProxy(e).applyDataUpdates(!0)}}bindingMapUpdate(e,t,n){if(this.bindingMapDisabled)return!1;const s=n[e];if(!s)return!1;let o=null;for(let e=0;e<s.length;e+=1){(0,s[e])(t,(e=>{null!==o&&e!==o&&this.endBindingMapUpdateForElement(o),o=e}),((e,t)=>{e.textContent=t}))}const i=o;return null!==i&&this.endBindingMapUpdateForElement(i),!0}handleChildrenCreation(e,t,n){const s=[];return e(!0,((e,o)=>{if(t&&""!==n){const e=this.createDynamicPlaceholder(t);return void s.push(e)}const i=this.shadowRoot.createTextNode(e);i.destroyBackendElementOnRemoval(),t&&et.setSlotElement(i,t),o&&o(i),s.push(i)}),((e,o,i,r,l,a)=>{if(t&&n!==(l||"")){const e=this.createDynamicPlaceholder(t);return void s.push(e)}const d=this.createCommonElement(e,o,i,r,a);if(t){et.setSlotElement(d,t);ut(d).dynamicSlotNameMatched=!0}else void 0!==l&&(d.slot=l);s.push(d)}),((e,o)=>{const i=this.shadowRoot.createVirtualNode("wx:if");i.destroyBackendElementOnRemoval(),et.setInheritSlots(i),t&&et.setSlotElement(i,t);ut(i).key=e,this.handleChildrenCreationAndInsert(o,i,t,n),s.push(i)}),((e,o,i,r,l)=>{const a=this.shadowRoot,d=a.createVirtualNode("wx:for");d.destroyBackendElementOnRemoval(),et.setInheritSlots(d),t&&et.setSlotElement(d,t);ut(d).keyList=new dt(o,e,d,a,((e,s)=>{const o=a.createVirtualNode("wx:for-item");return o.destroyBackendElementOnRemoval(),et.setInheritSlots(o),t&&et.setSlotElement(d,t),this.handleChildrenCreationAndInsert(((t,n,o,i,a,d,c)=>{l(!0,e,s,void 0,void 0,r?[...r,s]:null,n,o,i,a,d,c)}),o,t,n),o})),s.push(d)}),((e,n,o)=>{const i=this.shadowRoot.createVirtualNode("slot");i.destroyBackendElementOnRemoval(),et.setSlotName(i,pt(e)),t?et.setSlotElement(i,t):void 0!==o&&(i.slot=o),n&&n(i),s.push(i)}),((e,o)=>{if(void 0!==o)if(t)if(n===o){const n=this.shadowRoot.createVirtualNode("virtual");n.destroyBackendElementOnRemoval(),et.setSlotElement(n,t);ut(n).dynamicSlotNameMatched=!0,this.handleChildrenCreationAndInsert(e,n,void 0,void 0),s.push(n)}else{const e=this.createDynamicPlaceholder(t);s.push(e)}else{const t=this.shadowRoot.createVirtualNode("virtual");t.destroyBackendElementOnRemoval(),t.slot=o,this.handleChildrenCreationAndInsert(e,t,void 0,void 0),s.push(t)}else{const o=this.shadowRoot.createVirtualNode("virtual");o.destroyBackendElementOnRemoval(),et.setInheritSlots(o),t&&et.setSlotElement(o,t),this.handleChildrenCreationAndInsert(e,o,t,n),s.push(o)}}),void 0,void 0),s}handleChildrenCreationAndInsert(e,t,n,s){const o=this.handleChildrenCreation(e,n,s);o.length&&t.insertChildren(o,-1)}handleChildrenUpdate(e,t,n,s){let o=0;const i=n?n.slotNodes.filter((e=>e.parentNode===t)):t.childNodes;e(!1,(e=>{const t=i[o];if(o+=1,t){if(n){if(!ut(t).dynamicSlotNameMatched)return}void 0!==e&&(t.textContent=e)}}),((e,r,l,a,d,c)=>{const h=i[o];if(o+=1,!h)return;if(n){const o=ut(h);if(s!==(d||"")){if(o.dynamicSlotNameMatched){const e=this.createDynamicPlaceholder(n);t.replaceChild(e,h)}return}if(!o.dynamicSlotNameMatched){const s=this.createCommonElement(e,r,l,a,c);et.setSlotElement(s,n);return ut(s).dynamicSlotNameMatched=!0,void t.replaceChild(s,h)}}l(h,!1);let u=!1;if(S(h)){const e=this.dynamicSlotUpdate(h,c,a);if(e&&(u=!0),h.hasPendingChanges()){Pt.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[o];if(o+=1,!l)return;const a=ut(l);if(a.key===e)this.handleChildrenUpdate(r,l,n,s);else{const i=this.shadowRoot.createVirtualNode("wx:if");i.destroyBackendElementOnRemoval(),et.setInheritSlots(i),n&&et.setSlotElement(i,n);const d=ut(i);a.key=d.key=e,this.handleChildrenCreationAndInsert(r,i,n,s),n?t.replaceChild(i,l):t.replaceChildAt(i,o-1)}}),((e,t,r,l,a)=>{const d=i[o];if(o+=1,!d)return;ut(d).keyList.diff(e,r,d,((e,t)=>{const o=this.shadowRoot.createVirtualNode("wx:for-item");return o.destroyBackendElementOnRemoval(),et.setInheritSlots(o),n&&et.setSlotElement(d,n),this.handleChildrenCreationAndInsert(((n,s,o,i,r,d,c)=>{a(!0,e,t,void 0,void 0,l?[...l,t]:null,s,o,i,r,d,c)}),o,n,s),o}),((e,t,o,i,r)=>{r&&this.handleChildrenUpdate(((n,s,r,d,c,h,u)=>{a(!1,e,t,o,!!i||void 0,l?[...l,t]:null,s,r,d,c,h,u)}),r,n,s)}))}),((e,t,s)=>{const r=i[o];o+=1,r&&(void 0!==e&&et.setSlotName(r,pt(e)),n||void 0!==s&&(r.slot=s),t&&t(r),this.shadowRoot.applySlotValueUpdates(r))}),((e,r)=>{const l=i[o];if(o+=1,l)if(void 0!==r)if(n){const o=ut(l);if(s===r)if(o.dynamicSlotNameMatched)this.handleChildrenUpdate(e,l,void 0,void 0);else{const s=this.shadowRoot.createVirtualNode("virtual");s.destroyBackendElementOnRemoval(),et.setSlotElement(s,n);ut(s).dynamicSlotNameMatched=!0,this.handleChildrenCreationAndInsert(e,s,void 0,void 0),t.replaceChild(s,l)}else if(o.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,s)}),void 0,void 0)}dynamicSlotUpdate(e,t,n){const s=e.getShadowRoot();return 3===(null==s?void 0:s.getSlotMode())?(s.setDynamicSlotHandler(t||[],(t=>{const s=[];for(let e=0;e<t.length;e+=1){const{slot:o,name:i,slotValues:r}=t[e],l=this.handleChildrenCreation(((e,t,s,o,i,l,a)=>{n(!0,t,s,o,i,l,a,r,void 0)}),o,i);s.push(...l)}s.length&&e.insertChildren(s,-1)}),(t=>{if(!t.length)return;const n=[];for(let e=0;e<t.length;e+=1)t[e].slotNodes.length&&n.push(t[e]);n.sort(((e,t)=>e.slotNodes[0].parentIndex-t.slotNodes[0].parentIndex));let s=0,o=0;for(let t=0;t<n.length;t+=1){const i=n[t].slotNodes,r=i[0].parentIndex,l=i.findLast((t=>t.parentNode===e)).parentIndex;o!==r&&(s>=0&&e.removeChildren(s,o-s),s=r),o=l+1}s!==o&&e.removeChildren(s,o-s)}),((t,s,o)=>{const i=t._$slotName||"";this.handleChildrenUpdate(((e,t,i,r,l,a,d)=>{n(!1,t,i,r,l,a,d,s,o)}),e,t,i)})),s):null}createDynamicPlaceholder(e){const t=this.shadowRoot.createVirtualNode("virtual");t.destroyBackendElementOnRemoval(),et.setSlotElement(t,e);return ut(t).dynamicSlotNameMatched=!1,t}checkFallbackEventListener(e,t,n,s){if(t.startsWith("bind"))this.v(e,t.slice(4),n,!1,!1,!1,!0,s);else if(t.startsWith("captureBind"))this.v(e,t.slice(11),n,!1,!1,!0,!0,s);else if(t.startsWith("catch"))this.v(e,t.slice(5),n,!0,!1,!1,!0,s);else if(t.startsWith("captureCatch"))this.v(e,t.slice(12),n,!0,!1,!0,!0,s);else{if(!t.startsWith("on"))return!1;this.v(e,t.slice(2),n,!1,!1,!1,!0,s)}return!0}createCommonElement(e,t,n,s,o){let i=!1;const r=e=>{const t=S(e)?this.dynamicSlotUpdate(e,o,s):null;if(t&&(i=!0),n(e,!0),S(e)){if(e.hasPendingChanges()){Pt.getDataProxy(e).applyDataUpdates(!0)}null==t||t.applySlotUpdates()}},l=this.shadowRoot.createComponent(e,e,t,(()=>{var n;const s=this.shadowRoot.createComponent(e,e,t,void 0,r);s.destroyBackendElementOnRemoval();const o=s.getShadowRoot(),i=S(l)?l.getShadowRoot():null,a=3===(null==i?void 0:i.getSlotMode()),d=3===(null==o?void 0:o.getSlotMode());d!==a?O(new Error(`The "dynamicSlots" option of component <${s.is}> and its placeholder <${l.is}> should be the same.`),"[render]",S(s)?s:s.is):d?null===(n=l.parentNode)||void 0===n||n.replaceChild(s,l):l.selfReplaceWith(s)}),r);return l.destroyBackendElementOnRemoval(),i?this.bindingMapDisabled=!0:this.handleChildrenCreationAndInsert(s,l,void 0,void 0),l}tryCallPropertyChangeListener(e,t,n){var s;const o=ut(e);if(null===(s=o.changeProp)||void 0===s?void 0:s[t]){const s=o.changeProp[t],i=s.oldValue;if(i!==n){s.oldValue=n;const t=e.ownerShadowRoot.getHostNode();c("Property Change Observer",s.listener,null,[n,i,t,e],t)}}}applyClassListUpdates(e){const t=ut(e).staticClasses;e.setNodeClassList(t),this.tryCallPropertyChangeListener(e,"class",t)}applyStyleListUpdates(e){const t=ut(e).styleNameValues;let n="";for(let e=0;e<t.length;e+=2){n+=`${t[e]}:${t[e+1]};`}if(S(e)&&Pt.hasProperty(e,"style")){const t=Pt.getDataProxy(e),s=ft("style");t.replaceProperty(s,n)}else e.setNodeStyle(pt(n),0);this.tryCallPropertyChangeListener(e,"style",n)}setFnFilter(e){this.changePropFilter=e}setEventListenerWrapper(e){"function"==typeof e&&(this.eventListenerWrapper=e)}devArgs(e){return(e=>{const t=e;return t._$wxTmplDevArgs=t._$wxTmplDevArgs||{}})(e)}}var gt;!function(e){e[e.Data=0]="Data",e[e.Script=1]="Script",e[e.InlineScript=2]="InlineScript"}(gt||(gt={}));const _t=()=>{};class mt{constructor(e,t){this.i=(e,t)=>{this.shadowRoot.idMap[t]=e},this.v=(e,t,n,s)=>{const o=e=>{const t=this.shadowRoot.comp.callMethod(n,e);return!s&&t};Object.defineProperty(o,"name",{value:n}),this.shadowRoot.setListener(e,t,o)},this.a=(e,t,n)=>{this.r(e,t,n)},this.shadowRoot=e,this.procGen=t}create(e){const{shadowRoot:t,procGen:n}=this,s=n(this,!0,e);return this.handleChildrenCreation(s.C,t.shadowRootElement),s.B}bindingMapUpdate(e,t,n){const s=n[e];if(void 0!==s)for(let e=0;e<s.length;e+=1){(0,s[e])(t,(()=>{}),((e,t)=>{e.textContent=t}))}}handleChildrenCreation(e,t){let n=!0,s=!1;const o=()=>{n=!1,s=!1;const e=document.createElement("virtual");t.appendChild(e),this.shadowRoot.slot=e};e(!0,((e,i)=>{s?o():n=!1;const r=document.createTextNode(e||"");i&&i(r),t.appendChild(r)}),((e,i,r,l)=>{s?o():n=!1;const a=document.createElement(e);r(a,!0),this.handleChildrenCreation(l,a),t.appendChild(a)}),_t,_t,(()=>{n?(s=!0,this.shadowRoot.slot=t):o()}),(e=>{s?o():n=!1;const i=document.createElement("virtual");this.handleChildrenCreation(e,i),t.appendChild(i)}))}s(){}l(){}c(e,t){e.setAttribute("class",t)}e(){}ei(){}y(e,t){e.setAttribute("style",t)}w(){}wi(){}d(e,t,n){e.dataset[t]=pt(n)}m(){}r(e,t,n){"boolean"==typeof n?n?e.setAttribute(t,""):e.removeAttribute(t):e.setAttribute(t,pt(n))}wl(){}p(){}setFnFilter(){}setEventListenerWrapper(){}devArgs(e){return(e=>{const t=e;return t._$wxTmplDevArgs=t._$wxTmplDevArgs||{}})(e)}}const vt=()=>({C:(e,t,n,s,o,i)=>{i("")},B:Object.create(null)}),bt=()=>vt;class yt{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:bt};this.genObjectGroupEnv={list:t.groupList||Object.create(null),group:t.content}}this.updateMode=""}createInstance(e){return new St(this,e)}}class St{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 s=e.genObjectGroupEnv.group("")||bt();this.procGenWrapper=new mt(this,s),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 s=0;s<t.length;s+=1){const[o]=t[s];this.procGenWrapper.bindingMapUpdate(o[0],e,n)}}setListener(e,t,n){const s=e;s._$wxTmplEv?s._$wxTmplEv[t]=n:s._$wxTmplEv={[t]:n}}handleEvent(e,t){var n;const s=e;let o=s;const i=this.shadowRootElement,r=t.getEventName(),l=t.bubbles;for(;;){const e=t.wrapShadowedEvent(s,null,o,this.comp),a=null===(n=o._$wxTmplEv)||void 0===n?void 0:n[r];if(a){!1===a.call(o,e)&&(t.preventDefault(),t.stopPropagation())}if(!l||t.propagationStopped())break;if(o===i)break;const d=o.parentNode;if(!d)break;o=d}}}const Ct=()=>({C:(e,t,n,s,o,i)=>{i("")},B:Object.create(null)}),wt=()=>Ct;var Nt;!function(e){e[e.Disabled=0]="Disabled",e[e.Enabled=1]="Enabled",e[e.Forced=2]="Forced"}(Nt||(Nt={}));const Et=e=>String(e>>>0)===e;class kt{create(e,t){return t.externalComponent?new yt(e):new xt(e)}}class xt{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:wt};this.genObjectGroupEnv={list:n.groupList||Object.create(null),group:n.content},this.updateMode=n.updateMode||"",this.fallbackListenerOnNativeNode=n.fallbackListenerOnNativeNode||!1}createInstance(e,t){return new Ot(this,e,t(e))}}class Ot{constructor(e,t,n){this.comp=t,this.shadowRoot=n,this.shadowRoot.destroyBackendElementOnRemoval(),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("")||wt();"bindingMap"===e.updateMode?this.forceBindingMapUpdate=2:"virtualTree"===e.updateMode?this.forceBindingMapUpdate=0:this.forceBindingMapUpdate=1,this.procGenWrapper=new $t(this.shadowRoot,t,e.fallbackListenerOnNativeNode),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[s,o,i,r]=t[e];let l=n;for(let e=0;e<s.length;e+=1){const t=s[e],n=l[t];if(!0===n)break;if(e===s.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 s=n,o=Object.keys(s);for(let e=0;e<o.length;e+=1){const n=o[e];Et(n)&&(t[Number(n)]=s[n],delete s[n])}}else{const s=new Array(e),o=Object.keys(n);let i=!1;for(let e=0;e<o.length;e+=1){const t=o[e],r=n[t];Et(t)?s[Number(t)]=r:"length"===t&&(i=!0)}const r=Object.create(s);i&&(r.length=!0),l[t]=r}const s=Object.getPrototypeOf(l[t]),a=new Array(o.length);a.fill(!0),s.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[s]=t;return 1===s.length&&this.procGenWrapper.bindingMapUpdate(s[0],e,n)}}let Lt=null;const Rt=()=>{if(Lt)return Lt;const e=new kt;return Lt=e,e};var At=Object.freeze({__proto__:null,DEFAULT_PROC_GEN_GROUP:wt,get GeneralLvaluePathPrefix(){return gt},GlassEaselTemplateEngine:kt,getDefaultTemplateEngine:Rt});const Mt=(e,t,n,s)=>{const o=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(s&&Object.prototype.hasOwnProperty.call(s,c)){const n=s[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 s=o.getGlobalUsingComponent(n);if("string"==typeof s)a[c]=s;else if(s)a[c]={final:s,source:t,placeholder:null,waiting:null};else{L(`Generic "${c}" value "${n}" is not valid`,e.is);const s=o.getDefaultComponent();if(!s)throw new R(`Cannot find default component for generic "${c}"`,"[prepare]",e.is);a[c]={final:s,source:t,placeholder:null,waiting:null}}}else a[c]=n}else{let s=n[c];if(!s){if(s=o.getDefaultComponent(),!s)throw new R(`Cannot find default component for generic "${c}"`,"[prepare]",e.is);L(`No component specified for generic "${c}", using default component (on component "${e.is}")`)}a[c]="string"==typeof s?s:{final:s,source:t,placeholder:null,waiting:null}}}}else a=null;return a},Tt=(e,t,n,s)=>{const o=n._$using[e]||s&&s[e];let i=null;if(o&&("string"==typeof o?i=o:null===o.placeholder?i=o.final:L("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 R(`Cannot find placeholder target "${e}"`,"[prepare]",n.is);L(`Cannot find placeholder target "${e}", using default component.`,n.is)}return r};class Dt{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:Rt()}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 s=t[e];n[s]={enumerable:!0,get(){return this._$dataGroup.data[s]},set(e){const t=this._$dataGroup;t.replaceDataOnPath([s],e),t.applyDataUpdates()}}}const s=Object.keys(e._$methodMap);for(let t=0;t<s.length;t+=1){const o=s[t];n[o]={enumerable:!0,value:e._$methodMap[o]}}}const s=function(){};n.constructor={value:s,writable:!0};const o=s.prototype=Object.create(Pt.prototype,n);o._$behavior=e,o._$definition=this,o._$methodMap=e._$methodMap,o._$dataGroupObserverTree=e._$generateObserverTree(),o._$lifetimeFuncs=e._$getAllLifetimeFuncs(),o._$pageLifetimeFuncs=e._$getAllPageLifetimeFuncs();const i=(e=>{if(void 0===e)return null;const t={definitions:new Array(6),keyMap:Object.create(null)},n=t.definitions,s=t.keyMap,o=Object.keys(e);for(let t=0;t<o.length;t+=1){const i=o[t],r=e[i],l=r.type;n[l]?(s[i]=[l,n[l].length],n[l].push(r)):(s[i]=[l,0],n[l]=[r])}return t})(e._$relationMap),r=Ie(t.dataDeepCopy),l=Ie(t.propertyPassingDeepCopy),a=this._$templateEngine.create(e,t);this._$detail={proto:o,template:a,dataDeepCopy:r,propertyPassingDeepCopy:l,relationDefinitionGroup:i}}}let Bt=1,It=null;class Pt extends et{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||le()).defineComponent(e)}static _$tagMethod(e){const t=e;return t[Q]=!0,t}static isTaggedMethod(e){return"function"==typeof e&&!!e[Q]}static _$advancedCreate(e,t,n,s,o,r,l){var a,d,h,u,p,f;t._$detail||t.prepare();const{proto:$,template:g,dataDeepCopy:_,propertyPassingDeepCopy:m,relationDefinitionGroup:v}=t._$detail,b=t._$options,y=t.behavior,S=n?n.getBackendContext():s||i.backendContext||(()=>{if(It)return It;let e;return e=new W,It=e,e})(),C=b.externalComponent,w=b.propertyEarlyInit,N=i.writeExtraInfoToAttr,E=b.virtualHost,k=Object.create($);k._$genericImpls=o,k._$external=C,k.tagName=e,k._$methodCaller=k;const x=y.ownerSpace,O=x._$sharedStyleScope,L=b.styleScope&&b.styleScope!==O;let A=null;if(S)if(3===S.mode){if(!E&&(A=S.document.createElement(e),L)){const e=x.styleScopeManager.queryName(b.styleScope);e&&A.setAttribute("wx-host",e)}}else if(2===S.mode)E||(A=S.createElement(b.hostNodeTagName,e));else if(1===S.mode){A=(n?n._$backendShadowRoot:S.getRootNode()).createComponent(e,C,E,null!==(a=b.styleScope)&&void 0!==a?a:Y.globalScope(),b.extraStyleScope,y._$externalClasses,C?null:b.dynamicSlots?3:b.multipleSlots?2:1,b.writeIdToDOM)}k._$initialize(E,A,n,null!==(d=null==n?void 0:n._$nodeTreeContext)&&void 0!==d?d:S),k._$placeholderHandlerRemover=r;const M=n?n.getHostNode():void 0,T=null==M?void 0:M.getComponentOptions(),D=null!==(h=null==T?void 0:T.styleScope)&&void 0!==h?h:Y.globalScope(),B=null!==(u=null==T?void 0:T.extraStyleScope)&&void 0!==u?u:void 0,I=null==M?void 0:M._$behavior.ownerSpace.styleScopeManager;if(k.classList=new Z(k,y._$externalClasses,M?M.classList:null,D,B,I),A){const e=null!==(p=null==T?void 0:T.styleScope)&&void 0!==p?p:b.styleScope;e&&2===S.mode&&A.setStyleScope(e,B,L?null!==(f=b.styleScope)&&void 0!==f?f:Y.globalScope():void 0)}if(A&&(A.__wxElement=k,3!==S.mode?A.associateValue(k):S.associateValue(A,k),I&&N)){const e=I.queryName(D);e&&A.setAttribute("exparser:info-class-prefix",`${e}--`)}const P=g.createInstance(k,at.createShadowRoot);if(N&&A){const e=Bt;Bt+=1,k._$componentInstanceId=e,A.setAttribute("exparser:info-component-id",e)}k._$idPrefix=b.idPrefixGenerator?b.idPrefixGenerator.call(k):"";const j=y._$staticData,F=y._$data;let U;if(void 0===j)if(1===F.length){U=(0,F[0])()}else{U={};for(let e=0;e<F.length;e+=1){const t=F[e];Object.assign(U,t())}}else{U=_e(j);for(let e=0;e<F.length;e+=1){const t=F[e];Object.assign(U,t())}}const V=k._$relation=new st(k,v);k._$traitGroup=new te;const G=y._$traitBehaviors;if(void 0!==G)for(let e=0;e<G.length;e+=1){const{traitBehavior:t,impl:n}=G[e];k._$traitGroup.implement(t,n)}if(y._$methodCallerInit){const e=y._$methodCallerInit.call(k);k._$methodCaller=e}let H=!1;if(y._$init.length>0){let e=!0;const t=k.getMethodCaller(),n={self:t,data:U,setData:k.setData.bind(k),implement:(e,t)=>{if(H)throw new R("Cannot execute init-time functions after initialization","[implement]",y.is);k._$traitGroup.implement(e,t)},relation:function(e){if(H)throw new R("Cannot execute init-time functions after initialization","[implement]",y.is);const t=e.target,n=nt(y.ownerSpace,y.is,"undefined",e);let s;return s=n?V.add(n):Symbol("invalid"),{list:()=>V.getLinkedTargets(s).map((e=>e.getMethodCaller())),listAsTrait:t instanceof ee?()=>V.getLinkedTargets(s).map((e=>e.traitBehavior(t))):void 0}},observer:(e,t)=>{if(H)throw new R("Cannot execute init-time functions after initialization","[implement]",y.is);k.dynamicAddObserver(t,e)},lifetime:(e,t)=>{if(H)throw new R("Cannot execute init-time functions after initialization","[implement]",y.is);k.addLifetimeListener(e,t)},pageLifetime:(e,t)=>{if(H)throw new R("Cannot execute init-time functions after initialization","[implement]",y.is);k.addPageLifetimeListener(e,t)},method:e=>Pt._$tagMethod(e),listener:e=>Pt._$tagMethod(e)},s=y._$init;for(let o=0;o<s.length;o+=1){const i=c("Component Init",s[o].func,t,[n],void 0);if(i){const t=Object.keys(i);for(let n=0;n<t.length;n+=1){const s=t[n],o=i[s];Pt.isTaggedMethod(o)&&(e&&(e=!1,k._$methodMap=Object.create(k._$methodMap)),k._$methodMap[s]=o,b.writeFieldsToNode&&(k[s]=o))}}}}H=!0;const z=P.shadowRoot;if(k.shadowRoot=z,C&&1===S.mode){const e=z.slot;A.setExternalSlot(e)}const q=new Pe(k,U,b.pureDataPattern||null,_,m,b.reflectToAttributes,k._$dataGroupObserverTree);k._$dataGroup=q,w&&void 0!==l&&l(k),P.initValues(q.innerData||q.data),k._$tmplInst=P,q.setUpdateListener(((e,t)=>{P.updateValues(e,t)}));const X=y._$listeners;if(void 0!==X)for(let e=0;e<X.length;e+=1){const{id:t,ev:n,listener:s}=X[e],o=s;if("this"===t)k.addListener(n,(e=>o.call(k._$methodCaller,e)));else if(C){const e=z,s=t?e.getIdMap()[t]:e.root;s&&e.setListener(s,n,(e=>o.call(k._$methodCaller,e)))}else{const e=z,s=t?e.getElementById(t):e;s&&s.addListener(n,(e=>o.call(k._$methodCaller,e)))}}return k.triggerLifetime("created",[]),w||void 0===l||l(k),k}static createWithGenericsAndContext(e,t,n,s,o){const i=e=>{let t;return n&&(t=Object.create(null),Object.entries(n).forEach((([n,s])=>{t[n]={final:s,source:e.behavior,placeholder:null,waiting:null}}))),Mt(e,e.behavior,void 0,t)};if(t)return Pt._$advancedCreate(String(e),t,null,s,i(t),void 0,o);if(e instanceof Dt)return Pt._$advancedCreate(e.is,e,null,s,i(e),void 0);const r=le().getComponentByUrl(e,"");return Pt._$advancedCreate(e,r,null,s,i(r),void 0)}static createWithGenerics(e,t,n,s){return Pt.createWithGenericsAndContext(e,t,n,null,s)}static createWithContext(e,t,n,s){return Pt.createWithGenericsAndContext(e,t,null,n,s)}static create(e,t,n){return Pt.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 R("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=Pt.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 ee?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}getEventObject(e){var t,n;return(null===(n=(t=this._$behavior)._$listenerEventReplacer)||void 0===n?void 0:n.call(t,e))||e}addLifetimeListener(e,t){Object.prototype.hasOwnProperty.call(this,"_$lifetimeFuncs")||(this._$lifetimeFuncs=this._$behavior._$getAllLifetimeFuncs());const n=this._$lifetimeFuncs;(n[e]=n[e]||new l("lifetime")).add(t)}removeLifetimeListener(e,t){Object.prototype.hasOwnProperty.call(this,"_$lifetimeFuncs")||(this._$lifetimeFuncs=this._$behavior._$getAllLifetimeFuncs());const n=this._$lifetimeFuncs[e];null==n||n.remove(t)}triggerLifetime(e,t){const n=this._$lifetimeFuncs[e];n&&n.call(this._$methodCaller,t,this)}triggerLifeTime(e,t){return this.triggerLifetime(e,t)}addPageLifetimeListener(e,t){Object.prototype.hasOwnProperty.call(this,"_$pageLifetimeFuncs")||(this._$pageLifetimeFuncs=this._$behavior._$getAllPageLifetimeFuncs());const n=this._$pageLifetimeFuncs;(n[e]=n[e]||new l("pageLifetime")).add(t)}removePageLifetimeListener(e,t){Object.prototype.hasOwnProperty.call(this,"_$pageLifetimeFuncs")||(this._$pageLifetimeFuncs=this._$behavior._$getAllPageLifetimeFuncs());const n=this._$pageLifetimeFuncs[e];null==n||n.remove(t)}triggerPageLifetime(e,t){const n=s=>{if(S(s)){if(s._$pageLifetimeFuncs){const n=s._$pageLifetimeFuncs[e];n&&n.call(s._$methodCaller,t,this)}s._$external||n(s.shadowRoot)}const o=s.childNodes;for(let e=0;e<o.length;e+=1){const t=o[e];m(t)&&n(t)}};n(this)}triggerPageLifeTime(e,t){return this.triggerPageLifetime(e,t)}dynamicAddObserver(e,t){Object.prototype.hasOwnProperty.call(this,"_$dataGroupObserverTree")||(this._$dataGroupObserverTree=this._$dataGroupObserverTree.cloneSub(),this._$dataGroup&&(this._$dataGroup._$observerTree=this._$dataGroupObserverTree));const n=this._$dataGroupObserverTree;try{n.addObserver(e,fe(t))}catch(e){O(e,"observer",this.is)}}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(),this._$mutationObserverTarget&&ye.callAttrObservers(this,{type:"properties",target:this,nameType:"external-class",attributeName:e})}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())&&S(t)&&t.applyExternalClassChanges();const s=t.childNodes;for(let t=0,n=s.length;t<n;t+=1)e(s[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 R("Cannot update data before component created","replaceDataOnPath",this);n.replaceDataOnPath(e,t)}spliceArrayDataOnPath(e,t,n,s){const o=this._$dataGroup;if(void 0===o)throw new R("Cannot update data before component created","spliceArrayDataOnPath",this);o.spliceArrayDataOnPath(e,t,n,s)}hasPendingChanges(){const e=this._$dataGroup;return void 0!==e&&e.getChanges().length>0}applyDataUpdates(){const e=this._$dataGroup;if(void 0===e)throw new R("Cannot update data before component created","applyDataUpdates",this);e.applyDataUpdates()}groupUpdates(e){const t=this._$dataGroup;if(void 0===t)throw new R("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 R("Cannot update data before component created","updateData",this);if("object"==typeof e&&null!==e){const n=Object.keys(e);for(let s=0;s<n.length;s+=1){const o=n[s];try{const n=pe(o);t.replaceDataOnPath(n,e[o])}catch(e){O(e,"updateData",this)}}}}setData(e){const t=this._$dataGroup;if(void 0===t)throw new R("Cannot update data before component created","setData",this);if("object"==typeof e&&null!==e){const n=Object.keys(e);for(let s=0;s<n.length;s+=1){const o=n[s];try{const n=pe(o);t.replaceDataOnPath(n,e[o])}catch(e){O(e,"setData",this)}}}t.applyDataUpdates()}}Pt.isComponent=S,Pt.prototype[g]=!0;class jt{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}listenerEventReplacer(e){return this._$listenerEventReplacer=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 s=t[n],o=e[s];this._$methods.push({name:s,func:o})}return this}observer(e,t,n=!1){this._$observers||(this._$observers=[]);try{this._$observers.push({dataPaths:fe(e),func:t,once:n})}catch(e){O(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,t=!1){return this._$init.push({func:e,once:t}),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 s=e[t],o=n[s];this._$properties.push({name:s,def:o})}}const s=e.methods;if(void 0!==s){const e=Object.keys(s);for(let t=0;t<e.length;t+=1){const n=e[t],o=s[n];this._$methods.push({name:n,func:o})}}const o=e.observers;if(void 0!==o)if(this._$observers||(this._$observers=[]),Array.isArray(o))for(let e=0;e<o.length;e+=1){const{fields:t,observer:n}=o[e];try{this._$observers.push({dataPaths:fe(null!=t?t:"**"),func:n,once:!1})}catch(e){O(e,"definition",this.is)}}else{const e=Object.keys(o);for(let t=0;t<e.length;t+=1){const n=e[t],s=o[n];try{this._$observers.push({dataPaths:fe(n),func:s,once:!1})}catch(e){O(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],s=i[n];this._$lifetimes.push({name:n,func:s,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],s=r[n];this._$pageLifetimes.push({name:n,func:s,once:!0})}}const l=e.listeners;if(l){this._$listeners||(this._$listeners={});const e=Object.keys(l);for(let t=0;t<e.length;t+=1){const n=e[t],s=l[n];this._$listeners[n]={func:s,once:!0}}}const a=e.relations;if(a){this._$relations||(this._$relations=[]);const e=Object.keys(a);for(let t=0;t<e.length;t+=1){const n=e[t],s=a[n];this._$relations.push({name:n,rel:s})}}return this}registerBehavior(){const e=this.is,t=new Ft(this);return void 0!==e&&this._$ownerSpace._$registerBehavior(e,t),t}extraThisFieldsType(){return this}registerComponent(){const e=this.is,t=new Ft(this),n=new Dt(t);return void 0!==e&&this._$ownerSpace.registerComponent(e,n),n}}class Ft{static create(e,t){return new jt(e.is,t||le()).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,this._$listenerEventReplacer=e._$listenerEventReplacer}general(){return this}getComponentDependencies(e){const t=new Set,n=function(e){e._$unprepared&&e.prepare();const s=Object.keys(e._$using);for(let o=0;o<s.length;o+=1){const i=s[o],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 s=Object.values(e);for(let e=0;e<s.length;e+=1){const o=s[e];"string"!=typeof o&&(t.has(o)||(t.add(o),n(o.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,s=this._$builder,o=this._$flatAncestors;if(Array.isArray(s._$behaviors))for(let e=0;e<s._$behaviors.length;e+=1){const i=s._$behaviors[e];let r=null;if(i instanceof Ft)r=i;else{const e=String(i);n&&(r=n.getBehaviorByUrl(e,t)),r||O(new Error(`behavior "${e}" is not found.`),"[prepare]",t)}if(!r)continue;r._$unprepared&&Ft.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={}),Ee(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;if(void 0!==u)if(this._$listeners)for(let e=0;e<u.length;e+=1){const t=u[e];t.once&&this._$listeners.indexOf(t)>=0||this._$listeners.push(t)}else this._$listeners=u.slice().slice();const p=r._$relationMap;void 0!==p&&(this._$relationMap||(this._$relationMap=Object.create(null)),Object.assign(this._$relationMap,p));for(let e=0;e<r._$init.length;e+=1){const t=r._$init[e];t.once&&this._$init.indexOf(t)>=0||this._$init.push(t)}r._$flatAncestors.forEach((e=>{o.add(e)}))}const i=s._$traitBehaviors;if(void 0!==i&&(this._$traitBehaviors||(this._$traitBehaviors=[]),this._$traitBehaviors.push(...i)),"object"==typeof s._$using&&null!==s._$using){const o="object"==typeof s._$placeholders&&null!==s._$placeholders,i=Object.keys(s._$using);for(let r=0;r<i.length;r+=1){const l=i[r],a=s._$using[l];let d=null;if(o&&(d=null!==(e=s._$placeholders[l])&&void 0!==e?e:null),a instanceof Dt)this._$using[l]={final:a,source:this,placeholder:d,waiting:null};else if(n){const e=String(a),s=n.getComponentByUrlWithoutDefault(e,t);if(s)this._$using[l]={final:s,source:this,placeholder:null,waiting:null};else if(null!==d){const s={final:null,source:this,placeholder:d,waiting:null},o=n._$componentWaitingList(e,t);o&&(o.add((e=>{s.final=e,s.placeholder=null,s.waiting=null})),s.waiting=o),this._$using[l]=s}else{const t=n.getGlobalUsingComponent(e);this._$using[l]="string"==typeof t?t:{final:t,source:this,placeholder:null,waiting:null}}}else O(new Error(`cannot find component "${String(a)}"`),"[prepare]",t)}}if("object"==typeof s._$generics&&null!==s._$generics){const e=this._$generics=[],o=Object.create(null);this._$genericDefaults=o;const i=Object.keys(s._$generics);for(let r=0;r<i.length;r+=1){const l=i[r],a=s._$generics[l];let d=null;const c=!0===a||null==a?void 0:a.default;if(void 0!==c)if(c instanceof Dt)d=c;else if(n){const e=String(c);d=n.getComponentByUrlWithoutDefault(e,t)||n.getGlobalUsingComponent(e)}else O(new Error(`cannot define generic "${l}" without a default implementor.`),"[prepare]",t);e.push(l),o[l]=d}}const r=s._$staticData;r&&(this._$staticData?Ee(this._$staticData,r):this._$staticData=r);const l=s._$methods;for(let e=0;e<l.length;e+=1){const{name:t,func:n}=l[e];this._$methodMap[t]=n}const a=s._$properties;if(void 0!==a){const e=[];for(let n=0;n<a.length;n+=1){const{name:s,def:o}=a[n],i="string"===(d=o)||d===String?{type:"string",optionalTypes:null,defaultFn:()=>"",observer:null,comparer:null,reflectIdPrefix:!1}:"number"===d||d===Number?{type:"number",optionalTypes:null,defaultFn:()=>0,observer:null,comparer:null,reflectIdPrefix:!1}:"boolean"===d||d===Boolean?{type:"boolean",optionalTypes:null,defaultFn:()=>!1,observer:null,comparer:null,reflectIdPrefix:!1}:"object"===d||d===Object?{type:"object",optionalTypes:null,defaultFn:()=>null,observer:null,comparer:null,reflectIdPrefix:!1}:"array"===d||d===Array?{type:"array",optionalTypes:null,defaultFn:()=>[],observer:null,comparer:null,reflectIdPrefix:!1}:"function"===d||d===Function?{type:"function",optionalTypes:null,defaultFn:()=>function(){},observer:null,comparer:null,reflectIdPrefix:!1}:"any"===d||null==d?{type:"any",optionalTypes:null,defaultFn:()=>null,observer:null,comparer:null,reflectIdPrefix:!1}:null;let r,l;if(null!==i)r=i,l=i.defaultFn;else{const e=o;let n=xe(e.type),i=null;Array.isArray(e.optionalTypes)&&(i=e.optionalTypes.map(xe),i.length>0&&("invalid"!==n&&"any"!==n||(n=i[0]))),"invalid"===n&&O(new Error(`the type of property "${s}" is illegal`),"[prepare]",t);const a=ke(n);"function"==typeof e.default&&void 0!==e.value&&L(`the initial value of property "${s}" is not used when its default is provided.`,t);const d="function"==typeof e.default?()=>{const n=c(`Property "${s}" Default`,e.default,null,[],t);return void 0!==n?n:_e(a)}:()=>_e(a);let h,u;l="function"==typeof e.default?d:void 0!==e.value?()=>_e(e.value):()=>_e(a),"function"==typeof e.observer?h=e.observer:"string"==typeof e.observer?(h=this._$methodMap[e.observer]||null,h||O(new Error(`Cannot find method "${e.observer}" for observer of property "${s}".`),"[prepare]",t)):(h=null,void 0!==e.observer&&O(new Error(`The observer of property "${s}" is not a function, got "${typeof e.observer}".`),"[prepare]",t)),"function"==typeof e.comparer?u=e.comparer:(u=null,void 0!==e.comparer&&O(new Error(`the comparer of property "${s}" is not a function.`),"[prepare]",t));r={type:n,optionalTypes:i,defaultFn:d,observer:h,comparer:u,reflectIdPrefix:!!e.reflectIdPrefix}}this._$propertyMap[s]=r,e.push({name:s,func:l})}this._$data.push((()=>{const t={};for(let n=0;n<e.length;n+=1){const{name:s,func:o}=e[n];t[s]=o()}return t}))}var d;this._$data.push(...s._$data);const h=s._$observers;if(void 0!==h)for(let e=0;e<h.length;e+=1){const{dataPaths:n,func:s,once:o}=h[e],i="function"==typeof s?s:this._$methodMap[s];"function"==typeof i?this._$observers.push({dataPaths:n,observer:i,once:o}):O(new Error(`the "${String(i)}" observer is not a function.`),"[prepare]",t)}const u=s._$lifetimes;this._$lifetimes.push(...u);const p=s._$pageLifetimes;p&&(this._$pageLifetimes||(this._$pageLifetimes=[]),this._$pageLifetimes.push(...p));const f=s._$listeners;if(void 0!==f){const e=Object.keys(f);if(e.length>0){this._$listeners||(this._$listeners=[]);for(let n=0;n<e.length;n+=1){const s=e[n],{func:o,once:i}=f[s],r="function"==typeof o?o:this._$methodMap[o];if(r){const e=s.indexOf(".");let t,n;e>=0?(t=s.slice(0,e),n=s.slice(e+1)):(t="",n=s),this._$listeners.push({id:t,ev:n,listener:r,once:i})}else O(new Error(`the "${s}" listener is not a function or a method name`),"[prepare]",t)}}}const $=s._$relations;if(void 0!==$){this._$relationMap||(this._$relationMap=Object.create(null));for(let e=0;e<$.length;e+=1){const{name:s,rel:o}=$[e];if(null==o)continue;const i=nt(n,t,s,o);i&&(this._$relationMap[s]=i)}}this._$init.push(...s._$init),o.add(this)}getTemplate(){return this._$template}_$updateTemplate(e){this._$template=e}hasBehavior(e){if(this._$unprepared&&this.prepare(),e instanceof Ft)return this._$flatAncestors.has(e);if(this.ownerSpace){const t=this.ownerSpace.getBehaviorByUrl(e,this.is);return!!t&&this._$flatAncestors.has(t)}return!1}listProperties(){return Object.keys(this._$propertyMap)}getPropertyType(e){var t;return null===(t=this._$propertyMap[e])||void 0===t?void 0:t.type}getPropertyOptionalType(e){var t;return null===(t=this._$propertyMap[e])||void 0===t?void 0:t.optionalTypes}getMethods(){return this._$methodMap}_$generateObserverTree(){const e=new Ae(this._$propertyMap),t=this._$observers;for(let n=0;n<t.length;n+=1){const{dataPaths:s,observer:o}=t[n];e.addObserver(o,s)}return e}_$getAllLifetimeFuncs(){const e=Object.create(null),t=this._$lifetimes;for(let n=0;n<t.length;n+=1){const{name:s,func:o}=t[n];if(e[s])e[s].add(o);else{(e[s]=new l("lifetime")).add(o)}}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:s,func:o}=t[n];if(e[s])e[s].add(o);else{(e[s]=new l("pageLifetime")).add(o)}}return e}}var Ut;!function(e){e.ShadowAncestors="shadow-ancestors",e.ComposedAncestors="composed-ancestors",e.ShadowDescendantsRootFirst="shadow-descendants-root-first",e.ShadowDescendantsRootLast="shadow-descendants-root-last",e.ComposedDescendantsRootFirst="composed-descendants-root-first",e.ComposedDescendantsRootLast="composed-descendants-root-last"}(Ut||(Ut={}));class Vt{constructor(e,t,n=et){if(!m(e)&&!_(e))throw new Error("Element iterators can only be used in elements or text nodes");if(this._$node=e,this._$nodeTypeLimit=n||et,"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 Vt(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 s;if(s=t?n.getComposedParent():n.parentNode,!s)break;n=s}}else{const n=this._$rootFirst,s=function*(o){if(!(n&&o instanceof e&&!1===(yield o))){if(m(o))if(t){const e=o.iterateComposedChild();for(let t=e.next();!t.done;t=e.next())yield*s(t.value)}else{const e=o.childNodes;for(let t=0;t<e.length;t+=1){const n=e[t];yield*s(n)}}n||o instanceof e&&(yield o)}};yield*s(this._$node)}}forEach(e){const t=this._$nodeTypeLimit,n=this._$composed;if(this._$isAncestor){let s=this._$node;for(;;){if(s instanceof t&&!1===e(s))return;let o;if(o=n?s.getComposedParent():s.parentNode,!o)break;s=o}}else{const s=this._$rootFirst,o=i=>{if(s&&i instanceof t&&!1===e(i))return!1;if(m(i)){let e=!1;const t=t=>!1!==o(t)||(e=!0,!1);if(n?i.forEachComposedChild(t):i.childNodes.every(t),e)return!1}return!(!s&&i instanceof t&&!1===e(i))};o(this._$node)}}}const Wt=(e,t)=>{const n=e.getBackendContext();n&&((e,t)=>{e.render((()=>{"function"==typeof t&&c("render",t,e,[null])}))})(n,t||null)};var Gt=Object.freeze({__proto__:null});const Ht=e=>le().defineBehavior(e),zt=e=>le().defineComponent(e);function qt(e,t){return Pt.create(e,t||null)}const Xt=ze.triggerEvent,Kt=ze.triggerExternalEvent;export{e as BackendMode,Ft as Behavior,jt as BehaviorBuilder,Z as ClassList,Pt as Component,Dt as ComponentDefinition,ie as ComponentSpace,P as CurrentWindowBackendContext,Pe as DataGroup,t as DeepCopyKind,et as Element,Vt as ElementIterator,Ut as ElementIteratorType,W as EmptyBackendContext,z as EmptyComposedBackendContext,ze as Event,je as EventBubbleStatus,Ve as EventMutLevel,Ge as EventPhase,l as FuncArr,Se as MutationObserver,ot as NativeNode,Ne as NormalizedPropertyType,Se as Observer,Ke as ParsedSelector,tt as RelationType,at as ShadowRoot,lt as SlotMode,Y as StyleScopeManager,Ye as StyleSegmentIndex,it as TextNode,ee as TraitBehavior,rt as VirtualNode,A as addGlobalErrorListener,T as addGlobalWarningListener,n as backend,s as composedBackend,qt as createElement,$e as dataPath,be as dataUtils,O as dispatchError,o as domlikeBackend,N as dumpElement,w as dumpElementToString,C as dumpSingleElementToString,le as getDefaultComponentSpace,i as globalOptions,Ce as mutationObserver,Ht as registerBehavior,zt as registerElement,M as removeGlobalErrorListener,D as removeGlobalWarningListener,c as safeCallback,At as template,Gt as templateEngine,Xt as triggerEvent,Kt as triggerExternalEvent,Wt as triggerRender,L as triggerWarning,J as typeUtils};
2
2
  //# sourceMappingURL=glass_easel.all.es.js.map