aptechka 0.69.7 → 0.69.9

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.
@@ -20,6 +20,7 @@ export declare class BillboardElement extends HTMLElement {
20
20
  get autoplay(): CSSProperty<string | false>;
21
21
  get autoplayDuration(): number;
22
22
  get swipe(): CSSProperty<false | Axes2D>;
23
+ get lengthOffset(): CSSProperty<number>;
23
24
  get items(): BillboardItem[];
24
25
  get groups(): Map<string, BillboardItem[]>;
25
26
  get length(): number;
@@ -1 +1 @@
1
- "use strict";var nt=l=>{throw TypeError(l)};var et=(l,n,e)=>n.has(l)||nt("Cannot "+e);var t=(l,n,e)=>(et(l,n,"read from private field"),e?e.call(l):n.get(l)),s=(l,n,e)=>n.has(l)?nt("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(l):n.set(l,e),h=(l,n,e,i)=>(et(l,n,"write to private field"),i?i.call(l,e):n.set(l,e),e),c=(l,n,e)=>(et(l,n,"access private method"),e);var H=(l,n,e)=>new Promise((i,r)=>{var a=A=>{try{Z(e.next(A))}catch(tt){r(tt)}},y=A=>{try{Z(e.throw(A))}catch(tt){r(tt)}},Z=A=>A.done?i(A.value):Promise.resolve(A.value).then(a,y);Z((e=e.apply(l,n)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("../index-DekP7OZe.cjs"),it=require("../custom-elements-Dh4TWRDJ.cjs"),Y=require("../dom-JBOkFLTh.cjs");require("construct-style-sheets-polyfill");const $=require("../css-property/index.cjs"),ft=require("../events-KVanG9sR.cjs"),pt=require("../gestures-C7gbKx11.cjs"),Et=require("../math-GDWEqu7y.cjs"),rt=require("../number-ChAm68cm.cjs");var m,B,Q,f,ht,at,ot,st;class lt{constructor(n,e){s(this,f);s(this,m);s(this,B,null);s(this,Q,!1);this.element=n,h(this,m,e)}destroy(){c(this,f,st).call(this)}updateClasses(n){const e=n===t(this,m).counter;t(this,Q)&&!e?this.element.classList.add("was-current"):this.element.classList.remove("was-current"),c(this,f,ot).call(this),c(this,f,st).call(this),n===t(this,m).counter?c(this,f,ht).call(this):n<t(this,m).counter?this.element.classList.add("previous"):this.element.classList.add("next"),c(this,f,at).call(this,n)}}m=new WeakMap,B=new WeakMap,Q=new WeakMap,f=new WeakSet,ht=function(){h(this,Q,!0),this.element.classList.add("current"),h(this,B,requestAnimationFrame(()=>{this.element.classList.add("current-active")}))},at=function(n){n===rt.loopNumber(t(this,m).counter-1,t(this,m).length)?this.element.classList.add("previous-sibling"):n===(t(this,m).counter+1)%t(this,m).length&&this.element.classList.add("next-sibling")},ot=function(){this.element.classList.remove("current","previous","next","previous-sibling","next-sibling","current-active")},st=function(){t(this,B)&&(cancelAnimationFrame(t(this,B)),h(this,B,null))};var z,M,L,C,S,I,T,p,o,b,P,d,ct,U,F,V,K,W,X;class J extends HTMLElement{constructor(){super(...arguments);s(this,d);s(this,z,new $.CSSProperty(this,"--resize",!0));s(this,M,new $.CSSProperty(this,"--loop",!0));s(this,L,new $.CSSProperty(this,"--autoplay",!1));s(this,C,new $.CSSProperty(this,"--swipe","x"));s(this,S);s(this,I,!1);s(this,T,[]);s(this,p,new Map);s(this,o,-1);s(this,b,0);s(this,P,[]);s(this,F,e=>{h(this,I,e.isIntersecting),t(this,I)?c(this,d,U).call(this):clearInterval(t(this,S))});s(this,V,()=>{clearInterval(t(this,S)),t(this,I)&&h(this,S,setInterval(t(this,W),this.autoplayDuration))});s(this,W,()=>{c(this,d,K).call(this,t(this,o)+1)});s(this,X,e=>{if(!t(this,C).current)return;let i=0;pt.setupDrag(r=>{const a=e.x-r.x,y=e.y-r.y;t(this,C).current==="x"?Math.abs(a)>Math.abs(y)&&Math.abs(a)>10&&(i=Math.sign(a)):t(this,C).current==="y"&&Math.abs(y)>Math.abs(a)&&Math.abs(y)>10&&(i=Math.sign(y))},()=>{i&&this.shift(i)})})}get counter(){return t(this,o)}get loop(){return t(this,M)}get autoplay(){return t(this,L)}get autoplayDuration(){return parseFloat(t(this,L).current||"0")*1e3}get swipe(){return t(this,C)}get items(){return t(this,T)}get groups(){return t(this,p)}get length(){return t(this,b)}addItem(e){const i=new lt(e,this);t(this,T).push(i);const r=e.getAttribute("data-billboard-item-group")||"default";let a=t(this,p).get(r);a||(a=[],t(this,p).set(r,a)),a.push(i),c(this,d,ct).call(this)}set(e){(!this.handleSet||this.handleSet(e))&&(c(this,d,K).call(this,e),c(this,d,U).call(this))}shift(e){this.set(t(this,o)+e)}connectedCallback(){[...this.querySelectorAll(`[data-billboard-item${this.id?`="${this.id}"`:""}]`)].forEach(i=>{this.addItem(i)}),t(this,p).forEach(i=>{var r;(r=i[0])==null||r.element.classList.add("current")}),t(this,L).subscribe(i=>{i.current?(D.intersector.subscribe(this,t(this,F)),c(this,d,U).call(this)):(h(this,I,!0),D.intersector.unsubscribe(t(this,F)),clearInterval(t(this,S)),c(this,d,K).call(this,0))}),t(this,L).observe(),t(this,C).observe(),t(this,M).observe(),t(this,z).observe(),c(this,d,K).call(this,0),this.addEventListener("pointerdown",t(this,X))}disconnectedCallback(){t(this,L).unobserve(),t(this,C).unobserve(),t(this,M).unobserve(),t(this,z).unobserve(),t(this,T).forEach(e=>e.destroy()),h(this,T,[]),t(this,p).clear(),D.intersector.unsubscribe(t(this,F)),clearInterval(t(this,S)),t(this,P).forEach(e=>{clearTimeout(e)})}}z=new WeakMap,M=new WeakMap,L=new WeakMap,C=new WeakMap,S=new WeakMap,I=new WeakMap,T=new WeakMap,p=new WeakMap,o=new WeakMap,b=new WeakMap,P=new WeakMap,d=new WeakSet,ct=function(){h(this,b,0),t(this,p).forEach(e=>{e.length>t(this,b)&&h(this,b,e.length)})},U=function(){t(this,L).current!==!1&&t(this,V).call(this)},F=new WeakMap,V=new WeakMap,K=function(){return H(this,arguments,function*(e=t(this,o)){const i=t(this,o);t(this,M).current?h(this,o,rt.loopNumber(e,t(this,b))):h(this,o,Et.clamp(e,0,t(this,b)-1)),i!==t(this,o)&&(t(this,P).forEach(r=>{clearTimeout(r)}),this.classList.remove("forward","backward","next-round","prev-round"),t(this,o)-i>=0?this.classList.add("forward"):t(this,o)-i<0&&this.classList.add("backward"),t(this,p).forEach(r=>{r.forEach((a,y)=>{a.updateClasses(y)})}),this.classList.toggle("has-length",t(this,b)>1),this.classList.toggle("start",t(this,o)===0),this.classList.toggle("end",t(this,o)===t(this,b)-1),this.style.setProperty("--counter",t(this,o).toString()),this.style.setProperty("--sections",t(this,b).toString()),ft.dispatchEvent(this,"billboardChange",{detail:{counter:t(this,o)}}),t(this,z).current&&t(this,P).push(setTimeout(()=>{window.dispatchEvent(new Event("resize"))},0)),t(this,P).push(setTimeout(()=>{this.classList.remove("next-round","prev-round")},10)))})},W=new WeakMap,X=new WeakMap;customElements.get("e-billboard")||customElements.define("e-billboard",J);var E,N,g,R,_;class ut extends HTMLElement{constructor(){super(...arguments);s(this,E,null);s(this,N,null);s(this,g,[]);s(this,R,e=>{const i=e.currentTarget,r=t(this,g).findIndex(a=>a===i);r>=0&&t(this,E).set(r)});s(this,_,()=>{t(this,g).forEach((e,i)=>{i===t(this,E).counter?e.classList.add("current"):e.classList.remove("current")})})}get buttonElements(){return t(this,g)}connectedCallback(){return H(this,null,function*(){var e;if(yield it.whenDefined("e-billboard"),h(this,E,Y.findParentElement(this,J)),t(this,E)&&this.isConnected){this.innerHTML="";const i=t(this,E).length;h(this,N,document.createElement("div"));for(let r=0;r<i;r++){const a=document.createElement("button");a.setAttribute("aria-label",`Go to item ${r+1}`),t(this,g).push(a),t(this,N).appendChild(a)}this.appendChild(t(this,N)),t(this,g).forEach(r=>{r.addEventListener("click",t(this,R))}),(e=t(this,E))==null||e.addEventListener("billboardChange",t(this,_)),t(this,_).call(this)}})}disconnectedCallback(){var e;t(this,g).forEach(i=>{i.removeEventListener("click",t(this,R))}),(e=t(this,E))==null||e.removeEventListener("billboardChange",t(this,_)),this.innerHTML="",h(this,g,[])}}E=new WeakMap,N=new WeakMap,g=new WeakMap,R=new WeakMap,_=new WeakMap;D.isBrowser&&!customElements.get("e-billboard-bullets")&&customElements.define("e-billboard-bullets",ut);var q,j;class dt extends HTMLElement{constructor(){super(...arguments);s(this,q,null);s(this,j,()=>{var r;const e=(((r=t(this,q))==null?void 0:r.counter)||0)+1,i=parseInt(this.getAttribute("pad")||"0");this.textContent=e.toString().padStart(i,"0")})}connectedCallback(){return H(this,null,function*(){var e;yield it.whenDefined("e-billboard"),h(this,q,Y.findParentElement(this,J)),(e=t(this,q))==null||e.addEventListener("billboardChange",t(this,j)),t(this,j).call(this)})}disconnectedCallback(){var e;(e=t(this,q))==null||e.removeEventListener("billboardChange",t(this,j))}}q=new WeakMap,j=new WeakMap;D.isBrowser&&!customElements.get("e-billboard-counter")&&customElements.define("e-billboard-counter",dt);var G,w,v,k;class bt extends HTMLElement{constructor(){super();s(this,G,null);s(this,w,new $.CSSProperty(this,"--index",0));s(this,v,null);s(this,k,()=>{t(this,G).updateClasses(t(this,w).current)});this.addEventListener("click",e=>{t(this,v)&&(!this.handleClick||this.handleClick(e))&&t(this,v).set(t(this,w).current)}),this.addEventListener("keydown",e=>{e.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(e.preventDefault(),this.click())})}connectedCallback(){return H(this,null,function*(){yield it.whenDefined("e-billboard"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button"),h(this,v,Y.findParentElement(this,J)),t(this,v)&&(h(this,G,new lt(this,t(this,v))),t(this,v).addEventListener("billboardChange",t(this,k)),t(this,k).call(this),t(this,w).subscribe(t(this,k)),t(this,w).observe())})}disconnectedCallback(){var e;this.removeAttribute("tabindex"),this.removeAttribute("role"),t(this,w).unsubscribe(t(this,k)),t(this,w).unobserve(),(e=t(this,v))==null||e.removeEventListener("billboardChange",t(this,k)),t(this,G).destroy()}}G=new WeakMap,w=new WeakMap,v=new WeakMap,k=new WeakMap;D.isBrowser&&!customElements.get("e-billboard-set-button")&&customElements.define("e-billboard-set-button",bt);var x,u,O;class mt extends HTMLElement{constructor(){super();s(this,x,new $.CSSProperty(this,"--step",1));s(this,u,null);s(this,O,()=>{t(this,u)&&(!t(this,u).loop.current&&(t(this,u).counter===0&&t(this,x).current<=0||t(this,u).counter===t(this,u).length-1&&t(this,x).current>=0)?this.setAttribute("disabled",""):this.removeAttribute("disabled"))});this.addEventListener("click",e=>{t(this,u)&&(!this.handleClick||this.handleClick(e))&&t(this,u).shift(t(this,x).current)}),this.addEventListener("keydown",e=>{e.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(e.preventDefault(),this.click())})}connectedCallback(){return H(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,h(this,u,Y.findParentElement(this,J)),(e=t(this,u))==null||e.addEventListener("billboardChange",t(this,O)),setTimeout(()=>{t(this,O).call(this)},0)})}disconnectedCallback(){var e;this.removeAttribute("tabindex"),this.removeAttribute("role"),t(this,x).unobserve(),(e=t(this,u))==null||e.removeEventListener("billboardChange",t(this,O))}}x=new WeakMap,u=new WeakMap,O=new WeakMap;D.isBrowser&&!customElements.get("e-billboard-step-button")&&customElements.define("e-billboard-step-button",mt);exports.BillboardBulletsElement=ut;exports.BillboardCounterElement=dt;exports.BillboardElement=J;exports.BillboardSetButtonElement=bt;exports.BillboardStepButtonElement=mt;
1
+ "use strict";var ht=h=>{throw TypeError(h)};var st=(h,r,e)=>r.has(h)||ht("Cannot "+e);var t=(h,r,e)=>(st(h,r,"read from private field"),e?e.call(h):r.get(h)),s=(h,r,e)=>r.has(h)?ht("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(h):r.set(h,e),l=(h,r,e,i)=>(st(h,r,"write to private field"),i?i.call(h,e):r.set(h,e),e),c=(h,r,e)=>(st(h,r,"access private method"),e);var z=(h,r,e)=>new Promise((i,n)=>{var a=B=>{try{tt(e.next(B))}catch(et){n(et)}},y=B=>{try{tt(e.throw(B))}catch(et){n(et)}},tt=B=>B.done?i(B.value):Promise.resolve(B.value).then(a,y);tt((e=e.apply(h,r)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("../index-DekP7OZe.cjs"),nt=require("../custom-elements-Dh4TWRDJ.cjs"),Z=require("../dom-JBOkFLTh.cjs");require("construct-style-sheets-polyfill");const M=require("../css-property/index.cjs"),pt=require("../events-KVanG9sR.cjs"),gt=require("../gestures-C7gbKx11.cjs"),Et=require("../math-GDWEqu7y.cjs"),lt=require("../number-ChAm68cm.cjs");var m,I,R,f,ot,ct,ut,it;class at{constructor(r,e){s(this,f);s(this,m);s(this,I,null);s(this,R,!1);this.element=r,l(this,m,e)}destroy(){c(this,f,it).call(this)}updateClasses(r){const e=r===t(this,m).counter;t(this,R)&&!e?this.element.classList.add("was-current"):this.element.classList.remove("was-current"),c(this,f,ut).call(this),c(this,f,it).call(this),r===t(this,m).counter?c(this,f,ot).call(this):r<t(this,m).counter?this.element.classList.add("previous"):this.element.classList.add("next"),c(this,f,ct).call(this,r)}}m=new WeakMap,I=new WeakMap,R=new WeakMap,f=new WeakSet,ot=function(){l(this,R,!0),this.element.classList.add("current"),l(this,I,requestAnimationFrame(()=>{this.element.classList.add("current-active")}))},ct=function(r){r===lt.loopNumber(t(this,m).counter-1,t(this,m).length)?this.element.classList.add("previous-sibling"):r===(t(this,m).counter+1)%t(this,m).length&&this.element.classList.add("next-sibling")},ut=function(){this.element.classList.remove("current","previous","next","previous-sibling","next-sibling","current-active")},it=function(){t(this,I)&&(cancelAnimationFrame(t(this,I)),l(this,I,null))};var F,P,L,C,S,k,T,q,p,o,d,D,u,rt,V,N,W,Q,X,Y;class K extends HTMLElement{constructor(){super(...arguments);s(this,u);s(this,F,new M.CSSProperty(this,"--resize",!0));s(this,P,new M.CSSProperty(this,"--loop",!0));s(this,L,new M.CSSProperty(this,"--autoplay",!1));s(this,C,new M.CSSProperty(this,"--swipe","x"));s(this,S,new M.CSSProperty(this,"--length-offset",0));s(this,k);s(this,T,!1);s(this,q,[]);s(this,p,new Map);s(this,o,-1);s(this,d,0);s(this,D,[]);s(this,N,e=>{l(this,T,e.isIntersecting),t(this,T)?c(this,u,V).call(this):clearInterval(t(this,k))});s(this,W,()=>{clearInterval(t(this,k)),t(this,T)&&l(this,k,setInterval(t(this,X),this.autoplayDuration))});s(this,X,()=>{c(this,u,Q).call(this,t(this,o)+1)});s(this,Y,e=>{if(!t(this,C).current)return;let i=0;gt.setupDrag(n=>{const a=e.x-n.x,y=e.y-n.y;t(this,C).current==="x"?Math.abs(a)>Math.abs(y)&&Math.abs(a)>10&&(i=Math.sign(a)):t(this,C).current==="y"&&Math.abs(y)>Math.abs(a)&&Math.abs(y)>10&&(i=Math.sign(y))},()=>{i&&this.shift(i)})})}get counter(){return t(this,o)}get loop(){return t(this,P)}get autoplay(){return t(this,L)}get autoplayDuration(){return parseFloat(t(this,L).current||"0")*1e3}get swipe(){return t(this,C)}get lengthOffset(){return t(this,S)}get items(){return t(this,q)}get groups(){return t(this,p)}get length(){return t(this,d)}addItem(e){const i=new at(e,this);t(this,q).push(i);const n=e.getAttribute("data-billboard-item-group")||"default";let a=t(this,p).get(n);a||(a=[],t(this,p).set(n,a)),a.push(i),c(this,u,rt).call(this)}set(e){(!this.handleSet||this.handleSet(e))&&(c(this,u,Q).call(this,e),c(this,u,V).call(this))}shift(e){this.set(t(this,o)+e)}connectedCallback(){[...this.querySelectorAll(`[data-billboard-item${this.id?`="${this.id}"`:""}]`)].forEach(i=>{this.addItem(i)}),t(this,p).forEach(i=>{var n;(n=i[0])==null||n.element.classList.add("current")}),t(this,L).subscribe(i=>{i.current?($.intersector.subscribe(this,t(this,N)),c(this,u,V).call(this)):(l(this,T,!0),$.intersector.unsubscribe(t(this,N)),clearInterval(t(this,k)),c(this,u,Q).call(this,0))}),t(this,S).subscribe(()=>{c(this,u,rt).call(this)}),t(this,L).observe(),t(this,C).observe(),t(this,S).observe(),t(this,P).observe(),t(this,F).observe(),c(this,u,Q).call(this,0),this.addEventListener("pointerdown",t(this,Y))}disconnectedCallback(){t(this,L).unobserve(),t(this,C).unobserve(),t(this,S).unobserve(),t(this,P).unobserve(),t(this,F).unobserve(),t(this,q).forEach(e=>e.destroy()),l(this,q,[]),t(this,p).clear(),$.intersector.unsubscribe(t(this,N)),clearInterval(t(this,k)),t(this,D).forEach(e=>{clearTimeout(e)})}}F=new WeakMap,P=new WeakMap,L=new WeakMap,C=new WeakMap,S=new WeakMap,k=new WeakMap,T=new WeakMap,q=new WeakMap,p=new WeakMap,o=new WeakMap,d=new WeakMap,D=new WeakMap,u=new WeakSet,rt=function(){l(this,d,0),t(this,p).forEach(e=>{e.length>t(this,d)&&l(this,d,e.length)}),l(this,d,t(this,d)+t(this,S).current)},V=function(){t(this,L).current!==!1&&t(this,W).call(this)},N=new WeakMap,W=new WeakMap,Q=function(){return z(this,arguments,function*(e=t(this,o)){const i=t(this,o);t(this,P).current?l(this,o,lt.loopNumber(e,t(this,d))):l(this,o,Et.clamp(e,0,t(this,d)-1)),i!==t(this,o)&&(t(this,D).forEach(n=>{clearTimeout(n)}),this.classList.remove("forward","backward","next-round","prev-round"),t(this,o)-i>=0?this.classList.add("forward"):t(this,o)-i<0&&this.classList.add("backward"),t(this,p).forEach(n=>{n.forEach((a,y)=>{a.updateClasses(y)})}),this.classList.toggle("has-length",t(this,d)>1),this.classList.toggle("start",t(this,o)===0),this.classList.toggle("end",t(this,o)===t(this,d)-1),this.style.setProperty("--counter",t(this,o).toString()),this.style.setProperty("--sections",t(this,d).toString()),pt.dispatchEvent(this,"billboardChange",{detail:{counter:t(this,o)}}),t(this,F).current&&t(this,D).push(setTimeout(()=>{window.dispatchEvent(new Event("resize"))},0)),t(this,D).push(setTimeout(()=>{this.classList.remove("next-round","prev-round")},10)))})},X=new WeakMap,Y=new WeakMap;customElements.get("e-billboard")||customElements.define("e-billboard",K);var g,O,E,U,_;class dt extends HTMLElement{constructor(){super(...arguments);s(this,g,null);s(this,O,null);s(this,E,[]);s(this,U,e=>{const i=e.currentTarget,n=t(this,E).findIndex(a=>a===i);n>=0&&t(this,g).set(n)});s(this,_,()=>{t(this,E).forEach((e,i)=>{i===t(this,g).counter?e.classList.add("current"):e.classList.remove("current")})})}get buttonElements(){return t(this,E)}connectedCallback(){return z(this,null,function*(){var e;if(yield nt.whenDefined("e-billboard"),l(this,g,Z.findParentElement(this,K)),t(this,g)&&this.isConnected){this.innerHTML="";const i=t(this,g).length;l(this,O,document.createElement("div"));for(let n=0;n<i;n++){const a=document.createElement("button");a.setAttribute("aria-label",`Go to item ${n+1}`),t(this,E).push(a),t(this,O).appendChild(a)}this.appendChild(t(this,O)),t(this,E).forEach(n=>{n.addEventListener("click",t(this,U))}),(e=t(this,g))==null||e.addEventListener("billboardChange",t(this,_)),t(this,_).call(this)}})}disconnectedCallback(){var e;t(this,E).forEach(i=>{i.removeEventListener("click",t(this,U))}),(e=t(this,g))==null||e.removeEventListener("billboardChange",t(this,_)),this.innerHTML="",l(this,E,[])}}g=new WeakMap,O=new WeakMap,E=new WeakMap,U=new WeakMap,_=new WeakMap;$.isBrowser&&!customElements.get("e-billboard-bullets")&&customElements.define("e-billboard-bullets",dt);var H,j;class bt extends HTMLElement{constructor(){super(...arguments);s(this,H,null);s(this,j,()=>{var n;const e=(((n=t(this,H))==null?void 0:n.counter)||0)+1,i=parseInt(this.getAttribute("pad")||"0");this.textContent=e.toString().padStart(i,"0")})}connectedCallback(){return z(this,null,function*(){var e;yield nt.whenDefined("e-billboard"),l(this,H,Z.findParentElement(this,K)),(e=t(this,H))==null||e.addEventListener("billboardChange",t(this,j)),t(this,j).call(this)})}disconnectedCallback(){var e;(e=t(this,H))==null||e.removeEventListener("billboardChange",t(this,j))}}H=new WeakMap,j=new WeakMap;$.isBrowser&&!customElements.get("e-billboard-counter")&&customElements.define("e-billboard-counter",bt);var G,w,v,x;class mt extends HTMLElement{constructor(){super();s(this,G,null);s(this,w,new M.CSSProperty(this,"--index",0));s(this,v,null);s(this,x,()=>{t(this,G).updateClasses(t(this,w).current)});this.addEventListener("click",e=>{t(this,v)&&(!this.handleClick||this.handleClick(e))&&t(this,v).set(t(this,w).current)}),this.addEventListener("keydown",e=>{e.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(e.preventDefault(),this.click())})}connectedCallback(){return z(this,null,function*(){yield nt.whenDefined("e-billboard"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button"),l(this,v,Z.findParentElement(this,K)),t(this,v)&&(l(this,G,new at(this,t(this,v))),t(this,v).addEventListener("billboardChange",t(this,x)),t(this,x).call(this),t(this,w).subscribe(t(this,x)),t(this,w).observe())})}disconnectedCallback(){var e;this.removeAttribute("tabindex"),this.removeAttribute("role"),t(this,w).unsubscribe(t(this,x)),t(this,w).unobserve(),(e=t(this,v))==null||e.removeEventListener("billboardChange",t(this,x)),t(this,G).destroy()}}G=new WeakMap,w=new WeakMap,v=new WeakMap,x=new WeakMap;$.isBrowser&&!customElements.get("e-billboard-set-button")&&customElements.define("e-billboard-set-button",mt);var A,b,J;class ft extends HTMLElement{constructor(){super();s(this,A,new M.CSSProperty(this,"--step",1));s(this,b,null);s(this,J,()=>{t(this,b)&&(!t(this,b).loop.current&&(t(this,b).counter===0&&t(this,A).current<=0||t(this,b).counter===t(this,b).length-1&&t(this,A).current>=0)?this.setAttribute("disabled",""):this.removeAttribute("disabled"))});this.addEventListener("click",e=>{t(this,b)&&(!this.handleClick||this.handleClick(e))&&t(this,b).shift(t(this,A).current)}),this.addEventListener("keydown",e=>{e.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(e.preventDefault(),this.click())})}connectedCallback(){return z(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,A).observe(),this.tabIndex=0,l(this,b,Z.findParentElement(this,K)),(e=t(this,b))==null||e.addEventListener("billboardChange",t(this,J)),setTimeout(()=>{t(this,J).call(this)},0)})}disconnectedCallback(){var e;this.removeAttribute("tabindex"),this.removeAttribute("role"),t(this,A).unobserve(),(e=t(this,b))==null||e.removeEventListener("billboardChange",t(this,J))}}A=new WeakMap,b=new WeakMap,J=new WeakMap;$.isBrowser&&!customElements.get("e-billboard-step-button")&&customElements.define("e-billboard-step-button",ft);exports.BillboardBulletsElement=dt;exports.BillboardCounterElement=bt;exports.BillboardElement=K;exports.BillboardSetButtonElement=mt;exports.BillboardStepButtonElement=ft;
@@ -1,57 +1,57 @@
1
- var rt = (h) => {
1
+ var lt = (h) => {
2
2
  throw TypeError(h);
3
3
  };
4
- var et = (h, n, e) => n.has(h) || rt("Cannot " + e);
5
- var t = (h, n, e) => (et(h, n, "read from private field"), e ? e.call(h) : n.get(h)), s = (h, n, e) => n.has(h) ? rt("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(h) : n.set(h, e), l = (h, n, e, i) => (et(h, n, "write to private field"), i ? i.call(h, e) : n.set(h, e), e), c = (h, n, e) => (et(h, n, "access private method"), e);
6
- var P = (h, n, e) => new Promise((i, r) => {
7
- var a = (M) => {
4
+ var st = (h, n, e) => n.has(h) || lt("Cannot " + e);
5
+ var t = (h, n, e) => (st(h, n, "read from private field"), e ? e.call(h) : n.get(h)), s = (h, n, e) => n.has(h) ? lt("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(h) : n.set(h, e), l = (h, n, e, i) => (st(h, n, "write to private field"), i ? i.call(h, e) : n.set(h, e), e), c = (h, n, e) => (st(h, n, "access private method"), e);
6
+ var F = (h, n, e) => new Promise((i, r) => {
7
+ var a = (I) => {
8
8
  try {
9
- _(e.next(M));
10
- } catch (tt) {
11
- r(tt);
9
+ tt(e.next(I));
10
+ } catch (et) {
11
+ r(et);
12
12
  }
13
- }, y = (M) => {
13
+ }, y = (I) => {
14
14
  try {
15
- _(e.throw(M));
16
- } catch (tt) {
17
- r(tt);
15
+ tt(e.throw(I));
16
+ } catch (et) {
17
+ r(et);
18
18
  }
19
- }, _ = (M) => M.done ? i(M.value) : Promise.resolve(M.value).then(a, y);
20
- _((e = e.apply(h, n)).next());
19
+ }, tt = (I) => I.done ? i(I.value) : Promise.resolve(I.value).then(a, y);
20
+ tt((e = e.apply(h, n)).next());
21
21
  });
22
- import { a as st, i as Y } from "../index-Bv9zgfdb.js";
23
- import { w as nt } from "../custom-elements-DBnCK7Zx.js";
24
- import { b as Z } from "../dom-CVWzyXPH.js";
22
+ import { a as it, i as Z } from "../index-Bv9zgfdb.js";
23
+ import { w as ht } from "../custom-elements-DBnCK7Zx.js";
24
+ import { b as _ } from "../dom-CVWzyXPH.js";
25
25
  import "construct-style-sheets-polyfill";
26
- import { CSSProperty as z } from "../css-property/index.js";
27
- import { d as ut } from "../events-CsVF98U6.js";
28
- import { s as bt } from "../gestures-CcXV6fCp.js";
29
- import { c as mt } from "../math-BOBiC4TN.js";
30
- import { l as ht } from "../number-CumqY64S.js";
31
- var m, I, O, f, at, ot, ct, it;
32
- class lt {
26
+ import { CSSProperty as S } from "../css-property/index.js";
27
+ import { d as bt } from "../events-CsVF98U6.js";
28
+ import { s as mt } from "../gestures-CcXV6fCp.js";
29
+ import { c as ft } from "../math-BOBiC4TN.js";
30
+ import { l as at } from "../number-CumqY64S.js";
31
+ var m, T, Q, f, ct, dt, ut, nt;
32
+ class ot {
33
33
  constructor(n, e) {
34
34
  s(this, f);
35
35
  s(this, m);
36
- s(this, I, null);
37
- s(this, O, !1);
36
+ s(this, T, null);
37
+ s(this, Q, !1);
38
38
  this.element = n, l(this, m, e);
39
39
  }
40
40
  destroy() {
41
- c(this, f, it).call(this);
41
+ c(this, f, nt).call(this);
42
42
  }
43
43
  updateClasses(n) {
44
44
  const e = n === t(this, m).counter;
45
- t(this, O) && !e ? this.element.classList.add("was-current") : this.element.classList.remove("was-current"), c(this, f, ct).call(this), c(this, f, it).call(this), n === t(this, m).counter ? c(this, f, at).call(this) : n < t(this, m).counter ? this.element.classList.add("previous") : this.element.classList.add("next"), c(this, f, ot).call(this, n);
45
+ t(this, Q) && !e ? this.element.classList.add("was-current") : this.element.classList.remove("was-current"), c(this, f, ut).call(this), c(this, f, nt).call(this), n === t(this, m).counter ? c(this, f, ct).call(this) : n < t(this, m).counter ? this.element.classList.add("previous") : this.element.classList.add("next"), c(this, f, dt).call(this, n);
46
46
  }
47
47
  }
48
- m = new WeakMap(), I = new WeakMap(), O = new WeakMap(), f = new WeakSet(), at = function() {
49
- l(this, O, !0), this.element.classList.add("current"), l(this, I, requestAnimationFrame(() => {
48
+ m = new WeakMap(), T = new WeakMap(), Q = new WeakMap(), f = new WeakSet(), ct = function() {
49
+ l(this, Q, !0), this.element.classList.add("current"), l(this, T, requestAnimationFrame(() => {
50
50
  this.element.classList.add("current-active");
51
51
  }));
52
- }, ot = function(n) {
53
- n === ht(t(this, m).counter - 1, t(this, m).length) ? this.element.classList.add("previous-sibling") : n === (t(this, m).counter + 1) % t(this, m).length && this.element.classList.add("next-sibling");
54
- }, ct = function() {
52
+ }, dt = function(n) {
53
+ n === at(t(this, m).counter - 1, t(this, m).length) ? this.element.classList.add("previous-sibling") : n === (t(this, m).counter + 1) % t(this, m).length && this.element.classList.add("next-sibling");
54
+ }, ut = function() {
55
55
  this.element.classList.remove(
56
56
  "current",
57
57
  "previous",
@@ -60,39 +60,40 @@ m = new WeakMap(), I = new WeakMap(), O = new WeakMap(), f = new WeakSet(), at =
60
60
  "next-sibling",
61
61
  "current-active"
62
62
  );
63
- }, it = function() {
64
- t(this, I) && (cancelAnimationFrame(t(this, I)), l(this, I, null));
63
+ }, nt = function() {
64
+ t(this, T) && (cancelAnimationFrame(t(this, T)), l(this, T, null));
65
65
  };
66
- var F, S, L, C, k, T, B, p, o, b, D, u, dt, U, $, V, K, W, X;
67
- class R extends HTMLElement {
66
+ var $, B, L, C, k, x, D, H, p, o, u, P, d, rt, V, q, W, K, X, Y;
67
+ class U extends HTMLElement {
68
68
  constructor() {
69
69
  super(...arguments);
70
- s(this, u);
71
- s(this, F, new z(this, "--resize", !0));
72
- s(this, S, new z(this, "--loop", !0));
73
- s(this, L, new z(this, "--autoplay", !1));
74
- s(this, C, new z(this, "--swipe", "x"));
75
- s(this, k);
76
- s(this, T, !1);
77
- s(this, B, []);
70
+ s(this, d);
71
+ s(this, $, new S(this, "--resize", !0));
72
+ s(this, B, new S(this, "--loop", !0));
73
+ s(this, L, new S(this, "--autoplay", !1));
74
+ s(this, C, new S(this, "--swipe", "x"));
75
+ s(this, k, new S(this, "--length-offset", 0));
76
+ s(this, x);
77
+ s(this, D, !1);
78
+ s(this, H, []);
78
79
  s(this, p, /* @__PURE__ */ new Map());
79
80
  s(this, o, -1);
80
- s(this, b, 0);
81
- s(this, D, []);
82
- s(this, $, (e) => {
83
- l(this, T, e.isIntersecting), t(this, T) ? c(this, u, U).call(this) : clearInterval(t(this, k));
84
- });
85
- s(this, V, () => {
86
- clearInterval(t(this, k)), t(this, T) && l(this, k, setInterval(t(this, W), this.autoplayDuration));
81
+ s(this, u, 0);
82
+ s(this, P, []);
83
+ s(this, q, (e) => {
84
+ l(this, D, e.isIntersecting), t(this, D) ? c(this, d, V).call(this) : clearInterval(t(this, x));
87
85
  });
88
86
  s(this, W, () => {
89
- c(this, u, K).call(this, t(this, o) + 1);
87
+ clearInterval(t(this, x)), t(this, D) && l(this, x, setInterval(t(this, X), this.autoplayDuration));
88
+ });
89
+ s(this, X, () => {
90
+ c(this, d, K).call(this, t(this, o) + 1);
90
91
  });
91
- s(this, X, (e) => {
92
+ s(this, Y, (e) => {
92
93
  if (!t(this, C).current)
93
94
  return;
94
95
  let i = 0;
95
- bt(
96
+ mt(
96
97
  (r) => {
97
98
  const a = e.x - r.x, y = e.y - r.y;
98
99
  t(this, C).current === "x" ? Math.abs(a) > Math.abs(y) && Math.abs(a) > 10 && (i = Math.sign(a)) : t(this, C).current === "y" && Math.abs(y) > Math.abs(a) && Math.abs(y) > 10 && (i = Math.sign(y));
@@ -107,7 +108,7 @@ class R extends HTMLElement {
107
108
  return t(this, o);
108
109
  }
109
110
  get loop() {
110
- return t(this, S);
111
+ return t(this, B);
111
112
  }
112
113
  get autoplay() {
113
114
  return t(this, L);
@@ -118,24 +119,27 @@ class R extends HTMLElement {
118
119
  get swipe() {
119
120
  return t(this, C);
120
121
  }
122
+ get lengthOffset() {
123
+ return t(this, k);
124
+ }
121
125
  get items() {
122
- return t(this, B);
126
+ return t(this, H);
123
127
  }
124
128
  get groups() {
125
129
  return t(this, p);
126
130
  }
127
131
  get length() {
128
- return t(this, b);
132
+ return t(this, u);
129
133
  }
130
134
  addItem(e) {
131
- const i = new lt(e, this);
132
- t(this, B).push(i);
135
+ const i = new ot(e, this);
136
+ t(this, H).push(i);
133
137
  const r = e.getAttribute("data-billboard-item-group") || "default";
134
138
  let a = t(this, p).get(r);
135
- a || (a = [], t(this, p).set(r, a)), a.push(i), c(this, u, dt).call(this);
139
+ a || (a = [], t(this, p).set(r, a)), a.push(i), c(this, d, rt).call(this);
136
140
  }
137
141
  set(e) {
138
- (!this.handleSet || this.handleSet(e)) && (c(this, u, K).call(this, e), c(this, u, U).call(this));
142
+ (!this.handleSet || this.handleSet(e)) && (c(this, d, K).call(this, e), c(this, d, V).call(this));
139
143
  }
140
144
  shift(e) {
141
145
  this.set(t(this, o) + e);
@@ -151,58 +155,60 @@ class R extends HTMLElement {
151
155
  var r;
152
156
  (r = i[0]) == null || r.element.classList.add("current");
153
157
  }), t(this, L).subscribe((i) => {
154
- i.current ? (st.subscribe(this, t(this, $)), c(this, u, U).call(this)) : (l(this, T, !0), st.unsubscribe(t(this, $)), clearInterval(t(this, k)), c(this, u, K).call(this, 0));
155
- }), t(this, L).observe(), t(this, C).observe(), t(this, S).observe(), t(this, F).observe(), c(this, u, K).call(this, 0), this.addEventListener("pointerdown", t(this, X));
158
+ i.current ? (it.subscribe(this, t(this, q)), c(this, d, V).call(this)) : (l(this, D, !0), it.unsubscribe(t(this, q)), clearInterval(t(this, x)), c(this, d, K).call(this, 0));
159
+ }), t(this, k).subscribe(() => {
160
+ c(this, d, rt).call(this);
161
+ }), t(this, L).observe(), t(this, C).observe(), t(this, k).observe(), t(this, B).observe(), t(this, $).observe(), c(this, d, K).call(this, 0), this.addEventListener("pointerdown", t(this, Y));
156
162
  }
157
163
  disconnectedCallback() {
158
- t(this, L).unobserve(), t(this, C).unobserve(), t(this, S).unobserve(), t(this, F).unobserve(), t(this, B).forEach((e) => e.destroy()), l(this, B, []), t(this, p).clear(), st.unsubscribe(t(this, $)), clearInterval(t(this, k)), t(this, D).forEach((e) => {
164
+ t(this, L).unobserve(), t(this, C).unobserve(), t(this, k).unobserve(), t(this, B).unobserve(), t(this, $).unobserve(), t(this, H).forEach((e) => e.destroy()), l(this, H, []), t(this, p).clear(), it.unsubscribe(t(this, q)), clearInterval(t(this, x)), t(this, P).forEach((e) => {
159
165
  clearTimeout(e);
160
166
  });
161
167
  }
162
168
  }
163
- F = new WeakMap(), S = new WeakMap(), L = new WeakMap(), C = new WeakMap(), k = new WeakMap(), T = new WeakMap(), B = new WeakMap(), p = new WeakMap(), o = new WeakMap(), b = new WeakMap(), D = new WeakMap(), u = new WeakSet(), dt = function() {
164
- l(this, b, 0), t(this, p).forEach((e) => {
165
- e.length > t(this, b) && l(this, b, e.length);
166
- });
167
- }, U = function() {
168
- t(this, L).current !== !1 && t(this, V).call(this);
169
- }, $ = new WeakMap(), V = new WeakMap(), K = function() {
170
- return P(this, arguments, function* (e = t(this, o)) {
169
+ $ = new WeakMap(), B = new WeakMap(), L = new WeakMap(), C = new WeakMap(), k = new WeakMap(), x = new WeakMap(), D = new WeakMap(), H = new WeakMap(), p = new WeakMap(), o = new WeakMap(), u = new WeakMap(), P = new WeakMap(), d = new WeakSet(), rt = function() {
170
+ l(this, u, 0), t(this, p).forEach((e) => {
171
+ e.length > t(this, u) && l(this, u, e.length);
172
+ }), l(this, u, t(this, u) + t(this, k).current);
173
+ }, V = function() {
174
+ t(this, L).current !== !1 && t(this, W).call(this);
175
+ }, q = new WeakMap(), W = new WeakMap(), K = function() {
176
+ return F(this, arguments, function* (e = t(this, o)) {
171
177
  const i = t(this, o);
172
- t(this, S).current ? l(this, o, ht(e, t(this, b))) : l(this, o, mt(e, 0, t(this, b) - 1)), i !== t(this, o) && (t(this, D).forEach((r) => {
178
+ t(this, B).current ? l(this, o, at(e, t(this, u))) : l(this, o, ft(e, 0, t(this, u) - 1)), i !== t(this, o) && (t(this, P).forEach((r) => {
173
179
  clearTimeout(r);
174
180
  }), this.classList.remove("forward", "backward", "next-round", "prev-round"), t(this, o) - i >= 0 ? this.classList.add("forward") : t(this, o) - i < 0 && this.classList.add("backward"), t(this, p).forEach((r) => {
175
181
  r.forEach((a, y) => {
176
182
  a.updateClasses(y);
177
183
  });
178
- }), this.classList.toggle("has-length", t(this, b) > 1), this.classList.toggle("start", t(this, o) === 0), this.classList.toggle("end", t(this, o) === t(this, b) - 1), this.style.setProperty("--counter", t(this, o).toString()), this.style.setProperty("--sections", t(this, b).toString()), ut(this, "billboardChange", {
184
+ }), this.classList.toggle("has-length", t(this, u) > 1), this.classList.toggle("start", t(this, o) === 0), this.classList.toggle("end", t(this, o) === t(this, u) - 1), this.style.setProperty("--counter", t(this, o).toString()), this.style.setProperty("--sections", t(this, u).toString()), bt(this, "billboardChange", {
179
185
  detail: {
180
186
  counter: t(this, o)
181
187
  }
182
- }), t(this, F).current && t(this, D).push(
188
+ }), t(this, $).current && t(this, P).push(
183
189
  setTimeout(() => {
184
190
  window.dispatchEvent(new Event("resize"));
185
191
  }, 0)
186
- ), t(this, D).push(
192
+ ), t(this, P).push(
187
193
  setTimeout(() => {
188
194
  this.classList.remove("next-round", "prev-round");
189
195
  }, 10)
190
196
  ));
191
197
  });
192
- }, W = new WeakMap(), X = new WeakMap();
193
- customElements.get("e-billboard") || customElements.define("e-billboard", R);
194
- var g, q, v, Q, N;
195
- class ft extends HTMLElement {
198
+ }, X = new WeakMap(), Y = new WeakMap();
199
+ customElements.get("e-billboard") || customElements.define("e-billboard", U);
200
+ var g, N, v, R, O;
201
+ class pt extends HTMLElement {
196
202
  constructor() {
197
203
  super(...arguments);
198
204
  s(this, g, null);
199
- s(this, q, null);
205
+ s(this, N, null);
200
206
  s(this, v, []);
201
- s(this, Q, (e) => {
207
+ s(this, R, (e) => {
202
208
  const i = e.currentTarget, r = t(this, v).findIndex((a) => a === i);
203
209
  r >= 0 && t(this, g).set(r);
204
210
  });
205
- s(this, N, () => {
211
+ s(this, O, () => {
206
212
  t(this, v).forEach((e, i) => {
207
213
  i === t(this, g).counter ? e.classList.add("current") : e.classList.remove("current");
208
214
  });
@@ -212,52 +218,52 @@ class ft extends HTMLElement {
212
218
  return t(this, v);
213
219
  }
214
220
  connectedCallback() {
215
- return P(this, null, function* () {
221
+ return F(this, null, function* () {
216
222
  var e;
217
- if (yield nt("e-billboard"), l(this, g, Z(this, R)), t(this, g) && this.isConnected) {
223
+ if (yield ht("e-billboard"), l(this, g, _(this, U)), t(this, g) && this.isConnected) {
218
224
  this.innerHTML = "";
219
225
  const i = t(this, g).length;
220
- l(this, q, document.createElement("div"));
226
+ l(this, N, document.createElement("div"));
221
227
  for (let r = 0; r < i; r++) {
222
228
  const a = document.createElement("button");
223
- a.setAttribute("aria-label", `Go to item ${r + 1}`), t(this, v).push(a), t(this, q).appendChild(a);
229
+ a.setAttribute("aria-label", `Go to item ${r + 1}`), t(this, v).push(a), t(this, N).appendChild(a);
224
230
  }
225
- this.appendChild(t(this, q)), t(this, v).forEach((r) => {
226
- r.addEventListener("click", t(this, Q));
231
+ this.appendChild(t(this, N)), t(this, v).forEach((r) => {
232
+ r.addEventListener("click", t(this, R));
227
233
  }), (e = t(this, g)) == null || e.addEventListener(
228
234
  "billboardChange",
229
- t(this, N)
230
- ), t(this, N).call(this);
235
+ t(this, O)
236
+ ), t(this, O).call(this);
231
237
  }
232
238
  });
233
239
  }
234
240
  disconnectedCallback() {
235
241
  var e;
236
242
  t(this, v).forEach((i) => {
237
- i.removeEventListener("click", t(this, Q));
243
+ i.removeEventListener("click", t(this, R));
238
244
  }), (e = t(this, g)) == null || e.removeEventListener(
239
245
  "billboardChange",
240
- t(this, N)
246
+ t(this, O)
241
247
  ), this.innerHTML = "", l(this, v, []);
242
248
  }
243
249
  }
244
- g = new WeakMap(), q = new WeakMap(), v = new WeakMap(), Q = new WeakMap(), N = new WeakMap();
245
- Y && !customElements.get("e-billboard-bullets") && customElements.define("e-billboard-bullets", ft);
246
- var H, G;
247
- class pt extends HTMLElement {
250
+ g = new WeakMap(), N = new WeakMap(), v = new WeakMap(), R = new WeakMap(), O = new WeakMap();
251
+ Z && !customElements.get("e-billboard-bullets") && customElements.define("e-billboard-bullets", pt);
252
+ var z, G;
253
+ class gt extends HTMLElement {
248
254
  constructor() {
249
255
  super(...arguments);
250
- s(this, H, null);
256
+ s(this, z, null);
251
257
  s(this, G, () => {
252
258
  var r;
253
- const e = (((r = t(this, H)) == null ? void 0 : r.counter) || 0) + 1, i = parseInt(this.getAttribute("pad") || "0");
259
+ const e = (((r = t(this, z)) == null ? void 0 : r.counter) || 0) + 1, i = parseInt(this.getAttribute("pad") || "0");
254
260
  this.textContent = e.toString().padStart(i, "0");
255
261
  });
256
262
  }
257
263
  connectedCallback() {
258
- return P(this, null, function* () {
264
+ return F(this, null, function* () {
259
265
  var e;
260
- yield nt("e-billboard"), l(this, H, Z(this, R)), (e = t(this, H)) == null || e.addEventListener(
266
+ yield ht("e-billboard"), l(this, z, _(this, U)), (e = t(this, z)) == null || e.addEventListener(
261
267
  "billboardChange",
262
268
  t(this, G)
263
269
  ), t(this, G).call(this);
@@ -265,22 +271,22 @@ class pt extends HTMLElement {
265
271
  }
266
272
  disconnectedCallback() {
267
273
  var e;
268
- (e = t(this, H)) == null || e.removeEventListener(
274
+ (e = t(this, z)) == null || e.removeEventListener(
269
275
  "billboardChange",
270
276
  t(this, G)
271
277
  );
272
278
  }
273
279
  }
274
- H = new WeakMap(), G = new WeakMap();
275
- Y && !customElements.get("e-billboard-counter") && customElements.define("e-billboard-counter", pt);
276
- var j, w, E, x;
277
- class gt extends HTMLElement {
280
+ z = new WeakMap(), G = new WeakMap();
281
+ Z && !customElements.get("e-billboard-counter") && customElements.define("e-billboard-counter", gt);
282
+ var j, w, E, A;
283
+ class vt extends HTMLElement {
278
284
  constructor() {
279
285
  super();
280
286
  s(this, j, null);
281
- s(this, w, new z(this, "--index", 0));
287
+ s(this, w, new S(this, "--index", 0));
282
288
  s(this, E, null);
283
- s(this, x, () => {
289
+ s(this, A, () => {
284
290
  t(this, j).updateClasses(t(this, w).current);
285
291
  });
286
292
  this.addEventListener("click", (e) => {
@@ -290,42 +296,42 @@ class gt extends HTMLElement {
290
296
  });
291
297
  }
292
298
  connectedCallback() {
293
- return P(this, null, function* () {
294
- yield nt("e-billboard"), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.hasAttribute("role") || this.setAttribute("role", "button"), l(this, E, Z(this, R)), t(this, E) && (l(this, j, new lt(this, t(this, E))), t(this, E).addEventListener(
299
+ return F(this, null, function* () {
300
+ yield ht("e-billboard"), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.hasAttribute("role") || this.setAttribute("role", "button"), l(this, E, _(this, U)), t(this, E) && (l(this, j, new ot(this, t(this, E))), t(this, E).addEventListener(
295
301
  "billboardChange",
296
- t(this, x)
297
- ), t(this, x).call(this), t(this, w).subscribe(t(this, x)), t(this, w).observe());
302
+ t(this, A)
303
+ ), t(this, A).call(this), t(this, w).subscribe(t(this, A)), t(this, w).observe());
298
304
  });
299
305
  }
300
306
  disconnectedCallback() {
301
307
  var e;
302
- this.removeAttribute("tabindex"), this.removeAttribute("role"), t(this, w).unsubscribe(t(this, x)), t(this, w).unobserve(), (e = t(this, E)) == null || e.removeEventListener(
308
+ this.removeAttribute("tabindex"), this.removeAttribute("role"), t(this, w).unsubscribe(t(this, A)), t(this, w).unobserve(), (e = t(this, E)) == null || e.removeEventListener(
303
309
  "billboardChange",
304
- t(this, x)
310
+ t(this, A)
305
311
  ), t(this, j).destroy();
306
312
  }
307
313
  }
308
- j = new WeakMap(), w = new WeakMap(), E = new WeakMap(), x = new WeakMap();
309
- Y && !customElements.get("e-billboard-set-button") && customElements.define("e-billboard-set-button", gt);
310
- var A, d, J;
311
- class vt extends HTMLElement {
314
+ j = new WeakMap(), w = new WeakMap(), E = new WeakMap(), A = new WeakMap();
315
+ Z && !customElements.get("e-billboard-set-button") && customElements.define("e-billboard-set-button", vt);
316
+ var M, b, J;
317
+ class Et extends HTMLElement {
312
318
  constructor() {
313
319
  super();
314
- s(this, A, new z(this, "--step", 1));
315
- s(this, d, null);
320
+ s(this, M, new S(this, "--step", 1));
321
+ s(this, b, null);
316
322
  s(this, J, () => {
317
- t(this, d) && (!t(this, d).loop.current && (t(this, d).counter === 0 && t(this, A).current <= 0 || t(this, d).counter === t(this, d).length - 1 && t(this, A).current >= 0) ? this.setAttribute("disabled", "") : this.removeAttribute("disabled"));
323
+ t(this, b) && (!t(this, b).loop.current && (t(this, b).counter === 0 && t(this, M).current <= 0 || t(this, b).counter === t(this, b).length - 1 && t(this, M).current >= 0) ? this.setAttribute("disabled", "") : this.removeAttribute("disabled"));
318
324
  });
319
325
  this.addEventListener("click", (e) => {
320
- t(this, d) && (!this.handleClick || this.handleClick(e)) && t(this, d).shift(t(this, A).current);
326
+ t(this, b) && (!this.handleClick || this.handleClick(e)) && t(this, b).shift(t(this, M).current);
321
327
  }), this.addEventListener("keydown", (e) => {
322
328
  e.code === "Space" && !this.hasAttribute("keydown-disabled") && (e.preventDefault(), this.click());
323
329
  });
324
330
  }
325
331
  connectedCallback() {
326
- return P(this, null, function* () {
332
+ return F(this, null, function* () {
327
333
  var e;
328
- yield customElements.whenDefined("e-billboard"), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.hasAttribute("role") || this.setAttribute("role", "button"), t(this, A).observe(), this.tabIndex = 0, l(this, d, Z(this, R)), (e = t(this, d)) == null || e.addEventListener(
334
+ yield customElements.whenDefined("e-billboard"), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.hasAttribute("role") || this.setAttribute("role", "button"), t(this, M).observe(), this.tabIndex = 0, l(this, b, _(this, U)), (e = t(this, b)) == null || e.addEventListener(
329
335
  "billboardChange",
330
336
  t(this, J)
331
337
  ), setTimeout(() => {
@@ -335,18 +341,18 @@ class vt extends HTMLElement {
335
341
  }
336
342
  disconnectedCallback() {
337
343
  var e;
338
- this.removeAttribute("tabindex"), this.removeAttribute("role"), t(this, A).unobserve(), (e = t(this, d)) == null || e.removeEventListener(
344
+ this.removeAttribute("tabindex"), this.removeAttribute("role"), t(this, M).unobserve(), (e = t(this, b)) == null || e.removeEventListener(
339
345
  "billboardChange",
340
346
  t(this, J)
341
347
  );
342
348
  }
343
349
  }
344
- A = new WeakMap(), d = new WeakMap(), J = new WeakMap();
345
- Y && !customElements.get("e-billboard-step-button") && customElements.define("e-billboard-step-button", vt);
350
+ M = new WeakMap(), b = new WeakMap(), J = new WeakMap();
351
+ Z && !customElements.get("e-billboard-step-button") && customElements.define("e-billboard-step-button", Et);
346
352
  export {
347
- ft as BillboardBulletsElement,
348
- pt as BillboardCounterElement,
349
- R as BillboardElement,
350
- gt as BillboardSetButtonElement,
351
- vt as BillboardStepButtonElement
353
+ pt as BillboardBulletsElement,
354
+ gt as BillboardCounterElement,
355
+ U as BillboardElement,
356
+ vt as BillboardSetButtonElement,
357
+ Et as BillboardStepButtonElement
352
358
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.69.7",
3
+ "version": "0.69.9",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"