aptechka 0.45.1 → 0.46.0

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 M=s=>{throw TypeError(s)};var p=(s,i,t)=>i.has(s)||M("Cannot "+t);var e=(s,i,t)=>(p(s,i,"read from private field"),t?t.call(s):i.get(s)),n=(s,i,t)=>i.has(s)?M("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(s):i.set(s,t),c=(s,i,t,r)=>(p(s,i,"write to private field"),r?r.call(s,t):i.set(s,t),t),m=(s,i,t)=>(p(s,i,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("../attribute/index.cjs"),z=require("../index-Cqw2NKev.cjs"),H=require("../events-KVanG9sR.cjs"),R=require("../style-At6aDoqG.cjs");var d,h,f,l,E,u,o,N,w,y,L,b,k;class S{constructor(i,t){n(this,o);n(this,d,null);n(this,h,null);n(this,f,null);n(this,l,null);n(this,E);n(this,u,!1);n(this,y,()=>{e(this,u)?this.close():this.open()});n(this,L,()=>{e(this,u)&&(m(this,o,b).call(this,0,!0),m(this,o,b).call(this,e(this,o,w)))});t.firstElementChild instanceof HTMLElement&&t.lastElementChild instanceof HTMLElement?(c(this,d,i),c(this,h,t),c(this,f,t.firstElementChild),c(this,l,t.lastElementChild),e(this,l).style.overflow="hidden",e(this,d).axisAttribute.current==="y"?e(this,l).style.height="0px":e(this,l).style.width="0px",addEventListener("resize",e(this,L)),e(this,f).addEventListener("click",e(this,y)),e(this,h).hasAttribute("data-opened")&&this.open({skipTransition:!0})):i.removeItem(e(this,h))}get element(){return e(this,h)}destroy(){e(this,f)&&(e(this,h).classList.remove("opened","triggered"),e(this,h).removeAttribute("data-opened"),e(this,f).style.cursor="",m(this,o,b).call(this,void 0),removeEventListener("resize",e(this,L)),e(this,f).removeEventListener("click",e(this,y)),clearTimeout(e(this,E)))}open(i){i!=null&&i.skipTransition&&m(this,o,k).call(this),e(this,d).multipleAttribute.current||e(this,d).closeAll({exclude:e(this,h)}),c(this,u,!0),clearTimeout(e(this,E)),e(this,h).classList.add("triggered"),m(this,o,b).call(this,e(this,o,w)),setTimeout(()=>{e(this,h).classList.add("opened"),e(this,h).setAttribute("data-opened","")},0),H.dispatchEvent(this.element,"accordionItemToggle",{bubbles:!0,composed:!0,detail:{opened:e(this,u)}})}close(i){i!=null&&i.skipTransition&&m(this,o,k).call(this),c(this,u,!1),e(this,h).classList.remove("opened"),m(this,o,b).call(this,0),c(this,E,setTimeout(()=>{e(this,h).classList.remove("triggered")},R.getElementTransitionDurationMS(e(this,l)))),H.dispatchEvent(this.element,"accordionItemToggle",{bubbles:!0,composed:!0,detail:{opened:e(this,u)}})}}d=new WeakMap,h=new WeakMap,f=new WeakMap,l=new WeakMap,E=new WeakMap,u=new WeakMap,o=new WeakSet,N=function(){return e(this,h).parentElement||e(this,h).getRootNode()},w=function(){return e(this,d).axisAttribute.current==="x"?e(this,l).scrollWidth:e(this,l).scrollHeight},y=new WeakMap,L=new WeakMap,b=function(i,t=!1){t&&(e(this,l).style.transition="all 0s",setTimeout(()=>{e(this,l).style.transition=""}));const r=e(this,d).axisAttribute.current==="x"?"width":"height";i!=null?e(this,l).style[r]=`${i}px`:e(this,l).style[r]=""},k=function(){e(this,l).style.transition="all 0s",setTimeout(()=>{e(this,l).style.transition=""},50)};var v,g,a,T,x,I;class q extends HTMLElement{constructor(){super();n(this,x);n(this,v,new C.Attribute(this,"axis","y"));n(this,g,new C.Attribute(this,"multiple",!1));n(this,a,[]);n(this,T,null);z.isBrowser&&c(this,T,new MutationObserver(t=>{t.forEach(r=>{r.removedNodes.forEach(A=>{A instanceof HTMLElement&&this.removeItem(A)}),r.addedNodes.forEach(A=>{A instanceof HTMLElement&&this.createItem(A)})})}))}get axisAttribute(){return e(this,v)}get multipleAttribute(){return e(this,g)}createItem(t){e(this,a).find(r=>r.element===t)||e(this,a).push(new S(this,t))}removeItem(t){c(this,a,e(this,a).filter(r=>{if(r.element!==t)return!0;r.destroy()}))}closeAll(t){e(this,a).forEach(r=>{(t==null?void 0:t.exclude)!==r.element&&r.close(t)})}openAll(t){e(this,a).forEach(r=>{(t==null?void 0:t.exclude)!==r.element&&r.open(t)})}connectedCallback(){e(this,v).observe(),e(this,g).observe(),e(this,T).observe(e(this,x,I),{childList:!0}),c(this,a,[...e(this,x,I).children].map(t=>{if(t instanceof HTMLElement)return new S(this,t)}).filter(t=>!!t))}disconnectedCallback(){e(this,v).unobserve(),e(this,g).unobserve(),e(this,T).disconnect()}}v=new WeakMap,g=new WeakMap,a=new WeakMap,T=new WeakMap,x=new WeakSet,I=function(){return this.shadowRoot?this.shadowRoot:this};z.isBrowser&&!customElements.get("e-accordion")&&customElements.define("e-accordion",q);exports.AccordionElement=q;
1
+ "use strict";var M=s=>{throw TypeError(s)};var p=(s,i,t)=>i.has(s)||M("Cannot "+t);var e=(s,i,t)=>(p(s,i,"read from private field"),t?t.call(s):i.get(s)),l=(s,i,t)=>i.has(s)?M("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(s):i.set(s,t),c=(s,i,t,r)=>(p(s,i,"write to private field"),r?r.call(s,t):i.set(s,t),t),m=(s,i,t)=>(p(s,i,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("../attribute/index.cjs"),z=require("../index-Cqw2NKev.cjs"),H=require("../events-KVanG9sR.cjs"),O=require("../style-At6aDoqG.cjs");var d,n,f,h,v,u,o,w,y,L,b,k;class S{constructor(i,t){l(this,o);l(this,d,null);l(this,n,null);l(this,f,null);l(this,h,null);l(this,v);l(this,u,!1);l(this,y,()=>{e(this,u)?this.close():this.open()});l(this,L,()=>{e(this,u)&&(m(this,o,b).call(this,0,!0),m(this,o,b).call(this,e(this,o,w)))});t.firstElementChild instanceof HTMLElement&&t.lastElementChild instanceof HTMLElement?(c(this,d,i),c(this,n,t),c(this,f,t.firstElementChild),c(this,h,t.lastElementChild),e(this,h).style.overflow="hidden",e(this,d).axisAttribute.current==="y"?e(this,h).style.height="0px":e(this,h).style.width="0px",addEventListener("resize",e(this,L)),e(this,f).addEventListener("click",e(this,y)),e(this,n).hasAttribute("data-opened")&&this.open({skipTransition:!0})):i.removeItem(e(this,n))}get element(){return e(this,n)}destroy(){e(this,f)&&(e(this,n).classList.remove("opened","triggered"),e(this,n).removeAttribute("data-opened"),e(this,f).style.cursor="",m(this,o,b).call(this,void 0),removeEventListener("resize",e(this,L)),e(this,f).removeEventListener("click",e(this,y)),clearTimeout(e(this,v)))}open(i){i!=null&&i.skipTransition&&m(this,o,k).call(this),e(this,d).multipleAttribute.current||e(this,d).closeAll({exclude:e(this,n)}),c(this,u,!0),clearTimeout(e(this,v)),e(this,n).classList.add("triggered"),m(this,o,b).call(this,e(this,o,w)),setTimeout(()=>{e(this,n).classList.add("opened"),e(this,n).setAttribute("data-opened","")},0),H.dispatchEvent(this.element,"accordionItemToggle",{bubbles:!0,composed:!0,detail:{opened:e(this,u)}})}close(i){i!=null&&i.skipTransition&&m(this,o,k).call(this),c(this,u,!1),e(this,n).classList.remove("opened"),m(this,o,b).call(this,0),c(this,v,setTimeout(()=>{e(this,n).classList.remove("triggered")},O.getElementTransitionDurationMS(e(this,h)))),H.dispatchEvent(this.element,"accordionItemToggle",{bubbles:!0,composed:!0,detail:{opened:e(this,u)}})}}d=new WeakMap,n=new WeakMap,f=new WeakMap,h=new WeakMap,v=new WeakMap,u=new WeakMap,o=new WeakSet,w=function(){return e(this,d).axisAttribute.current==="x"?e(this,h).scrollWidth:e(this,h).scrollHeight},y=new WeakMap,L=new WeakMap,b=function(i,t=!1){t&&(e(this,h).style.transition="all 0s",setTimeout(()=>{e(this,h).style.transition=""}));const r=e(this,d).axisAttribute.current==="x"?"width":"height";i!=null?e(this,h).style[r]=`${i}px`:e(this,h).style[r]=""},k=function(){e(this,h).style.transition="all 0s",setTimeout(()=>{e(this,h).style.transition=""},50)};var E,g,a,T,x,I;class q extends HTMLElement{constructor(){super();l(this,x);l(this,E,new C.Attribute(this,"axis","y"));l(this,g,new C.Attribute(this,"multiple",!1));l(this,a,[]);l(this,T,null);z.isBrowser&&c(this,T,new MutationObserver(t=>{t.forEach(r=>{r.removedNodes.forEach(A=>{A instanceof HTMLElement&&this.removeItem(A)}),r.addedNodes.forEach(A=>{A instanceof HTMLElement&&this.createItem(A)})})}))}get axisAttribute(){return e(this,E)}get multipleAttribute(){return e(this,g)}createItem(t){e(this,a).find(r=>r.element===t)||e(this,a).push(new S(this,t))}removeItem(t){c(this,a,e(this,a).filter(r=>{if(r.element!==t)return!0;r.destroy()}))}closeAll(t){e(this,a).forEach(r=>{(t==null?void 0:t.exclude)!==r.element&&r.close(t)})}openAll(t){e(this,a).forEach(r=>{(t==null?void 0:t.exclude)!==r.element&&r.open(t)})}connectedCallback(){e(this,E).observe(),e(this,g).observe(),e(this,T).observe(e(this,x,I),{childList:!0}),c(this,a,[...e(this,x,I).children].map(t=>{if(t instanceof HTMLElement)return new S(this,t)}).filter(t=>!!t))}disconnectedCallback(){e(this,E).unobserve(),e(this,g).unobserve(),e(this,T).disconnect()}}E=new WeakMap,g=new WeakMap,a=new WeakMap,T=new WeakMap,x=new WeakSet,I=function(){return this.shadowRoot?this.shadowRoot:this};z.isBrowser&&!customElements.get("e-accordion")&&customElements.define("e-accordion",q);exports.AccordionElement=q;
@@ -2,38 +2,38 @@ var M = (s) => {
2
2
  throw TypeError(s);
3
3
  };
4
4
  var y = (s, i, t) => i.has(s) || M("Cannot " + t);
5
- var e = (s, i, t) => (y(s, i, "read from private field"), t ? t.call(s) : i.get(s)), n = (s, i, t) => i.has(s) ? M("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(s) : i.set(s, t), a = (s, i, t, r) => (y(s, i, "write to private field"), r ? r.call(s, t) : i.set(s, t), t), m = (s, i, t) => (y(s, i, "access private method"), t);
5
+ var e = (s, i, t) => (y(s, i, "read from private field"), t ? t.call(s) : i.get(s)), l = (s, i, t) => i.has(s) ? M("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(s) : i.set(s, t), a = (s, i, t, r) => (y(s, i, "write to private field"), r ? r.call(s, t) : i.set(s, t), t), m = (s, i, t) => (y(s, i, "access private method"), t);
6
6
  import { Attribute as C } from "../attribute/index.js";
7
- import { i as R } from "../index-euf5anj6.js";
7
+ import { i as S } from "../index-euf5anj6.js";
8
8
  import { d as H } from "../events-CsVF98U6.js";
9
- import { g as S } from "../style-j2TwriJ_.js";
10
- var d, h, f, l, E, u, o, N, w, L, A, b, k;
9
+ import { g as R } from "../style-j2TwriJ_.js";
10
+ var d, n, f, h, E, u, o, w, L, A, b, k;
11
11
  class z {
12
12
  constructor(i, t) {
13
- n(this, o);
14
- n(this, d, null);
15
- n(this, h, null);
16
- n(this, f, null);
17
- n(this, l, null);
18
- n(this, E);
19
- n(this, u, !1);
20
- n(this, L, () => {
13
+ l(this, o);
14
+ l(this, d, null);
15
+ l(this, n, null);
16
+ l(this, f, null);
17
+ l(this, h, null);
18
+ l(this, E);
19
+ l(this, u, !1);
20
+ l(this, L, () => {
21
21
  e(this, u) ? this.close() : this.open();
22
22
  });
23
- n(this, A, () => {
23
+ l(this, A, () => {
24
24
  e(this, u) && (m(this, o, b).call(this, 0, !0), m(this, o, b).call(this, e(this, o, w)));
25
25
  });
26
- t.firstElementChild instanceof HTMLElement && t.lastElementChild instanceof HTMLElement ? (a(this, d, i), a(this, h, t), a(this, f, t.firstElementChild), a(this, l, t.lastElementChild), e(this, l).style.overflow = "hidden", e(this, d).axisAttribute.current === "y" ? e(this, l).style.height = "0px" : e(this, l).style.width = "0px", addEventListener("resize", e(this, A)), e(this, f).addEventListener("click", e(this, L)), e(this, h).hasAttribute("data-opened") && this.open({ skipTransition: !0 })) : i.removeItem(e(this, h));
26
+ t.firstElementChild instanceof HTMLElement && t.lastElementChild instanceof HTMLElement ? (a(this, d, i), a(this, n, t), a(this, f, t.firstElementChild), a(this, h, t.lastElementChild), e(this, h).style.overflow = "hidden", e(this, d).axisAttribute.current === "y" ? e(this, h).style.height = "0px" : e(this, h).style.width = "0px", addEventListener("resize", e(this, A)), e(this, f).addEventListener("click", e(this, L)), e(this, n).hasAttribute("data-opened") && this.open({ skipTransition: !0 })) : i.removeItem(e(this, n));
27
27
  }
28
28
  get element() {
29
- return e(this, h);
29
+ return e(this, n);
30
30
  }
31
31
  destroy() {
32
- e(this, f) && (e(this, h).classList.remove("opened", "triggered"), e(this, h).removeAttribute("data-opened"), e(this, f).style.cursor = "", m(this, o, b).call(this, void 0), removeEventListener("resize", e(this, A)), e(this, f).removeEventListener("click", e(this, L)), clearTimeout(e(this, E)));
32
+ e(this, f) && (e(this, n).classList.remove("opened", "triggered"), e(this, n).removeAttribute("data-opened"), e(this, f).style.cursor = "", m(this, o, b).call(this, void 0), removeEventListener("resize", e(this, A)), e(this, f).removeEventListener("click", e(this, L)), clearTimeout(e(this, E)));
33
33
  }
34
34
  open(i) {
35
- i != null && i.skipTransition && m(this, o, k).call(this), e(this, d).multipleAttribute.current || e(this, d).closeAll({ exclude: e(this, h) }), a(this, u, !0), clearTimeout(e(this, E)), e(this, h).classList.add("triggered"), m(this, o, b).call(this, e(this, o, w)), setTimeout(() => {
36
- e(this, h).classList.add("opened"), e(this, h).setAttribute("data-opened", "");
35
+ i != null && i.skipTransition && m(this, o, k).call(this), e(this, d).multipleAttribute.current || e(this, d).closeAll({ exclude: e(this, n) }), a(this, u, !0), clearTimeout(e(this, E)), e(this, n).classList.add("triggered"), m(this, o, b).call(this, e(this, o, w)), setTimeout(() => {
36
+ e(this, n).classList.add("opened"), e(this, n).setAttribute("data-opened", "");
37
37
  }, 0), H(this.element, "accordionItemToggle", {
38
38
  bubbles: !0,
39
39
  composed: !0,
@@ -43,9 +43,9 @@ class z {
43
43
  });
44
44
  }
45
45
  close(i) {
46
- i != null && i.skipTransition && m(this, o, k).call(this), a(this, u, !1), e(this, h).classList.remove("opened"), m(this, o, b).call(this, 0), a(this, E, setTimeout(() => {
47
- e(this, h).classList.remove("triggered");
48
- }, S(e(this, l)))), H(this.element, "accordionItemToggle", {
46
+ i != null && i.skipTransition && m(this, o, k).call(this), a(this, u, !1), e(this, n).classList.remove("opened"), m(this, o, b).call(this, 0), a(this, E, setTimeout(() => {
47
+ e(this, n).classList.remove("triggered");
48
+ }, R(e(this, h)))), H(this.element, "accordionItemToggle", {
49
49
  bubbles: !0,
50
50
  composed: !0,
51
51
  detail: {
@@ -54,31 +54,29 @@ class z {
54
54
  });
55
55
  }
56
56
  }
57
- d = new WeakMap(), h = new WeakMap(), f = new WeakMap(), l = new WeakMap(), E = new WeakMap(), u = new WeakMap(), o = new WeakSet(), N = function() {
58
- return e(this, h).parentElement || e(this, h).getRootNode();
59
- }, w = function() {
60
- return e(this, d).axisAttribute.current === "x" ? e(this, l).scrollWidth : e(this, l).scrollHeight;
57
+ d = new WeakMap(), n = new WeakMap(), f = new WeakMap(), h = new WeakMap(), E = new WeakMap(), u = new WeakMap(), o = new WeakSet(), w = function() {
58
+ return e(this, d).axisAttribute.current === "x" ? e(this, h).scrollWidth : e(this, h).scrollHeight;
61
59
  }, L = new WeakMap(), A = new WeakMap(), b = function(i, t = !1) {
62
- t && (e(this, l).style.transition = "all 0s", setTimeout(() => {
63
- e(this, l).style.transition = "";
60
+ t && (e(this, h).style.transition = "all 0s", setTimeout(() => {
61
+ e(this, h).style.transition = "";
64
62
  }));
65
63
  const r = e(this, d).axisAttribute.current === "x" ? "width" : "height";
66
- i != null ? e(this, l).style[r] = `${i}px` : e(this, l).style[r] = "";
64
+ i != null ? e(this, h).style[r] = `${i}px` : e(this, h).style[r] = "";
67
65
  }, k = function() {
68
- e(this, l).style.transition = "all 0s", setTimeout(() => {
69
- e(this, l).style.transition = "";
66
+ e(this, h).style.transition = "all 0s", setTimeout(() => {
67
+ e(this, h).style.transition = "";
70
68
  }, 50);
71
69
  };
72
70
  var v, g, c, T, x, I;
73
- class O extends HTMLElement {
71
+ class N extends HTMLElement {
74
72
  constructor() {
75
73
  super();
76
- n(this, x);
77
- n(this, v, new C(this, "axis", "y"));
78
- n(this, g, new C(this, "multiple", !1));
79
- n(this, c, []);
80
- n(this, T, null);
81
- R && a(this, T, new MutationObserver((t) => {
74
+ l(this, x);
75
+ l(this, v, new C(this, "axis", "y"));
76
+ l(this, g, new C(this, "multiple", !1));
77
+ l(this, c, []);
78
+ l(this, T, null);
79
+ S && a(this, T, new MutationObserver((t) => {
82
80
  t.forEach((r) => {
83
81
  r.removedNodes.forEach((p) => {
84
82
  p instanceof HTMLElement && this.removeItem(p);
@@ -129,7 +127,7 @@ class O extends HTMLElement {
129
127
  v = new WeakMap(), g = new WeakMap(), c = new WeakMap(), T = new WeakMap(), x = new WeakSet(), I = function() {
130
128
  return this.shadowRoot ? this.shadowRoot : this;
131
129
  };
132
- R && !customElements.get("e-accordion") && customElements.define("e-accordion", O);
130
+ S && !customElements.get("e-accordion") && customElements.define("e-accordion", N);
133
131
  export {
134
- O as AccordionElement
132
+ N as AccordionElement
135
133
  };
@@ -1 +1 @@
1
- "use strict";var ft=(i,t)=>(t=Symbol[i])?t:Symbol.for("Symbol."+i),pt=i=>{throw TypeError(i)};var $=(i,t,s)=>t.has(i)||pt("Cannot "+s);var e=(i,t,s)=>($(i,t,"read from private field"),s?s.call(i):t.get(i)),o=(i,t,s)=>t.has(i)?pt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),a=(i,t,s,r)=>($(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s),d=(i,t,s)=>($(i,t,"access private method"),s);var M=(i,t,s)=>new Promise((r,u)=>{var m=l=>{try{A(s.next(l))}catch(g){u(g)}},V=l=>{try{A(s.throw(l))}catch(g){u(g)}},A=l=>l.done?r(l.value):Promise.resolve(l.value).then(m,V);A((s=s.apply(i,t)).next())});var Et=(i,t,s)=>(t=i[ft("asyncIterator")])?t.call(i):(i=i[ft("iterator")](),t={},s=(r,u)=>(u=i[r])&&(t[r]=m=>new Promise((V,A,l)=>(m=u.call(i,m),l=m.done,Promise.resolve(m.value).then(g=>V({value:g,done:l}),A)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const St=require("../index-Cqw2NKev.cjs"),J=require("../events-KVanG9sR.cjs"),Tt=require("../polyfills-Df4r-ETT.cjs"),Ct=require("../scroll-DPDSZypW.cjs"),Q=require("../url-CLvdjbII.cjs"),Ht=require("../css-value-parser/index.cjs");class yt extends HTMLElement{connectedCallback(){const t={"aria-live":"assertive","aria-atomic":"true",style:"position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"};for(const[s,r]of Object.entries(t))this.setAttribute(s,r)}}St.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",yt);var R,h,T,O,q;class gt{constructor(t,s){o(this,R);o(this,h);o(this,T);o(this,O,t=>{t.preventDefault();const s=e(this,h).getAttribute("data-history-action")||"push",r=e(this,h).hasAttribute("data-center-scroll"),u=getComputedStyle(e(this,h)).getPropertyValue("--offset-scroll").trim(),m=u?Ht.cssValueParser.parse(u):void 0,V=e(this,h).hasAttribute("data-revalidate");e(this,R).navigate(e(this,T),{historyAction:s,centerScroll:r,offsetScroll:m,revalidate:V})});o(this,q,()=>{e(this,R).prefetch(e(this,T)),e(this,h).removeEventListener("pointerenter",e(this,q))});a(this,R,s),a(this,h,t),a(this,T,e(this,h).getAttribute("href")||"/"),e(this,h).addEventListener("click",e(this,O));const r=s.normalizePath(e(this,T)),u=s.normalizePath(location.pathname);e(this,h).hasAttribute("data-include")&&u.pathname.includes(r.pathname)?e(this,h).classList.add("current"):r.pathname===u.pathname&&e(this,h).classList.add("current"),e(this,h).hasAttribute("data-prefetch")&&e(this,h).addEventListener("pointerenter",e(this,q))}get element(){return e(this,h)}destroy(){e(this,h).removeEventListener("click",e(this,O)),e(this,h).removeEventListener("pointerenter",e(this,q)),e(this,h).classList.remove("current")}}R=new WeakMap,h=new WeakMap,T=new WeakMap,O=new WeakMap,q=new WeakMap;var C,z,p,H,k,w;class vt{constructor(t,s,r){o(this,C);o(this,z);o(this,p,{x:0,y:0});o(this,H);o(this,k,null);o(this,w,null);a(this,C,t),a(this,z,s),a(this,H,r.cloneNode(!0))}get pathname(){return e(this,z)}get scrollState(){return e(this,p)}get document(){return e(this,w)}cloneDocument(){a(this,w,(e(this,k)||e(this,H)).cloneNode(!0))}get title(){let t="";if(e(this,w).title)t=e(this,w).title;else{const s=e(this,w).querySelector("h1");t=(s==null?void 0:s.innerText)||(s==null?void 0:s.textContent)||e(this,z)}return t}clearScrollState(){e(this,p).x=0,e(this,p).y=0}clearDocumentState(){a(this,k,null)}saveScrollState(){e(this,H).documentElement.hasAttribute("data-no-scroll-restoration")?(e(this,p).x=0,e(this,p).y=0):(e(this,p).x=e(this,C).scrollElement.scrollLeft,e(this,p).y=e(this,C).scrollElement.scrollTop)}saveDocumentState(){e(this,H).documentElement.hasAttribute("data-no-page-restoration")?a(this,k,null):a(this,k,document.cloneNode(!0))}restoreScrollPosition(){e(this,C).scrollElement.scroll({top:e(this,p).y,left:e(this,p).x})}}C=new WeakMap,z=new WeakMap,p=new WeakMap,H=new WeakMap,k=new WeakMap,w=new WeakMap;var b,W,v,U,P,f,j,x,N,F,I,D,c,tt,et,st,Lt,it,nt,rt,X;class kt{constructor(t){o(this,c);o(this,b,null);o(this,W,null);o(this,v,[]);o(this,U,new DOMParser);o(this,P);o(this,f,null);o(this,j);o(this,x,[]);o(this,N,!1);o(this,F,null);o(this,I,new Map);o(this,D,null);o(this,X,t=>M(this,null,function*(){var s;(s=t.state)!=null&&s.path&&(a(this,N,!0),yield this.navigate(t.state.path,{historyAction:"none"}),a(this,N,!1))}));if(St.isBrowser){a(this,b,{base:Q.normalizeBase(t==null?void 0:t.base),waitForHeadToLoad:(t==null?void 0:t.waitForHeadToLoad)!==!1,cachePages:(t==null?void 0:t.cachePages)!==!1,trailingSlash:(t==null?void 0:t.trailingSlash)||!1,scrollSelector:(t==null?void 0:t.scrollSelector)||"body"}),a(this,W,d(this,c,st).call(this,document.body));const s=this.normalizePath(location.pathname+location.hash);a(this,f,s.pathname),e(this,I).set(e(this,f),new vt(this,e(this,f),document)),document.documentElement.setAttribute("data-current-pathname",e(this,f)),document.documentElement.setAttribute("data-current-leaf",s.leaf),this.findLinks(),addEventListener("popstate",e(this,X)),Q.changeHistory({action:"replace",pathname:e(this,f),searchParameters:s.parameters,hash:s.hash}),a(this,D,new yt),d(this,c,rt).call(this)}}get currentPathname(){return e(this,f)}get previousPathname(){return e(this,j)}get links(){return e(this,v)}get scrollElement(){return e(this,F)}normalizePath(t){return Q.splitPath(t,{base:e(this,b).base,trailingSlash:e(this,b).trailingSlash})}prefetch(t){return M(this,null,function*(){const s=this.normalizePath(t);d(this,c,et).call(this,s.pathname)})}navigate(V){return M(this,arguments,function*(t,{historyAction:s="push",centerScroll:r,offsetScroll:u,revalidate:m}={}){if(e(this,x).length)return;const A=this.normalizePath(t);let{pathname:l,hash:g,parameters:wt,leaf:bt}=A;if(!(e(this,P)===l||e(this,f)===l)){a(this,P,l);try{let _=!0;if(this.preprocessor)try{yield new Promise((n,y)=>{var L;(L=this.preprocessor)==null||L.call(this,{pathname:l,resolve:n,reject:y})})}catch(n){n?console.error(n):console.log("Route change canceled"),_=!1}if(!_||e(this,P)!==l)return;const ot=yield d(this,c,tt).call(this,e(this,f)),S=yield d(this,c,tt).call(this,l,m);if(e(this,P)!==l)return;ot.saveScrollState(),ot.saveDocumentState(),e(this,N)||(S.clearScrollState(),S.clearDocumentState()),S.cloneDocument(),e(this,D).textContent=S.title,document.body.appendChild(e(this,D));const at={pathname:l};J.dispatchEvent(document,"morphStart",{detail:at});const lt=Array.from(document.head.children),ct=Array.from(S.document.head.children),ht=d(this,c,Lt).call(this,lt,ct),Pt=d(this,c,it).call(this,lt,ht),K=d(this,c,it).call(this,ct,ht);K.forEach((n,y)=>{if(n.tagName==="SCRIPT"&&n.getAttribute("src")){const L=document.createElement("script");L.type="module",L.src=n.getAttribute("src"),K[y]=L}}),K.forEach(n=>{document.head.appendChild(n)});const Z=K.filter(n=>{if(n.hasAttribute("data-no-waiting"))return!1;if(d(this,c,nt).call(this,n))return!0});e(this,b).waitForHeadToLoad&&Z.length&&(yield new Promise(n=>M(this,null,function*(){let y=0;try{for(var L=Et(Z),dt,B,mt;dt=!(B=yield L.next()).done;dt=!1){const Y=B.value;Y.onload=()=>{y++,y===Z.length&&n()}}}catch(B){mt=[B]}finally{try{dt&&(B=L.return)&&(yield B.call(L))}finally{if(mt)throw mt[0]}}})));const ut=[];Pt.forEach(n=>{n.hasAttribute("data-permanent")||(d(this,c,nt).call(this,n)?ut.push(n):n.remove())});const At=d(this,c,st).call(this,S.document.body);if(e(this,W).forEach((n,y)=>{const L=At[y],dt=getComputedStyle(n).getPropertyValue("--morph-duration"),B=[...L.childNodes];if(dt){const mt=[...n.childNodes];mt.forEach(E=>{E instanceof HTMLElement&&E.classList.add("old")}),B.forEach(E=>{E instanceof HTMLElement&&E.classList.add("new")}),n.prepend(...B),Tt.requestIdleCallback(()=>{B.forEach(E=>{E instanceof HTMLElement&&E.classList.add("in")})});const Y={morphElement:n,pathname:l};J.dispatchEvent(document,"morphNewChildrenAdded",{detail:Y});const Mt=new Promise(E=>{setTimeout(()=>{mt.forEach(G=>G.remove()),B.forEach(G=>{G instanceof HTMLElement&&G.classList.remove("in","new")}),J.dispatchEvent(document,"morphOldChildrenRemoved",{detail:Y}),E()},(parseFloat(dt)||0)*1e3+10)});e(this,x).push(Mt)}else n.innerHTML="",n.append(...B)}),d(this,c,rt).call(this),g){S.clearScrollState();const n=document.getElementById(g);n instanceof HTMLElement&&Ct.scrollToElement(n,{scrollElement:e(this,F),behaviour:"instant",center:r,offset:u})}else e(this,N)&&S.restoreScrollPosition();yield Promise.all(e(this,x)),ut.forEach(n=>n.remove()),a(this,j,e(this,f)),a(this,f,l),a(this,x,[]),this.findLinks(),document.documentElement.setAttribute("data-current-pathname",l),document.documentElement.setAttribute("data-current-leaf",bt),e(this,D).remove(),Q.changeHistory({action:s,pathname:l,searchParameters:wt,hash:g}),J.dispatchEvent(document,"morphComplete",{detail:at})}catch(_){console.error(_)}a(this,P,void 0)}})}addLink(t){e(this,v).push(new gt(t,this))}addLinks(t){t.forEach(s=>{this.addLink(s)})}removeLink(t){a(this,v,e(this,v).filter(s=>s.element===t?(s.destroy(),!1):!0))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(s=>{var r;return((r=s.getAttribute("href"))==null?void 0:r.startsWith("/"))&&!s.hasAttribute("download")&&!s.hasAttribute("data-morph-skip")&&!s.closest("[data-morph-skip]")});e(this,v).forEach(s=>s.destroy()),a(this,v,t.map(s=>new gt(s,this)))}}b=new WeakMap,W=new WeakMap,v=new WeakMap,U=new WeakMap,P=new WeakMap,f=new WeakMap,j=new WeakMap,x=new WeakMap,N=new WeakMap,F=new WeakMap,I=new WeakMap,D=new WeakMap,c=new WeakSet,tt=function(t,s=!1){return M(this,null,function*(){let r=e(this,I).get(t);return(!r||s)&&(r=yield d(this,c,et).call(this,t)),r})},et=function(t){return M(this,null,function*(){const r=yield(yield fetch(t)).text(),u=e(this,U).parseFromString(r,"text/html"),m=new vt(this,t,u);return e(this,I).set(t,m),m})},st=function(t){const s=[...t.querySelectorAll("[data-morph]")];return s.length?s:[t]},Lt=function(t,s){return t.filter(r=>s.find(u=>u.outerHTML===r.outerHTML))},it=function(t,s){return t.filter(r=>!s.find(u=>u.outerHTML===r.outerHTML))},nt=function(t){return t.tagName==="SCRIPT"||t.tagName==="STYLE"||t.tagName==="LINK"&&t.getAttribute("rel")==="stylesheet"},rt=function(){a(this,F,document.querySelector(e(this,b).scrollSelector)||document.documentElement)},X=new WeakMap;exports.Morph=kt;
1
+ "use strict";var ft=(i,t)=>(t=Symbol[i])?t:Symbol.for("Symbol."+i),pt=i=>{throw TypeError(i)};var $=(i,t,s)=>t.has(i)||pt("Cannot "+s);var e=(i,t,s)=>($(i,t,"read from private field"),s?s.call(i):t.get(i)),o=(i,t,s)=>t.has(i)?pt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),a=(i,t,s,r)=>($(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s),d=(i,t,s)=>($(i,t,"access private method"),s);var M=(i,t,s)=>new Promise((r,u)=>{var m=l=>{try{A(s.next(l))}catch(g){u(g)}},V=l=>{try{A(s.throw(l))}catch(g){u(g)}},A=l=>l.done?r(l.value):Promise.resolve(l.value).then(m,V);A((s=s.apply(i,t)).next())});var Et=(i,t,s)=>(t=i[ft("asyncIterator")])?t.call(i):(i=i[ft("iterator")](),t={},s=(r,u)=>(u=i[r])&&(t[r]=m=>new Promise((V,A,l)=>(m=u.call(i,m),l=m.done,Promise.resolve(m.value).then(g=>V({value:g,done:l}),A)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const St=require("../index-Cqw2NKev.cjs"),J=require("../events-KVanG9sR.cjs"),Tt=require("../polyfills-Df4r-ETT.cjs"),Ct=require("../scroll-DPDSZypW.cjs"),Q=require("../url-CLvdjbII.cjs"),Ht=require("../css-value-parser/index.cjs");class yt extends HTMLElement{connectedCallback(){const t={"aria-live":"assertive","aria-atomic":"true",style:"position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"};for(const[s,r]of Object.entries(t))this.setAttribute(s,r)}}St.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",yt);var R,h,T,O,q;class gt{constructor(t,s){o(this,R);o(this,h);o(this,T);o(this,O,t=>{t.preventDefault();const s=e(this,h).getAttribute("data-history-action")||"push",r=e(this,h).hasAttribute("data-center-scroll"),u=getComputedStyle(e(this,h)).getPropertyValue("--offset-scroll").trim(),m=u?Ht.cssValueParser.parse(u):void 0,V=e(this,h).hasAttribute("data-revalidate");e(this,R).navigate(e(this,T),{historyAction:s,centerScroll:r,offsetScroll:m,revalidate:V})});o(this,q,()=>{e(this,R).prefetch(e(this,T)),e(this,h).removeEventListener("pointerenter",e(this,q))});a(this,R,s),a(this,h,t),a(this,T,e(this,h).getAttribute("href")||"/"),e(this,h).addEventListener("click",e(this,O));const r=s.normalizePath(e(this,T)),u=s.normalizePath(location.pathname);e(this,h).hasAttribute("data-include")&&u.pathname.includes(r.pathname)?e(this,h).classList.add("current"):r.pathname===u.pathname&&e(this,h).classList.add("current"),e(this,h).hasAttribute("data-prefetch")&&e(this,h).addEventListener("pointerenter",e(this,q))}get element(){return e(this,h)}destroy(){e(this,h).removeEventListener("click",e(this,O)),e(this,h).removeEventListener("pointerenter",e(this,q)),e(this,h).classList.remove("current")}}R=new WeakMap,h=new WeakMap,T=new WeakMap,O=new WeakMap,q=new WeakMap;var C,z,p,H,k,w;class vt{constructor(t,s,r){o(this,C);o(this,z);o(this,p,{x:0,y:0});o(this,H);o(this,k,null);o(this,w,null);a(this,C,t),a(this,z,s),a(this,H,r.cloneNode(!0))}get pathname(){return e(this,z)}get scrollState(){return e(this,p)}get document(){return e(this,w)}cloneDocument(){a(this,w,(e(this,k)||e(this,H)).cloneNode(!0))}get title(){let t="";if(e(this,w).title)t=e(this,w).title;else{const s=e(this,w).querySelector("h1");t=(s==null?void 0:s.innerText)||(s==null?void 0:s.textContent)||e(this,z)}return t}clearScrollState(){e(this,p).x=0,e(this,p).y=0}clearDocumentState(){a(this,k,null)}saveScrollState(){e(this,H).documentElement.hasAttribute("data-no-scroll-restoration")?(e(this,p).x=0,e(this,p).y=0):(e(this,p).x=e(this,C).scrollElement.scrollLeft,e(this,p).y=e(this,C).scrollElement.scrollTop)}saveDocumentState(){e(this,H).documentElement.hasAttribute("data-no-page-restoration")?a(this,k,null):a(this,k,document.cloneNode(!0))}restoreScrollPosition(){e(this,C).scrollElement.scroll({top:e(this,p).y,left:e(this,p).x})}}C=new WeakMap,z=new WeakMap,p=new WeakMap,H=new WeakMap,k=new WeakMap,w=new WeakMap;var b,W,S,U,P,f,j,x,N,F,I,D,c,tt,et,st,Lt,it,nt,rt,X;class kt{constructor(t){o(this,c);o(this,b,null);o(this,W,null);o(this,S,[]);o(this,U,new DOMParser);o(this,P);o(this,f,null);o(this,j);o(this,x,[]);o(this,N,!1);o(this,F,null);o(this,I,new Map);o(this,D,null);o(this,X,t=>M(this,null,function*(){var s;(s=t.state)!=null&&s.path&&(a(this,N,!0),yield this.navigate(t.state.path,{historyAction:"none"}),a(this,N,!1))}));if(St.isBrowser){a(this,b,{base:Q.normalizeBase(t==null?void 0:t.base),waitForHeadToLoad:(t==null?void 0:t.waitForHeadToLoad)!==!1,cachePages:(t==null?void 0:t.cachePages)!==!1,trailingSlash:(t==null?void 0:t.trailingSlash)||!1,scrollSelector:(t==null?void 0:t.scrollSelector)||"body"}),a(this,W,d(this,c,st).call(this,document.body));const s=this.normalizePath(location.pathname+location.hash);a(this,f,s.pathname),e(this,I).set(e(this,f),new vt(this,e(this,f),document)),document.documentElement.setAttribute("data-current-pathname",e(this,f)),document.documentElement.setAttribute("data-current-leaf",s.leaf),this.findLinks(),addEventListener("popstate",e(this,X)),Q.changeHistory({action:"replace",pathname:e(this,f),searchParameters:s.parameters,hash:s.hash}),a(this,D,new yt),d(this,c,rt).call(this,document)}}get currentPathname(){return e(this,f)}get previousPathname(){return e(this,j)}get links(){return e(this,S)}get scrollElement(){return e(this,F)}normalizePath(t){return Q.splitPath(t,{base:e(this,b).base,trailingSlash:e(this,b).trailingSlash})}prefetch(t){return M(this,null,function*(){const s=this.normalizePath(t);d(this,c,et).call(this,s.pathname)})}navigate(V){return M(this,arguments,function*(t,{historyAction:s="push",centerScroll:r,offsetScroll:u,revalidate:m}={}){if(e(this,x).length)return;const A=this.normalizePath(t);let{pathname:l,hash:g,parameters:wt,leaf:bt}=A;if(!(e(this,P)===l||e(this,f)===l)){a(this,P,l);try{let _=!0;if(this.preprocessor)try{yield new Promise((n,y)=>{var L;(L=this.preprocessor)==null||L.call(this,{pathname:l,resolve:n,reject:y})})}catch(n){n?console.error(n):console.log("Route change canceled"),_=!1}if(!_||e(this,P)!==l)return;const ot=yield d(this,c,tt).call(this,e(this,f)),v=yield d(this,c,tt).call(this,l,m);if(e(this,P)!==l)return;ot.saveScrollState(),ot.saveDocumentState(),e(this,N)||(v.clearScrollState(),v.clearDocumentState()),v.cloneDocument(),e(this,D).textContent=v.title,document.body.appendChild(e(this,D));const at={pathname:l};J.dispatchEvent(document,"morphStart",{detail:at});const lt=Array.from(document.head.children),ct=Array.from(v.document.head.children),ht=d(this,c,Lt).call(this,lt,ct),Pt=d(this,c,it).call(this,lt,ht),K=d(this,c,it).call(this,ct,ht);K.forEach((n,y)=>{if(n.tagName==="SCRIPT"&&n.getAttribute("src")){const L=document.createElement("script");L.type="module",L.src=n.getAttribute("src"),K[y]=L}}),K.forEach(n=>{document.head.appendChild(n)});const Z=K.filter(n=>{if(n.hasAttribute("data-no-waiting"))return!1;if(d(this,c,nt).call(this,n))return!0});e(this,b).waitForHeadToLoad&&Z.length&&(yield new Promise(n=>M(this,null,function*(){let y=0;try{for(var L=Et(Z),dt,B,mt;dt=!(B=yield L.next()).done;dt=!1){const Y=B.value;Y.onload=()=>{y++,y===Z.length&&n()}}}catch(B){mt=[B]}finally{try{dt&&(B=L.return)&&(yield B.call(L))}finally{if(mt)throw mt[0]}}})));const ut=[];Pt.forEach(n=>{n.hasAttribute("data-permanent")||(d(this,c,nt).call(this,n)?ut.push(n):n.remove())});const At=d(this,c,st).call(this,v.document.body);if(d(this,c,rt).call(this,v.document),document.documentElement.setAttribute("data-current-pathname",l),document.documentElement.setAttribute("data-current-leaf",bt),Q.changeHistory({action:s,pathname:l,searchParameters:wt,hash:g}),e(this,D).remove(),a(this,j,e(this,f)),a(this,f,l),e(this,W).forEach((n,y)=>{const L=At[y],dt=getComputedStyle(n).getPropertyValue("--morph-duration"),B=[...L.childNodes];if(dt){const mt=[...n.childNodes];mt.forEach(E=>{E instanceof HTMLElement&&E.classList.add("old")}),B.forEach(E=>{E instanceof HTMLElement&&E.classList.add("new")}),n.prepend(...B),Tt.requestIdleCallback(()=>{B.forEach(E=>{E instanceof HTMLElement&&E.classList.add("in")})});const Y={morphElement:n,pathname:l};J.dispatchEvent(document,"morphNewChildrenAdded",{detail:Y});const Mt=new Promise(E=>{setTimeout(()=>{mt.forEach(G=>G.remove()),B.forEach(G=>{G instanceof HTMLElement&&G.classList.remove("in","new")}),J.dispatchEvent(document,"morphOldChildrenRemoved",{detail:Y}),E()},(parseFloat(dt)||0)*1e3+10)});e(this,x).push(Mt)}else n.innerHTML="",n.append(...B)}),g){v.clearScrollState();const n=document.getElementById(g);n instanceof HTMLElement&&Ct.scrollToElement(n,{scrollElement:e(this,F),behaviour:"instant",center:r,offset:u})}else e(this,N)&&v.restoreScrollPosition();yield Promise.all(e(this,x)),ut.forEach(n=>n.remove()),a(this,x,[]),this.findLinks(),J.dispatchEvent(document,"morphComplete",{detail:at}),window.dispatchEvent(new Event("resize"))}catch(_){console.error(_)}a(this,P,void 0)}})}addLink(t){e(this,S).push(new gt(t,this))}addLinks(t){t.forEach(s=>{this.addLink(s)})}removeLink(t){a(this,S,e(this,S).filter(s=>s.element===t?(s.destroy(),!1):!0))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(s=>{var r;return((r=s.getAttribute("href"))==null?void 0:r.startsWith("/"))&&!s.hasAttribute("download")&&!s.hasAttribute("data-morph-skip")&&!s.closest("[data-morph-skip]")});e(this,S).forEach(s=>s.destroy()),a(this,S,t.map(s=>new gt(s,this)))}}b=new WeakMap,W=new WeakMap,S=new WeakMap,U=new WeakMap,P=new WeakMap,f=new WeakMap,j=new WeakMap,x=new WeakMap,N=new WeakMap,F=new WeakMap,I=new WeakMap,D=new WeakMap,c=new WeakSet,tt=function(t,s=!1){return M(this,null,function*(){let r=e(this,I).get(t);return(!r||s)&&(r=yield d(this,c,et).call(this,t)),r})},et=function(t){return M(this,null,function*(){const r=yield(yield fetch(t)).text(),u=e(this,U).parseFromString(r,"text/html"),m=new vt(this,t,u);return e(this,I).set(t,m),m})},st=function(t){const s=[...t.querySelectorAll("[data-morph]")];return s.length?s:[t]},Lt=function(t,s){return t.filter(r=>s.find(u=>u.outerHTML===r.outerHTML))},it=function(t,s){return t.filter(r=>!s.find(u=>u.outerHTML===r.outerHTML))},nt=function(t){return t.tagName==="SCRIPT"||t.tagName==="STYLE"||t.tagName==="LINK"&&t.getAttribute("rel")==="stylesheet"},rt=function(t){a(this,F,t.querySelector(e(this,b).scrollSelector)||t.documentElement)},X=new WeakMap;exports.Morph=kt;
@@ -71,7 +71,7 @@ class gt {
71
71
  }
72
72
  }
73
73
  R = new WeakMap(), c = new WeakMap(), T = new WeakMap(), O = new WeakMap(), z = new WeakMap();
74
- var C, q, p, H, k, w;
74
+ var C, q, p, H, k, y;
75
75
  class Lt {
76
76
  constructor(t, s, o) {
77
77
  r(this, C);
@@ -79,7 +79,7 @@ class Lt {
79
79
  r(this, p, { x: 0, y: 0 });
80
80
  r(this, H);
81
81
  r(this, k, null);
82
- r(this, w, null);
82
+ r(this, y, null);
83
83
  a(this, C, t), a(this, q, s), a(this, H, o.cloneNode(!0));
84
84
  }
85
85
  get pathname() {
@@ -89,17 +89,17 @@ class Lt {
89
89
  return e(this, p);
90
90
  }
91
91
  get document() {
92
- return e(this, w);
92
+ return e(this, y);
93
93
  }
94
94
  cloneDocument() {
95
- a(this, w, (e(this, k) || e(this, H)).cloneNode(!0));
95
+ a(this, y, (e(this, k) || e(this, H)).cloneNode(!0));
96
96
  }
97
97
  get title() {
98
98
  let t = "";
99
- if (e(this, w).title)
100
- t = e(this, w).title;
99
+ if (e(this, y).title)
100
+ t = e(this, y).title;
101
101
  else {
102
- const s = e(this, w).querySelector("h1");
102
+ const s = e(this, y).querySelector("h1");
103
103
  t = (s == null ? void 0 : s.innerText) || (s == null ? void 0 : s.textContent) || e(this, q);
104
104
  }
105
105
  return t;
@@ -127,14 +127,14 @@ class Lt {
127
127
  });
128
128
  }
129
129
  }
130
- C = new WeakMap(), q = new WeakMap(), p = new WeakMap(), H = new WeakMap(), k = new WeakMap(), w = new WeakMap();
131
- var b, W, L, U, P, f, j, x, N, F, I, D, h, $, tt, et, yt, st, it, nt, X;
130
+ C = new WeakMap(), q = new WeakMap(), p = new WeakMap(), H = new WeakMap(), k = new WeakMap(), y = new WeakMap();
131
+ var b, W, S, U, P, f, j, x, N, F, I, D, h, $, tt, et, wt, st, it, nt, X;
132
132
  class Vt {
133
133
  constructor(t) {
134
134
  r(this, h);
135
135
  r(this, b, null);
136
136
  r(this, W, null);
137
- r(this, L, []);
137
+ r(this, S, []);
138
138
  r(this, U, new DOMParser());
139
139
  r(this, P);
140
140
  r(this, f, null);
@@ -173,7 +173,7 @@ class Vt {
173
173
  pathname: e(this, f),
174
174
  searchParameters: s.parameters,
175
175
  hash: s.hash
176
- }), a(this, D, new vt()), d(this, h, nt).call(this);
176
+ }), a(this, D, new vt()), d(this, h, nt).call(this, document);
177
177
  }
178
178
  }
179
179
  get currentPathname() {
@@ -183,7 +183,7 @@ class Vt {
183
183
  return e(this, j);
184
184
  }
185
185
  get links() {
186
- return e(this, L);
186
+ return e(this, S);
187
187
  }
188
188
  get scrollElement() {
189
189
  return e(this, F);
@@ -210,7 +210,7 @@ class Vt {
210
210
  if (e(this, x).length)
211
211
  return;
212
212
  const A = this.normalizePath(t);
213
- let { pathname: l, hash: g, parameters: wt, leaf: bt } = A;
213
+ let { pathname: l, hash: g, parameters: yt, leaf: bt } = A;
214
214
  if (!(e(this, P) === l || e(this, f) === l)) {
215
215
  a(this, P, l);
216
216
  try {
@@ -218,8 +218,8 @@ class Vt {
218
218
  if (this.preprocessor)
219
219
  try {
220
220
  yield new Promise((n, v) => {
221
- var y;
222
- (y = this.preprocessor) == null || y.call(this, {
221
+ var w;
222
+ (w = this.preprocessor) == null || w.call(this, {
223
223
  pathname: l,
224
224
  resolve: n,
225
225
  reject: v
@@ -230,21 +230,21 @@ class Vt {
230
230
  }
231
231
  if (!K || e(this, P) !== l)
232
232
  return;
233
- const ot = yield d(this, h, $).call(this, e(this, f)), S = yield d(this, h, $).call(this, l, m);
233
+ const ot = yield d(this, h, $).call(this, e(this, f)), L = yield d(this, h, $).call(this, l, m);
234
234
  if (e(this, P) !== l)
235
235
  return;
236
- ot.saveScrollState(), ot.saveDocumentState(), e(this, N) || (S.clearScrollState(), S.clearDocumentState()), S.cloneDocument(), e(this, D).textContent = S.title, document.body.appendChild(e(this, D));
236
+ ot.saveScrollState(), ot.saveDocumentState(), e(this, N) || (L.clearScrollState(), L.clearDocumentState()), L.cloneDocument(), e(this, D).textContent = L.title, document.body.appendChild(e(this, D));
237
237
  const rt = {
238
238
  pathname: l
239
239
  };
240
240
  Q(document, "morphStart", {
241
241
  detail: rt
242
242
  });
243
- const at = Array.from(document.head.children), lt = Array.from(S.document.head.children), ht = d(this, h, yt).call(this, at, lt), Pt = d(this, h, st).call(this, at, ht), Y = d(this, h, st).call(this, lt, ht);
243
+ const at = Array.from(document.head.children), lt = Array.from(L.document.head.children), ht = d(this, h, wt).call(this, at, lt), Pt = d(this, h, st).call(this, at, ht), Y = d(this, h, st).call(this, lt, ht);
244
244
  Y.forEach((n, v) => {
245
245
  if (n.tagName === "SCRIPT" && n.getAttribute("src")) {
246
- const y = document.createElement("script");
247
- y.type = "module", y.src = n.getAttribute("src"), Y[v] = y;
246
+ const w = document.createElement("script");
247
+ w.type = "module", w.src = n.getAttribute("src"), Y[v] = w;
248
248
  }
249
249
  }), Y.forEach((n) => {
250
250
  document.head.appendChild(n);
@@ -258,7 +258,7 @@ class Vt {
258
258
  e(this, b).waitForHeadToLoad && Z.length && (yield new Promise((n) => M(this, null, function* () {
259
259
  let v = 0;
260
260
  try {
261
- for (var y = pt(Z), ut, B, dt; ut = !(B = yield y.next()).done; ut = !1) {
261
+ for (var w = pt(Z), ut, B, dt; ut = !(B = yield w.next()).done; ut = !1) {
262
262
  const G = B.value;
263
263
  G.onload = () => {
264
264
  v++, v === Z.length && n();
@@ -268,7 +268,7 @@ class Vt {
268
268
  dt = [B];
269
269
  } finally {
270
270
  try {
271
- ut && (B = y.return) && (yield B.call(y));
271
+ ut && (B = w.return) && (yield B.call(w));
272
272
  } finally {
273
273
  if (dt)
274
274
  throw dt[0];
@@ -279,9 +279,14 @@ class Vt {
279
279
  Pt.forEach((n) => {
280
280
  n.hasAttribute("data-permanent") || (d(this, h, it).call(this, n) ? ct.push(n) : n.remove());
281
281
  });
282
- const At = d(this, h, et).call(this, S.document.body);
283
- if (e(this, W).forEach((n, v) => {
284
- const y = At[v], ut = getComputedStyle(n).getPropertyValue("--morph-duration"), B = [...y.childNodes];
282
+ const At = d(this, h, et).call(this, L.document.body);
283
+ if (d(this, h, nt).call(this, L.document), document.documentElement.setAttribute("data-current-pathname", l), document.documentElement.setAttribute("data-current-leaf", bt), Et({
284
+ action: s,
285
+ pathname: l,
286
+ searchParameters: yt,
287
+ hash: g
288
+ }), e(this, D).remove(), a(this, j, e(this, f)), a(this, f, l), e(this, W).forEach((n, v) => {
289
+ const w = At[v], ut = getComputedStyle(n).getPropertyValue("--morph-duration"), B = [...w.childNodes];
285
290
  if (ut) {
286
291
  const dt = [...n.childNodes];
287
292
  dt.forEach((E) => {
@@ -312,8 +317,8 @@ class Vt {
312
317
  e(this, x).push(Mt);
313
318
  } else
314
319
  n.innerHTML = "", n.append(...B);
315
- }), d(this, h, nt).call(this), g) {
316
- S.clearScrollState();
320
+ }), g) {
321
+ L.clearScrollState();
317
322
  const n = document.getElementById(g);
318
323
  n instanceof HTMLElement && Ct(n, {
319
324
  scrollElement: e(this, F),
@@ -321,15 +326,10 @@ class Vt {
321
326
  center: o,
322
327
  offset: u
323
328
  });
324
- } else e(this, N) && S.restoreScrollPosition();
325
- yield Promise.all(e(this, x)), ct.forEach((n) => n.remove()), a(this, j, e(this, f)), a(this, f, l), a(this, x, []), this.findLinks(), document.documentElement.setAttribute("data-current-pathname", l), document.documentElement.setAttribute("data-current-leaf", bt), e(this, D).remove(), Et({
326
- action: s,
327
- pathname: l,
328
- searchParameters: wt,
329
- hash: g
330
- }), Q(document, "morphComplete", {
329
+ } else e(this, N) && L.restoreScrollPosition();
330
+ yield Promise.all(e(this, x)), ct.forEach((n) => n.remove()), a(this, x, []), this.findLinks(), Q(document, "morphComplete", {
331
331
  detail: rt
332
- });
332
+ }), window.dispatchEvent(new Event("resize"));
333
333
  } catch (K) {
334
334
  console.error(K);
335
335
  }
@@ -338,7 +338,7 @@ class Vt {
338
338
  });
339
339
  }
340
340
  addLink(t) {
341
- e(this, L).push(new gt(t, this));
341
+ e(this, S).push(new gt(t, this));
342
342
  }
343
343
  addLinks(t) {
344
344
  t.forEach((s) => {
@@ -346,7 +346,7 @@ class Vt {
346
346
  });
347
347
  }
348
348
  removeLink(t) {
349
- a(this, L, e(this, L).filter((s) => s.element === t ? (s.destroy(), !1) : !0));
349
+ a(this, S, e(this, S).filter((s) => s.element === t ? (s.destroy(), !1) : !0));
350
350
  }
351
351
  findLinks() {
352
352
  const t = [
@@ -357,10 +357,10 @@ class Vt {
357
357
  return ((o = s.getAttribute("href")) == null ? void 0 : o.startsWith("/")) && !s.hasAttribute("download") && !s.hasAttribute("data-morph-skip") && !s.closest("[data-morph-skip]");
358
358
  }
359
359
  );
360
- e(this, L).forEach((s) => s.destroy()), a(this, L, t.map((s) => new gt(s, this)));
360
+ e(this, S).forEach((s) => s.destroy()), a(this, S, t.map((s) => new gt(s, this)));
361
361
  }
362
362
  }
363
- b = new WeakMap(), W = new WeakMap(), L = new WeakMap(), U = new WeakMap(), P = new WeakMap(), f = new WeakMap(), j = new WeakMap(), x = new WeakMap(), N = new WeakMap(), F = new WeakMap(), I = new WeakMap(), D = new WeakMap(), h = new WeakSet(), $ = function(t, s = !1) {
363
+ b = new WeakMap(), W = new WeakMap(), S = new WeakMap(), U = new WeakMap(), P = new WeakMap(), f = new WeakMap(), j = new WeakMap(), x = new WeakMap(), N = new WeakMap(), F = new WeakMap(), I = new WeakMap(), D = new WeakMap(), h = new WeakSet(), $ = function(t, s = !1) {
364
364
  return M(this, null, function* () {
365
365
  let o = e(this, I).get(t);
366
366
  return (!o || s) && (o = yield d(this, h, tt).call(this, t)), o;
@@ -373,7 +373,7 @@ b = new WeakMap(), W = new WeakMap(), L = new WeakMap(), U = new WeakMap(), P =
373
373
  }, et = function(t) {
374
374
  const s = [...t.querySelectorAll("[data-morph]")];
375
375
  return s.length ? s : [t];
376
- }, yt = function(t, s) {
376
+ }, wt = function(t, s) {
377
377
  return t.filter(
378
378
  (o) => s.find(
379
379
  (u) => u.outerHTML === o.outerHTML
@@ -387,8 +387,8 @@ b = new WeakMap(), W = new WeakMap(), L = new WeakMap(), U = new WeakMap(), P =
387
387
  );
388
388
  }, it = function(t) {
389
389
  return t.tagName === "SCRIPT" || t.tagName === "STYLE" || t.tagName === "LINK" && t.getAttribute("rel") === "stylesheet";
390
- }, nt = function() {
391
- a(this, F, document.querySelector(e(this, b).scrollSelector) || document.documentElement);
390
+ }, nt = function(t) {
391
+ a(this, F, t.querySelector(e(this, b).scrollSelector) || t.documentElement);
392
392
  }, X = new WeakMap();
393
393
  export {
394
394
  Vt as Morph
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.45.1",
3
+ "version": "0.46.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"