jaxs 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/jaxs.umd.cjs CHANGED
@@ -1,17 +1,18 @@
1
- ;(function (p, b) {
1
+ ;(function (l, b) {
2
2
  typeof exports == 'object' && typeof module < 'u'
3
3
  ? b(exports)
4
4
  : typeof define == 'function' && define.amd
5
5
  ? define(['exports'], b)
6
- : ((p = typeof globalThis < 'u' ? globalThis : p || self),
7
- b((p.jaxs = {})))
8
- })(this, function (p) {
6
+ : ((l = typeof globalThis < 'u' ? globalThis : l || self),
7
+ b((l.jaxs = {})))
8
+ })(this, function (l) {
9
9
  'use strict'
10
10
  const b = (e, t) => e.reduce((s, r) => (r !== t && s.push(r), s), []),
11
11
  j = (e, t) => e.reduce((s, r) => (t(r) || s.push(r), s), []),
12
12
  O = (e, t, s) => (e.splice(t, 0, s), e),
13
- ht = { remove: b, removeBy: j, insertAt: O }
14
- class dt {
13
+ M = (e, t) => (e.includes(t) || e.push(t), e),
14
+ dt = { remove: b, removeBy: j, insertAt: O, appendIfUnique: M }
15
+ class pt {
15
16
  constructor(t) {
16
17
  this.store = t
17
18
  }
@@ -34,15 +35,23 @@
34
35
  setFalse() {
35
36
  this.update(!1)
36
37
  }
38
+ isTrue() {
39
+ return this.value === !0
40
+ }
41
+ isFalse() {
42
+ return this.value === !1
43
+ }
37
44
  }
38
- const v = (e) => new dt(e),
39
- pt = {
45
+ const v = (e) => new pt(e),
46
+ mt = {
40
47
  toggle: (e) => v(e).toggle(),
41
48
  setTrue: (e) => v(e).setTrue(),
42
49
  setFalse: (e) => v(e).setFalse(),
43
50
  reset: (e) => v(e).reset(),
51
+ isTrue: (e) => v(e).isTrue(),
52
+ isFalse: (e) => v(e).isFalse(),
44
53
  }
45
- class mt {
54
+ class ft {
46
55
  constructor(t) {
47
56
  this.store = t
48
57
  }
@@ -89,9 +98,16 @@
89
98
  const s = j(this.value, t)
90
99
  this.update(s)
91
100
  }
101
+ includes(t) {
102
+ return this.value.includes(t)
103
+ }
104
+ appendIfUnique(t) {
105
+ const s = this.value
106
+ M(s, t), this.update(s)
107
+ }
92
108
  }
93
- const f = (e) => new mt(e),
94
- ft = {
109
+ const f = (e) => new ft(e),
110
+ bt = {
95
111
  push: (e, t) => f(e).push(t),
96
112
  pop: (e) => f(e).pop(),
97
113
  unshift: (e, t) => f(e).unshift(t),
@@ -101,8 +117,10 @@
101
117
  remove: (e, t) => f(e).remove(t),
102
118
  removeBy: (e, t) => f(e).removeBy(t),
103
119
  reset: (e) => f(e).reset(),
120
+ includes: (e, t) => f(e).includes(t),
121
+ appendIfUnique: (e, t) => f(e).appendIfUnique(t),
104
122
  }
105
- class bt {
123
+ class vt {
106
124
  constructor(t) {
107
125
  this.store = t
108
126
  }
@@ -137,22 +155,26 @@
137
155
  const s = { ...this.value, ...t }
138
156
  this.update(s)
139
157
  }
158
+ attributeTruthy(t) {
159
+ return !!this.value[t]
160
+ }
140
161
  }
141
- const g = (e) => new bt(e),
142
- vt = {
162
+ const g = (e) => new vt(e),
163
+ gt = {
143
164
  reset: (e) => g(e).reset(),
144
165
  resetAttribute: (e, t) => g(e).resetAttribute(t),
145
166
  updateAttribute: (e, t, s) => g(e).updateAttribute(t, s),
146
167
  updateAttributes: (e, t) => g(e).updateAttributes(t),
168
+ attributeTruthy: (e, t) => g(e).attributeTruthy(t),
147
169
  },
148
- gt = (e) => typeof e == 'boolean',
149
- yt = (e) => typeof e == 'number',
150
- M = (e) => typeof e == 'string',
170
+ yt = (e) => typeof e == 'boolean',
171
+ Et = (e) => typeof e == 'number',
172
+ k = (e) => typeof e == 'string',
151
173
  y = (e) => Array.isArray(e),
152
174
  A = (e) => e !== null && !y(e) && typeof e == 'object',
153
- Et = { boolean: gt, number: yt, string: M, array: y, object: A },
154
- At = (e, t) => t.createElement(e),
155
- wt = (e, t) => {
175
+ At = { boolean: yt, number: Et, string: k, array: y, object: A },
176
+ wt = (e, t) => t.createElement(e),
177
+ Nt = (e, t) => {
156
178
  for (const s in t) {
157
179
  if (s === '__self') continue
158
180
  const r = t[s].toString()
@@ -160,10 +182,10 @@
160
182
  const n = e
161
183
  n.value !== r && (n.value = r)
162
184
  } else
163
- M(r) && r.trim() === '' ? e.removeAttribute(s) : e.setAttribute(s, r)
185
+ k(r) && r.trim() === '' ? e.removeAttribute(s) : e.setAttribute(s, r)
164
186
  }
165
187
  },
166
- Nt = (e, t, s) => {
188
+ St = (e, t, s) => {
167
189
  const r = {}
168
190
  for (const n in t) {
169
191
  const i = t[n],
@@ -174,8 +196,8 @@
174
196
  e.eventMaps = r
175
197
  },
176
198
  _t = (e, t, s, r) => {
177
- const n = At(e, r.document)
178
- return wt(n, t), Nt(n, s, r.publish), n
199
+ const n = wt(e, r.document)
200
+ return Nt(n, t), St(n, s, r.publish), n
179
201
  },
180
202
  N = 'http://www.w3.org/2000/svg',
181
203
  xt = {
@@ -242,8 +264,8 @@
242
264
  use: !0,
243
265
  view: !0,
244
266
  },
245
- St = (e, t) => !!(xt[e] || (e === 'a' && t === N)),
246
- Tt = (e, t, s) => {
267
+ Tt = (e, t) => !!(xt[e] || (e === 'a' && t === N)),
268
+ jt = (e, t, s) => {
247
269
  const r = s.createElementNS(N, e)
248
270
  for (const n in t)
249
271
  n === '__self' ||
@@ -251,24 +273,24 @@
251
273
  r.setAttributeNS(null, n, t[n].toString())
252
274
  return r
253
275
  },
254
- jt = (e) => e.namespaceURI === N,
255
- Ot = (e, t) => t.createTextNode(e)
256
- class Mt {
276
+ Ot = (e) => e.namespaceURI === N,
277
+ Mt = (e, t) => t.createTextNode(e)
278
+ class kt {
257
279
  constructor(t) {
258
280
  this.value = t.toString()
259
281
  }
260
282
  render(t) {
261
- const s = Ot(this.value, t.document)
283
+ const s = Mt(this.value, t.document)
262
284
  return (s.__jsx = 'TextNode'), [s]
263
285
  }
264
286
  }
265
- const kt = (e) => typeof e == 'string' || typeof e == 'number',
266
- $t = (e) => new Mt(e),
267
- Dt = (e) => (kt(e) ? $t(e) : e),
268
- k = (e) => Pt(e).map(Dt).flat(),
269
- Pt = (e) => (Array.isArray(e) ? e.flat() : e ? [e] : []),
270
- $ = (e, t = {}) => k(e || t.children || []),
271
- Bt = (e, t = '') => {
287
+ const $t = (e) => typeof e == 'string' || typeof e == 'number',
288
+ Dt = (e) => new kt(e),
289
+ Pt = (e) => ($t(e) ? Dt(e) : e),
290
+ $ = (e) => Bt(e).map(Pt).flat(),
291
+ Bt = (e) => (Array.isArray(e) ? e.flat() : e ? [e] : []),
292
+ D = (e, t = {}) => $(e || t.children || []),
293
+ Ft = (e, t = '') => {
272
294
  const s = {},
273
295
  r = {}
274
296
  for (const n in e) {
@@ -284,21 +306,21 @@
284
306
  return { attributes: s, events: r }
285
307
  },
286
308
  Vt = (e, t, s = '') => (t == null ? s : t.toString()),
287
- Ft = (e, t) => {
309
+ Lt = (e, t) => {
288
310
  const s = e || {},
289
- r = $(t, s)
311
+ r = D(t, s)
290
312
  return (s.children = s.children || r), s
291
313
  },
292
- D = (e, t, s, r = []) => e.reduce(Lt(t, s), r).flat(),
293
- Lt = (e, t) => (s, r) =>
314
+ P = (e, t, s, r = []) => e.reduce(zt(t, s), r).flat(),
315
+ zt = (e, t) => (s, r) =>
294
316
  r
295
317
  ? Array.isArray(r)
296
- ? D(r, e, t, s)
318
+ ? P(r, e, t, s)
297
319
  : (r.render(e, t).forEach((n) => s.push(n)), s)
298
320
  : s
299
- class P {
321
+ class B {
300
322
  constructor(t) {
301
- this.collection = k(t)
323
+ this.collection = $(t)
302
324
  }
303
325
  render(t, s) {
304
326
  this.parentElement = s
@@ -306,7 +328,7 @@
306
328
  return this.attachToParent(r), r
307
329
  }
308
330
  generateDom(t) {
309
- return D(this.collection, t, this.parentElement)
331
+ return P(this.collection, t, this.parentElement)
310
332
  }
311
333
  attachToParent(t) {
312
334
  if (this.parentElement === void 0) return
@@ -314,7 +336,7 @@
314
336
  t.forEach((r) => s.appendChild(r))
315
337
  }
316
338
  }
317
- class zt {
339
+ class Kt {
318
340
  constructor(t, s) {
319
341
  ;(this.type = t), (this.attributes = s)
320
342
  }
@@ -342,14 +364,14 @@
342
364
  return `${this.type}${t}${s}${r}`
343
365
  }
344
366
  }
345
- class Kt {
367
+ class Rt {
346
368
  constructor(t, s, r = []) {
347
369
  this.type = t
348
- const { events: n, attributes: i } = Bt(s)
370
+ const { events: n, attributes: i } = Ft(s)
349
371
  ;(this.events = n),
350
372
  (this.attributes = i),
351
- (this.isSvg = St(this.type, this.attributes.xmlns)),
352
- (this.children = new P(r))
373
+ (this.isSvg = Tt(this.type, this.attributes.xmlns)),
374
+ (this.children = new B(r))
353
375
  }
354
376
  render(t) {
355
377
  const s = this.generateDom(t)
@@ -363,20 +385,20 @@
363
385
  return (s.__jsx = this.jsxKey()), s
364
386
  }
365
387
  generateSvgDom(t) {
366
- const s = Tt(this.type, this.attributes, t.document)
388
+ const s = jt(this.type, this.attributes, t.document)
367
389
  return (s.__jsx = this.jsxKey()), s
368
390
  }
369
391
  jsxKey() {
370
- return new zt(this.type, this.attributes).generate()
392
+ return new Kt(this.type, this.attributes).generate()
371
393
  }
372
394
  }
373
- const B = (e, t, ...s) =>
374
- typeof e == 'string' ? new Kt(e, t, s) : e(Ft(t, s))
375
- B.fragment = (e, t) => {
376
- const s = $(t, e)
377
- return new P(s)
395
+ const F = (e, t, ...s) =>
396
+ typeof e == 'string' ? new Rt(e, t, s) : e(Lt(t, s))
397
+ F.fragment = (e, t) => {
398
+ const s = D(t, e)
399
+ return new B(s)
378
400
  }
379
- class Rt {
401
+ class Ut {
380
402
  constructor(t, s, r) {
381
403
  ;(this.template = t),
382
404
  (this.selector = s),
@@ -401,45 +423,45 @@
401
423
  return this.renderKit.document.querySelector(this.selector)
402
424
  }
403
425
  }
404
- const Ut = (e, t, s) => {
405
- const r = new Rt(e, t, s)
426
+ const qt = (e, t, s) => {
427
+ const r = new Ut(e, t, s)
406
428
  return r.renderAndAttach(s), r
407
429
  },
408
430
  V = 'go-to-href',
409
- F = 'go-to',
431
+ L = 'go-to',
410
432
  E = 'navigation:location-change',
411
- L = 'navigation:route-change',
412
- qt = Object.freeze(
433
+ z = 'navigation:route-change',
434
+ It = Object.freeze(
413
435
  Object.defineProperty(
414
436
  {
415
437
  __proto__: null,
416
438
  linkNavigationEvent: V,
417
439
  locationChangeEvent: E,
418
- navigationEvent: F,
419
- routeChangeEvent: L,
440
+ navigationEvent: L,
441
+ routeChangeEvent: z,
420
442
  },
421
443
  Symbol.toStringTag,
422
444
  { value: 'Module' },
423
445
  ),
424
446
  ),
425
- z = (e) => {
447
+ K = (e) => {
426
448
  e.create('route', { host: '', path: '', query: {} })
427
449
  },
428
- K = (e) => {
450
+ R = (e) => {
429
451
  const t = e.closest('[href]')
430
452
  return (t && t.getAttribute('href')) || ''
431
453
  },
432
- _ = ({ payload: e, publish: t, window: s }) => {
454
+ S = ({ payload: e, publish: t, window: s }) => {
433
455
  s.history.pushState(null, '', e), t(E, null)
434
456
  },
435
- R = (e) => {
457
+ U = (e) => {
436
458
  const t = e.payload
437
459
  if (!t || !t.target) return
438
460
  t.preventDefault()
439
- const s = K(t.target)
440
- _({ ...e, payload: s })
461
+ const s = R(t.target)
462
+ S({ ...e, payload: s })
441
463
  },
442
- U = (e) =>
464
+ q = (e) =>
443
465
  e
444
466
  .replace(/^\?/, '')
445
467
  .split('&')
@@ -448,45 +470,45 @@
448
470
  const r = s.split('=')
449
471
  return (t[r[0]] = r[1]), t
450
472
  }, {}),
451
- q = (e) => {
473
+ I = (e) => {
452
474
  const { state: t, publish: s, window: r } = e,
453
475
  { host: n, pathname: i, search: a } = r.location,
454
476
  c = i,
455
- u = U(a),
456
- h = { host: n, path: c, query: u }
457
- t.store('route').update(h), s(L, h)
477
+ u = q(a),
478
+ d = { host: n, path: c, query: u }
479
+ t.store('route').update(d), s(z, d)
458
480
  },
459
481
  C = (e) => {
460
482
  const { subscribe: t } = e
461
- t(V, R),
462
- t(F, (s) => {
463
- _(s)
483
+ t(V, U),
484
+ t(L, (s) => {
485
+ S(s)
464
486
  })
465
487
  },
466
- I = (e) => {
488
+ J = (e) => {
467
489
  const { publish: t, subscribe: s, state: r, window: n } = e
468
- z(r), n.addEventListener('popstate', () => t(E, null)), s(E, q)
490
+ K(r), n.addEventListener('popstate', () => t(E, null)), s(E, I)
469
491
  },
470
- J = (e) => {
492
+ G = (e) => {
471
493
  setTimeout(() => e.publish(E, null), 0)
472
494
  },
473
- G = (e) => {
474
- I(e), C(e), J(e)
495
+ H = (e) => {
496
+ J(e), C(e), G(e)
475
497
  },
476
498
  Ct = Object.freeze(
477
499
  Object.defineProperty(
478
500
  {
479
501
  __proto__: null,
480
- publishLocation: J,
481
- startNavigation: G,
482
- subscribeToHistoryChange: I,
502
+ publishLocation: G,
503
+ startNavigation: H,
504
+ subscribeToHistoryChange: J,
483
505
  subscribeToNavigation: C,
484
506
  },
485
507
  Symbol.toStringTag,
486
508
  { value: 'Module' },
487
509
  ),
488
510
  )
489
- class H {
511
+ class Q {
490
512
  constructor({
491
513
  window: t,
492
514
  document: s,
@@ -506,19 +528,19 @@
506
528
  (this.roots = [])
507
529
  }
508
530
  render(t, s) {
509
- const r = Ut(t, s, this.renderKit)
531
+ const r = qt(t, s, this.renderKit)
510
532
  return this.roots.push(r), r
511
533
  }
512
534
  startNavigation() {
513
- G(this)
535
+ H(this)
514
536
  }
515
537
  }
516
- const It = Object.freeze(
517
- Object.defineProperty({ __proto__: null, App: H }, Symbol.toStringTag, {
538
+ const Jt = Object.freeze(
539
+ Object.defineProperty({ __proto__: null, App: Q }, Symbol.toStringTag, {
518
540
  value: 'Module',
519
541
  }),
520
542
  )
521
- class Q {
543
+ class W {
522
544
  constructor() {
523
545
  this.lookup = {}
524
546
  }
@@ -541,7 +563,7 @@
541
563
  this.lookup[t] || (this.lookup[t] = [])
542
564
  }
543
565
  }
544
- class W {
566
+ class X {
545
567
  constructor() {
546
568
  this.lookup = []
547
569
  }
@@ -556,7 +578,7 @@
556
578
  return this.lookup.filter((s) => s.matcher.test(t))
557
579
  }
558
580
  }
559
- class Jt {
581
+ class Gt {
560
582
  constructor({ publish: t, event: s, payload: r, timer: n }) {
561
583
  ;(this.setNewTimeout = () => {
562
584
  this.stopped ||
@@ -593,7 +615,7 @@
593
615
  ((this.callCount += 1), this.publish(this.event, this.payload))
594
616
  }
595
617
  }
596
- const Gt = (e) => {
618
+ const Ht = (e) => {
597
619
  const { offset: t, period: s } = e,
598
620
  r = ({ callCount: n }) => (t && n == 0 ? t : s)
599
621
  return {
@@ -603,16 +625,16 @@
603
625
  timer: r,
604
626
  }
605
627
  },
606
- Ht = (e) => {
628
+ Qt = (e) => {
607
629
  let t
608
- 'timer' in e ? (t = e) : (t = Gt(e))
609
- const s = new Jt(t)
630
+ 'timer' in e ? (t = e) : (t = Ht(e))
631
+ const s = new Gt(t)
610
632
  return s.start(), s.stop
611
633
  }
612
- class X {
634
+ class Y {
613
635
  constructor() {
614
- ;(this.exactSubscriptions = new Q()),
615
- (this.fuzzySubscriptions = new W()),
636
+ ;(this.exactSubscriptions = new W()),
637
+ (this.fuzzySubscriptions = new X()),
616
638
  (this.currentIndex = 0)
617
639
  }
618
640
  subscribe(t, s) {
@@ -647,48 +669,48 @@
647
669
  }
648
670
  }
649
671
  }
650
- const Y = () => {
651
- const e = new X()
672
+ const Z = () => {
673
+ const e = new Y()
652
674
  return {
653
675
  bus: e,
654
676
  publish: (r, n) => e.publish(r, n),
655
677
  subscribe: (r, n) => e.subscribe(r, n),
656
678
  }
657
679
  },
658
- Qt = Object.freeze(
680
+ Wt = Object.freeze(
659
681
  Object.defineProperty(
660
682
  {
661
683
  __proto__: null,
662
- ExactSubscriptions: Q,
663
- FuzzySubscriptions: W,
664
- JaxsBus: X,
665
- createBus: Y,
666
- publishPeriodically: Ht,
684
+ ExactSubscriptions: W,
685
+ FuzzySubscriptions: X,
686
+ JaxsBus: Y,
687
+ createBus: Z,
688
+ publishPeriodically: Qt,
667
689
  },
668
690
  Symbol.toStringTag,
669
691
  { value: 'Module' },
670
692
  ),
671
693
  ),
672
- Wt = (e, t) => e === t,
673
- Xt = (e, t) => Object.keys(e).length === Object.keys(t).length,
674
- Z = (e, t) =>
675
- !(A(e) && A(t)) || !Xt(e, t)
694
+ Xt = (e, t) => e === t,
695
+ Yt = (e, t) => Object.keys(e).length === Object.keys(t).length,
696
+ tt = (e, t) =>
697
+ !(A(e) && A(t)) || !Yt(e, t)
676
698
  ? !1
677
699
  : Object.keys(e).every((s) => {
678
700
  const r = e[s],
679
701
  n = t[s]
680
702
  return w(r, n)
681
703
  }),
682
- tt = (e, t) =>
704
+ et = (e, t) =>
683
705
  !(y(e) && y(t)) || e.length !== t.length
684
706
  ? !1
685
707
  : e.every((s, r) => {
686
708
  const n = t[r]
687
709
  return w(s, n)
688
710
  }),
689
- w = (e, t) => (A(e) ? Z(e, t) : y(e) ? tt(e, t) : Wt(e, t)),
690
- Yt = { objects: Z, arrays: tt, equal: w }
691
- class x {
711
+ w = (e, t) => (A(e) ? tt(e, t) : y(e) ? et(e, t) : Xt(e, t)),
712
+ Zt = { objects: tt, arrays: et, equal: w }
713
+ class _ {
692
714
  constructor(t) {
693
715
  ;(this.name = t.name),
694
716
  (this.parent = t.parent),
@@ -717,22 +739,21 @@
717
739
  return t(this.value)
718
740
  }
719
741
  }
720
- const Zt = { object: g, list: f, boolean: v },
721
- S = 'state'
722
- class et {
742
+ const x = 'state'
743
+ class st {
723
744
  constructor(t) {
724
745
  ;(this.publisher = t),
725
746
  (this.stores = {}),
726
- (this.eventNamePrefix = S),
747
+ (this.eventNamePrefix = x),
727
748
  (this.notifications = new Set()),
728
749
  (this.inTransaction = !1)
729
750
  }
730
751
  create(t, s) {
731
- const r = new x({ name: t, parent: this, value: s })
752
+ const r = new _({ name: t, parent: this, value: s })
732
753
  return (this.stores[t] = r), r
733
754
  }
734
755
  store(t) {
735
- return this.stores[t] || new x({ name: t, parent: this, value: void 0 })
756
+ return this.stores[t] || new _({ name: t, parent: this, value: void 0 })
736
757
  }
737
758
  get(t) {
738
759
  return this.store(t).value
@@ -765,17 +786,10 @@
765
786
  return `${this.eventNamePrefix}:${t}`
766
787
  }
767
788
  }
768
- const st = (e) => new et(e),
789
+ const rt = (e) => new st(e),
769
790
  te = Object.freeze(
770
791
  Object.defineProperty(
771
- {
772
- __proto__: null,
773
- State: et,
774
- Store: x,
775
- createState: st,
776
- eventName: S,
777
- updaters: Zt,
778
- },
792
+ { __proto__: null, State: st, Store: _, createState: rt, eventName: x },
779
793
  Symbol.toStringTag,
780
794
  { value: 'Module' },
781
795
  ),
@@ -790,7 +804,7 @@
790
804
  this.setupState(),
791
805
  this.addBusOptions(),
792
806
  this.setRenderKit(),
793
- new H({
807
+ new Q({
794
808
  window: this.window,
795
809
  document: this.document,
796
810
  publish: this.publish,
@@ -810,11 +824,11 @@
810
824
  : ((this.window = window), (this.document = document))
811
825
  }
812
826
  setupBus() {
813
- const { publish: t, subscribe: s, bus: r } = Y()
827
+ const { publish: t, subscribe: s, bus: r } = Z()
814
828
  ;(this.publish = t), (this.subscribe = s), (this.bus = r)
815
829
  }
816
830
  setupState() {
817
- this.state = st(this.publish)
831
+ this.state = rt(this.publish)
818
832
  }
819
833
  addBusOptions() {
820
834
  this.bus.addListenerOptions({
@@ -876,11 +890,11 @@
876
890
  ce = (e, t, s) => ({ source: e, target: t, data: s, type: o.removeEvent }),
877
891
  le = (e, t, s) => ({ source: e, target: t, data: s, type: o.addEvent }),
878
892
  he = (e, t, s) => ({ source: e, target: t, data: s, type: o.updateEvent }),
879
- rt = (e) => ({ source: e, target: e, type: o.removeNode, data: {} }),
893
+ nt = (e) => ({ source: e, target: e, type: o.removeNode, data: {} }),
880
894
  T = (e, t) => ({ target: e, source: e, type: o.insertNode, data: t }),
881
895
  de = (e, t, s) => ({ source: e, target: t, type: o.changeValue, data: s }),
882
896
  pe = (e, t) => (e.type > t.type ? 1 : e.type < t.type ? -1 : 0),
883
- nt = { index: -1 }
897
+ it = { index: -1 }
884
898
  class me {
885
899
  constructor() {
886
900
  this.map = {}
@@ -896,7 +910,7 @@
896
910
  pullMatch(t) {
897
911
  const s = t && t.__jsx
898
912
  return !s || !(this.map[s] && this.map[s].length)
899
- ? nt
913
+ ? it
900
914
  : this.map[s].shift()
901
915
  }
902
916
  clear(t) {
@@ -913,46 +927,46 @@
913
927
  return Object.values(this.map).flat()
914
928
  }
915
929
  }
916
- const it = (e) => {
930
+ const ot = (e) => {
917
931
  const t = new me()
918
932
  return t.populate(e), t
919
933
  },
920
- ot = (e, t, s = !1) => {
934
+ ut = (e, t, s = !1) => {
921
935
  const r = [],
922
936
  n = e.attributes,
923
937
  i = n.length,
924
938
  a = t.attributes,
925
939
  c = a.length
926
- let u, h, d
940
+ let u, d, p
927
941
  for (u = 0; u < i; u++) {
928
- d = null
929
- const l = n.item(u)
930
- if (l) {
931
- for (h = 0; h < c; h++) {
932
- const m = a.item(h)
933
- if (m && l.name == m.name) {
934
- d = m
942
+ p = null
943
+ const h = n.item(u)
944
+ if (h) {
945
+ for (d = 0; d < c; d++) {
946
+ const m = a.item(d)
947
+ if (m && h.name == m.name) {
948
+ p = m
935
949
  break
936
950
  }
937
951
  }
938
- d
939
- ? l.value !== d.value &&
940
- r.push(ae(e, t, { name: l.name, value: d.value, isSvg: s }))
941
- : r.push(oe(e, t, { name: l.name, isSvg: s }))
952
+ p
953
+ ? h.value !== p.value &&
954
+ r.push(ae(e, t, { name: h.name, value: p.value, isSvg: s }))
955
+ : r.push(oe(e, t, { name: h.name, isSvg: s }))
942
956
  }
943
957
  }
944
958
  for (u = 0; u < c; u++) {
945
- d = null
946
- const l = a.item(u)
947
- if (l) {
948
- for (h = 0; h < i; h++) {
949
- const m = n.item(h)
950
- if (m && m.name == l.name) {
951
- d = m
959
+ p = null
960
+ const h = a.item(u)
961
+ if (h) {
962
+ for (d = 0; d < i; d++) {
963
+ const m = n.item(d)
964
+ if (m && m.name == h.name) {
965
+ p = m
952
966
  break
953
967
  }
954
968
  }
955
- d || r.push(ue(e, t, { name: l.name, value: l.value, isSvg: s }))
969
+ p || r.push(ue(e, t, { name: h.name, value: h.value, isSvg: s }))
956
970
  }
957
971
  }
958
972
  return r
@@ -966,13 +980,13 @@
966
980
  return (
967
981
  i.forEach((c) => {
968
982
  const u = r[c],
969
- h = n[c]
970
- h
971
- ? h.busEvent !== u.busEvent &&
983
+ d = n[c]
984
+ d
985
+ ? d.busEvent !== u.busEvent &&
972
986
  s.push(
973
987
  he(e, t, {
974
988
  name: c,
975
- targetValue: h.listener,
989
+ targetValue: d.listener,
976
990
  sourceValue: u.listener,
977
991
  }),
978
992
  )
@@ -980,8 +994,8 @@
980
994
  }),
981
995
  a.forEach((c) => {
982
996
  const u = r[c],
983
- h = n[c]
984
- u || s.push(le(e, t, { name: h.domEvent, value: h.listener }))
997
+ d = n[c]
998
+ u || s.push(le(e, t, { name: d.domEvent, value: d.listener }))
985
999
  }),
986
1000
  s
987
1001
  )
@@ -995,16 +1009,16 @@
995
1009
  return [de(s, r, { name: 'value', value: r.value })]
996
1010
  },
997
1011
  ye = (e, t) => {
998
- const s = ot(e, t),
1012
+ const s = ut(e, t),
999
1013
  r = fe(e, t),
1000
1014
  n = ge(e, t)
1001
1015
  return s.concat(r).concat(n)
1002
1016
  },
1003
- Ee = (e, t) => ot(e, t, !0),
1017
+ Ee = (e, t) => ut(e, t, !0),
1004
1018
  Ae = (e, t) => (e.textContent !== t.textContent ? [ne(e, t)] : []),
1005
1019
  we = (e, t, s) => {
1006
1020
  let r = []
1007
- if (e.nodeType === 1 && jt(e)) {
1021
+ if (e.nodeType === 1 && Ot(e)) {
1008
1022
  const n = e,
1009
1023
  i = t,
1010
1024
  a = Ee(n, i),
@@ -1019,56 +1033,56 @@
1019
1033
  } else e.nodeType === 3 && (r = Ae(e, t))
1020
1034
  return r
1021
1035
  },
1022
- ut = (e, t, s) => {
1036
+ at = (e, t, s) => {
1023
1037
  const r = [],
1024
1038
  n = Ne(e, t),
1025
- i = it(e),
1026
- a = it(t),
1039
+ i = ot(e),
1040
+ a = ot(t),
1027
1041
  c = []
1028
1042
  let u = 0
1029
1043
  for (; u < n; u++) {
1030
- const d = e[u],
1031
- l = t[u]
1032
- if (l && a.check(l)) {
1033
- const m = i.pullMatch(l)
1034
- a.clear(l),
1044
+ const p = e[u],
1045
+ h = t[u]
1046
+ if (h && a.check(h)) {
1047
+ const m = i.pullMatch(h)
1048
+ a.clear(h),
1035
1049
  m.element
1036
1050
  ? (m.index !== u && r.push(T(m.element, { parent: s, index: u })),
1037
- c.push({ source: m.element, target: l }))
1038
- : d
1039
- ? a.check(d)
1040
- ? r.push(T(l, { parent: s, index: u }))
1041
- : (i.clear(d), r.push(ie(d, l)))
1042
- : r.push(T(l, { parent: s, index: u }))
1043
- } else d && i.pullMatch(d).element && r.push(rt(d))
1051
+ c.push({ source: m.element, target: h }))
1052
+ : p
1053
+ ? a.check(p)
1054
+ ? r.push(T(h, { parent: s, index: u }))
1055
+ : (i.clear(p), r.push(ie(p, h)))
1056
+ : r.push(T(h, { parent: s, index: u }))
1057
+ } else p && i.pullMatch(p).element && r.push(nt(p))
1044
1058
  }
1045
- i.remaining().forEach(({ element: d }) => {
1046
- r.push(rt(d))
1059
+ i.remaining().forEach(({ element: p }) => {
1060
+ r.push(nt(p))
1047
1061
  })
1048
- const h = c.reduce(
1049
- (d, { source: l, target: m }) => d.concat(we(l, m, ut)),
1062
+ const d = c.reduce(
1063
+ (p, { source: h, target: m }) => p.concat(we(h, m, at)),
1050
1064
  [],
1051
1065
  )
1052
- return r.concat(h).sort(pe)
1066
+ return r.concat(d).sort(pe)
1053
1067
  },
1054
1068
  Ne = (e, t) => {
1055
1069
  const s = e.length,
1056
1070
  r = t.length
1057
1071
  return s > r ? s : r
1058
1072
  },
1059
- _e = (e, t, s) => {
1060
- const r = ut(e, t, s)
1073
+ Se = (e, t, s) => {
1074
+ const r = at(e, t, s)
1061
1075
  return (
1062
1076
  r.forEach((n) => {
1063
- xe(n)
1077
+ _e(n)
1064
1078
  }),
1065
1079
  r
1066
1080
  )
1067
1081
  },
1068
- xe = (e) => {
1069
- ;(Fe[e.type] || Se)(e)
1082
+ _e = (e) => {
1083
+ ;(Ve[e.type] || xe)(e)
1070
1084
  },
1071
- Se = (e) => {},
1085
+ xe = (e) => {},
1072
1086
  Te = (e) => {
1073
1087
  const { source: t, target: s } = e
1074
1088
  t.nodeValue = s.textContent
@@ -1092,13 +1106,13 @@
1092
1106
  { name: r, isSvg: n } = s
1093
1107
  n ? t.removeAttributeNS(null, r) : t.removeAttribute(r)
1094
1108
  },
1095
- at = (e) => {
1109
+ ct = (e) => {
1096
1110
  const { source: t, data: s } = e,
1097
1111
  { name: r, value: n, isSvg: i } = s
1098
1112
  i ? t.setAttributeNS(null, r, n) : t.setAttribute(r, n)
1099
1113
  },
1100
1114
  $e = (e) => {
1101
- at(e)
1115
+ ct(e)
1102
1116
  },
1103
1117
  De = (e) => {
1104
1118
  const t = e.data,
@@ -1118,24 +1132,24 @@
1118
1132
  { name: r, sourceValue: n, targetValue: i } = t
1119
1133
  s.removeEventListener(r, n), s.addEventListener(r, i)
1120
1134
  },
1121
- Ve = (e) => {
1135
+ Fe = (e) => {
1122
1136
  const t = e.data,
1123
1137
  s = e.source,
1124
1138
  { value: r } = t
1125
1139
  s.value = r
1126
1140
  },
1127
- Fe = {
1141
+ Ve = {
1128
1142
  [o.changeText]: Te,
1129
1143
  [o.removeNode]: je,
1130
1144
  [o.insertNode]: Oe,
1131
1145
  [o.replaceNode]: Me,
1132
1146
  [o.removeAttribute]: ke,
1133
- [o.addAttribute]: at,
1147
+ [o.addAttribute]: ct,
1134
1148
  [o.updateAttribute]: $e,
1135
1149
  [o.removeEvent]: De,
1136
1150
  [o.addEvent]: Pe,
1137
1151
  [o.updateEvent]: Be,
1138
- [o.changeValue]: Ve,
1152
+ [o.changeValue]: Fe,
1139
1153
  },
1140
1154
  Le = (e, t, s) => {
1141
1155
  const r = [...t]
@@ -1167,7 +1181,7 @@
1167
1181
  n >= 0 && (t[n] = s)
1168
1182
  },
1169
1183
  qe = { [o.removeNode]: Ke, [o.insertNode]: Re, [o.replaceNode]: Ue }
1170
- class Ce {
1184
+ class Ie {
1171
1185
  constructor({
1172
1186
  Template: t,
1173
1187
  subscriptions: s,
@@ -1204,7 +1218,7 @@
1204
1218
  this.parentElement = r
1205
1219
  }
1206
1220
  const t = this.generateDom(this.renderKit),
1207
- s = _e(this.dom, t, this.parentElement)
1221
+ s = Se(this.dom, t, this.parentElement)
1208
1222
  this.dom = Le(s, this.dom, this.parentElement)
1209
1223
  }
1210
1224
  subscribeForRerender() {
@@ -1214,22 +1228,22 @@
1214
1228
  })
1215
1229
  }
1216
1230
  eventName(t) {
1217
- return `${S}:${t}`
1231
+ return `${x}:${t}`
1218
1232
  }
1219
1233
  }
1220
- const Ie = (e) => e,
1221
- ct = ({ Template: e, viewModel: t, subscriptions: s }) => (
1234
+ const Ce = (e) => e,
1235
+ lt = ({ Template: e, viewModel: t, subscriptions: s }) => (
1222
1236
  (s = s || []),
1223
- (t = t || Ie),
1237
+ (t = t || Ce),
1224
1238
  (r) =>
1225
- new Ce({ Template: e, viewModel: t, subscriptions: s, attributes: r })
1239
+ new Ie({ Template: e, viewModel: t, subscriptions: s, attributes: r })
1226
1240
  ),
1227
1241
  Je =
1228
1242
  (e) =>
1229
1243
  ({ path: t }) =>
1230
1244
  t === e,
1231
1245
  Ge = () => !0,
1232
- lt =
1246
+ ht =
1233
1247
  (e) =>
1234
1248
  ({ route: t }) => {
1235
1249
  const s = e.find((r) => r.match(t))
@@ -1237,15 +1251,15 @@
1237
1251
  },
1238
1252
  He = Object.freeze(
1239
1253
  Object.defineProperty(
1240
- { __proto__: null, buildRouter: lt, catchAll: Ge, exactPathMatch: Je },
1254
+ { __proto__: null, buildRouter: ht, catchAll: Ge, exactPathMatch: Je },
1241
1255
  Symbol.toStringTag,
1242
1256
  { value: 'Module' },
1243
1257
  ),
1244
1258
  ),
1245
1259
  Qe = () => ({ render: (e, t) => [] }),
1246
1260
  We = (e) => {
1247
- const t = lt(e)
1248
- return ct({
1261
+ const t = ht(e)
1262
+ return lt({
1249
1263
  Template: ({ route: r }) => (t({ route: r }) || Qe)(),
1250
1264
  subscriptions: ['route'],
1251
1265
  })
@@ -1254,37 +1268,34 @@
1254
1268
  Object.defineProperty(
1255
1269
  {
1256
1270
  __proto__: null,
1257
- createRouteState: z,
1258
- events: qt,
1259
- extractQueryParams: U,
1260
- findHref: K,
1261
- navigate: _,
1262
- onLinkClick: R,
1263
- onLocationChange: q,
1271
+ createRouteState: K,
1272
+ events: It,
1273
+ extractQueryParams: q,
1274
+ findHref: R,
1275
+ navigate: S,
1276
+ onLinkClick: U,
1277
+ onLocationChange: I,
1264
1278
  start: Ct,
1265
1279
  },
1266
1280
  Symbol.toStringTag,
1267
1281
  { value: 'Module' },
1268
1282
  ),
1269
- ),
1270
- Ye = {
1271
- RecordStore: vt,
1272
- BooleanStore: pt,
1273
- ListStore: ft,
1274
- ArrayModifiers: ht,
1275
- }
1276
- ;(p.Equality = Yt),
1277
- (p.Is = Et),
1278
- (p.JaxsTypes = re),
1279
- (p.Update = Ye),
1280
- (p.appBuilding = It),
1281
- (p.bind = ct),
1282
- (p.createApp = se),
1283
- (p.jsx = B),
1284
- (p.messageBus = Qt),
1285
- (p.navigation = Xe),
1286
- (p.routedView = We),
1287
- (p.routing = He),
1288
- (p.state = te),
1289
- Object.defineProperty(p, Symbol.toStringTag, { value: 'Module' })
1283
+ )
1284
+ ;(l.ArrayModifiers = dt),
1285
+ (l.BooleanStore = mt),
1286
+ (l.Equality = Zt),
1287
+ (l.Is = At),
1288
+ (l.JaxsTypes = re),
1289
+ (l.ListStore = bt),
1290
+ (l.RecordStore = gt),
1291
+ (l.appBuilding = Jt),
1292
+ (l.bind = lt),
1293
+ (l.createApp = se),
1294
+ (l.jsx = F),
1295
+ (l.messageBus = Wt),
1296
+ (l.navigation = Xe),
1297
+ (l.routedView = We),
1298
+ (l.routing = He),
1299
+ (l.state = te),
1300
+ Object.defineProperty(l, Symbol.toStringTag, { value: 'Module' })
1290
1301
  })