aptechka 0.1.14 → 0.1.15

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.
Files changed (53) hide show
  1. package/lib/Damped-Fy7tHx4d.js +33 -0
  2. package/lib/Damped-mdFs8WSd.cjs +1 -0
  3. package/lib/{WheelControls-CX9WUbBC.js → WheelControls-BN4XGOpG.js} +29 -34
  4. package/lib/WheelControls-Dc1xcVG6.cjs +1 -0
  5. package/lib/animation/index.cjs +1 -1
  6. package/lib/animation/index.js +21 -24
  7. package/lib/component/Component.d.ts +7 -3
  8. package/lib/component/hooks/custom-element.d.ts +2 -0
  9. package/lib/component/index.cjs +1 -1
  10. package/lib/component/index.d.ts +2 -1
  11. package/lib/component/index.js +174 -139
  12. package/lib/controls/index.cjs +1 -1
  13. package/lib/controls/index.js +20 -23
  14. package/lib/en3/{test → core}/En3Raycaster.d.ts +1 -1
  15. package/lib/en3/core/en3.d.ts +2 -0
  16. package/lib/en3/index.cjs +7 -7
  17. package/lib/en3/index.d.ts +1 -1
  18. package/lib/en3/index.js +540 -523
  19. package/lib/index-B-ZmkQyB.cjs +9 -0
  20. package/lib/{index-BWTXnG5n.js → index-Dizn7btU.js} +96 -96
  21. package/lib/layout-box/index.cjs +1 -1
  22. package/lib/layout-box/index.d.ts +15 -0
  23. package/lib/layout-box/index.js +102 -93
  24. package/lib/morph/index.cjs +1 -1
  25. package/lib/morph/index.js +71 -75
  26. package/lib/object-BZELAoVj.cjs +1 -0
  27. package/lib/object-R34VLqhp.js +85 -0
  28. package/lib/order/index.cjs +1 -1
  29. package/lib/order/index.d.ts +1 -0
  30. package/lib/order/index.js +1 -1
  31. package/lib/popover/index.cjs +1 -1
  32. package/lib/popover/index.js +50 -50
  33. package/lib/resized/index.d.ts +11 -0
  34. package/lib/router/index.cjs +1 -1
  35. package/lib/router/index.js +101 -105
  36. package/lib/scroll/index.cjs +1 -1
  37. package/lib/scroll/index.js +2 -2
  38. package/lib/select/index.cjs +1 -1
  39. package/lib/select/index.js +1 -1
  40. package/lib/studio/index.cjs +1 -1
  41. package/lib/studio/index.js +1 -1
  42. package/lib/utils/index.cjs +1 -1
  43. package/lib/utils/index.d.ts +1 -1
  44. package/lib/utils/index.js +15 -14
  45. package/lib/utils/object.d.ts +1 -0
  46. package/package.json +1 -1
  47. package/lib/Damped-BwpMU9Gi.cjs +0 -1
  48. package/lib/Damped-urvryQLo.js +0 -36
  49. package/lib/WheelControls-CfDeGCOU.cjs +0 -1
  50. package/lib/component/hooks/shadow.d.ts +0 -1
  51. package/lib/index-3G1lTMEf.cjs +0 -9
  52. package/lib/object-C1ph624j.cjs +0 -1
  53. package/lib/object-DIPjdukP.js +0 -73
@@ -0,0 +1,85 @@
1
+ function c(e) {
2
+ return typeof e == "object" && e !== null && !Array.isArray(e);
3
+ }
4
+ function y(e) {
5
+ if (e === null || typeof e != "object")
6
+ return e;
7
+ if (e instanceof Date)
8
+ return new Date(e.getTime());
9
+ if (e instanceof Node)
10
+ return e;
11
+ const t = Array.isArray(e) ? [] : {};
12
+ for (const r in e)
13
+ e.hasOwnProperty(r) && (t[r] = y(e[r]));
14
+ return t;
15
+ }
16
+ function o(e, t, r = c) {
17
+ for (const n in t)
18
+ r(t[n]) ? (e[n] || Object.assign(e, { [n]: {} }), o(e[n], t[n], r)) : Object.assign(e, { [n]: t[n] });
19
+ return e;
20
+ }
21
+ function u(e) {
22
+ return e === null || typeof e == "undefined";
23
+ }
24
+ function i(e, t) {
25
+ if (typeof e != typeof t)
26
+ return !1;
27
+ if ([e, t].some((r) => u(r)))
28
+ return e === t;
29
+ if (Array.isArray(e)) {
30
+ const r = e.length > t.length ? e : t, n = e.length > t.length ? t : e;
31
+ return r.every(
32
+ (s, f) => i(s, n[f])
33
+ );
34
+ }
35
+ if (typeof e != "object" || e instanceof Node || typeof e == "object" && e.constructor.toString().startsWith("class"))
36
+ return e === t;
37
+ for (const r in e) {
38
+ if (!t.hasOwnProperty(r))
39
+ return !1;
40
+ if (typeof e[r] == "object" && typeof t[r] == "object") {
41
+ if (!i(e[r], t[r]))
42
+ return !1;
43
+ } else if (e[r] !== t[r])
44
+ return !1;
45
+ }
46
+ return !0;
47
+ }
48
+ function a(e, t) {
49
+ const r = {};
50
+ for (const n in e)
51
+ t.includes(n) && (r[n] = e[n]);
52
+ return r;
53
+ }
54
+ function p(e, t) {
55
+ const r = {};
56
+ for (const n in e)
57
+ t.includes(n) || (r[n] = e[n]);
58
+ return r;
59
+ }
60
+ function l(e) {
61
+ var t;
62
+ return typeof e == "function" && ((t = Object.getOwnPropertyDescriptor(e, "prototype")) == null ? void 0 : t.writable) === !1;
63
+ }
64
+ function O(e, ...t) {
65
+ t.forEach((r) => {
66
+ Object.getOwnPropertyNames(r.prototype).forEach((n) => {
67
+ console.log(n), Object.defineProperty(
68
+ e.prototype,
69
+ n,
70
+ Object.getOwnPropertyDescriptor(r.prototype, n) || /* @__PURE__ */ Object.create(null)
71
+ );
72
+ });
73
+ });
74
+ }
75
+ export {
76
+ c as a,
77
+ u as b,
78
+ y as c,
79
+ i as d,
80
+ O as e,
81
+ l as i,
82
+ o as m,
83
+ p as o,
84
+ a as p
85
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var L=(e=>(e[e.DEVICE=-1e5]="DEVICE",e[e.MEDIA=-99999]="MEDIA",e[e.SOURCE_MANAGER=-99998]="SOURCE_MANAGER",e[e.SCROLL=-99997]="SCROLL",e[e.LAYOUT_BOX=-99996]="LAYOUT_BOX",e[e.EN3=1e5]="EN3",e))(L||{}),r=(e=>(e[e.SCROLL=-1e5]="SCROLL",e[e.LAYOUT_BOX=-99999]="LAYOUT_BOX",e[e.EN3=1e5]="EN3",e))(r||{});exports.RESIZE_ORDER=L;exports.TICK_ORDER=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e=(L=>(L[L.DEVICE=-1e5]="DEVICE",L[L.MEDIA=-99999]="MEDIA",L[L.SOURCE_MANAGER=-99998]="SOURCE_MANAGER",L[L.SCROLL=-99997]="SCROLL",L[L.LAYOUT_BOX=-99996]="LAYOUT_BOX",L[L.EN3=1e5]="EN3",L))(e||{}),A=(L=>(L[L.SCROLL=-1e5]="SCROLL",L[L.LAYOUT_BOX=-99999]="LAYOUT_BOX",L[L.LADDER=-99998]="LADDER",L[L.EN3=1e5]="EN3",L))(A||{});exports.RESIZE_ORDER=e;exports.TICK_ORDER=A;
@@ -9,5 +9,6 @@ export declare enum RESIZE_ORDER {
9
9
  export declare enum TICK_ORDER {
10
10
  SCROLL = -100000,
11
11
  LAYOUT_BOX = -99999,
12
+ LADDER = -99998,
12
13
  EN3 = 100000
13
14
  }
@@ -1,4 +1,4 @@
1
- var A = /* @__PURE__ */ ((L) => (L[L.DEVICE = -1e5] = "DEVICE", L[L.MEDIA = -99999] = "MEDIA", L[L.SOURCE_MANAGER = -99998] = "SOURCE_MANAGER", L[L.SCROLL = -99997] = "SCROLL", L[L.LAYOUT_BOX = -99996] = "LAYOUT_BOX", L[L.EN3 = 1e5] = "EN3", L))(A || {}), e = /* @__PURE__ */ ((L) => (L[L.SCROLL = -1e5] = "SCROLL", L[L.LAYOUT_BOX = -99999] = "LAYOUT_BOX", L[L.EN3 = 1e5] = "EN3", L))(e || {});
1
+ var A = /* @__PURE__ */ ((L) => (L[L.DEVICE = -1e5] = "DEVICE", L[L.MEDIA = -99999] = "MEDIA", L[L.SOURCE_MANAGER = -99998] = "SOURCE_MANAGER", L[L.SCROLL = -99997] = "SCROLL", L[L.LAYOUT_BOX = -99996] = "LAYOUT_BOX", L[L.EN3 = 1e5] = "EN3", L))(A || {}), e = /* @__PURE__ */ ((L) => (L[L.SCROLL = -1e5] = "SCROLL", L[L.LAYOUT_BOX = -99999] = "LAYOUT_BOX", L[L.LADDER = -99998] = "LADDER", L[L.EN3 = 1e5] = "EN3", L))(e || {});
2
2
  export {
3
3
  A as RESIZE_ORDER,
4
4
  e as TICK_ORDER
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("../attribute/index.cjs"),$=require("../custom-element/index.cjs"),x=require("../Store-D0_rDIsE.cjs"),B=require("../style-At6aDoqG.cjs"),D=require("../abstract-elements/index.cjs");var O=Object.defineProperty,N=Object.getOwnPropertyDescriptor,b=(t,e,r)=>e in t?O(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,I=(t,e,r,i)=>{for(var n=i>1?void 0:i?N(e,r):e,l=t.length-1,c;l>=0;l--)(c=t[l])&&(n=(i?c(e,r,n):c(n))||n);return i&&n&&O(e,r,n),n},L=(t,e,r)=>(b(t,typeof e!="symbol"?e+"":e,r),r),k=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},s=(t,e,r)=>(k(t,e,"read from private field"),r?r.call(t):e.get(t)),o=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},S=(t,e,r,i)=>(k(t,e,"write to private field"),i?i.call(t,r):e.set(t,r),r),C=(t,e,r)=>(k(t,e,"access private method"),r),P,a,m,p,E,_,M,A,u,f,w,g,y,W,v;exports.PopoverElement=class extends $.CustomElement{constructor(){super(...arguments),o(this,M),o(this,u),o(this,y),o(this,P,-1),o(this,a,new x.Store(!1)),o(this,m,void 0),o(this,p,new T.Attribute(this,"history",!1)),o(this,E,new T.Attribute(this,"single",!1)),o(this,_,!1),L(this,"open",()=>{s(this,a).current||(s(this,a).current=!0,s(this,E).current&&(exports.PopoverElement.__opened.forEach(e=>e.close()),exports.PopoverElement.__opened=[]),exports.PopoverElement.__opened.push(this),S(this,P,exports.PopoverElement.__opened.length-1),s(this,p).current&&s(this,_)&&history.pushState("","",s(this,M,A)),clearTimeout(s(this,m)),this.classList.add("triggered"),this.style.display="block",setTimeout(()=>{addEventListener("click",s(this,w)),addEventListener("keydown",s(this,g)),this.style.opacity="1",this.classList.add("opened")}))}),L(this,"close",()=>{s(this,a).current&&(s(this,a).current=!1,exports.PopoverElement.__opened=exports.PopoverElement.__opened.filter(e=>e!==this),s(this,p).current&&history.replaceState("","",location.href.replace(new RegExp(`[&?]${s(this,u,f)}`,"g"),"")),this.classList.remove("opened"),this.style.opacity="0",removeEventListener("click",s(this,w)),removeEventListener("keydown",s(this,g)),setTimeout(()=>{this.classList.remove("triggered"),this.style.display="none"},B.getElementTransitionDurationMS(this)))}),o(this,w,e=>{C(this,y,W).call(this,()=>{const r=e.composedPath();(!r.find(i=>i===this)&&!r.find(i=>i instanceof HTMLElement&&i.closest("e-popover-button"))||r[0]instanceof HTMLElement&&r[0].hasAttribute("outside"))&&this.close()})}),o(this,g,e=>{C(this,y,W).call(this,()=>{e.code==="Escape"&&this.close()})}),o(this,v,()=>{S(this,_,!1),s(this,a).current&&s(this,p).current&&!location.search.includes(s(this,u,f))?this.close():!s(this,a).current&&s(this,p).current&&location.search.includes(s(this,u,f))&&this.open(),S(this,_,!0)})}get history(){return s(this,p)}get single(){return s(this,E)}get opened(){return s(this,a)}connectedCallback(){this.style.opacity="0",this.style.display="none",addEventListener("popstate",s(this,v)),setTimeout(()=>{s(this,v).call(this)},0)}disconnectedCallback(){clearTimeout(s(this,m)),removeEventListener("popstate",s(this,v))}};P=new WeakMap;a=new WeakMap;m=new WeakMap;p=new WeakMap;E=new WeakMap;_=new WeakMap;M=new WeakSet;A=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${s(this,u,f)}`};u=new WeakSet;f=function(){return`modal-${this.id}`};w=new WeakMap;g=new WeakMap;y=new WeakSet;W=function(t){(exports.PopoverElement.__opened[s(this,P)-1]||exports.PopoverElement.__opened.length===1)&&t()};v=new WeakMap;L(exports.PopoverElement,"__opened",[]);exports.PopoverElement=I([$.define("e-popover")],exports.PopoverElement);var G=Object.defineProperty,H=Object.getOwnPropertyDescriptor,R=(t,e,r,i)=>{for(var n=i>1?void 0:i?H(e,r):e,l=t.length-1,c;l>=0;l--)(c=t[l])&&(n=(i?c(e,r,n):c(n))||n);return i&&n&&G(e,r,n),n},q=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},d=(t,e,r)=>(q(t,e,"read from private field"),r?r.call(t):e.get(t)),F=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},z=(t,e,r,i)=>(q(t,e,"write to private field"),i?i.call(t,r):e.set(t,r),r),h;exports.PopoverButtonElement=class extends D.AbstractButtonElement{constructor(){super(...arguments),F(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 r=document.querySelector(`#${e}`)||this.getRootNode().querySelector(`#${e}`);r?z(this,h,r):console.warn(this,`target ${e} not found`)}}};h=new WeakMap;exports.PopoverButtonElement=R([$.define("e-popover-button")],exports.PopoverButtonElement);
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("../attribute/index.cjs"),M=require("../custom-element/index.cjs"),A=require("../Store-D0_rDIsE.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,54 +1,54 @@
1
- import { Attribute as C } from "../attribute/index.js";
2
- import { CustomElement as I, define as A } from "../custom-element/index.js";
3
- import { S as q } from "../Store-JOKrNVEr.js";
4
- import { g as B } from "../style-j2TwriJ_.js";
5
- import { AbstractButtonElement as G } from "../abstract-elements/index.js";
6
- var x = Object.defineProperty, H = Object.getOwnPropertyDescriptor, R = (e, t, s) => t in e ? x(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, F = (e, t, s, r) => {
7
- for (var n = r > 1 ? void 0 : r ? H(t, s) : t, p = e.length - 1, l; p >= 0; p--)
1
+ import { Attribute as T } from "../attribute/index.js";
2
+ import { CustomElement as D, define as P } from "../custom-element/index.js";
3
+ import { S as I } from "../Store-JOKrNVEr.js";
4
+ import { g as N } from "../style-j2TwriJ_.js";
5
+ import { AbstractButtonElement as q } from "../abstract-elements/index.js";
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
8
  (l = e[p]) && (n = (r ? l(t, s, n) : l(n)) || n);
9
- return r && n && x(t, s, n), n;
10
- }, $ = (e, t, s) => (R(e, typeof t != "symbol" ? t + "" : t, s), s), T = (e, t, s) => {
9
+ return r && n && B(t, s, n), n;
10
+ }, M = (e, t, s) => {
11
11
  if (!t.has(e))
12
12
  throw TypeError("Cannot " + s);
13
- }, i = (e, t, s) => (T(e, t, "read from private field"), s ? s.call(e) : t.get(e)), o = (e, t, s) => {
13
+ }, i = (e, t, s) => (M(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
- }, W = (e, t, s, r) => (T(e, t, "write to private field"), r ? r.call(e, s) : t.set(e, s), s), P = (e, t, s) => (T(e, t, "access private method"), s), S, h, m, d, g, f, k, D, _, w, y, E, L, M, v;
18
- let a = class extends I {
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 {
19
19
  constructor() {
20
- super(...arguments), o(this, k), o(this, _), o(this, L), o(this, S, -1), o(this, h, new q(!1)), o(this, m, void 0), o(this, d, new C(this, "history", !1)), o(this, g, new C(this, "single", !1)), o(this, f, !1), $(this, "open", () => {
21
- i(this, h).current || (i(this, h).current = !0, i(this, g).current && (a.__opened.forEach((e) => e.close()), a.__opened = []), a.__opened.push(this), W(this, S, a.__opened.length - 1), i(this, d).current && i(this, f) && history.pushState("", "", i(this, k, D)), clearTimeout(i(this, m)), this.classList.add("triggered"), this.style.display = "block", setTimeout(() => {
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(() => {
22
22
  addEventListener("click", i(this, y)), addEventListener("keydown", i(this, E)), this.style.opacity = "1", this.classList.add("opened");
23
23
  }));
24
- }), $(this, "close", () => {
24
+ }, this.close = () => {
25
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
26
  "",
27
27
  "",
28
- location.href.replace(new RegExp(`[&?]${i(this, _, w)}`, "g"), "")
28
+ location.href.replace(new RegExp(`[&?]${i(this, u, w)}`, "g"), "")
29
29
  ), this.classList.remove("opened"), this.style.opacity = "0", removeEventListener("click", i(this, y)), removeEventListener("keydown", i(this, E)), setTimeout(() => {
30
30
  this.classList.remove("triggered"), this.style.display = "none";
31
- }, B(this)));
32
- }), o(this, y, (e) => {
33
- P(this, L, M).call(this, () => {
31
+ }, N(this)));
32
+ }, o(this, y, (e) => {
33
+ C(this, k, $).call(this, () => {
34
34
  const t = e.composedPath();
35
35
  (!t.find((s) => s === this) && !t.find(
36
36
  (s) => s instanceof HTMLElement && s.closest("e-popover-button")
37
37
  ) || t[0] instanceof HTMLElement && t[0].hasAttribute("outside")) && this.close();
38
38
  });
39
39
  }), o(this, E, (e) => {
40
- P(this, L, M).call(this, () => {
40
+ C(this, k, $).call(this, () => {
41
41
  e.code === "Escape" && this.close();
42
42
  });
43
43
  }), o(this, v, () => {
44
- W(this, f, !1), i(this, h).current && i(this, d).current && !location.search.includes(i(this, _, w)) ? this.close() : !i(this, h).current && i(this, d).current && location.search.includes(i(this, _, w)) && this.open(), W(this, f, !0);
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
45
  });
46
46
  }
47
47
  get history() {
48
48
  return i(this, d);
49
49
  }
50
50
  get single() {
51
- return i(this, g);
51
+ return i(this, m);
52
52
  }
53
53
  get opened() {
54
54
  return i(this, h);
@@ -59,70 +59,70 @@ let a = class extends I {
59
59
  }, 0);
60
60
  }
61
61
  disconnectedCallback() {
62
- clearTimeout(i(this, m)), removeEventListener("popstate", i(this, v));
62
+ clearTimeout(i(this, g)), removeEventListener("popstate", i(this, v));
63
63
  }
64
64
  };
65
- S = /* @__PURE__ */ new WeakMap();
65
+ L = /* @__PURE__ */ new WeakMap();
66
66
  h = /* @__PURE__ */ new WeakMap();
67
- m = /* @__PURE__ */ new WeakMap();
68
- d = /* @__PURE__ */ new WeakMap();
69
67
  g = /* @__PURE__ */ new WeakMap();
68
+ d = /* @__PURE__ */ new WeakMap();
69
+ m = /* @__PURE__ */ new WeakMap();
70
70
  f = /* @__PURE__ */ new WeakMap();
71
- k = /* @__PURE__ */ new WeakSet();
72
- D = function() {
73
- return `${location.pathname}${location.search ? location.search + "&" : "?"}${i(this, _, w)}`;
71
+ W = /* @__PURE__ */ new WeakSet();
72
+ A = function() {
73
+ return `${location.pathname}${location.search ? location.search + "&" : "?"}${i(this, u, w)}`;
74
74
  };
75
- _ = /* @__PURE__ */ new WeakSet();
75
+ u = /* @__PURE__ */ new WeakSet();
76
76
  w = function() {
77
77
  return `modal-${this.id}`;
78
78
  };
79
79
  y = /* @__PURE__ */ new WeakMap();
80
80
  E = /* @__PURE__ */ new WeakMap();
81
- L = /* @__PURE__ */ new WeakSet();
82
- M = function(e) {
83
- (a.__opened[i(this, S) - 1] || a.__opened.length === 1) && e();
81
+ k = /* @__PURE__ */ new WeakSet();
82
+ $ = function(e) {
83
+ (a.__opened[i(this, L) - 1] || a.__opened.length === 1) && e();
84
84
  };
85
85
  v = /* @__PURE__ */ new WeakMap();
86
- $(a, "__opened", []);
87
- a = F([
88
- A("e-popover")
86
+ a.__opened = [];
87
+ a = H([
88
+ P("e-popover")
89
89
  ], a);
90
- var z = Object.defineProperty, J = Object.getOwnPropertyDescriptor, K = (e, t, s, r) => {
91
- for (var n = r > 1 ? void 0 : r ? J(t, s) : t, p = e.length - 1, l; p >= 0; p--)
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
92
  (l = e[p]) && (n = (r ? l(t, s, n) : l(n)) || n);
93
- return r && n && z(t, s, n), n;
94
- }, N = (e, t, s) => {
93
+ return r && n && R(t, s, n), n;
94
+ }, x = (e, t, s) => {
95
95
  if (!t.has(e))
96
96
  throw TypeError("Cannot " + s);
97
- }, u = (e, t, s) => (N(e, t, "read from private field"), s ? s.call(e) : t.get(e)), Q = (e, t, s) => {
97
+ }, _ = (e, t, s) => (x(e, t, "read from private field"), s ? s.call(e) : t.get(e)), J = (e, t, s) => {
98
98
  if (t.has(e))
99
99
  throw TypeError("Cannot add the same private member more than once");
100
100
  t instanceof WeakSet ? t.add(e) : t.set(e, s);
101
- }, U = (e, t, s, r) => (N(e, t, "write to private field"), r ? r.call(e, s) : t.set(e, s), s), c;
102
- let O = class extends G {
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
103
  constructor() {
104
- super(...arguments), Q(this, c, void 0);
104
+ super(...arguments), J(this, c, void 0);
105
105
  }
106
106
  get popoverElement() {
107
- return u(this, c);
107
+ return _(this, c);
108
108
  }
109
109
  click() {
110
- if (u(this, c)) {
110
+ if (_(this, c)) {
111
111
  const e = this.getAttribute("type") || "open";
112
- e === "open" || e === "toggle" && !u(this, c).opened.current ? u(this, c).open() : (e === "close" || e === "toggle" && u(this, c).opened.current) && u(this, c).close();
112
+ e === "open" || e === "toggle" && !_(this, c).opened.current ? _(this, c).open() : (e === "close" || e === "toggle" && _(this, c).opened.current) && _(this, c).close();
113
113
  }
114
114
  }
115
115
  connectedCallback() {
116
116
  const e = this.getAttribute("target");
117
117
  if (e) {
118
118
  const t = document.querySelector(`#${e}`) || this.getRootNode().querySelector(`#${e}`);
119
- t ? U(this, c, t) : console.warn(this, `target ${e} not found`);
119
+ t ? K(this, c, t) : console.warn(this, `target ${e} not found`);
120
120
  }
121
121
  }
122
122
  };
123
123
  c = /* @__PURE__ */ new WeakMap();
124
- O = K([
125
- A("e-popover-button")
124
+ O = F([
125
+ P("e-popover-button")
126
126
  ], O);
127
127
  export {
128
128
  O as PopoverButtonElement,
@@ -0,0 +1,11 @@
1
+ import { Store, StoreOptions } from '../store';
2
+ import { ElementOrSelector } from '../utils';
3
+ export interface ResizedOptions extends StoreOptions<number, 'number'> {
4
+ dispatcher?: ElementOrSelector;
5
+ }
6
+ export type ResizedCallback = () => number;
7
+ export declare class Resized extends Store<number, 'number'> {
8
+ #private;
9
+ constructor(callback: ResizedCallback, options?: ResizedOptions);
10
+ close(): void;
11
+ }
@@ -1 +1 @@
1
- "use strict";var st=Object.defineProperty;var Z=(i,t)=>(t=Symbol[i])?t:Symbol.for("Symbol."+i);var it=(i,t,s)=>t in i?st(i,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[t]=s;var I=(i,t,s)=>(it(i,typeof t!="symbol"?t+"":t,s),s),F=(i,t,s)=>{if(!t.has(i))throw TypeError("Cannot "+s)};var e=(i,t,s)=>(F(i,t,"read from private field"),s?s.call(i):t.get(i)),n=(i,t,s)=>{if(t.has(i))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(i):t.set(i,s)},o=(i,t,s,r)=>(F(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s);var G=(i,t,s)=>(F(i,t,"access private method"),s);var D=(i,t,s)=>new Promise((r,f)=>{var h=u=>{try{d(s.next(u))}catch(T){f(T)}},a=u=>{try{d(s.throw(u))}catch(T){f(T)}},d=u=>u.done?r(u.value):Promise.resolve(u.value).then(h,a);d((s=s.apply(i,t)).next())});var J=(i,t,s)=>(t=i[Z("asyncIterator")])?t.call(i):(i=i[Z("iterator")](),t={},s=(r,f)=>(f=i[r])&&(t[r]=h=>new Promise((a,d,u)=>(h=f.call(i,h),u=h.done,Promise.resolve(h.value).then(T=>a({value:T,done:u}),d)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const rt=require("urlpattern-polyfill"),ot=require("../notifier/index.cjs"),_=require("../browser-CpzFX2xg.cjs"),nt=require("../function-MthRj-GJ.cjs"),$=require("../object-C1ph624j.cjs");var b,H,R,m,l,w,S,v,P,y,K,tt;class ht{constructor(t,s){n(this,K);n(this,b,void 0);n(this,H,void 0);n(this,R,void 0);n(this,m,void 0);n(this,l,void 0);n(this,w,void 0);n(this,S,void 0);n(this,v,null);n(this,P,[]);n(this,y,[]);o(this,b,t),o(this,H,s),o(this,R,new URLPattern({pathname:e(this,b)})),o(this,m,null),o(this,l,null),o(this,w,!1),o(this,S,null),_.isBrowser&&o(this,v,new MutationObserver(r=>{r[0].addedNodes.forEach(h=>{e(this,m)?e(this,y).push(h):e(this,P).push(h)})}))}get pattern(){return e(this,b)}get urlPattern(){return e(this,R)}get isActive(){return e(this,w)}get element(){return e(this,l)}get outlet(){return e(this,S)}testPathname(t){return this.urlPattern.test({pathname:t})}render(t,s){return D(this,null,function*(){var r,f;if(e(this,v).observe(document.head,{childList:!0,subtree:!0}),e(this,m))e(this,P).forEach(h=>{document.head.appendChild(h)});else{const h=yield e(this,H).call(this);if(o(this,y,[...e(this,P)]),typeof h.default=="function"&&(o(this,m,h.default),$.isESClass(h.default))){const a="e-"+((r=e(this,m))==null?void 0:r.name.toLowerCase());customElements.get(a)||customElements.define(a,h.default)}}if(yield G(this,K,tt).call(this),e(this,m)){const h=e(this,R).exec({pathname:s}),a=(h==null?void 0:h.pathname.groups)||{},d=Object.fromEntries(new URLSearchParams(location.search)),u={pathnameParams:a,searchParams:d};$.isESClass(e(this,m))?o(this,l,new(e(this,m))(u)):o(this,l,e(this,m).call(this,u)),t.appendChild(e(this,l)),o(this,S,e(this,l).querySelector("[data-outlet]")||((f=e(this,l).shadowRoot)==null?void 0:f.querySelector("[data-outlet]"))||e(this,l).shadowRoot||e(this,l)),o(this,w,!0)}e(this,v).disconnect()})}close(){var t;e(this,v).disconnect(),(t=e(this,l))==null||t.remove(),o(this,w,!1),e(this,y).forEach(s=>document.head.removeChild(s)),o(this,y,[])}getAnchorElements(){var s;let t=[];return e(this,l)&&(t=[...e(this,l).querySelectorAll("a")]),(s=e(this,l))!=null&&s.shadowRoot&&(t=[...t,...e(this,l).shadowRoot.querySelectorAll("a")]),t}}b=new WeakMap,H=new WeakMap,R=new WeakMap,m=new WeakMap,l=new WeakMap,w=new WeakMap,S=new WeakMap,v=new WeakMap,P=new WeakMap,y=new WeakMap,K=new WeakSet,tt=function(){return D(this,null,function*(){const t=e(this,P).filter(a=>a instanceof HTMLElement?a.tagName==="STYLE"||a.tagName==="SCRIPT"||a.tagName==="LINK":!1);try{for(var s=J(t),r,f,h;r=!(f=yield s.next()).done;r=!1){const a=f.value;yield new Promise(d=>{a.onload=()=>{d()}})}}catch(f){h=[f]}finally{try{r&&(f=s.return)&&(yield f.call(s))}finally{if(h)throw h[0]}}})};var U,g,A,j,M;class at{constructor(t,s){n(this,U,void 0);n(this,g,void 0);n(this,A,void 0);n(this,j,void 0);n(this,M,t=>{t.preventDefault(),e(this,U).navigate(e(this,A),e(this,j))});o(this,U,t),o(this,g,s),o(this,A,e(this,g).getAttribute("href")||"/"),o(this,j,e(this,g).getAttribute("data-history-action")||"push"),e(this,g).addEventListener("click",e(this,M)),location.pathname===e(this,A)&&e(this,g).classList.add("current")}destroy(){e(this,g).removeEventListener("click",e(this,M)),e(this,g).classList.remove("current")}}U=new WeakMap,g=new WeakMap,A=new WeakMap,j=new WeakMap,M=new WeakMap;globalThis.URLPattern=rt.URLPattern;var k,q,p,C,x,E,N,B,W,Y,et,z;const O=class O{constructor(t){n(this,Y);n(this,k,null);n(this,q,void 0);n(this,p,[]);n(this,C,null);n(this,x,[]);n(this,E,void 0);n(this,N,null);n(this,B,new ot.Notifier);I(this,"preprocessor");I(this,"postprocessor");n(this,W,nt.debounce(()=>{const t=s=>s.split("/").length;o(this,p,e(this,p).sort((s,r)=>t(s.pattern)-t(r.pattern))),this.navigate(location.pathname.replace(e(this,q),""))},0));n(this,z,t=>{t.state&&this.navigate(t.state,"none")});o(this,q,(t==null?void 0:t.base)||""),O.active=this,_.isBrowser&&(o(this,k,(t==null?void 0:t.rootElement)||document.body),addEventListener("popstate",e(this,z)))}get currentPathname(){return e(this,N)}get candidatePathname(){return e(this,E)}get routes(){return e(this,p)}navigationEvent(t){return e(this,B).subscribe(t)}defineRoute(t,s){const r=new ht(t,s);e(this,p).push(r),e(this,W).call(this)}navigate(t,s="push"){return D(this,null,function*(){var u,V;if(e(this,E)===t||e(this,N)===t)return;O.active=this,o(this,E,t);const r=e(this,p).filter(c=>c.isActive),f=e(this,p).filter(c=>!r.includes(c)&&c.testPathname(t)),h=r.filter(c=>!c.testPathname(t)),a=r.filter(c=>c.testPathname(t));let d=!0;if(this.preprocessor)try{yield new Promise((c,L)=>{var X;(X=this.preprocessor)==null||X.call(this,{pathname:t,resolve:c,reject:L})})}catch(c){c?console.error(c):console.log("Route change canceled"),d=!1}if(d&&e(this,E)===t){o(this,C,a[a.length-1]),h.forEach(L=>{L.close()}),o(this,N,t);try{for(var T=J(f),ut,ft,dt;ut=!(ft=yield T.next()).done;ut=!1){const L=ft.value;yield L.render(((u=e(this,C))==null?void 0:u.outlet)||e(this,k),t),o(this,C,L)}}catch(ft){dt=[ft]}finally{try{ut&&(ft=T.return)&&(yield ft.call(T))}finally{if(dt)throw dt[0]}}const c=e(this,q)+t+location.search;s==="push"?history.pushState(c,"",c):s==="replace"&&history.replaceState(c,"",c),G(this,Y,et).call(this),(V=this.postprocessor)==null||V.call(this,{pathname:t}),e(this,B).notify({pathname:t})}})}};k=new WeakMap,q=new WeakMap,p=new WeakMap,C=new WeakMap,x=new WeakMap,E=new WeakMap,N=new WeakMap,B=new WeakMap,W=new WeakMap,Y=new WeakSet,et=function(){const t=e(this,p).filter(r=>r.isActive),s=Array.from(new Set([...e(this,k).querySelectorAll("a"),...t.map(r=>r.getAnchorElements()).flat()].filter(r=>{var f;return(f=r.getAttribute("href"))==null?void 0:f.startsWith("/")})));e(this,x).forEach(r=>{r.destroy()}),o(this,x,s.map(r=>new at(this,r)))},z=new WeakMap,I(O,"active");let Q=O;exports.Router=Q;
1
+ "use strict";var X=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n);var z=(n,t,s)=>{if(!t.has(n))throw TypeError("Cannot "+s)};var e=(n,t,s)=>(z(n,t,"read from private field"),s?s.call(n):t.get(n)),o=(n,t,s)=>{if(t.has(n))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(n):t.set(n,s)},r=(n,t,s,i)=>(z(n,t,"write to private field"),i?i.call(n,s):t.set(n,s),s);var F=(n,t,s)=>(z(n,t,"access private method"),s);var B=(n,t,s)=>new Promise((i,f)=>{var h=u=>{try{d(s.next(u))}catch(T){f(T)}},a=u=>{try{d(s.throw(u))}catch(T){f(T)}},d=u=>u.done?i(u.value):Promise.resolve(u.value).then(h,a);d((s=s.apply(n,t)).next())});var G=(n,t,s)=>(t=n[X("asyncIterator")])?t.call(n):(n=n[X("iterator")](),t={},s=(i,f)=>(f=n[i])&&(t[i]=h=>new Promise((a,d,u)=>(h=f.call(n,h),u=h.done,Promise.resolve(h.value).then(T=>a({value:T,done:u}),d)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const et=require("urlpattern-polyfill"),st=require("../notifier/index.cjs"),_=require("../browser-CpzFX2xg.cjs"),it=require("../function-MthRj-GJ.cjs"),Z=require("../object-BZELAoVj.cjs");var b,O,R,m,l,v,S,p,P,y,I,$;class nt{constructor(t,s){o(this,I);o(this,b,void 0);o(this,O,void 0);o(this,R,void 0);o(this,m,void 0);o(this,l,void 0);o(this,v,void 0);o(this,S,void 0);o(this,p,null);o(this,P,[]);o(this,y,[]);r(this,b,t),r(this,O,s),r(this,R,new URLPattern({pathname:e(this,b)})),r(this,m,null),r(this,l,null),r(this,v,!1),r(this,S,null),_.isBrowser&&r(this,p,new MutationObserver(i=>{i[0].addedNodes.forEach(h=>{e(this,m)?e(this,y).push(h):e(this,P).push(h)})}))}get pattern(){return e(this,b)}get urlPattern(){return e(this,R)}get isActive(){return e(this,v)}get element(){return e(this,l)}get outlet(){return e(this,S)}testPathname(t){return this.urlPattern.test({pathname:t})}render(t,s){return B(this,null,function*(){var i,f;if(e(this,p).observe(document.head,{childList:!0,subtree:!0}),e(this,m))e(this,P).forEach(h=>{document.head.appendChild(h)});else{const h=yield e(this,O).call(this);if(r(this,y,[...e(this,P)]),typeof h.default=="function"&&(r(this,m,h.default),Z.isESClass(h.default))){const a="e-"+((i=e(this,m))==null?void 0:i.name.toLowerCase());customElements.get(a)||customElements.define(a,h.default)}}if(yield F(this,I,$).call(this),e(this,m)){const h=e(this,R).exec({pathname:s}),a=(h==null?void 0:h.pathname.groups)||{},d=Object.fromEntries(new URLSearchParams(location.search)),u={pathnameParams:a,searchParams:d};Z.isESClass(e(this,m))?r(this,l,new(e(this,m))(u)):r(this,l,e(this,m).call(this,u)),t.appendChild(e(this,l)),r(this,S,e(this,l).querySelector("[data-outlet]")||((f=e(this,l).shadowRoot)==null?void 0:f.querySelector("[data-outlet]"))||e(this,l).shadowRoot||e(this,l)),r(this,v,!0)}e(this,p).disconnect()})}close(){var t;e(this,p).disconnect(),(t=e(this,l))==null||t.remove(),r(this,v,!1),e(this,y).forEach(s=>document.head.removeChild(s)),r(this,y,[])}getAnchorElements(){var s;let t=[];return e(this,l)&&(t=[...e(this,l).querySelectorAll("a")]),(s=e(this,l))!=null&&s.shadowRoot&&(t=[...t,...e(this,l).shadowRoot.querySelectorAll("a")]),t}}b=new WeakMap,O=new WeakMap,R=new WeakMap,m=new WeakMap,l=new WeakMap,v=new WeakMap,S=new WeakMap,p=new WeakMap,P=new WeakMap,y=new WeakMap,I=new WeakSet,$=function(){return B(this,null,function*(){const t=e(this,P).filter(a=>a instanceof HTMLElement?a.tagName==="STYLE"||a.tagName==="SCRIPT"||a.tagName==="LINK":!1);try{for(var s=G(t),i,f,h;i=!(f=yield s.next()).done;i=!1){const a=f.value;yield new Promise(d=>{a.onload=()=>{d()}})}}catch(f){h=[f]}finally{try{i&&(f=s.return)&&(yield f.call(s))}finally{if(h)throw h[0]}}})};var H,g,A,U,j;class rt{constructor(t,s){o(this,H,void 0);o(this,g,void 0);o(this,A,void 0);o(this,U,void 0);o(this,j,t=>{t.preventDefault(),e(this,H).navigate(e(this,A),e(this,U))});r(this,H,t),r(this,g,s),r(this,A,e(this,g).getAttribute("href")||"/"),r(this,U,e(this,g).getAttribute("data-history-action")||"push"),e(this,g).addEventListener("click",e(this,j)),location.pathname===e(this,A)&&e(this,g).classList.add("current")}destroy(){e(this,g).removeEventListener("click",e(this,j)),e(this,g).classList.remove("current")}}H=new WeakMap,g=new WeakMap,A=new WeakMap,U=new WeakMap,j=new WeakMap;globalThis.URLPattern=et.URLPattern;var k,q,w,C,M,E,N,x,D,K,tt,W;const Y=class Y{constructor(t){o(this,K);o(this,k,null);o(this,q,void 0);o(this,w,[]);o(this,C,null);o(this,M,[]);o(this,E,void 0);o(this,N,null);o(this,x,new st.Notifier);o(this,D,it.debounce(()=>{const t=s=>s.split("/").length;r(this,w,e(this,w).sort((s,i)=>t(s.pattern)-t(i.pattern))),this.navigate(location.pathname.replace(e(this,q),""))},0));o(this,W,t=>{t.state&&this.navigate(t.state,"none")});r(this,q,(t==null?void 0:t.base)||""),Y.active=this,_.isBrowser&&(r(this,k,(t==null?void 0:t.rootElement)||document.body),addEventListener("popstate",e(this,W)))}get currentPathname(){return e(this,N)}get candidatePathname(){return e(this,E)}get routes(){return e(this,w)}navigationEvent(t){return e(this,x).subscribe(t)}defineRoute(t,s){const i=new nt(t,s);e(this,w).push(i),e(this,D).call(this)}navigate(t,s="push"){return B(this,null,function*(){var u,Q;if(e(this,E)===t||e(this,N)===t)return;Y.active=this,r(this,E,t);const i=e(this,w).filter(c=>c.isActive),f=e(this,w).filter(c=>!i.includes(c)&&c.testPathname(t)),h=i.filter(c=>!c.testPathname(t)),a=i.filter(c=>c.testPathname(t));let d=!0;if(this.preprocessor)try{yield new Promise((c,L)=>{var V;(V=this.preprocessor)==null||V.call(this,{pathname:t,resolve:c,reject:L})})}catch(c){c?console.error(c):console.log("Route change canceled"),d=!1}if(d&&e(this,E)===t){r(this,C,a[a.length-1]),h.forEach(L=>{L.close()}),r(this,N,t);try{for(var T=G(f),at,ct,lt;at=!(ct=yield T.next()).done;at=!1){const L=ct.value;yield L.render(((u=e(this,C))==null?void 0:u.outlet)||e(this,k),t),r(this,C,L)}}catch(ct){lt=[ct]}finally{try{at&&(ct=T.return)&&(yield ct.call(T))}finally{if(lt)throw lt[0]}}const c=e(this,q)+t+location.search;s==="push"?history.pushState(c,"",c):s==="replace"&&history.replaceState(c,"",c),F(this,K,tt).call(this),(Q=this.postprocessor)==null||Q.call(this,{pathname:t}),e(this,x).notify({pathname:t})}})}};k=new WeakMap,q=new WeakMap,w=new WeakMap,C=new WeakMap,M=new WeakMap,E=new WeakMap,N=new WeakMap,x=new WeakMap,D=new WeakMap,K=new WeakSet,tt=function(){const t=e(this,w).filter(i=>i.isActive),s=Array.from(new Set([...e(this,k).querySelectorAll("a"),...t.map(i=>i.getAnchorElements()).flat()].filter(i=>{var f;return(f=i.getAttribute("href"))==null?void 0:f.startsWith("/")})));e(this,M).forEach(i=>{i.destroy()}),r(this,M,s.map(i=>new rt(this,i)))},W=new WeakMap;let J=Y;exports.Router=J;