what-core 0.11.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-RI7T5VFD.min.js → chunk-D5YDPQ57.min.js} +1 -2
- package/dist/chunk-O3SKPRTY.min.js +0 -1
- package/dist/chunk-W33M3HL5.min.js +1 -0
- package/dist/index.min.js +2 -3
- package/dist/jsx-dev-runtime.min.js +0 -1
- package/dist/jsx-runtime.min.js +0 -1
- package/dist/render.min.js +1 -2
- package/dist/testing.min.js +1 -2
- package/package.json +2 -2
- package/src/agent-context.js +1 -1
- package/src/reactive.js +20 -4
- package/dist/a11y.js +0 -440
- package/dist/animation.js +0 -548
- package/dist/chunk-2IZMPODD.min.js +0 -2
- package/dist/chunk-2IZMPODD.min.js.map +0 -7
- package/dist/chunk-2P7OVL2L.js +0 -1386
- package/dist/chunk-2P7OVL2L.js.map +0 -7
- package/dist/chunk-5EQUBJWQ.js +0 -1365
- package/dist/chunk-5EQUBJWQ.js.map +0 -7
- package/dist/chunk-6DAIK77K.min.js +0 -2
- package/dist/chunk-6DAIK77K.min.js.map +0 -7
- package/dist/chunk-AW3BAPIK.js +0 -1685
- package/dist/chunk-AW3BAPIK.js.map +0 -7
- package/dist/chunk-AZP2EOGX.js +0 -188
- package/dist/chunk-AZP2EOGX.js.map +0 -7
- package/dist/chunk-CCINITLW.js +0 -1692
- package/dist/chunk-CCINITLW.js.map +0 -7
- package/dist/chunk-F2HUXI22.js +0 -1675
- package/dist/chunk-F2HUXI22.js.map +0 -7
- package/dist/chunk-GZRA4IAJ.js +0 -1699
- package/dist/chunk-GZRA4IAJ.js.map +0 -7
- package/dist/chunk-H3GA34JK.js +0 -1384
- package/dist/chunk-H3GA34JK.js.map +0 -7
- package/dist/chunk-KBM6CWG4.min.js +0 -2
- package/dist/chunk-KBM6CWG4.min.js.map +0 -7
- package/dist/chunk-KL7TNUIU.min.js +0 -2
- package/dist/chunk-KL7TNUIU.min.js.map +0 -7
- package/dist/chunk-L6XOF7P4.min.js +0 -2
- package/dist/chunk-L6XOF7P4.min.js.map +0 -7
- package/dist/chunk-M7UEET5O.js +0 -1323
- package/dist/chunk-M7UEET5O.js.map +0 -7
- package/dist/chunk-MH7L756Y.min.js +0 -2
- package/dist/chunk-MH7L756Y.min.js.map +0 -7
- package/dist/chunk-O3SKPRTY.min.js.map +0 -7
- package/dist/chunk-RI7T5VFD.min.js.map +0 -7
- package/dist/chunk-RN6QIBWL.min.js +0 -2
- package/dist/chunk-RN6QIBWL.min.js.map +0 -7
- package/dist/chunk-VKCFJ4OT.min.js +0 -2
- package/dist/chunk-VKCFJ4OT.min.js.map +0 -7
- package/dist/chunk-VMTTYB4L.min.js +0 -2
- package/dist/chunk-VMTTYB4L.min.js.map +0 -7
- package/dist/chunk-VP4WLF5A.js +0 -1323
- package/dist/chunk-VP4WLF5A.js.map +0 -7
- package/dist/chunk-YA3W4XKH.js +0 -1323
- package/dist/chunk-YA3W4XKH.js.map +0 -7
- package/dist/compiler.js +0 -1799
- package/dist/compiler.js.map +0 -7
- package/dist/compiler.min.js +0 -2
- package/dist/compiler.min.js.map +0 -7
- package/dist/components.js +0 -229
- package/dist/data.js +0 -638
- package/dist/devtools.js +0 -10
- package/dist/devtools.js.map +0 -7
- package/dist/devtools.min.js +0 -2
- package/dist/devtools.min.js.map +0 -7
- package/dist/dom.js +0 -439
- package/dist/form.js +0 -509
- package/dist/h.js +0 -152
- package/dist/head.js +0 -51
- package/dist/helpers.js +0 -140
- package/dist/hooks.js +0 -210
- package/dist/index.js +0 -3576
- package/dist/index.js.map +0 -7
- package/dist/index.min.js.map +0 -7
- package/dist/jsx-dev-runtime.js +0 -23
- package/dist/jsx-dev-runtime.js.map +0 -7
- package/dist/jsx-dev-runtime.min.js.map +0 -7
- package/dist/jsx-runtime.js +0 -21
- package/dist/jsx-runtime.js.map +0 -7
- package/dist/jsx-runtime.min.js.map +0 -7
- package/dist/reactive.js +0 -432
- package/dist/render.js +0 -53
- package/dist/render.js.map +0 -7
- package/dist/render.min.js.map +0 -7
- package/dist/scheduler.js +0 -246
- package/dist/skeleton.js +0 -363
- package/dist/store.js +0 -83
- package/dist/testing.js +0 -439
- package/dist/testing.js.map +0 -7
- package/dist/testing.min.js.map +0 -7
- package/dist/what.js +0 -117
package/dist/animation.js
DELETED
|
@@ -1,548 +0,0 @@
|
|
|
1
|
-
// What Framework - Animation Primitives
|
|
2
|
-
// Springs, tweens, gestures, and transition helpers
|
|
3
|
-
|
|
4
|
-
import { signal, effect, untrack, batch } from './reactive.js';
|
|
5
|
-
import { getCurrentComponent } from './dom.js';
|
|
6
|
-
import { scheduleRead, scheduleWrite } from './scheduler.js';
|
|
7
|
-
|
|
8
|
-
// Create an effect scoped to the current component's lifecycle
|
|
9
|
-
function scopedEffect(fn) {
|
|
10
|
-
const ctx = getCurrentComponent?.();
|
|
11
|
-
const dispose = effect(fn);
|
|
12
|
-
if (ctx) ctx.effects.push(dispose);
|
|
13
|
-
return dispose;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// --- Spring Animation ---
|
|
17
|
-
// Physics-based animation with natural feel
|
|
18
|
-
|
|
19
|
-
export function spring(initialValue, options = {}) {
|
|
20
|
-
const {
|
|
21
|
-
stiffness = 100,
|
|
22
|
-
damping = 10,
|
|
23
|
-
mass = 1,
|
|
24
|
-
precision = 0.01,
|
|
25
|
-
} = options;
|
|
26
|
-
|
|
27
|
-
const current = signal(initialValue);
|
|
28
|
-
const target = signal(initialValue);
|
|
29
|
-
const velocity = signal(0);
|
|
30
|
-
const isAnimating = signal(false);
|
|
31
|
-
|
|
32
|
-
let rafId = null;
|
|
33
|
-
let lastTime = null;
|
|
34
|
-
|
|
35
|
-
function tick(time) {
|
|
36
|
-
if (lastTime === null) {
|
|
37
|
-
lastTime = time;
|
|
38
|
-
rafId = requestAnimationFrame(tick);
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const dt = Math.min((time - lastTime) / 1000, 0.064); // Cap at ~15fps minimum
|
|
43
|
-
lastTime = time;
|
|
44
|
-
|
|
45
|
-
const currentVal = current.peek();
|
|
46
|
-
const targetVal = target.peek();
|
|
47
|
-
const vel = velocity.peek();
|
|
48
|
-
|
|
49
|
-
// Spring physics
|
|
50
|
-
const displacement = currentVal - targetVal;
|
|
51
|
-
const springForce = -stiffness * displacement;
|
|
52
|
-
const dampingForce = -damping * vel;
|
|
53
|
-
const acceleration = (springForce + dampingForce) / mass;
|
|
54
|
-
|
|
55
|
-
const newVelocity = vel + acceleration * dt;
|
|
56
|
-
const newValue = currentVal + newVelocity * dt;
|
|
57
|
-
|
|
58
|
-
batch(() => {
|
|
59
|
-
velocity.set(newVelocity);
|
|
60
|
-
current.set(newValue);
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
// Check if settled
|
|
64
|
-
if (Math.abs(newVelocity) < precision && Math.abs(displacement) < precision) {
|
|
65
|
-
batch(() => {
|
|
66
|
-
current.set(targetVal);
|
|
67
|
-
velocity.set(0);
|
|
68
|
-
isAnimating.set(false);
|
|
69
|
-
});
|
|
70
|
-
rafId = null;
|
|
71
|
-
lastTime = null;
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
rafId = requestAnimationFrame(tick);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function set(newTarget) {
|
|
79
|
-
target.set(newTarget);
|
|
80
|
-
if (!isAnimating.peek()) {
|
|
81
|
-
isAnimating.set(true);
|
|
82
|
-
lastTime = null;
|
|
83
|
-
rafId = requestAnimationFrame(tick);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
function stop() {
|
|
88
|
-
if (rafId) {
|
|
89
|
-
cancelAnimationFrame(rafId);
|
|
90
|
-
rafId = null;
|
|
91
|
-
}
|
|
92
|
-
isAnimating.set(false);
|
|
93
|
-
lastTime = null;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function snap(value) {
|
|
97
|
-
stop();
|
|
98
|
-
batch(() => {
|
|
99
|
-
current.set(value);
|
|
100
|
-
target.set(value);
|
|
101
|
-
velocity.set(0);
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// Register stop() as cleanup if inside a component
|
|
106
|
-
const ctx = getCurrentComponent?.();
|
|
107
|
-
if (ctx) {
|
|
108
|
-
ctx._cleanupCallbacks = ctx._cleanupCallbacks || [];
|
|
109
|
-
ctx._cleanupCallbacks.push(stop);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
return {
|
|
113
|
-
current: () => current(),
|
|
114
|
-
target: () => target(),
|
|
115
|
-
velocity: () => velocity(),
|
|
116
|
-
isAnimating: () => isAnimating(),
|
|
117
|
-
set,
|
|
118
|
-
stop,
|
|
119
|
-
snap,
|
|
120
|
-
subscribe: current.subscribe,
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// --- Tween Animation ---
|
|
125
|
-
// Easing-based animation
|
|
126
|
-
|
|
127
|
-
export function tween(from, to, options = {}) {
|
|
128
|
-
const {
|
|
129
|
-
duration = 300,
|
|
130
|
-
easing = (t) => t * (2 - t), // easeOutQuad
|
|
131
|
-
onUpdate,
|
|
132
|
-
onComplete,
|
|
133
|
-
} = options;
|
|
134
|
-
|
|
135
|
-
const progress = signal(0);
|
|
136
|
-
const value = signal(from);
|
|
137
|
-
const isAnimating = signal(true);
|
|
138
|
-
|
|
139
|
-
let startTime = null;
|
|
140
|
-
let rafId = null;
|
|
141
|
-
|
|
142
|
-
function tick(time) {
|
|
143
|
-
if (startTime === null) startTime = time;
|
|
144
|
-
|
|
145
|
-
const elapsed = time - startTime;
|
|
146
|
-
const t = Math.min(elapsed / duration, 1);
|
|
147
|
-
const easedT = easing(t);
|
|
148
|
-
const currentValue = from + (to - from) * easedT;
|
|
149
|
-
|
|
150
|
-
batch(() => {
|
|
151
|
-
progress.set(t);
|
|
152
|
-
value.set(currentValue);
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
if (onUpdate) onUpdate(currentValue, t);
|
|
156
|
-
|
|
157
|
-
if (t < 1) {
|
|
158
|
-
rafId = requestAnimationFrame(tick);
|
|
159
|
-
} else {
|
|
160
|
-
isAnimating.set(false);
|
|
161
|
-
if (onComplete) onComplete();
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
rafId = requestAnimationFrame(tick);
|
|
166
|
-
|
|
167
|
-
return {
|
|
168
|
-
progress: () => progress(),
|
|
169
|
-
value: () => value(),
|
|
170
|
-
isAnimating: () => isAnimating(),
|
|
171
|
-
cancel: () => {
|
|
172
|
-
if (rafId) cancelAnimationFrame(rafId);
|
|
173
|
-
isAnimating.set(false);
|
|
174
|
-
},
|
|
175
|
-
subscribe: value.subscribe,
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
// --- Easing Functions ---
|
|
180
|
-
|
|
181
|
-
export const easings = {
|
|
182
|
-
linear: (t) => t,
|
|
183
|
-
easeInQuad: (t) => t * t,
|
|
184
|
-
easeOutQuad: (t) => t * (2 - t),
|
|
185
|
-
easeInOutQuad: (t) => t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t,
|
|
186
|
-
easeInCubic: (t) => t * t * t,
|
|
187
|
-
easeOutCubic: (t) => (--t) * t * t + 1,
|
|
188
|
-
easeInOutCubic: (t) => t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1,
|
|
189
|
-
easeInElastic: (t) => t === 0 ? 0 : t === 1 ? 1 : -Math.pow(2, 10 * t - 10) * Math.sin((t * 10 - 10.75) * ((2 * Math.PI) / 3)),
|
|
190
|
-
easeOutElastic: (t) => t === 0 ? 0 : t === 1 ? 1 : Math.pow(2, -10 * t) * Math.sin((t * 10 - 0.75) * ((2 * Math.PI) / 3)) + 1,
|
|
191
|
-
easeOutBounce: (t) => {
|
|
192
|
-
const n1 = 7.5625;
|
|
193
|
-
const d1 = 2.75;
|
|
194
|
-
if (t < 1 / d1) return n1 * t * t;
|
|
195
|
-
if (t < 2 / d1) return n1 * (t -= 1.5 / d1) * t + 0.75;
|
|
196
|
-
if (t < 2.5 / d1) return n1 * (t -= 2.25 / d1) * t + 0.9375;
|
|
197
|
-
return n1 * (t -= 2.625 / d1) * t + 0.984375;
|
|
198
|
-
},
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
// --- useTransition Hook ---
|
|
202
|
-
// Animate between states
|
|
203
|
-
|
|
204
|
-
export function useTransition(options = {}) {
|
|
205
|
-
const { duration = 300, easing = easings.easeOutQuad } = options;
|
|
206
|
-
|
|
207
|
-
const isTransitioning = signal(false);
|
|
208
|
-
const progress = signal(0);
|
|
209
|
-
|
|
210
|
-
async function start(callback) {
|
|
211
|
-
isTransitioning.set(true);
|
|
212
|
-
progress.set(0);
|
|
213
|
-
|
|
214
|
-
return new Promise((resolve) => {
|
|
215
|
-
const startTime = performance.now();
|
|
216
|
-
|
|
217
|
-
function tick(time) {
|
|
218
|
-
const elapsed = time - startTime;
|
|
219
|
-
const t = Math.min(elapsed / duration, 1);
|
|
220
|
-
progress.set(easing(t));
|
|
221
|
-
|
|
222
|
-
if (t < 1) {
|
|
223
|
-
requestAnimationFrame(tick);
|
|
224
|
-
} else {
|
|
225
|
-
isTransitioning.set(false);
|
|
226
|
-
if (callback) callback();
|
|
227
|
-
resolve();
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
requestAnimationFrame(tick);
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
return {
|
|
236
|
-
isTransitioning: () => isTransitioning(),
|
|
237
|
-
progress: () => progress(),
|
|
238
|
-
start,
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
// --- Gesture Handlers ---
|
|
243
|
-
|
|
244
|
-
export function useGesture(element, handlers = {}) {
|
|
245
|
-
const {
|
|
246
|
-
onDrag,
|
|
247
|
-
onDragStart,
|
|
248
|
-
onDragEnd,
|
|
249
|
-
onPinch,
|
|
250
|
-
onSwipe,
|
|
251
|
-
onTap,
|
|
252
|
-
onLongPress,
|
|
253
|
-
preventDefault = false, // Set to true to allow e.preventDefault() in touch handlers
|
|
254
|
-
} = handlers;
|
|
255
|
-
|
|
256
|
-
const state = {
|
|
257
|
-
isDragging: signal(false),
|
|
258
|
-
startX: 0,
|
|
259
|
-
startY: 0,
|
|
260
|
-
currentX: signal(0),
|
|
261
|
-
currentY: signal(0),
|
|
262
|
-
deltaX: signal(0),
|
|
263
|
-
deltaY: signal(0),
|
|
264
|
-
velocity: signal({ x: 0, y: 0 }),
|
|
265
|
-
};
|
|
266
|
-
|
|
267
|
-
let lastTime = 0;
|
|
268
|
-
let lastX = 0;
|
|
269
|
-
let lastY = 0;
|
|
270
|
-
let longPressTimer = null;
|
|
271
|
-
|
|
272
|
-
function handleStart(e) {
|
|
273
|
-
const touch = e.touches ? e.touches[0] : e;
|
|
274
|
-
state.startX = touch.clientX;
|
|
275
|
-
state.startY = touch.clientY;
|
|
276
|
-
lastX = touch.clientX;
|
|
277
|
-
lastY = touch.clientY;
|
|
278
|
-
lastTime = performance.now();
|
|
279
|
-
|
|
280
|
-
state.isDragging.set(true);
|
|
281
|
-
if (onDragStart) onDragStart({ x: state.startX, y: state.startY });
|
|
282
|
-
|
|
283
|
-
// Long press detection
|
|
284
|
-
if (onLongPress) {
|
|
285
|
-
longPressTimer = setTimeout(() => {
|
|
286
|
-
if (state.isDragging.peek()) {
|
|
287
|
-
onLongPress({ x: lastX, y: lastY });
|
|
288
|
-
}
|
|
289
|
-
}, 500);
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
function handleMove(e) {
|
|
294
|
-
if (!state.isDragging.peek()) return;
|
|
295
|
-
|
|
296
|
-
const touch = e.touches ? e.touches[0] : e;
|
|
297
|
-
const x = touch.clientX;
|
|
298
|
-
const y = touch.clientY;
|
|
299
|
-
const now = performance.now();
|
|
300
|
-
const dt = now - lastTime;
|
|
301
|
-
|
|
302
|
-
batch(() => {
|
|
303
|
-
state.currentX.set(x);
|
|
304
|
-
state.currentY.set(y);
|
|
305
|
-
state.deltaX.set(x - state.startX);
|
|
306
|
-
state.deltaY.set(y - state.startY);
|
|
307
|
-
|
|
308
|
-
if (dt > 0) {
|
|
309
|
-
state.velocity.set({
|
|
310
|
-
x: (x - lastX) / dt * 1000,
|
|
311
|
-
y: (y - lastY) / dt * 1000,
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
});
|
|
315
|
-
|
|
316
|
-
lastX = x;
|
|
317
|
-
lastY = y;
|
|
318
|
-
lastTime = now;
|
|
319
|
-
|
|
320
|
-
if (longPressTimer) {
|
|
321
|
-
// Cancel long press if moved too much
|
|
322
|
-
const distance = Math.sqrt(state.deltaX.peek() ** 2 + state.deltaY.peek() ** 2);
|
|
323
|
-
if (distance > 10) {
|
|
324
|
-
clearTimeout(longPressTimer);
|
|
325
|
-
longPressTimer = null;
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
if (onDrag) {
|
|
330
|
-
onDrag({
|
|
331
|
-
x,
|
|
332
|
-
y,
|
|
333
|
-
deltaX: state.deltaX.peek(),
|
|
334
|
-
deltaY: state.deltaY.peek(),
|
|
335
|
-
velocity: state.velocity.peek(),
|
|
336
|
-
});
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
function handleEnd(e) {
|
|
341
|
-
if (!state.isDragging.peek()) return;
|
|
342
|
-
|
|
343
|
-
if (longPressTimer) {
|
|
344
|
-
clearTimeout(longPressTimer);
|
|
345
|
-
longPressTimer = null;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
const deltaX = state.deltaX.peek();
|
|
349
|
-
const deltaY = state.deltaY.peek();
|
|
350
|
-
const velocity = state.velocity.peek();
|
|
351
|
-
const distance = Math.sqrt(deltaX ** 2 + deltaY ** 2);
|
|
352
|
-
|
|
353
|
-
// Tap detection
|
|
354
|
-
if (distance < 10 && onTap) {
|
|
355
|
-
onTap({ x: state.startX, y: state.startY });
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
// Swipe detection
|
|
359
|
-
if (onSwipe && (Math.abs(velocity.x) > 500 || Math.abs(velocity.y) > 500)) {
|
|
360
|
-
const direction = Math.abs(velocity.x) > Math.abs(velocity.y)
|
|
361
|
-
? (velocity.x > 0 ? 'right' : 'left')
|
|
362
|
-
: (velocity.y > 0 ? 'down' : 'up');
|
|
363
|
-
onSwipe({ direction, velocity });
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
if (onDragEnd) {
|
|
367
|
-
onDragEnd({
|
|
368
|
-
deltaX,
|
|
369
|
-
deltaY,
|
|
370
|
-
velocity,
|
|
371
|
-
});
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
state.isDragging.set(false);
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
// Pinch handling (touch only)
|
|
378
|
-
let initialPinchDistance = null;
|
|
379
|
-
|
|
380
|
-
function handlePinchMove(e) {
|
|
381
|
-
if (!onPinch || e.touches.length !== 2) return;
|
|
382
|
-
|
|
383
|
-
const touch1 = e.touches[0];
|
|
384
|
-
const touch2 = e.touches[1];
|
|
385
|
-
const distance = Math.sqrt(
|
|
386
|
-
(touch2.clientX - touch1.clientX) ** 2 +
|
|
387
|
-
(touch2.clientY - touch1.clientY) ** 2
|
|
388
|
-
);
|
|
389
|
-
|
|
390
|
-
if (initialPinchDistance === null) {
|
|
391
|
-
initialPinchDistance = distance;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
const scale = distance / initialPinchDistance;
|
|
395
|
-
const centerX = (touch1.clientX + touch2.clientX) / 2;
|
|
396
|
-
const centerY = (touch1.clientY + touch2.clientY) / 2;
|
|
397
|
-
|
|
398
|
-
onPinch({ scale, centerX, centerY });
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
function handlePinchEnd() {
|
|
402
|
-
initialPinchDistance = null;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
// Attach listeners
|
|
406
|
-
if (typeof element === 'function') {
|
|
407
|
-
// Ref function
|
|
408
|
-
scopedEffect(() => {
|
|
409
|
-
const el = untrack(element);
|
|
410
|
-
if (!el) return;
|
|
411
|
-
return attachListeners(el);
|
|
412
|
-
});
|
|
413
|
-
} else if (element?.current !== undefined) {
|
|
414
|
-
// Ref object
|
|
415
|
-
scopedEffect(() => {
|
|
416
|
-
const el = element.current;
|
|
417
|
-
if (!el) return;
|
|
418
|
-
return attachListeners(el);
|
|
419
|
-
});
|
|
420
|
-
} else if (element) {
|
|
421
|
-
attachListeners(element);
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
function attachListeners(el) {
|
|
425
|
-
el.addEventListener('mousedown', handleStart);
|
|
426
|
-
el.addEventListener('touchstart', handleStart, { passive: !preventDefault });
|
|
427
|
-
window.addEventListener('mousemove', handleMove);
|
|
428
|
-
window.addEventListener('touchmove', handlePinchMove);
|
|
429
|
-
window.addEventListener('touchmove', handleMove);
|
|
430
|
-
window.addEventListener('mouseup', handleEnd);
|
|
431
|
-
window.addEventListener('touchend', handleEnd);
|
|
432
|
-
window.addEventListener('touchend', handlePinchEnd);
|
|
433
|
-
|
|
434
|
-
return () => {
|
|
435
|
-
el.removeEventListener('mousedown', handleStart);
|
|
436
|
-
el.removeEventListener('touchstart', handleStart);
|
|
437
|
-
window.removeEventListener('mousemove', handleMove);
|
|
438
|
-
window.removeEventListener('touchmove', handlePinchMove);
|
|
439
|
-
window.removeEventListener('touchmove', handleMove);
|
|
440
|
-
window.removeEventListener('mouseup', handleEnd);
|
|
441
|
-
window.removeEventListener('touchend', handleEnd);
|
|
442
|
-
window.removeEventListener('touchend', handlePinchEnd);
|
|
443
|
-
};
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
return state;
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
// --- useAnimatedValue Hook ---
|
|
450
|
-
// Like React Native's Animated.Value
|
|
451
|
-
|
|
452
|
-
export function useAnimatedValue(initialValue) {
|
|
453
|
-
const value = signal(initialValue);
|
|
454
|
-
const animations = [];
|
|
455
|
-
|
|
456
|
-
return {
|
|
457
|
-
value: () => value(),
|
|
458
|
-
setValue: (v) => value.set(v),
|
|
459
|
-
|
|
460
|
-
// Spring to target
|
|
461
|
-
spring(toValue, config = {}) {
|
|
462
|
-
const s = spring(value.peek(), config);
|
|
463
|
-
s.set(toValue);
|
|
464
|
-
|
|
465
|
-
const dispose = effect(() => {
|
|
466
|
-
value.set(s.current());
|
|
467
|
-
});
|
|
468
|
-
|
|
469
|
-
return {
|
|
470
|
-
stop: () => { s.stop(); dispose(); },
|
|
471
|
-
};
|
|
472
|
-
},
|
|
473
|
-
|
|
474
|
-
// Tween to target
|
|
475
|
-
timing(toValue, config = {}) {
|
|
476
|
-
const t = tween(value.peek(), toValue, {
|
|
477
|
-
...config,
|
|
478
|
-
onUpdate: (v) => value.set(v),
|
|
479
|
-
});
|
|
480
|
-
|
|
481
|
-
return {
|
|
482
|
-
stop: () => t.cancel(),
|
|
483
|
-
};
|
|
484
|
-
},
|
|
485
|
-
|
|
486
|
-
// Interpolate value
|
|
487
|
-
interpolate(inputRange, outputRange) {
|
|
488
|
-
return () => {
|
|
489
|
-
const v = value();
|
|
490
|
-
// Find segment
|
|
491
|
-
for (let i = 0; i < inputRange.length - 1; i++) {
|
|
492
|
-
if (v >= inputRange[i] && v <= inputRange[i + 1]) {
|
|
493
|
-
const t = (v - inputRange[i]) / (inputRange[i + 1] - inputRange[i]);
|
|
494
|
-
return outputRange[i] + (outputRange[i + 1] - outputRange[i]) * t;
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
// Clamp
|
|
498
|
-
if (v <= inputRange[0]) return outputRange[0];
|
|
499
|
-
return outputRange[outputRange.length - 1];
|
|
500
|
-
};
|
|
501
|
-
},
|
|
502
|
-
|
|
503
|
-
subscribe: value.subscribe,
|
|
504
|
-
};
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
// --- CSS Transition Classes ---
|
|
508
|
-
|
|
509
|
-
export function createTransitionClasses(name) {
|
|
510
|
-
return {
|
|
511
|
-
enter: `${name}-enter`,
|
|
512
|
-
enterActive: `${name}-enter-active`,
|
|
513
|
-
enterDone: `${name}-enter-done`,
|
|
514
|
-
exit: `${name}-exit`,
|
|
515
|
-
exitActive: `${name}-exit-active`,
|
|
516
|
-
exitDone: `${name}-exit-done`,
|
|
517
|
-
};
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
// Apply CSS transition
|
|
521
|
-
export async function cssTransition(element, name, type = 'enter', duration = 300) {
|
|
522
|
-
const classes = createTransitionClasses(name);
|
|
523
|
-
|
|
524
|
-
return new Promise((resolve) => {
|
|
525
|
-
scheduleWrite(() => {
|
|
526
|
-
// Initial state
|
|
527
|
-
element.classList.add(classes[type]);
|
|
528
|
-
|
|
529
|
-
// Force reflow
|
|
530
|
-
scheduleRead(() => {
|
|
531
|
-
element.offsetHeight;
|
|
532
|
-
|
|
533
|
-
scheduleWrite(() => {
|
|
534
|
-
// Active state
|
|
535
|
-
element.classList.add(classes[`${type}Active`]);
|
|
536
|
-
|
|
537
|
-
setTimeout(() => {
|
|
538
|
-
scheduleWrite(() => {
|
|
539
|
-
element.classList.remove(classes[type], classes[`${type}Active`]);
|
|
540
|
-
element.classList.add(classes[`${type}Done`]);
|
|
541
|
-
resolve();
|
|
542
|
-
});
|
|
543
|
-
}, duration);
|
|
544
|
-
});
|
|
545
|
-
});
|
|
546
|
-
});
|
|
547
|
-
});
|
|
548
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{I as R,K as rt,M as ht,N as it,a as P,c as tt,e as D,m as q}from"./chunk-6DAIK77K.min.js";var Z=null;function Zt(t){Z=typeof t=="function"?t:null}function Jt(t,n,e){if(e&&e.length>0){let o=e.length===1?e[0]:e;n?n.children=o:n={children:o}}return rt({tag:t,props:n||{},children:e||[],key:null,_vnode:!0})}var gt=new Set(["href","src","action","formaction","formAction"]);function Ct(t){if(typeof t!="string")return!0;let n=t.trim().replace(/[\s\x00-\x1f]/g,"").toLowerCase();return!(n.startsWith("javascript:")||n.startsWith("data:")||n.startsWith("vbscript:"))}var At={tr:{depth:2,wrap:"<table><tbody>",unwrap:"</tbody></table>"},td:{depth:3,wrap:"<table><tbody><tr>",unwrap:"</tr></tbody></table>"},th:{depth:3,wrap:"<table><tbody><tr>",unwrap:"</tr></tbody></table>"},thead:{depth:1,wrap:"<table>",unwrap:"</table>"},tbody:{depth:1,wrap:"<table>",unwrap:"</table>"},tfoot:{depth:1,wrap:"<table>",unwrap:"</table>"},colgroup:{depth:1,wrap:"<table>",unwrap:"</table>"},col:{depth:1,wrap:"<table>",unwrap:"</table>"},caption:{depth:1,wrap:"<table>",unwrap:"</table>"}},wt=new Set(["svg","path","circle","rect","line","polyline","polygon","ellipse","g","defs","use","text","tspan","foreignObject","clipPath","mask","pattern","linearGradient","radialGradient","stop","marker","symbol","image","animate","animateTransform","animateMotion","set","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feImage","feMorphology","feSpecularLighting","feTile","feTurbulence","feDistantLight","fePointLight","feSpotLight"]);function pt(t){let n=t.match(/^<([a-zA-Z][a-zA-Z0-9]*)/);return n?n[1]:""}function Tt(t){let n=t.trim(),e=pt(n);if(wt.has(e))return Et(n);let o=At[e];if(o){let i=document.createElement("template");i.innerHTML=o.wrap+n+o.unwrap;let y=i.content.firstChild;for(let c=0;c<o.depth;c++)y=y.firstChild;return()=>y.cloneNode(!0)}let r=document.createElement("template");return r.innerHTML=n,()=>r.content.firstChild.cloneNode(!0)}var dt=!1;function Qt(t){return P&&!dt&&(dt=!0,console.warn("[what] template() is a compiler internal. Use JSX instead. Direct calls with user input can lead to XSS vulnerabilities.")),Tt(t)}function Et(t){let n=t.trim();if(pt(n)==="svg"){let r=document.createElement("template");return r.innerHTML=n,()=>r.content.firstChild.cloneNode(!0)}let o=document.createElement("template");return o.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg">${n}</svg>`,()=>o.content.firstChild.firstChild.cloneNode(!0)}function Yt(t,n,e){if(typeof n=="function"&&n._mapArray)return n(t,e||null);if(typeof n=="function"){let o=e||null,r=null,i=null,y=!1;return D(()=>{let c=n(),h=typeof c;if(!y){y=!0,h==="string"||h==="number"?(i=document.createTextNode(String(c)),o?t.insertBefore(i,o):t.appendChild(i),Z&&Z(t,String(c)),r=i):r=Q(t,c,null,o);return}if(i!==null&&(h==="string"||h==="number")){let l=String(c);i.data!==l&&(i.data=l),Z&&Z(t,l);return}i=null,r=Q(t,c,r,o)}),r}if(typeof n=="string"||typeof n=="number"){let o=document.createTextNode(String(n));return e?t.insertBefore(o,e):t.appendChild(o),o}return n!=null&&typeof n=="object"&&n.nodeType>0?(e?t.insertBefore(n,e):t.appendChild(n),n):Q(t,n,null,e||null)}function xt(t){return!t||typeof t!="object"?!1:typeof Node<"u"&&t instanceof Node?!0:typeof t.nodeType=="number"&&typeof t.nodeName=="string"}function Lt(t){return!!t&&typeof t=="object"&&(t._vnode===!0||"tag"in t)}var nt=typeof SVGElement<"u";function St(t){return nt&&t instanceof SVGElement&&t.tagName!=="foreignObject"}function yt(t){return t==null?[]:Array.isArray(t)?t:[t]}function st(t,n,e){if(t==null||typeof t=="boolean")return e;if(Array.isArray(t)){for(let o=0;o<t.length;o++)st(t[o],n,e);return e}if(typeof t=="function")return st(t(),n,e),e;if(typeof t=="string"||typeof t=="number")return e.push(document.createTextNode(String(t))),e;if(xt(t)){if(t.nodeType===11&&t.childNodes.length>0){let o=Array.from(t.childNodes);for(let r=0;r<o.length;r++)e.push(o[r])}else e.push(t);return e}return Lt(t)?(e.push(rt(t,n,St(n))),e):(e.push(document.createTextNode(String(t))),e)}function Mt(t,n){if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(t[e]!==n[e])return!1;return!0}function Q(t,n,e,o){if(!t||typeof t.insertBefore!="function")return P&&console.warn("[what] reconcileInsert called with invalid parent:",t),e;let r=o||null;if(n==null||typeof n=="boolean"){let l=yt(e);for(let d=0;d<l.length;d++){let s=l[d];s.parentNode===t&&(R(s),t.removeChild(s))}return null}if((typeof n=="string"||typeof n=="number")&&e&&!Array.isArray(e)&&e.nodeType===3){let l=String(n);return e.data!==l&&(e.data=l),e}if(typeof n=="object"&&n!==null&&n.nodeType>0&&!Array.isArray(n)){if(n===e)return e;if(e&&!Array.isArray(e)&&e.nodeType>0)return e.parentNode===t?(R(e),t.replaceChild(n,e)):r?t.insertBefore(n,r):t.appendChild(n),n}let i=st(n,t,[]),y=yt(e);if(Mt(y,i))return e;let c=i.length;for(let l=0;l<y.length;l++){let d=y[l];if(d.parentNode!==t)continue;let s=!1;for(let C=0;C<c;C++)if(i[C]===d){s=!0;break}s||(R(d),t.removeChild(d))}let h=r;for(let l=i.length-1;l>=0;l--){let d=i[l];(d.parentNode!==t||d.nextSibling!==h)&&(h&&h.parentNode!==t&&(h=null),h?t.insertBefore(d,h):t.appendChild(d)),h=d}return i.length===0?null:i.length===1?i[0]:i}function It(t,n,e){let o=e?.key,r=e?.raw||!1,i=(y,c)=>{let h=[],l=[],d=[],s=o&&!r?new Map:null,C=document.createComment("/list");return y.insertBefore(C,c||null),D(()=>{let m=t()||[];o?Dt(y,C,h,m,l,d,n,o,s):Bt(y,C,h,m,l,d,n),h=m.length>0?m.slice():m}),C};return i._mapArray=!0,i}function Bt(t,n,e,o,r,i,y){let c=o.length,h=e.length;if(c===0){if(h>0){for(let u=0;u<h;u++)i[u]&&i[u]();for(let u=h-1;u>=0;u--){let a=r[u];a&&(R(a),a.parentNode===t&&t.removeChild(a))}r.length=0,i.length=0}return}if(h===0){let u=document.createDocumentFragment();for(let a=0;a<c;a++){let T=o[a],L=q(V=>(i[a]=V,y(T,a)));r[a]=L,u.appendChild(L)}t.insertBefore(u,n);return}let l=0,d=Math.min(h,c);for(;l<d&&e[l]===o[l];)l++;if(l===h&&l===c)return;let s=h-1,C=c-1;for(;s>=l&&C>=l&&e[s]===o[C];)s--,C--;let m=new Array(c),p=new Array(c);for(let u=0;u<l;u++)m[u]=r[u],p[u]=i[u];for(let u=C+1;u<c;u++){let a=s+1+(u-C-1);m[u]=r[a],p[u]=i[a]}let x=C-l+1,w=s-l+1;if(x===0)for(let u=l;u<=s;u++)i[u]?.(),r[u]&&R(r[u]),r[u]?.parentNode&&r[u].parentNode.removeChild(r[u]);else if(w===0){let u=l<c&&m[C+1]?m[C+1]:n,a=document.createDocumentFragment();for(let T=l;T<=C;T++){let L=o[T],V=T;m[T]=q(S=>(p[V]=S,y(L,V))),a.appendChild(m[T])}t.insertBefore(a,u)}else Ht(t,n,e,o,r,i,y,l,s,C,m,p);r.length=c,i.length=c;for(let u=0;u<c;u++)r[u]=m[u],i[u]=p[u]}function Ht(t,n,e,o,r,i,y,c,h,l,d,s){let C=new Map;for(let a=c;a<=h;a++)C.set(e[a],a);let m=l-c+1,p=new Int32Array(m);p.fill(-1);for(let a=c;a<=l;a++){let T=C.get(o[a]);T!==void 0&&(C.delete(o[a]),d[a]=r[T],s[a]=i[T],p[a-c]=T)}for(let[,a]of C)i[a]?.(),r[a]&&R(r[a]),r[a]?.parentNode&&r[a].parentNode.removeChild(r[a]);let x=m-jt(p,m),w=new Uint8Array(m);if(x>1){let a=new Int32Array(x),T=new Int32Array(x),L=0;for(let S=0;S<m;S++)p[S]!==-1&&(a[L]=p[S],T[L]=S,L++);let V=_t(a,x);for(let S=0;S<V.length;S++)w[T[V[S]]]=1}else if(x===1){for(let a=0;a<m;a++)if(p[a]!==-1){w[a]=1;break}}for(let a=c;a<=l;a++)if(!d[a]){let T=o[a],L=a;d[a]=q(V=>(s[L]=V,y(T,L)))}let u=l+1<d.length&&d[l+1]?d[l+1]:n;for(let a=l;a>=c;a--){let T=a-c;(p[T]===-1||!w[T])&&(u&&u.parentNode!==t&&(u=n),t.insertBefore(d[a],u)),u=d[a]}}function jt(t,n){let e=0;for(let o=0;o<n;o++)t[o]===-1&&e++;return e}function _t(t,n){if(n===0)return[];if(n===1)return[0];let e=new Int32Array(n),o=new Int32Array(n),r=1;e[0]=0,o[0]=-1;for(let c=1;c<n;c++)if(t[c]>t[e[r-1]])o[c]=e[r-1],e[r++]=c;else{let h=0,l=r-1;for(;h<l;){let d=h+l>>1;t[e[d]]<t[c]?h=d+1:l=d}e[h]=c,o[c]=h>0?e[h-1]:-1}let i=new Array(r),y=e[r-1];for(let c=r-1;c>=0;c--)i[c]=y,y=o[y];return i}function $t(){return document.createComment("i")}function z(t,n,e,o){let r=n;for(;r&&r!==e;){let i=r.nextSibling;t.insertBefore(r,o),r=i}}function ft(t,n,e){let o=n;for(;o&&o!==e;){let r=o.nextSibling;R(o),t.removeChild(o),o=r}}function ct(t,n,e,o,r,i,y,c,h){let l;if(r){let C=o(n),m=h(n);l=m,r.set(C,{itemSig:m})}else l=n;let d=$t();t.appendChild(d);let s=q(C=>(c[e]=C,i(l,e)));t.appendChild(s),y[e]=d}function Dt(t,n,e,o,r,i,y,c,h){let l=o.length,d=e.length;if(l===0){if(d>0){for(let f=0;f<d;f++)i[f]&&i[f]();r[0]&&ft(t,r[0],n),r.length=0,i.length=0,h&&h.clear()}return}if(d===0){let f=document.createDocumentFragment();for(let _=0;_<l;_++)ct(f,o[_],_,c,h,y,r,i,tt);t.insertBefore(f,n);return}let s=0,C=Math.min(d,l);for(;s<C;){if(e[s]===o[s]){s++;continue}let f=c(e[s]),_=c(o[s]);if(f!==_)break;h&&h.get(f).itemSig.set(o[s]),s++}let m=d-1,p=l-1;for(;m>=s&&p>=s;){if(e[m]===o[p]){m--,p--;continue}let f=c(e[m]),_=c(o[p]);if(f!==_)break;h&&h.get(f).itemSig.set(o[p]),m--,p--}if(s>m&&s>p)return;let x=new Array(l),w=new Array(l);for(let f=0;f<s;f++)x[f]=r[f],w[f]=i[f];for(let f=p+1;f<l;f++){let _=m+1+(f-p-1);x[f]=r[_],w[f]=i[_]}let u=p-s+1,a=m-s+1;if(a===0){let f=p+1<l&&x[p+1]?x[p+1]:n,_=document.createDocumentFragment();for(let E=s;E<=p;E++)ct(_,o[E],E,c,h,y,x,w,tt);t.insertBefore(_,f),X(r,i,x,w,l);return}if(u===0){for(let f=s;f<=m;f++){i[f]?.();let _=O(t,r[f],r,f,n);ft(t,r[f],_),h&&h.delete(c(e[f]))}X(r,i,x,w,l);return}if(u===a&&u>=2&&u<=Math.max(a,200)){let f=0,_=-1,E=-1;for(let b=0;b<u&&f<=4;b++){let A=c(e[s+b]),K=c(o[s+b]);A!==K&&(f===0?_=b:f===1&&(E=b),f++)}if(f===2){let b=s+_,A=s+E,K=c(e[b]),N=c(e[A]),U=c(o[b]),F=c(o[A]);if(K===F&&N===U){for(let g=0;g<s;g++)x[g]=r[g],w[g]=i[g];for(let g=s;g<=p;g++)x[g]=r[g],w[g]=i[g];for(let g=p+1;g<l;g++){let $=m+1+(g-p-1);x[g]=r[$],w[g]=i[$]}let G=x[b];x[b]=x[A],x[A]=G;let H=w[b];if(w[b]=w[A],w[A]=H,h){if(o[b]!==e[b]){let g=c(o[b]),$=h.get(g);$&&$.itemSig.set(o[b])}if(o[A]!==e[A]){let g=c(o[A]),$=h.get(g);$&&$.itemSig.set(o[A])}}let B=A===b+1||b===A+1,j=Math.min(b,A),M=Math.max(b,A);if(B){let g=O(t,r[M],r,M,n);z(t,r[M],g,r[j])}else{let g=O(t,r[A],r,A,n),$=document.createComment("tmp");t.insertBefore($,r[A]),z(t,r[A],g,r[b]);let v=O(t,r[b],r,b,n);z(t,r[b],v,$),t.removeChild($)}X(r,i,x,w,l);return}}if(f>=2&&f<=u){let b=_,A=null,K=-1,N=-1,U=!1,F=c(e[s+b]),G=-1;for(let H=b;H<u;H++)if(c(o[s+H])===F){G=H;break}if(G>b){let H=!0;for(let B=b;B<G;B++)if(c(e[s+B+1])!==c(o[s+B])){H=!1;break}if(H){let B=!0;for(let j=G+1;j<u;j++)if(c(e[s+j])!==c(o[s+j])){B=!1;break}B&&(U=!0,K=s+b,N=s+G,A=F)}}if(!U){let H=c(o[s+b]),B=-1;for(let j=b;j<a;j++)if(c(e[s+j])===H){B=j;break}if(B>b){let j=!0;for(let M=b;M<B;M++)if(c(e[s+M])!==c(o[s+M+1])){j=!1;break}if(j){let M=!0;for(let g=B+1;g<u;g++)if(c(e[s+g])!==c(o[s+g])){M=!1;break}M&&(U=!0,K=s+B,N=s+b,A=H)}}}if(U){for(let g=s;g<=m;g++)x[g]=r[g],w[g]=i[g];let H=x[K],B=w[K];if(K<N)for(let g=K;g<N;g++)x[g]=x[g+1],w[g]=w[g+1];else for(let g=K;g>N;g--)x[g]=x[g-1],w[g]=w[g-1];if(x[N]=H,w[N]=B,h)for(let g=s;g<=p;g++){let $=c(o[g]);if(o[g]!==e[g]){let v=h.get($);v&&v.itemSig.set(o[g])}}let j=O(t,H,r,K,n),M;N+1<l?M=x[N+1]:M=n,(N>=p+1||M&&M.parentNode!==t)&&(M=n),z(t,H,j,M),X(r,i,x,w,l);return}}}let T=new Map;for(let f=s;f<=m;f++)T.set(c(e[f]),f);let L=new Int32Array(u);L.fill(-1);for(let f=s;f<=p;f++){let _=c(o[f]),E=T.get(_);E!==void 0&&(T.delete(_),x[f]=r[E],w[f]=i[E],L[f-s]=E,h&&o[f]!==e[E]&&h.get(_).itemSig.set(o[f]))}let V=[...T.values()].sort((f,_)=>_-f);for(let f of V){i[f]?.();let _=O(t,r[f],r,f,n);ft(t,r[f],_),h&&h.delete(c(e[f]))}for(let f=s;f<=p;f++)if(!x[f]){let _=document.createDocumentFragment();ct(_,o[f],f,c,h,y,x,w,tt),x[f]._frag=_}let S=0,ut=!0,at=-1;for(let f=0;f<u;f++)L[f]!==-1&&(S++,L[f]<=at&&(ut=!1),at=L[f]);let k=new Uint8Array(u);if(ut)for(let f=0;f<u;f++)L[f]!==-1&&(k[f]=1);else if(S>1){let f=new Int32Array(S),_=new Int32Array(S),E=0;for(let A=0;A<u;A++)L[A]!==-1&&(f[E]=L[A],_[E]=A,E++);let b=_t(f,S);for(let A=0;A<b.length;A++)k[_[b[A]]]=1}else if(S===1){for(let f=0;f<u;f++)if(L[f]!==-1){k[f]=1;break}}X(r,i,x,w,l);let ot=p+1<l&&r[p+1]?r[p+1]:n;for(let f=p;f>=s;f--){let _=f-s,E=r[f];if(L[_]===-1)E._frag&&(t.insertBefore(E._frag,ot),delete E._frag);else if(!k[_]){let b=O(t,E,r,f,n);z(t,E,b,ot)}ot=E}}function O(t,n,e,o,r){let i=n.nextSibling;for(;i&&i!==r;){if(i.nodeType===8&&i.data==="i")return i;i=i.nextSibling}return r}function X(t,n,e,o,r){t.length=r,n.length=r;for(let i=0;i<r;i++)t[i]=e[i],n[i]=o[i]}function kt(t,n){for(let e in n){let o=n[e];if(e.startsWith("on")&&e.length>2){let r=e.slice(2).toLowerCase();t.addEventListener(r,o);continue}if(typeof o=="function"&&!e.startsWith("on")){if(t._propEffects||(t._propEffects={}),t._propEffects[e])try{t._propEffects[e]()}catch{}e==="class"||e==="className"?t._propEffects[e]=D(()=>{let r=o()||"";nt&&t instanceof SVGElement?t.setAttribute("class",r):t.className=r}):e==="style"&&typeof o()=="object"?t._propEffects[e]=D(()=>{let r=o();for(let i in r)t.style[i]=r[i]??""}):t._propEffects[e]=D(()=>{Y(t,e,o())})}else Y(t,e,o)}}function Y(t,n,e){if(n==="ref"){typeof e=="function"?e(t):e&&typeof e=="object"&&(e.current=t);return}if(n==="key")return;if(typeof e=="function"&&!n.startsWith("on")){if(t._propEffects||(t._propEffects={}),t._propEffects[n])try{t._propEffects[n]()}catch{}t._propEffects[n]=D(()=>Y(t,n,e()));return}if((gt.has(n)||gt.has(n.toLowerCase()))&&!Ct(e)){typeof console<"u"&&console.warn(`[what] Blocked unsafe URL in "${n}" attribute: ${e}`);return}let o=nt&&t instanceof SVGElement;if(n==="class"||n==="className")o?t.setAttribute("class",e||""):t.className=e||"";else if(n==="dangerouslySetInnerHTML"){let r=e?.__html??"";typeof P<"u"&&P&&typeof r=="string"&&/(<script|onerror\s*=|onload\s*=|javascript:)/i.test(r)&&console.warn("[what] dangerouslySetInnerHTML contains potential XSS vectors. Ensure content is sanitized."),t.innerHTML=r}else if(n==="innerHTML")if(e&&typeof e=="object"&&"__html"in e){let r=e.__html??"";typeof P<"u"&&P&&typeof r=="string"&&/(<script|onerror\s*=|onload\s*=|javascript:)/i.test(r)&&console.warn("[what] dangerouslySetInnerHTML contains potential XSS vectors. Ensure content is sanitized."),t.innerHTML=r}else typeof console<"u"&&e!=null&&e!==""&&console.warn('[what] Plain string innerHTML is not allowed. Use { __html: "..." } or dangerouslySetInnerHTML={{ __html: "..." }} instead.');else if(n==="style"){if(typeof e=="string")t.style.cssText=e;else if(typeof e=="object")for(let r in e)t.style[r]=e[r]??""}else n.startsWith("data-")||n.startsWith("aria-")?t.setAttribute(n,e):typeof e=="boolean"?e?t.setAttribute(n,""):t.removeAttribute(n):o?t.setAttribute(n,e):n==="value"&&t.tagName==="SELECT"?it(t,e):n in t?t[n]=e:t.setAttribute(n,e)}function I(t,n,e,o){if(t._propEffects||(t._propEffects={}),t._propEffects[n])try{t._propEffects[n]()}catch{}t._propEffects[n]=D(()=>o(t,e()))}function Kt(t,n){if(typeof n=="function")return I(t,"class",n,Kt);nt&&t instanceof SVGElement?t.setAttribute("class",n||""):t.className=n||""}function Nt(t,n){if(typeof n=="function")return I(t,"style",n,Nt);if(typeof n=="string")t.style.cssText=n;else if(n&&typeof n=="object"){let e=t.style;for(let o in n)e[o]=n[o]??""}else n==null&&(t.style.cssText="")}function Vt(t,n,e){if(typeof e=="function")return I(t,n,e,(o,r)=>Vt(o,n,r));e==null?t.removeAttribute(n):t.setAttribute(n,e)}function Wt(t,n){if(typeof n=="function")return I(t,"value",n,Wt);if(t.tagName==="SELECT"){it(t,n);return}let e=n==null?"":String(n);t.value!==e&&(t.value=e)}function Rt(t,n){if(typeof n=="function")return I(t,"checked",n,Rt);t.checked=!!n}var bt=new Set;function Ft(t){for(let n of t)bt.has(n)||(bt.add(n),document.addEventListener(n,e=>{let o=e.target,r="$$"+n;for(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return o||document}});o;){let i=o[r];if(i&&(i(e),e.cancelBubble))return;o=o.parentNode}}))}function vt(t,n,e){return t.addEventListener(n,e),()=>t.removeEventListener(n,e)}function te(t,n){D(()=>{for(let e in n){let o=typeof n[e]=="function"?n[e]():n[e];t.classList.toggle(e,!!o)}})}var et=!1,W=null;function ee(){return et}function ne(t,n){et=!0,W={parent:n,index:0};try{return J(t,n)}finally{et=!1,W=null}}function mt(t){let n=t.childNodes;for(;W.index<n.length;){let e=n[W.index];if(e.nodeType===8){let o=e.textContent;if(o==="$"||o==="/$"||o==="[]"||o==="/[]"){W.index++;continue}}return W.index++,e}return null}function lt(){return typeof process<"u"&&!1}function J(t,n){if(t==null||typeof t=="boolean")return null;if(typeof t=="string"||typeof t=="number"){let o=mt(n),r=String(t);if(o&&o.nodeType===3)return lt()&&o.textContent!==r&&(console.warn(`[what] Hydration mismatch: expected text "${r}", got "${o.textContent}"`),o.textContent=r),o;lt()&&console.warn(`[what] Hydration mismatch: expected text node "${r}", got ${o?o.nodeName:"nothing"}. Falling back to client render.`);let i=document.createTextNode(r);return o?n.replaceChild(i,o):n.appendChild(i),i}if(typeof t=="function"){let o=t(),r=J(o,n);return D(()=>{let i=t();et||(r=Q(n,i,r,null))}),r}if(Array.isArray(t)){let o=[];for(let r of t){let i=J(r,n);i&&o.push(i)}return o.length===1?o[0]:o}if(typeof t=="object"&&t._vnode){if(typeof t.tag=="function"){let y=ht(),c=t.tag,h=t.props||{},l=t.children||[],d={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,Component:c,_parentCtx:y[y.length-1]||null,_errorBoundary:null};y.push(d);let s;try{let C=l.length===0?void 0:l.length===1?l[0]:l;s=c({...h,children:C})}catch(C){return y.pop(),console.error("[what] Error in component during hydration:",c.name||"Anonymous",C),null}return y.pop(),d.mounted=!0,d._mountCallbacks&&queueMicrotask(()=>{if(!d.disposed)for(let C of d._mountCallbacks)try{C()}catch(m){console.error("[what] onMount error:",m)}}),J(s,n)}let o=mt(n),r=t.tag.toUpperCase();if(o&&o.nodeType===1&&o.nodeName===r){Gt(o,t.props||{});let y=W;if(W={parent:o,index:0},t.props?.dangerouslySetInnerHTML?.__html==null)for(let h of t.children)J(h,o);return W=y,o}lt()&&console.warn(`[what] Hydration mismatch: expected <${t.tag}>, got ${o?o.nodeName:"nothing"}. Falling back to client render.`);let i=document.createElement(t.tag);for(let y in t.props||{})y==="children"||y==="key"||Y(i,y,t.props[y]);for(let y of t.children)Q(i,y,null,null);return o?n.replaceChild(i,o):n.appendChild(i),i}if(xt(t))return t;let e=document.createTextNode(String(t));return n.appendChild(e),e}function Gt(t,n){for(let e in n){if(e==="children"||e==="key"||e==="ref"||e==="dangerouslySetInnerHTML"||e==="innerHTML")continue;let o=n[e];if(e.startsWith("on")&&e.length>2){let r=e.slice(2).toLowerCase();t.addEventListener(r,o);continue}if(e.startsWith("$$")){t[e]=o;continue}if(typeof o=="function"&&!e.startsWith("on")){e==="class"||e==="className"?D(()=>{t.className=o()||""}):e==="style"&&typeof o()=="object"?D(()=>{let r=o();for(let i in r)t.style[i]=r[i]??""}):D(()=>{Y(t,e,o())});continue}}}export{Zt as a,Jt as b,Tt as c,Qt as d,Et as e,Yt as f,It as g,kt as h,Y as i,Kt as j,Nt as k,Vt as l,Wt as m,Rt as n,Ft as o,vt as p,te as q,ee as r,ne as s};
|
|
2
|
-
//# sourceMappingURL=chunk-2IZMPODD.min.js.map
|