jaxs 0.7.1 → 0.7.2

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