aptechka 0.4.0 → 0.4.1

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.
@@ -1 +1 @@
1
- "use strict";var f=(e,s,t)=>{if(!s.has(e))throw TypeError("Cannot "+t)};var r=(e,s,t)=>(f(e,s,"read from private field"),t?t.call(e):s.get(e)),n=(e,s,t)=>{if(s.has(e))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(e):s.set(e,t)},a=(e,s,t,c)=>(f(e,s,"write to private field"),c?c.call(e,t):s.set(e,t),t);var v=(e,s,t)=>(f(e,s,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("../Store-Dis8QUAR.cjs"),A=require("../attributes-Bf2svn4j.cjs"),S=require("../browser-CpzFX2xg.cjs"),q=require("../dom-JBOkFLTh.cjs");var i,u,b,h,m;class p extends y.Store{constructor(t,c,l,o){super(l,o);n(this,h);n(this,i,null);n(this,u,void 0);n(this,b,null);a(this,u,c),S.isBrowser&&(a(this,i,q.getElement(t)),a(this,b,new MutationObserver(d=>{d.forEach(g=>{g.type==="attributes"&&g.attributeName===r(this,u)&&v(this,h,m).call(this)})})),o!=null&&o.sync&&this.subscribe(d=>{r(this,i).setAttribute(r(this,u),d.current.toString())}))}subscribe(t){const c=!this.subscribers.size,l=super.subscribe(t);return c&&(r(this,b).observe(r(this,i),{attributes:!0}),v(this,h,m).call(this)),l}unsubscribe(t){super.unsubscribe(t),this.subscribers.size||r(this,b).disconnect()}close(){super.close(),r(this,b).disconnect()}}i=new WeakMap,u=new WeakMap,b=new WeakMap,h=new WeakSet,m=function(){const t=r(this,i).getAttribute(r(this,u));t!=null&&(this.current=A.parseAttributeValue(t))};exports.Attribute=p;
1
+ "use strict";var v=(t,s,e)=>{if(!s.has(t))throw TypeError("Cannot "+e)};var r=(t,s,e)=>(v(t,s,"read from private field"),e?e.call(t):s.get(t)),n=(t,s,e)=>{if(s.has(t))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(t):s.set(t,e)},a=(t,s,e,b)=>(v(t,s,"write to private field"),b?b.call(t,e):s.set(t,e),e);var f=(t,s,e)=>(v(t,s,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("../Store-Dis8QUAR.cjs"),A=require("../attributes-Bf2svn4j.cjs"),S=require("../browser-CpzFX2xg.cjs"),q=require("../dom-JBOkFLTh.cjs");var i,u,c,o,d;class p extends y.Store{constructor(e,b,g,h){super(g,h);n(this,o);n(this,i,null);n(this,u,void 0);n(this,c,null);a(this,u,b),S.isBrowser&&(a(this,i,q.getElement(e)),a(this,c,new MutationObserver(l=>{l.forEach(m=>{m.type==="attributes"&&m.attributeName===r(this,u)&&f(this,o,d).call(this)})})),h!=null&&h.sync&&this.subscribe(l=>{r(this,i).setAttribute(r(this,u),l.current.toString())}))}subscribe(e){const b=super.subscribe(e);return this.observe(),b}unsubscribe(e){super.unsubscribe(e),this.unobserve()}observe(){!this.subscribers.size&&(r(this,c).observe(r(this,i),{attributes:!0}),f(this,o,d).call(this))}unobserve(){this.subscribers.size||r(this,c).disconnect()}close(){super.close(),this.unobserve()}}i=new WeakMap,u=new WeakMap,c=new WeakMap,o=new WeakSet,d=function(){const e=r(this,i).getAttribute(r(this,u));e!=null&&(this.current=A.parseAttributeValue(e))};exports.Attribute=p;
@@ -9,5 +9,7 @@ export declare class Attribute<T extends string | number | boolean> extends Stor
9
9
  constructor(elementOrSelector: ElementOrSelector, name: string, defaultValue: T, options?: AttributeOptions<T>);
10
10
  subscribe(callback: StoreCallback<StoreEntry<T>>): () => void;
11
11
  unsubscribe(callback: StoreCallback<StoreEntry<T>>): void;
12
+ observe(): void;
13
+ unobserve(): void;
12
14
  close(): void;
13
15
  }
@@ -1,49 +1,55 @@
1
- var l = (s, e, t) => {
2
- if (!e.has(s))
3
- throw TypeError("Cannot " + t);
1
+ var v = (e, t, s) => {
2
+ if (!t.has(e))
3
+ throw TypeError("Cannot " + s);
4
4
  };
5
- var r = (s, e, t) => (l(s, e, "read from private field"), t ? t.call(s) : e.get(s)), h = (s, e, t) => {
6
- if (e.has(s))
5
+ var r = (e, t, s) => (v(e, t, "read from private field"), s ? s.call(e) : t.get(e)), h = (e, t, s) => {
6
+ if (t.has(e))
7
7
  throw TypeError("Cannot add the same private member more than once");
8
- e instanceof WeakSet ? e.add(s) : e.set(s, t);
9
- }, o = (s, e, t, c) => (l(s, e, "write to private field"), c ? c.call(s, t) : e.set(s, t), t);
10
- var p = (s, e, t) => (l(s, e, "access private method"), t);
8
+ t instanceof WeakSet ? t.add(e) : t.set(e, s);
9
+ }, a = (e, t, s, b) => (v(e, t, "write to private field"), b ? b.call(e, s) : t.set(e, s), s);
10
+ var f = (e, t, s) => (v(e, t, "access private method"), s);
11
11
  import { S as g } from "../Store-DdDuj5hz.js";
12
12
  import { p as A } from "../attributes-69we3byR.js";
13
13
  import { i as y } from "../browser-0zX67oeU.js";
14
14
  import { g as S } from "../dom-0S_WDL4g.js";
15
- var i, u, b, n, v;
15
+ var i, u, c, o, l;
16
16
  class B extends g {
17
- constructor(t, c, m, a) {
18
- super(m, a);
19
- h(this, n);
17
+ constructor(s, b, d, n) {
18
+ super(d, n);
19
+ h(this, o);
20
20
  h(this, i, null);
21
21
  h(this, u, void 0);
22
- h(this, b, null);
23
- o(this, u, c), y && (o(this, i, S(t)), o(this, b, new MutationObserver((f) => {
24
- f.forEach((d) => {
25
- d.type === "attributes" && d.attributeName === r(this, u) && p(this, n, v).call(this);
22
+ h(this, c, null);
23
+ a(this, u, b), y && (a(this, i, S(s)), a(this, c, new MutationObserver((m) => {
24
+ m.forEach((p) => {
25
+ p.type === "attributes" && p.attributeName === r(this, u) && f(this, o, l).call(this);
26
26
  });
27
- })), a != null && a.sync && this.subscribe((f) => {
28
- r(this, i).setAttribute(r(this, u), f.current.toString());
27
+ })), n != null && n.sync && this.subscribe((m) => {
28
+ r(this, i).setAttribute(r(this, u), m.current.toString());
29
29
  }));
30
30
  }
31
- subscribe(t) {
32
- const c = !this.subscribers.size, m = super.subscribe(t);
33
- return c && (r(this, b).observe(r(this, i), {
31
+ subscribe(s) {
32
+ const b = super.subscribe(s);
33
+ return this.observe(), b;
34
+ }
35
+ unsubscribe(s) {
36
+ super.unsubscribe(s), this.unobserve();
37
+ }
38
+ observe() {
39
+ !this.subscribers.size && (r(this, c).observe(r(this, i), {
34
40
  attributes: !0
35
- }), p(this, n, v).call(this)), m;
41
+ }), f(this, o, l).call(this));
36
42
  }
37
- unsubscribe(t) {
38
- super.unsubscribe(t), this.subscribers.size || r(this, b).disconnect();
43
+ unobserve() {
44
+ this.subscribers.size || r(this, c).disconnect();
39
45
  }
40
46
  close() {
41
- super.close(), r(this, b).disconnect();
47
+ super.close(), this.unobserve();
42
48
  }
43
49
  }
44
- i = new WeakMap(), u = new WeakMap(), b = new WeakMap(), n = new WeakSet(), v = function() {
45
- const t = r(this, i).getAttribute(r(this, u));
46
- t != null && (this.current = A(t));
50
+ i = new WeakMap(), u = new WeakMap(), c = new WeakMap(), o = new WeakSet(), l = function() {
51
+ const s = r(this, i).getAttribute(r(this, u));
52
+ s != null && (this.current = A(s));
47
53
  };
48
54
  export {
49
55
  B as Attribute
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("../attribute/index.cjs"),M=require("../custom-element/index.cjs"),A=require("../Store-Dis8QUAR.cjs"),q=require("../style-At6aDoqG.cjs"),x=require("../abstract-elements/index.cjs");var B=Object.defineProperty,D=Object.getOwnPropertyDescriptor,I=(t,e,s,i)=>{for(var n=i>1?void 0:i?D(e,s):e,c=t.length-1,l;c>=0;c--)(l=t[c])&&(n=(i?l(e,s,n):l(n))||n);return i&&n&&B(e,s,n),n},W=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)},r=(t,e,s)=>(W(t,e,"read from private field"),s?s.call(t):e.get(t)),o=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},k=(t,e,s,i)=>(W(t,e,"write to private field"),i?i.call(t,s):e.set(t,s),s),T=(t,e,s)=>(W(t,e,"access private method"),s),P,a,m,p,E,v,S,C,u,f,w,g,y,L,_;exports.PopoverElement=class extends M.CustomElement{constructor(){super(...arguments),o(this,S),o(this,u),o(this,y),o(this,P,-1),o(this,a,new A.Store(!1)),o(this,m,void 0),o(this,p,new $.Attribute(this,"history",!1)),o(this,E,new $.Attribute(this,"single",!1)),o(this,v,!1),this.open=()=>{r(this,a).current||(r(this,a).current=!0,r(this,E).current&&(exports.PopoverElement.__opened.forEach(e=>e.close()),exports.PopoverElement.__opened=[]),exports.PopoverElement.__opened.push(this),k(this,P,exports.PopoverElement.__opened.length-1),r(this,p).current&&r(this,v)&&history.pushState("","",r(this,S,C)),clearTimeout(r(this,m)),this.classList.add("triggered"),this.style.display="block",setTimeout(()=>{addEventListener("click",r(this,w)),addEventListener("keydown",r(this,g)),this.style.opacity="1",this.classList.add("opened")}))},this.close=()=>{r(this,a).current&&(r(this,a).current=!1,exports.PopoverElement.__opened=exports.PopoverElement.__opened.filter(e=>e!==this),r(this,p).current&&history.replaceState("","",location.href.replace(new RegExp(`[&?]${r(this,u,f)}`,"g"),"")),this.classList.remove("opened"),this.style.opacity="0",removeEventListener("click",r(this,w)),removeEventListener("keydown",r(this,g)),setTimeout(()=>{this.classList.remove("triggered"),this.style.display="none"},q.getElementTransitionDurationMS(this)))},o(this,w,e=>{T(this,y,L).call(this,()=>{const s=e.composedPath();(!s.find(i=>i===this)&&!s.find(i=>i instanceof HTMLElement&&i.closest("e-popover-button"))||s[0]instanceof HTMLElement&&s[0].hasAttribute("outside"))&&this.close()})}),o(this,g,e=>{T(this,y,L).call(this,()=>{e.code==="Escape"&&this.close()})}),o(this,_,()=>{k(this,v,!1),r(this,a).current&&r(this,p).current&&!location.search.includes(r(this,u,f))?this.close():!r(this,a).current&&r(this,p).current&&location.search.includes(r(this,u,f))&&this.open(),k(this,v,!0)})}get history(){return r(this,p)}get single(){return r(this,E)}get opened(){return r(this,a)}connectedCallback(){this.style.opacity="0",this.style.display="none",addEventListener("popstate",r(this,_)),setTimeout(()=>{r(this,_).call(this)},0)}disconnectedCallback(){clearTimeout(r(this,m)),removeEventListener("popstate",r(this,_))}};P=new WeakMap;a=new WeakMap;m=new WeakMap;p=new WeakMap;E=new WeakMap;v=new WeakMap;S=new WeakSet;C=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${r(this,u,f)}`};u=new WeakSet;f=function(){return`modal-${this.id}`};w=new WeakMap;g=new WeakMap;y=new WeakSet;L=function(t){(exports.PopoverElement.__opened[r(this,P)-1]||exports.PopoverElement.__opened.length===1)&&t()};_=new WeakMap;exports.PopoverElement.__opened=[];exports.PopoverElement=I([M.define("e-popover")],exports.PopoverElement);var N=Object.defineProperty,G=Object.getOwnPropertyDescriptor,H=(t,e,s,i)=>{for(var n=i>1?void 0:i?G(e,s):e,c=t.length-1,l;c>=0;c--)(l=t[c])&&(n=(i?l(e,s,n):l(n))||n);return i&&n&&N(e,s,n),n},O=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)},d=(t,e,s)=>(O(t,e,"read from private field"),s?s.call(t):e.get(t)),R=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},b=(t,e,s,i)=>(O(t,e,"write to private field"),i?i.call(t,s):e.set(t,s),s),h;exports.PopoverButtonElement=class extends x.AbstractButtonElement{constructor(){super(...arguments),R(this,h,void 0)}get popoverElement(){return d(this,h)}click(){if(d(this,h)){const e=this.getAttribute("type")||"open";e==="open"||e==="toggle"&&!d(this,h).opened.current?d(this,h).open():(e==="close"||e==="toggle"&&d(this,h).opened.current)&&d(this,h).close()}}connectedCallback(){const e=this.getAttribute("target");if(e){const s=document.querySelector(`#${e}`)||this.getRootNode().querySelector(`#${e}`);s?b(this,h,s):console.warn(this,`target ${e} not found`)}}};h=new WeakMap;exports.PopoverButtonElement=H([M.define("e-popover-button")],exports.PopoverButtonElement);
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("../attribute/index.cjs"),M=require("../custom-element/index.cjs"),A=require("../Store-Dis8QUAR.cjs"),q=require("../style-At6aDoqG.cjs"),x=require("../abstract-elements/index.cjs");var B=Object.defineProperty,D=Object.getOwnPropertyDescriptor,b=(t,e,s,i)=>{for(var n=i>1?void 0:i?D(e,s):e,c=t.length-1,p;c>=0;c--)(p=t[c])&&(n=(i?p(e,s,n):p(n))||n);return i&&n&&B(e,s,n),n},W=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)},r=(t,e,s)=>(W(t,e,"read from private field"),s?s.call(t):e.get(t)),o=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},k=(t,e,s,i)=>(W(t,e,"write to private field"),i?i.call(t,s):e.set(t,s),s),$=(t,e,s)=>(W(t,e,"access private method"),s),P,a,E,h,u,_,S,C,v,m,w,y,g,L,f;exports.PopoverElement=class extends M.CustomElement{constructor(){super(...arguments),o(this,S),o(this,v),o(this,g),o(this,P,-1),o(this,a,new A.Store(!1)),o(this,E,void 0),o(this,h,new T.Attribute(this,"history",!1)),o(this,u,new T.Attribute(this,"single",!1)),o(this,_,!1),this.open=()=>{r(this,a).current||(r(this,a).current=!0,r(this,u).current&&(exports.PopoverElement.__opened.forEach(e=>e.close()),exports.PopoverElement.__opened=[]),exports.PopoverElement.__opened.push(this),k(this,P,exports.PopoverElement.__opened.length-1),r(this,h).current&&r(this,_)&&history.pushState("","",r(this,S,C)),clearTimeout(r(this,E)),this.classList.add("triggered"),this.style.display="block",setTimeout(()=>{addEventListener("click",r(this,w)),addEventListener("keydown",r(this,y)),this.style.opacity="1",this.classList.add("opened")}))},this.close=()=>{if(r(this,a).current){if(r(this,a).current=!1,exports.PopoverElement.__opened=exports.PopoverElement.__opened.filter(e=>e!==this),r(this,h).current){const e=new URL(location.href);e.searchParams.delete(r(this,v,m)),history.replaceState(null,"",e.href)}this.classList.remove("opened"),this.style.opacity="0",removeEventListener("click",r(this,w)),removeEventListener("keydown",r(this,y)),setTimeout(()=>{this.classList.remove("triggered"),this.style.display="none"},q.getElementTransitionDurationMS(this))}},o(this,w,e=>{$(this,g,L).call(this,()=>{const s=e.composedPath();(!s.find(i=>i===this)&&!s.find(i=>i instanceof HTMLElement&&i.closest("e-popover-button"))||s[0]instanceof HTMLElement&&s[0].hasAttribute("outside"))&&this.close()})}),o(this,y,e=>{$(this,g,L).call(this,()=>{e.code==="Escape"&&this.close()})}),o(this,f,()=>{k(this,_,!1),r(this,a).current&&r(this,h).current&&!location.search.includes(r(this,v,m))?this.close():!r(this,a).current&&r(this,h).current&&location.search.includes(r(this,v,m))&&this.open(),k(this,_,!0)})}get history(){return r(this,h)}get single(){return r(this,u)}get opened(){return r(this,a)}connectedCallback(){r(this,h).observe(),r(this,u).observe(),this.style.opacity="0",this.style.display="none",addEventListener("popstate",r(this,f)),setTimeout(()=>{r(this,f).call(this)},0)}disconnectedCallback(){r(this,h).unobserve(),r(this,u).unobserve(),clearTimeout(r(this,E)),removeEventListener("popstate",r(this,f))}};P=new WeakMap;a=new WeakMap;E=new WeakMap;h=new WeakMap;u=new WeakMap;_=new WeakMap;S=new WeakSet;C=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${r(this,v,m)}`};v=new WeakSet;m=function(){return`modal-${this.id}`};w=new WeakMap;y=new WeakMap;g=new WeakSet;L=function(t){(exports.PopoverElement.__opened[r(this,P)-1]||exports.PopoverElement.__opened.length===1)&&t()};f=new WeakMap;exports.PopoverElement.__opened=[];exports.PopoverElement=b([M.define("e-popover")],exports.PopoverElement);var I=Object.defineProperty,N=Object.getOwnPropertyDescriptor,G=(t,e,s,i)=>{for(var n=i>1?void 0:i?N(e,s):e,c=t.length-1,p;c>=0;c--)(p=t[c])&&(n=(i?p(e,s,n):p(n))||n);return i&&n&&I(e,s,n),n},O=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)},d=(t,e,s)=>(O(t,e,"read from private field"),s?s.call(t):e.get(t)),H=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},R=(t,e,s,i)=>(O(t,e,"write to private field"),i?i.call(t,s):e.set(t,s),s),l;exports.PopoverButtonElement=class extends x.AbstractButtonElement{constructor(){super(...arguments),H(this,l,void 0)}get popoverElement(){return d(this,l)}click(){if(d(this,l)){const e=this.getAttribute("type")||"open";e==="open"||e==="toggle"&&!d(this,l).opened.current?d(this,l).open():(e==="close"||e==="toggle"&&d(this,l).opened.current)&&d(this,l).close()}}connectedCallback(){const e=this.getAttribute("target");if(e){const s=document.querySelector(`#${e}`)||this.getRootNode().querySelector(`#${e}`);s?R(this,l,s):console.warn(this,`target ${e} not found`)}}};l=new WeakMap;exports.PopoverButtonElement=G([M.define("e-popover-button")],exports.PopoverButtonElement);
@@ -1,130 +1,132 @@
1
1
  import { Attribute as T } from "../attribute/index.js";
2
- import { CustomElement as D, define as P } from "../custom-element/index.js";
2
+ import { CustomElement as x, define as O } from "../custom-element/index.js";
3
3
  import { S as I } from "../Store-DdDuj5hz.js";
4
4
  import { g as N } from "../style-j2TwriJ_.js";
5
5
  import { AbstractButtonElement as q } from "../abstract-elements/index.js";
6
6
  var B = Object.defineProperty, G = Object.getOwnPropertyDescriptor, H = (e, t, s, r) => {
7
- for (var n = r > 1 ? void 0 : r ? G(t, s) : t, p = e.length - 1, l; p >= 0; p--)
8
- (l = e[p]) && (n = (r ? l(t, s, n) : l(n)) || n);
7
+ for (var n = r > 1 ? void 0 : r ? G(t, s) : t, p = e.length - 1, d; p >= 0; p--)
8
+ (d = e[p]) && (n = (r ? d(t, s, n) : d(n)) || n);
9
9
  return r && n && B(t, s, n), n;
10
- }, M = (e, t, s) => {
10
+ }, $ = (e, t, s) => {
11
11
  if (!t.has(e))
12
12
  throw TypeError("Cannot " + s);
13
- }, i = (e, t, s) => (M(e, t, "read from private field"), s ? s.call(e) : t.get(e)), o = (e, t, s) => {
13
+ }, i = (e, t, s) => ($(e, t, "read from private field"), s ? s.call(e) : t.get(e)), o = (e, t, s) => {
14
14
  if (t.has(e))
15
15
  throw TypeError("Cannot add the same private member more than once");
16
16
  t instanceof WeakSet ? t.add(e) : t.set(e, s);
17
- }, S = (e, t, s, r) => (M(e, t, "write to private field"), r ? r.call(e, s) : t.set(e, s), s), C = (e, t, s) => (M(e, t, "access private method"), s), L, h, g, d, m, f, W, A, u, w, y, E, k, $, v;
18
- let a = class extends D {
17
+ }, S = (e, t, s, r) => ($(e, t, "write to private field"), r ? r.call(e, s) : t.set(e, s), s), C = (e, t, s) => ($(e, t, "access private method"), s), L, h, g, c, _, v, W, A, f, m, y, E, k, M, w;
18
+ let a = class extends x {
19
19
  constructor() {
20
- super(...arguments), o(this, W), o(this, u), o(this, k), o(this, L, -1), o(this, h, new I(!1)), o(this, g, void 0), o(this, d, new T(this, "history", !1)), o(this, m, new T(this, "single", !1)), o(this, f, !1), this.open = () => {
21
- i(this, h).current || (i(this, h).current = !0, i(this, m).current && (a.__opened.forEach((e) => e.close()), a.__opened = []), a.__opened.push(this), S(this, L, a.__opened.length - 1), i(this, d).current && i(this, f) && history.pushState("", "", i(this, W, A)), clearTimeout(i(this, g)), this.classList.add("triggered"), this.style.display = "block", setTimeout(() => {
20
+ super(...arguments), o(this, W), o(this, f), o(this, k), o(this, L, -1), o(this, h, new I(!1)), o(this, g, void 0), o(this, c, new T(this, "history", !1)), o(this, _, new T(this, "single", !1)), o(this, v, !1), this.open = () => {
21
+ i(this, h).current || (i(this, h).current = !0, i(this, _).current && (a.__opened.forEach((e) => e.close()), a.__opened = []), a.__opened.push(this), S(this, L, a.__opened.length - 1), i(this, c).current && i(this, v) && history.pushState("", "", i(this, W, A)), clearTimeout(i(this, g)), this.classList.add("triggered"), this.style.display = "block", setTimeout(() => {
22
22
  addEventListener("click", i(this, y)), addEventListener("keydown", i(this, E)), this.style.opacity = "1", this.classList.add("opened");
23
23
  }));
24
24
  }, this.close = () => {
25
- i(this, h).current && (i(this, h).current = !1, a.__opened = a.__opened.filter((e) => e !== this), i(this, d).current && history.replaceState(
26
- "",
27
- "",
28
- location.href.replace(new RegExp(`[&?]${i(this, u, w)}`, "g"), "")
29
- ), this.classList.remove("opened"), this.style.opacity = "0", removeEventListener("click", i(this, y)), removeEventListener("keydown", i(this, E)), setTimeout(() => {
30
- this.classList.remove("triggered"), this.style.display = "none";
31
- }, N(this)));
25
+ if (i(this, h).current) {
26
+ if (i(this, h).current = !1, a.__opened = a.__opened.filter((e) => e !== this), i(this, c).current) {
27
+ const e = new URL(location.href);
28
+ e.searchParams.delete(i(this, f, m)), history.replaceState(null, "", e.href);
29
+ }
30
+ this.classList.remove("opened"), this.style.opacity = "0", removeEventListener("click", i(this, y)), removeEventListener("keydown", i(this, E)), setTimeout(() => {
31
+ this.classList.remove("triggered"), this.style.display = "none";
32
+ }, N(this));
33
+ }
32
34
  }, o(this, y, (e) => {
33
- C(this, k, $).call(this, () => {
35
+ C(this, k, M).call(this, () => {
34
36
  const t = e.composedPath();
35
37
  (!t.find((s) => s === this) && !t.find(
36
38
  (s) => s instanceof HTMLElement && s.closest("e-popover-button")
37
39
  ) || t[0] instanceof HTMLElement && t[0].hasAttribute("outside")) && this.close();
38
40
  });
39
41
  }), o(this, E, (e) => {
40
- C(this, k, $).call(this, () => {
42
+ C(this, k, M).call(this, () => {
41
43
  e.code === "Escape" && this.close();
42
44
  });
43
- }), o(this, v, () => {
44
- S(this, f, !1), i(this, h).current && i(this, d).current && !location.search.includes(i(this, u, w)) ? this.close() : !i(this, h).current && i(this, d).current && location.search.includes(i(this, u, w)) && this.open(), S(this, f, !0);
45
+ }), o(this, w, () => {
46
+ S(this, v, !1), i(this, h).current && i(this, c).current && !location.search.includes(i(this, f, m)) ? this.close() : !i(this, h).current && i(this, c).current && location.search.includes(i(this, f, m)) && this.open(), S(this, v, !0);
45
47
  });
46
48
  }
47
49
  get history() {
48
- return i(this, d);
50
+ return i(this, c);
49
51
  }
50
52
  get single() {
51
- return i(this, m);
53
+ return i(this, _);
52
54
  }
53
55
  get opened() {
54
56
  return i(this, h);
55
57
  }
56
58
  connectedCallback() {
57
- this.style.opacity = "0", this.style.display = "none", addEventListener("popstate", i(this, v)), setTimeout(() => {
58
- i(this, v).call(this);
59
+ i(this, c).observe(), i(this, _).observe(), this.style.opacity = "0", this.style.display = "none", addEventListener("popstate", i(this, w)), setTimeout(() => {
60
+ i(this, w).call(this);
59
61
  }, 0);
60
62
  }
61
63
  disconnectedCallback() {
62
- clearTimeout(i(this, g)), removeEventListener("popstate", i(this, v));
64
+ i(this, c).unobserve(), i(this, _).unobserve(), clearTimeout(i(this, g)), removeEventListener("popstate", i(this, w));
63
65
  }
64
66
  };
65
67
  L = /* @__PURE__ */ new WeakMap();
66
68
  h = /* @__PURE__ */ new WeakMap();
67
69
  g = /* @__PURE__ */ new WeakMap();
68
- d = /* @__PURE__ */ new WeakMap();
69
- m = /* @__PURE__ */ new WeakMap();
70
- f = /* @__PURE__ */ new WeakMap();
70
+ c = /* @__PURE__ */ new WeakMap();
71
+ _ = /* @__PURE__ */ new WeakMap();
72
+ v = /* @__PURE__ */ new WeakMap();
71
73
  W = /* @__PURE__ */ new WeakSet();
72
74
  A = function() {
73
- return `${location.pathname}${location.search ? location.search + "&" : "?"}${i(this, u, w)}`;
75
+ return `${location.pathname}${location.search ? location.search + "&" : "?"}${i(this, f, m)}`;
74
76
  };
75
- u = /* @__PURE__ */ new WeakSet();
76
- w = function() {
77
+ f = /* @__PURE__ */ new WeakSet();
78
+ m = function() {
77
79
  return `modal-${this.id}`;
78
80
  };
79
81
  y = /* @__PURE__ */ new WeakMap();
80
82
  E = /* @__PURE__ */ new WeakMap();
81
83
  k = /* @__PURE__ */ new WeakSet();
82
- $ = function(e) {
84
+ M = function(e) {
83
85
  (a.__opened[i(this, L) - 1] || a.__opened.length === 1) && e();
84
86
  };
85
- v = /* @__PURE__ */ new WeakMap();
87
+ w = /* @__PURE__ */ new WeakMap();
86
88
  a.__opened = [];
87
89
  a = H([
88
- P("e-popover")
90
+ O("e-popover")
89
91
  ], a);
90
- var R = Object.defineProperty, z = Object.getOwnPropertyDescriptor, F = (e, t, s, r) => {
91
- for (var n = r > 1 ? void 0 : r ? z(t, s) : t, p = e.length - 1, l; p >= 0; p--)
92
- (l = e[p]) && (n = (r ? l(t, s, n) : l(n)) || n);
92
+ var R = Object.defineProperty, U = Object.getOwnPropertyDescriptor, z = (e, t, s, r) => {
93
+ for (var n = r > 1 ? void 0 : r ? U(t, s) : t, p = e.length - 1, d; p >= 0; p--)
94
+ (d = e[p]) && (n = (r ? d(t, s, n) : d(n)) || n);
93
95
  return r && n && R(t, s, n), n;
94
- }, x = (e, t, s) => {
96
+ }, D = (e, t, s) => {
95
97
  if (!t.has(e))
96
98
  throw TypeError("Cannot " + s);
97
- }, _ = (e, t, s) => (x(e, t, "read from private field"), s ? s.call(e) : t.get(e)), J = (e, t, s) => {
99
+ }, u = (e, t, s) => (D(e, t, "read from private field"), s ? s.call(e) : t.get(e)), F = (e, t, s) => {
98
100
  if (t.has(e))
99
101
  throw TypeError("Cannot add the same private member more than once");
100
102
  t instanceof WeakSet ? t.add(e) : t.set(e, s);
101
- }, K = (e, t, s, r) => (x(e, t, "write to private field"), r ? r.call(e, s) : t.set(e, s), s), c;
102
- let O = class extends q {
103
+ }, J = (e, t, s, r) => (D(e, t, "write to private field"), r ? r.call(e, s) : t.set(e, s), s), l;
104
+ let P = class extends q {
103
105
  constructor() {
104
- super(...arguments), J(this, c, void 0);
106
+ super(...arguments), F(this, l, void 0);
105
107
  }
106
108
  get popoverElement() {
107
- return _(this, c);
109
+ return u(this, l);
108
110
  }
109
111
  click() {
110
- if (_(this, c)) {
112
+ if (u(this, l)) {
111
113
  const e = this.getAttribute("type") || "open";
112
- e === "open" || e === "toggle" && !_(this, c).opened.current ? _(this, c).open() : (e === "close" || e === "toggle" && _(this, c).opened.current) && _(this, c).close();
114
+ e === "open" || e === "toggle" && !u(this, l).opened.current ? u(this, l).open() : (e === "close" || e === "toggle" && u(this, l).opened.current) && u(this, l).close();
113
115
  }
114
116
  }
115
117
  connectedCallback() {
116
118
  const e = this.getAttribute("target");
117
119
  if (e) {
118
120
  const t = document.querySelector(`#${e}`) || this.getRootNode().querySelector(`#${e}`);
119
- t ? K(this, c, t) : console.warn(this, `target ${e} not found`);
121
+ t ? J(this, l, t) : console.warn(this, `target ${e} not found`);
120
122
  }
121
123
  }
122
124
  };
123
- c = /* @__PURE__ */ new WeakMap();
124
- O = F([
125
- P("e-popover-button")
126
- ], O);
125
+ l = /* @__PURE__ */ new WeakMap();
126
+ P = z([
127
+ O("e-popover-button")
128
+ ], P);
127
129
  export {
128
- O as PopoverButtonElement,
130
+ P as PopoverButtonElement,
129
131
  a as PopoverElement
130
132
  };
@@ -1 +1 @@
1
- "use strict";var Ct=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)};var h=(i,e,s)=>(Ct(i,e,"read from private field"),s?s.call(i):e.get(i)),V=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},O=(i,e,s,r)=>(Ct(i,e,"write to private field"),r?r.call(i,s):e.set(i,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Tt=require("../Damped-B0eRyTcV.cjs"),Vt=require("../Store-Dis8QUAR.cjs"),Dt=require("../Derived-vGokdC4b.cjs"),zt=require("../browser-CpzFX2xg.cjs"),H=require("../layout-8ryRAMGJ.cjs"),Lt=require("../math-GDWEqu7y.cjs");require("../ticker/index.cjs");const x=require("../attribute/index.cjs"),At=require("../WheelControls-fiz52vcl.cjs"),wt=require("../custom-element/index.cjs"),yt=require("../order/index.cjs"),ft=require("../window-resizer/index.cjs"),B=require("../scroll-entries/index.cjs"),q=require("../tags-D3-tO-m6.cjs"),Pt=require("../createStylesheet-B4vLzvah.cjs"),It=require("../css-unit-parser/index.cjs"),Ht=require("../dom-JBOkFLTh.cjs");var Bt=Object.defineProperty,Ft=Object.getOwnPropertyDescriptor,Ut=(i,e,s,r)=>{for(var n=r>1?void 0:r?Ft(e,s):e,p=i.length-1,d;p>=0;p--)(d=i[p])&&(n=(r?d(e,s,n):d(n))||n);return r&&n&&Bt(e,s,n),n},kt=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)},t=(i,e,s)=>(kt(i,e,"read from private field"),s?s.call(i):e.get(i)),l=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},g=(i,e,s,r)=>(kt(i,e,"write to private field"),r?r.call(i,s):e.set(i,s),s),m=(i,e,s)=>(kt(i,e,"access private method"),s),a,C,D,$,I,j,y,G,tt,et,u,dt,c,st,it,_,f,L,k,F,w,K,R,N,gt,U,Q,mt,Wt,bt,Mt,rt,_t,nt,St,T,vt,Et,Ot,ht,lt,xt,S,b,P,W;class Gt{constructor(e,s){V(this,S,void 0);V(this,b,void 0);V(this,P,0);V(this,W,0);O(this,S,e),O(this,b,s),B.scrollEntries.register(h(this,S))}get size(){return h(this,P)}get position(){return h(this,W)}destroy(){B.scrollEntries.unregister(h(this,S)),h(this,S).style.transform=""}resize(){O(this,P,h(this,b).vertical?h(this,S).offsetHeight:h(this,S).offsetWidth),O(this,W,h(this,b).vertical?H.getCumulativeOffsetTop(h(this,S)):H.getCumulativeOffsetLeft(h(this,S))),O(this,W,h(this,W)-h(this,b).contentPosition)}transform(){let e=0;const s=h(this,b).viewportSize-h(this,P);h(this,b).infiniteAttribute.current&&h(this,b).overscroll&&h(this,W)+h(this,P)<h(this,b).currentScrollValue&&(e=h(this,b).distance*-1-h(this,b).gap),B.scrollEntries.update(h(this,S),h(this,b).axisAttibute.current,e);const r=h(this,b).currentScrollValue+e,n=h(this,W)-h(this,b).viewportSize-s,p=h(this,W)+h(this,P)+s,d=Lt.clamp(r,n,p);h(this,b).vertical?h(this,S).style.transform=`translate3d(0px, ${d*-1}px, 0px)`:h(this,S).style.transform=`translate3d(${d*-1}px, 0px, 0px)`}}S=new WeakMap,b=new WeakMap,P=new WeakMap,W=new WeakMap;const Kt=Pt.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},':host([hibernated="true"])':{display:"contents"},".static":{position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},".content":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)"},':host([hibernated="true"]) .content':{display:"contents"},"::slotted(*)":{flexShrink:"0"}});exports.ScrollElement=class extends wt.CustomElement{constructor(){super(),l(this,N),l(this,U),l(this,mt),l(this,bt),l(this,rt),l(this,nt),l(this,Et),l(this,lt),l(this,a,null),l(this,C,new x.Attribute(this,"axis","y")),l(this,D,new x.Attribute(this,"pages",0,{validate:e=>Math.max(0,e-1)})),l(this,$,new x.Attribute(this,"split",!1)),l(this,I,new x.Attribute(this,"sectional",!1)),l(this,j,new x.Attribute(this,"wheel-max-delta",!1)),l(this,y,new x.Attribute(this,"infinite",!1)),l(this,G,new x.Attribute(this,"damping",.03)),l(this,tt,new x.Attribute(this,"disabled",!1)),l(this,et,new x.Attribute(this,"hibernated",!1)),l(this,u,null),l(this,dt,null),l(this,c,[]),l(this,st,0),l(this,it,0),l(this,_,0),l(this,f,0),l(this,L,0),l(this,k,null),l(this,F,null),l(this,w,new Vt.Store(0)),l(this,K,0),l(this,R,0),l(this,T,()=>{const e=this.currentScrollValue/t(this,f)||0;if(g(this,st,this.vertical?H.getCumulativeOffsetTop(this):H.getCumulativeOffsetLeft(this)),g(this,it,this.vertical?H.getCumulativeOffsetTop(t(this,u)):H.getCumulativeOffsetLeft(t(this,u))),g(this,_,this.vertical?this.offsetHeight:this.offsetWidth),t(this,D).current){g(this,f,t(this,_)*t(this,D).current);const s=t(this,f)+t(this,_);this.vertical?(t(this,u).style.width=s+"px",t(this,u).style.height="100%"):(t(this,u).style.height=s+"px",t(this,u).style.width="100%")}else this.vertical?(t(this,u).style.width="100%",t(this,u).style.height="max-content",g(this,f,t(this,u).offsetHeight-t(this,_))):(t(this,u).style.width="max-content",t(this,u).style.height="100%",g(this,f,t(this,u).offsetWidth-t(this,_)));if(g(this,L,It.cssUnitParser.parse(getComputedStyle(t(this,u)).gap)),!t(this,y).current){const s=getComputedStyle(this);g(this,f,t(this,f)+(this.vertical?parseFloat(s.paddingBlockStart)+parseFloat(s.paddingBlockEnd):parseFloat(s.paddingInlineStart)+parseFloat(s.paddingInlineEnd))),t(this,a).max=t(this,f)}if(t(this,c).forEach(s=>{s.resize(),s.transform()}),t(this,y).current&&t(this,c).length){const s=t(this,c)[t(this,c).length-1],r=s.position+s.size-t(this,_),n=t(this,f)-r;g(this,R,s.position+s.size+n)}else g(this,R,t(this,f));if(t(this,I).current&&t(this,c).length){const s=t(this,c)[t(this,w).current];t(this,a).set(s.position,!0)}else t(this,a).set(e*t(this,f),!0)}),l(this,vt,()=>{const e=this.currentScrollValue;if(g(this,K,Math.max(0,e-t(this,f))),t(this,c).length){let s=0;for(let r=0;r<t(this,c).length;r++){const n=t(this,c)[r];n.transform(),this.targetScrollValue+this.viewportSize/2>=n.position&&(s=r)}t(this,w).current=s}else this.vertical?t(this,u).style.transform=`translate3d(0px, ${e*-1}px, 0px)`:t(this,u).style.transform=`translate3d(${e*-1}px, 0px, 0px)`;B.scrollEntries.update(this,t(this,C).current,e)}),l(this,ht,e=>{if(typeof e=="number")if(t(this,I).current){const s=Math.sign(e);t(this,c).length?this.shiftSections(s):t(this,a).shift(s*t(this,_))}else t(this,a).shift(e);else e==="min"?t(this,a).set(t(this,a).min):e==="max"&&t(this,a).set(t(this,a).length)}),zt.isBrowser&&(g(this,a,new Tt.Damped(0,{damping:.01,min:0,order:yt.TICK_ORDER.SCROLL})),this.openShadow(Kt),q.element(this,{tabIndex:0,children:[q.div({class:"static",children:[q.slot({name:"static"})]}),q.div({class:"content",children:[q.slot({ref:e=>g(this,dt,e)})],style:{flexDirection:new Dt.Derived(t(this,C),e=>e==="x"?"row":"column")},ref:e=>g(this,u,e)})]}),g(this,k,new At.WheelControls({element:this})),t(this,k).changeEvent.subscribe(t(this,ht)),g(this,F,new At.KeyboardControls({element:this})),t(this,F).changeEvent.subscribe(t(this,ht)),t(this,C).subscribe(({current:e})=>{t(this,u).style.flexDirection=e==="x"?"row":"column",t(this,k).axis=t(this,j).current?"max":e,this.isConnected&&t(this,T).call(this)}),t(this,j).subscribe(e=>{t(this,k).axis=e.current?"max":t(this,C).current}),t(this,D).subscribe(()=>{this.isConnected&&t(this,T).call(this)}),t(this,$).subscribe(({current:e})=>{this.isConnected&&(e?m(this,N,gt).call(this):m(this,U,Q).call(this))}),t(this,I).subscribe(e=>{t(this,w).current=0,t(this,k).debounce=e.current,t(this,a).reset(),this.isConnected&&(e.current&&!e.previous?m(this,N,gt).call(this):!e.current&&e.previous&&m(this,U,Q).call(this))}),t(this,y).subscribe(e=>{e.current?(this.isConnected&&(t(this,c).length||(t(this,$).current=!0)),t(this,c).length&&(t(this,a).max=1/0,t(this,a).min=-1/0)):(g(this,K,0),t(this,a).max=t(this,f),t(this,a).min=0)}),t(this,G).subscribe(e=>{t(this,a).damping=e.current}),t(this,tt).subscribe(e=>{e.current&&!e.previous?m(this,mt,Wt).call(this):!e.current&&e.previous&&m(this,bt,Mt).call(this)}),t(this,et).subscribe(e=>{e.current&&!e.previous?m(this,rt,_t).call(this):!e.current&&e.previous&&m(this,nt,St).call(this)}))}get dampingAttribute(){return t(this,G)}get axisAttibute(){return t(this,C)}get pagesAttibute(){return t(this,D)}get splitAttibute(){return t(this,$)}get sectionalAttibute(){return t(this,I)}get infiniteAttribute(){return t(this,y)}get dampingAttibute(){return t(this,G)}get disabledAttibute(){return t(this,tt)}get hibernatedAttibute(){return t(this,et)}get currentScrollValue(){return m(this,lt,xt).call(this,"current")}get targetScrollValue(){return m(this,lt,xt).call(this,"target")}get contentElement(){return t(this,u)}get position(){return t(this,st)}get contentPosition(){return t(this,it)}get viewportSize(){return t(this,_)}get scrollSize(){return t(this,f)}get gap(){return t(this,L)}get counter(){return t(this,w)}get distance(){return t(this,R)}get overscroll(){return t(this,K)}get vertical(){return t(this,C).current==="y"}get currentProgress(){return this.currentScrollValue/t(this,R)||0}get targetProgress(){return this.targetScrollValue/t(this,R)||0}get speed(){return t(this,a).speed}get direction(){return t(this,a).direction}get isRunning(){return t(this,a).isRunning}onScroll(...e){return t(this,a).subscribe(...e)}offScroll(...e){t(this,a).unsubscribe(...e)}range(e,s,r=0){const n=e-r,p=n+s+r*2;return this.currentProgress<n?0:this.currentProgress>p?1:(this.currentProgress-n)/(p-n)}curve(e,s,r=0){return Math.sin(this.range(e,s,r)*Math.PI)}visible(e,s,r=0){const n=e-r,p=n+s+r*2;return this.currentProgress>=n&&this.currentProgress<=p}scrollToSection(e,s="smooth"){if(!t(this,c).length)return;const r=t(this,w).current;m(this,Et,Ot).call(this,e);const n=t(this,c)[r],p=t(this,c)[t(this,w).current];if(n&&p){let d=0;const Y=t(this,c).length-1;t(this,y).current?t(this,w).current===0&&r===Y?d=t(this,f)+t(this,_)-n.position+t(this,L):t(this,w).current===Y&&r===0?d=p.position-(t(this,f)+t(this,_)+t(this,L)):d=p.position-n.position:d=p.position-n.position,t(this,a).shift(d,s==="instant")}}shiftSections(e,s="smooth"){t(this,c).length&&this.scrollToSection(t(this,w).current+e,s)}setPosition(e,s="smooth"){t(this,a).set(e,s==="instant")}connectedCallback(){m(this,nt,St).call(this)}disconnectedCallback(){m(this,rt,_t).call(this)}};a=new WeakMap;C=new WeakMap;D=new WeakMap;$=new WeakMap;I=new WeakMap;j=new WeakMap;y=new WeakMap;G=new WeakMap;tt=new WeakMap;et=new WeakMap;u=new WeakMap;dt=new WeakMap;c=new WeakMap;st=new WeakMap;it=new WeakMap;_=new WeakMap;f=new WeakMap;L=new WeakMap;k=new WeakMap;F=new WeakMap;w=new WeakMap;K=new WeakMap;R=new WeakMap;N=new WeakSet;gt=function(){m(this,U,Q).call(this),t(this,dt).assignedElements().forEach(i=>{i instanceof HTMLElement&&t(this,c).push(new Gt(i,this))}),t(this,u).style.transform="",t(this,T).call(this)};U=new WeakSet;Q=function(){t(this,c).forEach(i=>{i.destroy()}),g(this,c,[])};mt=new WeakSet;Wt=function(){t(this,a).unsubscribe(t(this,vt)),t(this,a).stopAnimation(),t(this,k).disconnect(),t(this,F).disconnect()};bt=new WeakSet;Mt=function(){t(this,a).subscribe(t(this,vt)),t(this,k).connect(),t(this,F).connect()};rt=new WeakSet;_t=function(){ft.windowResizer.unsubscribe(t(this,T)),t(this,a).reset(),m(this,mt,Wt).call(this),t(this,u).style.transform="",t(this,$).current&&m(this,U,Q).call(this),B.scrollEntries.unregister(this)};nt=new WeakSet;St=function(){t(this,$).current&&m(this,N,gt).call(this),B.scrollEntries.register(this),ft.windowResizer.subscribe(t(this,T),yt.RESIZE_ORDER.SCROLL),m(this,bt,Mt).call(this)};T=new WeakMap;vt=new WeakMap;Et=new WeakSet;Ot=function(i){t(this,y).current?(t(this,w).current=i%t(this,c).length,t(this,w).current=t(this,w).current<0?t(this,c).length+t(this,w).current:t(this,w).current):t(this,w).current=Lt.clamp(i,0,t(this,c).length-1)};ht=new WeakMap;lt=new WeakSet;xt=function(i="current"){if(t(this,y).current&&t(this,c).length){const e=t(this,a)[i]%(t(this,f)+t(this,_)+t(this,L));return e<0?t(this,f)+e+t(this,_)+t(this,L):e}else return t(this,a)[i]};exports.ScrollElement=Ut([wt.define("e-scroll")],exports.ScrollElement);var X;class Zt extends wt.CustomElement{constructor(){super(...arguments);V(this,X,null)}get scrollElement(){return h(this,X)}connectedCallback(){const s=Ht.findParentElement(this,exports.ScrollElement);s instanceof exports.ScrollElement?O(this,X,s):console.error(this,"e-scroll not found")}}X=new WeakMap;var Jt=Object.defineProperty,Nt=Object.getOwnPropertyDescriptor,Qt=(i,e,s,r)=>{for(var n=r>1?void 0:r?Nt(e,s):e,p=i.length-1,d;p>=0;p--)(d=i[p])&&(n=(r?d(e,s,n):d(n))||n);return r&&n&&Jt(e,s,n),n},Rt=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)},o=(i,e,s)=>(Rt(i,e,"read from private field"),s?s.call(i):e.get(i)),E=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},M=(i,e,s,r)=>(Rt(i,e,"write to private field"),r?r.call(i,s):e.set(i,s),s),ot,v,A,z,Z,J,at,ct,ut,pt;const Xt=Pt.createStylesheet({":host":{display:"inline-block",zIndex:"1",backgroundColor:"#efefef"},':host([axis="y"])':{position:"absolute",right:"0",top:"0",width:"1vmin",height:"100%"},':host([axis="x"])':{position:"absolute",left:"0",bottom:"0",width:"100%",height:"1vmin"},".default-thumb":{backgroundColor:"#181818",borderRadius:"1vmin",touchAction:"none"},"::slotted(*)":{touchAction:"none"}});exports.ScrollbarElement=class extends Zt{constructor(){super(),E(this,ot,null),E(this,v,null),E(this,A,!1),E(this,z,0),E(this,Z,0),E(this,J,0),E(this,at,()=>{M(this,A,this.offsetWidth>this.offsetHeight);const e=o(this,A)?this.offsetWidth:this.offsetHeight;M(this,z,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),M(this,z,Math.max(o(this,z),30)),o(this,A)?(o(this,v).style.width=o(this,z)+"px",o(this,v).style.height="100%"):(o(this,v).style.width="100%",o(this,v).style.height=o(this,z)+"px"),M(this,Z,e-o(this,z)),this.scrollElement.scrollSize||(this.style.display="none")}),E(this,ct,()=>{M(this,J,this.scrollElement.currentProgress*o(this,Z)),o(this,A)?o(this,v).style.transform=`translate3d(${o(this,J)}px, 0px, 0px)`:o(this,v).style.transform=`translate3d(0px, ${o(this,J)}px, 0px)`}),E(this,ut,()=>{this.setAttribute("axis",this.scrollElement.axisAttibute.current)}),E(this,pt,e=>{const s=d=>{const Y=o(this,A)?d.x:d.y,qt=this.scrollElement.distance/o(this,Z),$t=(Y-p)*qt;this.scrollElement.setPosition(n+$t)},r=()=>{removeEventListener("pointermove",s),removeEventListener("pointerup",r),removeEventListener("touchend",r)};addEventListener("pointermove",s),addEventListener("pointerup",r),addEventListener("touchend",r);const n=this.scrollElement.targetScrollValue,p=o(this,A)?e.x:e.y}),zt.isBrowser&&(this.openShadow(Xt),q.element(this,{children:[q.slot({ref:e=>M(this,ot,e)})]}))}get thumbElement(){return o(this,v)}connectedCallback(){super.connectedCallback();const e=o(this,ot).assignedElements()[0];e instanceof HTMLElement?M(this,v,e):(M(this,v,document.createElement("div")),o(this,v).classList.add("default-thumb"),this.shadowRoot.appendChild(o(this,v))),o(this,v).addEventListener("pointerdown",o(this,pt)),ft.windowResizer.subscribe(o(this,at),yt.RESIZE_ORDER.SCROLL+1),this.scrollElement.onScroll(o(this,ct)),this.scrollElement.axisAttibute.subscribe(o(this,ut))}disconnectedCallback(){o(this,v).removeEventListener("pointerdown",o(this,pt)),ft.windowResizer.unsubscribe(o(this,at)),this.scrollElement.offScroll(o(this,ct)),this.scrollElement.axisAttibute.unsubscribe(o(this,ut))}};ot=new WeakMap;v=new WeakMap;A=new WeakMap;z=new WeakMap;Z=new WeakMap;J=new WeakMap;at=new WeakMap;ct=new WeakMap;ut=new WeakMap;pt=new WeakMap;exports.ScrollbarElement=Qt([wt.define("e-scrollbar")],exports.ScrollbarElement);
1
+ "use strict";var Ct=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)};var h=(i,e,s)=>(Ct(i,e,"read from private field"),s?s.call(i):e.get(i)),H=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},$=(i,e,s,r)=>(Ct(i,e,"write to private field"),r?r.call(i,s):e.set(i,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Tt=require("../Damped-B0eRyTcV.cjs"),Vt=require("../Store-Dis8QUAR.cjs"),Dt=require("../Derived-vGokdC4b.cjs"),zt=require("../browser-CpzFX2xg.cjs"),G=require("../layout-8ryRAMGJ.cjs"),Lt=require("../math-GDWEqu7y.cjs");require("../ticker/index.cjs");const k=require("../attribute/index.cjs"),At=require("../WheelControls-fiz52vcl.cjs"),vt=require("../custom-element/index.cjs"),yt=require("../order/index.cjs"),ft=require("../window-resizer/index.cjs"),K=require("../scroll-entries/index.cjs"),D=require("../tags-D3-tO-m6.cjs"),Pt=require("../createStylesheet-B4vLzvah.cjs"),It=require("../css-unit-parser/index.cjs"),Ht=require("../dom-JBOkFLTh.cjs");var Bt=Object.defineProperty,Ft=Object.getOwnPropertyDescriptor,Ut=(i,e,s,r)=>{for(var n=r>1?void 0:r?Ft(e,s):e,p=i.length-1,d;p>=0;p--)(d=i[p])&&(n=(r?d(e,s,n):d(n))||n);return r&&n&&Bt(e,s,n),n},kt=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)},t=(i,e,s)=>(kt(i,e,"read from private field"),s?s.call(i):e.get(i)),l=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},b=(i,e,s,r)=>(kt(i,e,"write to private field"),r?r.call(i,s):e.set(i,s),s),g=(i,e,s)=>(kt(i,e,"access private method"),s),a,y,z,W,L,B,E,T,F,U,u,dt,c,st,it,_,f,R,M,Z,v,N,V,Y,bt,J,j,gt,Wt,mt,Mt,rt,_t,nt,St,I,wt,Et,Ot,ht,lt,xt,S,m,q,C;class Gt{constructor(e,s){H(this,S,void 0);H(this,m,void 0);H(this,q,0);H(this,C,0);$(this,S,e),$(this,m,s),K.scrollEntries.register(h(this,S))}get size(){return h(this,q)}get position(){return h(this,C)}destroy(){K.scrollEntries.unregister(h(this,S)),h(this,S).style.transform=""}resize(){$(this,q,h(this,m).vertical?h(this,S).offsetHeight:h(this,S).offsetWidth),$(this,C,h(this,m).vertical?G.getCumulativeOffsetTop(h(this,S)):G.getCumulativeOffsetLeft(h(this,S))),$(this,C,h(this,C)-h(this,m).contentPosition)}transform(){let e=0;const s=h(this,m).viewportSize-h(this,q);h(this,m).infiniteAttribute.current&&h(this,m).overscroll&&h(this,C)+h(this,q)<h(this,m).currentScrollValue&&(e=h(this,m).distance*-1-h(this,m).gap),K.scrollEntries.update(h(this,S),h(this,m).axisAttibute.current,e);const r=h(this,m).currentScrollValue+e,n=h(this,C)-h(this,m).viewportSize-s,p=h(this,C)+h(this,q)+s,d=Lt.clamp(r,n,p);h(this,m).vertical?h(this,S).style.transform=`translate3d(0px, ${d*-1}px, 0px)`:h(this,S).style.transform=`translate3d(${d*-1}px, 0px, 0px)`}}S=new WeakMap,m=new WeakMap,q=new WeakMap,C=new WeakMap;const Kt=Pt.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},':host([hibernated="true"])':{display:"contents"},".static":{position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},".content":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)"},':host([hibernated="true"]) .content':{display:"contents"},"::slotted(*)":{flexShrink:"0"}});exports.ScrollElement=class extends vt.CustomElement{constructor(){super(),l(this,Y),l(this,J),l(this,gt),l(this,mt),l(this,rt),l(this,nt),l(this,Et),l(this,lt),l(this,a,null),l(this,y,new k.Attribute(this,"axis","y")),l(this,z,new k.Attribute(this,"pages",0,{validate:e=>Math.max(0,e-1)})),l(this,W,new k.Attribute(this,"split",!1)),l(this,L,new k.Attribute(this,"sectional",!1)),l(this,B,new k.Attribute(this,"wheel-max-delta",!1)),l(this,E,new k.Attribute(this,"infinite",!1)),l(this,T,new k.Attribute(this,"damping",.03)),l(this,F,new k.Attribute(this,"disabled",!1)),l(this,U,new k.Attribute(this,"hibernated",!1)),l(this,u,null),l(this,dt,null),l(this,c,[]),l(this,st,0),l(this,it,0),l(this,_,0),l(this,f,0),l(this,R,0),l(this,M,null),l(this,Z,null),l(this,v,new Vt.Store(0)),l(this,N,0),l(this,V,0),l(this,I,()=>{const e=this.currentScrollValue/t(this,f)||0;if(b(this,st,this.vertical?G.getCumulativeOffsetTop(this):G.getCumulativeOffsetLeft(this)),b(this,it,this.vertical?G.getCumulativeOffsetTop(t(this,u)):G.getCumulativeOffsetLeft(t(this,u))),b(this,_,this.vertical?this.offsetHeight:this.offsetWidth),t(this,z).current){b(this,f,t(this,_)*t(this,z).current);const s=t(this,f)+t(this,_);this.vertical?(t(this,u).style.width=s+"px",t(this,u).style.height="100%"):(t(this,u).style.height=s+"px",t(this,u).style.width="100%")}else this.vertical?(t(this,u).style.width="100%",t(this,u).style.height="max-content",b(this,f,t(this,u).offsetHeight-t(this,_))):(t(this,u).style.width="max-content",t(this,u).style.height="100%",b(this,f,t(this,u).offsetWidth-t(this,_)));if(b(this,R,It.cssUnitParser.parse(getComputedStyle(t(this,u)).gap)),!t(this,E).current){const s=getComputedStyle(this);b(this,f,t(this,f)+(this.vertical?parseFloat(s.paddingBlockStart)+parseFloat(s.paddingBlockEnd):parseFloat(s.paddingInlineStart)+parseFloat(s.paddingInlineEnd))),t(this,a).max=t(this,f)}if(t(this,c).forEach(s=>{s.resize(),s.transform()}),t(this,E).current&&t(this,c).length){const s=t(this,c)[t(this,c).length-1],r=s.position+s.size-t(this,_),n=t(this,f)-r;b(this,V,s.position+s.size+n)}else b(this,V,t(this,f));if(t(this,L).current&&t(this,c).length){const s=t(this,c)[t(this,v).current];t(this,a).set(s.position,!0)}else t(this,a).set(e*t(this,f),!0)}),l(this,wt,()=>{const e=this.currentScrollValue;if(b(this,N,Math.max(0,e-t(this,f))),t(this,c).length){let s=0;for(let r=0;r<t(this,c).length;r++){const n=t(this,c)[r];n.transform(),this.targetScrollValue+this.viewportSize/2>=n.position&&(s=r)}t(this,v).current=s}else this.vertical?t(this,u).style.transform=`translate3d(0px, ${e*-1}px, 0px)`:t(this,u).style.transform=`translate3d(${e*-1}px, 0px, 0px)`;K.scrollEntries.update(this,t(this,y).current,e)}),l(this,ht,e=>{if(typeof e=="number")if(t(this,L).current){const s=Math.sign(e);t(this,c).length?this.shiftSections(s):t(this,a).shift(s*t(this,_))}else t(this,a).shift(e);else e==="min"?t(this,a).set(t(this,a).min):e==="max"&&t(this,a).set(t(this,a).length)}),zt.isBrowser&&(b(this,a,new Tt.Damped(0,{damping:.01,min:0,order:yt.TICK_ORDER.SCROLL})),this.openShadow(Kt),D.element(this,{tabIndex:0,children:[D.div({class:"static",children:[D.slot({name:"static"})]}),D.div({class:"content",children:[D.slot({ref:e=>b(this,dt,e)})],style:{flexDirection:new Dt.Derived(t(this,y),e=>e==="x"?"row":"column")},ref:e=>b(this,u,e)})]}),b(this,M,new At.WheelControls({element:this})),t(this,M).changeEvent.subscribe(t(this,ht)),b(this,Z,new At.KeyboardControls({element:this})),t(this,Z).changeEvent.subscribe(t(this,ht)),t(this,y).subscribe(({current:e})=>{t(this,u).style.flexDirection=e==="x"?"row":"column",t(this,M).axis=t(this,B).current?"max":e,this.isConnected&&t(this,I).call(this)}),t(this,B).subscribe(e=>{t(this,M).axis=e.current?"max":t(this,y).current}),t(this,z).subscribe(()=>{this.isConnected&&t(this,I).call(this)}),t(this,W).subscribe(({current:e})=>{this.isConnected&&(e?g(this,Y,bt).call(this):g(this,J,j).call(this))}),t(this,L).subscribe(e=>{t(this,v).current=0,t(this,M).debounce=e.current,t(this,a).reset(),this.isConnected&&(e.current&&!e.previous?g(this,Y,bt).call(this):!e.current&&e.previous&&g(this,J,j).call(this))}),t(this,E).subscribe(e=>{e.current?(this.isConnected&&(t(this,c).length||(t(this,W).current=!0)),t(this,c).length&&(t(this,a).max=1/0,t(this,a).min=-1/0)):(b(this,N,0),t(this,a).max=t(this,f),t(this,a).min=0)}),t(this,T).subscribe(e=>{t(this,a).damping=e.current}),t(this,F).subscribe(e=>{e.current&&!e.previous?g(this,gt,Wt).call(this):!e.current&&e.previous&&g(this,mt,Mt).call(this)}),t(this,U).subscribe(e=>{e.current&&!e.previous?g(this,rt,_t).call(this):!e.current&&e.previous&&g(this,nt,St).call(this)}))}get dampingAttribute(){return t(this,T)}get axisAttibute(){return t(this,y)}get pagesAttibute(){return t(this,z)}get splitAttibute(){return t(this,W)}get sectionalAttibute(){return t(this,L)}get infiniteAttribute(){return t(this,E)}get dampingAttibute(){return t(this,T)}get disabledAttibute(){return t(this,F)}get hibernatedAttibute(){return t(this,U)}get currentScrollValue(){return g(this,lt,xt).call(this,"current")}get targetScrollValue(){return g(this,lt,xt).call(this,"target")}get contentElement(){return t(this,u)}get position(){return t(this,st)}get contentPosition(){return t(this,it)}get viewportSize(){return t(this,_)}get scrollSize(){return t(this,f)}get gap(){return t(this,R)}get counter(){return t(this,v)}get distance(){return t(this,V)}get overscroll(){return t(this,N)}get vertical(){return t(this,y).current==="y"}get currentProgress(){return this.currentScrollValue/t(this,V)||0}get targetProgress(){return this.targetScrollValue/t(this,V)||0}get speed(){return t(this,a).speed}get direction(){return t(this,a).direction}get isRunning(){return t(this,a).isRunning}onScroll(...e){return t(this,a).subscribe(...e)}offScroll(...e){t(this,a).unsubscribe(...e)}range(e,s,r=0){const n=e-r,p=n+s+r*2;return this.currentProgress<n?0:this.currentProgress>p?1:(this.currentProgress-n)/(p-n)}curve(e,s,r=0){return Math.sin(this.range(e,s,r)*Math.PI)}visible(e,s,r=0){const n=e-r,p=n+s+r*2;return this.currentProgress>=n&&this.currentProgress<=p}scrollToSection(e,s="smooth"){if(!t(this,c).length)return;const r=t(this,v).current;g(this,Et,Ot).call(this,e);const n=t(this,c)[r],p=t(this,c)[t(this,v).current];if(n&&p){let d=0;const et=t(this,c).length-1;t(this,E).current?t(this,v).current===0&&r===et?d=t(this,f)+t(this,_)-n.position+t(this,R):t(this,v).current===et&&r===0?d=p.position-(t(this,f)+t(this,_)+t(this,R)):d=p.position-n.position:d=p.position-n.position,t(this,a).shift(d,s==="instant")}}shiftSections(e,s="smooth"){t(this,c).length&&this.scrollToSection(t(this,v).current+e,s)}setPosition(e,s="smooth"){t(this,a).set(e,s==="instant")}connectedCallback(){t(this,y).observe(),t(this,z).observe(),t(this,W).observe(),t(this,L).observe(),t(this,B).observe(),t(this,E).observe(),t(this,T).observe(),t(this,F).observe(),t(this,U).observe(),g(this,nt,St).call(this)}disconnectedCallback(){t(this,y).unobserve(),t(this,z).unobserve(),t(this,W).unobserve(),t(this,L).unobserve(),t(this,B).unobserve(),t(this,E).unobserve(),t(this,T).unobserve(),t(this,F).unobserve(),t(this,U).unobserve(),g(this,rt,_t).call(this)}};a=new WeakMap;y=new WeakMap;z=new WeakMap;W=new WeakMap;L=new WeakMap;B=new WeakMap;E=new WeakMap;T=new WeakMap;F=new WeakMap;U=new WeakMap;u=new WeakMap;dt=new WeakMap;c=new WeakMap;st=new WeakMap;it=new WeakMap;_=new WeakMap;f=new WeakMap;R=new WeakMap;M=new WeakMap;Z=new WeakMap;v=new WeakMap;N=new WeakMap;V=new WeakMap;Y=new WeakSet;bt=function(){g(this,J,j).call(this),t(this,dt).assignedElements().forEach(i=>{i instanceof HTMLElement&&t(this,c).push(new Gt(i,this))}),t(this,u).style.transform="",t(this,I).call(this)};J=new WeakSet;j=function(){t(this,c).forEach(i=>{i.destroy()}),b(this,c,[])};gt=new WeakSet;Wt=function(){t(this,a).unsubscribe(t(this,wt)),t(this,a).stopAnimation(),t(this,M).disconnect(),t(this,Z).disconnect()};mt=new WeakSet;Mt=function(){t(this,a).subscribe(t(this,wt)),t(this,M).connect(),t(this,Z).connect()};rt=new WeakSet;_t=function(){ft.windowResizer.unsubscribe(t(this,I)),t(this,a).reset(),g(this,gt,Wt).call(this),t(this,u).style.transform="",t(this,W).current&&g(this,J,j).call(this),K.scrollEntries.unregister(this)};nt=new WeakSet;St=function(){t(this,W).current&&g(this,Y,bt).call(this),K.scrollEntries.register(this),ft.windowResizer.subscribe(t(this,I),yt.RESIZE_ORDER.SCROLL),g(this,mt,Mt).call(this)};I=new WeakMap;wt=new WeakMap;Et=new WeakSet;Ot=function(i){t(this,E).current?(t(this,v).current=i%t(this,c).length,t(this,v).current=t(this,v).current<0?t(this,c).length+t(this,v).current:t(this,v).current):t(this,v).current=Lt.clamp(i,0,t(this,c).length-1)};ht=new WeakMap;lt=new WeakSet;xt=function(i="current"){if(t(this,E).current&&t(this,c).length){const e=t(this,a)[i]%(t(this,f)+t(this,_)+t(this,R));return e<0?t(this,f)+e+t(this,_)+t(this,R):e}else return t(this,a)[i]};exports.ScrollElement=Ut([vt.define("e-scroll")],exports.ScrollElement);var tt;class Zt extends vt.CustomElement{constructor(){super(...arguments);H(this,tt,null)}get scrollElement(){return h(this,tt)}connectedCallback(){const s=Ht.findParentElement(this,exports.ScrollElement);s instanceof exports.ScrollElement?$(this,tt,s):console.error(this,"e-scroll not found")}}tt=new WeakMap;var Jt=Object.defineProperty,Nt=Object.getOwnPropertyDescriptor,Qt=(i,e,s,r)=>{for(var n=r>1?void 0:r?Nt(e,s):e,p=i.length-1,d;p>=0;p--)(d=i[p])&&(n=(r?d(e,s,n):d(n))||n);return r&&n&&Jt(e,s,n),n},Rt=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)},o=(i,e,s)=>(Rt(i,e,"read from private field"),s?s.call(i):e.get(i)),x=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},A=(i,e,s,r)=>(Rt(i,e,"write to private field"),r?r.call(i,s):e.set(i,s),s),ot,w,P,O,Q,X,at,ct,ut,pt;const Xt=Pt.createStylesheet({":host":{display:"inline-block",zIndex:"1",backgroundColor:"#efefef"},':host([axis="y"])':{position:"absolute",right:"0",top:"0",width:"1vmin",height:"100%"},':host([axis="x"])':{position:"absolute",left:"0",bottom:"0",width:"100%",height:"1vmin"},".default-thumb":{backgroundColor:"#181818",borderRadius:"1vmin",touchAction:"none"},"::slotted(*)":{touchAction:"none"}});exports.ScrollbarElement=class extends Zt{constructor(){super(),x(this,ot,null),x(this,w,null),x(this,P,!1),x(this,O,0),x(this,Q,0),x(this,X,0),x(this,at,()=>{A(this,P,this.offsetWidth>this.offsetHeight);const e=o(this,P)?this.offsetWidth:this.offsetHeight;A(this,O,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),A(this,O,Math.max(o(this,O),30)),o(this,P)?(o(this,w).style.width=o(this,O)+"px",o(this,w).style.height="100%"):(o(this,w).style.width="100%",o(this,w).style.height=o(this,O)+"px"),A(this,Q,e-o(this,O)),this.scrollElement.scrollSize||(this.style.display="none")}),x(this,ct,()=>{A(this,X,this.scrollElement.currentProgress*o(this,Q)),o(this,P)?o(this,w).style.transform=`translate3d(${o(this,X)}px, 0px, 0px)`:o(this,w).style.transform=`translate3d(0px, ${o(this,X)}px, 0px)`}),x(this,ut,()=>{this.setAttribute("axis",this.scrollElement.axisAttibute.current)}),x(this,pt,e=>{const s=d=>{const et=o(this,P)?d.x:d.y,qt=this.scrollElement.distance/o(this,Q),$t=(et-p)*qt;this.scrollElement.setPosition(n+$t)},r=()=>{removeEventListener("pointermove",s),removeEventListener("pointerup",r),removeEventListener("touchend",r)};addEventListener("pointermove",s),addEventListener("pointerup",r),addEventListener("touchend",r);const n=this.scrollElement.targetScrollValue,p=o(this,P)?e.x:e.y}),zt.isBrowser&&(this.openShadow(Xt),D.element(this,{children:[D.slot({ref:e=>A(this,ot,e)})]}))}get thumbElement(){return o(this,w)}connectedCallback(){super.connectedCallback();const e=o(this,ot).assignedElements()[0];e instanceof HTMLElement?A(this,w,e):(A(this,w,document.createElement("div")),o(this,w).classList.add("default-thumb"),this.shadowRoot.appendChild(o(this,w))),o(this,w).addEventListener("pointerdown",o(this,pt)),ft.windowResizer.subscribe(o(this,at),yt.RESIZE_ORDER.SCROLL+1),this.scrollElement.onScroll(o(this,ct)),this.scrollElement.axisAttibute.subscribe(o(this,ut))}disconnectedCallback(){o(this,w).removeEventListener("pointerdown",o(this,pt)),ft.windowResizer.unsubscribe(o(this,at)),this.scrollElement.offScroll(o(this,ct)),this.scrollElement.axisAttibute.unsubscribe(o(this,ut))}};ot=new WeakMap;w=new WeakMap;P=new WeakMap;O=new WeakMap;Q=new WeakMap;X=new WeakMap;at=new WeakMap;ct=new WeakMap;ut=new WeakMap;pt=new WeakMap;exports.ScrollbarElement=Qt([vt.define("e-scrollbar")],exports.ScrollbarElement);
@@ -2,31 +2,31 @@ var Mt = (e, s, i) => {
2
2
  if (!s.has(e))
3
3
  throw TypeError("Cannot " + i);
4
4
  };
5
- var n = (e, s, i) => (Mt(e, s, "read from private field"), i ? i.call(e) : s.get(e)), R = (e, s, i) => {
5
+ var n = (e, s, i) => (Mt(e, s, "read from private field"), i ? i.call(e) : s.get(e)), H = (e, s, i) => {
6
6
  if (s.has(e))
7
7
  throw TypeError("Cannot add the same private member more than once");
8
8
  s instanceof WeakSet ? s.add(e) : s.set(e, i);
9
- }, $ = (e, s, i, r) => (Mt(e, s, "write to private field"), r ? r.call(e, i) : s.set(e, i), i);
9
+ }, D = (e, s, i, r) => (Mt(e, s, "write to private field"), r ? r.call(e, i) : s.set(e, i), i);
10
10
  import { D as Ft } from "../Damped-Do9H-LKf.js";
11
11
  import { S as Bt } from "../Store-DdDuj5hz.js";
12
12
  import { D as Kt } from "../Derived-Dbjm-dob.js";
13
13
  import { i as Lt } from "../browser-0zX67oeU.js";
14
- import { a as wt, g as bt } from "../layout-HoBT_Da2.js";
14
+ import { a as bt, g as vt } from "../layout-HoBT_Da2.js";
15
15
  import { c as Pt } from "../math-BOBiC4TN.js";
16
16
  import "../ticker/index.js";
17
- import { Attribute as k } from "../attribute/index.js";
17
+ import { Attribute as W } from "../attribute/index.js";
18
18
  import { W as Gt, K as Ut } from "../WheelControls-BqO_fTyY.js";
19
19
  import { CustomElement as zt, define as $t } from "../custom-element/index.js";
20
20
  import { TICK_ORDER as Zt, RESIZE_ORDER as Ot } from "../order/index.js";
21
21
  import { windowResizer as ct } from "../window-resizer/index.js";
22
- import { scrollEntries as H } from "../scroll-entries/index.js";
23
- import { e as Vt, D as Ct, ay as vt } from "../tags-D9nd9mMM.js";
22
+ import { scrollEntries as G } from "../scroll-entries/index.js";
23
+ import { e as Vt, D as Ct, ay as wt } from "../tags-D9nd9mMM.js";
24
24
  import { c as Dt } from "../createStylesheet-CR-XQRVT.js";
25
25
  import { cssUnitParser as qt } from "../css-unit-parser/index.js";
26
26
  import { f as Jt } from "../dom-0S_WDL4g.js";
27
27
  var Nt = Object.defineProperty, Qt = Object.getOwnPropertyDescriptor, Xt = (e, s, i, r) => {
28
- for (var a = r > 1 ? void 0 : r ? Qt(s, i) : s, f = e.length - 1, b; f >= 0; f--)
29
- (b = e[f]) && (a = (r ? b(s, i, a) : b(a)) || a);
28
+ for (var a = r > 1 ? void 0 : r ? Qt(s, i) : s, f = e.length - 1, v; f >= 0; f--)
29
+ (v = e[f]) && (a = (r ? v(s, i, a) : v(a)) || a);
30
30
  return r && a && Nt(s, i, a), a;
31
31
  }, Et = (e, s, i) => {
32
32
  if (!s.has(e))
@@ -35,40 +35,40 @@ var Nt = Object.defineProperty, Qt = Object.getOwnPropertyDescriptor, Xt = (e, s
35
35
  if (s.has(e))
36
36
  throw TypeError("Cannot add the same private member more than once");
37
37
  s instanceof WeakSet ? s.add(e) : s.set(e, i);
38
- }, d = (e, s, i, r) => (Et(e, s, "write to private field"), r ? r.call(e, i) : s.set(e, i), i), m = (e, s, i) => (Et(e, s, "access private method"), i), l, C, T, V, I, Q, E, K, X, Y, u, ut, c, j, tt, _, p, P, W, F, w, G, O, q, pt, B, J, ft, Wt, dt, yt, et, _t, st, St, D, gt, xt, Rt, it, rt, kt, S, g, z, y;
38
+ }, d = (e, s, i, r) => (Et(e, s, "write to private field"), r ? r.call(e, i) : s.set(e, i), i), m = (e, s, i) => (Et(e, s, "access private method"), i), l, E, L, y, P, F, x, R, B, K, u, ut, c, j, tt, _, p, O, M, U, b, q, T, Q, pt, Z, X, ft, Wt, dt, yt, et, _t, st, St, I, gt, xt, Rt, it, rt, kt, S, g, V, C;
39
39
  class Yt {
40
40
  constructor(s, i) {
41
- R(this, S, void 0);
42
- R(this, g, void 0);
43
- R(this, z, 0);
44
- R(this, y, 0);
45
- $(this, S, s), $(this, g, i), H.register(n(this, S));
41
+ H(this, S, void 0);
42
+ H(this, g, void 0);
43
+ H(this, V, 0);
44
+ H(this, C, 0);
45
+ D(this, S, s), D(this, g, i), G.register(n(this, S));
46
46
  }
47
47
  get size() {
48
- return n(this, z);
48
+ return n(this, V);
49
49
  }
50
50
  get position() {
51
- return n(this, y);
51
+ return n(this, C);
52
52
  }
53
53
  destroy() {
54
- H.unregister(n(this, S)), n(this, S).style.transform = "";
54
+ G.unregister(n(this, S)), n(this, S).style.transform = "";
55
55
  }
56
56
  resize() {
57
- $(this, z, n(this, g).vertical ? n(this, S).offsetHeight : n(this, S).offsetWidth), $(this, y, n(this, g).vertical ? wt(n(this, S)) : bt(n(this, S))), $(this, y, n(this, y) - n(this, g).contentPosition);
57
+ D(this, V, n(this, g).vertical ? n(this, S).offsetHeight : n(this, S).offsetWidth), D(this, C, n(this, g).vertical ? bt(n(this, S)) : vt(n(this, S))), D(this, C, n(this, C) - n(this, g).contentPosition);
58
58
  }
59
59
  transform() {
60
60
  let s = 0;
61
- const i = n(this, g).viewportSize - n(this, z);
62
- n(this, g).infiniteAttribute.current && n(this, g).overscroll && n(this, y) + n(this, z) < n(this, g).currentScrollValue && (s = n(this, g).distance * -1 - n(this, g).gap), H.update(
61
+ const i = n(this, g).viewportSize - n(this, V);
62
+ n(this, g).infiniteAttribute.current && n(this, g).overscroll && n(this, C) + n(this, V) < n(this, g).currentScrollValue && (s = n(this, g).distance * -1 - n(this, g).gap), G.update(
63
63
  n(this, S),
64
64
  n(this, g).axisAttibute.current,
65
65
  s
66
66
  );
67
- const r = n(this, g).currentScrollValue + s, a = n(this, y) - n(this, g).viewportSize - i, f = n(this, y) + n(this, z) + i, b = Pt(r, a, f);
68
- n(this, g).vertical ? n(this, S).style.transform = `translate3d(0px, ${b * -1}px, 0px)` : n(this, S).style.transform = `translate3d(${b * -1}px, 0px, 0px)`;
67
+ const r = n(this, g).currentScrollValue + s, a = n(this, C) - n(this, g).viewportSize - i, f = n(this, C) + n(this, V) + i, v = Pt(r, a, f);
68
+ n(this, g).vertical ? n(this, S).style.transform = `translate3d(0px, ${v * -1}px, 0px)` : n(this, S).style.transform = `translate3d(${v * -1}px, 0px, 0px)`;
69
69
  }
70
70
  }
71
- S = new WeakMap(), g = new WeakMap(), z = new WeakMap(), y = new WeakMap();
71
+ S = new WeakMap(), g = new WeakMap(), V = new WeakMap(), C = new WeakMap();
72
72
  const jt = Dt({
73
73
  ":host": {
74
74
  position: "relative",
@@ -103,52 +103,52 @@ const jt = Dt({
103
103
  });
104
104
  let mt = class extends zt {
105
105
  constructor() {
106
- super(), h(this, q), h(this, B), h(this, ft), h(this, dt), h(this, et), h(this, st), h(this, xt), h(this, rt), h(this, l, null), h(this, C, new k(this, "axis", "y")), h(this, T, new k(this, "pages", 0, {
106
+ super(), h(this, Q), h(this, Z), h(this, ft), h(this, dt), h(this, et), h(this, st), h(this, xt), h(this, rt), h(this, l, null), h(this, E, new W(this, "axis", "y")), h(this, L, new W(this, "pages", 0, {
107
107
  validate: (e) => Math.max(0, e - 1)
108
- })), h(this, V, new k(this, "split", !1)), h(this, I, new k(this, "sectional", !1)), h(this, Q, new k(
108
+ })), h(this, y, new W(this, "split", !1)), h(this, P, new W(this, "sectional", !1)), h(this, F, new W(
109
109
  this,
110
110
  "wheel-max-delta",
111
111
  !1
112
- )), h(this, E, new k(this, "infinite", !1)), h(this, K, new k(this, "damping", 0.03)), h(this, X, new k(this, "disabled", !1)), h(this, Y, new k(this, "hibernated", !1)), h(this, u, null), h(this, ut, null), h(this, c, []), h(this, j, 0), h(this, tt, 0), h(this, _, 0), h(this, p, 0), h(this, P, 0), h(this, W, null), h(this, F, null), h(this, w, new Bt(0)), h(this, G, 0), h(this, O, 0), h(this, D, () => {
112
+ )), h(this, x, new W(this, "infinite", !1)), h(this, R, new W(this, "damping", 0.03)), h(this, B, new W(this, "disabled", !1)), h(this, K, new W(this, "hibernated", !1)), h(this, u, null), h(this, ut, null), h(this, c, []), h(this, j, 0), h(this, tt, 0), h(this, _, 0), h(this, p, 0), h(this, O, 0), h(this, M, null), h(this, U, null), h(this, b, new Bt(0)), h(this, q, 0), h(this, T, 0), h(this, I, () => {
113
113
  const e = this.currentScrollValue / t(this, p) || 0;
114
- if (d(this, j, this.vertical ? wt(this) : bt(this)), d(this, tt, this.vertical ? wt(t(this, u)) : bt(t(this, u))), d(this, _, this.vertical ? this.offsetHeight : this.offsetWidth), t(this, T).current) {
115
- d(this, p, t(this, _) * t(this, T).current);
114
+ if (d(this, j, this.vertical ? bt(this) : vt(this)), d(this, tt, this.vertical ? bt(t(this, u)) : vt(t(this, u))), d(this, _, this.vertical ? this.offsetHeight : this.offsetWidth), t(this, L).current) {
115
+ d(this, p, t(this, _) * t(this, L).current);
116
116
  const s = t(this, p) + t(this, _);
117
117
  this.vertical ? (t(this, u).style.width = s + "px", t(this, u).style.height = "100%") : (t(this, u).style.height = s + "px", t(this, u).style.width = "100%");
118
118
  } else
119
119
  this.vertical ? (t(this, u).style.width = "100%", t(this, u).style.height = "max-content", d(this, p, t(this, u).offsetHeight - t(this, _))) : (t(this, u).style.width = "max-content", t(this, u).style.height = "100%", d(this, p, t(this, u).offsetWidth - t(this, _)));
120
- if (d(this, P, qt.parse(getComputedStyle(t(this, u)).gap)), !t(this, E).current) {
120
+ if (d(this, O, qt.parse(getComputedStyle(t(this, u)).gap)), !t(this, x).current) {
121
121
  const s = getComputedStyle(this);
122
122
  d(this, p, t(this, p) + (this.vertical ? parseFloat(s.paddingBlockStart) + parseFloat(s.paddingBlockEnd) : parseFloat(s.paddingInlineStart) + parseFloat(s.paddingInlineEnd))), t(this, l).max = t(this, p);
123
123
  }
124
124
  if (t(this, c).forEach((s) => {
125
125
  s.resize(), s.transform();
126
- }), t(this, E).current && t(this, c).length) {
126
+ }), t(this, x).current && t(this, c).length) {
127
127
  const s = t(this, c)[t(this, c).length - 1], i = s.position + s.size - t(this, _), r = t(this, p) - i;
128
- d(this, O, s.position + s.size + r);
128
+ d(this, T, s.position + s.size + r);
129
129
  } else
130
- d(this, O, t(this, p));
131
- if (t(this, I).current && t(this, c).length) {
132
- const s = t(this, c)[t(this, w).current];
130
+ d(this, T, t(this, p));
131
+ if (t(this, P).current && t(this, c).length) {
132
+ const s = t(this, c)[t(this, b).current];
133
133
  t(this, l).set(s.position, !0);
134
134
  } else
135
135
  t(this, l).set(e * t(this, p), !0);
136
136
  }), h(this, gt, () => {
137
137
  const e = this.currentScrollValue;
138
- if (d(this, G, Math.max(0, e - t(this, p))), t(this, c).length) {
138
+ if (d(this, q, Math.max(0, e - t(this, p))), t(this, c).length) {
139
139
  let s = 0;
140
140
  for (let i = 0; i < t(this, c).length; i++) {
141
141
  const r = t(this, c)[i];
142
142
  r.transform(), // this.targetScrollValue + this.viewportSize / 2 >=
143
143
  this.targetScrollValue + this.viewportSize / 2 >= r.position && (s = i);
144
144
  }
145
- t(this, w).current = s;
145
+ t(this, b).current = s;
146
146
  } else
147
147
  this.vertical ? t(this, u).style.transform = `translate3d(0px, ${e * -1}px, 0px)` : t(this, u).style.transform = `translate3d(${e * -1}px, 0px, 0px)`;
148
- H.update(this, t(this, C).current, e);
148
+ G.update(this, t(this, E).current, e);
149
149
  }), h(this, it, (e) => {
150
150
  if (typeof e == "number")
151
- if (t(this, I).current) {
151
+ if (t(this, P).current) {
152
152
  const s = Math.sign(e);
153
153
  t(this, c).length ? this.shiftSections(s) : t(this, l).shift(s * t(this, _));
154
154
  } else
@@ -164,66 +164,66 @@ let mt = class extends zt {
164
164
  children: [
165
165
  Ct({
166
166
  class: "static",
167
- children: [vt({ name: "static" })]
167
+ children: [wt({ name: "static" })]
168
168
  }),
169
169
  Ct({
170
170
  class: "content",
171
- children: [vt({ ref: (e) => d(this, ut, e) })],
171
+ children: [wt({ ref: (e) => d(this, ut, e) })],
172
172
  style: {
173
173
  flexDirection: new Kt(
174
- t(this, C),
174
+ t(this, E),
175
175
  (e) => e === "x" ? "row" : "column"
176
176
  )
177
177
  },
178
178
  ref: (e) => d(this, u, e)
179
179
  })
180
180
  ]
181
- }), d(this, W, new Gt({ element: this })), t(this, W).changeEvent.subscribe(t(this, it)), d(this, F, new Ut({ element: this })), t(this, F).changeEvent.subscribe(t(this, it)), t(this, C).subscribe(({ current: e }) => {
182
- t(this, u).style.flexDirection = e === "x" ? "row" : "column", t(this, W).axis = t(this, Q).current ? "max" : e, this.isConnected && t(this, D).call(this);
183
- }), t(this, Q).subscribe((e) => {
184
- t(this, W).axis = e.current ? "max" : t(this, C).current;
185
- }), t(this, T).subscribe(() => {
186
- this.isConnected && t(this, D).call(this);
187
- }), t(this, V).subscribe(({ current: e }) => {
188
- this.isConnected && (e ? m(this, q, pt).call(this) : m(this, B, J).call(this));
189
- }), t(this, I).subscribe((e) => {
190
- t(this, w).current = 0, t(this, W).debounce = e.current, t(this, l).reset(), this.isConnected && (e.current && !e.previous ? m(this, q, pt).call(this) : !e.current && e.previous && m(this, B, J).call(this));
191
- }), t(this, E).subscribe((e) => {
192
- e.current ? (this.isConnected && (t(this, c).length || (t(this, V).current = !0)), t(this, c).length && (t(this, l).max = 1 / 0, t(this, l).min = -1 / 0)) : (d(this, G, 0), t(this, l).max = t(this, p), t(this, l).min = 0);
193
- }), t(this, K).subscribe((e) => {
181
+ }), d(this, M, new Gt({ element: this })), t(this, M).changeEvent.subscribe(t(this, it)), d(this, U, new Ut({ element: this })), t(this, U).changeEvent.subscribe(t(this, it)), t(this, E).subscribe(({ current: e }) => {
182
+ t(this, u).style.flexDirection = e === "x" ? "row" : "column", t(this, M).axis = t(this, F).current ? "max" : e, this.isConnected && t(this, I).call(this);
183
+ }), t(this, F).subscribe((e) => {
184
+ t(this, M).axis = e.current ? "max" : t(this, E).current;
185
+ }), t(this, L).subscribe(() => {
186
+ this.isConnected && t(this, I).call(this);
187
+ }), t(this, y).subscribe(({ current: e }) => {
188
+ this.isConnected && (e ? m(this, Q, pt).call(this) : m(this, Z, X).call(this));
189
+ }), t(this, P).subscribe((e) => {
190
+ t(this, b).current = 0, t(this, M).debounce = e.current, t(this, l).reset(), this.isConnected && (e.current && !e.previous ? m(this, Q, pt).call(this) : !e.current && e.previous && m(this, Z, X).call(this));
191
+ }), t(this, x).subscribe((e) => {
192
+ e.current ? (this.isConnected && (t(this, c).length || (t(this, y).current = !0)), t(this, c).length && (t(this, l).max = 1 / 0, t(this, l).min = -1 / 0)) : (d(this, q, 0), t(this, l).max = t(this, p), t(this, l).min = 0);
193
+ }), t(this, R).subscribe((e) => {
194
194
  t(this, l).damping = e.current;
195
- }), t(this, X).subscribe((e) => {
195
+ }), t(this, B).subscribe((e) => {
196
196
  e.current && !e.previous ? m(this, ft, Wt).call(this) : !e.current && e.previous && m(this, dt, yt).call(this);
197
- }), t(this, Y).subscribe((e) => {
197
+ }), t(this, K).subscribe((e) => {
198
198
  e.current && !e.previous ? m(this, et, _t).call(this) : !e.current && e.previous && m(this, st, St).call(this);
199
199
  }));
200
200
  }
201
201
  get dampingAttribute() {
202
- return t(this, K);
202
+ return t(this, R);
203
203
  }
204
204
  get axisAttibute() {
205
- return t(this, C);
205
+ return t(this, E);
206
206
  }
207
207
  get pagesAttibute() {
208
- return t(this, T);
208
+ return t(this, L);
209
209
  }
210
210
  get splitAttibute() {
211
- return t(this, V);
211
+ return t(this, y);
212
212
  }
213
213
  get sectionalAttibute() {
214
- return t(this, I);
214
+ return t(this, P);
215
215
  }
216
216
  get infiniteAttribute() {
217
- return t(this, E);
217
+ return t(this, x);
218
218
  }
219
219
  get dampingAttibute() {
220
- return t(this, K);
220
+ return t(this, R);
221
221
  }
222
222
  get disabledAttibute() {
223
- return t(this, X);
223
+ return t(this, B);
224
224
  }
225
225
  get hibernatedAttibute() {
226
- return t(this, Y);
226
+ return t(this, K);
227
227
  }
228
228
  get currentScrollValue() {
229
229
  return m(this, rt, kt).call(this, "current");
@@ -247,25 +247,25 @@ let mt = class extends zt {
247
247
  return t(this, p);
248
248
  }
249
249
  get gap() {
250
- return t(this, P);
250
+ return t(this, O);
251
251
  }
252
252
  get counter() {
253
- return t(this, w);
253
+ return t(this, b);
254
254
  }
255
255
  get distance() {
256
- return t(this, O);
256
+ return t(this, T);
257
257
  }
258
258
  get overscroll() {
259
- return t(this, G);
259
+ return t(this, q);
260
260
  }
261
261
  get vertical() {
262
- return t(this, C).current === "y";
262
+ return t(this, E).current === "y";
263
263
  }
264
264
  get currentProgress() {
265
- return this.currentScrollValue / t(this, O) || 0;
265
+ return this.currentScrollValue / t(this, T) || 0;
266
266
  }
267
267
  get targetProgress() {
268
- return this.targetScrollValue / t(this, O) || 0;
268
+ return this.targetScrollValue / t(this, T) || 0;
269
269
  }
270
270
  get speed() {
271
271
  return t(this, l).speed;
@@ -298,38 +298,38 @@ let mt = class extends zt {
298
298
  scrollToSection(e, s = "smooth") {
299
299
  if (!t(this, c).length)
300
300
  return;
301
- const i = t(this, w).current;
301
+ const i = t(this, b).current;
302
302
  m(this, xt, Rt).call(this, e);
303
- const r = t(this, c)[i], a = t(this, c)[t(this, w).current];
303
+ const r = t(this, c)[i], a = t(this, c)[t(this, b).current];
304
304
  if (r && a) {
305
305
  let f = 0;
306
- const b = t(this, c).length - 1;
307
- t(this, E).current ? t(this, w).current === 0 && i === b ? f = t(this, p) + t(this, _) - r.position + t(this, P) : t(this, w).current === b && i === 0 ? f = a.position - (t(this, p) + t(this, _) + t(this, P)) : f = a.position - r.position : f = a.position - r.position, t(this, l).shift(f, s === "instant");
306
+ const v = t(this, c).length - 1;
307
+ t(this, x).current ? t(this, b).current === 0 && i === v ? f = t(this, p) + t(this, _) - r.position + t(this, O) : t(this, b).current === v && i === 0 ? f = a.position - (t(this, p) + t(this, _) + t(this, O)) : f = a.position - r.position : f = a.position - r.position, t(this, l).shift(f, s === "instant");
308
308
  }
309
309
  }
310
310
  shiftSections(e, s = "smooth") {
311
- t(this, c).length && this.scrollToSection(t(this, w).current + e, s);
311
+ t(this, c).length && this.scrollToSection(t(this, b).current + e, s);
312
312
  }
313
313
  setPosition(e, s = "smooth") {
314
314
  t(this, l).set(e, s === "instant");
315
315
  }
316
316
  connectedCallback() {
317
- m(this, st, St).call(this);
317
+ t(this, E).observe(), t(this, L).observe(), t(this, y).observe(), t(this, P).observe(), t(this, F).observe(), t(this, x).observe(), t(this, R).observe(), t(this, B).observe(), t(this, K).observe(), m(this, st, St).call(this);
318
318
  }
319
319
  disconnectedCallback() {
320
- m(this, et, _t).call(this);
320
+ t(this, E).unobserve(), t(this, L).unobserve(), t(this, y).unobserve(), t(this, P).unobserve(), t(this, F).unobserve(), t(this, x).unobserve(), t(this, R).unobserve(), t(this, B).unobserve(), t(this, K).unobserve(), m(this, et, _t).call(this);
321
321
  }
322
322
  };
323
323
  l = /* @__PURE__ */ new WeakMap();
324
- C = /* @__PURE__ */ new WeakMap();
325
- T = /* @__PURE__ */ new WeakMap();
326
- V = /* @__PURE__ */ new WeakMap();
327
- I = /* @__PURE__ */ new WeakMap();
328
- Q = /* @__PURE__ */ new WeakMap();
329
324
  E = /* @__PURE__ */ new WeakMap();
325
+ L = /* @__PURE__ */ new WeakMap();
326
+ y = /* @__PURE__ */ new WeakMap();
327
+ P = /* @__PURE__ */ new WeakMap();
328
+ F = /* @__PURE__ */ new WeakMap();
329
+ x = /* @__PURE__ */ new WeakMap();
330
+ R = /* @__PURE__ */ new WeakMap();
331
+ B = /* @__PURE__ */ new WeakMap();
330
332
  K = /* @__PURE__ */ new WeakMap();
331
- X = /* @__PURE__ */ new WeakMap();
332
- Y = /* @__PURE__ */ new WeakMap();
333
333
  u = /* @__PURE__ */ new WeakMap();
334
334
  ut = /* @__PURE__ */ new WeakMap();
335
335
  c = /* @__PURE__ */ new WeakMap();
@@ -337,85 +337,85 @@ j = /* @__PURE__ */ new WeakMap();
337
337
  tt = /* @__PURE__ */ new WeakMap();
338
338
  _ = /* @__PURE__ */ new WeakMap();
339
339
  p = /* @__PURE__ */ new WeakMap();
340
- P = /* @__PURE__ */ new WeakMap();
341
- W = /* @__PURE__ */ new WeakMap();
342
- F = /* @__PURE__ */ new WeakMap();
343
- w = /* @__PURE__ */ new WeakMap();
344
- G = /* @__PURE__ */ new WeakMap();
345
340
  O = /* @__PURE__ */ new WeakMap();
346
- q = /* @__PURE__ */ new WeakSet();
341
+ M = /* @__PURE__ */ new WeakMap();
342
+ U = /* @__PURE__ */ new WeakMap();
343
+ b = /* @__PURE__ */ new WeakMap();
344
+ q = /* @__PURE__ */ new WeakMap();
345
+ T = /* @__PURE__ */ new WeakMap();
346
+ Q = /* @__PURE__ */ new WeakSet();
347
347
  pt = function() {
348
- m(this, B, J).call(this), t(this, ut).assignedElements().forEach((e) => {
348
+ m(this, Z, X).call(this), t(this, ut).assignedElements().forEach((e) => {
349
349
  e instanceof HTMLElement && t(this, c).push(new Yt(e, this));
350
- }), t(this, u).style.transform = "", t(this, D).call(this);
350
+ }), t(this, u).style.transform = "", t(this, I).call(this);
351
351
  };
352
- B = /* @__PURE__ */ new WeakSet();
353
- J = function() {
352
+ Z = /* @__PURE__ */ new WeakSet();
353
+ X = function() {
354
354
  t(this, c).forEach((e) => {
355
355
  e.destroy();
356
356
  }), d(this, c, []);
357
357
  };
358
358
  ft = /* @__PURE__ */ new WeakSet();
359
359
  Wt = function() {
360
- t(this, l).unsubscribe(t(this, gt)), t(this, l).stopAnimation(), t(this, W).disconnect(), t(this, F).disconnect();
360
+ t(this, l).unsubscribe(t(this, gt)), t(this, l).stopAnimation(), t(this, M).disconnect(), t(this, U).disconnect();
361
361
  };
362
362
  dt = /* @__PURE__ */ new WeakSet();
363
363
  yt = function() {
364
- t(this, l).subscribe(t(this, gt)), t(this, W).connect(), t(this, F).connect();
364
+ t(this, l).subscribe(t(this, gt)), t(this, M).connect(), t(this, U).connect();
365
365
  };
366
366
  et = /* @__PURE__ */ new WeakSet();
367
367
  _t = function() {
368
- ct.unsubscribe(t(this, D)), t(this, l).reset(), m(this, ft, Wt).call(this), t(this, u).style.transform = "", t(this, V).current && m(this, B, J).call(this), H.unregister(this);
368
+ ct.unsubscribe(t(this, I)), t(this, l).reset(), m(this, ft, Wt).call(this), t(this, u).style.transform = "", t(this, y).current && m(this, Z, X).call(this), G.unregister(this);
369
369
  };
370
370
  st = /* @__PURE__ */ new WeakSet();
371
371
  St = function() {
372
- t(this, V).current && m(this, q, pt).call(this), H.register(this), ct.subscribe(t(this, D), Ot.SCROLL), m(this, dt, yt).call(this);
372
+ t(this, y).current && m(this, Q, pt).call(this), G.register(this), ct.subscribe(t(this, I), Ot.SCROLL), m(this, dt, yt).call(this);
373
373
  };
374
- D = /* @__PURE__ */ new WeakMap();
374
+ I = /* @__PURE__ */ new WeakMap();
375
375
  gt = /* @__PURE__ */ new WeakMap();
376
376
  xt = /* @__PURE__ */ new WeakSet();
377
377
  Rt = function(e) {
378
- t(this, E).current ? (t(this, w).current = e % t(this, c).length, t(this, w).current = t(this, w).current < 0 ? t(this, c).length + t(this, w).current : t(this, w).current) : t(this, w).current = Pt(e, 0, t(this, c).length - 1);
378
+ t(this, x).current ? (t(this, b).current = e % t(this, c).length, t(this, b).current = t(this, b).current < 0 ? t(this, c).length + t(this, b).current : t(this, b).current) : t(this, b).current = Pt(e, 0, t(this, c).length - 1);
379
379
  };
380
380
  it = /* @__PURE__ */ new WeakMap();
381
381
  rt = /* @__PURE__ */ new WeakSet();
382
382
  kt = function(e = "current") {
383
- if (t(this, E).current && t(this, c).length) {
384
- const s = t(this, l)[e] % (t(this, p) + t(this, _) + t(this, P));
385
- return s < 0 ? t(this, p) + s + t(this, _) + t(this, P) : s;
383
+ if (t(this, x).current && t(this, c).length) {
384
+ const s = t(this, l)[e] % (t(this, p) + t(this, _) + t(this, O));
385
+ return s < 0 ? t(this, p) + s + t(this, _) + t(this, O) : s;
386
386
  } else
387
387
  return t(this, l)[e];
388
388
  };
389
389
  mt = Xt([
390
390
  $t("e-scroll")
391
391
  ], mt);
392
- var N;
392
+ var Y;
393
393
  class te extends zt {
394
394
  constructor() {
395
395
  super(...arguments);
396
- R(this, N, null);
396
+ H(this, Y, null);
397
397
  }
398
398
  get scrollElement() {
399
- return n(this, N);
399
+ return n(this, Y);
400
400
  }
401
401
  connectedCallback() {
402
402
  const i = Jt(this, mt);
403
- i instanceof mt ? $(this, N, i) : console.error(this, "e-scroll not found");
403
+ i instanceof mt ? D(this, Y, i) : console.error(this, "e-scroll not found");
404
404
  }
405
405
  }
406
- N = new WeakMap();
406
+ Y = new WeakMap();
407
407
  var ee = Object.defineProperty, se = Object.getOwnPropertyDescriptor, ie = (e, s, i, r) => {
408
- for (var a = r > 1 ? void 0 : r ? se(s, i) : s, f = e.length - 1, b; f >= 0; f--)
409
- (b = e[f]) && (a = (r ? b(s, i, a) : b(a)) || a);
408
+ for (var a = r > 1 ? void 0 : r ? se(s, i) : s, f = e.length - 1, v; f >= 0; f--)
409
+ (v = e[f]) && (a = (r ? v(s, i, a) : v(a)) || a);
410
410
  return r && a && ee(s, i, a), a;
411
411
  }, Tt = (e, s, i) => {
412
412
  if (!s.has(e))
413
413
  throw TypeError("Cannot " + i);
414
- }, o = (e, s, i) => (Tt(e, s, "read from private field"), i ? i.call(e) : s.get(e)), x = (e, s, i) => {
414
+ }, o = (e, s, i) => (Tt(e, s, "read from private field"), i ? i.call(e) : s.get(e)), k = (e, s, i) => {
415
415
  if (s.has(e))
416
416
  throw TypeError("Cannot add the same private member more than once");
417
417
  s instanceof WeakSet ? s.add(e) : s.set(e, i);
418
- }, M = (e, s, i, r) => (Tt(e, s, "write to private field"), r ? r.call(e, i) : s.set(e, i), i), nt, v, A, L, U, Z, ht, ot, lt, at;
418
+ }, A = (e, s, i, r) => (Tt(e, s, "write to private field"), r ? r.call(e, i) : s.set(e, i), i), nt, w, z, $, J, N, ht, ot, lt, at;
419
419
  const re = Dt({
420
420
  ":host": {
421
421
  display: "inline-block",
@@ -447,45 +447,45 @@ const re = Dt({
447
447
  });
448
448
  let At = class extends te {
449
449
  constructor() {
450
- super(), x(this, nt, null), x(this, v, null), x(this, A, !1), x(this, L, 0), x(this, U, 0), x(this, Z, 0), x(this, ht, () => {
451
- M(this, A, this.offsetWidth > this.offsetHeight);
452
- const e = o(this, A) ? this.offsetWidth : this.offsetHeight;
453
- M(this, L, e / ((this.scrollElement.scrollSize + this.scrollElement.viewportSize) / e)), M(this, L, Math.max(o(this, L), 30)), o(this, A) ? (o(this, v).style.width = o(this, L) + "px", o(this, v).style.height = "100%") : (o(this, v).style.width = "100%", o(this, v).style.height = o(this, L) + "px"), M(this, U, e - o(this, L)), this.scrollElement.scrollSize || (this.style.display = "none");
454
- }), x(this, ot, () => {
455
- M(this, Z, this.scrollElement.currentProgress * o(this, U)), o(this, A) ? o(this, v).style.transform = `translate3d(${o(this, Z)}px, 0px, 0px)` : o(this, v).style.transform = `translate3d(0px, ${o(this, Z)}px, 0px)`;
456
- }), x(this, lt, () => {
450
+ super(), k(this, nt, null), k(this, w, null), k(this, z, !1), k(this, $, 0), k(this, J, 0), k(this, N, 0), k(this, ht, () => {
451
+ A(this, z, this.offsetWidth > this.offsetHeight);
452
+ const e = o(this, z) ? this.offsetWidth : this.offsetHeight;
453
+ A(this, $, e / ((this.scrollElement.scrollSize + this.scrollElement.viewportSize) / e)), A(this, $, Math.max(o(this, $), 30)), o(this, z) ? (o(this, w).style.width = o(this, $) + "px", o(this, w).style.height = "100%") : (o(this, w).style.width = "100%", o(this, w).style.height = o(this, $) + "px"), A(this, J, e - o(this, $)), this.scrollElement.scrollSize || (this.style.display = "none");
454
+ }), k(this, ot, () => {
455
+ A(this, N, this.scrollElement.currentProgress * o(this, J)), o(this, z) ? o(this, w).style.transform = `translate3d(${o(this, N)}px, 0px, 0px)` : o(this, w).style.transform = `translate3d(0px, ${o(this, N)}px, 0px)`;
456
+ }), k(this, lt, () => {
457
457
  this.setAttribute("axis", this.scrollElement.axisAttibute.current);
458
- }), x(this, at, (e) => {
458
+ }), k(this, at, (e) => {
459
459
  const s = (f) => {
460
- const b = o(this, A) ? f.x : f.y, It = this.scrollElement.distance / o(this, U), Ht = (b - a) * It;
460
+ const v = o(this, z) ? f.x : f.y, It = this.scrollElement.distance / o(this, J), Ht = (v - a) * It;
461
461
  this.scrollElement.setPosition(r + Ht);
462
462
  }, i = () => {
463
463
  removeEventListener("pointermove", s), removeEventListener("pointerup", i), removeEventListener("touchend", i);
464
464
  };
465
465
  addEventListener("pointermove", s), addEventListener("pointerup", i), addEventListener("touchend", i);
466
- const r = this.scrollElement.targetScrollValue, a = o(this, A) ? e.x : e.y;
466
+ const r = this.scrollElement.targetScrollValue, a = o(this, z) ? e.x : e.y;
467
467
  }), Lt && (this.openShadow(re), Vt(this, {
468
- children: [vt({ ref: (e) => M(this, nt, e) })]
468
+ children: [wt({ ref: (e) => A(this, nt, e) })]
469
469
  }));
470
470
  }
471
471
  get thumbElement() {
472
- return o(this, v);
472
+ return o(this, w);
473
473
  }
474
474
  connectedCallback() {
475
475
  super.connectedCallback();
476
476
  const e = o(this, nt).assignedElements()[0];
477
- e instanceof HTMLElement ? M(this, v, e) : (M(this, v, document.createElement("div")), o(this, v).classList.add("default-thumb"), this.shadowRoot.appendChild(o(this, v))), o(this, v).addEventListener("pointerdown", o(this, at)), ct.subscribe(o(this, ht), Ot.SCROLL + 1), this.scrollElement.onScroll(o(this, ot)), this.scrollElement.axisAttibute.subscribe(o(this, lt));
477
+ e instanceof HTMLElement ? A(this, w, e) : (A(this, w, document.createElement("div")), o(this, w).classList.add("default-thumb"), this.shadowRoot.appendChild(o(this, w))), o(this, w).addEventListener("pointerdown", o(this, at)), ct.subscribe(o(this, ht), Ot.SCROLL + 1), this.scrollElement.onScroll(o(this, ot)), this.scrollElement.axisAttibute.subscribe(o(this, lt));
478
478
  }
479
479
  disconnectedCallback() {
480
- o(this, v).removeEventListener("pointerdown", o(this, at)), ct.unsubscribe(o(this, ht)), this.scrollElement.offScroll(o(this, ot)), this.scrollElement.axisAttibute.unsubscribe(o(this, lt));
480
+ o(this, w).removeEventListener("pointerdown", o(this, at)), ct.unsubscribe(o(this, ht)), this.scrollElement.offScroll(o(this, ot)), this.scrollElement.axisAttibute.unsubscribe(o(this, lt));
481
481
  }
482
482
  };
483
483
  nt = /* @__PURE__ */ new WeakMap();
484
- v = /* @__PURE__ */ new WeakMap();
485
- A = /* @__PURE__ */ new WeakMap();
486
- L = /* @__PURE__ */ new WeakMap();
487
- U = /* @__PURE__ */ new WeakMap();
488
- Z = /* @__PURE__ */ new WeakMap();
484
+ w = /* @__PURE__ */ new WeakMap();
485
+ z = /* @__PURE__ */ new WeakMap();
486
+ $ = /* @__PURE__ */ new WeakMap();
487
+ J = /* @__PURE__ */ new WeakMap();
488
+ N = /* @__PURE__ */ new WeakMap();
489
489
  ht = /* @__PURE__ */ new WeakMap();
490
490
  ot = /* @__PURE__ */ new WeakMap();
491
491
  lt = /* @__PURE__ */ new WeakMap();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"