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