aptechka 0.71.18 → 0.71.20

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.
@@ -0,0 +1,5 @@
1
+ "use strict";var Y=c=>{throw TypeError(c)};var Z=(c,n,e)=>n.has(c)||Y("Cannot "+e);var t=(c,n,e)=>(Z(c,n,"read from private field"),e?e.call(c):n.get(c)),i=(c,n,e)=>n.has(c)?Y("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(c):n.set(c,e),s=(c,n,e,a)=>(Z(c,n,"write to private field"),a?a.call(c,e):n.set(c,e),e),F=(c,n,e)=>(Z(c,n,"access private method"),e);const it=require("./element-linked-store/index.cjs"),rt=require("./index-DekP7OZe.cjs"),M=require("./events-KVanG9sR.cjs"),nt=require("./string-DUXXtU8v.cjs");require("construct-style-sheets-polyfill");const J=require("./loading/index.cjs"),at=require("./order/index.cjs"),tt=require("./window-resizer/index.cjs"),ht=require("./Store-Cd1GlEmZ.cjs");var C,b,B,S,d,p,$;class et{constructor(n){i(this,C);i(this,b);i(this,B);i(this,S);i(this,d);i(this,p);i(this,$);s(this,C,n);let e=n.split(".");const a=/\b\d{1,2}x\b/g,l=e.find(y=>y.match(a)&&parseInt(y));s(this,B,l?parseInt(l):1),l&&(e=e.slice(0,-1)),s(this,b,e.length>1?e.slice(0,-1).join("."):e.join("."));const h=/\d+max/g,m=/\d+min/g,w=/\d+mar/g,U=/\d+mir/g,W=e.find(y=>y.match(h)),u=e.find(y=>y.match(m)),x=e.find(y=>y.match(w)),X=e.find(y=>y.match(U));x?(s(this,d,parseInt(x)),s(this,p,"max"),s(this,S,`(max-aspect-ratio: ${t(this,d)})`)):X?(s(this,d,parseInt(X)),s(this,p,"max"),s(this,S,`(min-aspect-ratio: ${t(this,d)})`)):W?(s(this,d,parseInt(W)),s(this,p,"max"),s(this,S,`(max-width: ${t(this,d)}px)`)):u?(s(this,d,parseInt(u)),s(this,S,`(min-width: ${t(this,d)}px)`),s(this,p,"min")):(s(this,d,0),s(this,S,`(min-width: ${t(this,d)}px)`),s(this,p,"min")),s(this,b,t(this,b).replace(`.${t(this,d)}${t(this,p)}`,"")),s(this,$,e[e.length-1]===t(this,b)?"":"."+e[e.length-1]),s(this,$,t(this,$).replace(`.${t(this,d)}${t(this,p)}`,""))}get url(){return t(this,C)}get name(){return t(this,b)}get density(){return t(this,B)}get query(){return t(this,S)}get extension(){return t(this,$)}get queryType(){return t(this,p)}get queryValue(){return t(this,d)}}C=new WeakMap,b=new WeakMap,B=new WeakMap,S=new WeakMap,d=new WeakMap,p=new WeakMap,$=new WeakMap;var q;class Q{constructor(n,e){i(this,q);s(this,q,new Map);const a=(e==null?void 0:e.mediaBuckets)!==!1,l=typeof n=="string"?a?n.trim().split(",").map(u=>u.trim()).filter(u=>!!u):[n]:n,h=[];l.forEach(u=>{const x=new et(u);h.push([x.query,x])});const m=h.filter(u=>u[1].queryType.includes("max")).sort((u,x)=>x[1].queryValue-u[1].queryValue),w=h.filter(u=>u[1].queryType.includes("min")&&u[1].queryValue!==0).sort((u,x)=>u[1].queryValue-x[1].queryValue),U=h.filter(u=>u[0]==="(min-width: 0px)");(U?[...U,...m,...w]:[...m,...w]).forEach(u=>{t(this,q).has(u[0])||t(this,q).set(u[0],[]),t(this,q).get(u[0]).push(u[1])})}get mediaBuckets(){return t(this,q)}}q=new WeakMap;var R,A;class st extends ht.Store{constructor(e){super(void 0);i(this,R);i(this,A,()=>{let e;t(this,R).mediaBuckets.forEach((h,m)=>{matchMedia(m).matches&&(e=h)});let a,l=0;e==null||e.forEach(h=>{h.density>l&&h.density<=Math.max(devicePixelRatio,1)&&(l=h.density,a=h)}),e!=null&&e.length&&!a&&(a=e[0]),this.current=a});s(this,R,new Q(e.srcset,e.sourceSetOptions))}updateSource(e){s(this,R,new Q(e.srcset,e.sourceSetOptions)),t(this,A).call(this)}close(){super.close(),this.disconnect()}connect(){tt.windowResizer.subscribe(t(this,A),at.RESIZE_ORDER.SOURCE_MANAGER),t(this,A).call(this)}disconnect(){tt.windowResizer.unsubscribe(t(this,A))}}R=new WeakMap,A=new WeakMap;function ot(c){if(isNaN(c))return"0:00";const n=Math.floor(Math.max(0,c)),e=Math.floor(n/3600),a=Math.floor(n%3600/60),h=(n%60).toString().padStart(2,"0");if(e>0){const m=a.toString().padStart(2,"0");return`${e}:${m}:${h}`}else return`${a}:${h}`}let ct=0;var f,r,k,E,L,g,P,I,o,O,T,v,_,z,j,G,D,K,H,N,V;class ut extends HTMLElement{constructor(e){super();i(this,z);i(this,f,null);i(this,r,null);i(this,k,this);i(this,E,!1);i(this,L,!1);i(this,g,!1);i(this,P,"");i(this,I,"");i(this,o,new it.ElementLinkedStore(this,{loading:!1,loaded:!1,error:!1,clear:!1,playing:!1,metadata:!1}));i(this,O,null);i(this,T);i(this,v,null);i(this,_);i(this,G,e=>{const a=e[0];t(this,g)&&(!t(this,L)||this.hasAttribute("reload-source"))&&a.isIntersecting&&this.triggerLazyLoad(),a.isIntersecting?M.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&(F(this,z,j).call(this,void 0),s(this,L,!1)),M.dispatchEvent(this,"sourceRelease",{custom:!0}))});i(this,D,()=>{t(this,o).set("loaded",!0),t(this,o).set("error",!1),t(this,o).set("loading",!1),!t(this,g)&&!t(this,E)&&J.loading.complete(t(this,I)),M.dispatchEvent(this,"sourceLoaded",{custom:!0});const e=getComputedStyle(this).getPropertyValue("--clear-duration");e?s(this,T,setTimeout(()=>{t(this,o).set("clear",!0)},parseFloat(e)*1e3)):t(this,o).set("clear",!0),s(this,E,!0)});i(this,K,e=>{t(this,o).set("loaded",!1),t(this,o).set("error",!0),t(this,o).set("loading",!1),!t(this,g)&&!t(this,E)&&J.loading.error(t(this,I)),M.dispatchEvent(this,"sourceError",{custom:!0}),s(this,E,!0)});i(this,H,()=>{t(this,o).set("playing",!0),M.dispatchEvent(this,"sourcePlay",{custom:!0})});i(this,N,()=>{t(this,o).set("playing",!1),M.dispatchEvent(this,"sourcePause",{custom:!0})});i(this,V,()=>{const e=t(this,r);(e.tagName==="VIDEO"||e.tagName==="AUDIO")&&e.readyState>=1&&(t(this,o).set("metadata",!0),M.dispatchEvent(this,"sourceMetadataLoaded",{custom:!0}),this.querySelectorAll("[data-source-duration]").forEach(a=>{a.textContent=ot(e.duration)}))});s(this,_,e==null?void 0:e.sourceSetOptions),rt.isBrowser&&window.IntersectionObserver&&s(this,O,new IntersectionObserver(t(this,G))),t(this,o).subscribe(a=>{var h;const l=(h=this.getAttribute("data-global-play-class"))==null?void 0:h.split(",");l!=null&&l.length&&(a.current.playing?l.forEach(m=>{document.documentElement.classList.add(m.trim())}):l.forEach(m=>{document.documentElement.classList.remove(m.trim())}))})}get consumerElement(){return t(this,r)}get consumerHolderElement(){return t(this,k)}get sourceManager(){return t(this,f)}get status(){return t(this,o)}get isLazy(){return t(this,g)}get currentURL(){return t(this,v)}get isFirstLoadHappened(){return t(this,E)}triggerLazyLoad(){!t(this,L)&&t(this,f).current&&t(this,f).current!==t(this,f).previous&&(s(this,L,!0),F(this,z,j).call(this,t(this,f).current))}connectedCallback(){var l;s(this,P,`source-consumer-${++ct}`);const e=this.getAttribute("srcset")||"",a=this.hasAttribute("notify")?this.closest(this.getAttribute("notify")):null;a&&t(this,o).addElement(a),s(this,k,this.querySelector("[data-consumer-holder]")||this),(l=this.querySelector(".source-consumer"))==null||l.remove(),s(this,r,this.createConsumer()),t(this,r).style.cssText=`
2
+ display: block;
3
+ width: 100%;
4
+ height: 100%;
5
+ `,t(this,r).classList.add("source-consumer"),t(this,r).addEventListener("play",t(this,H)),t(this,r).addEventListener("pause",t(this,N)),t(this,r).addEventListener("loadedmetadata",t(this,V)),t(this,V).call(this),Array.from(this.attributes).forEach(h=>{if(h.name!=="srcset"){const m=h.nodeValue||"",w=nt.kebabToCamel(h.name);w in t(this,r)&&(t(this,r)[w]=m||!0)}}),t(this,k).appendChild(t(this,r)),s(this,f,new st({srcset:e,sourceSetOptions:t(this,_)})),s(this,g,this.hasAttribute("lazy")),t(this,f).subscribe(h=>{(!t(this,g)||t(this,g)&&t(this,L))&&F(this,z,j).call(this,h.current)}),t(this,f).connect(),t(this,O).observe(this)}disconnectedCallback(){var e;clearTimeout(t(this,T)),t(this,O).disconnect(),(e=t(this,f))==null||e.close(),t(this,r)&&(this.consumeSource(null),t(this,r).removeEventListener("play",t(this,H)),t(this,r).removeEventListener("pause",t(this,N)),t(this,r).removeEventListener("loadedmetadata",t(this,V)),t(this,r).onloadeddata=null,t(this,r).onload=null,t(this,r).onerror=null,t(this,r).onerror=null,t(this,r).remove()),s(this,E,!1),s(this,L,!1),t(this,o).reset()}}f=new WeakMap,r=new WeakMap,k=new WeakMap,E=new WeakMap,L=new WeakMap,g=new WeakMap,P=new WeakMap,I=new WeakMap,o=new WeakMap,O=new WeakMap,T=new WeakMap,v=new WeakMap,_=new WeakMap,z=new WeakSet,j=function(e){if(clearTimeout(t(this,T)),t(this,r).onloadeddata=null,t(this,r).onload=null,t(this,r).onerror=null,t(this,o).set("loaded",!1),t(this,o).set("error",!1),t(this,o).set("loading",!1),t(this,o).set("clear",!1),t(this,o).set("playing",!1),t(this,o).set("metadata",!1),e){s(this,I,`${t(this,P)}-${e.url}`);const a=this.hasAttribute("keep-source-parameters");t(this,o).set("loading",!0),s(this,v,a?e.url:e.name+e.extension),this.consumeSource(t(this,v)),!t(this,g)&&!t(this,E)&&J.loading.add(t(this,I)),t(this,r).onloadeddata=()=>{t(this,D).call(this)},t(this,r).onload=()=>{t(this,D).call(this)},t(this,r).onerror=()=>{t(this,K).call(this,t(this,v))}}else s(this,v,null),this.consumeSource(null)},G=new WeakMap,D=new WeakMap,K=new WeakMap,H=new WeakMap,N=new WeakMap,V=new WeakMap;exports.Source=et;exports.SourceElement=ut;exports.SourceManager=st;exports.SourceSet=Q;
@@ -1,54 +1,54 @@
1
- var Q = (c) => {
2
- throw TypeError(c);
1
+ var X = (l) => {
2
+ throw TypeError(l);
3
3
  };
4
- var W = (c, a, e) => a.has(c) || Q("Cannot " + e);
5
- var t = (c, a, e) => (W(c, a, "read from private field"), e ? e.call(c) : a.get(c)), i = (c, a, e) => a.has(c) ? Q("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(c) : a.set(c, e), s = (c, a, e, n) => (W(c, a, "write to private field"), n ? n.call(c, e) : a.set(c, e), e), H = (c, a, e) => (W(c, a, "access private method"), e);
6
- import { ElementLinkedStore as tt } from "./element-linked-store/index.js";
7
- import { i as et } from "./index-Bv9zgfdb.js";
8
- import { d as $ } from "./events-CsVF98U6.js";
9
- import { k as st } from "./string-BlMQbe8b.js";
4
+ var Z = (l, a, e) => a.has(l) || X("Cannot " + e);
5
+ var t = (l, a, e) => (Z(l, a, "read from private field"), e ? e.call(l) : a.get(l)), i = (l, a, e) => a.has(l) ? X("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(l) : a.set(l, e), s = (l, a, e, n) => (Z(l, a, "write to private field"), n ? n.call(l, e) : a.set(l, e), e), j = (l, a, e) => (Z(l, a, "access private method"), e);
6
+ import { ElementLinkedStore as et } from "./element-linked-store/index.js";
7
+ import { i as st } from "./index-Bv9zgfdb.js";
8
+ import { d as q } from "./events-CsVF98U6.js";
9
+ import { k as it } from "./string-BlMQbe8b.js";
10
10
  import "construct-style-sheets-polyfill";
11
- import { loading as Z } from "./loading/index.js";
12
- import { RESIZE_ORDER as it } from "./order/index.js";
13
- import { windowResizer as X } from "./window-resizer/index.js";
14
- import { S as rt } from "./Store-0BVty6AZ.js";
15
- var C, S, z, L, d, p, q;
16
- class at {
11
+ import { loading as J } from "./loading/index.js";
12
+ import { RESIZE_ORDER as rt } from "./order/index.js";
13
+ import { windowResizer as Y } from "./window-resizer/index.js";
14
+ import { S as at } from "./Store-0BVty6AZ.js";
15
+ var z, S, B, L, d, p, $;
16
+ class nt {
17
17
  constructor(a) {
18
- i(this, C);
19
- i(this, S);
20
18
  i(this, z);
19
+ i(this, S);
20
+ i(this, B);
21
21
  i(this, L);
22
22
  i(this, d);
23
23
  i(this, p);
24
- i(this, q);
25
- s(this, C, a);
24
+ i(this, $);
25
+ s(this, z, a);
26
26
  let e = a.split(".");
27
27
  const n = /\b\d{1,2}x\b/g, u = e.find((y) => y.match(n) && parseInt(y));
28
- s(this, z, u ? parseInt(u) : 1), u && (e = e.slice(0, -1)), s(this, S, e.length > 1 ? e.slice(0, -1).join(".") : e.join("."));
29
- const h = /\d+max/g, m = /\d+min/g, w = /\d+mar/g, F = /\d+mir/g, K = e.find((y) => y.match(h)), l = e.find((y) => y.match(m)), x = e.find((y) => y.match(w)), J = e.find((y) => y.match(F));
30
- x ? (s(this, d, parseInt(x)), s(this, p, "max"), s(this, L, `(max-aspect-ratio: ${t(this, d)})`)) : J ? (s(this, d, parseInt(J)), s(this, p, "max"), s(this, L, `(min-aspect-ratio: ${t(this, d)})`)) : K ? (s(this, d, parseInt(K)), s(this, p, "max"), s(this, L, `(max-width: ${t(this, d)}px)`)) : l ? (s(this, d, parseInt(l)), s(this, L, `(min-width: ${t(this, d)}px)`), s(this, p, "min")) : (s(this, d, 0), s(this, L, `(min-width: ${t(this, d)}px)`), s(this, p, "min")), s(this, S, t(this, S).replace(
28
+ s(this, B, u ? parseInt(u) : 1), u && (e = e.slice(0, -1)), s(this, S, e.length > 1 ? e.slice(0, -1).join(".") : e.join("."));
29
+ const h = /\d+max/g, m = /\d+min/g, w = /\d+mar/g, F = /\d+mir/g, W = e.find((y) => y.match(h)), c = e.find((y) => y.match(m)), x = e.find((y) => y.match(w)), Q = e.find((y) => y.match(F));
30
+ x ? (s(this, d, parseInt(x)), s(this, p, "max"), s(this, L, `(max-aspect-ratio: ${t(this, d)})`)) : Q ? (s(this, d, parseInt(Q)), s(this, p, "max"), s(this, L, `(min-aspect-ratio: ${t(this, d)})`)) : W ? (s(this, d, parseInt(W)), s(this, p, "max"), s(this, L, `(max-width: ${t(this, d)}px)`)) : c ? (s(this, d, parseInt(c)), s(this, L, `(min-width: ${t(this, d)}px)`), s(this, p, "min")) : (s(this, d, 0), s(this, L, `(min-width: ${t(this, d)}px)`), s(this, p, "min")), s(this, S, t(this, S).replace(
31
31
  `.${t(this, d)}${t(this, p)}`,
32
32
  ""
33
- )), s(this, q, e[e.length - 1] === t(this, S) ? "" : "." + e[e.length - 1]), s(this, q, t(this, q).replace(
33
+ )), s(this, $, e[e.length - 1] === t(this, S) ? "" : "." + e[e.length - 1]), s(this, $, t(this, $).replace(
34
34
  `.${t(this, d)}${t(this, p)}`,
35
35
  ""
36
36
  ));
37
37
  }
38
38
  get url() {
39
- return t(this, C);
39
+ return t(this, z);
40
40
  }
41
41
  get name() {
42
42
  return t(this, S);
43
43
  }
44
44
  get density() {
45
- return t(this, z);
45
+ return t(this, B);
46
46
  }
47
47
  get query() {
48
48
  return t(this, L);
49
49
  }
50
50
  get extension() {
51
- return t(this, q);
51
+ return t(this, $);
52
52
  }
53
53
  get queryType() {
54
54
  return t(this, p);
@@ -57,20 +57,20 @@ class at {
57
57
  return t(this, d);
58
58
  }
59
59
  }
60
- C = new WeakMap(), S = new WeakMap(), z = new WeakMap(), L = new WeakMap(), d = new WeakMap(), p = new WeakMap(), q = new WeakMap();
60
+ z = new WeakMap(), S = new WeakMap(), B = new WeakMap(), L = new WeakMap(), d = new WeakMap(), p = new WeakMap(), $ = new WeakMap();
61
61
  var M;
62
- class Y {
62
+ class tt {
63
63
  constructor(a, e) {
64
64
  i(this, M);
65
65
  s(this, M, /* @__PURE__ */ new Map());
66
- const n = (e == null ? void 0 : e.mediaBuckets) !== !1, u = typeof a == "string" ? n ? a.trim().split(",").map((l) => l.trim()).filter((l) => !!l) : [a] : a, h = [];
67
- u.forEach((l) => {
68
- const x = new at(l);
66
+ const n = (e == null ? void 0 : e.mediaBuckets) !== !1, u = typeof a == "string" ? n ? a.trim().split(",").map((c) => c.trim()).filter((c) => !!c) : [a] : a, h = [];
67
+ u.forEach((c) => {
68
+ const x = new nt(c);
69
69
  h.push([x.query, x]);
70
70
  });
71
- const m = h.filter((l) => l[1].queryType.includes("max")).sort((l, x) => x[1].queryValue - l[1].queryValue), w = h.filter((l) => l[1].queryType.includes("min") && l[1].queryValue !== 0).sort((l, x) => l[1].queryValue - x[1].queryValue), F = h.filter((l) => l[0] === "(min-width: 0px)");
72
- (F ? [...F, ...m, ...w] : [...m, ...w]).forEach((l) => {
73
- t(this, M).has(l[0]) || t(this, M).set(l[0], []), t(this, M).get(l[0]).push(l[1]);
71
+ const m = h.filter((c) => c[1].queryType.includes("max")).sort((c, x) => x[1].queryValue - c[1].queryValue), w = h.filter((c) => c[1].queryType.includes("min") && c[1].queryValue !== 0).sort((c, x) => c[1].queryValue - x[1].queryValue), F = h.filter((c) => c[0] === "(min-width: 0px)");
72
+ (F ? [...F, ...m, ...w] : [...m, ...w]).forEach((c) => {
73
+ t(this, M).has(c[0]) || t(this, M).set(c[0], []), t(this, M).get(c[0]).push(c[1]);
74
74
  });
75
75
  }
76
76
  get mediaBuckets() {
@@ -79,7 +79,7 @@ class Y {
79
79
  }
80
80
  M = new WeakMap();
81
81
  var k, A;
82
- class nt extends rt {
82
+ class ht extends at {
83
83
  constructor(e) {
84
84
  super(void 0);
85
85
  i(this, k);
@@ -93,45 +93,46 @@ class nt extends rt {
93
93
  h.density > u && h.density <= Math.max(devicePixelRatio, 1) && (u = h.density, n = h);
94
94
  }), e != null && e.length && !n && (n = e[0]), this.current = n;
95
95
  });
96
- s(this, k, new Y(e.srcset, e.sourceSetOptions));
96
+ s(this, k, new tt(e.srcset, e.sourceSetOptions));
97
97
  }
98
98
  updateSource(e) {
99
- s(this, k, new Y(e.srcset, e.sourceSetOptions)), t(this, A).call(this);
99
+ s(this, k, new tt(e.srcset, e.sourceSetOptions)), t(this, A).call(this);
100
100
  }
101
101
  close() {
102
102
  super.close(), this.disconnect();
103
103
  }
104
104
  connect() {
105
- X.subscribe(t(this, A), it.SOURCE_MANAGER), t(this, A).call(this);
105
+ Y.subscribe(t(this, A), rt.SOURCE_MANAGER), t(this, A).call(this);
106
106
  }
107
107
  disconnect() {
108
- X.unsubscribe(t(this, A));
108
+ Y.unsubscribe(t(this, A));
109
109
  }
110
110
  }
111
111
  k = new WeakMap(), A = new WeakMap();
112
- function ht(c) {
113
- if (isNaN(c)) return "0:00";
114
- const a = Math.floor(Math.max(0, c)), e = Math.floor(a / 3600), n = Math.floor(a % 3600 / 60), h = (a % 60).toString().padStart(2, "0");
112
+ function ot(l) {
113
+ if (isNaN(l)) return "0:00";
114
+ const a = Math.floor(Math.max(0, l)), e = Math.floor(a / 3600), n = Math.floor(a % 3600 / 60), h = (a % 60).toString().padStart(2, "0");
115
115
  if (e > 0) {
116
116
  const m = n.toString().padStart(2, "0");
117
117
  return `${e}:${m}:${h}`;
118
118
  } else
119
119
  return `${n}:${h}`;
120
120
  }
121
- let ot = 0;
122
- var f, r, E, b, g, B, I, o, O, R, v, P, T, j, _, D, G, N, U, V;
123
- class xt extends HTMLElement {
121
+ let lt = 0;
122
+ var f, r, O, E, b, g, P, I, o, R, T, v, D, V, _, G, H, K, N, U, C;
123
+ class Lt extends HTMLElement {
124
124
  constructor(e) {
125
125
  super();
126
- i(this, T);
126
+ i(this, V);
127
127
  i(this, f, null);
128
128
  i(this, r, null);
129
+ i(this, O, this);
129
130
  i(this, E, !1);
130
131
  i(this, b, !1);
131
132
  i(this, g, !1);
132
- i(this, B, "");
133
+ i(this, P, "");
133
134
  i(this, I, "");
134
- i(this, o, new tt(this, {
135
+ i(this, o, new et(this, {
135
136
  loading: !1,
136
137
  loaded: !1,
137
138
  error: !1,
@@ -139,38 +140,38 @@ class xt extends HTMLElement {
139
140
  playing: !1,
140
141
  metadata: !1
141
142
  }));
142
- i(this, O, null);
143
- i(this, R);
143
+ i(this, R, null);
144
+ i(this, T);
144
145
  i(this, v, null);
145
- i(this, P);
146
- i(this, _, (e) => {
146
+ i(this, D);
147
+ i(this, G, (e) => {
147
148
  const n = e[0];
148
- t(this, g) && (!t(this, b) || this.hasAttribute("reload-source")) && n.isIntersecting && this.triggerLazyLoad(), n.isIntersecting ? $(this, "sourceCapture", { custom: !0 }) : (this.hasAttribute("reload-source") && (H(this, T, j).call(this, void 0), s(this, b, !1)), $(this, "sourceRelease", { custom: !0 }));
149
+ t(this, g) && (!t(this, b) || this.hasAttribute("reload-source")) && n.isIntersecting && this.triggerLazyLoad(), n.isIntersecting ? q(this, "sourceCapture", { custom: !0 }) : (this.hasAttribute("reload-source") && (j(this, V, _).call(this, void 0), s(this, b, !1)), q(this, "sourceRelease", { custom: !0 }));
149
150
  });
150
- i(this, D, () => {
151
- t(this, o).set("loaded", !0), t(this, o).set("error", !1), t(this, o).set("loading", !1), !t(this, g) && !t(this, E) && Z.complete(t(this, I)), $(this, "sourceLoaded", { custom: !0 });
151
+ i(this, H, () => {
152
+ t(this, o).set("loaded", !0), t(this, o).set("error", !1), t(this, o).set("loading", !1), !t(this, g) && !t(this, E) && J.complete(t(this, I)), q(this, "sourceLoaded", { custom: !0 });
152
153
  const e = getComputedStyle(this).getPropertyValue("--clear-duration");
153
- e ? s(this, R, setTimeout(() => {
154
+ e ? s(this, T, setTimeout(() => {
154
155
  t(this, o).set("clear", !0);
155
156
  }, parseFloat(e) * 1e3)) : t(this, o).set("clear", !0), s(this, E, !0);
156
157
  });
157
- i(this, G, (e) => {
158
- t(this, o).set("loaded", !1), t(this, o).set("error", !0), t(this, o).set("loading", !1), !t(this, g) && !t(this, E) && Z.error(t(this, I)), $(this, "sourceError", { custom: !0 }), s(this, E, !0);
158
+ i(this, K, (e) => {
159
+ t(this, o).set("loaded", !1), t(this, o).set("error", !0), t(this, o).set("loading", !1), !t(this, g) && !t(this, E) && J.error(t(this, I)), q(this, "sourceError", { custom: !0 }), s(this, E, !0);
159
160
  });
160
161
  i(this, N, () => {
161
- t(this, o).set("playing", !0), $(this, "sourcePlay", { custom: !0 });
162
+ t(this, o).set("playing", !0), q(this, "sourcePlay", { custom: !0 });
162
163
  });
163
164
  i(this, U, () => {
164
- t(this, o).set("playing", !1), $(this, "sourcePause", { custom: !0 });
165
+ t(this, o).set("playing", !1), q(this, "sourcePause", { custom: !0 });
165
166
  });
166
- i(this, V, () => {
167
+ i(this, C, () => {
167
168
  const e = t(this, r);
168
- (e.tagName === "VIDEO" || e.tagName === "AUDIO") && e.readyState >= 1 && (t(this, o).set("metadata", !0), $(this, "sourceMetadataLoaded", { custom: !0 }), this.querySelectorAll("[data-source-duration]").forEach((n) => {
169
- n.textContent = ht(e.duration);
169
+ (e.tagName === "VIDEO" || e.tagName === "AUDIO") && e.readyState >= 1 && (t(this, o).set("metadata", !0), q(this, "sourceMetadataLoaded", { custom: !0 }), this.querySelectorAll("[data-source-duration]").forEach((n) => {
170
+ n.textContent = ot(e.duration);
170
171
  }));
171
172
  });
172
- s(this, P, e == null ? void 0 : e.sourceSetOptions), et && window.IntersectionObserver && s(this, O, new IntersectionObserver(
173
- t(this, _)
173
+ s(this, D, e == null ? void 0 : e.sourceSetOptions), st && window.IntersectionObserver && s(this, R, new IntersectionObserver(
174
+ t(this, G)
174
175
  )), t(this, o).subscribe((n) => {
175
176
  var h;
176
177
  const u = (h = this.getAttribute("data-global-play-class")) == null ? void 0 : h.split(
@@ -186,6 +187,9 @@ class xt extends HTMLElement {
186
187
  get consumerElement() {
187
188
  return t(this, r);
188
189
  }
190
+ get consumerHolderElement() {
191
+ return t(this, O);
192
+ }
189
193
  get sourceManager() {
190
194
  return t(this, f);
191
195
  }
@@ -202,56 +206,56 @@ class xt extends HTMLElement {
202
206
  return t(this, E);
203
207
  }
204
208
  triggerLazyLoad() {
205
- !t(this, b) && t(this, f).current && t(this, f).current !== t(this, f).previous && (s(this, b, !0), H(this, T, j).call(this, t(this, f).current));
209
+ !t(this, b) && t(this, f).current && t(this, f).current !== t(this, f).previous && (s(this, b, !0), j(this, V, _).call(this, t(this, f).current));
206
210
  }
207
211
  connectedCallback() {
208
212
  var u;
209
- s(this, B, `source-consumer-${++ot}`);
213
+ s(this, P, `source-consumer-${++lt}`);
210
214
  const e = this.getAttribute("srcset") || "", n = this.hasAttribute("notify") ? this.closest(this.getAttribute("notify")) : null;
211
- n && t(this, o).addElement(n), (u = this.querySelector(".source-consumer")) == null || u.remove(), s(this, r, this.createConsumer()), t(this, r).style.cssText = `
215
+ n && t(this, o).addElement(n), s(this, O, this.querySelector("[data-consumer-holder]") || this), (u = this.querySelector(".source-consumer")) == null || u.remove(), s(this, r, this.createConsumer()), t(this, r).style.cssText = `
212
216
  display: block;
213
217
  width: 100%;
214
218
  height: 100%;
215
219
  `, t(this, r).classList.add("source-consumer"), t(this, r).addEventListener("play", t(this, N)), t(this, r).addEventListener("pause", t(this, U)), t(this, r).addEventListener(
216
220
  "loadedmetadata",
217
- t(this, V)
218
- ), t(this, V).call(this), Array.from(this.attributes).forEach((h) => {
221
+ t(this, C)
222
+ ), t(this, C).call(this), Array.from(this.attributes).forEach((h) => {
219
223
  if (h.name !== "srcset") {
220
- const m = h.nodeValue || "", w = st(h.name);
224
+ const m = h.nodeValue || "", w = it(h.name);
221
225
  w in t(this, r) && (t(this, r)[w] = m || !0);
222
226
  }
223
- }), this.appendChild(t(this, r)), s(this, f, new nt({
227
+ }), t(this, O).appendChild(t(this, r)), s(this, f, new ht({
224
228
  srcset: e,
225
- sourceSetOptions: t(this, P)
229
+ sourceSetOptions: t(this, D)
226
230
  })), s(this, g, this.hasAttribute("lazy")), t(this, f).subscribe((h) => {
227
- (!t(this, g) || t(this, g) && t(this, b)) && H(this, T, j).call(this, h.current);
228
- }), t(this, f).connect(), t(this, O).observe(this);
231
+ (!t(this, g) || t(this, g) && t(this, b)) && j(this, V, _).call(this, h.current);
232
+ }), t(this, f).connect(), t(this, R).observe(this);
229
233
  }
230
234
  disconnectedCallback() {
231
235
  var e;
232
- clearTimeout(t(this, R)), t(this, O).disconnect(), (e = t(this, f)) == null || e.close(), t(this, r) && (this.consumeSource(null), t(this, r).removeEventListener("play", t(this, N)), t(this, r).removeEventListener("pause", t(this, U)), t(this, r).removeEventListener(
236
+ clearTimeout(t(this, T)), t(this, R).disconnect(), (e = t(this, f)) == null || e.close(), t(this, r) && (this.consumeSource(null), t(this, r).removeEventListener("play", t(this, N)), t(this, r).removeEventListener("pause", t(this, U)), t(this, r).removeEventListener(
233
237
  "loadedmetadata",
234
- t(this, V)
238
+ t(this, C)
235
239
  ), t(this, r).onloadeddata = null, t(this, r).onload = null, t(this, r).onerror = null, t(this, r).onerror = null, t(this, r).remove()), s(this, E, !1), s(this, b, !1), t(this, o).reset();
236
240
  }
237
241
  }
238
- f = new WeakMap(), r = new WeakMap(), E = new WeakMap(), b = new WeakMap(), g = new WeakMap(), B = new WeakMap(), I = new WeakMap(), o = new WeakMap(), O = new WeakMap(), R = new WeakMap(), v = new WeakMap(), P = new WeakMap(), T = new WeakSet(), j = function(e) {
239
- if (clearTimeout(t(this, R)), t(this, r).onloadeddata = null, t(this, r).onload = null, t(this, r).onerror = null, t(this, o).set("loaded", !1), t(this, o).set("error", !1), t(this, o).set("loading", !1), t(this, o).set("clear", !1), t(this, o).set("playing", !1), t(this, o).set("metadata", !1), e) {
240
- s(this, I, `${t(this, B)}-${e.url}`);
242
+ f = new WeakMap(), r = new WeakMap(), O = new WeakMap(), E = new WeakMap(), b = new WeakMap(), g = new WeakMap(), P = new WeakMap(), I = new WeakMap(), o = new WeakMap(), R = new WeakMap(), T = new WeakMap(), v = new WeakMap(), D = new WeakMap(), V = new WeakSet(), _ = function(e) {
243
+ if (clearTimeout(t(this, T)), t(this, r).onloadeddata = null, t(this, r).onload = null, t(this, r).onerror = null, t(this, o).set("loaded", !1), t(this, o).set("error", !1), t(this, o).set("loading", !1), t(this, o).set("clear", !1), t(this, o).set("playing", !1), t(this, o).set("metadata", !1), e) {
244
+ s(this, I, `${t(this, P)}-${e.url}`);
241
245
  const n = this.hasAttribute("keep-source-parameters");
242
- t(this, o).set("loading", !0), s(this, v, n ? e.url : e.name + e.extension), this.consumeSource(t(this, v)), !t(this, g) && !t(this, E) && Z.add(t(this, I)), t(this, r).onloadeddata = () => {
243
- t(this, D).call(this);
246
+ t(this, o).set("loading", !0), s(this, v, n ? e.url : e.name + e.extension), this.consumeSource(t(this, v)), !t(this, g) && !t(this, E) && J.add(t(this, I)), t(this, r).onloadeddata = () => {
247
+ t(this, H).call(this);
244
248
  }, t(this, r).onload = () => {
245
- t(this, D).call(this);
249
+ t(this, H).call(this);
246
250
  }, t(this, r).onerror = () => {
247
- t(this, G).call(this, t(this, v));
251
+ t(this, K).call(this, t(this, v));
248
252
  };
249
253
  } else
250
254
  s(this, v, null), this.consumeSource(null);
251
- }, _ = new WeakMap(), D = new WeakMap(), G = new WeakMap(), N = new WeakMap(), U = new WeakMap(), V = new WeakMap();
255
+ }, G = new WeakMap(), H = new WeakMap(), K = new WeakMap(), N = new WeakMap(), U = new WeakMap(), C = new WeakMap();
252
256
  export {
253
- at as S,
254
- xt as a,
255
- Y as b,
256
- nt as c
257
+ nt as S,
258
+ Lt as a,
259
+ tt as b,
260
+ ht as c
257
261
  };
@@ -1 +1 @@
1
- "use strict";var u=r=>{throw TypeError(r)};var a=(r,t,e)=>t.has(r)||u("Cannot "+e);var s=(r,t,e)=>(a(r,t,"read from private field"),e?e.call(r):t.get(r)),o=(r,t,e)=>t.has(r)?u("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e),c=(r,t,e,i)=>(a(r,t,"write to private field"),i?i.call(r,e):t.set(r,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../SourceElement-8nqiFLJ2.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const f=require("../index-DekP7OZe.cjs");require("construct-style-sheets-polyfill");var n,l,m;class E extends h.SourceElement{constructor(){super({sourceSetOptions:{mediaBuckets:!1}});o(this,n,null);o(this,l,()=>{var e,i;(i=(e=this.consumerElement).onload)==null||i.call(e,new Event("load"))});o(this,m,()=>{var e,i;(i=(e=this.consumerElement).onload)==null||i.call(e,new Event("error"))})}createConsumer(){return document.createElement("div")}consumeSource(e){s(this,n)&&(s(this,n).onload=null,s(this,n).onerror=null),this.consumerElement.innerHTML=(e==null?void 0:e.replace(/\\u003C/g,"<").replace(/\\u003E/g,">").replace(/\\"/g,'"'))||"",c(this,n,this.consumerElement.querySelector("iframe")),s(this,n)&&(s(this,n).onload=s(this,l),s(this,n).onerror=s(this,m))}}n=new WeakMap,l=new WeakMap,m=new WeakMap;f.isBrowser&&!customElements.get("e-iframe")&&customElements.define("e-iframe",E);exports.IFrameElement=E;
1
+ "use strict";var u=r=>{throw TypeError(r)};var a=(r,t,e)=>t.has(r)||u("Cannot "+e);var s=(r,t,e)=>(a(r,t,"read from private field"),e?e.call(r):t.get(r)),o=(r,t,e)=>t.has(r)?u("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e),c=(r,t,e,i)=>(a(r,t,"write to private field"),i?i.call(r,e):t.set(r,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../SourceElement-0vRhCW3O.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const f=require("../index-DekP7OZe.cjs");require("construct-style-sheets-polyfill");var n,l,m;class E extends h.SourceElement{constructor(){super({sourceSetOptions:{mediaBuckets:!1}});o(this,n,null);o(this,l,()=>{var e,i;(i=(e=this.consumerElement).onload)==null||i.call(e,new Event("load"))});o(this,m,()=>{var e,i;(i=(e=this.consumerElement).onload)==null||i.call(e,new Event("error"))})}createConsumer(){return document.createElement("div")}consumeSource(e){s(this,n)&&(s(this,n).onload=null,s(this,n).onerror=null),this.consumerElement.innerHTML=(e==null?void 0:e.replace(/\\u003C/g,"<").replace(/\\u003E/g,">").replace(/\\"/g,'"'))||"",c(this,n,this.consumerElement.querySelector("iframe")),s(this,n)&&(s(this,n).onload=s(this,l),s(this,n).onerror=s(this,m))}}n=new WeakMap,l=new WeakMap,m=new WeakMap;f.isBrowser&&!customElements.get("e-iframe")&&customElements.define("e-iframe",E);exports.IFrameElement=E;
@@ -3,7 +3,7 @@ var a = (r) => {
3
3
  };
4
4
  var u = (r, t, e) => t.has(r) || a("Cannot " + e);
5
5
  var s = (r, t, e) => (u(r, t, "read from private field"), e ? e.call(r) : t.get(r)), i = (r, t, e) => t.has(r) ? a("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, e), c = (r, t, e, o) => (u(r, t, "write to private field"), o ? o.call(r, e) : t.set(r, e), e);
6
- import { a as E } from "../SourceElement-DrZ3QNm-.js";
6
+ import { a as E } from "../SourceElement-Cvtgjo07.js";
7
7
  import "../window-resizer/index.js";
8
8
  import "../Store-0BVty6AZ.js";
9
9
  import { i as f } from "../index-Bv9zgfdb.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../Viewport-DB0qAZPJ.cjs"),i=require("../SourceElement-8nqiFLJ2.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const n=require("../index-DekP7OZe.cjs");require("construct-style-sheets-polyfill");class t extends i.SourceElement{createConsumer(){return document.createElement("img")}consumeSource(e){if(e&&this.hasAttribute("webp")&&s.device.isWebp){const r=e.split(".").slice(0,-1).join(".")+".webp";this.consumerElement.src=r}else this.consumerElement.src=e||""}}n.isBrowser&&!customElements.get("e-image")&&customElements.define("e-image",t);exports.ImageElement=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../Viewport-DB0qAZPJ.cjs"),i=require("../SourceElement-0vRhCW3O.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const n=require("../index-DekP7OZe.cjs");require("construct-style-sheets-polyfill");class t extends i.SourceElement{createConsumer(){return document.createElement("img")}consumeSource(e){if(e&&this.hasAttribute("webp")&&s.device.isWebp){const r=e.split(".").slice(0,-1).join(".")+".webp";this.consumerElement.src=r}else this.consumerElement.src=e||""}}n.isBrowser&&!customElements.get("e-image")&&customElements.define("e-image",t);exports.ImageElement=t;
@@ -1,5 +1,5 @@
1
1
  import { d as m } from "../Viewport-DA10iWAO.js";
2
- import { a as s } from "../SourceElement-DrZ3QNm-.js";
2
+ import { a as s } from "../SourceElement-Cvtgjo07.js";
3
3
  import "../window-resizer/index.js";
4
4
  import "../Store-0BVty6AZ.js";
5
5
  import { i } from "../index-Bv9zgfdb.js";
@@ -1 +1 @@
1
- "use strict";var oe=l=>{throw TypeError(l)};var ee=(l,n,t)=>n.has(l)||oe("Cannot "+t);var e=(l,n,t)=>(ee(l,n,"read from private field"),t?t.call(l):n.get(l)),r=(l,n,t)=>n.has(l)?oe("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(l):n.set(l,t),o=(l,n,t,s)=>(ee(l,n,"write to private field"),s?s.call(l,t):n.set(l,t),t),p=(l,n,t)=>(ee(l,n,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ue=require("../element-linked-store/index.cjs"),E=require("../css-property/index.cjs"),ie=require("../index-DekP7OZe.cjs"),M=require("../events-KVanG9sR.cjs"),pe=require("../function-MthRj-GJ.cjs"),ne=require("../style-At6aDoqG.cjs");require("construct-style-sheets-polyfill");const he=require("../url-YEESIcRn.cjs"),le=require("../window-resizer/index.cjs"),Q=require("../Viewport-DB0qAZPJ.cjs");var d,w,_,N;class de{constructor(){r(this,d,new Map);r(this,w,[]);r(this,_,n=>{var s;const t=[...e(this,w)].reverse().find(i=>i.clickOutside.current);if(t){const i=n.composedPath();if(i.find(re=>re instanceof HTMLElement&&re.hasAttribute("data-popover-content")))return;const c=i[0],f=c instanceof Node&&(t.contains(c)||((s=t.shadowRoot)==null?void 0:s.contains(c))),F=c instanceof HTMLElement&&c.hasAttribute("data-outside");(!f||F)&&t.close()}});r(this,N,n=>{if(n.code==="Escape"){const t=[...e(this,w)].reverse().find(s=>s.escape.current);t&&t.close()}});document.documentElement.addEventListener("click",e(this,_)),addEventListener("keydown",e(this,N))}get groups(){return e(this,d)}get stack(){return e(this,w)}add(n,t){if(t.closeRest.current)e(this,d).forEach(i=>{i.forEach(c=>{c.close()})});else if(t.closeRestInGroup.current){let i=e(this,d).get(n);i==null||i.forEach(c=>{c.close()})}let s=e(this,d).get(n);s!=null&&s.length||(s=[],e(this,d).set(n,s)),e(this,w).push(t),s.push(t)}remove(n,t){if(setTimeout(()=>{o(this,w,e(this,w).filter(s=>s!==t))}),t.closeRest.current){let s=[];e(this,d).forEach(i=>{i.forEach(c=>s.push(c))}),e(this,d).clear(),s.forEach(i=>i.close())}else if(t.closeRestInGroup.current){const s=e(this,d).get(n);e(this,d).delete(n),s==null||s.forEach(i=>{i.close()})}else{let s=e(this,d).get(n);s&&(s=s.filter(i=>i!==t),e(this,d).set(n,s))}}}d=new WeakMap,w=new WeakMap,_=new WeakMap,N=new WeakMap;var v,z,B,k,H,m,T,A,x,b,R,q,C,y,$,a,V,W,u,ce,L,Z,G,O,j,X,D;const S=class S extends HTMLElement{constructor(){super();r(this,u);r(this,v);r(this,z);r(this,B);r(this,k);r(this,H);r(this,m);r(this,T);r(this,A);r(this,x);r(this,b);r(this,R);r(this,q);r(this,C);r(this,y);r(this,$);r(this,a);r(this,V);r(this,W);r(this,G);r(this,O);r(this,j);r(this,X);r(this,D);this.urlValue="",o(this,v,!1),o(this,m,new E.CSSProperty(this,"--history",!1)),o(this,T,new E.CSSProperty(this,"--restore",!1)),o(this,A,new E.CSSProperty(this,"--close-rest",!1)),o(this,x,new E.CSSProperty(this,"--close-rest-in-group",!1)),o(this,b,new E.CSSProperty(this,"--group","")),o(this,R,new E.CSSProperty(this,"--click-outside",!1)),o(this,q,new E.CSSProperty(this,"--escape",!1)),o(this,C,new E.CSSProperty(this,"--check-viewport-bounds",!1)),o(this,y,!0),o(this,a,new ue.ElementLinkedStore(this,{triggered:!1,beforeopen:!1,opened:!1,closing:!1,transitionend:!1})),o(this,V,[]),o(this,W,[]),o(this,G,()=>{o(this,y,!1),e(this,v)&&e(this,m).current&&!location.search.includes(this.id)?this.close():!e(this,v)&&e(this,m).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),o(this,y,!0)}),o(this,O,()=>{this.style.setProperty("--content-width","initial"),this.style.setProperty("--content-height","initial"),this.style.setProperty("--viewport-offset-x","0px"),this.style.setProperty("--viewport-offset-y","0px"),e(this,j).call(this)}),o(this,j,pe.debounce(()=>{e(this,X).call(this)},10)),o(this,X,()=>{if(this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px"),e(this,C).current){const t=this.getBoundingClientRect();let s=0,i=0;t.right>Q.viewport.width?s=Q.viewport.width-t.right:t.left<0&&(s=t.left*-1),t.bottom>Q.viewport.height?i=Q.viewport.height-t.bottom:t.top<0&&(i=t.top*-1),this.style.setProperty("--viewport-offset-x",s+"px"),this.style.setProperty("--viewport-offset-y",i+"px")}}),o(this,D,()=>{this.close()}),e(this,b).subscribe(t=>{t.previous&&(S.stack.remove(t.previous,this),t.current||(document.documentElement.classList.remove(`${this.group.previous}-closing`),document.documentElement.classList.remove(`${this.group.previous}-opened`)))}),e(this,a).subscribe(t=>{if(this.group.current){document.documentElement.classList.toggle(`${this.group.current}-closing`,t.current.closing);const s=S.stack.groups.get(this.group.current),i=s==null?void 0:s.find(c=>c.opened);document.documentElement.classList.toggle(`${this.group.current}-opened`,!!i)}})}get openClass(){return this.getAttribute("data-open-global-class")}get closingClass(){return this.getAttribute("data-closing-global-class")}get history(){return e(this,m)}get restore(){return e(this,T)}get closeRest(){return e(this,A)}get closeRestInGroup(){return e(this,x)}get group(){return e(this,b)}get clickOutside(){return e(this,R)}get escape(){return e(this,q)}get opened(){return e(this,v)}get lastTrigger(){return e(this,$)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,v)&&he.updateSearchParameter(this.id,t)}open(t){if(e(this,v))return;o(this,$,t==null?void 0:t.trigger),clearTimeout(e(this,z)),clearTimeout(e(this,B)),p(this,u,L).call(this,!1,this.closingClass),e(this,a).set("closing",!1),e(this,a).set("triggered",!0),M.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,$)}}),e(this,m).current&&e(this,y)&&history.pushState(history.state,"",e(this,u,ce)),e(this,a).set("beforeopen",!0),o(this,v,!0);const s=()=>{S.stack.add(e(this,b).current,this),e(this,W).forEach(i=>{i.scroll({top:0,left:0,behavior:"instant"})}),p(this,u,L).call(this,!0,this.openClass),e(this,a).set("opened",!0),M.dispatchEvent(window,"resize"),M.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,$)},bubbles:!0}),o(this,k,void 0),o(this,H,setTimeout(()=>{e(this,a).set("transitionend",!0),M.dispatchEvent(this,"popoverTransitionend")},ne.getElementTransitionDurationMS(this)+10))};t!=null&&t.skipTransition?s():o(this,k,requestAnimationFrame(s))}close(){e(this,v)&&(o(this,v,!1),cancelAnimationFrame(e(this,k)),clearTimeout(e(this,H)),S.stack.remove(e(this,b).current,this),p(this,u,Z).call(this),o(this,z,setTimeout(()=>{e(this,a).set("transitionend",!1),e(this,a).set("opened",!1),e(this,a).set("closing",!0),p(this,u,L).call(this,!1,this.openClass),p(this,u,L).call(this,!0,this.closingClass),M.dispatchEvent(this,"popoverClosing",{custom:!0,bubbles:!0}),o(this,B,setTimeout(()=>{e(this,a).set("triggered",!1),e(this,a).set("beforeopen",!1),e(this,a).set("closing",!1),p(this,u,L).call(this,!1,this.closingClass),M.dispatchEvent(this,"popoverClosed",{custom:!0,bubbles:!0})},ne.getElementTransitionDurationMS(this)+10))},10)))}connectedCallback(){o(this,V,[...this.querySelectorAll(`[data-popover-close${this.id?`="${this.id}"`:""}]`)]),e(this,V).forEach(t=>{t.addEventListener("click",e(this,D))}),o(this,W,[...this.querySelectorAll(`[data-popover-reset-scroll${this.id?`="${this.id}"`:""}]`)]),e(this,m).observe(),e(this,T).observe(),e(this,A).observe(),e(this,x).observe(),e(this,b).observe(),e(this,R).observe(),e(this,q).observe(),e(this,C).observe(),this.setAttribute("role","dialog"),addEventListener("popstate",e(this,G)),setTimeout(()=>{e(this,T).current?(o(this,y,!1),this.urlValue=he.parseSearchParameters(location.search)[this.id],location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),o(this,y,!0)):(p(this,u,Z).call(this),o(this,y,!0))},0),e(this,C).subscribe(()=>{e(this,O).call(this)}),le.windowResizer.subscribe(e(this,O))}disconnectedCallback(){e(this,V).forEach(t=>{t.removeEventListener("click",e(this,D))}),S.stack.remove(e(this,b).current,this),le.windowResizer.unsubscribe(e(this,O)),e(this,m).close(),e(this,T).close(),e(this,A).close(),e(this,x).close(),e(this,b).close(),e(this,R).close(),e(this,q).close(),e(this,C).close(),this.removeAttribute("role"),p(this,u,L).call(this,!1,this.openClass),p(this,u,L).call(this,!1,this.closingClass),clearTimeout(e(this,z)),clearTimeout(e(this,B)),clearTimeout(e(this,k)),clearTimeout(e(this,H)),removeEventListener("popstate",e(this,G)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),this.style.removeProperty("--viewport-offset-x"),this.style.removeProperty("--viewport-offset-y"),p(this,u,Z).call(this)}};v=new WeakMap,z=new WeakMap,B=new WeakMap,k=new WeakMap,H=new WeakMap,m=new WeakMap,T=new WeakMap,A=new WeakMap,x=new WeakMap,b=new WeakMap,R=new WeakMap,q=new WeakMap,C=new WeakMap,y=new WeakMap,$=new WeakMap,a=new WeakMap,V=new WeakMap,W=new WeakMap,u=new WeakSet,ce=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},L=function(t,s){s&&s.split(" ").map(i=>{document.documentElement.classList.toggle(i.trim(),t)})},Z=function(){if(e(this,m).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},G=new WeakMap,O=new WeakMap,j=new WeakMap,X=new WeakMap,D=new WeakMap,S.stack=new de;let U=S;ie.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",U);var h,g,P,te,Y,I,J,K,se;class ae extends HTMLElement{constructor(){super();r(this,P);r(this,h);r(this,g,new E.CSSProperty(this,"--type","open"));r(this,Y,t=>{t.target===e(this,h)&&e(this,g).current!=="close"&&this.classList.add("triggered")});r(this,I,t=>{t.target===e(this,h)&&e(this,g).current!=="close"&&(this.classList.add("opened"),this.setAttribute("aria-expanded","true"))});r(this,J,t=>{t.target===e(this,h)&&e(this,g).current!=="close"&&this.classList.remove("opened")});r(this,K,t=>{t.target===e(this,h)&&e(this,g).current!=="close"&&(this.classList.remove("triggered"),this.setAttribute("aria-expanded","false"))});ie.isBrowser&&(this.addEventListener("click",()=>{if(e(this,h)){const t=e(this,g).current;t==="open"||t==="toggle"&&!e(this,h).opened?e(this,h).open({trigger:this}):(t==="close"||t==="toggle"&&e(this,h).opened)&&e(this,h).close()}}),this.addEventListener("keydown",t=>{t.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(t.preventDefault(),this.click())}))}get type(){return e(this,g)}get popoverElement(){return e(this,h)}changePopover(t){var s;if(p(this,P,te).call(this),t){let i=null;if(t==="parent"){const c=this.closest("[data-popover]");if(c)i=c;else{const f=this.getRootNode();f instanceof ShadowRoot?i=f.host.closest("[data-popover]"):f instanceof HTMLElement&&(i=f.closest("[data-popover]"))}}else if(t==="sibling")i=(s=this.parentElement)==null?void 0:s.querySelector("[data-popover]");else if(t==="ancestor-child"){const c=f=>{if(!f)return null;let F=f.querySelector("[data-popover]");return!F&&(f!=null&&f.parentElement)&&(F=c(f.parentElement)),F};i=c(this.parentElement)||null}else!t.startsWith(".")&&!t.startsWith("[")&&(t=`#${t}`),i=document.querySelector(t)||this.getRootNode().querySelector(t);i instanceof HTMLElement?(o(this,h,i),e(this,h).addEventListener("popoverTriggered",e(this,Y)),e(this,h).addEventListener("popoverOpened",e(this,I)),e(this,h).addEventListener("popoverClosing",e(this,J)),e(this,h).addEventListener("popoverClosed",e(this,K))):console.warn(this,`target ${t} not found`)}p(this,P,se).call(this,e(this,g).current)}connectedCallback(){e(this,g).subscribe(s=>{p(this,P,se).call(this,s.current)}),this.hasAttribute("tabindex")||(this.tabIndex=0),this.hasAttribute("role")||this.setAttribute("role","button");const t=this.getAttribute("target");t&&this.changePopover(t),this.isConnected&&e(this,g).observe()}disconnectedCallback(){e(this,g).unobserve(),this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls"),this.removeAttribute("role"),this.removeAttribute("tabindex"),p(this,P,te).call(this)}}h=new WeakMap,g=new WeakMap,P=new WeakSet,te=function(){e(this,h)&&(e(this,h).removeEventListener("popoverTriggered",e(this,Y)),e(this,h).removeEventListener("popoverOpened",e(this,I)),e(this,h).removeEventListener("popoverClosing",e(this,J)),e(this,h).removeEventListener("popoverClosed",e(this,K)))},Y=new WeakMap,I=new WeakMap,J=new WeakMap,K=new WeakMap,se=function(t){e(this,h)instanceof U&&(t!=="close"?(this.setAttribute("aria-haspopup","true"),this.setAttribute("aria-expanded",e(this,h).opened?"true":"false"),this.setAttribute("aria-controls",e(this,h).id||"")):(this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls")))};ie.isBrowser&&!customElements.get("e-popover-button")&&customElements.define("e-popover-button",ae);exports.PopoverButtonElement=ae;exports.PopoverElement=U;
1
+ "use strict";var oe=l=>{throw TypeError(l)};var ee=(l,n,t)=>n.has(l)||oe("Cannot "+t);var e=(l,n,t)=>(ee(l,n,"read from private field"),t?t.call(l):n.get(l)),r=(l,n,t)=>n.has(l)?oe("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(l):n.set(l,t),o=(l,n,t,s)=>(ee(l,n,"write to private field"),s?s.call(l,t):n.set(l,t),t),p=(l,n,t)=>(ee(l,n,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ue=require("../element-linked-store/index.cjs"),E=require("../css-property/index.cjs"),ie=require("../index-DekP7OZe.cjs"),M=require("../events-KVanG9sR.cjs"),pe=require("../function-MthRj-GJ.cjs"),ne=require("../style-At6aDoqG.cjs");require("construct-style-sheets-polyfill");const he=require("../url-YEESIcRn.cjs"),le=require("../window-resizer/index.cjs"),Q=require("../Viewport-DB0qAZPJ.cjs");var d,w,_,N;class de{constructor(){r(this,d,new Map);r(this,w,[]);r(this,_,n=>{var s;const t=[...e(this,w)].reverse().find(i=>i.clickOutside.current);if(t){const i=n.composedPath();if(i.find(re=>re instanceof HTMLElement&&re.hasAttribute("data-popover-content")))return;const c=i[0],f=c instanceof Node&&(t.contains(c)||((s=t.shadowRoot)==null?void 0:s.contains(c))),F=c instanceof HTMLElement&&c.hasAttribute("data-outside");(!f||F)&&t.close()}});r(this,N,n=>{if(n.code==="Escape"){const t=[...e(this,w)].reverse().find(s=>s.escape.current);t&&t.close()}});document.documentElement.addEventListener("click",e(this,_)),addEventListener("keydown",e(this,N))}get groups(){return e(this,d)}get stack(){return e(this,w)}add(n,t){if(t.closeRest.current)e(this,d).forEach(i=>{i.forEach(c=>{c.close()})});else if(t.closeRestInGroup.current){let i=e(this,d).get(n);i==null||i.forEach(c=>{c.close()})}let s=e(this,d).get(n);s!=null&&s.length||(s=[],e(this,d).set(n,s)),e(this,w).push(t),s.push(t)}remove(n,t){if(setTimeout(()=>{o(this,w,e(this,w).filter(s=>s!==t))}),t.closeRest.current){let s=[];e(this,d).forEach(i=>{i.forEach(c=>s.push(c))}),e(this,d).clear(),s.forEach(i=>i.close())}else if(t.closeRestInGroup.current){const s=e(this,d).get(n);e(this,d).delete(n),s==null||s.forEach(i=>{i.close()})}else{let s=e(this,d).get(n);s&&(s=s.filter(i=>i!==t),e(this,d).set(n,s))}}}d=new WeakMap,w=new WeakMap,_=new WeakMap,N=new WeakMap;var v,z,B,k,H,m,T,A,x,b,R,q,C,y,$,a,V,W,u,ce,L,Z,G,O,j,X,D;const S=class S extends HTMLElement{constructor(){super();r(this,u);r(this,v);r(this,z);r(this,B);r(this,k);r(this,H);r(this,m);r(this,T);r(this,A);r(this,x);r(this,b);r(this,R);r(this,q);r(this,C);r(this,y);r(this,$);r(this,a);r(this,V);r(this,W);r(this,G);r(this,O);r(this,j);r(this,X);r(this,D);this.urlValue="",o(this,v,!1),o(this,m,new E.CSSProperty(this,"--history",!1)),o(this,T,new E.CSSProperty(this,"--restore",!1)),o(this,A,new E.CSSProperty(this,"--close-rest",!1)),o(this,x,new E.CSSProperty(this,"--close-rest-in-group",!1)),o(this,b,new E.CSSProperty(this,"--group","")),o(this,R,new E.CSSProperty(this,"--click-outside",!1)),o(this,q,new E.CSSProperty(this,"--escape",!1)),o(this,C,new E.CSSProperty(this,"--check-viewport-bounds",!1)),o(this,y,!0),o(this,a,new ue.ElementLinkedStore(this,{triggered:!1,beforeopen:!1,opened:!1,closing:!1,transitionend:!1})),o(this,V,[]),o(this,W,[]),o(this,G,()=>{o(this,y,!1),e(this,v)&&e(this,m).current&&!location.search.includes(this.id)?this.close():!e(this,v)&&e(this,m).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),o(this,y,!0)}),o(this,O,()=>{this.style.setProperty("--content-width","initial"),this.style.setProperty("--content-height","initial"),this.style.setProperty("--viewport-offset-x","0px"),this.style.setProperty("--viewport-offset-y","0px"),e(this,j).call(this)}),o(this,j,pe.debounce(()=>{e(this,X).call(this)},10)),o(this,X,()=>{if(this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px"),e(this,C).current){const t=this.getBoundingClientRect();let s=0,i=0;t.right>Q.viewport.width?s=Q.viewport.width-t.right:t.left<0&&(s=t.left*-1),t.bottom>Q.viewport.height?i=Q.viewport.height-t.bottom:t.top<0&&(i=t.top*-1),this.style.setProperty("--viewport-offset-x",s+"px"),this.style.setProperty("--viewport-offset-y",i+"px")}}),o(this,D,()=>{this.close()}),e(this,b).subscribe(t=>{t.previous&&(S.stack.remove(t.previous,this),t.current||(document.documentElement.classList.remove(`${this.group.previous}-closing`),document.documentElement.classList.remove(`${this.group.previous}-opened`)))}),e(this,a).subscribe(t=>{if(this.group.current){document.documentElement.classList.toggle(`${this.group.current}-closing`,t.current.closing);const s=S.stack.groups.get(this.group.current),i=s==null?void 0:s.find(c=>c.opened);document.documentElement.classList.toggle(`${this.group.current}-opened`,!!i)}})}get openClass(){return this.getAttribute("data-open-global-class")}get closingClass(){return this.getAttribute("data-closing-global-class")}get history(){return e(this,m)}get restore(){return e(this,T)}get closeRest(){return e(this,A)}get closeRestInGroup(){return e(this,x)}get group(){return e(this,b)}get clickOutside(){return e(this,R)}get escape(){return e(this,q)}get opened(){return e(this,v)}get lastTrigger(){return e(this,$)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,v)&&he.updateSearchParameter(this.id,t)}open(t){if(e(this,v))return;o(this,$,t==null?void 0:t.trigger),clearTimeout(e(this,z)),clearTimeout(e(this,B)),p(this,u,L).call(this,!1,this.closingClass),e(this,a).set("closing",!1),e(this,a).set("triggered",!0),M.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,$)}}),e(this,m).current&&e(this,y)&&history.pushState(history.state,"",e(this,u,ce)),e(this,a).set("beforeopen",!0),o(this,v,!0);const s=()=>{S.stack.add(e(this,b).current,this),e(this,W).forEach(i=>{i.scroll({top:0,left:0,behavior:"instant"})}),p(this,u,L).call(this,!0,this.openClass),e(this,a).set("opened",!0),M.dispatchEvent(window,"resize"),M.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,$)},bubbles:!0}),o(this,k,void 0),o(this,H,setTimeout(()=>{e(this,a).set("transitionend",!0),M.dispatchEvent(this,"popoverTransitionend")},ne.getElementTransitionDurationMS(this)+10))};t!=null&&t.skipTransition?s():o(this,k,requestAnimationFrame(s))}close(){e(this,v)&&(o(this,v,!1),cancelAnimationFrame(e(this,k)),clearTimeout(e(this,H)),S.stack.remove(e(this,b).current,this),p(this,u,Z).call(this),o(this,z,setTimeout(()=>{e(this,a).set("transitionend",!1),e(this,a).set("opened",!1),e(this,a).set("closing",!0),p(this,u,L).call(this,!1,this.openClass),p(this,u,L).call(this,!0,this.closingClass),M.dispatchEvent(this,"popoverClosing",{custom:!0,bubbles:!0}),o(this,B,setTimeout(()=>{e(this,a).set("triggered",!1),e(this,a).set("beforeopen",!1),e(this,a).set("closing",!1),p(this,u,L).call(this,!1,this.closingClass),M.dispatchEvent(this,"popoverClosed",{custom:!0,bubbles:!0})},ne.getElementTransitionDurationMS(this)+10))},10)))}connectedCallback(){o(this,V,[...this.querySelectorAll(`[data-popover-close${this.id?`="${this.id}"`:""}]`)]),e(this,V).forEach(t=>{t.addEventListener("click",e(this,D))}),o(this,W,[...this.querySelectorAll(`[data-popover-reset-scroll${this.id?`="${this.id}"`:""}]`)]),console.log(this.id,`[data-popover-reset-scroll${this.id?`="${this.id}"`:""}]`),e(this,m).observe(),e(this,T).observe(),e(this,A).observe(),e(this,x).observe(),e(this,b).observe(),e(this,R).observe(),e(this,q).observe(),e(this,C).observe(),this.setAttribute("role","dialog"),addEventListener("popstate",e(this,G)),setTimeout(()=>{e(this,T).current?(o(this,y,!1),this.urlValue=he.parseSearchParameters(location.search)[this.id],location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),o(this,y,!0)):(p(this,u,Z).call(this),o(this,y,!0))},0),e(this,C).subscribe(()=>{e(this,O).call(this)}),le.windowResizer.subscribe(e(this,O))}disconnectedCallback(){e(this,V).forEach(t=>{t.removeEventListener("click",e(this,D))}),S.stack.remove(e(this,b).current,this),le.windowResizer.unsubscribe(e(this,O)),e(this,m).close(),e(this,T).close(),e(this,A).close(),e(this,x).close(),e(this,b).close(),e(this,R).close(),e(this,q).close(),e(this,C).close(),this.removeAttribute("role"),p(this,u,L).call(this,!1,this.openClass),p(this,u,L).call(this,!1,this.closingClass),clearTimeout(e(this,z)),clearTimeout(e(this,B)),clearTimeout(e(this,k)),clearTimeout(e(this,H)),removeEventListener("popstate",e(this,G)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),this.style.removeProperty("--viewport-offset-x"),this.style.removeProperty("--viewport-offset-y"),p(this,u,Z).call(this)}};v=new WeakMap,z=new WeakMap,B=new WeakMap,k=new WeakMap,H=new WeakMap,m=new WeakMap,T=new WeakMap,A=new WeakMap,x=new WeakMap,b=new WeakMap,R=new WeakMap,q=new WeakMap,C=new WeakMap,y=new WeakMap,$=new WeakMap,a=new WeakMap,V=new WeakMap,W=new WeakMap,u=new WeakSet,ce=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},L=function(t,s){s&&s.split(" ").map(i=>{document.documentElement.classList.toggle(i.trim(),t)})},Z=function(){if(e(this,m).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},G=new WeakMap,O=new WeakMap,j=new WeakMap,X=new WeakMap,D=new WeakMap,S.stack=new de;let U=S;ie.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",U);var h,g,P,te,Y,I,J,K,se;class ae extends HTMLElement{constructor(){super();r(this,P);r(this,h);r(this,g,new E.CSSProperty(this,"--type","open"));r(this,Y,t=>{t.target===e(this,h)&&e(this,g).current!=="close"&&this.classList.add("triggered")});r(this,I,t=>{t.target===e(this,h)&&e(this,g).current!=="close"&&(this.classList.add("opened"),this.setAttribute("aria-expanded","true"))});r(this,J,t=>{t.target===e(this,h)&&e(this,g).current!=="close"&&this.classList.remove("opened")});r(this,K,t=>{t.target===e(this,h)&&e(this,g).current!=="close"&&(this.classList.remove("triggered"),this.setAttribute("aria-expanded","false"))});ie.isBrowser&&(this.addEventListener("click",()=>{if(e(this,h)){const t=e(this,g).current;t==="open"||t==="toggle"&&!e(this,h).opened?e(this,h).open({trigger:this}):(t==="close"||t==="toggle"&&e(this,h).opened)&&e(this,h).close()}}),this.addEventListener("keydown",t=>{t.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(t.preventDefault(),this.click())}))}get type(){return e(this,g)}get popoverElement(){return e(this,h)}changePopover(t){var s;if(p(this,P,te).call(this),t){let i=null;if(t==="parent"){const c=this.closest("[data-popover]");if(c)i=c;else{const f=this.getRootNode();f instanceof ShadowRoot?i=f.host.closest("[data-popover]"):f instanceof HTMLElement&&(i=f.closest("[data-popover]"))}}else if(t==="sibling")i=(s=this.parentElement)==null?void 0:s.querySelector("[data-popover]");else if(t==="ancestor-child"){const c=f=>{if(!f)return null;let F=f.querySelector("[data-popover]");return!F&&(f!=null&&f.parentElement)&&(F=c(f.parentElement)),F};i=c(this.parentElement)||null}else!t.startsWith(".")&&!t.startsWith("[")&&(t=`#${t}`),i=document.querySelector(t)||this.getRootNode().querySelector(t);i instanceof HTMLElement?(o(this,h,i),e(this,h).addEventListener("popoverTriggered",e(this,Y)),e(this,h).addEventListener("popoverOpened",e(this,I)),e(this,h).addEventListener("popoverClosing",e(this,J)),e(this,h).addEventListener("popoverClosed",e(this,K))):console.warn(this,`target ${t} not found`)}p(this,P,se).call(this,e(this,g).current)}connectedCallback(){e(this,g).subscribe(s=>{p(this,P,se).call(this,s.current)}),this.hasAttribute("tabindex")||(this.tabIndex=0),this.hasAttribute("role")||this.setAttribute("role","button");const t=this.getAttribute("target");t&&this.changePopover(t),this.isConnected&&e(this,g).observe()}disconnectedCallback(){e(this,g).unobserve(),this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls"),this.removeAttribute("role"),this.removeAttribute("tabindex"),p(this,P,te).call(this)}}h=new WeakMap,g=new WeakMap,P=new WeakSet,te=function(){e(this,h)&&(e(this,h).removeEventListener("popoverTriggered",e(this,Y)),e(this,h).removeEventListener("popoverOpened",e(this,I)),e(this,h).removeEventListener("popoverClosing",e(this,J)),e(this,h).removeEventListener("popoverClosed",e(this,K)))},Y=new WeakMap,I=new WeakMap,J=new WeakMap,K=new WeakMap,se=function(t){e(this,h)instanceof U&&(t!=="close"?(this.setAttribute("aria-haspopup","true"),this.setAttribute("aria-expanded",e(this,h).opened?"true":"false"),this.setAttribute("aria-controls",e(this,h).id||"")):(this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls")))};ie.isBrowser&&!customElements.get("e-popover-button")&&customElements.define("e-popover-button",ae);exports.PopoverButtonElement=ae;exports.PopoverElement=U;
@@ -84,7 +84,7 @@ class dt {
84
84
  }
85
85
  }
86
86
  d = new WeakMap(), w = new WeakMap(), N = new WeakMap(), _ = new WeakMap();
87
- var m, H, W, P, G, v, k, x, S, b, R, $, A, E, V, a, O, z, u, lt, L, Q, B, M, U, X, F;
87
+ var m, H, W, P, G, v, k, x, S, b, $, R, A, E, V, a, O, z, u, lt, L, Q, B, M, U, X, F;
88
88
  const T = class T extends HTMLElement {
89
89
  constructor() {
90
90
  super();
@@ -99,8 +99,8 @@ const T = class T extends HTMLElement {
99
99
  r(this, x);
100
100
  r(this, S);
101
101
  r(this, b);
102
- r(this, R);
103
102
  r(this, $);
103
+ r(this, R);
104
104
  r(this, A);
105
105
  r(this, E);
106
106
  r(this, V);
@@ -116,7 +116,7 @@ const T = class T extends HTMLElement {
116
116
  this,
117
117
  "--close-rest-in-group",
118
118
  !1
119
- )), o(this, b, new y(this, "--group", "")), o(this, R, new y(this, "--click-outside", !1)), o(this, $, new y(this, "--escape", !1)), o(this, A, new y(this, "--check-viewport-bounds", !1)), o(this, E, !0), o(this, a, new ct(this, {
119
+ )), o(this, b, new y(this, "--group", "")), o(this, $, new y(this, "--click-outside", !1)), o(this, R, new y(this, "--escape", !1)), o(this, A, new y(this, "--check-viewport-bounds", !1)), o(this, E, !0), o(this, a, new ct(this, {
120
120
  triggered: !1,
121
121
  beforeopen: !1,
122
122
  opened: !1,
@@ -178,10 +178,10 @@ const T = class T extends HTMLElement {
178
178
  return t(this, b);
179
179
  }
180
180
  get clickOutside() {
181
- return t(this, R);
181
+ return t(this, $);
182
182
  }
183
183
  get escape() {
184
- return t(this, $);
184
+ return t(this, R);
185
185
  }
186
186
  get opened() {
187
187
  return t(this, m);
@@ -247,7 +247,10 @@ const T = class T extends HTMLElement {
247
247
  ...this.querySelectorAll(
248
248
  `[data-popover-reset-scroll${this.id ? `="${this.id}"` : ""}]`
249
249
  )
250
- ]), t(this, v).observe(), t(this, k).observe(), t(this, x).observe(), t(this, S).observe(), t(this, b).observe(), t(this, R).observe(), t(this, $).observe(), t(this, A).observe(), this.setAttribute("role", "dialog"), addEventListener("popstate", t(this, B)), setTimeout(() => {
250
+ ]), console.log(
251
+ this.id,
252
+ `[data-popover-reset-scroll${this.id ? `="${this.id}"` : ""}]`
253
+ ), t(this, v).observe(), t(this, k).observe(), t(this, x).observe(), t(this, S).observe(), t(this, b).observe(), t(this, $).observe(), t(this, R).observe(), t(this, A).observe(), this.setAttribute("role", "dialog"), addEventListener("popstate", t(this, B)), setTimeout(() => {
251
254
  t(this, k).current ? (o(this, E, !1), this.urlValue = pt(location.search)[this.id], location.search.includes(this.id) && this.open({ trigger: this.idWithValue }), o(this, E, !0)) : (p(this, u, Q).call(this), o(this, E, !0));
252
255
  }, 0), t(this, A).subscribe(() => {
253
256
  t(this, M).call(this);
@@ -256,10 +259,10 @@ const T = class T extends HTMLElement {
256
259
  disconnectedCallback() {
257
260
  t(this, O).forEach((e) => {
258
261
  e.removeEventListener("click", t(this, F));
259
- }), T.stack.remove(t(this, b).current, this), nt.unsubscribe(t(this, M)), t(this, v).close(), t(this, k).close(), t(this, x).close(), t(this, S).close(), t(this, b).close(), t(this, R).close(), t(this, $).close(), t(this, A).close(), this.removeAttribute("role"), p(this, u, L).call(this, !1, this.openClass), p(this, u, L).call(this, !1, this.closingClass), clearTimeout(t(this, H)), clearTimeout(t(this, W)), clearTimeout(t(this, P)), clearTimeout(t(this, G)), removeEventListener("popstate", t(this, B)), this.style.removeProperty("--content-width"), this.style.removeProperty("--content-height"), this.style.removeProperty("--viewport-offset-x"), this.style.removeProperty("--viewport-offset-y"), p(this, u, Q).call(this);
262
+ }), T.stack.remove(t(this, b).current, this), nt.unsubscribe(t(this, M)), t(this, v).close(), t(this, k).close(), t(this, x).close(), t(this, S).close(), t(this, b).close(), t(this, $).close(), t(this, R).close(), t(this, A).close(), this.removeAttribute("role"), p(this, u, L).call(this, !1, this.openClass), p(this, u, L).call(this, !1, this.closingClass), clearTimeout(t(this, H)), clearTimeout(t(this, W)), clearTimeout(t(this, P)), clearTimeout(t(this, G)), removeEventListener("popstate", t(this, B)), this.style.removeProperty("--content-width"), this.style.removeProperty("--content-height"), this.style.removeProperty("--viewport-offset-x"), this.style.removeProperty("--viewport-offset-y"), p(this, u, Q).call(this);
260
263
  }
261
264
  };
262
- m = new WeakMap(), H = new WeakMap(), W = new WeakMap(), P = new WeakMap(), G = new WeakMap(), v = new WeakMap(), k = new WeakMap(), x = new WeakMap(), S = new WeakMap(), b = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), A = new WeakMap(), E = new WeakMap(), V = new WeakMap(), a = new WeakMap(), O = new WeakMap(), z = new WeakMap(), u = new WeakSet(), lt = function() {
265
+ m = new WeakMap(), H = new WeakMap(), W = new WeakMap(), P = new WeakMap(), G = new WeakMap(), v = new WeakMap(), k = new WeakMap(), x = new WeakMap(), S = new WeakMap(), b = new WeakMap(), $ = new WeakMap(), R = new WeakMap(), A = new WeakMap(), E = new WeakMap(), V = new WeakMap(), a = new WeakMap(), O = new WeakMap(), z = new WeakMap(), u = new WeakSet(), lt = function() {
263
266
  return `${location.pathname}${location.search ? location.search + "&" : "?"}${this.idWithValue}`;
264
267
  }, L = function(e, s) {
265
268
  s && s.split(" ").map((i) => {