@raphy-js/dom 0.0.0-stage → 1.0.0-dev.88
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/LICENSE +202 -0
- package/README.md +187 -2
- package/dist/DOMBlueprintMaterializer-C-icNhvm.cjs +1 -0
- package/dist/DOMBlueprintMaterializer-CxzM_TX5.js +201 -0
- package/dist/FullDOMOperations-BOlf0_0L.js +2781 -0
- package/dist/FullDOMOperations-Dschwj33.cjs +1 -0
- package/dist/api/renderer.d.ts +12 -0
- package/dist/applicationIdentity-CHbuUlsE.cjs +1 -0
- package/dist/applicationIdentity-DjVgpsQq.js +11 -0
- package/dist/bind-BEmkQdaL.cjs +1 -0
- package/dist/bind-OakIMWpC.js +52 -0
- package/dist/binding/DOMValueWriter.d.ts +59 -0
- package/dist/binding/materializeComponentProps.d.ts +38 -0
- package/dist/binding/mountDOMBinding.d.ts +9 -0
- package/dist/binding/mountDOMProps.d.ts +22 -0
- package/dist/capture.cjs +1 -0
- package/dist/capture.d.ts +7 -0
- package/dist/capture.js +166 -0
- package/dist/channels-Bs8GHVWn.cjs +1 -0
- package/dist/channels-DqAQt-NH.js +33 -0
- package/dist/compact/hydration.cjs +1 -0
- package/dist/compact/hydration.d.ts +9 -0
- package/dist/compact/hydration.js +12 -0
- package/dist/compact/index.d.ts +19 -0
- package/dist/compact/targetRuntime.d.ts +1 -0
- package/dist/compact.cjs +1 -0
- package/dist/compact.js +34 -0
- package/dist/contracts/freezeGeneratedContract.d.ts +5 -0
- package/dist/contracts/manifest.json +25 -0
- package/dist/contracts/node.cjs +1 -0
- package/dist/contracts/node.contract.json +36889 -0
- package/dist/contracts/node.d.ts +6 -0
- package/dist/contracts/node.js +19 -0
- package/dist/contracts/stylesheet.cjs +1 -0
- package/dist/contracts/stylesheet.contract.json +11887 -0
- package/dist/contracts/stylesheet.d.ts +6 -0
- package/dist/contracts/stylesheet.js +22 -0
- package/dist/createDOMDataEventInput-B82pnIav.cjs +1 -0
- package/dist/createDOMDataEventInput-BDX50jhu.js +3010 -0
- package/dist/createDOMNodeRuntime-BHcsbeO1.cjs +1 -0
- package/dist/createDOMNodeRuntime-DIKOUQP7.js +3006 -0
- package/dist/createHydrationRenderer-C7srF-66.js +289 -0
- package/dist/createHydrationRenderer-DKybWTj4.cjs +1 -0
- package/dist/elementRef-D8Ir8tXA.cjs +1 -0
- package/dist/elementRef-YPBBElV9.js +32 -0
- package/dist/event/DOMEventHub.d.ts +303 -0
- package/dist/freezeGeneratedContract-0EZt85o4.js +10 -0
- package/dist/freezeGeneratedContract-g_Op1hGY.cjs +1 -0
- package/dist/hydration/HydrationEvents.d.ts +20 -0
- package/dist/hydration/HydrationSession.d.ts +107 -0
- package/dist/hydration/HydrationStream.d.ts +30 -0
- package/dist/hydration/activateHydration.d.ts +2 -0
- package/dist/hydration/createHydrationRenderer.d.ts +25 -0
- package/dist/hydration/index.d.ts +8 -0
- package/dist/hydration.cjs +1 -0
- package/dist/hydration.js +12 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +24 -0
- package/dist/interaction/clipboard.d.ts +2 -0
- package/dist/interaction/contextAction.d.ts +3 -0
- package/dist/interaction/contracts/node.cjs +1 -0
- package/dist/interaction/contracts/node.d.ts +15 -0
- package/dist/interaction/contracts/node.js +60 -0
- package/dist/interaction/dragDrop.d.ts +13 -0
- package/dist/interaction/focus.d.ts +4 -0
- package/dist/interaction/geometry.d.ts +39 -0
- package/dist/interaction/hover.d.ts +4 -0
- package/dist/interaction/index.d.ts +2 -0
- package/dist/interaction/interaction.d.ts +4 -0
- package/dist/interaction/internal/DOMInputModality.d.ts +20 -0
- package/dist/interaction/internal/DOMInteraction.types.d.ts +29 -0
- package/dist/interaction/internal/applicationIdentity.d.ts +3 -0
- package/dist/interaction/internal/dragDataTransfer.d.ts +4 -0
- package/dist/interaction/internal/solvePosition.d.ts +5 -0
- package/dist/interaction/keyboard.d.ts +3 -0
- package/dist/interaction/move.d.ts +3 -0
- package/dist/interaction/nativeDragDrop.d.ts +18 -0
- package/dist/interaction/outside.d.ts +3 -0
- package/dist/interaction/press.d.ts +3 -0
- package/dist/interaction/profile.cjs +1 -0
- package/dist/interaction/profile.d.ts +2 -0
- package/dist/interaction/profile.js +48 -0
- package/dist/interaction/rovingFocus.d.ts +4 -0
- package/dist/interaction/runtime.d.ts +7 -0
- package/dist/interaction/textEditing.d.ts +4 -0
- package/dist/interaction.cjs +1 -0
- package/dist/interaction.js +1603 -0
- package/dist/internal/dev.d.ts +20 -0
- package/dist/motion/channels.d.ts +5 -0
- package/dist/motion/index.d.ts +8 -0
- package/dist/motion-scroll/index.d.ts +19 -0
- package/dist/motion-scroll.cjs +1 -0
- package/dist/motion-scroll.js +169 -0
- package/dist/motion.cjs +1 -0
- package/dist/motion.js +187 -0
- package/dist/operations.cjs +1 -0
- package/dist/operations.d.ts +3 -0
- package/dist/operations.js +10 -0
- package/dist/profile/DOMProfile.d.ts +4 -0
- package/dist/profile/index.d.ts +1 -0
- package/dist/profile.cjs +1 -0
- package/dist/profile.js +23 -0
- package/dist/renderer/DOMEffectScope.d.ts +13 -0
- package/dist/renderer/DOMPresentation.d.ts +8 -0
- package/dist/renderer/DOMRenderer.d.ts +35 -0
- package/dist/renderer/DOMRenderer.types.d.ts +12 -0
- package/dist/renderer/DOMRendererExtension.types.d.ts +33 -0
- package/dist/renderer/DOMRuntimeProfile.d.ts +15 -0
- package/dist/renderer/DOMTargetRuntime.d.ts +1 -0
- package/dist/renderer/createDOMTargetRuntime.d.ts +3 -0
- package/dist/renderer/installAuxiliaryViews.d.ts +8 -0
- package/dist/renderer/installDOMRendererExtensions.d.ts +10 -0
- package/dist/renderer/resolveDOMMountTarget.d.ts +7 -0
- package/dist/renderer-4Wbid5nE.js +30 -0
- package/dist/renderer-DHK3lLG-.cjs +1 -0
- package/dist/resolveDOMMountTarget-C75JWc5x.cjs +1 -0
- package/dist/resolveDOMMountTarget-D944H05N.js +19 -0
- package/dist/runtime.cjs +1 -0
- package/dist/runtime.d.ts +21 -0
- package/dist/runtime.js +25 -0
- package/dist/serialization.cjs +1 -0
- package/dist/serialization.d.ts +4 -0
- package/dist/serialization.js +118 -0
- package/dist/stylesheet/DOMStyleManager.d.ts +95 -0
- package/dist/stylesheet/DOMStyleReferenceName.d.ts +2 -0
- package/dist/stylesheet/DOMStylesheetRuntime.d.ts +25 -0
- package/dist/stylesheet/acquireInstanceStylesheets.d.ts +4 -0
- package/dist/stylesheet/scopeDOMSelector.d.ts +2 -0
- package/dist/stylesheet/serializeDOMStyleValue.d.ts +3 -0
- package/dist/targetRuntime-C67QmOgE.cjs +1 -0
- package/dist/targetRuntime-C_OdmS5w.js +5 -0
- package/dist/template/AdvancedDOMMaterializer.d.ts +14 -0
- package/dist/template/AsyncDOMMaterializer.d.ts +4 -0
- package/dist/template/BoundaryDOMMaterializer.d.ts +10 -0
- package/dist/template/DOMHostPlan.d.ts +4 -0
- package/dist/template/DOMNode.types.d.ts +192 -0
- package/dist/template/DOMNodeRuntime.d.ts +1 -0
- package/dist/template/binding/DOMBinding.types.d.ts +44 -0
- package/dist/template/binding/bind.d.ts +16 -0
- package/dist/template/blueprint/DOMBlueprintAddressing.d.ts +23 -0
- package/dist/template/blueprint/DOMBlueprintMaterializer.d.ts +3 -0
- package/dist/template/blueprint/DOMBlueprintMaterializer.types.d.ts +15 -0
- package/dist/template/blueprint/DOMHostBlueprint.d.ts +102 -0
- package/dist/template/blueprint/DOMHostBlueprintCache.d.ts +86 -0
- package/dist/template/blueprint/createDOMDataEventInput.d.ts +5 -0
- package/dist/template/blueprint/mountDOMHostBlueprint.d.ts +45 -0
- package/dist/template/createDOMNodeRuntime.d.ts +3 -0
- package/dist/template/each/mountEach.d.ts +5 -0
- package/dist/template/each/mountPureEach.d.ts +22 -0
- package/dist/template/error/DOMInvocation.d.ts +58 -0
- package/dist/template/error/DOMOperationError.d.ts +25 -0
- package/dist/template/html/DOMRawHtmlNode.types.d.ts +21 -0
- package/dist/template/html/rawHtml.d.ts +5 -0
- package/dist/template/keep-alive/DOMKeepAliveNode.types.d.ts +10 -0
- package/dist/template/keep-alive/keepAlive.d.ts +4 -0
- package/dist/template/mount/DOMMountTransaction.d.ts +63 -0
- package/dist/template/mountNode.d.ts +173 -0
- package/dist/template/normalizeChildren.d.ts +5 -0
- package/dist/template/operations/DOMOperations.d.ts +56 -0
- package/dist/template/operations/FullDOMOperations.d.ts +6 -0
- package/dist/template/page/DOMHead.d.ts +7 -0
- package/dist/template/page/PageNodePlan.d.ts +31 -0
- package/dist/template/ref/DOMElementRef.types.d.ts +7 -0
- package/dist/template/ref/componentRefGuard.d.ts +6 -0
- package/dist/template/ref/elementRef.d.ts +9 -0
- package/dist/template/structural/range/DOMRange.d.ts +145 -0
- package/dist/template/teleport/DOMTeleportNode.types.d.ts +8 -0
- package/dist/template/teleport/teleport.d.ts +4 -0
- package/dist/template/transition/DOMTransitionCoordinator.d.ts +32 -0
- package/dist/template/transition/DOMTransitionNode.types.d.ts +30 -0
- package/dist/template/transition/transition.d.ts +4 -0
- package/dist/template/value/DOMValueDescriptor.types.d.ts +34 -0
- package/dist/template/value/valueDescriptors.d.ts +13 -0
- package/package.json +157 -4
|
@@ -0,0 +1,3010 @@
|
|
|
1
|
+
import { isTargetRef as ft, isNodeDynamicValue as Y, componentEventListenerName as pt, getComponentModelListenerMetadata as _t, RaphEffectScope as yt, BranchBlock as Be } from "@raphy-js/core";
|
|
2
|
+
import { i as vt } from "./bind-OakIMWpC.js";
|
|
3
|
+
import { i as gt, r as wt, a as mt } from "./elementRef-YPBBElV9.js";
|
|
4
|
+
const ae = Symbol("raphy.dom.event.data.undefined");
|
|
5
|
+
class ce {
|
|
6
|
+
/**
|
|
7
|
+
* Создаёт основную запись события вместе с остальными тремя; `primary`
|
|
8
|
+
* получают только они и разделяют его keys и listeners.
|
|
9
|
+
*/
|
|
10
|
+
constructor(e, t, n, i) {
|
|
11
|
+
this.eventName = e, this.handler = t === null ? Symbol(`raphy.dom.event.${e}.handler`) : t.handler, this.owner = t === null ? Symbol(`raphy.dom.event.${e}.owner`) : t.owner, this.data = t === null ? Symbol(`raphy.dom.event.${e}.data`) : t.data, this.listeners = t === null ? /* @__PURE__ */ new Map() : t.listeners, this.clearsData = i, this.eventless = n, this.plain = t === null ? new ce(e, this, !0, !1) : this, this.retaining = i ? this : new ce(e, t ?? this, n, !0), this.dispatch = void 0;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
class te {
|
|
15
|
+
constructor(e, t, n, i, s, o) {
|
|
16
|
+
this.hub = e, this.owner = t, this.errorContext = n, this.handleError = i, this._element0 = s, this._slot0 = o, this._element1 = void 0, this._slot1 = void 0, this._rest = void 0, this.router = void 0;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Handlers elements, которые указывают на эту запись, вызываются без event.
|
|
20
|
+
* На запись указывают только elements вида её первого слота; elements
|
|
21
|
+
* другого вида указывают на парную запись.
|
|
22
|
+
*/
|
|
23
|
+
get eventless() {
|
|
24
|
+
return this._slot0.eventless;
|
|
25
|
+
}
|
|
26
|
+
/** Запоминает ещё один занятый слот того же owner, любого вида. */
|
|
27
|
+
add(e, t) {
|
|
28
|
+
this._element1 === void 0 ? (this._element1 = e, this._slot1 = t) : this._rest === void 0 ? this._rest = [e, t] : this._rest.push(e, t);
|
|
29
|
+
}
|
|
30
|
+
/** Очищает все expando owner, чтобы удержанный element не удерживал handler. */
|
|
31
|
+
release() {
|
|
32
|
+
const e = this.hub;
|
|
33
|
+
e._staticOwner === this && (e._staticOwner = null, e._staticTwin = null);
|
|
34
|
+
const t = this._element0;
|
|
35
|
+
if (t === void 0)
|
|
36
|
+
return;
|
|
37
|
+
ge(t, this._slot0), this._element0 = void 0;
|
|
38
|
+
const n = this._element1;
|
|
39
|
+
n !== void 0 && (ge(n, this._slot1), this._element1 = void 0);
|
|
40
|
+
const i = this._rest;
|
|
41
|
+
if (i !== void 0) {
|
|
42
|
+
for (let s = 0; s < i.length; s += 2)
|
|
43
|
+
ge(
|
|
44
|
+
i[s],
|
|
45
|
+
i[s + 1]
|
|
46
|
+
);
|
|
47
|
+
this._rest = void 0;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const He = Object.freeze({}), ur = () => {
|
|
52
|
+
}, bt = 128;
|
|
53
|
+
class le {
|
|
54
|
+
constructor() {
|
|
55
|
+
this.event = null, this.handed = null, this.target = null, this.outer = null, this.original = void 0, this.accessor = Object.freeze({
|
|
56
|
+
configurable: !0,
|
|
57
|
+
get: () => this.target
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
let de = new le(), L = null;
|
|
62
|
+
const re = /* @__PURE__ */ new Set([
|
|
63
|
+
"auxclick",
|
|
64
|
+
"beforeinput",
|
|
65
|
+
"change",
|
|
66
|
+
"click",
|
|
67
|
+
"compositionend",
|
|
68
|
+
"compositionstart",
|
|
69
|
+
"compositionupdate",
|
|
70
|
+
"contextmenu",
|
|
71
|
+
"copy",
|
|
72
|
+
"cut",
|
|
73
|
+
"dblclick",
|
|
74
|
+
"drag",
|
|
75
|
+
"dragend",
|
|
76
|
+
"dragenter",
|
|
77
|
+
"dragleave",
|
|
78
|
+
"dragover",
|
|
79
|
+
"dragstart",
|
|
80
|
+
"drop",
|
|
81
|
+
"focusin",
|
|
82
|
+
"focusout",
|
|
83
|
+
"input",
|
|
84
|
+
"keydown",
|
|
85
|
+
"keypress",
|
|
86
|
+
"keyup",
|
|
87
|
+
"mousedown",
|
|
88
|
+
"mousemove",
|
|
89
|
+
"mouseout",
|
|
90
|
+
"mouseover",
|
|
91
|
+
"mouseup",
|
|
92
|
+
"paste",
|
|
93
|
+
"pointercancel",
|
|
94
|
+
"pointerdown",
|
|
95
|
+
"pointermove",
|
|
96
|
+
"pointerout",
|
|
97
|
+
"pointerover",
|
|
98
|
+
"pointerup",
|
|
99
|
+
"reset",
|
|
100
|
+
"submit",
|
|
101
|
+
"touchcancel",
|
|
102
|
+
"touchend",
|
|
103
|
+
"touchmove",
|
|
104
|
+
"touchstart",
|
|
105
|
+
"wheel"
|
|
106
|
+
]);
|
|
107
|
+
class hr {
|
|
108
|
+
// Фиксируют application-local DOM boundaries и runtime выполнения handlers.
|
|
109
|
+
_boundaries = /* @__PURE__ */ new Map();
|
|
110
|
+
_primaryBoundary;
|
|
111
|
+
_runtime;
|
|
112
|
+
// Хранят bindings элементов и состояние delegated events с их root listeners.
|
|
113
|
+
/** @internal */
|
|
114
|
+
_bindings = /* @__PURE__ */ new WeakMap();
|
|
115
|
+
_userRouteBindings = 0;
|
|
116
|
+
/**
|
|
117
|
+
* Число зарегистрированных route bindings обоих каналов: пока оно равно
|
|
118
|
+
* нулю, доставка не ищет route ни одного element пути.
|
|
119
|
+
* @internal
|
|
120
|
+
*/
|
|
121
|
+
_routeBindings = 0;
|
|
122
|
+
_staticSlots = /* @__PURE__ */ new Map();
|
|
123
|
+
_eventNames = /* @__PURE__ */ new Map();
|
|
124
|
+
_dispatched = /* @__PURE__ */ new WeakMap();
|
|
125
|
+
_boundarySubscriptions = /* @__PURE__ */ new Set();
|
|
126
|
+
/** @internal */
|
|
127
|
+
_disposed = !1;
|
|
128
|
+
/**
|
|
129
|
+
* Последняя запись static handlers: соседние registrations одного owner
|
|
130
|
+
* разделяют её без lookup.
|
|
131
|
+
* @internal
|
|
132
|
+
*/
|
|
133
|
+
_staticOwner = null;
|
|
134
|
+
/**
|
|
135
|
+
* Парная запись `_staticOwner` для handlers другого вида; создаётся первой
|
|
136
|
+
* такой registration и живёт, пока `_staticOwner` остаётся последней записью.
|
|
137
|
+
* @internal
|
|
138
|
+
*/
|
|
139
|
+
_staticTwin = null;
|
|
140
|
+
/**
|
|
141
|
+
* Связывает hub с одним DOM target и runtime renderer application.
|
|
142
|
+
*/
|
|
143
|
+
constructor(e, t) {
|
|
144
|
+
this._boundaries.set(e, 1), this._primaryBoundary = e, this._runtime = t;
|
|
145
|
+
}
|
|
146
|
+
// ---------------------------------------------
|
|
147
|
+
// PUBLIC API
|
|
148
|
+
// ---------------------------------------------
|
|
149
|
+
/**
|
|
150
|
+
* Возвращает snapshot принадлежащих renderer границ без новых subscriptions.
|
|
151
|
+
* @internal
|
|
152
|
+
*/
|
|
153
|
+
boundaries() {
|
|
154
|
+
return this._assertAlive(), Object.freeze([...this._boundaries.keys()]);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Возвращает native event name для `on<Event>` property.
|
|
158
|
+
*
|
|
159
|
+
* Нормализация кэшируется в hub: повторная registration того же property
|
|
160
|
+
* не создаёт строк.
|
|
161
|
+
*/
|
|
162
|
+
resolveEventName(e) {
|
|
163
|
+
let t = this._eventNames.get(e);
|
|
164
|
+
return t === void 0 && (t = e.slice(2).toLowerCase(), !this._disposed && this._eventNames.size < bt && this._eventNames.set(e, t)), t;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Создаёт стабильный writer delegated либо direct event binding.
|
|
168
|
+
*/
|
|
169
|
+
createWriter(e, t, n, i, s = {}) {
|
|
170
|
+
return this._createWriter(e, t, n, i, "user", s);
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Сразу регистрирует неизменяемый user handler без промежуточного writer.
|
|
174
|
+
*
|
|
175
|
+
* Delegated handler хранится в hub-local expando элемента и не создаёт route;
|
|
176
|
+
* route остаётся fallback, когда слот занят либо у элемента уже есть user route.
|
|
177
|
+
*
|
|
178
|
+
* С `data` handler является общей функцией нескольких elements: hub хранит
|
|
179
|
+
* data рядом со ссылкой на handler и вызывает `handler(data, event)` с тем же
|
|
180
|
+
* receiver. Функция, связывающая handler с data, не создаётся ни на одном
|
|
181
|
+
* пути: delegated handler держит data под третьим key element, fallback на
|
|
182
|
+
* route — в поле своего binding, direct listener — в context listener,
|
|
183
|
+
* который он создаёт и для handler без data. `undefined` означает handler без
|
|
184
|
+
* data, а data `undefined` передаётся как `DOM_EVENT_UNDEFINED_DATA`.
|
|
185
|
+
*
|
|
186
|
+
* Handler с option `eventless` вызывается без event на каждом из трёх путей:
|
|
187
|
+
* `handler()` либо `handler(data)`. Delegated handler запоминает это видом
|
|
188
|
+
* записи своего слота, поэтому на element ничего не добавляется.
|
|
189
|
+
*/
|
|
190
|
+
registerStatic(e, t, n, i, s, o, a = He, c) {
|
|
191
|
+
this._assertAlive();
|
|
192
|
+
const l = ne(n, t);
|
|
193
|
+
if (l === void 0)
|
|
194
|
+
return;
|
|
195
|
+
if (!re.has(t) || !we(a)) {
|
|
196
|
+
this._registerStaticDirect(
|
|
197
|
+
e,
|
|
198
|
+
t,
|
|
199
|
+
l,
|
|
200
|
+
i,
|
|
201
|
+
(p) => o(s, p, `event:${t}`),
|
|
202
|
+
a,
|
|
203
|
+
c
|
|
204
|
+
);
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
const d = this._resolveStaticSlot(t), h = e, _ = a.eventless === !0;
|
|
208
|
+
if (h[d.handler] !== void 0 || this._userRouteBindings !== 0 && se(this._bindings.get(e), t)?.user !== void 0) {
|
|
209
|
+
this._registerDelegatedBinding(e, t, {
|
|
210
|
+
handler: l,
|
|
211
|
+
handleError: (p) => o(s, p, `event:${t}`),
|
|
212
|
+
owner: i,
|
|
213
|
+
registered: !1,
|
|
214
|
+
data: c,
|
|
215
|
+
eventless: _
|
|
216
|
+
}, "user");
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
const m = _ ? d.plain : d, E = c !== void 0 && Et(c) ? m.retaining : m, R = this._staticOwner, k = R !== null && R.owner === i && R.errorContext === s && R.handleError === o;
|
|
220
|
+
let u;
|
|
221
|
+
k ? (R.add(h, E), u = R.eventless === _ ? R : this._staticTwin ??= new te(
|
|
222
|
+
this,
|
|
223
|
+
i,
|
|
224
|
+
s,
|
|
225
|
+
o,
|
|
226
|
+
void 0,
|
|
227
|
+
E
|
|
228
|
+
)) : u = new te(
|
|
229
|
+
this,
|
|
230
|
+
i,
|
|
231
|
+
s,
|
|
232
|
+
o,
|
|
233
|
+
h,
|
|
234
|
+
E
|
|
235
|
+
), h[d.handler] = l, h[d.owner] = u, h[d.data] = c, k || (this._staticOwner = u, this._staticTwin = null, i.own(u.release.bind(u))), d.listeners.size !== this._boundaries.size && this._installRootListeners(d);
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Готовит делегированное событие строк keyed-списка, который сам владеет
|
|
239
|
+
* строками без owner строки. Все строки события делят одну запись owner без
|
|
240
|
+
* cleanup и без списка elements: удалённая строка уходит вместе со своими
|
|
241
|
+
* expando, а живость проверяется по owner списка. Возвращает `undefined`, если
|
|
242
|
+
* событие с этими options не делегируется: тогда список строит строки обычным
|
|
243
|
+
* путём.
|
|
244
|
+
* @internal
|
|
245
|
+
*/
|
|
246
|
+
createRowEvent(e, t, n, i, s = He) {
|
|
247
|
+
if (this._assertAlive(), !re.has(e) || !we(s))
|
|
248
|
+
return;
|
|
249
|
+
const o = this._resolveStaticSlot(e), a = s.eventless === !0 ? o.plain : o;
|
|
250
|
+
return {
|
|
251
|
+
slot: o,
|
|
252
|
+
record: new te(
|
|
253
|
+
this,
|
|
254
|
+
t,
|
|
255
|
+
n,
|
|
256
|
+
i,
|
|
257
|
+
void 0,
|
|
258
|
+
a
|
|
259
|
+
)
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Готовит одно делегированное событие для всех слотов этого события в строке:
|
|
264
|
+
* expando ставятся на корень строки, а при доставке router вызывает слоты,
|
|
265
|
+
* которые содержат target, от внутреннего к внешнему. Строке не нужно ни
|
|
266
|
+
* адресовать elements слотов, ни писать на них expando. Возвращает
|
|
267
|
+
* `undefined`, если событие не делегируется.
|
|
268
|
+
* @internal
|
|
269
|
+
*/
|
|
270
|
+
createRowRouter(e, t, n, i, s) {
|
|
271
|
+
if (this._assertAlive(), !re.has(e))
|
|
272
|
+
return;
|
|
273
|
+
const o = this._resolveStaticSlot(e), a = new te(
|
|
274
|
+
this,
|
|
275
|
+
t,
|
|
276
|
+
n,
|
|
277
|
+
i,
|
|
278
|
+
void 0,
|
|
279
|
+
o
|
|
280
|
+
);
|
|
281
|
+
return a.router = { routes: [...s].sort((c, l) => l.path.length - c.path.length) }, { slot: o, record: a };
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Регистрирует handler строки, подготовленный `createRowEvent`: те же три
|
|
285
|
+
* expando, что у `registerStatic`, без записи в owner.
|
|
286
|
+
* @internal
|
|
287
|
+
*/
|
|
288
|
+
writeRowEvent(e, t, n, i) {
|
|
289
|
+
const s = e, o = t.slot;
|
|
290
|
+
s[o.handler] = n, s[o.owner] = t.record, s[o.data] = i, o.listeners.size !== this._boundaries.size && this._installRootListeners(o);
|
|
291
|
+
}
|
|
292
|
+
/** Нормализует handler так же, как регистрация события. @internal */
|
|
293
|
+
normalizeRowHandler(e, t) {
|
|
294
|
+
return ne(e, t);
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Создаёт renderer-internal handler, выполняемый раньше user handler элемента.
|
|
298
|
+
*/
|
|
299
|
+
createInternalWriter(e, t, n, i) {
|
|
300
|
+
return this._createWriter(e, t, n, i, "internal", {});
|
|
301
|
+
}
|
|
302
|
+
/** Добавляет статический Teleport boundary и возвращает reference-counted cleanup. */
|
|
303
|
+
retainBoundary(e) {
|
|
304
|
+
this._assertAlive(), this._boundaries.set(e, (this._boundaries.get(e) ?? 0) + 1);
|
|
305
|
+
let t = !0;
|
|
306
|
+
const n = () => {
|
|
307
|
+
if (!t)
|
|
308
|
+
return;
|
|
309
|
+
t = !1;
|
|
310
|
+
const i = (this._boundaries.get(e) ?? 1) - 1;
|
|
311
|
+
if (i > 0) {
|
|
312
|
+
this._boundaries.set(e, i);
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
this._boundaries.delete(e);
|
|
316
|
+
let s;
|
|
317
|
+
for (const o of this._staticSlots.values()) {
|
|
318
|
+
const a = o.listeners.get(e);
|
|
319
|
+
if (a !== void 0) {
|
|
320
|
+
try {
|
|
321
|
+
e.removeEventListener(o.eventName, a);
|
|
322
|
+
} catch (c) {
|
|
323
|
+
(s ??= []).push(c);
|
|
324
|
+
}
|
|
325
|
+
o.listeners.get(e) === a && o.listeners.delete(e);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
for (const o of this._boundarySubscriptions) {
|
|
329
|
+
const a = o.listeners.get(e);
|
|
330
|
+
if (a !== void 0) {
|
|
331
|
+
try {
|
|
332
|
+
e.removeEventListener(
|
|
333
|
+
o.eventName,
|
|
334
|
+
a,
|
|
335
|
+
me(o.options)
|
|
336
|
+
);
|
|
337
|
+
} catch (c) {
|
|
338
|
+
(s ??= []).push(c);
|
|
339
|
+
}
|
|
340
|
+
o.listeners.delete(e);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
if (s?.length === 1)
|
|
344
|
+
throw s[0];
|
|
345
|
+
if (s !== void 0)
|
|
346
|
+
throw new AggregateError(s, "[RaphyDOM] Event boundary cleanup failed.");
|
|
347
|
+
};
|
|
348
|
+
try {
|
|
349
|
+
for (const i of this._staticSlots.values())
|
|
350
|
+
i.listeners.size !== 0 && this._ensureBoundaryListener(i, e);
|
|
351
|
+
for (const i of this._boundarySubscriptions)
|
|
352
|
+
this._installBoundarySubscription(i, e);
|
|
353
|
+
} catch (i) {
|
|
354
|
+
try {
|
|
355
|
+
n();
|
|
356
|
+
} catch (s) {
|
|
357
|
+
throw new AggregateError(
|
|
358
|
+
[i, s],
|
|
359
|
+
"[RaphyDOM] Event boundary installation and rollback failed."
|
|
360
|
+
);
|
|
361
|
+
}
|
|
362
|
+
throw i;
|
|
363
|
+
}
|
|
364
|
+
return n;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Подписывает renderer extension на одно событие всех application boundaries.
|
|
368
|
+
* Вложенные boundaries не дублируют доставку одного native event.
|
|
369
|
+
*/
|
|
370
|
+
subscribeBoundaries(e, t, n = !1) {
|
|
371
|
+
this._assertAlive();
|
|
372
|
+
const i = e.trim();
|
|
373
|
+
if (i.length === 0)
|
|
374
|
+
throw new TypeError("[RaphyDOM] Boundary event name must not be empty.");
|
|
375
|
+
const s = {
|
|
376
|
+
eventName: i,
|
|
377
|
+
listener: t,
|
|
378
|
+
listeners: /* @__PURE__ */ new Map(),
|
|
379
|
+
options: n
|
|
380
|
+
};
|
|
381
|
+
this._boundarySubscriptions.add(s);
|
|
382
|
+
let o = !0;
|
|
383
|
+
const a = () => {
|
|
384
|
+
if (!o)
|
|
385
|
+
return;
|
|
386
|
+
o = !1, this._boundarySubscriptions.delete(s);
|
|
387
|
+
let c;
|
|
388
|
+
for (const [l, d] of s.listeners)
|
|
389
|
+
try {
|
|
390
|
+
l.removeEventListener(i, d, me(n));
|
|
391
|
+
} catch (h) {
|
|
392
|
+
(c ??= []).push(h);
|
|
393
|
+
}
|
|
394
|
+
if (s.listeners.clear(), c?.length === 1)
|
|
395
|
+
throw c[0];
|
|
396
|
+
if (c !== void 0)
|
|
397
|
+
throw new AggregateError(c, "[RaphyDOM] Boundary subscription cleanup failed.");
|
|
398
|
+
};
|
|
399
|
+
try {
|
|
400
|
+
for (const c of this._boundaries.keys())
|
|
401
|
+
this._installBoundarySubscription(s, c);
|
|
402
|
+
} catch (c) {
|
|
403
|
+
try {
|
|
404
|
+
a();
|
|
405
|
+
} catch (l) {
|
|
406
|
+
throw new AggregateError(
|
|
407
|
+
[c, l],
|
|
408
|
+
"[RaphyDOM] Boundary subscription installation and rollback failed."
|
|
409
|
+
);
|
|
410
|
+
}
|
|
411
|
+
throw c;
|
|
412
|
+
}
|
|
413
|
+
return a;
|
|
414
|
+
}
|
|
415
|
+
_createWriter(e, t, n, i, s, o) {
|
|
416
|
+
return this._assertAlive(), re.has(t) && we(o) ? this._createDelegatedWriter(e, t, n, i, s, o.eventless === !0) : this._createDirectWriter(e, t, n, i, o);
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Снимает все root listeners и освобождает renderer-level registry.
|
|
420
|
+
*/
|
|
421
|
+
dispose() {
|
|
422
|
+
if (this._disposed)
|
|
423
|
+
return;
|
|
424
|
+
this._disposed = !0;
|
|
425
|
+
let e;
|
|
426
|
+
for (const t of [...this._boundarySubscriptions]) {
|
|
427
|
+
for (const [n, i] of t.listeners)
|
|
428
|
+
try {
|
|
429
|
+
n.removeEventListener(
|
|
430
|
+
t.eventName,
|
|
431
|
+
i,
|
|
432
|
+
me(t.options)
|
|
433
|
+
);
|
|
434
|
+
} catch (s) {
|
|
435
|
+
(e ??= []).push(s);
|
|
436
|
+
}
|
|
437
|
+
t.listeners.clear();
|
|
438
|
+
}
|
|
439
|
+
this._boundarySubscriptions.clear();
|
|
440
|
+
for (const t of this._staticSlots.values()) {
|
|
441
|
+
for (const [n, i] of t.listeners)
|
|
442
|
+
try {
|
|
443
|
+
n.removeEventListener(t.eventName, i);
|
|
444
|
+
} catch (s) {
|
|
445
|
+
(e ??= []).push(s);
|
|
446
|
+
}
|
|
447
|
+
t.listeners.clear();
|
|
448
|
+
}
|
|
449
|
+
if (this._boundaries.clear(), this._bindings = /* @__PURE__ */ new WeakMap(), this._dispatched = /* @__PURE__ */ new WeakMap(), this._staticOwner = null, this._staticTwin = null, this._staticSlots.clear(), this._eventNames.clear(), e?.length === 1)
|
|
450
|
+
throw e[0];
|
|
451
|
+
if (e !== void 0)
|
|
452
|
+
throw new AggregateError(e, "[RaphyDOM] Event hub disposal failed.");
|
|
453
|
+
}
|
|
454
|
+
// ---------------------------------------------
|
|
455
|
+
// PRIVATE
|
|
456
|
+
// ---------------------------------------------
|
|
457
|
+
_installBoundarySubscription(e, t) {
|
|
458
|
+
if (e.listeners.has(t))
|
|
459
|
+
return;
|
|
460
|
+
const n = (i) => {
|
|
461
|
+
this._disposed || !Tt(this._boundaries, t, i) || e.listener.call(t, i);
|
|
462
|
+
};
|
|
463
|
+
t.addEventListener(e.eventName, n, e.options), e.listeners.set(t, n);
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* Создаёт element binding, разделяющий один root listener с соседними elements.
|
|
467
|
+
*/
|
|
468
|
+
_createDelegatedWriter(e, t, n, i, s, o) {
|
|
469
|
+
const a = {
|
|
470
|
+
handler: void 0,
|
|
471
|
+
handleError: i,
|
|
472
|
+
owner: n,
|
|
473
|
+
registered: !1,
|
|
474
|
+
data: void 0,
|
|
475
|
+
eventless: o
|
|
476
|
+
};
|
|
477
|
+
return {
|
|
478
|
+
clear: () => {
|
|
479
|
+
a.handler = void 0;
|
|
480
|
+
},
|
|
481
|
+
write: (c) => {
|
|
482
|
+
a.handler = ne(c, t), a.handler !== void 0 && this._registerDelegatedBinding(e, t, a, s);
|
|
483
|
+
}
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Добавляет binding в delegated route и связывает его удаление с owner.
|
|
488
|
+
*/
|
|
489
|
+
_registerDelegatedBinding(e, t, n, i) {
|
|
490
|
+
if (n.registered)
|
|
491
|
+
return;
|
|
492
|
+
this._assertAlive();
|
|
493
|
+
const s = this._bindings.get(e);
|
|
494
|
+
let o = se(s, t);
|
|
495
|
+
if (o === void 0)
|
|
496
|
+
if (o = {
|
|
497
|
+
internal: void 0,
|
|
498
|
+
user: void 0
|
|
499
|
+
}, s === void 0)
|
|
500
|
+
this._bindings.set(e, { eventName: t, route: o });
|
|
501
|
+
else if (s instanceof Map)
|
|
502
|
+
s.set(t, o);
|
|
503
|
+
else {
|
|
504
|
+
const l = /* @__PURE__ */ new Map();
|
|
505
|
+
l.set(s.eventName, s.route), l.set(t, o), this._bindings.set(e, l);
|
|
506
|
+
}
|
|
507
|
+
Ot(o, i, n), n.registered = !0, this._routeBindings++, i === "user" && this._userRouteBindings++;
|
|
508
|
+
const a = n.owner.own(() => {
|
|
509
|
+
if (n.handler = void 0, n.data = void 0, !n.registered)
|
|
510
|
+
return;
|
|
511
|
+
n.registered = !1, this._routeBindings--, i === "user" && this._userRouteBindings--;
|
|
512
|
+
const l = this._bindings.get(e);
|
|
513
|
+
if (l === void 0)
|
|
514
|
+
return;
|
|
515
|
+
const d = se(l, t);
|
|
516
|
+
if (d !== void 0 && (Rt(d, i, n), d.internal === void 0 && d.user === void 0)) {
|
|
517
|
+
if (!(l instanceof Map))
|
|
518
|
+
this._bindings.delete(e);
|
|
519
|
+
else if (l.delete(t), l.size === 0)
|
|
520
|
+
this._bindings.delete(e);
|
|
521
|
+
else if (l.size === 1) {
|
|
522
|
+
const h = l.entries().next().value;
|
|
523
|
+
h !== void 0 && this._bindings.set(e, {
|
|
524
|
+
eventName: h[0],
|
|
525
|
+
route: h[1]
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
}), c = this._resolveStaticSlot(t);
|
|
530
|
+
try {
|
|
531
|
+
c.listeners.size !== this._boundaries.size && this._installRootListeners(c);
|
|
532
|
+
} catch (l) {
|
|
533
|
+
try {
|
|
534
|
+
a();
|
|
535
|
+
} catch (d) {
|
|
536
|
+
throw new AggregateError(
|
|
537
|
+
[l, d],
|
|
538
|
+
"[RaphyDOM] Event binding installation and rollback failed."
|
|
539
|
+
);
|
|
540
|
+
}
|
|
541
|
+
throw l;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* Создаёт stable native listener для события вне delegation allowlist.
|
|
546
|
+
*/
|
|
547
|
+
_createDirectWriter(e, t, n, i, s) {
|
|
548
|
+
let o, a = !1;
|
|
549
|
+
const c = (l) => {
|
|
550
|
+
const d = o;
|
|
551
|
+
if (!(d === void 0 || n.disposed) && !(s.self === !0 && l.target !== e))
|
|
552
|
+
try {
|
|
553
|
+
this._runtime.action(
|
|
554
|
+
`@raphy-js/dom:event:${t}`,
|
|
555
|
+
() => {
|
|
556
|
+
s.prevent === !0 && l.preventDefault(), s.stop === !0 && l.stopPropagation(), J(e, d, void 0, s.eventless === !0 ? void 0 : l);
|
|
557
|
+
}
|
|
558
|
+
)();
|
|
559
|
+
} catch (h) {
|
|
560
|
+
if (!i(h))
|
|
561
|
+
throw h;
|
|
562
|
+
} finally {
|
|
563
|
+
s.once === !0 && a && (a = !1, o = void 0, e.removeEventListener(t, c, s.capture));
|
|
564
|
+
}
|
|
565
|
+
};
|
|
566
|
+
return {
|
|
567
|
+
clear: () => {
|
|
568
|
+
o = void 0;
|
|
569
|
+
},
|
|
570
|
+
write: (l) => {
|
|
571
|
+
if (o = ne(l, t), !(o === void 0 || a)) {
|
|
572
|
+
a = !0;
|
|
573
|
+
try {
|
|
574
|
+
e.addEventListener(t, c, s);
|
|
575
|
+
} catch (d) {
|
|
576
|
+
o = void 0, a = !1;
|
|
577
|
+
try {
|
|
578
|
+
e.removeEventListener(t, c, s.capture);
|
|
579
|
+
} catch (h) {
|
|
580
|
+
throw new AggregateError(
|
|
581
|
+
[d, h],
|
|
582
|
+
"[RaphyDOM] Direct listener installation cleanup failed."
|
|
583
|
+
);
|
|
584
|
+
}
|
|
585
|
+
throw d;
|
|
586
|
+
}
|
|
587
|
+
n.own(() => {
|
|
588
|
+
o = void 0, a && (a = !1, e.removeEventListener(t, c, s.capture));
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Устанавливает direct listener для одного неизменяемого handler.
|
|
596
|
+
*
|
|
597
|
+
* `data` — значение, с которым handler зарегистрирован в `registerStatic()`:
|
|
598
|
+
* оно лежит в context listener рядом с handler и освобождается вместе с ним.
|
|
599
|
+
*/
|
|
600
|
+
_registerStaticDirect(e, t, n, i, s, o, a) {
|
|
601
|
+
let c = n, l = a, d = !0;
|
|
602
|
+
const h = (_) => {
|
|
603
|
+
const m = c;
|
|
604
|
+
if (m === void 0 || i.disposed || o.self === !0 && _.target !== e)
|
|
605
|
+
return;
|
|
606
|
+
const E = l;
|
|
607
|
+
try {
|
|
608
|
+
this._runtime.action(
|
|
609
|
+
`@raphy-js/dom:event:${t}`,
|
|
610
|
+
() => {
|
|
611
|
+
o.prevent === !0 && _.preventDefault(), o.stop === !0 && _.stopPropagation(), J(e, m, E, o.eventless === !0 ? void 0 : _);
|
|
612
|
+
}
|
|
613
|
+
)();
|
|
614
|
+
} catch (R) {
|
|
615
|
+
if (!s(R))
|
|
616
|
+
throw R;
|
|
617
|
+
} finally {
|
|
618
|
+
o.once === !0 && d && (d = !1, c = void 0, l = void 0, e.removeEventListener(t, h, o.capture));
|
|
619
|
+
}
|
|
620
|
+
};
|
|
621
|
+
try {
|
|
622
|
+
e.addEventListener(t, h, o);
|
|
623
|
+
} catch (_) {
|
|
624
|
+
c = void 0, l = void 0, d = !1;
|
|
625
|
+
try {
|
|
626
|
+
e.removeEventListener(t, h, o.capture);
|
|
627
|
+
} catch (m) {
|
|
628
|
+
throw new AggregateError(
|
|
629
|
+
[_, m],
|
|
630
|
+
"[RaphyDOM] Direct listener installation cleanup failed."
|
|
631
|
+
);
|
|
632
|
+
}
|
|
633
|
+
throw _;
|
|
634
|
+
}
|
|
635
|
+
i.own(() => {
|
|
636
|
+
c = void 0, l = void 0, d && (d = !1, e.removeEventListener(t, h, o.capture));
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* Устанавливает native listener события на boundaries, где его ещё нет.
|
|
641
|
+
*
|
|
642
|
+
* Registration вызывает метод, только пока listener есть не на всех boundaries.
|
|
643
|
+
*/
|
|
644
|
+
_installRootListeners(e) {
|
|
645
|
+
for (const t of this._boundaries.keys())
|
|
646
|
+
this._ensureBoundaryListener(e, t);
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* Возвращает состояние delegated event, создавая его при первом обращении.
|
|
650
|
+
*/
|
|
651
|
+
_resolveStaticSlot(e) {
|
|
652
|
+
let t = this._staticSlots.get(e);
|
|
653
|
+
return t === void 0 && (t = new ce(e, null, !1, !1), this._staticSlots.set(e, t)), t;
|
|
654
|
+
}
|
|
655
|
+
_ensureBoundaryListener(e, t) {
|
|
656
|
+
const n = e.listeners;
|
|
657
|
+
if (n.has(t))
|
|
658
|
+
return;
|
|
659
|
+
const i = (s) => this._dispatch(e, s);
|
|
660
|
+
n.set(t, i);
|
|
661
|
+
try {
|
|
662
|
+
t.addEventListener(e.eventName, i);
|
|
663
|
+
} catch (s) {
|
|
664
|
+
let o = !1, a;
|
|
665
|
+
try {
|
|
666
|
+
t.removeEventListener(e.eventName, i);
|
|
667
|
+
} catch (c) {
|
|
668
|
+
o = !0, a = c;
|
|
669
|
+
}
|
|
670
|
+
throw n.get(t) === i && n.delete(t), o ? new AggregateError(
|
|
671
|
+
[s, a],
|
|
672
|
+
"[RaphyDOM] Event listener installation and rollback failed."
|
|
673
|
+
) : s;
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* Выполняет bubble dispatch по зарегистрированным elements внутри одной action.
|
|
678
|
+
*
|
|
679
|
+
* `slot` — основная запись события: root listener держит её сам и не ищет по
|
|
680
|
+
* имени. Path события не копируется: доставка идёт по `composedPath()` от
|
|
681
|
+
* первого element до boundary.
|
|
682
|
+
*/
|
|
683
|
+
_dispatch(e, t) {
|
|
684
|
+
if (this._disposed)
|
|
685
|
+
return;
|
|
686
|
+
if (this._boundaries.size > 1) {
|
|
687
|
+
const a = e.eventName;
|
|
688
|
+
let c = this._dispatched.get(t);
|
|
689
|
+
if (c?.has(a) === !0)
|
|
690
|
+
return;
|
|
691
|
+
c === void 0 && (c = /* @__PURE__ */ new Set(), this._dispatched.set(t, c)), c.add(a);
|
|
692
|
+
}
|
|
693
|
+
const n = typeof t.composedPath == "function" ? t.composedPath() : Ue(t.target), i = this._boundaries.size === 1 ? n.indexOf(this._primaryBoundary) : n.findIndex((a) => this._boundaries.has(
|
|
694
|
+
a
|
|
695
|
+
));
|
|
696
|
+
let s = 0;
|
|
697
|
+
for (; s <= i && !qe(n[s]); )
|
|
698
|
+
s++;
|
|
699
|
+
if (s > i)
|
|
700
|
+
return;
|
|
701
|
+
const o = L;
|
|
702
|
+
try {
|
|
703
|
+
let a = e.dispatch;
|
|
704
|
+
(a === void 0 || this._runtime.disposed) && (a = e.dispatch = this._runtime.action(
|
|
705
|
+
`@raphy-js/dom:event:${e.eventName}`,
|
|
706
|
+
kt
|
|
707
|
+
)), a(this, e, n, s, i, t);
|
|
708
|
+
} finally {
|
|
709
|
+
const a = L;
|
|
710
|
+
a !== o && a !== null && Ct(a);
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
/**
|
|
714
|
+
* Запрещает новые registrations после renderer cleanup.
|
|
715
|
+
*/
|
|
716
|
+
_assertAlive() {
|
|
717
|
+
if (this._disposed)
|
|
718
|
+
throw new Error("[RaphyDOM] Event hub is disposed.");
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
function se(r, e) {
|
|
722
|
+
if (r !== void 0)
|
|
723
|
+
return r instanceof Map ? r.get(e) : r.eventName === e ? r.route : void 0;
|
|
724
|
+
}
|
|
725
|
+
function Ot(r, e, t) {
|
|
726
|
+
const n = r[e];
|
|
727
|
+
if (n === void 0) {
|
|
728
|
+
r[e] = t;
|
|
729
|
+
return;
|
|
730
|
+
}
|
|
731
|
+
if (n instanceof Set) {
|
|
732
|
+
n.add(t);
|
|
733
|
+
return;
|
|
734
|
+
}
|
|
735
|
+
n !== t && (r[e] = /* @__PURE__ */ new Set([n, t]));
|
|
736
|
+
}
|
|
737
|
+
function Rt(r, e, t) {
|
|
738
|
+
const n = r[e];
|
|
739
|
+
if (n === t) {
|
|
740
|
+
r[e] = void 0;
|
|
741
|
+
return;
|
|
742
|
+
}
|
|
743
|
+
n instanceof Set && (n.delete(t), n.size === 0 ? r[e] = void 0 : n.size === 1 && (r[e] = n.values().next().value));
|
|
744
|
+
}
|
|
745
|
+
function Le(r, e, t) {
|
|
746
|
+
if (t === void 0)
|
|
747
|
+
return !1;
|
|
748
|
+
if (!(t instanceof Set))
|
|
749
|
+
return Ie(r, e, t);
|
|
750
|
+
for (const n of t)
|
|
751
|
+
if (Ie(r, e, n))
|
|
752
|
+
return !0;
|
|
753
|
+
return !1;
|
|
754
|
+
}
|
|
755
|
+
function Ie(r, e, t) {
|
|
756
|
+
const n = t.handler;
|
|
757
|
+
if (n === void 0 || t.owner.disposed)
|
|
758
|
+
return !1;
|
|
759
|
+
try {
|
|
760
|
+
return J(
|
|
761
|
+
r,
|
|
762
|
+
n,
|
|
763
|
+
t.data,
|
|
764
|
+
t.eventless ? void 0 : ke(e, r)
|
|
765
|
+
), !1;
|
|
766
|
+
} catch (i) {
|
|
767
|
+
if (!t.handleError(i))
|
|
768
|
+
throw i;
|
|
769
|
+
return !0;
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
function Dt(r, e, t) {
|
|
773
|
+
const n = r[t.handler];
|
|
774
|
+
if (n === void 0)
|
|
775
|
+
return !1;
|
|
776
|
+
const i = r[t.owner];
|
|
777
|
+
if (i.owner.disposed)
|
|
778
|
+
return !1;
|
|
779
|
+
const s = i.router;
|
|
780
|
+
if (s !== void 0)
|
|
781
|
+
return Mt(r, e, t, i, s, r[t.data]);
|
|
782
|
+
try {
|
|
783
|
+
return J(
|
|
784
|
+
r,
|
|
785
|
+
n,
|
|
786
|
+
r[t.data],
|
|
787
|
+
i.eventless ? void 0 : ke(e, r)
|
|
788
|
+
), !1;
|
|
789
|
+
} catch (o) {
|
|
790
|
+
if (!i.handleError(i.errorContext, o, `event:${t.eventName}`))
|
|
791
|
+
throw o;
|
|
792
|
+
return !0;
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
function Mt(r, e, t, n, i, s) {
|
|
796
|
+
const o = e.target;
|
|
797
|
+
if (o === null)
|
|
798
|
+
return !1;
|
|
799
|
+
const a = i.routes;
|
|
800
|
+
for (let c = 0; c < a.length; c++) {
|
|
801
|
+
const l = a[c];
|
|
802
|
+
let d = r;
|
|
803
|
+
const h = l.path;
|
|
804
|
+
for (let _ = 0; _ < h.length && d !== null; _++)
|
|
805
|
+
d = d.childNodes[h[_]] ?? null;
|
|
806
|
+
if (!(d === null || !d.contains(o))) {
|
|
807
|
+
try {
|
|
808
|
+
J(
|
|
809
|
+
d,
|
|
810
|
+
l.handler,
|
|
811
|
+
l.data === void 0 ? void 0 : l.data(s),
|
|
812
|
+
l.eventless ? void 0 : ke(e, d)
|
|
813
|
+
);
|
|
814
|
+
} catch (_) {
|
|
815
|
+
if (!n.handleError(n.errorContext, _, `event:${t.eventName}`))
|
|
816
|
+
throw _;
|
|
817
|
+
return !0;
|
|
818
|
+
}
|
|
819
|
+
if (e.cancelBubble)
|
|
820
|
+
break;
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
return !1;
|
|
824
|
+
}
|
|
825
|
+
function J(r, e, t, n) {
|
|
826
|
+
t === void 0 ? n === void 0 ? e.call(r) : e.call(r, n) : n === void 0 ? e.call(
|
|
827
|
+
r,
|
|
828
|
+
t === ae ? void 0 : t
|
|
829
|
+
) : e.call(
|
|
830
|
+
r,
|
|
831
|
+
t === ae ? void 0 : t,
|
|
832
|
+
n
|
|
833
|
+
);
|
|
834
|
+
}
|
|
835
|
+
function ke(r, e) {
|
|
836
|
+
let t = L;
|
|
837
|
+
return (t === null || t.event !== r) && (t = St(r)), t.target = e, t.handed;
|
|
838
|
+
}
|
|
839
|
+
function ge(r, e) {
|
|
840
|
+
r[e.handler] = void 0, r[e.owner] = void 0, e.clearsData && (r[e.data] = void 0);
|
|
841
|
+
}
|
|
842
|
+
function Et(r) {
|
|
843
|
+
return typeof r != "number" && typeof r != "boolean" && r !== null && r !== ae;
|
|
844
|
+
}
|
|
845
|
+
function ne(r, e) {
|
|
846
|
+
if (r != null) {
|
|
847
|
+
if (typeof r != "function")
|
|
848
|
+
throw new TypeError(`[RaphyDOM] Event "${e}" must be a function.`);
|
|
849
|
+
return r;
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
function kt(r, e, t, n, i, s) {
|
|
853
|
+
const o = e.eventName, a = e.handler;
|
|
854
|
+
for (let c = n; c <= i; c++) {
|
|
855
|
+
const l = t[c], d = r._routeBindings === 0 ? void 0 : se(r._bindings.get(l), o);
|
|
856
|
+
if (d === void 0 && l[a] === void 0 || c !== n && !qe(l))
|
|
857
|
+
continue;
|
|
858
|
+
const h = L;
|
|
859
|
+
if (h !== null && h.event === s && (h.target = l), d !== void 0 && Le(l, s, d.internal) || Dt(l, s, e) || d !== void 0 && Le(l, s, d.user) || s.cancelBubble || r._disposed)
|
|
860
|
+
break;
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
function St(r) {
|
|
864
|
+
const e = L, t = Object.getOwnPropertyDescriptor(r, "currentTarget");
|
|
865
|
+
let n = e === null ? de : new le();
|
|
866
|
+
try {
|
|
867
|
+
Object.defineProperty(r, "currentTarget", n.accessor), n.handed = r, n.original = t;
|
|
868
|
+
} catch {
|
|
869
|
+
n === de && (n = new le()), n.handed = At(r, n);
|
|
870
|
+
}
|
|
871
|
+
return n.event = r, n.outer = e, L = n, n;
|
|
872
|
+
}
|
|
873
|
+
function Ct(r) {
|
|
874
|
+
const e = r.event, t = r.handed === e, n = r.original;
|
|
875
|
+
if (L = r.outer, r.event = null, r.handed = null, r.target = null, r.outer = null, r.original = void 0, !!t) {
|
|
876
|
+
if (n === void 0) {
|
|
877
|
+
Reflect.deleteProperty(e, "currentTarget") || We(r);
|
|
878
|
+
return;
|
|
879
|
+
}
|
|
880
|
+
try {
|
|
881
|
+
Object.defineProperty(e, "currentTarget", n);
|
|
882
|
+
} catch (i) {
|
|
883
|
+
throw We(r), i;
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
function We(r) {
|
|
888
|
+
r === de && (de = new le());
|
|
889
|
+
}
|
|
890
|
+
function At(r, e) {
|
|
891
|
+
return new Proxy(r, {
|
|
892
|
+
get(t, n) {
|
|
893
|
+
if (n === "currentTarget")
|
|
894
|
+
return e.target;
|
|
895
|
+
const i = Reflect.get(t, n, t);
|
|
896
|
+
return typeof i == "function" ? i.bind(t) : i;
|
|
897
|
+
}
|
|
898
|
+
});
|
|
899
|
+
}
|
|
900
|
+
function Ue(r) {
|
|
901
|
+
const e = [];
|
|
902
|
+
let t = r;
|
|
903
|
+
for (; t !== null; )
|
|
904
|
+
e.push(t), t = Ge(t) ? t.parentNode : null;
|
|
905
|
+
return e;
|
|
906
|
+
}
|
|
907
|
+
function qe(r) {
|
|
908
|
+
return Ge(r) && r.nodeType === 1;
|
|
909
|
+
}
|
|
910
|
+
function Ge(r) {
|
|
911
|
+
return r != null && typeof Reflect.get(r, "nodeType") == "number";
|
|
912
|
+
}
|
|
913
|
+
function we(r) {
|
|
914
|
+
return r.capture !== !0 && r.once !== !0 && r.passive !== !0 && r.prevent !== !0 && r.self !== !0 && r.stop !== !0;
|
|
915
|
+
}
|
|
916
|
+
function me(r) {
|
|
917
|
+
return typeof r == "boolean" ? r : r.capture === !0;
|
|
918
|
+
}
|
|
919
|
+
function Tt(r, e, t) {
|
|
920
|
+
if (r.size < 2)
|
|
921
|
+
return !0;
|
|
922
|
+
const n = typeof t.composedPath == "function" ? t.composedPath() : Ue(t.target);
|
|
923
|
+
for (const i of n)
|
|
924
|
+
if (r.has(i))
|
|
925
|
+
return i === e;
|
|
926
|
+
return !0;
|
|
927
|
+
}
|
|
928
|
+
const fr = [
|
|
929
|
+
"click",
|
|
930
|
+
"input",
|
|
931
|
+
"change",
|
|
932
|
+
"keydown",
|
|
933
|
+
"submit",
|
|
934
|
+
"pointerdown",
|
|
935
|
+
"focusin",
|
|
936
|
+
"compositionstart",
|
|
937
|
+
"compositionend"
|
|
938
|
+
], V = /* @__PURE__ */ new WeakMap(), ue = /* @__PURE__ */ new WeakSet();
|
|
939
|
+
function Nt(r) {
|
|
940
|
+
return V.has(r);
|
|
941
|
+
}
|
|
942
|
+
function jt(r) {
|
|
943
|
+
return ue.has(r);
|
|
944
|
+
}
|
|
945
|
+
function Pt(r) {
|
|
946
|
+
if (r.released)
|
|
947
|
+
return;
|
|
948
|
+
r.released = !0;
|
|
949
|
+
const e = V.get(r.target) - 1;
|
|
950
|
+
e === 0 ? (V.delete(r.target), ue.delete(r.target)) : V.set(r.target, e);
|
|
951
|
+
}
|
|
952
|
+
function pr(r) {
|
|
953
|
+
const e = r.target, t = e;
|
|
954
|
+
return V.set(e, (V.get(e) ?? 0) + 1), r.type === "compositionstart" ? ue.add(e) : r.type === "compositionend" && ue.delete(e), {
|
|
955
|
+
released: !1,
|
|
956
|
+
event: r,
|
|
957
|
+
target: e,
|
|
958
|
+
value: Reflect.get(e, "value"),
|
|
959
|
+
checked: Reflect.get(e, "checked"),
|
|
960
|
+
..."selectionStart" in e ? {
|
|
961
|
+
selection: {
|
|
962
|
+
start: t.selectionStart,
|
|
963
|
+
end: t.selectionEnd,
|
|
964
|
+
direction: t.selectionDirection
|
|
965
|
+
}
|
|
966
|
+
} : {}
|
|
967
|
+
};
|
|
968
|
+
}
|
|
969
|
+
function _r(r) {
|
|
970
|
+
if (Pt(r), !r.target.isConnected)
|
|
971
|
+
return;
|
|
972
|
+
if (r.value !== void 0 && Reflect.set(r.target, "value", r.value), r.checked !== void 0) {
|
|
973
|
+
const n = r.target.type;
|
|
974
|
+
Reflect.set(
|
|
975
|
+
r.target,
|
|
976
|
+
"checked",
|
|
977
|
+
r.event.type === "click" ? n === "checkbox" ? !r.checked : n === "radio" ? !1 : r.checked : r.checked
|
|
978
|
+
);
|
|
979
|
+
}
|
|
980
|
+
r.selection?.start !== null && r.selection?.start !== void 0 && r.target.setSelectionRange(
|
|
981
|
+
r.selection.start,
|
|
982
|
+
r.selection.end,
|
|
983
|
+
r.selection.direction
|
|
984
|
+
);
|
|
985
|
+
const e = r.event.constructor;
|
|
986
|
+
if (r.target.dispatchEvent(
|
|
987
|
+
new e(r.event.type, r.event)
|
|
988
|
+
))
|
|
989
|
+
if (r.event.type === "submit" && r.target.localName === "form") {
|
|
990
|
+
const n = r.target;
|
|
991
|
+
n.ownerDocument.defaultView.HTMLFormElement.prototype.submit.call(n);
|
|
992
|
+
} else r.event.type === "keydown" && r.event.key === "Enter" && r.target.localName === "input" && r.target.form?.requestSubmit();
|
|
993
|
+
}
|
|
994
|
+
function yr(r) {
|
|
995
|
+
r.stopImmediatePropagation(), r.cancelable && (r.type === "click" || r.type === "submit" || r.type === "keydown" && r.key === "Enter" && !r.isComposing) && r.preventDefault();
|
|
996
|
+
}
|
|
997
|
+
const B = /* @__PURE__ */ new WeakMap();
|
|
998
|
+
let De = 0;
|
|
999
|
+
function I(r) {
|
|
1000
|
+
return De === 0 ? void 0 : B.get(r);
|
|
1001
|
+
}
|
|
1002
|
+
class Ke {
|
|
1003
|
+
constructor(e, t, n, i) {
|
|
1004
|
+
this.options = e, this._stream = i, this.work = t, this._tokens = n ?? be(e.target, e.manifest.texts);
|
|
1005
|
+
for (const [s, o] of this._tokens.entries())
|
|
1006
|
+
this._indexes.set(o.node, s);
|
|
1007
|
+
}
|
|
1008
|
+
_tokens;
|
|
1009
|
+
_cursor = 0;
|
|
1010
|
+
_adopted = /* @__PURE__ */ new WeakSet();
|
|
1011
|
+
_indexes = /* @__PURE__ */ new WeakMap();
|
|
1012
|
+
pending = /* @__PURE__ */ new Set();
|
|
1013
|
+
cleanups = /* @__PURE__ */ new Set();
|
|
1014
|
+
_commits = [];
|
|
1015
|
+
_dirtyControls = /* @__PURE__ */ new Set();
|
|
1016
|
+
_disposed = !1;
|
|
1017
|
+
_parent;
|
|
1018
|
+
_readyDone = !1;
|
|
1019
|
+
work;
|
|
1020
|
+
controlsChanged = !1;
|
|
1021
|
+
run(e) {
|
|
1022
|
+
const t = this.options.target.ownerDocument, n = B.get(t);
|
|
1023
|
+
B.set(t, this), De++;
|
|
1024
|
+
try {
|
|
1025
|
+
return e();
|
|
1026
|
+
} finally {
|
|
1027
|
+
De--, n === void 0 ? B.delete(t) : B.set(t, n);
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
suspend(e) {
|
|
1031
|
+
const t = this.options.target.ownerDocument, n = B.get(t);
|
|
1032
|
+
B.delete(t);
|
|
1033
|
+
try {
|
|
1034
|
+
return e();
|
|
1035
|
+
} finally {
|
|
1036
|
+
n !== void 0 && B.set(t, n);
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
nextLabel() {
|
|
1040
|
+
return this._tokens[this._cursor]?.label;
|
|
1041
|
+
}
|
|
1042
|
+
componentIdentity() {
|
|
1043
|
+
const e = this._tokens[this._cursor];
|
|
1044
|
+
return e?.kind === "range" && (e.label === "raphy:component" || e.label === "raphy:async-component") ? e.id?.replace(/\.async$/, "") : void 0;
|
|
1045
|
+
}
|
|
1046
|
+
portal(e, t) {
|
|
1047
|
+
const n = this._tokens[this._indexes.get(t)], i = be(e, this.options.manifest.texts), s = i.findIndex(
|
|
1048
|
+
(a) => a.label === "raphy:teleport:content" && a.id === `${n?.id}.portal`
|
|
1049
|
+
);
|
|
1050
|
+
if (s === -1)
|
|
1051
|
+
throw new Error("[RaphyDOM] Missing server portal boundary.");
|
|
1052
|
+
const o = i.slice(s, i[s].end).map((a) => ({ ...a, end: a.end - s }));
|
|
1053
|
+
return this._fork({ ...this.options, target: e }, o);
|
|
1054
|
+
}
|
|
1055
|
+
range(e) {
|
|
1056
|
+
const t = this._take("range", e);
|
|
1057
|
+
return t === void 0 ? void 0 : { first: t.node, last: t.last };
|
|
1058
|
+
}
|
|
1059
|
+
element(e, t) {
|
|
1060
|
+
const n = this._tokens[this._cursor];
|
|
1061
|
+
if (n?.kind === "element" && n.node.localName.toLowerCase() === e.toLowerCase() && n.node.namespaceURI === t)
|
|
1062
|
+
return this._cursor++, this._adopted.add(n.node), n.node;
|
|
1063
|
+
this._mismatch(`${t}:${e}`, n);
|
|
1064
|
+
}
|
|
1065
|
+
text(e) {
|
|
1066
|
+
if (e === "" && this._tokens[this._cursor]?.kind !== "text") {
|
|
1067
|
+
const i = this.options.target.ownerDocument.createTextNode("");
|
|
1068
|
+
return this._adopted.add(i), i;
|
|
1069
|
+
}
|
|
1070
|
+
const t = this._take("text");
|
|
1071
|
+
if (t === void 0)
|
|
1072
|
+
return;
|
|
1073
|
+
const n = t.node;
|
|
1074
|
+
return e !== void 0 && this.checkText(n, e), n;
|
|
1075
|
+
}
|
|
1076
|
+
checkText(e, t) {
|
|
1077
|
+
const n = this._tokens[this._indexes.get(e)];
|
|
1078
|
+
if (e.data !== t && !(this.controlsChanged && n?.serverText === e.data)) {
|
|
1079
|
+
const i = {
|
|
1080
|
+
code: "DOM_HYDRATION_MISMATCH",
|
|
1081
|
+
expected: JSON.stringify(t),
|
|
1082
|
+
actual: JSON.stringify(e.data),
|
|
1083
|
+
node: e
|
|
1084
|
+
};
|
|
1085
|
+
if (this.options.onMismatch?.(i), this.options.mode !== "production")
|
|
1086
|
+
throw new Error(
|
|
1087
|
+
`[RaphyDOM] Hydration text mismatch: expected ${i.expected}, received ${i.actual}.`
|
|
1088
|
+
);
|
|
1089
|
+
}
|
|
1090
|
+
e.data !== t && (e.data = t);
|
|
1091
|
+
}
|
|
1092
|
+
finishElement(e, t = !1) {
|
|
1093
|
+
const n = this._tokens[this._indexes.get(e)];
|
|
1094
|
+
if (n !== void 0 && this._cursor < n.end)
|
|
1095
|
+
if (t)
|
|
1096
|
+
this._cursor = n.end;
|
|
1097
|
+
else
|
|
1098
|
+
for (; this._cursor < n.end; )
|
|
1099
|
+
this._mismatch("end of element", this._tokens[this._cursor]);
|
|
1100
|
+
}
|
|
1101
|
+
owns(e) {
|
|
1102
|
+
return this._adopted.has(e);
|
|
1103
|
+
}
|
|
1104
|
+
remaining() {
|
|
1105
|
+
for (; this._cursor < this._tokens.length; )
|
|
1106
|
+
this._mismatch("end of boundary", this._tokens[this._cursor]);
|
|
1107
|
+
}
|
|
1108
|
+
/** Leaves untouched HTML behind and lends exactly its tokens to a later trigger. */
|
|
1109
|
+
defer(e, t = !1) {
|
|
1110
|
+
const n = this._indexes.get(e) ?? -1, i = this._tokens[n];
|
|
1111
|
+
if (i === void 0)
|
|
1112
|
+
throw new Error("[RaphyDOM] Missing hydration boundary marker.");
|
|
1113
|
+
const s = t ? n : n + 1;
|
|
1114
|
+
this._cursor = i.end;
|
|
1115
|
+
const o = this._tokens.slice(s, i.end).map((a) => ({ ...a, end: a.end - s }));
|
|
1116
|
+
return this._fork(this.options, o);
|
|
1117
|
+
}
|
|
1118
|
+
skip(e) {
|
|
1119
|
+
this.defer(e);
|
|
1120
|
+
}
|
|
1121
|
+
get streaming() {
|
|
1122
|
+
return this._stream !== void 0;
|
|
1123
|
+
}
|
|
1124
|
+
waitStream(e, t, n) {
|
|
1125
|
+
const i = this._tokens[this._indexes.get(e)];
|
|
1126
|
+
return this._stream.register(i.id, e, t, n), this._stream.wait(i.id, n);
|
|
1127
|
+
}
|
|
1128
|
+
trackStream(e) {
|
|
1129
|
+
this._stream.track(e);
|
|
1130
|
+
}
|
|
1131
|
+
finishStream(e) {
|
|
1132
|
+
this._stream.release(this._tokens[this._indexes.get(e)].id);
|
|
1133
|
+
}
|
|
1134
|
+
/** The parser has replaced this range since the shell tokens were captured. */
|
|
1135
|
+
rescan(e, t) {
|
|
1136
|
+
return this._fork(this.options, be(this.options.target, this.options.manifest.texts, e.nextSibling, t));
|
|
1137
|
+
}
|
|
1138
|
+
track(e) {
|
|
1139
|
+
this.pending.add(e), e.then(
|
|
1140
|
+
() => this.pending.delete(e),
|
|
1141
|
+
() => this.pending.delete(e)
|
|
1142
|
+
);
|
|
1143
|
+
}
|
|
1144
|
+
/** Initial grouped props may execute under a sibling's reactive phase. */
|
|
1145
|
+
initialBinding(e, t) {
|
|
1146
|
+
let n = !0, i, s;
|
|
1147
|
+
const o = new Promise((l, d) => {
|
|
1148
|
+
i = l, s = d;
|
|
1149
|
+
}), a = () => {
|
|
1150
|
+
this.cleanups.delete(a), i();
|
|
1151
|
+
};
|
|
1152
|
+
this.cleanups.add(a);
|
|
1153
|
+
const c = e.own(a);
|
|
1154
|
+
return this.track(o), () => {
|
|
1155
|
+
if (!n) {
|
|
1156
|
+
t();
|
|
1157
|
+
return;
|
|
1158
|
+
}
|
|
1159
|
+
n = !1;
|
|
1160
|
+
try {
|
|
1161
|
+
this.run(t), i();
|
|
1162
|
+
} catch (l) {
|
|
1163
|
+
throw s(l), l;
|
|
1164
|
+
} finally {
|
|
1165
|
+
c();
|
|
1166
|
+
}
|
|
1167
|
+
};
|
|
1168
|
+
}
|
|
1169
|
+
commit(e, t) {
|
|
1170
|
+
this._commits.push({ operation: e, cancel: t });
|
|
1171
|
+
}
|
|
1172
|
+
preserveControl(e) {
|
|
1173
|
+
if (this.controlsChanged = !0, this._parent !== void 0 && !this._parent._readyDone) {
|
|
1174
|
+
this._parent.preserveControl(e);
|
|
1175
|
+
return;
|
|
1176
|
+
}
|
|
1177
|
+
Nt(e) || this._dirtyControls.add(e);
|
|
1178
|
+
}
|
|
1179
|
+
async ready() {
|
|
1180
|
+
for (; this.pending.size !== 0; )
|
|
1181
|
+
await Promise.all(this.pending);
|
|
1182
|
+
for (; !this._disposed && this._commits.length !== 0; )
|
|
1183
|
+
this._commits.shift().operation();
|
|
1184
|
+
if (this._readyDone = !0, !this._disposed) {
|
|
1185
|
+
for (const e of this._dirtyControls)
|
|
1186
|
+
if (e.isConnected) {
|
|
1187
|
+
const t = e.ownerDocument.defaultView, n = e.localName === "textarea" || e.localName === "input" && !["checkbox", "radio"].includes(
|
|
1188
|
+
e.type
|
|
1189
|
+
);
|
|
1190
|
+
e.dispatchEvent(
|
|
1191
|
+
n ? new t.InputEvent("input", {
|
|
1192
|
+
bubbles: !0,
|
|
1193
|
+
isComposing: jt(e)
|
|
1194
|
+
}) : new t.Event("change", { bubbles: !0 })
|
|
1195
|
+
);
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
this._dirtyControls.clear();
|
|
1199
|
+
}
|
|
1200
|
+
dispose() {
|
|
1201
|
+
this._disposed = !0, this._dirtyControls.clear();
|
|
1202
|
+
for (const e of this._commits.splice(0))
|
|
1203
|
+
e.cancel();
|
|
1204
|
+
for (const e of this.cleanups)
|
|
1205
|
+
e();
|
|
1206
|
+
this.cleanups.clear();
|
|
1207
|
+
}
|
|
1208
|
+
_fork(e, t) {
|
|
1209
|
+
const n = this._stream, i = n === void 0 ? e : {
|
|
1210
|
+
...e,
|
|
1211
|
+
get manifest() {
|
|
1212
|
+
return n.manifest;
|
|
1213
|
+
}
|
|
1214
|
+
}, s = new Ke(i, this.work, t, n);
|
|
1215
|
+
s._parent = this;
|
|
1216
|
+
const o = () => s.dispose();
|
|
1217
|
+
return this.cleanups.add(o), s.cleanups.add(() => this.cleanups.delete(o)), s;
|
|
1218
|
+
}
|
|
1219
|
+
_take(e, t) {
|
|
1220
|
+
const n = this._tokens[this._cursor];
|
|
1221
|
+
if (n?.kind === e && (t === void 0 || n.label === t))
|
|
1222
|
+
return this._cursor++, this._adopted.add(n.node), this._stream?.claim(n.node), n;
|
|
1223
|
+
this._mismatch(t ?? e, n);
|
|
1224
|
+
}
|
|
1225
|
+
_mismatch(e, t) {
|
|
1226
|
+
const n = t === void 0 ? "end of boundary" : t.label ?? t.node.nodeName;
|
|
1227
|
+
if (this.options.onMismatch?.({
|
|
1228
|
+
code: "DOM_HYDRATION_MISMATCH",
|
|
1229
|
+
expected: e,
|
|
1230
|
+
actual: n,
|
|
1231
|
+
node: t?.node ?? null
|
|
1232
|
+
}), this.options.mode !== "production")
|
|
1233
|
+
throw new Error(
|
|
1234
|
+
`[RaphyDOM] Hydration mismatch: expected ${e}, received ${n}.`
|
|
1235
|
+
);
|
|
1236
|
+
if (t !== void 0) {
|
|
1237
|
+
this._cursor = t.end;
|
|
1238
|
+
let i = t.node;
|
|
1239
|
+
for (; i !== null; ) {
|
|
1240
|
+
const s = i.nextSibling;
|
|
1241
|
+
if (i.remove(), i === t.last)
|
|
1242
|
+
break;
|
|
1243
|
+
i = s;
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
function be(r, e, t, n) {
|
|
1249
|
+
const i = [], s = (o, a = o.firstChild, c) => {
|
|
1250
|
+
const l = [];
|
|
1251
|
+
for (let d = a; d !== null && d !== c; d = d.nextSibling)
|
|
1252
|
+
if (d.nodeType === 8) {
|
|
1253
|
+
const h = d.data;
|
|
1254
|
+
if (h.startsWith("r:text@1:")) {
|
|
1255
|
+
const m = h.slice(9);
|
|
1256
|
+
if (!Object.hasOwn(e, m))
|
|
1257
|
+
throw new Error("[RaphyDOM] Corrupt text identity.");
|
|
1258
|
+
let E = d.nextSibling;
|
|
1259
|
+
E?.nodeType !== 3 && (E = r.ownerDocument.createTextNode(""), o.insertBefore(E, d.nextSibling));
|
|
1260
|
+
const R = E.nextSibling;
|
|
1261
|
+
if (R?.nodeType !== 8 || R.data !== "r:/text")
|
|
1262
|
+
throw new Error("[RaphyDOM] Corrupt text markers.");
|
|
1263
|
+
i.push({
|
|
1264
|
+
kind: "text",
|
|
1265
|
+
node: E,
|
|
1266
|
+
last: E,
|
|
1267
|
+
serverText: e[m],
|
|
1268
|
+
end: i.length + 1
|
|
1269
|
+
}), d = R;
|
|
1270
|
+
continue;
|
|
1271
|
+
}
|
|
1272
|
+
const _ = /^(raphy:.+)@1:([\w.]+):(start|end)$/.exec(h);
|
|
1273
|
+
if (_ === null)
|
|
1274
|
+
continue;
|
|
1275
|
+
if (_[3] === "start") {
|
|
1276
|
+
const m = {
|
|
1277
|
+
kind: "range",
|
|
1278
|
+
node: d,
|
|
1279
|
+
last: d,
|
|
1280
|
+
label: _[1],
|
|
1281
|
+
id: _[2],
|
|
1282
|
+
end: 0
|
|
1283
|
+
};
|
|
1284
|
+
i.push(m), l.push(m);
|
|
1285
|
+
} else {
|
|
1286
|
+
const m = l.pop();
|
|
1287
|
+
if (m?.id !== _[2] || m.label !== _[1])
|
|
1288
|
+
throw new Error("[RaphyDOM] Corrupt structural markers.");
|
|
1289
|
+
Object.assign(m, { last: d, end: i.length });
|
|
1290
|
+
}
|
|
1291
|
+
} else if (d.nodeType === 1) {
|
|
1292
|
+
const h = d;
|
|
1293
|
+
if (h.hasAttribute("data-r-manifest") || h.hasAttribute("data-r-stream-frame") || h.hasAttribute("data-r-chunk") || h.hasAttribute("data-r-region-chunk") || h.hasAttribute("data-r-chunk-error") || h.hasAttribute("data-r-stream-head") || h.hasAttribute("data-r-stream-portal"))
|
|
1294
|
+
continue;
|
|
1295
|
+
const _ = { kind: "element", node: d, last: d, end: 0 };
|
|
1296
|
+
i.push(_), s(d), _.end = i.length;
|
|
1297
|
+
} else d.nodeType === 3 && i.push({ kind: "text", node: d, last: d, end: i.length + 1 });
|
|
1298
|
+
if (l.length !== 0)
|
|
1299
|
+
throw new Error("[RaphyDOM] Unclosed structural markers.");
|
|
1300
|
+
};
|
|
1301
|
+
return t === void 0 ? s(r) : s(n.parentNode, t, n), i;
|
|
1302
|
+
}
|
|
1303
|
+
function vr(r, e) {
|
|
1304
|
+
return I(r)?.text(e) ?? r.createTextNode(e);
|
|
1305
|
+
}
|
|
1306
|
+
function gr(r, e) {
|
|
1307
|
+
I(r.ownerDocument) !== void 0 && e.parentNode === r || r.appendChild(e);
|
|
1308
|
+
}
|
|
1309
|
+
const $ = "@raphy-js/dom:write", wr = Object.freeze({ initial: "sync" }), zt = Object.freeze([
|
|
1310
|
+
Object.freeze({
|
|
1311
|
+
name: $
|
|
1312
|
+
})
|
|
1313
|
+
]), Bt = Object.freeze({
|
|
1314
|
+
phases: zt,
|
|
1315
|
+
scheduler: "microtask",
|
|
1316
|
+
validateRuntime(r) {
|
|
1317
|
+
if (r.configuration.scheduler !== "microtask")
|
|
1318
|
+
throw new Error('[RaphyDOM] Runtime scheduler must be "microtask".');
|
|
1319
|
+
if (r.phases.find((t) => t.name === $) === void 0)
|
|
1320
|
+
throw new Error(`[RaphyDOM] Runtime does not provide the required "${$}" phase.`);
|
|
1321
|
+
}
|
|
1322
|
+
});
|
|
1323
|
+
function Ht() {
|
|
1324
|
+
return Bt;
|
|
1325
|
+
}
|
|
1326
|
+
const mr = Ht();
|
|
1327
|
+
class w {
|
|
1328
|
+
/** Сохраняет итог вызова, не создавая Error и не меняя raw payload. */
|
|
1329
|
+
constructor(e) {
|
|
1330
|
+
this.error = e;
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
function br(r, e) {
|
|
1334
|
+
if (!r.hasUnrouted)
|
|
1335
|
+
throw new w(r.error);
|
|
1336
|
+
const t = e(r.error);
|
|
1337
|
+
if (!t.handled)
|
|
1338
|
+
throw new w(t.report.error);
|
|
1339
|
+
if (r.completed !== void 0)
|
|
1340
|
+
throw new w(r.completed.error);
|
|
1341
|
+
}
|
|
1342
|
+
class Lt {
|
|
1343
|
+
handled = !0;
|
|
1344
|
+
report;
|
|
1345
|
+
owner;
|
|
1346
|
+
/** Marker не попадает в handlers: они уже получили исходный report. */
|
|
1347
|
+
constructor(e, t) {
|
|
1348
|
+
this.report = e.report, this.owner = t, Object.freeze(this);
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
class P {
|
|
1352
|
+
/** Сохраняет точный report текущего принадлежащего DOM вызова. */
|
|
1353
|
+
constructor(e) {
|
|
1354
|
+
this.captured = e;
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
function ie(r, e) {
|
|
1358
|
+
if (r === void 0)
|
|
1359
|
+
return;
|
|
1360
|
+
if (r.interrupted === void 0)
|
|
1361
|
+
throw new w(r.prior);
|
|
1362
|
+
const t = r.interrupted.error;
|
|
1363
|
+
throw t instanceof P ? new w(r.prior) : t instanceof w ? new w(new AggregateError(
|
|
1364
|
+
[r.prior, t.error],
|
|
1365
|
+
"[RaphyDOM] Published cleanup and mount completion failed."
|
|
1366
|
+
)) : (e(new AggregateError(
|
|
1367
|
+
[r.prior, t],
|
|
1368
|
+
"[RaphyDOM] Published cleanup and mount completion failed."
|
|
1369
|
+
)), new w(r.prior));
|
|
1370
|
+
}
|
|
1371
|
+
function Se(r, e, t) {
|
|
1372
|
+
let n = !0, i = null;
|
|
1373
|
+
try {
|
|
1374
|
+
if (e((s) => {
|
|
1375
|
+
try {
|
|
1376
|
+
return t(s);
|
|
1377
|
+
} catch (o) {
|
|
1378
|
+
if (o instanceof w)
|
|
1379
|
+
throw n ? o : o.error;
|
|
1380
|
+
if (!(o instanceof P))
|
|
1381
|
+
throw o;
|
|
1382
|
+
n && r.disposed && (i = o);
|
|
1383
|
+
}
|
|
1384
|
+
}, () => i !== null), i !== null)
|
|
1385
|
+
throw i;
|
|
1386
|
+
} finally {
|
|
1387
|
+
n = !1, i = null;
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
function xe(r) {
|
|
1391
|
+
try {
|
|
1392
|
+
r();
|
|
1393
|
+
} catch (e) {
|
|
1394
|
+
if (e instanceof P)
|
|
1395
|
+
return;
|
|
1396
|
+
throw e instanceof w ? e.error : e;
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
function pe(r) {
|
|
1400
|
+
throw new w(r);
|
|
1401
|
+
}
|
|
1402
|
+
function Or(r, e, t) {
|
|
1403
|
+
Se(
|
|
1404
|
+
r,
|
|
1405
|
+
(n, i) => r._registerEffect($, n, t, !1, pe, i),
|
|
1406
|
+
e
|
|
1407
|
+
);
|
|
1408
|
+
}
|
|
1409
|
+
function Rr(r, e, t) {
|
|
1410
|
+
Se(
|
|
1411
|
+
r,
|
|
1412
|
+
(n, i) => r._registerEffect($, n, t, !0, pe, i),
|
|
1413
|
+
e
|
|
1414
|
+
);
|
|
1415
|
+
}
|
|
1416
|
+
function Dr(r, e, t, n) {
|
|
1417
|
+
Se(
|
|
1418
|
+
r,
|
|
1419
|
+
(i, s) => r._registerWatch(e, $, i, n, pe, s),
|
|
1420
|
+
t
|
|
1421
|
+
);
|
|
1422
|
+
}
|
|
1423
|
+
function Mr(r, e) {
|
|
1424
|
+
r._start(e, "sync", pe);
|
|
1425
|
+
}
|
|
1426
|
+
function Er(r, e, t) {
|
|
1427
|
+
let n = !1, i = !1;
|
|
1428
|
+
const s = { handled: null };
|
|
1429
|
+
try {
|
|
1430
|
+
return r((o) => {
|
|
1431
|
+
try {
|
|
1432
|
+
e(o);
|
|
1433
|
+
} catch (a) {
|
|
1434
|
+
if (a instanceof P)
|
|
1435
|
+
throw s.handled = a, a.captured.report.error;
|
|
1436
|
+
if (a instanceof w)
|
|
1437
|
+
throw n = !0, a.error;
|
|
1438
|
+
const c = t(a, o);
|
|
1439
|
+
if (c.handled) {
|
|
1440
|
+
if (c instanceof Lt && !c.owner.disposed && !o.node.disposed)
|
|
1441
|
+
return;
|
|
1442
|
+
throw s.handled = new P(c), c.report.error;
|
|
1443
|
+
}
|
|
1444
|
+
throw n = !0, c.report.error;
|
|
1445
|
+
}
|
|
1446
|
+
}, (o) => {
|
|
1447
|
+
throw i = !0, o;
|
|
1448
|
+
});
|
|
1449
|
+
} catch (o) {
|
|
1450
|
+
throw o instanceof w ? o : i ? s.handled !== null || n ? new w(o) : o : s.handled !== null ? Object.is(o, s.handled.captured.report.error) ? s.handled : new w(o) : n ? new w(o) : o;
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
class Oe extends Error {
|
|
1454
|
+
/**
|
|
1455
|
+
* Сохраняет renderer operation context без замены исходного exception.
|
|
1456
|
+
*/
|
|
1457
|
+
constructor(e, t, n, i) {
|
|
1458
|
+
super("[RaphyDOM] Renderer operation failed.", { cause: n }), this.component = e, this.owner = t, this.cause = n, this.source = i, this.name = "DOMOperationError";
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
function Re(r, e, t, n) {
|
|
1462
|
+
return t instanceof Oe ? t.owner.disposed && !e.disposed ? new Oe(t.component, e, t.cause, t.source) : t : new Oe(r, e, t, n);
|
|
1463
|
+
}
|
|
1464
|
+
class Fe {
|
|
1465
|
+
// Сохраняют commit order: сначала refs, затем child-first component hooks.
|
|
1466
|
+
_elementRefs = [];
|
|
1467
|
+
_components = [];
|
|
1468
|
+
_componentRefs = [];
|
|
1469
|
+
_completedFailures;
|
|
1470
|
+
_state = "open";
|
|
1471
|
+
// Блоки when/each/match, чей первый запуск Raph отложил до следующего прохода
|
|
1472
|
+
// доставки: их refs и mount hooks должны попасть в этот же commit.
|
|
1473
|
+
_holds = 0;
|
|
1474
|
+
_released;
|
|
1475
|
+
/** Показывает, может ли текущая materialization добавлять commit operations. */
|
|
1476
|
+
get open() {
|
|
1477
|
+
return this._state === "open";
|
|
1478
|
+
}
|
|
1479
|
+
/** Есть вложенные блоки, ещё не выполнившие первый запуск. */
|
|
1480
|
+
get held() {
|
|
1481
|
+
return this._holds !== 0;
|
|
1482
|
+
}
|
|
1483
|
+
/**
|
|
1484
|
+
* Держит commit до первого запуска вложенного блока. Внутри доставки Raph
|
|
1485
|
+
* откладывает sync initial до следующего прохода; без hold component mount
|
|
1486
|
+
* случился бы раньше, чем блок вставит свои elements и назначит refs.
|
|
1487
|
+
*/
|
|
1488
|
+
hold() {
|
|
1489
|
+
this._assertOpen(), this._holds++;
|
|
1490
|
+
let e = !1;
|
|
1491
|
+
return () => {
|
|
1492
|
+
if (!e && (e = !0, --this._holds === 0 && this._released !== void 0)) {
|
|
1493
|
+
const t = this._released;
|
|
1494
|
+
this._released = void 0, this._state === "open" && t();
|
|
1495
|
+
}
|
|
1496
|
+
};
|
|
1497
|
+
}
|
|
1498
|
+
/** Выполняет finish после снятия последнего hold; без holds — сразу. */
|
|
1499
|
+
afterHolds(e) {
|
|
1500
|
+
if (this._assertOpen(), this._holds === 0) {
|
|
1501
|
+
e();
|
|
1502
|
+
return;
|
|
1503
|
+
}
|
|
1504
|
+
this._released = e;
|
|
1505
|
+
}
|
|
1506
|
+
/** Откладывает назначение ref и сразу связывает его cleanup с owner. */
|
|
1507
|
+
addElementRef(e, t, n) {
|
|
1508
|
+
this._assertOpen(), this._elementRefs.push({ element: t, owner: n, reference: e }), gt(e) && n.own(() => wt(e, t));
|
|
1509
|
+
}
|
|
1510
|
+
/** Откладывает mount hook component до commit всего output range. */
|
|
1511
|
+
addComponent(e, t) {
|
|
1512
|
+
this._assertOpen(), this._components.push({ component: e, handleError: t });
|
|
1513
|
+
}
|
|
1514
|
+
/** Откладывает назначение public component ref до успешной DOM insertion. */
|
|
1515
|
+
addComponentRef(e, t) {
|
|
1516
|
+
this._assertOpen(), this._componentRefs.push({ component: t, reference: e });
|
|
1517
|
+
}
|
|
1518
|
+
/** Handler уже получил ошибку прежней ветки; доставляем её после commit новой. */
|
|
1519
|
+
deferCompletedFailure(e) {
|
|
1520
|
+
this._assertOpen(), (this._completedFailures ??= []).push(e);
|
|
1521
|
+
}
|
|
1522
|
+
/**
|
|
1523
|
+
* Переносит отложенные refs и mount hooks дочерней materialization в текущую transaction.
|
|
1524
|
+
*/
|
|
1525
|
+
absorb(e) {
|
|
1526
|
+
this._assertOpen(), e._assertOpen(), this._elementRefs.push(...e._elementRefs), this._componentRefs.push(...e._componentRefs), this._components.push(...e._components), e._completedFailures !== void 0 && ((this._completedFailures ??= []).push(...e._completedFailures), e._completedFailures = void 0), e._elementRefs.length = 0, e._componentRefs.length = 0, e._components.length = 0, e._state = "committed";
|
|
1527
|
+
}
|
|
1528
|
+
/** Назначает refs и подтверждает component mounts после platform insertion. */
|
|
1529
|
+
commit(e) {
|
|
1530
|
+
this._assertOpen(), this._state = "committing";
|
|
1531
|
+
let t;
|
|
1532
|
+
try {
|
|
1533
|
+
for (const { element: i, owner: s, reference: o } of this._elementRefs)
|
|
1534
|
+
s.disposed || (ft(o) ? e.assignTargetRef(s, o, i) : mt(o, i));
|
|
1535
|
+
for (const { component: i, reference: s } of this._componentRefs)
|
|
1536
|
+
i.disposed || e.assignComponentRef(i, s);
|
|
1537
|
+
for (const { component: i, handleError: s } of this._components)
|
|
1538
|
+
if (!i.disposed)
|
|
1539
|
+
try {
|
|
1540
|
+
e.commitComponentMount(i);
|
|
1541
|
+
} catch (o) {
|
|
1542
|
+
if (!s(o))
|
|
1543
|
+
throw o;
|
|
1544
|
+
}
|
|
1545
|
+
this._state = "committed";
|
|
1546
|
+
} catch (i) {
|
|
1547
|
+
this._state = "failed", t = { error: i };
|
|
1548
|
+
} finally {
|
|
1549
|
+
this._elementRefs.length = 0, this._componentRefs.length = 0, this._components.length = 0;
|
|
1550
|
+
}
|
|
1551
|
+
const n = this._takeCompletion(t);
|
|
1552
|
+
if (n === void 0 && t !== void 0)
|
|
1553
|
+
throw t.error;
|
|
1554
|
+
return n;
|
|
1555
|
+
}
|
|
1556
|
+
/** Ошибка materialization не запускает refs и mount hooks. */
|
|
1557
|
+
abort(e) {
|
|
1558
|
+
const t = this.abortAndTakeCompleted(e);
|
|
1559
|
+
if (t === void 0)
|
|
1560
|
+
throw e;
|
|
1561
|
+
return t;
|
|
1562
|
+
}
|
|
1563
|
+
/** Закрывает неудавшуюся materialization; caller сам маршрутизирует original. */
|
|
1564
|
+
abortAndTakeCompleted(e) {
|
|
1565
|
+
return this._assertOpen(), this._state = "failed", this._elementRefs.length = 0, this._componentRefs.length = 0, this._components.length = 0, this._takeCompletion({ error: e });
|
|
1566
|
+
}
|
|
1567
|
+
/** Отменённая async materialization не подтверждает refs/mount hooks. */
|
|
1568
|
+
cancelAndTakeCompleted() {
|
|
1569
|
+
return this._assertOpen(), this._state = "failed", this._elementRefs.length = 0, this._componentRefs.length = 0, this._components.length = 0, this._takeCompletion();
|
|
1570
|
+
}
|
|
1571
|
+
_takeCompletion(e) {
|
|
1572
|
+
const t = this._completedFailures;
|
|
1573
|
+
if (this._completedFailures = void 0, t === void 0)
|
|
1574
|
+
return;
|
|
1575
|
+
const n = t.length === 1 ? t[0] : new AggregateError(t, "[RaphyDOM] Published branch cleanups failed.");
|
|
1576
|
+
return e === void 0 ? { prior: n } : { prior: n, interrupted: e };
|
|
1577
|
+
}
|
|
1578
|
+
/** Отклоняет повторное использование завершённой transaction. */
|
|
1579
|
+
_assertOpen() {
|
|
1580
|
+
if (!this.open)
|
|
1581
|
+
throw new Error("[RaphyDOM] Mount transaction is already closed.");
|
|
1582
|
+
}
|
|
1583
|
+
}
|
|
1584
|
+
function kr(r, e, t, n) {
|
|
1585
|
+
if (!r.open) {
|
|
1586
|
+
n(t);
|
|
1587
|
+
return;
|
|
1588
|
+
}
|
|
1589
|
+
const i = r.hold();
|
|
1590
|
+
let s = !0;
|
|
1591
|
+
try {
|
|
1592
|
+
n(() => {
|
|
1593
|
+
if (!s) {
|
|
1594
|
+
t();
|
|
1595
|
+
return;
|
|
1596
|
+
}
|
|
1597
|
+
s = !1;
|
|
1598
|
+
try {
|
|
1599
|
+
t();
|
|
1600
|
+
} finally {
|
|
1601
|
+
i();
|
|
1602
|
+
}
|
|
1603
|
+
});
|
|
1604
|
+
} catch (o) {
|
|
1605
|
+
throw i(), o;
|
|
1606
|
+
}
|
|
1607
|
+
s && e.own(i);
|
|
1608
|
+
}
|
|
1609
|
+
function Sr(r, e, t) {
|
|
1610
|
+
const n = new Map(e.map((a) => [pt(a), a]));
|
|
1611
|
+
if (Y(r)) {
|
|
1612
|
+
const a = t(() => xt(
|
|
1613
|
+
Ye(r.read()),
|
|
1614
|
+
n
|
|
1615
|
+
));
|
|
1616
|
+
return {
|
|
1617
|
+
bindings: [{
|
|
1618
|
+
source: a,
|
|
1619
|
+
replace: !0
|
|
1620
|
+
}],
|
|
1621
|
+
initial: a.peek()
|
|
1622
|
+
};
|
|
1623
|
+
}
|
|
1624
|
+
const i = {}, s = {}, o = [];
|
|
1625
|
+
for (const a of Reflect.ownKeys(r)) {
|
|
1626
|
+
const c = Reflect.get(r, a);
|
|
1627
|
+
if (Y(c)) {
|
|
1628
|
+
const l = c.read, d = t(() => Ft(
|
|
1629
|
+
a,
|
|
1630
|
+
l(),
|
|
1631
|
+
n
|
|
1632
|
+
));
|
|
1633
|
+
It(i, s, d.peek()), o.push({
|
|
1634
|
+
source: d,
|
|
1635
|
+
replace: !1
|
|
1636
|
+
});
|
|
1637
|
+
} else
|
|
1638
|
+
Ce(i, s, n, a, c);
|
|
1639
|
+
}
|
|
1640
|
+
return {
|
|
1641
|
+
bindings: o,
|
|
1642
|
+
initial: {
|
|
1643
|
+
listeners: s,
|
|
1644
|
+
props: i
|
|
1645
|
+
}
|
|
1646
|
+
};
|
|
1647
|
+
}
|
|
1648
|
+
function Cr(r, e) {
|
|
1649
|
+
if (Y(r)) {
|
|
1650
|
+
const i = e(() => Ye(r.read()));
|
|
1651
|
+
return {
|
|
1652
|
+
bindings: [{
|
|
1653
|
+
source: i,
|
|
1654
|
+
replace: !0
|
|
1655
|
+
}],
|
|
1656
|
+
initial: i.peek()
|
|
1657
|
+
};
|
|
1658
|
+
}
|
|
1659
|
+
const t = {}, n = [];
|
|
1660
|
+
for (const i of Reflect.ownKeys(r)) {
|
|
1661
|
+
const s = Reflect.get(r, i);
|
|
1662
|
+
if (Y(s)) {
|
|
1663
|
+
const o = s.read, a = () => {
|
|
1664
|
+
const l = o();
|
|
1665
|
+
return he(l), l;
|
|
1666
|
+
}, c = e(() => Wt(i, a()));
|
|
1667
|
+
Me(t, c.peek()), n.push({
|
|
1668
|
+
source: c,
|
|
1669
|
+
replace: !1
|
|
1670
|
+
});
|
|
1671
|
+
} else
|
|
1672
|
+
he(s), Reflect.set(t, i, s);
|
|
1673
|
+
}
|
|
1674
|
+
return { bindings: n, initial: t };
|
|
1675
|
+
}
|
|
1676
|
+
function It(r, e, t) {
|
|
1677
|
+
Me(r, t.props), Me(e, t.listeners);
|
|
1678
|
+
}
|
|
1679
|
+
function Me(r, e) {
|
|
1680
|
+
for (const t of Reflect.ownKeys(e))
|
|
1681
|
+
Reflect.set(r, t, Reflect.get(e, t));
|
|
1682
|
+
}
|
|
1683
|
+
function Ye(r) {
|
|
1684
|
+
if (r === null || typeof r != "object" || Array.isArray(r))
|
|
1685
|
+
throw new TypeError("[RaphyDOM] Grouped dynamic component props must return an object.");
|
|
1686
|
+
for (const e of Reflect.ownKeys(r)) {
|
|
1687
|
+
if (Y(Reflect.get(r, e)))
|
|
1688
|
+
throw new TypeError("[RaphyDOM] Grouped dynamic component props cannot contain nested dynamic() values.");
|
|
1689
|
+
he(Reflect.get(r, e));
|
|
1690
|
+
}
|
|
1691
|
+
return r;
|
|
1692
|
+
}
|
|
1693
|
+
function Wt(r, e) {
|
|
1694
|
+
const t = {};
|
|
1695
|
+
return Reflect.set(t, r, e), t;
|
|
1696
|
+
}
|
|
1697
|
+
function xt(r, e) {
|
|
1698
|
+
const t = {}, n = {};
|
|
1699
|
+
for (const i of Reflect.ownKeys(r))
|
|
1700
|
+
Ce(
|
|
1701
|
+
t,
|
|
1702
|
+
n,
|
|
1703
|
+
e,
|
|
1704
|
+
i,
|
|
1705
|
+
Reflect.get(r, i)
|
|
1706
|
+
);
|
|
1707
|
+
return {
|
|
1708
|
+
listeners: n,
|
|
1709
|
+
props: t
|
|
1710
|
+
};
|
|
1711
|
+
}
|
|
1712
|
+
function Ft(r, e, t) {
|
|
1713
|
+
const n = {}, i = {};
|
|
1714
|
+
return Ce(n, i, t, r, e), {
|
|
1715
|
+
listeners: i,
|
|
1716
|
+
props: n
|
|
1717
|
+
};
|
|
1718
|
+
}
|
|
1719
|
+
function Ce(r, e, t, n, i) {
|
|
1720
|
+
if (he(i), typeof n == "string" && /^on[A-Z]/.test(n)) {
|
|
1721
|
+
const s = t.get(n);
|
|
1722
|
+
if (s !== void 0) {
|
|
1723
|
+
Reflect.set(e, s, i);
|
|
1724
|
+
return;
|
|
1725
|
+
}
|
|
1726
|
+
const o = _t(i);
|
|
1727
|
+
if (o !== null)
|
|
1728
|
+
throw new Error(
|
|
1729
|
+
`[RaphyDOM] model("${o.name}") requires component event "${o.eventName}".`
|
|
1730
|
+
);
|
|
1731
|
+
}
|
|
1732
|
+
Reflect.set(r, n, i);
|
|
1733
|
+
}
|
|
1734
|
+
function he(r) {
|
|
1735
|
+
if (vt(r))
|
|
1736
|
+
throw new TypeError("[RaphyDOM] bind() can only control a native DOM element.");
|
|
1737
|
+
}
|
|
1738
|
+
const Ar = Object.freeze({}), Vt = Object.freeze([]), U = process.env.NODE_ENV !== "production";
|
|
1739
|
+
function Tr(r) {
|
|
1740
|
+
const e = { kind: "property", value: r };
|
|
1741
|
+
return U ? Object.freeze(e) : e;
|
|
1742
|
+
}
|
|
1743
|
+
function Nr(r, e = {}) {
|
|
1744
|
+
const t = {
|
|
1745
|
+
kind: "attribute",
|
|
1746
|
+
name: e.name,
|
|
1747
|
+
namespace: e.namespace,
|
|
1748
|
+
value: r
|
|
1749
|
+
};
|
|
1750
|
+
return U ? Object.freeze(t) : t;
|
|
1751
|
+
}
|
|
1752
|
+
function $t(r, e = {}) {
|
|
1753
|
+
if (e.passive === !0 && e.prevent === !0)
|
|
1754
|
+
throw new TypeError("[RaphyDOM] Passive listener cannot use prevent modifier.");
|
|
1755
|
+
const t = { ...e }, n = {
|
|
1756
|
+
handler: r,
|
|
1757
|
+
kind: "listener",
|
|
1758
|
+
options: U ? Object.freeze(t) : t
|
|
1759
|
+
};
|
|
1760
|
+
return U ? Object.freeze(n) : n;
|
|
1761
|
+
}
|
|
1762
|
+
function jr(r) {
|
|
1763
|
+
if (typeof r != "object" || r === null)
|
|
1764
|
+
return !1;
|
|
1765
|
+
const e = Reflect.get(r, "kind");
|
|
1766
|
+
return e === "attribute" || e === "listener" || e === "property";
|
|
1767
|
+
}
|
|
1768
|
+
const Je = /* @__PURE__ */ new Set([
|
|
1769
|
+
"innerHTML",
|
|
1770
|
+
"outerHTML",
|
|
1771
|
+
"textContent"
|
|
1772
|
+
]), Ut = /* @__PURE__ */ Gt(
|
|
1773
|
+
Je
|
|
1774
|
+
);
|
|
1775
|
+
function Pr(r, e, t, n, i, s, o = null) {
|
|
1776
|
+
const a = Qe(r, e, o);
|
|
1777
|
+
if (a === "listener") {
|
|
1778
|
+
const l = o, d = n.resolveEventName(e);
|
|
1779
|
+
return n.createWriter(
|
|
1780
|
+
r,
|
|
1781
|
+
d,
|
|
1782
|
+
t,
|
|
1783
|
+
(h) => s(i, h, `event:${d}`),
|
|
1784
|
+
l?.options
|
|
1785
|
+
);
|
|
1786
|
+
}
|
|
1787
|
+
if (a === "class")
|
|
1788
|
+
return Zt(r);
|
|
1789
|
+
if (a === "style")
|
|
1790
|
+
return Xt(r);
|
|
1791
|
+
if (a === "property")
|
|
1792
|
+
return tr(r, e);
|
|
1793
|
+
const c = o;
|
|
1794
|
+
return nr(
|
|
1795
|
+
r,
|
|
1796
|
+
c?.name ?? e,
|
|
1797
|
+
c?.namespace
|
|
1798
|
+
);
|
|
1799
|
+
}
|
|
1800
|
+
function zr(r, e, t, n, i, s, o, a) {
|
|
1801
|
+
const c = Qe(r, e, a);
|
|
1802
|
+
if (c === "listener") {
|
|
1803
|
+
const l = a;
|
|
1804
|
+
return i.registerStatic(
|
|
1805
|
+
r,
|
|
1806
|
+
i.resolveEventName(e),
|
|
1807
|
+
t,
|
|
1808
|
+
n,
|
|
1809
|
+
s,
|
|
1810
|
+
o,
|
|
1811
|
+
l?.options,
|
|
1812
|
+
l?.data
|
|
1813
|
+
), !0;
|
|
1814
|
+
}
|
|
1815
|
+
return a !== null ? !1 : c === "class" ? (Kt(r, t), !0) : c === "style" ? (Yt(r, t), !0) : c === "property" ? (Jt(r, e, t), !0) : (Qt(r, e, t), !0);
|
|
1816
|
+
}
|
|
1817
|
+
function qt(r) {
|
|
1818
|
+
if (r[0] !== "o" || r[1] !== "n")
|
|
1819
|
+
return !1;
|
|
1820
|
+
const e = r.charCodeAt(2);
|
|
1821
|
+
return e >= 65 && e <= 90;
|
|
1822
|
+
}
|
|
1823
|
+
function Qe(r, e, t) {
|
|
1824
|
+
if ((Ut & 1 << (e.length & 31)) !== 0 && Je.has(e))
|
|
1825
|
+
throw new Error(
|
|
1826
|
+
`[RaphyDOM] Property "${e}" is not supported by node().`
|
|
1827
|
+
);
|
|
1828
|
+
const n = t?.kind;
|
|
1829
|
+
if (e === "class" || e === "style") {
|
|
1830
|
+
if (n !== "listener")
|
|
1831
|
+
return e;
|
|
1832
|
+
} else if (qt(e))
|
|
1833
|
+
return "listener";
|
|
1834
|
+
if (n === "listener")
|
|
1835
|
+
throw new TypeError(
|
|
1836
|
+
"[RaphyDOM] listener() must be assigned to an on<Event> property."
|
|
1837
|
+
);
|
|
1838
|
+
return n === "property" ? "property" : n === "attribute" ? "attribute" : r.namespaceURI === "http://www.w3.org/1999/xhtml" && !e.startsWith("aria-") && !e.startsWith("data-") && e in r ? "property" : "attribute";
|
|
1839
|
+
}
|
|
1840
|
+
function Gt(r) {
|
|
1841
|
+
let e = 0;
|
|
1842
|
+
for (const t of r)
|
|
1843
|
+
e |= 1 << (t.length & 31);
|
|
1844
|
+
return e;
|
|
1845
|
+
}
|
|
1846
|
+
function Kt(r, e) {
|
|
1847
|
+
const t = it(e);
|
|
1848
|
+
t.length === 0 ? r.removeAttribute("class") : r.setAttribute("class", t);
|
|
1849
|
+
}
|
|
1850
|
+
function Yt(r, e) {
|
|
1851
|
+
if (e == null) {
|
|
1852
|
+
r.removeAttribute("style");
|
|
1853
|
+
return;
|
|
1854
|
+
}
|
|
1855
|
+
if (typeof e == "string") {
|
|
1856
|
+
r.setAttribute("style", e);
|
|
1857
|
+
return;
|
|
1858
|
+
}
|
|
1859
|
+
const t = rt(r);
|
|
1860
|
+
if (Array.isArray(e)) {
|
|
1861
|
+
const n = ot(e);
|
|
1862
|
+
r.removeAttribute("style"), n.cssText.length !== 0 && (t.cssText = n.cssText);
|
|
1863
|
+
for (const [i, s] of n.properties)
|
|
1864
|
+
fe(t, i, s);
|
|
1865
|
+
return;
|
|
1866
|
+
}
|
|
1867
|
+
if (typeof e != "object")
|
|
1868
|
+
throw new TypeError("[RaphyDOM] style must be a string, object, or array.");
|
|
1869
|
+
for (const [n, i] of Object.entries(e))
|
|
1870
|
+
fe(t, n, i);
|
|
1871
|
+
}
|
|
1872
|
+
function Jt(r, e, t) {
|
|
1873
|
+
if (Ze(r, e))
|
|
1874
|
+
return;
|
|
1875
|
+
if (t != null) {
|
|
1876
|
+
Ee(r, e, t);
|
|
1877
|
+
return;
|
|
1878
|
+
}
|
|
1879
|
+
const n = Reflect.get(r, e), i = r.getAttribute(e);
|
|
1880
|
+
Ee(r, e, n), i === null ? r.removeAttribute(e) : r.setAttribute(e, i);
|
|
1881
|
+
}
|
|
1882
|
+
function Qt(r, e, t, n) {
|
|
1883
|
+
const i = et(e, t);
|
|
1884
|
+
if (i === void 0) {
|
|
1885
|
+
tt(r, e, n);
|
|
1886
|
+
return;
|
|
1887
|
+
}
|
|
1888
|
+
r.setAttribute(e, i);
|
|
1889
|
+
}
|
|
1890
|
+
function Zt(r) {
|
|
1891
|
+
const e = Symbol("unset");
|
|
1892
|
+
let t = r.hasAttribute("class") ? e : "";
|
|
1893
|
+
const n = (i) => {
|
|
1894
|
+
Object.is(t, i) || (i.length === 0 ? r.removeAttribute("class") : r.setAttribute("class", i), t = i);
|
|
1895
|
+
};
|
|
1896
|
+
return {
|
|
1897
|
+
clear: () => n(""),
|
|
1898
|
+
write(i) {
|
|
1899
|
+
n(it(i));
|
|
1900
|
+
}
|
|
1901
|
+
};
|
|
1902
|
+
}
|
|
1903
|
+
function Xt(r) {
|
|
1904
|
+
const e = rt(r);
|
|
1905
|
+
let t = "empty", n = /* @__PURE__ */ new Map(), i;
|
|
1906
|
+
const s = () => {
|
|
1907
|
+
t !== "empty" && (r.removeAttribute("style"), t = "empty", n = /* @__PURE__ */ new Map(), i = void 0);
|
|
1908
|
+
};
|
|
1909
|
+
return {
|
|
1910
|
+
clear: s,
|
|
1911
|
+
write(o) {
|
|
1912
|
+
if (o == null) {
|
|
1913
|
+
s();
|
|
1914
|
+
return;
|
|
1915
|
+
}
|
|
1916
|
+
if (typeof o == "string") {
|
|
1917
|
+
if (t === "string" && i === o)
|
|
1918
|
+
return;
|
|
1919
|
+
r.setAttribute("style", o), t = "string", n = /* @__PURE__ */ new Map(), i = o;
|
|
1920
|
+
return;
|
|
1921
|
+
}
|
|
1922
|
+
if (Array.isArray(o)) {
|
|
1923
|
+
const l = ot(o);
|
|
1924
|
+
r.removeAttribute("style"), l.cssText.length !== 0 && (e.cssText = l.cssText);
|
|
1925
|
+
for (const [d, h] of l.properties)
|
|
1926
|
+
fe(e, d, h);
|
|
1927
|
+
t = "object", n = l.properties, i = void 0;
|
|
1928
|
+
return;
|
|
1929
|
+
}
|
|
1930
|
+
if (typeof o != "object")
|
|
1931
|
+
throw new TypeError(
|
|
1932
|
+
"[RaphyDOM] style must be a string, object, or array."
|
|
1933
|
+
);
|
|
1934
|
+
const a = o;
|
|
1935
|
+
if (t === "object" && er(n, a))
|
|
1936
|
+
return;
|
|
1937
|
+
t === "string" && r.removeAttribute("style");
|
|
1938
|
+
const c = /* @__PURE__ */ new Map();
|
|
1939
|
+
for (const l in a)
|
|
1940
|
+
Object.hasOwn(a, l) && c.set(l, a[l]);
|
|
1941
|
+
for (const l of n.keys())
|
|
1942
|
+
c.has(l) || nt(e, l);
|
|
1943
|
+
for (const [l, d] of c)
|
|
1944
|
+
(t !== "object" || !Object.is(n.get(l), d)) && fe(e, l, d);
|
|
1945
|
+
t = "object", n = c, i = void 0;
|
|
1946
|
+
}
|
|
1947
|
+
};
|
|
1948
|
+
}
|
|
1949
|
+
function er(r, e) {
|
|
1950
|
+
let t = 0;
|
|
1951
|
+
for (const n in e)
|
|
1952
|
+
if (Object.hasOwn(e, n)) {
|
|
1953
|
+
if (!Object.is(r.get(n), e[n]) || !r.has(n))
|
|
1954
|
+
return !1;
|
|
1955
|
+
t++;
|
|
1956
|
+
}
|
|
1957
|
+
return t === r.size;
|
|
1958
|
+
}
|
|
1959
|
+
function tr(r, e) {
|
|
1960
|
+
const t = Reflect.get(r, e), n = r.getAttribute(e);
|
|
1961
|
+
let i = Symbol("unset"), s = !0;
|
|
1962
|
+
const o = Ze(r, e), a = (l) => {
|
|
1963
|
+
if (s && (s = !1, o)) {
|
|
1964
|
+
i = l;
|
|
1965
|
+
return;
|
|
1966
|
+
}
|
|
1967
|
+
Object.is(i, l) || (Ee(r, e, l), i = l);
|
|
1968
|
+
}, c = () => {
|
|
1969
|
+
a(t), n === null ? r.removeAttribute(e) : r.setAttribute(e, n);
|
|
1970
|
+
};
|
|
1971
|
+
return {
|
|
1972
|
+
clear: c,
|
|
1973
|
+
write(l) {
|
|
1974
|
+
if (l == null) {
|
|
1975
|
+
c();
|
|
1976
|
+
return;
|
|
1977
|
+
}
|
|
1978
|
+
a(l);
|
|
1979
|
+
}
|
|
1980
|
+
};
|
|
1981
|
+
}
|
|
1982
|
+
function Ze(r, e) {
|
|
1983
|
+
if (e !== "value" && e !== "checked")
|
|
1984
|
+
return !1;
|
|
1985
|
+
const t = r.localName;
|
|
1986
|
+
if (e === "checked" && t !== "input" || e === "value" && t !== "input" && t !== "textarea" && t !== "select")
|
|
1987
|
+
return !1;
|
|
1988
|
+
const n = I(r.ownerDocument);
|
|
1989
|
+
if (n?.owns(r) !== !0)
|
|
1990
|
+
return !1;
|
|
1991
|
+
const i = r, s = e === "checked" ? i.checked !== i.defaultChecked : t === "select" ? rr(r) : i.value !== i.defaultValue;
|
|
1992
|
+
return s && n.preserveControl(r), s;
|
|
1993
|
+
}
|
|
1994
|
+
function rr(r) {
|
|
1995
|
+
const e = [...r.options], t = e.filter((i) => i.defaultSelected);
|
|
1996
|
+
if (r.multiple)
|
|
1997
|
+
return e.some((i) => i.selected !== i.defaultSelected);
|
|
1998
|
+
const n = t.at(-1) ?? e.find(
|
|
1999
|
+
(i) => !i.disabled && !(i.parentElement?.localName === "optgroup" && i.parentElement.disabled)
|
|
2000
|
+
);
|
|
2001
|
+
return r.selectedOptions[0] !== n;
|
|
2002
|
+
}
|
|
2003
|
+
function nr(r, e, t) {
|
|
2004
|
+
const n = Symbol("unset");
|
|
2005
|
+
let i = n;
|
|
2006
|
+
const s = Xe(e), o = () => {
|
|
2007
|
+
i !== n && i !== void 0 && tt(r, e, t), i = void 0;
|
|
2008
|
+
};
|
|
2009
|
+
return {
|
|
2010
|
+
clear: o,
|
|
2011
|
+
write(a) {
|
|
2012
|
+
if (i !== n && i !== void 0 && Object.is(i, a))
|
|
2013
|
+
return;
|
|
2014
|
+
const c = et(e, a, s);
|
|
2015
|
+
if (c === void 0) {
|
|
2016
|
+
o();
|
|
2017
|
+
return;
|
|
2018
|
+
}
|
|
2019
|
+
t === void 0 ? r.setAttribute(e, c) : r.setAttributeNS(t, e, c), i = a;
|
|
2020
|
+
}
|
|
2021
|
+
};
|
|
2022
|
+
}
|
|
2023
|
+
function Ee(r, e, t) {
|
|
2024
|
+
if (!Reflect.set(r, e, t))
|
|
2025
|
+
throw new TypeError(
|
|
2026
|
+
`[RaphyDOM] DOM property "${e}" cannot be assigned.`
|
|
2027
|
+
);
|
|
2028
|
+
}
|
|
2029
|
+
function Xe(r) {
|
|
2030
|
+
return r.startsWith("aria-") || r.startsWith("data-");
|
|
2031
|
+
}
|
|
2032
|
+
function et(r, e, t = Xe(r)) {
|
|
2033
|
+
if (!(e == null || e === !1 && !t))
|
|
2034
|
+
return e === !0 && !t ? "" : String(e);
|
|
2035
|
+
}
|
|
2036
|
+
function tt(r, e, t) {
|
|
2037
|
+
t === void 0 ? r.removeAttribute(e) : r.removeAttributeNS(t, ir(e));
|
|
2038
|
+
}
|
|
2039
|
+
function rt(r) {
|
|
2040
|
+
const e = Reflect.get(r, "style");
|
|
2041
|
+
if (typeof e != "object" || e === null)
|
|
2042
|
+
throw new TypeError(
|
|
2043
|
+
"[RaphyDOM] This element does not support object style."
|
|
2044
|
+
);
|
|
2045
|
+
return e;
|
|
2046
|
+
}
|
|
2047
|
+
function fe(r, e, t) {
|
|
2048
|
+
if (t == null) {
|
|
2049
|
+
nt(r, e);
|
|
2050
|
+
return;
|
|
2051
|
+
}
|
|
2052
|
+
if (e.startsWith("--") || e.includes("-")) {
|
|
2053
|
+
r.setProperty(e, String(t));
|
|
2054
|
+
return;
|
|
2055
|
+
}
|
|
2056
|
+
if (!Reflect.set(r, e, t))
|
|
2057
|
+
throw new TypeError(
|
|
2058
|
+
`[RaphyDOM] Style property "${e}" cannot be assigned.`
|
|
2059
|
+
);
|
|
2060
|
+
}
|
|
2061
|
+
function nt(r, e) {
|
|
2062
|
+
if (e.startsWith("--") || e.includes("-")) {
|
|
2063
|
+
r.removeProperty(e);
|
|
2064
|
+
return;
|
|
2065
|
+
}
|
|
2066
|
+
Reflect.set(r, e, "");
|
|
2067
|
+
}
|
|
2068
|
+
function it(r) {
|
|
2069
|
+
if (typeof r == "string")
|
|
2070
|
+
return r.trim();
|
|
2071
|
+
if (r == null || r === !1)
|
|
2072
|
+
return "";
|
|
2073
|
+
const e = [];
|
|
2074
|
+
return st(e, r), e.join(" ");
|
|
2075
|
+
}
|
|
2076
|
+
function st(r, e) {
|
|
2077
|
+
if (!(e == null || e === !1)) {
|
|
2078
|
+
if (typeof e == "string") {
|
|
2079
|
+
const t = e.trim();
|
|
2080
|
+
t.length !== 0 && r.push(t);
|
|
2081
|
+
return;
|
|
2082
|
+
}
|
|
2083
|
+
if (Array.isArray(e)) {
|
|
2084
|
+
for (const t of e)
|
|
2085
|
+
st(r, t);
|
|
2086
|
+
return;
|
|
2087
|
+
}
|
|
2088
|
+
if (typeof e == "object") {
|
|
2089
|
+
for (const [t, n] of Object.entries(e))
|
|
2090
|
+
n && r.push(t);
|
|
2091
|
+
return;
|
|
2092
|
+
}
|
|
2093
|
+
throw new TypeError("[RaphyDOM] class must be a string, object, or array.");
|
|
2094
|
+
}
|
|
2095
|
+
}
|
|
2096
|
+
function ot(r) {
|
|
2097
|
+
const e = [], t = /* @__PURE__ */ new Map(), n = (i) => {
|
|
2098
|
+
if (!(i == null || i === !1)) {
|
|
2099
|
+
if (typeof i == "string") {
|
|
2100
|
+
i.trim().length !== 0 && e.push(i.trim());
|
|
2101
|
+
return;
|
|
2102
|
+
}
|
|
2103
|
+
if (Array.isArray(i)) {
|
|
2104
|
+
for (const s of i)
|
|
2105
|
+
n(s);
|
|
2106
|
+
return;
|
|
2107
|
+
}
|
|
2108
|
+
if (typeof i == "object") {
|
|
2109
|
+
for (const [s, o] of Object.entries(i))
|
|
2110
|
+
t.set(s, o);
|
|
2111
|
+
return;
|
|
2112
|
+
}
|
|
2113
|
+
throw new TypeError(
|
|
2114
|
+
"[RaphyDOM] style array accepts only strings, objects, and nested arrays."
|
|
2115
|
+
);
|
|
2116
|
+
}
|
|
2117
|
+
};
|
|
2118
|
+
return n(r), {
|
|
2119
|
+
cssText: e.join(";"),
|
|
2120
|
+
properties: t
|
|
2121
|
+
};
|
|
2122
|
+
}
|
|
2123
|
+
function ir(r) {
|
|
2124
|
+
const e = r.indexOf(":");
|
|
2125
|
+
return e === -1 ? r : r.slice(e + 1);
|
|
2126
|
+
}
|
|
2127
|
+
function K(r, e) {
|
|
2128
|
+
return r instanceof yt ? r.fork(e) : e;
|
|
2129
|
+
}
|
|
2130
|
+
function Br(r) {
|
|
2131
|
+
const e = [];
|
|
2132
|
+
return at(r, e), e.length === 0 ? Vt : U ? Object.freeze(e) : e;
|
|
2133
|
+
}
|
|
2134
|
+
function at(r, e) {
|
|
2135
|
+
if (sr(r)) {
|
|
2136
|
+
for (const t of r)
|
|
2137
|
+
at(t, e);
|
|
2138
|
+
return;
|
|
2139
|
+
}
|
|
2140
|
+
r == null || typeof r == "boolean" || e.push(typeof r == "number" ? String(r) : r);
|
|
2141
|
+
}
|
|
2142
|
+
function sr(r) {
|
|
2143
|
+
return Array.isArray(r);
|
|
2144
|
+
}
|
|
2145
|
+
class F {
|
|
2146
|
+
// Задают включительные границы принадлежащего диапазону набора nodes.
|
|
2147
|
+
first;
|
|
2148
|
+
last;
|
|
2149
|
+
_children;
|
|
2150
|
+
_parentRange = null;
|
|
2151
|
+
_removalCancellation = null;
|
|
2152
|
+
_removalHandler = null;
|
|
2153
|
+
_moveHandler = null;
|
|
2154
|
+
_removalPending = !1;
|
|
2155
|
+
_removalCleanups;
|
|
2156
|
+
/**
|
|
2157
|
+
* Фиксирует границы уже созданного непрерывного диапазона.
|
|
2158
|
+
*/
|
|
2159
|
+
constructor(e, t) {
|
|
2160
|
+
this.first = e, this.last = t;
|
|
2161
|
+
}
|
|
2162
|
+
/**
|
|
2163
|
+
* Оборачивает один DOM node в общий range contract.
|
|
2164
|
+
*/
|
|
2165
|
+
static single(e) {
|
|
2166
|
+
return new F(e, e);
|
|
2167
|
+
}
|
|
2168
|
+
/**
|
|
2169
|
+
* Создаёт пустой диапазон с невидимыми comment anchors.
|
|
2170
|
+
*/
|
|
2171
|
+
static anchored(e, t) {
|
|
2172
|
+
const n = I(e)?.range(t);
|
|
2173
|
+
if (n !== void 0)
|
|
2174
|
+
return new F(n.first, n.last);
|
|
2175
|
+
const i = e.createDocumentFragment(), s = e.createComment(`${t}:start`), o = e.createComment(`${t}:end`);
|
|
2176
|
+
return i.append(s, o), new F(s, o);
|
|
2177
|
+
}
|
|
2178
|
+
/**
|
|
2179
|
+
* Перемещает одиночный node, у которого нет собственного DOMRange, перед
|
|
2180
|
+
* reference либо в конец parent.
|
|
2181
|
+
*
|
|
2182
|
+
* Перемещение — один вызов `insertBefore` самого node, без промежуточного
|
|
2183
|
+
* fragment: платформа сама отсоединяет подключённый node и вставляет его на
|
|
2184
|
+
* новое место. Focus и selection внутри подключённого node сохраняются так
|
|
2185
|
+
* же, как при moveBefore: снимок до вызова, восстановление после него. Node
|
|
2186
|
+
* без parent вставляется без снимка: focus в нём находиться не может.
|
|
2187
|
+
*
|
|
2188
|
+
* Посторонний observer получает те же records, что и при переносе через
|
|
2189
|
+
* fragment: удаление node и его вставку. Отличается ход переноса:
|
|
2190
|
+
*
|
|
2191
|
+
* - reactions custom elements внутри node исполняются после вызова, когда
|
|
2192
|
+
* node уже стоит на новом месте: `disconnectedCallback`, затем
|
|
2193
|
+
* `connectedCallback`, по одному разу, как при любом native-перемещении;
|
|
2194
|
+
* - вызов, который платформа отклонила до отсоединения node (reference не
|
|
2195
|
+
* является child parent на момент вызова, parent находится внутри node),
|
|
2196
|
+
* оставляет node на прежнем месте вместе с его focus, а не в отсоединённом
|
|
2197
|
+
* fragment.
|
|
2198
|
+
*
|
|
2199
|
+
* Вызов, отклонённый после отсоединения node, этого не обещает. В Chromium
|
|
2200
|
+
* element с focus внутри node получает `blur` синхронно, пока `insertBefore`
|
|
2201
|
+
* отсоединяет node. Listener этого `blur`, который убрал reference из parent,
|
|
2202
|
+
* приводит к ошибке вставки, когда node уже отсоединён: node остаётся без
|
|
2203
|
+
* parent, focus переходит к body и не восстанавливается, ошибка выходит из
|
|
2204
|
+
* вызова. Через fragment такая строка оставалась в отсоединённом fragment.
|
|
2205
|
+
* Список возвращает её на место следующим reconcile, сверяя порядок с DOM.
|
|
2206
|
+
*
|
|
2207
|
+
* Подключённый DOMRange по-прежнему переносится через fragment (moveBefore):
|
|
2208
|
+
* range из нескольких nodes иначе не вставить одним вызовом.
|
|
2209
|
+
*/
|
|
2210
|
+
static moveNode(e, t, n) {
|
|
2211
|
+
if (e.parentNode === null) {
|
|
2212
|
+
t.insertBefore(e, n);
|
|
2213
|
+
return;
|
|
2214
|
+
}
|
|
2215
|
+
const i = Ve(e, e);
|
|
2216
|
+
t.insertBefore(e, n), $e(i);
|
|
2217
|
+
}
|
|
2218
|
+
/**
|
|
2219
|
+
* Возвращает текущего DOM parent либо null для полностью отсоединённого range.
|
|
2220
|
+
*/
|
|
2221
|
+
get parentNode() {
|
|
2222
|
+
return this.first.parentNode;
|
|
2223
|
+
}
|
|
2224
|
+
/**
|
|
2225
|
+
* Возвращает node диапазона, который ничего не добавляет к самому node: он
|
|
2226
|
+
* состоит из одного node, не имеет handlers и не связан с другими ranges.
|
|
2227
|
+
* Для любого другого диапазона возвращает null.
|
|
2228
|
+
*/
|
|
2229
|
+
plainNode() {
|
|
2230
|
+
return this.first === this.last && this._removalHandler === null && this._removalCleanups === void 0 && this._moveHandler === null && this._children === void 0 && this._parentRange === null ? this.first : null;
|
|
2231
|
+
}
|
|
2232
|
+
/** Связывает nested/remote range с lifecycle внешнего materialized output. */
|
|
2233
|
+
adopt(e) {
|
|
2234
|
+
if (e === this)
|
|
2235
|
+
throw new Error("[RaphyDOM] DOM range cannot adopt itself.");
|
|
2236
|
+
e._parentRange?._children?.delete(e), e._parentRange = this, this._children === void 0 && (this._children = /* @__PURE__ */ new Set()), this._children.add(e);
|
|
2237
|
+
}
|
|
2238
|
+
/** Runs renderer resources only after this range is physically removed. */
|
|
2239
|
+
onRemoved(e) {
|
|
2240
|
+
if (typeof e != "function")
|
|
2241
|
+
throw new TypeError(
|
|
2242
|
+
"[RaphyDOM] DOM range removal cleanup must be a function."
|
|
2243
|
+
);
|
|
2244
|
+
(this._removalCleanups ??= []).push(e);
|
|
2245
|
+
}
|
|
2246
|
+
/** Устанавливает renderer-owned delayed removal, например transition leave. */
|
|
2247
|
+
setRemovalHandler(e, t) {
|
|
2248
|
+
if (this._removalHandler !== null)
|
|
2249
|
+
throw new Error(
|
|
2250
|
+
"[RaphyDOM] DOM range removal handler is already configured."
|
|
2251
|
+
);
|
|
2252
|
+
this._removalHandler = e, this._removalCancellation = t ?? null;
|
|
2253
|
+
}
|
|
2254
|
+
/** Регистрирует transition hook для фактической keyed-list перестановки. */
|
|
2255
|
+
setMoveHandler(e) {
|
|
2256
|
+
this._moveHandler = e;
|
|
2257
|
+
}
|
|
2258
|
+
/** Уведомляет range о завершившемся DOM move. */
|
|
2259
|
+
notifyMove() {
|
|
2260
|
+
this._moveHandler?.();
|
|
2261
|
+
}
|
|
2262
|
+
/**
|
|
2263
|
+
* Перемещает весь диапазон перед reference либо в конец указанного parent.
|
|
2264
|
+
*/
|
|
2265
|
+
moveBefore(e, t) {
|
|
2266
|
+
if (I(this.first.ownerDocument) !== void 0 && this.first.parentNode === e)
|
|
2267
|
+
return;
|
|
2268
|
+
if (this.first === this.last && this.first.parentNode === null) {
|
|
2269
|
+
e.insertBefore(this.first, t);
|
|
2270
|
+
return;
|
|
2271
|
+
}
|
|
2272
|
+
const n = Ve(this.first, this.last), i = this.first.ownerDocument.createDocumentFragment();
|
|
2273
|
+
let s = this.first;
|
|
2274
|
+
for (; s !== null; ) {
|
|
2275
|
+
const o = s.nextSibling;
|
|
2276
|
+
if (i.append(s), s === this.last) {
|
|
2277
|
+
e.insertBefore(i, t), $e(n);
|
|
2278
|
+
return;
|
|
2279
|
+
}
|
|
2280
|
+
s = o;
|
|
2281
|
+
}
|
|
2282
|
+
throw new Error("[RaphyDOM] Cannot move a disconnected partial DOM range.");
|
|
2283
|
+
}
|
|
2284
|
+
/**
|
|
2285
|
+
* Удаляет содержимое между anchors, сохраняя сам structural range.
|
|
2286
|
+
*/
|
|
2287
|
+
clear() {
|
|
2288
|
+
if (this.first === this.last)
|
|
2289
|
+
return;
|
|
2290
|
+
let e = this.first.nextSibling;
|
|
2291
|
+
for (; e !== null && e !== this.last; ) {
|
|
2292
|
+
const t = e.nextSibling;
|
|
2293
|
+
e.remove(), e = t;
|
|
2294
|
+
}
|
|
2295
|
+
}
|
|
2296
|
+
/**
|
|
2297
|
+
* Сообщает, может ли владелец anchored range удалить всё между anchors одной
|
|
2298
|
+
* очисткой parent вместо удаления каждого node.
|
|
2299
|
+
*
|
|
2300
|
+
* Очистка parent минует `removeNode`, поэтому допустима только там, где
|
|
2301
|
+
* `removeNode` удалил бы каждый node сразу: у range и у его внешних ranges
|
|
2302
|
+
* нет transition boundary, а сам range не принял ни одного вложенного range,
|
|
2303
|
+
* которому нужен собственный проход удаления. Range вместе с anchors обязан
|
|
2304
|
+
* составлять всё содержимое parent: перед открывающим anchor и после
|
|
2305
|
+
* закрывающего нет ни одного node. Parent — element либо fragment: у document
|
|
2306
|
+
* собственные ограничения на состав детей, и список в нём так не очищается.
|
|
2307
|
+
*
|
|
2308
|
+
* Ответ не говорит, что стоит между anchors: состав и порядок nodes сверяет
|
|
2309
|
+
* владелец range перед вызовом `clearParent`.
|
|
2310
|
+
*/
|
|
2311
|
+
canClearParent() {
|
|
2312
|
+
const e = this.first, t = this.last, n = e.parentNode;
|
|
2313
|
+
if (e === t || n === null || n !== t.parentNode || this._removalHandler !== null || this._removalPending || this._children !== void 0 && this._children.size !== 0)
|
|
2314
|
+
return !1;
|
|
2315
|
+
const i = n.nodeType;
|
|
2316
|
+
return (i === 1 || i === 11) && e.previousSibling === null && t.nextSibling === null && this._closestRemovalBoundary() === null;
|
|
2317
|
+
}
|
|
2318
|
+
/**
|
|
2319
|
+
* Удаляет все nodes между anchors одним вызовом `replaceChildren` parent:
|
|
2320
|
+
* новым содержимым parent становятся сами anchors.
|
|
2321
|
+
*
|
|
2322
|
+
* Вызывается только после `canClearParent()` и только владельцем, который
|
|
2323
|
+
* сверил, что между anchors стоят его собственные инертные nodes: метод не
|
|
2324
|
+
* читает содержимое range и удаляет всё, что находится в parent.
|
|
2325
|
+
*
|
|
2326
|
+
* Вызов один, поэтому custom element reactions посторонних nodes внутри
|
|
2327
|
+
* удалённых исполняются после него: все nodes уже удалены, anchors стоят в
|
|
2328
|
+
* parent. Вызов отсоединяет anchors и вставляет их заново. MutationObserver
|
|
2329
|
+
* получает три records вместо одной на node: удаление каждого anchor и
|
|
2330
|
+
* замену оставшихся детей parent парой anchors. Границы live Range и
|
|
2331
|
+
* Selection внутри parent схлопываются к его началу.
|
|
2332
|
+
*/
|
|
2333
|
+
clearParent() {
|
|
2334
|
+
const e = this.first;
|
|
2335
|
+
e.parentNode.replaceChildren(e, this.last);
|
|
2336
|
+
}
|
|
2337
|
+
/**
|
|
2338
|
+
* Удаляет все nodes диапазона и допускает повторный cleanup.
|
|
2339
|
+
*/
|
|
2340
|
+
remove(e = !1) {
|
|
2341
|
+
if (!e) {
|
|
2342
|
+
const a = this._closestRemovalBoundary();
|
|
2343
|
+
if (a !== null) {
|
|
2344
|
+
a.remove();
|
|
2345
|
+
return;
|
|
2346
|
+
}
|
|
2347
|
+
}
|
|
2348
|
+
if (!e && this._removalHandler !== null) {
|
|
2349
|
+
if (this._removalPending)
|
|
2350
|
+
return;
|
|
2351
|
+
this._removalPending = !0, this._removalHandler(() => {
|
|
2352
|
+
this._removalCancellation = null, this._removalHandler = null, this._removalPending = !1, this.remove(!0);
|
|
2353
|
+
});
|
|
2354
|
+
return;
|
|
2355
|
+
}
|
|
2356
|
+
if (e && this._removalPending) {
|
|
2357
|
+
const a = this._removalCancellation;
|
|
2358
|
+
this._removalCancellation = null, this._removalHandler = null, this._removalPending = !1, a?.();
|
|
2359
|
+
}
|
|
2360
|
+
const t = this._parentRange, n = [], i = this._children;
|
|
2361
|
+
if (i !== void 0) {
|
|
2362
|
+
const a = this.parentNode;
|
|
2363
|
+
for (const c of i)
|
|
2364
|
+
c._requiresExplicitRemoval(a) ? (c.remove(e), !e && c._removalPending && (t === null ? n.push(c) : t.adopt(c))) : (c._completeImplicitRemoval(), c._parentRange = null);
|
|
2365
|
+
i.clear();
|
|
2366
|
+
}
|
|
2367
|
+
this._children = void 0;
|
|
2368
|
+
for (const a of n)
|
|
2369
|
+
this._children === void 0 && (this._children = /* @__PURE__ */ new Set()), this._children.add(a);
|
|
2370
|
+
if (t?._children?.delete(this), this._parentRange = null, this.first === this.last) {
|
|
2371
|
+
this.first.remove(), this._completeRemoval();
|
|
2372
|
+
return;
|
|
2373
|
+
}
|
|
2374
|
+
if (this.first.parentNode === null) {
|
|
2375
|
+
this.first.remove(), this.last.remove(), this._completeRemoval();
|
|
2376
|
+
return;
|
|
2377
|
+
}
|
|
2378
|
+
let o = this.first;
|
|
2379
|
+
for (; o !== null; ) {
|
|
2380
|
+
const a = o.nextSibling;
|
|
2381
|
+
if (o.remove(), o === this.last) {
|
|
2382
|
+
this._completeRemoval();
|
|
2383
|
+
return;
|
|
2384
|
+
}
|
|
2385
|
+
o = a;
|
|
2386
|
+
}
|
|
2387
|
+
this.last.remove(), this._completeRemoval();
|
|
2388
|
+
}
|
|
2389
|
+
_completeImplicitRemoval() {
|
|
2390
|
+
for (const e of this._children ?? [])
|
|
2391
|
+
e._completeImplicitRemoval(), e._parentRange = null;
|
|
2392
|
+
this._children?.clear(), this._children = void 0, this._completeRemoval();
|
|
2393
|
+
}
|
|
2394
|
+
_completeRemoval() {
|
|
2395
|
+
const e = this._removalCleanups;
|
|
2396
|
+
if (this._removalCleanups = void 0, e === void 0)
|
|
2397
|
+
return;
|
|
2398
|
+
let t;
|
|
2399
|
+
for (const n of e.reverse())
|
|
2400
|
+
try {
|
|
2401
|
+
n();
|
|
2402
|
+
} catch (i) {
|
|
2403
|
+
(t ??= []).push(i);
|
|
2404
|
+
}
|
|
2405
|
+
if (t?.length === 1)
|
|
2406
|
+
throw t[0];
|
|
2407
|
+
if (t !== void 0)
|
|
2408
|
+
throw new AggregateError(
|
|
2409
|
+
t,
|
|
2410
|
+
"[RaphyDOM] DOM range removal cleanup failed."
|
|
2411
|
+
);
|
|
2412
|
+
}
|
|
2413
|
+
/**
|
|
2414
|
+
* Удаляет одиночный node, которым владелец range управляет без собственного
|
|
2415
|
+
* DOMRange для него.
|
|
2416
|
+
*
|
|
2417
|
+
* Ближайшая transition boundary — сам range либо его внешний range —
|
|
2418
|
+
* удерживает node до конца leave так же, как вложенный range.
|
|
2419
|
+
*/
|
|
2420
|
+
removeNode(e, t) {
|
|
2421
|
+
const n = this._removalHandler !== null || this._removalPending ? this : this._closestRemovalBoundary();
|
|
2422
|
+
if (n === null) {
|
|
2423
|
+
e.remove(), t?.();
|
|
2424
|
+
return;
|
|
2425
|
+
}
|
|
2426
|
+
const i = F.single(e);
|
|
2427
|
+
t !== void 0 && i.onRemoved(t), this.adopt(i), n.remove();
|
|
2428
|
+
}
|
|
2429
|
+
/**
|
|
2430
|
+
* Передаёт cleanup вложенного component ближайшей transition boundary.
|
|
2431
|
+
*
|
|
2432
|
+
* Core lifecycle при этом уже может завершиться, но renderer сохраняет весь
|
|
2433
|
+
* инертный диапазон до окончания leave и удаляет его одним force-проходом.
|
|
2434
|
+
*/
|
|
2435
|
+
_closestRemovalBoundary() {
|
|
2436
|
+
let e = this._parentRange;
|
|
2437
|
+
for (; e !== null; ) {
|
|
2438
|
+
if (e._removalHandler !== null || e._removalPending)
|
|
2439
|
+
return e;
|
|
2440
|
+
e = e._parentRange;
|
|
2441
|
+
}
|
|
2442
|
+
return null;
|
|
2443
|
+
}
|
|
2444
|
+
/**
|
|
2445
|
+
* Отличает remote/delayed descendants, которым недостаточно физического
|
|
2446
|
+
* удаления nodes внешнего непрерывного диапазона.
|
|
2447
|
+
*/
|
|
2448
|
+
_requiresExplicitRemoval(e) {
|
|
2449
|
+
if (this._removalHandler !== null || this._removalPending || this.parentNode !== e)
|
|
2450
|
+
return !0;
|
|
2451
|
+
for (const t of this._children ?? [])
|
|
2452
|
+
if (t._requiresExplicitRemoval(this.parentNode))
|
|
2453
|
+
return !0;
|
|
2454
|
+
return !1;
|
|
2455
|
+
}
|
|
2456
|
+
}
|
|
2457
|
+
function Ve(r, e) {
|
|
2458
|
+
const t = r.ownerDocument, n = t?.activeElement;
|
|
2459
|
+
return t === null || n === null || n === void 0 || n === t.body || n === t.documentElement || !or(r, e, n) ? null : ct(n) ? {
|
|
2460
|
+
element: n,
|
|
2461
|
+
selectionDirection: n.selectionDirection ?? void 0,
|
|
2462
|
+
selectionEnd: n.selectionEnd ?? void 0,
|
|
2463
|
+
selectionStart: n.selectionStart ?? void 0
|
|
2464
|
+
} : { element: n };
|
|
2465
|
+
}
|
|
2466
|
+
function $e(r) {
|
|
2467
|
+
if (r === null || !r.element.isConnected)
|
|
2468
|
+
return;
|
|
2469
|
+
const e = Reflect.get(r.element, "focus");
|
|
2470
|
+
typeof e == "function" && e.call(r.element, { preventScroll: !0 }), ct(r.element) && r.selectionStart !== void 0 && r.selectionEnd !== void 0 && r.element.setSelectionRange(
|
|
2471
|
+
r.selectionStart,
|
|
2472
|
+
r.selectionEnd,
|
|
2473
|
+
r.selectionDirection
|
|
2474
|
+
);
|
|
2475
|
+
}
|
|
2476
|
+
function or(r, e, t) {
|
|
2477
|
+
let n = r;
|
|
2478
|
+
for (; n !== null; ) {
|
|
2479
|
+
if (n === t || n.nodeType === 1 && n.contains(t))
|
|
2480
|
+
return !0;
|
|
2481
|
+
if (n === e)
|
|
2482
|
+
return !1;
|
|
2483
|
+
n = n.nextSibling;
|
|
2484
|
+
}
|
|
2485
|
+
return !1;
|
|
2486
|
+
}
|
|
2487
|
+
function ct(r) {
|
|
2488
|
+
return typeof Reflect.get(r, "setSelectionRange") == "function";
|
|
2489
|
+
}
|
|
2490
|
+
function ar(r) {
|
|
2491
|
+
const { MountContext: e, mountChildren: t, runTemplateOperation: n, runMountTransaction: i, rethrowUnhandledDOMOperationError: s, ownDOMOutput: o, clearDOMBranchForTransaction: a, selectDOMBranch: c, clearDOMBranch: l, commitOrAbsorbTransaction: d, scheduleUnhandledAsyncError: h, captureDOMError: _, removeDOMOutputWithOutcome: m } = r;
|
|
2492
|
+
function E(k, u) {
|
|
2493
|
+
const p = F.anchored(
|
|
2494
|
+
u.env.document,
|
|
2495
|
+
"raphy:async-boundary"
|
|
2496
|
+
), S = I(u.env.document);
|
|
2497
|
+
if (S?.streaming === !0 && S.nextLabel() === "raphy:async-boundary:pending") {
|
|
2498
|
+
S.skip(p.first);
|
|
2499
|
+
const T = new AbortController(), H = () => T.abort(), Q = u.ownerNode.own(H);
|
|
2500
|
+
p.onRemoved(H);
|
|
2501
|
+
const q = (async () => {
|
|
2502
|
+
try {
|
|
2503
|
+
if (await S.waitStream(p.first, p.last, T.signal), T.signal.aborted || u.ownerNode.disposed)
|
|
2504
|
+
return;
|
|
2505
|
+
const b = S.rescan(p.first, p.last);
|
|
2506
|
+
b.run(() => i(u, "hydrate-stream-boundary", (C) => {
|
|
2507
|
+
R(k, new e(u.env, u.effectScope, u.ownerNode, C), p);
|
|
2508
|
+
})), b.remaining(), await b.ready();
|
|
2509
|
+
} catch (b) {
|
|
2510
|
+
T.signal.aborted || s(u, b, "hydrate-stream-boundary", !0);
|
|
2511
|
+
} finally {
|
|
2512
|
+
T.signal.aborted || S.finishStream(p.first), Q();
|
|
2513
|
+
}
|
|
2514
|
+
})();
|
|
2515
|
+
return S.trackStream(q), p;
|
|
2516
|
+
}
|
|
2517
|
+
return R(k, u, p);
|
|
2518
|
+
}
|
|
2519
|
+
function R(k, u, p) {
|
|
2520
|
+
const S = I(u.env.document), T = S?.nextLabel() === "raphy:async-boundary:rejected" ? S.defer(p.first) : void 0;
|
|
2521
|
+
let H = T, Q, q;
|
|
2522
|
+
if (T !== void 0 && S.track(
|
|
2523
|
+
new Promise((M, D) => {
|
|
2524
|
+
Q = M, q = D;
|
|
2525
|
+
})
|
|
2526
|
+
), S !== void 0 && T === void 0) {
|
|
2527
|
+
const M = n(
|
|
2528
|
+
u.env.targetRuntime,
|
|
2529
|
+
u.env.styleScopeId,
|
|
2530
|
+
k.content
|
|
2531
|
+
), D = t(
|
|
2532
|
+
M,
|
|
2533
|
+
u,
|
|
2534
|
+
"raphy:async-boundary:content"
|
|
2535
|
+
);
|
|
2536
|
+
return p.adopt(D), D.moveBefore(p.parentNode, p.last), p;
|
|
2537
|
+
}
|
|
2538
|
+
const b = new Be(u.ownerNode), C = new Be(
|
|
2539
|
+
u.ownerNode
|
|
2540
|
+
), lt = K(
|
|
2541
|
+
u.effectScope,
|
|
2542
|
+
b.node
|
|
2543
|
+
), Ae = K(
|
|
2544
|
+
u.effectScope,
|
|
2545
|
+
C.node
|
|
2546
|
+
);
|
|
2547
|
+
o(u.ownerNode, p, u);
|
|
2548
|
+
let z = 0, Te, A = null;
|
|
2549
|
+
b.node._ownCompletedCleanup(() => {
|
|
2550
|
+
const M = A;
|
|
2551
|
+
if (A = null, M === null || !M.open)
|
|
2552
|
+
return;
|
|
2553
|
+
const D = M.cancelAndTakeCompleted();
|
|
2554
|
+
return D === void 0 ? void 0 : {
|
|
2555
|
+
error: D.prior,
|
|
2556
|
+
hasUnrouted: !1,
|
|
2557
|
+
completed: { error: D.prior }
|
|
2558
|
+
};
|
|
2559
|
+
});
|
|
2560
|
+
const _e = () => {
|
|
2561
|
+
const M = ++z;
|
|
2562
|
+
let D = null, O = new Fe();
|
|
2563
|
+
const Ne = A;
|
|
2564
|
+
if (A = O, Ne?.open) {
|
|
2565
|
+
const f = Ne.cancelAndTakeCompleted();
|
|
2566
|
+
f !== void 0 && O.deferCompletedFailure(f.prior);
|
|
2567
|
+
}
|
|
2568
|
+
const dt = u.env.document.createDocumentFragment();
|
|
2569
|
+
let W = !1, ye = null, ve = !1, x = 0, Z = !1;
|
|
2570
|
+
a(
|
|
2571
|
+
b,
|
|
2572
|
+
u,
|
|
2573
|
+
O,
|
|
2574
|
+
"async-boundary-content"
|
|
2575
|
+
), a(
|
|
2576
|
+
C,
|
|
2577
|
+
u,
|
|
2578
|
+
O,
|
|
2579
|
+
"async-boundary-content"
|
|
2580
|
+
);
|
|
2581
|
+
const ut = (f) => {
|
|
2582
|
+
if (k.rejected === void 0 || M !== z)
|
|
2583
|
+
return;
|
|
2584
|
+
W = !0;
|
|
2585
|
+
const y = () => i(
|
|
2586
|
+
u,
|
|
2587
|
+
"async-boundary-content",
|
|
2588
|
+
(v) => {
|
|
2589
|
+
a(
|
|
2590
|
+
b,
|
|
2591
|
+
u,
|
|
2592
|
+
v,
|
|
2593
|
+
"async-boundary-content"
|
|
2594
|
+
), a(
|
|
2595
|
+
C,
|
|
2596
|
+
u,
|
|
2597
|
+
v,
|
|
2598
|
+
"async-boundary-content"
|
|
2599
|
+
), c(
|
|
2600
|
+
C,
|
|
2601
|
+
u,
|
|
2602
|
+
v,
|
|
2603
|
+
"async-boundary-rejected",
|
|
2604
|
+
"rejected",
|
|
2605
|
+
f.report,
|
|
2606
|
+
(g) => {
|
|
2607
|
+
const N = K(Ae, g.node), j = t(
|
|
2608
|
+
n(
|
|
2609
|
+
u.env.targetRuntime,
|
|
2610
|
+
u.env.styleScopeId,
|
|
2611
|
+
() => k.rejected({
|
|
2612
|
+
error: f.report.error,
|
|
2613
|
+
report: f.report,
|
|
2614
|
+
retry: Te
|
|
2615
|
+
})
|
|
2616
|
+
),
|
|
2617
|
+
new e(
|
|
2618
|
+
u.env,
|
|
2619
|
+
N,
|
|
2620
|
+
g.node,
|
|
2621
|
+
v
|
|
2622
|
+
),
|
|
2623
|
+
"raphy:async-boundary:rejected"
|
|
2624
|
+
);
|
|
2625
|
+
g.node.disposed || (o(g.node, j, u), p.adopt(j), j.moveBefore(p.parentNode, p.last));
|
|
2626
|
+
}
|
|
2627
|
+
);
|
|
2628
|
+
}
|
|
2629
|
+
);
|
|
2630
|
+
if (H === void 0)
|
|
2631
|
+
y();
|
|
2632
|
+
else {
|
|
2633
|
+
const v = H;
|
|
2634
|
+
H = void 0;
|
|
2635
|
+
try {
|
|
2636
|
+
v.run(y), v.remaining(), v.ready().then(Q, q);
|
|
2637
|
+
} catch (g) {
|
|
2638
|
+
throw q(g), g;
|
|
2639
|
+
}
|
|
2640
|
+
}
|
|
2641
|
+
}, je = (f, y, v, g) => {
|
|
2642
|
+
const N = Re(
|
|
2643
|
+
f,
|
|
2644
|
+
y,
|
|
2645
|
+
v,
|
|
2646
|
+
g
|
|
2647
|
+
), j = u.env.host.captureError(
|
|
2648
|
+
N.component,
|
|
2649
|
+
N.owner,
|
|
2650
|
+
N.cause,
|
|
2651
|
+
N.source,
|
|
2652
|
+
{ caught: !0 }
|
|
2653
|
+
);
|
|
2654
|
+
if (j.handled) {
|
|
2655
|
+
ye = j;
|
|
2656
|
+
try {
|
|
2657
|
+
ut(j);
|
|
2658
|
+
} catch (G) {
|
|
2659
|
+
if (G instanceof P)
|
|
2660
|
+
return G.captured;
|
|
2661
|
+
if (G instanceof w)
|
|
2662
|
+
return Object.freeze({
|
|
2663
|
+
handled: !1,
|
|
2664
|
+
report: Object.freeze({
|
|
2665
|
+
...j.report,
|
|
2666
|
+
error: G.error
|
|
2667
|
+
})
|
|
2668
|
+
});
|
|
2669
|
+
const ee = Re(
|
|
2670
|
+
N.component,
|
|
2671
|
+
C.node,
|
|
2672
|
+
G,
|
|
2673
|
+
{ layer: "renderer", operation: "async-boundary-rejected" }
|
|
2674
|
+
);
|
|
2675
|
+
return u.env.host.captureError(
|
|
2676
|
+
ee.component,
|
|
2677
|
+
ee.owner,
|
|
2678
|
+
ee.cause,
|
|
2679
|
+
ee.source
|
|
2680
|
+
);
|
|
2681
|
+
}
|
|
2682
|
+
}
|
|
2683
|
+
return j;
|
|
2684
|
+
}, X = (f) => {
|
|
2685
|
+
if (f instanceof P) {
|
|
2686
|
+
if (b.disposed || u.ownerNode.disposed)
|
|
2687
|
+
throw f;
|
|
2688
|
+
return;
|
|
2689
|
+
}
|
|
2690
|
+
if (f instanceof w)
|
|
2691
|
+
throw f;
|
|
2692
|
+
if (b.disposed)
|
|
2693
|
+
return;
|
|
2694
|
+
const y = Re(
|
|
2695
|
+
u.env.ownerComponent,
|
|
2696
|
+
b.node,
|
|
2697
|
+
f,
|
|
2698
|
+
{ layer: "renderer", operation: "async-boundary-content" }
|
|
2699
|
+
), v = k.rejected === void 0 ? u.env.host.captureError(
|
|
2700
|
+
y.component,
|
|
2701
|
+
y.owner,
|
|
2702
|
+
y.cause,
|
|
2703
|
+
y.source
|
|
2704
|
+
) : je(
|
|
2705
|
+
y.component,
|
|
2706
|
+
y.owner,
|
|
2707
|
+
y.cause,
|
|
2708
|
+
y.source
|
|
2709
|
+
);
|
|
2710
|
+
if (!v.handled)
|
|
2711
|
+
throw v.report.error;
|
|
2712
|
+
}, Pe = () => {
|
|
2713
|
+
if (W || M !== z || u.ownerNode.disposed || b.disposed || C.disposed || !ve || x !== 0 || D === null)
|
|
2714
|
+
return;
|
|
2715
|
+
const f = O ?? new Fe();
|
|
2716
|
+
let y;
|
|
2717
|
+
try {
|
|
2718
|
+
try {
|
|
2719
|
+
l(C, u, "async-boundary-content");
|
|
2720
|
+
} catch (v) {
|
|
2721
|
+
if (!(v instanceof w))
|
|
2722
|
+
throw v;
|
|
2723
|
+
f.deferCompletedFailure(v.error);
|
|
2724
|
+
}
|
|
2725
|
+
p.adopt(D), D.moveBefore(p.parentNode, p.last), y = d(f, u), O = null, A === f && (A = null), Z = !0;
|
|
2726
|
+
} catch (v) {
|
|
2727
|
+
const g = f.open ? f.abortAndTakeCompleted(v) : void 0;
|
|
2728
|
+
throw O = null, A === f && (A = null), g !== void 0 && ie(g, X), v;
|
|
2729
|
+
}
|
|
2730
|
+
y !== void 0 && ie(y, (v) => s(
|
|
2731
|
+
u,
|
|
2732
|
+
v,
|
|
2733
|
+
"async-boundary-content",
|
|
2734
|
+
!0
|
|
2735
|
+
));
|
|
2736
|
+
}, ze = () => {
|
|
2737
|
+
H === void 0 && (W || M !== z || u.ownerNode.disposed || b.disposed || C.disposed || p.parentNode === null || (Z && D !== null && (D.moveBefore(dt, null), Z = !1), i(u, "async-boundary-content", (f) => {
|
|
2738
|
+
c(
|
|
2739
|
+
C,
|
|
2740
|
+
u,
|
|
2741
|
+
f,
|
|
2742
|
+
"async-boundary-content",
|
|
2743
|
+
"pending",
|
|
2744
|
+
x,
|
|
2745
|
+
(y) => {
|
|
2746
|
+
const v = K(Ae, y.node), g = t(
|
|
2747
|
+
n(
|
|
2748
|
+
u.env.targetRuntime,
|
|
2749
|
+
u.env.styleScopeId,
|
|
2750
|
+
k.pending
|
|
2751
|
+
),
|
|
2752
|
+
new e(
|
|
2753
|
+
u.env,
|
|
2754
|
+
v,
|
|
2755
|
+
y.node,
|
|
2756
|
+
f
|
|
2757
|
+
),
|
|
2758
|
+
"raphy:async-boundary:pending"
|
|
2759
|
+
);
|
|
2760
|
+
y.node.disposed || (o(y.node, g, u), p.adopt(g), g.moveBefore(p.parentNode, p.last));
|
|
2761
|
+
}
|
|
2762
|
+
);
|
|
2763
|
+
})));
|
|
2764
|
+
}, ht = {
|
|
2765
|
+
register(f) {
|
|
2766
|
+
if (W || M !== z)
|
|
2767
|
+
return;
|
|
2768
|
+
const y = ve && x === 0 && Z;
|
|
2769
|
+
x++, y && ze();
|
|
2770
|
+
const v = f().catch((g) => {
|
|
2771
|
+
if (!(g instanceof P)) {
|
|
2772
|
+
if (g instanceof w)
|
|
2773
|
+
throw g.error;
|
|
2774
|
+
if (!W && M === z) {
|
|
2775
|
+
const N = _(g, u, {
|
|
2776
|
+
layer: "renderer",
|
|
2777
|
+
operation: "async-boundary-dependency"
|
|
2778
|
+
});
|
|
2779
|
+
if (!N.handled)
|
|
2780
|
+
throw N.report.error;
|
|
2781
|
+
}
|
|
2782
|
+
}
|
|
2783
|
+
}).finally(() => {
|
|
2784
|
+
M !== z || u.ownerNode.disposed || b.disposed || C.disposed || (x--, xe(Pe));
|
|
2785
|
+
});
|
|
2786
|
+
u.env.host.trackRenderWork(b.node, v), v.catch(h);
|
|
2787
|
+
}
|
|
2788
|
+
};
|
|
2789
|
+
try {
|
|
2790
|
+
if (c(
|
|
2791
|
+
b,
|
|
2792
|
+
u,
|
|
2793
|
+
O,
|
|
2794
|
+
"async-boundary-content",
|
|
2795
|
+
"content",
|
|
2796
|
+
void 0,
|
|
2797
|
+
(f) => {
|
|
2798
|
+
const y = K(lt, f.node);
|
|
2799
|
+
k.rejected !== void 0 && u.env.host.registerErrorBoundary(
|
|
2800
|
+
f.node,
|
|
2801
|
+
je
|
|
2802
|
+
), D = t(
|
|
2803
|
+
n(
|
|
2804
|
+
u.env.targetRuntime,
|
|
2805
|
+
u.env.styleScopeId,
|
|
2806
|
+
k.content
|
|
2807
|
+
),
|
|
2808
|
+
new e(
|
|
2809
|
+
{ ...u.env, asyncBoundary: ht },
|
|
2810
|
+
y,
|
|
2811
|
+
f.node,
|
|
2812
|
+
O
|
|
2813
|
+
),
|
|
2814
|
+
"raphy:async-boundary:content"
|
|
2815
|
+
), !f.node.disposed && f.node._ownCompletedCleanup(() => {
|
|
2816
|
+
if (D !== null)
|
|
2817
|
+
return m(
|
|
2818
|
+
D,
|
|
2819
|
+
u.env.host,
|
|
2820
|
+
u.env.ownerComponent
|
|
2821
|
+
);
|
|
2822
|
+
});
|
|
2823
|
+
}
|
|
2824
|
+
), W) {
|
|
2825
|
+
M === z && a(
|
|
2826
|
+
b,
|
|
2827
|
+
u,
|
|
2828
|
+
O,
|
|
2829
|
+
"async-boundary-content"
|
|
2830
|
+
);
|
|
2831
|
+
const f = O?.open && ye !== null ? O.abortAndTakeCompleted(
|
|
2832
|
+
new P(ye)
|
|
2833
|
+
) : void 0;
|
|
2834
|
+
A === O && (A = null), O = null, f !== void 0 && ie(f, X);
|
|
2835
|
+
return;
|
|
2836
|
+
}
|
|
2837
|
+
if (ve = !0, x === 0) {
|
|
2838
|
+
Pe();
|
|
2839
|
+
return;
|
|
2840
|
+
}
|
|
2841
|
+
ze();
|
|
2842
|
+
} catch (f) {
|
|
2843
|
+
const y = O?.open ? O.abortAndTakeCompleted(f) : void 0;
|
|
2844
|
+
if (A === O && (A = null), O = null, y !== void 0) {
|
|
2845
|
+
ie(y, X);
|
|
2846
|
+
return;
|
|
2847
|
+
}
|
|
2848
|
+
X(f);
|
|
2849
|
+
}
|
|
2850
|
+
};
|
|
2851
|
+
return Te = () => xe(_e), T === void 0 ? _e() : S.suspend(_e), p;
|
|
2852
|
+
}
|
|
2853
|
+
return E;
|
|
2854
|
+
}
|
|
2855
|
+
const oe = Symbol("raphy:dom:operations");
|
|
2856
|
+
function Hr(r, e) {
|
|
2857
|
+
if (typeof r != "object" || r === null || !("template" in r || "views" in r))
|
|
2858
|
+
throw new TypeError("[RaphyDOM] Declare operations on a resolved component with a template or named views, inside its async loader.");
|
|
2859
|
+
const t = Object.getOwnPropertyDescriptors(r);
|
|
2860
|
+
Reflect.deleteProperty(t, oe);
|
|
2861
|
+
const n = Object.create(Object.getPrototypeOf(r), t);
|
|
2862
|
+
return Object.defineProperty(n, oe, {
|
|
2863
|
+
value: Object.freeze([...r[oe] ?? [], ...e]),
|
|
2864
|
+
enumerable: !1,
|
|
2865
|
+
writable: !1,
|
|
2866
|
+
configurable: !1
|
|
2867
|
+
}), Object.freeze(n);
|
|
2868
|
+
}
|
|
2869
|
+
class Lr {
|
|
2870
|
+
_operation;
|
|
2871
|
+
_binding;
|
|
2872
|
+
_materializer;
|
|
2873
|
+
_advanced;
|
|
2874
|
+
_advancedMaterializer;
|
|
2875
|
+
_boundaries;
|
|
2876
|
+
_boundaryMaterializer;
|
|
2877
|
+
_async;
|
|
2878
|
+
_disposed = !1;
|
|
2879
|
+
constructor(e) {
|
|
2880
|
+
this._install(e);
|
|
2881
|
+
}
|
|
2882
|
+
_install(e) {
|
|
2883
|
+
for (const t of e)
|
|
2884
|
+
if (t.kind === "binding") {
|
|
2885
|
+
if (this._binding !== void 0 && this._binding !== t)
|
|
2886
|
+
throw new Error("[RaphyDOM] Conflicting binding materializers in one renderer.");
|
|
2887
|
+
this._binding = t;
|
|
2888
|
+
} else if (t.kind === "advanced") {
|
|
2889
|
+
if (this._advanced !== void 0 && this._advanced !== t)
|
|
2890
|
+
throw new Error("[RaphyDOM] Conflicting advanced materializers in one renderer.");
|
|
2891
|
+
this._advanced = t;
|
|
2892
|
+
} else if (t.kind === "boundaries") {
|
|
2893
|
+
if (this._boundaries !== void 0 && this._boundaries !== t)
|
|
2894
|
+
throw new Error("[RaphyDOM] Conflicting boundary materializers in one renderer.");
|
|
2895
|
+
this._boundaries = t;
|
|
2896
|
+
} else if (t.kind === "each") {
|
|
2897
|
+
if (this._operation !== void 0 && this._operation !== t)
|
|
2898
|
+
throw new Error("[RaphyDOM] Conflicting each materializers in one renderer.");
|
|
2899
|
+
this._operation = t;
|
|
2900
|
+
} else
|
|
2901
|
+
throw new TypeError("[RaphyDOM] Unknown operation.");
|
|
2902
|
+
}
|
|
2903
|
+
prepare(e) {
|
|
2904
|
+
if (this._disposed)
|
|
2905
|
+
throw new Error("[RaphyDOM] Operation table is disposed.");
|
|
2906
|
+
const t = e[oe];
|
|
2907
|
+
t !== void 0 && this._install(t);
|
|
2908
|
+
}
|
|
2909
|
+
mountEach(e, t, n) {
|
|
2910
|
+
if (this._disposed)
|
|
2911
|
+
throw new Error("[RaphyDOM] Operation table is disposed.");
|
|
2912
|
+
if (this._operation === void 0)
|
|
2913
|
+
throw new Error("[RaphyDOM] each requires DOM operation metadata or the Full profile.");
|
|
2914
|
+
return this._materializer ??= this._operation.create(n), this._materializer(e, t);
|
|
2915
|
+
}
|
|
2916
|
+
binding() {
|
|
2917
|
+
if (this._disposed)
|
|
2918
|
+
throw new Error("[RaphyDOM] Operation table is disposed.");
|
|
2919
|
+
if (this._binding === void 0)
|
|
2920
|
+
throw new Error("[RaphyDOM] bind requires DOM operation metadata or the Full profile.");
|
|
2921
|
+
return this._binding.mount;
|
|
2922
|
+
}
|
|
2923
|
+
advanced(e) {
|
|
2924
|
+
if (this._disposed)
|
|
2925
|
+
throw new Error("[RaphyDOM] Operation table is disposed.");
|
|
2926
|
+
if (this._advanced === void 0)
|
|
2927
|
+
throw new Error("[RaphyDOM] Advanced structural node requires DOM operation metadata or the Full profile.");
|
|
2928
|
+
return this._advancedMaterializer ??= this._advanced.create(e), this._advancedMaterializer;
|
|
2929
|
+
}
|
|
2930
|
+
boundaries(e, t) {
|
|
2931
|
+
if (this._disposed)
|
|
2932
|
+
throw new Error("[RaphyDOM] Operation table is disposed.");
|
|
2933
|
+
if (this._boundaries === void 0)
|
|
2934
|
+
throw new Error(`[RaphyDOM] ${t} requires DOM operation metadata or the Full profile.`);
|
|
2935
|
+
return this._boundaryMaterializer ??= this._boundaries.create(e), this._boundaryMaterializer;
|
|
2936
|
+
}
|
|
2937
|
+
asyncBoundary(e) {
|
|
2938
|
+
if (this._disposed)
|
|
2939
|
+
throw new Error("[RaphyDOM] Operation table is disposed.");
|
|
2940
|
+
return this._async ??= ar(e), this._async;
|
|
2941
|
+
}
|
|
2942
|
+
dispose() {
|
|
2943
|
+
this._disposed = !0, this._async = void 0, this._boundaries = void 0, this._boundaryMaterializer = void 0, this._operation = void 0, this._binding = void 0, this._materializer = void 0, this._advanced = void 0, this._advancedMaterializer = void 0;
|
|
2944
|
+
}
|
|
2945
|
+
}
|
|
2946
|
+
function Ir(r, e, t) {
|
|
2947
|
+
const n = $t(r, e);
|
|
2948
|
+
if (typeof r != "function")
|
|
2949
|
+
return n;
|
|
2950
|
+
const i = {
|
|
2951
|
+
handler: n.handler,
|
|
2952
|
+
kind: n.kind,
|
|
2953
|
+
options: n.options,
|
|
2954
|
+
data: t === void 0 ? ae : t
|
|
2955
|
+
};
|
|
2956
|
+
return U ? Object.freeze(i) : i;
|
|
2957
|
+
}
|
|
2958
|
+
export {
|
|
2959
|
+
Dr as A,
|
|
2960
|
+
Rr as B,
|
|
2961
|
+
wr as C,
|
|
2962
|
+
mr as D,
|
|
2963
|
+
Ar as E,
|
|
2964
|
+
Cr as F,
|
|
2965
|
+
K as G,
|
|
2966
|
+
fr as H,
|
|
2967
|
+
F as I,
|
|
2968
|
+
Re as J,
|
|
2969
|
+
Or as K,
|
|
2970
|
+
ie as L,
|
|
2971
|
+
Fe as M,
|
|
2972
|
+
Oe as N,
|
|
2973
|
+
Lt as O,
|
|
2974
|
+
xe as P,
|
|
2975
|
+
kr as Q,
|
|
2976
|
+
ur as R,
|
|
2977
|
+
Er as S,
|
|
2978
|
+
vr as T,
|
|
2979
|
+
br as U,
|
|
2980
|
+
gr as V,
|
|
2981
|
+
Sr as W,
|
|
2982
|
+
Lr as X,
|
|
2983
|
+
hr as Y,
|
|
2984
|
+
$ as a,
|
|
2985
|
+
Nr as b,
|
|
2986
|
+
pr as c,
|
|
2987
|
+
Ht as d,
|
|
2988
|
+
Pt as e,
|
|
2989
|
+
Ke as f,
|
|
2990
|
+
w as g,
|
|
2991
|
+
P as h,
|
|
2992
|
+
U as i,
|
|
2993
|
+
Mr as j,
|
|
2994
|
+
ae as k,
|
|
2995
|
+
$t as l,
|
|
2996
|
+
zr as m,
|
|
2997
|
+
it as n,
|
|
2998
|
+
Pr as o,
|
|
2999
|
+
Tr as p,
|
|
3000
|
+
I as q,
|
|
3001
|
+
_r as r,
|
|
3002
|
+
yr as s,
|
|
3003
|
+
Ir as t,
|
|
3004
|
+
Br as u,
|
|
3005
|
+
qt as v,
|
|
3006
|
+
Hr as w,
|
|
3007
|
+
jr as x,
|
|
3008
|
+
Qe as y,
|
|
3009
|
+
jt as z
|
|
3010
|
+
};
|