@tenuuki/tenuuki-spin 0.0.10 → 0.0.12

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.
@@ -8,15 +8,15 @@ function a() {
8
8
  }
9
9
  a();
10
10
  const o = {}, s = Symbol(), c = "http://www.w3.org/1999/xhtml";
11
- var l = Array.isArray, u = Array.prototype.indexOf, d = Array.prototype.includes, f = Array.from, p = Object.keys, m = Object.defineProperty, h = Object.getOwnPropertyDescriptor, g = Object.getOwnPropertyDescriptors, _ = Object.prototype, v = Array.prototype, y = Object.getPrototypeOf, b = Object.isExtensible;
12
- const x = () => {};
13
- function ee(e) {
11
+ var l = Array.isArray, u = Array.prototype.indexOf, d = Array.prototype.includes, f = Array.from, p = Object.keys, m = Object.defineProperty, h = Object.getOwnPropertyDescriptor, g = Object.getOwnPropertyDescriptors, ee = Object.prototype, _ = Array.prototype, v = Object.getPrototypeOf, te = Object.isExtensible;
12
+ const y = () => {};
13
+ function b(e) {
14
14
  return e();
15
15
  }
16
- function te(e) {
16
+ function ne(e) {
17
17
  for (var t = 0; t < e.length; t++) e[t]();
18
18
  }
19
- function ne() {
19
+ function re() {
20
20
  var e, t;
21
21
  return {
22
22
  promise: new Promise((n, r) => {
@@ -26,42 +26,42 @@ function ne() {
26
26
  reject: t
27
27
  };
28
28
  }
29
- function re(e) {
29
+ function ie(e) {
30
30
  "@babel/helpers - typeof";
31
- return re = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
31
+ return ie = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
32
32
  return typeof e;
33
33
  } : function(e) {
34
34
  return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
35
- }, re(e);
35
+ }, ie(e);
36
36
  }
37
- function ie(e, t) {
38
- if (re(e) != "object" || !e) return e;
37
+ function ae(e, t) {
38
+ if (ie(e) != "object" || !e) return e;
39
39
  var n = e[Symbol.toPrimitive];
40
40
  if (n !== void 0) {
41
41
  var r = n.call(e, t || "default");
42
- if (re(r) != "object") return r;
42
+ if (ie(r) != "object") return r;
43
43
  throw TypeError("@@toPrimitive must return a primitive value.");
44
44
  }
45
45
  return (t === "string" ? String : Number)(e);
46
46
  }
47
- function ae(e) {
48
- var t = ie(e, "string");
49
- return re(t) == "symbol" ? t : t + "";
47
+ function oe(e) {
48
+ var t = ae(e, "string");
49
+ return ie(t) == "symbol" ? t : t + "";
50
50
  }
51
- function S(e, t, n) {
52
- return (t = ae(t)) in e ? Object.defineProperty(e, t, {
51
+ function x(e, t, n) {
52
+ return (t = oe(t)) in e ? Object.defineProperty(e, t, {
53
53
  value: n,
54
54
  enumerable: !0,
55
55
  configurable: !0,
56
56
  writable: !0
57
57
  }) : e[t] = n, e;
58
58
  }
59
- var oe;
60
- const C = 1024, se = 2048, w = 4096, ce = 8192, le = 32768, ue = 65536, de = 1 << 19, fe = 1 << 20, pe = 65536, me = 1 << 21, he = 1 << 23, T = Symbol("$state"), ge = Symbol("legacy props"), _e = Symbol(""), ve = new class extends Error {
59
+ var se;
60
+ const S = 1024, C = 2048, w = 4096, ce = 8192, le = 32768, ue = 65536, de = 1 << 19, fe = 1 << 20, pe = 65536, me = 1 << 21, he = 1 << 23, T = Symbol("$state"), ge = Symbol("legacy props"), _e = Symbol(""), ve = new class extends Error {
61
61
  constructor(...e) {
62
- super(...e), S(this, "name", "StaleReactionError"), S(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
62
+ super(...e), x(this, "name", "StaleReactionError"), x(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
63
63
  }
64
- }(), ye = !!((oe = globalThis.document) != null && oe.contentType) && globalThis.document.contentType.includes("xml");
64
+ }(), ye = !!((se = globalThis.document) != null && se.contentType) && globalThis.document.contentType.includes("xml");
65
65
  function be(e) {
66
66
  throw Error("https://svelte.dev/e/lifecycle_outside_component");
67
67
  }
@@ -168,7 +168,7 @@ function Ge(e) {
168
168
  for (var t = 1; t < arguments.length; t++) {
169
169
  var n = arguments[t] == null ? {} : arguments[t];
170
170
  t % 2 ? We(Object(n), !0).forEach(function(t) {
171
- S(e, t, n[t]);
171
+ x(e, t, n[t]);
172
172
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : We(Object(n)).forEach(function(t) {
173
173
  Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
174
174
  });
@@ -208,7 +208,7 @@ function Ye() {
208
208
  var Xe = [];
209
209
  function Ze() {
210
210
  var e = Xe;
211
- Xe = [], te(e);
211
+ Xe = [], ne(e);
212
212
  }
213
213
  function Qe(e) {
214
214
  if (Xe.length === 0 && !ut) {
@@ -248,13 +248,13 @@ function k(e, t) {
248
248
  e.f = e.f & nt | t;
249
249
  }
250
250
  function rt(e) {
251
- e.f & 512 || e.deps === null ? k(e, C) : k(e, w);
251
+ e.f & 512 || e.deps === null ? k(e, S) : k(e, w);
252
252
  }
253
253
  function it(e) {
254
254
  if (e !== null) for (let t of e) !(t.f & 2) || !(t.f & 65536) || (t.f ^= pe, it(t.deps));
255
255
  }
256
256
  function at(e, t, n) {
257
- e.f & 2048 ? t.add(e) : e.f & 4096 && n.add(e), it(e.deps), k(e, C);
257
+ e.f & 2048 ? t.add(e) : e.f & 4096 && n.add(e), it(e.deps), k(e, S);
258
258
  }
259
259
  function ot(e, t) {
260
260
  if (t.has(e)) throw TypeError("Cannot initialize the same private elements twice on an object");
@@ -281,7 +281,7 @@ var I = [], lt = null;
281
281
  let ut = !1, dt = null;
282
282
  var ft = 1, pt = new WeakMap(), mt = new WeakMap(), ht = new WeakMap(), gt = new WeakMap(), _t = new WeakMap(), vt = new WeakMap(), yt = new WeakMap(), bt = new WeakMap(), xt = new WeakMap(), St = new WeakSet(), Ct = class e {
283
283
  constructor() {
284
- st(this, St), S(this, "id", ft++), S(this, "current", new Map()), S(this, "previous", new Map()), A(this, pt, new Set()), A(this, mt, new Set()), A(this, ht, 0), A(this, gt, 0), A(this, _t, null), A(this, vt, new Set()), A(this, yt, new Set()), A(this, bt, new Map()), S(this, "is_fork", !1), A(this, xt, !1);
284
+ st(this, St), x(this, "id", ft++), x(this, "current", new Map()), x(this, "previous", new Map()), A(this, pt, new Set()), A(this, mt, new Set()), A(this, ht, 0), A(this, gt, 0), A(this, _t, null), A(this, vt, new Set()), A(this, yt, new Set()), A(this, bt, new Map()), x(this, "is_fork", !1), A(this, xt, !1);
285
285
  }
286
286
  skip_effect(e) {
287
287
  M(bt, this).has(e) || M(bt, this).set(e, {
@@ -293,7 +293,7 @@ var ft = 1, pt = new WeakMap(), mt = new WeakMap(), ht = new WeakMap(), gt = new
293
293
  var t = M(bt, this).get(e);
294
294
  if (t) {
295
295
  M(bt, this).delete(e);
296
- for (var n of t.d) k(n, se), Ft(n);
296
+ for (var n of t.d) k(n, C), Ft(n);
297
297
  for (n of t.m) k(n, w), Ft(n);
298
298
  }
299
299
  }
@@ -343,7 +343,7 @@ var ft = 1, pt = new WeakMap(), mt = new WeakMap(), ht = new WeakMap(), gt = new
343
343
  }));
344
344
  }
345
345
  revive() {
346
- for (let e of M(vt, this)) M(yt, this).delete(e), k(e, se), Ft(e);
346
+ for (let e of M(vt, this)) M(yt, this).delete(e), k(e, C), Ft(e);
347
347
  for (let e of M(yt, this)) k(e, w), Ft(e);
348
348
  this.flush();
349
349
  }
@@ -355,7 +355,7 @@ var ft = 1, pt = new WeakMap(), mt = new WeakMap(), ht = new WeakMap(), gt = new
355
355
  }
356
356
  settled() {
357
357
  var e;
358
- return ((e = M(_t, this)) == null ? N(_t, this, ne()) : e).promise;
358
+ return ((e = M(_t, this)) == null ? N(_t, this, re()) : e).promise;
359
359
  }
360
360
  static ensure() {
361
361
  if (P === null) {
@@ -372,11 +372,11 @@ function wt() {
372
372
  return this.is_fork || M(gt, this) > 0;
373
373
  }
374
374
  function Tt(e, t, n) {
375
- e.f ^= C;
375
+ e.f ^= S;
376
376
  for (var r = e.first; r !== null;) {
377
377
  var i = r.f, a = (i & 96) != 0, o = a && (i & 1024) != 0, s = (i & ce) !== 0;
378
378
  if (!(o || M(bt, this).has(r)) && r.fn !== null) {
379
- a ? s || (r.f ^= C) : i & 4 ? t.push(r) : i & 16777224 && s ? n.push(r) : Mr(r) && (Lr(r), i & 16 && (M(yt, this).add(r), s && k(r, se)));
379
+ a ? s || (r.f ^= S) : i & 4 ? t.push(r) : i & 16777224 && s ? n.push(r) : Mr(r) && (Lr(r), i & 16 && (M(yt, this).add(r), s && k(r, C)));
380
380
  var c = r.first;
381
381
  if (c !== null) {
382
382
  r = c;
@@ -486,7 +486,7 @@ function Mt(e) {
486
486
  function Nt(e, t, n, r) {
487
487
  if (!n.has(e) && (n.add(e), e.reactions !== null)) for (let i of e.reactions) {
488
488
  let e = i.f;
489
- e & 2 ? Nt(i, t, n, r) : e & 4194320 && !(e & 2048) && Pt(i, t, r) && (k(i, se), Ft(i));
489
+ e & 2 ? Nt(i, t, n, r) : e & 4194320 && !(e & 2048) && Pt(i, t, r) && (k(i, C), Ft(i));
490
490
  }
491
491
  }
492
492
  function Pt(e, t, n) {
@@ -510,14 +510,14 @@ function Ft(e) {
510
510
  if (dt !== null && t === q && !(e.f & 8)) return;
511
511
  if (r & 96) {
512
512
  if (!(r & 1024)) return;
513
- t.f ^= C;
513
+ t.f ^= S;
514
514
  }
515
515
  }
516
516
  I.push(t);
517
517
  }
518
518
  function It(e, t) {
519
519
  if (!(e.f & 32 && e.f & 1024)) {
520
- e.f & 2048 ? t.d.push(e) : e.f & 4096 && t.m.push(e), k(e, C);
520
+ e.f & 2048 ? t.d.push(e) : e.f & 4096 && t.m.push(e), k(e, S);
521
521
  for (var n = e.first; n !== null;) It(n, t), n = n.next;
522
522
  }
523
523
  }
@@ -538,7 +538,7 @@ function zt(e, t, n, r) {
538
538
  var L = new WeakMap(), Bt = new WeakMap(), Vt = new WeakMap(), Ht = new WeakMap(), R = new WeakMap(), Ut = new WeakMap(), z = new WeakMap(), Wt = new WeakMap(), Gt = new WeakMap(), Kt = new WeakMap(), qt = new WeakMap(), Jt = new WeakMap(), Yt = new WeakMap(), Xt = new WeakMap(), Zt = new WeakMap(), Qt = new WeakMap(), B = new WeakSet(), $t = class {
539
539
  constructor(e, t, n, r) {
540
540
  var i, a;
541
- st(this, B), S(this, "parent", void 0), S(this, "is_pending", !1), S(this, "transform_error", void 0), A(this, L, void 0), A(this, Bt, E ? D : null), A(this, Vt, void 0), A(this, Ht, void 0), A(this, R, void 0), A(this, Ut, null), A(this, z, null), A(this, Wt, null), A(this, Gt, null), A(this, Kt, 0), A(this, qt, 0), A(this, Jt, !1), A(this, Yt, new Set()), A(this, Xt, new Set()), A(this, Zt, null), A(this, Qt, Lt(() => (N(Zt, this, En(M(Kt, this))), () => {
541
+ st(this, B), x(this, "parent", void 0), x(this, "is_pending", !1), x(this, "transform_error", void 0), A(this, L, void 0), A(this, Bt, E ? D : null), A(this, Vt, void 0), A(this, Ht, void 0), A(this, R, void 0), A(this, Ut, null), A(this, z, null), A(this, Wt, null), A(this, Gt, null), A(this, Kt, 0), A(this, qt, 0), A(this, Jt, !1), A(this, Yt, new Set()), A(this, Xt, new Set()), A(this, Zt, null), A(this, Qt, Lt(() => (N(Zt, this, En(M(Kt, this))), () => {
542
542
  N(Zt, this, null);
543
543
  }))), N(L, this, e), N(Vt, this, t), N(Ht, this, (e) => {
544
544
  var t = q;
@@ -656,7 +656,7 @@ function rn() {
656
656
  }
657
657
  function an() {
658
658
  this.is_pending = !1;
659
- for (let e of M(Yt, this)) k(e, se), Ft(e);
659
+ for (let e of M(Yt, this)) k(e, C), Ft(e);
660
660
  for (let e of M(Xt, this)) k(e, w), Ft(e);
661
661
  M(Yt, this).clear(), M(Xt, this).clear();
662
662
  }
@@ -787,7 +787,7 @@ function pn() {
787
787
  };
788
788
  }
789
789
  function mn(e) {
790
- var t = 2 | se, n = W !== null && W.f & 2 ? W : null;
790
+ var t = 2 | C, n = W !== null && W.f & 2 ? W : null;
791
791
  return q !== null && (q.f |= de), {
792
792
  ctx: O,
793
793
  deps: null,
@@ -807,7 +807,7 @@ function hn(e, t, n) {
807
807
  q === null && xe();
808
808
  var r = void 0, i = En(s), a = !W, o = new Map();
809
809
  return or(() => {
810
- var t = ne();
810
+ var t = re();
811
811
  r = t.promise;
812
812
  try {
813
813
  Promise.resolve(e()).then(t.resolve, t.reject).finally(fn);
@@ -874,7 +874,7 @@ function yn(e) {
874
874
  function bn(e) {
875
875
  var t = yn(e);
876
876
  if (!e.equals(t) && (e.wv = jr(), (!(P != null && P.is_fork) || e.deps === null) && (e.v = t, e.deps === null))) {
877
- k(e, C);
877
+ k(e, S);
878
878
  return;
879
879
  }
880
880
  Sr || (F === null ? rt(e) : (Xn() || P != null && P.is_fork) && F.set(e, t));
@@ -883,7 +883,7 @@ function xn(e) {
883
883
  if (e.effects !== null) {
884
884
  for (let r of e.effects) if (r.teardown || r.ac) {
885
885
  var t, n;
886
- (t = r.teardown) == null || t.call(r), (n = r.ac) == null || n.abort(ve), r.teardown = x, r.ac = null, Ir(r, 0), fr(r);
886
+ (t = r.teardown) == null || t.call(r), (n = r.ac) == null || n.abort(ve), r.teardown = y, r.ac = null, Ir(r, 0), fr(r);
887
887
  }
888
888
  }
889
889
  }
@@ -927,7 +927,7 @@ function kn(e, t) {
927
927
  let t = e;
928
928
  e.f & 2048 && yn(t), rt(t);
929
929
  }
930
- e.wv = jr(), Mn(e, se), Ye() && q !== null && q.f & 1024 && !(q.f & 96) && (Z === null ? Er([e]) : Z.push(e)), !r.is_fork && Cn.size > 0 && !Tn && An();
930
+ e.wv = jr(), Mn(e, C), Ye() && q !== null && q.f & 1024 && !(q.f & 96) && (Z === null ? Er([e]) : Z.push(e)), !r.is_fork && Cn.size > 0 && !Tn && An();
931
931
  }
932
932
  return t;
933
933
  }
@@ -944,7 +944,7 @@ function Mn(e, t) {
944
944
  if (n !== null) for (var r = Ye(), i = n.length, a = 0; a < i; a++) {
945
945
  var o = n[a], s = o.f;
946
946
  if (!(!r && o === q)) {
947
- var c = (s & se) === 0;
947
+ var c = (s & C) === 0;
948
948
  if (c && k(o, t), s & 2) {
949
949
  var l = o;
950
950
  F == null || F.delete(l), s & 65536 || (s & 512 && (o.f |= pe), Mn(l, w));
@@ -954,8 +954,8 @@ function Mn(e, t) {
954
954
  }
955
955
  function Nn(e) {
956
956
  if (typeof e != "object" || !e || T in e) return e;
957
- let t = y(e);
958
- if (t !== _ && t !== v) return e;
957
+ let t = v(e);
958
+ if (t !== ee && t !== _) return e;
959
959
  var n = new Map(), r = l(e), i = Dn(0), a = null, o = kr, c = (e) => {
960
960
  if (kr === o) return e();
961
961
  var t = W, n = kr;
@@ -1028,11 +1028,11 @@ function Nn(e) {
1028
1028
  var g = c(() => Nn(o));
1029
1029
  V(u, g);
1030
1030
  }
1031
- var _ = Reflect.getOwnPropertyDescriptor(e, t);
1032
- if (_ != null && _.set && _.set.call(l, o), !d) {
1031
+ var ee = Reflect.getOwnPropertyDescriptor(e, t);
1032
+ if (ee != null && ee.set && ee.set.call(l, o), !d) {
1033
1033
  if (r && typeof t == "string") {
1034
- var v = n.get("length"), y = Number(t);
1035
- Number.isInteger(y) && y >= v.v && V(v, y + 1);
1034
+ var _ = n.get("length"), v = Number(t);
1035
+ Number.isInteger(v) && v >= _.v && V(_, v + 1);
1036
1036
  }
1037
1037
  jn(i);
1038
1038
  }
@@ -1057,7 +1057,7 @@ function Rn() {
1057
1057
  if (Pn === void 0) {
1058
1058
  Pn = window, document, Fn = /Firefox/.test(navigator.userAgent);
1059
1059
  var e = Element.prototype, t = Node.prototype, n = Text.prototype;
1060
- In = h(t, "firstChild").get, Ln = h(t, "nextSibling").get, b(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), b(n) && (n.__t = void 0);
1060
+ In = h(t, "firstChild").get, Ln = h(t, "nextSibling").get, te(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), te(n) && (n.__t = void 0);
1061
1061
  }
1062
1062
  }
1063
1063
  function zn(e = "") {
@@ -1149,7 +1149,7 @@ function Xn() {
1149
1149
  }
1150
1150
  function Zn(e) {
1151
1151
  let t = H(8, null);
1152
- return k(t, C), t.teardown = e, t;
1152
+ return k(t, S), t.teardown = e, t;
1153
1153
  }
1154
1154
  function Qn(e) {
1155
1155
  Jn("$effect");
@@ -1350,7 +1350,7 @@ function Mr(e) {
1350
1350
  var a = n[i];
1351
1351
  if (Mr(a) && bn(a), a.wv > e.wv) return !0;
1352
1352
  }
1353
- t & 512 && F === null && k(e, C);
1353
+ t & 512 && F === null && k(e, S);
1354
1354
  }
1355
1355
  return !1;
1356
1356
  }
@@ -1358,7 +1358,7 @@ function Nr(e, t, n = !0) {
1358
1358
  var r = e.reactions;
1359
1359
  if (r !== null && !(J !== null && d.call(J, e))) for (var i = 0; i < r.length; i++) {
1360
1360
  var a = r[i];
1361
- a.f & 2 ? Nr(a, t, !1) : t === a && (n ? k(a, se) : a.f & 1024 && k(a, w), Ft(a));
1361
+ a.f & 2 ? Nr(a, t, !1) : t === a && (n ? k(a, C) : a.f & 1024 && k(a, w), Ft(a));
1362
1362
  }
1363
1363
  }
1364
1364
  function Pr(e) {
@@ -1414,7 +1414,7 @@ function Ir(e, t) {
1414
1414
  function Lr(e) {
1415
1415
  var t = e.f;
1416
1416
  if (!(t & 16384)) {
1417
- k(e, C);
1417
+ k(e, S);
1418
1418
  var n = q, r = xr;
1419
1419
  q = e, xr = !0;
1420
1420
  try {
@@ -1487,7 +1487,7 @@ function Hr(e, t = new Set()) {
1487
1487
  for (let n in e) try {
1488
1488
  Hr(e[n], t);
1489
1489
  } catch (e) {}
1490
- let n = y(e);
1490
+ let n = v(e);
1491
1491
  if (n !== Object.prototype && n !== Array.prototype && n !== Map.prototype && n !== Set.prototype && n !== Date.prototype) {
1492
1492
  let t = g(n);
1493
1493
  for (let n in t) {
@@ -1545,8 +1545,8 @@ function Yr(e) {
1545
1545
  for (var p, h = []; o !== null;) {
1546
1546
  var g = o.assignedSlot || o.parentNode || o.host || null;
1547
1547
  try {
1548
- var _, v = (_ = o[Ur]) == null ? void 0 : _[i];
1549
- v != null && (!o.disabled || e.target === o) && v.call(o, e);
1548
+ var ee, _ = (ee = o[Ur]) == null ? void 0 : ee[i];
1549
+ _ != null && (!o.disabled || e.target === o) && _.call(o, e);
1550
1550
  } catch (e) {
1551
1551
  p ? h.push(e) : p = e;
1552
1552
  }
@@ -1674,7 +1674,7 @@ function ui(e, t) {
1674
1674
  }
1675
1675
  var di = new WeakMap(), fi = new WeakMap(), $ = new WeakMap(), pi = new WeakMap(), mi = new WeakMap(), hi = new WeakMap(), gi = new WeakMap(), _i = class {
1676
1676
  constructor(e, t = !0) {
1677
- S(this, "anchor", void 0), A(this, di, new Map()), A(this, fi, new Map()), A(this, $, new Map()), A(this, pi, new Set()), A(this, mi, !0), A(this, hi, (e) => {
1677
+ x(this, "anchor", void 0), A(this, di, new Map()), A(this, fi, new Map()), A(this, $, new Map()), A(this, pi, new Set()), A(this, mi, !0), A(this, hi, (e) => {
1678
1678
  if (M(di, this).has(e)) {
1679
1679
  var t = M(di, this).get(e), n = M(fi, this).get(t);
1680
1680
  if (n) vr(n), M(pi, this).delete(t);
@@ -1835,7 +1835,7 @@ function Mi(e) {
1835
1835
  ji.set(t, n = []);
1836
1836
  for (var r, i = e, a = Element.prototype; a !== i;) {
1837
1837
  for (var o in r = g(i), r) r[o].set && n.push(o);
1838
- i = y(i);
1838
+ i = v(i);
1839
1839
  }
1840
1840
  return n;
1841
1841
  }
@@ -1867,7 +1867,7 @@ function Bi() {
1867
1867
  }
1868
1868
  })) : e;
1869
1869
  }
1870
- S(zi, "entries", new WeakMap());
1870
+ x(zi, "entries", new WeakMap());
1871
1871
  function Vi(e, t) {
1872
1872
  return e === t || (e == null ? void 0 : e[T]) === t;
1873
1873
  }
@@ -1898,14 +1898,14 @@ function Ui(e = !1) {
1898
1898
  r = () => Q(i);
1899
1899
  }
1900
1900
  n.b.length && er(() => {
1901
- Wi(t, r), te(n.b);
1901
+ Wi(t, r), ne(n.b);
1902
1902
  }), Qn(() => {
1903
- let e = Br(() => n.m.map(ee));
1903
+ let e = Br(() => n.m.map(b));
1904
1904
  return () => {
1905
1905
  for (let t of e) typeof t == "function" && t();
1906
1906
  };
1907
1907
  }), n.a.length && Qn(() => {
1908
- Wi(t, r), te(n.a);
1908
+ Wi(t, r), ne(n.a);
1909
1909
  });
1910
1910
  }
1911
1911
  function Wi(e, t) {
@@ -1927,31 +1927,31 @@ function qi(e, t, n, r) {
1927
1927
  var f, p, m = T in e || ge in e;
1928
1928
  d = (f = (p = h(e, t)) == null ? void 0 : p.set) == null ? m && t in e ? (n) => e[t] = n : void 0 : f;
1929
1929
  }
1930
- var g, _ = !1;
1931
- o ? [g, _] = Ki(() => e[t]) : g = e[t], g === void 0 && r !== void 0 && (g = u(), d && (a && De(t), d(g)));
1932
- var v = a ? () => {
1930
+ var g, ee = !1;
1931
+ o ? [g, ee] = Ki(() => e[t]) : g = e[t], g === void 0 && r !== void 0 && (g = u(), d && (a && De(t), d(g)));
1932
+ var _ = a ? () => {
1933
1933
  var n = e[t];
1934
1934
  return n === void 0 ? u() : (l = !0, n);
1935
1935
  } : () => {
1936
1936
  var n = e[t];
1937
1937
  return n !== void 0 && (c = void 0), n === void 0 ? c : n;
1938
1938
  };
1939
- if (a && !(n & 4)) return v;
1939
+ if (a && !(n & 4)) return _;
1940
1940
  if (d) {
1941
- var y = e.$$legacy;
1941
+ var v = e.$$legacy;
1942
1942
  return (function(e, t) {
1943
- return arguments.length > 0 ? ((!a || !t || y || _) && d(t ? v() : e), e) : v();
1943
+ return arguments.length > 0 ? ((!a || !t || v || ee) && d(t ? _() : e), e) : _();
1944
1944
  });
1945
1945
  }
1946
- var b = !1, x = (n & 1 ? mn : gn)(() => (b = !1, v()));
1947
- o && Q(x);
1948
- var ee = q;
1946
+ var te = !1, y = (n & 1 ? mn : gn)(() => (te = !1, _()));
1947
+ o && Q(y);
1948
+ var b = q;
1949
1949
  return (function(e, t) {
1950
1950
  if (arguments.length > 0) {
1951
- let n = t ? Q(x) : a && o ? Nn(e) : e;
1952
- return V(x, n), b = !0, c !== void 0 && (c = n), e;
1951
+ let n = t ? Q(y) : a && o ? Nn(e) : e;
1952
+ return V(y, n), te = !0, c !== void 0 && (c = n), e;
1953
1953
  }
1954
- return Sr && b || ee.f & 16384 ? x.v : Q(x);
1954
+ return Sr && te || b.f & 16384 ? y.v : Q(y);
1955
1955
  });
1956
1956
  }
1957
1957
  function Ji(e) {
@@ -2019,7 +2019,7 @@ var Yi = new WeakMap(), Xi = new WeakMap(), Zi = class {
2019
2019
  }, Qi;
2020
2020
  typeof HTMLElement == "function" && (Qi = class extends HTMLElement {
2021
2021
  constructor(e, t, n) {
2022
- super(), S(this, "$$ctor", void 0), S(this, "$$s", void 0), S(this, "$$c", void 0), S(this, "$$cn", !1), S(this, "$$d", {}), S(this, "$$r", !1), S(this, "$$p_d", {}), S(this, "$$l", {}), S(this, "$$l_u", new Map()), S(this, "$$me", void 0), S(this, "$$shadowRoot", null), this.$$ctor = e, this.$$s = t, n && (this.$$shadowRoot = this.attachShadow(n));
2022
+ super(), x(this, "$$ctor", void 0), x(this, "$$s", void 0), x(this, "$$c", void 0), x(this, "$$cn", !1), x(this, "$$d", {}), x(this, "$$r", !1), x(this, "$$p_d", {}), x(this, "$$l", {}), x(this, "$$l_u", new Map()), x(this, "$$me", void 0), x(this, "$$shadowRoot", null), this.$$ctor = e, this.$$s = t, n && (this.$$shadowRoot = this.attachShadow(n));
2023
2023
  }
2024
2024
  addEventListener(e, t, n) {
2025
2025
  if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(t), this.$$c) {
@@ -2149,126 +2149,157 @@ function ta(e, t, n, r, i, a) {
2149
2149
  var na = ti("<img draggable=\"false\"/>"), ra = ti("<p>Loading...</p>"), ia = ti("<div class=\"tenuuki-spin-viewer\"><!></div>");
2150
2150
  function aa(e, t) {
2151
2151
  qe(t, !1);
2152
- let n = On(), r = qi(t, "options", 28, () => ({ images: [] })), i = On(0), a = 0, o = On(), s = On(), c, l = [], u = [], d = 0, f = !1, p = On(!1), m = 0, h = 0, g = 2.5, _ = 0, v = [], y, b = (e, t) => (e % t + t) % t, x = () => {
2152
+ let n = On(), r = qi(t, "options", 28, () => ({ images: [] })), i = On(0), a = 0, o = On(), s = On(), c, l = !1, u = [], d = [], f = 0, p = !1, m = On(!1), h = 0, g = 0, ee = 2.5, _ = 0, v = [], te, y = (e, t) => (e % t + t) % t, b = () => {
2153
2153
  var e;
2154
2154
  return ((e = r()) == null ? void 0 : e.direction) === -1 ? 1 : -1;
2155
- }, ee = () => {
2155
+ }, ne = () => {
2156
2156
  var e, t;
2157
2157
  return Math.min(((e = (t = r()) == null ? void 0 : t.initialFrame) == null ? 1 : e) - 1, r().images.length - 1);
2158
- }, te = (e, t, n) => Array.from({ length: t }, (t, i) => e.replace(`{${r().replacementToken}}`, String(i + 1).padStart(n, "0"))), ne = (e) => {
2159
- u[e] || (u[e] = !0, d++, se());
2160
- };
2161
- function re(e) {
2162
- var t;
2163
- let n = r().images.length;
2164
- if (n === 0) return;
2165
- c && (clearInterval(c), c = void 0), le();
2166
- let o = b(e, n);
2167
- c = setInterval(() => {
2168
- V(i, o), a = o, c && (clearInterval(c), c = void 0);
2169
- }, (t = r().frameInterval) == null ? 60 : t);
2170
- }
2171
- function ie(e, t = 1, n = !0) {
2172
- var o;
2173
- let s = r().images.length;
2174
- if (s === 0) return;
2175
- c && (clearInterval(c), c = void 0), le();
2176
- let l = b(e, s), u = b(Math.floor(a), s), d = x(), f = b(l - u, s), p = b(u - l, s), m = d, h = 0;
2177
- if (n ? f <= p ? (m = 1, h = f) : (m = -1, h = p) : h = (d === 1 ? f : p) + Math.max(0, Math.floor(t)) * s, h === 0) return;
2178
- let g = h;
2179
- c = setInterval(() => {
2180
- if (g <= 0) {
2181
- clearInterval(c), c = void 0;
2158
+ }, re = () => {
2159
+ var e, t;
2160
+ let n = (e = r().frameInterval) == null ? 60 : e, i = Number.isFinite(n) && n > 0 ? n : 60, a = Number((t = r().speedMultiplier) == null ? 1 : t), o = Number.isFinite(a) && a > 0 ? a : 1;
2161
+ return Math.max(1, Math.round(i / o));
2162
+ }, ie = () => {
2163
+ var e;
2164
+ let t = ((e = r().rotationCurve) == null ? "linear" : e).toLowerCase();
2165
+ return t === "standard" || t === "easeinoutquad" ? (e) => e < .5 ? 2 * e * e : 1 - (-2 * e + 2) ** 2 / 2 : (e) => e;
2166
+ }, ae = (e, t, n, r) => {
2167
+ let i = Math.max(1, t), a = 1 / i, o = e % i, s = o / i, c = (o + 1) / i, l = Math.max(1e-4, r(c) - r(s));
2168
+ return Math.max(1, Math.round(a / l * n));
2169
+ }, oe = (e, t, n, r = e) => {
2170
+ if (e <= 0) {
2171
+ n == null || n();
2172
+ return;
2173
+ }
2174
+ let i = re(), a = ie(), o = 0, s = () => {
2175
+ if (o >= e) {
2176
+ c && (clearInterval(c), c = void 0), n == null || n();
2182
2177
  return;
2183
2178
  }
2184
- a = b(a + m, s), V(i, Math.floor(a)), g--;
2185
- }, (o = r().frameInterval) == null ? 60 : o);
2186
- }
2187
- function ae(e = 0) {
2188
- var t;
2189
- c || (c = setInterval(() => {
2190
- let e = r().images.length;
2191
- e !== 0 && (V(i, b(Q(i) + x(), e)), a = Q(i));
2192
- }, (t = r().frameInterval) == null ? 60 : t));
2193
- }
2194
- function S() {
2195
- c && (clearInterval(c), c = void 0);
2179
+ if (t(), o++, o >= e) {
2180
+ c && (clearInterval(c), c = void 0), n == null || n();
2181
+ return;
2182
+ }
2183
+ let l = ae(o, r, i, a);
2184
+ c = setTimeout(s, l);
2185
+ };
2186
+ c = setTimeout(s, ae(0, r, i, a));
2187
+ }, x = (e, t, n) => Array.from({ length: t }, (t, i) => e.replace(`{${r().replacementToken}}`, String(i + 1).padStart(n, "0"))), se = (e) => {
2188
+ d[e] || (d[e] = !0, f++, pe());
2189
+ };
2190
+ function S(e) {
2191
+ let t = r().images.length;
2192
+ if (t === 0) return;
2193
+ c && (clearInterval(c), c = void 0), T();
2194
+ let n = y(e, t);
2195
+ c = setInterval(() => {
2196
+ V(i, n), a = n, c && (clearInterval(c), c = void 0);
2197
+ }, re());
2196
2198
  }
2197
- function oe(e = 1, t = null) {
2198
- var n;
2199
+ function C(e, t = 1, n = !0) {
2199
2200
  let o = r().images.length;
2200
2201
  if (o === 0) return;
2201
- t !== null && (V(i, b(t, o)), a = Q(i));
2202
- let s = Math.max(0, Math.floor(e));
2203
- if (s === 0) return;
2204
- c && clearInterval(c);
2205
- let l = s * o;
2206
- c = setInterval(() => {
2207
- if (l <= 0) {
2208
- clearInterval(c), c = void 0;
2202
+ c && (clearInterval(c), c = void 0), T();
2203
+ let s = y(e, o), l = y(Math.floor(a), o), u = b(), d = y(s - l, o), f = y(l - s, o), p = u, m = 0;
2204
+ n ? d <= f ? (p = 1, m = d) : (p = -1, m = f) : m = (u === 1 ? d : f) + Math.max(0, Math.floor(t)) * o, m !== 0 && oe(m, () => {
2205
+ a = y(a + p, o), V(i, Math.floor(a));
2206
+ }, void 0, Math.min(o, m));
2207
+ }
2208
+ function w(e = 0) {
2209
+ if (c) return;
2210
+ let t = r().images.length;
2211
+ if (t === 0) return;
2212
+ T();
2213
+ let n = b(), o = Math.max(0, Math.floor(e));
2214
+ l = o === 0;
2215
+ let s = o * t, u = re(), d = ie(), f = 0, p = () => {
2216
+ if (!l && f >= s) {
2217
+ c && (clearInterval(c), c = void 0);
2209
2218
  return;
2210
2219
  }
2211
- V(i, b(Q(i) + x(), o)), a = Q(i), l--;
2212
- }, (n = r().frameInterval) == null ? 60 : n);
2220
+ V(i, y(Q(i) + n, t)), a = Q(i), f++;
2221
+ let e = ae(f, t, u, d);
2222
+ c = setTimeout(p, e);
2223
+ };
2224
+ c = setTimeout(p, ae(0, t, u, d));
2225
+ }
2226
+ function ce() {
2227
+ c && (clearInterval(c), c = void 0);
2213
2228
  }
2214
- let C = (e = 10, t = 50) => {
2229
+ function le() {
2230
+ return !!c;
2231
+ }
2232
+ function ue(e, t = 1) {
2233
+ C(e, t, !1);
2234
+ }
2235
+ function de(e = 1, t = null) {
2236
+ let n = r().images.length;
2237
+ if (n === 0) return;
2238
+ t !== null && (V(i, y(t, n)), a = Q(i));
2239
+ let o = Math.max(0, Math.floor(e));
2240
+ o !== 0 && (c && clearInterval(c), oe(o * n, () => {
2241
+ V(i, y(Q(i) + b(), n)), a = Q(i);
2242
+ }));
2243
+ }
2244
+ let fe = (e = 10, t = 50) => {
2215
2245
  let n = 0, i = () => {
2216
2246
  for (let t = n; t < n + e && t < r().images.length; t++) {
2217
2247
  let e = new Image();
2218
- u[t] = !1, e.onload = () => ne(t), e.onerror = () => {
2219
- console.warn(`[TenuukiSpinViewer] Failed to load image ${t}`), ne(t);
2220
- }, e.src = r().images[t], l[t] = e;
2248
+ d[t] = !1, e.onload = () => se(t), e.onerror = () => {
2249
+ console.warn(`[TenuukiSpinViewer] Failed to load image ${t}`), se(t);
2250
+ }, e.src = r().images[t], u[t] = e;
2221
2251
  }
2222
2252
  n += e, n < r().images.length && setTimeout(i, t);
2223
2253
  };
2224
2254
  i();
2225
- }, se = () => {
2226
- if (f || !r().initialSpin) return;
2227
- let e = r().images.length, t = w(), n = ee(), i = !0;
2228
- for (let r = t; r !== b(n + x(), e); r = b(r + x(), e)) if (!u[r]) {
2255
+ }, pe = () => {
2256
+ if (p || !r().initialSpin) return;
2257
+ let e = r().images.length, t = me(), n = ne(), i = !0;
2258
+ for (let r = t; r !== y(n + b(), e); r = y(r + b(), e)) if (!d[r]) {
2229
2259
  i = !1;
2230
2260
  break;
2231
2261
  }
2232
- i && (f = !0, ce());
2233
- }, w = () => {
2262
+ i && (p = !0, he());
2263
+ }, me = () => {
2234
2264
  var e;
2235
2265
  let t = r().images.length;
2236
- return b(ee() - Math.round(((e = r().spinOffset) == null ? 0 : e) % 360 / 360 * t), t);
2237
- }, ce = () => {
2238
- var e;
2266
+ return y(ne() - Math.round(((e = r().spinOffset) == null ? 0 : e) % 360 / 360 * t), t);
2267
+ }, he = () => {
2239
2268
  if (!r().initialSpin) return;
2240
2269
  c && clearInterval(c);
2241
- let t = r().images.length, n = w(), o = ee(), s = x();
2242
- V(i, n), a = n, c = setInterval(() => {
2243
- V(i, b(Q(i) + s, t)), a = Q(i), Q(i) === o && (clearInterval(c), c = void 0);
2244
- }, (e = r().frameInterval) == null ? 60 : e);
2245
- }, le = () => {
2246
- y && cancelAnimationFrame(y), y = void 0, _ = 0;
2247
- }, ue = () => {
2270
+ let e = r().images.length, t = me(), n = ne(), o = b();
2271
+ V(i, t), a = t, oe(y(n - t, e), () => {
2272
+ V(i, y(Q(i) + o, e)), a = Q(i);
2273
+ }, () => {
2274
+ V(i, n), a = n;
2275
+ });
2276
+ }, T = () => {
2277
+ te && cancelAnimationFrame(te), te = void 0, _ = 0;
2278
+ }, ge = () => {
2248
2279
  let e = r().images.length;
2249
2280
  if (e === 0 || Math.abs(_) < .1) return;
2250
2281
  let t = performance.now(), n = (r) => {
2251
2282
  let o = (r - t) / 1e3;
2252
- t = r, a = b(a + _ * o, e), V(i, Math.floor(a)), _ *= .92 ** (o * 60), y = Math.abs(_) >= .01 ? requestAnimationFrame(n) : void 0;
2283
+ t = r, a = y(a + _ * o, e), V(i, Math.floor(a)), _ *= .92 ** (o * 60), te = Math.abs(_) >= .01 ? requestAnimationFrame(n) : void 0;
2253
2284
  };
2254
- y = requestAnimationFrame(n);
2255
- }, de = (e) => r().axis === "y" ? e.clientY : e.clientX, fe = (e) => {
2256
- r().draggable !== !1 && (V(p, !0), m = de(e), h = a, v = [{
2257
- coord: m,
2285
+ te = requestAnimationFrame(n);
2286
+ }, _e = (e) => r().axis === "y" ? e.clientY : e.clientX, ve = (e) => {
2287
+ r().draggable !== !1 && (V(m, !0), h = _e(e), g = a, v = [{
2288
+ coord: h,
2258
2289
  time: performance.now()
2259
- }], c && (clearInterval(c), c = void 0), le(), Q(o) && Q(o).setPointerCapture(e.pointerId), window.addEventListener("pointermove", pe), window.addEventListener("pointerup", me), window.addEventListener("pointercancel", me));
2260
- }, pe = (e) => {
2261
- if (!Q(p)) return;
2262
- let t = r().images.length, n = de(e), o = (n - m) * x();
2263
- a = b(h + o / g, t), V(i, Math.floor(a)), v.push({
2290
+ }], c && (clearInterval(c), c = void 0), T(), Q(o) && Q(o).setPointerCapture(e.pointerId), window.addEventListener("pointermove", ye), window.addEventListener("pointerup", be), window.addEventListener("pointercancel", be));
2291
+ }, ye = (e) => {
2292
+ if (!Q(m)) return;
2293
+ let t = r().images.length, n = _e(e), o = (n - h) * b();
2294
+ a = y(g + o / ee, t), V(i, Math.floor(a)), v.push({
2264
2295
  coord: n,
2265
2296
  time: performance.now()
2266
2297
  }), v.length > 2 && v.shift();
2267
- }, me = (e) => {
2268
- if (Q(p)) {
2269
- if (V(p, !1), window.removeEventListener("pointermove", pe), window.removeEventListener("pointerup", me), window.removeEventListener("pointercancel", me), Q(o) && Q(o).releasePointerCapture(e.pointerId), v.length >= 2) {
2298
+ }, be = (e) => {
2299
+ if (Q(m)) {
2300
+ if (V(m, !1), window.removeEventListener("pointermove", ye), window.removeEventListener("pointerup", be), window.removeEventListener("pointercancel", be), Q(o) && Q(o).releasePointerCapture(e.pointerId), v.length >= 2) {
2270
2301
  let e = v[0], t = v[v.length - 1], n = (t.time - e.time) / 1e3, r = t.coord - e.coord;
2271
- n > 0 && (_ = r / g / n * x(), Math.abs(_) > .1 && ue());
2302
+ n > 0 && (_ = r / ee / n * b(), Math.abs(_) > .1 && ge());
2272
2303
  }
2273
2304
  v = [];
2274
2305
  }
@@ -2279,19 +2310,21 @@ function aa(e, t) {
2279
2310
  let t = Q(s), n = (e = t.closest("tenuuki-spin-viewer")) == null ? t.parentElement : e;
2280
2311
  if (!n) return {};
2281
2312
  let o = n.getAttribute("data-image-base-url"), l = parseInt(n.getAttribute("data-image-count") || "0", 10), u = parseInt(n.getAttribute("data-image-number-padding") || "4", 10);
2282
- return r(r().axis = n.getAttribute("data-axis") === "y" ? "y" : "x", !0), r(r().direction = n.getAttribute("data-direction") === "-1" ? -1 : 1, !0), r(r().draggable = n.getAttribute("data-draggable") !== "false", !0), r(r().initialSpin = n.getAttribute("data-initial-spin") !== "false", !0), r(r().spinOffset = parseInt(n.getAttribute("data-spin-offset") || "0", 10), !0), r(r().initialFrame = parseInt(n.getAttribute("data-initial-frame") || "1", 10), !0), r(r().frameInterval = 60, !0), r(r().replacementToken = n.getAttribute("data-replacement-token") || "frame", !0), o && l > 0 && r(r().images = te(o, l, u), !0), V(i, r().initialSpin ? w() : 0), a = Q(i), C(), () => {
2283
- c && clearInterval(c), le();
2313
+ return r(r().axis = n.getAttribute("data-axis") === "y" ? "y" : "x", !0), r(r().direction = n.getAttribute("data-direction") === "-1" ? -1 : 1, !0), r(r().draggable = n.getAttribute("data-draggable") !== "false", !0), r(r().initialSpin = n.getAttribute("data-initial-spin") !== "false", !0), r(r().spinOffset = parseInt(n.getAttribute("data-spin-offset") || "0", 10), !0), r(r().initialFrame = parseInt(n.getAttribute("data-initial-frame") || "1", 10), !0), r(r().frameInterval = 60, !0), r(r().speedMultiplier = parseFloat(n.getAttribute("data-speed-multiplier") || "1"), !0), r(r().rotationCurve = n.getAttribute("data-easing") || "linear", !0), r(r().replacementToken = n.getAttribute("data-replacement-token") || "frame", !0), o && l > 0 && r(r().images = x(o, l, u), !0), V(i, r().initialSpin ? me() : 0), a = Q(i), fe(), () => {
2314
+ c && clearInterval(c), T();
2284
2315
  };
2285
2316
  }), ir(() => (Vr(r()), Q(i)), () => {
2286
2317
  var e;
2287
2318
  V(n, ((e = r().images) == null ? void 0 : e[Q(i)]) || "");
2288
2319
  }), ar();
2289
- var he = {
2290
- goTo: re,
2291
- spinTo: ie,
2292
- play: ae,
2293
- stop: S,
2294
- replay: oe,
2320
+ var xe = {
2321
+ goTo: S,
2322
+ spinTo: C,
2323
+ play: w,
2324
+ stop: ce,
2325
+ isPlaying: le,
2326
+ spinToStop: ue,
2327
+ replay: de,
2295
2328
  get options() {
2296
2329
  return r();
2297
2330
  },
@@ -2300,27 +2333,29 @@ function aa(e, t) {
2300
2333
  }
2301
2334
  };
2302
2335
  Ui();
2303
- var T = ia(), ge = Hn(T), _e = (e) => {
2336
+ var Se = ia(), Ce = Hn(Se), we = (e) => {
2304
2337
  var t = na();
2305
2338
  Hi(t, (e) => V(o, e), () => Q(o)), cr(() => {
2306
2339
  var e;
2307
2340
  ki(t, "src", Q(n)), ki(t, "alt", `Spinner frame ${(e = Q(i)) == null ? "" : e}`), Ti(t, `
2308
- cursor: ${Q(p) ? "grabbing" : "grab"};
2341
+ cursor: ${Q(m) ? "grabbing" : "grab"};
2309
2342
  user-select: none;
2310
2343
  touch-action: none;
2311
2344
  `);
2312
- }), qr("pointerdown", t, fe), ni(e, t);
2313
- }, ve = (e) => {
2345
+ }), qr("pointerdown", t, ve), ni(e, t);
2346
+ }, Te = (e) => {
2314
2347
  ni(e, ra());
2315
2348
  };
2316
- return bi(ge, (e) => {
2317
- Q(n) ? e(_e) : e(ve, -1);
2318
- }), Le(T), Hi(T, (e) => V(s, e), () => Q(s)), ni(e, T), Ni(t, "goTo", re), Ni(t, "spinTo", ie), Ni(t, "play", ae), Ni(t, "stop", S), Ni(t, "replay", oe), Je(he);
2349
+ return bi(Ce, (e) => {
2350
+ Q(n) ? e(we) : e(Te, -1);
2351
+ }), Le(Se), Hi(Se, (e) => V(s, e), () => Q(s)), ni(e, Se), Ni(t, "goTo", S), Ni(t, "spinTo", C), Ni(t, "play", w), Ni(t, "stop", ce), Ni(t, "isPlaying", le), Ni(t, "spinToStop", ue), Ni(t, "replay", de), Je(xe);
2319
2352
  }
2320
2353
  customElements.define("tenuuki-spin-viewer", ta(aa, { options: {} }, [], [
2321
2354
  "goTo",
2322
2355
  "spinTo",
2323
2356
  "play",
2324
2357
  "stop",
2358
+ "isPlaying",
2359
+ "spinToStop",
2325
2360
  "replay"
2326
2361
  ]));