svelte-product-mockup 0.0.3 → 0.0.5
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/index.js +1485 -1427
- package/package.json +45 -43
- package/src/lib/components/MockupEditor.svelte +33 -0
- package/src/routes/+layout.svelte +1 -1
- package/dist/index.css +0 -1
package/dist/index.js
CHANGED
|
@@ -1,162 +1,162 @@
|
|
|
1
1
|
import "svelte/internal/disclose-version";
|
|
2
2
|
import * as e from "svelte/internal/client";
|
|
3
3
|
import { onMount as Te, tick as xt, onDestroy as kt, untrack as Ge } from "svelte";
|
|
4
|
-
import { fade as
|
|
4
|
+
import { fade as $e } from "svelte/transition";
|
|
5
5
|
import { beforeNavigate as Mt, pushState as Tt } from "$app/navigation";
|
|
6
|
-
import { browser as
|
|
7
|
-
function
|
|
8
|
-
const t = new Uint8ClampedArray(
|
|
6
|
+
import { browser as zt } from "$app/environment";
|
|
7
|
+
function St(o, n) {
|
|
8
|
+
const t = new Uint8ClampedArray(o.data), { brightness: a, contrast: r, saturation: s, hue: l, exposure: f, gamma: g, shadows: w, highlights: u, vibrance: h, temperature: m, tint: T } = n;
|
|
9
9
|
for (let v = 0; v < t.length; v += 4) {
|
|
10
|
-
let y = t[v], x = t[v + 1],
|
|
11
|
-
t[v + 3] !== 0 && (y =
|
|
10
|
+
let y = t[v], x = t[v + 1], N = t[v + 2];
|
|
11
|
+
t[v + 3] !== 0 && (y = Be(y, a), x = Be(x, a), N = Be(N, a), y = Ee(y, r), x = Ee(x, r), N = Ee(N, r), [y, x, N] = Nt(y, x, N, s), [y, x, N] = It(y, x, N, l), [y, x, N] = Ct(y, x, N, f), [y, x, N] = Pt(y, x, N, g), [y, x, N] = Rt(y, x, N, w, u), [y, x, N] = jt(y, x, N, h), [y, x, N] = Wt(y, x, N, m, T), t[v] = Ze(y), t[v + 1] = Ze(x), t[v + 2] = Ze(N));
|
|
12
12
|
}
|
|
13
|
-
return new ImageData(t,
|
|
13
|
+
return new ImageData(t, o.width, o.height);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
return
|
|
15
|
+
function Be(o, n) {
|
|
16
|
+
return o + n * 255;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return 259 * (
|
|
18
|
+
function Ee(o, n) {
|
|
19
|
+
return 259 * (n * 255 + 255) / (255 * (259 - n * 255)) * (o - 128) + 128;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
const
|
|
21
|
+
function Nt(o, n, t, a) {
|
|
22
|
+
const r = 0.299 * o + 0.587 * n + 0.114 * t, s = 1 + a;
|
|
23
23
|
return [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
r + s * (o - r),
|
|
25
|
+
r + s * (n - r),
|
|
26
|
+
r + s * (t - r)
|
|
27
27
|
];
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
1 / 3 * (1 -
|
|
33
|
-
1 / 3 * (1 -
|
|
34
|
-
1 / 3 * (1 -
|
|
35
|
-
|
|
36
|
-
1 / 3 * (1 -
|
|
37
|
-
1 / 3 * (1 -
|
|
38
|
-
1 / 3 * (1 -
|
|
39
|
-
|
|
29
|
+
function It(o, n, t, a) {
|
|
30
|
+
const r = a * Math.PI / 180, s = Math.cos(r), l = Math.sin(r), f = [
|
|
31
|
+
s + (1 - s) / 3,
|
|
32
|
+
1 / 3 * (1 - s) - Math.sqrt(1 / 3) * l,
|
|
33
|
+
1 / 3 * (1 - s) + Math.sqrt(1 / 3) * l,
|
|
34
|
+
1 / 3 * (1 - s) + Math.sqrt(1 / 3) * l,
|
|
35
|
+
s + 1 / 3 * (1 - s),
|
|
36
|
+
1 / 3 * (1 - s) - Math.sqrt(1 / 3) * l,
|
|
37
|
+
1 / 3 * (1 - s) - Math.sqrt(1 / 3) * l,
|
|
38
|
+
1 / 3 * (1 - s) + Math.sqrt(1 / 3) * l,
|
|
39
|
+
s + 1 / 3 * (1 - s)
|
|
40
40
|
];
|
|
41
41
|
return [
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
o * f[0] + n * f[1] + t * f[2],
|
|
43
|
+
o * f[3] + n * f[4] + t * f[5],
|
|
44
|
+
o * f[6] + n * f[7] + t * f[8]
|
|
45
45
|
];
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
const
|
|
49
|
-
return [
|
|
47
|
+
function Ct(o, n, t, a) {
|
|
48
|
+
const r = Math.pow(2, a);
|
|
49
|
+
return [o * r, n * r, t * r];
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
const
|
|
51
|
+
function Pt(o, n, t, a) {
|
|
52
|
+
const r = 1 / a;
|
|
53
53
|
return [
|
|
54
|
-
Math.pow(
|
|
55
|
-
Math.pow(
|
|
56
|
-
Math.pow(t / 255,
|
|
54
|
+
Math.pow(o / 255, r) * 255,
|
|
55
|
+
Math.pow(n / 255, r) * 255,
|
|
56
|
+
Math.pow(t / 255, r) * 255
|
|
57
57
|
];
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
const
|
|
59
|
+
function Rt(o, n, t, a, r) {
|
|
60
|
+
const s = 0.299 * o + 0.587 * n + 0.114 * t;
|
|
61
61
|
let l = 1;
|
|
62
|
-
return
|
|
62
|
+
return s < 128 ? l = 1 + a : l = 1 + r, [o * l, n * l, t * l];
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
const
|
|
66
|
-
return [
|
|
64
|
+
function jt(o, n, t, a) {
|
|
65
|
+
const r = Math.max(o, n, t), s = Math.min(o, n, t), l = r === 0 ? 0 : (r - s) / r, f = 1 + a * (1 - l);
|
|
66
|
+
return [o * f, n * f, t * f];
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
let
|
|
70
|
-
return
|
|
68
|
+
function Wt(o, n, t, a, r) {
|
|
69
|
+
let s = o, l = n, f = t;
|
|
70
|
+
return a > 0 ? (s += a * 0.1, f -= a * 0.1) : (s += a * 0.05, f -= a * 0.05), r > 0 ? (s += r * 0.1, l -= r * 0.05) : (s += r * 0.05, l -= r * 0.1), [s, l, f];
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
return Math.max(0, Math.min(255,
|
|
72
|
+
function Ze(o) {
|
|
73
|
+
return Math.max(0, Math.min(255, o));
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
const
|
|
75
|
+
function Dt(o, n, t) {
|
|
76
|
+
const a = o / n;
|
|
77
77
|
switch (t.mode) {
|
|
78
78
|
case "scale":
|
|
79
|
-
const
|
|
79
|
+
const r = t.scale ?? 1;
|
|
80
80
|
return {
|
|
81
|
-
width:
|
|
82
|
-
height:
|
|
81
|
+
width: o * r,
|
|
82
|
+
height: n * r,
|
|
83
83
|
sourceX: 0,
|
|
84
84
|
sourceY: 0,
|
|
85
|
-
sourceWidth:
|
|
86
|
-
sourceHeight:
|
|
85
|
+
sourceWidth: o,
|
|
86
|
+
sourceHeight: n
|
|
87
87
|
};
|
|
88
88
|
case "px":
|
|
89
|
-
let
|
|
89
|
+
let s = t.width ?? o, l = t.height ?? n;
|
|
90
90
|
if (t.maintainAspectRatio) {
|
|
91
|
-
if (
|
|
92
|
-
l =
|
|
93
|
-
else if (l && !
|
|
94
|
-
|
|
95
|
-
else if (
|
|
96
|
-
const
|
|
97
|
-
|
|
91
|
+
if (s && !l)
|
|
92
|
+
l = s / a;
|
|
93
|
+
else if (l && !s)
|
|
94
|
+
s = l * a;
|
|
95
|
+
else if (s && l) {
|
|
96
|
+
const I = Math.min(s / o, l / n);
|
|
97
|
+
s = o * I, l = n * I;
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
return t.minWidth && (
|
|
101
|
-
width:
|
|
100
|
+
return t.minWidth && (s = Math.max(s, t.minWidth)), t.maxWidth && (s = Math.min(s, t.maxWidth)), t.minHeight && (l = Math.max(l, t.minHeight)), t.maxHeight && (l = Math.min(l, t.maxHeight)), {
|
|
101
|
+
width: s,
|
|
102
102
|
height: l,
|
|
103
103
|
sourceX: 0,
|
|
104
104
|
sourceY: 0,
|
|
105
|
-
sourceWidth:
|
|
106
|
-
sourceHeight:
|
|
105
|
+
sourceWidth: o,
|
|
106
|
+
sourceHeight: n
|
|
107
107
|
};
|
|
108
108
|
case "fit":
|
|
109
|
-
const f = t.width ??
|
|
109
|
+
const f = t.width ?? o, g = t.height ?? n, w = Math.min(f / o, g / n);
|
|
110
110
|
return {
|
|
111
|
-
width:
|
|
112
|
-
height:
|
|
111
|
+
width: o * w,
|
|
112
|
+
height: n * w,
|
|
113
113
|
sourceX: 0,
|
|
114
114
|
sourceY: 0,
|
|
115
|
-
sourceWidth:
|
|
116
|
-
sourceHeight:
|
|
115
|
+
sourceWidth: o,
|
|
116
|
+
sourceHeight: n
|
|
117
117
|
};
|
|
118
118
|
case "fill":
|
|
119
|
-
const
|
|
119
|
+
const u = t.width ?? o, h = t.height ?? n, m = Math.max(u / o, h / n), T = u / m, v = h / m;
|
|
120
120
|
return {
|
|
121
|
-
width:
|
|
122
|
-
height:
|
|
123
|
-
sourceX: (
|
|
124
|
-
sourceY: (
|
|
121
|
+
width: u,
|
|
122
|
+
height: h,
|
|
123
|
+
sourceX: (o - T) / 2,
|
|
124
|
+
sourceY: (n - v) / 2,
|
|
125
125
|
sourceWidth: T,
|
|
126
126
|
sourceHeight: v
|
|
127
127
|
};
|
|
128
128
|
case "cover":
|
|
129
|
-
const y = t.width ??
|
|
129
|
+
const y = t.width ?? o, x = t.height ?? n;
|
|
130
130
|
return {
|
|
131
131
|
width: y,
|
|
132
132
|
height: x,
|
|
133
133
|
sourceX: 0,
|
|
134
134
|
sourceY: 0,
|
|
135
|
-
sourceWidth:
|
|
136
|
-
sourceHeight:
|
|
135
|
+
sourceWidth: o,
|
|
136
|
+
sourceHeight: n
|
|
137
137
|
};
|
|
138
138
|
case "contain":
|
|
139
|
-
const
|
|
139
|
+
const N = t.width ?? o, _ = t.height ?? n, k = Math.min(N / o, _ / n);
|
|
140
140
|
return {
|
|
141
|
-
width:
|
|
142
|
-
height:
|
|
141
|
+
width: o * k,
|
|
142
|
+
height: n * k,
|
|
143
143
|
sourceX: 0,
|
|
144
144
|
sourceY: 0,
|
|
145
|
-
sourceWidth:
|
|
146
|
-
sourceHeight:
|
|
145
|
+
sourceWidth: o,
|
|
146
|
+
sourceHeight: n
|
|
147
147
|
};
|
|
148
148
|
default:
|
|
149
149
|
return {
|
|
150
|
-
width:
|
|
151
|
-
height:
|
|
150
|
+
width: o,
|
|
151
|
+
height: n,
|
|
152
152
|
sourceX: 0,
|
|
153
153
|
sourceY: 0,
|
|
154
|
-
sourceWidth:
|
|
155
|
-
sourceHeight:
|
|
154
|
+
sourceWidth: o,
|
|
155
|
+
sourceHeight: n
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
const
|
|
159
|
+
const se = {
|
|
160
160
|
scale: 1,
|
|
161
161
|
translateX: 0,
|
|
162
162
|
translateY: 0
|
|
@@ -171,7 +171,7 @@ const ie = {
|
|
|
171
171
|
rotationX: 0,
|
|
172
172
|
rotationY: 0,
|
|
173
173
|
rotationZ: 0
|
|
174
|
-
},
|
|
174
|
+
}, ae = {
|
|
175
175
|
rotationX: 0,
|
|
176
176
|
rotationY: 0,
|
|
177
177
|
rotationZ: 0,
|
|
@@ -181,324 +181,324 @@ const ie = {
|
|
|
181
181
|
rotationX: 0,
|
|
182
182
|
rotationY: 0,
|
|
183
183
|
rotationZ: 0
|
|
184
|
-
},
|
|
184
|
+
}, Qe = {
|
|
185
185
|
type: "warp",
|
|
186
186
|
shape: "none",
|
|
187
187
|
enabled: !1,
|
|
188
188
|
quality: 1,
|
|
189
|
-
image: { ...
|
|
189
|
+
image: { ...se },
|
|
190
190
|
cylinder: { ...ce },
|
|
191
|
-
plane: { ...
|
|
191
|
+
plane: { ...ae },
|
|
192
192
|
sphere: { ...ke }
|
|
193
193
|
};
|
|
194
|
-
function
|
|
195
|
-
const t = new OffscreenCanvas(
|
|
194
|
+
function Xt(o) {
|
|
195
|
+
const t = new OffscreenCanvas(o.width, o.height).getContext("2d");
|
|
196
196
|
if (!t) throw new Error("Failed to create canvas context");
|
|
197
|
-
return t.drawImage(
|
|
197
|
+
return t.drawImage(o, 0, 0), t.getImageData(0, 0, o.width, o.height);
|
|
198
198
|
}
|
|
199
|
-
function
|
|
200
|
-
const
|
|
201
|
-
if (
|
|
199
|
+
function Yt(o, n, t) {
|
|
200
|
+
const a = o.width, r = o.height, s = o.data;
|
|
201
|
+
if (n < 0 || n >= a || t < 0 || t >= r)
|
|
202
202
|
return null;
|
|
203
|
-
const l = Math.floor(
|
|
204
|
-
const p = (
|
|
203
|
+
const l = Math.floor(n), f = Math.floor(t), g = Math.min(l + 1, a - 1), w = Math.min(f + 1, r - 1), u = n - l, h = t - f, m = (b, d) => {
|
|
204
|
+
const p = (d * a + b) * 4;
|
|
205
205
|
return {
|
|
206
|
-
r:
|
|
207
|
-
g:
|
|
208
|
-
b:
|
|
209
|
-
a:
|
|
206
|
+
r: s[p],
|
|
207
|
+
g: s[p + 1],
|
|
208
|
+
b: s[p + 2],
|
|
209
|
+
a: s[p + 3]
|
|
210
210
|
};
|
|
211
|
-
}, T = m(l, f), v = m(
|
|
212
|
-
return { r:
|
|
211
|
+
}, T = m(l, f), v = m(g, f), y = m(l, w), x = m(g, w), N = (b, d, p) => b + (d - b) * p, _ = N(N(T.r, v.r, u), N(y.r, x.r, u), h), k = N(N(T.g, v.g, u), N(y.g, x.g, u), h), I = N(N(T.b, v.b, u), N(y.b, x.b, u), h), z = N(N(T.a, v.a, u), N(y.a, x.a, u), h);
|
|
212
|
+
return { r: _, g: k, b: I, a: z };
|
|
213
213
|
}
|
|
214
|
-
function He(
|
|
215
|
-
const
|
|
216
|
-
minX: -
|
|
217
|
-
minY: -
|
|
218
|
-
maxX:
|
|
219
|
-
maxY:
|
|
220
|
-
}, v = T.maxX - T.minX, y = T.maxY - T.minY, x = Math.floor(v * l),
|
|
221
|
-
if (x <= 0 ||
|
|
222
|
-
const
|
|
223
|
-
for (let p = 0; p <
|
|
224
|
-
for (let
|
|
225
|
-
const c = T.minX +
|
|
226
|
-
if (!
|
|
214
|
+
function He(o, n, t, a, r, s, l, f, g, w) {
|
|
215
|
+
const u = Xt(n), h = w?.showDepthVis ?? !1, m = w?.maxZ ?? 500, T = g ?? {
|
|
216
|
+
minX: -r / 2,
|
|
217
|
+
minY: -s / 2,
|
|
218
|
+
maxX: r / 2,
|
|
219
|
+
maxY: s / 2
|
|
220
|
+
}, v = T.maxX - T.minX, y = T.maxY - T.minY, x = Math.floor(v * l), N = Math.floor(y * l);
|
|
221
|
+
if (x <= 0 || N <= 0) return;
|
|
222
|
+
const _ = new ImageData(x, N), k = _.data;
|
|
223
|
+
for (let p = 0; p < N; p++)
|
|
224
|
+
for (let i = 0; i < x; i++) {
|
|
225
|
+
const c = T.minX + i / l, M = T.minY + p / l, S = f(c, M);
|
|
226
|
+
if (!S || S.z <= 0)
|
|
227
227
|
continue;
|
|
228
|
-
const
|
|
229
|
-
if (
|
|
230
|
-
const J = Math.min(1, Math.max(0,
|
|
231
|
-
k[
|
|
228
|
+
const Y = (p * x + i) * 4;
|
|
229
|
+
if (h) {
|
|
230
|
+
const J = Math.min(1, Math.max(0, S.z / m)), B = Math.floor(J * 200 + 55);
|
|
231
|
+
k[Y] = Math.floor(B * 0.3), k[Y + 1] = Math.floor(B * 0.6), k[Y + 2] = B, k[Y + 3] = 200;
|
|
232
232
|
} else {
|
|
233
|
-
const { u: J, v:
|
|
234
|
-
U && (k[
|
|
233
|
+
const { u: J, v: B } = S, U = Yt(u, J, B);
|
|
234
|
+
U && (k[Y] = Math.round(U.r), k[Y + 1] = Math.round(U.g), k[Y + 2] = Math.round(U.b), k[Y + 3] = Math.round(U.a));
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
|
-
const
|
|
238
|
-
if (!
|
|
239
|
-
|
|
240
|
-
const
|
|
241
|
-
l !== 1 ?
|
|
237
|
+
const I = new OffscreenCanvas(x, N), z = I.getContext("2d");
|
|
238
|
+
if (!z) return;
|
|
239
|
+
z.putImageData(_, 0, 0);
|
|
240
|
+
const b = t + T.minX, d = a + T.minY;
|
|
241
|
+
l !== 1 ? o.drawImage(I, b, d, v, y) : o.drawImage(I, b, d);
|
|
242
242
|
}
|
|
243
|
-
function Ae(
|
|
244
|
-
if (!("save" in
|
|
245
|
-
const
|
|
246
|
-
|
|
243
|
+
function Ae(o, n, t, a = 20) {
|
|
244
|
+
if (!("save" in o)) return;
|
|
245
|
+
const r = o;
|
|
246
|
+
r.save(), r.strokeStyle = "#00ff00", r.lineWidth = 2, r.beginPath(), r.moveTo(n - a, t), r.lineTo(n + a, t), r.stroke(), r.beginPath(), r.moveTo(n, t - a), r.lineTo(n, t + a), r.stroke(), r.fillStyle = "#00ff00", r.beginPath(), r.arc(n, t, 3, 0, Math.PI * 2), r.fill(), r.restore();
|
|
247
247
|
}
|
|
248
|
-
function
|
|
249
|
-
const l = Math.cos(
|
|
250
|
-
let m =
|
|
251
|
-
if (
|
|
248
|
+
function oe(o, n, t, a, r, s) {
|
|
249
|
+
const l = Math.cos(a), f = Math.sin(a), g = Math.cos(r), w = Math.sin(r), u = Math.cos(s), h = Math.sin(s);
|
|
250
|
+
let m = o, T = n, v = t;
|
|
251
|
+
if (s !== 0) {
|
|
252
252
|
const y = m, x = T;
|
|
253
|
-
m = y *
|
|
253
|
+
m = y * u - x * h, T = y * h + x * u;
|
|
254
254
|
}
|
|
255
|
-
if (
|
|
255
|
+
if (r !== 0) {
|
|
256
256
|
const y = m, x = v;
|
|
257
|
-
m = y *
|
|
257
|
+
m = y * g + x * w, v = -y * w + x * g;
|
|
258
258
|
}
|
|
259
|
-
if (
|
|
259
|
+
if (a !== 0) {
|
|
260
260
|
const y = T, x = v;
|
|
261
261
|
T = y * l - x * f, v = y * f + x * l;
|
|
262
262
|
}
|
|
263
263
|
return [m, T, v];
|
|
264
264
|
}
|
|
265
|
-
function
|
|
266
|
-
const l = Math.cos(
|
|
267
|
-
let m =
|
|
268
|
-
if (
|
|
265
|
+
function qt(o, n, t, a, r, s) {
|
|
266
|
+
const l = Math.cos(a), f = Math.sin(a), g = Math.cos(r), w = Math.sin(r), u = Math.cos(s), h = Math.sin(s);
|
|
267
|
+
let m = o, T = n, v = t;
|
|
268
|
+
if (a !== 0) {
|
|
269
269
|
const y = T, x = v;
|
|
270
270
|
T = y * l + x * f, v = -y * f + x * l;
|
|
271
271
|
}
|
|
272
|
-
if (
|
|
272
|
+
if (r !== 0) {
|
|
273
273
|
const y = m, x = v;
|
|
274
|
-
m = y *
|
|
274
|
+
m = y * g - x * w, v = y * w + x * g;
|
|
275
275
|
}
|
|
276
|
-
if (
|
|
276
|
+
if (s !== 0) {
|
|
277
277
|
const y = m, x = T;
|
|
278
|
-
m = y *
|
|
278
|
+
m = y * u + x * h, T = -y * h + x * u;
|
|
279
279
|
}
|
|
280
280
|
return [m, T, v];
|
|
281
281
|
}
|
|
282
|
-
function
|
|
283
|
-
if (!("save" in
|
|
284
|
-
const l =
|
|
282
|
+
function Bt(o, n, t, a, r, s) {
|
|
283
|
+
if (!("save" in o)) return;
|
|
284
|
+
const l = o;
|
|
285
285
|
l.save(), l.strokeStyle = "#ff6600", l.lineWidth = 1.5, l.setLineDash([4, 6]);
|
|
286
|
-
const f = 50,
|
|
287
|
-
for (let w = -
|
|
288
|
-
const
|
|
286
|
+
const f = 50, g = 3;
|
|
287
|
+
for (let w = -g; w <= g; w++) {
|
|
288
|
+
const u = w * f, h = [];
|
|
289
289
|
for (let m = -10; m <= 10; m++) {
|
|
290
|
-
const T = m * f, v =
|
|
291
|
-
v &&
|
|
290
|
+
const T = m * f, v = s(u, T);
|
|
291
|
+
v && h.push({ x: n + v.x, y: t + v.y });
|
|
292
292
|
}
|
|
293
|
-
if (
|
|
294
|
-
l.beginPath(), l.moveTo(
|
|
295
|
-
for (let m = 1; m <
|
|
296
|
-
l.lineTo(
|
|
293
|
+
if (h.length > 1) {
|
|
294
|
+
l.beginPath(), l.moveTo(h[0].x, h[0].y);
|
|
295
|
+
for (let m = 1; m < h.length; m++)
|
|
296
|
+
l.lineTo(h[m].x, h[m].y);
|
|
297
297
|
l.stroke();
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
|
-
for (let w = -
|
|
301
|
-
const
|
|
300
|
+
for (let w = -g; w <= g; w++) {
|
|
301
|
+
const u = w * f, h = [];
|
|
302
302
|
for (let m = -10; m <= 10; m++) {
|
|
303
|
-
const T = m * f, v =
|
|
304
|
-
v &&
|
|
303
|
+
const T = m * f, v = s(T, u);
|
|
304
|
+
v && h.push({ x: n + v.x, y: t + v.y });
|
|
305
305
|
}
|
|
306
|
-
if (
|
|
307
|
-
l.beginPath(), l.moveTo(
|
|
308
|
-
for (let m = 1; m <
|
|
309
|
-
l.lineTo(
|
|
306
|
+
if (h.length > 1) {
|
|
307
|
+
l.beginPath(), l.moveTo(h[0].x, h[0].y);
|
|
308
|
+
for (let m = 1; m < h.length; m++)
|
|
309
|
+
l.lineTo(h[m].x, h[m].y);
|
|
310
310
|
l.stroke();
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
313
|
l.restore();
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
if (!("save" in
|
|
317
|
-
const
|
|
318
|
-
|
|
319
|
-
const w = Math.sin(
|
|
320
|
-
let
|
|
321
|
-
const m = (p,
|
|
322
|
-
const M =
|
|
315
|
+
function Et(o, n, t, a, r, s, l, f) {
|
|
316
|
+
if (!("save" in o)) return;
|
|
317
|
+
const g = o;
|
|
318
|
+
g.save(), g.lineWidth = 2, g.setLineDash([6, 4]);
|
|
319
|
+
const w = Math.sin(s);
|
|
320
|
+
let u = 1 / 0, h = -1 / 0;
|
|
321
|
+
const m = (p, i, c) => {
|
|
322
|
+
const M = i * w, S = f / (f + M);
|
|
323
323
|
return {
|
|
324
|
-
x:
|
|
325
|
-
y: t +
|
|
324
|
+
x: n + p * S,
|
|
325
|
+
y: t + i * S,
|
|
326
326
|
z: c
|
|
327
327
|
};
|
|
328
|
-
}, T = (p,
|
|
329
|
-
const M = c -
|
|
328
|
+
}, T = (p, i, c) => {
|
|
329
|
+
const M = c - i;
|
|
330
330
|
if (M < 1e-3) return "#ff6600";
|
|
331
|
-
const
|
|
332
|
-
return `rgb(${
|
|
333
|
-
}, v = 32, y = [], x = [],
|
|
331
|
+
const S = (p - i) / M, Y = Math.round(100 + S * 155), J = Math.round(30 + S * 70), B = Math.round(0 + S * 0);
|
|
332
|
+
return `rgb(${Y},${J},${B})`;
|
|
333
|
+
}, v = 32, y = [], x = [], N = [], _ = [], k = s > 0.01 ? -Math.PI / 2 : 0, I = s > 0.01 ? Math.PI / 2 : Math.PI * 2, z = s < -0.01 ? -Math.PI / 2 : 0, b = s < -0.01 ? Math.PI / 2 : Math.PI * 2;
|
|
334
334
|
for (let p = 0; p <= v; p++) {
|
|
335
|
-
const
|
|
336
|
-
y.push(
|
|
335
|
+
const i = p / v, c = k + i * (I - k), M = Math.sin(c) * a, S = Math.cos(c) * a, Y = -r / 2, [J, B, U] = oe(M, Y, S, s, 0, l), j = m(J, B, U);
|
|
336
|
+
y.push(j), u = Math.min(u, U), h = Math.max(h, U);
|
|
337
337
|
}
|
|
338
338
|
for (let p = 0; p <= v; p++) {
|
|
339
|
-
const
|
|
340
|
-
x.push(
|
|
339
|
+
const i = p / v, c = z + i * (b - z), M = Math.sin(c) * a, S = Math.cos(c) * a, Y = r / 2, [J, B, U] = oe(M, Y, S, s, 0, l), j = m(J, B, U);
|
|
340
|
+
x.push(j), u = Math.min(u, U), h = Math.max(h, U);
|
|
341
341
|
}
|
|
342
342
|
for (let p = 0; p <= 10; p++) {
|
|
343
|
-
const
|
|
344
|
-
|
|
345
|
-
const [J,
|
|
346
|
-
|
|
347
|
-
}
|
|
348
|
-
const
|
|
349
|
-
for (let
|
|
350
|
-
const c = p[
|
|
351
|
-
|
|
343
|
+
const i = p / 10, c = -r / 2 + i * r, [M, S, Y] = oe(-a, c, 0, s, 0, l);
|
|
344
|
+
N.push(m(M, S, Y)), u = Math.min(u, Y), h = Math.max(h, Y);
|
|
345
|
+
const [J, B, U] = oe(a, c, 0, s, 0, l);
|
|
346
|
+
_.push(m(J, B, U)), u = Math.min(u, U), h = Math.max(h, U);
|
|
347
|
+
}
|
|
348
|
+
const d = (p) => {
|
|
349
|
+
for (let i = 0; i < p.length - 1; i++) {
|
|
350
|
+
const c = p[i], M = p[i + 1], S = (c.z + M.z) / 2;
|
|
351
|
+
g.strokeStyle = T(S, u, h), g.beginPath(), g.moveTo(c.x, c.y), g.lineTo(M.x, M.y), g.stroke();
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
|
|
354
|
+
d(y), d(x), d(N), d(_), g.restore();
|
|
355
355
|
}
|
|
356
|
-
function
|
|
357
|
-
const { diameter:
|
|
358
|
-
let
|
|
356
|
+
function Zt(o, n, t, a, r, s, l, f, g, w) {
|
|
357
|
+
const { diameter: u, perspective: h, rotationX: m, rotationZ: T } = l, v = u / 2, y = m * Math.PI / 180, x = T * Math.PI / 180, N = Math.abs(y) > 1e-3, _ = h ?? 1, k = _ > 0.01 ? v * (10 / _) : v * 1e3, I = f.scale, z = f.translateX, b = f.translateY;
|
|
358
|
+
let d = {
|
|
359
359
|
minX: -v,
|
|
360
|
-
minY: -
|
|
360
|
+
minY: -s / 2,
|
|
361
361
|
maxX: v,
|
|
362
|
-
maxY:
|
|
362
|
+
maxY: s / 2
|
|
363
363
|
};
|
|
364
|
-
if (
|
|
364
|
+
if (N) {
|
|
365
365
|
const c = [
|
|
366
|
-
{ x: -v, y: -
|
|
367
|
-
{ x: v, y: -
|
|
368
|
-
{ x: v, y:
|
|
369
|
-
{ x: -v, y:
|
|
366
|
+
{ x: -v, y: -s / 2 },
|
|
367
|
+
{ x: v, y: -s / 2 },
|
|
368
|
+
{ x: v, y: s / 2 },
|
|
369
|
+
{ x: -v, y: s / 2 }
|
|
370
370
|
], M = [];
|
|
371
|
-
for (const
|
|
372
|
-
const [J,
|
|
373
|
-
M.push({ x: J *
|
|
374
|
-
const [E, O
|
|
375
|
-
M.push({ x:
|
|
371
|
+
for (const Y of c) {
|
|
372
|
+
const [J, B, U] = oe(Y.x, Y.y, v, y, 0, x), j = k / (k + U);
|
|
373
|
+
M.push({ x: J * j, y: B * j });
|
|
374
|
+
const [q, E, O] = oe(Y.x, Y.y, 0, y, 0, x), Z = k / (k + O);
|
|
375
|
+
M.push({ x: q * Z, y: E * Z });
|
|
376
376
|
}
|
|
377
|
-
const
|
|
378
|
-
M.length > 0 && (
|
|
379
|
-
minX: Math.min(...M.map((
|
|
380
|
-
minY: Math.min(...M.map((
|
|
381
|
-
maxX: Math.max(...M.map((
|
|
382
|
-
maxY: Math.max(...M.map((
|
|
377
|
+
const S = v * Math.abs(Math.sin(y));
|
|
378
|
+
M.length > 0 && (d = {
|
|
379
|
+
minX: Math.min(...M.map((Y) => Y.x)) - 2,
|
|
380
|
+
minY: Math.min(...M.map((Y) => Y.y)) - S - 2,
|
|
381
|
+
maxX: Math.max(...M.map((Y) => Y.x)) + 2,
|
|
382
|
+
maxY: Math.max(...M.map((Y) => Y.y)) + S + 2
|
|
383
383
|
});
|
|
384
384
|
}
|
|
385
385
|
const p = (c, M) => {
|
|
386
|
-
const
|
|
387
|
-
if (Math.abs(
|
|
388
|
-
const K = Math.sqrt(v * v -
|
|
386
|
+
const S = Math.cos(x), Y = Math.sin(x), J = c * S + M * Y, B = -c * Y + M * S, U = Math.cos(y), j = Math.sin(y), q = B * j, E = k / (k + q), O = J / E, Z = B / E;
|
|
387
|
+
if (Math.abs(O) > v) return null;
|
|
388
|
+
const K = Math.sqrt(v * v - O * O);
|
|
389
389
|
if (Math.abs(U) < 0.01) return null;
|
|
390
|
-
const H = (
|
|
390
|
+
const H = (Z + K * j) / U, G = H * j + K * U;
|
|
391
391
|
if (G < 0) return null;
|
|
392
|
-
const
|
|
393
|
-
return V >= 0 && V <= 1 && A >= 0 && A <= 1 ? { u: V *
|
|
394
|
-
},
|
|
395
|
-
w.showBounds &&
|
|
392
|
+
const W = Math.asin(O / v) * v / r + 0.5, P = H / s + 0.5, V = (W - 0.5 - z) / I + 0.5, A = (P - 0.5 - b) / I + 0.5;
|
|
393
|
+
return V >= 0 && V <= 1 && A >= 0 && A <= 1 ? { u: V * n.width, v: A * n.height, z: G } : null;
|
|
394
|
+
}, i = w.showDepthVis ? { showDepthVis: !0, maxZ: v } : void 0;
|
|
395
|
+
w.showBounds && Et(o, t, a, v, s, y, x, k), He(o, n, t, a, r, s, g, p, d, i), w.showCrosshair && Ae(o, t, a);
|
|
396
396
|
}
|
|
397
|
-
function
|
|
398
|
-
const { rotationX:
|
|
399
|
-
const [
|
|
400
|
-
if (
|
|
401
|
-
const
|
|
402
|
-
return { x: K, y: H, z:
|
|
397
|
+
function Ot(o, n, t, a, r, s, l, f, g, w) {
|
|
398
|
+
const { rotationX: u, rotationY: h, rotationZ: m, depthScale: T } = l, v = u * (Math.PI / 180), y = h * (Math.PI / 180), x = m * (Math.PI / 180), N = Math.abs(v) > 1e-3 || Math.abs(y) > 1e-3 || Math.abs(x) > 1e-3, _ = f.scale, k = f.translateX, I = f.translateY, z = T * 1e-3, b = z > 1e-4 ? 1 / z : 1e4, d = (B, U) => {
|
|
399
|
+
const [j, q, E] = oe(B, U, 0, v, y, x), O = E + b;
|
|
400
|
+
if (O <= 0) return null;
|
|
401
|
+
const Z = b / O, K = j * Z, H = q * Z;
|
|
402
|
+
return { x: K, y: H, z: E };
|
|
403
403
|
};
|
|
404
|
-
let p = -
|
|
405
|
-
if (
|
|
406
|
-
const
|
|
407
|
-
for (let
|
|
408
|
-
const
|
|
409
|
-
|
|
410
|
-
const
|
|
411
|
-
|
|
412
|
-
const K = -
|
|
413
|
-
H &&
|
|
414
|
-
const G =
|
|
415
|
-
G &&
|
|
404
|
+
let p = -r / 2, i = r / 2, c = -s / 2, M = s / 2;
|
|
405
|
+
if (N) {
|
|
406
|
+
const B = [];
|
|
407
|
+
for (let j = 0; j <= 10; j++) {
|
|
408
|
+
const q = j / 10, E = -r / 2 + q * r, O = d(E, -s / 2);
|
|
409
|
+
O && B.push({ x: O.x, y: O.y });
|
|
410
|
+
const Z = d(E, s / 2);
|
|
411
|
+
Z && B.push({ x: Z.x, y: Z.y });
|
|
412
|
+
const K = -s / 2 + q * s, H = d(-r / 2, K);
|
|
413
|
+
H && B.push({ x: H.x, y: H.y });
|
|
414
|
+
const G = d(r / 2, K);
|
|
415
|
+
G && B.push({ x: G.x, y: G.y });
|
|
416
416
|
}
|
|
417
|
-
if (
|
|
418
|
-
p = Math.min(...
|
|
419
|
-
const
|
|
420
|
-
p -=
|
|
417
|
+
if (B.length > 0) {
|
|
418
|
+
p = Math.min(...B.map((Z) => Z.x)), i = Math.max(...B.map((Z) => Z.x)), c = Math.min(...B.map((Z) => Z.y)), M = Math.max(...B.map((Z) => Z.y));
|
|
419
|
+
const j = Math.sqrt(v * v + y * y + x * x), q = 2, E = j * Math.max(r, s) * 0.1, O = q + E;
|
|
420
|
+
p -= O, i += O, c -= O, M += O;
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
|
-
const
|
|
424
|
-
if (!
|
|
425
|
-
const
|
|
423
|
+
const S = { minX: p, minY: c, maxX: i, maxY: M }, Y = (B, U) => {
|
|
424
|
+
if (!N) {
|
|
425
|
+
const Ne = B / r + 0.5, je = U / s + 0.5, me = (Ne - 0.5 - k) / _ + 0.5, ye = (je - 0.5 - I) / _ + 0.5;
|
|
426
426
|
return me >= 0 && me <= 1 && ye >= 0 && ye <= 1 ? {
|
|
427
|
-
u: me *
|
|
428
|
-
v: ye *
|
|
427
|
+
u: me * n.width,
|
|
428
|
+
v: ye * n.height,
|
|
429
429
|
z: 1
|
|
430
430
|
} : null;
|
|
431
431
|
}
|
|
432
|
-
const [
|
|
433
|
-
if (Math.abs(
|
|
432
|
+
const [j, q, E] = oe(0, 0, 1, v, y, x), O = 0, Z = 0, K = 0, H = -b, G = B - Z, D = U - K, X = 0 - H, W = Math.sqrt(G * G + D * D + X * X), P = G / W, V = D / W, A = X / W, de = P * j + V * q + A * E;
|
|
433
|
+
if (Math.abs(de) < 1e-4)
|
|
434
434
|
return null;
|
|
435
|
-
const
|
|
436
|
-
if (
|
|
435
|
+
const ie = -(Z * j + K * q + H * E + O) / de;
|
|
436
|
+
if (ie < 0)
|
|
437
437
|
return null;
|
|
438
|
-
const
|
|
438
|
+
const ge = Z + P * ie, he = K + V * ie, le = H + A * ie;
|
|
439
439
|
if (le < H)
|
|
440
440
|
return null;
|
|
441
|
-
const [
|
|
442
|
-
return
|
|
443
|
-
u:
|
|
444
|
-
v: pe *
|
|
445
|
-
z:
|
|
441
|
+
const [be, Re] = qt(ge, he, le, v, y, x), ze = be / r + 0.5, ue = Re / s + 0.5, Se = le + b, _e = (ze - 0.5 - k) / _ + 0.5, pe = (ue - 0.5 - I) / _ + 0.5;
|
|
442
|
+
return _e >= 0 && _e <= 1 && pe >= 0 && pe <= 1 ? {
|
|
443
|
+
u: _e * n.width,
|
|
444
|
+
v: pe * n.height,
|
|
445
|
+
z: Se
|
|
446
446
|
} : null;
|
|
447
|
-
}, J = w.showDepthVis ? { showDepthVis: !0, maxZ:
|
|
448
|
-
w.showBounds &&
|
|
447
|
+
}, J = w.showDepthVis ? { showDepthVis: !0, maxZ: b * 0.5 } : void 0;
|
|
448
|
+
w.showBounds && Bt(o, t, a, r, s, d), He(o, n, t, a, r, s, g, Y, S, J), w.showCrosshair && Ae(o, t, a);
|
|
449
449
|
}
|
|
450
|
-
function
|
|
451
|
-
if (!("save" in
|
|
452
|
-
const
|
|
453
|
-
if (
|
|
454
|
-
|
|
455
|
-
const l = Math.cos(
|
|
456
|
-
|
|
457
|
-
}
|
|
458
|
-
|
|
450
|
+
function Lt(o, n, t, a, r) {
|
|
451
|
+
if (!("save" in o)) return;
|
|
452
|
+
const s = o;
|
|
453
|
+
if (s.save(), s.strokeStyle = "#ff6600", s.lineWidth = 2, s.setLineDash([6, 4]), s.beginPath(), s.arc(n, t, a, 0, Math.PI * 2), s.stroke(), s.beginPath(), s.moveTo(n - a, t), s.lineTo(n + a, t), s.stroke(), s.beginPath(), s.moveTo(n, t - a), s.lineTo(n, t + a), s.stroke(), s.beginPath(), s.moveTo(n - a, t - a), s.lineTo(n - a, t + a), s.stroke(), s.beginPath(), s.moveTo(n + a, t - a), s.lineTo(n + a, t + a), s.stroke(), Math.abs(r) > 1e-3) {
|
|
454
|
+
s.strokeStyle = "#ffaa00";
|
|
455
|
+
const l = Math.cos(r), f = Math.sin(r), g = a * 0.7;
|
|
456
|
+
s.beginPath(), s.moveTo(n + l * g, t + f * g), s.lineTo(n - l * g, t - f * g), s.stroke(), s.beginPath(), s.moveTo(n - f * g, t + l * g), s.lineTo(n + f * g, t - l * g), s.stroke();
|
|
457
|
+
}
|
|
458
|
+
s.restore();
|
|
459
459
|
}
|
|
460
|
-
function Ht(
|
|
461
|
-
const { radius:
|
|
462
|
-
minX: -
|
|
463
|
-
minY: -
|
|
464
|
-
maxX:
|
|
465
|
-
maxY:
|
|
466
|
-
},
|
|
467
|
-
const
|
|
468
|
-
if (
|
|
469
|
-
const
|
|
470
|
-
return J >= 0 && J <= 1 &&
|
|
471
|
-
u: J *
|
|
472
|
-
v:
|
|
473
|
-
z:
|
|
460
|
+
function Ht(o, n, t, a, r, s, l, f, g, w) {
|
|
461
|
+
const { radius: u, rotationZ: h } = l, m = h * (Math.PI / 180), T = f.scale, v = f.translateX, y = f.translateY, x = {
|
|
462
|
+
minX: -u,
|
|
463
|
+
minY: -u,
|
|
464
|
+
maxX: u,
|
|
465
|
+
maxY: u
|
|
466
|
+
}, N = (k, I) => {
|
|
467
|
+
const z = Math.sqrt(k * k + I * I);
|
|
468
|
+
if (z > u) return null;
|
|
469
|
+
const b = Math.sqrt(u * u - k * k - I * I), p = Math.asin(z / u) * u, i = Math.atan2(I, k) - m, c = p * Math.cos(i), M = p * Math.sin(i), S = c / r + 0.5, Y = M / s + 0.5, J = (S - 0.5 - v) / T + 0.5, B = (Y - 0.5 - y) / T + 0.5;
|
|
470
|
+
return J >= 0 && J <= 1 && B >= 0 && B <= 1 ? {
|
|
471
|
+
u: J * n.width,
|
|
472
|
+
v: B * n.height,
|
|
473
|
+
z: b
|
|
474
474
|
} : null;
|
|
475
|
-
},
|
|
476
|
-
w.showBounds &&
|
|
475
|
+
}, _ = w.showDepthVis ? { showDepthVis: !0, maxZ: u } : void 0;
|
|
476
|
+
w.showBounds && Lt(o, t, a, u, m), He(o, n, t, a, r, s, g, N, x, _), w.showCrosshair && Ae(o, t, a);
|
|
477
477
|
}
|
|
478
|
-
function At(
|
|
479
|
-
|
|
478
|
+
function At(o, n, t, a, r, s, l) {
|
|
479
|
+
o.drawImage(n, t - r / 2, a - s / 2, r, s);
|
|
480
480
|
}
|
|
481
|
-
function Ut(
|
|
481
|
+
function Ut(o, n, t, a, r, s, l) {
|
|
482
482
|
if (!l.enabled || l.shape === "none") {
|
|
483
|
-
|
|
483
|
+
o.drawImage(n, t - r / 2, a - s / 2, r, s);
|
|
484
484
|
return;
|
|
485
485
|
}
|
|
486
|
-
const f = l.quality ?? 1,
|
|
486
|
+
const f = l.quality ?? 1, g = l.image ?? se, w = l.debug ?? ve;
|
|
487
487
|
switch (l.shape) {
|
|
488
488
|
case "cylinder":
|
|
489
|
-
l.cylinder &&
|
|
489
|
+
l.cylinder && Zt(o, n, t, a, r, s, l.cylinder, g, f, w);
|
|
490
490
|
break;
|
|
491
491
|
case "plane":
|
|
492
|
-
l.plane &&
|
|
492
|
+
l.plane && Ot(o, n, t, a, r, s, l.plane, g, f, w);
|
|
493
493
|
break;
|
|
494
494
|
case "sphere":
|
|
495
|
-
l.sphere && Ht(
|
|
495
|
+
l.sphere && Ht(o, n, t, a, r, s, l.sphere, g, f, w);
|
|
496
496
|
break;
|
|
497
497
|
case "custom":
|
|
498
|
-
l.custom && At(
|
|
498
|
+
l.custom && At(o, n, t, a, r, s, l.custom);
|
|
499
499
|
break;
|
|
500
500
|
default:
|
|
501
|
-
|
|
501
|
+
o.drawImage(n, t - r / 2, a - s / 2, r, s);
|
|
502
502
|
}
|
|
503
503
|
}
|
|
504
504
|
const ee = {
|
|
@@ -520,14 +520,14 @@ const ee = {
|
|
|
520
520
|
scale: 1,
|
|
521
521
|
maintainAspectRatio: !0
|
|
522
522
|
};
|
|
523
|
-
function et(
|
|
524
|
-
let t =
|
|
525
|
-
const
|
|
526
|
-
for (const l of
|
|
523
|
+
function et(o, n) {
|
|
524
|
+
let t = o, a = o.width, r = o.height;
|
|
525
|
+
const s = Vt(n);
|
|
526
|
+
for (const l of s)
|
|
527
527
|
switch (l.type) {
|
|
528
528
|
case "resize":
|
|
529
|
-
const f =
|
|
530
|
-
|
|
529
|
+
const f = Dt(a, r, l);
|
|
530
|
+
a = f.width, r = f.height;
|
|
531
531
|
break;
|
|
532
532
|
case "restyle":
|
|
533
533
|
t = Ft(t, l);
|
|
@@ -535,35 +535,35 @@ function et(r, a) {
|
|
|
535
535
|
}
|
|
536
536
|
return {
|
|
537
537
|
image: t,
|
|
538
|
-
width:
|
|
539
|
-
height:
|
|
538
|
+
width: a,
|
|
539
|
+
height: r
|
|
540
540
|
};
|
|
541
541
|
}
|
|
542
|
-
function Vt(
|
|
543
|
-
const
|
|
544
|
-
return
|
|
545
|
-
const
|
|
546
|
-
return
|
|
542
|
+
function Vt(o) {
|
|
543
|
+
const n = ["resize", "restyle", "warp"];
|
|
544
|
+
return o.sort((t, a) => {
|
|
545
|
+
const r = n.indexOf(t.type), s = n.indexOf(a.type);
|
|
546
|
+
return r - s;
|
|
547
547
|
});
|
|
548
548
|
}
|
|
549
|
-
function Ft(
|
|
550
|
-
const t = new OffscreenCanvas(
|
|
551
|
-
if (!
|
|
552
|
-
|
|
553
|
-
const
|
|
554
|
-
return
|
|
549
|
+
function Ft(o, n) {
|
|
550
|
+
const t = new OffscreenCanvas(o.width, o.height), a = t.getContext("2d");
|
|
551
|
+
if (!a) return o;
|
|
552
|
+
a.drawImage(o, 0, 0);
|
|
553
|
+
const r = a.getImageData(0, 0, o.width, o.height), s = St(r, n);
|
|
554
|
+
return a.putImageData(s, 0, 0), t.transferToImageBitmap();
|
|
555
555
|
}
|
|
556
|
-
class
|
|
556
|
+
class nt {
|
|
557
557
|
latestInput = null;
|
|
558
558
|
rafPending = !1;
|
|
559
559
|
timeoutId = null;
|
|
560
560
|
onFlush;
|
|
561
561
|
TRAILING_MS = 32;
|
|
562
|
-
constructor(
|
|
563
|
-
this.onFlush =
|
|
562
|
+
constructor(n) {
|
|
563
|
+
this.onFlush = n;
|
|
564
564
|
}
|
|
565
|
-
queue(
|
|
566
|
-
this.latestInput =
|
|
565
|
+
queue(n) {
|
|
566
|
+
this.latestInput = n, this.timeoutId !== null && clearTimeout(this.timeoutId), this.rafPending || (this.rafPending = !0, requestAnimationFrame(() => {
|
|
567
567
|
this.rafPending = !1, this.flush();
|
|
568
568
|
})), this.timeoutId = setTimeout(() => {
|
|
569
569
|
this.timeoutId = null, this.flush();
|
|
@@ -572,8 +572,8 @@ class at {
|
|
|
572
572
|
flush() {
|
|
573
573
|
if (this.latestInput === null) return;
|
|
574
574
|
this.timeoutId !== null && (clearTimeout(this.timeoutId), this.timeoutId = null);
|
|
575
|
-
const
|
|
576
|
-
this.latestInput = null, this.onFlush(
|
|
575
|
+
const n = this.latestInput;
|
|
576
|
+
this.latestInput = null, this.onFlush(n);
|
|
577
577
|
}
|
|
578
578
|
destroy() {
|
|
579
579
|
this.timeoutId !== null && (clearTimeout(this.timeoutId), this.timeoutId = null), this.latestInput = null;
|
|
@@ -587,8 +587,8 @@ class Kt {
|
|
|
587
587
|
frameId = 0;
|
|
588
588
|
lastCompletedId = 0;
|
|
589
589
|
options;
|
|
590
|
-
constructor(
|
|
591
|
-
this.options =
|
|
590
|
+
constructor(n) {
|
|
591
|
+
this.options = n, this.batcher = new nt((t) => this.submitToWorker(t)), this.initWorker();
|
|
592
592
|
}
|
|
593
593
|
initWorker() {
|
|
594
594
|
try {
|
|
@@ -599,55 +599,55 @@ class Kt {
|
|
|
599
599
|
import.meta.url
|
|
600
600
|
),
|
|
601
601
|
{ type: "module" }
|
|
602
|
-
), this.worker.onmessage = (
|
|
603
|
-
this.handleWorkerMessage(
|
|
604
|
-
}, this.worker.onerror = (
|
|
605
|
-
console.error("Worker error:",
|
|
602
|
+
), this.worker.onmessage = (n) => {
|
|
603
|
+
this.handleWorkerMessage(n.data);
|
|
604
|
+
}, this.worker.onerror = (n) => {
|
|
605
|
+
console.error("Worker error:", n), this.options.onError?.(`Worker error: ${n.message}`);
|
|
606
606
|
};
|
|
607
|
-
} catch (
|
|
608
|
-
console.error("Failed to create worker:",
|
|
607
|
+
} catch (n) {
|
|
608
|
+
console.error("Failed to create worker:", n), this.options.onError?.("Failed to create render worker");
|
|
609
609
|
}
|
|
610
610
|
}
|
|
611
|
-
request(
|
|
612
|
-
this.batcher.queue(
|
|
611
|
+
request(n) {
|
|
612
|
+
this.batcher.queue(n);
|
|
613
613
|
}
|
|
614
|
-
submitToWorker(
|
|
615
|
-
const t = ++this.frameId,
|
|
616
|
-
...
|
|
614
|
+
submitToWorker(n) {
|
|
615
|
+
const t = ++this.frameId, a = {
|
|
616
|
+
...n,
|
|
617
617
|
id: t
|
|
618
618
|
};
|
|
619
|
-
this.isWorking ? this.pendingRequest =
|
|
619
|
+
this.isWorking ? this.pendingRequest = a : this.sendToWorker(a);
|
|
620
620
|
}
|
|
621
|
-
sendToWorker(
|
|
621
|
+
sendToWorker(n) {
|
|
622
622
|
if (!this.worker) return;
|
|
623
623
|
this.isWorking = !0;
|
|
624
|
-
const t = { type: "render", payload:
|
|
625
|
-
this.worker.postMessage(t,
|
|
624
|
+
const t = { type: "render", payload: n }, a = n.images.filter((r) => r instanceof ImageBitmap);
|
|
625
|
+
this.worker.postMessage(t, a);
|
|
626
626
|
}
|
|
627
|
-
handleWorkerMessage(
|
|
628
|
-
if (
|
|
629
|
-
console.error("Render error:",
|
|
627
|
+
handleWorkerMessage(n) {
|
|
628
|
+
if (n.type === "error") {
|
|
629
|
+
console.error("Render error:", n.payload.error), this.isWorking = !1, this.processNext();
|
|
630
630
|
return;
|
|
631
631
|
}
|
|
632
|
-
const { id: t, result:
|
|
632
|
+
const { id: t, result: a, frameTime: r } = n.payload;
|
|
633
633
|
if (this.isWorking = !1, t <= this.lastCompletedId) {
|
|
634
|
-
|
|
634
|
+
a.close(), this.processNext();
|
|
635
635
|
return;
|
|
636
636
|
}
|
|
637
|
-
this.lastCompletedId = t, this.options.onResult(
|
|
637
|
+
this.lastCompletedId = t, this.options.onResult(a, r), this.processNext();
|
|
638
638
|
}
|
|
639
639
|
processNext() {
|
|
640
640
|
if (this.pendingRequest) {
|
|
641
|
-
const
|
|
642
|
-
this.pendingRequest = null, this.sendToWorker(
|
|
641
|
+
const n = this.pendingRequest;
|
|
642
|
+
this.pendingRequest = null, this.sendToWorker(n);
|
|
643
643
|
}
|
|
644
644
|
}
|
|
645
645
|
destroy() {
|
|
646
646
|
this.batcher.destroy(), this.worker && (this.worker.terminate(), this.worker = null);
|
|
647
647
|
}
|
|
648
648
|
}
|
|
649
|
-
function
|
|
650
|
-
const
|
|
649
|
+
function Le(o, n, t = {}, a) {
|
|
650
|
+
const r = {
|
|
651
651
|
loadedImages: /* @__PURE__ */ new Map(),
|
|
652
652
|
imageBitmaps: /* @__PURE__ */ new Map(),
|
|
653
653
|
imagesLoaded: !1,
|
|
@@ -658,151 +658,151 @@ function qe(r, a, t = {}, s) {
|
|
|
658
658
|
ctx: null,
|
|
659
659
|
renderStartTime: null
|
|
660
660
|
};
|
|
661
|
-
|
|
662
|
-
function
|
|
663
|
-
return Object.keys(k).length === 0 ?
|
|
664
|
-
...
|
|
665
|
-
layers:
|
|
666
|
-
const
|
|
667
|
-
return
|
|
668
|
-
...
|
|
669
|
-
src:
|
|
670
|
-
} :
|
|
661
|
+
r.ctx = o.getContext("2d");
|
|
662
|
+
function s(_, k) {
|
|
663
|
+
return Object.keys(k).length === 0 ? _ : {
|
|
664
|
+
..._,
|
|
665
|
+
layers: _.layers.map((I) => {
|
|
666
|
+
const z = I.name || I.id, b = k[z];
|
|
667
|
+
return b ? {
|
|
668
|
+
...I,
|
|
669
|
+
src: b
|
|
670
|
+
} : I;
|
|
671
671
|
})
|
|
672
672
|
};
|
|
673
673
|
}
|
|
674
|
-
if (!
|
|
674
|
+
if (!r.ctx)
|
|
675
675
|
return () => {
|
|
676
676
|
};
|
|
677
|
-
let l =
|
|
678
|
-
function
|
|
679
|
-
return
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
onResult: (
|
|
683
|
-
if (
|
|
684
|
-
if (
|
|
685
|
-
const
|
|
686
|
-
|
|
677
|
+
let l = n, f = t;
|
|
678
|
+
function g() {
|
|
679
|
+
return s(l, f);
|
|
680
|
+
}
|
|
681
|
+
g(), r.scheduler = new Kt({
|
|
682
|
+
onResult: (_, k) => {
|
|
683
|
+
if (r.ctx && o)
|
|
684
|
+
if (r.ctx.drawImage(_, 0, 0, o.width, o.height), _.close(), r.renderStartTime !== null) {
|
|
685
|
+
const I = performance.now() - r.renderStartTime;
|
|
686
|
+
a?.(I), r.renderStartTime = null;
|
|
687
687
|
} else
|
|
688
|
-
|
|
688
|
+
a?.(k);
|
|
689
689
|
},
|
|
690
|
-
onError: (
|
|
691
|
-
console.warn("Worker render failed, falling back to main thread:",
|
|
690
|
+
onError: (_) => {
|
|
691
|
+
console.warn("Worker render failed, falling back to main thread:", _), r.useWorker = !1, m();
|
|
692
692
|
}
|
|
693
693
|
});
|
|
694
694
|
function w() {
|
|
695
|
-
if (!
|
|
696
|
-
const
|
|
697
|
-
const
|
|
698
|
-
return `${
|
|
695
|
+
if (!o || !r.ctx) return;
|
|
696
|
+
const _ = g(), k = _.layers.map((z) => z.src).join(","), I = _.layers.map((z) => {
|
|
697
|
+
const b = z.effects.find((c) => c.type === "warp"), d = z.effects.find((c) => c.type === "restyle"), p = b ? `${b.enabled}:${b.shape}` : "none", i = d ? JSON.stringify(d) : "none";
|
|
698
|
+
return `${z.id}:${z.transform.x},${z.transform.y},${z.transform.scale},${z.transform.rotation},${z.opacity},${z.visible}:${p}:${i}`;
|
|
699
699
|
}).join("|");
|
|
700
|
-
(
|
|
701
|
-
}
|
|
702
|
-
async function
|
|
703
|
-
if (
|
|
704
|
-
return
|
|
705
|
-
const k =
|
|
706
|
-
let
|
|
707
|
-
if (!k && !
|
|
700
|
+
(o.width !== _.width || o.height !== _.height) && (o.width = _.width, o.height = _.height), k !== r.lastSources ? (r.lastSources = k, r.imagesLoaded = !1, h()) : r.imagesLoaded && I !== r.lastRenderKey ? (r.lastRenderKey = I, m()) : r.imagesLoaded ? r.imagesLoaded && m() : g().layers.length > 0 && h();
|
|
701
|
+
}
|
|
702
|
+
async function u(_) {
|
|
703
|
+
if (r.loadedImages.has(_))
|
|
704
|
+
return r.loadedImages.get(_);
|
|
705
|
+
const k = _.startsWith("data:");
|
|
706
|
+
let z = _.startsWith("/") || _.startsWith("./") || _.startsWith("../");
|
|
707
|
+
if (!k && !z && typeof window < "u")
|
|
708
708
|
try {
|
|
709
|
-
|
|
709
|
+
z = new URL(_, window.location.href).origin === window.location.origin;
|
|
710
710
|
} catch {
|
|
711
|
-
|
|
711
|
+
z = !0;
|
|
712
712
|
}
|
|
713
|
-
const
|
|
713
|
+
const b = new Image();
|
|
714
714
|
try {
|
|
715
|
-
if (await new Promise((
|
|
716
|
-
const
|
|
715
|
+
if (await new Promise((d, p) => {
|
|
716
|
+
const i = setTimeout(() => {
|
|
717
717
|
p(new Error("Image load timeout"));
|
|
718
718
|
}, 3e4);
|
|
719
|
-
|
|
720
|
-
clearTimeout(
|
|
721
|
-
},
|
|
722
|
-
clearTimeout(
|
|
723
|
-
},
|
|
724
|
-
}),
|
|
719
|
+
b.onload = () => {
|
|
720
|
+
clearTimeout(i), d();
|
|
721
|
+
}, b.onerror = (c) => {
|
|
722
|
+
clearTimeout(i), p(c);
|
|
723
|
+
}, b.src = _;
|
|
724
|
+
}), r.loadedImages.set(_, b), !k && !z)
|
|
725
725
|
try {
|
|
726
|
-
const
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
}),
|
|
726
|
+
const d = new Image();
|
|
727
|
+
d.crossOrigin = "anonymous", await new Promise((p, i) => {
|
|
728
|
+
d.onload = () => p(), d.onerror = () => i(new Error("CORS failed")), d.src = _;
|
|
729
|
+
}), r.loadedImages.set(_, d);
|
|
730
730
|
try {
|
|
731
|
-
const p = await createImageBitmap(
|
|
732
|
-
|
|
731
|
+
const p = await createImageBitmap(d);
|
|
732
|
+
r.imageBitmaps.set(_, p);
|
|
733
733
|
} catch (p) {
|
|
734
734
|
console.warn("Failed to create ImageBitmap:", p);
|
|
735
735
|
}
|
|
736
|
-
return
|
|
736
|
+
return d;
|
|
737
737
|
} catch {
|
|
738
|
-
console.warn(`Image loaded but CORS not available for ${
|
|
738
|
+
console.warn(`Image loaded but CORS not available for ${_}. Canvas operations may be limited.`);
|
|
739
739
|
try {
|
|
740
|
-
const p = await createImageBitmap(
|
|
741
|
-
|
|
740
|
+
const p = await createImageBitmap(b);
|
|
741
|
+
r.imageBitmaps.set(_, p);
|
|
742
742
|
} catch {
|
|
743
743
|
}
|
|
744
|
-
return
|
|
744
|
+
return b;
|
|
745
745
|
}
|
|
746
746
|
else {
|
|
747
747
|
try {
|
|
748
|
-
const
|
|
749
|
-
|
|
750
|
-
} catch (
|
|
751
|
-
console.warn("Failed to create ImageBitmap:",
|
|
748
|
+
const d = await createImageBitmap(b);
|
|
749
|
+
r.imageBitmaps.set(_, d);
|
|
750
|
+
} catch (d) {
|
|
751
|
+
console.warn("Failed to create ImageBitmap:", d);
|
|
752
752
|
}
|
|
753
|
-
return
|
|
753
|
+
return b;
|
|
754
754
|
}
|
|
755
|
-
} catch (
|
|
756
|
-
return console.error(`Failed to load image: ${
|
|
755
|
+
} catch (d) {
|
|
756
|
+
return console.error(`Failed to load image: ${_}`, d), null;
|
|
757
757
|
}
|
|
758
758
|
}
|
|
759
|
-
async function
|
|
759
|
+
async function h() {
|
|
760
760
|
performance.now();
|
|
761
|
-
const
|
|
762
|
-
if (
|
|
763
|
-
|
|
761
|
+
const _ = g();
|
|
762
|
+
if (_.layers.length === 0) {
|
|
763
|
+
r.imagesLoaded = !0, r.ctx && m();
|
|
764
764
|
return;
|
|
765
765
|
}
|
|
766
|
-
await Promise.all(
|
|
766
|
+
await Promise.all(_.layers.map((k) => u(k.src))), r.imagesLoaded = !0, r.ctx && o && m();
|
|
767
767
|
}
|
|
768
768
|
function m() {
|
|
769
|
-
if (!(!
|
|
770
|
-
if (
|
|
769
|
+
if (!(!r.ctx || !o)) {
|
|
770
|
+
if (r.useWorker && r.scheduler) {
|
|
771
771
|
T();
|
|
772
772
|
return;
|
|
773
773
|
}
|
|
774
|
-
|
|
774
|
+
r.renderStartTime = performance.now(), v();
|
|
775
775
|
}
|
|
776
776
|
}
|
|
777
777
|
async function T() {
|
|
778
|
-
if (!
|
|
779
|
-
|
|
780
|
-
const
|
|
781
|
-
let
|
|
782
|
-
for (const
|
|
783
|
-
if (!
|
|
784
|
-
const
|
|
785
|
-
if (!
|
|
778
|
+
if (!r.scheduler) return;
|
|
779
|
+
r.renderStartTime = performance.now();
|
|
780
|
+
const _ = g(), k = [], I = [];
|
|
781
|
+
let z = !1;
|
|
782
|
+
for (const b of _.layers) {
|
|
783
|
+
if (!b.visible) continue;
|
|
784
|
+
const d = r.loadedImages.get(b.src), p = r.imageBitmaps.get(b.src);
|
|
785
|
+
if (!d) continue;
|
|
786
786
|
if (!p) {
|
|
787
|
-
|
|
787
|
+
z = !0;
|
|
788
788
|
continue;
|
|
789
789
|
}
|
|
790
|
-
const
|
|
791
|
-
let M =
|
|
792
|
-
const
|
|
793
|
-
let
|
|
794
|
-
if (
|
|
795
|
-
|
|
790
|
+
const i = et(p, b.effects), c = b.effects.find((j) => j.type === "warp");
|
|
791
|
+
let M = i.width, S = i.height;
|
|
792
|
+
const Y = M * b.transform.scale, J = S * b.transform.scale;
|
|
793
|
+
let B;
|
|
794
|
+
if (i.image instanceof ImageBitmap)
|
|
795
|
+
B = i.image;
|
|
796
796
|
else
|
|
797
797
|
try {
|
|
798
|
-
|
|
799
|
-
} catch (
|
|
800
|
-
console.warn("Failed to create bitmap from processed image, falling back to main thread:",
|
|
798
|
+
B = await createImageBitmap(i.image);
|
|
799
|
+
} catch (j) {
|
|
800
|
+
console.warn("Failed to create bitmap from processed image, falling back to main thread:", j), v();
|
|
801
801
|
return;
|
|
802
802
|
}
|
|
803
803
|
let U = null;
|
|
804
804
|
if (c) {
|
|
805
|
-
const
|
|
805
|
+
const j = {
|
|
806
806
|
type: "warp",
|
|
807
807
|
shape: c.shape,
|
|
808
808
|
enabled: !!c.enabled,
|
|
@@ -813,401 +813,428 @@ function qe(r, a, t = {}, s) {
|
|
|
813
813
|
translateY: Number(c.image?.translateY ?? 0)
|
|
814
814
|
}
|
|
815
815
|
};
|
|
816
|
-
c.debug && (
|
|
816
|
+
c.debug && (j.debug = {
|
|
817
817
|
showBounds: !!c.debug.showBounds,
|
|
818
818
|
showDepthVis: !!c.debug.showDepthVis,
|
|
819
819
|
showCrosshair: !!c.debug.showCrosshair
|
|
820
|
-
}), c.cylinder && (
|
|
820
|
+
}), c.cylinder && (j.cylinder = {
|
|
821
821
|
diameter: Number(c.cylinder.diameter),
|
|
822
822
|
pitch: Number(c.cylinder.pitch),
|
|
823
823
|
perspective: Number(c.cylinder.perspective),
|
|
824
824
|
rotationX: Number(c.cylinder.rotationX),
|
|
825
825
|
rotationY: Number(c.cylinder.rotationY),
|
|
826
826
|
rotationZ: Number(c.cylinder.rotationZ)
|
|
827
|
-
}), c.plane && (
|
|
827
|
+
}), c.plane && (j.plane = {
|
|
828
828
|
rotationX: Number(c.plane.rotationX),
|
|
829
829
|
rotationY: Number(c.plane.rotationY),
|
|
830
830
|
rotationZ: Number(c.plane.rotationZ),
|
|
831
831
|
depthScale: Number(c.plane.depthScale)
|
|
832
|
-
}), c.sphere && (
|
|
832
|
+
}), c.sphere && (j.sphere = {
|
|
833
833
|
radius: Number(c.sphere.radius),
|
|
834
834
|
rotationX: Number(c.sphere.rotationX),
|
|
835
835
|
rotationY: Number(c.sphere.rotationY),
|
|
836
836
|
rotationZ: Number(c.sphere.rotationZ)
|
|
837
|
-
}), c.custom && (
|
|
837
|
+
}), c.custom && (j.custom = {
|
|
838
838
|
formula: String(c.custom.formula),
|
|
839
839
|
parameters: Object.fromEntries(
|
|
840
|
-
Object.entries(c.custom.parameters || {}).map(([
|
|
840
|
+
Object.entries(c.custom.parameters || {}).map(([q, E]) => [q, Number(E)])
|
|
841
841
|
)
|
|
842
|
-
}), U =
|
|
842
|
+
}), U = j;
|
|
843
843
|
}
|
|
844
844
|
k.push({
|
|
845
|
-
id: String(
|
|
846
|
-
x: Number(
|
|
847
|
-
y: Number(
|
|
848
|
-
width: Number(
|
|
845
|
+
id: String(b.id),
|
|
846
|
+
x: Number(b.transform.x),
|
|
847
|
+
y: Number(b.transform.y),
|
|
848
|
+
width: Number(Y),
|
|
849
849
|
height: Number(J),
|
|
850
|
-
rotation: Number(
|
|
851
|
-
opacity: Number(
|
|
850
|
+
rotation: Number(b.transform.rotation),
|
|
851
|
+
opacity: Number(b.opacity),
|
|
852
852
|
warp: U
|
|
853
|
-
}),
|
|
853
|
+
}), I.push(B);
|
|
854
854
|
}
|
|
855
|
-
if (
|
|
855
|
+
if (z || k.length === 0) {
|
|
856
856
|
v();
|
|
857
857
|
return;
|
|
858
858
|
}
|
|
859
859
|
try {
|
|
860
|
-
const
|
|
861
|
-
|
|
860
|
+
const b = await Promise.all(
|
|
861
|
+
I.map((d) => createImageBitmap(d))
|
|
862
862
|
);
|
|
863
|
-
|
|
864
|
-
canvasWidth:
|
|
865
|
-
canvasHeight:
|
|
863
|
+
r.scheduler?.request({
|
|
864
|
+
canvasWidth: _.width,
|
|
865
|
+
canvasHeight: _.height,
|
|
866
866
|
layers: k,
|
|
867
|
-
images:
|
|
867
|
+
images: b
|
|
868
868
|
});
|
|
869
|
-
} catch (
|
|
870
|
-
console.warn("Failed to clone bitmaps for worker, falling back to main thread:",
|
|
869
|
+
} catch (b) {
|
|
870
|
+
console.warn("Failed to clone bitmaps for worker, falling back to main thread:", b), v();
|
|
871
871
|
}
|
|
872
872
|
}
|
|
873
873
|
function v() {
|
|
874
|
-
if (!
|
|
875
|
-
const
|
|
876
|
-
|
|
877
|
-
for (const
|
|
878
|
-
if (!
|
|
874
|
+
if (!r.ctx || !o) return;
|
|
875
|
+
const _ = r.renderStartTime ?? performance.now(), k = g();
|
|
876
|
+
r.ctx.fillStyle = "#ffffff", r.ctx.fillRect(0, 0, k.width, k.height);
|
|
877
|
+
for (const z of k.layers) {
|
|
878
|
+
if (!z.visible) continue;
|
|
879
879
|
performance.now();
|
|
880
|
-
const
|
|
881
|
-
if (!
|
|
882
|
-
if (!
|
|
883
|
-
console.warn("Image not fully loaded:",
|
|
880
|
+
const b = r.loadedImages.get(z.src);
|
|
881
|
+
if (!b) continue;
|
|
882
|
+
if (!b.complete || b.naturalWidth === 0) {
|
|
883
|
+
console.warn("Image not fully loaded:", z.src);
|
|
884
884
|
continue;
|
|
885
885
|
}
|
|
886
|
-
const
|
|
887
|
-
let
|
|
888
|
-
|
|
889
|
-
const M =
|
|
890
|
-
|
|
891
|
-
const
|
|
886
|
+
const d = et(b, z.effects), p = z.effects.find((B) => B.type === "warp");
|
|
887
|
+
let i = d.width, c = d.height;
|
|
888
|
+
r.ctx.save(), r.ctx.globalAlpha = z.opacity;
|
|
889
|
+
const M = z.transform.x, S = z.transform.y;
|
|
890
|
+
r.ctx.translate(M, S), r.ctx.rotate(z.transform.rotation * Math.PI / 180);
|
|
891
|
+
const Y = i * z.transform.scale, J = c * z.transform.scale;
|
|
892
892
|
try {
|
|
893
|
-
p && p.enabled && p.shape !== "none" ? Ut(
|
|
894
|
-
} catch (
|
|
895
|
-
console.warn("Failed to draw image to canvas (may be CORS issue):",
|
|
893
|
+
p && p.enabled && p.shape !== "none" ? Ut(r.ctx, d.image, 0, 0, Y, J, p) : r.ctx.drawImage(d.image, -Y / 2, -J / 2, Y, J);
|
|
894
|
+
} catch (B) {
|
|
895
|
+
console.warn("Failed to draw image to canvas (may be CORS issue):", z.src, B);
|
|
896
896
|
}
|
|
897
|
-
|
|
897
|
+
r.ctx.restore();
|
|
898
898
|
}
|
|
899
|
-
const
|
|
900
|
-
|
|
899
|
+
const I = performance.now() - _;
|
|
900
|
+
a?.(I), r.renderStartTime !== null && (r.renderStartTime = null);
|
|
901
901
|
}
|
|
902
902
|
w();
|
|
903
|
-
function y(
|
|
904
|
-
l =
|
|
903
|
+
function y(_, k) {
|
|
904
|
+
l = _, k !== void 0 && (f = k), w();
|
|
905
905
|
}
|
|
906
906
|
function x() {
|
|
907
|
-
|
|
908
|
-
for (const
|
|
909
|
-
|
|
907
|
+
r.scheduler?.destroy();
|
|
908
|
+
for (const _ of r.imageBitmaps.values())
|
|
909
|
+
_.close();
|
|
910
910
|
}
|
|
911
|
-
const
|
|
912
|
-
return
|
|
911
|
+
const N = x;
|
|
912
|
+
return N.update = y, N;
|
|
913
913
|
}
|
|
914
914
|
var Jt = e.from_html('<div><canvas class="canvas svelte-1xdpk2w"></canvas></div>');
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
915
|
+
const Gt = {
|
|
916
|
+
hash: "svelte-1xdpk2w",
|
|
917
|
+
code: ".mockup-renderer.svelte-1xdpk2w {position:relative;display:flex;align-items:center;justify-content:center;width:100%;height:100%;overflow:hidden;}.canvas.svelte-1xdpk2w {display:block;max-width:100%;max-height:100%;}.mockup-renderer.contain.svelte-1xdpk2w .canvas:where(.svelte-1xdpk2w) {width:auto;height:auto;max-width:100%;max-height:100%;object-fit:contain;}.mockup-renderer.cover.svelte-1xdpk2w .canvas:where(.svelte-1xdpk2w) {width:100%;height:100%;object-fit:cover;}"
|
|
918
|
+
};
|
|
919
|
+
function ca(o, n) {
|
|
920
|
+
e.push(n, !0), e.append_styles(o, Gt);
|
|
921
|
+
let t = e.prop(n, "imageOverrides", 19, () => ({})), a = e.prop(n, "objectFit", 3, "contain"), r = e.state(null);
|
|
918
922
|
Te(() => {
|
|
919
|
-
if (e.get(
|
|
920
|
-
return
|
|
923
|
+
if (e.get(r))
|
|
924
|
+
return Le(e.get(r), n.mockup.composition, t());
|
|
921
925
|
});
|
|
922
|
-
var
|
|
926
|
+
var s = Jt();
|
|
923
927
|
let l;
|
|
924
|
-
var f = e.child(
|
|
925
|
-
e.bind_this(f, (
|
|
926
|
-
contain:
|
|
927
|
-
cover:
|
|
928
|
-
})), e.append(
|
|
928
|
+
var f = e.child(s);
|
|
929
|
+
e.bind_this(f, (g) => e.set(r, g), () => e.get(r)), e.reset(s), e.template_effect(() => l = e.set_class(s, 1, "mockup-renderer svelte-1xdpk2w", null, l, {
|
|
930
|
+
contain: a() === "contain",
|
|
931
|
+
cover: a() === "cover"
|
|
932
|
+
})), e.append(o, s), e.pop();
|
|
929
933
|
}
|
|
930
|
-
const
|
|
934
|
+
const $t = {
|
|
931
935
|
x: 0,
|
|
932
936
|
y: 0,
|
|
933
937
|
scale: 1,
|
|
934
938
|
rotation: 0
|
|
935
939
|
}, Qt = {
|
|
936
|
-
transform: {
|
|
940
|
+
transform: { ...$t },
|
|
937
941
|
opacity: 1,
|
|
938
942
|
visible: !0,
|
|
939
943
|
effects: []
|
|
940
|
-
},
|
|
944
|
+
}, Ie = {
|
|
941
945
|
zoom: 1,
|
|
942
946
|
panX: 0,
|
|
943
947
|
panY: 0
|
|
944
|
-
},
|
|
948
|
+
}, at = {
|
|
945
949
|
width: 800,
|
|
946
950
|
height: 600,
|
|
947
951
|
layers: [],
|
|
948
952
|
effects: []
|
|
949
953
|
};
|
|
950
|
-
var
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
}
|
|
958
|
-
function
|
|
959
|
-
|
|
960
|
-
|
|
954
|
+
var er = e.from_html('<div class="zoomable-canvas svelte-zjsyu1" role="application" aria-label="Zoomable canvas - scroll to zoom, drag to pan"><div class="canvas-frame svelte-zjsyu1"><!></div> <div class="view-controls svelte-zjsyu1"><span class="zoom-indicator svelte-zjsyu1"> </span> <button class="reset-btn svelte-zjsyu1">Reset</button></div></div>');
|
|
955
|
+
const tr = {
|
|
956
|
+
hash: "svelte-zjsyu1",
|
|
957
|
+
code: ".zoomable-canvas.svelte-zjsyu1 {width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:var(--color-bg, #f5f5f5);overflow:hidden;cursor:grab;position:relative;}.zoomable-canvas.svelte-zjsyu1:active {cursor:grabbing;}.canvas-frame.svelte-zjsyu1 {transform-origin:center center;box-shadow:0 4px 16px rgba(0, 0, 0, 0.1);}.view-controls.svelte-zjsyu1 {position:absolute;bottom:1rem;right:1rem;display:flex;align-items:center;gap:0.5rem;background:rgba(0, 0, 0, 0.7);padding:0.3rem 0.5rem;border-radius:4px;}.zoom-indicator.svelte-zjsyu1 {color:#fff;font-size:0.75rem;font-family:monospace;min-width:2.5rem;text-align:center;}.reset-btn.svelte-zjsyu1 {background:transparent;border:1px solid rgba(255, 255, 255, 0.3);color:rgba(255, 255, 255, 0.8);padding:0.2rem 0.5rem;border-radius:3px;font-size:0.75rem;cursor:pointer;transition:all 200ms;}.reset-btn.svelte-zjsyu1:hover {border-color:rgba(255, 255, 255, 0.6);color:#fff;}"
|
|
958
|
+
};
|
|
959
|
+
function rr(o, n) {
|
|
960
|
+
e.append_styles(o, tr);
|
|
961
|
+
let t = e.state(e.proxy({ ...Ie })), a = e.state(!1), r = e.state(e.proxy({ x: 0, y: 0 }));
|
|
962
|
+
function s(_) {
|
|
963
|
+
_.preventDefault();
|
|
964
|
+
const k = _.deltaY > 0 ? 0.9 : 1.1, I = Math.max(0.25, Math.min(4, e.get(t).zoom * k));
|
|
965
|
+
e.set(t, { ...e.get(t), zoom: I }, !0);
|
|
966
|
+
}
|
|
967
|
+
function l(_) {
|
|
968
|
+
_.button === 0 && (e.set(a, !0), e.set(
|
|
969
|
+
r,
|
|
961
970
|
{
|
|
962
|
-
x:
|
|
963
|
-
y:
|
|
971
|
+
x: _.clientX - e.get(t).panX,
|
|
972
|
+
y: _.clientY - e.get(t).panY
|
|
964
973
|
},
|
|
965
974
|
!0
|
|
966
975
|
));
|
|
967
976
|
}
|
|
968
|
-
function f(
|
|
969
|
-
e.get(
|
|
977
|
+
function f(_) {
|
|
978
|
+
e.get(a) && e.set(
|
|
970
979
|
t,
|
|
971
980
|
{
|
|
972
981
|
...e.get(t),
|
|
973
|
-
panX:
|
|
974
|
-
panY:
|
|
982
|
+
panX: _.clientX - e.get(r).x,
|
|
983
|
+
panY: _.clientY - e.get(r).y
|
|
975
984
|
},
|
|
976
985
|
!0
|
|
977
986
|
);
|
|
978
987
|
}
|
|
979
|
-
function
|
|
980
|
-
e.set(
|
|
988
|
+
function g() {
|
|
989
|
+
e.set(a, !1);
|
|
981
990
|
}
|
|
982
991
|
function w() {
|
|
983
|
-
e.set(t, { ...
|
|
992
|
+
e.set(t, { ...Ie }, !0);
|
|
984
993
|
}
|
|
985
|
-
const
|
|
986
|
-
var
|
|
987
|
-
|
|
988
|
-
var m = e.child(
|
|
989
|
-
e.snippet(T, () =>
|
|
994
|
+
const u = e.derived(() => `transform: scale(${e.get(t).zoom}) translate(${e.get(t).panX / e.get(t).zoom}px, ${e.get(t).panY / e.get(t).zoom}px);`);
|
|
995
|
+
var h = er();
|
|
996
|
+
h.__mousedown = l, h.__mousemove = f, h.__mouseup = g;
|
|
997
|
+
var m = e.child(h), T = e.child(m);
|
|
998
|
+
e.snippet(T, () => n.children), e.reset(m);
|
|
990
999
|
var v = e.sibling(m, 2), y = e.child(v), x = e.child(y);
|
|
991
1000
|
e.reset(y);
|
|
992
|
-
var
|
|
993
|
-
|
|
994
|
-
(
|
|
995
|
-
e.set_style(m, e.get(
|
|
1001
|
+
var N = e.sibling(y, 2);
|
|
1002
|
+
N.__click = w, e.reset(v), e.reset(h), e.template_effect(
|
|
1003
|
+
(_) => {
|
|
1004
|
+
e.set_style(m, e.get(u)), e.set_text(x, `${_ ?? ""}%`);
|
|
996
1005
|
},
|
|
997
1006
|
[() => Math.round(e.get(t).zoom * 100)]
|
|
998
|
-
), e.event("wheel",
|
|
1007
|
+
), e.event("wheel", h, s), e.event("mouseleave", h, g), e.append(o, h);
|
|
999
1008
|
}
|
|
1000
1009
|
e.delegate(["mousedown", "mousemove", "mouseup", "click"]);
|
|
1001
|
-
function
|
|
1002
|
-
let
|
|
1003
|
-
const f = new
|
|
1004
|
-
l?.update ? l.update(
|
|
1010
|
+
function nr(o, n, t = {}, a) {
|
|
1011
|
+
let r = n, s = t, l = null;
|
|
1012
|
+
const f = new nt((u) => {
|
|
1013
|
+
l?.update ? l.update(u.config, u.overrides) : (l?.(), l = Le(o, u.config, u.overrides, a));
|
|
1005
1014
|
});
|
|
1006
|
-
l =
|
|
1007
|
-
function
|
|
1008
|
-
|
|
1015
|
+
l = Le(o, r, s, a);
|
|
1016
|
+
function g(u, h) {
|
|
1017
|
+
r = u, h !== void 0 && (s = h), f.queue({ config: r, overrides: s });
|
|
1009
1018
|
}
|
|
1010
1019
|
return {
|
|
1011
|
-
update:
|
|
1020
|
+
update: g,
|
|
1012
1021
|
cleanup: () => {
|
|
1013
1022
|
f.destroy(), l?.();
|
|
1014
1023
|
}
|
|
1015
1024
|
};
|
|
1016
1025
|
}
|
|
1017
|
-
var
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1026
|
+
var ar = e.from_html('<div class="render-time svelte-1p1rf8j"> </div>'), sr = e.from_html('<div><canvas class="canvas svelte-1p1rf8j"></canvas> <!></div>');
|
|
1027
|
+
const or = {
|
|
1028
|
+
hash: "svelte-1p1rf8j",
|
|
1029
|
+
code: ".mockup-renderer.svelte-1p1rf8j {position:relative;display:flex;align-items:center;justify-content:center;width:100%;height:100%;overflow:hidden;}.canvas.svelte-1p1rf8j {display:block;max-width:100%;max-height:100%;}.mockup-renderer.contain.svelte-1p1rf8j .canvas:where(.svelte-1p1rf8j) {width:auto;height:auto;max-width:100%;max-height:100%;object-fit:contain;}.mockup-renderer.cover.svelte-1p1rf8j .canvas:where(.svelte-1p1rf8j) {width:100%;height:100%;object-fit:cover;}.render-time.svelte-1p1rf8j {position:absolute;top:8px;right:8px;background:rgba(0, 0, 0, 0.7);color:white;padding:4px 8px;border-radius:4px;font-size:12px;font-family:monospace;pointer-events:none;z-index:10;}"
|
|
1030
|
+
};
|
|
1031
|
+
function ir(o, n) {
|
|
1032
|
+
e.push(n, !0), e.append_styles(o, or);
|
|
1033
|
+
let t = e.prop(n, "imageOverrides", 19, () => ({})), a = e.prop(n, "objectFit", 3, "contain"), r = e.prop(n, "debounceMs", 3, 100), s = e.state(null), l = e.state(null), f = e.state(0), g = e.state(null), w = null, u = e.state(""), h = e.state(""), m = e.state(null);
|
|
1021
1034
|
const T = 3;
|
|
1022
1035
|
function v() {
|
|
1023
1036
|
if (!e.get(l)) return;
|
|
1024
|
-
const
|
|
1025
|
-
|
|
1026
|
-
|
|
1037
|
+
const b = JSON.stringify(n.mockup.composition), d = JSON.stringify(t());
|
|
1038
|
+
b === e.get(u) && d === e.get(h) || (e.update(f), e.set(
|
|
1039
|
+
g,
|
|
1027
1040
|
{
|
|
1028
|
-
composition:
|
|
1041
|
+
composition: n.mockup.composition,
|
|
1029
1042
|
overrides: t()
|
|
1030
1043
|
},
|
|
1031
1044
|
!0
|
|
1032
|
-
), e.get(f) >= T ? (e.set(f, 0), w && (clearTimeout(w), w = null), e.get(
|
|
1033
|
-
e.get(l).update(e.get(
|
|
1034
|
-
}), e.set(
|
|
1045
|
+
), e.get(f) >= T ? (e.set(f, 0), w && (clearTimeout(w), w = null), e.get(g) && (Ge(() => {
|
|
1046
|
+
e.get(l).update(e.get(g).composition, e.get(g).overrides), e.set(u, b, !0), e.set(h, d, !0);
|
|
1047
|
+
}), e.set(g, null))) : (w && clearTimeout(w), w = setTimeout(
|
|
1035
1048
|
() => {
|
|
1036
|
-
e.get(l) && e.get(
|
|
1037
|
-
e.get(l).update(e.get(
|
|
1038
|
-
}), e.set(
|
|
1049
|
+
e.get(l) && e.get(g) && (Ge(() => {
|
|
1050
|
+
e.get(l).update(e.get(g).composition, e.get(g).overrides), e.set(u, JSON.stringify(e.get(g).composition), !0), e.set(h, JSON.stringify(e.get(g).overrides), !0);
|
|
1051
|
+
}), e.set(g, null), e.set(f, 0)), w = null;
|
|
1039
1052
|
},
|
|
1040
|
-
|
|
1053
|
+
r()
|
|
1041
1054
|
)));
|
|
1042
1055
|
}
|
|
1043
1056
|
Te(() => (xt().then(() => {
|
|
1044
|
-
e.get(
|
|
1057
|
+
e.get(s) && (e.set(
|
|
1045
1058
|
l,
|
|
1046
|
-
|
|
1047
|
-
e.set(m,
|
|
1059
|
+
nr(e.get(s), n.mockup.composition, t(), (b) => {
|
|
1060
|
+
e.set(m, b, !0);
|
|
1048
1061
|
}),
|
|
1049
1062
|
!0
|
|
1050
|
-
), e.set(
|
|
1063
|
+
), e.set(u, JSON.stringify(n.mockup.composition), !0), e.set(h, JSON.stringify(t()), !0));
|
|
1051
1064
|
}), () => {
|
|
1052
1065
|
w && clearTimeout(w), e.get(l)?.cleanup();
|
|
1053
1066
|
}));
|
|
1054
|
-
const y = e.derived(() => JSON.stringify(
|
|
1067
|
+
const y = e.derived(() => JSON.stringify(n.mockup.composition)), x = e.derived(() => JSON.stringify(t()));
|
|
1055
1068
|
e.user_effect(() => {
|
|
1056
1069
|
e.get(y), e.get(x), e.get(l) && v();
|
|
1057
1070
|
}), kt(() => {
|
|
1058
1071
|
w && clearTimeout(w), e.get(l)?.cleanup();
|
|
1059
1072
|
});
|
|
1060
|
-
var
|
|
1061
|
-
let
|
|
1062
|
-
var k = e.child(
|
|
1063
|
-
e.bind_this(k, (
|
|
1064
|
-
var
|
|
1073
|
+
var N = sr();
|
|
1074
|
+
let _;
|
|
1075
|
+
var k = e.child(N);
|
|
1076
|
+
e.bind_this(k, (b) => e.set(s, b), () => e.get(s));
|
|
1077
|
+
var I = e.sibling(k, 2);
|
|
1065
1078
|
{
|
|
1066
|
-
var
|
|
1067
|
-
var
|
|
1068
|
-
e.reset(
|
|
1079
|
+
var z = (b) => {
|
|
1080
|
+
var d = ar(), p = e.child(d);
|
|
1081
|
+
e.reset(d), e.template_effect((i) => e.set_text(p, `${i ?? ""}ms`), [() => e.get(m).toFixed(1)]), e.append(b, d);
|
|
1069
1082
|
};
|
|
1070
|
-
e.if(
|
|
1071
|
-
e.get(m) !== null &&
|
|
1083
|
+
e.if(I, (b) => {
|
|
1084
|
+
e.get(m) !== null && b(z);
|
|
1072
1085
|
});
|
|
1073
1086
|
}
|
|
1074
|
-
e.reset(
|
|
1075
|
-
contain:
|
|
1076
|
-
cover:
|
|
1077
|
-
})), e.append(
|
|
1087
|
+
e.reset(N), e.template_effect(() => _ = e.set_class(N, 1, "mockup-renderer svelte-1p1rf8j", null, _, {
|
|
1088
|
+
contain: a() === "contain",
|
|
1089
|
+
cover: a() === "cover"
|
|
1090
|
+
})), e.append(o, N), e.pop();
|
|
1078
1091
|
}
|
|
1079
|
-
var
|
|
1080
|
-
function
|
|
1081
|
-
let t = e.prop(
|
|
1082
|
-
var
|
|
1092
|
+
var lr = e.from_svg('<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></svg>');
|
|
1093
|
+
function cr(o, n) {
|
|
1094
|
+
let t = e.prop(n, "fontSize", 3, "1em"), a = e.prop(n, "color", 3, "currentColor");
|
|
1095
|
+
var r = lr();
|
|
1083
1096
|
e.template_effect(() => {
|
|
1084
|
-
e.set_style(
|
|
1085
|
-
}), e.append(
|
|
1097
|
+
e.set_style(r, `font-size: ${t() ?? ""};`), e.set_attribute(r, "stroke", a());
|
|
1098
|
+
}), e.append(o, r);
|
|
1086
1099
|
}
|
|
1087
|
-
var
|
|
1088
|
-
function
|
|
1089
|
-
let t = e.prop(
|
|
1090
|
-
var
|
|
1100
|
+
var dr = e.from_svg('<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24"></path><line x1="1" y1="1" x2="23" y2="23"></line></svg>');
|
|
1101
|
+
function ur(o, n) {
|
|
1102
|
+
let t = e.prop(n, "fontSize", 3, "1em"), a = e.prop(n, "color", 3, "currentColor");
|
|
1103
|
+
var r = dr();
|
|
1091
1104
|
e.template_effect(() => {
|
|
1092
|
-
e.set_style(
|
|
1093
|
-
}), e.append(
|
|
1105
|
+
e.set_style(r, `font-size: ${t() ?? ""};`), e.set_attribute(r, "stroke", a());
|
|
1106
|
+
}), e.append(o, r);
|
|
1094
1107
|
}
|
|
1095
|
-
var
|
|
1096
|
-
function Ue(
|
|
1097
|
-
let t = e.prop(
|
|
1098
|
-
var
|
|
1108
|
+
var pr = e.from_svg('<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke-width="2"><path d="M3 6h18M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"></path></svg>');
|
|
1109
|
+
function Ue(o, n) {
|
|
1110
|
+
let t = e.prop(n, "fontSize", 3, "1em"), a = e.prop(n, "color", 3, "currentColor");
|
|
1111
|
+
var r = pr();
|
|
1099
1112
|
e.template_effect(() => {
|
|
1100
|
-
e.set_style(
|
|
1101
|
-
}), e.append(
|
|
1113
|
+
e.set_style(r, `font-size: ${t() ?? ""};`), e.set_attribute(r, "stroke", a());
|
|
1114
|
+
}), e.append(o, r);
|
|
1102
1115
|
}
|
|
1103
|
-
var
|
|
1104
|
-
function
|
|
1105
|
-
let t = e.prop(
|
|
1106
|
-
var
|
|
1116
|
+
var mr = e.from_svg('<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"></path><path d="M3 3v5h5"></path></svg>');
|
|
1117
|
+
function vr(o, n) {
|
|
1118
|
+
let t = e.prop(n, "fontSize", 3, "1em"), a = e.prop(n, "color", 3, "currentColor");
|
|
1119
|
+
var r = mr();
|
|
1107
1120
|
e.template_effect(() => {
|
|
1108
|
-
e.set_style(
|
|
1109
|
-
}), e.append(
|
|
1121
|
+
e.set_style(r, `font-size: ${t() ?? ""};`), e.set_attribute(r, "stroke", a());
|
|
1122
|
+
}), e.append(o, r);
|
|
1110
1123
|
}
|
|
1111
|
-
var
|
|
1112
|
-
|
|
1113
|
-
|
|
1124
|
+
var fr = e.from_html('<button type="button" class="reset-btn svelte-18gpljp" title="Reset to default"><!></button>'), gr = e.from_html('<div class="control-group"><div class="control-row svelte-18gpljp"><!> <label class="control-label svelte-18gpljp"><span class="label-text svelte-18gpljp"> </span> <div class="control-content svelte-18gpljp"><!></div></label></div></div>');
|
|
1125
|
+
const hr = {
|
|
1126
|
+
hash: "svelte-18gpljp",
|
|
1127
|
+
code: ".control-row.svelte-18gpljp {display:flex;align-items:center;gap:0.25rem;min-width:0;max-width:100%;}.reset-btn.svelte-18gpljp {display:flex;align-items:center;justify-content:center;padding:0.25rem;background:transparent;border:none;border-radius:4px;color:var(--color-text-muted, #666);cursor:pointer;opacity:0.5;transition:opacity 0.15s, color 0.15s;}.reset-btn.svelte-18gpljp:hover {opacity:1;color:var(--color-primary, #007bff);}.control-label.svelte-18gpljp {display:flex;align-items:center;gap:0.5rem;flex:1;min-width:0;}.label-text.svelte-18gpljp {width:80px;flex-shrink:0;font-size:0.875rem;color:var(--color-text-muted, #666);}.control-content.svelte-18gpljp {flex:1;display:flex;align-items:center;gap:0.5rem;min-width:0;max-width:100%;overflow:hidden;}"
|
|
1128
|
+
};
|
|
1129
|
+
function F(o, n) {
|
|
1130
|
+
e.append_styles(o, hr);
|
|
1131
|
+
var t = gr(), a = e.child(t), r = e.child(a);
|
|
1114
1132
|
{
|
|
1115
|
-
var
|
|
1116
|
-
var m =
|
|
1133
|
+
var s = (h) => {
|
|
1134
|
+
var m = fr();
|
|
1117
1135
|
m.__click = function(...v) {
|
|
1118
|
-
|
|
1136
|
+
n.onReset?.apply(this, v);
|
|
1119
1137
|
};
|
|
1120
1138
|
var T = e.child(m);
|
|
1121
|
-
|
|
1139
|
+
vr(T, { fontSize: "0.875rem" }), e.reset(m), e.append(h, m);
|
|
1122
1140
|
};
|
|
1123
|
-
e.if(
|
|
1124
|
-
|
|
1141
|
+
e.if(r, (h) => {
|
|
1142
|
+
n.onReset && h(s);
|
|
1125
1143
|
});
|
|
1126
1144
|
}
|
|
1127
|
-
var l = e.sibling(
|
|
1145
|
+
var l = e.sibling(r, 2), f = e.child(l), g = e.child(f, !0);
|
|
1128
1146
|
e.reset(f);
|
|
1129
|
-
var w = e.sibling(f, 2),
|
|
1130
|
-
e.snippet(
|
|
1147
|
+
var w = e.sibling(f, 2), u = e.child(w);
|
|
1148
|
+
e.snippet(u, () => n.children), e.reset(w), e.reset(l), e.reset(a), e.reset(t), e.template_effect(() => e.set_text(g, n.label)), e.append(o, t);
|
|
1131
1149
|
}
|
|
1132
1150
|
e.delegate(["click"]);
|
|
1133
|
-
var
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1151
|
+
var br = e.from_html('<input type="range" step="1" class="svelte-efcks6"/> <input type="number" class="manual-input svelte-efcks6" step="1"/>', 1), _r = e.from_html('<input type="range" step="1" class="svelte-efcks6"/> <input type="number" class="manual-input svelte-efcks6" step="1"/>', 1), yr = e.from_html('<input type="range" step="1" min="-360" max="360" class="svelte-efcks6"/> <input type="number" class="manual-input svelte-efcks6" step="1"/>', 1), wr = e.from_html('<input type="range" min="0" max="1" step="0.01" class="svelte-efcks6"/> <input type="number" class="manual-input svelte-efcks6" step="0.01" min="0" max="1"/>', 1), xr = e.from_html('<details class="section svelte-efcks6" open=""><summary class="section-title svelte-efcks6">Position & Transform</summary> <div class="section-content svelte-efcks6"><details class="subsection svelte-efcks6" open=""><summary class="subsection-title svelte-efcks6">Position</summary> <div class="subsection-content svelte-efcks6"><!> <!></div></details> <details class="subsection svelte-efcks6" open=""><summary class="subsection-title svelte-efcks6">Transform</summary> <div class="subsection-content svelte-efcks6"><!> <!></div></details></div></details>');
|
|
1152
|
+
const kr = {
|
|
1153
|
+
hash: "svelte-efcks6",
|
|
1154
|
+
code: `.section.svelte-efcks6 {border-top:1px solid var(--color-border, #ccc);border-bottom:1px solid var(--color-border, #ccc);background:var(--color-surface, #fff);min-width:0;}.section-title.svelte-efcks6 {padding:0.75rem 0;font-size:0.875rem;font-weight:600;text-transform:uppercase;color:var(--color-text-muted, #666);cursor:pointer;list-style:none;display:flex;align-items:center;gap:0.5rem;border-bottom:1px solid var(--color-border, #eee);}.section-title.svelte-efcks6::-webkit-details-marker {display:none;}.section-title.svelte-efcks6::before {content:'▶';font-size:0.625rem;transition:transform 0.15s ease;}.section[open].svelte-efcks6 > .section-title:where(.svelte-efcks6)::before {transform:rotate(90deg);}.section-content.svelte-efcks6 {padding:0.75rem 0;display:flex;flex-direction:column;gap:0.75rem;}.manual-input.svelte-efcks6 {width:60px;padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;}input[type="range"].svelte-efcks6 {flex:1;min-width:0;max-width:100%;}.subsection.svelte-efcks6 {margin-top:0.75rem;border-top:1px solid var(--color-border, #e0e0e0);}.subsection.svelte-efcks6:first-child {margin-top:0;border-top:none;}.subsection-title.svelte-efcks6 {padding:0.5rem 0;font-size:0.75rem;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:var(--color-text-muted, #666);cursor:pointer;list-style:none;display:flex;align-items:center;gap:0.5rem;}.subsection-title.svelte-efcks6::-webkit-details-marker {display:none;}.subsection-title.svelte-efcks6::before {content:'▶';font-size:0.625rem;transition:transform 0.15s ease;}.subsection[open].svelte-efcks6 > .subsection-title:where(.svelte-efcks6)::before {transform:rotate(90deg);}.subsection-content.svelte-efcks6 {padding-bottom:0.25rem;}`
|
|
1155
|
+
};
|
|
1156
|
+
function Mr(o, n) {
|
|
1157
|
+
e.push(n, !0), e.append_styles(o, kr);
|
|
1158
|
+
let t = e.prop(n, "transform", 7), a = e.prop(n, "opacity", 7);
|
|
1159
|
+
const r = {
|
|
1160
|
+
x: Math.round(n.canvasWidth / 2),
|
|
1161
|
+
y: Math.round(n.canvasHeight / 2),
|
|
1140
1162
|
rotation: 0,
|
|
1141
1163
|
opacity: 1
|
|
1142
1164
|
};
|
|
1143
|
-
function
|
|
1144
|
-
|
|
1165
|
+
function s(I) {
|
|
1166
|
+
n.onTransformChange({ ...t(), ...I });
|
|
1145
1167
|
}
|
|
1146
|
-
const l = -
|
|
1147
|
-
var
|
|
1168
|
+
const l = -n.canvasWidth / 2, f = n.canvasWidth * 1.5, g = -n.canvasHeight / 2, w = n.canvasHeight * 1.5;
|
|
1169
|
+
var u = xr(), h = e.sibling(e.child(u), 2), m = e.child(h), T = e.sibling(e.child(m), 2), v = e.child(T);
|
|
1148
1170
|
F(v, {
|
|
1149
1171
|
label: "Position X",
|
|
1150
|
-
onReset: () =>
|
|
1151
|
-
children: (
|
|
1152
|
-
var
|
|
1153
|
-
e.remove_input_defaults(
|
|
1154
|
-
var p = e.sibling(
|
|
1155
|
-
e.remove_input_defaults(p), p.__input = (
|
|
1156
|
-
e.set_attribute(
|
|
1157
|
-
}), e.bind_value(
|
|
1172
|
+
onReset: () => s({ x: r.x }),
|
|
1173
|
+
children: (I, z) => {
|
|
1174
|
+
var b = br(), d = e.first_child(b);
|
|
1175
|
+
e.remove_input_defaults(d), d.__input = (i) => s({ x: Number(i.currentTarget.value) });
|
|
1176
|
+
var p = e.sibling(d, 2);
|
|
1177
|
+
e.remove_input_defaults(p), p.__input = (i) => s({ x: Number(i.currentTarget.value) }), e.template_effect(() => {
|
|
1178
|
+
e.set_attribute(d, "min", l), e.set_attribute(d, "max", f);
|
|
1179
|
+
}), e.bind_value(d, () => t().x, (i) => t().x = i), e.bind_value(p, () => t().x, (i) => t().x = i), e.append(I, b);
|
|
1158
1180
|
}
|
|
1159
1181
|
});
|
|
1160
1182
|
var y = e.sibling(v, 2);
|
|
1161
1183
|
F(y, {
|
|
1162
1184
|
label: "Position Y",
|
|
1163
|
-
onReset: () =>
|
|
1164
|
-
children: (
|
|
1165
|
-
var
|
|
1166
|
-
e.remove_input_defaults(
|
|
1167
|
-
var p = e.sibling(
|
|
1168
|
-
e.remove_input_defaults(p), p.__input = (
|
|
1169
|
-
e.set_attribute(
|
|
1170
|
-
}), e.bind_value(
|
|
1185
|
+
onReset: () => s({ y: r.y }),
|
|
1186
|
+
children: (I, z) => {
|
|
1187
|
+
var b = _r(), d = e.first_child(b);
|
|
1188
|
+
e.remove_input_defaults(d), d.__input = (i) => s({ y: Number(i.currentTarget.value) });
|
|
1189
|
+
var p = e.sibling(d, 2);
|
|
1190
|
+
e.remove_input_defaults(p), p.__input = (i) => s({ y: Number(i.currentTarget.value) }), e.template_effect(() => {
|
|
1191
|
+
e.set_attribute(d, "min", g), e.set_attribute(d, "max", w);
|
|
1192
|
+
}), e.bind_value(d, () => t().y, (i) => t().y = i), e.bind_value(p, () => t().y, (i) => t().y = i), e.append(I, b);
|
|
1171
1193
|
}
|
|
1172
1194
|
}), e.reset(T), e.reset(m);
|
|
1173
|
-
var x = e.sibling(m, 2),
|
|
1174
|
-
F(
|
|
1195
|
+
var x = e.sibling(m, 2), N = e.sibling(e.child(x), 2), _ = e.child(N);
|
|
1196
|
+
F(_, {
|
|
1175
1197
|
label: "Rotation (°)",
|
|
1176
|
-
onReset: () =>
|
|
1177
|
-
children: (
|
|
1178
|
-
var
|
|
1179
|
-
e.remove_input_defaults(
|
|
1180
|
-
var p = e.sibling(
|
|
1181
|
-
e.remove_input_defaults(p), p.__input = (
|
|
1198
|
+
onReset: () => s({ rotation: r.rotation }),
|
|
1199
|
+
children: (I, z) => {
|
|
1200
|
+
var b = yr(), d = e.first_child(b);
|
|
1201
|
+
e.remove_input_defaults(d), d.__input = (i) => s({ rotation: Number(i.currentTarget.value) });
|
|
1202
|
+
var p = e.sibling(d, 2);
|
|
1203
|
+
e.remove_input_defaults(p), p.__input = (i) => s({ rotation: Number(i.currentTarget.value) }), e.bind_value(d, () => t().rotation, (i) => t().rotation = i), e.bind_value(p, () => t().rotation, (i) => t().rotation = i), e.append(I, b);
|
|
1182
1204
|
}
|
|
1183
1205
|
});
|
|
1184
|
-
var k = e.sibling(
|
|
1206
|
+
var k = e.sibling(_, 2);
|
|
1185
1207
|
F(k, {
|
|
1186
1208
|
label: "Opacity",
|
|
1187
|
-
onReset: () =>
|
|
1188
|
-
children: (
|
|
1189
|
-
var
|
|
1190
|
-
e.remove_input_defaults(
|
|
1191
|
-
var p = e.sibling(
|
|
1192
|
-
e.remove_input_defaults(p), p.__input = (
|
|
1209
|
+
onReset: () => n.onOpacityChange(r.opacity),
|
|
1210
|
+
children: (I, z) => {
|
|
1211
|
+
var b = wr(), d = e.first_child(b);
|
|
1212
|
+
e.remove_input_defaults(d), d.__input = (i) => n.onOpacityChange(Number(i.currentTarget.value));
|
|
1213
|
+
var p = e.sibling(d, 2);
|
|
1214
|
+
e.remove_input_defaults(p), p.__input = (i) => n.onOpacityChange(Number(i.currentTarget.value)), e.bind_value(d, a), e.bind_value(p, a), e.append(I, b);
|
|
1193
1215
|
}
|
|
1194
|
-
}), e.reset(
|
|
1216
|
+
}), e.reset(N), e.reset(x), e.reset(h), e.reset(u), e.append(o, u), e.pop();
|
|
1195
1217
|
}
|
|
1196
1218
|
e.delegate(["input"]);
|
|
1197
|
-
var
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1219
|
+
var Tr = e.from_html('<select class="mode-select svelte-1qmrgom"><option>Scale</option><option>Px</option></select>'), zr = e.from_html('<input type="range" step="0.1" min="0.1" max="10" class="svelte-1qmrgom"/> <input type="number" class="manual-input svelte-1qmrgom" step="0.1" min="0.1" max="10"/>', 1), Sr = e.from_html('<input type="number" class="px-input svelte-1qmrgom" step="1" min="1" placeholder="Auto"/> <select class="constraint-select svelte-1qmrgom"><option>None</option><option>Min</option><option>Max</option></select>', 1), Nr = e.from_html('<input type="number" class="px-input svelte-1qmrgom" step="1" min="1" placeholder="Auto"/> <select class="constraint-select svelte-1qmrgom"><option>None</option><option>Min</option><option>Max</option></select>', 1), Ir = e.from_html('<input type="checkbox"/>'), Cr = e.from_html("<!> <!> <!>", 1), Pr = e.from_html('<details class="section svelte-1qmrgom" open=""><summary class="section-title svelte-1qmrgom">Sizing</summary> <div class="section-content svelte-1qmrgom"><!> <!></div></details>');
|
|
1220
|
+
const Rr = {
|
|
1221
|
+
hash: "svelte-1qmrgom",
|
|
1222
|
+
code: `.section.svelte-1qmrgom {border-top:1px solid var(--color-border, #ccc);border-bottom:1px solid var(--color-border, #ccc);background:var(--color-surface, #fff);min-width:0;}.section-title.svelte-1qmrgom {padding:0.75rem 0;font-size:0.875rem;font-weight:600;text-transform:uppercase;color:var(--color-text-muted, #666);cursor:pointer;list-style:none;display:flex;align-items:center;gap:0.5rem;border-bottom:1px solid var(--color-border, #eee);}.section-title.svelte-1qmrgom::-webkit-details-marker {display:none;}.section-title.svelte-1qmrgom::before {content:'▶';font-size:0.625rem;transition:transform 0.15s ease;}.section[open].svelte-1qmrgom > .section-title:where(.svelte-1qmrgom)::before {transform:rotate(90deg);}.section-content.svelte-1qmrgom {padding:0.75rem 0;display:flex;flex-direction:column;gap:0.75rem;}.mode-select.svelte-1qmrgom {padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;background:var(--color-surface, #fff);}.px-input.svelte-1qmrgom {width:50px;padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;appearance:textfield;-moz-appearance:textfield;}.px-input.svelte-1qmrgom::-webkit-outer-spin-button,
|
|
1223
|
+
.px-input.svelte-1qmrgom::-webkit-inner-spin-button {-webkit-appearance:none;margin:0;}.constraint-select.svelte-1qmrgom {width:70px;flex-shrink:0;padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;}.manual-input.svelte-1qmrgom {width:60px;padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;}input[type="range"].svelte-1qmrgom {flex:1;min-width:0;max-width:100%;}`
|
|
1224
|
+
};
|
|
1225
|
+
function jr(o, n) {
|
|
1226
|
+
e.push(n, !0), e.append_styles(o, Rr);
|
|
1227
|
+
let t = e.prop(n, "effect", 3, fe);
|
|
1228
|
+
function a(u) {
|
|
1229
|
+
n.onChange({ ...t(), ...u });
|
|
1230
|
+
}
|
|
1231
|
+
var r = Pr(), s = e.sibling(e.child(r), 2), l = e.child(s);
|
|
1205
1232
|
F(l, {
|
|
1206
1233
|
label: "Mode",
|
|
1207
|
-
onReset: () =>
|
|
1208
|
-
children: (
|
|
1209
|
-
var m =
|
|
1210
|
-
m.__change = (x) =>
|
|
1234
|
+
onReset: () => a({ mode: fe.mode }),
|
|
1235
|
+
children: (u, h) => {
|
|
1236
|
+
var m = Tr();
|
|
1237
|
+
m.__change = (x) => a({ mode: x.currentTarget.value });
|
|
1211
1238
|
var T = e.child(m);
|
|
1212
1239
|
T.value = T.__value = "scale";
|
|
1213
1240
|
var v = e.sibling(T);
|
|
@@ -1215,156 +1242,164 @@ function In(r, a) {
|
|
|
1215
1242
|
var y;
|
|
1216
1243
|
e.init_select(m), e.template_effect(() => {
|
|
1217
1244
|
y !== (y = t().mode) && (m.value = (m.__value = t().mode) ?? "", e.select_option(m, t().mode));
|
|
1218
|
-
}), e.append(
|
|
1245
|
+
}), e.append(u, m);
|
|
1219
1246
|
}
|
|
1220
1247
|
});
|
|
1221
1248
|
var f = e.sibling(l, 2);
|
|
1222
1249
|
{
|
|
1223
|
-
var
|
|
1224
|
-
F(
|
|
1250
|
+
var g = (u) => {
|
|
1251
|
+
F(u, {
|
|
1225
1252
|
label: "Scale",
|
|
1226
|
-
onReset: () =>
|
|
1227
|
-
children: (
|
|
1228
|
-
var T =
|
|
1229
|
-
e.remove_input_defaults(v), v.__input = (x) =>
|
|
1253
|
+
onReset: () => a({ scale: fe.scale }),
|
|
1254
|
+
children: (h, m) => {
|
|
1255
|
+
var T = zr(), v = e.first_child(T);
|
|
1256
|
+
e.remove_input_defaults(v), v.__input = (x) => a({ scale: Number(x.currentTarget.value) });
|
|
1230
1257
|
var y = e.sibling(v, 2);
|
|
1231
|
-
e.remove_input_defaults(y), y.__input = (x) =>
|
|
1258
|
+
e.remove_input_defaults(y), y.__input = (x) => a({ scale: Number(x.currentTarget.value) }), e.template_effect(() => {
|
|
1232
1259
|
e.set_value(v, t().scale ?? 1), e.set_value(y, t().scale ?? 1);
|
|
1233
|
-
}), e.append(
|
|
1260
|
+
}), e.append(h, T);
|
|
1234
1261
|
}
|
|
1235
1262
|
});
|
|
1236
|
-
}, w = (
|
|
1237
|
-
var
|
|
1263
|
+
}, w = (u) => {
|
|
1264
|
+
var h = Cr(), m = e.first_child(h);
|
|
1238
1265
|
F(m, {
|
|
1239
1266
|
label: "Width",
|
|
1240
|
-
onReset: () =>
|
|
1267
|
+
onReset: () => a({ width: void 0, minWidth: void 0, maxWidth: void 0 }),
|
|
1241
1268
|
children: (y, x) => {
|
|
1242
|
-
var
|
|
1243
|
-
e.remove_input_defaults(
|
|
1244
|
-
const
|
|
1245
|
-
|
|
1269
|
+
var N = Sr(), _ = e.first_child(N);
|
|
1270
|
+
e.remove_input_defaults(_), _.__input = (p) => {
|
|
1271
|
+
const i = p.currentTarget.value ? Number(p.currentTarget.value) : void 0, c = t().minWidth !== void 0 ? "min" : t().maxWidth !== void 0 ? "max" : "";
|
|
1272
|
+
a(c === "min" ? { width: i, minWidth: i, maxWidth: void 0 } : c === "max" ? { width: i, maxWidth: i, minWidth: void 0 } : { width: i });
|
|
1246
1273
|
};
|
|
1247
|
-
var k = e.sibling(
|
|
1274
|
+
var k = e.sibling(_, 2);
|
|
1248
1275
|
k.__change = (p) => {
|
|
1249
|
-
const
|
|
1250
|
-
p.currentTarget.value === "min" &&
|
|
1276
|
+
const i = t().width ?? t().minWidth ?? t().maxWidth;
|
|
1277
|
+
p.currentTarget.value === "min" && i !== void 0 ? a({ minWidth: i, maxWidth: void 0 }) : p.currentTarget.value === "max" && i !== void 0 ? a({ maxWidth: i, minWidth: void 0 }) : a({ minWidth: void 0, maxWidth: void 0 });
|
|
1251
1278
|
};
|
|
1252
|
-
var
|
|
1253
|
-
|
|
1254
|
-
var
|
|
1255
|
-
|
|
1256
|
-
var
|
|
1257
|
-
|
|
1258
|
-
var
|
|
1279
|
+
var I = e.child(k);
|
|
1280
|
+
I.value = I.__value = "";
|
|
1281
|
+
var z = e.sibling(I);
|
|
1282
|
+
z.value = z.__value = "min";
|
|
1283
|
+
var b = e.sibling(z);
|
|
1284
|
+
b.value = b.__value = "max", e.reset(k);
|
|
1285
|
+
var d;
|
|
1259
1286
|
e.init_select(k), e.template_effect(() => {
|
|
1260
|
-
e.set_value(
|
|
1261
|
-
}), e.append(y,
|
|
1287
|
+
e.set_value(_, t().width ?? t().minWidth ?? t().maxWidth ?? ""), d !== (d = t().minWidth !== void 0 ? "min" : t().maxWidth !== void 0 ? "max" : "") && (k.value = k.__value = t().minWidth !== void 0 ? "min" : t().maxWidth !== void 0 ? "max" : "", e.select_option(k, t().minWidth !== void 0 ? "min" : t().maxWidth !== void 0 ? "max" : ""));
|
|
1288
|
+
}), e.append(y, N);
|
|
1262
1289
|
}
|
|
1263
1290
|
});
|
|
1264
1291
|
var T = e.sibling(m, 2);
|
|
1265
1292
|
F(T, {
|
|
1266
1293
|
label: "Height",
|
|
1267
|
-
onReset: () =>
|
|
1294
|
+
onReset: () => a({
|
|
1268
1295
|
height: void 0,
|
|
1269
1296
|
minHeight: void 0,
|
|
1270
1297
|
maxHeight: void 0
|
|
1271
1298
|
}),
|
|
1272
1299
|
children: (y, x) => {
|
|
1273
|
-
var
|
|
1274
|
-
e.remove_input_defaults(
|
|
1275
|
-
const
|
|
1276
|
-
|
|
1300
|
+
var N = Nr(), _ = e.first_child(N);
|
|
1301
|
+
e.remove_input_defaults(_), _.__input = (p) => {
|
|
1302
|
+
const i = p.currentTarget.value ? Number(p.currentTarget.value) : void 0, c = t().minHeight !== void 0 ? "min" : t().maxHeight !== void 0 ? "max" : "";
|
|
1303
|
+
a(c === "min" ? { height: i, minHeight: i, maxHeight: void 0 } : c === "max" ? { height: i, maxHeight: i, minHeight: void 0 } : { height: i });
|
|
1277
1304
|
};
|
|
1278
|
-
var k = e.sibling(
|
|
1305
|
+
var k = e.sibling(_, 2);
|
|
1279
1306
|
k.__change = (p) => {
|
|
1280
|
-
const
|
|
1281
|
-
p.currentTarget.value === "min" &&
|
|
1307
|
+
const i = t().height ?? t().minHeight ?? t().maxHeight;
|
|
1308
|
+
p.currentTarget.value === "min" && i !== void 0 ? a({ minHeight: i, maxHeight: void 0 }) : p.currentTarget.value === "max" && i !== void 0 ? a({ maxHeight: i, minHeight: void 0 }) : a({ minHeight: void 0, maxHeight: void 0 });
|
|
1282
1309
|
};
|
|
1283
|
-
var
|
|
1284
|
-
|
|
1285
|
-
var
|
|
1286
|
-
|
|
1287
|
-
var
|
|
1288
|
-
|
|
1289
|
-
var
|
|
1310
|
+
var I = e.child(k);
|
|
1311
|
+
I.value = I.__value = "";
|
|
1312
|
+
var z = e.sibling(I);
|
|
1313
|
+
z.value = z.__value = "min";
|
|
1314
|
+
var b = e.sibling(z);
|
|
1315
|
+
b.value = b.__value = "max", e.reset(k);
|
|
1316
|
+
var d;
|
|
1290
1317
|
e.init_select(k), e.template_effect(() => {
|
|
1291
|
-
e.set_value(
|
|
1292
|
-
}), e.append(y,
|
|
1318
|
+
e.set_value(_, t().height ?? t().minHeight ?? t().maxHeight ?? ""), d !== (d = t().minHeight !== void 0 ? "min" : t().maxHeight !== void 0 ? "max" : "") && (k.value = k.__value = t().minHeight !== void 0 ? "min" : t().maxHeight !== void 0 ? "max" : "", e.select_option(k, t().minHeight !== void 0 ? "min" : t().maxHeight !== void 0 ? "max" : ""));
|
|
1319
|
+
}), e.append(y, N);
|
|
1293
1320
|
}
|
|
1294
1321
|
});
|
|
1295
1322
|
var v = e.sibling(T, 2);
|
|
1296
1323
|
F(v, {
|
|
1297
1324
|
label: "Maintain Aspect",
|
|
1298
|
-
onReset: () =>
|
|
1325
|
+
onReset: () => a({ maintainAspectRatio: fe.maintainAspectRatio }),
|
|
1299
1326
|
children: (y, x) => {
|
|
1300
|
-
var
|
|
1301
|
-
e.remove_input_defaults(
|
|
1327
|
+
var N = Ir();
|
|
1328
|
+
e.remove_input_defaults(N), N.__change = (_) => a({ maintainAspectRatio: _.currentTarget.checked }), e.template_effect(() => e.set_checked(N, t().maintainAspectRatio ?? !0)), e.append(y, N);
|
|
1302
1329
|
}
|
|
1303
|
-
}), e.append(
|
|
1330
|
+
}), e.append(u, h);
|
|
1304
1331
|
};
|
|
1305
|
-
e.if(f, (
|
|
1306
|
-
t().mode === "scale" ?
|
|
1332
|
+
e.if(f, (u) => {
|
|
1333
|
+
t().mode === "scale" ? u(g) : u(w, !1);
|
|
1307
1334
|
});
|
|
1308
1335
|
}
|
|
1309
|
-
e.reset(
|
|
1336
|
+
e.reset(s), e.reset(r), e.append(o, r), e.pop();
|
|
1310
1337
|
}
|
|
1311
1338
|
e.delegate(["change", "input"]);
|
|
1312
|
-
var
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
e.
|
|
1320
|
-
var
|
|
1339
|
+
var Wr = e.from_html('<span class="section-toggle svelte-1h62jm0"> </span>'), Dr = e.from_html('<div class="section-content svelte-1h62jm0"><!></div>'), Xr = e.from_html('<div class="section svelte-1h62jm0"><div class="section-header svelte-1h62jm0"><h3 class="section-title svelte-1h62jm0"> </h3> <!></div> <!></div>');
|
|
1340
|
+
const Yr = {
|
|
1341
|
+
hash: "svelte-1h62jm0",
|
|
1342
|
+
code: ".section.svelte-1h62jm0 {border-top:1px solid var(--color-border, #ccc);border-bottom:1px solid var(--color-border, #ccc);background:var(--color-surface, #fff);min-width:0;}.section-header.svelte-1h62jm0 {display:flex;align-items:center;justify-content:space-between;padding:0.75rem 0;border-bottom:1px solid var(--color-border, #eee);cursor:pointer;}.section-title.svelte-1h62jm0 {margin:0;font-size:0.875rem;font-weight:600;text-transform:uppercase;color:var(--color-text-muted, #666);}.section-toggle.svelte-1h62jm0 {font-size:0.75rem;color:var(--color-text-muted, #666);}.section-content.svelte-1h62jm0 {padding:0.75rem 0;display:flex;flex-direction:column;gap:0.75rem;}"
|
|
1343
|
+
};
|
|
1344
|
+
function qr(o, n) {
|
|
1345
|
+
e.push(n, !0), e.append_styles(o, Yr);
|
|
1346
|
+
let t = e.state(e.proxy(n.config.defaultCollapsed ?? !1));
|
|
1347
|
+
var a = Xr(), r = e.child(a);
|
|
1348
|
+
r.__click = () => n.config.collapsible && e.set(t, !e.get(t));
|
|
1349
|
+
var s = e.child(r), l = e.child(s, !0);
|
|
1350
|
+
e.reset(s);
|
|
1351
|
+
var f = e.sibling(s, 2);
|
|
1321
1352
|
{
|
|
1322
|
-
var
|
|
1323
|
-
var m =
|
|
1324
|
-
e.reset(m), e.template_effect(() => e.set_text(T, e.get(t) ? "▼" : "▲")), e.append(
|
|
1353
|
+
var g = (h) => {
|
|
1354
|
+
var m = Wr(), T = e.child(m, !0);
|
|
1355
|
+
e.reset(m), e.template_effect(() => e.set_text(T, e.get(t) ? "▼" : "▲")), e.append(h, m);
|
|
1325
1356
|
};
|
|
1326
|
-
e.if(f, (
|
|
1327
|
-
|
|
1357
|
+
e.if(f, (h) => {
|
|
1358
|
+
n.config.collapsible && h(g);
|
|
1328
1359
|
});
|
|
1329
1360
|
}
|
|
1330
|
-
e.reset(
|
|
1331
|
-
var w = e.sibling(
|
|
1361
|
+
e.reset(r);
|
|
1362
|
+
var w = e.sibling(r, 2);
|
|
1332
1363
|
{
|
|
1333
|
-
var
|
|
1334
|
-
var m =
|
|
1335
|
-
e.snippet(T, () =>
|
|
1364
|
+
var u = (h) => {
|
|
1365
|
+
var m = Dr(), T = e.child(m);
|
|
1366
|
+
e.snippet(T, () => n.children), e.reset(m), e.append(h, m);
|
|
1336
1367
|
};
|
|
1337
|
-
e.if(w, (
|
|
1338
|
-
e.get(t) ||
|
|
1368
|
+
e.if(w, (h) => {
|
|
1369
|
+
e.get(t) || h(u);
|
|
1339
1370
|
});
|
|
1340
1371
|
}
|
|
1341
|
-
e.reset(
|
|
1372
|
+
e.reset(a), e.template_effect(() => e.set_text(l, n.config.title)), e.append(o, a), e.pop();
|
|
1342
1373
|
}
|
|
1343
1374
|
e.delegate(["click"]);
|
|
1344
|
-
var
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1375
|
+
var Br = e.from_html('<input type="checkbox"/>'), Er = e.from_html('<select class="shape-select svelte-1ani6pi"><option>None</option><option>Plane</option><option>Cylinder</option><option>Sphere</option></select>'), Zr = e.from_html('<input type="range" step="0.5" min="0.5" max="4" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="0.5" min="0.5" max="4"/>', 1), Or = e.from_html('<input type="range" step="0.05" min="0.1" max="5" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="0.05" min="0.1" max="5"/>', 1), Lr = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="0.01" min="-1" max="1"/>', 1), Hr = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="0.01" min="-1" max="1"/>', 1), Ar = e.from_html('<details class="subsection svelte-1ani6pi" open=""><summary class="subsection-title svelte-1ani6pi">Image Position & Sizing</summary> <div class="subsection-content svelte-1ani6pi"><!> <!> <!></div></details>'), Ur = e.from_html('<input type="range" step="1" min="-90" max="90" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="1" min="-90" max="90"/>', 1), Vr = e.from_html('<input type="range" step="1" min="-90" max="90" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="1" min="-90" max="90"/>', 1), Fr = e.from_html('<input type="range" step="1" min="-180" max="180" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="1" min="-180" max="180"/>', 1), Kr = e.from_html('<input type="range" step="0.1" min="0" max="3" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="0.1" min="0" max="3"/>', 1), Jr = e.from_html('<details class="subsection svelte-1ani6pi" open=""><summary class="subsection-title svelte-1ani6pi">Surface Settings</summary> <div class="subsection-content svelte-1ani6pi"><!> <!> <!> <!></div></details>'), Gr = e.from_html('<input type="range" step="10" min="50" max="2000" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="10" min="50" max="2000"/>', 1), $r = e.from_html('<input type="range" step="0.1" min="0" max="5" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="0.1" min="0" max="10"/>', 1), Qr = e.from_html('<input type="range" step="1" min="-90" max="90" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="1" min="-90" max="90"/>', 1), en = e.from_html('<input type="range" step="1" min="-180" max="180" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="1" min="-180" max="180"/>', 1), tn = e.from_html('<details class="subsection svelte-1ani6pi" open=""><summary class="subsection-title svelte-1ani6pi">Surface Settings</summary> <div class="subsection-content svelte-1ani6pi"><!> <!> <!> <!></div></details>'), rn = e.from_html('<input type="range" step="10" min="50" max="1000" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="10" min="50" max="1000"/>', 1), nn = e.from_html('<input type="range" step="1" min="-180" max="180" class="svelte-1ani6pi"/> <input type="number" class="manual-input svelte-1ani6pi" step="1" min="-180" max="180"/>', 1), an = e.from_html('<details class="subsection svelte-1ani6pi" open=""><summary class="subsection-title svelte-1ani6pi">Surface Settings</summary> <div class="subsection-content svelte-1ani6pi"><!> <!></div></details>'), sn = e.from_html('<input type="checkbox"/>'), on = e.from_html('<input type="checkbox"/>'), ln = e.from_html('<input type="checkbox"/>'), cn = e.from_html('<details class="subsection svelte-1ani6pi"><summary class="subsection-title svelte-1ani6pi">Debug Visualization</summary> <div class="subsection-content svelte-1ani6pi"><!> <!> <!></div></details>'), dn = e.from_html("<!> <!> <!> <!> <!> <!> <!>", 1), un = e.from_html("<!> <!>", 1);
|
|
1376
|
+
const pn = {
|
|
1377
|
+
hash: "svelte-1ani6pi",
|
|
1378
|
+
code: `.shape-select.svelte-1ani6pi {padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;background:var(--color-surface, #fff);}.manual-input.svelte-1ani6pi {width:60px;padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;}input[type="range"].svelte-1ani6pi {flex:1;min-width:0;max-width:100%;}.subsection.svelte-1ani6pi {margin-top:0.75rem;border-top:1px solid var(--color-border, #e0e0e0);}.subsection-title.svelte-1ani6pi {padding:0.5rem 0;font-size:0.75rem;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:var(--color-text-muted, #666);cursor:pointer;list-style:none;display:flex;align-items:center;gap:0.5rem;}.subsection-title.svelte-1ani6pi::-webkit-details-marker {display:none;}.subsection-title.svelte-1ani6pi::before {content:'▶';font-size:0.625rem;transition:transform 0.15s ease;}.subsection[open].svelte-1ani6pi > .subsection-title:where(.svelte-1ani6pi)::before {transform:rotate(90deg);}.subsection-content.svelte-1ani6pi {padding-bottom:0.25rem;}`
|
|
1379
|
+
};
|
|
1380
|
+
function mn(o, n) {
|
|
1381
|
+
e.push(n, !0), e.append_styles(o, pn);
|
|
1382
|
+
const t = e.derived(() => n.effect ?? Qe), a = e.derived(() => e.get(t).image ?? se), r = e.derived(() => e.get(t).debug ?? ve);
|
|
1383
|
+
function s(T) {
|
|
1349
1384
|
const v = { ...e.get(t), ...T };
|
|
1350
|
-
|
|
1385
|
+
n.onChange(v);
|
|
1351
1386
|
}
|
|
1352
1387
|
function l(T) {
|
|
1353
|
-
|
|
1388
|
+
s({
|
|
1354
1389
|
image: {
|
|
1355
|
-
...
|
|
1390
|
+
...se,
|
|
1356
1391
|
...e.get(t).image,
|
|
1357
1392
|
...T
|
|
1358
1393
|
}
|
|
1359
1394
|
});
|
|
1360
1395
|
}
|
|
1361
1396
|
function f(T) {
|
|
1362
|
-
|
|
1397
|
+
s({
|
|
1363
1398
|
debug: { ...ve, ...e.get(t).debug, ...T }
|
|
1364
1399
|
});
|
|
1365
1400
|
}
|
|
1366
|
-
function
|
|
1367
|
-
|
|
1401
|
+
function g(T) {
|
|
1402
|
+
s({
|
|
1368
1403
|
cylinder: {
|
|
1369
1404
|
...ce,
|
|
1370
1405
|
...e.get(t).cylinder,
|
|
@@ -1373,12 +1408,12 @@ function ia(r, a) {
|
|
|
1373
1408
|
});
|
|
1374
1409
|
}
|
|
1375
1410
|
function w(T) {
|
|
1376
|
-
|
|
1377
|
-
plane: { ...
|
|
1411
|
+
s({
|
|
1412
|
+
plane: { ...ae, ...e.get(t).plane, ...T }
|
|
1378
1413
|
});
|
|
1379
1414
|
}
|
|
1380
|
-
function
|
|
1381
|
-
|
|
1415
|
+
function u(T) {
|
|
1416
|
+
s({
|
|
1382
1417
|
sphere: {
|
|
1383
1418
|
...ke,
|
|
1384
1419
|
...e.get(t).sphere,
|
|
@@ -1386,310 +1421,310 @@ function ia(r, a) {
|
|
|
1386
1421
|
}
|
|
1387
1422
|
});
|
|
1388
1423
|
}
|
|
1389
|
-
function
|
|
1390
|
-
e.get(t).enabled ?
|
|
1424
|
+
function h() {
|
|
1425
|
+
e.get(t).enabled ? s({ enabled: !1 }) : s({
|
|
1391
1426
|
enabled: !0,
|
|
1392
1427
|
shape: "plane",
|
|
1393
|
-
plane: e.get(t).plane ?? { ...
|
|
1394
|
-
image: e.get(t).image ?? { ...
|
|
1428
|
+
plane: e.get(t).plane ?? { ...ae },
|
|
1429
|
+
image: e.get(t).image ?? { ...se }
|
|
1395
1430
|
});
|
|
1396
1431
|
}
|
|
1397
1432
|
const m = { id: "warp", title: "Warp", collapsible: !0 };
|
|
1398
|
-
|
|
1433
|
+
qr(o, {
|
|
1399
1434
|
get config() {
|
|
1400
1435
|
return m;
|
|
1401
1436
|
},
|
|
1402
1437
|
children: (T, v) => {
|
|
1403
|
-
var y =
|
|
1438
|
+
var y = un(), x = e.first_child(y);
|
|
1404
1439
|
F(x, {
|
|
1405
1440
|
label: "Enabled",
|
|
1406
|
-
children: (k,
|
|
1407
|
-
var
|
|
1408
|
-
e.remove_input_defaults(
|
|
1441
|
+
children: (k, I) => {
|
|
1442
|
+
var z = Br();
|
|
1443
|
+
e.remove_input_defaults(z), z.__change = h, e.template_effect(() => e.set_checked(z, e.get(t).enabled)), e.append(k, z);
|
|
1409
1444
|
}
|
|
1410
1445
|
});
|
|
1411
|
-
var
|
|
1446
|
+
var N = e.sibling(x, 2);
|
|
1412
1447
|
{
|
|
1413
|
-
var
|
|
1414
|
-
var
|
|
1415
|
-
F(
|
|
1448
|
+
var _ = (k) => {
|
|
1449
|
+
var I = dn(), z = e.first_child(I);
|
|
1450
|
+
F(z, {
|
|
1416
1451
|
label: "Shape",
|
|
1417
|
-
children: (
|
|
1418
|
-
var
|
|
1419
|
-
|
|
1420
|
-
const
|
|
1421
|
-
|
|
1452
|
+
children: (j, q) => {
|
|
1453
|
+
var E = Er();
|
|
1454
|
+
E.__change = (D) => {
|
|
1455
|
+
const X = D.currentTarget.value;
|
|
1456
|
+
s({ shape: X }), X === "cylinder" && !e.get(t).cylinder && s({ cylinder: { ...ce } }), X === "plane" && !e.get(t).plane && s({ plane: { ...ae } }), X === "sphere" && !e.get(t).sphere && s({ sphere: { ...ke } });
|
|
1422
1457
|
};
|
|
1423
|
-
var
|
|
1424
|
-
|
|
1425
|
-
var
|
|
1426
|
-
|
|
1427
|
-
var K = e.sibling(
|
|
1458
|
+
var O = e.child(E);
|
|
1459
|
+
O.value = O.__value = "none";
|
|
1460
|
+
var Z = e.sibling(O);
|
|
1461
|
+
Z.value = Z.__value = "plane";
|
|
1462
|
+
var K = e.sibling(Z);
|
|
1428
1463
|
K.value = K.__value = "cylinder";
|
|
1429
1464
|
var H = e.sibling(K);
|
|
1430
|
-
H.value = H.__value = "sphere", e.reset(
|
|
1465
|
+
H.value = H.__value = "sphere", e.reset(E);
|
|
1431
1466
|
var G;
|
|
1432
|
-
e.init_select(
|
|
1433
|
-
G !== (G = e.get(t).shape) && (
|
|
1434
|
-
}), e.append(
|
|
1467
|
+
e.init_select(E), e.template_effect(() => {
|
|
1468
|
+
G !== (G = e.get(t).shape) && (E.value = (E.__value = e.get(t).shape) ?? "", e.select_option(E, e.get(t).shape));
|
|
1469
|
+
}), e.append(j, E);
|
|
1435
1470
|
}
|
|
1436
1471
|
});
|
|
1437
|
-
var
|
|
1438
|
-
F(
|
|
1472
|
+
var b = e.sibling(z, 2);
|
|
1473
|
+
F(b, {
|
|
1439
1474
|
label: "Quality",
|
|
1440
|
-
onReset: () =>
|
|
1441
|
-
children: (
|
|
1442
|
-
var
|
|
1443
|
-
e.remove_input_defaults(
|
|
1444
|
-
var
|
|
1445
|
-
e.remove_input_defaults(
|
|
1446
|
-
e.set_value(
|
|
1447
|
-
}), e.append(
|
|
1475
|
+
onReset: () => s({ quality: Qe.quality }),
|
|
1476
|
+
children: (j, q) => {
|
|
1477
|
+
var E = Zr(), O = e.first_child(E);
|
|
1478
|
+
e.remove_input_defaults(O), O.__input = (K) => s({ quality: Number(K.currentTarget.value) });
|
|
1479
|
+
var Z = e.sibling(O, 2);
|
|
1480
|
+
e.remove_input_defaults(Z), Z.__input = (K) => s({ quality: Number(K.currentTarget.value) }), e.template_effect(() => {
|
|
1481
|
+
e.set_value(O, e.get(t).quality ?? 1), e.set_value(Z, e.get(t).quality ?? 1);
|
|
1482
|
+
}), e.append(j, E);
|
|
1448
1483
|
}
|
|
1449
1484
|
});
|
|
1450
|
-
var
|
|
1485
|
+
var d = e.sibling(b, 2);
|
|
1451
1486
|
{
|
|
1452
|
-
var p = (
|
|
1453
|
-
var
|
|
1454
|
-
F(
|
|
1487
|
+
var p = (j) => {
|
|
1488
|
+
var q = Ar(), E = e.sibling(e.child(q), 2), O = e.child(E);
|
|
1489
|
+
F(O, {
|
|
1455
1490
|
label: "Scale",
|
|
1456
|
-
onReset: () => l({ scale:
|
|
1491
|
+
onReset: () => l({ scale: se.scale }),
|
|
1457
1492
|
children: (H, G) => {
|
|
1458
|
-
var
|
|
1459
|
-
e.remove_input_defaults(
|
|
1460
|
-
var
|
|
1461
|
-
e.remove_input_defaults(
|
|
1462
|
-
e.set_value(
|
|
1463
|
-
}), e.append(H,
|
|
1493
|
+
var D = Or(), X = e.first_child(D);
|
|
1494
|
+
e.remove_input_defaults(X), X.__input = (P) => l({ scale: Number(P.currentTarget.value) });
|
|
1495
|
+
var W = e.sibling(X, 2);
|
|
1496
|
+
e.remove_input_defaults(W), W.__input = (P) => l({ scale: Number(P.currentTarget.value) }), e.template_effect(() => {
|
|
1497
|
+
e.set_value(X, e.get(a).scale), e.set_value(W, e.get(a).scale);
|
|
1498
|
+
}), e.append(H, D);
|
|
1464
1499
|
}
|
|
1465
1500
|
});
|
|
1466
|
-
var
|
|
1467
|
-
F(
|
|
1501
|
+
var Z = e.sibling(O, 2);
|
|
1502
|
+
F(Z, {
|
|
1468
1503
|
label: "Translate X",
|
|
1469
|
-
onReset: () => l({ translateX:
|
|
1504
|
+
onReset: () => l({ translateX: se.translateX }),
|
|
1470
1505
|
children: (H, G) => {
|
|
1471
|
-
var
|
|
1472
|
-
e.remove_input_defaults(
|
|
1473
|
-
var
|
|
1474
|
-
e.remove_input_defaults(
|
|
1475
|
-
e.set_value(
|
|
1476
|
-
}), e.append(H,
|
|
1506
|
+
var D = Lr(), X = e.first_child(D);
|
|
1507
|
+
e.remove_input_defaults(X), X.__input = (P) => l({ translateX: Number(P.currentTarget.value) });
|
|
1508
|
+
var W = e.sibling(X, 2);
|
|
1509
|
+
e.remove_input_defaults(W), W.__input = (P) => l({ translateX: Number(P.currentTarget.value) }), e.template_effect(() => {
|
|
1510
|
+
e.set_value(X, e.get(a).translateX), e.set_value(W, e.get(a).translateX);
|
|
1511
|
+
}), e.append(H, D);
|
|
1477
1512
|
}
|
|
1478
1513
|
});
|
|
1479
|
-
var K = e.sibling(
|
|
1514
|
+
var K = e.sibling(Z, 2);
|
|
1480
1515
|
F(K, {
|
|
1481
1516
|
label: "Translate Y",
|
|
1482
|
-
onReset: () => l({ translateY:
|
|
1517
|
+
onReset: () => l({ translateY: se.translateY }),
|
|
1483
1518
|
children: (H, G) => {
|
|
1484
|
-
var
|
|
1485
|
-
e.remove_input_defaults(
|
|
1486
|
-
var
|
|
1487
|
-
e.remove_input_defaults(
|
|
1488
|
-
e.set_value(
|
|
1489
|
-
}), e.append(H,
|
|
1519
|
+
var D = Hr(), X = e.first_child(D);
|
|
1520
|
+
e.remove_input_defaults(X), X.__input = (P) => l({ translateY: Number(P.currentTarget.value) });
|
|
1521
|
+
var W = e.sibling(X, 2);
|
|
1522
|
+
e.remove_input_defaults(W), W.__input = (P) => l({ translateY: Number(P.currentTarget.value) }), e.template_effect(() => {
|
|
1523
|
+
e.set_value(X, e.get(a).translateY), e.set_value(W, e.get(a).translateY);
|
|
1524
|
+
}), e.append(H, D);
|
|
1490
1525
|
}
|
|
1491
|
-
}), e.reset(
|
|
1526
|
+
}), e.reset(E), e.reset(q), e.append(j, q);
|
|
1492
1527
|
};
|
|
1493
|
-
e.if(
|
|
1494
|
-
e.get(t).shape !== "none" &&
|
|
1528
|
+
e.if(d, (j) => {
|
|
1529
|
+
e.get(t).shape !== "none" && j(p);
|
|
1495
1530
|
});
|
|
1496
1531
|
}
|
|
1497
|
-
var
|
|
1532
|
+
var i = e.sibling(d, 2);
|
|
1498
1533
|
{
|
|
1499
|
-
var c = (
|
|
1500
|
-
const
|
|
1501
|
-
var
|
|
1502
|
-
F(
|
|
1534
|
+
var c = (j) => {
|
|
1535
|
+
const q = e.derived(() => e.get(t).plane);
|
|
1536
|
+
var E = Jr(), O = e.sibling(e.child(E), 2), Z = e.child(O);
|
|
1537
|
+
F(Z, {
|
|
1503
1538
|
label: "Rotation X",
|
|
1504
|
-
onReset: () => w({ rotationX:
|
|
1505
|
-
children: (
|
|
1506
|
-
var
|
|
1507
|
-
e.remove_input_defaults(
|
|
1508
|
-
var V = e.sibling(
|
|
1539
|
+
onReset: () => w({ rotationX: ae.rotationX }),
|
|
1540
|
+
children: (D, X) => {
|
|
1541
|
+
var W = Ur(), P = e.first_child(W);
|
|
1542
|
+
e.remove_input_defaults(P), P.__input = (A) => w({ rotationX: Number(A.currentTarget.value) });
|
|
1543
|
+
var V = e.sibling(P, 2);
|
|
1509
1544
|
e.remove_input_defaults(V), V.__input = (A) => w({ rotationX: Number(A.currentTarget.value) }), e.template_effect(() => {
|
|
1510
|
-
e.set_value(
|
|
1511
|
-
}), e.append(
|
|
1545
|
+
e.set_value(P, e.get(q).rotationX), e.set_value(V, e.get(q).rotationX);
|
|
1546
|
+
}), e.append(D, W);
|
|
1512
1547
|
}
|
|
1513
1548
|
});
|
|
1514
|
-
var K = e.sibling(
|
|
1549
|
+
var K = e.sibling(Z, 2);
|
|
1515
1550
|
F(K, {
|
|
1516
1551
|
label: "Rotation Y",
|
|
1517
|
-
onReset: () => w({ rotationY:
|
|
1518
|
-
children: (
|
|
1519
|
-
var
|
|
1520
|
-
e.remove_input_defaults(
|
|
1521
|
-
var V = e.sibling(
|
|
1552
|
+
onReset: () => w({ rotationY: ae.rotationY }),
|
|
1553
|
+
children: (D, X) => {
|
|
1554
|
+
var W = Vr(), P = e.first_child(W);
|
|
1555
|
+
e.remove_input_defaults(P), P.__input = (A) => w({ rotationY: Number(A.currentTarget.value) });
|
|
1556
|
+
var V = e.sibling(P, 2);
|
|
1522
1557
|
e.remove_input_defaults(V), V.__input = (A) => w({ rotationY: Number(A.currentTarget.value) }), e.template_effect(() => {
|
|
1523
|
-
e.set_value(
|
|
1524
|
-
}), e.append(
|
|
1558
|
+
e.set_value(P, e.get(q).rotationY), e.set_value(V, e.get(q).rotationY);
|
|
1559
|
+
}), e.append(D, W);
|
|
1525
1560
|
}
|
|
1526
1561
|
});
|
|
1527
1562
|
var H = e.sibling(K, 2);
|
|
1528
1563
|
F(H, {
|
|
1529
1564
|
label: "Rotation Z",
|
|
1530
|
-
onReset: () => w({ rotationZ:
|
|
1531
|
-
children: (
|
|
1532
|
-
var
|
|
1533
|
-
e.remove_input_defaults(
|
|
1534
|
-
var V = e.sibling(
|
|
1565
|
+
onReset: () => w({ rotationZ: ae.rotationZ }),
|
|
1566
|
+
children: (D, X) => {
|
|
1567
|
+
var W = Fr(), P = e.first_child(W);
|
|
1568
|
+
e.remove_input_defaults(P), P.__input = (A) => w({ rotationZ: Number(A.currentTarget.value) });
|
|
1569
|
+
var V = e.sibling(P, 2);
|
|
1535
1570
|
e.remove_input_defaults(V), V.__input = (A) => w({ rotationZ: Number(A.currentTarget.value) }), e.template_effect(() => {
|
|
1536
|
-
e.set_value(
|
|
1537
|
-
}), e.append(
|
|
1571
|
+
e.set_value(P, e.get(q).rotationZ), e.set_value(V, e.get(q).rotationZ);
|
|
1572
|
+
}), e.append(D, W);
|
|
1538
1573
|
}
|
|
1539
1574
|
});
|
|
1540
1575
|
var G = e.sibling(H, 2);
|
|
1541
1576
|
F(G, {
|
|
1542
1577
|
label: "Perspective",
|
|
1543
|
-
onReset: () => w({ depthScale:
|
|
1544
|
-
children: (
|
|
1545
|
-
var
|
|
1546
|
-
e.remove_input_defaults(
|
|
1547
|
-
var V = e.sibling(
|
|
1578
|
+
onReset: () => w({ depthScale: ae.depthScale }),
|
|
1579
|
+
children: (D, X) => {
|
|
1580
|
+
var W = Kr(), P = e.first_child(W);
|
|
1581
|
+
e.remove_input_defaults(P), P.__input = (A) => w({ depthScale: Number(A.currentTarget.value) });
|
|
1582
|
+
var V = e.sibling(P, 2);
|
|
1548
1583
|
e.remove_input_defaults(V), V.__input = (A) => w({ depthScale: Number(A.currentTarget.value) }), e.template_effect(() => {
|
|
1549
|
-
e.set_value(
|
|
1550
|
-
}), e.append(
|
|
1584
|
+
e.set_value(P, e.get(q).depthScale), e.set_value(V, e.get(q).depthScale);
|
|
1585
|
+
}), e.append(D, W);
|
|
1551
1586
|
}
|
|
1552
|
-
}), e.reset(
|
|
1587
|
+
}), e.reset(O), e.reset(E), e.append(j, E);
|
|
1553
1588
|
};
|
|
1554
|
-
e.if(
|
|
1555
|
-
e.get(t).shape === "plane" && e.get(t).plane &&
|
|
1589
|
+
e.if(i, (j) => {
|
|
1590
|
+
e.get(t).shape === "plane" && e.get(t).plane && j(c);
|
|
1556
1591
|
});
|
|
1557
1592
|
}
|
|
1558
|
-
var M = e.sibling(
|
|
1593
|
+
var M = e.sibling(i, 2);
|
|
1559
1594
|
{
|
|
1560
|
-
var
|
|
1561
|
-
const
|
|
1562
|
-
var
|
|
1563
|
-
F(
|
|
1595
|
+
var S = (j) => {
|
|
1596
|
+
const q = e.derived(() => e.get(t).cylinder);
|
|
1597
|
+
var E = tn(), O = e.sibling(e.child(E), 2), Z = e.child(O);
|
|
1598
|
+
F(Z, {
|
|
1564
1599
|
label: "Diameter",
|
|
1565
|
-
onReset: () =>
|
|
1566
|
-
children: (
|
|
1567
|
-
var
|
|
1568
|
-
e.remove_input_defaults(
|
|
1569
|
-
var V = e.sibling(
|
|
1570
|
-
e.remove_input_defaults(V), V.__input = (A) =>
|
|
1571
|
-
e.set_value(
|
|
1572
|
-
}), e.append(
|
|
1600
|
+
onReset: () => g({ diameter: ce.diameter }),
|
|
1601
|
+
children: (D, X) => {
|
|
1602
|
+
var W = Gr(), P = e.first_child(W);
|
|
1603
|
+
e.remove_input_defaults(P), P.__input = (A) => g({ diameter: Number(A.currentTarget.value) });
|
|
1604
|
+
var V = e.sibling(P, 2);
|
|
1605
|
+
e.remove_input_defaults(V), V.__input = (A) => g({ diameter: Number(A.currentTarget.value) }), e.template_effect(() => {
|
|
1606
|
+
e.set_value(P, e.get(q).diameter), e.set_value(V, e.get(q).diameter);
|
|
1607
|
+
}), e.append(D, W);
|
|
1573
1608
|
}
|
|
1574
1609
|
});
|
|
1575
|
-
var K = e.sibling(
|
|
1610
|
+
var K = e.sibling(Z, 2);
|
|
1576
1611
|
F(K, {
|
|
1577
1612
|
label: "Perspective",
|
|
1578
|
-
onReset: () =>
|
|
1579
|
-
children: (
|
|
1580
|
-
var
|
|
1581
|
-
e.remove_input_defaults(
|
|
1582
|
-
var V = e.sibling(
|
|
1583
|
-
e.remove_input_defaults(V), V.__input = (A) =>
|
|
1584
|
-
e.set_value(
|
|
1585
|
-
}), e.append(
|
|
1613
|
+
onReset: () => g({ perspective: ce.perspective }),
|
|
1614
|
+
children: (D, X) => {
|
|
1615
|
+
var W = $r(), P = e.first_child(W);
|
|
1616
|
+
e.remove_input_defaults(P), P.__input = (A) => g({ perspective: Number(A.currentTarget.value) });
|
|
1617
|
+
var V = e.sibling(P, 2);
|
|
1618
|
+
e.remove_input_defaults(V), V.__input = (A) => g({ perspective: Number(A.currentTarget.value) }), e.template_effect(() => {
|
|
1619
|
+
e.set_value(P, e.get(q).perspective ?? 1), e.set_value(V, e.get(q).perspective ?? 1);
|
|
1620
|
+
}), e.append(D, W);
|
|
1586
1621
|
}
|
|
1587
1622
|
});
|
|
1588
1623
|
var H = e.sibling(K, 2);
|
|
1589
1624
|
F(H, {
|
|
1590
1625
|
label: "Tilt (X)",
|
|
1591
|
-
onReset: () =>
|
|
1592
|
-
children: (
|
|
1593
|
-
var
|
|
1594
|
-
e.remove_input_defaults(
|
|
1595
|
-
var V = e.sibling(
|
|
1596
|
-
e.remove_input_defaults(V), V.__input = (A) =>
|
|
1597
|
-
e.set_value(
|
|
1598
|
-
}), e.append(
|
|
1626
|
+
onReset: () => g({ rotationX: ce.rotationX }),
|
|
1627
|
+
children: (D, X) => {
|
|
1628
|
+
var W = Qr(), P = e.first_child(W);
|
|
1629
|
+
e.remove_input_defaults(P), P.__input = (A) => g({ rotationX: Number(A.currentTarget.value) });
|
|
1630
|
+
var V = e.sibling(P, 2);
|
|
1631
|
+
e.remove_input_defaults(V), V.__input = (A) => g({ rotationX: Number(A.currentTarget.value) }), e.template_effect(() => {
|
|
1632
|
+
e.set_value(P, e.get(q).rotationX), e.set_value(V, e.get(q).rotationX);
|
|
1633
|
+
}), e.append(D, W);
|
|
1599
1634
|
}
|
|
1600
1635
|
});
|
|
1601
1636
|
var G = e.sibling(H, 2);
|
|
1602
1637
|
F(G, {
|
|
1603
1638
|
label: "Spin (Z)",
|
|
1604
|
-
onReset: () =>
|
|
1605
|
-
children: (
|
|
1606
|
-
var
|
|
1607
|
-
e.remove_input_defaults(
|
|
1608
|
-
var V = e.sibling(
|
|
1609
|
-
e.remove_input_defaults(V), V.__input = (A) =>
|
|
1610
|
-
e.set_value(
|
|
1611
|
-
}), e.append(
|
|
1639
|
+
onReset: () => g({ rotationZ: ce.rotationZ }),
|
|
1640
|
+
children: (D, X) => {
|
|
1641
|
+
var W = en(), P = e.first_child(W);
|
|
1642
|
+
e.remove_input_defaults(P), P.__input = (A) => g({ rotationZ: Number(A.currentTarget.value) });
|
|
1643
|
+
var V = e.sibling(P, 2);
|
|
1644
|
+
e.remove_input_defaults(V), V.__input = (A) => g({ rotationZ: Number(A.currentTarget.value) }), e.template_effect(() => {
|
|
1645
|
+
e.set_value(P, e.get(q).rotationZ), e.set_value(V, e.get(q).rotationZ);
|
|
1646
|
+
}), e.append(D, W);
|
|
1612
1647
|
}
|
|
1613
|
-
}), e.reset(
|
|
1648
|
+
}), e.reset(O), e.reset(E), e.append(j, E);
|
|
1614
1649
|
};
|
|
1615
|
-
e.if(M, (
|
|
1616
|
-
e.get(t).shape === "cylinder" && e.get(t).cylinder &&
|
|
1650
|
+
e.if(M, (j) => {
|
|
1651
|
+
e.get(t).shape === "cylinder" && e.get(t).cylinder && j(S);
|
|
1617
1652
|
});
|
|
1618
1653
|
}
|
|
1619
|
-
var
|
|
1654
|
+
var Y = e.sibling(M, 2);
|
|
1620
1655
|
{
|
|
1621
|
-
var J = (
|
|
1622
|
-
const
|
|
1623
|
-
var
|
|
1624
|
-
F(
|
|
1656
|
+
var J = (j) => {
|
|
1657
|
+
const q = e.derived(() => e.get(t).sphere);
|
|
1658
|
+
var E = an(), O = e.sibling(e.child(E), 2), Z = e.child(O);
|
|
1659
|
+
F(Z, {
|
|
1625
1660
|
label: "Radius",
|
|
1626
|
-
onReset: () =>
|
|
1661
|
+
onReset: () => u({ radius: ke.radius }),
|
|
1627
1662
|
children: (H, G) => {
|
|
1628
|
-
var
|
|
1629
|
-
e.remove_input_defaults(
|
|
1630
|
-
var
|
|
1631
|
-
e.remove_input_defaults(
|
|
1632
|
-
e.set_value(
|
|
1633
|
-
}), e.append(H,
|
|
1663
|
+
var D = rn(), X = e.first_child(D);
|
|
1664
|
+
e.remove_input_defaults(X), X.__input = (P) => u({ radius: Number(P.currentTarget.value) });
|
|
1665
|
+
var W = e.sibling(X, 2);
|
|
1666
|
+
e.remove_input_defaults(W), W.__input = (P) => u({ radius: Number(P.currentTarget.value) }), e.template_effect(() => {
|
|
1667
|
+
e.set_value(X, e.get(q).radius), e.set_value(W, e.get(q).radius);
|
|
1668
|
+
}), e.append(H, D);
|
|
1634
1669
|
}
|
|
1635
1670
|
});
|
|
1636
|
-
var K = e.sibling(
|
|
1671
|
+
var K = e.sibling(Z, 2);
|
|
1637
1672
|
F(K, {
|
|
1638
1673
|
label: "Spin (Z)",
|
|
1639
|
-
onReset: () =>
|
|
1674
|
+
onReset: () => u({ rotationZ: ke.rotationZ }),
|
|
1640
1675
|
children: (H, G) => {
|
|
1641
|
-
var
|
|
1642
|
-
e.remove_input_defaults(
|
|
1643
|
-
var
|
|
1644
|
-
e.remove_input_defaults(
|
|
1645
|
-
e.set_value(
|
|
1646
|
-
}), e.append(H,
|
|
1676
|
+
var D = nn(), X = e.first_child(D);
|
|
1677
|
+
e.remove_input_defaults(X), X.__input = (P) => u({ rotationZ: Number(P.currentTarget.value) });
|
|
1678
|
+
var W = e.sibling(X, 2);
|
|
1679
|
+
e.remove_input_defaults(W), W.__input = (P) => u({ rotationZ: Number(P.currentTarget.value) }), e.template_effect(() => {
|
|
1680
|
+
e.set_value(X, e.get(q).rotationZ), e.set_value(W, e.get(q).rotationZ);
|
|
1681
|
+
}), e.append(H, D);
|
|
1647
1682
|
}
|
|
1648
|
-
}), e.reset(
|
|
1683
|
+
}), e.reset(O), e.reset(E), e.append(j, E);
|
|
1649
1684
|
};
|
|
1650
|
-
e.if(
|
|
1651
|
-
e.get(t).shape === "sphere" && e.get(t).sphere &&
|
|
1685
|
+
e.if(Y, (j) => {
|
|
1686
|
+
e.get(t).shape === "sphere" && e.get(t).sphere && j(J);
|
|
1652
1687
|
});
|
|
1653
1688
|
}
|
|
1654
|
-
var
|
|
1689
|
+
var B = e.sibling(Y, 2);
|
|
1655
1690
|
{
|
|
1656
|
-
var U = (
|
|
1657
|
-
var
|
|
1658
|
-
F(
|
|
1691
|
+
var U = (j) => {
|
|
1692
|
+
var q = cn(), E = e.sibling(e.child(q), 2), O = e.child(E);
|
|
1693
|
+
F(O, {
|
|
1659
1694
|
label: "Show Grid/Bounds",
|
|
1660
1695
|
onReset: () => f({ showBounds: ve.showBounds }),
|
|
1661
1696
|
children: (H, G) => {
|
|
1662
|
-
var
|
|
1663
|
-
e.remove_input_defaults(
|
|
1697
|
+
var D = sn();
|
|
1698
|
+
e.remove_input_defaults(D), D.__change = (X) => f({ showBounds: X.currentTarget.checked }), e.template_effect(() => e.set_checked(D, e.get(r).showBounds)), e.append(H, D);
|
|
1664
1699
|
}
|
|
1665
1700
|
});
|
|
1666
|
-
var
|
|
1667
|
-
F(
|
|
1701
|
+
var Z = e.sibling(O, 2);
|
|
1702
|
+
F(Z, {
|
|
1668
1703
|
label: "Depth Shader",
|
|
1669
1704
|
onReset: () => f({ showDepthVis: ve.showDepthVis }),
|
|
1670
1705
|
children: (H, G) => {
|
|
1671
|
-
var
|
|
1672
|
-
e.remove_input_defaults(
|
|
1706
|
+
var D = on();
|
|
1707
|
+
e.remove_input_defaults(D), D.__change = (X) => f({ showDepthVis: X.currentTarget.checked }), e.template_effect(() => e.set_checked(D, e.get(r).showDepthVis)), e.append(H, D);
|
|
1673
1708
|
}
|
|
1674
1709
|
});
|
|
1675
|
-
var K = e.sibling(
|
|
1710
|
+
var K = e.sibling(Z, 2);
|
|
1676
1711
|
F(K, {
|
|
1677
1712
|
label: "Crosshair",
|
|
1678
1713
|
onReset: () => f({ showCrosshair: ve.showCrosshair }),
|
|
1679
1714
|
children: (H, G) => {
|
|
1680
|
-
var
|
|
1681
|
-
e.remove_input_defaults(
|
|
1715
|
+
var D = ln();
|
|
1716
|
+
e.remove_input_defaults(D), D.__change = (X) => f({ showCrosshair: X.currentTarget.checked }), e.template_effect(() => e.set_checked(D, e.get(r).showCrosshair)), e.append(H, D);
|
|
1682
1717
|
}
|
|
1683
|
-
}), e.reset(
|
|
1718
|
+
}), e.reset(E), e.reset(q), e.append(j, q);
|
|
1684
1719
|
};
|
|
1685
|
-
e.if(
|
|
1686
|
-
e.get(t).shape !== "none" &&
|
|
1720
|
+
e.if(B, (j) => {
|
|
1721
|
+
e.get(t).shape !== "none" && j(U);
|
|
1687
1722
|
});
|
|
1688
1723
|
}
|
|
1689
|
-
e.append(k,
|
|
1724
|
+
e.append(k, I);
|
|
1690
1725
|
};
|
|
1691
|
-
e.if(
|
|
1692
|
-
e.get(t).enabled && k(
|
|
1726
|
+
e.if(N, (k) => {
|
|
1727
|
+
e.get(t).enabled && k(_);
|
|
1693
1728
|
});
|
|
1694
1729
|
}
|
|
1695
1730
|
e.append(T, y);
|
|
@@ -1698,783 +1733,806 @@ function ia(r, a) {
|
|
|
1698
1733
|
}), e.pop();
|
|
1699
1734
|
}
|
|
1700
1735
|
e.delegate(["change", "input"]);
|
|
1701
|
-
var
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1736
|
+
var vn = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="-1" max="1"/>', 1), fn = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="-1" max="1"/>', 1), gn = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="-1" max="1"/>', 1), hn = e.from_html('<input type="range" step="1" min="-180" max="180" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="1" min="-180" max="180"/>', 1), bn = e.from_html('<input type="range" step="0.01" min="-2" max="2" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="-2" max="2"/>', 1), _n = e.from_html('<input type="range" step="0.01" min="0.1" max="3" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="0.1" max="3"/>', 1), yn = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="-1" max="1"/>', 1), wn = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="-1" max="1"/>', 1), xn = e.from_html('<input type="range" step="0.01" min="-1" max="1" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="0.01" min="-1" max="1"/>', 1), kn = e.from_html('<input type="range" step="1" min="-100" max="100" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="1" min="-100" max="100"/>', 1), Mn = e.from_html('<input type="range" step="1" min="-100" max="100" class="svelte-1f6utug"/> <input type="number" class="manual-input svelte-1f6utug" step="1" min="-100" max="100"/>', 1), Tn = e.from_html('<details class="section svelte-1f6utug" open=""><summary class="section-title svelte-1f6utug">Restyle</summary> <div class="section-content svelte-1f6utug"><details class="subsection svelte-1f6utug" open=""><summary class="subsection-title svelte-1f6utug">Basic Adjustments</summary> <div class="subsection-content svelte-1f6utug"><!> <!> <!> <!></div></details> <details class="subsection svelte-1f6utug" open=""><summary class="subsection-title svelte-1f6utug">Exposure & Tone</summary> <div class="subsection-content svelte-1f6utug"><!> <!> <!> <!></div></details> <details class="subsection svelte-1f6utug" open=""><summary class="subsection-title svelte-1f6utug">Color & White Balance</summary> <div class="subsection-content svelte-1f6utug"><!> <!> <!></div></details></div></details>');
|
|
1737
|
+
const zn = {
|
|
1738
|
+
hash: "svelte-1f6utug",
|
|
1739
|
+
code: `.section.svelte-1f6utug {border-top:1px solid var(--color-border, #ccc);border-bottom:1px solid var(--color-border, #ccc);background:var(--color-surface, #fff);min-width:0;}.section-title.svelte-1f6utug {padding:0.75rem 0;font-size:0.875rem;font-weight:600;text-transform:uppercase;color:var(--color-text-muted, #666);cursor:pointer;list-style:none;display:flex;align-items:center;gap:0.5rem;border-bottom:1px solid var(--color-border, #eee);}.section-title.svelte-1f6utug::-webkit-details-marker {display:none;}.section-title.svelte-1f6utug::before {content:'▶';font-size:0.625rem;transition:transform 0.15s ease;}.section[open].svelte-1f6utug > .section-title:where(.svelte-1f6utug)::before {transform:rotate(90deg);}.section-content.svelte-1f6utug {padding:0.75rem 0;display:flex;flex-direction:column;gap:0.75rem;}.manual-input.svelte-1f6utug {width:60px;padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;}input[type="range"].svelte-1f6utug {flex:1;min-width:0;max-width:100%;}.subsection.svelte-1f6utug {margin-top:0.75rem;border-top:1px solid var(--color-border, #e0e0e0);}.subsection.svelte-1f6utug:first-child {margin-top:0;border-top:none;}.subsection-title.svelte-1f6utug {padding:0.5rem 0;font-size:0.75rem;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:var(--color-text-muted, #666);cursor:pointer;list-style:none;display:flex;align-items:center;gap:0.5rem;}.subsection-title.svelte-1f6utug::-webkit-details-marker {display:none;}.subsection-title.svelte-1f6utug::before {content:'▶';font-size:0.625rem;transition:transform 0.15s ease;}.subsection[open].svelte-1f6utug > .subsection-title:where(.svelte-1f6utug)::before {transform:rotate(90deg);}.subsection-content.svelte-1f6utug {padding-bottom:0.25rem;}`
|
|
1740
|
+
};
|
|
1741
|
+
function Sn(o, n) {
|
|
1742
|
+
e.push(n, !0), e.append_styles(o, zn);
|
|
1743
|
+
let t = e.prop(n, "effect", 3, ee);
|
|
1744
|
+
function a(d) {
|
|
1745
|
+
n.onChange({ ...t(), ...d });
|
|
1707
1746
|
}
|
|
1708
|
-
var
|
|
1709
|
-
F(
|
|
1747
|
+
var r = Tn(), s = e.sibling(e.child(r), 2), l = e.child(s), f = e.sibling(e.child(l), 2), g = e.child(f);
|
|
1748
|
+
F(g, {
|
|
1710
1749
|
label: "Brightness",
|
|
1711
|
-
onReset: () =>
|
|
1712
|
-
children: (
|
|
1713
|
-
var
|
|
1714
|
-
e.remove_input_defaults(c), c.__input = (
|
|
1750
|
+
onReset: () => a({ brightness: ee.brightness }),
|
|
1751
|
+
children: (d, p) => {
|
|
1752
|
+
var i = vn(), c = e.first_child(i);
|
|
1753
|
+
e.remove_input_defaults(c), c.__input = (S) => a({ brightness: Number(S.currentTarget.value) });
|
|
1715
1754
|
var M = e.sibling(c, 2);
|
|
1716
|
-
e.remove_input_defaults(M), M.__input = (
|
|
1755
|
+
e.remove_input_defaults(M), M.__input = (S) => a({ brightness: Number(S.currentTarget.value) }), e.template_effect(() => {
|
|
1717
1756
|
e.set_value(c, t().brightness), e.set_value(M, t().brightness);
|
|
1718
|
-
}), e.append(
|
|
1757
|
+
}), e.append(d, i);
|
|
1719
1758
|
}
|
|
1720
1759
|
});
|
|
1721
|
-
var w = e.sibling(
|
|
1760
|
+
var w = e.sibling(g, 2);
|
|
1722
1761
|
F(w, {
|
|
1723
1762
|
label: "Contrast",
|
|
1724
|
-
onReset: () =>
|
|
1725
|
-
children: (
|
|
1726
|
-
var
|
|
1727
|
-
e.remove_input_defaults(c), c.__input = (
|
|
1763
|
+
onReset: () => a({ contrast: ee.contrast }),
|
|
1764
|
+
children: (d, p) => {
|
|
1765
|
+
var i = fn(), c = e.first_child(i);
|
|
1766
|
+
e.remove_input_defaults(c), c.__input = (S) => a({ contrast: Number(S.currentTarget.value) });
|
|
1728
1767
|
var M = e.sibling(c, 2);
|
|
1729
|
-
e.remove_input_defaults(M), M.__input = (
|
|
1768
|
+
e.remove_input_defaults(M), M.__input = (S) => a({ contrast: Number(S.currentTarget.value) }), e.template_effect(() => {
|
|
1730
1769
|
e.set_value(c, t().contrast), e.set_value(M, t().contrast);
|
|
1731
|
-
}), e.append(
|
|
1770
|
+
}), e.append(d, i);
|
|
1732
1771
|
}
|
|
1733
1772
|
});
|
|
1734
|
-
var
|
|
1735
|
-
F(
|
|
1773
|
+
var u = e.sibling(w, 2);
|
|
1774
|
+
F(u, {
|
|
1736
1775
|
label: "Saturation",
|
|
1737
|
-
onReset: () =>
|
|
1738
|
-
children: (
|
|
1739
|
-
var
|
|
1740
|
-
e.remove_input_defaults(c), c.__input = (
|
|
1776
|
+
onReset: () => a({ saturation: ee.saturation }),
|
|
1777
|
+
children: (d, p) => {
|
|
1778
|
+
var i = gn(), c = e.first_child(i);
|
|
1779
|
+
e.remove_input_defaults(c), c.__input = (S) => a({ saturation: Number(S.currentTarget.value) });
|
|
1741
1780
|
var M = e.sibling(c, 2);
|
|
1742
|
-
e.remove_input_defaults(M), M.__input = (
|
|
1781
|
+
e.remove_input_defaults(M), M.__input = (S) => a({ saturation: Number(S.currentTarget.value) }), e.template_effect(() => {
|
|
1743
1782
|
e.set_value(c, t().saturation), e.set_value(M, t().saturation);
|
|
1744
|
-
}), e.append(
|
|
1783
|
+
}), e.append(d, i);
|
|
1745
1784
|
}
|
|
1746
1785
|
});
|
|
1747
|
-
var
|
|
1748
|
-
F(
|
|
1786
|
+
var h = e.sibling(u, 2);
|
|
1787
|
+
F(h, {
|
|
1749
1788
|
label: "Hue (°)",
|
|
1750
|
-
onReset: () =>
|
|
1751
|
-
children: (
|
|
1752
|
-
var
|
|
1753
|
-
e.remove_input_defaults(c), c.__input = (
|
|
1789
|
+
onReset: () => a({ hue: ee.hue }),
|
|
1790
|
+
children: (d, p) => {
|
|
1791
|
+
var i = hn(), c = e.first_child(i);
|
|
1792
|
+
e.remove_input_defaults(c), c.__input = (S) => a({ hue: Number(S.currentTarget.value) });
|
|
1754
1793
|
var M = e.sibling(c, 2);
|
|
1755
|
-
e.remove_input_defaults(M), M.__input = (
|
|
1794
|
+
e.remove_input_defaults(M), M.__input = (S) => a({ hue: Number(S.currentTarget.value) }), e.template_effect(() => {
|
|
1756
1795
|
e.set_value(c, t().hue), e.set_value(M, t().hue);
|
|
1757
|
-
}), e.append(
|
|
1796
|
+
}), e.append(d, i);
|
|
1758
1797
|
}
|
|
1759
1798
|
}), e.reset(f), e.reset(l);
|
|
1760
1799
|
var m = e.sibling(l, 2), T = e.sibling(e.child(m), 2), v = e.child(T);
|
|
1761
1800
|
F(v, {
|
|
1762
1801
|
label: "Exposure",
|
|
1763
|
-
onReset: () =>
|
|
1764
|
-
children: (
|
|
1765
|
-
var
|
|
1766
|
-
e.remove_input_defaults(c), c.__input = (
|
|
1802
|
+
onReset: () => a({ exposure: ee.exposure }),
|
|
1803
|
+
children: (d, p) => {
|
|
1804
|
+
var i = bn(), c = e.first_child(i);
|
|
1805
|
+
e.remove_input_defaults(c), c.__input = (S) => a({ exposure: Number(S.currentTarget.value) });
|
|
1767
1806
|
var M = e.sibling(c, 2);
|
|
1768
|
-
e.remove_input_defaults(M), M.__input = (
|
|
1807
|
+
e.remove_input_defaults(M), M.__input = (S) => a({ exposure: Number(S.currentTarget.value) }), e.template_effect(() => {
|
|
1769
1808
|
e.set_value(c, t().exposure), e.set_value(M, t().exposure);
|
|
1770
|
-
}), e.append(
|
|
1809
|
+
}), e.append(d, i);
|
|
1771
1810
|
}
|
|
1772
1811
|
});
|
|
1773
1812
|
var y = e.sibling(v, 2);
|
|
1774
1813
|
F(y, {
|
|
1775
1814
|
label: "Gamma",
|
|
1776
|
-
onReset: () =>
|
|
1777
|
-
children: (
|
|
1778
|
-
var
|
|
1779
|
-
e.remove_input_defaults(c), c.__input = (
|
|
1815
|
+
onReset: () => a({ gamma: ee.gamma }),
|
|
1816
|
+
children: (d, p) => {
|
|
1817
|
+
var i = _n(), c = e.first_child(i);
|
|
1818
|
+
e.remove_input_defaults(c), c.__input = (S) => a({ gamma: Number(S.currentTarget.value) });
|
|
1780
1819
|
var M = e.sibling(c, 2);
|
|
1781
|
-
e.remove_input_defaults(M), M.__input = (
|
|
1820
|
+
e.remove_input_defaults(M), M.__input = (S) => a({ gamma: Number(S.currentTarget.value) }), e.template_effect(() => {
|
|
1782
1821
|
e.set_value(c, t().gamma), e.set_value(M, t().gamma);
|
|
1783
|
-
}), e.append(
|
|
1822
|
+
}), e.append(d, i);
|
|
1784
1823
|
}
|
|
1785
1824
|
});
|
|
1786
1825
|
var x = e.sibling(y, 2);
|
|
1787
1826
|
F(x, {
|
|
1788
1827
|
label: "Shadows",
|
|
1789
|
-
onReset: () =>
|
|
1790
|
-
children: (
|
|
1791
|
-
var
|
|
1792
|
-
e.remove_input_defaults(c), c.__input = (
|
|
1828
|
+
onReset: () => a({ shadows: ee.shadows }),
|
|
1829
|
+
children: (d, p) => {
|
|
1830
|
+
var i = yn(), c = e.first_child(i);
|
|
1831
|
+
e.remove_input_defaults(c), c.__input = (S) => a({ shadows: Number(S.currentTarget.value) });
|
|
1793
1832
|
var M = e.sibling(c, 2);
|
|
1794
|
-
e.remove_input_defaults(M), M.__input = (
|
|
1833
|
+
e.remove_input_defaults(M), M.__input = (S) => a({ shadows: Number(S.currentTarget.value) }), e.template_effect(() => {
|
|
1795
1834
|
e.set_value(c, t().shadows), e.set_value(M, t().shadows);
|
|
1796
|
-
}), e.append(
|
|
1835
|
+
}), e.append(d, i);
|
|
1797
1836
|
}
|
|
1798
1837
|
});
|
|
1799
|
-
var
|
|
1800
|
-
F(
|
|
1838
|
+
var N = e.sibling(x, 2);
|
|
1839
|
+
F(N, {
|
|
1801
1840
|
label: "Highlights",
|
|
1802
|
-
onReset: () =>
|
|
1803
|
-
children: (
|
|
1804
|
-
var
|
|
1805
|
-
e.remove_input_defaults(c), c.__input = (
|
|
1841
|
+
onReset: () => a({ highlights: ee.highlights }),
|
|
1842
|
+
children: (d, p) => {
|
|
1843
|
+
var i = wn(), c = e.first_child(i);
|
|
1844
|
+
e.remove_input_defaults(c), c.__input = (S) => a({ highlights: Number(S.currentTarget.value) });
|
|
1806
1845
|
var M = e.sibling(c, 2);
|
|
1807
|
-
e.remove_input_defaults(M), M.__input = (
|
|
1846
|
+
e.remove_input_defaults(M), M.__input = (S) => a({ highlights: Number(S.currentTarget.value) }), e.template_effect(() => {
|
|
1808
1847
|
e.set_value(c, t().highlights), e.set_value(M, t().highlights);
|
|
1809
|
-
}), e.append(
|
|
1848
|
+
}), e.append(d, i);
|
|
1810
1849
|
}
|
|
1811
1850
|
}), e.reset(T), e.reset(m);
|
|
1812
|
-
var
|
|
1813
|
-
F(
|
|
1851
|
+
var _ = e.sibling(m, 2), k = e.sibling(e.child(_), 2), I = e.child(k);
|
|
1852
|
+
F(I, {
|
|
1814
1853
|
label: "Vibrance",
|
|
1815
|
-
onReset: () =>
|
|
1816
|
-
children: (
|
|
1817
|
-
var
|
|
1818
|
-
e.remove_input_defaults(c), c.__input = (
|
|
1854
|
+
onReset: () => a({ vibrance: ee.vibrance }),
|
|
1855
|
+
children: (d, p) => {
|
|
1856
|
+
var i = xn(), c = e.first_child(i);
|
|
1857
|
+
e.remove_input_defaults(c), c.__input = (S) => a({ vibrance: Number(S.currentTarget.value) });
|
|
1819
1858
|
var M = e.sibling(c, 2);
|
|
1820
|
-
e.remove_input_defaults(M), M.__input = (
|
|
1859
|
+
e.remove_input_defaults(M), M.__input = (S) => a({ vibrance: Number(S.currentTarget.value) }), e.template_effect(() => {
|
|
1821
1860
|
e.set_value(c, t().vibrance), e.set_value(M, t().vibrance);
|
|
1822
|
-
}), e.append(
|
|
1861
|
+
}), e.append(d, i);
|
|
1823
1862
|
}
|
|
1824
1863
|
});
|
|
1825
|
-
var
|
|
1826
|
-
F(
|
|
1864
|
+
var z = e.sibling(I, 2);
|
|
1865
|
+
F(z, {
|
|
1827
1866
|
label: "Temperature",
|
|
1828
|
-
onReset: () =>
|
|
1829
|
-
children: (
|
|
1830
|
-
var
|
|
1831
|
-
e.remove_input_defaults(c), c.__input = (
|
|
1867
|
+
onReset: () => a({ temperature: ee.temperature }),
|
|
1868
|
+
children: (d, p) => {
|
|
1869
|
+
var i = kn(), c = e.first_child(i);
|
|
1870
|
+
e.remove_input_defaults(c), c.__input = (S) => a({ temperature: Number(S.currentTarget.value) });
|
|
1832
1871
|
var M = e.sibling(c, 2);
|
|
1833
|
-
e.remove_input_defaults(M), M.__input = (
|
|
1872
|
+
e.remove_input_defaults(M), M.__input = (S) => a({ temperature: Number(S.currentTarget.value) }), e.template_effect(() => {
|
|
1834
1873
|
e.set_value(c, t().temperature), e.set_value(M, t().temperature);
|
|
1835
|
-
}), e.append(
|
|
1874
|
+
}), e.append(d, i);
|
|
1836
1875
|
}
|
|
1837
1876
|
});
|
|
1838
|
-
var
|
|
1839
|
-
F(
|
|
1877
|
+
var b = e.sibling(z, 2);
|
|
1878
|
+
F(b, {
|
|
1840
1879
|
label: "Tint",
|
|
1841
|
-
onReset: () =>
|
|
1842
|
-
children: (
|
|
1843
|
-
var
|
|
1844
|
-
e.remove_input_defaults(c), c.__input = (
|
|
1880
|
+
onReset: () => a({ tint: ee.tint }),
|
|
1881
|
+
children: (d, p) => {
|
|
1882
|
+
var i = Mn(), c = e.first_child(i);
|
|
1883
|
+
e.remove_input_defaults(c), c.__input = (S) => a({ tint: Number(S.currentTarget.value) });
|
|
1845
1884
|
var M = e.sibling(c, 2);
|
|
1846
|
-
e.remove_input_defaults(M), M.__input = (
|
|
1885
|
+
e.remove_input_defaults(M), M.__input = (S) => a({ tint: Number(S.currentTarget.value) }), e.template_effect(() => {
|
|
1847
1886
|
e.set_value(c, t().tint), e.set_value(M, t().tint);
|
|
1848
|
-
}), e.append(
|
|
1887
|
+
}), e.append(d, i);
|
|
1849
1888
|
}
|
|
1850
|
-
}), e.reset(k), e.reset(
|
|
1889
|
+
}), e.reset(k), e.reset(_), e.reset(s), e.reset(r), e.append(o, r), e.pop();
|
|
1851
1890
|
}
|
|
1852
1891
|
e.delegate(["input"]);
|
|
1853
|
-
var
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
function
|
|
1862
|
-
const c =
|
|
1863
|
-
|
|
1864
|
-
}
|
|
1865
|
-
function
|
|
1866
|
-
const c =
|
|
1867
|
-
|
|
1868
|
-
}
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1892
|
+
var Nn = e.from_html('<div class="layer-name-section svelte-et76o3"><label class="form-label svelte-et76o3">Layer Name (for overrides)</label> <input type="text" class="form-input svelte-et76o3" placeholder="e.g., front, back, logo"/> <p class="form-hint svelte-et76o3">Use this name as the key when overriding images in the renderer</p></div>'), In = e.from_html('<div class="layer-controls svelte-et76o3"><div class="layer-header svelte-et76o3"><button class="visibility-toggle svelte-et76o3"><!></button> <span class="layer-preview svelte-et76o3"><img alt="Layer preview" class="svelte-et76o3"/></span> <button class="delete-btn svelte-et76o3" aria-label="Delete layer"><!></button></div> <!> <div class="sections svelte-et76o3"><!> <!> <!> <!></div></div>');
|
|
1893
|
+
const Cn = {
|
|
1894
|
+
hash: "svelte-et76o3",
|
|
1895
|
+
code: ".layer-controls.svelte-et76o3 {border-radius:4px;padding-top:0.75rem;padding-bottom:0.75rem;margin-bottom:0.5rem;background:var(--color-surface, #fff);}.layer-header.svelte-et76o3 {display:flex;align-items:center;gap:0.5rem;margin-bottom:0.75rem;padding-bottom:0.75rem;border-bottom:1px solid var(--color-border, #eee);}.visibility-toggle.svelte-et76o3 {background:none;border:none;cursor:pointer;padding:0.25rem;display:flex;align-items:center;justify-content:center;color:var(--color-text, #000);}.layer-preview.svelte-et76o3 {flex:1;display:flex;align-items:center;justify-content:center;height:40px;overflow:hidden;border-radius:4px;background:#f5f5f5;}.layer-preview.svelte-et76o3 img:where(.svelte-et76o3) {max-width:100%;max-height:100%;object-fit:contain;}.delete-btn.svelte-et76o3 {background:#ef4444;color:white;border:none;border-radius:4px;width:24px;height:24px;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;}.delete-btn.svelte-et76o3:hover {background:#dc2626;}.layer-name-section.svelte-et76o3 {padding:0 0.75rem;margin-bottom:0.75rem;}.layer-name-section.svelte-et76o3 .form-label:where(.svelte-et76o3) {display:block;font-size:0.75rem;font-weight:500;color:var(--color-text-muted, #666);margin-bottom:0.25rem;text-transform:uppercase;letter-spacing:0.5px;}.layer-name-section.svelte-et76o3 .form-input:where(.svelte-et76o3) {width:100%;padding:0.375rem 0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;font-family:inherit;}.layer-name-section.svelte-et76o3 .form-input:where(.svelte-et76o3):focus {outline:none;border-color:var(--color-primary, #3b82f6);}.form-hint.svelte-et76o3 {font-size:0.75rem;color:var(--color-text-muted, #666);margin:0.25rem 0 0 0;}.sections.svelte-et76o3 {display:flex;flex-direction:column;gap:0;overflow:hidden;min-width:0;}"
|
|
1896
|
+
};
|
|
1897
|
+
function Pn(o, n) {
|
|
1898
|
+
e.push(n, !0), e.append_styles(o, Cn);
|
|
1899
|
+
const t = e.derived(() => n.layer.effects.find((c) => c.type === "resize") ?? fe), a = e.derived(() => n.layer.effects.find((c) => c.type === "restyle") ?? ee), r = e.derived(() => n.layer.effects.find((i) => i.type === "warp"));
|
|
1900
|
+
function s(i) {
|
|
1901
|
+
const c = n.layer.effects.filter((M) => M.type !== "resize");
|
|
1902
|
+
n.onEffectsChange([...c, i]);
|
|
1903
|
+
}
|
|
1904
|
+
function l(i) {
|
|
1905
|
+
const c = n.layer.effects.filter((M) => M.type !== "restyle");
|
|
1906
|
+
n.onEffectsChange([...c, i]);
|
|
1907
|
+
}
|
|
1908
|
+
function f(i) {
|
|
1909
|
+
const c = n.layer.effects.filter((M) => M.type !== "warp");
|
|
1910
|
+
i ? n.onEffectsChange([...c, i]) : n.onEffectsChange(c);
|
|
1911
|
+
}
|
|
1912
|
+
var g = In(), w = e.child(g), u = e.child(w);
|
|
1913
|
+
u.__click = () => n.onVisibilityChange(!n.layer.visible);
|
|
1914
|
+
var h = e.child(u);
|
|
1872
1915
|
{
|
|
1873
|
-
var m = (
|
|
1874
|
-
|
|
1875
|
-
}, T = (
|
|
1876
|
-
|
|
1916
|
+
var m = (i) => {
|
|
1917
|
+
cr(i, {});
|
|
1918
|
+
}, T = (i) => {
|
|
1919
|
+
ur(i, {});
|
|
1877
1920
|
};
|
|
1878
|
-
e.if(
|
|
1879
|
-
|
|
1921
|
+
e.if(h, (i) => {
|
|
1922
|
+
n.layer.visible ? i(m) : i(T, !1);
|
|
1880
1923
|
});
|
|
1881
1924
|
}
|
|
1882
|
-
e.reset(
|
|
1883
|
-
var v = e.sibling(
|
|
1925
|
+
e.reset(u);
|
|
1926
|
+
var v = e.sibling(u, 2), y = e.child(v);
|
|
1884
1927
|
e.reset(v);
|
|
1885
1928
|
var x = e.sibling(v, 2);
|
|
1886
|
-
x.__click = function(...
|
|
1887
|
-
|
|
1929
|
+
x.__click = function(...i) {
|
|
1930
|
+
n.onDelete?.apply(this, i);
|
|
1888
1931
|
};
|
|
1889
|
-
var
|
|
1890
|
-
Ue(
|
|
1891
|
-
var
|
|
1932
|
+
var N = e.child(x);
|
|
1933
|
+
Ue(N, {}), e.reset(x), e.reset(w);
|
|
1934
|
+
var _ = e.sibling(w, 2);
|
|
1892
1935
|
{
|
|
1893
|
-
var k = (
|
|
1894
|
-
var c =
|
|
1895
|
-
e.remove_input_defaults(
|
|
1896
|
-
e.set_attribute(M, "for", `layer-name-${
|
|
1897
|
-
}), e.append(
|
|
1936
|
+
var k = (i) => {
|
|
1937
|
+
var c = Nn(), M = e.child(c), S = e.sibling(M, 2);
|
|
1938
|
+
e.remove_input_defaults(S), S.__input = (Y) => n.onNameChange(Y.currentTarget.value), e.next(2), e.reset(c), e.template_effect(() => {
|
|
1939
|
+
e.set_attribute(M, "for", `layer-name-${n.layer.id ?? ""}`), e.set_attribute(S, "id", `layer-name-${n.layer.id ?? ""}`), e.set_value(S, n.layer.name || "");
|
|
1940
|
+
}), e.append(i, c);
|
|
1898
1941
|
};
|
|
1899
|
-
e.if(
|
|
1900
|
-
|
|
1942
|
+
e.if(_, (i) => {
|
|
1943
|
+
n.onNameChange && i(k);
|
|
1901
1944
|
});
|
|
1902
1945
|
}
|
|
1903
|
-
var
|
|
1904
|
-
|
|
1946
|
+
var I = e.sibling(_, 2), z = e.child(I);
|
|
1947
|
+
jr(z, {
|
|
1905
1948
|
get effect() {
|
|
1906
1949
|
return e.get(t);
|
|
1907
1950
|
},
|
|
1908
|
-
onChange:
|
|
1951
|
+
onChange: s
|
|
1909
1952
|
});
|
|
1910
|
-
var
|
|
1911
|
-
|
|
1953
|
+
var b = e.sibling(z, 2);
|
|
1954
|
+
Sn(b, {
|
|
1912
1955
|
get effect() {
|
|
1913
|
-
return e.get(
|
|
1956
|
+
return e.get(a);
|
|
1914
1957
|
},
|
|
1915
1958
|
onChange: l
|
|
1916
1959
|
});
|
|
1917
|
-
var
|
|
1918
|
-
|
|
1960
|
+
var d = e.sibling(b, 2);
|
|
1961
|
+
Mr(d, {
|
|
1919
1962
|
get transform() {
|
|
1920
|
-
return
|
|
1963
|
+
return n.layer.transform;
|
|
1921
1964
|
},
|
|
1922
1965
|
get opacity() {
|
|
1923
|
-
return
|
|
1966
|
+
return n.layer.opacity;
|
|
1924
1967
|
},
|
|
1925
1968
|
get canvasWidth() {
|
|
1926
|
-
return
|
|
1969
|
+
return n.canvasWidth;
|
|
1927
1970
|
},
|
|
1928
1971
|
get canvasHeight() {
|
|
1929
|
-
return
|
|
1972
|
+
return n.canvasHeight;
|
|
1930
1973
|
},
|
|
1931
1974
|
get onTransformChange() {
|
|
1932
|
-
return
|
|
1975
|
+
return n.onTransformChange;
|
|
1933
1976
|
},
|
|
1934
1977
|
get onOpacityChange() {
|
|
1935
|
-
return
|
|
1978
|
+
return n.onOpacityChange;
|
|
1936
1979
|
},
|
|
1937
1980
|
get layerId() {
|
|
1938
|
-
return
|
|
1981
|
+
return n.layer.id;
|
|
1939
1982
|
}
|
|
1940
1983
|
});
|
|
1941
|
-
var p = e.sibling(
|
|
1942
|
-
|
|
1984
|
+
var p = e.sibling(d, 2);
|
|
1985
|
+
mn(p, {
|
|
1943
1986
|
get effect() {
|
|
1944
|
-
return e.get(
|
|
1987
|
+
return e.get(r);
|
|
1945
1988
|
},
|
|
1946
1989
|
onChange: f
|
|
1947
|
-
}), e.reset(
|
|
1948
|
-
e.set_attribute(
|
|
1949
|
-
}), e.append(
|
|
1990
|
+
}), e.reset(I), e.reset(g), e.template_effect(() => {
|
|
1991
|
+
e.set_attribute(u, "aria-label", n.layer.visible ? "Hide layer" : "Show layer"), e.set_attribute(y, "src", n.layer.src);
|
|
1992
|
+
}), e.append(o, g), e.pop();
|
|
1950
1993
|
}
|
|
1951
1994
|
e.delegate(["click", "input"]);
|
|
1952
|
-
var
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1995
|
+
var Rn = e.from_html('<button type="button" class="modal-backdrop svelte-ta60gp" aria-label="Close modal"></button> <div><!></div>', 1);
|
|
1996
|
+
const jn = {
|
|
1997
|
+
hash: "svelte-ta60gp",
|
|
1998
|
+
code: ".modal-backdrop.svelte-ta60gp {position:fixed;inset:0;z-index:10000;background:var(--color-overlay-darker);backdrop-filter:blur(4px);border:none;padding:0;margin:0;cursor:pointer;border-radius:unset;}.modal-backdrop.svelte-ta60gp:hover {background:var(--color-overlay-darker) !important;}.modal-content.svelte-ta60gp {position:fixed;top:0;left:0;right:0;height:100dvh;z-index:10001;overflow-y:auto;-webkit-overflow-scrolling:touch;pointer-events:none;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);}.modal-content.ios-safari.svelte-ta60gp {height:100dvh;overflow-y:auto;}.modal-content.svelte-ta60gp > * {pointer-events:auto;margin:0 auto;}"
|
|
1999
|
+
};
|
|
2000
|
+
function Wn(o, n) {
|
|
2001
|
+
e.push(n, !0), e.append_styles(o, jn);
|
|
2002
|
+
let t = !1, a = !1;
|
|
2003
|
+
const r = zt && /iPhone|iPad|iPod/.test(navigator.userAgent) && !("MSStream" in window);
|
|
2004
|
+
function s(T) {
|
|
1958
2005
|
T.key === "Escape" && (T.preventDefault(), f());
|
|
1959
2006
|
}
|
|
1960
2007
|
function l() {
|
|
1961
|
-
t && (t = !1,
|
|
2008
|
+
t && (t = !1, n.onclose());
|
|
1962
2009
|
}
|
|
1963
2010
|
function f() {
|
|
1964
|
-
t && (t = !1, history.back()),
|
|
2011
|
+
t && (t = !1, history.back()), n.onclose();
|
|
1965
2012
|
}
|
|
1966
2013
|
Mt(() => {
|
|
1967
|
-
|
|
1968
|
-
}), Te(() => (
|
|
1969
|
-
|
|
2014
|
+
a = !0;
|
|
2015
|
+
}), Te(() => (r || (document.documentElement.style.overflow = "hidden", document.body.style.overflow = "hidden"), Tt("", { modal: !0 }), t = !0, () => {
|
|
2016
|
+
r || (document.documentElement.style.overflow = "", document.body.style.overflow = ""), t && !a && history.back();
|
|
1970
2017
|
}));
|
|
1971
|
-
var
|
|
1972
|
-
e.event("keydown", e.window,
|
|
1973
|
-
var w = e.first_child(
|
|
2018
|
+
var g = Rn();
|
|
2019
|
+
e.event("keydown", e.window, s), e.event("popstate", e.window, l);
|
|
2020
|
+
var w = e.first_child(g);
|
|
1974
2021
|
w.__click = f;
|
|
1975
|
-
var
|
|
1976
|
-
let
|
|
1977
|
-
var m = e.child(
|
|
1978
|
-
e.snippet(m, () =>
|
|
2022
|
+
var u = e.sibling(w, 2);
|
|
2023
|
+
let h;
|
|
2024
|
+
var m = e.child(u);
|
|
2025
|
+
e.snippet(m, () => n.children), e.reset(u), e.template_effect(() => h = e.set_class(u, 1, "modal-content svelte-ta60gp", null, h, { "ios-safari": r })), e.transition(7, w, () => $e, () => ({ duration: 100 })), e.transition(7, u, () => $e, () => ({ duration: 100 })), e.append(o, g), e.pop();
|
|
1979
2026
|
}
|
|
1980
2027
|
e.delegate(["click"]);
|
|
1981
|
-
var
|
|
1982
|
-
function Me(
|
|
1983
|
-
let t = e.prop(
|
|
1984
|
-
var
|
|
2028
|
+
var Dn = e.from_svg('<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke-width="2"><path d="M12 5v14M5 12h14"></path></svg>');
|
|
2029
|
+
function Me(o, n) {
|
|
2030
|
+
let t = e.prop(n, "fontSize", 3, "1em"), a = e.prop(n, "color", 3, "currentColor");
|
|
2031
|
+
var r = Dn();
|
|
1985
2032
|
e.template_effect(() => {
|
|
1986
|
-
e.set_style(
|
|
1987
|
-
}), e.append(
|
|
2033
|
+
e.set_style(r, `font-size: ${t() ?? ""};`), e.set_attribute(r, "stroke", a());
|
|
2034
|
+
}), e.append(o, r);
|
|
1988
2035
|
}
|
|
1989
|
-
const
|
|
1990
|
-
function
|
|
2036
|
+
const Ce = "product-mockups", st = "product-mockups-current";
|
|
2037
|
+
function Xn(o, n = Ce) {
|
|
1991
2038
|
try {
|
|
1992
|
-
const t =
|
|
1993
|
-
return
|
|
2039
|
+
const t = Pe(), a = t.findIndex((r) => r.id === o.id);
|
|
2040
|
+
return a >= 0 ? t[a] = { ...o, updatedAt: Date.now() } : t.push({ ...o, updatedAt: Date.now() }), localStorage.setItem(n, JSON.stringify(t)), !0;
|
|
1994
2041
|
} catch (t) {
|
|
1995
2042
|
return console.error("Failed to save mockup:", t), !1;
|
|
1996
2043
|
}
|
|
1997
2044
|
}
|
|
1998
|
-
function
|
|
2045
|
+
function Pe(o = Ce) {
|
|
1999
2046
|
try {
|
|
2000
|
-
const
|
|
2001
|
-
return
|
|
2002
|
-
const
|
|
2047
|
+
const n = localStorage.getItem(o);
|
|
2048
|
+
return n ? JSON.parse(n).map((a) => {
|
|
2049
|
+
const r = a.composition ?? a.canvas ?? { ...at };
|
|
2003
2050
|
return {
|
|
2004
|
-
...
|
|
2005
|
-
view:
|
|
2051
|
+
...a,
|
|
2052
|
+
view: a.view ?? { ...Ie },
|
|
2006
2053
|
composition: {
|
|
2007
|
-
...
|
|
2008
|
-
effects:
|
|
2009
|
-
layers:
|
|
2010
|
-
...
|
|
2011
|
-
effects:
|
|
2054
|
+
...r,
|
|
2055
|
+
effects: r.effects ?? [],
|
|
2056
|
+
layers: r.layers?.map((s) => ({
|
|
2057
|
+
...s,
|
|
2058
|
+
effects: s.effects ?? []
|
|
2012
2059
|
})) ?? []
|
|
2013
2060
|
}
|
|
2014
2061
|
};
|
|
2015
2062
|
}) : [];
|
|
2016
|
-
} catch (
|
|
2017
|
-
return console.error("Failed to load mockups:",
|
|
2063
|
+
} catch (n) {
|
|
2064
|
+
return console.error("Failed to load mockups:", n), [];
|
|
2018
2065
|
}
|
|
2019
2066
|
}
|
|
2020
|
-
function
|
|
2021
|
-
return
|
|
2067
|
+
function Yn(o, n = Ce) {
|
|
2068
|
+
return Pe(n).find((a) => a.id === o) ?? null;
|
|
2022
2069
|
}
|
|
2023
|
-
function
|
|
2070
|
+
function qn(o, n = Ce) {
|
|
2024
2071
|
try {
|
|
2025
|
-
const
|
|
2026
|
-
return localStorage.setItem(
|
|
2072
|
+
const a = Pe(n).filter((r) => r.id !== o);
|
|
2073
|
+
return localStorage.setItem(n, JSON.stringify(a)), !0;
|
|
2027
2074
|
} catch (t) {
|
|
2028
2075
|
return console.error("Failed to delete mockup:", t), !1;
|
|
2029
2076
|
}
|
|
2030
2077
|
}
|
|
2031
|
-
function
|
|
2078
|
+
function Oe(o, n = st) {
|
|
2032
2079
|
try {
|
|
2033
|
-
|
|
2080
|
+
o ? localStorage.setItem(n, o) : localStorage.removeItem(n);
|
|
2034
2081
|
} catch (t) {
|
|
2035
2082
|
console.error("Failed to save current mockup ID:", t);
|
|
2036
2083
|
}
|
|
2037
2084
|
}
|
|
2038
|
-
function
|
|
2085
|
+
function Bn(o = st) {
|
|
2039
2086
|
try {
|
|
2040
|
-
return localStorage.getItem(
|
|
2087
|
+
return localStorage.getItem(o);
|
|
2041
2088
|
} catch {
|
|
2042
2089
|
return null;
|
|
2043
2090
|
}
|
|
2044
2091
|
}
|
|
2045
|
-
function tt(
|
|
2092
|
+
function tt(o = "Untitled Mockup") {
|
|
2046
2093
|
return {
|
|
2047
2094
|
id: crypto.randomUUID(),
|
|
2048
|
-
name:
|
|
2049
|
-
composition: { ...
|
|
2050
|
-
view: { ...
|
|
2095
|
+
name: o,
|
|
2096
|
+
composition: { ...at },
|
|
2097
|
+
view: { ...Ie },
|
|
2051
2098
|
createdAt: Date.now(),
|
|
2052
2099
|
updatedAt: Date.now()
|
|
2053
2100
|
};
|
|
2054
2101
|
}
|
|
2055
|
-
var
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2102
|
+
var En = e.from_html('<div class="empty-state svelte-33nadc"><p class="svelte-33nadc">No mockups yet. Create your first mockup to get started!</p> <button class="new-mockup-btn primary svelte-33nadc" type="button"><!> Create Mockup</button></div>'), Zn = e.from_html('<div role="button" tabindex="0"><div class="mockup-card-header svelte-33nadc"><h3 class="mockup-card-title svelte-33nadc"> </h3> <div class="mockup-card-actions svelte-33nadc"><button class="copy-btn svelte-33nadc" type="button" aria-label="Copy config">Copy Config</button> <button class="delete-btn svelte-33nadc" type="button" aria-label="Delete mockup"><!></button></div></div> <div class="mockup-card-info svelte-33nadc"><div class="mockup-card-stat svelte-33nadc"><span class="stat-label svelte-33nadc">Layers:</span> <span class="stat-value svelte-33nadc"> </span></div> <div class="mockup-card-stat svelte-33nadc"><span class="stat-label svelte-33nadc">Size:</span> <span class="stat-value svelte-33nadc"> </span></div></div> <div class="mockup-card-footer svelte-33nadc"><div class="mockup-card-date svelte-33nadc"><span class="date-label svelte-33nadc">Updated:</span> <span class="date-value svelte-33nadc"> </span></div></div></div>'), On = e.from_html('<div class="mockup-grid svelte-33nadc"></div>'), Ln = e.from_html('<div class="mockup-list-container svelte-33nadc"><div class="mockup-list-header svelte-33nadc"><h2 class="svelte-33nadc">All Mockups</h2> <button class="new-mockup-btn svelte-33nadc" type="button"><!> New Mockup</button></div> <!></div>');
|
|
2103
|
+
const Hn = {
|
|
2104
|
+
hash: "svelte-33nadc",
|
|
2105
|
+
code: ".mockup-list-container.svelte-33nadc {background:var(--color-surface, #fff);border-radius:8px;padding:2rem;max-width:900px;width:100%;margin:2rem auto;max-height:calc(100dvh - 4rem);overflow-y:auto;box-shadow:0 10px 40px rgba(0, 0, 0, 0.2);}.mockup-list-header.svelte-33nadc {display:flex;align-items:center;justify-content:space-between;margin-bottom:2rem;gap:1rem;}.mockup-list-header.svelte-33nadc h2:where(.svelte-33nadc) {font-size:1.5rem;font-weight:600;color:var(--color-text, #111);margin:0;}.new-mockup-btn.svelte-33nadc {display:flex;align-items:center;gap:0.5rem;padding:0.5rem 1rem;background:var(--color-primary, #3b82f6);color:white;border:none;border-radius:6px;cursor:pointer;font-size:0.875rem;font-weight:500;transition:background 200ms;}.new-mockup-btn.svelte-33nadc:hover {background:var(--color-primary-dark, #2563eb);}.new-mockup-btn.primary.svelte-33nadc {margin-top:1rem;}.empty-state.svelte-33nadc {text-align:center;padding:4rem 2rem;color:var(--color-text-muted, #666);}.empty-state.svelte-33nadc p:where(.svelte-33nadc) {font-size:1rem;margin-bottom:1.5rem;}.mockup-grid.svelte-33nadc {display:grid;grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));gap:1rem;}.mockup-card.svelte-33nadc {background:var(--color-surface-alt, #f5f5f5);border:2px solid var(--color-border, #ccc);border-radius:8px;padding:1rem;cursor:pointer;transition:all 200ms;display:flex;flex-direction:column;gap:0.75rem;}.mockup-card.svelte-33nadc:hover {border-color:var(--color-primary, #3b82f6);background:var(--color-surface, #fff);transform:translateY(-2px);box-shadow:0 4px 12px rgba(0, 0, 0, 0.1);}.mockup-card.current.svelte-33nadc {border-color:var(--color-primary, #3b82f6);background:var(--color-primary-light, #eff6ff);}.mockup-card-header.svelte-33nadc {display:flex;align-items:flex-start;justify-content:space-between;gap:0.5rem;}.mockup-card-title.svelte-33nadc {font-size:1rem;font-weight:600;color:var(--color-text, #111);margin:0;flex:1;word-break:break-word;}.mockup-card-actions.svelte-33nadc {display:flex;align-items:center;gap:0.5rem;flex-shrink:0;}.copy-btn.svelte-33nadc {background:transparent;border:1px solid var(--color-primary, #3b82f6);color:var(--color-primary, #3b82f6);cursor:pointer;padding:0.25rem 0.5rem;border-radius:4px;font-size:0.75rem;transition:all 200ms;display:flex;align-items:center;justify-content:center;}.copy-btn.svelte-33nadc:hover {background:var(--color-primary, #3b82f6);color:white;}.delete-btn.svelte-33nadc {background:transparent;border:none;color:var(--color-text-muted, #666);cursor:pointer;padding:0.25rem;border-radius:4px;display:flex;align-items:center;justify-content:center;transition:all 200ms;flex-shrink:0;}.delete-btn.svelte-33nadc:hover {background:#ef4444;color:white;}.mockup-card-info.svelte-33nadc {display:flex;gap:1rem;font-size:0.875rem;}.mockup-card-stat.svelte-33nadc {display:flex;flex-direction:column;gap:0.25rem;}.stat-label.svelte-33nadc {color:var(--color-text-muted, #666);font-size:0.75rem;text-transform:uppercase;}.stat-value.svelte-33nadc {color:var(--color-text, #111);font-weight:500;}.mockup-card-footer.svelte-33nadc {margin-top:auto;padding-top:0.75rem;border-top:1px solid var(--color-border, #ccc);}.mockup-card-date.svelte-33nadc {display:flex;flex-direction:column;gap:0.25rem;font-size:0.75rem;}.date-label.svelte-33nadc {color:var(--color-text-muted, #666);text-transform:uppercase;}.date-value.svelte-33nadc {color:var(--color-text, #111);}"
|
|
2106
|
+
};
|
|
2107
|
+
function An(o, n) {
|
|
2108
|
+
e.push(n, !0), e.append_styles(o, Hn);
|
|
2109
|
+
let t = e.prop(n, "storageKey", 3, "product-mockups"), a = e.state(e.proxy([]));
|
|
2110
|
+
function r() {
|
|
2111
|
+
e.set(a, Pe(t()), !0);
|
|
2061
2112
|
}
|
|
2062
2113
|
Te(() => {
|
|
2063
|
-
|
|
2114
|
+
r();
|
|
2064
2115
|
});
|
|
2065
|
-
function
|
|
2066
|
-
|
|
2116
|
+
function s(u) {
|
|
2117
|
+
n.onSelect(u), n.onclose();
|
|
2067
2118
|
}
|
|
2068
2119
|
function l() {
|
|
2069
|
-
|
|
2120
|
+
n.onNew(), n.onclose();
|
|
2070
2121
|
}
|
|
2071
|
-
function f(
|
|
2072
|
-
|
|
2122
|
+
function f(u, h) {
|
|
2123
|
+
u.stopPropagation(), confirm("Are you sure you want to delete this mockup?") && (qn(h, t()), r());
|
|
2073
2124
|
}
|
|
2074
|
-
async function
|
|
2075
|
-
|
|
2125
|
+
async function g(u, h) {
|
|
2126
|
+
u.stopPropagation();
|
|
2076
2127
|
try {
|
|
2077
|
-
const m = JSON.stringify(
|
|
2128
|
+
const m = JSON.stringify(h, null, 2);
|
|
2078
2129
|
await navigator.clipboard.writeText(m);
|
|
2079
2130
|
} catch (m) {
|
|
2080
2131
|
console.error("Failed to copy config:", m);
|
|
2081
2132
|
}
|
|
2082
2133
|
}
|
|
2083
|
-
function w(
|
|
2084
|
-
const
|
|
2085
|
-
return
|
|
2134
|
+
function w(u) {
|
|
2135
|
+
const h = new Date(u);
|
|
2136
|
+
return h.toLocaleDateString() + " " + h.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
|
|
2086
2137
|
}
|
|
2087
|
-
|
|
2138
|
+
Wn(o, {
|
|
2088
2139
|
get onclose() {
|
|
2089
|
-
return
|
|
2140
|
+
return n.onclose;
|
|
2090
2141
|
},
|
|
2091
|
-
children: (
|
|
2092
|
-
var m =
|
|
2142
|
+
children: (u, h) => {
|
|
2143
|
+
var m = Ln(), T = e.child(m), v = e.sibling(e.child(T), 2);
|
|
2093
2144
|
v.__click = l;
|
|
2094
2145
|
var y = e.child(v);
|
|
2095
2146
|
Me(y, {}), e.next(), e.reset(v), e.reset(T);
|
|
2096
2147
|
var x = e.sibling(T, 2);
|
|
2097
2148
|
{
|
|
2098
|
-
var
|
|
2099
|
-
var
|
|
2100
|
-
|
|
2101
|
-
var
|
|
2102
|
-
Me(
|
|
2103
|
-
},
|
|
2104
|
-
var
|
|
2105
|
-
e.each(
|
|
2106
|
-
var
|
|
2149
|
+
var N = (k) => {
|
|
2150
|
+
var I = En(), z = e.sibling(e.child(I), 2);
|
|
2151
|
+
z.__click = l;
|
|
2152
|
+
var b = e.child(z);
|
|
2153
|
+
Me(b, {}), e.next(), e.reset(z), e.reset(I), e.append(k, I);
|
|
2154
|
+
}, _ = (k) => {
|
|
2155
|
+
var I = On();
|
|
2156
|
+
e.each(I, 21, () => e.get(a), (z) => z.id, (z, b) => {
|
|
2157
|
+
var d = Zn();
|
|
2107
2158
|
let p;
|
|
2108
|
-
|
|
2109
|
-
var
|
|
2159
|
+
d.__click = () => s(e.get(b)), d.__keydown = (W) => W.key === "Enter" && s(e.get(b));
|
|
2160
|
+
var i = e.child(d), c = e.child(i), M = e.child(c, !0);
|
|
2110
2161
|
e.reset(c);
|
|
2111
|
-
var
|
|
2112
|
-
|
|
2113
|
-
var J = e.sibling(
|
|
2114
|
-
J.__click = (
|
|
2115
|
-
var
|
|
2116
|
-
Ue(
|
|
2117
|
-
var U = e.sibling(
|
|
2118
|
-
e.reset(
|
|
2119
|
-
var
|
|
2120
|
-
e.reset(
|
|
2121
|
-
var H = e.sibling(U, 2), G = e.child(H),
|
|
2122
|
-
e.reset(
|
|
2123
|
-
(
|
|
2124
|
-
p = e.set_class(
|
|
2162
|
+
var S = e.sibling(c, 2), Y = e.child(S);
|
|
2163
|
+
Y.__click = (W) => g(W, e.get(b));
|
|
2164
|
+
var J = e.sibling(Y, 2);
|
|
2165
|
+
J.__click = (W) => f(W, e.get(b).id);
|
|
2166
|
+
var B = e.child(J);
|
|
2167
|
+
Ue(B, {}), e.reset(J), e.reset(S), e.reset(i);
|
|
2168
|
+
var U = e.sibling(i, 2), j = e.child(U), q = e.sibling(e.child(j), 2), E = e.child(q, !0);
|
|
2169
|
+
e.reset(q), e.reset(j);
|
|
2170
|
+
var O = e.sibling(j, 2), Z = e.sibling(e.child(O), 2), K = e.child(Z);
|
|
2171
|
+
e.reset(Z), e.reset(O), e.reset(U);
|
|
2172
|
+
var H = e.sibling(U, 2), G = e.child(H), D = e.sibling(e.child(G), 2), X = e.child(D, !0);
|
|
2173
|
+
e.reset(D), e.reset(G), e.reset(H), e.reset(d), e.template_effect(
|
|
2174
|
+
(W) => {
|
|
2175
|
+
p = e.set_class(d, 1, "mockup-card svelte-33nadc", null, p, { current: e.get(b).id === n.currentMockupId }), e.set_text(M, e.get(b).name), e.set_text(E, e.get(b).composition.layers.length), e.set_text(K, `${e.get(b).composition.width ?? ""} × ${e.get(b).composition.height ?? ""}`), e.set_text(X, W);
|
|
2125
2176
|
},
|
|
2126
|
-
[() => w(e.get(
|
|
2127
|
-
), e.append(
|
|
2128
|
-
}), e.reset(
|
|
2177
|
+
[() => w(e.get(b).updatedAt)]
|
|
2178
|
+
), e.append(z, d);
|
|
2179
|
+
}), e.reset(I), e.append(k, I);
|
|
2129
2180
|
};
|
|
2130
2181
|
e.if(x, (k) => {
|
|
2131
|
-
e.get(
|
|
2182
|
+
e.get(a).length === 0 ? k(N) : k(_, !1);
|
|
2132
2183
|
});
|
|
2133
2184
|
}
|
|
2134
|
-
e.reset(m), e.append(
|
|
2185
|
+
e.reset(m), e.append(u, m);
|
|
2135
2186
|
},
|
|
2136
2187
|
$$slots: { default: !0 }
|
|
2137
2188
|
}), e.pop();
|
|
2138
2189
|
}
|
|
2139
2190
|
e.delegate(["click", "keydown"]);
|
|
2140
|
-
var
|
|
2141
|
-
function
|
|
2142
|
-
let t = e.prop(
|
|
2143
|
-
var
|
|
2191
|
+
var Un = e.from_svg('<svg width=".4em" height="1em" viewBox="8 2 8 20" fill="none" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18l6-6-6-6"></path></svg>');
|
|
2192
|
+
function rt(o, n) {
|
|
2193
|
+
let t = e.prop(n, "fontSize", 3, "1em"), a = e.prop(n, "color", 3, "currentColor");
|
|
2194
|
+
var r = Un();
|
|
2144
2195
|
e.template_effect(() => {
|
|
2145
|
-
e.set_style(
|
|
2146
|
-
}), e.append(
|
|
2196
|
+
e.set_style(r, `font-size: ${t() ?? ""}; ${(n.rotate && `rotate: ${n.rotate};`) ?? ""}`), e.set_attribute(r, "stroke", a());
|
|
2197
|
+
}), e.append(o, r);
|
|
2147
2198
|
}
|
|
2148
|
-
const
|
|
2149
|
-
var
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2199
|
+
const Vn = "product-mockups", Fn = "product-mockups-current";
|
|
2200
|
+
var Kn = e.from_html('<header class="header-logos svelte-w47swm"><!></header>'), Jn = e.from_html('<div class="url-input-group svelte-w47swm"><input type="url" placeholder="https://example.com/image.jpg" class="svelte-w47swm"/> <button type="button" class="svelte-w47swm">Add</button></div>'), Gn = e.from_html('<div class="no-layers svelte-w47swm">No layers yet. Add an image to get started.</div>'), $n = e.from_html('<code class="layer-key-badge svelte-w47swm"> </code>'), Qn = e.from_html('<div role="button" tabindex="0"><div class="layer-item-preview svelte-w47swm"><img alt="Layer preview" class="svelte-w47swm"/></div> <div class="layer-item-info svelte-w47swm"><span class="layer-item-name svelte-w47swm"> <!></span> <div class="layer-item-actions svelte-w47swm"><button class="layer-order-btn svelte-w47swm" aria-label="Move up"><!></button> <button class="layer-order-btn svelte-w47swm" aria-label="Move down"><!></button> <button class="layer-delete-btn svelte-w47swm" aria-label="Delete layer"><!></button></div></div></div>'), ea = e.from_html('<div class="layers-list svelte-w47swm"></div>'), ta = e.from_html('<div class="canvas-header svelte-w47swm"><!></div>'), ra = e.from_html('<div class="processor-container svelte-w47swm"><sidebar class="svelte-w47swm"><!> <div class="editor-items svelte-w47swm"><div class="editor-section svelte-w47swm"><div class="mockup-name-header svelte-w47swm"><div class="mockup-title-group svelte-w47swm"><h3 class="mockup-name-title svelte-w47swm">Mockup</h3></div> <div class="mockup-buttons-group svelte-w47swm"><button class="new-mockup-btn svelte-w47swm" type="button"><!> New Mockup</button> <button class="view-all-btn svelte-w47swm" type="button">View All</button></div></div> <label class="form-label svelte-w47swm">Mockup Name</label> <div class="name-input-group svelte-w47swm"><input type="text" class="form-input name-input svelte-w47swm" placeholder="Mockup name..."/> <button class="copy-config-btn svelte-w47swm" type="button">Copy Config</button></div></div> <div class="editor-section svelte-w47swm"><div class="sidebar-title-2 svelte-w47swm">Canvas Setup</div> <div class="canvas-size-controls svelte-w47swm"><div class="form-input-group svelte-w47swm"><label class="form-label svelte-w47swm">Width</label> <input type="number" class="form-input svelte-w47swm" min="100" max="5000"/></div> <div class="form-input-group svelte-w47swm"><label class="form-label svelte-w47swm">Height</label> <input type="number" class="form-input svelte-w47swm" min="100" max="5000"/></div></div></div> <div class="editor-section svelte-w47swm"><div class="layers-header svelte-w47swm"><div class="layers-title svelte-w47swm"> </div> <div class="add-layer-buttons svelte-w47swm"><button class="add-layer-btn secondary svelte-w47swm" type="button"><!> </button> <label class="add-layer-btn svelte-w47swm"><!> File <input type="file" accept="image/*" style="display: none;"/></label></div></div> <!> <!></div> <!></div></sidebar> <div class="output-canvas svelte-w47swm"><!> <!></div> <!></div>');
|
|
2201
|
+
const na = {
|
|
2202
|
+
hash: "svelte-w47swm",
|
|
2203
|
+
code: `.form-label.svelte-w47swm {display:block;font-size:0.75rem;font-weight:500;color:var(--color-text-muted, #666);margin-bottom:0.375rem;}.form-input.svelte-w47swm {width:100%;padding-top:0.5rem;padding-bottom:0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;margin-bottom:1rem;}.form-input-group.svelte-w47swm .form-input:where(.svelte-w47swm) {margin-bottom:0;}.form-input.svelte-w47swm:focus {outline:none;border-color:var(--color-primary, #3b82f6);}.form-input-group.svelte-w47swm {display:flex;flex-direction:column;gap:0.25rem;}.processor-container.svelte-w47swm {display:flex;height:100%;overflow:hidden;}sidebar.svelte-w47swm {min-width:360px;flex-shrink:0;background:var(--color-surface, #fff);border-right:1px solid var(--color-border, #ccc);display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden;padding-left:1rem;}.header-logos.svelte-w47swm {display:flex;gap:1rem;font-size:1.5rem;padding:0.5rem;padding-right:1rem;border-bottom:1px solid var(--color-border, #ccc);align-items:center;flex-wrap:wrap;}.editor-items.svelte-w47swm {flex:1;overflow-y:auto;padding:0;padding-right:0.5rem;display:flex;flex-direction:column;}.editor-section.svelte-w47swm {border-bottom:1px solid var(--color-border, #ccc);padding:0.25rem 0 0.75rem 0;}.output-canvas.svelte-w47swm {flex:1;display:flex;min-width:0;background:var(--color-bg, #f5f5f5);overflow:hidden;position:relative;flex-shrink:0;}.canvas-header.svelte-w47swm {display:none;}.sidebar-title-2.svelte-w47swm {font-size:0.875rem;font-weight:600;text-transform:uppercase;color:var(--color-text-muted, #666);padding:0.75rem 0 0.25rem 0;margin-bottom:0.5rem;}.layers-header.svelte-w47swm {display:flex;align-items:center;justify-content:space-between;gap:0.5rem;margin-bottom:0.5rem;}.layers-title.svelte-w47swm {font-size:0.875rem;font-weight:600;text-transform:uppercase;color:var(--color-text-muted, #666);flex:1;}.add-layer-buttons.svelte-w47swm {display:flex;gap:0.25rem;}.add-layer-btn.svelte-w47swm {padding:0.375rem 0.75rem;background:var(--color-primary, #3b82f6);color:white;border:none;border-radius:4px;cursor:pointer;font-size:0.875rem;transition:background 200ms;display:flex;align-items:center;gap:0.375rem;}.add-layer-btn.svelte-w47swm:hover {background:var(--color-primary-dark, #2563eb);}.add-layer-btn.secondary.svelte-w47swm {background:transparent;color:var(--color-text, #111);border:1px solid var(--color-border, #ccc);}.add-layer-btn.secondary.svelte-w47swm:hover {background:var(--color-bg, #f5f5f5);}.url-input-group.svelte-w47swm {display:flex;gap:0.5rem;margin-top:0.5rem;padding:0.75rem;background:var(--color-surface-alt, #f5f5f5);border-radius:4px;}.url-input-group.svelte-w47swm input:where(.svelte-w47swm) {flex:1;padding-top:0.375rem;padding-bottom:0.375rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;}.url-input-group.svelte-w47swm button:where(.svelte-w47swm) {padding:0.375rem 0.75rem;background:var(--color-primary, #3b82f6);color:white;border:none;border-radius:4px;cursor:pointer;font-size:0.875rem;transition:background 200ms;}.url-input-group.svelte-w47swm button:where(.svelte-w47swm):hover {background:var(--color-primary-dark, #2563eb);}.canvas-size-controls.svelte-w47swm {display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;margin-bottom:1rem;margin-top:0;}.form-input-group.svelte-w47swm {display:flex;flex-direction:column;}.no-layers.svelte-w47swm {padding:1rem;text-align:center;color:var(--color-text-muted, #666);font-size:0.875rem;}.layers-list.svelte-w47swm {display:flex;flex-direction:column;gap:0.5rem;}.layer-item.svelte-w47swm {display:flex;align-items:center;gap:0.5rem;padding:0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;cursor:pointer;transition:all 200ms;background:var(--color-surface, #fff);}.layer-item.svelte-w47swm:hover {border-color:var(--color-primary, #3b82f6);background:var(--color-surface-alt, #f5f5f5);}.layer-item.selected.svelte-w47swm {border-color:var(--color-primary, #3b82f6);background:var(--color-primary-light, #eff6ff);}.layer-item-preview.svelte-w47swm {width:40px;height:40px;flex-shrink:0;border-radius:4px;overflow:hidden;background:#f5f5f5;display:flex;align-items:center;justify-content:center;}.layer-item-preview.svelte-w47swm img:where(.svelte-w47swm) {width:100%;height:100%;object-fit:cover;}.layer-item-info.svelte-w47swm {flex:1;display:flex;align-items:center;justify-content:space-between;gap:0.5rem;}.layer-item-name.svelte-w47swm {font-size:0.875rem;color:var(--color-text, #111);display:flex;flex-direction:column;gap:0.25rem;}.layer-key-badge.svelte-w47swm {font-size:0.7rem;font-family:monospace;background:var(--color-primary-light, #eff6ff);color:var(--color-primary, #3b82f6);padding:0.125rem 0.375rem;border-radius:3px;font-weight:500;}.layer-item-actions.svelte-w47swm {display:flex;gap:0.25rem;align-items:center;}.layer-order-btn.svelte-w47swm {background:transparent;border:1px solid var(--color-border, #ccc);border-radius:3px;width:24px;height:24px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all 200ms;color:var(--color-text, #000);padding:0;}.layer-order-btn.svelte-w47swm:hover:not(:disabled) {background:var(--color-primary, #3b82f6);border-color:var(--color-primary, #3b82f6);color:white;}.layer-order-btn.svelte-w47swm:disabled {opacity:0.3;cursor:not-allowed;}.layer-delete-btn.svelte-w47swm {background:#ef4444;color:white;border:none;border-radius:3px;display:flex;align-items:center;justify-content:center;padding:0;width:24px;height:24px;cursor:pointer;font-size:1rem;line-height:1;transition:background 200ms;}.layer-delete-btn.svelte-w47swm:hover {background:#dc2626;}.mockup-name-header.svelte-w47swm {display:flex;align-items:center;justify-content:space-between;margin-bottom:0.5rem;}.mockup-title-group.svelte-w47swm {display:flex;align-items:center;gap:0.5rem;}.mockup-buttons-group.svelte-w47swm {display:flex;align-items:center;gap:0.5rem;}.new-mockup-btn.svelte-w47swm {padding:0.375rem 0.75rem;background:var(--color-primary, #3b82f6);color:white;border:none;border-radius:4px;cursor:pointer;font-size:0.875rem;transition:background 200ms;display:flex;align-items:center;gap:0.375rem;}.new-mockup-btn.svelte-w47swm:hover {background:var(--color-primary-dark, #2563eb);}.mockup-name-title.svelte-w47swm {font-size:0.875rem;font-weight:600;text-transform:uppercase;color:var(--color-text-muted, #666);margin:0;}.view-all-btn.svelte-w47swm {padding:0.375rem 0.75rem;background:transparent;color:var(--color-primary, #3b82f6);border:1px solid var(--color-primary, #3b82f6);border-radius:4px;cursor:pointer;font-size:0.875rem;transition:all 200ms;}.view-all-btn.svelte-w47swm:hover {background:var(--color-primary, #3b82f6);color:white;}.form-label.svelte-w47swm {display:block;font-size:0.875rem;font-weight:500;color:var(--color-text, #111);margin-bottom:0.25rem;}.form-input.svelte-w47swm {width:100%;padding:0.5rem;border:1px solid var(--color-border, #ccc);border-radius:4px;font-size:0.875rem;margin-bottom:0.75rem;}.name-input-group.svelte-w47swm {display:flex;gap:0.5rem;align-items:stretch;}.name-input.svelte-w47swm {flex:1;margin-bottom:0;min-width:0;}.copy-config-btn.svelte-w47swm {padding:0.375rem 0.75rem;background:transparent;color:var(--color-primary, #3b82f6);border:1px solid var(--color-primary, #3b82f6);border-radius:4px;cursor:pointer;font-size:0.875rem;transition:all 200ms;white-space:nowrap;flex-shrink:0;}.copy-config-btn.svelte-w47swm:hover {background:var(--color-primary, #3b82f6);color:white;}.no-layers.svelte-w47swm {text-align:center;color:var(--color-text-muted, #666);font-size:0.875rem;padding:2rem;}
|
|
2204
|
+
|
|
2205
|
+
@media (max-width: 768px) {.processor-container.svelte-w47swm {flex-direction:column;height:100%;}sidebar.svelte-w47swm {min-width:unset;width:100%;border-right:none;border-top:1px solid var(--color-border, #ccc);order:2;flex-shrink:1;overflow-y:auto;}sidebar.svelte-w47swm .header-logos:where(.svelte-w47swm) {display:none;}.output-canvas.svelte-w47swm {order:1;flex:0 0 50vh;height:50vh;min-height:50vh;}.canvas-header.svelte-w47swm {display:flex;position:absolute;top:0;left:0;right:0;z-index:10;gap:1rem;font-size:1.5rem;padding:0.5rem 1rem;align-items:center;flex-wrap:wrap;}
|
|
2206
|
+
}`
|
|
2207
|
+
};
|
|
2208
|
+
function da(o, n) {
|
|
2209
|
+
e.push(n, !0), e.append_styles(o, na);
|
|
2210
|
+
let t = e.prop(n, "storageKey", 3, Vn), a = e.prop(n, "currentMockupKey", 3, Fn), r = e.state(e.proxy(tt())), s = e.state(""), l = e.state(null), f = e.state(""), g = e.state(!1), w = e.state(!1), u = null;
|
|
2211
|
+
e.derived(() => e.get(l) ? e.get(r).composition.layers.find((C) => C.id === e.get(l)) ?? null : null);
|
|
2212
|
+
function h(C) {
|
|
2213
|
+
const R = {
|
|
2156
2214
|
id: crypto.randomUUID(),
|
|
2157
|
-
src:
|
|
2215
|
+
src: C,
|
|
2158
2216
|
...Qt,
|
|
2159
2217
|
effects: [{ ...fe }],
|
|
2160
2218
|
transform: {
|
|
2161
|
-
x: e.get(
|
|
2162
|
-
y: e.get(
|
|
2219
|
+
x: e.get(r).composition.width / 2,
|
|
2220
|
+
y: e.get(r).composition.height / 2,
|
|
2163
2221
|
scale: 1,
|
|
2164
2222
|
rotation: 0
|
|
2165
2223
|
}
|
|
2166
2224
|
};
|
|
2167
|
-
e.get(
|
|
2225
|
+
e.get(r).composition.layers.push(R), e.set(l, R.id, !0), p();
|
|
2168
2226
|
}
|
|
2169
2227
|
function m() {
|
|
2170
|
-
const
|
|
2171
|
-
|
|
2172
|
-
}
|
|
2173
|
-
function T(
|
|
2174
|
-
const
|
|
2175
|
-
if (
|
|
2176
|
-
const
|
|
2177
|
-
|
|
2178
|
-
const
|
|
2179
|
-
typeof
|
|
2180
|
-
},
|
|
2228
|
+
const C = e.get(f).trim();
|
|
2229
|
+
C && (h(C), e.set(f, ""), e.set(g, !1));
|
|
2230
|
+
}
|
|
2231
|
+
function T(C) {
|
|
2232
|
+
const R = C.currentTarget, L = R.files?.[0];
|
|
2233
|
+
if (L) {
|
|
2234
|
+
const $ = new FileReader();
|
|
2235
|
+
$.onload = (re) => {
|
|
2236
|
+
const Q = re.target?.result;
|
|
2237
|
+
typeof Q == "string" && h(Q);
|
|
2238
|
+
}, $.readAsDataURL(L);
|
|
2181
2239
|
}
|
|
2182
|
-
|
|
2240
|
+
R.value = "";
|
|
2183
2241
|
}
|
|
2184
|
-
function v(
|
|
2185
|
-
e.set(l,
|
|
2242
|
+
function v(C) {
|
|
2243
|
+
e.set(l, C, !0);
|
|
2186
2244
|
}
|
|
2187
|
-
function y(
|
|
2188
|
-
const
|
|
2189
|
-
|
|
2245
|
+
function y(C, R) {
|
|
2246
|
+
const L = e.get(r).composition.layers.find(($) => $.id === C);
|
|
2247
|
+
L && (L.transform = R, p());
|
|
2190
2248
|
}
|
|
2191
|
-
function x(
|
|
2192
|
-
const
|
|
2193
|
-
|
|
2249
|
+
function x(C, R) {
|
|
2250
|
+
const L = e.get(r).composition.layers.find(($) => $.id === C);
|
|
2251
|
+
L && (L.opacity = R, p());
|
|
2194
2252
|
}
|
|
2195
|
-
function
|
|
2196
|
-
const
|
|
2197
|
-
|
|
2253
|
+
function N(C, R) {
|
|
2254
|
+
const L = e.get(r).composition.layers.find(($) => $.id === C);
|
|
2255
|
+
L && (L.visible = R, p());
|
|
2198
2256
|
}
|
|
2199
|
-
function
|
|
2200
|
-
const
|
|
2201
|
-
|
|
2257
|
+
function _(C, R) {
|
|
2258
|
+
const L = e.get(r).composition.layers.find(($) => $.id === C);
|
|
2259
|
+
L && (L.effects = R, p());
|
|
2202
2260
|
}
|
|
2203
|
-
function k(
|
|
2204
|
-
const
|
|
2205
|
-
|
|
2261
|
+
function k(C, R) {
|
|
2262
|
+
const L = e.get(r).composition.layers.find(($) => $.id === C);
|
|
2263
|
+
L && (L.name = R.trim() || void 0, p());
|
|
2206
2264
|
}
|
|
2207
|
-
function C
|
|
2208
|
-
e.get(
|
|
2265
|
+
function I(C) {
|
|
2266
|
+
e.get(r).composition.layers = e.get(r).composition.layers.filter((R) => R.id !== C), e.get(l) === C && e.set(l, null), p();
|
|
2209
2267
|
}
|
|
2210
|
-
function
|
|
2211
|
-
const
|
|
2212
|
-
if (
|
|
2213
|
-
const
|
|
2214
|
-
[
|
|
2268
|
+
function z(C) {
|
|
2269
|
+
const R = e.get(r).composition.layers.findIndex((L) => L.id === C);
|
|
2270
|
+
if (R > 0) {
|
|
2271
|
+
const L = [...e.get(r).composition.layers];
|
|
2272
|
+
[L[R - 1], L[R]] = [L[R], L[R - 1]], e.get(r).composition.layers = L, p();
|
|
2215
2273
|
}
|
|
2216
2274
|
}
|
|
2217
|
-
function
|
|
2218
|
-
const
|
|
2219
|
-
if (
|
|
2220
|
-
const
|
|
2221
|
-
[
|
|
2275
|
+
function b(C) {
|
|
2276
|
+
const R = e.get(r).composition.layers.findIndex((L) => L.id === C);
|
|
2277
|
+
if (R >= 0 && R < e.get(r).composition.layers.length - 1) {
|
|
2278
|
+
const L = [...e.get(r).composition.layers];
|
|
2279
|
+
[L[R], L[R + 1]] = [L[R + 1], L[R]], e.get(r).composition.layers = L, p();
|
|
2222
2280
|
}
|
|
2223
2281
|
}
|
|
2224
|
-
function
|
|
2225
|
-
e.get(
|
|
2282
|
+
function d(C, R) {
|
|
2283
|
+
e.get(r).composition.width = C, e.get(r).composition.height = R, p();
|
|
2226
2284
|
}
|
|
2227
2285
|
function p() {
|
|
2228
|
-
|
|
2286
|
+
u && clearTimeout(u), u = setTimeout(
|
|
2229
2287
|
() => {
|
|
2230
|
-
|
|
2288
|
+
i();
|
|
2231
2289
|
},
|
|
2232
2290
|
500
|
|
2233
2291
|
);
|
|
2234
2292
|
}
|
|
2235
|
-
function
|
|
2236
|
-
e.get(
|
|
2293
|
+
function i() {
|
|
2294
|
+
e.get(r).name = e.get(s) || "Untitled Mockup", e.get(r).updatedAt = Date.now(), Xn(e.get(r), t()), Oe(e.get(r).id, a());
|
|
2237
2295
|
}
|
|
2238
2296
|
function c() {
|
|
2239
|
-
|
|
2240
|
-
const
|
|
2241
|
-
e.set(
|
|
2297
|
+
i();
|
|
2298
|
+
const C = tt();
|
|
2299
|
+
e.set(r, C, !0), e.set(s, C.name, !0), Oe(null, a());
|
|
2242
2300
|
}
|
|
2243
|
-
function M(
|
|
2244
|
-
|
|
2301
|
+
function M(C) {
|
|
2302
|
+
i(), e.set(r, C, !0), e.set(s, C.name, !0), Oe(C.id, a()), e.set(w, !1);
|
|
2245
2303
|
}
|
|
2246
|
-
function
|
|
2304
|
+
function S() {
|
|
2247
2305
|
c(), e.set(w, !1);
|
|
2248
2306
|
}
|
|
2249
|
-
async function
|
|
2307
|
+
async function Y() {
|
|
2250
2308
|
try {
|
|
2251
|
-
const
|
|
2252
|
-
await navigator.clipboard.writeText(
|
|
2253
|
-
} catch (
|
|
2254
|
-
console.error("Failed to copy config:",
|
|
2309
|
+
const C = JSON.stringify(e.get(r), null, 2);
|
|
2310
|
+
await navigator.clipboard.writeText(C);
|
|
2311
|
+
} catch (C) {
|
|
2312
|
+
console.error("Failed to copy config:", C);
|
|
2255
2313
|
}
|
|
2256
2314
|
}
|
|
2257
2315
|
Te(() => {
|
|
2258
|
-
const
|
|
2259
|
-
if (
|
|
2260
|
-
const
|
|
2261
|
-
|
|
2316
|
+
const C = Bn(a());
|
|
2317
|
+
if (C) {
|
|
2318
|
+
const R = Yn(C, t());
|
|
2319
|
+
R && (e.set(r, R, !0), e.set(s, R.name, !0));
|
|
2262
2320
|
}
|
|
2263
2321
|
return () => {
|
|
2264
|
-
|
|
2322
|
+
u && clearTimeout(u), i();
|
|
2265
2323
|
};
|
|
2266
2324
|
});
|
|
2267
|
-
var J =
|
|
2325
|
+
var J = ra(), B = e.child(J), U = e.child(B);
|
|
2268
2326
|
{
|
|
2269
|
-
var
|
|
2270
|
-
var
|
|
2271
|
-
e.snippet(
|
|
2327
|
+
var j = (C) => {
|
|
2328
|
+
var R = Kn(), L = e.child(R);
|
|
2329
|
+
e.snippet(L, () => n.children), e.reset(R), e.append(C, R);
|
|
2272
2330
|
};
|
|
2273
|
-
e.if(U, (
|
|
2274
|
-
|
|
2331
|
+
e.if(U, (C) => {
|
|
2332
|
+
n.children && C(j);
|
|
2275
2333
|
});
|
|
2276
2334
|
}
|
|
2277
|
-
var
|
|
2335
|
+
var q = e.sibling(U, 2), E = e.child(q), O = e.child(E), Z = e.sibling(e.child(O), 2), K = e.child(Z);
|
|
2278
2336
|
K.__click = c;
|
|
2279
2337
|
var H = e.child(K);
|
|
2280
2338
|
Me(H, {}), e.next(), e.reset(K);
|
|
2281
2339
|
var G = e.sibling(K, 2);
|
|
2282
|
-
G.__click = () => e.set(w, !0), e.reset(
|
|
2283
|
-
var
|
|
2284
|
-
e.remove_input_defaults(
|
|
2340
|
+
G.__click = () => e.set(w, !0), e.reset(Z), e.reset(O);
|
|
2341
|
+
var D = e.sibling(O, 4), X = e.child(D);
|
|
2342
|
+
e.remove_input_defaults(X), X.__input = () => {
|
|
2285
2343
|
p();
|
|
2286
2344
|
};
|
|
2287
|
-
var
|
|
2288
|
-
|
|
2289
|
-
var
|
|
2290
|
-
e.remove_input_defaults(
|
|
2291
|
-
var
|
|
2292
|
-
e.remove_input_defaults(
|
|
2293
|
-
var
|
|
2294
|
-
e.reset(
|
|
2295
|
-
var
|
|
2296
|
-
|
|
2297
|
-
var
|
|
2345
|
+
var W = e.sibling(X, 2);
|
|
2346
|
+
W.__click = Y, e.reset(D), e.reset(E);
|
|
2347
|
+
var P = e.sibling(E, 2), V = e.sibling(e.child(P), 2), A = e.child(V), de = e.sibling(e.child(A), 2);
|
|
2348
|
+
e.remove_input_defaults(de), de.__input = (C) => d(Number(C.currentTarget.value), e.get(r).composition.height), e.reset(A);
|
|
2349
|
+
var ie = e.sibling(A, 2), ge = e.sibling(e.child(ie), 2);
|
|
2350
|
+
e.remove_input_defaults(ge), ge.__input = (C) => d(e.get(r).composition.width, Number(C.currentTarget.value)), e.reset(ie), e.reset(V), e.reset(P);
|
|
2351
|
+
var he = e.sibling(P, 2), le = e.child(he), be = e.child(le), Re = e.child(be);
|
|
2352
|
+
e.reset(be);
|
|
2353
|
+
var ze = e.sibling(be, 2), ue = e.child(ze);
|
|
2354
|
+
ue.__click = () => e.set(g, !e.get(g));
|
|
2355
|
+
var Se = e.child(ue);
|
|
2356
|
+
Me(Se, {});
|
|
2357
|
+
var _e = e.sibling(Se);
|
|
2358
|
+
e.reset(ue);
|
|
2359
|
+
var pe = e.sibling(ue, 2), Ne = e.child(pe);
|
|
2298
2360
|
Me(Ne, {});
|
|
2299
|
-
var
|
|
2300
|
-
e.reset(
|
|
2301
|
-
var pe = e.sibling(de, 2), Ie = e.child(pe);
|
|
2302
|
-
Me(Ie, {});
|
|
2303
|
-
var ze = e.sibling(Ie, 2);
|
|
2304
|
-
ze.__change = T, e.reset(pe), e.reset(Se), e.reset(le);
|
|
2361
|
+
var je = e.sibling(Ne, 2);
|
|
2362
|
+
je.__change = T, e.reset(pe), e.reset(ze), e.reset(le);
|
|
2305
2363
|
var me = e.sibling(le, 2);
|
|
2306
2364
|
{
|
|
2307
|
-
var ye = (
|
|
2308
|
-
var
|
|
2309
|
-
e.remove_input_defaults(
|
|
2310
|
-
var
|
|
2311
|
-
|
|
2365
|
+
var ye = (C) => {
|
|
2366
|
+
var R = Jn(), L = e.child(R);
|
|
2367
|
+
e.remove_input_defaults(L), L.__keydown = (re) => re.key === "Enter" && m();
|
|
2368
|
+
var $ = e.sibling(L, 2);
|
|
2369
|
+
$.__click = m, e.reset(R), e.bind_value(L, () => e.get(f), (re) => e.set(f, re)), e.append(C, R);
|
|
2312
2370
|
};
|
|
2313
|
-
e.if(me, (
|
|
2314
|
-
e.get(
|
|
2371
|
+
e.if(me, (C) => {
|
|
2372
|
+
e.get(g) && C(ye);
|
|
2315
2373
|
});
|
|
2316
2374
|
}
|
|
2317
|
-
var
|
|
2375
|
+
var ot = e.sibling(me, 2);
|
|
2318
2376
|
{
|
|
2319
|
-
var
|
|
2320
|
-
var
|
|
2321
|
-
e.append(
|
|
2322
|
-
}, lt = (
|
|
2323
|
-
var
|
|
2324
|
-
e.each(
|
|
2325
|
-
var
|
|
2377
|
+
var it = (C) => {
|
|
2378
|
+
var R = Gn();
|
|
2379
|
+
e.append(C, R);
|
|
2380
|
+
}, lt = (C) => {
|
|
2381
|
+
var R = ea();
|
|
2382
|
+
e.each(R, 23, () => e.get(r).composition.layers, (L) => L.id, (L, $, re) => {
|
|
2383
|
+
var Q = Qn();
|
|
2326
2384
|
let te;
|
|
2327
|
-
|
|
2328
|
-
var
|
|
2329
|
-
e.reset(
|
|
2330
|
-
var Fe = e.sibling(
|
|
2385
|
+
Q.__click = () => v(e.get($).id), Q.__keydown = (ne) => ne.key === "Enter" && v(e.get($).id);
|
|
2386
|
+
var De = e.child(Q), ft = e.child(De);
|
|
2387
|
+
e.reset(De);
|
|
2388
|
+
var Fe = e.sibling(De, 2), Xe = e.child(Fe), Ke = e.child(Xe), gt = e.sibling(Ke);
|
|
2331
2389
|
{
|
|
2332
|
-
var
|
|
2333
|
-
var
|
|
2334
|
-
e.reset(
|
|
2390
|
+
var ht = (ne) => {
|
|
2391
|
+
var qe = $n(), wt = e.child(qe, !0);
|
|
2392
|
+
e.reset(qe), e.template_effect(() => e.set_text(wt, e.get($).name)), e.append(ne, qe);
|
|
2335
2393
|
};
|
|
2336
|
-
e.if(
|
|
2337
|
-
e.get(
|
|
2394
|
+
e.if(gt, (ne) => {
|
|
2395
|
+
e.get($).name && ne(ht);
|
|
2338
2396
|
});
|
|
2339
2397
|
}
|
|
2340
|
-
e.reset(
|
|
2341
|
-
var Je = e.sibling(
|
|
2342
|
-
we.__click = (
|
|
2343
|
-
|
|
2398
|
+
e.reset(Xe);
|
|
2399
|
+
var Je = e.sibling(Xe, 2), we = e.child(Je);
|
|
2400
|
+
we.__click = (ne) => {
|
|
2401
|
+
ne.stopPropagation(), z(e.get($).id);
|
|
2344
2402
|
};
|
|
2345
|
-
var
|
|
2346
|
-
|
|
2403
|
+
var bt = e.child(we);
|
|
2404
|
+
rt(bt, { rotate: "-90deg" }), e.reset(we);
|
|
2347
2405
|
var xe = e.sibling(we, 2);
|
|
2348
|
-
xe.__click = (
|
|
2349
|
-
|
|
2406
|
+
xe.__click = (ne) => {
|
|
2407
|
+
ne.stopPropagation(), b(e.get($).id);
|
|
2350
2408
|
};
|
|
2351
|
-
var
|
|
2352
|
-
|
|
2353
|
-
var
|
|
2354
|
-
|
|
2355
|
-
|
|
2409
|
+
var _t = e.child(xe);
|
|
2410
|
+
rt(_t, { rotate: "90deg" }), e.reset(xe);
|
|
2411
|
+
var Ye = e.sibling(xe, 2);
|
|
2412
|
+
Ye.__click = (ne) => {
|
|
2413
|
+
ne.stopPropagation(), I(e.get($).id);
|
|
2356
2414
|
};
|
|
2357
|
-
var yt = e.child(
|
|
2358
|
-
Ue(yt, {}), e.reset(
|
|
2359
|
-
te = e.set_class(
|
|
2360
|
-
}), e.append(
|
|
2361
|
-
}), e.reset(
|
|
2415
|
+
var yt = e.child(Ye);
|
|
2416
|
+
Ue(yt, {}), e.reset(Ye), e.reset(Je), e.reset(Fe), e.reset(Q), e.template_effect(() => {
|
|
2417
|
+
te = e.set_class(Q, 1, "layer-item svelte-w47swm", null, te, { selected: e.get(l) === e.get($).id }), e.set_attribute(ft, "src", e.get($).src), e.set_text(Ke, `${(e.get($).name || `Layer ${e.get(re) + 1}`) ?? ""} `), we.disabled = e.get(re) === 0, xe.disabled = e.get(re) === e.get(r).composition.layers.length - 1;
|
|
2418
|
+
}), e.append(L, Q);
|
|
2419
|
+
}), e.reset(R), e.append(C, R);
|
|
2362
2420
|
};
|
|
2363
|
-
e.if(
|
|
2364
|
-
e.get(
|
|
2421
|
+
e.if(ot, (C) => {
|
|
2422
|
+
e.get(r).composition.layers.length === 0 ? C(it) : C(lt, !1);
|
|
2365
2423
|
});
|
|
2366
2424
|
}
|
|
2367
|
-
e.reset(
|
|
2368
|
-
var ct = e.sibling(
|
|
2425
|
+
e.reset(he);
|
|
2426
|
+
var ct = e.sibling(he, 2);
|
|
2369
2427
|
{
|
|
2370
|
-
var
|
|
2371
|
-
const
|
|
2372
|
-
var
|
|
2428
|
+
var dt = (C) => {
|
|
2429
|
+
const R = e.derived(() => e.get(r).composition.layers.find((Q) => Q.id === e.get(l)));
|
|
2430
|
+
var L = e.comment(), $ = e.first_child(L);
|
|
2373
2431
|
{
|
|
2374
|
-
var
|
|
2375
|
-
|
|
2432
|
+
var re = (Q) => {
|
|
2433
|
+
Pn(Q, {
|
|
2376
2434
|
get layer() {
|
|
2377
|
-
return e.get(
|
|
2435
|
+
return e.get(R);
|
|
2378
2436
|
},
|
|
2379
2437
|
get canvasWidth() {
|
|
2380
|
-
return e.get(
|
|
2438
|
+
return e.get(r).composition.width;
|
|
2381
2439
|
},
|
|
2382
2440
|
get canvasHeight() {
|
|
2383
|
-
return e.get(
|
|
2441
|
+
return e.get(r).composition.height;
|
|
2384
2442
|
},
|
|
2385
|
-
onTransformChange: (te) => y(e.get(
|
|
2386
|
-
onOpacityChange: (te) => x(e.get(
|
|
2387
|
-
onVisibilityChange: (te) =>
|
|
2388
|
-
onEffectsChange: (te) =>
|
|
2389
|
-
onNameChange: (te) => k(e.get(
|
|
2390
|
-
onDelete: () =>
|
|
2443
|
+
onTransformChange: (te) => y(e.get(R).id, te),
|
|
2444
|
+
onOpacityChange: (te) => x(e.get(R).id, te),
|
|
2445
|
+
onVisibilityChange: (te) => N(e.get(R).id, te),
|
|
2446
|
+
onEffectsChange: (te) => _(e.get(R).id, te),
|
|
2447
|
+
onNameChange: (te) => k(e.get(R).id, te),
|
|
2448
|
+
onDelete: () => I(e.get(R).id)
|
|
2391
2449
|
});
|
|
2392
2450
|
};
|
|
2393
|
-
e.if(
|
|
2394
|
-
e.get(
|
|
2451
|
+
e.if($, (Q) => {
|
|
2452
|
+
e.get(R) && Q(re);
|
|
2395
2453
|
});
|
|
2396
2454
|
}
|
|
2397
|
-
e.append(
|
|
2455
|
+
e.append(C, L);
|
|
2398
2456
|
};
|
|
2399
|
-
e.if(ct, (
|
|
2400
|
-
e.get(l) &&
|
|
2457
|
+
e.if(ct, (C) => {
|
|
2458
|
+
e.get(l) && C(dt);
|
|
2401
2459
|
});
|
|
2402
2460
|
}
|
|
2403
|
-
e.reset(
|
|
2404
|
-
var
|
|
2461
|
+
e.reset(q), e.reset(B);
|
|
2462
|
+
var We = e.sibling(B, 2), Ve = e.child(We);
|
|
2405
2463
|
{
|
|
2406
|
-
var
|
|
2407
|
-
var
|
|
2408
|
-
e.snippet(
|
|
2464
|
+
var ut = (C) => {
|
|
2465
|
+
var R = ta(), L = e.child(R);
|
|
2466
|
+
e.snippet(L, () => n.children), e.reset(R), e.append(C, R);
|
|
2409
2467
|
};
|
|
2410
|
-
e.if(Ve, (
|
|
2411
|
-
|
|
2468
|
+
e.if(Ve, (C) => {
|
|
2469
|
+
n.children && C(ut);
|
|
2412
2470
|
});
|
|
2413
2471
|
}
|
|
2414
2472
|
var pt = e.sibling(Ve, 2);
|
|
2415
|
-
|
|
2416
|
-
children: (
|
|
2417
|
-
|
|
2473
|
+
rr(pt, {
|
|
2474
|
+
children: (C, R) => {
|
|
2475
|
+
ir(C, {
|
|
2418
2476
|
get mockup() {
|
|
2419
|
-
return e.get(
|
|
2477
|
+
return e.get(r);
|
|
2420
2478
|
}
|
|
2421
2479
|
});
|
|
2422
2480
|
}
|
|
2423
|
-
}), e.reset(
|
|
2424
|
-
var mt = e.sibling(
|
|
2481
|
+
}), e.reset(We);
|
|
2482
|
+
var mt = e.sibling(We, 2);
|
|
2425
2483
|
{
|
|
2426
|
-
var vt = (
|
|
2427
|
-
|
|
2484
|
+
var vt = (C) => {
|
|
2485
|
+
An(C, {
|
|
2428
2486
|
onclose: () => e.set(w, !1),
|
|
2429
2487
|
onSelect: M,
|
|
2430
|
-
onNew:
|
|
2488
|
+
onNew: S,
|
|
2431
2489
|
get currentMockupId() {
|
|
2432
|
-
return e.get(
|
|
2490
|
+
return e.get(r).id;
|
|
2433
2491
|
},
|
|
2434
2492
|
get storageKey() {
|
|
2435
2493
|
return t();
|
|
2436
2494
|
}
|
|
2437
2495
|
});
|
|
2438
2496
|
};
|
|
2439
|
-
e.if(mt, (
|
|
2440
|
-
e.get(w) &&
|
|
2497
|
+
e.if(mt, (C) => {
|
|
2498
|
+
e.get(w) && C(vt);
|
|
2441
2499
|
});
|
|
2442
2500
|
}
|
|
2443
2501
|
e.reset(J), e.template_effect(() => {
|
|
2444
|
-
e.set_value(
|
|
2445
|
-
}), e.bind_value(
|
|
2502
|
+
e.set_value(de, e.get(r).composition.width), e.set_value(ge, e.get(r).composition.height), e.set_text(Re, `Layers (${e.get(r).composition.layers.length ?? ""})`), e.set_text(_e, ` ${e.get(g) ? "Cancel" : "URL"}`);
|
|
2503
|
+
}), e.bind_value(X, () => e.get(s), (C) => e.set(s, C)), e.append(o, J), e.pop();
|
|
2446
2504
|
}
|
|
2447
2505
|
e.delegate(["click", "input", "change", "keydown"]);
|
|
2448
2506
|
export {
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2507
|
+
Fn as CURRENT_MOCKUP_KEY,
|
|
2508
|
+
nt as InputBatcher,
|
|
2509
|
+
Pn as LayerControls,
|
|
2510
|
+
da as MockupEditor,
|
|
2511
|
+
ir as MockupEditorRenderer,
|
|
2512
|
+
An as MockupListModal,
|
|
2513
|
+
ca as MockupRenderer,
|
|
2456
2514
|
Kt as RenderScheduler,
|
|
2457
|
-
|
|
2458
|
-
|
|
2515
|
+
Vn as STORAGE_KEY,
|
|
2516
|
+
rr as ZoomableCanvas,
|
|
2459
2517
|
tt as createNewMockup,
|
|
2460
|
-
|
|
2518
|
+
at as defaultComposition,
|
|
2461
2519
|
ce as defaultCylinderWarp,
|
|
2462
|
-
|
|
2520
|
+
se as defaultImageOnSurface,
|
|
2463
2521
|
Qt as defaultLayer,
|
|
2464
|
-
|
|
2522
|
+
ae as defaultPlaneWarp,
|
|
2465
2523
|
fe as defaultResizeEffect,
|
|
2466
2524
|
ee as defaultRestyleEffect,
|
|
2467
2525
|
ke as defaultSphereWarp,
|
|
2468
|
-
|
|
2469
|
-
|
|
2526
|
+
$t as defaultTransform,
|
|
2527
|
+
Ie as defaultView,
|
|
2470
2528
|
ve as defaultWarpDebug,
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2529
|
+
Qe as defaultWarpEffect,
|
|
2530
|
+
qn as deleteMockup,
|
|
2531
|
+
Pe as loadAllMockups,
|
|
2532
|
+
Bn as loadCurrentMockupId,
|
|
2533
|
+
Yn as loadMockup,
|
|
2534
|
+
Le as renderMockupCanvas,
|
|
2535
|
+
nr as renderMockupCanvasEditor,
|
|
2536
|
+
Oe as saveCurrentMockupId,
|
|
2537
|
+
Xn as saveMockup
|
|
2480
2538
|
};
|