jaxs 0.8.0 → 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],
166
+ Nt = (e, t, s) => {
167
+ const r = {}
168
+ for (const n in t) {
169
+ const i = t[n],
29
170
  a = (c) => s(i, c)
30
- e.addEventListener(r, a),
31
- (n[r] = { domEvent: r, busEvent: i, listener: a })
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,136 +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 = ({ payload: 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) => {
435
+ R = (e) => {
295
436
  const t = e.payload
296
437
  if (!t || !t.target) return
297
438
  t.preventDefault()
298
- const s = V(t.target)
299
- E({ ...e, payload: s })
439
+ const s = K(t.target)
440
+ _({ ...e, payload: s })
300
441
  },
301
- L = (e) =>
442
+ U = (e) =>
302
443
  e
303
444
  .replace(/^\?/, '')
304
445
  .split('&')
305
446
  .reduce((t, s) => {
306
447
  if (!s) return t
307
- const n = s.split('=')
308
- return (t[n[0]] = n[1]), t
448
+ const r = s.split('=')
449
+ return (t[r[0]] = r[1]), t
309
450
  }, {}),
310
- z = (e) => {
311
- const { state: t, publish: s, window: n } = e,
312
- { host: r, pathname: i, search: a } = n.location,
451
+ q = (e) => {
452
+ const { state: t, publish: s, window: r } = e,
453
+ { host: n, pathname: i, search: a } = r.location,
313
454
  c = i,
314
- u = L(a),
315
- h = { host: r, path: c, query: u }
316
- t.store('route').update(h), s(D, h)
455
+ u = U(a),
456
+ h = { host: n, path: c, query: u }
457
+ t.store('route').update(h), s(L, h)
317
458
  },
318
- B = (e) => {
459
+ C = (e) => {
319
460
  const { subscribe: t } = e
320
- t(k, F),
321
- t($, (s) => {
322
- E(s)
461
+ t(V, R),
462
+ t(F, (s) => {
463
+ _(s)
323
464
  })
324
465
  },
325
- K = (e) => {
326
- const { publish: t, subscribe: s, state: n, window: r } = e
327
- 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)
328
469
  },
329
- R = (e) => {
330
- setTimeout(() => e.publish(b, null), 0)
470
+ J = (e) => {
471
+ setTimeout(() => e.publish(E, null), 0)
331
472
  },
332
- U = (e) => {
333
- K(e), B(e), R(e)
473
+ G = (e) => {
474
+ I(e), C(e), J(e)
334
475
  },
335
- Tt = Object.freeze(
476
+ Ct = Object.freeze(
336
477
  Object.defineProperty(
337
478
  {
338
479
  __proto__: null,
339
- publishLocation: R,
340
- startNavigation: U,
341
- subscribeToHistoryChange: K,
342
- subscribeToNavigation: B,
480
+ publishLocation: J,
481
+ startNavigation: G,
482
+ subscribeToHistoryChange: I,
483
+ subscribeToNavigation: C,
343
484
  },
344
485
  Symbol.toStringTag,
345
486
  { value: 'Module' },
346
487
  ),
347
488
  )
348
- class C {
489
+ class H {
349
490
  constructor({
350
491
  window: t,
351
492
  document: s,
352
- publish: n,
353
- subscribe: r,
493
+ publish: r,
494
+ subscribe: n,
354
495
  bus: i,
355
496
  state: a,
356
497
  renderKit: c,
357
498
  }) {
358
499
  ;(this.window = t),
359
500
  (this.document = s),
360
- (this.publish = n),
361
- (this.subscribe = r),
501
+ (this.publish = r),
502
+ (this.subscribe = n),
362
503
  (this.bus = i),
363
504
  (this.state = a),
364
505
  (this.renderKit = c),
365
506
  (this.roots = [])
366
507
  }
367
508
  render(t, s) {
368
- const n = _t(t, s, this.renderKit)
369
- return this.roots.push(n), n
509
+ const r = Ut(t, s, this.renderKit)
510
+ return this.roots.push(r), r
370
511
  }
371
512
  startNavigation() {
372
- U(this)
513
+ G(this)
373
514
  }
374
515
  }
375
- const jt = Object.freeze(
376
- Object.defineProperty({ __proto__: null, App: C }, Symbol.toStringTag, {
516
+ const It = Object.freeze(
517
+ Object.defineProperty({ __proto__: null, App: H }, Symbol.toStringTag, {
377
518
  value: 'Module',
378
519
  }),
379
520
  )
380
- class I {
521
+ class Q {
381
522
  constructor() {
382
523
  this.lookup = {}
383
524
  }
384
- add(t, s, n) {
525
+ add(t, s, r) {
385
526
  this.ensureArrayFor(t)
386
- const r = { listener: s, index: n, matcher: t }
387
- 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)
388
529
  }
389
530
  remove(t) {
390
531
  this.lookup[t.matcher] &&
391
532
  (this.lookup[t.matcher] = this.lookup[t.matcher].reduce(
392
- (s, n) => (n !== t && s.push(n), s),
533
+ (s, r) => (r !== t && s.push(r), s),
393
534
  [],
394
535
  ))
395
536
  }
@@ -400,23 +541,23 @@
400
541
  this.lookup[t] || (this.lookup[t] = [])
401
542
  }
402
543
  }
403
- class q {
544
+ class W {
404
545
  constructor() {
405
546
  this.lookup = []
406
547
  }
407
- add(t, s, n) {
408
- const r = { listener: s, index: n, matcher: t }
409
- 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)
410
551
  }
411
552
  remove(t) {
412
- 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), [])
413
554
  }
414
555
  matches(t) {
415
556
  return this.lookup.filter((s) => s.matcher.test(t))
416
557
  }
417
558
  }
418
- class Ot {
419
- constructor({ publish: t, event: s, payload: n, timer: r }) {
559
+ class Jt {
560
+ constructor({ publish: t, event: s, payload: r, timer: n }) {
420
561
  ;(this.setNewTimeout = () => {
421
562
  this.stopped ||
422
563
  setTimeout(() => {
@@ -431,10 +572,10 @@
431
572
  })),
432
573
  (this.publish = t),
433
574
  (this.event = s),
434
- (this.payload = n || null),
575
+ (this.payload = r || null),
435
576
  (this.stop = this.stopTimeout.bind(this)),
436
577
  (this.stopped = !1),
437
- (this.timer = r),
578
+ (this.timer = n),
438
579
  (this.startedAt = new Date().getTime()),
439
580
  (this.callCount = 0)
440
581
  }
@@ -452,36 +593,36 @@
452
593
  ((this.callCount += 1), this.publish(this.event, this.payload))
453
594
  }
454
595
  }
455
- const Mt = (e) => {
596
+ const Gt = (e) => {
456
597
  const { offset: t, period: s } = e,
457
- n = ({ callCount: r }) => (t && r == 0 ? t : s)
598
+ r = ({ callCount: n }) => (t && n == 0 ? t : s)
458
599
  return {
459
600
  event: e.event,
460
601
  publish: e.publish,
461
602
  payload: e.payload,
462
- timer: n,
603
+ timer: r,
463
604
  }
464
605
  },
465
- kt = (e) => {
606
+ Ht = (e) => {
466
607
  let t
467
- 'timer' in e ? (t = e) : (t = Mt(e))
468
- const s = new Ot(t)
608
+ 'timer' in e ? (t = e) : (t = Gt(e))
609
+ const s = new Jt(t)
469
610
  return s.start(), s.stop
470
611
  }
471
- class J {
612
+ class X {
472
613
  constructor() {
473
- ;(this.exactSubscriptions = new I()),
474
- (this.fuzzySubscriptions = new q()),
614
+ ;(this.exactSubscriptions = new Q()),
615
+ (this.fuzzySubscriptions = new W()),
475
616
  (this.currentIndex = 0)
476
617
  }
477
618
  subscribe(t, s) {
478
- let n
619
+ let r
479
620
  return (
480
621
  typeof t == 'string'
481
- ? (n = this.exactSubscriptions.add(t, s, this.currentIndex))
482
- : (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)),
483
624
  (this.currentIndex += 1),
484
- n
625
+ r
485
626
  )
486
627
  }
487
628
  publish(t, s) {
@@ -489,9 +630,9 @@
489
630
  ...this.exactSubscriptions.matches(t),
490
631
  ...this.fuzzySubscriptions.matches(t),
491
632
  ]
492
- .sort((r, i) => r.index - i.index)
493
- .forEach((r) => {
494
- r.listener(this.listenerOptions(t, s))
633
+ .sort((n, i) => n.index - i.index)
634
+ .forEach((n) => {
635
+ n.listener(this.listenerOptions(t, s))
495
636
  })
496
637
  }
497
638
  addListenerOptions(t) {
@@ -506,46 +647,47 @@
506
647
  }
507
648
  }
508
649
  }
509
- const G = () => {
510
- const e = new J()
650
+ const Y = () => {
651
+ const e = new X()
511
652
  return {
512
653
  bus: e,
513
- publish: (n, r) => e.publish(n, r),
514
- subscribe: (n, r) => e.subscribe(n, r),
654
+ publish: (r, n) => e.publish(r, n),
655
+ subscribe: (r, n) => e.subscribe(r, n),
515
656
  }
516
657
  },
517
- $t = Object.freeze(
658
+ Qt = Object.freeze(
518
659
  Object.defineProperty(
519
660
  {
520
661
  __proto__: null,
521
- ExactSubscriptions: I,
522
- FuzzySubscriptions: q,
523
- JaxsBus: J,
524
- createBus: G,
525
- publishPeriodically: kt,
662
+ ExactSubscriptions: Q,
663
+ FuzzySubscriptions: W,
664
+ JaxsBus: X,
665
+ createBus: Y,
666
+ publishPeriodically: Ht,
526
667
  },
527
668
  Symbol.toStringTag,
528
669
  { value: 'Module' },
529
670
  ),
530
671
  ),
531
- Dt = (e, t) => e === t,
532
- Pt = (e, t) => Object.keys(e).length === Object.keys(t).length,
533
- Vt = (e, t) =>
534
- !(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)
535
676
  ? !1
536
677
  : Object.keys(e).every((s) => {
537
- const n = e[s],
538
- r = t[s]
539
- return A(n, r)
678
+ const r = e[s],
679
+ n = t[s]
680
+ return w(r, n)
540
681
  }),
541
- Ft = (e, t) =>
542
- !(v(e) && v(t)) || e.length !== t.length
682
+ tt = (e, t) =>
683
+ !(y(e) && y(t)) || e.length !== t.length
543
684
  ? !1
544
- : e.every((s, n) => {
545
- const r = t[n]
546
- return A(s, r)
685
+ : e.every((s, r) => {
686
+ const n = t[r]
687
+ return w(s, n)
547
688
  }),
548
- 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 }
549
691
  class x {
550
692
  constructor(t) {
551
693
  ;(this.name = t.name),
@@ -554,7 +696,7 @@
554
696
  (this.initialValue = structuredClone(t.value))
555
697
  }
556
698
  get value() {
557
- return this._value
699
+ return structuredClone(this._value)
558
700
  }
559
701
  set value(t) {
560
702
  throw new Error('Cannot set value directly. Use an updater!')
@@ -569,114 +711,25 @@
569
711
  } else this.updateValue(t)
570
712
  }
571
713
  updateValue(t) {
572
- 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))
573
715
  }
574
716
  getUpdatedValue(t) {
575
- return t(structuredClone(this.value))
576
- }
577
- }
578
- class w {
579
- constructor(t) {
580
- this.store = t
581
- }
582
- update(t) {
583
- this.store.update(t)
584
- }
585
- reset() {
586
- this.store.update(this.store.initialValue)
587
- }
588
- get value() {
589
- return this.store.value
590
- }
591
- }
592
- class Lt extends w {
593
- updateAttribute(t, s) {
594
- const n = { ...this.value }
595
- ;(n[t] = s), this.update(n)
596
- }
597
- updateDynamicAttribute(t, s) {
598
- this.isKey(t) && this.isValueType(t, s) && this.updateAttribute(t, s)
599
- }
600
- isKey(t) {
601
- return t in this.store.initialValue
602
- }
603
- isValueType(t, s) {
604
- return typeof this.store.initialValue[t] == typeof s
605
- }
606
- resetAttribute(t) {
607
- const s = { ...this.value },
608
- n = this.store.initialValue[t]
609
- ;(s[t] = n), this.update(s)
610
- }
611
- }
612
- const zt = (e) => new Lt(e)
613
- class Bt extends w {
614
- push(t) {
615
- const s = [...this.value, t]
616
- this.update(s)
617
- }
618
- pop() {
619
- const t = [...this.value],
620
- s = t.pop()
621
- return this.update(t), s
622
- }
623
- unshift(t) {
624
- const s = [t, ...this.value]
625
- this.update(s)
626
- }
627
- shift() {
628
- const t = [...this.value],
629
- s = t.shift()
630
- return this.update(t), s
631
- }
632
- addSorter(t, s) {
633
- this[t] = () => {
634
- this.sortBy(s)
635
- }
636
- }
637
- sortBy(t) {
638
- const s = [...this.value]
639
- s.sort(t), this.update(s)
640
- }
641
- insertAt(t, s) {
642
- const n = [...this.value]
643
- n.splice(t, 0, s), this.update(n)
644
- }
645
- remove(t) {
646
- const s = this.value.reduce((n, r) => (r !== t && n.push(r), n), [])
647
- this.update(s)
648
- }
649
- removeBy(t) {
650
- const s = this.value.reduce((n, r) => (t(r) || n.push(r), n), [])
651
- this.update(s)
717
+ return t(this.value)
652
718
  }
653
719
  }
654
- const Kt = (e) => new Bt(e)
655
- class Rt extends w {
656
- toggle() {
657
- const t = !this.value
658
- this.update(t)
659
- }
660
- setTrue() {
661
- this.update(!0)
662
- }
663
- setFalse() {
664
- this.update(!1)
665
- }
666
- }
667
- const Ut = { object: zt, list: Kt, boolean: (e) => new Rt(e) },
668
- N = 'state'
669
- class H {
720
+ const Zt = { object: g, list: f, boolean: v },
721
+ S = 'state'
722
+ class et {
670
723
  constructor(t) {
671
724
  ;(this.publisher = t),
672
725
  (this.stores = {}),
673
- (this.eventNamePrefix = N),
726
+ (this.eventNamePrefix = S),
674
727
  (this.notifications = new Set()),
675
728
  (this.inTransaction = !1)
676
729
  }
677
730
  create(t, s) {
678
- const n = new x({ name: t, parent: this, value: s })
679
- return (this.stores[t] = n), n
731
+ const r = new x({ name: t, parent: this, value: s })
732
+ return (this.stores[t] = r), r
680
733
  }
681
734
  store(t) {
682
735
  return this.stores[t] || new x({ name: t, parent: this, value: void 0 })
@@ -685,7 +738,7 @@
685
738
  return this.store(t).value
686
739
  }
687
740
  getAll(t) {
688
- return t.reduce((s, n) => ((s[n] = this.get(n)), s), {})
741
+ return t.reduce((s, r) => ((s[r] = this.get(r)), s), {})
689
742
  }
690
743
  notify(t) {
691
744
  this.inTransaction ? this.notifications.add(t) : this.publish(t)
@@ -712,22 +765,22 @@
712
765
  return `${this.eventNamePrefix}:${t}`
713
766
  }
714
767
  }
715
- const Q = (e) => new H(e),
716
- Ct = Object.freeze(
768
+ const st = (e) => new et(e),
769
+ te = Object.freeze(
717
770
  Object.defineProperty(
718
771
  {
719
772
  __proto__: null,
720
- State: H,
773
+ State: et,
721
774
  Store: x,
722
- createState: Q,
723
- eventName: N,
724
- updaters: Ut,
775
+ createState: st,
776
+ eventName: S,
777
+ updaters: Zt,
725
778
  },
726
779
  Symbol.toStringTag,
727
780
  { value: 'Module' },
728
781
  ),
729
782
  )
730
- class It {
783
+ class ee {
731
784
  constructor(t) {
732
785
  this.setupDomEnvironment(t)
733
786
  }
@@ -737,7 +790,7 @@
737
790
  this.setupState(),
738
791
  this.addBusOptions(),
739
792
  this.setRenderKit(),
740
- new C({
793
+ new H({
741
794
  window: this.window,
742
795
  document: this.document,
743
796
  publish: this.publish,
@@ -757,11 +810,11 @@
757
810
  : ((this.window = window), (this.document = document))
758
811
  }
759
812
  setupBus() {
760
- const { publish: t, subscribe: s, bus: n } = G()
761
- ;(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)
762
815
  }
763
816
  setupState() {
764
- this.state = Q(this.publish)
817
+ this.state = st(this.publish)
765
818
  }
766
819
  addBusOptions() {
767
820
  this.bus.addListenerOptions({
@@ -780,8 +833,8 @@
780
833
  }
781
834
  }
782
835
  }
783
- const qt = (e = {}) => {
784
- const s = new It(e).setup()
836
+ const se = (e = {}) => {
837
+ const s = new ee(e).setup()
785
838
  return s.startNavigation(), s
786
839
  }
787
840
  var o = ((e) => (
@@ -798,59 +851,59 @@
798
851
  (e[(e.changeText = 10)] = 'changeText'),
799
852
  e
800
853
  ))(o || {})
801
- const Jt = Object.freeze(
854
+ const re = Object.freeze(
802
855
  Object.defineProperty(
803
856
  { __proto__: null, ChangeInstructionTypes: o },
804
857
  Symbol.toStringTag,
805
858
  { value: 'Module' },
806
859
  ),
807
860
  ),
808
- Gt = (e, t) => ({ source: e, target: t, type: o.changeText, data: {} }),
809
- Ht = (e, t) => ({ source: e, target: t, type: o.replaceNode, data: {} }),
810
- 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) => ({
811
864
  source: e,
812
865
  target: t,
813
866
  data: s,
814
867
  type: o.removeAttribute,
815
868
  }),
816
- Wt = (e, t, s) => ({ source: e, target: t, data: s, type: o.addAttribute }),
817
- Xt = (e, t, s) => ({
869
+ ue = (e, t, s) => ({ source: e, target: t, data: s, type: o.addAttribute }),
870
+ ae = (e, t, s) => ({
818
871
  source: e,
819
872
  target: t,
820
873
  data: s,
821
874
  type: o.updateAttribute,
822
875
  }),
823
- Yt = (e, t, s) => ({ source: e, target: t, data: s, type: o.removeEvent }),
824
- Zt = (e, t, s) => ({ source: e, target: t, data: s, type: o.addEvent }),
825
- te = (e, t, s) => ({ source: e, target: t, data: s, type: o.updateEvent }),
826
- W = (e) => ({ source: e, target: e, type: o.removeNode, data: {} }),
827
- _ = (e, t) => ({ target: e, source: e, type: o.insertNode, data: t }),
828
- ee = (e, t, s) => ({ source: e, target: t, type: o.changeValue, data: s }),
829
- se = (e, t) => (e.type > t.type ? 1 : e.type < t.type ? -1 : 0),
830
- X = { index: -1 }
831
- 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 {
832
885
  constructor() {
833
886
  this.map = {}
834
887
  }
835
888
  populate(t) {
836
- t.forEach((s, n) => {
837
- const r = s.__jsx
838
- r &&
839
- ((this.map[r] = this.map[r] || []),
840
- 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 }))
841
894
  })
842
895
  }
843
896
  pullMatch(t) {
844
897
  const s = t && t.__jsx
845
898
  return !s || !(this.map[s] && this.map[s].length)
846
- ? X
899
+ ? nt
847
900
  : this.map[s].shift()
848
901
  }
849
902
  clear(t) {
850
903
  const s = t && t.__jsx
851
904
  if (!(s && this.map[s] && this.map[s].length)) return
852
- const n = this.map[s]
853
- 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), [])
854
907
  }
855
908
  check(t) {
856
909
  const s = t && t.__jsx
@@ -860,20 +913,20 @@
860
913
  return Object.values(this.map).flat()
861
914
  }
862
915
  }
863
- const Y = (e) => {
864
- const t = new ne()
916
+ const it = (e) => {
917
+ const t = new me()
865
918
  return t.populate(e), t
866
919
  },
867
- Z = (e, t, s = !1) => {
868
- const n = [],
869
- r = e.attributes,
870
- i = r.length,
920
+ ot = (e, t, s = !1) => {
921
+ const r = [],
922
+ n = e.attributes,
923
+ i = n.length,
871
924
  a = t.attributes,
872
925
  c = a.length
873
926
  let u, h, d
874
927
  for (u = 0; u < i; u++) {
875
928
  d = null
876
- const l = r.item(u)
929
+ const l = n.item(u)
877
930
  if (l) {
878
931
  for (h = 0; h < c; h++) {
879
932
  const m = a.item(h)
@@ -884,8 +937,8 @@
884
937
  }
885
938
  d
886
939
  ? l.value !== d.value &&
887
- n.push(Xt(e, t, { name: l.name, value: d.value, isSvg: s }))
888
- : n.push(Qt(e, t, { name: l.name, isSvg: s }))
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 }))
889
942
  }
890
943
  }
891
944
  for (u = 0; u < c; u++) {
@@ -893,237 +946,237 @@
893
946
  const l = a.item(u)
894
947
  if (l) {
895
948
  for (h = 0; h < i; h++) {
896
- const m = r.item(h)
949
+ const m = n.item(h)
897
950
  if (m && m.name == l.name) {
898
951
  d = m
899
952
  break
900
953
  }
901
954
  }
902
- d || n.push(Wt(e, t, { name: l.name, value: l.value, isSvg: s }))
955
+ d || r.push(ue(e, t, { name: l.name, value: l.value, isSvg: s }))
903
956
  }
904
957
  }
905
- return n
958
+ return r
906
959
  },
907
- re = (e, t) => {
960
+ fe = (e, t) => {
908
961
  const s = [],
909
- n = e.eventMaps,
910
- r = t.eventMaps,
911
- i = Object.keys(n),
912
- a = Object.keys(r)
962
+ r = e.eventMaps,
963
+ n = t.eventMaps,
964
+ i = Object.keys(r),
965
+ a = Object.keys(n)
913
966
  return (
914
967
  i.forEach((c) => {
915
- const u = n[c],
916
- h = r[c]
968
+ const u = r[c],
969
+ h = n[c]
917
970
  h
918
971
  ? h.busEvent !== u.busEvent &&
919
972
  s.push(
920
- te(e, t, {
973
+ he(e, t, {
921
974
  name: c,
922
975
  targetValue: h.listener,
923
976
  sourceValue: u.listener,
924
977
  }),
925
978
  )
926
- : s.push(Yt(e, t, { name: u.domEvent, value: u.listener }))
979
+ : s.push(ce(e, t, { name: u.domEvent, value: u.listener }))
927
980
  }),
928
981
  a.forEach((c) => {
929
- const u = n[c],
930
- h = r[c]
931
- u || s.push(Zt(e, t, { name: h.domEvent, value: h.listener }))
982
+ const u = r[c],
983
+ h = n[c]
984
+ u || s.push(le(e, t, { name: h.domEvent, value: h.listener }))
932
985
  }),
933
986
  s
934
987
  )
935
988
  },
936
- ie = (e) => e.tagName !== 'INPUT',
937
- oe = (e, t) => e.value === t.value,
938
- ue = (e, t) => {
939
- 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 []
940
993
  const s = e,
941
- n = t
942
- return [ee(s, n, { name: 'value', value: n.value })]
994
+ r = t
995
+ return [de(s, r, { name: 'value', value: r.value })]
943
996
  },
944
- ae = (e, t) => {
945
- const s = Z(e, t),
946
- n = re(e, t),
947
- r = ue(e, t)
948
- 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)
949
1002
  },
950
- ce = (e, t) => Z(e, t, !0),
951
- le = (e, t) => (e.textContent !== t.textContent ? [Gt(e, t)] : []),
952
- he = (e, t, s) => {
953
- let n = []
954
- if (e.nodeType === 1 && ht(e)) {
955
- 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,
956
1009
  i = t,
957
- a = ce(r, i),
958
- c = s(r.childNodes, i.childNodes, r)
959
- n = a.concat(c)
1010
+ a = Ee(n, i),
1011
+ c = s(n.childNodes, i.childNodes, n)
1012
+ r = a.concat(c)
960
1013
  } else if (e.nodeType === 1) {
961
- const r = e,
1014
+ const n = e,
962
1015
  i = t,
963
- a = ae(r, i),
964
- c = s(r.childNodes, i.childNodes, r)
965
- n = a.concat(c)
966
- } else e.nodeType === 3 && (n = le(e, t))
967
- 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
968
1021
  },
969
- tt = (e, t, s) => {
970
- const n = [],
971
- r = de(e, t),
972
- i = Y(e),
973
- a = Y(t),
1022
+ ut = (e, t, s) => {
1023
+ const r = [],
1024
+ n = Ne(e, t),
1025
+ i = it(e),
1026
+ a = it(t),
974
1027
  c = []
975
1028
  let u = 0
976
- for (; u < r; u++) {
1029
+ for (; u < n; u++) {
977
1030
  const d = e[u],
978
1031
  l = t[u]
979
1032
  if (l && a.check(l)) {
980
1033
  const m = i.pullMatch(l)
981
1034
  a.clear(l),
982
1035
  m.element
983
- ? (m.index !== u && n.push(_(m.element, { parent: s, index: u })),
1036
+ ? (m.index !== u && r.push(T(m.element, { parent: s, index: u })),
984
1037
  c.push({ source: m.element, target: l }))
985
1038
  : d
986
1039
  ? a.check(d)
987
- ? n.push(_(l, { parent: s, index: u }))
988
- : (i.clear(d), n.push(Ht(d, l)))
989
- : n.push(_(l, { parent: s, index: u }))
990
- } else d && i.pullMatch(d).element && n.push(W(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))
991
1044
  }
992
1045
  i.remaining().forEach(({ element: d }) => {
993
- n.push(W(d))
1046
+ r.push(rt(d))
994
1047
  })
995
1048
  const h = c.reduce(
996
- (d, { source: l, target: m }) => d.concat(he(l, m, tt)),
1049
+ (d, { source: l, target: m }) => d.concat(we(l, m, ut)),
997
1050
  [],
998
1051
  )
999
- return n.concat(h).sort(se)
1052
+ return r.concat(h).sort(pe)
1000
1053
  },
1001
- de = (e, t) => {
1054
+ Ne = (e, t) => {
1002
1055
  const s = e.length,
1003
- n = t.length
1004
- return s > n ? s : n
1056
+ r = t.length
1057
+ return s > r ? s : r
1005
1058
  },
1006
- pe = (e, t, s) => {
1007
- const n = tt(e, t, s)
1059
+ _e = (e, t, s) => {
1060
+ const r = ut(e, t, s)
1008
1061
  return (
1009
- n.forEach((r) => {
1010
- me(r)
1062
+ r.forEach((n) => {
1063
+ xe(n)
1011
1064
  }),
1012
- n
1065
+ r
1013
1066
  )
1014
1067
  },
1015
- me = (e) => {
1016
- ;(Se[e.type] || fe)(e)
1068
+ xe = (e) => {
1069
+ ;(Fe[e.type] || Se)(e)
1017
1070
  },
1018
- fe = (e) => {},
1019
- be = (e) => {
1071
+ Se = (e) => {},
1072
+ Te = (e) => {
1020
1073
  const { source: t, target: s } = e
1021
1074
  t.nodeValue = s.textContent
1022
1075
  },
1023
- ve = (e) => {
1076
+ je = (e) => {
1024
1077
  const { source: t } = e
1025
1078
  t.remove()
1026
1079
  },
1027
- ge = (e) => {
1080
+ Oe = (e) => {
1028
1081
  const { target: t, data: s } = e,
1029
- { parent: n, index: r } = s,
1030
- i = n.childNodes[r]
1031
- 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)
1032
1085
  },
1033
- ye = (e) => {
1086
+ Me = (e) => {
1034
1087
  const { source: t, target: s } = e
1035
1088
  t.replaceWith(s)
1036
1089
  },
1037
- Ee = (e) => {
1090
+ ke = (e) => {
1038
1091
  const { source: t, data: s } = e,
1039
- { name: n, isSvg: r } = s
1040
- r ? t.removeAttributeNS(null, n) : t.removeAttribute(n)
1092
+ { name: r, isSvg: n } = s
1093
+ n ? t.removeAttributeNS(null, r) : t.removeAttribute(r)
1041
1094
  },
1042
- et = (e) => {
1095
+ at = (e) => {
1043
1096
  const { source: t, data: s } = e,
1044
- { name: n, value: r, isSvg: i } = s
1045
- 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)
1046
1099
  },
1047
- Ae = (e) => {
1048
- et(e)
1100
+ $e = (e) => {
1101
+ at(e)
1049
1102
  },
1050
- xe = (e) => {
1103
+ De = (e) => {
1051
1104
  const t = e.data,
1052
1105
  s = e.source,
1053
- { name: n, value: r } = t
1054
- s.removeEventListener(n, r)
1106
+ { name: r, value: n } = t
1107
+ s.removeEventListener(r, n)
1055
1108
  },
1056
- we = (e) => {
1109
+ Pe = (e) => {
1057
1110
  const t = e.data,
1058
1111
  s = e.source,
1059
- { name: n, value: r } = t
1060
- s.addEventListener(n, r)
1112
+ { name: r, value: n } = t
1113
+ s.addEventListener(r, n)
1061
1114
  },
1062
- Ne = (e) => {
1115
+ Be = (e) => {
1063
1116
  const t = e.data,
1064
1117
  s = e.source,
1065
- { name: n, sourceValue: r, targetValue: i } = t
1066
- 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)
1067
1120
  },
1068
- _e = (e) => {
1121
+ Ve = (e) => {
1069
1122
  const t = e.data,
1070
1123
  s = e.source,
1071
- { value: n } = t
1072
- s.value = n
1124
+ { value: r } = t
1125
+ s.value = r
1073
1126
  },
1074
- Se = {
1075
- [o.changeText]: be,
1076
- [o.removeNode]: ve,
1077
- [o.insertNode]: ge,
1078
- [o.replaceNode]: ye,
1079
- [o.removeAttribute]: Ee,
1080
- [o.addAttribute]: et,
1081
- [o.updateAttribute]: Ae,
1082
- [o.removeEvent]: xe,
1083
- [o.addEvent]: we,
1084
- [o.updateEvent]: Ne,
1085
- [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,
1086
1139
  },
1087
- Te = (e, t, s) => {
1088
- const n = [...t]
1140
+ Le = (e, t, s) => {
1141
+ const r = [...t]
1089
1142
  return (
1090
- e.forEach((r) => {
1091
- je(r, n, s)
1143
+ e.forEach((n) => {
1144
+ ze(n, r, s)
1092
1145
  }),
1093
- n
1146
+ r
1094
1147
  )
1095
1148
  },
1096
- je = (e, t, s) => {
1097
- const n = $e[e.type]
1098
- n && n(e, t, s)
1149
+ ze = (e, t, s) => {
1150
+ const r = qe[e.type]
1151
+ r && r(e, t, s)
1099
1152
  },
1100
- Oe = (e, t) => {
1153
+ Ke = (e, t) => {
1101
1154
  const { source: s } = e,
1102
- n = t.indexOf(s)
1103
- n >= 0 && t.splice(n, 1)
1155
+ r = t.indexOf(s)
1156
+ r >= 0 && t.splice(r, 1)
1104
1157
  },
1105
- Me = (e, t, s) => {
1106
- const { target: n } = e,
1107
- r = e.data,
1108
- { index: i, parent: a } = r
1109
- 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)
1110
1163
  },
1111
- ke = (e, t) => {
1112
- const { target: s, source: n } = e,
1113
- r = t.indexOf(n)
1114
- 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)
1115
1168
  },
1116
- $e = { [o.removeNode]: Oe, [o.insertNode]: Me, [o.replaceNode]: ke }
1117
- class De {
1169
+ qe = { [o.removeNode]: Ke, [o.insertNode]: Re, [o.replaceNode]: Ue }
1170
+ class Ce {
1118
1171
  constructor({
1119
1172
  Template: t,
1120
1173
  subscriptions: s,
1121
- attributes: n,
1122
- viewModel: r,
1174
+ attributes: r,
1175
+ viewModel: n,
1123
1176
  }) {
1124
1177
  ;(this.Template = t),
1125
- (this.viewModel = r),
1126
- (this.attributes = n),
1178
+ (this.viewModel = n),
1179
+ (this.attributes = r),
1127
1180
  (this.subscriptions = s),
1128
1181
  (this.dom = []),
1129
1182
  (this.parentElement = null)
@@ -1142,17 +1195,17 @@
1142
1195
  ...this.attributes,
1143
1196
  ...this.viewModel(t.state.getAll(this.subscriptions)),
1144
1197
  },
1145
- n = this.Template(s)
1146
- return n ? n.render(t) : []
1198
+ r = this.Template(s)
1199
+ return r ? r.render(t) : []
1147
1200
  }
1148
1201
  rerender() {
1149
1202
  if (!this.parentElement && this.dom[0]) {
1150
- const n = this.dom[0].parentElement
1151
- this.parentElement = n
1203
+ const r = this.dom[0].parentElement
1204
+ this.parentElement = r
1152
1205
  }
1153
1206
  const t = this.generateDom(this.renderKit),
1154
- s = pe(this.dom, t, this.parentElement)
1155
- 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)
1156
1209
  }
1157
1210
  subscribeForRerender() {
1158
1211
  const { subscribe: t } = this.renderKit
@@ -1161,68 +1214,77 @@
1161
1214
  })
1162
1215
  }
1163
1216
  eventName(t) {
1164
- return `${N}:${t}`
1217
+ return `${S}:${t}`
1165
1218
  }
1166
1219
  }
1167
- const Pe = (e) => e,
1168
- st = ({ Template: e, viewModel: t, subscriptions: s }) => (
1220
+ const Ie = (e) => e,
1221
+ ct = ({ Template: e, viewModel: t, subscriptions: s }) => (
1169
1222
  (s = s || []),
1170
- (t = t || Pe),
1171
- (n) =>
1172
- 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 })
1173
1226
  ),
1174
- Ve =
1227
+ Je =
1175
1228
  (e) =>
1176
1229
  ({ path: t }) =>
1177
1230
  t === e,
1178
- Fe = () => !0,
1179
- nt =
1231
+ Ge = () => !0,
1232
+ lt =
1180
1233
  (e) =>
1181
1234
  ({ route: t }) => {
1182
- const s = e.find((n) => n.match(t))
1235
+ const s = e.find((r) => r.match(t))
1183
1236
  return s && s.Partial
1184
1237
  },
1185
- Le = Object.freeze(
1238
+ He = Object.freeze(
1186
1239
  Object.defineProperty(
1187
- { __proto__: null, buildRouter: nt, catchAll: Fe, exactPathMatch: Ve },
1240
+ { __proto__: null, buildRouter: lt, catchAll: Ge, exactPathMatch: Je },
1188
1241
  Symbol.toStringTag,
1189
1242
  { value: 'Module' },
1190
1243
  ),
1191
1244
  ),
1192
- ze = () => ({ render: (e, t) => [] }),
1193
- Be = (e) => {
1194
- const t = nt(e)
1195
- return st({
1196
- 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)(),
1197
1250
  subscriptions: ['route'],
1198
1251
  })
1199
1252
  },
1200
- Ke = Object.freeze(
1253
+ Xe = Object.freeze(
1201
1254
  Object.defineProperty(
1202
1255
  {
1203
1256
  __proto__: null,
1204
- createRouteState: P,
1205
- events: St,
1206
- extractQueryParams: L,
1207
- findHref: V,
1208
- navigate: E,
1209
- onLinkClick: F,
1210
- onLocationChange: z,
1211
- 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,
1212
1265
  },
1213
1266
  Symbol.toStringTag,
1214
1267
  { value: 'Module' },
1215
1268
  ),
1216
- )
1217
- ;(p.JaxsTypes = Jt),
1218
- (p.appBuilding = jt),
1219
- (p.bind = st),
1220
- (p.createApp = qt),
1221
- (p.jsx = M),
1222
- (p.messageBus = $t),
1223
- (p.navigation = Ke),
1224
- (p.routedView = Be),
1225
- (p.routing = Le),
1226
- (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),
1227
1289
  Object.defineProperty(p, Symbol.toStringTag, { value: 'Module' })
1228
1290
  })