@telperion/elements 2.0.0 → 3.0.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.
- package/.build-manifest.json +12 -1
- package/README.md +46 -1
- package/details-set/details-set-element.cjs +5 -4
- package/details-set/details-set-element.cjs.map +1 -1
- package/details-set/details-set-element.js +5 -4
- package/details-set/details-set-element.js.map +1 -1
- package/details-set/index.d.cts +6 -6
- package/details-set/index.d.ts +6 -6
- package/fesm/elements.mjs +392 -5
- package/fesm/elements.mjs.map +1 -1
- package/iife/details-set/index.js +1 -1
- package/iife/details-set/index.js.map +1 -1
- package/iife/elements.js +15 -15
- package/iife/elements.js.map +1 -1
- package/iife/popover/index.js +35 -0
- package/iife/popover/index.js.map +1 -0
- package/index.cjs +5 -0
- package/index.cjs.map +1 -1
- package/index.d.cts +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/package.json +52 -7
- package/popover/index.cjs +11 -0
- package/popover/index.cjs.map +1 -0
- package/popover/index.d.cts +98 -0
- package/popover/index.d.ts +98 -0
- package/popover/index.js +2 -0
- package/popover/index.js.map +1 -0
- package/popover/popover-element.cjs +295 -0
- package/popover/popover-element.cjs.map +1 -0
- package/popover/popover-element.js +295 -0
- package/popover/popover-element.js.map +1 -0
- package/popover/position.cjs +103 -0
- package/popover/position.cjs.map +1 -0
- package/popover/position.js +100 -0
- package/popover/position.js.map +1 -0
package/iife/elements.js
CHANGED
|
@@ -4,29 +4,29 @@ var TelperionElements=function(t){"use strict";function e(t,e,r,n){var s,i=argum
|
|
|
4
4
|
* Copyright 2019 Google LLC
|
|
5
5
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
6
|
*/
|
|
7
|
-
const n=globalThis,s=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),o=new WeakMap;let a=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(s&&void 0===t){const r=void 0!==e&&1===e.length;r&&(t=o.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&o.set(e,t))}return t}toString(){return this.cssText}};const h=(t,...e)=>{const r=1===t.length?t[0]:e.reduce((e,r,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+t[n+1],t[0]);return new a(r,t,i)},l=s?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const r of t.cssRules)e+=r.cssText;return(t=>new a("string"==typeof t?t:t+"",void 0,i))(e)})(t):t,{is:c,defineProperty:d,getOwnPropertyDescriptor:u,getOwnPropertyNames:p,getOwnPropertySymbols:g,getPrototypeOf:f}=Object,v=globalThis,m=v.trustedTypes,y=m?m.emptyScript:"",b=v.reactiveElementPolyfillSupport,E=(t,e)=>t,$={toAttribute(t,e){switch(e){case Boolean:t=t?y:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=null!==t;break;case Number:r=null===t?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch(t){r=null}}return r}},
|
|
7
|
+
const n=globalThis,s=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),o=new WeakMap;let a=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(s&&void 0===t){const r=void 0!==e&&1===e.length;r&&(t=o.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&o.set(e,t))}return t}toString(){return this.cssText}};const h=(t,...e)=>{const r=1===t.length?t[0]:e.reduce((e,r,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+t[n+1],t[0]);return new a(r,t,i)},l=s?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const r of t.cssRules)e+=r.cssText;return(t=>new a("string"==typeof t?t:t+"",void 0,i))(e)})(t):t,{is:c,defineProperty:d,getOwnPropertyDescriptor:u,getOwnPropertyNames:p,getOwnPropertySymbols:g,getPrototypeOf:f}=Object,v=globalThis,m=v.trustedTypes,y=m?m.emptyScript:"",b=v.reactiveElementPolyfillSupport,E=(t,e)=>t,$={toAttribute(t,e){switch(e){case Boolean:t=t?y:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=null!==t;break;case Number:r=null===t?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch(t){r=null}}return r}},S=(t,e)=>!c(t,e),_={attribute:!0,type:String,converter:$,reflect:!1,useDefault:!1,hasChanged:S};
|
|
8
8
|
/**
|
|
9
9
|
* @license
|
|
10
10
|
* Copyright 2017 Google LLC
|
|
11
11
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
|
-
*/Symbol.metadata??=Symbol("metadata"),v.litPropertyMetadata??=new WeakMap;let
|
|
12
|
+
*/Symbol.metadata??=Symbol("metadata"),v.litPropertyMetadata??=new WeakMap;let C=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=_){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const r=Symbol(),n=this.getPropertyDescriptor(t,r,e);void 0!==n&&d(this.prototype,t,n)}}static getPropertyDescriptor(t,e,r){const{get:n,set:s}=u(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:n,set(e){const i=n?.call(this);s?.call(this,e),this.requestUpdate(t,i,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??_}static _$Ei(){if(this.hasOwnProperty(E("elementProperties")))return;const t=f(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(E("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(E("properties"))){const t=this.properties,e=[...p(t),...g(t)];for(const r of e)this.createProperty(r,t[r])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,r]of e)this.elementProperties.set(t,r)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const r=this._$Eu(t,e);void 0!==r&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const t of r)e.unshift(l(t))}else void 0!==t&&e.push(l(t));return e}static _$Eu(t,e){const r=e.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(s)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const r of e){const e=document.createElement("style"),s=n.litNonce;void 0!==s&&e.setAttribute("nonce",s),e.textContent=r.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$ET(t,e){const r=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,r);if(void 0!==n&&!0===r.reflect){const s=(void 0!==r.converter?.toAttribute?r.converter:$).toAttribute(e,r.type);this._$Em=t,null==s?this.removeAttribute(n):this.setAttribute(n,s),this._$Em=null}}_$AK(t,e){const r=this.constructor,n=r._$Eh.get(t);if(void 0!==n&&this._$Em!==n){const t=r.getPropertyOptions(n),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:$;this._$Em=n;const i=s.fromAttribute(e,t.type);this[n]=i??this._$Ej?.get(n)??i,this._$Em=null}}requestUpdate(t,e,r){if(void 0!==t){const n=this.constructor,s=this[t];if(r??=n.getPropertyOptions(t),!((r.hasChanged??S)(s,e)||r.useDefault&&r.reflect&&s===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,r))))return;this.C(t,e,r)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:r,reflect:n,wrapped:s},i){r&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??e??this[t]),!0!==s||void 0!==i)||(this._$AL.has(t)||(this.hasUpdated||r||(e=void 0),this._$AL.set(t,e)),!0===n&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,r]of t){const{wrapped:t}=r,n=this[e];!0!==t||this._$AL.has(e)||void 0===n||this.C(e,void 0,r,n)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}};C.elementStyles=[],C.shadowRootOptions={mode:"open"},C[E("elementProperties")]=new Map,C[E("finalized")]=new Map,b?.({ReactiveElement:C}),(v.reactiveElementVersions??=[]).push("2.1.1");
|
|
13
13
|
/**
|
|
14
14
|
* @license
|
|
15
15
|
* Copyright 2017 Google LLC
|
|
16
16
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
17
|
*/
|
|
18
|
-
const
|
|
18
|
+
const w=globalThis,A=w.trustedTypes,k=A?A.createPolicy("lit-html",{createHTML:t=>t}):void 0,O="$lit$",T=`lit$${Math.random().toFixed(9).slice(2)}$`,D="?"+T,R=`<${D}>`,x=document,P=()=>x.createComment(""),L=t=>null===t||"object"!=typeof t&&"function"!=typeof t,N=Array.isArray,M="[ \t\n\f\r]",U=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,I=/-->/g,H=/>/g,W=RegExp(`>|${M}(?:([^\\s"'>=/]+)(${M}*=${M}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),j=/'/g,z=/"/g,B=/^(?:script|style|textarea|title)$/i,V=(t=>(e,...r)=>({_$litType$:t,strings:e,values:r}))(1),q=Symbol.for("lit-noChange"),G=Symbol.for("lit-nothing"),Z=new WeakMap,J=x.createTreeWalker(x,129);function F(t,e){if(!N(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==k?k.createHTML(e):e}const Y=(t,e)=>{const r=t.length-1,n=[];let s,i=2===e?"<svg>":3===e?"<math>":"",o=U;for(let e=0;e<r;e++){const r=t[e];let a,h,l=-1,c=0;for(;c<r.length&&(o.lastIndex=c,h=o.exec(r),null!==h);)c=o.lastIndex,o===U?"!--"===h[1]?o=I:void 0!==h[1]?o=H:void 0!==h[2]?(B.test(h[2])&&(s=RegExp("</"+h[2],"g")),o=W):void 0!==h[3]&&(o=W):o===W?">"===h[0]?(o=s??U,l=-1):void 0===h[1]?l=-2:(l=o.lastIndex-h[2].length,a=h[1],o=void 0===h[3]?W:'"'===h[3]?z:j):o===z||o===j?o=W:o===I||o===H?o=U:(o=W,s=void 0);const d=o===W&&t[e+1].startsWith("/>")?" ":"";i+=o===U?r+R:l>=0?(n.push(a),r.slice(0,l)+O+r.slice(l)+T+d):r+T+(-2===l?e:d)}return[F(t,i+(t[r]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),n]};class K{constructor({strings:t,_$litType$:e},r){let n;this.parts=[];let s=0,i=0;const o=t.length-1,a=this.parts,[h,l]=Y(t,e);if(this.el=K.createElement(h,r),J.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=J.nextNode())&&a.length<o;){if(1===n.nodeType){if(n.hasAttributes())for(const t of n.getAttributeNames())if(t.endsWith(O)){const e=l[i++],r=n.getAttribute(t).split(T),o=/([.?@])?(.*)/.exec(e);a.push({type:1,index:s,name:o[2],strings:r,ctor:"."===o[1]?rt:"?"===o[1]?nt:"@"===o[1]?st:et}),n.removeAttribute(t)}else t.startsWith(T)&&(a.push({type:6,index:s}),n.removeAttribute(t));if(B.test(n.tagName)){const t=n.textContent.split(T),e=t.length-1;if(e>0){n.textContent=A?A.emptyScript:"";for(let r=0;r<e;r++)n.append(t[r],P()),J.nextNode(),a.push({type:2,index:++s});n.append(t[e],P())}}}else if(8===n.nodeType)if(n.data===D)a.push({type:2,index:s});else{let t=-1;for(;-1!==(t=n.data.indexOf(T,t+1));)a.push({type:7,index:s}),t+=T.length-1}s++}}static createElement(t,e){const r=x.createElement("template");return r.innerHTML=t,r}}function Q(t,e,r=t,n){if(e===q)return e;let s=void 0!==n?r._$Co?.[n]:r._$Cl;const i=L(e)?void 0:e._$litDirective$;return s?.constructor!==i&&(s?._$AO?.(!1),void 0===i?s=void 0:(s=new i(t),s._$AT(t,r,n)),void 0!==n?(r._$Co??=[])[n]=s:r._$Cl=s),void 0!==s&&(e=Q(t,s._$AS(t,e.values),s,n)),e}class X{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:r}=this._$AD,n=(t?.creationScope??x).importNode(e,!0);J.currentNode=n;let s=J.nextNode(),i=0,o=0,a=r[0];for(;void 0!==a;){if(i===a.index){let e;2===a.type?e=new tt(s,s.nextSibling,this,t):1===a.type?e=new a.ctor(s,a.name,a.strings,this,t):6===a.type&&(e=new it(s,this,t)),this._$AV.push(e),a=r[++o]}i!==a?.index&&(s=J.nextNode(),i++)}return J.currentNode=x,n}p(t){let e=0;for(const r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}}class tt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,r,n){this.type=2,this._$AH=G,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Q(this,t,e),L(t)?t===G||null==t||""===t?(this._$AH!==G&&this._$AR(),this._$AH=G):t!==this._$AH&&t!==q&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>N(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==G&&L(this._$AH)?this._$AA.nextSibling.data=t:this.T(x.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:r}=t,n="number"==typeof r?this._$AC(t):(void 0===r.el&&(r.el=K.createElement(F(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(e);else{const t=new X(n,this),r=t.u(this.options);t.p(e),this.T(r),this._$AH=t}}_$AC(t){let e=Z.get(t.strings);return void 0===e&&Z.set(t.strings,e=new K(t)),e}k(t){N(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,n=0;for(const s of t)n===e.length?e.push(r=new tt(this.O(P()),this.O(P()),this,this.options)):r=e[n],r._$AI(s),n++;n<e.length&&(this._$AR(r&&r._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class et{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,n,s){this.type=1,this._$AH=G,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=s,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=G}_$AI(t,e=this,r,n){const s=this.strings;let i=!1;if(void 0===s)t=Q(this,t,e,0),i=!L(t)||t!==this._$AH&&t!==q,i&&(this._$AH=t);else{const n=t;let o,a;for(t=s[0],o=0;o<s.length-1;o++)a=Q(this,n[r+o],e,o),a===q&&(a=this._$AH[o]),i||=!L(a)||a!==this._$AH[o],a===G?t=G:t!==G&&(t+=(a??"")+s[o+1]),this._$AH[o]=a}i&&!n&&this.j(t)}j(t){t===G?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class rt extends et{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===G?void 0:t}}class nt extends et{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==G)}}class st extends et{constructor(t,e,r,n,s){super(t,e,r,n,s),this.type=5}_$AI(t,e=this){if((t=Q(this,t,e,0)??G)===q)return;const r=this._$AH,n=t===G&&r!==G||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,s=t!==G&&(r===G||n);n&&this.element.removeEventListener(this.name,this,r),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class it{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){Q(this,t)}}const ot=w.litHtmlPolyfillSupport;ot?.(K,tt),(w.litHtmlVersions??=[]).push("3.3.1");const at=globalThis;
|
|
19
19
|
/**
|
|
20
20
|
* @license
|
|
21
21
|
* Copyright 2017 Google LLC
|
|
22
22
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
-
*/let ht=class extends
|
|
23
|
+
*/let ht=class extends C{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,r)=>{const n=r?.renderBefore??e;let s=n._$litPart$;if(void 0===s){const t=r?.renderBefore??null;n._$litPart$=s=new tt(e.insertBefore(P(),t),t,void 0,r??{})}return s._$AI(t),s})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return q}};ht._$litElement$=!0,ht.finalized=!0,at.litElementHydrateSupport?.({LitElement:ht});const lt=at.litElementPolyfillSupport;lt?.({LitElement:ht}),(at.litElementVersions??=[]).push("4.2.1");
|
|
24
24
|
/**
|
|
25
25
|
* @license
|
|
26
26
|
* Copyright 2017 Google LLC
|
|
27
27
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
28
|
*/
|
|
29
|
-
const ct=t=>(e,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)},dt={attribute:!0,type:String,converter:$,reflect:!1,hasChanged:
|
|
29
|
+
const ct=t=>(e,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)},dt={attribute:!0,type:String,converter:$,reflect:!1,hasChanged:S},ut=(t=dt,e,r)=>{const{kind:n,metadata:s}=r;let i=globalThis.litPropertyMetadata.get(s);if(void 0===i&&globalThis.litPropertyMetadata.set(s,i=new Map),"setter"===n&&((t=Object.create(t)).wrapped=!0),i.set(r.name,t),"accessor"===n){const{name:n}=r;return{set(r){const s=e.get.call(this);e.set.call(this,r),this.requestUpdate(n,s,t)},init(e){return void 0!==e&&this.C(n,void 0,t,e),e}}}if("setter"===n){const{name:n}=r;return function(r){const s=this[n];e.call(this,r),this.requestUpdate(n,s,t)}}throw Error("Unsupported decorator location: "+n)};
|
|
30
30
|
/**
|
|
31
31
|
* @license
|
|
32
32
|
* Copyright 2017 Google LLC
|
|
@@ -51,14 +51,14 @@ function bt(t,e){return Object.is(t,e)}
|
|
|
51
51
|
*
|
|
52
52
|
* Use of this source code is governed by an MIT-style license that can be
|
|
53
53
|
* found in the LICENSE file at https://angular.io/license
|
|
54
|
-
*/let Et=null,$t=!1,
|
|
54
|
+
*/let Et=null,$t=!1,St=1;const _t=Symbol("SIGNAL");function Ct(t){const e=Et;return Et=t,e}const wt={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function At(t){if($t)throw new Error("undefined"!=typeof ngDevMode&&ngDevMode?"Assertion error: signal read during notification phase":"");if(null===Et)return;Et.consumerOnSignalRead(t);const e=Et.nextProducerIndex++;if(Pt(Et),e<Et.producerNode.length&&Et.producerNode[e]!==t&&xt(Et)){Rt(Et.producerNode[e],Et.producerIndexOfThis[e])}Et.producerNode[e]!==t&&(Et.producerNode[e]=t,Et.producerIndexOfThis[e]=xt(Et)?Dt(t,Et,e):0),Et.producerLastReadVersion[e]=t.version}function kt(t){if(t.dirty||t.lastCleanEpoch!==St){if(!t.producerMustRecompute(t)&&!function(t){Pt(t);for(let e=0;e<t.producerNode.length;e++){const r=t.producerNode[e],n=t.producerLastReadVersion[e];if(n!==r.version)return!0;if(kt(r),n!==r.version)return!0}return!1}(t))return t.dirty=!1,void(t.lastCleanEpoch=St);t.producerRecomputeValue(t),t.dirty=!1,t.lastCleanEpoch=St}}function Ot(t){if(void 0===t.liveConsumerNode)return;const e=$t;$t=!0;try{for(const e of t.liveConsumerNode)e.dirty||Tt(e)}finally{$t=e}}function Tt(t){var e;t.dirty=!0,Ot(t),null==(e=t.consumerMarkedDirty)||e.call(t.wrapper??t)}function Dt(t,e,r){var n;if(Lt(t),Pt(t),0===t.liveConsumerNode.length){null==(n=t.watched)||n.call(t.wrapper);for(let e=0;e<t.producerNode.length;e++)t.producerIndexOfThis[e]=Dt(t.producerNode[e],t,e)}return t.liveConsumerIndexOfThis.push(r),t.liveConsumerNode.push(e)-1}function Rt(t,e){var r;if(Lt(t),Pt(t),"undefined"!=typeof ngDevMode&&ngDevMode&&e>=t.liveConsumerNode.length)throw new Error(`Assertion error: active consumer index ${e} is out of bounds of ${t.liveConsumerNode.length} consumers)`);if(1===t.liveConsumerNode.length){null==(r=t.unwatched)||r.call(t.wrapper);for(let e=0;e<t.producerNode.length;e++)Rt(t.producerNode[e],t.producerIndexOfThis[e])}const n=t.liveConsumerNode.length-1;if(t.liveConsumerNode[e]=t.liveConsumerNode[n],t.liveConsumerIndexOfThis[e]=t.liveConsumerIndexOfThis[n],t.liveConsumerNode.length--,t.liveConsumerIndexOfThis.length--,e<t.liveConsumerNode.length){const r=t.liveConsumerIndexOfThis[e],n=t.liveConsumerNode[e];Pt(n),n.producerIndexOfThis[r]=e}}function xt(t){var e;return t.consumerIsAlwaysLive||((null==(e=null==t?void 0:t.liveConsumerNode)?void 0:e.length)??0)>0}function Pt(t){t.producerNode??(t.producerNode=[]),t.producerIndexOfThis??(t.producerIndexOfThis=[]),t.producerLastReadVersion??(t.producerLastReadVersion=[])}function Lt(t){t.liveConsumerNode??(t.liveConsumerNode=[]),t.liveConsumerIndexOfThis??(t.liveConsumerIndexOfThis=[])}
|
|
55
55
|
/**
|
|
56
56
|
* @license
|
|
57
57
|
* Copyright Google LLC All Rights Reserved.
|
|
58
58
|
*
|
|
59
59
|
* Use of this source code is governed by an MIT-style license that can be
|
|
60
60
|
* found in the LICENSE file at https://angular.io/license
|
|
61
|
-
*/function
|
|
61
|
+
*/function Nt(t){if(kt(t),At(t),t.value===It)throw t.error;return t.value}const Mt=Symbol("UNSET"),Ut=Symbol("COMPUTING"),It=Symbol("ERRORED"),Ht=(()=>({...wt,value:Mt,dirty:!0,error:null,equal:bt,producerMustRecompute:t=>t.value===Mt||t.value===Ut,producerRecomputeValue(t){if(t.value===Ut)throw new Error("Detected cycle in computations.");const e=t.value;t.value=Ut;const r=function(t){return t&&(t.nextProducerIndex=0),Ct(t)}(t);let n,s=!1;try{n=t.computation.call(t.wrapper);s=e!==Mt&&e!==It&&t.equal.call(t.wrapper,e,n)}catch(e){n=It,t.error=e}finally{!function(t,e){if(Ct(e),t&&void 0!==t.producerNode&&void 0!==t.producerIndexOfThis&&void 0!==t.producerLastReadVersion){if(xt(t))for(let e=t.nextProducerIndex;e<t.producerNode.length;e++)Rt(t.producerNode[e],t.producerIndexOfThis[e]);for(;t.producerNode.length>t.nextProducerIndex;)t.producerNode.pop(),t.producerLastReadVersion.pop(),t.producerIndexOfThis.pop()}}(t,r)}s?t.value=e:(t.value=n,t.version++)}}))();let Wt=
|
|
62
62
|
/**
|
|
63
63
|
* @license
|
|
64
64
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -66,7 +66,7 @@ function bt(t,e){return Object.is(t,e)}
|
|
|
66
66
|
* Use of this source code is governed by an MIT-style license that can be
|
|
67
67
|
* found in the LICENSE file at https://angular.io/license
|
|
68
68
|
*/
|
|
69
|
-
function(){throw new Error};function jt(){return At(this),this.value}function zt(t,e){!1===(null==Et?void 0:Et.consumerAllowSignalWrites)&&
|
|
69
|
+
function(){throw new Error};function jt(){return At(this),this.value}function zt(t,e){!1===(null==Et?void 0:Et.consumerAllowSignalWrites)&&Wt(),t.equal.call(t.wrapper,t.value,e)||(t.value=e,function(t){t.version++,St++,Ot(t)}
|
|
70
70
|
/**
|
|
71
71
|
* @license
|
|
72
72
|
* Copyright 2024 Bloomberg Finance L.P.
|
|
@@ -82,7 +82,7 @@ function(){throw new Error};function jt(){return At(this),this.value}function zt
|
|
|
82
82
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
83
83
|
* See the License for the specific language governing permissions and
|
|
84
84
|
* limitations under the License.
|
|
85
|
-
*/(t))}const
|
|
85
|
+
*/(t))}const Bt=(()=>({...wt,equal:bt,value:void 0}))();const Vt=Symbol("node");var qt;(t=>{var e,r,n,s;e=Vt,r=new WeakSet,t.isState=t=>"object"==typeof t&&vt(r,t),t.State=class{constructor(n,s={}){mt(this,r),ft(this,e);const i=
|
|
86
86
|
/**
|
|
87
87
|
* @license
|
|
88
88
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -90,7 +90,7 @@ function(){throw new Error};function jt(){return At(this),this.value}function zt
|
|
|
90
90
|
* Use of this source code is governed by an MIT-style license that can be
|
|
91
91
|
* found in the LICENSE file at https://angular.io/license
|
|
92
92
|
*/
|
|
93
|
-
function(t){const e=Object.create(
|
|
93
|
+
function(t){const e=Object.create(Bt);e.value=t;const r=()=>(At(e),e.value);return r[_t]=e,r}(n),o=i[_t];if(this[Vt]=o,o.wrapper=this,s){const e=s.equals;e&&(o.equal=e),o.watched=s[t.subtle.watched],o.unwatched=s[t.subtle.unwatched]}}get(){if(!(0,t.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.get");return jt.call(this[Vt])}set(e){if(!(0,t.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.set");if($t)throw new Error("Writes to signals not permitted during Watcher callback");zt(this[Vt],e)}};n=Vt,s=new WeakSet,t.isComputed=t=>"object"==typeof t&&vt(s,t),t.Computed=class{constructor(e,r){mt(this,s),ft(this,n);const i=function(t){const e=Object.create(Ht);e.computation=t;const r=()=>Nt(e);return r[_t]=e,r}(e),o=i[_t];if(o.consumerAllowSignalWrites=!0,this[Vt]=o,o.wrapper=this,r){const e=r.equals;e&&(o.equal=e),o.watched=r[t.subtle.watched],o.unwatched=r[t.subtle.unwatched]}}get(){if(!(0,t.isComputed)(this))throw new TypeError("Wrong receiver type for Signal.Computed.prototype.get");return Nt(this[Vt])}},(e=>{var r,n,s,i;e.untrack=function(t){let e,r=null;try{r=Ct(null),e=t()}finally{Ct(r)}return e},e.introspectSources=function(e){var r;if(!(0,t.isComputed)(e)&&!(0,t.isWatcher)(e))throw new TypeError("Called introspectSources without a Computed or Watcher argument");return(null==(r=e[Vt].producerNode)?void 0:r.map(t=>t.wrapper))??[]},e.introspectSinks=function(e){var r;if(!(0,t.isComputed)(e)&&!(0,t.isState)(e))throw new TypeError("Called introspectSinks without a Signal argument");return(null==(r=e[Vt].liveConsumerNode)?void 0:r.map(t=>t.wrapper))??[]},e.hasSinks=function(e){if(!(0,t.isComputed)(e)&&!(0,t.isState)(e))throw new TypeError("Called hasSinks without a Signal argument");const r=e[Vt].liveConsumerNode;return!!r&&r.length>0},e.hasSources=function(e){if(!(0,t.isComputed)(e)&&!(0,t.isWatcher)(e))throw new TypeError("Called hasSources without a Computed or Watcher argument");const r=e[Vt].producerNode;return!!r&&r.length>0};r=Vt,n=new WeakSet,s=new WeakSet,i=function(e){for(const r of e)if(!(0,t.isComputed)(r)&&!(0,t.isState)(r))throw new TypeError("Called watch/unwatch without a Computed or State argument")},t.isWatcher=t=>vt(n,t),e.Watcher=class{constructor(t){mt(this,n),mt(this,s),ft(this,r);let e=Object.create(wt);e.wrapper=this,e.consumerMarkedDirty=t,e.consumerIsAlwaysLive=!0,e.consumerAllowSignalWrites=!1,e.producerNode=[],this[Vt]=e}watch(...e){if(!(0,t.isWatcher)(this))throw new TypeError("Called unwatch without Watcher receiver");yt(this,s,i).call(this,e);const r=this[Vt];r.dirty=!1;const n=Ct(r);for(const t of e)At(t[Vt]);Ct(n)}unwatch(...e){if(!(0,t.isWatcher)(this))throw new TypeError("Called unwatch without Watcher receiver");yt(this,s,i).call(this,e);const r=this[Vt];Pt(r);for(let t=r.producerNode.length-1;t>=0;t--)if(e.includes(r.producerNode[t].wrapper)){Rt(r.producerNode[t],r.producerIndexOfThis[t]);const e=r.producerNode.length-1;if(r.producerNode[t]=r.producerNode[e],r.producerIndexOfThis[t]=r.producerIndexOfThis[e],r.producerNode.length--,r.producerIndexOfThis.length--,r.nextProducerIndex--,t<r.producerNode.length){const e=r.producerIndexOfThis[t],n=r.producerNode[t];Lt(n),n.liveConsumerIndexOfThis[e]=t}}}getPending(){if(!(0,t.isWatcher)(this))throw new TypeError("Called getPending without Watcher receiver");return this[Vt].producerNode.filter(t=>t.dirty).map(t=>t.wrapper)}},e.currentComputed=function(){var t;return null==(t=Et)?void 0:t.wrapper},e.watched=Symbol("watched"),e.unwatched=Symbol("unwatched")})(t.subtle||(t.subtle={}))})(qt||(qt={}));
|
|
94
94
|
/**
|
|
95
95
|
* @license
|
|
96
96
|
* Copyright 2023 Google LLC
|
|
@@ -117,7 +117,7 @@ const Kt=2;let Qt=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,
|
|
|
117
117
|
* @license
|
|
118
118
|
* Copyright 2023 Google LLC
|
|
119
119
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
120
|
-
*/let oe=!1;const ae=new qt.subtle.Watcher(async()=>{oe||(oe=!0,queueMicrotask(()=>{oe=!1;for(const t of ae.getPending())t.get();ae.watch()}))});const he=(t=>(...e)=>({_$litDirective$:t,values:e}))(class extends ie{_$S_(){var t,e;void 0===this._$Sm&&(this._$Sj=new qt.Computed(()=>{var t;const e=null===(t=this._$SW)||void 0===t?void 0:t.get();return this.setValue(e),e}),this._$Sm=null!==(e=null===(t=this._$Sk)||void 0===t?void 0:t.h)&&void 0!==e?e:ae,this._$Sm.watch(this._$Sj),qt.subtle.untrack(()=>{var t;return null===(t=this._$Sj)||void 0===t?void 0:t.get()}))}_$Sp(){void 0!==this._$Sm&&(this._$Sm.unwatch(this._$SW),this._$Sm=void 0)}render(t){return qt.subtle.untrack(()=>t.get())}update(t,[e]){var r,n;return null!==(r=this._$Sk)&&void 0!==r||(this._$Sk=null===(n=t.options)||void 0===n?void 0:n.host),e!==this._$SW&&void 0!==this._$SW&&this._$Sp(),this._$SW=e,this._$S_(),qt.subtle.untrack(()=>this._$SW.get())}disconnected(){this._$Sp()}reconnected(){this._$S_()}}),le=(t=>(e,...r)=>t(e,...r.map(t=>t instanceof qt.State||t instanceof qt.Computed?he(t):t)))(
|
|
120
|
+
*/let oe=!1;const ae=new qt.subtle.Watcher(async()=>{oe||(oe=!0,queueMicrotask(()=>{oe=!1;for(const t of ae.getPending())t.get();ae.watch()}))});const he=(t=>(...e)=>({_$litDirective$:t,values:e}))(class extends ie{_$S_(){var t,e;void 0===this._$Sm&&(this._$Sj=new qt.Computed(()=>{var t;const e=null===(t=this._$SW)||void 0===t?void 0:t.get();return this.setValue(e),e}),this._$Sm=null!==(e=null===(t=this._$Sk)||void 0===t?void 0:t.h)&&void 0!==e?e:ae,this._$Sm.watch(this._$Sj),qt.subtle.untrack(()=>{var t;return null===(t=this._$Sj)||void 0===t?void 0:t.get()}))}_$Sp(){void 0!==this._$Sm&&(this._$Sm.unwatch(this._$SW),this._$Sm=void 0)}render(t){return qt.subtle.untrack(()=>t.get())}update(t,[e]){var r,n;return null!==(r=this._$Sk)&&void 0!==r||(this._$Sk=null===(n=t.options)||void 0===n?void 0:n.host),e!==this._$SW&&void 0!==this._$SW&&this._$Sp(),this._$SW=e,this._$S_(),qt.subtle.untrack(()=>this._$SW.get())}disconnected(){this._$Sp()}reconnected(){this._$S_()}}),le=(t=>(e,...r)=>t(e,...r.map(t=>t instanceof qt.State||t instanceof qt.Computed?he(t):t)))(V);
|
|
121
121
|
/**
|
|
122
122
|
* @license
|
|
123
123
|
* Copyright 2023 Google LLC
|
|
@@ -128,17 +128,17 @@ const Kt=2;let Qt=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,
|
|
|
128
128
|
* Copyright 2023 Google LLC
|
|
129
129
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
130
130
|
*/
|
|
131
|
-
qt.State,qt.Computed;const ce=(t,e)=>new qt.State(t,e),de=(t,e)=>new qt.Computed(t,e);var ue,pe;const ge=Symbol("ThaRoute:fragment"),fe=Symbol("ThaRoute:path-pattern");function ve(){}t.ThaRoute=class extends ht{constructor(){super(...arguments),this[ue]=ce(this.#t()),this[pe]=null,this.path=null,this.#e=new MutationObserver(()=>{this[ge].set(this.#t())})}static{ue=ge,pe=fe}#e;connectedCallback(){super.connectedCallback(),this.#e.observe(this,{childList:!0})}attributeChangedCallback(t,e,r){if(super.attributeChangedCallback(t,e,r),"path"===t)this[fe]=r?new URLPattern({pathname:r}):null}#t(){const t=this.querySelector("template");return t?new WeakRef(t.content):null}disconnectedCallback(){super.disconnectedCallback(),this.#e.disconnect()}},e([pt({type:String}),r("design:type",Object)],t.ThaRoute.prototype,"path",void 0),t.ThaRoute=e([ct("tha-route")],t.ThaRoute);const me=function(t){return!0===t[Jt]?(console.warn("SignalWatcher should not be applied to the same class more than once."),t):class extends t{constructor(){super(...arguments),this._$St=new Map,this._$So=new qt.State(0),this._$Si=!1}_$Sl(){var t,e;const r=[],n=[];this._$St.forEach((t,e)=>{((null==t?void 0:t.beforeUpdate)?r:n).push(e)});const s=null===(t=this.h)||void 0===t?void 0:t.getPending().filter(t=>t!==this._$Su&&!this._$St.has(t));r.forEach(t=>t.get()),null===(e=this._$Su)||void 0===e||e.get(),s.forEach(t=>t.get()),n.forEach(t=>t.get())}_$Sv(){this.isUpdatePending||queueMicrotask(()=>{this.isUpdatePending||this._$Sl()})}_$S_(){if(void 0!==this.h)return;this._$Su=new qt.Computed(()=>{this._$So.get(),super.performUpdate()});const t=this.h=new qt.subtle.Watcher(function(){const t=Yt.get(this);void 0!==t&&(!1===t._$Si&&(new Set(this.getPending()).has(t._$Su)?t.requestUpdate():t._$Sv()),this.watch())});Yt.set(t,this),Ft.register(this,t),t.watch(this._$Su),t.watch(...Array.from(this._$St).map(([t])=>t))}_$Sp(){if(void 0===this.h)return;let t=!1;this.h.unwatch(...qt.subtle.introspectSources(this.h).filter(e=>{var r;const n=!0!==(null===(r=this._$St.get(e))||void 0===r?void 0:r.manualDispose);return n&&this._$St.delete(e),t||(t=!n),n})),t||(this._$Su=void 0,this.h=void 0,this._$St.clear())}updateEffect(t,e){var r;this._$S_();const n=new qt.Computed(()=>{t()});return this.h.watch(n),this._$St.set(n,e),null!==(r=null==e?void 0:e.beforeUpdate)&&void 0!==r&&r?qt.subtle.untrack(()=>n.get()):this.updateComplete.then(()=>qt.subtle.untrack(()=>n.get())),()=>{this._$St.delete(n),this.h.unwatch(n),!1===this.isConnected&&this._$Sp()}}performUpdate(){this.isUpdatePending&&(this._$S_(),this._$Si=!0,this._$So.set(this._$So.get()+1),this._$Si=!1,this._$Sl())}connectedCallback(){super.connectedCallback(),this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),queueMicrotask(()=>{!1===this.isConnected&&this._$Sp()})}}}(ht);function ye(){return ye=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ye.apply(null,arguments)}var be;!function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"}(be||(be={}));var Ee="production"!==process.env.NODE_ENV?function(t){return Object.freeze(t)}:function(t){return t};function $e(t,e){if(!t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}}var _e="beforeunload",Se="popstate";function we(t){void 0===t&&(t={});var e=t.window,r=void 0===e?document.defaultView:e,n=r.history;function s(){var t=De(r.location.hash.substr(1)),e=t.pathname,s=void 0===e?"/":e,i=t.search,o=void 0===i?"":i,a=t.hash,h=void 0===a?"":a,l=n.state||{};return[l.idx,Ee({pathname:s,search:o,hash:h,state:l.usr||null,key:l.key||"default"})]}var i=null;function o(){if(i)u.call(i),i=null;else{var t=be.Pop,e=s(),r=e[0],n=e[1];if(u.length)if(null!=r){var o=l-r;o&&(i={action:t,location:n,retry:function(){y(-1*o)}},y(o))}else"production"!==process.env.NODE_ENV&&$e(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");else m(t)}}r.addEventListener(Se,o),r.addEventListener("hashchange",function(){Te(s()[1])!==Te(c)&&o()});var a=be.Pop,h=s(),l=h[0],c=h[1],d=Oe(),u=Oe();function p(t){return function(){var t=document.querySelector("base"),e="";if(t&&t.getAttribute("href")){var n=r.location.href,s=n.indexOf("#");e=-1===s?n:n.slice(0,s)}return e}()+"#"+("string"==typeof t?t:Te(t))}function g(t,e){return void 0===e&&(e=null),Ee(ye({pathname:c.pathname,hash:"",search:""},"string"==typeof t?De(t):t,{state:e,key:ke()}))}function f(t,e){return[{usr:t.state,key:t.key,idx:e},p(t)]}function v(t,e,r){return!u.length||(u.call({action:t,location:e,retry:r}),!1)}function m(t){a=t;var e=s();l=e[0],c=e[1],d.call({action:a,location:c})}function y(t){n.go(t)}null==l&&(l=0,n.replaceState(ye({},n.state,{idx:l}),""));var b={get action(){return a},get location(){return c},createHref:p,push:function t(e,s){var i=be.Push,o=g(e,s);if("production"!==process.env.NODE_ENV&&$e("/"===o.pathname.charAt(0),"Relative pathnames are not supported in hash history.push("+JSON.stringify(e)+")"),v(i,o,function(){t(e,s)})){var a=f(o,l+1),h=a[0],c=a[1];try{n.pushState(h,"",c)}catch(t){r.location.assign(c)}m(i)}},replace:function t(e,r){var s=be.Replace,i=g(e,r);if("production"!==process.env.NODE_ENV&&$e("/"===i.pathname.charAt(0),"Relative pathnames are not supported in hash history.replace("+JSON.stringify(e)+")"),v(s,i,function(){t(e,r)})){var o=f(i,l),a=o[0],h=o[1];n.replaceState(a,"",h),m(s)}},go:y,back:function(){y(-1)},forward:function(){y(1)},listen:function(t){return d.push(t)},block:function(t){var e=u.push(t);return 1===u.length&&r.addEventListener(_e,Ae),function(){e(),u.length||r.removeEventListener(_e,Ae)}}};return b}function Ce(t,e,r){return Math.min(Math.max(t,e),r)}function Ae(t){t.preventDefault(),t.returnValue=""}function Oe(){var t=[];return{get length(){return t.length},push:function(e){return t.push(e),function(){t=t.filter(function(t){return t!==e})}},call:function(e){t.forEach(function(t){return t&&t(e)})}}}function ke(){return Math.random().toString(36).substr(2,8)}function Te(t){var e=t.pathname,r=void 0===e?"/":e,n=t.search,s=void 0===n?"":n,i=t.hash,o=void 0===i?"":i;return s&&"?"!==s&&(r+="?"===s.charAt(0)?s:"?"+s),o&&"#"!==o&&(r+="#"===o.charAt(0)?o:"#"+o),r}function De(t){var e={};if(t){var r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));var n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}const Re={},xe=ce("browser");function Ne(t){let e=Re[t];if(!e){switch(t){case"browser":e=function(t){void 0===t&&(t={});var e=t.window,r=void 0===e?document.defaultView:e,n=r.history;function s(){var t=r.location,e=t.pathname,s=t.search,i=t.hash,o=n.state||{};return[o.idx,Ee({pathname:e,search:s,hash:i,state:o.usr||null,key:o.key||"default"})]}var i=null;r.addEventListener(Se,function(){if(i)d.call(i),i=null;else{var t=be.Pop,e=s(),r=e[0],n=e[1];if(d.length)if(null!=r){var o=h-r;o&&(i={action:t,location:n,retry:function(){m(-1*o)}},m(o))}else"production"!==process.env.NODE_ENV&&$e(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");else v(t)}});var o=be.Pop,a=s(),h=a[0],l=a[1],c=Oe(),d=Oe();function u(t){return"string"==typeof t?t:Te(t)}function p(t,e){return void 0===e&&(e=null),Ee(ye({pathname:l.pathname,hash:"",search:""},"string"==typeof t?De(t):t,{state:e,key:ke()}))}function g(t,e){return[{usr:t.state,key:t.key,idx:e},u(t)]}function f(t,e,r){return!d.length||(d.call({action:t,location:e,retry:r}),!1)}function v(t){o=t;var e=s();h=e[0],l=e[1],c.call({action:o,location:l})}function m(t){n.go(t)}null==h&&(h=0,n.replaceState(ye({},n.state,{idx:h}),""));var y={get action(){return o},get location(){return l},createHref:u,push:function t(e,s){var i=be.Push,o=p(e,s);if(f(i,o,function(){t(e,s)})){var a=g(o,h+1),l=a[0],c=a[1];try{n.pushState(l,"",c)}catch(t){r.location.assign(c)}v(i)}},replace:function t(e,r){var s=be.Replace,i=p(e,r);if(f(s,i,function(){t(e,r)})){var o=g(i,h),a=o[0],l=o[1];n.replaceState(a,"",l),v(s)}},go:m,back:function(){m(-1)},forward:function(){m(1)},listen:function(t){return c.push(t)},block:function(t){var e=d.push(t);return 1===d.length&&r.addEventListener(_e,Ae),function(){e(),d.length||r.removeEventListener(_e,Ae)}}};return y}();break;case"hash":e=we();break;default:e=function(t){void 0===t&&(t={});var e=t,r=e.initialEntries,n=void 0===r?["/"]:r,s=e.initialIndex,i=n.map(function(t){var e=Ee(ye({pathname:"/",search:"",hash:"",state:null,key:ke()},"string"==typeof t?De(t):t));return"production"!==process.env.NODE_ENV&&$e("/"===e.pathname.charAt(0),"Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: "+JSON.stringify(t)+")"),e}),o=Ce(null==s?i.length-1:s,0,i.length-1),a=be.Pop,h=i[o],l=Oe(),c=Oe();function d(t,e){return void 0===e&&(e=null),Ee(ye({pathname:h.pathname,search:"",hash:""},"string"==typeof t?De(t):t,{state:e,key:ke()}))}function u(t,e,r){return!c.length||(c.call({action:t,location:e,retry:r}),!1)}function p(t,e){a=t,h=e,l.call({action:a,location:h})}function g(t){var e=Ce(o+t,0,i.length-1),r=be.Pop,n=i[e];u(r,n,function(){g(t)})&&(o=e,p(r,n))}var f={get index(){return o},get action(){return a},get location(){return h},createHref:function(t){return"string"==typeof t?t:Te(t)},push:function t(e,r){var n=be.Push,s=d(e,r);"production"!==process.env.NODE_ENV&&$e("/"===h.pathname.charAt(0),"Relative pathnames are not supported in memory history.push("+JSON.stringify(e)+")"),u(n,s,function(){t(e,r)})&&(o+=1,i.splice(o,i.length,s),p(n,s))},replace:function t(e,r){var n=be.Replace,s=d(e,r);"production"!==process.env.NODE_ENV&&$e("/"===h.pathname.charAt(0),"Relative pathnames are not supported in memory history.replace("+JSON.stringify(e)+")"),u(n,s,function(){t(e,r)})&&(i[o]=s,p(n,s))},go:g,back:function(){g(-1)},forward:function(){g(1)},listen:function(t){return l.push(t)},block:function(t){return c.push(t)}};return f}()}Re[t]=e}return e}de(()=>Ne(xe.get()));const Pe=Symbol("HistoryManaged:history"),Le=Symbol("HistoryManaged:historyType"),Me=t=>{var n,s;class i extends t{constructor(){super(...arguments),this.history=void 0,this.#r=ce(this.history),this.#n=de(()=>{const t=this.closest("tha-router-config, tha-router-outlet");return t?.[Le]?.get()}),this[n]=de(()=>this.#r.get()??this.#n.get()??xe.get()),this[s]=de(()=>Ne(this[Le].get()))}static{n=Le,s=Pe}#r;#n;attributeChangedCallback(t,e,r){if(super.attributeChangedCallback(t,e,r),"history"===t)this.#r.set(r)}}return e([pt({type:String}),r("design:type",Object)],i.prototype,"history",void 0),i};function Ue(t=ve){return new Promise((e,r)=>{setTimeout(()=>{try{const r=t();e(r)}catch(t){r(t)}},0)})}var He;const We=Symbol("ThaRouterOutlet:renderRoute"),Ie=Symbol("ThaRouterOutlet:params");function je(t){return!!t}function ze(t){return t.filter(je)}t.ThaRouterOutlet=class extends me{constructor(){super(...arguments),this.#s=ce(void 0),this.#i=ce(null),this.#o=de(()=>this.#i.get()?.deref()?.[ge].get()??null),this.#a=de(()=>{const t=this.#s.get()?.deref(),e=this.#i.get()?.deref(),r=e?.[fe];if(!t||!r)return null;const{location:{pathname:n}}=t[Pe].get();return r.exec(n,"http://dummy.base")?.pathname.groups??null}),this[He]=de(()=>{const t=this.#a.get()??{},e=this.parentElement?.closest("tha-router-outlet"),r=e?.[Ie].get()??{};return Object.freeze({...r,...t})}),this.params={},this.#h=ve,this.#l=ve,this.#c=ve,this.for=null,this.routePath=null,this.routeID=void 0}#s;#i;#o;#a;#h;#l;#c;connectedCallback(){super.connectedCallback(),Ue(()=>{this.bindToRouter()}),this.#h=this.updateEffect(()=>{Array.from(this.renderRoot.children).forEach(t=>t.remove());const t=this.#o.get()?.deref()??null;t&&this.renderRoot.appendChild(t.cloneNode(!0))}),this.#l=this.updateEffect(()=>{const t=this.#i.get()?.deref()??null;this.routePath=t?.getAttribute("path")??null,this.routeID=t?.id?t?.id:void 0}),this.#c=this.updateEffect(()=>{const t=this[Ie].get();Array.from(this.attributes).filter(t=>t.name.startsWith("param-")).filter(e=>!(e.name.slice(6)in t)).forEach(t=>{this.removeAttribute(t.name)});for(const[e,r]of Object.entries(t))this.setAttribute(`param-${e}`,r??"");this.params=t})}bindToRouter(t){if(!t)if(this.for){t=this.getRootNode().querySelector(`tha-router#${this.for}`)??void 0}else t=this.closest("tha-router")??void 0;const e=this.#s?.get()?.deref()??null;return e===t?e:(e?.assignOutlet(null),t?.assignOutlet(this),this.#s.set(t?new WeakRef(t):void 0),t??null)}[(He=Ie,We)](t){this.#i.set(t?new WeakRef(t):null)}disconnectedCallback(){super.disconnectedCallback(),this.#s?.get()?.deref()?.assignOutlet(null);try{this.#h(),this.#l(),this.#c()}catch{}}createRenderRoot(){return this}},e([function(t){return pt({...t,state:!0,attribute:!1})}(),r("design:type",Object)],t.ThaRouterOutlet.prototype,"params",void 0),e([pt({type:String}),r("design:type",Object)],t.ThaRouterOutlet.prototype,"for",void 0),e([pt({type:String,reflect:!0}),r("design:type",Object)],t.ThaRouterOutlet.prototype,"routePath",void 0),e([pt({type:String,reflect:!0}),r("design:type",Object)],t.ThaRouterOutlet.prototype,"routeID",void 0),t.ThaRouterOutlet=e([ct("tha-router-outlet")],t.ThaRouterOutlet),t.ThaRouter=class extends(Me(me)){static{const t=document.createElement("style");t.setAttribute("type","text/css"),t.setAttribute("data-id","tha-router-styles"),t.textContent=h`
|
|
131
|
+
qt.State,qt.Computed;const ce=(t,e)=>new qt.State(t,e),de=(t,e)=>new qt.Computed(t,e);var ue,pe;const ge=Symbol("ThaRoute:fragment"),fe=Symbol("ThaRoute:path-pattern");function ve(){}t.ThaRoute=class extends ht{constructor(){super(...arguments),this[ue]=ce(this.#t()),this[pe]=null,this.path=null,this.#e=new MutationObserver(()=>{this[ge].set(this.#t())})}static{ue=ge,pe=fe}#e;connectedCallback(){super.connectedCallback(),this.#e.observe(this,{childList:!0})}attributeChangedCallback(t,e,r){if(super.attributeChangedCallback(t,e,r),"path"===t)this[fe]=r?new URLPattern({pathname:r}):null}#t(){const t=this.querySelector("template");return t?new WeakRef(t.content):null}disconnectedCallback(){super.disconnectedCallback(),this.#e.disconnect()}},e([pt({type:String}),r("design:type",Object)],t.ThaRoute.prototype,"path",void 0),t.ThaRoute=e([ct("tha-route")],t.ThaRoute);const me=function(t){return!0===t[Jt]?(console.warn("SignalWatcher should not be applied to the same class more than once."),t):class extends t{constructor(){super(...arguments),this._$St=new Map,this._$So=new qt.State(0),this._$Si=!1}_$Sl(){var t,e;const r=[],n=[];this._$St.forEach((t,e)=>{((null==t?void 0:t.beforeUpdate)?r:n).push(e)});const s=null===(t=this.h)||void 0===t?void 0:t.getPending().filter(t=>t!==this._$Su&&!this._$St.has(t));r.forEach(t=>t.get()),null===(e=this._$Su)||void 0===e||e.get(),s.forEach(t=>t.get()),n.forEach(t=>t.get())}_$Sv(){this.isUpdatePending||queueMicrotask(()=>{this.isUpdatePending||this._$Sl()})}_$S_(){if(void 0!==this.h)return;this._$Su=new qt.Computed(()=>{this._$So.get(),super.performUpdate()});const t=this.h=new qt.subtle.Watcher(function(){const t=Yt.get(this);void 0!==t&&(!1===t._$Si&&(new Set(this.getPending()).has(t._$Su)?t.requestUpdate():t._$Sv()),this.watch())});Yt.set(t,this),Ft.register(this,t),t.watch(this._$Su),t.watch(...Array.from(this._$St).map(([t])=>t))}_$Sp(){if(void 0===this.h)return;let t=!1;this.h.unwatch(...qt.subtle.introspectSources(this.h).filter(e=>{var r;const n=!0!==(null===(r=this._$St.get(e))||void 0===r?void 0:r.manualDispose);return n&&this._$St.delete(e),t||(t=!n),n})),t||(this._$Su=void 0,this.h=void 0,this._$St.clear())}updateEffect(t,e){var r;this._$S_();const n=new qt.Computed(()=>{t()});return this.h.watch(n),this._$St.set(n,e),null!==(r=null==e?void 0:e.beforeUpdate)&&void 0!==r&&r?qt.subtle.untrack(()=>n.get()):this.updateComplete.then(()=>qt.subtle.untrack(()=>n.get())),()=>{this._$St.delete(n),this.h.unwatch(n),!1===this.isConnected&&this._$Sp()}}performUpdate(){this.isUpdatePending&&(this._$S_(),this._$Si=!0,this._$So.set(this._$So.get()+1),this._$Si=!1,this._$Sl())}connectedCallback(){super.connectedCallback(),this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),queueMicrotask(()=>{!1===this.isConnected&&this._$Sp()})}}}(ht);function ye(){return ye=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ye.apply(null,arguments)}var be;!function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"}(be||(be={}));var Ee="production"!==process.env.NODE_ENV?function(t){return Object.freeze(t)}:function(t){return t};function $e(t,e){if(!t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}}var Se="beforeunload",_e="popstate";function Ce(t){void 0===t&&(t={});var e=t.window,r=void 0===e?document.defaultView:e,n=r.history;function s(){var t=De(r.location.hash.substr(1)),e=t.pathname,s=void 0===e?"/":e,i=t.search,o=void 0===i?"":i,a=t.hash,h=void 0===a?"":a,l=n.state||{};return[l.idx,Ee({pathname:s,search:o,hash:h,state:l.usr||null,key:l.key||"default"})]}var i=null;function o(){if(i)u.call(i),i=null;else{var t=be.Pop,e=s(),r=e[0],n=e[1];if(u.length)if(null!=r){var o=l-r;o&&(i={action:t,location:n,retry:function(){y(-1*o)}},y(o))}else"production"!==process.env.NODE_ENV&&$e(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");else m(t)}}r.addEventListener(_e,o),r.addEventListener("hashchange",function(){Te(s()[1])!==Te(c)&&o()});var a=be.Pop,h=s(),l=h[0],c=h[1],d=ke(),u=ke();function p(t){return function(){var t=document.querySelector("base"),e="";if(t&&t.getAttribute("href")){var n=r.location.href,s=n.indexOf("#");e=-1===s?n:n.slice(0,s)}return e}()+"#"+("string"==typeof t?t:Te(t))}function g(t,e){return void 0===e&&(e=null),Ee(ye({pathname:c.pathname,hash:"",search:""},"string"==typeof t?De(t):t,{state:e,key:Oe()}))}function f(t,e){return[{usr:t.state,key:t.key,idx:e},p(t)]}function v(t,e,r){return!u.length||(u.call({action:t,location:e,retry:r}),!1)}function m(t){a=t;var e=s();l=e[0],c=e[1],d.call({action:a,location:c})}function y(t){n.go(t)}null==l&&(l=0,n.replaceState(ye({},n.state,{idx:l}),""));var b={get action(){return a},get location(){return c},createHref:p,push:function t(e,s){var i=be.Push,o=g(e,s);if("production"!==process.env.NODE_ENV&&$e("/"===o.pathname.charAt(0),"Relative pathnames are not supported in hash history.push("+JSON.stringify(e)+")"),v(i,o,function(){t(e,s)})){var a=f(o,l+1),h=a[0],c=a[1];try{n.pushState(h,"",c)}catch(t){r.location.assign(c)}m(i)}},replace:function t(e,r){var s=be.Replace,i=g(e,r);if("production"!==process.env.NODE_ENV&&$e("/"===i.pathname.charAt(0),"Relative pathnames are not supported in hash history.replace("+JSON.stringify(e)+")"),v(s,i,function(){t(e,r)})){var o=f(i,l),a=o[0],h=o[1];n.replaceState(a,"",h),m(s)}},go:y,back:function(){y(-1)},forward:function(){y(1)},listen:function(t){return d.push(t)},block:function(t){var e=u.push(t);return 1===u.length&&r.addEventListener(Se,Ae),function(){e(),u.length||r.removeEventListener(Se,Ae)}}};return b}function we(t,e,r){return Math.min(Math.max(t,e),r)}function Ae(t){t.preventDefault(),t.returnValue=""}function ke(){var t=[];return{get length(){return t.length},push:function(e){return t.push(e),function(){t=t.filter(function(t){return t!==e})}},call:function(e){t.forEach(function(t){return t&&t(e)})}}}function Oe(){return Math.random().toString(36).substr(2,8)}function Te(t){var e=t.pathname,r=void 0===e?"/":e,n=t.search,s=void 0===n?"":n,i=t.hash,o=void 0===i?"":i;return s&&"?"!==s&&(r+="?"===s.charAt(0)?s:"?"+s),o&&"#"!==o&&(r+="#"===o.charAt(0)?o:"#"+o),r}function De(t){var e={};if(t){var r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));var n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}const Re={},xe=ce("browser");function Pe(t){let e=Re[t];if(!e){switch(t){case"browser":e=function(t){void 0===t&&(t={});var e=t.window,r=void 0===e?document.defaultView:e,n=r.history;function s(){var t=r.location,e=t.pathname,s=t.search,i=t.hash,o=n.state||{};return[o.idx,Ee({pathname:e,search:s,hash:i,state:o.usr||null,key:o.key||"default"})]}var i=null;r.addEventListener(_e,function(){if(i)d.call(i),i=null;else{var t=be.Pop,e=s(),r=e[0],n=e[1];if(d.length)if(null!=r){var o=h-r;o&&(i={action:t,location:n,retry:function(){m(-1*o)}},m(o))}else"production"!==process.env.NODE_ENV&&$e(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");else v(t)}});var o=be.Pop,a=s(),h=a[0],l=a[1],c=ke(),d=ke();function u(t){return"string"==typeof t?t:Te(t)}function p(t,e){return void 0===e&&(e=null),Ee(ye({pathname:l.pathname,hash:"",search:""},"string"==typeof t?De(t):t,{state:e,key:Oe()}))}function g(t,e){return[{usr:t.state,key:t.key,idx:e},u(t)]}function f(t,e,r){return!d.length||(d.call({action:t,location:e,retry:r}),!1)}function v(t){o=t;var e=s();h=e[0],l=e[1],c.call({action:o,location:l})}function m(t){n.go(t)}null==h&&(h=0,n.replaceState(ye({},n.state,{idx:h}),""));var y={get action(){return o},get location(){return l},createHref:u,push:function t(e,s){var i=be.Push,o=p(e,s);if(f(i,o,function(){t(e,s)})){var a=g(o,h+1),l=a[0],c=a[1];try{n.pushState(l,"",c)}catch(t){r.location.assign(c)}v(i)}},replace:function t(e,r){var s=be.Replace,i=p(e,r);if(f(s,i,function(){t(e,r)})){var o=g(i,h),a=o[0],l=o[1];n.replaceState(a,"",l),v(s)}},go:m,back:function(){m(-1)},forward:function(){m(1)},listen:function(t){return c.push(t)},block:function(t){var e=d.push(t);return 1===d.length&&r.addEventListener(Se,Ae),function(){e(),d.length||r.removeEventListener(Se,Ae)}}};return y}();break;case"hash":e=Ce();break;default:e=function(t){void 0===t&&(t={});var e=t,r=e.initialEntries,n=void 0===r?["/"]:r,s=e.initialIndex,i=n.map(function(t){var e=Ee(ye({pathname:"/",search:"",hash:"",state:null,key:Oe()},"string"==typeof t?De(t):t));return"production"!==process.env.NODE_ENV&&$e("/"===e.pathname.charAt(0),"Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: "+JSON.stringify(t)+")"),e}),o=we(null==s?i.length-1:s,0,i.length-1),a=be.Pop,h=i[o],l=ke(),c=ke();function d(t,e){return void 0===e&&(e=null),Ee(ye({pathname:h.pathname,search:"",hash:""},"string"==typeof t?De(t):t,{state:e,key:Oe()}))}function u(t,e,r){return!c.length||(c.call({action:t,location:e,retry:r}),!1)}function p(t,e){a=t,h=e,l.call({action:a,location:h})}function g(t){var e=we(o+t,0,i.length-1),r=be.Pop,n=i[e];u(r,n,function(){g(t)})&&(o=e,p(r,n))}var f={get index(){return o},get action(){return a},get location(){return h},createHref:function(t){return"string"==typeof t?t:Te(t)},push:function t(e,r){var n=be.Push,s=d(e,r);"production"!==process.env.NODE_ENV&&$e("/"===h.pathname.charAt(0),"Relative pathnames are not supported in memory history.push("+JSON.stringify(e)+")"),u(n,s,function(){t(e,r)})&&(o+=1,i.splice(o,i.length,s),p(n,s))},replace:function t(e,r){var n=be.Replace,s=d(e,r);"production"!==process.env.NODE_ENV&&$e("/"===h.pathname.charAt(0),"Relative pathnames are not supported in memory history.replace("+JSON.stringify(e)+")"),u(n,s,function(){t(e,r)})&&(i[o]=s,p(n,s))},go:g,back:function(){g(-1)},forward:function(){g(1)},listen:function(t){return l.push(t)},block:function(t){return c.push(t)}};return f}()}Re[t]=e}return e}de(()=>Pe(xe.get()));const Le=Symbol("HistoryManaged:history"),Ne=Symbol("HistoryManaged:historyType"),Me=t=>{var n,s;class i extends t{constructor(){super(...arguments),this.history=void 0,this.#r=ce(this.history),this.#n=de(()=>{const t=this.closest("tha-router-config, tha-router-outlet");return t?.[Ne]?.get()}),this[n]=de(()=>this.#r.get()??this.#n.get()??xe.get()),this[s]=de(()=>Pe(this[Ne].get()))}static{n=Ne,s=Le}#r;#n;attributeChangedCallback(t,e,r){if(super.attributeChangedCallback(t,e,r),"history"===t)this.#r.set(r)}}return e([pt({type:String}),r("design:type",Object)],i.prototype,"history",void 0),i};function Ue(t=ve){return new Promise((e,r)=>{setTimeout(()=>{try{const r=t();e(r)}catch(t){r(t)}},0)})}var Ie;const He=Symbol("ThaRouterOutlet:renderRoute"),We=Symbol("ThaRouterOutlet:params");function je(t){return!!t}function ze(t){return t.filter(je)}t.ThaRouterOutlet=class extends me{constructor(){super(...arguments),this.#s=ce(void 0),this.#i=ce(null),this.#o=de(()=>this.#i.get()?.deref()?.[ge].get()??null),this.#a=de(()=>{const t=this.#s.get()?.deref(),e=this.#i.get()?.deref(),r=e?.[fe];if(!t||!r)return null;const{location:{pathname:n}}=t[Le].get();return r.exec(n,"http://dummy.base")?.pathname.groups??null}),this[Ie]=de(()=>{const t=this.#a.get()??{},e=this.parentElement?.closest("tha-router-outlet"),r=e?.[We].get()??{};return Object.freeze({...r,...t})}),this.params={},this.#h=ve,this.#l=ve,this.#c=ve,this.for=null,this.routePath=null,this.routeID=void 0}#s;#i;#o;#a;#h;#l;#c;connectedCallback(){super.connectedCallback(),Ue(()=>{this.bindToRouter()}),this.#h=this.updateEffect(()=>{Array.from(this.renderRoot.children).forEach(t=>t.remove());const t=this.#o.get()?.deref()??null;t&&this.renderRoot.appendChild(t.cloneNode(!0))}),this.#l=this.updateEffect(()=>{const t=this.#i.get()?.deref()??null;this.routePath=t?.getAttribute("path")??null,this.routeID=t?.id?t?.id:void 0}),this.#c=this.updateEffect(()=>{const t=this[We].get();Array.from(this.attributes).filter(t=>t.name.startsWith("param-")).filter(e=>!(e.name.slice(6)in t)).forEach(t=>{this.removeAttribute(t.name)});for(const[e,r]of Object.entries(t))this.setAttribute(`param-${e}`,r??"");this.params=t})}bindToRouter(t){if(!t)if(this.for){t=this.getRootNode().querySelector(`tha-router#${this.for}`)??void 0}else t=this.closest("tha-router")??void 0;const e=this.#s?.get()?.deref()??null;return e===t?e:(e?.assignOutlet(null),t?.assignOutlet(this),this.#s.set(t?new WeakRef(t):void 0),t??null)}[(Ie=We,He)](t){this.#i.set(t?new WeakRef(t):null)}disconnectedCallback(){super.disconnectedCallback(),this.#s?.get()?.deref()?.assignOutlet(null);try{this.#h(),this.#l(),this.#c()}catch{}}createRenderRoot(){return this}},e([function(t){return pt({...t,state:!0,attribute:!1})}(),r("design:type",Object)],t.ThaRouterOutlet.prototype,"params",void 0),e([pt({type:String}),r("design:type",Object)],t.ThaRouterOutlet.prototype,"for",void 0),e([pt({type:String,reflect:!0}),r("design:type",Object)],t.ThaRouterOutlet.prototype,"routePath",void 0),e([pt({type:String,reflect:!0}),r("design:type",Object)],t.ThaRouterOutlet.prototype,"routeID",void 0),t.ThaRouterOutlet=e([ct("tha-router-outlet")],t.ThaRouterOutlet),t.ThaRouter=class extends(Me(me)){static{const t=document.createElement("style");t.setAttribute("type","text/css"),t.setAttribute("data-id","tha-router-styles"),t.textContent=h`
|
|
132
132
|
tha-router {
|
|
133
133
|
& > :not(tha-router-outlet) {
|
|
134
134
|
display: none;
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
`.toString(),document.head.appendChild(t)}#d=new MutationObserver(e=>{e.filter(t=>"childList"===t.type).length&&this.#u.set(Array.from(this.children).filter(e=>e instanceof t.ThaRoute).map(t=>new WeakRef(t)))});#p=ve;#g=ve;#f=ve;#u=ce([]);#v=ce(null);#m=ce(null);connectedCallback(){super.connectedCallback(),this.#d.observe(this,{childList:!0}),this.#p=this.updateEffect(()=>{const t=this.#v.get()?.deref()??null,e=this.#m.get()?.deref()??null;e?.[
|
|
137
|
+
`.toString(),document.head.appendChild(t)}#d=new MutationObserver(e=>{e.filter(t=>"childList"===t.type).length&&this.#u.set(Array.from(this.children).filter(e=>e instanceof t.ThaRoute).map(t=>new WeakRef(t)))});#p=ve;#g=ve;#f=ve;#u=ce([]);#v=ce(null);#m=ce(null);connectedCallback(){super.connectedCallback(),this.#d.observe(this,{childList:!0}),this.#p=this.updateEffect(()=>{const t=this.#v.get()?.deref()??null,e=this.#m.get()?.deref()??null;e?.[He](t)}),this.#g=this.updateEffect(()=>{const t=this[Le].get();this.#f(),this.#y({location:this[Le].get().location,action:"POP"}),this.#f=t?t.listen(this.#y):ve}),Ue(()=>{this.#y({location:this[Le].get().location,action:"POP"})})}assignOutlet(t){this.#m.set(t?new WeakRef(t):null)}#y=t=>{const e=this.#u.get().map(t=>t.deref()).filter(Boolean);for(const r of e){const e=r[fe];if(e?.test({pathname:t.location.pathname}))return void this.#v.set(new WeakRef(r))}this.#v.set(null)};disconnectedCallback(){super.disconnectedCallback();try{this.#p(),this.#g()}catch{}this.#d.disconnect(),this.#f()}createRenderRoot(){return this}},t.ThaRouter=e([ct("tha-router")],t.ThaRouter),t.ThaRouterLink=class extends(Me(me)){constructor(){super(...arguments),this.to=null,this.active=!1,this.#b=ve,this.#f=ve,this.#E=ce(null),this.#$=de(()=>{const t=this.#E.get();if(!t||"back"===t||"forward"===t)return null;try{return new URLPattern({pathname:t})}catch{return null}}),this.#S=t=>{const e=this[Le].get();if(console.log(this[Ne].get()),"back"===this.to)return e.back();if("forward"===this.to)return e.forward();const r=e.location.pathname+e.location.search+e.location.hash;let n=this.to;if(n?.startsWith(".")){const t=ze(r.split("/")),e=ze(n.split("/"));for(const r of e)".."===r?t.pop():"."!==r&&t.push(r);n="/"+t.join("/")}n=n?.replaceAll("//","/"),this[Le].get()?.push(n||"/")}}static{const t=document.createElement("style");t.setAttribute("type","text/css"),t.setAttribute("data-id","tha-router-link-styles"),t.textContent=h`
|
|
138
138
|
tha-router-link {
|
|
139
139
|
cursor: pointer;
|
|
140
140
|
}
|
|
141
|
-
`.toString(),document.head.appendChild(t)}#b;#f;#E;#$;connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.#
|
|
141
|
+
`.toString(),document.head.appendChild(t)}#b;#f;#E;#$;connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.#S),this.#b=this.updateEffect(()=>{const t=this[Le].get(),e=this.#$.get();this.active=e?.test({pathname:t?.location.pathname??""})??!1,this.#f=t?.listen(()=>{this.active=e?.test({pathname:t.location.pathname})??!1})??ve})}attributeChangedCallback(t,e,r){if(super.attributeChangedCallback(t,e,r),"to"===t)this.#E.set(r)}#S;disconnectedCallback(){super.disconnectedCallback();try{this.#b()}catch{}this.#f(),this.removeEventListener("click",this.#S)}createRenderRoot(){return this}},e([pt({type:String}),r("design:type",Object)],t.ThaRouterLink.prototype,"to",void 0),e([pt({type:Boolean,reflect:!0}),r("design:type",Object)],t.ThaRouterLink.prototype,"active",void 0),t.ThaRouterLink=e([ct("tha-router-link")],t.ThaRouterLink),t.ThaRouterConfig=class extends(Me(me)){#_=ve;connectedCallback(){super.connectedCallback(),document.head.contains(this)&&(console.log("ThaRouterConfig: Setting global history type to",this[Ne].get()),this.#_=this.updateEffect(()=>{xe.set(this[Ne].get())}))}disconnectedCallback(){super.disconnectedCallback();try{this.#_()}catch{}}createRenderRoot(){return this}},t.ThaRouterConfig=e([ct("tha-router-config")],t.ThaRouterConfig),t.ThaRouterParam=class extends me{constructor(){super(...arguments),this.#m=ce(null),this.#C=ce(""),this.#w=de(()=>this.#m.get()?.[We]?.get()[this.#C.get()]),this.name=""}#m;#C;#w;connectedCallback(){super.connectedCallback();const t=this.closest("tha-router-outlet");if(!t)throw new Error("<tha-router-param> must be used within a <tha-router-outlet>.");this.#m.set(t)}attributeChangedCallback(t,e,r){if(super.attributeChangedCallback(t,e,r),"name"===t)this.#C.set(r??"")}render(){return le`${this.#w}`}},e([pt({type:String}),r("design:type",String)],t.ThaRouterParam.prototype,"name",void 0),t.ThaRouterParam=e([ct("tha-router-param")],t.ThaRouterParam);const Be=Symbol("Accept Drop"),Ve=Symbol("Register Handle"),qe=Symbol("Unregister Handle");var Ge,Ze;class Je extends DragEvent{static#A=["thadrag","thadragstart","thadragend","thadropzoneenter","thadropzoneleave","thadropzoneover","thadropped"];static#k=["thadrop","thadropend","thadragenter","thadragleave","thadragover"];get#O(){return Ge.#k.includes(this.type)?this.dropzoneTarget:Ge.#A.includes(this.type)?this.dragTarget:new WeakRef(this.target)}get name(){return this.#O.deref()?.name}get dragData(){return this.dragTarget.deref()?.dragData}constructor(t,{dragTarget:e,dropzoneTarget:r},n){super(t,n),this.dragTarget=e,this.dropzoneTarget=r}acceptDrop(t){this.dragTarget.deref()?.[Be](this.dropzoneTarget,t)}}let Fe;function Ye(t,e){if(null===t||""===t)return 0;const r=Number(t);if(!Number.isFinite(r))return 0;const n=Math.trunc(r);return n>=0?Math.min(n,e):Math.max(0,e+n+1)}Ge=Je,t.DragElement=class extends ht{constructor(){super(...arguments),this.dragData={},this.preDragData={boundingRect:null,dragStartEvent:null,styles:{pointerEvents:""}},this.#T=null,this.#D=null,this.#R=new Set,this.draggingStrategy="move",this.dragging=!1,this.dragend=!1,this.draggedOver=null,this.dropAccepted=!1,this.#x=t=>{if(!this.#P(t))return t.preventDefault();t.stopPropagation(),t.dataTransfer?.setDragImage(Ze.TRANSPARENT_IMAGE,0,0),t.dataTransfer.effectAllowed=this.draggingStrategy,document.addEventListener("dragover",this.#L),this.#N(t),this.#M(),Ue().then(()=>{if(this.style.pointerEvents="none",this.dragging=!0,this.replaceClone){const t=this.#U();this.#D=new WeakRef(t),this.parentElement.insertBefore(t,this.nextSibling)}this.dispatchEvent(new Je("thadragstart",{dragTarget:new WeakRef(this)},t))})},this.#I=t=>{document.removeEventListener("dragover",this.#L),this.dragend=!0;const e=getComputedStyle(this).transitionDuration.match(/\d*\.?\d+/g)?.map(Number).some(t=>t>0),r=()=>{this.replaceClone&&this.clone?.remove(),this.style.pointerEvents=this.preDragData.styles.pointerEvents,["--tha-width","--tha-height","--tha-left","--tha-top","--tha-x","--tha-y","--tha-cx","--tha-cy"].forEach(t=>{this.style.removeProperty(t)}),["width","height","left","right","top","bottom"].forEach(t=>{this.style.removeProperty(`--tha-target-${t}`)});const e=this.#T,r=this.dropAccepted;this.dragging=!1,this.dragend=!1,this.draggedOver=null,this.dropAccepted=!1,this.#T=null,r&&e&&e.deref()?.dispatchEvent(new Je("thadropend",{dragTarget:new WeakRef(this),dropzoneTarget:e},t)),this.dispatchEvent(new Je("thadragend",{dragTarget:new WeakRef(this)},t))};e?this.addEventListener("transitionend",r,{once:!0}):r()},this.#H=t=>{const{x:e,y:r}=t;this.style.setProperty("--tha-cx",`${e}px`),this.style.setProperty("--tha-cy",`${r}px`)},this.#W=t=>{this.draggedOver=t.dropzoneTarget?.deref()?.name??""},this.#j=()=>{this.draggedOver=null}}static{Ze=this}static{this.DRAG_DATA_OBSERVER=new MutationObserver(t=>{for(const{attributeName:e,target:r}of t){if(!e?.startsWith("data-drag-"))continue;const t=r;t.dragData[e.replace("data-drag-","")]=t.getAttribute(e)}})}static{this.styles=h`
|
|
142
142
|
:host {
|
|
143
143
|
--tha-diff-x: calc(var(--tha-cx) - var(--tha-x));
|
|
144
144
|
--tha-diff-y: calc(var(--tha-cy) - var(--tha-y));
|
|
@@ -176,5 +176,5 @@ qt.State,qt.Computed;const ce=(t,e)=>new qt.State(t,e),de=(t,e)=>new qt.Computed
|
|
|
176
176
|
width: var(--tha-target-width);
|
|
177
177
|
height: var(--tha-target-height);
|
|
178
178
|
}
|
|
179
|
-
`}static{this.TRANSPARENT_IMAGE=new Image(1,1),this.TRANSPARENT_IMAGE.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z/C/HgAGgwJ/lK3Q6wAAAABJRU5ErkJggg==";const t=this.GLOBAL_STYLE=document.createElement("style");t.innerHTML="\n @property --tha-offset-x {\n syntax: '<length>';\n initial-value: 0px;\n inherits: true;\n }\n\n @property --tha-offset-y {\n syntax: '<length>';\n initial-value: 0px;\n inherits: true;\n }\n ",document.head.appendChild(t)}#T;#D;#R;get clone(){return this.#D.deref()}connectedCallback(){super.connectedCallback(),this.draggable=!0,this.#z(),this.addEventListener("dragstart",this.#x),this.addEventListener("dragend",this.#H),this.addEventListener("drag",this.#W),this.addEventListener("thadropzoneenter",this.#I),this.addEventListener("thadropzoneleave",this.#j)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("dragstart",this.#x),this.removeEventListener("dragend",this.#H),this.removeEventListener("drag",this.#W),this.removeEventListener("thadropzoneenter",this.#I),this.removeEventListener("thadropzoneleave",this.#j)}render(){return B`<slot></slot>`}[Ve](t,e){if(this.dropAccepted=!0,this.#T=t,!e)return;const{width:r,height:n,left:s,right:i,top:o,bottom:a}=e;for(const t in{width:r,height:n,left:s,right:i,top:o,bottom:a})this.style.setProperty(`--tha-target-${t}`,`${e[t]}px`)}[Be](t){this.#R.add(t)}[qe](t){this.#R.delete(t)}#z(){Ze.DRAG_DATA_OBSERVER.observe(this,{attributes:!0});for(const{name:t,value:e}of Object.values(this.attributes).filter(t=>t.name.startsWith("data-drag-")))this.dragData[t.replace("data-drag-","")]=e}#x;#H;#W;#I;#j;#U(){const t=document.createElement("tha-drag-clone");return Object.values(this.attributes).filter(t=>!["dragging","replaceclone","draggable"].includes(t.name)).forEach(e=>{t.attributes.setNamedItem(e.cloneNode())}),this.childNodes.forEach(e=>{t.appendChild(e.cloneNode(!0))}),t}#L(t){this.preDragData.boundingRect=this.getBoundingClientRect(),this.preDragData.dragStartEvent=t,this.preDragData.styles.pointerEvents=this.style.pointerEvents}#M(){const{boundingRect:{width:t,height:e,left:r,top:n},dragStartEvent:{x:s,y:i}}=this.preDragData,o={width:t,height:e,left:r,top:n,x:s,y:i};for(const t in o)this.style.setProperty(`--tha-${t}`,`${o[t]}px`)}#P(t){t.preventDefault()}#N(t){return!this.disabled&&(!this.#R.size||!!this.#R.has(t.target))}},e([pt({type:String}),r("design:type",String)],t.DragElement.prototype,"name",void 0),e([pt({type:String,reflect:!0}),r("design:type",String)],t.DragElement.prototype,"draggingStrategy",void 0),e([pt({type:String}),r("design:type",String)],t.DragElement.prototype,"dragGroup",void 0),e([pt({type:Boolean}),r("design:type",Boolean)],t.DragElement.prototype,"replaceClone",void 0),e([pt({type:Boolean,reflect:!0}),r("design:type",Object)],t.DragElement.prototype,"dragging",void 0),e([pt({type:Boolean,reflect:!0}),r("design:type",Object)],t.DragElement.prototype,"dragend",void 0),e([pt({type:String,reflect:!0}),r("design:type",Object)],t.DragElement.prototype,"draggedOver",void 0),e([pt({type:Boolean,reflect:!0}),r("design:type",Object)],t.DragElement.prototype,"dropAccepted",void 0),e([pt({type:Boolean,reflect:!0}),r("design:type",Boolean)],t.DragElement.prototype,"disabled",void 0),t.DragElement=Ze=e([ct("tha-drag")],t.DragElement),document.addEventListener("thadragstart",t=>{Fe=t}),t.DropZoneElement=class extends ht{constructor(){super(...arguments),this.#V=0,this.accept=[],this.name="",this.itemDragged=null,this.acceptableDrag=!1,this.#B=t=>{this.accept.length&&!this.accept.includes(t.name)||(this.acceptableDrag=!0)},this.#q=()=>{this.itemDragged=null,this.acceptableDrag=!1,this.#V=0},this.#G=t=>{this.#Z()&&(++this.#V>1||(this.itemDragged=Fe.name??"",this.#J("thadragenter","thadropzoneenter",t)))},this.#F=t=>{this.#Z()&&(--this.#V>0||(this.itemDragged=null,this.#J("thadragleave","thadropzoneleave",t)))},this.#Y=t=>{this.#Z()&&this.#J("thadragover","thadropzoneover",t)},this.#K=t=>{this.#Z()&&this.#J("thadrop","thadropped",t)}}static{this.styles=h``}#V;render(){return B`<slot></slot>`}connectedCallback(){super.connectedCallback(),document.addEventListener("thadragstart",this.#B),document.addEventListener("thadragend",this.#q),document.addEventListener("thadropend",this.#q),this.addEventListener("dragenter",this.#G),this.addEventListener("dragleave",this.#F),this.addEventListener("dragover",this.#Y),this.addEventListener("drop",this.#K)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("thadragstart",this.#B),document.removeEventListener("thadragend",this.#q),document.removeEventListener("thadropend",this.#q),this.removeEventListener("dragenter",this.#G),this.removeEventListener("dragleave",this.#F),this.removeEventListener("dragover",this.#Y),this.removeEventListener("drop",this.#K)}#B;#q;#G;#F;#Y;#K;#Z(){return!Fe.name||!this.accept.length||this.accept.includes(Fe.name)}#J(t,e,r){const{dragTarget:n}=Fe,s=new WeakRef(this);this.dispatchEvent(new Je(t,{dragTarget:n,dropzoneTarget:s},r)),n.deref()?.dispatchEvent(new Je(e,{dragTarget:n,dropzoneTarget:s},r))}},e([pt({converter:t=>(t??"").split(",").map(t=>t.trim())}),r("design:type",Array)],t.DropZoneElement.prototype,"accept",void 0),e([pt({type:String}),r("design:type",Object)],t.DropZoneElement.prototype,"name",void 0),e([pt({type:String,reflect:!0}),r("design:type",Object)],t.DropZoneElement.prototype,"itemDragged",void 0),e([pt({type:Boolean,reflect:!0}),r("design:type",Object)],t.DropZoneElement.prototype,"acceptableDrag",void 0),t.DropZoneElement=e([ct("tha-dropzone")],t.DropZoneElement),t.DragHandleElement=class extends ht{get#Q(){for(const e of function*(t){for(;t.parentElement;)yield t=t.parentElement}(this))if(e instanceof t.DragElement)return e;return null}connectedCallback(){super.connectedCallback(),this.draggable=!0,this.#Q?.[Be](this)}disconnectedCallback(){super.disconnectedCallback(),this.#Q?.[qe](this)}render(){return B`<slot></slot>`}},t.DragHandleElement=e([ct("tha-drag-handle")],t.DragHandleElement),t.DetailsSetElement=class extends ht{constructor(){super(...arguments),this.maxOpenItems=0,this.toggleOn="summary",this.#X=[],this.#tt=new Map,this.#et=new Map,this.#rt=new WeakMap,this.#nt=()=>{this.#st()},this.#it=()=>{this.#ot()},this.#at=t=>{const e=t.target;e instanceof HTMLDetailsElement&&e.parentElement===this&&this.#ht(e)},this.#lt=t=>{this.#ht(t)},this.#ct=t=>{if(t.defaultPrevented)return;const e=t.target;if(!(e instanceof Element))return;const r=e.closest("summary");if(!r)return;const n=r.parentElement;if(!(n instanceof HTMLDetailsElement))return;if(n.parentElement!==this)return;if(r!==n.querySelector(":scope > summary"))return;"marker"===this.#dt(n)&&0!==t.detail&&r.querySelector("[tp-summary-marker]")&&(e.closest("[tp-summary-marker]")||t.preventDefault())}}static{const t=this.GLOBAL_STYLE=document.createElement("style");t.textContent='\n tp-details-set {\n display: block;\n interpolate-size: allow-keywords;\n }\n\n tp-details-set > details::details-content {\n block-size: 0;\n overflow: clip;\n transition:\n block-size var(--tp-details-set-transition-duration, 0.3s)\n var(--tp-details-set-transition-easing, ease),\n content-visibility var(--tp-details-set-transition-duration, 0.3s)\n var(--tp-details-set-transition-easing, ease)\n allow-discrete;\n }\n\n tp-details-set > details[open]::details-content {\n block-size: auto;\n }\n\n /* Hide the native disclosure marker when the consumer has supplied at\n least one custom marker via <template summary-marker>. */\n tp-details-set > details > summary:has(> [tp-summary-marker]) {\n list-style: none;\n }\n tp-details-set > details > summary:has(> [tp-summary-marker])::-webkit-details-marker {\n display: none;\n }\n tp-details-set > details > summary:has(> [tp-summary-marker])::marker {\n content: "";\n }\n ',document.head.appendChild(t)}#X;#tt;#ut;#et;#rt;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("toggle",this.#at,{capture:!0}),this.addEventListener("click",this.#ct,{capture:!0}),this.#ut=new MutationObserver(this.#it),this.#ut.observe(this,{childList:!0}),this.#ot()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("toggle",this.#at,{capture:!0}),this.removeEventListener("click",this.#ct,{capture:!0}),this.#ut?.disconnect(),this.#ut=void 0;for(const t of this.#tt.values())t.disconnect();this.#tt.clear();for(const t of this.#et.values())t.disconnect();this.#et.clear(),this.#X=[]}updated(t){t.has("maxOpenItems")&&this.#pt()}render(){return B``}#ot(){const t=new Set(this.#gt());for(const[e,r]of this.#tt)t.has(e)||(r.disconnect(),this.#tt.delete(e));this.#X=this.#X.filter(e=>t.has(e));for(const e of t)if(!this.#tt.has(e)){const t=new MutationObserver(()=>this.#lt(e));t.observe(e,{attributes:!0,attributeFilter:["open"]}),this.#tt.set(e,t),e.open&&!this.#X.includes(e)&&this.#X.push(e)}this.#pt(),this.#ft(),this.#st()}#ft(){const t=new Set(this.#vt());for(const[e,r]of this.#et)t.has(e)||(r.disconnect(),this.#et.delete(e));for(const e of t)if(!this.#et.has(e)){const t=new MutationObserver(this.#nt);t.observe(e,{attributes:!0,attributeFilter:["index","summary-marker"]}),t.observe(e.content,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),this.#et.set(e,t)}}#nt;#st(){const t=this.#vt();for(const e of this.#gt()){const r=e.querySelector(":scope > summary");r instanceof HTMLElement&&this.#mt(r,t)}}#mt(t,e){let r=this.#rt.get(t);r||(r=new Map,this.#rt.set(t,r));for(const e of r.values())for(const r of e)r.parentNode===t&&t.removeChild(r);r.clear();for(const n of e){const e=n.content.cloneNode(!0),s=Array.from(e.childNodes);if(0===s.length)continue;for(const t of s)t instanceof Element&&t.setAttribute("tp-summary-marker","");const i=Ye(n.getAttribute("index"),t.childNodes.length),o=t.childNodes[i]??null;t.insertBefore(e,o),r.set(n,s)}}#vt(){return Array.from(this.children).filter(t=>t instanceof HTMLTemplateElement&&t.hasAttribute("summary-marker"))}#gt(){return Array.from(this.children).filter(t=>t instanceof HTMLDetailsElement)}#it;#at;#lt;#ct;#dt(t){const e=t.getAttribute("toggle-on");return"marker"===e||"summary"===e?e:"marker"===this.toggleOn?"marker":"summary"}#ht(t){const e=this.#X.includes(t);t.open&&!e?(this.#X.push(t),this.#pt()):!t.open&&e&&(this.#X=this.#X.filter(e=>e!==t))}#pt(){const t=this.maxOpenItems;if(!Number.isFinite(t)||t<=0)return;const e=[];for(;this.#X.length>t;){const t=this.#X.shift();if(!t)break;t.open&&(t.open=!1,e.push(t))}e.length>0&&this.dispatchEvent(new CustomEvent("tp-details-set-change",{bubbles:!0,composed:!0,detail:{opened:[],closed:e}}))}},e([pt({type:Number,reflect:!0,attribute:"max-open-items"}),r("design:type",Object)],t.DetailsSetElement.prototype,"maxOpenItems",void 0),e([pt({reflect:!0,attribute:"toggle-on"}),r("design:type",String)],t.DetailsSetElement.prototype,"toggleOn",void 0),t.DetailsSetElement=e([ct("tp-details-set")],t.DetailsSetElement),t.ThaDragEvent=Je,t}({});
|
|
179
|
+
`}static{this.TRANSPARENT_IMAGE=new Image(1,1),this.TRANSPARENT_IMAGE.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z/C/HgAGgwJ/lK3Q6wAAAABJRU5ErkJggg==";const t=this.GLOBAL_STYLE=document.createElement("style");t.innerHTML="\n @property --tha-offset-x {\n syntax: '<length>';\n initial-value: 0px;\n inherits: true;\n }\n\n @property --tha-offset-y {\n syntax: '<length>';\n initial-value: 0px;\n inherits: true;\n }\n ",document.head.appendChild(t)}#T;#D;#R;get clone(){return this.#D.deref()}connectedCallback(){super.connectedCallback(),this.draggable=!0,this.#z(),this.addEventListener("dragstart",this.#x),this.addEventListener("dragend",this.#I),this.addEventListener("drag",this.#H),this.addEventListener("thadropzoneenter",this.#W),this.addEventListener("thadropzoneleave",this.#j)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("dragstart",this.#x),this.removeEventListener("dragend",this.#I),this.removeEventListener("drag",this.#H),this.removeEventListener("thadropzoneenter",this.#W),this.removeEventListener("thadropzoneleave",this.#j)}render(){return V`<slot></slot>`}[Be](t,e){if(this.dropAccepted=!0,this.#T=t,!e)return;const{width:r,height:n,left:s,right:i,top:o,bottom:a}=e;for(const t in{width:r,height:n,left:s,right:i,top:o,bottom:a})this.style.setProperty(`--tha-target-${t}`,`${e[t]}px`)}[Ve](t){this.#R.add(t)}[qe](t){this.#R.delete(t)}#z(){Ze.DRAG_DATA_OBSERVER.observe(this,{attributes:!0});for(const{name:t,value:e}of Object.values(this.attributes).filter(t=>t.name.startsWith("data-drag-")))this.dragData[t.replace("data-drag-","")]=e}#x;#I;#H;#W;#j;#U(){const t=document.createElement("tha-drag-clone");return Object.values(this.attributes).filter(t=>!["dragging","replaceclone","draggable"].includes(t.name)).forEach(e=>{t.attributes.setNamedItem(e.cloneNode())}),this.childNodes.forEach(e=>{t.appendChild(e.cloneNode(!0))}),t}#N(t){this.preDragData.boundingRect=this.getBoundingClientRect(),this.preDragData.dragStartEvent=t,this.preDragData.styles.pointerEvents=this.style.pointerEvents}#M(){const{boundingRect:{width:t,height:e,left:r,top:n},dragStartEvent:{x:s,y:i}}=this.preDragData,o={width:t,height:e,left:r,top:n,x:s,y:i};for(const t in o)this.style.setProperty(`--tha-${t}`,`${o[t]}px`)}#L(t){t.preventDefault()}#P(t){return!this.disabled&&(!this.#R.size||!!this.#R.has(t.target))}},e([pt({type:String}),r("design:type",String)],t.DragElement.prototype,"name",void 0),e([pt({type:String,reflect:!0}),r("design:type",String)],t.DragElement.prototype,"draggingStrategy",void 0),e([pt({type:String}),r("design:type",String)],t.DragElement.prototype,"dragGroup",void 0),e([pt({type:Boolean}),r("design:type",Boolean)],t.DragElement.prototype,"replaceClone",void 0),e([pt({type:Boolean,reflect:!0}),r("design:type",Object)],t.DragElement.prototype,"dragging",void 0),e([pt({type:Boolean,reflect:!0}),r("design:type",Object)],t.DragElement.prototype,"dragend",void 0),e([pt({type:String,reflect:!0}),r("design:type",Object)],t.DragElement.prototype,"draggedOver",void 0),e([pt({type:Boolean,reflect:!0}),r("design:type",Object)],t.DragElement.prototype,"dropAccepted",void 0),e([pt({type:Boolean,reflect:!0}),r("design:type",Boolean)],t.DragElement.prototype,"disabled",void 0),t.DragElement=Ze=e([ct("tha-drag")],t.DragElement),document.addEventListener("thadragstart",t=>{Fe=t}),t.DropZoneElement=class extends ht{constructor(){super(...arguments),this.#B=0,this.accept=[],this.name="",this.itemDragged=null,this.acceptableDrag=!1,this.#V=t=>{this.accept.length&&!this.accept.includes(t.name)||(this.acceptableDrag=!0)},this.#q=()=>{this.itemDragged=null,this.acceptableDrag=!1,this.#B=0},this.#G=t=>{this.#Z()&&(++this.#B>1||(this.itemDragged=Fe.name??"",this.#J("thadragenter","thadropzoneenter",t)))},this.#F=t=>{this.#Z()&&(--this.#B>0||(this.itemDragged=null,this.#J("thadragleave","thadropzoneleave",t)))},this.#Y=t=>{this.#Z()&&this.#J("thadragover","thadropzoneover",t)},this.#K=t=>{this.#Z()&&this.#J("thadrop","thadropped",t)}}static{this.styles=h``}#B;render(){return V`<slot></slot>`}connectedCallback(){super.connectedCallback(),document.addEventListener("thadragstart",this.#V),document.addEventListener("thadragend",this.#q),document.addEventListener("thadropend",this.#q),this.addEventListener("dragenter",this.#G),this.addEventListener("dragleave",this.#F),this.addEventListener("dragover",this.#Y),this.addEventListener("drop",this.#K)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("thadragstart",this.#V),document.removeEventListener("thadragend",this.#q),document.removeEventListener("thadropend",this.#q),this.removeEventListener("dragenter",this.#G),this.removeEventListener("dragleave",this.#F),this.removeEventListener("dragover",this.#Y),this.removeEventListener("drop",this.#K)}#V;#q;#G;#F;#Y;#K;#Z(){return!Fe.name||!this.accept.length||this.accept.includes(Fe.name)}#J(t,e,r){const{dragTarget:n}=Fe,s=new WeakRef(this);this.dispatchEvent(new Je(t,{dragTarget:n,dropzoneTarget:s},r)),n.deref()?.dispatchEvent(new Je(e,{dragTarget:n,dropzoneTarget:s},r))}},e([pt({converter:t=>(t??"").split(",").map(t=>t.trim())}),r("design:type",Array)],t.DropZoneElement.prototype,"accept",void 0),e([pt({type:String}),r("design:type",Object)],t.DropZoneElement.prototype,"name",void 0),e([pt({type:String,reflect:!0}),r("design:type",Object)],t.DropZoneElement.prototype,"itemDragged",void 0),e([pt({type:Boolean,reflect:!0}),r("design:type",Object)],t.DropZoneElement.prototype,"acceptableDrag",void 0),t.DropZoneElement=e([ct("tha-dropzone")],t.DropZoneElement),t.DragHandleElement=class extends ht{get#Q(){for(const e of function*(t){for(;t.parentElement;)yield t=t.parentElement}(this))if(e instanceof t.DragElement)return e;return null}connectedCallback(){super.connectedCallback(),this.draggable=!0,this.#Q?.[Ve](this)}disconnectedCallback(){super.disconnectedCallback(),this.#Q?.[qe](this)}render(){return V`<slot></slot>`}},t.DragHandleElement=e([ct("tha-drag-handle")],t.DragHandleElement),t.DetailsSetElement=class extends ht{constructor(){super(...arguments),this.maxOpenItems=0,this.toggleOn="summary",this.#X=[],this.#tt=new Map,this.#et=new Map,this.#rt=new WeakMap,this.#nt=()=>{this.#st()},this.#it=()=>{this.#ot()},this.#at=t=>{const e=t.target;e instanceof HTMLDetailsElement&&e.parentElement===this&&this.#ht(e)},this.#lt=t=>{this.#ht(t)},this.#ct=t=>{if(t.defaultPrevented)return;const e=t.target;if(!(e instanceof Element))return;const r=e.closest("summary");if(!r)return;const n=r.parentElement;if(!(n instanceof HTMLDetailsElement))return;if(n.parentElement!==this)return;if(r!==n.querySelector(":scope > summary"))return;"marker"===this.#dt(n)&&0!==t.detail&&r.querySelector("[tp-summary-marker]")&&(e.closest("[tp-summary-marker]")||t.preventDefault())}}static{const t=this.GLOBAL_STYLE=document.createElement("style");t.textContent='\n tp-details-set {\n display: block;\n interpolate-size: allow-keywords;\n }\n\n tp-details-set > details::details-content {\n block-size: 0;\n overflow: clip;\n transition:\n block-size var(--tp-details-set-transition-duration, 0.3s)\n var(--tp-details-set-transition-easing, ease),\n content-visibility var(--tp-details-set-transition-duration, 0.3s)\n var(--tp-details-set-transition-easing, ease)\n allow-discrete;\n }\n\n tp-details-set > details[open]::details-content {\n block-size: auto;\n }\n\n /* Hide the native disclosure marker when the consumer has supplied at\n least one custom marker via <template summary-marker>. */\n tp-details-set > details > summary:has(> [tp-summary-marker]) {\n list-style: none;\n }\n tp-details-set > details > summary:has(> [tp-summary-marker])::-webkit-details-marker {\n display: none;\n }\n tp-details-set > details > summary:has(> [tp-summary-marker])::marker {\n content: "";\n }\n ',document.head.appendChild(t)}#X;#tt;#ut;#et;#rt;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("toggle",this.#at,{capture:!0}),this.addEventListener("click",this.#ct,{capture:!0}),this.#ut=new MutationObserver(this.#it),this.#ut.observe(this,{childList:!0}),this.#ot()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("toggle",this.#at,{capture:!0}),this.removeEventListener("click",this.#ct,{capture:!0}),this.#ut?.disconnect(),this.#ut=void 0;for(const t of this.#tt.values())t.disconnect();this.#tt.clear();for(const t of this.#et.values())t.disconnect();this.#et.clear(),this.#X=[]}updated(t){t.has("maxOpenItems")&&this.#pt()}render(){return V``}#ot(){const t=new Set(this.#gt());for(const[e,r]of this.#tt)t.has(e)||(r.disconnect(),this.#tt.delete(e));this.#X=this.#X.filter(e=>t.has(e));for(const e of t)if(!this.#tt.has(e)){const t=new MutationObserver(()=>this.#lt(e));t.observe(e,{attributes:!0,attributeFilter:["open"]}),this.#tt.set(e,t),e.open&&!this.#X.includes(e)&&this.#X.push(e)}this.#pt(),this.#ft(),this.#st()}#ft(){const t=new Set(this.#vt());for(const[e,r]of this.#et)t.has(e)||(r.disconnect(),this.#et.delete(e));for(const e of t)if(!this.#et.has(e)){const t=new MutationObserver(this.#nt);t.observe(e,{attributes:!0,attributeFilter:["index","summary-marker"]}),t.observe(e.content,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),this.#et.set(e,t)}}#nt;#st(){const t=this.#vt();for(const e of this.#gt()){const r=e.querySelector(":scope > summary");r instanceof HTMLElement&&this.#mt(r,t)}}#mt(t,e){let r=this.#rt.get(t);r||(r=new Map,this.#rt.set(t,r));for(const e of r.values())for(const r of e)r.parentNode===t&&t.removeChild(r);r.clear();for(const n of e){const e=n.content.cloneNode(!0),s=Array.from(e.childNodes);if(0===s.length)continue;for(const t of s)t instanceof Element&&t.setAttribute("tp-summary-marker","");const i=Ye(n.getAttribute("index"),t.childNodes.length),o=t.childNodes[i]??null;t.insertBefore(e,o),r.set(n,s)}}#vt(){return Array.from(this.children).filter(t=>t instanceof HTMLTemplateElement&&t.hasAttribute("summary-marker"))}#gt(){return Array.from(this.children).filter(t=>t instanceof HTMLDetailsElement)}#it;#at;#lt;#ct;#dt(t){const e=t.getAttribute("toggle-on");return"marker"===e||"summary"===e?e:"marker"===this.toggleOn?"marker":"summary"}#ht(t){const e=this.#X.includes(t);t.open&&!e?(this.#X.push(t),this.#pt()):!t.open&&e&&(this.#X=this.#X.filter(e=>e!==t))}#pt(){const t=this.maxOpenItems;if(!Number.isFinite(t)||t<=0)return;const e=[];for(;this.#X.length>t;){const t=this.#X.shift();if(!t)break;t.open&&(t.open=!1,e.push(t))}e.length>0&&this.dispatchEvent(new CustomEvent("tp-details-set-change",{bubbles:!0,composed:!0,detail:{opened:[],closed:e}}))}},e([pt({type:Number,reflect:!0,attribute:"max-open-items"}),r("design:type",Object)],t.DetailsSetElement.prototype,"maxOpenItems",void 0),e([pt({reflect:!0,attribute:"toggle-on"}),r("design:type",String)],t.DetailsSetElement.prototype,"toggleOn",void 0),t.DetailsSetElement=e([ct("tp-details-set")],t.DetailsSetElement);const Ke={};const Qe={popInline:"center",targetInline:"center",popBlock:"bottom",targetBlock:"top"},Xe=new Set(["start","center","end"]),tr=new Set(["top","middle","bottom"]),er={start:["end","start"],center:["center","center"],end:["start","end"]},rr={top:["bottom","top"],middle:["middle","middle"],bottom:["top","bottom"]};function nr(t){const e=t.trim().split(/\s+to\s+/);if(1===e.length){const t=e[0];return Xe.has(t)?er[t]:null}return 2===e.length&&Xe.has(e[0])&&Xe.has(e[1])?[e[0],e[1]]:null}function sr(t){const e=t.trim().split(/\s+to\s+/);if(1===e.length){const t=e[0];return tr.has(t)?rr[t]:null}return 2===e.length&&tr.has(e[0])&&tr.has(e[1])?[e[0],e[1]]:null}return t.PopoverElement=class extends ht{constructor(){var t;super(...arguments),this.mode="auto",this.target=null,this.position=null,this.trigger="manual",this.#yt=((t="tp-popover")in Ke||(Ke[t]=function*(t){let e=0;for(;;)yield`${t}-${e++}`}(t)),Ke[t].next().value),this.#bt=null,this.#Et=!1,this.#$t=[]}static{const t=this.GLOBAL_STYLE=document.createElement("style");t.textContent='\n tp-popover {\n --tp-popover-inline-position: attr(data-ti type(*));\n --tp-popover-block-position: attr(data-tb type(*));\n inset: auto;\n translate: var(--tp-popover-translate-x, 0) var(--tp-popover-translate-y, 0);\n position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline;\n\n &[data-tb="middle"] {\n --tp-popover-block-position: center;\n }\n\n &[data-pi="start"],\n &[data-pi="center"] {\n inset-inline-start: anchor(var(--tp-popover-inline-position));\n }\n\n &[data-pi="center"] {\n --tp-popover-translate-x: -50%;\n }\n\n &[data-pi="end"] {\n inset-inline-end: anchor(var(--tp-popover-inline-position));\n }\n\n &[data-pb="top"],\n &[data-pb="middle"] {\n inset-block-start: anchor(var(--tp-popover-block-position));\n }\n\n &[data-pb="middle"] {\n --tp-popover-translate-y: -50%;\n }\n\n &[data-pb="bottom"] {\n inset-block-end: anchor(var(--tp-popover-block-position));\n }\n }\n ',document.head.appendChild(t)}#yt;#bt;get anchorElement(){return this.#bt}get anchorName(){return`--${this.#yt}`}#Et;#$t;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.#St(),this.#_t(),this.#Ct(),this.#wt()}disconnectedCallback(){super.disconnectedCallback(),this.#At(),this.#kt()}updated(t){t.has("mode")&&this.#St(),t.has("target")&&(this.#_t(),this.#wt()),t.has("position")&&this.#Ct(),t.has("trigger")&&this.#wt()}render(){return V``}#St(){const t="manual"===this.mode?"manual":"auto";this.getAttribute("popover")!==t&&this.setAttribute("popover",t)}#Ot(){const t=this.target;if(t)try{const e=document.querySelector(t);if(e instanceof HTMLElement)return e;console.warn(`<tp-popover>: target "${t}" did not resolve to an HTMLElement; using parentElement.`)}catch{console.warn(`<tp-popover>: invalid target selector "${t}"; using parentElement.`)}const e=this.parentElement;return e instanceof HTMLElement?e:null}#_t(){const t=this.#Ot();t!==this.#bt?(this.#kt(),this.#bt=t,t&&this.#Tt(t)):t&&this.#Tt(t)}#Tt(t){const e=`--${this.#yt}`,r=t.style.getPropertyValue("anchor-name").trim();if(r&&r!==e)return this.style.setProperty("position-anchor",r),void(this.#Et=!1);t.style.setProperty("anchor-name",e),this.style.setProperty("position-anchor",e),this.#Et=!0}#kt(){if(this.#bt&&this.#Et){const t=`--${this.#yt}`;this.#bt.style.getPropertyValue("anchor-name").trim()===t&&this.#bt.style.removeProperty("anchor-name")}this.#bt=null,this.#Et=!1,this.style.removeProperty("position-anchor")}#Ct(){let t=function(t){if(!t)return null;const e=t.trim().toLowerCase();if(!e)return null;if(!e.includes("/")){const t=nr(e);if(t){const[e,r]=rr.middle;return{popInline:t[0],targetInline:t[1],popBlock:e,targetBlock:r}}const r=sr(e);if(r){const[t,e]=er.center;return{popInline:t,targetInline:e,popBlock:r[0],targetBlock:r[1]}}return null}const r=e.split("/");if(2!==r.length)return null;const n=nr(r[0]),s=sr(r[1]);return n&&s?{popInline:n[0],targetInline:n[1],popBlock:s[0],targetBlock:s[1]}:null}(this.position);this.position&&!t&&console.warn(`<tp-popover>: invalid position "${this.position}"; using default.`),t??=Qe,this.dataset.pi=t.popInline,this.dataset.ti=t.targetInline,this.dataset.pb=t.popBlock,this.dataset.tb=t.targetBlock}#At(){for(const t of this.#$t)t();this.#$t=[]}#wt(){this.#At();const t=this.#bt;if(t){if("click"===this.trigger){const e=()=>{try{this.togglePopover()}catch{}};return t.addEventListener("click",e),void this.#$t.push(()=>t.removeEventListener("click",e))}if("hover"===this.trigger){let e=null;const r=()=>{null!==e&&(clearTimeout(e),e=null)},n=()=>{r();try{this.showPopover()}catch{}},s=()=>{r(),e=setTimeout(()=>{try{this.hidePopover()}catch{}},120)};t.addEventListener("pointerenter",n),t.addEventListener("pointerleave",s),t.addEventListener("focusin",n),t.addEventListener("focusout",s),this.addEventListener("pointerenter",r),this.addEventListener("pointerleave",s),this.addEventListener("focusin",r),this.addEventListener("focusout",s),this.#$t.push(()=>{r(),t.removeEventListener("pointerenter",n),t.removeEventListener("pointerleave",s),t.removeEventListener("focusin",n),t.removeEventListener("focusout",s),this.removeEventListener("pointerenter",r),this.removeEventListener("pointerleave",s),this.removeEventListener("focusin",r),this.removeEventListener("focusout",s)})}}}},e([pt({reflect:!0}),r("design:type",String)],t.PopoverElement.prototype,"mode",void 0),e([pt({reflect:!0}),r("design:type",Object)],t.PopoverElement.prototype,"target",void 0),e([pt({reflect:!0}),r("design:type",Object)],t.PopoverElement.prototype,"position",void 0),e([pt({reflect:!0}),r("design:type",String)],t.PopoverElement.prototype,"trigger",void 0),t.PopoverElement=e([ct("tp-popover")],t.PopoverElement),t.ThaDragEvent=Je,t}({});
|
|
180
180
|
//# sourceMappingURL=elements.js.map
|