aptechka 0.65.0 → 0.65.2

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.
@@ -13,6 +13,8 @@ export declare class BillboardElement extends HTMLElement {
13
13
  get autoplay(): CSSProperty<string | false>;
14
14
  get swipe(): CSSProperty<false | Axes2D>;
15
15
  get itemElements(): HTMLElement[];
16
+ get groups(): Map<string, HTMLElement[]>;
17
+ get length(): number;
16
18
  addItem(element: HTMLElement): void;
17
19
  set(value: number): void;
18
20
  shift(value: number): void;
@@ -1 +1 @@
1
- "use strict";var Q=i=>{throw TypeError(i)};var O=(i,r,e)=>r.has(i)||Q("Cannot "+e);var t=(i,r,e)=>(O(i,r,"read from private field"),e?e.call(i):r.get(i)),s=(i,r,e)=>r.has(i)?Q("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(i):r.set(i,e),d=(i,r,e,n)=>(O(i,r,"write to private field"),n?n.call(i,e):r.set(i,e),e),m=(i,r,e)=>(O(i,r,"access private method"),e);var J=(i,r,e)=>new Promise((n,l)=>{var a=y=>{try{G(e.next(y))}catch(N){l(N)}},x=y=>{try{G(e.throw(y))}catch(N){l(N)}},G=y=>y.done?n(y.value):Promise.resolve(y.value).then(a,x);G((e=e.apply(i,r)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("../index-DekP7OZe.cjs"),K=require("../dom-JBOkFLTh.cjs");require("construct-style-sheets-polyfill");const B=require("../css-property/index.cjs"),W=require("../events-KVanG9sR.cjs"),X=require("../gestures-C7gbKx11.cjs"),Y=require("../math-GDWEqu7y.cjs"),Z=require("../number-DyefJ5a1.cjs");var P,k,f,E,L,S,o,h,b,$,I,_,A,j,F;class z extends HTMLElement{constructor(){super(...arguments);s(this,b);s(this,P,new B.CSSProperty(this,"--resize",!0));s(this,k,new B.CSSProperty(this,"--loop",!0));s(this,f,new B.CSSProperty(this,"--autoplay",!1));s(this,E,new B.CSSProperty(this,"--swipe","x"));s(this,L);s(this,S,!1);s(this,o,[]);s(this,h,0);s(this,I,e=>{d(this,S,e.isIntersecting),t(this,S)?m(this,b,$).call(this):clearInterval(t(this,L))});s(this,_,()=>{clearInterval(t(this,L)),t(this,S)&&d(this,L,setInterval(t(this,j),parseFloat(t(this,f).current||"0")*1e3))});s(this,j,()=>{m(this,b,A).call(this,t(this,h)+1)});s(this,F,e=>{if(!t(this,E).current)return;let n=0;X.setupDrag(l=>{const a=e.x-l.x,x=e.y-l.y;t(this,E).current==="x"?Math.abs(a)>Math.abs(x)&&Math.abs(a)>10&&(n=Math.sign(a)):t(this,E).current==="y"&&Math.abs(x)>Math.abs(a)&&Math.abs(x)>10&&(n=Math.sign(x))},()=>{n&&this.shift(n)})})}get counter(){return t(this,h)}get loop(){return t(this,k)}get autoplay(){return t(this,f)}get swipe(){return t(this,E)}get itemElements(){return t(this,o)}addItem(e){t(this,o).push(e),m(this,b,A).call(this)}set(e){(!this.handleSet||this.handleSet(e))&&(m(this,b,A).call(this,e),m(this,b,$).call(this))}shift(e){this.set(t(this,h)+e)}connectedCallback(){var e;d(this,o,[...this.querySelectorAll(`[data-billboard-item${this.id?`="${this.id}"`:""}]`)]),(e=t(this,o)[0])==null||e.classList.add("current"),t(this,f).subscribe(n=>{n.current?(M.intersector.subscribe(this,t(this,I)),m(this,b,$).call(this)):(d(this,S,!0),M.intersector.unsubscribe(t(this,I)),clearInterval(t(this,L)),m(this,b,A).call(this,0))}),t(this,f).observe(),t(this,E).observe(),t(this,k).observe(),t(this,P).observe(),m(this,b,A).call(this,0),this.addEventListener("pointerdown",t(this,F))}disconnectedCallback(){t(this,f).unobserve(),t(this,E).unobserve(),t(this,k).unobserve(),t(this,P).unobserve(),M.intersector.unsubscribe(t(this,I)),clearInterval(t(this,L))}}P=new WeakMap,k=new WeakMap,f=new WeakMap,E=new WeakMap,L=new WeakMap,S=new WeakMap,o=new WeakMap,h=new WeakMap,b=new WeakSet,$=function(){t(this,f).current!==!1&&t(this,_).call(this)},I=new WeakMap,_=new WeakMap,A=function(e=t(this,h)){const n=t(this,h);t(this,k).current?d(this,h,Z.loopNumber(e,t(this,o).length)):d(this,h,Y.clamp(e,0,t(this,o).length-1)),this.classList.remove("forward","backward"),t(this,h)-n>=0?this.classList.add("forward"):t(this,h)-n<0&&this.classList.add("backward"),t(this,o).forEach((l,a)=>{l.classList.remove("current","previous","next"),a===t(this,h)?l.classList.add("current"):a<t(this,h)?l.classList.add("previous"):a>t(this,h)&&l.classList.add("next")}),this.classList.toggle("has-length",t(this,o).length>1),this.classList.toggle("start",t(this,h)===0),this.classList.toggle("end",t(this,h)===t(this,o).length-1),this.style.setProperty("--counter",t(this,h).toString()),this.style.setProperty("--sections",t(this,o).length.toString()),t(this,h)!==n&&(W.dispatchEvent(this,"billboardChange",{detail:{counter:t(this,h)}}),t(this,P).current&&setTimeout(()=>{window.dispatchEvent(new Event("resize"))},0))},j=new WeakMap,F=new WeakMap;customElements.get("e-billboard")||customElements.define("e-billboard",z);var u,T,p,H,q;class R extends HTMLElement{constructor(){super(...arguments);s(this,u,null);s(this,T,null);s(this,p,[]);s(this,H,e=>{const n=e.currentTarget,l=t(this,p).findIndex(a=>a===n);l>=0&&t(this,u).set(l)});s(this,q,()=>{t(this,p).forEach((e,n)=>{n===t(this,u).counter?e.classList.add("current"):e.classList.remove("current")})})}connectedCallback(){return J(this,null,function*(){var e;if(d(this,u,K.findParentElement(this,z)),t(this,u)&&(yield customElements.whenDefined("e-billboard"),this.isConnected)){this.innerHTML="";const n=t(this,u).itemElements.length;d(this,T,document.createElement("div"));for(let l=0;l<n;l++){const a=document.createElement("button");a.setAttribute("aria-label",`Go to item ${l+1}`),t(this,p).push(a),t(this,T).appendChild(a)}this.appendChild(t(this,T)),t(this,p).forEach(l=>{l.addEventListener("click",t(this,H))}),(e=t(this,u))==null||e.addEventListener("billboardChange",t(this,q)),t(this,q).call(this)}})}disconnectedCallback(){var e;t(this,p).forEach(n=>{n.removeEventListener("click",t(this,H))}),(e=t(this,u))==null||e.removeEventListener("billboardChange",t(this,q)),this.innerHTML="",d(this,p,[])}}u=new WeakMap,T=new WeakMap,p=new WeakMap,H=new WeakMap,q=new WeakMap;M.isBrowser&&!customElements.get("e-billboard-bullets")&&customElements.define("e-billboard-bullets",R);var v,g,w;class U extends HTMLElement{constructor(){super();s(this,v,new B.CSSProperty(this,"--index",0));s(this,g,null);s(this,w,()=>{var e;t(this,v).current===((e=t(this,g))==null?void 0:e.counter)?this.classList.add("current"):this.classList.remove("current")});this.addEventListener("click",e=>{t(this,g)&&(!this.handleClick||this.handleClick(e))&&t(this,g).set(t(this,v).current)}),this.addEventListener("keydown",e=>{e.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(e.preventDefault(),this.click())})}connectedCallback(){var e;this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button"),d(this,g,K.findParentElement(this,z)),(e=t(this,g))==null||e.addEventListener("billboardChange",t(this,w)),customElements.whenDefined("e-billboard").then(()=>{this.isConnected&&t(this,w).call(this)}),t(this,v).subscribe(t(this,w)),t(this,v).observe()}disconnectedCallback(){var e;this.removeAttribute("tabindex"),this.removeAttribute("role"),t(this,v).unsubscribe(t(this,w)),t(this,v).unobserve(),(e=t(this,g))==null||e.removeEventListener("billboardChange",t(this,w))}}v=new WeakMap,g=new WeakMap,w=new WeakMap;M.isBrowser&&!customElements.get("e-billboard-set-button")&&customElements.define("e-billboard-set-button",U);var C,c,D;class V extends HTMLElement{constructor(){super();s(this,C,new B.CSSProperty(this,"--step",1));s(this,c,null);s(this,D,()=>{t(this,c)&&(!t(this,c).loop.current&&(t(this,c).counter===0&&t(this,C).current<=0||t(this,c).counter===t(this,c).itemElements.length-1&&t(this,C).current>=0)?this.setAttribute("disabled",""):this.removeAttribute("disabled"))});this.addEventListener("click",e=>{t(this,c)&&(!this.handleClick||this.handleClick(e))&&t(this,c).shift(t(this,C).current)}),this.addEventListener("keydown",e=>{e.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(e.preventDefault(),this.click())})}connectedCallback(){return J(this,null,function*(){var e;yield customElements.whenDefined("e-billboard"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button"),t(this,C).observe(),this.tabIndex=0,d(this,c,K.findParentElement(this,z)),(e=t(this,c))==null||e.addEventListener("billboardChange",t(this,D)),setTimeout(()=>{t(this,D).call(this)},0)})}disconnectedCallback(){var e;this.removeAttribute("tabindex"),this.removeAttribute("role"),t(this,C).unobserve(),(e=t(this,c))==null||e.removeEventListener("billboardChange",t(this,D))}}C=new WeakMap,c=new WeakMap,D=new WeakMap;M.isBrowser&&!customElements.get("e-billboard-step-button")&&customElements.define("e-billboard-step-button",V);exports.BillboardBulletsElement=R;exports.BillboardElement=z;exports.BillboardSetButtonElement=U;exports.BillboardStepButtonElement=V;
1
+ "use strict";var V=n=>{throw TypeError(n)};var K=(n,a,e)=>a.has(n)||V("Cannot "+e);var t=(n,a,e)=>(K(n,a,"read from private field"),e?e.call(n):a.get(n)),i=(n,a,e)=>a.has(n)?V("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(n):a.set(n,e),c=(n,a,e,s)=>(K(n,a,"write to private field"),s?s.call(n,e):a.set(n,e),e),f=(n,a,e)=>(K(n,a,"access private method"),e);var Q=(n,a,e)=>new Promise((s,r)=>{var h=k=>{try{O(e.next(k))}catch(J){r(J)}},u=k=>{try{O(e.throw(k))}catch(J){r(J)}},O=k=>k.done?s(k.value):Promise.resolve(k.value).then(h,u);O((e=e.apply(n,a)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("../index-DekP7OZe.cjs"),U=require("../dom-JBOkFLTh.cjs");require("construct-style-sheets-polyfill");const M=require("../css-property/index.cjs"),tt=require("../events-KVanG9sR.cjs"),et=require("../gestures-C7gbKx11.cjs"),st=require("../math-GDWEqu7y.cjs"),W=require("../number-DyefJ5a1.cjs");var I,S,g,E,C,A,z,m,l,b,o,R,_,T,j,B,F,G;class $ extends HTMLElement{constructor(){super(...arguments);i(this,o);i(this,I,new M.CSSProperty(this,"--resize",!0));i(this,S,new M.CSSProperty(this,"--loop",!0));i(this,g,new M.CSSProperty(this,"--autoplay",!1));i(this,E,new M.CSSProperty(this,"--swipe","x"));i(this,C);i(this,A,!1);i(this,z,[]);i(this,m,new Map);i(this,l,0);i(this,b,0);i(this,T,e=>{c(this,A,e.isIntersecting),t(this,A)?f(this,o,_).call(this):clearInterval(t(this,C))});i(this,j,()=>{clearInterval(t(this,C)),t(this,A)&&c(this,C,setInterval(t(this,F),parseFloat(t(this,g).current||"0")*1e3))});i(this,F,()=>{f(this,o,B).call(this,t(this,l)+1)});i(this,G,e=>{if(!t(this,E).current)return;let s=0;et.setupDrag(r=>{const h=e.x-r.x,u=e.y-r.y;t(this,E).current==="x"?Math.abs(h)>Math.abs(u)&&Math.abs(h)>10&&(s=Math.sign(h)):t(this,E).current==="y"&&Math.abs(u)>Math.abs(h)&&Math.abs(u)>10&&(s=Math.sign(u))},()=>{s&&this.shift(s)})})}get counter(){return t(this,l)}get loop(){return t(this,S)}get autoplay(){return t(this,g)}get swipe(){return t(this,E)}get itemElements(){return t(this,z)}get groups(){return t(this,m)}get length(){return t(this,b)}addItem(e){f(this,o,R).call(this,e),f(this,o,B).call(this)}set(e){(!this.handleSet||this.handleSet(e))&&(f(this,o,B).call(this,e),f(this,o,_).call(this))}shift(e){this.set(t(this,l)+e)}connectedCallback(){[...this.querySelectorAll(`[data-billboard-item${this.id?`="${this.id}"`:""}]`)].forEach(s=>{f(this,o,R).call(this,s)}),t(this,m).forEach(s=>{var r;(r=s[0])==null||r.classList.add("current")}),t(this,g).subscribe(s=>{s.current?(P.intersector.subscribe(this,t(this,T)),f(this,o,_).call(this)):(c(this,A,!0),P.intersector.unsubscribe(t(this,T)),clearInterval(t(this,C)),f(this,o,B).call(this,0))}),t(this,g).observe(),t(this,E).observe(),t(this,S).observe(),t(this,I).observe(),f(this,o,B).call(this,0),this.addEventListener("pointerdown",t(this,G))}disconnectedCallback(){t(this,g).unobserve(),t(this,E).unobserve(),t(this,S).unobserve(),t(this,I).unobserve(),t(this,m).clear(),P.intersector.unsubscribe(t(this,T)),clearInterval(t(this,C))}}I=new WeakMap,S=new WeakMap,g=new WeakMap,E=new WeakMap,C=new WeakMap,A=new WeakMap,z=new WeakMap,m=new WeakMap,l=new WeakMap,b=new WeakMap,o=new WeakSet,R=function(e){t(this,z).push(e);const s=e.getAttribute("data-billboard-item-group")||"default";let r=t(this,m).get(s);r||(r=[],t(this,m).set(s,r)),r.push(e),c(this,b,0),t(this,m).forEach(h=>{h.length>t(this,b)&&c(this,b,h.length)})},_=function(){t(this,g).current!==!1&&t(this,j).call(this)},T=new WeakMap,j=new WeakMap,B=function(e=t(this,l)){const s=t(this,l);t(this,S).current?c(this,l,W.loopNumber(e,t(this,b))):c(this,l,st.clamp(e,0,t(this,b)-1)),this.classList.remove("forward","backward"),t(this,l)-s>=0?this.classList.add("forward"):t(this,l)-s<0&&this.classList.add("backward"),t(this,m).forEach(r=>{r.forEach((h,u)=>{h.classList.remove("current","previous","next","previous-sibling","next-sibling"),u===t(this,l)?h.classList.add("current"):u<t(this,l)?h.classList.add("previous"):u>t(this,l)&&h.classList.add("next"),u===W.loopNumber(t(this,l)-1,this.length)?h.classList.add("previous-sibling"):u===(t(this,l)+1)%this.length&&h.classList.add("next-sibling")})}),this.classList.toggle("has-length",t(this,b)>1),this.classList.toggle("start",t(this,l)===0),this.classList.toggle("end",t(this,l)===t(this,b)-1),this.style.setProperty("--counter",t(this,l).toString()),this.style.setProperty("--sections",t(this,b).toString()),t(this,l)!==s&&(tt.dispatchEvent(this,"billboardChange",{detail:{counter:t(this,l)}}),t(this,I).current&&setTimeout(()=>{window.dispatchEvent(new Event("resize"))},0))},F=new WeakMap,G=new WeakMap;customElements.get("e-billboard")||customElements.define("e-billboard",$);var p,q,v,N,D;class X extends HTMLElement{constructor(){super(...arguments);i(this,p,null);i(this,q,null);i(this,v,[]);i(this,N,e=>{const s=e.currentTarget,r=t(this,v).findIndex(h=>h===s);r>=0&&t(this,p).set(r)});i(this,D,()=>{t(this,v).forEach((e,s)=>{s===t(this,p).counter?e.classList.add("current"):e.classList.remove("current")})})}connectedCallback(){return Q(this,null,function*(){var e;if(c(this,p,U.findParentElement(this,$)),t(this,p)&&(yield customElements.whenDefined("e-billboard"),this.isConnected)){this.innerHTML="";const s=t(this,p).length;c(this,q,document.createElement("div"));for(let r=0;r<s;r++){const h=document.createElement("button");h.setAttribute("aria-label",`Go to item ${r+1}`),t(this,v).push(h),t(this,q).appendChild(h)}this.appendChild(t(this,q)),t(this,v).forEach(r=>{r.addEventListener("click",t(this,N))}),(e=t(this,p))==null||e.addEventListener("billboardChange",t(this,D)),t(this,D).call(this)}})}disconnectedCallback(){var e;t(this,v).forEach(s=>{s.removeEventListener("click",t(this,N))}),(e=t(this,p))==null||e.removeEventListener("billboardChange",t(this,D)),this.innerHTML="",c(this,v,[])}}p=new WeakMap,q=new WeakMap,v=new WeakMap,N=new WeakMap,D=new WeakMap;P.isBrowser&&!customElements.get("e-billboard-bullets")&&customElements.define("e-billboard-bullets",X);var L,w,y;class Y extends HTMLElement{constructor(){super();i(this,L,new M.CSSProperty(this,"--index",0));i(this,w,null);i(this,y,()=>{var e;t(this,L).current===((e=t(this,w))==null?void 0:e.counter)?this.classList.add("current"):this.classList.remove("current")});this.addEventListener("click",e=>{t(this,w)&&(!this.handleClick||this.handleClick(e))&&t(this,w).set(t(this,L).current)}),this.addEventListener("keydown",e=>{e.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(e.preventDefault(),this.click())})}connectedCallback(){var e;this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button"),c(this,w,U.findParentElement(this,$)),(e=t(this,w))==null||e.addEventListener("billboardChange",t(this,y)),customElements.whenDefined("e-billboard").then(()=>{this.isConnected&&t(this,y).call(this)}),t(this,L).subscribe(t(this,y)),t(this,L).observe()}disconnectedCallback(){var e;this.removeAttribute("tabindex"),this.removeAttribute("role"),t(this,L).unsubscribe(t(this,y)),t(this,L).unobserve(),(e=t(this,w))==null||e.removeEventListener("billboardChange",t(this,y))}}L=new WeakMap,w=new WeakMap,y=new WeakMap;P.isBrowser&&!customElements.get("e-billboard-set-button")&&customElements.define("e-billboard-set-button",Y);var x,d,H;class Z extends HTMLElement{constructor(){super();i(this,x,new M.CSSProperty(this,"--step",1));i(this,d,null);i(this,H,()=>{t(this,d)&&(!t(this,d).loop.current&&(t(this,d).counter===0&&t(this,x).current<=0||t(this,d).counter===t(this,d).length-1&&t(this,x).current>=0)?this.setAttribute("disabled",""):this.removeAttribute("disabled"))});this.addEventListener("click",e=>{t(this,d)&&(!this.handleClick||this.handleClick(e))&&t(this,d).shift(t(this,x).current)}),this.addEventListener("keydown",e=>{e.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(e.preventDefault(),this.click())})}connectedCallback(){return Q(this,null,function*(){var e;yield customElements.whenDefined("e-billboard"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button"),t(this,x).observe(),this.tabIndex=0,c(this,d,U.findParentElement(this,$)),(e=t(this,d))==null||e.addEventListener("billboardChange",t(this,H)),setTimeout(()=>{t(this,H).call(this)},0)})}disconnectedCallback(){var e;this.removeAttribute("tabindex"),this.removeAttribute("role"),t(this,x).unobserve(),(e=t(this,d))==null||e.removeEventListener("billboardChange",t(this,H))}}x=new WeakMap,d=new WeakMap,H=new WeakMap;P.isBrowser&&!customElements.get("e-billboard-step-button")&&customElements.define("e-billboard-step-button",Z);exports.BillboardBulletsElement=X;exports.BillboardElement=$;exports.BillboardSetButtonElement=Y;exports.BillboardStepButtonElement=Z;
@@ -1,251 +1,275 @@
1
- var U = (i) => {
2
- throw TypeError(i);
1
+ var X = (n) => {
2
+ throw TypeError(n);
3
3
  };
4
- var J = (i, r, e) => r.has(i) || U("Cannot " + e);
5
- var t = (i, r, e) => (J(i, r, "read from private field"), e ? e.call(i) : r.get(i)), s = (i, r, e) => r.has(i) ? U("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(i) : r.set(i, e), d = (i, r, e, n) => (J(i, r, "write to private field"), n ? n.call(i, e) : r.set(i, e), e), m = (i, r, e) => (J(i, r, "access private method"), e);
6
- var K = (i, r, e) => new Promise((n, l) => {
7
- var a = (C) => {
4
+ var O = (n, a, e) => a.has(n) || X("Cannot " + e);
5
+ var t = (n, a, e) => (O(n, a, "read from private field"), e ? e.call(n) : a.get(n)), i = (n, a, e) => a.has(n) ? X("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(n) : a.set(n, e), c = (n, a, e, s) => (O(n, a, "write to private field"), s ? s.call(n, e) : a.set(n, e), e), f = (n, a, e) => (O(n, a, "access private method"), e);
6
+ var Q = (n, a, e) => new Promise((s, r) => {
7
+ var h = (y) => {
8
8
  try {
9
- N(e.next(C));
10
- } catch (j) {
11
- l(j);
9
+ J(e.next(y));
10
+ } catch (K) {
11
+ r(K);
12
12
  }
13
- }, A = (C) => {
13
+ }, b = (y) => {
14
14
  try {
15
- N(e.throw(C));
16
- } catch (j) {
17
- l(j);
15
+ J(e.throw(y));
16
+ } catch (K) {
17
+ r(K);
18
18
  }
19
- }, N = (C) => C.done ? n(C.value) : Promise.resolve(C.value).then(a, A);
20
- N((e = e.apply(i, r)).next());
19
+ }, J = (y) => y.done ? s(y.value) : Promise.resolve(y.value).then(h, b);
20
+ J((e = e.apply(n, a)).next());
21
21
  });
22
- import { a as O, i as Q } from "../index-Bv9zgfdb.js";
23
- import { b as R } from "../dom-CVWzyXPH.js";
22
+ import { a as R, i as V } from "../index-Bv9zgfdb.js";
23
+ import { b as W } from "../dom-CVWzyXPH.js";
24
24
  import "construct-style-sheets-polyfill";
25
- import { CSSProperty as I } from "../css-property/index.js";
26
- import { d as V } from "../events-CsVF98U6.js";
27
- import { s as W } from "../gestures-CcXV6fCp.js";
28
- import { c as X } from "../math-BOBiC4TN.js";
25
+ import { CSSProperty as S } from "../css-property/index.js";
26
+ import { d as Z } from "../events-CsVF98U6.js";
27
+ import { s as _ } from "../gestures-CcXV6fCp.js";
28
+ import { c as tt } from "../math-BOBiC4TN.js";
29
29
  import { l as Y } from "../number-CbdpfO3u.js";
30
- var S, x, f, p, L, y, o, h, b, z, T, $, M, q, F;
31
- class G extends HTMLElement {
30
+ var T, A, g, v, k, M, z, m, l, u, o, U, N, B, q, I, F, G;
31
+ class j extends HTMLElement {
32
32
  constructor() {
33
33
  super(...arguments);
34
- s(this, b);
35
- s(this, S, new I(this, "--resize", !0));
36
- s(this, x, new I(this, "--loop", !0));
37
- s(this, f, new I(this, "--autoplay", !1));
38
- s(this, p, new I(this, "--swipe", "x"));
39
- s(this, L);
40
- s(this, y, !1);
41
- s(this, o, []);
42
- s(this, h, 0);
43
- s(this, T, (e) => {
44
- d(this, y, e.isIntersecting), t(this, y) ? m(this, b, z).call(this) : clearInterval(t(this, L));
34
+ i(this, o);
35
+ i(this, T, new S(this, "--resize", !0));
36
+ i(this, A, new S(this, "--loop", !0));
37
+ i(this, g, new S(this, "--autoplay", !1));
38
+ i(this, v, new S(this, "--swipe", "x"));
39
+ i(this, k);
40
+ i(this, M, !1);
41
+ i(this, z, []);
42
+ i(this, m, /* @__PURE__ */ new Map());
43
+ i(this, l, 0);
44
+ i(this, u, 0);
45
+ i(this, B, (e) => {
46
+ c(this, M, e.isIntersecting), t(this, M) ? f(this, o, N).call(this) : clearInterval(t(this, k));
45
47
  });
46
- s(this, $, () => {
47
- clearInterval(t(this, L)), t(this, y) && d(this, L, setInterval(
48
- t(this, q),
49
- parseFloat(t(this, f).current || "0") * 1e3
48
+ i(this, q, () => {
49
+ clearInterval(t(this, k)), t(this, M) && c(this, k, setInterval(
50
+ t(this, F),
51
+ parseFloat(t(this, g).current || "0") * 1e3
50
52
  ));
51
53
  });
52
- s(this, q, () => {
53
- m(this, b, M).call(this, t(this, h) + 1);
54
+ i(this, F, () => {
55
+ f(this, o, I).call(this, t(this, l) + 1);
54
56
  });
55
- s(this, F, (e) => {
56
- if (!t(this, p).current)
57
+ i(this, G, (e) => {
58
+ if (!t(this, v).current)
57
59
  return;
58
- let n = 0;
59
- W(
60
- (l) => {
61
- const a = e.x - l.x, A = e.y - l.y;
62
- t(this, p).current === "x" ? Math.abs(a) > Math.abs(A) && Math.abs(a) > 10 && (n = Math.sign(a)) : t(this, p).current === "y" && Math.abs(A) > Math.abs(a) && Math.abs(A) > 10 && (n = Math.sign(A));
60
+ let s = 0;
61
+ _(
62
+ (r) => {
63
+ const h = e.x - r.x, b = e.y - r.y;
64
+ t(this, v).current === "x" ? Math.abs(h) > Math.abs(b) && Math.abs(h) > 10 && (s = Math.sign(h)) : t(this, v).current === "y" && Math.abs(b) > Math.abs(h) && Math.abs(b) > 10 && (s = Math.sign(b));
63
65
  },
64
66
  () => {
65
- n && this.shift(n);
67
+ s && this.shift(s);
66
68
  }
67
69
  );
68
70
  });
69
71
  }
70
72
  get counter() {
71
- return t(this, h);
73
+ return t(this, l);
72
74
  }
73
75
  get loop() {
74
- return t(this, x);
76
+ return t(this, A);
75
77
  }
76
78
  get autoplay() {
77
- return t(this, f);
79
+ return t(this, g);
78
80
  }
79
81
  get swipe() {
80
- return t(this, p);
82
+ return t(this, v);
81
83
  }
82
84
  get itemElements() {
83
- return t(this, o);
85
+ return t(this, z);
86
+ }
87
+ get groups() {
88
+ return t(this, m);
89
+ }
90
+ get length() {
91
+ return t(this, u);
84
92
  }
85
93
  addItem(e) {
86
- t(this, o).push(e), m(this, b, M).call(this);
94
+ f(this, o, U).call(this, e), f(this, o, I).call(this);
87
95
  }
88
96
  set(e) {
89
- (!this.handleSet || this.handleSet(e)) && (m(this, b, M).call(this, e), m(this, b, z).call(this));
97
+ (!this.handleSet || this.handleSet(e)) && (f(this, o, I).call(this, e), f(this, o, N).call(this));
90
98
  }
91
99
  shift(e) {
92
- this.set(t(this, h) + e);
100
+ this.set(t(this, l) + e);
93
101
  }
94
102
  connectedCallback() {
95
- var e;
96
- d(this, o, [
103
+ [
97
104
  ...this.querySelectorAll(
98
105
  `[data-billboard-item${this.id ? `="${this.id}"` : ""}]`
99
106
  )
100
- ]), (e = t(this, o)[0]) == null || e.classList.add("current"), t(this, f).subscribe((n) => {
101
- n.current ? (O.subscribe(this, t(this, T)), m(this, b, z).call(this)) : (d(this, y, !0), O.unsubscribe(t(this, T)), clearInterval(t(this, L)), m(this, b, M).call(this, 0));
102
- }), t(this, f).observe(), t(this, p).observe(), t(this, x).observe(), t(this, S).observe(), m(this, b, M).call(this, 0), this.addEventListener("pointerdown", t(this, F));
107
+ ].forEach((s) => {
108
+ f(this, o, U).call(this, s);
109
+ }), t(this, m).forEach((s) => {
110
+ var r;
111
+ (r = s[0]) == null || r.classList.add("current");
112
+ }), t(this, g).subscribe((s) => {
113
+ s.current ? (R.subscribe(this, t(this, B)), f(this, o, N).call(this)) : (c(this, M, !0), R.unsubscribe(t(this, B)), clearInterval(t(this, k)), f(this, o, I).call(this, 0));
114
+ }), t(this, g).observe(), t(this, v).observe(), t(this, A).observe(), t(this, T).observe(), f(this, o, I).call(this, 0), this.addEventListener("pointerdown", t(this, G));
103
115
  }
104
116
  disconnectedCallback() {
105
- t(this, f).unobserve(), t(this, p).unobserve(), t(this, x).unobserve(), t(this, S).unobserve(), O.unsubscribe(t(this, T)), clearInterval(t(this, L));
117
+ t(this, g).unobserve(), t(this, v).unobserve(), t(this, A).unobserve(), t(this, T).unobserve(), t(this, m).clear(), R.unsubscribe(t(this, B)), clearInterval(t(this, k));
106
118
  }
107
119
  }
108
- S = new WeakMap(), x = new WeakMap(), f = new WeakMap(), p = new WeakMap(), L = new WeakMap(), y = new WeakMap(), o = new WeakMap(), h = new WeakMap(), b = new WeakSet(), z = function() {
109
- t(this, f).current !== !1 && t(this, $).call(this);
110
- }, T = new WeakMap(), $ = new WeakMap(), M = function(e = t(this, h)) {
111
- const n = t(this, h);
112
- t(this, x).current ? d(this, h, Y(e, t(this, o).length)) : d(this, h, X(e, 0, t(this, o).length - 1)), this.classList.remove("forward", "backward"), t(this, h) - n >= 0 ? this.classList.add("forward") : t(this, h) - n < 0 && this.classList.add("backward"), t(this, o).forEach((l, a) => {
113
- l.classList.remove("current", "previous", "next"), a === t(this, h) ? l.classList.add("current") : a < t(this, h) ? l.classList.add("previous") : a > t(this, h) && l.classList.add("next");
114
- }), this.classList.toggle("has-length", t(this, o).length > 1), this.classList.toggle("start", t(this, h) === 0), this.classList.toggle(
115
- "end",
116
- t(this, h) === t(this, o).length - 1
117
- ), this.style.setProperty("--counter", t(this, h).toString()), this.style.setProperty("--sections", t(this, o).length.toString()), t(this, h) !== n && (V(this, "billboardChange", {
120
+ T = new WeakMap(), A = new WeakMap(), g = new WeakMap(), v = new WeakMap(), k = new WeakMap(), M = new WeakMap(), z = new WeakMap(), m = new WeakMap(), l = new WeakMap(), u = new WeakMap(), o = new WeakSet(), U = function(e) {
121
+ t(this, z).push(e);
122
+ const s = e.getAttribute("data-billboard-item-group") || "default";
123
+ let r = t(this, m).get(s);
124
+ r || (r = [], t(this, m).set(s, r)), r.push(e), c(this, u, 0), t(this, m).forEach((h) => {
125
+ h.length > t(this, u) && c(this, u, h.length);
126
+ });
127
+ }, N = function() {
128
+ t(this, g).current !== !1 && t(this, q).call(this);
129
+ }, B = new WeakMap(), q = new WeakMap(), I = function(e = t(this, l)) {
130
+ const s = t(this, l);
131
+ t(this, A).current ? c(this, l, Y(e, t(this, u))) : c(this, l, tt(e, 0, t(this, u) - 1)), this.classList.remove("forward", "backward"), t(this, l) - s >= 0 ? this.classList.add("forward") : t(this, l) - s < 0 && this.classList.add("backward"), t(this, m).forEach((r) => {
132
+ r.forEach((h, b) => {
133
+ h.classList.remove(
134
+ "current",
135
+ "previous",
136
+ "next",
137
+ "previous-sibling",
138
+ "next-sibling"
139
+ ), b === t(this, l) ? h.classList.add("current") : b < t(this, l) ? h.classList.add("previous") : b > t(this, l) && h.classList.add("next"), b === Y(t(this, l) - 1, this.length) ? h.classList.add("previous-sibling") : b === (t(this, l) + 1) % this.length && h.classList.add("next-sibling");
140
+ });
141
+ }), this.classList.toggle("has-length", t(this, u) > 1), this.classList.toggle("start", t(this, l) === 0), this.classList.toggle("end", t(this, l) === t(this, u) - 1), this.style.setProperty("--counter", t(this, l).toString()), this.style.setProperty("--sections", t(this, u).toString()), t(this, l) !== s && (Z(this, "billboardChange", {
118
142
  detail: {
119
- counter: t(this, h)
143
+ counter: t(this, l)
120
144
  }
121
- }), t(this, S).current && setTimeout(() => {
145
+ }), t(this, T).current && setTimeout(() => {
122
146
  window.dispatchEvent(new Event("resize"));
123
147
  }, 0));
124
- }, q = new WeakMap(), F = new WeakMap();
125
- customElements.get("e-billboard") || customElements.define("e-billboard", G);
126
- var u, B, v, P, D;
127
- class Z extends HTMLElement {
148
+ }, F = new WeakMap(), G = new WeakMap();
149
+ customElements.get("e-billboard") || customElements.define("e-billboard", j);
150
+ var p, D, E, $, H;
151
+ class et extends HTMLElement {
128
152
  constructor() {
129
153
  super(...arguments);
130
- s(this, u, null);
131
- s(this, B, null);
132
- s(this, v, []);
133
- s(this, P, (e) => {
134
- const n = e.currentTarget, l = t(this, v).findIndex((a) => a === n);
135
- l >= 0 && t(this, u).set(l);
154
+ i(this, p, null);
155
+ i(this, D, null);
156
+ i(this, E, []);
157
+ i(this, $, (e) => {
158
+ const s = e.currentTarget, r = t(this, E).findIndex((h) => h === s);
159
+ r >= 0 && t(this, p).set(r);
136
160
  });
137
- s(this, D, () => {
138
- t(this, v).forEach((e, n) => {
139
- n === t(this, u).counter ? e.classList.add("current") : e.classList.remove("current");
161
+ i(this, H, () => {
162
+ t(this, E).forEach((e, s) => {
163
+ s === t(this, p).counter ? e.classList.add("current") : e.classList.remove("current");
140
164
  });
141
165
  });
142
166
  }
143
167
  connectedCallback() {
144
- return K(this, null, function* () {
168
+ return Q(this, null, function* () {
145
169
  var e;
146
- if (d(this, u, R(this, G)), t(this, u) && (yield customElements.whenDefined("e-billboard"), this.isConnected)) {
170
+ if (c(this, p, W(this, j)), t(this, p) && (yield customElements.whenDefined("e-billboard"), this.isConnected)) {
147
171
  this.innerHTML = "";
148
- const n = t(this, u).itemElements.length;
149
- d(this, B, document.createElement("div"));
150
- for (let l = 0; l < n; l++) {
151
- const a = document.createElement("button");
152
- a.setAttribute("aria-label", `Go to item ${l + 1}`), t(this, v).push(a), t(this, B).appendChild(a);
172
+ const s = t(this, p).length;
173
+ c(this, D, document.createElement("div"));
174
+ for (let r = 0; r < s; r++) {
175
+ const h = document.createElement("button");
176
+ h.setAttribute("aria-label", `Go to item ${r + 1}`), t(this, E).push(h), t(this, D).appendChild(h);
153
177
  }
154
- this.appendChild(t(this, B)), t(this, v).forEach((l) => {
155
- l.addEventListener("click", t(this, P));
156
- }), (e = t(this, u)) == null || e.addEventListener(
178
+ this.appendChild(t(this, D)), t(this, E).forEach((r) => {
179
+ r.addEventListener("click", t(this, $));
180
+ }), (e = t(this, p)) == null || e.addEventListener(
157
181
  "billboardChange",
158
- t(this, D)
159
- ), t(this, D).call(this);
182
+ t(this, H)
183
+ ), t(this, H).call(this);
160
184
  }
161
185
  });
162
186
  }
163
187
  disconnectedCallback() {
164
188
  var e;
165
- t(this, v).forEach((n) => {
166
- n.removeEventListener("click", t(this, P));
167
- }), (e = t(this, u)) == null || e.removeEventListener(
189
+ t(this, E).forEach((s) => {
190
+ s.removeEventListener("click", t(this, $));
191
+ }), (e = t(this, p)) == null || e.removeEventListener(
168
192
  "billboardChange",
169
- t(this, D)
170
- ), this.innerHTML = "", d(this, v, []);
193
+ t(this, H)
194
+ ), this.innerHTML = "", c(this, E, []);
171
195
  }
172
196
  }
173
- u = new WeakMap(), B = new WeakMap(), v = new WeakMap(), P = new WeakMap(), D = new WeakMap();
174
- Q && !customElements.get("e-billboard-bullets") && customElements.define("e-billboard-bullets", Z);
175
- var E, g, w;
176
- class _ extends HTMLElement {
197
+ p = new WeakMap(), D = new WeakMap(), E = new WeakMap(), $ = new WeakMap(), H = new WeakMap();
198
+ V && !customElements.get("e-billboard-bullets") && customElements.define("e-billboard-bullets", et);
199
+ var L, w, x;
200
+ class st extends HTMLElement {
177
201
  constructor() {
178
202
  super();
179
- s(this, E, new I(this, "--index", 0));
180
- s(this, g, null);
181
- s(this, w, () => {
203
+ i(this, L, new S(this, "--index", 0));
204
+ i(this, w, null);
205
+ i(this, x, () => {
182
206
  var e;
183
- t(this, E).current === ((e = t(this, g)) == null ? void 0 : e.counter) ? this.classList.add("current") : this.classList.remove("current");
207
+ t(this, L).current === ((e = t(this, w)) == null ? void 0 : e.counter) ? this.classList.add("current") : this.classList.remove("current");
184
208
  });
185
209
  this.addEventListener("click", (e) => {
186
- t(this, g) && (!this.handleClick || this.handleClick(e)) && t(this, g).set(t(this, E).current);
210
+ t(this, w) && (!this.handleClick || this.handleClick(e)) && t(this, w).set(t(this, L).current);
187
211
  }), this.addEventListener("keydown", (e) => {
188
212
  e.code === "Space" && !this.hasAttribute("keydown-disabled") && (e.preventDefault(), this.click());
189
213
  });
190
214
  }
191
215
  connectedCallback() {
192
216
  var e;
193
- this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.hasAttribute("role") || this.setAttribute("role", "button"), d(this, g, R(this, G)), (e = t(this, g)) == null || e.addEventListener(
217
+ this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.hasAttribute("role") || this.setAttribute("role", "button"), c(this, w, W(this, j)), (e = t(this, w)) == null || e.addEventListener(
194
218
  "billboardChange",
195
- t(this, w)
219
+ t(this, x)
196
220
  ), customElements.whenDefined("e-billboard").then(() => {
197
- this.isConnected && t(this, w).call(this);
198
- }), t(this, E).subscribe(t(this, w)), t(this, E).observe();
221
+ this.isConnected && t(this, x).call(this);
222
+ }), t(this, L).subscribe(t(this, x)), t(this, L).observe();
199
223
  }
200
224
  disconnectedCallback() {
201
225
  var e;
202
- this.removeAttribute("tabindex"), this.removeAttribute("role"), t(this, E).unsubscribe(t(this, w)), t(this, E).unobserve(), (e = t(this, g)) == null || e.removeEventListener(
226
+ this.removeAttribute("tabindex"), this.removeAttribute("role"), t(this, L).unsubscribe(t(this, x)), t(this, L).unobserve(), (e = t(this, w)) == null || e.removeEventListener(
203
227
  "billboardChange",
204
- t(this, w)
228
+ t(this, x)
205
229
  );
206
230
  }
207
231
  }
208
- E = new WeakMap(), g = new WeakMap(), w = new WeakMap();
209
- Q && !customElements.get("e-billboard-set-button") && customElements.define("e-billboard-set-button", _);
210
- var k, c, H;
211
- class tt extends HTMLElement {
232
+ L = new WeakMap(), w = new WeakMap(), x = new WeakMap();
233
+ V && !customElements.get("e-billboard-set-button") && customElements.define("e-billboard-set-button", st);
234
+ var C, d, P;
235
+ class it extends HTMLElement {
212
236
  constructor() {
213
237
  super();
214
- s(this, k, new I(this, "--step", 1));
215
- s(this, c, null);
216
- s(this, H, () => {
217
- t(this, c) && (!t(this, c).loop.current && (t(this, c).counter === 0 && t(this, k).current <= 0 || t(this, c).counter === t(this, c).itemElements.length - 1 && t(this, k).current >= 0) ? this.setAttribute("disabled", "") : this.removeAttribute("disabled"));
238
+ i(this, C, new S(this, "--step", 1));
239
+ i(this, d, null);
240
+ i(this, P, () => {
241
+ t(this, d) && (!t(this, d).loop.current && (t(this, d).counter === 0 && t(this, C).current <= 0 || t(this, d).counter === t(this, d).length - 1 && t(this, C).current >= 0) ? this.setAttribute("disabled", "") : this.removeAttribute("disabled"));
218
242
  });
219
243
  this.addEventListener("click", (e) => {
220
- t(this, c) && (!this.handleClick || this.handleClick(e)) && t(this, c).shift(t(this, k).current);
244
+ t(this, d) && (!this.handleClick || this.handleClick(e)) && t(this, d).shift(t(this, C).current);
221
245
  }), this.addEventListener("keydown", (e) => {
222
246
  e.code === "Space" && !this.hasAttribute("keydown-disabled") && (e.preventDefault(), this.click());
223
247
  });
224
248
  }
225
249
  connectedCallback() {
226
- return K(this, null, function* () {
250
+ return Q(this, null, function* () {
227
251
  var e;
228
- yield customElements.whenDefined("e-billboard"), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.hasAttribute("role") || this.setAttribute("role", "button"), t(this, k).observe(), this.tabIndex = 0, d(this, c, R(this, G)), (e = t(this, c)) == null || e.addEventListener(
252
+ yield customElements.whenDefined("e-billboard"), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.hasAttribute("role") || this.setAttribute("role", "button"), t(this, C).observe(), this.tabIndex = 0, c(this, d, W(this, j)), (e = t(this, d)) == null || e.addEventListener(
229
253
  "billboardChange",
230
- t(this, H)
254
+ t(this, P)
231
255
  ), setTimeout(() => {
232
- t(this, H).call(this);
256
+ t(this, P).call(this);
233
257
  }, 0);
234
258
  });
235
259
  }
236
260
  disconnectedCallback() {
237
261
  var e;
238
- this.removeAttribute("tabindex"), this.removeAttribute("role"), t(this, k).unobserve(), (e = t(this, c)) == null || e.removeEventListener(
262
+ this.removeAttribute("tabindex"), this.removeAttribute("role"), t(this, C).unobserve(), (e = t(this, d)) == null || e.removeEventListener(
239
263
  "billboardChange",
240
- t(this, H)
264
+ t(this, P)
241
265
  );
242
266
  }
243
267
  }
244
- k = new WeakMap(), c = new WeakMap(), H = new WeakMap();
245
- Q && !customElements.get("e-billboard-step-button") && customElements.define("e-billboard-step-button", tt);
268
+ C = new WeakMap(), d = new WeakMap(), P = new WeakMap();
269
+ V && !customElements.get("e-billboard-step-button") && customElements.define("e-billboard-step-button", it);
246
270
  export {
247
- Z as BillboardBulletsElement,
248
- G as BillboardElement,
249
- _ as BillboardSetButtonElement,
250
- tt as BillboardStepButtonElement
271
+ et as BillboardBulletsElement,
272
+ j as BillboardElement,
273
+ st as BillboardSetButtonElement,
274
+ it as BillboardStepButtonElement
251
275
  };
@@ -1 +1 @@
1
- "use strict";var te=c=>{throw TypeError(c)};var K=(c,o,t)=>o.has(c)||te("Cannot "+t);var e=(c,o,t)=>(K(c,o,"read from private field"),t?t.call(c):o.get(c)),r=(c,o,t)=>o.has(c)?te("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(c):o.set(c,t),n=(c,o,t,s)=>(K(c,o,"write to private field"),s?s.call(c,t):o.set(c,t),t),y=(c,o,t)=>(K(c,o,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const he=require("../element-linked-store/index.cjs"),g=require("../css-property/index.cjs"),_=require("../index-DekP7OZe.cjs"),X=require("../events-KVanG9sR.cjs"),ce=require("../function-MthRj-GJ.cjs"),se=require("../style-At6aDoqG.cjs");require("construct-style-sheets-polyfill");const ie=require("../url-lnBE_6yf.cjs"),re=require("../window-resizer/index.cjs"),Y=require("../Viewport-DB0qAZPJ.cjs");var u,b,I,J;class le{constructor(){r(this,u,new Map);r(this,b,[]);r(this,I,o=>{var s;const t=[...e(this,b)].reverse().find(i=>i.clickOutside.current);if(t){const i=o.composedPath();if(i.find(ee=>ee instanceof HTMLElement&&ee.hasAttribute("data-popover-content")))return;const l=i[0],p=l instanceof Node&&(t.contains(l)||((s=t.shadowRoot)==null?void 0:s.contains(l))),H=l instanceof HTMLElement&&l.hasAttribute("data-outside");(!p||H)&&t.close()}});r(this,J,o=>{if(o.code==="Escape"){const t=[...e(this,b)].reverse().find(s=>s.escape.current);t&&t.close()}});document.documentElement.addEventListener("click",e(this,I)),addEventListener("keydown",e(this,J))}get groups(){return e(this,u)}get stack(){return e(this,b)}add(o,t){if(t.closeRest.current)e(this,u).forEach(i=>{i.forEach(l=>{l.close()})});else if(t.closeRestInGroup.current){let i=e(this,u).get(o);i==null||i.forEach(l=>{l.close()})}let s=e(this,u).get(o);s!=null&&s.length||(s=[],e(this,u).set(o,s)),e(this,b).push(t),s.push(t)}remove(o,t){if(n(this,b,e(this,b).filter(s=>s!==t)),t.closeRest.current){let s=[];e(this,u).forEach(i=>{i.forEach(l=>s.push(l))}),e(this,u).clear(),s.forEach(i=>i.close())}else if(t.closeRestInGroup.current){const s=e(this,u).get(o);e(this,u).delete(o),s==null||s.forEach(i=>{i.close()})}else{let s=e(this,u).get(o);s&&(s=s.filter(i=>i!==t),e(this,u).set(o,s))}}}u=new WeakMap,b=new WeakMap,I=new WeakMap,J=new WeakMap;var f,$,M,A,B,v,w,C,x,m,R,q,L,T,O,a,P,oe,F,V,S,W,G;const E=class E extends HTMLElement{constructor(){super();r(this,P);r(this,f);r(this,$);r(this,M);r(this,A);r(this,B);r(this,v);r(this,w);r(this,C);r(this,x);r(this,m);r(this,R);r(this,q);r(this,L);r(this,T);r(this,O);r(this,a);r(this,V);r(this,S);r(this,W);r(this,G);this.urlValue="",n(this,f,!1),n(this,v,new g.CSSProperty(this,"--history",!1)),n(this,w,new g.CSSProperty(this,"--restore",!1)),n(this,C,new g.CSSProperty(this,"--close-rest",!1)),n(this,x,new g.CSSProperty(this,"--close-rest-in-group",!1)),n(this,m,new g.CSSProperty(this,"--group","")),n(this,R,new g.CSSProperty(this,"--click-outside",!1)),n(this,q,new g.CSSProperty(this,"--escape",!1)),n(this,L,new g.CSSProperty(this,"--check-viewport-bounds",!1)),n(this,T,!1),n(this,a,new he.ElementLinkedStore(this,{opened:!1,closing:!1,triggered:!1,transitionend:!1})),n(this,V,()=>{n(this,T,!1),e(this,f)&&e(this,v).current&&!location.search.includes(this.id)?this.close():!e(this,f)&&e(this,v).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),n(this,T,!0)}),n(this,S,()=>{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,W).call(this)}),n(this,W,ce.debounce(()=>{e(this,G).call(this)},10)),n(this,G,()=>{if(this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px"),e(this,L).current){const t=this.getBoundingClientRect();let s=0,i=0;t.right>Y.viewport.width?s=Y.viewport.width-t.right:t.left<0&&(s=t.left*-1),t.bottom>Y.viewport.height?i=Y.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")}}),e(this,m).subscribe(t=>{t.previous&&(E.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=E.stack.groups.get(this.group.current),i=s==null?void 0:s.find(l=>l.opened);document.documentElement.classList.toggle(`${this.group.current}-opened`,!!i)}})}get history(){return e(this,v)}get restore(){return e(this,w)}get closeRest(){return e(this,C)}get closeRestInGroup(){return e(this,x)}get group(){return e(this,m)}get clickOutside(){return e(this,R)}get escape(){return e(this,q)}get opened(){return e(this,f)}get lastTrigger(){return e(this,O)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,f)&&ie.updateSearchParameter(this.id,t)}open(t){if(e(this,f))return;if(n(this,O,t==null?void 0:t.trigger),clearTimeout(e(this,$)),clearTimeout(e(this,M)),this.hasAttribute("data-document-class")){const i=this.getAttribute("data-document-class");document.documentElement.classList.add(i)}e(this,a).set("closing",!1),e(this,a).set("triggered",!0),X.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,O)}}),e(this,v).current&&e(this,T)&&history.pushState(history.state,"",e(this,P,oe)),n(this,f,!0);const s=()=>{E.stack.add(e(this,m).current,this),e(this,S).call(this),e(this,a).set("opened",!0),X.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,O)}}),n(this,A,void 0),n(this,B,setTimeout(()=>{e(this,a).set("transitionend",!0)},se.getElementTransitionDurationMS(this)+10))};t!=null&&t.skipTransition?s():n(this,A,setTimeout(s,10))}close(){if(e(this,f)){if(clearTimeout(e(this,A)),clearTimeout(e(this,B)),E.stack.remove(e(this,m).current,this),n(this,f,!1),y(this,P,F).call(this),this.hasAttribute("data-document-class")){const t=this.getAttribute("data-document-class");document.documentElement.classList.remove(t)}e(this,a).set("transitionend",!1),n(this,$,setTimeout(()=>{e(this,a).set("opened",!1),e(this,a).set("closing",!0),X.dispatchEvent(this,"popoverClosing",{custom:!0}),n(this,M,setTimeout(()=>{e(this,a).set("triggered",!1),e(this,a).set("closing",!1),X.dispatchEvent(this,"popoverClosed",{custom:!0})},se.getElementTransitionDurationMS(this)+10))},10))}}connectedCallback(){e(this,v).observe(),e(this,w).observe(),e(this,C).observe(),e(this,x).observe(),e(this,m).observe(),e(this,R).observe(),e(this,q).observe(),e(this,L).observe(),this.setAttribute("role","dialog"),addEventListener("popstate",e(this,V)),setTimeout(()=>{e(this,w).current?(this.urlValue=ie.parseSearchParameters(location.search)[this.id],e(this,V).call(this)):(y(this,P,F).call(this),n(this,T,!0))},0),e(this,L).subscribe(()=>{e(this,S).call(this)}),re.windowResizer.subscribe(e(this,S))}disconnectedCallback(){E.stack.remove(e(this,m).current,this),re.windowResizer.unsubscribe(e(this,S)),e(this,a).close(),e(this,v).close(),e(this,w).close(),e(this,C).close(),e(this,x).close(),e(this,m).close(),e(this,R).close(),e(this,q).close(),e(this,L).close(),this.removeAttribute("role"),clearTimeout(e(this,$)),clearTimeout(e(this,M)),clearTimeout(e(this,A)),clearTimeout(e(this,B)),removeEventListener("popstate",e(this,V)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),this.style.removeProperty("--viewport-offset-x"),this.style.removeProperty("--viewport-offset-y"),y(this,P,F).call(this)}};f=new WeakMap,$=new WeakMap,M=new WeakMap,A=new WeakMap,B=new WeakMap,v=new WeakMap,w=new WeakMap,C=new WeakMap,x=new WeakMap,m=new WeakMap,R=new WeakMap,q=new WeakMap,L=new WeakMap,T=new WeakMap,O=new WeakMap,a=new WeakMap,P=new WeakSet,oe=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},F=function(){if(e(this,v).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},V=new WeakMap,S=new WeakMap,W=new WeakMap,G=new WeakMap,E.stack=new le;let z=E;_.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",z);var h,d,k,Q,D,U,j,N,Z;class ne extends HTMLElement{constructor(){super();r(this,k);r(this,h);r(this,d,new g.CSSProperty(this,"--type","open"));r(this,D,()=>{e(this,d).current!=="close"&&this.classList.add("triggered")});r(this,U,()=>{e(this,d).current!=="close"&&(this.classList.add("opened"),this.setAttribute("aria-expanded","true"))});r(this,j,()=>{e(this,d).current!=="close"&&this.classList.remove("opened")});r(this,N,()=>{e(this,d).current!=="close"&&(this.classList.remove("triggered"),this.setAttribute("aria-expanded","false"))});_.isBrowser&&(this.addEventListener("click",()=>{if(e(this,h)){const t=e(this,d).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,d)}get popoverElement(){return e(this,h)}changePopover(t){var s;if(y(this,k,Q).call(this),t){let i=null;if(t==="parent"){const l=this.closest("[data-popover]");if(l)i=l;else{const p=this.getRootNode();p instanceof ShadowRoot?i=p.host.closest("[data-popover]"):p instanceof HTMLElement&&(i=p.closest("[data-popover]"))}}else if(t==="sibling")i=(s=this.parentElement)==null?void 0:s.querySelector("[data-popover]");else if(t==="ancestor-child"){const l=p=>{if(!p)return null;let H=p.querySelector("[data-popover]");return!H&&(p!=null&&p.parentElement)&&(H=l(p.parentElement)),H};i=l(this.parentElement)||null}else!t.startsWith(".")&&!t.startsWith("[")&&(t=`#${t}`),i=document.querySelector(t)||this.getRootNode().querySelector(t);i instanceof HTMLElement?(n(this,h,i),e(this,h).addEventListener("popoverTriggered",e(this,D)),e(this,h).addEventListener("popoverOpened",e(this,U)),e(this,h).addEventListener("popoverClosing",e(this,j)),e(this,h).addEventListener("popoverClosed",e(this,N))):console.warn(this,`target ${t} not found`)}y(this,k,Z).call(this,e(this,d).current)}connectedCallback(){e(this,d).subscribe(s=>{y(this,k,Z).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,d).observe()}disconnectedCallback(){e(this,d).unobserve(),this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls"),this.removeAttribute("role"),this.removeAttribute("tabindex"),y(this,k,Q).call(this)}}h=new WeakMap,d=new WeakMap,k=new WeakSet,Q=function(){e(this,h)&&(e(this,h).removeEventListener("popoverTriggered",e(this,D)),e(this,h).removeEventListener("popoverOpened",e(this,U)),e(this,h).removeEventListener("popoverClosing",e(this,j)),e(this,h).removeEventListener("popoverClosed",e(this,N)))},D=new WeakMap,U=new WeakMap,j=new WeakMap,N=new WeakMap,Z=function(t){e(this,h)instanceof z&&(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")))};_.isBrowser&&!customElements.get("e-popover-button")&&customElements.define("e-popover-button",ne);exports.PopoverButtonElement=ne;exports.PopoverElement=z;
1
+ "use strict";var te=l=>{throw TypeError(l)};var K=(l,o,t)=>o.has(l)||te("Cannot "+t);var e=(l,o,t)=>(K(l,o,"read from private field"),t?t.call(l):o.get(l)),r=(l,o,t)=>o.has(l)?te("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(l):o.set(l,t),n=(l,o,t,s)=>(K(l,o,"write to private field"),s?s.call(l,t):o.set(l,t),t),y=(l,o,t)=>(K(l,o,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const he=require("../element-linked-store/index.cjs"),g=require("../css-property/index.cjs"),_=require("../index-DekP7OZe.cjs"),X=require("../events-KVanG9sR.cjs"),ce=require("../function-MthRj-GJ.cjs"),se=require("../style-At6aDoqG.cjs");require("construct-style-sheets-polyfill");const ie=require("../url-lnBE_6yf.cjs"),re=require("../window-resizer/index.cjs"),Y=require("../Viewport-DB0qAZPJ.cjs");var u,b,I,J;class le{constructor(){r(this,u,new Map);r(this,b,[]);r(this,I,o=>{var s;const t=[...e(this,b)].reverse().find(i=>i.clickOutside.current);if(t){const i=o.composedPath();if(i.find(ee=>ee instanceof HTMLElement&&ee.hasAttribute("data-popover-content")))return;const c=i[0],p=c instanceof Node&&(t.contains(c)||((s=t.shadowRoot)==null?void 0:s.contains(c))),H=c instanceof HTMLElement&&c.hasAttribute("data-outside");(!p||H)&&t.close()}});r(this,J,o=>{if(o.code==="Escape"){const t=[...e(this,b)].reverse().find(s=>s.escape.current);t&&t.close()}});document.documentElement.addEventListener("click",e(this,I)),addEventListener("keydown",e(this,J))}get groups(){return e(this,u)}get stack(){return e(this,b)}add(o,t){if(t.closeRest.current)e(this,u).forEach(i=>{i.forEach(c=>{c.close()})});else if(t.closeRestInGroup.current){let i=e(this,u).get(o);i==null||i.forEach(c=>{c.close()})}let s=e(this,u).get(o);s!=null&&s.length||(s=[],e(this,u).set(o,s)),e(this,b).push(t),s.push(t)}remove(o,t){if(n(this,b,e(this,b).filter(s=>s!==t)),t.closeRest.current){let s=[];e(this,u).forEach(i=>{i.forEach(c=>s.push(c))}),e(this,u).clear(),s.forEach(i=>i.close())}else if(t.closeRestInGroup.current){const s=e(this,u).get(o);e(this,u).delete(o),s==null||s.forEach(i=>{i.close()})}else{let s=e(this,u).get(o);s&&(s=s.filter(i=>i!==t),e(this,u).set(o,s))}}}u=new WeakMap,b=new WeakMap,I=new WeakMap,J=new WeakMap;var f,$,M,A,B,v,w,C,x,m,R,q,L,T,O,a,P,oe,F,V,S,W,G;const E=class E extends HTMLElement{constructor(){super();r(this,P);r(this,f);r(this,$);r(this,M);r(this,A);r(this,B);r(this,v);r(this,w);r(this,C);r(this,x);r(this,m);r(this,R);r(this,q);r(this,L);r(this,T);r(this,O);r(this,a);r(this,V);r(this,S);r(this,W);r(this,G);this.urlValue="",n(this,f,!1),n(this,v,new g.CSSProperty(this,"--history",!1)),n(this,w,new g.CSSProperty(this,"--restore",!1)),n(this,C,new g.CSSProperty(this,"--close-rest",!1)),n(this,x,new g.CSSProperty(this,"--close-rest-in-group",!1)),n(this,m,new g.CSSProperty(this,"--group","")),n(this,R,new g.CSSProperty(this,"--click-outside",!1)),n(this,q,new g.CSSProperty(this,"--escape",!1)),n(this,L,new g.CSSProperty(this,"--check-viewport-bounds",!1)),n(this,T,!1),n(this,a,new he.ElementLinkedStore(this,{opened:!1,closing:!1,triggered:!1,transitionend:!1})),n(this,V,()=>{n(this,T,!1),e(this,f)&&e(this,v).current&&!location.search.includes(this.id)?this.close():!e(this,f)&&e(this,v).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),n(this,T,!0)}),n(this,S,()=>{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,W).call(this)}),n(this,W,ce.debounce(()=>{e(this,G).call(this)},10)),n(this,G,()=>{if(this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px"),e(this,L).current){const t=this.getBoundingClientRect();let s=0,i=0;t.right>Y.viewport.width?s=Y.viewport.width-t.right:t.left<0&&(s=t.left*-1),t.bottom>Y.viewport.height?i=Y.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")}}),e(this,m).subscribe(t=>{t.previous&&(E.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=E.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 history(){return e(this,v)}get restore(){return e(this,w)}get closeRest(){return e(this,C)}get closeRestInGroup(){return e(this,x)}get group(){return e(this,m)}get clickOutside(){return e(this,R)}get escape(){return e(this,q)}get opened(){return e(this,f)}get lastTrigger(){return e(this,O)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,f)&&ie.updateSearchParameter(this.id,t)}open(t){if(e(this,f))return;n(this,O,t==null?void 0:t.trigger),clearTimeout(e(this,$)),clearTimeout(e(this,M)),this.hasAttribute("data-document-class")&&this.getAttribute("data-document-class").split(" ").map(c=>{document.documentElement.classList.add(c.trim())}),e(this,a).set("closing",!1),e(this,a).set("triggered",!0),X.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,O)}}),e(this,v).current&&e(this,T)&&history.pushState(history.state,"",e(this,P,oe)),n(this,f,!0);const s=()=>{E.stack.add(e(this,m).current,this),e(this,S).call(this),e(this,a).set("opened",!0),X.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,O)}}),n(this,A,void 0),n(this,B,setTimeout(()=>{e(this,a).set("transitionend",!0)},se.getElementTransitionDurationMS(this)+10))};t!=null&&t.skipTransition?s():n(this,A,setTimeout(s,10))}close(){e(this,f)&&(clearTimeout(e(this,A)),clearTimeout(e(this,B)),E.stack.remove(e(this,m).current,this),n(this,f,!1),y(this,P,F).call(this),this.hasAttribute("data-document-class")&&this.getAttribute("data-document-class").split(" ").map(s=>{document.documentElement.classList.remove(s.trim())}),e(this,a).set("transitionend",!1),n(this,$,setTimeout(()=>{e(this,a).set("opened",!1),e(this,a).set("closing",!0),X.dispatchEvent(this,"popoverClosing",{custom:!0}),n(this,M,setTimeout(()=>{e(this,a).set("triggered",!1),e(this,a).set("closing",!1),X.dispatchEvent(this,"popoverClosed",{custom:!0})},se.getElementTransitionDurationMS(this)+10))},10)))}connectedCallback(){e(this,v).observe(),e(this,w).observe(),e(this,C).observe(),e(this,x).observe(),e(this,m).observe(),e(this,R).observe(),e(this,q).observe(),e(this,L).observe(),this.setAttribute("role","dialog"),addEventListener("popstate",e(this,V)),setTimeout(()=>{e(this,w).current?(this.urlValue=ie.parseSearchParameters(location.search)[this.id],e(this,V).call(this)):(y(this,P,F).call(this),n(this,T,!0))},0),e(this,L).subscribe(()=>{e(this,S).call(this)}),re.windowResizer.subscribe(e(this,S))}disconnectedCallback(){E.stack.remove(e(this,m).current,this),re.windowResizer.unsubscribe(e(this,S)),e(this,a).close(),e(this,v).close(),e(this,w).close(),e(this,C).close(),e(this,x).close(),e(this,m).close(),e(this,R).close(),e(this,q).close(),e(this,L).close(),this.removeAttribute("role"),clearTimeout(e(this,$)),clearTimeout(e(this,M)),clearTimeout(e(this,A)),clearTimeout(e(this,B)),removeEventListener("popstate",e(this,V)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),this.style.removeProperty("--viewport-offset-x"),this.style.removeProperty("--viewport-offset-y"),y(this,P,F).call(this)}};f=new WeakMap,$=new WeakMap,M=new WeakMap,A=new WeakMap,B=new WeakMap,v=new WeakMap,w=new WeakMap,C=new WeakMap,x=new WeakMap,m=new WeakMap,R=new WeakMap,q=new WeakMap,L=new WeakMap,T=new WeakMap,O=new WeakMap,a=new WeakMap,P=new WeakSet,oe=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},F=function(){if(e(this,v).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},V=new WeakMap,S=new WeakMap,W=new WeakMap,G=new WeakMap,E.stack=new le;let z=E;_.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",z);var h,d,k,Q,D,N,U,j,Z;class ne extends HTMLElement{constructor(){super();r(this,k);r(this,h);r(this,d,new g.CSSProperty(this,"--type","open"));r(this,D,()=>{e(this,d).current!=="close"&&this.classList.add("triggered")});r(this,N,()=>{e(this,d).current!=="close"&&(this.classList.add("opened"),this.setAttribute("aria-expanded","true"))});r(this,U,()=>{e(this,d).current!=="close"&&this.classList.remove("opened")});r(this,j,()=>{e(this,d).current!=="close"&&(this.classList.remove("triggered"),this.setAttribute("aria-expanded","false"))});_.isBrowser&&(this.addEventListener("click",()=>{if(e(this,h)){const t=e(this,d).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,d)}get popoverElement(){return e(this,h)}changePopover(t){var s;if(y(this,k,Q).call(this),t){let i=null;if(t==="parent"){const c=this.closest("[data-popover]");if(c)i=c;else{const p=this.getRootNode();p instanceof ShadowRoot?i=p.host.closest("[data-popover]"):p instanceof HTMLElement&&(i=p.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=p=>{if(!p)return null;let H=p.querySelector("[data-popover]");return!H&&(p!=null&&p.parentElement)&&(H=c(p.parentElement)),H};i=c(this.parentElement)||null}else!t.startsWith(".")&&!t.startsWith("[")&&(t=`#${t}`),i=document.querySelector(t)||this.getRootNode().querySelector(t);i instanceof HTMLElement?(n(this,h,i),e(this,h).addEventListener("popoverTriggered",e(this,D)),e(this,h).addEventListener("popoverOpened",e(this,N)),e(this,h).addEventListener("popoverClosing",e(this,U)),e(this,h).addEventListener("popoverClosed",e(this,j))):console.warn(this,`target ${t} not found`)}y(this,k,Z).call(this,e(this,d).current)}connectedCallback(){e(this,d).subscribe(s=>{y(this,k,Z).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,d).observe()}disconnectedCallback(){e(this,d).unobserve(),this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls"),this.removeAttribute("role"),this.removeAttribute("tabindex"),y(this,k,Q).call(this)}}h=new WeakMap,d=new WeakMap,k=new WeakSet,Q=function(){e(this,h)&&(e(this,h).removeEventListener("popoverTriggered",e(this,D)),e(this,h).removeEventListener("popoverOpened",e(this,N)),e(this,h).removeEventListener("popoverClosing",e(this,U)),e(this,h).removeEventListener("popoverClosed",e(this,j)))},D=new WeakMap,N=new WeakMap,U=new WeakMap,j=new WeakMap,Z=function(t){e(this,h)instanceof z&&(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")))};_.isBrowser&&!customElements.get("e-popover-button")&&customElements.define("e-popover-button",ne);exports.PopoverButtonElement=ne;exports.PopoverElement=z;
@@ -1,8 +1,8 @@
1
- var et = (c) => {
2
- throw TypeError(c);
1
+ var et = (a) => {
2
+ throw TypeError(a);
3
3
  };
4
- var K = (c, o, e) => o.has(c) || et("Cannot " + e);
5
- var t = (c, o, e) => (K(c, o, "read from private field"), e ? e.call(c) : o.get(c)), r = (c, o, e) => o.has(c) ? et("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(c) : o.set(c, e), h = (c, o, e, s) => (K(c, o, "write to private field"), s ? s.call(c, e) : o.set(c, e), e), y = (c, o, e) => (K(c, o, "access private method"), e);
4
+ var K = (a, o, e) => o.has(a) || et("Cannot " + e);
5
+ var t = (a, o, e) => (K(a, o, "read from private field"), e ? e.call(a) : o.get(a)), r = (a, o, e) => o.has(a) ? et("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(a) : o.set(a, e), h = (a, o, e, s) => (K(a, o, "write to private field"), s ? s.call(a, e) : o.set(a, e), e), y = (a, o, e) => (K(a, o, "access private method"), e);
6
6
  import { ElementLinkedStore as ot } from "../element-linked-store/index.js";
7
7
  import { CSSProperty as g } from "../css-property/index.js";
8
8
  import { i as _ } from "../index-Bv9zgfdb.js";
@@ -27,7 +27,7 @@ class at {
27
27
  (tt) => tt instanceof HTMLElement && tt.hasAttribute("data-popover-content")
28
28
  ))
29
29
  return;
30
- const a = i[0], p = a instanceof Node && (e.contains(a) || ((s = e.shadowRoot) == null ? void 0 : s.contains(a))), G = a instanceof HTMLElement && a.hasAttribute("data-outside");
30
+ const c = i[0], p = c instanceof Node && (e.contains(c) || ((s = e.shadowRoot) == null ? void 0 : s.contains(c))), G = c instanceof HTMLElement && c.hasAttribute("data-outside");
31
31
  (!p || G) && e.close();
32
32
  }
33
33
  });
@@ -51,14 +51,14 @@ class at {
51
51
  add(o, e) {
52
52
  if (e.closeRest.current)
53
53
  t(this, u).forEach((i) => {
54
- i.forEach((a) => {
55
- a.close();
54
+ i.forEach((c) => {
55
+ c.close();
56
56
  });
57
57
  });
58
58
  else if (e.closeRestInGroup.current) {
59
59
  let i = t(this, u).get(o);
60
- i == null || i.forEach((a) => {
61
- a.close();
60
+ i == null || i.forEach((c) => {
61
+ c.close();
62
62
  });
63
63
  }
64
64
  let s = t(this, u).get(o);
@@ -68,7 +68,7 @@ class at {
68
68
  if (h(this, b, t(this, b).filter((s) => s !== e)), e.closeRest.current) {
69
69
  let s = [];
70
70
  t(this, u).forEach((i) => {
71
- i.forEach((a) => s.push(a));
71
+ i.forEach((c) => s.push(c));
72
72
  }), t(this, u).clear(), s.forEach((i) => i.close());
73
73
  } else if (e.closeRestInGroup.current) {
74
74
  const s = t(this, u).get(o);
@@ -140,7 +140,7 @@ const E = class E extends HTMLElement {
140
140
  `${this.group.current}-closing`,
141
141
  e.current.closing
142
142
  );
143
- const s = E.stack.groups.get(this.group.current), i = s == null ? void 0 : s.find((a) => a.opened);
143
+ const s = E.stack.groups.get(this.group.current), i = s == null ? void 0 : s.find((c) => c.opened);
144
144
  document.documentElement.classList.toggle(
145
145
  `${this.group.current}-opened`,
146
146
  !!i
@@ -184,11 +184,9 @@ const E = class E extends HTMLElement {
184
184
  open(e) {
185
185
  if (t(this, f))
186
186
  return;
187
- if (h(this, O, e == null ? void 0 : e.trigger), clearTimeout(t(this, M)), clearTimeout(t(this, H)), this.hasAttribute("data-document-class")) {
188
- const i = this.getAttribute("data-document-class");
189
- document.documentElement.classList.add(i);
190
- }
191
- t(this, l).set("closing", !1), t(this, l).set("triggered", !0), X(this, "popoverTriggered", {
187
+ h(this, O, e == null ? void 0 : e.trigger), clearTimeout(t(this, M)), clearTimeout(t(this, H)), this.hasAttribute("data-document-class") && this.getAttribute("data-document-class").split(" ").map((c) => {
188
+ document.documentElement.classList.add(c.trim());
189
+ }), t(this, l).set("closing", !1), t(this, l).set("triggered", !0), X(this, "popoverTriggered", {
192
190
  custom: !0,
193
191
  detail: {
194
192
  trigger: t(this, O)
@@ -207,21 +205,17 @@ const E = class E extends HTMLElement {
207
205
  e != null && e.skipTransition ? s() : h(this, x, setTimeout(s, 10));
208
206
  }
209
207
  close() {
210
- if (t(this, f)) {
211
- if (clearTimeout(t(this, x)), clearTimeout(t(this, W)), E.stack.remove(t(this, v).current, this), h(this, f, !1), y(this, A, j).call(this), this.hasAttribute("data-document-class")) {
212
- const e = this.getAttribute("data-document-class");
213
- document.documentElement.classList.remove(e);
214
- }
215
- t(this, l).set("transitionend", !1), h(this, M, setTimeout(() => {
216
- t(this, l).set("opened", !1), t(this, l).set("closing", !0), X(this, "popoverClosing", {
208
+ t(this, f) && (clearTimeout(t(this, x)), clearTimeout(t(this, W)), E.stack.remove(t(this, v).current, this), h(this, f, !1), y(this, A, j).call(this), this.hasAttribute("data-document-class") && this.getAttribute("data-document-class").split(" ").map((s) => {
209
+ document.documentElement.classList.remove(s.trim());
210
+ }), t(this, l).set("transitionend", !1), h(this, M, setTimeout(() => {
211
+ t(this, l).set("opened", !1), t(this, l).set("closing", !0), X(this, "popoverClosing", {
212
+ custom: !0
213
+ }), h(this, H, setTimeout(() => {
214
+ t(this, l).set("triggered", !1), t(this, l).set("closing", !1), X(this, "popoverClosed", {
217
215
  custom: !0
218
- }), h(this, H, setTimeout(() => {
219
- t(this, l).set("triggered", !1), t(this, l).set("closing", !1), X(this, "popoverClosed", {
220
- custom: !0
221
- });
222
- }, st(this) + 10));
223
- }, 10));
224
- }
216
+ });
217
+ }, st(this) + 10));
218
+ }, 10)));
225
219
  }
226
220
  connectedCallback() {
227
221
  t(this, m).observe(), t(this, w).observe(), t(this, S).observe(), t(this, C).observe(), t(this, v).observe(), t(this, R).observe(), t(this, $).observe(), t(this, L).observe(), this.setAttribute("role", "dialog"), addEventListener("popstate", t(this, V)), setTimeout(() => {
@@ -244,7 +238,7 @@ f = new WeakMap(), M = new WeakMap(), H = new WeakMap(), x = new WeakMap(), W =
244
238
  }, V = new WeakMap(), k = new WeakMap(), q = new WeakMap(), z = new WeakMap(), E.stack = new at();
245
239
  let F = E;
246
240
  _ && !customElements.get("e-popover") && customElements.define("e-popover", F);
247
- var n, d, P, Q, B, D, U, N, Z;
241
+ var n, d, P, Q, B, N, D, U, Z;
248
242
  class lt extends HTMLElement {
249
243
  constructor() {
250
244
  super();
@@ -254,13 +248,13 @@ class lt extends HTMLElement {
254
248
  r(this, B, () => {
255
249
  t(this, d).current !== "close" && this.classList.add("triggered");
256
250
  });
257
- r(this, D, () => {
251
+ r(this, N, () => {
258
252
  t(this, d).current !== "close" && (this.classList.add("opened"), this.setAttribute("aria-expanded", "true"));
259
253
  });
260
- r(this, U, () => {
254
+ r(this, D, () => {
261
255
  t(this, d).current !== "close" && this.classList.remove("opened");
262
256
  });
263
- r(this, N, () => {
257
+ r(this, U, () => {
264
258
  t(this, d).current !== "close" && (this.classList.remove("triggered"), this.setAttribute("aria-expanded", "false"));
265
259
  });
266
260
  _ && (this.addEventListener("click", () => {
@@ -283,9 +277,9 @@ class lt extends HTMLElement {
283
277
  if (y(this, P, Q).call(this), e) {
284
278
  let i = null;
285
279
  if (e === "parent") {
286
- const a = this.closest("[data-popover]");
287
- if (a)
288
- i = a;
280
+ const c = this.closest("[data-popover]");
281
+ if (c)
282
+ i = c;
289
283
  else {
290
284
  const p = this.getRootNode();
291
285
  p instanceof ShadowRoot ? i = p.host.closest("[data-popover]") : p instanceof HTMLElement && (i = p.closest("[data-popover]"));
@@ -293,13 +287,13 @@ class lt extends HTMLElement {
293
287
  } else if (e === "sibling")
294
288
  i = (s = this.parentElement) == null ? void 0 : s.querySelector("[data-popover]");
295
289
  else if (e === "ancestor-child") {
296
- const a = (p) => {
290
+ const c = (p) => {
297
291
  if (!p)
298
292
  return null;
299
293
  let G = p.querySelector("[data-popover]");
300
- return !G && (p != null && p.parentElement) && (G = a(p.parentElement)), G;
294
+ return !G && (p != null && p.parentElement) && (G = c(p.parentElement)), G;
301
295
  };
302
- i = a(this.parentElement) || null;
296
+ i = c(this.parentElement) || null;
303
297
  } else
304
298
  !e.startsWith(".") && !e.startsWith("[") && (e = `#${e}`), i = document.querySelector(e) || this.getRootNode().querySelector(e);
305
299
  i instanceof HTMLElement ? (h(this, n, i), t(this, n).addEventListener(
@@ -307,13 +301,13 @@ class lt extends HTMLElement {
307
301
  t(this, B)
308
302
  ), t(this, n).addEventListener(
309
303
  "popoverOpened",
310
- t(this, D)
304
+ t(this, N)
311
305
  ), t(this, n).addEventListener(
312
306
  "popoverClosing",
313
- t(this, U)
307
+ t(this, D)
314
308
  ), t(this, n).addEventListener(
315
309
  "popoverClosed",
316
- t(this, N)
310
+ t(this, U)
317
311
  )) : console.warn(this, `target ${e} not found`);
318
312
  }
319
313
  y(this, P, Z).call(this, t(this, d).current);
@@ -335,15 +329,15 @@ n = new WeakMap(), d = new WeakMap(), P = new WeakSet(), Q = function() {
335
329
  t(this, B)
336
330
  ), t(this, n).removeEventListener(
337
331
  "popoverOpened",
338
- t(this, D)
332
+ t(this, N)
339
333
  ), t(this, n).removeEventListener(
340
334
  "popoverClosing",
341
- t(this, U)
335
+ t(this, D)
342
336
  ), t(this, n).removeEventListener(
343
337
  "popoverClosed",
344
- t(this, N)
338
+ t(this, U)
345
339
  ));
346
- }, B = new WeakMap(), D = new WeakMap(), U = new WeakMap(), N = new WeakMap(), Z = function(e) {
340
+ }, B = new WeakMap(), N = new WeakMap(), D = new WeakMap(), U = new WeakMap(), Z = function(e) {
347
341
  t(this, n) instanceof F && (e !== "close" ? (this.setAttribute("aria-haspopup", "true"), this.setAttribute(
348
342
  "aria-expanded",
349
343
  t(this, n).opened ? "true" : "false"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.65.0",
3
+ "version": "0.65.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"
@@ -401,12 +401,12 @@
401
401
  "dev": "vite --host --mode site"
402
402
  },
403
403
  "devDependencies": {
404
- "@types/node": "^22.10.1",
404
+ "@types/node": "^22.13.17",
405
405
  "@types/three": "^0.175.0",
406
- "tsx": "^4.19.2",
407
- "vite": "^6.0.1",
408
- "vite-plugin-dts": "^4.3.0",
409
- "vite-plugin-htmc": "0.1.15"
406
+ "tsx": "^4.19.3",
407
+ "vite": "^6.2.4",
408
+ "vite-plugin-dts": "^4.5.3",
409
+ "vite-plugin-htmc": "0.1.16"
410
410
  },
411
411
  "dependencies": {
412
412
  "construct-style-sheets-polyfill": "^3.1.0",