aptechka 0.84.5 → 0.85.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.
Files changed (50) hide show
  1. package/lib/{DerivedArray-BePrxcLC.js → DerivedArray-C1gHUvCT.js} +2 -2
  2. package/lib/{DerivedArray-xYBpcTp8.cjs → DerivedArray-CiMrwSDt.cjs} +1 -1
  3. package/lib/{DragControls-owFuNKoh.js → DragControls-BNaevZBQ.js} +2 -2
  4. package/lib/{LocalLinks-BdqYzt1b.js → LocalLinks-CI-vxMaR.js} +1 -1
  5. package/lib/{Tweened-DabaFaHX.js → Tweened-C1FsHjhN.js} +1 -1
  6. package/lib/animation/index.js +1 -1
  7. package/lib/controls/index.js +1 -1
  8. package/lib/{easings-BSGJFMAo.js → easings-DE1AUrbN.js} +14 -14
  9. package/lib/jsx/h.d.ts +0 -3
  10. package/lib/jsx/hooks/component/useShadow.d.ts +1 -1
  11. package/lib/jsx/index.cjs +1 -1
  12. package/lib/jsx/index.js +12 -9
  13. package/lib/jsx/render.d.ts +1 -1
  14. package/lib/{layout-C26zkY7D.js → layout-BL6AX9-r.js} +3 -3
  15. package/lib/layout-box/index.cjs +1 -1
  16. package/lib/layout-box/index.d.ts +2 -2
  17. package/lib/layout-box/index.js +11 -5
  18. package/lib/local-links/index.js +1 -1
  19. package/lib/morph/index.cjs +1 -1
  20. package/lib/morph/index.js +5 -2
  21. package/lib/{morph-BtgB1YQP.js → morph-BByLJAAh.js} +8 -8
  22. package/lib/need_redo_tweaker/TweakerFolderElement.d.ts +1 -1
  23. package/lib/need_redo_tweaker/index.cjs +2 -2
  24. package/lib/need_redo_tweaker/index.js +4 -8
  25. package/lib/promises-BsIKOEDq.js +13 -0
  26. package/lib/promises-nDm8_iG6.cjs +1 -0
  27. package/lib/{render-LpimRXgl.js → render-DHKcgkoZ.js} +22 -11
  28. package/lib/render-R8P4qkHo.cjs +1 -0
  29. package/lib/router/index.cjs +1 -1
  30. package/lib/router/index.js +2 -2
  31. package/lib/scroll/index.cjs +1 -1
  32. package/lib/scroll/index.js +5 -5
  33. package/lib/scroll-BtUpTUwr.cjs +1 -0
  34. package/lib/{scroll-DoNeuIgT.js → scroll-CHhF7Put.js} +10 -14
  35. package/lib/scroll-kit/index.cjs +1 -1
  36. package/lib/scroll-kit/index.js +23 -5
  37. package/lib/spa/index.js +2 -2
  38. package/lib/store/index.cjs +1 -1
  39. package/lib/store/index.js +1 -1
  40. package/lib/utils/color.d.ts +1 -0
  41. package/lib/utils/index.cjs +1 -1
  42. package/lib/utils/index.d.ts +4 -0
  43. package/lib/utils/index.js +142 -33
  44. package/lib/utils/lang.d.ts +6 -0
  45. package/lib/utils/loading.d.ts +1 -0
  46. package/lib/utils/progress.d.ts +2 -0
  47. package/lib/utils/scroll.d.ts +4 -2
  48. package/package.json +3 -3
  49. package/lib/render-H9BjFLZ3.cjs +0 -1
  50. package/lib/scroll-D2tOpCnP.cjs +0 -1
@@ -7,23 +7,24 @@ import { a as a2, c, f, m } from "../canvas-DsglKco1.js";
7
7
  import { g as g2, n, s } from "../coordinates--JG1U6kQ.js";
8
8
  import { w } from "../custom-elements-HEMuF7yH.js";
9
9
  import { c as c2, h, e, b as b2, f as f2, a as a3, g as g3, i as i2, t, d } from "../dom-D8D-_9ty.js";
10
- import { d as d2, o, g as g4, q, c as c3, j, n as n2, a as a4, h as h2, k, f as f3, p as p2, b as b3, i as i3, m as m2, l } from "../easings-BSGJFMAo.js";
10
+ import { f as f3, p as p2, h as h2, b as b3, d as d2, k, o, a as a4, i as i3, m as m2, g as g4, q, c as c3, j, n as n2, l } from "../easings-DE1AUrbN.js";
11
11
  import { i as i4 } from "../element-DKw5H-Tu.js";
12
12
  import { d as d3 } from "../events-Ds-TuvYW.js";
13
13
  import { c as c4, d as d4 } from "../file-DwQs6bB6.js";
14
14
  import { d as d5, t as t2 } from "../function-UmbPrOHm.js";
15
15
  import { s as s2 } from "../gestures-DmKKNnh4.js";
16
16
  import { c as c5, s as s3 } from "../stylesheet-CBTuup4f.js";
17
- import { g as g5, a as a5, c as c6, b as b4 } from "../layout-C26zkY7D.js";
17
+ import { a as a5, b as b4, c as c6, g as g5 } from "../layout-BL6AX9-r.js";
18
18
  import { e as e2, f as f4, c as c7, d as d6, l as l2, m as m3, r, b as b5, a as a6, s as s4 } from "../math-r8V23YFe.js";
19
19
  import { f as f5 } from "../metadata-BNdkmeeD.js";
20
- import { A, j as j2, d as d7, h as h3, e as e3, g as g6, i as i5, f as f6, b as b6, c as c8, N, a as a7, k as k2, m as m4, p as p3 } from "../morph-BtgB1YQP.js";
20
+ import { A, k as k2, e as e3, i as i5, f as f6, h as h3, j as j2, g as g6, b as b6, c as c8, N, a as a7, d as d7, m as m4, p as p3 } from "../morph-BByLJAAh.js";
21
21
  import { b as b7, l as l3, p as p4, r as r2, t as t3 } from "../number-DiVt2xnh.js";
22
22
  import { c as c9, d as d8, i as i6, b as b8, a as a8, m as m5, e as e4, o as o2, p as p5 } from "../object-CiIdEmJx.js";
23
23
  import { n as n3, r as r3 } from "../polyfills-CG1XJNia.js";
24
- import { s as s5, w as w2 } from "../scroll-DoNeuIgT.js";
25
- import { c as c10, a as a9, b as b9, d as d9, g as g7, i as i7, k as k3, s as s6, t as t4, u } from "../string-B3lm2b7v.js";
26
- import { g as g8, a as a10 } from "../style-DBoQWK0d.js";
24
+ import { w as w2 } from "../promises-BsIKOEDq.js";
25
+ import { g as g7, s as s5 } from "../scroll-CHhF7Put.js";
26
+ import { c as c10, a as a9, b as b9, d as d9, g as g8, i as i7, k as k3, s as s6, t as t4, u } from "../string-B3lm2b7v.js";
27
+ import { g as g9, a as a10 } from "../style-DBoQWK0d.js";
27
28
  import { c as c11, i as i8, a as a11, b as b10, n as n4, p as p6, s as s7, e as e5, d as d10, u as u2 } from "../url-CWCY_qe_.js";
28
29
  function insert(arr, index, ...newItems) {
29
30
  return [...arr.slice(0, index), ...newItems, ...arr.slice(index)];
@@ -93,6 +94,14 @@ function dotPolygonCollision(dot, polygon) {
93
94
  return inside;
94
95
  }
95
96
  __name(dotPolygonCollision, "dotPolygonCollision");
97
+ function rgbToHex(r4, g10, b11) {
98
+ const toHex = /* @__PURE__ */ __name((c12) => {
99
+ const hex = c12.toString(16);
100
+ return hex.length === 1 ? "0" + hex : hex;
101
+ }, "toHex");
102
+ return `#${toHex(r4)}${toHex(g10)}${toHex(b11)}`;
103
+ }
104
+ __name(rgbToHex, "rgbToHex");
96
105
  function getActualValue(rule, name) {
97
106
  const obj = rule.style.getPropertyValue(name);
98
107
  if (obj) {
@@ -131,6 +140,100 @@ function tryCreateHrefFromContact(contact) {
131
140
  return emailRegex.test(contact) ? (href = `mailto:${contact.trim()}`, type = "email") : phoneRegex.test(contact) && (href = `tel:${contact.replace(/[^0-9\\.\\+]+/g, "")}`, type = "phone"), { href, type, contact };
132
141
  }
133
142
  __name(tryCreateHrefFromContact, "tryCreateHrefFromContact");
143
+ function transliterate(text, options = {}) {
144
+ const {
145
+ separator = "-",
146
+ lowercase = !0,
147
+ replaceNumbers = !0,
148
+ maxLength = 60
149
+ } = options, charMap = {
150
+ а: "a",
151
+ б: "b",
152
+ в: "v",
153
+ г: "g",
154
+ д: "d",
155
+ е: "e",
156
+ ё: "e",
157
+ ж: "zh",
158
+ з: "z",
159
+ и: "i",
160
+ й: "j",
161
+ к: "k",
162
+ л: "l",
163
+ м: "m",
164
+ н: "n",
165
+ о: "o",
166
+ п: "p",
167
+ р: "r",
168
+ с: "s",
169
+ т: "t",
170
+ у: "u",
171
+ ф: "f",
172
+ х: "h",
173
+ ц: "c",
174
+ ч: "ch",
175
+ ш: "sh",
176
+ щ: "sh",
177
+ ъ: "",
178
+ ы: "y",
179
+ ь: "",
180
+ э: "e",
181
+ ю: "yu",
182
+ я: "ya"
183
+ };
184
+ let result = text.replace(/[а-яё]/gi, (char) => {
185
+ const lowerChar = char.toLowerCase(), replacement = charMap[lowerChar] || "";
186
+ return char === lowerChar ? replacement : replacement.toUpperCase();
187
+ });
188
+ if (replaceNumbers) {
189
+ const numberMap = {
190
+ 0: "zero",
191
+ 1: "one",
192
+ 2: "two",
193
+ 3: "three",
194
+ 4: "four",
195
+ 5: "five",
196
+ 6: "six",
197
+ 7: "seven",
198
+ 8: "eight",
199
+ 9: "nine"
200
+ };
201
+ result = result.replace(/[0-9]/g, (num) => numberMap[num] || num);
202
+ }
203
+ return lowercase && (result = result.toLowerCase()), result = result.replace(/[^\w\-]+/g, separator).replace(new RegExp(`\\${separator}+`, "g"), separator).replace(new RegExp(`(^\\${separator}|\\${separator}$)`, "g"), ""), maxLength > 0 && result.length > maxLength && (result = result.substring(0, maxLength).replace(new RegExp(`\\${separator}[^\\${separator}]*$`), "")), result;
204
+ }
205
+ __name(transliterate, "transliterate");
206
+ function requestLoadingCallback(event, callback) {
207
+ let idleId;
208
+ const domListener = /* @__PURE__ */ __name(() => {
209
+ window.removeEventListener("DOMContentLoaded", loadListener), callback();
210
+ }, "domListener"), loadListener = /* @__PURE__ */ __name(() => {
211
+ window.removeEventListener("load", loadListener), callback();
212
+ }, "loadListener"), idleListener = /* @__PURE__ */ __name(() => {
213
+ idleId = void 0, callback();
214
+ }, "idleListener"), clear = /* @__PURE__ */ __name(() => {
215
+ window.removeEventListener("DOMContentLoaded", domListener), window.removeEventListener("load", loadListener), idleId && window.cancelIdleCallback && window.cancelIdleCallback(idleId);
216
+ }, "clear");
217
+ return event === "idle" && window.requestIdleCallback ? idleId = window.requestIdleCallback(idleListener, { timeout: 1e4 }) : event === "load" ? document.readyState === "complete" ? loadListener() : window.addEventListener("load", loadListener) : event === "DOMContentLoaded" && window.addEventListener("DOMContentLoaded", domListener), clear;
218
+ }
219
+ __name(requestLoadingCallback, "requestLoadingCallback");
220
+ function setElementsProgress(progress, elements, initialItemsWithFullProgress = 0) {
221
+ const totalItems = elements.length - initialItemsWithFullProgress;
222
+ elements.forEach((el, index) => {
223
+ const offset = index / totalItems - initialItemsWithFullProgress / totalItems, itemProgress = Math.min(
224
+ 1,
225
+ Math.max(0, (progress - offset) * totalItems)
226
+ );
227
+ el.style.setProperty("--item-progress", itemProgress.toString());
228
+ });
229
+ }
230
+ __name(setElementsProgress, "setElementsProgress");
231
+ function setActiveContentClasses(index, elements) {
232
+ elements.forEach((el, i9) => {
233
+ i9 > index ? (el.classList.remove("current", "previous"), el.classList.add("next")) : i9 < index ? (el.classList.remove("current", "next"), el.classList.add("previous")) : (el.classList.remove("previous", "next"), el.classList.add("current"));
234
+ });
235
+ }
236
+ __name(setActiveContentClasses, "setActiveContentClasses");
134
237
  function cloneTemplateContent(templateElement, callback) {
135
238
  if (templateElement) {
136
239
  const element = templateElement.content.cloneNode(!0).firstElementChild;
@@ -178,13 +281,13 @@ function setIntervalOnIntersection(element, delay, callback, options) {
178
281
  __name(setIntervalOnIntersection, "setIntervalOnIntersection");
179
282
  export {
180
283
  A as ACTION_CREATE,
181
- j2 as ACTION_PRESERVE,
182
- d7 as ACTION_REMOVE,
183
- h3 as ACTION_REMOVE_ATTR,
184
- e3 as ACTION_REPLACE,
185
- g6 as ACTION_SET_ATTR,
186
- i5 as ACTION_SKIP,
187
- f6 as ACTION_UPDATE,
284
+ k2 as ACTION_PRESERVE,
285
+ e3 as ACTION_REMOVE,
286
+ i5 as ACTION_REMOVE_ATTR,
287
+ f6 as ACTION_REPLACE,
288
+ h3 as ACTION_SET_ATTR,
289
+ j2 as ACTION_SKIP,
290
+ g6 as ACTION_UPDATE,
188
291
  b6 as NODE_TYPE_COMMENT,
189
292
  c8 as NODE_TYPE_DOCUMENT,
190
293
  N as NODE_TYPE_ELEMENT,
@@ -211,27 +314,27 @@ export {
211
314
  decode,
212
315
  d9 as decodeHtmlEntities,
213
316
  h as deepQuerySelectorAll,
214
- k2 as diff,
317
+ d7 as diff,
215
318
  d3 as dispatchEvent,
216
319
  dotCircleCollision,
217
320
  dotPolygonCollision,
218
321
  dotRectCollision,
219
322
  d4 as downloadURI,
220
- d2 as easeInCubic,
221
- o as easeInExpo,
222
- g4 as easeInOutCubic,
223
- q as easeInOutExpo,
224
- c3 as easeInOutQuad,
225
- j as easeInOutQuart,
226
- n2 as easeInOutQuint,
323
+ f3 as easeInCubic,
324
+ p2 as easeInExpo,
325
+ h2 as easeInOutCubic,
326
+ b3 as easeInOutExpo,
327
+ d2 as easeInOutQuad,
328
+ k as easeInOutQuart,
329
+ o as easeInOutQuint,
227
330
  a4 as easeInQuad,
228
- h2 as easeInQuart,
229
- k as easeInQuint,
230
- f3 as easeOutCubic,
231
- p2 as easeOutExpo,
232
- b3 as easeOutQuad,
233
- i3 as easeOutQuart,
234
- m2 as easeOutQuint,
331
+ i3 as easeInQuart,
332
+ m2 as easeInQuint,
333
+ g4 as easeOutCubic,
334
+ q as easeOutExpo,
335
+ c3 as easeOutQuad,
336
+ j as easeOutQuart,
337
+ n2 as easeOutQuint,
235
338
  encode,
236
339
  e as excludeElements,
237
340
  b2 as findParentElement,
@@ -239,18 +342,19 @@ export {
239
342
  f as fixPosition,
240
343
  formatBytes,
241
344
  f5 as formatMediaDuration,
242
- g7 as generateId,
345
+ g8 as generateId,
243
346
  a3 as getAllParentElements,
244
- g5 as getCumulativeOffsetLeft,
245
- a5 as getCumulativeOffsetTop,
347
+ a5 as getCumulativeOffsetLeft,
348
+ b4 as getCumulativeOffsetTop,
246
349
  c6 as getCumulativePosition,
247
350
  g3 as getElement,
248
351
  g as getElementAttributesAdvanced,
249
- g8 as getElementTransitionDurationMS,
352
+ g9 as getElementTransitionDurationMS,
250
353
  a10 as getElementTransitionDurationS,
251
354
  g2 as getPointerPosition,
252
355
  getRootVariables,
253
- b4 as getStickyOffset,
356
+ g7 as getScrollToElementPosition,
357
+ g5 as getStickyOffset,
254
358
  insert,
255
359
  i2 as intersectElements,
256
360
  i as isBrowser,
@@ -283,12 +387,16 @@ export {
283
387
  p5 as pick,
284
388
  p4 as preciseNumber,
285
389
  r3 as requestIdleCallback,
390
+ requestLoadingCallback,
391
+ rgbToHex,
286
392
  r as round,
287
393
  r2 as roundNumberTo,
288
394
  s as screenToCartesian,
289
395
  s5 as scrollToElement,
290
396
  s7 as searchParamsObjectToString,
291
397
  e5 as searchParamsToObject,
398
+ setActiveContentClasses,
399
+ setElementsProgress,
292
400
  setIntervalOnIntersection,
293
401
  s2 as setupDrag,
294
402
  shiftArray,
@@ -301,6 +409,7 @@ export {
301
409
  t2 as throttle,
302
410
  t4 as toPascalCase,
303
411
  t3 as toStep,
412
+ transliterate,
304
413
  t as traverseNodes,
305
414
  d as traverseShadowRoots,
306
415
  tryCreateHrefFromContact,
@@ -0,0 +1,6 @@
1
+ export declare function transliterate(text: string, options?: {
2
+ separator?: string;
3
+ lowercase?: boolean;
4
+ replaceNumbers?: boolean;
5
+ maxLength?: number;
6
+ }): string;
@@ -0,0 +1 @@
1
+ export declare function requestLoadingCallback(event: 'DOMContentLoaded' | 'load' | 'idle', callback: Function): () => void;
@@ -0,0 +1,2 @@
1
+ export declare function setElementsProgress(progress: number, elements: Array<HTMLElement>, initialItemsWithFullProgress?: number): void;
2
+ export declare function setActiveContentClasses(index: number, elements: Array<HTMLElement>): void;
@@ -1,7 +1,9 @@
1
1
  import { ElementOrSelector } from '.';
2
- export declare function scrollToElement(elementOrSelectorOrNumber: ElementOrSelector<HTMLElement> | number, { behavior, offset, center, scrollElement, }?: {
2
+ export declare function getScrollToElementPosition(): void;
3
+ export declare function scrollToElement(elementOrSelectorOrNumber: ElementOrSelector<HTMLElement> | number, { behavior, offset, center, scrollElement, scrollCallback, }?: {
3
4
  behavior?: ScrollBehavior;
4
- offset?: number | ElementOrSelector<HTMLElement>;
5
+ offset?: number | string | ElementOrSelector<HTMLElement>;
5
6
  center?: boolean;
6
7
  scrollElement?: HTMLElement | Window;
8
+ scrollCallback?: (top: number, behaviour: ScrollBehavior) => void;
7
9
  }): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.84.5",
3
+ "version": "0.85.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"
@@ -466,7 +466,7 @@
466
466
  },
467
467
  "devDependencies": {
468
468
  "@types/node": "^24.3.0",
469
- "@types/three": "^0.179.0",
469
+ "@types/three": "^0.180.0",
470
470
  "astro": "^5.13.5",
471
471
  "csstype": "^3.1.3",
472
472
  "global-jsdom": "^26.0.0",
@@ -479,7 +479,7 @@
479
479
  },
480
480
  "dependencies": {
481
481
  "construct-style-sheets-polyfill": "^3.1.0",
482
- "three": "^0.179.1",
482
+ "three": "^0.180.0",
483
483
  "urlpattern-polyfill": "^10.1.0"
484
484
  },
485
485
  "peerDependencies": {
@@ -1 +0,0 @@
1
- "use strict";var __defProp=Object.defineProperty,__defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __typeError=msg=>{throw TypeError(msg)};var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);const Store=require("./Store-DZnOrofs.cjs"),string=require("./string-CbRNzmd9.cjs"),morph=require("./morph-Buhxq-X0.cjs"),object=require("./object-DTY_W6xG.cjs");require("construct-style-sheets-polyfill");const intersector_index=require("./index-DZ44osDT.cjs"),connector_index=require("./connector/index.cjs"),DerivedArray=require("./DerivedArray-xYBpcTp8.cjs");require("./css-value-parser/index.cjs");require("./window-resizer/index.cjs");require("./element-resizer/index.cjs");const activeComponent={current:null},componentElementLoadingTypes=["idle","load","visible","constructor","connect"];var _loadCallback,_connectCallbacks,_disconnectCallbacks,_loadingType,_idleId,_windowLoadListener,_idleListener,_intersectionListener,_ComponentElement_instances,connect_fn;const _ComponentElement=class _ComponentElement extends HTMLElement{constructor(){super();__privateAdd(this,_ComponentElement_instances);__privateAdd(this,_loadCallback);__privateAdd(this,_connectCallbacks,[]);__privateAdd(this,_disconnectCallbacks,[]);__privateAdd(this,_loadingType,"constructor");__privateAdd(this,_idleId);__privateAdd(this,_windowLoadListener,__name(()=>{window.removeEventListener("load",__privateGet(this,_windowLoadListener)),__privateGet(this,_loadingType)==="load"&&__privateMethod(this,_ComponentElement_instances,connect_fn).call(this)},"#windowLoadListener"));__privateAdd(this,_idleListener,__name(()=>{__privateSet(this,_idleId,void 0),__privateGet(this,_loadingType)==="idle"&&__privateMethod(this,_ComponentElement_instances,connect_fn).call(this)},"#idleListener"));__privateAdd(this,_intersectionListener,__name(entry=>{entry.isIntersecting&&(intersector_index.intersector.unsubscribe(__privateGet(this,_intersectionListener)),__privateGet(this,_loadingType)==="visible"&&__privateMethod(this,_ComponentElement_instances,connect_fn).call(this))},"#intersectionListener"));activeComponent.current=this}addLoadCallback(callback){this.hasAttribute("loading")&&componentElementLoadingTypes.includes(this.getAttribute("loading"))?__privateSet(this,_loadingType,this.getAttribute("loading")):__privateSet(this,_loadingType,"constructor"),__privateSet(this,_loadCallback,callback),__privateGet(this,_loadingType)==="constructor"&&__privateGet(this,_loadCallback).call(this)}addConnectCallback(callback){__privateGet(this,_connectCallbacks).push(callback)}addDisconnectCallback(callback){__privateGet(this,_disconnectCallbacks).push(callback)}connectedCallback(){const windowLoadSetup=__name(()=>{document.readyState==="complete"?__privateGet(this,_windowLoadListener).call(this):window.addEventListener("load",__privateGet(this,_windowLoadListener))},"windowLoadSetup");__privateGet(this,_loadingType)==="connect"||__privateGet(this,_loadingType)==="constructor"?__privateMethod(this,_ComponentElement_instances,connect_fn).call(this):__privateGet(this,_loadingType)==="load"?windowLoadSetup():__privateGet(this,_loadingType)==="idle"?window.requestIdleCallback?__privateSet(this,_idleId,window.requestIdleCallback(__privateGet(this,_idleListener))):windowLoadSetup():__privateGet(this,_loadingType)==="visible"&&intersector_index.intersector.subscribe(this,__privateGet(this,_intersectionListener)),activeComponent.current===this&&(activeComponent.current=null)}disconnectedCallback(){__privateGet(this,_disconnectCallbacks).forEach(callback=>{callback(this)}),__privateSet(this,_connectCallbacks,[]),__privateSet(this,_disconnectCallbacks,[]),activeComponent.current===this&&(activeComponent.current=null),window.removeEventListener("load",__privateGet(this,_windowLoadListener)),window.cancelIdleCallback&&__privateGet(this,_idleId)&&window.cancelIdleCallback(__privateGet(this,_idleId)),intersector_index.intersector.unsubscribe(__privateGet(this,_intersectionListener))}};_loadCallback=new WeakMap,_connectCallbacks=new WeakMap,_disconnectCallbacks=new WeakMap,_loadingType=new WeakMap,_idleId=new WeakMap,_windowLoadListener=new WeakMap,_idleListener=new WeakMap,_intersectionListener=new WeakMap,_ComponentElement_instances=new WeakSet,connect_fn=__name(function(){var _a;activeComponent.current=this,this.querySelectorAll("[data-fallback]").forEach(el=>{el.remove()}),__privateGet(this,_loadingType)!=="constructor"&&((_a=__privateGet(this,_loadCallback))==null||_a.call(this)),__privateGet(this,_connectCallbacks).forEach(callback=>{const unsub=callback(this);unsub&&__privateGet(this,_disconnectCallbacks).push(unsub)}),activeComponent.current===this&&(activeComponent.current=null)},"#connect"),__name(_ComponentElement,"ComponentElement");let ComponentElement=_ComponentElement;function subscribeToStore(element,store,callback){const unsubscribe=store.subscribe(e=>{callback(e)});connector_index.connector.subscribe(element,{disconnectCallback:__name(()=>{unsubscribe()},"disconnectCallback"),maxWaitSec:20,unsubscribeAfterDisconnect:!0})}__name(subscribeToStore,"subscribeToStore");function setClassAttribute(element,classes){classes&&(classes instanceof Store.Store?subscribeToStore(element,classes,e=>{e.previous&&element.classList.remove(e.previous.toString()),e.current&&element.classList.add(e.current.toString())}):typeof classes=="object"&&!Array.isArray(classes)?Object.entries(classes).forEach(([key,value])=>{value instanceof Store.Store?subscribeToStore(element,value,e=>{element.classList.toggle(key,!!e.current)}):value&&element.classList.add(key)}):Array.isArray(classes)?classes.forEach(item=>{typeof item=="string"?element.classList.add(item):setClassAttribute(element,item)}):classes.toString().split(" ").map(v=>element.classList.add(v.trim())))}__name(setClassAttribute,"setClassAttribute");function setStyleAttribute(element,value){value&&(typeof value=="object"?Object.entries(value).forEach(([key,value2])=>{value2 instanceof Store.Store?subscribeToStore(element,value2,e=>{var _a;element.style[key]=(_a=e.current)==null?void 0:_a.toString()}):(typeof value2=="number"||typeof value2=="string"||typeof value2=="boolean")&&(element.style[key]=value2.toString())}):typeof value=="string"&&(element.style=value))}__name(setStyleAttribute,"setStyleAttribute");function setAttribute(element,key,value){key==="ref"&&value?Array.isArray(value)?value.forEach(v=>{typeof v=="object"&&"value"in v&&(v.value=element)}):typeof value=="object"&&"value"in value&&(value.value=element):key==="className"||key==="class"?setClassAttribute(element,value):key==="style"?setStyleAttribute(element,value):key==="setHtml"&&value!=null?element.innerHTML=value:typeof value=="number"?key==="tabIndex"?element.setAttribute("tabindex",value.toString()):setAttribute(element,key,value.toString()):typeof value=="string"?key==="htmlFor"?element.setAttribute("for",value):element.setAttribute(key,value):typeof value=="boolean"?value?element.setAttribute(key,""):element.removeAttribute(key):value instanceof Store.Store&&subscribeToStore(element,value,e=>{key in element?element[key]=e.current:setAttribute(element,key,e.current)})}__name(setAttribute,"setAttribute");function setAttributes(ele,attributes){for(const[key,value]of Object.entries(attributes!=null?attributes:{}))typeof value=="function"&&key.startsWith("on")?ele.addEventListener(string.uncapitalize(key.replace("on","")),value):setAttribute(ele,key,value)}__name(setAttributes,"setAttributes");function createElement(tag,isSVG){return tag==="svg"?document.createElementNS("http://www.w3.org/2000/svg","svg"):isSVG?document.createElementNS("http://www.w3.org/2000/svg",tag):document.createElement(tag)}__name(createElement,"createElement");function filterChildren(children){const filtered=[];return(Array.isArray(children)?children:[children]).forEach(child=>{child!=null&&(typeof child=="number"?filtered.push(child.toString()):Array.isArray(child)?child.forEach(c=>{filtered.push(...filterChildren(c))}):filtered.push(child))}),filtered}__name(filterChildren,"filterChildren");function hydrateTextNode(element,newChild,index){const existingChild=element.childNodes[index];existingChild&&existingChild.nodeType===Node.TEXT_NODE?existingChild.textContent!==String(newChild)&&(console.warn(`Hydration text mismatch: expected "${newChild}", got "${existingChild.textContent}"`),existingChild.textContent=String(newChild)):newChild!=null&&newChild!==""&&element.insertBefore(document.createTextNode(String(newChild)),element.childNodes[index]||null)}__name(hydrateTextNode,"hydrateTextNode");function storeChildren(element,store){const currentChildNodes=[...element.childNodes].filter(node=>node.__storeId===store.id),newChildren=store.current,newChildrenArray=Array.isArray(newChildren)?newChildren:[newChildren],newNodes=[];if(newChildrenArray.forEach(newChild=>{let newNode=null;typeof newChild=="boolean"||typeof newChild=="number"||typeof newChild=="string"?newNode=document.createTextNode(newChild.toString()):newChild instanceof Node&&(newNode=newChild),newNode&&(newNode.__storeId=store.id,newNodes.push(newNode))}),store instanceof DerivedArray.DerivedKeyedArray){const nodesToStay=[];newNodes.forEach((newNode,i)=>{const oldNode=currentChildNodes.find(oldNode2=>oldNode2.__key===newNode.__key);oldNode?oldNode.isEqualNode(newNode)?nodesToStay.push(oldNode):(oldNode.replaceWith(newNode),nodesToStay.push(newNode)):(nodesToStay.push(newNode),element.appendChild(newNode))}),currentChildNodes.forEach(currentNode=>{nodesToStay.includes(currentNode)||currentNode.remove()})}else newNodes.forEach((node,i)=>{var _a;const founded=currentChildNodes[i];if(founded)founded.isEqualNode(node)||(founded.replaceWith(node),currentChildNodes[i]=node);else{const lastChildNode=currentChildNodes[currentChildNodes.length-1];lastChildNode?(_a=lastChildNode.parentNode)==null||_a.insertBefore(node,lastChildNode.nextSibling):element.appendChild(node)}}),currentChildNodes.slice(newNodes.length).forEach(node=>{node.remove()})}__name(storeChildren,"storeChildren");const _Props=class _Props{constructor(tag,attributes,children){this.tag=tag,this.attributes=attributes,this.children=children}};__name(_Props,"Props");let Props=_Props;const _ComponentProps=class _ComponentProps extends Props{};__name(_ComponentProps,"ComponentProps");let ComponentProps=_ComponentProps;const _ElementProps=class _ElementProps extends Props{};__name(_ElementProps,"ElementProps");let ElementProps=_ElementProps;const _HeadProps=class _HeadProps extends Props{};__name(_HeadProps,"HeadProps");let HeadProps=_HeadProps;function appendChildren(element,attributes,children,isSVG=!1){const filteredChildren=filterChildren(children);setAttributes(element,attributes),filteredChildren.forEach((child,index)=>{handleChild(element,child,index,isSVG)})}__name(appendChildren,"appendChildren");function handleChild(element,child,index,isSVG){child instanceof Store.Store?handleStoreChild(element,child):child instanceof ComponentProps?handleComponentProps(element,child):child instanceof ElementProps?handleElementProps(element,child,index,isSVG):child instanceof HeadProps?handleHeadProps(child):handleTextNode(element,child,index)}__name(handleChild,"handleChild");function handleStoreChild(element,child){subscribeToStore(element,child,()=>{storeChildren(element,child)})}__name(handleStoreChild,"handleStoreChild");function handleComponentProps(element,child){child.tag==="shadow"&&element.shadowRoot?appendChildren(element.shadowRoot,child.attributes,child.children):appendChildren(element,child.attributes,child.children)}__name(handleComponentProps,"handleComponentProps");function handleElementProps(element,child,index,isSVG){let childElement=null;if(isHydrating.value){const existingChild=element.children[index];(existingChild==null?void 0:existingChild.nodeName.toLowerCase())===child.tag?(childElement=existingChild,appendChildren(childElement,child.attributes,child.children,isSVG)):(childElement=createElement(child.tag,isSVG),appendChildren(childElement,child.attributes,child.children,isSVG),element.append(childElement))}else childElement=createElement(child.tag,isSVG),appendChildren(childElement,child.attributes,child.children,isSVG),element.append(childElement)}__name(handleElementProps,"handleElementProps");function handleHeadProps(child){const headElement=document.createElement(child.tag);appendChildren(headElement,child.attributes,child.children);const patches=morph.diff(document.head,headElement);morph.patch(document.head,patches)}__name(handleHeadProps,"handleHeadProps");function handleTextNode(element,child,index){isHydrating.value?hydrateTextNode(element,child,index):element.append(child)}__name(handleTextNode,"handleTextNode");function processChildren(attributes,children){let result=children.filter(Boolean).length?children:attributes==null?void 0:attributes.children;return result?result.flat(2):[]}__name(processChildren,"processChildren");function handleStringTag(tag,attributes,children){switch(tag){case"component":case"shadow":return new ComponentProps(tag,attributes,children);case"head":return new HeadProps(tag,attributes,children);default:return new ElementProps(tag,attributes,children)}}__name(handleStringTag,"handleStringTag");function handleFunctionTag(jsxTag,attributes,children){return object.isESClass(jsxTag)?createClassElement(jsxTag,attributes,children):jsxTag===Fragment?Fragment(children):jsxTag.template?jsxTag(__spreadValues({},attributes)):createCustomElement(jsxTag,attributes,children)}__name(handleFunctionTag,"handleFunctionTag");function createClassElement(jsxTag,attributes,children){const element=new jsxTag;return appendChildren(element,attributes,children),element}__name(createClassElement,"createClassElement");function createCustomElement(jsxTag,attributes,children){const name=jsxTag.define||`e-${string.camelToKebab(jsxTag.name)}`,Constructor=getOrDefineCustomElement(name,jsxTag),id=generateElementId(jsxTag.name,attributes),element=getOrCreateElement(name,id,Constructor);return fillComponentElement(element,jsxTag,attributes,children),element}__name(createCustomElement,"createCustomElement");function getOrDefineCustomElement(name,jsxTag){var _a;let Constructor=customElements.get(name);return Constructor||(Constructor=(_a=class extends ComponentElement{constructor(){super()}},__name(_a,"Constructor"),_a.formAssociated=jsxTag.formAssociated,_a),customElements.define(name,Constructor)),Constructor}__name(getOrDefineCustomElement,"getOrDefineCustomElement");function generateElementId(tagName,attributes){if(attributes!=null&&attributes.__hydrationId)return attributes.__hydrationId;const index=(indexMap.get(tagName)||0)+1;return indexMap.set(tagName,index),`${tagName}-${index}`}__name(generateElementId,"generateElementId");function getOrCreateElement(name,id,Constructor){if(isHydrating.value){const selector=`${name}[data-id="${id}"]`,existingElement=document.querySelector(selector);if(existingElement&&existingElement instanceof Constructor)return existingElement}const element=new Constructor;return element.setAttribute("data-id",id),element}__name(getOrCreateElement,"getOrCreateElement");function fillComponentElement(element,jsxTag,attributes,children){const props=__spreadProps(__spreadValues({},attributes),{children}),setHtml=props.setHtml;delete props.setHtml;const result=jsxTag(props);result instanceof ElementProps?appendChildren(element,{setHtml},result):result instanceof ComponentProps&&appendChildren(element,__spreadProps(__spreadValues({},result.attributes),{setHtml}),result.children)}__name(fillComponentElement,"fillComponentElement");const isHydrating={value:!1},indexMap=new Map;function h(jsxTag,attributes,...children){const processedChildren=processChildren(attributes,children),processedAttributes=__spreadValues({},attributes);return delete processedAttributes.children,typeof jsxTag=="string"?handleStringTag(jsxTag,processedAttributes,processedChildren):handleFunctionTag(jsxTag,processedAttributes,processedChildren)}__name(h,"h");function Fragment(children){const fragment=document.createDocumentFragment();return appendChildren(fragment,void 0,children),fragment}__name(Fragment,"Fragment");function render(container,Component,params,children){const element=h(Component,__spreadValues({},params),children);return container.append(element),element}__name(render,"render");function hydrate(Component,params,children){isHydrating.value=!0;const element=h(Component,__spreadValues({},params),children);return isHydrating.value=!1,element}__name(hydrate,"hydrate");exports.Fragment=Fragment;exports.activeComponent=activeComponent;exports.h=h;exports.hydrate=hydrate;exports.indexMap=indexMap;exports.render=render;
@@ -1 +0,0 @@
1
- "use strict";var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});const dom=require("./dom-B40i6NXw.cjs"),layout=require("./layout-CnGLl7oe.cjs");require("construct-style-sheets-polyfill");require("./index-DZ44osDT.cjs");function wait(dur){return new Promise(res=>{setTimeout(()=>{res()},dur)})}__name(wait,"wait");function scrollToElement(elementOrSelectorOrNumber,{behavior="instant",offset=0,center=!1,scrollElement}={}){var _a;let start,centerElement=scrollElement,scrollContainerElement=scrollElement;if(typeof elementOrSelectorOrNumber=="number")start=elementOrSelectorOrNumber;else{const element=dom.getElement(elementOrSelectorOrNumber);element&&(centerElement=element,scrollContainerElement=scrollElement||dom.findScrollParentElement(element),start=layout.getCumulativeOffsetTop(element))}if(centerElement&&scrollContainerElement&&typeof start=="number"){const offsetValue=(typeof offset=="number"?offset:((_a=dom.getElement(offset))==null?void 0:_a.offsetHeight)||0)*-1,height=centerElement instanceof HTMLElement?centerElement.offsetHeight:innerHeight,centerValue=center?innerHeight/2*-1+height/2:0;scrollContainerElement.scroll({top:start+offsetValue+centerValue,behavior})}}__name(scrollToElement,"scrollToElement");exports.scrollToElement=scrollToElement;exports.wait=wait;