jaxs 0.7.3 → 0.9.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.
package/dist/jaxs.umd.cjs CHANGED
@@ -1,43 +1,184 @@
1
- ;(function (p, f) {
1
+ ;(function (p, b) {
2
2
  typeof exports == 'object' && typeof module < 'u'
3
- ? f(exports)
3
+ ? b(exports)
4
4
  : typeof define == 'function' && define.amd
5
- ? define(['exports'], f)
5
+ ? define(['exports'], b)
6
6
  : ((p = typeof globalThis < 'u' ? globalThis : p || self),
7
- f((p.jaxs = {})))
7
+ b((p.jaxs = {})))
8
8
  })(this, function (p) {
9
9
  'use strict'
10
- const f = (e) => typeof e == 'string',
11
- v = (e) => Array.isArray(e),
12
- g = (e) => e !== null && !v(e) && typeof e == 'object',
13
- rt = (e, t) => t.createElement(e),
14
- it = (e, t) => {
10
+ const b = (e, t) => e.reduce((s, r) => (r !== t && s.push(r), s), []),
11
+ j = (e, t) => e.reduce((s, r) => (t(r) || s.push(r), s), []),
12
+ O = (e, t, s) => (e.splice(t, 0, s), e),
13
+ ht = { remove: b, removeBy: j, insertAt: O }
14
+ class dt {
15
+ constructor(t) {
16
+ this.store = t
17
+ }
18
+ update(t) {
19
+ this.store.update(t)
20
+ }
21
+ get value() {
22
+ return this.store.value
23
+ }
24
+ reset() {
25
+ this.store.update(this.store.initialValue)
26
+ }
27
+ toggle() {
28
+ const t = !this.value
29
+ this.update(t)
30
+ }
31
+ setTrue() {
32
+ this.update(!0)
33
+ }
34
+ setFalse() {
35
+ this.update(!1)
36
+ }
37
+ }
38
+ const v = (e) => new dt(e),
39
+ pt = {
40
+ toggle: (e) => v(e).toggle(),
41
+ setTrue: (e) => v(e).setTrue(),
42
+ setFalse: (e) => v(e).setFalse(),
43
+ reset: (e) => v(e).reset(),
44
+ }
45
+ class mt {
46
+ constructor(t) {
47
+ this.store = t
48
+ }
49
+ update(t) {
50
+ this.store.update(t)
51
+ }
52
+ get value() {
53
+ return this.store.value
54
+ }
55
+ reset() {
56
+ this.store.update(this.store.initialValue)
57
+ }
58
+ push(t) {
59
+ const s = this.value
60
+ s.push(t), this.update(s)
61
+ }
62
+ pop() {
63
+ const t = this.value,
64
+ s = t.pop()
65
+ return this.update(t), s
66
+ }
67
+ unshift(t) {
68
+ const s = this.value
69
+ s.unshift(t), this.update(s)
70
+ }
71
+ shift() {
72
+ const t = this.value,
73
+ s = t.shift()
74
+ return this.update(t), s
75
+ }
76
+ sortBy(t) {
77
+ const s = this.value
78
+ s.sort(t), this.update(s)
79
+ }
80
+ insertAt(t, s) {
81
+ const r = this.value
82
+ O(r, t, s), this.update(r)
83
+ }
84
+ remove(t) {
85
+ const s = b(this.value, t)
86
+ this.update(s)
87
+ }
88
+ removeBy(t) {
89
+ const s = j(this.value, t)
90
+ this.update(s)
91
+ }
92
+ }
93
+ const f = (e) => new mt(e),
94
+ ft = {
95
+ push: (e, t) => f(e).push(t),
96
+ pop: (e) => f(e).pop(),
97
+ unshift: (e, t) => f(e).unshift(t),
98
+ shift: (e) => f(e).shift(),
99
+ sortBy: (e, t) => f(e).sortBy(t),
100
+ insertAt: (e, t, s) => f(e).insertAt(t, s),
101
+ remove: (e, t) => f(e).remove(t),
102
+ removeBy: (e, t) => f(e).removeBy(t),
103
+ reset: (e) => f(e).reset(),
104
+ }
105
+ class bt {
106
+ constructor(t) {
107
+ this.store = t
108
+ }
109
+ update(t) {
110
+ this.store.update(t)
111
+ }
112
+ get value() {
113
+ return this.store.value
114
+ }
115
+ reset() {
116
+ this.store.update(this.store.initialValue)
117
+ }
118
+ updateAttribute(t, s) {
119
+ const r = { ...this.value }
120
+ ;(r[t] = s), this.update(r)
121
+ }
122
+ updateDynamicAttribute(t, s) {
123
+ this.isKey(t) && this.isValueType(t, s) && this.updateAttribute(t, s)
124
+ }
125
+ isKey(t) {
126
+ return t in this.store.initialValue
127
+ }
128
+ isValueType(t, s) {
129
+ return typeof this.store.initialValue[t] == typeof s
130
+ }
131
+ resetAttribute(t) {
132
+ const s = { ...this.value },
133
+ r = this.store.initialValue[t]
134
+ ;(s[t] = r), this.update(s)
135
+ }
136
+ updateAttributes(t) {
137
+ const s = { ...this.value, ...t }
138
+ this.update(s)
139
+ }
140
+ }
141
+ const g = (e) => new bt(e),
142
+ vt = {
143
+ reset: (e) => g(e).reset(),
144
+ resetAttribute: (e, t) => g(e).resetAttribute(t),
145
+ updateAttribute: (e, t, s) => g(e).updateAttribute(t, s),
146
+ updateAttributes: (e, t) => g(e).updateAttributes(t),
147
+ },
148
+ gt = (e) => typeof e == 'boolean',
149
+ yt = (e) => typeof e == 'number',
150
+ M = (e) => typeof e == 'string',
151
+ y = (e) => Array.isArray(e),
152
+ 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) => {
15
156
  for (const s in t) {
16
157
  if (s === '__self') continue
17
- const n = t[s].toString()
158
+ const r = t[s].toString()
18
159
  if (s === 'value') {
19
- const r = e
20
- r.value !== n && (r.value = n)
160
+ const n = e
161
+ n.value !== r && (n.value = r)
21
162
  } else
22
- f(n) && n.trim() === '' ? e.removeAttribute(s) : e.setAttribute(s, n)
163
+ M(r) && r.trim() === '' ? e.removeAttribute(s) : e.setAttribute(s, r)
23
164
  }
24
165
  },
25
- ot = (e, t, s) => {
26
- const n = {}
27
- for (const r in t) {
28
- const i = t[r],
29
- a = (l) => s(i, l)
30
- e.addEventListener(r, a),
31
- (n[r] = { domEvent: r, busEvent: i, listener: a })
166
+ Nt = (e, t, s) => {
167
+ const r = {}
168
+ for (const n in t) {
169
+ const i = t[n],
170
+ a = (c) => s(i, c)
171
+ e.addEventListener(n, a),
172
+ (r[n] = { domEvent: n, busEvent: i, listener: a })
32
173
  }
33
- e.eventMaps = n
174
+ e.eventMaps = r
34
175
  },
35
- ut = (e, t, s, n) => {
36
- const r = rt(e, n.document)
37
- return it(r, t), ot(r, s, n.publish), r
176
+ _t = (e, t, s, r) => {
177
+ const n = At(e, r.document)
178
+ return wt(n, t), Nt(n, s, r.publish), n
38
179
  },
39
- y = 'http://www.w3.org/2000/svg',
40
- at = {
180
+ N = 'http://www.w3.org/2000/svg',
181
+ xt = {
41
182
  animate: !0,
42
183
  animateMotion: !0,
43
184
  animateTransform: !0,
@@ -101,79 +242,79 @@
101
242
  use: !0,
102
243
  view: !0,
103
244
  },
104
- ct = (e, t) => !!(at[e] || (e === 'a' && t === y)),
105
- lt = (e, t, s) => {
106
- const n = s.createElementNS(y, e)
107
- for (const r in t)
108
- r === '__self' ||
109
- r === 'xmlns' ||
110
- n.setAttributeNS(null, r, t[r].toString())
111
- return n
245
+ St = (e, t) => !!(xt[e] || (e === 'a' && t === N)),
246
+ Tt = (e, t, s) => {
247
+ const r = s.createElementNS(N, e)
248
+ for (const n in t)
249
+ n === '__self' ||
250
+ n === 'xmlns' ||
251
+ r.setAttributeNS(null, n, t[n].toString())
252
+ return r
112
253
  },
113
- ht = (e) => e.namespaceURI === y,
114
- dt = (e, t) => t.createTextNode(e)
115
- class pt {
254
+ jt = (e) => e.namespaceURI === N,
255
+ Ot = (e, t) => t.createTextNode(e)
256
+ class Mt {
116
257
  constructor(t) {
117
258
  this.value = t.toString()
118
259
  }
119
260
  render(t) {
120
- const s = dt(this.value, t.document)
261
+ const s = Ot(this.value, t.document)
121
262
  return (s.__jsx = 'TextNode'), [s]
122
263
  }
123
264
  }
124
- const mt = (e) => typeof e == 'string' || typeof e == 'number',
125
- ft = (e) => new pt(e),
126
- bt = (e) => (mt(e) ? ft(e) : e),
127
- S = (e) => vt(e).map(bt).flat(),
128
- vt = (e) => (Array.isArray(e) ? e.flat() : e ? [e] : []),
129
- T = (e, t = {}) => S(e || t.children || []),
130
- gt = (e, t = '') => {
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 = '') => {
131
272
  const s = {},
132
- n = {}
133
- for (const r in e) {
134
- const i = e[r]
135
- if (r.match(/^on.+/i)) {
136
- const a = r.slice(2).toLowerCase()
137
- n[a] = i ? i.toString() : ''
273
+ r = {}
274
+ for (const n in e) {
275
+ const i = e[n]
276
+ if (n.match(/^on.+/i)) {
277
+ const a = n.slice(2).toLowerCase()
278
+ r[a] = i ? i.toString() : ''
138
279
  } else {
139
280
  if (i === !1) continue
140
- r === '__source' ? (s.__source = e.__source) : (s[r] = yt(r, i, t))
281
+ n === '__source' ? (s.__source = e.__source) : (s[n] = Vt(n, i, t))
141
282
  }
142
283
  }
143
- return { attributes: s, events: n }
284
+ return { attributes: s, events: r }
144
285
  },
145
- yt = (e, t, s = '') => (t == null ? s : t.toString()),
146
- Et = (e, t) => {
286
+ Vt = (e, t, s = '') => (t == null ? s : t.toString()),
287
+ Ft = (e, t) => {
147
288
  const s = e || {},
148
- n = T(t, s)
149
- return (s.children = s.children || n), s
289
+ r = $(t, s)
290
+ return (s.children = s.children || r), s
150
291
  },
151
- j = (e, t, s, n = []) => e.reduce(At(t, s), n).flat(),
152
- At = (e, t) => (s, n) =>
153
- n
154
- ? Array.isArray(n)
155
- ? j(n, e, t, s)
156
- : (n.render(e, t).forEach((r) => s.push(r)), s)
292
+ D = (e, t, s, r = []) => e.reduce(Lt(t, s), r).flat(),
293
+ Lt = (e, t) => (s, r) =>
294
+ r
295
+ ? Array.isArray(r)
296
+ ? D(r, e, t, s)
297
+ : (r.render(e, t).forEach((n) => s.push(n)), s)
157
298
  : s
158
- class O {
299
+ class P {
159
300
  constructor(t) {
160
- this.collection = S(t)
301
+ this.collection = k(t)
161
302
  }
162
303
  render(t, s) {
163
304
  this.parentElement = s
164
- const n = this.generateDom(t)
165
- return this.attachToParent(n), n
305
+ const r = this.generateDom(t)
306
+ return this.attachToParent(r), r
166
307
  }
167
308
  generateDom(t) {
168
- return j(this.collection, t, this.parentElement)
309
+ return D(this.collection, t, this.parentElement)
169
310
  }
170
311
  attachToParent(t) {
171
312
  if (this.parentElement === void 0) return
172
313
  const s = this.parentElement
173
- t.forEach((n) => s.appendChild(n))
314
+ t.forEach((r) => s.appendChild(r))
174
315
  }
175
316
  }
176
- class xt {
317
+ class zt {
177
318
  constructor(t, s) {
178
319
  ;(this.type = t), (this.attributes = s)
179
320
  }
@@ -189,26 +330,26 @@
189
330
  const {
190
331
  fileName: t,
191
332
  lineNumber: s,
192
- columnNumber: n,
333
+ columnNumber: r,
193
334
  } = this.attributes.__source
194
- return `${t}:${s}:${n}`
335
+ return `${t}:${s}:${r}`
195
336
  }
196
337
  }
197
338
  createKeyFromAttributes() {
198
339
  const t = this.attributes.id ? `#${this.attributes.id}` : '',
199
340
  s = this.attributes.type ? `[type=${this.attributes.type}]` : '',
200
- n = this.attributes.name ? `[name=${this.attributes.name}]` : ''
201
- return `${this.type}${t}${s}${n}`
341
+ r = this.attributes.name ? `[name=${this.attributes.name}]` : ''
342
+ return `${this.type}${t}${s}${r}`
202
343
  }
203
344
  }
204
- class wt {
205
- constructor(t, s, n = []) {
345
+ class Kt {
346
+ constructor(t, s, r = []) {
206
347
  this.type = t
207
- const { events: r, attributes: i } = gt(s)
208
- ;(this.events = r),
348
+ const { events: n, attributes: i } = Bt(s)
349
+ ;(this.events = n),
209
350
  (this.attributes = i),
210
- (this.isSvg = ct(this.type, this.attributes.xmlns)),
211
- (this.children = new O(n))
351
+ (this.isSvg = St(this.type, this.attributes.xmlns)),
352
+ (this.children = new P(r))
212
353
  }
213
354
  render(t) {
214
355
  const s = this.generateDom(t)
@@ -218,28 +359,28 @@
218
359
  return this.isSvg ? this.generateSvgDom(t) : this.generateHtmlDom(t)
219
360
  }
220
361
  generateHtmlDom(t) {
221
- const s = ut(this.type, this.attributes, this.events, t)
362
+ const s = _t(this.type, this.attributes, this.events, t)
222
363
  return (s.__jsx = this.jsxKey()), s
223
364
  }
224
365
  generateSvgDom(t) {
225
- const s = lt(this.type, this.attributes, t.document)
366
+ const s = Tt(this.type, this.attributes, t.document)
226
367
  return (s.__jsx = this.jsxKey()), s
227
368
  }
228
369
  jsxKey() {
229
- return new xt(this.type, this.attributes).generate()
370
+ return new zt(this.type, this.attributes).generate()
230
371
  }
231
372
  }
232
- const M = (e, t, ...s) =>
233
- typeof e == 'string' ? new wt(e, t, s) : e(Et(t, s))
234
- M.fragment = (e, t) => {
235
- const s = T(t, e)
236
- return new O(s)
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)
237
378
  }
238
- class Nt {
239
- constructor(t, s, n) {
379
+ class Rt {
380
+ constructor(t, s, r) {
240
381
  ;(this.template = t),
241
382
  (this.selector = s),
242
- (this.renderKit = n),
383
+ (this.renderKit = r),
243
384
  (this.dom = [])
244
385
  }
245
386
  renderAndAttach(t) {
@@ -260,135 +401,136 @@
260
401
  return this.renderKit.document.querySelector(this.selector)
261
402
  }
262
403
  }
263
- const _t = (e, t, s) => {
264
- const n = new Nt(e, t, s)
265
- return n.renderAndAttach(s), n
404
+ const Ut = (e, t, s) => {
405
+ const r = new Rt(e, t, s)
406
+ return r.renderAndAttach(s), r
266
407
  },
267
- k = 'go-to-href',
268
- $ = 'go-to',
269
- b = 'navigation:location-change',
270
- D = 'navigation:route-change',
271
- St = Object.freeze(
408
+ V = 'go-to-href',
409
+ F = 'go-to',
410
+ E = 'navigation:location-change',
411
+ L = 'navigation:route-change',
412
+ qt = Object.freeze(
272
413
  Object.defineProperty(
273
414
  {
274
415
  __proto__: null,
275
- linkNavigationEvent: k,
276
- locationChangeEvent: b,
277
- navigationEvent: $,
278
- routeChangeEvent: D,
416
+ linkNavigationEvent: V,
417
+ locationChangeEvent: E,
418
+ navigationEvent: F,
419
+ routeChangeEvent: L,
279
420
  },
280
421
  Symbol.toStringTag,
281
422
  { value: 'Module' },
282
423
  ),
283
424
  ),
284
- P = (e) => {
425
+ z = (e) => {
285
426
  e.create('route', { host: '', path: '', query: {} })
286
427
  },
287
- V = (e) => {
428
+ K = (e) => {
288
429
  const t = e.closest('[href]')
289
430
  return (t && t.getAttribute('href')) || ''
290
431
  },
291
- E = (e, { publish: t, window: s }) => {
292
- s.history.pushState(null, '', e), t(b, null)
432
+ _ = ({ payload: e, publish: t, window: s }) => {
433
+ s.history.pushState(null, '', e), t(E, null)
293
434
  },
294
- F = (e, t) => {
295
- if (!e || !e.target) return
296
- e.preventDefault()
297
- const s = V(e.target)
298
- E(s, t)
435
+ R = (e) => {
436
+ const t = e.payload
437
+ if (!t || !t.target) return
438
+ t.preventDefault()
439
+ const s = K(t.target)
440
+ _({ ...e, payload: s })
299
441
  },
300
- L = (e) =>
442
+ U = (e) =>
301
443
  e
302
444
  .replace(/^\?/, '')
303
445
  .split('&')
304
446
  .reduce((t, s) => {
305
447
  if (!s) return t
306
- const n = s.split('=')
307
- return (t[n[0]] = n[1]), t
448
+ const r = s.split('=')
449
+ return (t[r[0]] = r[1]), t
308
450
  }, {}),
309
- z = (e, t) => {
310
- const { state: s, publish: n, window: r } = t,
311
- { host: i, pathname: a, search: l } = r.location,
312
- u = a,
313
- d = L(l),
314
- c = { host: i, path: u, query: d }
315
- s.store('route').update(c), n(D, c)
451
+ q = (e) => {
452
+ const { state: t, publish: s, window: r } = e,
453
+ { host: n, pathname: i, search: a } = r.location,
454
+ c = i,
455
+ u = U(a),
456
+ h = { host: n, path: c, query: u }
457
+ t.store('route').update(h), s(L, h)
316
458
  },
317
- B = (e) => {
459
+ C = (e) => {
318
460
  const { subscribe: t } = e
319
- t(k, F),
320
- t($, (s, n) => {
321
- E(s, n)
461
+ t(V, R),
462
+ t(F, (s) => {
463
+ _(s)
322
464
  })
323
465
  },
324
- K = (e) => {
325
- const { publish: t, subscribe: s, state: n, window: r } = e
326
- P(n), r.addEventListener('popstate', () => t(b, null)), s(b, z)
466
+ I = (e) => {
467
+ const { publish: t, subscribe: s, state: r, window: n } = e
468
+ z(r), n.addEventListener('popstate', () => t(E, null)), s(E, q)
327
469
  },
328
- R = (e) => {
329
- setTimeout(() => e.publish(b, null), 0)
470
+ J = (e) => {
471
+ setTimeout(() => e.publish(E, null), 0)
330
472
  },
331
- U = (e) => {
332
- K(e), B(e), R(e)
473
+ G = (e) => {
474
+ I(e), C(e), J(e)
333
475
  },
334
- Tt = Object.freeze(
476
+ Ct = Object.freeze(
335
477
  Object.defineProperty(
336
478
  {
337
479
  __proto__: null,
338
- publishLocation: R,
339
- startNavigation: U,
340
- subscribeToHistoryChange: K,
341
- subscribeToNavigation: B,
480
+ publishLocation: J,
481
+ startNavigation: G,
482
+ subscribeToHistoryChange: I,
483
+ subscribeToNavigation: C,
342
484
  },
343
485
  Symbol.toStringTag,
344
486
  { value: 'Module' },
345
487
  ),
346
488
  )
347
- class C {
489
+ class H {
348
490
  constructor({
349
491
  window: t,
350
492
  document: s,
351
- publish: n,
352
- subscribe: r,
493
+ publish: r,
494
+ subscribe: n,
353
495
  bus: i,
354
496
  state: a,
355
- renderKit: l,
497
+ renderKit: c,
356
498
  }) {
357
499
  ;(this.window = t),
358
500
  (this.document = s),
359
- (this.publish = n),
360
- (this.subscribe = r),
501
+ (this.publish = r),
502
+ (this.subscribe = n),
361
503
  (this.bus = i),
362
504
  (this.state = a),
363
- (this.renderKit = l),
505
+ (this.renderKit = c),
364
506
  (this.roots = [])
365
507
  }
366
508
  render(t, s) {
367
- const n = _t(t, s, this.renderKit)
368
- return this.roots.push(n), n
509
+ const r = Ut(t, s, this.renderKit)
510
+ return this.roots.push(r), r
369
511
  }
370
512
  startNavigation() {
371
- U(this)
513
+ G(this)
372
514
  }
373
515
  }
374
- const jt = Object.freeze(
375
- Object.defineProperty({ __proto__: null, App: C }, Symbol.toStringTag, {
516
+ const It = Object.freeze(
517
+ Object.defineProperty({ __proto__: null, App: H }, Symbol.toStringTag, {
376
518
  value: 'Module',
377
519
  }),
378
520
  )
379
- class I {
521
+ class Q {
380
522
  constructor() {
381
523
  this.lookup = {}
382
524
  }
383
- add(t, s, n) {
525
+ add(t, s, r) {
384
526
  this.ensureArrayFor(t)
385
- const r = { listener: s, index: n, matcher: t }
386
- return this.lookup[t].push(r), () => this.remove(r)
527
+ const n = { listener: s, index: r, matcher: t }
528
+ return this.lookup[t].push(n), () => this.remove(n)
387
529
  }
388
530
  remove(t) {
389
531
  this.lookup[t.matcher] &&
390
532
  (this.lookup[t.matcher] = this.lookup[t.matcher].reduce(
391
- (s, n) => (n !== t && s.push(n), s),
533
+ (s, r) => (r !== t && s.push(r), s),
392
534
  [],
393
535
  ))
394
536
  }
@@ -399,23 +541,23 @@
399
541
  this.lookup[t] || (this.lookup[t] = [])
400
542
  }
401
543
  }
402
- class q {
544
+ class W {
403
545
  constructor() {
404
546
  this.lookup = []
405
547
  }
406
- add(t, s, n) {
407
- const r = { listener: s, index: n, matcher: t }
408
- return this.lookup.push(r), () => this.remove(r)
548
+ add(t, s, r) {
549
+ const n = { listener: s, index: r, matcher: t }
550
+ return this.lookup.push(n), () => this.remove(n)
409
551
  }
410
552
  remove(t) {
411
- this.lookup = this.lookup.reduce((s, n) => (n !== t && s.push(n), s), [])
553
+ this.lookup = this.lookup.reduce((s, r) => (r !== t && s.push(r), s), [])
412
554
  }
413
555
  matches(t) {
414
556
  return this.lookup.filter((s) => s.matcher.test(t))
415
557
  }
416
558
  }
417
- class Ot {
418
- constructor({ publish: t, event: s, payload: n, timer: r }) {
559
+ class Jt {
560
+ constructor({ publish: t, event: s, payload: r, timer: n }) {
419
561
  ;(this.setNewTimeout = () => {
420
562
  this.stopped ||
421
563
  setTimeout(() => {
@@ -430,10 +572,10 @@
430
572
  })),
431
573
  (this.publish = t),
432
574
  (this.event = s),
433
- (this.payload = n || null),
575
+ (this.payload = r || null),
434
576
  (this.stop = this.stopTimeout.bind(this)),
435
577
  (this.stopped = !1),
436
- (this.timer = r),
578
+ (this.timer = n),
437
579
  (this.startedAt = new Date().getTime()),
438
580
  (this.callCount = 0)
439
581
  }
@@ -451,36 +593,36 @@
451
593
  ((this.callCount += 1), this.publish(this.event, this.payload))
452
594
  }
453
595
  }
454
- const Mt = (e) => {
596
+ const Gt = (e) => {
455
597
  const { offset: t, period: s } = e,
456
- n = ({ callCount: r }) => (t && r == 0 ? t : s)
598
+ r = ({ callCount: n }) => (t && n == 0 ? t : s)
457
599
  return {
458
600
  event: e.event,
459
601
  publish: e.publish,
460
602
  payload: e.payload,
461
- timer: n,
603
+ timer: r,
462
604
  }
463
605
  },
464
- kt = (e) => {
606
+ Ht = (e) => {
465
607
  let t
466
- 'timer' in e ? (t = e) : (t = Mt(e))
467
- const s = new Ot(t)
608
+ 'timer' in e ? (t = e) : (t = Gt(e))
609
+ const s = new Jt(t)
468
610
  return s.start(), s.stop
469
611
  }
470
- class J {
612
+ class X {
471
613
  constructor() {
472
- ;(this.exactSubscriptions = new I()),
473
- (this.fuzzySubscriptions = new q()),
614
+ ;(this.exactSubscriptions = new Q()),
615
+ (this.fuzzySubscriptions = new W()),
474
616
  (this.currentIndex = 0)
475
617
  }
476
618
  subscribe(t, s) {
477
- let n
619
+ let r
478
620
  return (
479
621
  typeof t == 'string'
480
- ? (n = this.exactSubscriptions.add(t, s, this.currentIndex))
481
- : (n = this.fuzzySubscriptions.add(t, s, this.currentIndex)),
622
+ ? (r = this.exactSubscriptions.add(t, s, this.currentIndex))
623
+ : (r = this.fuzzySubscriptions.add(t, s, this.currentIndex)),
482
624
  (this.currentIndex += 1),
483
- n
625
+ r
484
626
  )
485
627
  }
486
628
  publish(t, s) {
@@ -488,58 +630,64 @@
488
630
  ...this.exactSubscriptions.matches(t),
489
631
  ...this.fuzzySubscriptions.matches(t),
490
632
  ]
491
- .sort((r, i) => r.index - i.index)
492
- .forEach((r) => {
493
- r.listener(s, this.listenerOptions(t))
633
+ .sort((n, i) => n.index - i.index)
634
+ .forEach((n) => {
635
+ n.listener(this.listenerOptions(t, s))
494
636
  })
495
637
  }
496
638
  addListenerOptions(t) {
497
639
  this.options = t
498
640
  }
499
- listenerOptions(t) {
500
- return { eventName: t, ...this.options, publish: this.publish.bind(this) }
641
+ listenerOptions(t, s) {
642
+ return {
643
+ eventName: t,
644
+ ...this.options,
645
+ publish: this.publish.bind(this),
646
+ payload: s,
647
+ }
501
648
  }
502
649
  }
503
- const G = () => {
504
- const e = new J()
650
+ const Y = () => {
651
+ const e = new X()
505
652
  return {
506
653
  bus: e,
507
- publish: (n, r) => e.publish(n, r),
508
- subscribe: (n, r) => e.subscribe(n, r),
654
+ publish: (r, n) => e.publish(r, n),
655
+ subscribe: (r, n) => e.subscribe(r, n),
509
656
  }
510
657
  },
511
- $t = Object.freeze(
658
+ Qt = Object.freeze(
512
659
  Object.defineProperty(
513
660
  {
514
661
  __proto__: null,
515
- ExactSubscriptions: I,
516
- FuzzySubscriptions: q,
517
- JaxsBus: J,
518
- createBus: G,
519
- publishPeriodically: kt,
662
+ ExactSubscriptions: Q,
663
+ FuzzySubscriptions: W,
664
+ JaxsBus: X,
665
+ createBus: Y,
666
+ publishPeriodically: Ht,
520
667
  },
521
668
  Symbol.toStringTag,
522
669
  { value: 'Module' },
523
670
  ),
524
671
  ),
525
- Dt = (e, t) => e === t,
526
- Pt = (e, t) => Object.keys(e).length === Object.keys(t).length,
527
- Vt = (e, t) =>
528
- !(g(e) && g(t)) || !Pt(e, t)
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)
529
676
  ? !1
530
677
  : Object.keys(e).every((s) => {
531
- const n = e[s],
532
- r = t[s]
533
- return A(n, r)
678
+ const r = e[s],
679
+ n = t[s]
680
+ return w(r, n)
534
681
  }),
535
- Ft = (e, t) =>
536
- !(v(e) && v(t)) || e.length !== t.length
682
+ tt = (e, t) =>
683
+ !(y(e) && y(t)) || e.length !== t.length
537
684
  ? !1
538
- : e.every((s, n) => {
539
- const r = t[n]
540
- return A(s, r)
685
+ : e.every((s, r) => {
686
+ const n = t[r]
687
+ return w(s, n)
541
688
  }),
542
- A = (e, t) => (g(e) ? Vt(e, t) : v(e) ? Ft(e, t) : Dt(e, t))
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 }
543
691
  class x {
544
692
  constructor(t) {
545
693
  ;(this.name = t.name),
@@ -548,7 +696,7 @@
548
696
  (this.initialValue = structuredClone(t.value))
549
697
  }
550
698
  get value() {
551
- return this._value
699
+ return structuredClone(this._value)
552
700
  }
553
701
  set value(t) {
554
702
  throw new Error('Cannot set value directly. Use an updater!')
@@ -563,114 +711,25 @@
563
711
  } else this.updateValue(t)
564
712
  }
565
713
  updateValue(t) {
566
- A(this._value, t) || ((this._value = t), this.parent.notify(this.name))
714
+ w(this._value, t) || ((this._value = t), this.parent.notify(this.name))
567
715
  }
568
716
  getUpdatedValue(t) {
569
- return t(structuredClone(this.value))
717
+ return t(this.value)
570
718
  }
571
719
  }
572
- class w {
573
- constructor(t) {
574
- this.store = t
575
- }
576
- update(t) {
577
- this.store.update(t)
578
- }
579
- reset() {
580
- this.store.update(this.store.initialValue)
581
- }
582
- get value() {
583
- return this.store.value
584
- }
585
- }
586
- class Lt extends w {
587
- updateAttribute(t, s) {
588
- const n = { ...this.value }
589
- ;(n[t] = s), this.update(n)
590
- }
591
- updateDynamicAttribute(t, s) {
592
- this.isKey(t) && this.isValueType(t, s) && this.updateAttribute(t, s)
593
- }
594
- isKey(t) {
595
- return t in this.store.initialValue
596
- }
597
- isValueType(t, s) {
598
- return typeof this.store.initialValue[t] == typeof s
599
- }
600
- resetAttribute(t) {
601
- const s = { ...this.value },
602
- n = this.store.initialValue[t]
603
- ;(s[t] = n), this.update(s)
604
- }
605
- }
606
- const zt = (e) => new Lt(e)
607
- class Bt extends w {
608
- push(t) {
609
- const s = [...this.value, t]
610
- this.update(s)
611
- }
612
- pop() {
613
- const t = [...this.value],
614
- s = t.pop()
615
- return this.update(t), s
616
- }
617
- unshift(t) {
618
- const s = [t, ...this.value]
619
- this.update(s)
620
- }
621
- shift() {
622
- const t = [...this.value],
623
- s = t.shift()
624
- return this.update(t), s
625
- }
626
- addSorter(t, s) {
627
- this[t] = () => {
628
- this.sortBy(s)
629
- }
630
- }
631
- sortBy(t) {
632
- const s = [...this.value]
633
- s.sort(t), this.update(s)
634
- }
635
- insertAt(t, s) {
636
- const n = [...this.value]
637
- n.splice(t, 0, s), this.update(n)
638
- }
639
- remove(t) {
640
- const s = this.value.reduce((n, r) => (r !== t && n.push(r), n), [])
641
- this.update(s)
642
- }
643
- removeBy(t) {
644
- const s = this.value.reduce((n, r) => (t(r) || n.push(r), n), [])
645
- this.update(s)
646
- }
647
- }
648
- const Kt = (e) => new Bt(e)
649
- class Rt extends w {
650
- toggle() {
651
- const t = !this.value
652
- this.update(t)
653
- }
654
- setTrue() {
655
- this.update(!0)
656
- }
657
- setFalse() {
658
- this.update(!1)
659
- }
660
- }
661
- const Ut = { object: zt, list: Kt, boolean: (e) => new Rt(e) },
662
- N = 'state'
663
- class H {
720
+ const Zt = { object: g, list: f, boolean: v },
721
+ S = 'state'
722
+ class et {
664
723
  constructor(t) {
665
724
  ;(this.publisher = t),
666
725
  (this.stores = {}),
667
- (this.eventNamePrefix = N),
726
+ (this.eventNamePrefix = S),
668
727
  (this.notifications = new Set()),
669
728
  (this.inTransaction = !1)
670
729
  }
671
730
  create(t, s) {
672
- const n = new x({ name: t, parent: this, value: s })
673
- return (this.stores[t] = n), n
731
+ const r = new x({ name: t, parent: this, value: s })
732
+ return (this.stores[t] = r), r
674
733
  }
675
734
  store(t) {
676
735
  return this.stores[t] || new x({ name: t, parent: this, value: void 0 })
@@ -679,7 +738,7 @@
679
738
  return this.store(t).value
680
739
  }
681
740
  getAll(t) {
682
- return t.reduce((s, n) => ((s[n] = this.get(n)), s), {})
741
+ return t.reduce((s, r) => ((s[r] = this.get(r)), s), {})
683
742
  }
684
743
  notify(t) {
685
744
  this.inTransaction ? this.notifications.add(t) : this.publish(t)
@@ -706,22 +765,22 @@
706
765
  return `${this.eventNamePrefix}:${t}`
707
766
  }
708
767
  }
709
- const Q = (e) => new H(e),
710
- Ct = Object.freeze(
768
+ const st = (e) => new et(e),
769
+ te = Object.freeze(
711
770
  Object.defineProperty(
712
771
  {
713
772
  __proto__: null,
714
- State: H,
773
+ State: et,
715
774
  Store: x,
716
- createState: Q,
717
- eventName: N,
718
- updaters: Ut,
775
+ createState: st,
776
+ eventName: S,
777
+ updaters: Zt,
719
778
  },
720
779
  Symbol.toStringTag,
721
780
  { value: 'Module' },
722
781
  ),
723
782
  )
724
- class It {
783
+ class ee {
725
784
  constructor(t) {
726
785
  this.setupDomEnvironment(t)
727
786
  }
@@ -731,7 +790,7 @@
731
790
  this.setupState(),
732
791
  this.addBusOptions(),
733
792
  this.setRenderKit(),
734
- new C({
793
+ new H({
735
794
  window: this.window,
736
795
  document: this.document,
737
796
  publish: this.publish,
@@ -751,11 +810,11 @@
751
810
  : ((this.window = window), (this.document = document))
752
811
  }
753
812
  setupBus() {
754
- const { publish: t, subscribe: s, bus: n } = G()
755
- ;(this.publish = t), (this.subscribe = s), (this.bus = n)
813
+ const { publish: t, subscribe: s, bus: r } = Y()
814
+ ;(this.publish = t), (this.subscribe = s), (this.bus = r)
756
815
  }
757
816
  setupState() {
758
- this.state = Q(this.publish)
817
+ this.state = st(this.publish)
759
818
  }
760
819
  addBusOptions() {
761
820
  this.bus.addListenerOptions({
@@ -774,8 +833,8 @@
774
833
  }
775
834
  }
776
835
  }
777
- const qt = (e = {}) => {
778
- const s = new It(e).setup()
836
+ const se = (e = {}) => {
837
+ const s = new ee(e).setup()
779
838
  return s.startNavigation(), s
780
839
  }
781
840
  var o = ((e) => (
@@ -792,59 +851,59 @@
792
851
  (e[(e.changeText = 10)] = 'changeText'),
793
852
  e
794
853
  ))(o || {})
795
- const Jt = Object.freeze(
854
+ const re = Object.freeze(
796
855
  Object.defineProperty(
797
856
  { __proto__: null, ChangeInstructionTypes: o },
798
857
  Symbol.toStringTag,
799
858
  { value: 'Module' },
800
859
  ),
801
860
  ),
802
- Gt = (e, t) => ({ source: e, target: t, type: o.changeText, data: {} }),
803
- Ht = (e, t) => ({ source: e, target: t, type: o.replaceNode, data: {} }),
804
- Qt = (e, t, s) => ({
861
+ ne = (e, t) => ({ source: e, target: t, type: o.changeText, data: {} }),
862
+ ie = (e, t) => ({ source: e, target: t, type: o.replaceNode, data: {} }),
863
+ oe = (e, t, s) => ({
805
864
  source: e,
806
865
  target: t,
807
866
  data: s,
808
867
  type: o.removeAttribute,
809
868
  }),
810
- Wt = (e, t, s) => ({ source: e, target: t, data: s, type: o.addAttribute }),
811
- Xt = (e, t, s) => ({
869
+ ue = (e, t, s) => ({ source: e, target: t, data: s, type: o.addAttribute }),
870
+ ae = (e, t, s) => ({
812
871
  source: e,
813
872
  target: t,
814
873
  data: s,
815
874
  type: o.updateAttribute,
816
875
  }),
817
- Yt = (e, t, s) => ({ source: e, target: t, data: s, type: o.removeEvent }),
818
- Zt = (e, t, s) => ({ source: e, target: t, data: s, type: o.addEvent }),
819
- te = (e, t, s) => ({ source: e, target: t, data: s, type: o.updateEvent }),
820
- W = (e) => ({ source: e, target: e, type: o.removeNode, data: {} }),
821
- _ = (e, t) => ({ target: e, source: e, type: o.insertNode, data: t }),
822
- ee = (e, t, s) => ({ source: e, target: t, type: o.changeValue, data: s }),
823
- se = (e, t) => (e.type > t.type ? 1 : e.type < t.type ? -1 : 0),
824
- X = { index: -1 }
825
- class ne {
876
+ ce = (e, t, s) => ({ source: e, target: t, data: s, type: o.removeEvent }),
877
+ le = (e, t, s) => ({ source: e, target: t, data: s, type: o.addEvent }),
878
+ he = (e, t, s) => ({ source: e, target: t, data: s, type: o.updateEvent }),
879
+ rt = (e) => ({ source: e, target: e, type: o.removeNode, data: {} }),
880
+ T = (e, t) => ({ target: e, source: e, type: o.insertNode, data: t }),
881
+ de = (e, t, s) => ({ source: e, target: t, type: o.changeValue, data: s }),
882
+ pe = (e, t) => (e.type > t.type ? 1 : e.type < t.type ? -1 : 0),
883
+ nt = { index: -1 }
884
+ class me {
826
885
  constructor() {
827
886
  this.map = {}
828
887
  }
829
888
  populate(t) {
830
- t.forEach((s, n) => {
831
- const r = s.__jsx
832
- r &&
833
- ((this.map[r] = this.map[r] || []),
834
- this.map[r].push({ element: s, index: n }))
889
+ t.forEach((s, r) => {
890
+ const n = s.__jsx
891
+ n &&
892
+ ((this.map[n] = this.map[n] || []),
893
+ this.map[n].push({ element: s, index: r }))
835
894
  })
836
895
  }
837
896
  pullMatch(t) {
838
897
  const s = t && t.__jsx
839
898
  return !s || !(this.map[s] && this.map[s].length)
840
- ? X
899
+ ? nt
841
900
  : this.map[s].shift()
842
901
  }
843
902
  clear(t) {
844
903
  const s = t && t.__jsx
845
904
  if (!(s && this.map[s] && this.map[s].length)) return
846
- const n = this.map[s]
847
- this.map[s] = n.reduce((r, i) => (i.element !== t && r.push(i), r), [])
905
+ const r = this.map[s]
906
+ this.map[s] = r.reduce((n, i) => (i.element !== t && n.push(i), n), [])
848
907
  }
849
908
  check(t) {
850
909
  const s = t && t.__jsx
@@ -854,270 +913,270 @@
854
913
  return Object.values(this.map).flat()
855
914
  }
856
915
  }
857
- const Y = (e) => {
858
- const t = new ne()
916
+ const it = (e) => {
917
+ const t = new me()
859
918
  return t.populate(e), t
860
919
  },
861
- Z = (e, t, s = !1) => {
862
- const n = [],
863
- r = e.attributes,
864
- i = r.length,
920
+ ot = (e, t, s = !1) => {
921
+ const r = [],
922
+ n = e.attributes,
923
+ i = n.length,
865
924
  a = t.attributes,
866
- l = a.length
867
- let u, d, c
925
+ c = a.length
926
+ let u, h, d
868
927
  for (u = 0; u < i; u++) {
869
- c = null
870
- const h = r.item(u)
871
- if (h) {
872
- for (d = 0; d < l; d++) {
873
- const m = a.item(d)
874
- if (m && h.name == m.name) {
875
- c = m
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
876
935
  break
877
936
  }
878
937
  }
879
- c
880
- ? h.value !== c.value &&
881
- n.push(Xt(e, t, { name: h.name, value: c.value, isSvg: s }))
882
- : n.push(Qt(e, t, { name: h.name, isSvg: s }))
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 }))
883
942
  }
884
943
  }
885
- for (u = 0; u < l; u++) {
886
- c = null
887
- const h = a.item(u)
888
- if (h) {
889
- for (d = 0; d < i; d++) {
890
- const m = r.item(d)
891
- if (m && m.name == h.name) {
892
- c = m
944
+ 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
893
952
  break
894
953
  }
895
954
  }
896
- c || n.push(Wt(e, t, { name: h.name, value: h.value, isSvg: s }))
955
+ d || r.push(ue(e, t, { name: l.name, value: l.value, isSvg: s }))
897
956
  }
898
957
  }
899
- return n
958
+ return r
900
959
  },
901
- re = (e, t) => {
960
+ fe = (e, t) => {
902
961
  const s = [],
903
- n = e.eventMaps,
904
- r = t.eventMaps,
905
- i = Object.keys(n),
906
- a = Object.keys(r)
962
+ r = e.eventMaps,
963
+ n = t.eventMaps,
964
+ i = Object.keys(r),
965
+ a = Object.keys(n)
907
966
  return (
908
- i.forEach((l) => {
909
- const u = n[l],
910
- d = r[l]
911
- d
912
- ? d.busEvent !== u.busEvent &&
967
+ i.forEach((c) => {
968
+ const u = r[c],
969
+ h = n[c]
970
+ h
971
+ ? h.busEvent !== u.busEvent &&
913
972
  s.push(
914
- te(e, t, {
915
- name: l,
916
- targetValue: d.listener,
973
+ he(e, t, {
974
+ name: c,
975
+ targetValue: h.listener,
917
976
  sourceValue: u.listener,
918
977
  }),
919
978
  )
920
- : s.push(Yt(e, t, { name: u.domEvent, value: u.listener }))
979
+ : s.push(ce(e, t, { name: u.domEvent, value: u.listener }))
921
980
  }),
922
- a.forEach((l) => {
923
- const u = n[l],
924
- d = r[l]
925
- u || s.push(Zt(e, t, { name: d.domEvent, value: d.listener }))
981
+ a.forEach((c) => {
982
+ const u = r[c],
983
+ h = n[c]
984
+ u || s.push(le(e, t, { name: h.domEvent, value: h.listener }))
926
985
  }),
927
986
  s
928
987
  )
929
988
  },
930
- ie = (e) => e.tagName !== 'INPUT',
931
- oe = (e, t) => e.value === t.value,
932
- ue = (e, t) => {
933
- if (ie(e) || oe(e, t)) return []
989
+ be = (e) => e.tagName !== 'INPUT',
990
+ ve = (e, t) => e.value === t.value,
991
+ ge = (e, t) => {
992
+ if (be(e) || ve(e, t)) return []
934
993
  const s = e,
935
- n = t
936
- return [ee(s, n, { name: 'value', value: n.value })]
994
+ r = t
995
+ return [de(s, r, { name: 'value', value: r.value })]
937
996
  },
938
- ae = (e, t) => {
939
- const s = Z(e, t),
940
- n = re(e, t),
941
- r = ue(e, t)
942
- return s.concat(n).concat(r)
997
+ ye = (e, t) => {
998
+ const s = ot(e, t),
999
+ r = fe(e, t),
1000
+ n = ge(e, t)
1001
+ return s.concat(r).concat(n)
943
1002
  },
944
- ce = (e, t) => Z(e, t, !0),
945
- le = (e, t) => (e.textContent !== t.textContent ? [Gt(e, t)] : []),
946
- he = (e, t, s) => {
947
- let n = []
948
- if (e.nodeType === 1 && ht(e)) {
949
- const r = e,
1003
+ Ee = (e, t) => ot(e, t, !0),
1004
+ Ae = (e, t) => (e.textContent !== t.textContent ? [ne(e, t)] : []),
1005
+ we = (e, t, s) => {
1006
+ let r = []
1007
+ if (e.nodeType === 1 && jt(e)) {
1008
+ const n = e,
950
1009
  i = t,
951
- a = ce(r, i),
952
- l = s(r.childNodes, i.childNodes, r)
953
- n = a.concat(l)
1010
+ a = Ee(n, i),
1011
+ c = s(n.childNodes, i.childNodes, n)
1012
+ r = a.concat(c)
954
1013
  } else if (e.nodeType === 1) {
955
- const r = e,
1014
+ const n = e,
956
1015
  i = t,
957
- a = ae(r, i),
958
- l = s(r.childNodes, i.childNodes, r)
959
- n = a.concat(l)
960
- } else e.nodeType === 3 && (n = le(e, t))
961
- return n
1016
+ a = ye(n, i),
1017
+ c = s(n.childNodes, i.childNodes, n)
1018
+ r = a.concat(c)
1019
+ } else e.nodeType === 3 && (r = Ae(e, t))
1020
+ return r
962
1021
  },
963
- tt = (e, t, s) => {
964
- const n = [],
965
- r = de(e, t),
966
- i = Y(e),
967
- a = Y(t),
968
- l = []
1022
+ ut = (e, t, s) => {
1023
+ const r = [],
1024
+ n = Ne(e, t),
1025
+ i = it(e),
1026
+ a = it(t),
1027
+ c = []
969
1028
  let u = 0
970
- for (; u < r; u++) {
971
- const c = e[u],
972
- h = t[u]
973
- if (h && a.check(h)) {
974
- const m = i.pullMatch(h)
975
- a.clear(h),
1029
+ 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),
976
1035
  m.element
977
- ? (m.index !== u && n.push(_(m.element, { parent: s, index: u })),
978
- l.push({ source: m.element, target: h }))
979
- : c
980
- ? a.check(c)
981
- ? n.push(_(h, { parent: s, index: u }))
982
- : (i.clear(c), n.push(Ht(c, h)))
983
- : n.push(_(h, { parent: s, index: u }))
984
- } else c && i.pullMatch(c).element && n.push(W(c))
1036
+ ? (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))
985
1044
  }
986
- i.remaining().forEach(({ element: c }) => {
987
- n.push(W(c))
1045
+ i.remaining().forEach(({ element: d }) => {
1046
+ r.push(rt(d))
988
1047
  })
989
- const d = l.reduce(
990
- (c, { source: h, target: m }) => c.concat(he(h, m, tt)),
1048
+ const h = c.reduce(
1049
+ (d, { source: l, target: m }) => d.concat(we(l, m, ut)),
991
1050
  [],
992
1051
  )
993
- return n.concat(d).sort(se)
1052
+ return r.concat(h).sort(pe)
994
1053
  },
995
- de = (e, t) => {
1054
+ Ne = (e, t) => {
996
1055
  const s = e.length,
997
- n = t.length
998
- return s > n ? s : n
1056
+ r = t.length
1057
+ return s > r ? s : r
999
1058
  },
1000
- pe = (e, t, s) => {
1001
- const n = tt(e, t, s)
1059
+ _e = (e, t, s) => {
1060
+ const r = ut(e, t, s)
1002
1061
  return (
1003
- n.forEach((r) => {
1004
- me(r)
1062
+ r.forEach((n) => {
1063
+ xe(n)
1005
1064
  }),
1006
- n
1065
+ r
1007
1066
  )
1008
1067
  },
1009
- me = (e) => {
1010
- ;(Se[e.type] || fe)(e)
1068
+ xe = (e) => {
1069
+ ;(Fe[e.type] || Se)(e)
1011
1070
  },
1012
- fe = (e) => {},
1013
- be = (e) => {
1071
+ Se = (e) => {},
1072
+ Te = (e) => {
1014
1073
  const { source: t, target: s } = e
1015
1074
  t.nodeValue = s.textContent
1016
1075
  },
1017
- ve = (e) => {
1076
+ je = (e) => {
1018
1077
  const { source: t } = e
1019
1078
  t.remove()
1020
1079
  },
1021
- ge = (e) => {
1080
+ Oe = (e) => {
1022
1081
  const { target: t, data: s } = e,
1023
- { parent: n, index: r } = s,
1024
- i = n.childNodes[r]
1025
- i ? i && i !== t && n.insertBefore(t, i) : n.appendChild(t)
1082
+ { parent: r, index: n } = s,
1083
+ i = r.childNodes[n]
1084
+ i ? i && i !== t && r.insertBefore(t, i) : r.appendChild(t)
1026
1085
  },
1027
- ye = (e) => {
1086
+ Me = (e) => {
1028
1087
  const { source: t, target: s } = e
1029
1088
  t.replaceWith(s)
1030
1089
  },
1031
- Ee = (e) => {
1090
+ ke = (e) => {
1032
1091
  const { source: t, data: s } = e,
1033
- { name: n, isSvg: r } = s
1034
- r ? t.removeAttributeNS(null, n) : t.removeAttribute(n)
1092
+ { name: r, isSvg: n } = s
1093
+ n ? t.removeAttributeNS(null, r) : t.removeAttribute(r)
1035
1094
  },
1036
- et = (e) => {
1095
+ at = (e) => {
1037
1096
  const { source: t, data: s } = e,
1038
- { name: n, value: r, isSvg: i } = s
1039
- i ? t.setAttributeNS(null, n, r) : t.setAttribute(n, r)
1097
+ { name: r, value: n, isSvg: i } = s
1098
+ i ? t.setAttributeNS(null, r, n) : t.setAttribute(r, n)
1040
1099
  },
1041
- Ae = (e) => {
1042
- et(e)
1100
+ $e = (e) => {
1101
+ at(e)
1043
1102
  },
1044
- xe = (e) => {
1103
+ De = (e) => {
1045
1104
  const t = e.data,
1046
1105
  s = e.source,
1047
- { name: n, value: r } = t
1048
- s.removeEventListener(n, r)
1106
+ { name: r, value: n } = t
1107
+ s.removeEventListener(r, n)
1049
1108
  },
1050
- we = (e) => {
1109
+ Pe = (e) => {
1051
1110
  const t = e.data,
1052
1111
  s = e.source,
1053
- { name: n, value: r } = t
1054
- s.addEventListener(n, r)
1112
+ { name: r, value: n } = t
1113
+ s.addEventListener(r, n)
1055
1114
  },
1056
- Ne = (e) => {
1115
+ Be = (e) => {
1057
1116
  const t = e.data,
1058
1117
  s = e.source,
1059
- { name: n, sourceValue: r, targetValue: i } = t
1060
- s.removeEventListener(n, r), s.addEventListener(n, i)
1118
+ { name: r, sourceValue: n, targetValue: i } = t
1119
+ s.removeEventListener(r, n), s.addEventListener(r, i)
1061
1120
  },
1062
- _e = (e) => {
1121
+ Ve = (e) => {
1063
1122
  const t = e.data,
1064
1123
  s = e.source,
1065
- { value: n } = t
1066
- s.value = n
1124
+ { value: r } = t
1125
+ s.value = r
1067
1126
  },
1068
- Se = {
1069
- [o.changeText]: be,
1070
- [o.removeNode]: ve,
1071
- [o.insertNode]: ge,
1072
- [o.replaceNode]: ye,
1073
- [o.removeAttribute]: Ee,
1074
- [o.addAttribute]: et,
1075
- [o.updateAttribute]: Ae,
1076
- [o.removeEvent]: xe,
1077
- [o.addEvent]: we,
1078
- [o.updateEvent]: Ne,
1079
- [o.changeValue]: _e,
1127
+ Fe = {
1128
+ [o.changeText]: Te,
1129
+ [o.removeNode]: je,
1130
+ [o.insertNode]: Oe,
1131
+ [o.replaceNode]: Me,
1132
+ [o.removeAttribute]: ke,
1133
+ [o.addAttribute]: at,
1134
+ [o.updateAttribute]: $e,
1135
+ [o.removeEvent]: De,
1136
+ [o.addEvent]: Pe,
1137
+ [o.updateEvent]: Be,
1138
+ [o.changeValue]: Ve,
1080
1139
  },
1081
- Te = (e, t, s) => {
1082
- const n = [...t]
1140
+ Le = (e, t, s) => {
1141
+ const r = [...t]
1083
1142
  return (
1084
- e.forEach((r) => {
1085
- je(r, n, s)
1143
+ e.forEach((n) => {
1144
+ ze(n, r, s)
1086
1145
  }),
1087
- n
1146
+ r
1088
1147
  )
1089
1148
  },
1090
- je = (e, t, s) => {
1091
- const n = $e[e.type]
1092
- n && n(e, t, s)
1149
+ ze = (e, t, s) => {
1150
+ const r = qe[e.type]
1151
+ r && r(e, t, s)
1093
1152
  },
1094
- Oe = (e, t) => {
1153
+ Ke = (e, t) => {
1095
1154
  const { source: s } = e,
1096
- n = t.indexOf(s)
1097
- n >= 0 && t.splice(n, 1)
1155
+ r = t.indexOf(s)
1156
+ r >= 0 && t.splice(r, 1)
1098
1157
  },
1099
- Me = (e, t, s) => {
1100
- const { target: n } = e,
1101
- r = e.data,
1102
- { index: i, parent: a } = r
1103
- s === a && t.splice(i, 0, n)
1158
+ Re = (e, t, s) => {
1159
+ const { target: r } = e,
1160
+ n = e.data,
1161
+ { index: i, parent: a } = n
1162
+ s === a && t.splice(i, 0, r)
1104
1163
  },
1105
- ke = (e, t) => {
1106
- const { target: s, source: n } = e,
1107
- r = t.indexOf(n)
1108
- r >= 0 && (t[r] = s)
1164
+ Ue = (e, t) => {
1165
+ const { target: s, source: r } = e,
1166
+ n = t.indexOf(r)
1167
+ n >= 0 && (t[n] = s)
1109
1168
  },
1110
- $e = { [o.removeNode]: Oe, [o.insertNode]: Me, [o.replaceNode]: ke }
1111
- class De {
1169
+ qe = { [o.removeNode]: Ke, [o.insertNode]: Re, [o.replaceNode]: Ue }
1170
+ class Ce {
1112
1171
  constructor({
1113
1172
  Template: t,
1114
1173
  subscriptions: s,
1115
- attributes: n,
1116
- viewModel: r,
1174
+ attributes: r,
1175
+ viewModel: n,
1117
1176
  }) {
1118
1177
  ;(this.Template = t),
1119
- (this.viewModel = r),
1120
- (this.attributes = n),
1178
+ (this.viewModel = n),
1179
+ (this.attributes = r),
1121
1180
  (this.subscriptions = s),
1122
1181
  (this.dom = []),
1123
1182
  (this.parentElement = null)
@@ -1136,17 +1195,17 @@
1136
1195
  ...this.attributes,
1137
1196
  ...this.viewModel(t.state.getAll(this.subscriptions)),
1138
1197
  },
1139
- n = this.Template(s)
1140
- return n ? n.render(t) : []
1198
+ r = this.Template(s)
1199
+ return r ? r.render(t) : []
1141
1200
  }
1142
1201
  rerender() {
1143
1202
  if (!this.parentElement && this.dom[0]) {
1144
- const n = this.dom[0].parentElement
1145
- this.parentElement = n
1203
+ const r = this.dom[0].parentElement
1204
+ this.parentElement = r
1146
1205
  }
1147
1206
  const t = this.generateDom(this.renderKit),
1148
- s = pe(this.dom, t, this.parentElement)
1149
- this.dom = Te(s, this.dom, this.parentElement)
1207
+ s = _e(this.dom, t, this.parentElement)
1208
+ this.dom = Le(s, this.dom, this.parentElement)
1150
1209
  }
1151
1210
  subscribeForRerender() {
1152
1211
  const { subscribe: t } = this.renderKit
@@ -1155,68 +1214,77 @@
1155
1214
  })
1156
1215
  }
1157
1216
  eventName(t) {
1158
- return `${N}:${t}`
1217
+ return `${S}:${t}`
1159
1218
  }
1160
1219
  }
1161
- const Pe = (e) => e,
1162
- st = ({ Template: e, viewModel: t, subscriptions: s }) => (
1220
+ const Ie = (e) => e,
1221
+ ct = ({ Template: e, viewModel: t, subscriptions: s }) => (
1163
1222
  (s = s || []),
1164
- (t = t || Pe),
1165
- (n) =>
1166
- new De({ Template: e, viewModel: t, subscriptions: s, attributes: n })
1223
+ (t = t || Ie),
1224
+ (r) =>
1225
+ new Ce({ Template: e, viewModel: t, subscriptions: s, attributes: r })
1167
1226
  ),
1168
- Ve =
1227
+ Je =
1169
1228
  (e) =>
1170
1229
  ({ path: t }) =>
1171
1230
  t === e,
1172
- Fe = () => !0,
1173
- nt =
1231
+ Ge = () => !0,
1232
+ lt =
1174
1233
  (e) =>
1175
1234
  ({ route: t }) => {
1176
- const s = e.find((n) => n.match(t))
1235
+ const s = e.find((r) => r.match(t))
1177
1236
  return s && s.Partial
1178
1237
  },
1179
- Le = Object.freeze(
1238
+ He = Object.freeze(
1180
1239
  Object.defineProperty(
1181
- { __proto__: null, buildRouter: nt, catchAll: Fe, exactPathMatch: Ve },
1240
+ { __proto__: null, buildRouter: lt, catchAll: Ge, exactPathMatch: Je },
1182
1241
  Symbol.toStringTag,
1183
1242
  { value: 'Module' },
1184
1243
  ),
1185
1244
  ),
1186
- ze = () => ({ render: (e, t) => [] }),
1187
- Be = (e) => {
1188
- const t = nt(e)
1189
- return st({
1190
- Template: ({ route: n }) => (t({ route: n }) || ze)(),
1245
+ Qe = () => ({ render: (e, t) => [] }),
1246
+ We = (e) => {
1247
+ const t = lt(e)
1248
+ return ct({
1249
+ Template: ({ route: r }) => (t({ route: r }) || Qe)(),
1191
1250
  subscriptions: ['route'],
1192
1251
  })
1193
1252
  },
1194
- Ke = Object.freeze(
1253
+ Xe = Object.freeze(
1195
1254
  Object.defineProperty(
1196
1255
  {
1197
1256
  __proto__: null,
1198
- createRouteState: P,
1199
- events: St,
1200
- extractQueryParams: L,
1201
- findHref: V,
1202
- navigate: E,
1203
- onLinkClick: F,
1204
- onLocationChange: z,
1205
- start: Tt,
1257
+ createRouteState: z,
1258
+ events: qt,
1259
+ extractQueryParams: U,
1260
+ findHref: K,
1261
+ navigate: _,
1262
+ onLinkClick: R,
1263
+ onLocationChange: q,
1264
+ start: Ct,
1206
1265
  },
1207
1266
  Symbol.toStringTag,
1208
1267
  { value: 'Module' },
1209
1268
  ),
1210
- )
1211
- ;(p.JaxsTypes = Jt),
1212
- (p.appBuilding = jt),
1213
- (p.bind = st),
1214
- (p.createApp = qt),
1215
- (p.jsx = M),
1216
- (p.messageBus = $t),
1217
- (p.navigation = Ke),
1218
- (p.routedView = Be),
1219
- (p.routing = Le),
1220
- (p.state = Ct),
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),
1221
1289
  Object.defineProperty(p, Symbol.toStringTag, { value: 'Module' })
1222
1290
  })