@harmonics/lattice-ui 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/LICENSE +21 -0
- package/README.md +164 -2
- package/dist/define.js +4 -0
- package/dist/elements-DMimFemm.js +2023 -0
- package/dist/index.js +1 -0
- package/dist/types/elements/define.d.ts +1 -0
- package/dist/types/elements/face.d.ts +32 -0
- package/dist/types/elements/host.d.ts +24 -0
- package/dist/types/elements/icon.d.ts +16 -0
- package/dist/types/elements/index.d.ts +31 -0
- package/dist/types/elements/shape.d.ts +29 -0
- package/dist/types/elements/shapes.d.ts +45 -0
- package/dist/types/elements/shears.d.ts +20 -0
- package/dist/types/elements/sky.d.ts +20 -0
- package/dist/types/elements/solid.d.ts +46 -0
- package/dist/types/faceLattice.d.ts +56 -0
- package/dist/types/hexes.d.ts +329 -0
- package/package.json +45 -4
- package/react.d.ts +48 -0
|
@@ -0,0 +1,2023 @@
|
|
|
1
|
+
//#region ../../node_modules/.bun/solid-js@1.9.17/node_modules/solid-js/dist/solid.js
|
|
2
|
+
var e = {
|
|
3
|
+
context: void 0,
|
|
4
|
+
registry: void 0,
|
|
5
|
+
effects: void 0,
|
|
6
|
+
done: !1,
|
|
7
|
+
getContextId() {
|
|
8
|
+
return t(this.context.count);
|
|
9
|
+
},
|
|
10
|
+
getNextContextId() {
|
|
11
|
+
return t(this.context.count++);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
function t(t) {
|
|
15
|
+
let n = String(t), r = n.length - 1;
|
|
16
|
+
return e.context.id + (r ? String.fromCharCode(96 + r) : "") + n;
|
|
17
|
+
}
|
|
18
|
+
function n(t) {
|
|
19
|
+
e.context = t;
|
|
20
|
+
}
|
|
21
|
+
var r = (e, t) => e === t, i = Symbol("solid-track"), a = { equals: r }, o = null, s = fe, c = 1, l = 2, u = {
|
|
22
|
+
owned: null,
|
|
23
|
+
cleanups: null,
|
|
24
|
+
context: null,
|
|
25
|
+
owner: null
|
|
26
|
+
}, d = null, f = null, p = null, m = null, h = null, g = 0;
|
|
27
|
+
function _(e, t) {
|
|
28
|
+
let n = p, r = d, i = e.length === 0, a = t === void 0 ? r : t, o = i ? u : {
|
|
29
|
+
owned: null,
|
|
30
|
+
cleanups: null,
|
|
31
|
+
context: a ? a.context : null,
|
|
32
|
+
owner: a
|
|
33
|
+
}, s = i ? e : () => e(() => S(() => E(o)));
|
|
34
|
+
d = o, p = null;
|
|
35
|
+
try {
|
|
36
|
+
return T(s, !0);
|
|
37
|
+
} finally {
|
|
38
|
+
p = n, d = r;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function v(e, t) {
|
|
42
|
+
t = t ? Object.assign({}, a, t) : a;
|
|
43
|
+
let n = {
|
|
44
|
+
value: e,
|
|
45
|
+
observers: null,
|
|
46
|
+
observerSlots: null,
|
|
47
|
+
comparator: t.equals || void 0
|
|
48
|
+
};
|
|
49
|
+
return [oe.bind(n), (e) => (typeof e == "function" && (e = f && f.running && f.sources.has(n) ? e(n.tValue) : e(n.value)), se(n, e))];
|
|
50
|
+
}
|
|
51
|
+
function y(e, t, n) {
|
|
52
|
+
w(le(e, t, !1, c));
|
|
53
|
+
}
|
|
54
|
+
function b(e, t, n) {
|
|
55
|
+
s = pe;
|
|
56
|
+
let r = le(e, t, !1, c), i = ae && re(ae);
|
|
57
|
+
i && (r.suspense = i), (!n || !n.render) && (r.user = !0), h ? h.push(r) : w(r);
|
|
58
|
+
}
|
|
59
|
+
function x(e, t, n) {
|
|
60
|
+
n = n ? Object.assign({}, a, n) : a;
|
|
61
|
+
let r = le(e, t, !0, 0);
|
|
62
|
+
return r.observers = null, r.observerSlots = null, r.comparator = n.equals || void 0, w(r), oe.bind(r);
|
|
63
|
+
}
|
|
64
|
+
function S(e) {
|
|
65
|
+
if (p === null) return e();
|
|
66
|
+
let t = p;
|
|
67
|
+
p = null;
|
|
68
|
+
try {
|
|
69
|
+
return e();
|
|
70
|
+
} finally {
|
|
71
|
+
p = t;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function ee(e, t, n) {
|
|
75
|
+
let r = Array.isArray(e), i, a = n && n.defer;
|
|
76
|
+
return (n) => {
|
|
77
|
+
let o;
|
|
78
|
+
if (r) {
|
|
79
|
+
o = Array(e.length);
|
|
80
|
+
for (let t = 0; t < e.length; t++) o[t] = e[t]();
|
|
81
|
+
} else o = e();
|
|
82
|
+
if (a) return a = !1, n;
|
|
83
|
+
let s = S(() => t(o, i, n));
|
|
84
|
+
return i = o, s;
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function C(e) {
|
|
88
|
+
return d === null || (d.cleanups === null ? d.cleanups = [e] : d.cleanups.push(e)), e;
|
|
89
|
+
}
|
|
90
|
+
var [te, ne] = /*@__PURE__*/ v(!1);
|
|
91
|
+
function re(e) {
|
|
92
|
+
let t;
|
|
93
|
+
return d && d.context && (t = d.context[e.id]) !== void 0 ? t : e.defaultValue;
|
|
94
|
+
}
|
|
95
|
+
function ie(e) {
|
|
96
|
+
let t = x(e), n = x(() => be(t()));
|
|
97
|
+
return n.toArray = () => {
|
|
98
|
+
let e = n();
|
|
99
|
+
return Array.isArray(e) ? e : e == null ? [] : [e];
|
|
100
|
+
}, n;
|
|
101
|
+
}
|
|
102
|
+
var ae;
|
|
103
|
+
function oe() {
|
|
104
|
+
let e = f && f.running;
|
|
105
|
+
if (this.sources && (e ? this.tState : this.state)) {
|
|
106
|
+
if ((e ? this.tState : this.state) === c) w(this);
|
|
107
|
+
else {
|
|
108
|
+
let e = m;
|
|
109
|
+
m = null, T(() => me(this), !1), m = e;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (p) {
|
|
113
|
+
let e = this.observers;
|
|
114
|
+
if (!e || e[e.length - 1] !== p) {
|
|
115
|
+
let t = e ? e.length : 0;
|
|
116
|
+
p.sources ? (p.sources.push(this), p.sourceSlots.push(t)) : (p.sources = [this], p.sourceSlots = [t]), e ? (e.push(p), this.observerSlots.push(p.sources.length - 1)) : (this.observers = [p], this.observerSlots = [p.sources.length - 1]);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return e && f.sources.has(this) ? this.tValue : this.value;
|
|
120
|
+
}
|
|
121
|
+
function se(e, t, n) {
|
|
122
|
+
let r = f && f.running && f.sources.has(e) ? e.tValue : e.value;
|
|
123
|
+
if (!e.comparator || !e.comparator(r, t)) {
|
|
124
|
+
if (f) {
|
|
125
|
+
let r = f.running;
|
|
126
|
+
(r || !n && f.sources.has(e)) && (f.sources.add(e), e.tValue = t), r || (e.value = t);
|
|
127
|
+
} else e.value = t;
|
|
128
|
+
e.observers && e.observers.length && T(() => {
|
|
129
|
+
for (let t = 0; t < e.observers.length; t += 1) {
|
|
130
|
+
let n = e.observers[t], r = f && f.running;
|
|
131
|
+
r && f.disposed.has(n) || ((r ? !n.tState : !n.state) && (n.pure ? m.push(n) : h.push(n), n.observers && he(n)), r ? n.tState = c : n.state = c);
|
|
132
|
+
}
|
|
133
|
+
if (m.length > 1e6) throw m = [], Error();
|
|
134
|
+
}, !1);
|
|
135
|
+
}
|
|
136
|
+
return t;
|
|
137
|
+
}
|
|
138
|
+
function w(e) {
|
|
139
|
+
if (!e.fn) return;
|
|
140
|
+
E(e);
|
|
141
|
+
let t = g;
|
|
142
|
+
ce(e, f && f.running && f.sources.has(e) ? e.tValue : e.value, t), f && !f.running && f.sources.has(e) && queueMicrotask(() => {
|
|
143
|
+
T(() => {
|
|
144
|
+
f && (f.running = !0), p = d = e, ce(e, e.tValue, t), p = d = null;
|
|
145
|
+
}, !1);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
function ce(e, t, n) {
|
|
149
|
+
let r, i = d, a = p;
|
|
150
|
+
p = d = e;
|
|
151
|
+
try {
|
|
152
|
+
r = e.fn(t);
|
|
153
|
+
} catch (t) {
|
|
154
|
+
return e.pure && (f && f.running ? (e.tState = c, e.tOwned && e.tOwned.forEach(E), e.tOwned = void 0) : (e.state = c, e.owned && e.owned.forEach(E), e.owned = null)), e.updatedAt = n + 1, ye(t);
|
|
155
|
+
} finally {
|
|
156
|
+
p = a, d = i;
|
|
157
|
+
}
|
|
158
|
+
(!e.updatedAt || e.updatedAt <= n) && (e.updatedAt != null && "observers" in e ? se(e, r, !0) : f && f.running && e.pure ? (f.sources.has(e) || (e.value = r), f.sources.add(e), e.tValue = r) : e.value = r, e.updatedAt = n);
|
|
159
|
+
}
|
|
160
|
+
function le(e, t, n, r = c, i) {
|
|
161
|
+
let a = {
|
|
162
|
+
fn: e,
|
|
163
|
+
state: r,
|
|
164
|
+
updatedAt: null,
|
|
165
|
+
owned: null,
|
|
166
|
+
sources: null,
|
|
167
|
+
sourceSlots: null,
|
|
168
|
+
cleanups: null,
|
|
169
|
+
value: t,
|
|
170
|
+
owner: d,
|
|
171
|
+
context: d ? d.context : null,
|
|
172
|
+
pure: n
|
|
173
|
+
};
|
|
174
|
+
return f && f.running && (a.state = 0, a.tState = r), d === null || d !== u && (f && f.running && d.pure ? d.tOwned ? d.tOwned.push(a) : d.tOwned = [a] : d.owned ? d.owned.push(a) : d.owned = [a]), a;
|
|
175
|
+
}
|
|
176
|
+
function ue(e) {
|
|
177
|
+
let t = f && f.running;
|
|
178
|
+
if ((t ? e.tState : e.state) === 0) return;
|
|
179
|
+
if ((t ? e.tState : e.state) === l) return me(e);
|
|
180
|
+
if (e.suspense && S(e.suspense.inFallback)) return e.suspense.effects.push(e);
|
|
181
|
+
let n = [e];
|
|
182
|
+
for (; (e = e.owner) && (!e.updatedAt || e.updatedAt < g);) {
|
|
183
|
+
if (t && f.disposed.has(e)) return;
|
|
184
|
+
(t ? e.tState : e.state) && n.push(e);
|
|
185
|
+
}
|
|
186
|
+
for (let r = n.length - 1; r >= 0; r--) {
|
|
187
|
+
if (e = n[r], t) {
|
|
188
|
+
let t = e, i = n[r + 1];
|
|
189
|
+
for (; (t = t.owner) && t !== i;) if (f.disposed.has(t)) return;
|
|
190
|
+
}
|
|
191
|
+
if ((t ? e.tState : e.state) === c) w(e);
|
|
192
|
+
else if ((t ? e.tState : e.state) === l) {
|
|
193
|
+
let t = m;
|
|
194
|
+
m = null, T(() => me(e, n[0]), !1), m = t;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
function T(e, t) {
|
|
199
|
+
if (m) return e();
|
|
200
|
+
let n = !1;
|
|
201
|
+
t || (m = []), h ? n = !0 : h = [], g++;
|
|
202
|
+
try {
|
|
203
|
+
let t = e();
|
|
204
|
+
return de(n), t;
|
|
205
|
+
} catch (e) {
|
|
206
|
+
n || (h = null), m = null, ye(e);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
function de(e) {
|
|
210
|
+
if (m &&= (fe(m), null), e) return;
|
|
211
|
+
let t;
|
|
212
|
+
if (f) {
|
|
213
|
+
if (!f.promises.size && !f.queue.size) {
|
|
214
|
+
let e = f.sources, n = f.disposed;
|
|
215
|
+
h.push.apply(h, f.effects), t = f.resolve;
|
|
216
|
+
for (let e of h) "tState" in e && (e.state = e.tState), delete e.tState;
|
|
217
|
+
f = null, T(() => {
|
|
218
|
+
for (let e of n) E(e);
|
|
219
|
+
for (let t of e) {
|
|
220
|
+
if (t.value = t.tValue, t.owned) for (let e = 0, n = t.owned.length; e < n; e++) E(t.owned[e]);
|
|
221
|
+
t.tOwned && (t.owned = t.tOwned), delete t.tValue, delete t.tOwned, t.tState = 0;
|
|
222
|
+
}
|
|
223
|
+
ne(!1);
|
|
224
|
+
}, !1);
|
|
225
|
+
} else if (f.running) {
|
|
226
|
+
f.running = !1, f.effects.push.apply(f.effects, h), h = null, ne(!0);
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
let n = h;
|
|
231
|
+
h = null, n.length && T(() => s(n), !1), t && t();
|
|
232
|
+
}
|
|
233
|
+
function fe(e) {
|
|
234
|
+
for (let t = 0; t < e.length; t++) ue(e[t]);
|
|
235
|
+
}
|
|
236
|
+
function pe(t) {
|
|
237
|
+
let r, i = 0;
|
|
238
|
+
for (r = 0; r < t.length; r++) {
|
|
239
|
+
let e = t[r];
|
|
240
|
+
e.user ? t[i++] = e : ue(e);
|
|
241
|
+
}
|
|
242
|
+
if (e.context) {
|
|
243
|
+
if (e.count) {
|
|
244
|
+
e.effects ||= [], e.effects.push(...t.slice(0, i));
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
n();
|
|
248
|
+
}
|
|
249
|
+
for (e.effects && (e.done || !e.count) && (t = [...e.effects, ...t], i += e.effects.length, delete e.effects), r = 0; r < i; r++) ue(t[r]);
|
|
250
|
+
}
|
|
251
|
+
function me(e, t) {
|
|
252
|
+
let n = f && f.running;
|
|
253
|
+
n ? e.tState = 0 : e.state = 0;
|
|
254
|
+
for (let r = 0; r < e.sources.length; r += 1) {
|
|
255
|
+
let i = e.sources[r];
|
|
256
|
+
if (i.sources) {
|
|
257
|
+
let e = n ? i.tState : i.state;
|
|
258
|
+
e === c ? i !== t && (!i.updatedAt || i.updatedAt < g) && ue(i) : e === l && me(i, t);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
function he(e) {
|
|
263
|
+
let t = f && f.running;
|
|
264
|
+
for (let n = 0; n < e.observers.length; n += 1) {
|
|
265
|
+
let r = e.observers[n];
|
|
266
|
+
(t ? !r.tState : !r.state) && (t ? r.tState = l : r.state = l, r.pure ? m.push(r) : h.push(r), r.observers && he(r));
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
function E(e) {
|
|
270
|
+
let t;
|
|
271
|
+
if (e.sources) for (; e.sources.length;) {
|
|
272
|
+
let t = e.sources.pop(), n = e.sourceSlots.pop(), r = t.observers;
|
|
273
|
+
if (r && r.length) {
|
|
274
|
+
let e = r.pop(), i = t.observerSlots.pop();
|
|
275
|
+
n < r.length && (e.sourceSlots[i] = n, r[n] = e, t.observerSlots[n] = i);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
if (e.tOwned) {
|
|
279
|
+
for (t = e.tOwned.length - 1; t >= 0; t--) E(e.tOwned[t]);
|
|
280
|
+
delete e.tOwned;
|
|
281
|
+
}
|
|
282
|
+
if (f && f.running && e.pure) ge(e, !0);
|
|
283
|
+
else if (e.owned) {
|
|
284
|
+
for (t = e.owned.length - 1; t >= 0; t--) E(e.owned[t]);
|
|
285
|
+
e.owned = null;
|
|
286
|
+
}
|
|
287
|
+
if (e.cleanups) {
|
|
288
|
+
for (t = e.cleanups.length - 1; t >= 0; t--) e.cleanups[t]();
|
|
289
|
+
e.cleanups = null;
|
|
290
|
+
}
|
|
291
|
+
f && f.running ? e.tState = 0 : e.state = 0;
|
|
292
|
+
}
|
|
293
|
+
function ge(e, t) {
|
|
294
|
+
if (t || (e.tState = 0, f.disposed.add(e)), e.owned) for (let t = 0; t < e.owned.length; t++) ge(e.owned[t]);
|
|
295
|
+
}
|
|
296
|
+
function _e(e) {
|
|
297
|
+
return e instanceof Error ? e : Error(typeof e == "string" ? e : "Unknown error", { cause: e });
|
|
298
|
+
}
|
|
299
|
+
function ve(e, t, n) {
|
|
300
|
+
try {
|
|
301
|
+
for (let n of t) n(e);
|
|
302
|
+
} catch (e) {
|
|
303
|
+
ye(e, n && n.owner || null);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
function ye(e, t = d) {
|
|
307
|
+
let n = o && t && t.context && t.context[o], r = _e(e);
|
|
308
|
+
if (!n) throw r;
|
|
309
|
+
h ? h.push({
|
|
310
|
+
fn() {
|
|
311
|
+
ve(r, n, t);
|
|
312
|
+
},
|
|
313
|
+
state: c
|
|
314
|
+
}) : ve(r, n, t);
|
|
315
|
+
}
|
|
316
|
+
function be(e) {
|
|
317
|
+
if (typeof e == "function" && !e.length) return be(e());
|
|
318
|
+
if (Array.isArray(e)) {
|
|
319
|
+
let t = [];
|
|
320
|
+
for (let n = 0; n < e.length; n++) {
|
|
321
|
+
let r = be(e[n]);
|
|
322
|
+
if (Array.isArray(r)) {
|
|
323
|
+
if (r.length < 32768) t.push.apply(t, r);
|
|
324
|
+
else for (let e = 0; e < r.length; e++) t.push(r[e]);
|
|
325
|
+
} else t.push(r);
|
|
326
|
+
}
|
|
327
|
+
return t;
|
|
328
|
+
}
|
|
329
|
+
return e;
|
|
330
|
+
}
|
|
331
|
+
var xe = Symbol("fallback");
|
|
332
|
+
function Se(e) {
|
|
333
|
+
for (let t = 0; t < e.length; t++) e[t]();
|
|
334
|
+
}
|
|
335
|
+
function Ce(e, t, n = {}) {
|
|
336
|
+
let r = [], a = [], o = [], s = 0, c = t.length > 1 ? [] : null;
|
|
337
|
+
return C(() => Se(o)), () => {
|
|
338
|
+
let l = e() || [], u = l.length, d, f;
|
|
339
|
+
return l[i], S(() => {
|
|
340
|
+
let e, t, i, m, h, g, v, y, b;
|
|
341
|
+
if (u === 0) s !== 0 && (Se(o), o = [], r = [], a = [], s = 0, c &&= []), n.fallback && (r = [xe], a[0] = _((e) => (o[0] = e, n.fallback())), s = 1);
|
|
342
|
+
else if (s === 0) {
|
|
343
|
+
for (a = Array(u), f = 0; f < u; f++) r[f] = l[f], a[f] = _(p);
|
|
344
|
+
s = u;
|
|
345
|
+
} else {
|
|
346
|
+
for (i = Array(u), m = Array(u), c && (h = Array(u)), g = 0, v = Math.min(s, u); g < v && r[g] === l[g]; g++);
|
|
347
|
+
for (v = s - 1, y = u - 1; v >= g && y >= g && r[v] === l[y]; v--, y--) i[y] = a[v], m[y] = o[v], c && (h[y] = c[v]);
|
|
348
|
+
for (e = /* @__PURE__ */ new Map(), t = Array(y + 1), f = y; f >= g; f--) b = l[f], d = e.get(b), t[f] = d === void 0 ? -1 : d, e.set(b, f);
|
|
349
|
+
for (d = g; d <= v; d++) b = r[d], f = e.get(b), f !== void 0 && f !== -1 ? (i[f] = a[d], m[f] = o[d], c && (h[f] = c[d]), f = t[f], e.set(b, f)) : o[d]();
|
|
350
|
+
for (f = g; f < u; f++) f in i ? (a[f] = i[f], o[f] = m[f], c && (c[f] = h[f], c[f](f))) : a[f] = _(p);
|
|
351
|
+
a = a.slice(0, s = u), r = l.slice(0);
|
|
352
|
+
}
|
|
353
|
+
return a;
|
|
354
|
+
});
|
|
355
|
+
function p(e) {
|
|
356
|
+
if (o[f] = e, c) {
|
|
357
|
+
let [e, n] = v(f);
|
|
358
|
+
return c[f] = n, t(l[f], e);
|
|
359
|
+
}
|
|
360
|
+
return t(l[f]);
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
function we(e, t, n = {}) {
|
|
365
|
+
let r = [], a = [], o = [], s = [], c = 0, l;
|
|
366
|
+
return C(() => Se(o)), () => {
|
|
367
|
+
let u = e() || [], d = u.length;
|
|
368
|
+
return u[i], S(() => {
|
|
369
|
+
if (d === 0) return c !== 0 && (Se(o), o = [], r = [], a = [], c = 0, s = []), n.fallback && (r = [xe], a[0] = _((e) => (o[0] = e, n.fallback())), c = 1), a;
|
|
370
|
+
for (r[0] === xe && (o[0](), o = [], r = [], a = [], c = 0), l = 0; l < d; l++) l < r.length && r[l] !== u[l] ? s[l](() => u[l]) : l >= r.length && (a[l] = _(f));
|
|
371
|
+
for (; l < r.length; l++) o[l]();
|
|
372
|
+
return c = s.length = o.length = d, r = u.slice(0), a = a.slice(0, c);
|
|
373
|
+
});
|
|
374
|
+
function f(e) {
|
|
375
|
+
o[l] = e;
|
|
376
|
+
let [n, r] = v(u[l]);
|
|
377
|
+
return s[l] = r, t(n, l);
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
function D(e, t) {
|
|
382
|
+
return S(() => e(t || {}));
|
|
383
|
+
}
|
|
384
|
+
var Te = (e) => `Stale read from <${e}>.`;
|
|
385
|
+
function Ee(e) {
|
|
386
|
+
let t = "fallback" in e && { fallback: () => e.fallback };
|
|
387
|
+
return x(Ce(() => e.each, e.children, t || void 0));
|
|
388
|
+
}
|
|
389
|
+
function De(e) {
|
|
390
|
+
let t = "fallback" in e && { fallback: () => e.fallback };
|
|
391
|
+
return x(we(() => e.each, e.children, t || void 0));
|
|
392
|
+
}
|
|
393
|
+
function Oe(e) {
|
|
394
|
+
let t = e.keyed, n = x(() => e.when, void 0, void 0), r = t ? n : x(n, void 0, { equals: (e, t) => !e == !t });
|
|
395
|
+
return x(() => {
|
|
396
|
+
let i = r();
|
|
397
|
+
if (i) {
|
|
398
|
+
let a = e.children;
|
|
399
|
+
return typeof a == "function" && a.length > 0 ? S(() => a(t ? i : () => {
|
|
400
|
+
if (!S(r)) throw Te("Show");
|
|
401
|
+
return n();
|
|
402
|
+
})) : a;
|
|
403
|
+
}
|
|
404
|
+
return e.fallback;
|
|
405
|
+
}, void 0, void 0);
|
|
406
|
+
}
|
|
407
|
+
function ke(e) {
|
|
408
|
+
let t = ie(() => e.children), n = x(() => {
|
|
409
|
+
let e = t(), n = Array.isArray(e) ? e : [e], r = () => void 0;
|
|
410
|
+
for (let e = 0; e < n.length; e++) {
|
|
411
|
+
let t = e, i = n[e], a = r, o = x(() => a() ? void 0 : i.when, void 0, void 0), s = i.keyed ? o : x(o, void 0, { equals: (e, t) => !e == !t });
|
|
412
|
+
r = () => a() || (s() ? [
|
|
413
|
+
t,
|
|
414
|
+
o,
|
|
415
|
+
i
|
|
416
|
+
] : void 0);
|
|
417
|
+
}
|
|
418
|
+
return r;
|
|
419
|
+
});
|
|
420
|
+
return x(() => {
|
|
421
|
+
let t = n()();
|
|
422
|
+
if (!t) return e.fallback;
|
|
423
|
+
let [r, i, a] = t, o = a.children;
|
|
424
|
+
return typeof o == "function" && o.length > 0 ? S(() => o(a.keyed ? i() : () => {
|
|
425
|
+
if (S(n)()?.[0] !== r) throw Te("Match");
|
|
426
|
+
return i();
|
|
427
|
+
})) : o;
|
|
428
|
+
}, void 0, void 0);
|
|
429
|
+
}
|
|
430
|
+
function Ae(e) {
|
|
431
|
+
return e;
|
|
432
|
+
}
|
|
433
|
+
//#endregion
|
|
434
|
+
//#region ../../node_modules/.bun/solid-js@1.9.17/node_modules/solid-js/web/dist/web.js
|
|
435
|
+
function je(e, t, n) {
|
|
436
|
+
let r = n.length, i = t.length, a = r, o = 0, s = 0, c = t[i - 1].nextSibling, l = null;
|
|
437
|
+
for (; o < i || s < a;) if (t[o] === n[s]) o++, s++;
|
|
438
|
+
else {
|
|
439
|
+
for (; t[i - 1] === n[a - 1];) i--, a--;
|
|
440
|
+
if (i === o) {
|
|
441
|
+
let t = a < r ? s ? n[s - 1].nextSibling : n[a - s] : c;
|
|
442
|
+
for (; s < a;) e.insertBefore(n[s++], t);
|
|
443
|
+
} else if (a === s) for (; o < i;) (!l || !l.has(t[o])) && t[o].remove(), o++;
|
|
444
|
+
else if (t[o] === n[a - 1] && n[s] === t[i - 1]) {
|
|
445
|
+
let r = t[--i].nextSibling;
|
|
446
|
+
e.insertBefore(n[s++], t[o++].nextSibling), e.insertBefore(n[--a], r), t[i] = n[a];
|
|
447
|
+
} else {
|
|
448
|
+
if (!l) {
|
|
449
|
+
l = /* @__PURE__ */ new Map();
|
|
450
|
+
let e = s;
|
|
451
|
+
for (; e < a;) l.set(n[e], e++);
|
|
452
|
+
}
|
|
453
|
+
let r = l.get(t[o]);
|
|
454
|
+
if (r != null) {
|
|
455
|
+
if (s < r && r < a) {
|
|
456
|
+
let c = o, u = 1, d;
|
|
457
|
+
for (; ++c < i && c < a && (d = l.get(t[c])) != null && d === r + u;) u++;
|
|
458
|
+
if (u > r - s) {
|
|
459
|
+
let i = t[o];
|
|
460
|
+
for (; s < r;) e.insertBefore(n[s++], i);
|
|
461
|
+
} else e.replaceChild(n[s++], t[o++]);
|
|
462
|
+
} else o++;
|
|
463
|
+
} else t[o++].remove();
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
function Me(e, t, n, r = {}) {
|
|
468
|
+
let i;
|
|
469
|
+
return _((r) => {
|
|
470
|
+
i = r, t === document ? e() : A(t, e(), !n && t.firstChild ? null : void 0, n);
|
|
471
|
+
}, r.owner), () => {
|
|
472
|
+
i(), t.textContent = "";
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
function O(e, t, n, r) {
|
|
476
|
+
let i, a = () => {
|
|
477
|
+
let t = r ? document.createElementNS("http://www.w3.org/1998/Math/MathML", "template") : document.createElement("template");
|
|
478
|
+
return t.innerHTML = e, n ? t.content.firstChild.firstChild : r ? t.firstChild : t.content.firstChild;
|
|
479
|
+
}, o = t ? () => S(() => document.importNode(i ||= a(), !0)) : () => (i ||= a()).cloneNode(!0);
|
|
480
|
+
return o.cloneNode = o, o;
|
|
481
|
+
}
|
|
482
|
+
function k(e, t, n) {
|
|
483
|
+
Ne(e) || (n == null ? e.removeAttribute(t) : e.setAttribute(t, n));
|
|
484
|
+
}
|
|
485
|
+
function A(e, t, n, r) {
|
|
486
|
+
if (n !== void 0 && !r && (r = []), typeof t != "function") return Pe(e, t, r, n);
|
|
487
|
+
y((r) => Pe(e, t(), r, n), r);
|
|
488
|
+
}
|
|
489
|
+
function Ne(t) {
|
|
490
|
+
return !!e.context && !e.done && (!t || t.isConnected);
|
|
491
|
+
}
|
|
492
|
+
function Pe(e, t, n, r, i) {
|
|
493
|
+
let a = Ne(e);
|
|
494
|
+
if (a) {
|
|
495
|
+
!n && (n = [...e.childNodes]);
|
|
496
|
+
let t = [];
|
|
497
|
+
for (let e = 0; e < n.length; e++) {
|
|
498
|
+
let r = n[e];
|
|
499
|
+
r.nodeType === 8 && r.data.slice(0, 2) === "!$" ? r.remove() : t.push(r);
|
|
500
|
+
}
|
|
501
|
+
n = t;
|
|
502
|
+
}
|
|
503
|
+
for (; typeof n == "function";) n = n();
|
|
504
|
+
if (t === n) return n;
|
|
505
|
+
let o = typeof t, s = r !== void 0;
|
|
506
|
+
if (e = s && n[0] && n[0].parentNode || e, o === "string" || o === "number") {
|
|
507
|
+
if (a || o === "number" && (t = t.toString(), t === n)) return n;
|
|
508
|
+
if (s) {
|
|
509
|
+
let i = n[0];
|
|
510
|
+
i && i.nodeType === 3 ? i.data !== t && (i.data = t) : i = document.createTextNode(t), n = j(e, n, r, i);
|
|
511
|
+
} else n = n !== "" && typeof n == "string" ? e.firstChild.data = t : e.textContent = t;
|
|
512
|
+
} else if (t == null || o === "boolean") {
|
|
513
|
+
if (a) return n;
|
|
514
|
+
n = j(e, n, r);
|
|
515
|
+
} else if (o === "function") return y(() => {
|
|
516
|
+
let i = t();
|
|
517
|
+
for (; typeof i == "function";) i = i();
|
|
518
|
+
n = Pe(e, i, n, r);
|
|
519
|
+
}), () => n;
|
|
520
|
+
else if (Array.isArray(t)) {
|
|
521
|
+
let o = [], c = n && Array.isArray(n);
|
|
522
|
+
if (Fe(o, t, n, i)) return y(() => n = Pe(e, o, n, r, !0)), () => n;
|
|
523
|
+
if (a) {
|
|
524
|
+
if (!o.length) return n;
|
|
525
|
+
if (r === void 0) return n = [...e.childNodes];
|
|
526
|
+
let t = o[0];
|
|
527
|
+
if (t.parentNode !== e) return n;
|
|
528
|
+
let i = [t];
|
|
529
|
+
for (; (t = t.nextSibling) !== r;) i.push(t);
|
|
530
|
+
return n = i;
|
|
531
|
+
}
|
|
532
|
+
if (o.length === 0) {
|
|
533
|
+
if (n = j(e, n, r), s) return n;
|
|
534
|
+
} else c ? n.length === 0 ? Ie(e, o, r) : je(e, n, o) : (n && j(e), Ie(e, o));
|
|
535
|
+
n = o;
|
|
536
|
+
} else if (t.nodeType) {
|
|
537
|
+
if (a && t.parentNode) return n = s ? [t] : t;
|
|
538
|
+
if (Array.isArray(n)) {
|
|
539
|
+
if (s) return n = j(e, n, r, t);
|
|
540
|
+
j(e, n, null, t);
|
|
541
|
+
} else n == null || n === "" || !e.firstChild ? e.appendChild(t) : e.replaceChild(t, e.firstChild);
|
|
542
|
+
n = t;
|
|
543
|
+
}
|
|
544
|
+
return n;
|
|
545
|
+
}
|
|
546
|
+
function Fe(e, t, n, r) {
|
|
547
|
+
let i = !1;
|
|
548
|
+
for (let a = 0, o = t.length; a < o; a++) {
|
|
549
|
+
let o = t[a], s = n && n[e.length], c;
|
|
550
|
+
if (o != null && o !== !0 && o !== !1) {
|
|
551
|
+
if ((c = typeof o) == "object" && o.nodeType) e.push(o);
|
|
552
|
+
else if (Array.isArray(o)) i = Fe(e, o, s) || i;
|
|
553
|
+
else if (c === "function") {
|
|
554
|
+
if (r) {
|
|
555
|
+
for (; typeof o == "function";) o = o();
|
|
556
|
+
i = Fe(e, Array.isArray(o) ? o : [o], Array.isArray(s) ? s : [s]) || i;
|
|
557
|
+
} else e.push(o), i = !0;
|
|
558
|
+
} else {
|
|
559
|
+
let t = String(o);
|
|
560
|
+
s && s.nodeType === 3 && s.data === t ? e.push(s) : e.push(document.createTextNode(t));
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
return i;
|
|
565
|
+
}
|
|
566
|
+
function Ie(e, t, n = null) {
|
|
567
|
+
for (let r = 0, i = t.length; r < i; r++) e.insertBefore(t[r], n);
|
|
568
|
+
}
|
|
569
|
+
function j(e, t, n, r) {
|
|
570
|
+
if (n === void 0) return e.textContent = "";
|
|
571
|
+
let i = r || document.createTextNode("");
|
|
572
|
+
if (t.length) {
|
|
573
|
+
let r = !1;
|
|
574
|
+
for (let a = t.length - 1; a >= 0; a--) {
|
|
575
|
+
let o = t[a];
|
|
576
|
+
if (i !== o) {
|
|
577
|
+
let t = o.parentNode === e;
|
|
578
|
+
!r && !a ? t ? e.replaceChild(i, o) : e.insertBefore(i, n) : t && o.remove();
|
|
579
|
+
} else r = !0;
|
|
580
|
+
}
|
|
581
|
+
} else e.insertBefore(i, n);
|
|
582
|
+
return [i];
|
|
583
|
+
}
|
|
584
|
+
//#endregion
|
|
585
|
+
//#region src/draw.ts
|
|
586
|
+
var Le = (e) => `M ${e.map((e) => `${e.x} ${e.y}`).join(" L ")} Z`, Re = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches, M = Math.sqrt(3), ze = (e) => `M${e.map((e) => `${Math.round(e.x * 100) / 100} ${Math.round(e.y * 100) / 100}`).join("L")}Z`;
|
|
587
|
+
function Be(e, t = {
|
|
588
|
+
x: 0,
|
|
589
|
+
y: 0
|
|
590
|
+
}) {
|
|
591
|
+
let n = e.x - t.x, r = e.y - t.y, i = [
|
|
592
|
+
0,
|
|
593
|
+
60,
|
|
594
|
+
120
|
|
595
|
+
].map((e) => {
|
|
596
|
+
let t = e * Math.PI / 180;
|
|
597
|
+
return Math.abs(n * Math.cos(t) + r * Math.sin(t));
|
|
598
|
+
});
|
|
599
|
+
return Math.max(...i) / (M / 2);
|
|
600
|
+
}
|
|
601
|
+
var Ve = /* @__PURE__ */ new Map();
|
|
602
|
+
function He(e) {
|
|
603
|
+
let t = Ve.get(e);
|
|
604
|
+
if (t) return t;
|
|
605
|
+
let n = 120 / e, r = n * M / 2, i = (e, t) => ({
|
|
606
|
+
x: r * t,
|
|
607
|
+
y: n * e + n / 2 * t
|
|
608
|
+
}), a = [];
|
|
609
|
+
for (let t = -2 * e; t <= 2 * e; t++) for (let n = -3 * e; n <= 3 * e; n++) for (let e of [0, 1]) {
|
|
610
|
+
let r = e === 0 ? [
|
|
611
|
+
i(n, t),
|
|
612
|
+
i(n, t + 1),
|
|
613
|
+
i(n + 1, t)
|
|
614
|
+
] : [
|
|
615
|
+
i(n, t + 1),
|
|
616
|
+
i(n + 1, t + 1),
|
|
617
|
+
i(n + 1, t)
|
|
618
|
+
], o = {
|
|
619
|
+
x: r.reduce((e, t) => e + t.x, 0) / 3 / 120,
|
|
620
|
+
y: r.reduce((e, t) => e + t.y, 0) / 3 / 120
|
|
621
|
+
};
|
|
622
|
+
Be(o) < .999 && a.push({
|
|
623
|
+
corners: r,
|
|
624
|
+
mid: o,
|
|
625
|
+
i: n,
|
|
626
|
+
j: t,
|
|
627
|
+
k: e
|
|
628
|
+
});
|
|
629
|
+
}
|
|
630
|
+
return Ve.set(e, a), a;
|
|
631
|
+
}
|
|
632
|
+
var N = 1 / 16, Ue = () => N * M / 2, We = (e) => {
|
|
633
|
+
let t = Math.round(e.x / Ue()), n = Math.round((e.y - N / 2 * t) / N);
|
|
634
|
+
return {
|
|
635
|
+
x: Ue() * t,
|
|
636
|
+
y: N * n + N / 2 * t
|
|
637
|
+
};
|
|
638
|
+
}, P = (e, t) => (n) => Be(n, We(e)) < Math.max(1, Math.round(t / N)) * N - 1e-6, Ge = (e, t, n) => (r) => ((r.x - e.x) / t) ** 2 + ((r.y - e.y) / n) ** 2 < 1, F = (e, t) => (n) => e.slice(1).some((r, i) => {
|
|
639
|
+
let a = e[i], o = r.x - a.x, s = r.y - a.y, c = Math.max(0, Math.min(1, ((n.x - a.x) * o + (n.y - a.y) * s) / (o * o + s * s)));
|
|
640
|
+
return Math.hypot(n.x - (a.x + c * o), n.y - (a.y + c * s)) < t;
|
|
641
|
+
}), I = (e, t, n, r = 16) => Array.from({ length: r + 1 }, (i, a) => {
|
|
642
|
+
let o = a / r, s = 1 - o;
|
|
643
|
+
return {
|
|
644
|
+
x: s * s * e.x + 2 * s * o * t.x + o * o * n.x,
|
|
645
|
+
y: s * s * e.y + 2 * s * o * t.y + o * o * n.y
|
|
646
|
+
};
|
|
647
|
+
}), L = (...e) => (t) => e.every((e) => e(t)), Ke = (e) => (t) => !e(t), R = (...e) => (t) => e.some((e) => e(t)), qe = (e) => (t) => {
|
|
648
|
+
let n = e.map(We);
|
|
649
|
+
return n.slice(1).some((e, r) => {
|
|
650
|
+
let i = n[r], a = e.x - i.x, o = e.y - i.y, s = ((t.x - i.x) * a + (t.y - i.y) * o) / (a * a + o * o);
|
|
651
|
+
if (s < 0 || s > 1) return !1;
|
|
652
|
+
let c = {
|
|
653
|
+
x: t.x - (i.x + s * a),
|
|
654
|
+
y: t.y - (i.y + s * o)
|
|
655
|
+
};
|
|
656
|
+
return (Math.abs(a) < 1e-9 ? c.x * Math.sign(i.x || 1) > 0 : c.y > 0) && Math.hypot(c.x, c.y) < Ue() * .999;
|
|
657
|
+
});
|
|
658
|
+
}, Je = (e, t) => {
|
|
659
|
+
let n = t * Math.tan(Math.PI / 6);
|
|
660
|
+
return [
|
|
661
|
+
{
|
|
662
|
+
x: e.x - t,
|
|
663
|
+
y: e.y - n
|
|
664
|
+
},
|
|
665
|
+
e,
|
|
666
|
+
{
|
|
667
|
+
x: e.x + t,
|
|
668
|
+
y: e.y - n
|
|
669
|
+
}
|
|
670
|
+
];
|
|
671
|
+
}, z = (e) => R(e(-1), e(1)), B = -.18, V = .34, H = (e) => ({
|
|
672
|
+
x: e * V,
|
|
673
|
+
y: B
|
|
674
|
+
}), Ye = (e) => (t) => Math.hypot(t.x - e.x, t.y - e.y) < N * .58, U = (e, t, n = 0) => (r) => e({
|
|
675
|
+
x: r.x - n * Ue(),
|
|
676
|
+
y: r.y - t * N - n * N / 2
|
|
677
|
+
}), Xe = (e, t, n = 0) => e.map(([e, r]) => [e, U(r, t, n)]), Ze = (e, t, n = 0) => e > 0 && (e + n) % t < .16, W = (e, t) => e % t / t, Qe = (e, t) => Math.floor(e / t) % 2, $e = (e, t = .04) => qe(Je({
|
|
678
|
+
x: e * V,
|
|
679
|
+
y: B + t
|
|
680
|
+
}, .14)), et = (e, t) => R(P({
|
|
681
|
+
x: e.x - .07 * t,
|
|
682
|
+
y: e.y - .04 * t
|
|
683
|
+
}, .09 * t), P({
|
|
684
|
+
x: e.x + .07 * t,
|
|
685
|
+
y: e.y - .04 * t
|
|
686
|
+
}, .09 * t), (n) => n.y > e.y - .04 * t && n.y < e.y + .2 * t && Math.abs(n.x - e.x) < .16 * t * (1 - (n.y - e.y + .04 * t) / (.24 * t))), tt = [
|
|
687
|
+
{
|
|
688
|
+
name: "Happy",
|
|
689
|
+
idle: "Bobs, blinks, cheeks glow",
|
|
690
|
+
at: (e) => {
|
|
691
|
+
let t = Ze(e, 3.4, 1), n = e > 0 && W(e, 2.4) < .5 ? .11 : .09;
|
|
692
|
+
return Xe([
|
|
693
|
+
["ink", z((e) => t ? $e(e) : P(H(e), .15))],
|
|
694
|
+
["glint", z((e) => t ? () => !1 : Ye({
|
|
695
|
+
x: e * V + .05,
|
|
696
|
+
y: -.22999999999999998
|
|
697
|
+
}))],
|
|
698
|
+
["ink", F(I({
|
|
699
|
+
x: -.4,
|
|
700
|
+
y: .2
|
|
701
|
+
}, {
|
|
702
|
+
x: 0,
|
|
703
|
+
y: .5
|
|
704
|
+
}, {
|
|
705
|
+
x: .4,
|
|
706
|
+
y: .2
|
|
707
|
+
}), .045)],
|
|
708
|
+
["blush", z((e) => P({
|
|
709
|
+
x: e * .6,
|
|
710
|
+
y: .1
|
|
711
|
+
}, n))]
|
|
712
|
+
], e > 0 && W(e, 1.2) < .5 ? -1 : 0);
|
|
713
|
+
}
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
name: "Laughing",
|
|
717
|
+
idle: "Shakes with each ha",
|
|
718
|
+
at: (e) => {
|
|
719
|
+
let t = e > 0 && W(e, 1.8) < .6 ? Qe(e, .12) : 0, n = t ? .04 : 0;
|
|
720
|
+
return Xe([
|
|
721
|
+
["ink", z((e) => F(I({
|
|
722
|
+
x: e * V - .13,
|
|
723
|
+
y: -.12
|
|
724
|
+
}, {
|
|
725
|
+
x: e * V,
|
|
726
|
+
y: -.36
|
|
727
|
+
}, {
|
|
728
|
+
x: e * V + .13,
|
|
729
|
+
y: -.12
|
|
730
|
+
}), .04))],
|
|
731
|
+
["ink", L(Ge({
|
|
732
|
+
x: 0,
|
|
733
|
+
y: .16
|
|
734
|
+
}, .42, .36 + n), (e) => e.y > .16)],
|
|
735
|
+
["tongue", L(Ge({
|
|
736
|
+
x: 0,
|
|
737
|
+
y: .16
|
|
738
|
+
}, .42, .36 + n), Ge({
|
|
739
|
+
x: 0,
|
|
740
|
+
y: .5 + n
|
|
741
|
+
}, .22, .12))],
|
|
742
|
+
["glint", L(Ge({
|
|
743
|
+
x: 0,
|
|
744
|
+
y: .16
|
|
745
|
+
}, .42, .36), (e) => e.y > .16 && e.y < .22)],
|
|
746
|
+
["blush", z((e) => P({
|
|
747
|
+
x: e * .62,
|
|
748
|
+
y: .06
|
|
749
|
+
}, .09))]
|
|
750
|
+
], -t);
|
|
751
|
+
}
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
name: "Sad",
|
|
755
|
+
idle: "A tear runs down; the lip trembles",
|
|
756
|
+
at: (e) => {
|
|
757
|
+
let t = Ze(e, 4.2, 2), n = .06 + (e > 0 ? W(e, 2) : 0) * .5, r = e > 0 ? Qe(e, .2) : 0;
|
|
758
|
+
return [
|
|
759
|
+
["ink", z((e) => t ? $e(e) : P(H(e), .13))],
|
|
760
|
+
["glint", z((e) => t ? () => !1 : Ye({
|
|
761
|
+
x: e * V + .04,
|
|
762
|
+
y: -.22
|
|
763
|
+
}))],
|
|
764
|
+
["ink", z((e) => F([{
|
|
765
|
+
x: e * .52,
|
|
766
|
+
y: -.36
|
|
767
|
+
}, {
|
|
768
|
+
x: e * .2,
|
|
769
|
+
y: -.46
|
|
770
|
+
}], .035))],
|
|
771
|
+
["ink", U(F(I({
|
|
772
|
+
x: -.3,
|
|
773
|
+
y: .46
|
|
774
|
+
}, {
|
|
775
|
+
x: 0,
|
|
776
|
+
y: .18
|
|
777
|
+
}, {
|
|
778
|
+
x: .3,
|
|
779
|
+
y: .46
|
|
780
|
+
}), .04), r)],
|
|
781
|
+
["tear", R(P({
|
|
782
|
+
x: -.34,
|
|
783
|
+
y: n
|
|
784
|
+
}, .06), P({
|
|
785
|
+
x: -.34,
|
|
786
|
+
y: n + .12
|
|
787
|
+
}, .08))]
|
|
788
|
+
];
|
|
789
|
+
}
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
name: "Surprised",
|
|
793
|
+
idle: "Eyes dart; brows jump",
|
|
794
|
+
at: (e) => {
|
|
795
|
+
let t = e > 0 ? [
|
|
796
|
+
0,
|
|
797
|
+
-1,
|
|
798
|
+
0,
|
|
799
|
+
1
|
|
800
|
+
][Math.floor(W(e, 3.2) * 4)] : 0, n = e > 0 && W(e, 1.6) < .18 ? -1 : 0;
|
|
801
|
+
return [
|
|
802
|
+
["ink", z((e) => L(P(H(e), .19), Ke(P(H(e), .14))))],
|
|
803
|
+
["ink", z((e) => U(P(H(e), .07), 0, t))],
|
|
804
|
+
["ink", z((e) => U(F(I({
|
|
805
|
+
x: e * .52,
|
|
806
|
+
y: -.42
|
|
807
|
+
}, {
|
|
808
|
+
x: e * .34,
|
|
809
|
+
y: -.58
|
|
810
|
+
}, {
|
|
811
|
+
x: e * .16,
|
|
812
|
+
y: -.44
|
|
813
|
+
}), .035), n))],
|
|
814
|
+
["ink", L(P({
|
|
815
|
+
x: 0,
|
|
816
|
+
y: .36
|
|
817
|
+
}, .17), Ke(P({
|
|
818
|
+
x: 0,
|
|
819
|
+
y: .36
|
|
820
|
+
}, .09)))]
|
|
821
|
+
];
|
|
822
|
+
}
|
|
823
|
+
},
|
|
824
|
+
{
|
|
825
|
+
name: "Angry",
|
|
826
|
+
idle: "Fumes and shakes",
|
|
827
|
+
at: (e) => {
|
|
828
|
+
let t = e > 0 && W(e, 2) < .4 ? Qe(e, .07) ? 1 : -1 : 0, n = +(e > 0 && W(e, 2) > .5), r = e > 0 ? W(e, 1) : -1, i = [
|
|
829
|
+
["ink", z((e) => L(P(H(e), .15), (t) => t.y > -.26 + .4 * (-e * (t.x - e * V))))],
|
|
830
|
+
["ink", z((e) => U(F([{
|
|
831
|
+
x: e * .58,
|
|
832
|
+
y: -.44
|
|
833
|
+
}, {
|
|
834
|
+
x: e * .12,
|
|
835
|
+
y: -.28
|
|
836
|
+
}], .045), n))],
|
|
837
|
+
["ink", F(I({
|
|
838
|
+
x: -.32,
|
|
839
|
+
y: .42
|
|
840
|
+
}, {
|
|
841
|
+
x: 0,
|
|
842
|
+
y: .3
|
|
843
|
+
}, {
|
|
844
|
+
x: .32,
|
|
845
|
+
y: .42
|
|
846
|
+
}), .045)]
|
|
847
|
+
];
|
|
848
|
+
return r >= 0 && i.push(["tear", z((e) => P({
|
|
849
|
+
x: e * (.5 + r * .04),
|
|
850
|
+
y: -.46 - r * .14
|
|
851
|
+
}, .05 + r * .03))]), Xe(i, 0, t);
|
|
852
|
+
}
|
|
853
|
+
},
|
|
854
|
+
{
|
|
855
|
+
name: "Worried",
|
|
856
|
+
idle: "Sweats; glances about",
|
|
857
|
+
at: (e) => {
|
|
858
|
+
let t = e > 0 ? [
|
|
859
|
+
0,
|
|
860
|
+
-1,
|
|
861
|
+
-1,
|
|
862
|
+
0,
|
|
863
|
+
1,
|
|
864
|
+
1
|
|
865
|
+
][Math.floor(W(e, 3) * 6)] : 0, n = e > 0 ? W(e, 2.2) : 0, r = e > 0 && Qe(e, .3) ? -1 : 1;
|
|
866
|
+
return [
|
|
867
|
+
["ink", z((e) => U(P(H(e), .14), 0, t))],
|
|
868
|
+
["glint", z((e) => U(Ye({
|
|
869
|
+
x: e * V + .04,
|
|
870
|
+
y: -.22999999999999998
|
|
871
|
+
}), 0, t))],
|
|
872
|
+
["ink", z((e) => F([{
|
|
873
|
+
x: e * .54,
|
|
874
|
+
y: -.38
|
|
875
|
+
}, {
|
|
876
|
+
x: e * .16,
|
|
877
|
+
y: -.5
|
|
878
|
+
}], .035))],
|
|
879
|
+
["ink", F(Array.from({ length: 9 }, (e, t) => ({
|
|
880
|
+
x: -.4 + t * .1,
|
|
881
|
+
y: .36 + (t % 2 == 0 ? .04 : -.04) * r
|
|
882
|
+
})), .035)],
|
|
883
|
+
["tear", R(P({
|
|
884
|
+
x: .66,
|
|
885
|
+
y: -.46 + n * .3
|
|
886
|
+
}, .06), P({
|
|
887
|
+
x: .66,
|
|
888
|
+
y: -.34 + n * .3
|
|
889
|
+
}, .08))]
|
|
890
|
+
];
|
|
891
|
+
}
|
|
892
|
+
},
|
|
893
|
+
{
|
|
894
|
+
name: "Sleepy",
|
|
895
|
+
idle: "Breathes in its bubble",
|
|
896
|
+
at: (e) => {
|
|
897
|
+
let t = e > 0 ? W(e, 3) : .3, n = t > .92, r = .13 + Math.sin(Math.PI * Math.min(1, t / .92)) * .09, i = e > 0 ? W(e, 2.4) : 0, a = [
|
|
898
|
+
["ink", z((e) => {
|
|
899
|
+
let t = Je({
|
|
900
|
+
x: e * V,
|
|
901
|
+
y: -.13
|
|
902
|
+
}, .16), n = Math.tan(Math.PI / 6), r = (t, r) => {
|
|
903
|
+
let i = e * (V + t), a = -.13 - t * n;
|
|
904
|
+
return qe([{
|
|
905
|
+
x: i,
|
|
906
|
+
y: a + .02
|
|
907
|
+
}, {
|
|
908
|
+
x: i,
|
|
909
|
+
y: a + .02 + r
|
|
910
|
+
}]);
|
|
911
|
+
};
|
|
912
|
+
return R(qe(t), r(.04, .05), r(.09, .06), r(.14, .05));
|
|
913
|
+
})],
|
|
914
|
+
["blush", z((e) => P({
|
|
915
|
+
x: e * .56,
|
|
916
|
+
y: .16
|
|
917
|
+
}, .09))],
|
|
918
|
+
["ink", L(P({
|
|
919
|
+
x: 0,
|
|
920
|
+
y: .42
|
|
921
|
+
}, .12), Ke(P({
|
|
922
|
+
x: 0,
|
|
923
|
+
y: .42
|
|
924
|
+
}, .06)))],
|
|
925
|
+
["tear", R(P({
|
|
926
|
+
x: .42,
|
|
927
|
+
y: -.44 - i * .1
|
|
928
|
+
}, .04), P({
|
|
929
|
+
x: .5,
|
|
930
|
+
y: -.58 - i * .1
|
|
931
|
+
}, .06))]
|
|
932
|
+
];
|
|
933
|
+
return n || a.push(["tear", L(P({
|
|
934
|
+
x: .2,
|
|
935
|
+
y: .18
|
|
936
|
+
}, r), Ke(P({
|
|
937
|
+
x: .2,
|
|
938
|
+
y: .18
|
|
939
|
+
}, r - .06)))]), a;
|
|
940
|
+
}
|
|
941
|
+
},
|
|
942
|
+
{
|
|
943
|
+
name: "Wink",
|
|
944
|
+
idle: "Winks again",
|
|
945
|
+
at: (e) => {
|
|
946
|
+
let t = e > 0 && W(e, 2.6) > .7 && W(e, 2.6) < .85, n = e > 0 && W(e, 2.6) < .3 ? .11 : .09;
|
|
947
|
+
return [
|
|
948
|
+
["ink", P(H(-1), .15)],
|
|
949
|
+
["glint", Ye({
|
|
950
|
+
x: -.34 + .05,
|
|
951
|
+
y: -.22999999999999998
|
|
952
|
+
})],
|
|
953
|
+
t ? ["ink", P(H(1), .15)] : ["ink", F(I({
|
|
954
|
+
x: .19000000000000003,
|
|
955
|
+
y: B
|
|
956
|
+
}, {
|
|
957
|
+
x: V,
|
|
958
|
+
y: -.3
|
|
959
|
+
}, {
|
|
960
|
+
x: .49,
|
|
961
|
+
y: B
|
|
962
|
+
}), .04)],
|
|
963
|
+
["ink", F(I({
|
|
964
|
+
x: -.3,
|
|
965
|
+
y: .32
|
|
966
|
+
}, {
|
|
967
|
+
x: .06,
|
|
968
|
+
y: .5
|
|
969
|
+
}, {
|
|
970
|
+
x: .38,
|
|
971
|
+
y: .22
|
|
972
|
+
}), .045)],
|
|
973
|
+
["blush", P({
|
|
974
|
+
x: .6,
|
|
975
|
+
y: .1
|
|
976
|
+
}, n)]
|
|
977
|
+
];
|
|
978
|
+
}
|
|
979
|
+
},
|
|
980
|
+
{
|
|
981
|
+
name: "Smitten",
|
|
982
|
+
idle: "Hearts beat",
|
|
983
|
+
at: (e) => {
|
|
984
|
+
let t = e > 0 ? W(e, 1.1) : .9, n = t < .12 || t > .24 && t < .36 ? 1.3 : 1;
|
|
985
|
+
return [["blush", z((e) => et({
|
|
986
|
+
x: e * V,
|
|
987
|
+
y: B
|
|
988
|
+
}, n))], ["ink", F(I({
|
|
989
|
+
x: -.34,
|
|
990
|
+
y: .24
|
|
991
|
+
}, {
|
|
992
|
+
x: 0,
|
|
993
|
+
y: .5
|
|
994
|
+
}, {
|
|
995
|
+
x: .34,
|
|
996
|
+
y: .24
|
|
997
|
+
}), .045)]];
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
], nt = (e, t) => {
|
|
1001
|
+
let n = "plate";
|
|
1002
|
+
for (let [r, i] of e) i(t) && (n = r);
|
|
1003
|
+
return n;
|
|
1004
|
+
}, rt = (e) => e.k === 0 ? "right" : "left";
|
|
1005
|
+
function it(e, t, n) {
|
|
1006
|
+
let r = He(t);
|
|
1007
|
+
N = 1 / t;
|
|
1008
|
+
let i = r.map((t) => nt(e, t.mid)), a = r.map(() => "top"), o = Math.max(1, Math.round(.035 / N)), s = (t, n) => nt(e, {
|
|
1009
|
+
x: t.mid.x,
|
|
1010
|
+
y: t.mid.y - n * N
|
|
1011
|
+
});
|
|
1012
|
+
return r.forEach((e, t) => {
|
|
1013
|
+
let r = i[t];
|
|
1014
|
+
if (n === "raised" && r === "plate") for (let n = 1; n <= o; n++) {
|
|
1015
|
+
let r = s(e, n);
|
|
1016
|
+
if (r !== "plate" && r !== "glint") {
|
|
1017
|
+
i[t] = r, a[t] = rt(e);
|
|
1018
|
+
break;
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
else if (n === "carved" && r !== "plate" && r !== "glint") {
|
|
1022
|
+
for (let n = 1; n <= o; n++) if (s(e, n) === "plate") {
|
|
1023
|
+
a[t] = rt(e);
|
|
1024
|
+
break;
|
|
1025
|
+
}
|
|
1026
|
+
} else if (n === "cubes" && r !== "plate" && r !== "glint") {
|
|
1027
|
+
let n = (e.k === 0 ? [
|
|
1028
|
+
[e.i, e.j],
|
|
1029
|
+
[e.i, e.j + 1],
|
|
1030
|
+
[e.i + 1, e.j]
|
|
1031
|
+
] : [
|
|
1032
|
+
[e.i, e.j + 1],
|
|
1033
|
+
[e.i + 1, e.j + 1],
|
|
1034
|
+
[e.i + 1, e.j]
|
|
1035
|
+
]).find(([e, t]) => ((t - e) % 3 + 3) % 3 == 0), r = {
|
|
1036
|
+
x: M / 2 * N * n[1],
|
|
1037
|
+
y: N * n[0] + N / 2 * n[1]
|
|
1038
|
+
}, i = (Math.atan2(e.mid.x - r.x, -(e.mid.y - r.y)) * 180 / Math.PI + 360) % 360;
|
|
1039
|
+
a[t] = i < 60 || i >= 300 ? "top" : i < 180 ? "right" : "left";
|
|
1040
|
+
}
|
|
1041
|
+
}), {
|
|
1042
|
+
inks: i,
|
|
1043
|
+
shades: a
|
|
1044
|
+
};
|
|
1045
|
+
}
|
|
1046
|
+
function at(e, t, n) {
|
|
1047
|
+
let r = /* @__PURE__ */ new Map();
|
|
1048
|
+
return e.forEach((e, i) => {
|
|
1049
|
+
let a = t[i], o = n?.[i] ?? "top", s = `${a}:${o}`, c = r.get(s) ?? {
|
|
1050
|
+
ink: a,
|
|
1051
|
+
shade: o,
|
|
1052
|
+
d: []
|
|
1053
|
+
};
|
|
1054
|
+
c.d.push(ze(e.corners)), r.set(s, c);
|
|
1055
|
+
}), [...r.values()].map((e) => ({
|
|
1056
|
+
ink: e.ink,
|
|
1057
|
+
shade: e.shade,
|
|
1058
|
+
d: e.d.join("")
|
|
1059
|
+
}));
|
|
1060
|
+
}
|
|
1061
|
+
//#endregion
|
|
1062
|
+
//#region src/faceDrawing.tsx
|
|
1063
|
+
var ot = /*#__PURE__*/ O("<svg><path class=facet></svg>", !1, !0, !1), st = 16, ct = 1400, lt = 300, ut = 100;
|
|
1064
|
+
function dt(e, t) {
|
|
1065
|
+
let n = (e) => ({
|
|
1066
|
+
x: e.x,
|
|
1067
|
+
y: e.y - t
|
|
1068
|
+
}), [, , r, i, a] = e;
|
|
1069
|
+
return {
|
|
1070
|
+
shade: ze([
|
|
1071
|
+
a,
|
|
1072
|
+
i,
|
|
1073
|
+
n(i),
|
|
1074
|
+
n(a)
|
|
1075
|
+
]),
|
|
1076
|
+
shadow: ze([
|
|
1077
|
+
i,
|
|
1078
|
+
r,
|
|
1079
|
+
n(r),
|
|
1080
|
+
n(i)
|
|
1081
|
+
]),
|
|
1082
|
+
top: ze(e.map(n))
|
|
1083
|
+
};
|
|
1084
|
+
}
|
|
1085
|
+
var ft = {
|
|
1086
|
+
happy: "Happy",
|
|
1087
|
+
content: "Happy",
|
|
1088
|
+
asleep: "Sleepy",
|
|
1089
|
+
sad: "Sad",
|
|
1090
|
+
distressed: "Worried",
|
|
1091
|
+
puzzled: "Surprised",
|
|
1092
|
+
relieved: "Laughing"
|
|
1093
|
+
}, pt = (e) => tt.find((t) => t.name.toLowerCase() === e.trim().toLowerCase()), mt = (e) => pt(ft[e]) ?? tt[0], ht = pt("Laughing");
|
|
1094
|
+
function gt(e, t) {
|
|
1095
|
+
let n = it(e.at(t), st, "raised");
|
|
1096
|
+
return at(He(st), n.inks, n.shades);
|
|
1097
|
+
}
|
|
1098
|
+
function _t(e) {
|
|
1099
|
+
let t = () => Re() || (e.still?.() ?? !1), [n, r] = v(!1), i;
|
|
1100
|
+
b(ee(e.pulse, (e, n) => {
|
|
1101
|
+
n === void 0 || e === n || t() || (r(!0), clearTimeout(i), i = setTimeout(() => r(!1), ct));
|
|
1102
|
+
}));
|
|
1103
|
+
let [a, o] = v(0);
|
|
1104
|
+
b(() => {
|
|
1105
|
+
if (t()) {
|
|
1106
|
+
o(0);
|
|
1107
|
+
return;
|
|
1108
|
+
}
|
|
1109
|
+
let e = performance.now(), n = setInterval(() => o((performance.now() - e) / 1e3), ut);
|
|
1110
|
+
C(() => clearInterval(n));
|
|
1111
|
+
}), C(() => clearTimeout(i));
|
|
1112
|
+
let s = x(() => n() ? ht : e.expression()), c = x(() => gt(s(), a())), [l, u] = v(), d;
|
|
1113
|
+
return b(ee(s, (e, n) => {
|
|
1114
|
+
n && !t() && (u(gt(n, a())), clearTimeout(d), d = setTimeout(() => u(void 0), lt));
|
|
1115
|
+
})), C(() => clearTimeout(d)), {
|
|
1116
|
+
face: c,
|
|
1117
|
+
leaving: l
|
|
1118
|
+
};
|
|
1119
|
+
}
|
|
1120
|
+
function vt(e) {
|
|
1121
|
+
return D(De, {
|
|
1122
|
+
get each() {
|
|
1123
|
+
return e.drawing;
|
|
1124
|
+
},
|
|
1125
|
+
children: (e) => (() => {
|
|
1126
|
+
var t = ot();
|
|
1127
|
+
return y((n) => {
|
|
1128
|
+
var r = e().ink, i = e().shade, a = e().d;
|
|
1129
|
+
return r !== n.e && k(t, "data-ink", n.e = r), i !== n.t && k(t, "data-shade", n.t = i), a !== n.a && k(t, "d", n.a = a), n;
|
|
1130
|
+
}, {
|
|
1131
|
+
e: void 0,
|
|
1132
|
+
t: void 0,
|
|
1133
|
+
a: void 0
|
|
1134
|
+
}), t;
|
|
1135
|
+
})()
|
|
1136
|
+
});
|
|
1137
|
+
}
|
|
1138
|
+
//#endregion
|
|
1139
|
+
//#region src/elements/face.css?inline
|
|
1140
|
+
var yt = ".face .plate-top{fill:var(--color-tree-raised);stroke:color-mix(in srgb, var(--color-tree-wood-0) 60%, var(--sky));stroke-width:var(--tree-rule-width);stroke-linejoin:round}.face .plate-shade{fill:color-mix(in srgb, var(--color-tree-wood-0) 45%, var(--sky))}.face .plate-shadow{fill:color-mix(in srgb, var(--color-tree-wood-0) 70%, var(--sky))}.face .facet{--ink:color-mix(in srgb, var(--color-tree-wood-0) 40%, var(--color-tree-ink));fill:var(--ink);stroke:var(--ink);stroke-width:var(--tree-rule-width);stroke-linejoin:round;vector-effect:non-scaling-stroke}.face .facet[data-ink=plate]{fill:none;stroke:color-mix(in srgb, var(--color-tree-wood-0) 14%, var(--color-tree-raised))}.face .facet[data-ink=glint]{--ink:var(--color-tree-raised)}.face .facet[data-ink=blush]{--ink:color-mix(in srgb, var(--color-tree-alert) 55%, var(--color-tree-raised))}.face .facet[data-ink=tear]{--ink:var(--color-tree-wood-2)}.face .facet[data-ink=tongue]{--ink:color-mix(in srgb, var(--color-tree-alert) 75%, var(--color-tree-raised))}.face .facet[data-shade=left]{fill:color-mix(in srgb, var(--ink) 72%, var(--color-tree-ink));stroke:color-mix(in srgb, var(--ink) 72%, var(--color-tree-ink))}.face .facet[data-shade=right]{fill:color-mix(in srgb, var(--ink) 48%, var(--color-tree-ink));stroke:color-mix(in srgb, var(--ink) 48%, var(--color-tree-ink))}.face .facet[data-ink=ink][data-shade=top]{fill:color-mix(in srgb, var(--color-tree-wood-0) 70%, var(--color-tree-ink));stroke:color-mix(in srgb, var(--color-tree-wood-0) 70%, var(--color-tree-ink))}.face .facet[data-ink=ink][data-shade=left]{fill:color-mix(in srgb, var(--color-tree-wood-0) 35%, var(--color-tree-ink));stroke:color-mix(in srgb, var(--color-tree-wood-0) 35%, var(--color-tree-ink))}.face .facet[data-ink=ink][data-shade=right]{fill:var(--color-tree-ink);stroke:var(--color-tree-ink)}.face .face-leaving{animation:.3s ease-in forwards face-sink}@keyframes face-sink{to{opacity:0;transform:translateY(var(--space-tree-2))}}@media (prefers-reduced-motion:reduce){.face .face-leaving{animation:none}}", bt = ":root{--color-primary:#6f9584;--color-secondary:#55524b;--color-neutral:#f7f5f0;--color-surface:var(--color-neutral);--color-on-surface:#2b2a27;--color-on-surface-muted:var(--color-secondary);--color-edge:var(--color-neutral);--color-error:#b3261e;--color-depth-0:#c9d6cf;--color-depth-1:#b7c9c0;--color-depth-2:#a5bcb1;--color-depth-3:#93afa2;--color-depth-4:#81a293;--color-depth-5:var(--color-primary);--color-cell-empty:#e4ebe6;--color-tree-sky:#f4f4f0;--color-tree-earth:#2a302c;--color-tree-topsoil:#1f2522;--color-tree-raised:#fff;--color-tree-ink:#1e2219;--color-tree-ink-soft:#565c50;--color-tree-rule:#cfd1c9;--color-tree-on-ink:#f7f6f0;--color-tree-ink-under:#e8eae2;--color-tree-ink-under-soft:#b4bbae;--color-tree-rule-under:#414945;--color-tree-raised-under:#343b37;--color-tree-alert:#a3441e;--color-tree-wood-0:#705f4a;--color-tree-wood-1:#9a7b3c;--color-tree-wood-2:#566c78;--color-tree-wood-3:#6f5873;--color-tree-wood-4:#5f7a57;--color-tree-wood-under-0:#b5a48e;--color-tree-wood-under-1:#d4b26a;--color-tree-wood-under-2:#97b2c0;--color-tree-wood-under-3:#b79bbe;--color-tree-wood-under-4:#9dbb94;--color-tree-leaf:#546d41;--color-tree-leaf-under:#9dbb94;--color-tree-olive:#3e3348;--color-tree-olive-under:#b7a9cf;--color-tree-shadow:#00000040;--color-tree-lattice-sky:#1e22190d;--color-tree-lattice-earth:#e8eae20f;--font-body:400 15px/1.5 Atkinson Hyperlegible Next Variable, system-ui, sans-serif;--font-body-family:Atkinson Hyperlegible Next Variable, system-ui, sans-serif;--font-body-size:15px;--font-body-weight:400;--font-body-leading:1.5;--font-goal:600 15px/1.3 Atkinson Hyperlegible Next Variable, system-ui, sans-serif;--font-goal-family:Atkinson Hyperlegible Next Variable, system-ui, sans-serif;--font-goal-size:15px;--font-goal-weight:600;--font-goal-leading:1.3;--font-label:400 14px/1.3 Atkinson Hyperlegible Next Variable, system-ui, sans-serif;--font-label-family:Atkinson Hyperlegible Next Variable, system-ui, sans-serif;--font-label-size:14px;--font-label-weight:400;--font-label-leading:1.3;--font-excerpt:400 13px/1.4 Atkinson Hyperlegible Next Variable, system-ui, sans-serif;--font-excerpt-family:Atkinson Hyperlegible Next Variable, system-ui, sans-serif;--font-excerpt-size:13px;--font-excerpt-weight:400;--font-excerpt-leading:1.4;--font-tree-body:400 .8125rem/1.5 Roboto Mono Variable, Menlo, monospace;--font-tree-body-family:Roboto Mono Variable, Menlo, monospace;--font-tree-body-size:.8125rem;--font-tree-body-weight:400;--font-tree-body-leading:1.5;--font-tree-tight:400 .8125rem/1.1 Roboto Mono Variable, Menlo, monospace;--font-tree-tight-family:Roboto Mono Variable, Menlo, monospace;--font-tree-tight-size:.8125rem;--font-tree-tight-weight:400;--font-tree-tight-leading:1.1;--font-tree-small:400 .75rem Roboto Mono Variable, Menlo, monospace;--font-tree-small-family:Roboto Mono Variable, Menlo, monospace;--font-tree-small-size:.75rem;--font-tree-small-weight:400;--font-tree-lead:400 .875rem Roboto Mono Variable, Menlo, monospace;--font-tree-lead-family:Roboto Mono Variable, Menlo, monospace;--font-tree-lead-size:.875rem;--font-tree-lead-weight:400;--font-tree-title:400 1rem Roboto Mono Variable, Menlo, monospace;--font-tree-title-family:Roboto Mono Variable, Menlo, monospace;--font-tree-title-size:1rem;--font-tree-title-weight:400;--font-tree-italic:400 .8125rem Victor Mono Variable, Menlo, monospace;--font-tree-italic-family:Victor Mono Variable, Menlo, monospace;--font-tree-italic-size:.8125rem;--font-tree-italic-weight:400;--font-tree-voice:600 1.125rem/1.2 Roboto Mono Variable, Menlo, monospace;--font-tree-voice-family:Roboto Mono Variable, Menlo, monospace;--font-tree-voice-size:1.125rem;--font-tree-voice-weight:600;--font-tree-voice-leading:1.2;--font-tree-voice-lead:600 .9375rem Roboto Mono Variable, Menlo, monospace;--font-tree-voice-lead-family:Roboto Mono Variable, Menlo, monospace;--font-tree-voice-lead-size:.9375rem;--font-tree-voice-lead-weight:600;--font-tree-label:400 12px Roboto Mono Variable, Menlo, monospace;--font-tree-label-family:Roboto Mono Variable, Menlo, monospace;--font-tree-label-size:12px;--font-tree-label-weight:400;--font-tree-heading:400 12px Roboto Mono Variable, Menlo, monospace;--font-tree-heading-family:Roboto Mono Variable, Menlo, monospace;--font-tree-heading-size:12px;--font-tree-heading-weight:400;--font-tree-section:400 14px Roboto Mono Variable, Menlo, monospace;--font-tree-section-family:Roboto Mono Variable, Menlo, monospace;--font-tree-section-size:14px;--font-tree-section-weight:400;--space-xs:4px;--space-sm:8px;--space-md:16px;--space-lg:24px;--space-xl:32px;--space-tree-1:.25rem;--space-tree-2:.5rem;--space-tree-3:.75rem;--space-tree-4:1rem;--space-tree-5:1.5rem;--space-tree-6:2.5rem;--space-tree-7:4rem;--radius-tree:.375rem;--canvas-background-color:var(--color-surface);--canvas-text-color:var(--color-on-surface);--canvas-typography:var(--font-body);--canvas-padding:var(--space-md);--goal-background-color:var(--color-surface);--goal-text-color:var(--color-on-surface);--goal-typography:var(--font-goal);--goal-padding:var(--space-sm);--goal-base-edge-width:225px;--corner-text-color:var(--color-on-surface);--corner-typography:var(--font-label);--corner-padding:var(--space-sm);--corner-excerpt-text-color:var(--color-on-surface-muted);--corner-excerpt-typography:var(--font-excerpt);--depth-0-background-color:var(--color-depth-0);--depth-1-background-color:var(--color-depth-1);--depth-2-background-color:var(--color-depth-2);--depth-3-background-color:var(--color-depth-3);--depth-4-background-color:var(--color-depth-4);--depth-5-background-color:var(--color-depth-5);--cell-empty-background-color:var(--color-cell-empty);--triangle-edge-background-color:var(--color-edge);--triangle-edge-width:1.5px;--selection-ring-background-color:var(--color-on-surface-muted);--selection-ring-width:1.5px;--hex-width:320px;--breadcrumb-background-color:var(--color-surface);--breadcrumb-text-color:var(--color-on-surface-muted);--breadcrumb-typography:var(--font-body);--breadcrumb-padding:var(--space-md);--breadcrumb-error-background-color:var(--color-surface);--breadcrumb-error-text-color:var(--color-error);--tree-column-width:26rem;--tree-measure-width:34rem;--tree-drawing-width:790px;--tree-sheet-height:70dvh;--tree-sheet-small-height:9rem;--tree-swatch-width:4rem;--tree-swatch-height:1.5rem;--tree-todo-height:26px;--tree-select-height:2rem;--tree-target-size:2.75rem;--tree-icon-target-size:2.5rem;--tree-row-icon-size:1.5rem;--tree-rootrow-box-size:40px;--tree-marker-size:.4rem;--tree-dot-size:.5rem;--tree-legend-inset-width:240px;--tree-legend-inset-narrow-width:128px;--tree-root-name-width:280px;--tree-count-width:104px;--tree-count-narrow-width:44px;--tree-comb-over-width:26px;--tree-topsoil-height:10px;--tree-rule-width:1px;--tree-rule-thick-width:3px;--tree-rule-thicker-width:6px;--tree-ground-line-width:1.5px;--tree-sprig-width:1.4px;--tree-halo-width:4px;--tree-focus-width:2px;--tree-focus-offset-width:2px;--tree-paper-background-color:var(--color-tree-sky);--tree-paper-text-color:var(--color-tree-ink);--tree-paper-soft-background-color:var(--color-tree-sky);--tree-paper-soft-text-color:var(--color-tree-ink-soft);--tree-box-background-color:var(--color-tree-raised);--tree-box-text-color:var(--color-tree-ink);--tree-toast-background-color:var(--color-tree-ink);--tree-toast-text-color:var(--color-tree-on-ink);--tree-alert-background-color:var(--color-tree-sky);--tree-alert-text-color:var(--color-tree-alert);--tree-ground-background-color:var(--color-tree-earth);--tree-ground-text-color:var(--color-tree-ink-under);--tree-ground-soft-background-color:var(--color-tree-earth);--tree-ground-soft-text-color:var(--color-tree-ink-under-soft);--tree-ground-box-background-color:var(--color-tree-raised-under);--tree-ground-box-text-color:var(--color-tree-ink-under);--tree-ground-topsoil-background-color:var(--color-tree-topsoil);--tree-ground-topsoil-text-color:var(--color-tree-ink-under);--tree-wood-0-background-color:var(--color-tree-sky);--tree-wood-0-text-color:var(--color-tree-wood-0);--tree-wood-1-background-color:var(--color-tree-sky);--tree-wood-1-text-color:var(--color-tree-wood-1);--tree-wood-2-background-color:var(--color-tree-sky);--tree-wood-2-text-color:var(--color-tree-wood-2);--tree-wood-3-background-color:var(--color-tree-sky);--tree-wood-3-text-color:var(--color-tree-wood-3);--tree-wood-4-background-color:var(--color-tree-sky);--tree-wood-4-text-color:var(--color-tree-wood-4);--tree-wood-under-0-background-color:var(--color-tree-earth);--tree-wood-under-0-text-color:var(--color-tree-wood-under-0);--tree-wood-under-1-background-color:var(--color-tree-earth);--tree-wood-under-1-text-color:var(--color-tree-wood-under-1);--tree-wood-under-2-background-color:var(--color-tree-earth);--tree-wood-under-2-text-color:var(--color-tree-wood-under-2);--tree-wood-under-3-background-color:var(--color-tree-earth);--tree-wood-under-3-text-color:var(--color-tree-wood-under-3);--tree-wood-under-4-background-color:var(--color-tree-earth);--tree-wood-under-4-text-color:var(--color-tree-wood-under-4);--tree-leaf-background-color:var(--color-tree-sky);--tree-leaf-text-color:var(--color-tree-leaf);--tree-leaf-under-background-color:var(--color-tree-earth);--tree-leaf-under-text-color:var(--color-tree-leaf-under);--tree-olive-background-color:var(--color-tree-sky);--tree-olive-text-color:var(--color-tree-olive);--tree-olive-under-background-color:var(--color-tree-earth);--tree-olive-under-text-color:var(--color-tree-olive-under);--tree-rule-line-background-color:var(--color-tree-rule);--tree-rule-under-background-color:var(--color-tree-rule-under);--tree-toast-shadow-background-color:var(--color-tree-shadow);--tree-lattice-sky-background-color:var(--color-tree-lattice-sky);--tree-lattice-earth-background-color:var(--color-tree-lattice-earth);--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}@media (prefers-color-scheme:dark){:root{--color-surface:#1b1c1e;--color-on-surface:#e6e4df;--color-on-surface-muted:#aeaba3;--color-edge:#1b1c1e;--color-error:#f2b8b5;--color-depth-0:#2e3a35;--color-depth-1:#34433c;--color-depth-2:#3a4c44;--color-depth-3:#40554b;--color-depth-4:#465e53;--color-depth-5:#4c675a;--color-cell-empty:#232a27;--color-tree-sky:#1a1e21;--color-tree-earth:#0c0f0e;--color-tree-topsoil:#060807;--color-tree-raised:#22272a;--color-tree-ink:#e6e7de;--color-tree-ink-soft:#a6ab9f;--color-tree-rule:#353a38;--color-tree-on-ink:#131513;--color-tree-ink-under:#e6e7de;--color-tree-ink-under-soft:#a6ab9f;--color-tree-rule-under:#2a302d;--color-tree-raised-under:#1e2224;--color-tree-alert:#f09a74;--color-tree-wood-0:#a3907b;--color-tree-wood-1:#c9a65c;--color-tree-wood-2:#8aa5b3;--color-tree-wood-3:#a98db0;--color-tree-wood-4:#8fae86;--color-tree-wood-under-0:#a3907b;--color-tree-wood-under-1:#c9a65c;--color-tree-wood-under-2:#8aa5b3;--color-tree-wood-under-3:#a98db0;--color-tree-wood-under-4:#8fae86;--color-tree-leaf:#8aa373;--color-tree-leaf-under:#8aa373;--color-tree-olive:#9b8db5;--color-tree-olive-under:#9b8db5;--color-tree-shadow:#00000040;--color-tree-lattice-sky:#e6e7de0d;--color-tree-lattice-earth:#e6e7de0d;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}}", xt = ":host{--sky:var(--color-tree-sky);vertical-align:middle;display:inline-block}:host([hidden]){display:none}svg{display:block;overflow:visible}", St = typeof HTMLElement > "u" ? class {} : HTMLElement, Ct = bt.replaceAll(":root", ":host");
|
|
1141
|
+
function G(e) {
|
|
1142
|
+
let t;
|
|
1143
|
+
return () => (t || (t = new CSSStyleSheet(), t.replaceSync(`${Ct}\n${xt}\n${e}`)), t);
|
|
1144
|
+
}
|
|
1145
|
+
function wt(e, t) {
|
|
1146
|
+
typeof customElements < "u" && (customElements.get(e) || customElements.define(e, t));
|
|
1147
|
+
}
|
|
1148
|
+
var K = (e, t) => {
|
|
1149
|
+
let n = typeof e == "number" ? e : Number.parseFloat(String(e ?? ""));
|
|
1150
|
+
return Number.isFinite(n) ? n : t;
|
|
1151
|
+
}, Tt = (e) => typeof e == "boolean" ? e : e != null && e !== "false", q = class extends St {
|
|
1152
|
+
dispose;
|
|
1153
|
+
connectedCallback() {
|
|
1154
|
+
for (let e of this.inputs) if (Object.hasOwn(this, e)) {
|
|
1155
|
+
let t = Reflect.get(this, e);
|
|
1156
|
+
Reflect.deleteProperty(this, e), Reflect.set(this, e, t);
|
|
1157
|
+
}
|
|
1158
|
+
if (this.dispose) return;
|
|
1159
|
+
let e = this.shadowRoot ?? this.attachShadow({ mode: "open" });
|
|
1160
|
+
e.adoptedStyleSheets = [this.sheet()], this.dispose = Me(() => this.draw(), e);
|
|
1161
|
+
}
|
|
1162
|
+
disconnectedCallback() {
|
|
1163
|
+
this.dispose?.(), this.dispose = void 0;
|
|
1164
|
+
}
|
|
1165
|
+
tell(e, t) {
|
|
1166
|
+
this.dispatchEvent(new CustomEvent(e, {
|
|
1167
|
+
detail: t,
|
|
1168
|
+
bubbles: !0,
|
|
1169
|
+
composed: !0
|
|
1170
|
+
}));
|
|
1171
|
+
}
|
|
1172
|
+
}, Et = /*#__PURE__*/ O("<svg class=face part=face><path class=plate-shade></path><path class=plate-shadow></path><path class=plate-top></path><g transform=\"translate(0 -10)\"><g>"), Dt = /*#__PURE__*/ O("<svg><g class=face-leaving></svg>", !1, !0, !1), Ot = "lattice-face", kt = Object.keys(ft), At = (e) => kt.includes(e), jt = 10, Mt = 2, J = 120 * M / 2, Nt = dt([
|
|
1173
|
+
{
|
|
1174
|
+
x: 0,
|
|
1175
|
+
y: -120
|
|
1176
|
+
},
|
|
1177
|
+
{
|
|
1178
|
+
x: J,
|
|
1179
|
+
y: -60
|
|
1180
|
+
},
|
|
1181
|
+
{
|
|
1182
|
+
x: J,
|
|
1183
|
+
y: 60
|
|
1184
|
+
},
|
|
1185
|
+
{
|
|
1186
|
+
x: 0,
|
|
1187
|
+
y: 120
|
|
1188
|
+
},
|
|
1189
|
+
{
|
|
1190
|
+
x: -J,
|
|
1191
|
+
y: 60
|
|
1192
|
+
},
|
|
1193
|
+
{
|
|
1194
|
+
x: -J,
|
|
1195
|
+
y: -60
|
|
1196
|
+
}
|
|
1197
|
+
], jt), Y = {
|
|
1198
|
+
x: -J - Mt,
|
|
1199
|
+
y: -120 - jt - Mt,
|
|
1200
|
+
width: 2 * (J + Mt),
|
|
1201
|
+
height: 240 + jt + 4
|
|
1202
|
+
}, Pt = G(`${yt}\n.plate-top { vector-effect: non-scaling-stroke; }`), Ft = class e extends q {
|
|
1203
|
+
static observedAttributes = [
|
|
1204
|
+
"mood",
|
|
1205
|
+
"expression",
|
|
1206
|
+
"pulse",
|
|
1207
|
+
"still",
|
|
1208
|
+
"size",
|
|
1209
|
+
"label",
|
|
1210
|
+
"decorative"
|
|
1211
|
+
];
|
|
1212
|
+
inputs = e.observedAttributes;
|
|
1213
|
+
moodSignal = v("happy");
|
|
1214
|
+
expressionSignal = v("");
|
|
1215
|
+
pulseSignal = v(0);
|
|
1216
|
+
stillSignal = v(!1);
|
|
1217
|
+
sizeSignal = v(96);
|
|
1218
|
+
labelSignal = v("");
|
|
1219
|
+
decorativeSignal = v(!1);
|
|
1220
|
+
get mood() {
|
|
1221
|
+
return this.moodSignal[0]();
|
|
1222
|
+
}
|
|
1223
|
+
set mood(e) {
|
|
1224
|
+
let t = String(e ?? "").toLowerCase();
|
|
1225
|
+
this.moodSignal[1](At(t) ? t : "happy");
|
|
1226
|
+
}
|
|
1227
|
+
get expression() {
|
|
1228
|
+
return this.expressionSignal[0]();
|
|
1229
|
+
}
|
|
1230
|
+
set expression(e) {
|
|
1231
|
+
this.expressionSignal[1](String(e ?? ""));
|
|
1232
|
+
}
|
|
1233
|
+
get pulse() {
|
|
1234
|
+
return this.pulseSignal[0]();
|
|
1235
|
+
}
|
|
1236
|
+
set pulse(e) {
|
|
1237
|
+
this.pulseSignal[1](K(e, 0));
|
|
1238
|
+
}
|
|
1239
|
+
get still() {
|
|
1240
|
+
return this.stillSignal[0]();
|
|
1241
|
+
}
|
|
1242
|
+
set still(e) {
|
|
1243
|
+
this.stillSignal[1](Tt(e));
|
|
1244
|
+
}
|
|
1245
|
+
get size() {
|
|
1246
|
+
return this.sizeSignal[0]();
|
|
1247
|
+
}
|
|
1248
|
+
set size(e) {
|
|
1249
|
+
this.sizeSignal[1](Math.max(1, K(e, 96)));
|
|
1250
|
+
}
|
|
1251
|
+
get label() {
|
|
1252
|
+
return this.labelSignal[0]();
|
|
1253
|
+
}
|
|
1254
|
+
set label(e) {
|
|
1255
|
+
this.labelSignal[1](String(e ?? ""));
|
|
1256
|
+
}
|
|
1257
|
+
get decorative() {
|
|
1258
|
+
return this.decorativeSignal[0]();
|
|
1259
|
+
}
|
|
1260
|
+
set decorative(e) {
|
|
1261
|
+
this.decorativeSignal[1](Tt(e));
|
|
1262
|
+
}
|
|
1263
|
+
attributeChangedCallback(e, t, n) {
|
|
1264
|
+
e === "still" || e === "decorative" ? Reflect.set(this, e, n) : Reflect.set(this, e, n ?? "");
|
|
1265
|
+
}
|
|
1266
|
+
sheet() {
|
|
1267
|
+
return Pt();
|
|
1268
|
+
}
|
|
1269
|
+
draw() {
|
|
1270
|
+
let e = x(() => pt(this.expression) ?? mt(this.mood)), { face: t, leaving: n } = _t({
|
|
1271
|
+
expression: e,
|
|
1272
|
+
pulse: () => this.pulse,
|
|
1273
|
+
still: () => this.still
|
|
1274
|
+
}), r = () => this.label || `A ${e().name.toLowerCase()} face`, i = this;
|
|
1275
|
+
return (() => {
|
|
1276
|
+
var e = Et(), a = e.firstChild, o = a.nextSibling, s = o.nextSibling, c = s.nextSibling, l = c.firstChild;
|
|
1277
|
+
return A(c, D(Oe, {
|
|
1278
|
+
get when() {
|
|
1279
|
+
return n();
|
|
1280
|
+
},
|
|
1281
|
+
children: (e) => (() => {
|
|
1282
|
+
var t = Dt();
|
|
1283
|
+
return A(t, D(vt, { get drawing() {
|
|
1284
|
+
return e();
|
|
1285
|
+
} })), t;
|
|
1286
|
+
})()
|
|
1287
|
+
}), l), A(l, D(vt, { get drawing() {
|
|
1288
|
+
return t();
|
|
1289
|
+
} })), y((t) => {
|
|
1290
|
+
var n = i.size, c = i.size * Y.height / Y.width, l = `${Y.x} ${Y.y} ${Y.width} ${Y.height}`, u = i.decorative ? void 0 : "img", d = i.decorative ? void 0 : r(), f = i.decorative ? "true" : void 0, p = Nt.shade, m = Nt.shadow, h = Nt.top;
|
|
1291
|
+
return n !== t.e && k(e, "width", t.e = n), c !== t.t && k(e, "height", t.t = c), l !== t.a && k(e, "viewBox", t.a = l), u !== t.o && k(e, "role", t.o = u), d !== t.i && k(e, "aria-label", t.i = d), f !== t.n && k(e, "aria-hidden", t.n = f), p !== t.s && k(a, "d", t.s = p), m !== t.h && k(o, "d", t.h = m), h !== t.r && k(s, "d", t.r = h), t;
|
|
1292
|
+
}, {
|
|
1293
|
+
e: void 0,
|
|
1294
|
+
t: void 0,
|
|
1295
|
+
a: void 0,
|
|
1296
|
+
o: void 0,
|
|
1297
|
+
i: void 0,
|
|
1298
|
+
n: void 0,
|
|
1299
|
+
s: void 0,
|
|
1300
|
+
h: void 0,
|
|
1301
|
+
r: void 0
|
|
1302
|
+
}), e;
|
|
1303
|
+
})();
|
|
1304
|
+
}
|
|
1305
|
+
}, It = () => wt(Ot, Ft), Lt = /*#__PURE__*/ O("<svg class=mark-shears viewBox=\"0 0 16 16\"aria-hidden=true><path class=shears-blade part=shears-blade></path><path class=shears-blade part=shears-blade></path><path class=shears-handle part=shears-handle></path><path class=shears-handle part=shears-handle>"), Rt = /*#__PURE__*/ O("<svg class=mark-done viewBox=\"0 0 16 16\"aria-hidden=true><path class=done-cell part=done-cell></path><path class=done-check part=done-check d=\"M 4.3 8.4 L 7 9.96 L 11.8 7.19\">"), zt = (e, t, n) => {
|
|
1306
|
+
let r = n * Math.sqrt(3) / 2;
|
|
1307
|
+
return [
|
|
1308
|
+
{
|
|
1309
|
+
x: e,
|
|
1310
|
+
y: t - n
|
|
1311
|
+
},
|
|
1312
|
+
{
|
|
1313
|
+
x: e + r,
|
|
1314
|
+
y: t - n / 2
|
|
1315
|
+
},
|
|
1316
|
+
{
|
|
1317
|
+
x: e + r,
|
|
1318
|
+
y: t + n / 2
|
|
1319
|
+
},
|
|
1320
|
+
{
|
|
1321
|
+
x: e,
|
|
1322
|
+
y: t + n
|
|
1323
|
+
},
|
|
1324
|
+
{
|
|
1325
|
+
x: e - r,
|
|
1326
|
+
y: t + n / 2
|
|
1327
|
+
},
|
|
1328
|
+
{
|
|
1329
|
+
x: e - r,
|
|
1330
|
+
y: t - n / 2
|
|
1331
|
+
}
|
|
1332
|
+
];
|
|
1333
|
+
};
|
|
1334
|
+
function Bt() {
|
|
1335
|
+
let e = (e, t) => [
|
|
1336
|
+
e,
|
|
1337
|
+
{
|
|
1338
|
+
x: e.x + t * 8.66,
|
|
1339
|
+
y: e.y - 5
|
|
1340
|
+
},
|
|
1341
|
+
{
|
|
1342
|
+
x: e.x + t * 8.66,
|
|
1343
|
+
y: e.y - 6.6
|
|
1344
|
+
},
|
|
1345
|
+
{
|
|
1346
|
+
x: e.x,
|
|
1347
|
+
y: e.y - 1.6
|
|
1348
|
+
}
|
|
1349
|
+
];
|
|
1350
|
+
return (() => {
|
|
1351
|
+
var t = Lt(), n = t.firstChild, r = n.nextSibling, i = r.nextSibling, a = i.nextSibling;
|
|
1352
|
+
return y((t) => {
|
|
1353
|
+
var o = Le(e({
|
|
1354
|
+
x: 4.6,
|
|
1355
|
+
y: 10
|
|
1356
|
+
}, 1)), s = Le(e({
|
|
1357
|
+
x: 11.4,
|
|
1358
|
+
y: 10
|
|
1359
|
+
}, -1)), c = Le(zt(4.6, 12.6, 2.6)), l = Le(zt(11.4, 12.6, 2.6));
|
|
1360
|
+
return o !== t.e && k(n, "d", t.e = o), s !== t.t && k(r, "d", t.t = s), c !== t.a && k(i, "d", t.a = c), l !== t.o && k(a, "d", t.o = l), t;
|
|
1361
|
+
}, {
|
|
1362
|
+
e: void 0,
|
|
1363
|
+
t: void 0,
|
|
1364
|
+
a: void 0,
|
|
1365
|
+
o: void 0
|
|
1366
|
+
}), t;
|
|
1367
|
+
})();
|
|
1368
|
+
}
|
|
1369
|
+
function Vt() {
|
|
1370
|
+
return (() => {
|
|
1371
|
+
var e = Rt(), t = e.firstChild;
|
|
1372
|
+
return y(() => k(t, "d", Le(zt(8, 8, 7)))), e;
|
|
1373
|
+
})();
|
|
1374
|
+
}
|
|
1375
|
+
//#endregion
|
|
1376
|
+
//#region src/elements/icon.css?inline
|
|
1377
|
+
var Ht = ":host{width:var(--lattice-icon-size,var(--space-tree-4));height:var(--lattice-icon-size,var(--space-tree-4))}span{width:100%;height:100%;display:block}svg{width:100%;height:100%}.mark-shears,.mark-done{stroke:currentColor;stroke-width:1.3px;stroke-linejoin:miter}.shears-blade{fill:currentColor}.shears-handle,.done-cell,.done-check{fill:none}.done-check{stroke-width:1.6px}", Ut = /*#__PURE__*/ O("<span part=icon>"), Wt = /*#__PURE__*/ O("<span part=icon role=img>"), Gt = "lattice-icon", Kt = ["shears", "done"], qt = G(Ht), Jt = class e extends q {
|
|
1378
|
+
static observedAttributes = ["name", "label"];
|
|
1379
|
+
inputs = e.observedAttributes;
|
|
1380
|
+
nameSignal = v("shears");
|
|
1381
|
+
labelSignal = v("");
|
|
1382
|
+
get name() {
|
|
1383
|
+
return this.nameSignal[0]();
|
|
1384
|
+
}
|
|
1385
|
+
set name(e) {
|
|
1386
|
+
this.nameSignal[1](String(e ?? "").toLowerCase() === "done" ? "done" : "shears");
|
|
1387
|
+
}
|
|
1388
|
+
get label() {
|
|
1389
|
+
return this.labelSignal[0]();
|
|
1390
|
+
}
|
|
1391
|
+
set label(e) {
|
|
1392
|
+
this.labelSignal[1](String(e ?? ""));
|
|
1393
|
+
}
|
|
1394
|
+
attributeChangedCallback(e, t, n) {
|
|
1395
|
+
Reflect.set(this, e, n ?? "");
|
|
1396
|
+
}
|
|
1397
|
+
sheet() {
|
|
1398
|
+
return qt();
|
|
1399
|
+
}
|
|
1400
|
+
draw() {
|
|
1401
|
+
let e = () => {
|
|
1402
|
+
let e = this;
|
|
1403
|
+
return D(ke, { get children() {
|
|
1404
|
+
return [D(Ae, {
|
|
1405
|
+
get when() {
|
|
1406
|
+
return e.name === "done";
|
|
1407
|
+
},
|
|
1408
|
+
get children() {
|
|
1409
|
+
return D(Vt, {});
|
|
1410
|
+
}
|
|
1411
|
+
}), D(Ae, {
|
|
1412
|
+
get when() {
|
|
1413
|
+
return e.name === "shears";
|
|
1414
|
+
},
|
|
1415
|
+
get children() {
|
|
1416
|
+
return D(Bt, {});
|
|
1417
|
+
}
|
|
1418
|
+
})];
|
|
1419
|
+
} });
|
|
1420
|
+
}, t = this;
|
|
1421
|
+
return D(Oe, {
|
|
1422
|
+
get when() {
|
|
1423
|
+
return t.label;
|
|
1424
|
+
},
|
|
1425
|
+
get fallback() {
|
|
1426
|
+
return (() => {
|
|
1427
|
+
var t = Ut();
|
|
1428
|
+
return A(t, e), t;
|
|
1429
|
+
})();
|
|
1430
|
+
},
|
|
1431
|
+
children: (t) => (() => {
|
|
1432
|
+
var n = Wt();
|
|
1433
|
+
return A(n, e), y(() => k(n, "aria-label", t())), n;
|
|
1434
|
+
})()
|
|
1435
|
+
});
|
|
1436
|
+
}
|
|
1437
|
+
}, Yt = () => wt(Gt, Jt), Xt = ".shape .flat-top{fill:color-mix(in srgb, var(--wood) 28%, var(--sky));stroke:color-mix(in srgb, var(--wood) 55%, var(--sky));stroke-width:var(--tree-rule-width);stroke-linejoin:round;vector-effect:non-scaling-stroke}.shape .flat-top[data-tone=\"5\"],.shape .flat-top[data-tone=\"6\"]{fill:var(--wood)}.shape .flat-top[data-tone=\"7\"]{fill:var(--color-tree-raised)}.shape .flat-shade{fill:color-mix(in srgb, var(--wood) 70%, var(--sky))}.shape .flat-shadow{fill:var(--wood)}.shape .seams{fill:none;stroke:color-mix(in srgb, var(--color-tree-ink) 18%, transparent);stroke-width:var(--tree-rule-width);stroke-linecap:round;vector-effect:non-scaling-stroke}", Zt = {
|
|
1438
|
+
width: 76.21,
|
|
1439
|
+
height: 132,
|
|
1440
|
+
half: 38.11
|
|
1441
|
+
}, Qt = {
|
|
1442
|
+
sky: "M 76.21 66.00 L 38.11 88.00 L -0.00 66.00 L 0.00 22.00 L 38.11 0.00 L 76.21 22.00 Z M 38.11 132.00 L 0.00 154.00 L -38.11 132.00 L -38.11 88.00 L -0.00 66.00 L 38.11 88.00 Z M 114.32 132.00 L 76.21 154.00 L 38.11 132.00 L 38.11 88.00 L 76.21 66.00 L 114.32 88.00 Z",
|
|
1443
|
+
earth: "M 76.21 66.00 L 38.11 88.00 L -0.00 66.00 L 0.00 22.00 L 38.11 0.00 L 76.21 22.00 Z M 38.11 44.00 L 76.21 66.00 M 57.16 55.00 L 57.16 77.00 L 38.11 66.00 Z M 38.11 44.00 L 38.11 88.00 M 38.11 66.00 L 19.05 77.00 L 19.05 55.00 Z M 38.11 44.00 L -0.00 66.00 M 19.05 55.00 L -0.00 44.00 L 19.05 33.00 Z M 38.11 44.00 L 0.00 22.00 M 19.05 33.00 L 19.05 11.00 L 38.11 22.00 Z M 38.11 44.00 L 38.11 0.00 M 38.11 22.00 L 57.16 11.00 L 57.16 33.00 Z M 38.11 44.00 L 76.21 22.00 M 57.16 33.00 L 76.21 44.00 L 57.16 55.00 Z M 38.11 132.00 L 0.00 154.00 L -38.11 132.00 L -38.11 88.00 L -0.00 66.00 L 38.11 88.00 Z M 0.00 110.00 L 38.11 132.00 M 19.05 121.00 L 19.05 143.00 L 0.00 132.00 Z M 0.00 110.00 L 0.00 154.00 M 0.00 132.00 L -19.05 143.00 L -19.05 121.00 Z M 0.00 110.00 L -38.11 132.00 M -19.05 121.00 L -38.11 110.00 L -19.05 99.00 Z M 0.00 110.00 L -38.11 88.00 M -19.05 99.00 L -19.05 77.00 L -0.00 88.00 Z M 0.00 110.00 L -0.00 66.00 M -0.00 88.00 L 19.05 77.00 L 19.05 99.00 Z M 0.00 110.00 L 38.11 88.00 M 19.05 99.00 L 38.11 110.00 L 19.05 121.00 Z M 114.32 132.00 L 76.21 154.00 L 38.11 132.00 L 38.11 88.00 L 76.21 66.00 L 114.32 88.00 Z M 76.21 110.00 L 114.32 132.00 M 95.26 121.00 L 95.26 143.00 L 76.21 132.00 Z M 76.21 110.00 L 76.21 154.00 M 76.21 132.00 L 57.16 143.00 L 57.16 121.00 Z M 76.21 110.00 L 38.11 132.00 M 57.16 121.00 L 38.11 110.00 L 57.16 99.00 Z M 76.21 110.00 L 38.11 88.00 M 57.16 99.00 L 57.16 77.00 L 76.21 88.00 Z M 76.21 110.00 L 76.21 66.00 M 76.21 88.00 L 95.26 77.00 L 95.26 99.00 Z M 76.21 110.00 L 114.32 88.00 M 95.26 99.00 L 114.32 110.00 L 95.26 121.00 Z"
|
|
1444
|
+
}, $t = 44, { width: X } = Zt, Z = X / 2;
|
|
1445
|
+
function en(e) {
|
|
1446
|
+
return {
|
|
1447
|
+
x: X * (e.q + e.r / 2),
|
|
1448
|
+
y: 66 * e.r
|
|
1449
|
+
};
|
|
1450
|
+
}
|
|
1451
|
+
function tn(e) {
|
|
1452
|
+
return {
|
|
1453
|
+
x: Z * e.j,
|
|
1454
|
+
y: $t * e.i + 22 * e.j
|
|
1455
|
+
};
|
|
1456
|
+
}
|
|
1457
|
+
function nn(e) {
|
|
1458
|
+
let t = tn(e);
|
|
1459
|
+
return {
|
|
1460
|
+
x: t.x,
|
|
1461
|
+
y: 22 + t.y
|
|
1462
|
+
};
|
|
1463
|
+
}
|
|
1464
|
+
function rn(e) {
|
|
1465
|
+
let { i: t, j: n } = e;
|
|
1466
|
+
return e.k === 0 ? [
|
|
1467
|
+
{
|
|
1468
|
+
i: t,
|
|
1469
|
+
j: n
|
|
1470
|
+
},
|
|
1471
|
+
{
|
|
1472
|
+
i: t,
|
|
1473
|
+
j: n + 1
|
|
1474
|
+
},
|
|
1475
|
+
{
|
|
1476
|
+
i: t + 1,
|
|
1477
|
+
j: n
|
|
1478
|
+
}
|
|
1479
|
+
] : [
|
|
1480
|
+
{
|
|
1481
|
+
i: t,
|
|
1482
|
+
j: n + 1
|
|
1483
|
+
},
|
|
1484
|
+
{
|
|
1485
|
+
i: t + 1,
|
|
1486
|
+
j: n + 1
|
|
1487
|
+
},
|
|
1488
|
+
{
|
|
1489
|
+
i: t + 1,
|
|
1490
|
+
j: n
|
|
1491
|
+
}
|
|
1492
|
+
];
|
|
1493
|
+
}
|
|
1494
|
+
function an(e, t) {
|
|
1495
|
+
let n = e - Z, r = 2 / 3 * ((t - 44) / $t), i = Math.sqrt(3) / 3 * (n / $t) - r / 2, a = -i - r, o = Math.round(i), s = Math.round(r), c = Math.round(a), l = Math.abs(o - i), u = Math.abs(s - r), d = Math.abs(c - a);
|
|
1496
|
+
return l > u && l > d ? o = -s - c : u > d && (s = -o - c), {
|
|
1497
|
+
q: o + 0,
|
|
1498
|
+
r: s + 0
|
|
1499
|
+
};
|
|
1500
|
+
}
|
|
1501
|
+
function on(e, t) {
|
|
1502
|
+
let n = Math.round(e / Z);
|
|
1503
|
+
return {
|
|
1504
|
+
i: Math.round((t - 22 - 22 * n) / $t) + 0,
|
|
1505
|
+
j: n + 0
|
|
1506
|
+
};
|
|
1507
|
+
}
|
|
1508
|
+
function sn(e) {
|
|
1509
|
+
return {
|
|
1510
|
+
i: e.r - e.q,
|
|
1511
|
+
j: 1 + 2 * e.q + e.r
|
|
1512
|
+
};
|
|
1513
|
+
}
|
|
1514
|
+
function cn(e) {
|
|
1515
|
+
let { i: t, j: n } = sn(e);
|
|
1516
|
+
return [
|
|
1517
|
+
{
|
|
1518
|
+
i: t,
|
|
1519
|
+
j: n,
|
|
1520
|
+
k: 0
|
|
1521
|
+
},
|
|
1522
|
+
{
|
|
1523
|
+
i: t - 1,
|
|
1524
|
+
j: n,
|
|
1525
|
+
k: 0
|
|
1526
|
+
},
|
|
1527
|
+
{
|
|
1528
|
+
i: t,
|
|
1529
|
+
j: n - 1,
|
|
1530
|
+
k: 0
|
|
1531
|
+
},
|
|
1532
|
+
{
|
|
1533
|
+
i: t - 1,
|
|
1534
|
+
j: n,
|
|
1535
|
+
k: 1
|
|
1536
|
+
},
|
|
1537
|
+
{
|
|
1538
|
+
i: t,
|
|
1539
|
+
j: n - 1,
|
|
1540
|
+
k: 1
|
|
1541
|
+
},
|
|
1542
|
+
{
|
|
1543
|
+
i: t - 1,
|
|
1544
|
+
j: n - 1,
|
|
1545
|
+
k: 1
|
|
1546
|
+
}
|
|
1547
|
+
];
|
|
1548
|
+
}
|
|
1549
|
+
function ln(e) {
|
|
1550
|
+
let { i: t, j: n } = e;
|
|
1551
|
+
return e.k === 0 ? [
|
|
1552
|
+
{
|
|
1553
|
+
i: t - 1,
|
|
1554
|
+
j: n,
|
|
1555
|
+
k: 1
|
|
1556
|
+
},
|
|
1557
|
+
{
|
|
1558
|
+
i: t,
|
|
1559
|
+
j: n,
|
|
1560
|
+
k: 1
|
|
1561
|
+
},
|
|
1562
|
+
{
|
|
1563
|
+
i: t,
|
|
1564
|
+
j: n - 1,
|
|
1565
|
+
k: 1
|
|
1566
|
+
}
|
|
1567
|
+
] : [
|
|
1568
|
+
{
|
|
1569
|
+
i: t,
|
|
1570
|
+
j: n + 1,
|
|
1571
|
+
k: 0
|
|
1572
|
+
},
|
|
1573
|
+
{
|
|
1574
|
+
i: t + 1,
|
|
1575
|
+
j: n,
|
|
1576
|
+
k: 0
|
|
1577
|
+
},
|
|
1578
|
+
{
|
|
1579
|
+
i: t,
|
|
1580
|
+
j: n,
|
|
1581
|
+
k: 0
|
|
1582
|
+
}
|
|
1583
|
+
];
|
|
1584
|
+
}
|
|
1585
|
+
var un = (e) => `${e.i},${e.j},${e.k}`, dn = (e) => `${e.i},${e.j}`, fn = (e) => e.kind === "cell" ? cn(e.at) : [e.at], pn = /* @__PURE__ */ new WeakMap();
|
|
1586
|
+
function mn(e) {
|
|
1587
|
+
let t = pn.get(e);
|
|
1588
|
+
return t || (t = e.parts.flatMap(fn), pn.set(e, t)), t;
|
|
1589
|
+
}
|
|
1590
|
+
function hn(e) {
|
|
1591
|
+
let t = e.flatMap(fn).flatMap((e) => rn(e).map(nn)), n = {
|
|
1592
|
+
x: t.reduce((e, t) => e + t.x, 0) / t.length,
|
|
1593
|
+
y: t.reduce((e, t) => e + t.y, 0) / t.length
|
|
1594
|
+
};
|
|
1595
|
+
return e.some((e) => e.kind === "cell") ? sn(an(n.x, n.y)) : on(n.x, n.y);
|
|
1596
|
+
}
|
|
1597
|
+
var gn = (e, t) => ({
|
|
1598
|
+
id: e,
|
|
1599
|
+
parts: t,
|
|
1600
|
+
pivot: hn(t)
|
|
1601
|
+
});
|
|
1602
|
+
function _n(e) {
|
|
1603
|
+
let t = /* @__PURE__ */ new Map();
|
|
1604
|
+
e.parts.forEach((e, n) => {
|
|
1605
|
+
for (let r of fn(e)) t.set(un(r), n);
|
|
1606
|
+
});
|
|
1607
|
+
let n = [];
|
|
1608
|
+
for (let [e, r] of t) {
|
|
1609
|
+
let [i, a, o] = e.split(",").map(Number), s = {
|
|
1610
|
+
i,
|
|
1611
|
+
j: a,
|
|
1612
|
+
k: o
|
|
1613
|
+
};
|
|
1614
|
+
for (let e of ln(s)) {
|
|
1615
|
+
let i = t.get(un(e));
|
|
1616
|
+
if (i === void 0 || i <= r) continue;
|
|
1617
|
+
let a = new Set(rn(s).map(dn)), o = rn(e).filter((e) => a.has(dn(e)));
|
|
1618
|
+
o.length === 2 && n.push([nn(o[0]), nn(o[1])]);
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
return n;
|
|
1622
|
+
}
|
|
1623
|
+
function vn(e, t) {
|
|
1624
|
+
let n = (e) => Math.round(e * 100) / 100, r = (e) => `M${e.map((e) => `${n(e.x)} ${n(e.y)}`).join("L")}Z`, i = (e) => ({
|
|
1625
|
+
x: e.x,
|
|
1626
|
+
y: e.y - t
|
|
1627
|
+
}), a = /* @__PURE__ */ new Map(), o = (e, t, n) => {
|
|
1628
|
+
let r = `${e}:${t}`, i = a.get(r) ?? {
|
|
1629
|
+
tone: t,
|
|
1630
|
+
kind: e,
|
|
1631
|
+
d: []
|
|
1632
|
+
};
|
|
1633
|
+
i.d.push(n), a.set(r, i);
|
|
1634
|
+
};
|
|
1635
|
+
for (let t of e.parts) if (t.kind === "cell") {
|
|
1636
|
+
let { x: e, y: n } = en(t.at), a = (t, r) => ({
|
|
1637
|
+
x: e + t,
|
|
1638
|
+
y: n + r
|
|
1639
|
+
}), [s, c, l] = [
|
|
1640
|
+
a(0, 66),
|
|
1641
|
+
a(Z, 88),
|
|
1642
|
+
a(X, 66)
|
|
1643
|
+
];
|
|
1644
|
+
o("shade", t.tone, r([
|
|
1645
|
+
s,
|
|
1646
|
+
c,
|
|
1647
|
+
i(c),
|
|
1648
|
+
i(s)
|
|
1649
|
+
])), o("shadow", t.tone, r([
|
|
1650
|
+
c,
|
|
1651
|
+
l,
|
|
1652
|
+
i(l),
|
|
1653
|
+
i(c)
|
|
1654
|
+
])), o("top", t.tone, r([
|
|
1655
|
+
a(Z, 0),
|
|
1656
|
+
a(X, 22),
|
|
1657
|
+
a(X, 66),
|
|
1658
|
+
a(Z, 88),
|
|
1659
|
+
a(0, 66),
|
|
1660
|
+
a(0, 22)
|
|
1661
|
+
].map(i)));
|
|
1662
|
+
} else {
|
|
1663
|
+
let e = rn(t.at).map(nn), n = e[2], a = e[1];
|
|
1664
|
+
o(t.at.k === 0 ? "shadow" : "shade", t.tone, r([
|
|
1665
|
+
n,
|
|
1666
|
+
a,
|
|
1667
|
+
i(a),
|
|
1668
|
+
i(n)
|
|
1669
|
+
])), o("top", t.tone, r(e.map(i)));
|
|
1670
|
+
}
|
|
1671
|
+
let s = [
|
|
1672
|
+
"shade",
|
|
1673
|
+
"shadow",
|
|
1674
|
+
"top"
|
|
1675
|
+
];
|
|
1676
|
+
return {
|
|
1677
|
+
faces: [...a.values()].sort((e, t) => s.indexOf(e.kind) - s.indexOf(t.kind) || e.tone - t.tone).map((e) => ({
|
|
1678
|
+
tone: e.tone,
|
|
1679
|
+
kind: e.kind,
|
|
1680
|
+
d: e.d.join("")
|
|
1681
|
+
})),
|
|
1682
|
+
seams: _n(e).map(([e, r]) => `M${n(e.x)} ${n(e.y - t)}L${n(r.x)} ${n(r.y - t)}`).join("")
|
|
1683
|
+
};
|
|
1684
|
+
}
|
|
1685
|
+
//#endregion
|
|
1686
|
+
//#region src/elements/shapes.ts
|
|
1687
|
+
var yn = 8, Q = (e, t, n) => ({
|
|
1688
|
+
kind: "cell",
|
|
1689
|
+
at: {
|
|
1690
|
+
q: e,
|
|
1691
|
+
r: t
|
|
1692
|
+
},
|
|
1693
|
+
tone: n
|
|
1694
|
+
}), $ = (e, t, n, r) => ({
|
|
1695
|
+
kind: "tri",
|
|
1696
|
+
at: {
|
|
1697
|
+
i: e,
|
|
1698
|
+
j: t,
|
|
1699
|
+
k: n
|
|
1700
|
+
},
|
|
1701
|
+
tone: r
|
|
1702
|
+
}), bn = [
|
|
1703
|
+
{
|
|
1704
|
+
q: 1,
|
|
1705
|
+
r: 0
|
|
1706
|
+
},
|
|
1707
|
+
{
|
|
1708
|
+
q: 0,
|
|
1709
|
+
r: 1
|
|
1710
|
+
},
|
|
1711
|
+
{
|
|
1712
|
+
q: -1,
|
|
1713
|
+
r: 1
|
|
1714
|
+
},
|
|
1715
|
+
{
|
|
1716
|
+
q: -1,
|
|
1717
|
+
r: 0
|
|
1718
|
+
},
|
|
1719
|
+
{
|
|
1720
|
+
q: 0,
|
|
1721
|
+
r: -1
|
|
1722
|
+
},
|
|
1723
|
+
{
|
|
1724
|
+
q: 1,
|
|
1725
|
+
r: -1
|
|
1726
|
+
}
|
|
1727
|
+
], xn = {
|
|
1728
|
+
cell: (e) => [Q(0, 0, e)],
|
|
1729
|
+
pair: (e) => [Q(0, 0, e), Q(1, 0, e)],
|
|
1730
|
+
line: (e) => [
|
|
1731
|
+
Q(-1, 0, e),
|
|
1732
|
+
Q(0, 0, e),
|
|
1733
|
+
Q(1, 0, e)
|
|
1734
|
+
],
|
|
1735
|
+
flower: (e) => [Q(0, 0, e), ...bn.map((t) => Q(t.q, t.r, e))],
|
|
1736
|
+
triangle: (e) => [$(0, 0, 0, e)],
|
|
1737
|
+
diamond: (e) => [$(0, 0, 0, e), $(0, 0, 1, e)],
|
|
1738
|
+
trapezoid: (e) => [
|
|
1739
|
+
$(0, 0, 0, e),
|
|
1740
|
+
$(0, 0, 1, e),
|
|
1741
|
+
$(0, 1, 0, e)
|
|
1742
|
+
],
|
|
1743
|
+
"big-triangle": (e) => [
|
|
1744
|
+
$(0, 0, 0, e),
|
|
1745
|
+
$(0, 1, 0, e),
|
|
1746
|
+
$(1, 0, 0, e),
|
|
1747
|
+
$(0, 0, 1, e)
|
|
1748
|
+
],
|
|
1749
|
+
hexagon: (e) => cn({
|
|
1750
|
+
q: 0,
|
|
1751
|
+
r: 0
|
|
1752
|
+
}).map((t) => $(t.i, t.j, t.k, e))
|
|
1753
|
+
}, Sn = Object.keys(xn), Cn = (e) => Math.min(7, Math.max(0, Math.round(Number.isFinite(e) ? e : 0))), wn = (e) => typeof e == "number" && Number.isInteger(e);
|
|
1754
|
+
function Tn(e, t) {
|
|
1755
|
+
let n = e;
|
|
1756
|
+
if (typeof n == "string") try {
|
|
1757
|
+
n = JSON.parse(n);
|
|
1758
|
+
} catch {
|
|
1759
|
+
return [];
|
|
1760
|
+
}
|
|
1761
|
+
return Array.isArray(n) ? n.flatMap((e) => {
|
|
1762
|
+
if (typeof e != "object" || !e) return [];
|
|
1763
|
+
let { kind: n, at: r, tone: i } = e, a = Cn(typeof i == "number" ? i : t);
|
|
1764
|
+
return n === "cell" && r && wn(r.q) && wn(r.r) ? [Q(r.q, r.r, a)] : n === "tri" && r && wn(r.i) && wn(r.j) && (r.k === 0 || r.k === 1) ? [$(r.i, r.j, r.k, a)] : [];
|
|
1765
|
+
}) : [];
|
|
1766
|
+
}
|
|
1767
|
+
function En(e, t, n = 2) {
|
|
1768
|
+
if (e.length === 0) return {
|
|
1769
|
+
faces: [],
|
|
1770
|
+
seams: "",
|
|
1771
|
+
box: {
|
|
1772
|
+
x: 0,
|
|
1773
|
+
y: 0,
|
|
1774
|
+
width: 0,
|
|
1775
|
+
height: 0
|
|
1776
|
+
}
|
|
1777
|
+
};
|
|
1778
|
+
let r = gn("shape", e), i = mn(r).flatMap((e) => rn(e).map(nn)), a = i.map((e) => e.x), o = i.map((e) => e.y), s = Math.min(...a) - n, c = Math.min(...o) - t - n, l = {
|
|
1779
|
+
x: s,
|
|
1780
|
+
y: c,
|
|
1781
|
+
width: Math.max(...a) + n - s,
|
|
1782
|
+
height: Math.max(...o) + n - c
|
|
1783
|
+
};
|
|
1784
|
+
return {
|
|
1785
|
+
...vn(r, t),
|
|
1786
|
+
box: l
|
|
1787
|
+
};
|
|
1788
|
+
}
|
|
1789
|
+
//#endregion
|
|
1790
|
+
//#region src/elements/woods.css?inline
|
|
1791
|
+
var Dn = ".woods [data-tone]{--wood:var(--color-tree-wood-0)}.woods [data-tone=\"1\"]{--wood:var(--color-tree-wood-1)}.woods [data-tone=\"2\"]{--wood:var(--color-tree-wood-2)}.woods [data-tone=\"3\"]{--wood:var(--color-tree-wood-3)}.woods [data-tone=\"4\"]{--wood:var(--color-tree-wood-4)}.woods [data-tone=\"5\"],.woods [data-tone=\"7\"]{--wood:var(--color-tree-olive)}", On = /*#__PURE__*/ O("<svg class=\"shape woods\"part=shape><path class=seams>"), kn = /*#__PURE__*/ O("<svg><path></svg>", !1, !0, !1), An = "lattice-shape", jn = (e) => Object.hasOwn(xn, e), Mn = G(`${Dn}\n${Xt}`), Nn = class e extends q {
|
|
1792
|
+
static observedAttributes = [
|
|
1793
|
+
"shape",
|
|
1794
|
+
"parts",
|
|
1795
|
+
"tone",
|
|
1796
|
+
"lift",
|
|
1797
|
+
"scale",
|
|
1798
|
+
"label"
|
|
1799
|
+
];
|
|
1800
|
+
inputs = e.observedAttributes;
|
|
1801
|
+
shapeSignal = v("cell");
|
|
1802
|
+
partsSignal = v();
|
|
1803
|
+
toneSignal = v(0);
|
|
1804
|
+
liftSignal = v(8);
|
|
1805
|
+
scaleSignal = v(1);
|
|
1806
|
+
labelSignal = v("");
|
|
1807
|
+
get shape() {
|
|
1808
|
+
return this.shapeSignal[0]();
|
|
1809
|
+
}
|
|
1810
|
+
set shape(e) {
|
|
1811
|
+
let t = String(e ?? "").toLowerCase();
|
|
1812
|
+
this.shapeSignal[1](jn(t) ? t : "cell");
|
|
1813
|
+
}
|
|
1814
|
+
get parts() {
|
|
1815
|
+
let e = this.partsSignal[0]();
|
|
1816
|
+
return e === void 0 ? xn[this.shape](this.tone) : Tn(e, this.tone);
|
|
1817
|
+
}
|
|
1818
|
+
set parts(e) {
|
|
1819
|
+
this.partsSignal[1](() => e === null || e === "" ? void 0 : e);
|
|
1820
|
+
}
|
|
1821
|
+
get tone() {
|
|
1822
|
+
return this.toneSignal[0]();
|
|
1823
|
+
}
|
|
1824
|
+
set tone(e) {
|
|
1825
|
+
this.toneSignal[1](Cn(K(e, 0)));
|
|
1826
|
+
}
|
|
1827
|
+
get lift() {
|
|
1828
|
+
return this.liftSignal[0]();
|
|
1829
|
+
}
|
|
1830
|
+
set lift(e) {
|
|
1831
|
+
this.liftSignal[1](Math.max(0, K(e, 8)));
|
|
1832
|
+
}
|
|
1833
|
+
get scale() {
|
|
1834
|
+
return this.scaleSignal[0]();
|
|
1835
|
+
}
|
|
1836
|
+
set scale(e) {
|
|
1837
|
+
let t = K(e, 1);
|
|
1838
|
+
this.scaleSignal[1](t > 0 ? t : 1);
|
|
1839
|
+
}
|
|
1840
|
+
get label() {
|
|
1841
|
+
return this.labelSignal[0]();
|
|
1842
|
+
}
|
|
1843
|
+
set label(e) {
|
|
1844
|
+
this.labelSignal[1](String(e ?? ""));
|
|
1845
|
+
}
|
|
1846
|
+
attributeChangedCallback(e, t, n) {
|
|
1847
|
+
e === "parts" ? this.parts = n : Reflect.set(this, e, n ?? "");
|
|
1848
|
+
}
|
|
1849
|
+
sheet() {
|
|
1850
|
+
return Mn();
|
|
1851
|
+
}
|
|
1852
|
+
draw() {
|
|
1853
|
+
let e = x(() => En(this.parts, this.lift)), t = () => e().box, n = this;
|
|
1854
|
+
return (() => {
|
|
1855
|
+
var r = On(), i = r.firstChild;
|
|
1856
|
+
return A(r, D(Ee, {
|
|
1857
|
+
get each() {
|
|
1858
|
+
return e().faces;
|
|
1859
|
+
},
|
|
1860
|
+
children: (e) => (() => {
|
|
1861
|
+
var t = kn();
|
|
1862
|
+
return y((n) => {
|
|
1863
|
+
var r = `flat-${e.kind}`, i = e.tone, a = e.d;
|
|
1864
|
+
return r !== n.e && k(t, "class", n.e = r), i !== n.t && k(t, "data-tone", n.t = i), a !== n.a && k(t, "d", n.a = a), n;
|
|
1865
|
+
}, {
|
|
1866
|
+
e: void 0,
|
|
1867
|
+
t: void 0,
|
|
1868
|
+
a: void 0
|
|
1869
|
+
}), t;
|
|
1870
|
+
})()
|
|
1871
|
+
}), i), y((a) => {
|
|
1872
|
+
var o = t().width * n.scale, s = t().height * n.scale, c = `${t().x} ${t().y} ${t().width} ${t().height}`, l = n.label ? "img" : void 0, u = n.label || void 0, d = n.label ? void 0 : "true", f = e().seams;
|
|
1873
|
+
return o !== a.e && k(r, "width", a.e = o), s !== a.t && k(r, "height", a.t = s), c !== a.a && k(r, "viewBox", a.a = c), l !== a.o && k(r, "role", a.o = l), u !== a.i && k(r, "aria-label", a.i = u), d !== a.n && k(r, "aria-hidden", a.n = d), f !== a.s && k(i, "d", a.s = f), a;
|
|
1874
|
+
}, {
|
|
1875
|
+
e: void 0,
|
|
1876
|
+
t: void 0,
|
|
1877
|
+
a: void 0,
|
|
1878
|
+
o: void 0,
|
|
1879
|
+
i: void 0,
|
|
1880
|
+
n: void 0,
|
|
1881
|
+
s: void 0
|
|
1882
|
+
}), r;
|
|
1883
|
+
})();
|
|
1884
|
+
}
|
|
1885
|
+
}, Pn = () => wt(An, Nn), Fn = ":host{touch-action:none;cursor:crosshair;display:block;position:relative}:host([disabled]){cursor:auto;pointer-events:none}.trail{pointer-events:none;width:100%;height:100%;position:absolute;inset:0}.blade{fill:none;stroke:var(--color-tree-alert);stroke-width:var(--tree-rule-thick-width);stroke-linecap:round;stroke-linejoin:round}", In = 220;
|
|
1886
|
+
function Ln() {
|
|
1887
|
+
let [e, t] = v([]), n, r = () => {
|
|
1888
|
+
let i = performance.now();
|
|
1889
|
+
t((e) => e.filter((e) => i - e.at < In)), n = e().length > 0 ? requestAnimationFrame(r) : void 0;
|
|
1890
|
+
};
|
|
1891
|
+
return C(() => {
|
|
1892
|
+
n !== void 0 && cancelAnimationFrame(n);
|
|
1893
|
+
}), {
|
|
1894
|
+
points: () => e().map((e) => `${e.p.x},${e.p.y}`).join(" "),
|
|
1895
|
+
add: (e) => {
|
|
1896
|
+
t((t) => [...t, {
|
|
1897
|
+
p: e,
|
|
1898
|
+
at: performance.now()
|
|
1899
|
+
}]), n ??= requestAnimationFrame(r);
|
|
1900
|
+
}
|
|
1901
|
+
};
|
|
1902
|
+
}
|
|
1903
|
+
//#endregion
|
|
1904
|
+
//#region src/elements/shears.tsx
|
|
1905
|
+
var Rn = /*#__PURE__*/ O("<svg class=trail part=trail aria-hidden=true><polyline class=blade>"), zn = "shears-pad", Bn = G(Fn), Vn = class e extends q {
|
|
1906
|
+
static observedAttributes = ["disabled"];
|
|
1907
|
+
inputs = e.observedAttributes;
|
|
1908
|
+
disabledSignal = v(!1);
|
|
1909
|
+
get disabled() {
|
|
1910
|
+
return this.disabledSignal[0]();
|
|
1911
|
+
}
|
|
1912
|
+
set disabled(e) {
|
|
1913
|
+
this.disabledSignal[1](Tt(e));
|
|
1914
|
+
}
|
|
1915
|
+
attributeChangedCallback(e, t, n) {
|
|
1916
|
+
this.disabled = n;
|
|
1917
|
+
}
|
|
1918
|
+
sheet() {
|
|
1919
|
+
return Bn();
|
|
1920
|
+
}
|
|
1921
|
+
draw() {
|
|
1922
|
+
let e = Ln(), t, n, r = (e) => {
|
|
1923
|
+
let t = this.getBoundingClientRect();
|
|
1924
|
+
return {
|
|
1925
|
+
x: e.clientX - t.left,
|
|
1926
|
+
y: e.clientY - t.top
|
|
1927
|
+
};
|
|
1928
|
+
}, i = (e) => {
|
|
1929
|
+
this.disabled || e.button !== 0 || t || (e.preventDefault(), n = e.pointerId, this.setPointerCapture(n), t = [r(e)], this.tell("stroke", {
|
|
1930
|
+
points: [...t],
|
|
1931
|
+
fresh: !0
|
|
1932
|
+
}));
|
|
1933
|
+
}, a = (i) => {
|
|
1934
|
+
if (!t || i.pointerId !== n) return;
|
|
1935
|
+
let a = r(i);
|
|
1936
|
+
t.push(a), e.add(a), this.tell("stroke", {
|
|
1937
|
+
points: [...t],
|
|
1938
|
+
fresh: !1
|
|
1939
|
+
});
|
|
1940
|
+
}, o = (e) => {
|
|
1941
|
+
if (!t || e.pointerId !== n) return;
|
|
1942
|
+
let r = t;
|
|
1943
|
+
t = void 0, this.hasPointerCapture(e.pointerId) && this.releasePointerCapture(e.pointerId), this.tell("strokeend", { points: r });
|
|
1944
|
+
}, s = [
|
|
1945
|
+
["pointerdown", i],
|
|
1946
|
+
["pointermove", a],
|
|
1947
|
+
["pointerup", o],
|
|
1948
|
+
["pointercancel", o]
|
|
1949
|
+
];
|
|
1950
|
+
for (let [e, t] of s) this.addEventListener(e, t);
|
|
1951
|
+
return C(() => {
|
|
1952
|
+
for (let [e, t] of s) this.removeEventListener(e, t);
|
|
1953
|
+
}), (() => {
|
|
1954
|
+
var t = Rn(), n = t.firstChild;
|
|
1955
|
+
return y(() => k(n, "points", e.points())), t;
|
|
1956
|
+
})();
|
|
1957
|
+
}
|
|
1958
|
+
}, Hn = () => wt(zn, Vn), Un = ":host{background:var(--color-tree-sky);display:block;position:relative}:host([kind=earth]){background:var(--color-tree-earth)}.sky{width:100%;height:100%;position:absolute;inset:0;overflow:hidden}.line{fill:none;stroke:var(--color-tree-lattice-sky);stroke-width:var(--tree-rule-width)}:host([kind=earth]) .line{stroke:var(--color-tree-lattice-earth)}", Wn = /*#__PURE__*/ O("<svg class=sky part=sky aria-hidden=true><defs><pattern patternUnits=userSpaceOnUse><path class=line></path></pattern></defs><rect width=100% height=100%>"), Gn = "hex-sky", Kn = G(Un), qn = 0, Jn = class e extends q {
|
|
1959
|
+
static observedAttributes = [
|
|
1960
|
+
"kind",
|
|
1961
|
+
"scale",
|
|
1962
|
+
"x",
|
|
1963
|
+
"y"
|
|
1964
|
+
];
|
|
1965
|
+
inputs = e.observedAttributes;
|
|
1966
|
+
kindSignal = v("sky");
|
|
1967
|
+
scaleSignal = v(1);
|
|
1968
|
+
xSignal = v(0);
|
|
1969
|
+
ySignal = v(0);
|
|
1970
|
+
get kind() {
|
|
1971
|
+
return this.kindSignal[0]();
|
|
1972
|
+
}
|
|
1973
|
+
set kind(e) {
|
|
1974
|
+
this.kindSignal[1](String(e ?? "").toLowerCase() === "earth" ? "earth" : "sky");
|
|
1975
|
+
}
|
|
1976
|
+
get scale() {
|
|
1977
|
+
return this.scaleSignal[0]();
|
|
1978
|
+
}
|
|
1979
|
+
set scale(e) {
|
|
1980
|
+
let t = K(e, 1);
|
|
1981
|
+
this.scaleSignal[1](t > 0 ? t : 1);
|
|
1982
|
+
}
|
|
1983
|
+
get x() {
|
|
1984
|
+
return this.xSignal[0]();
|
|
1985
|
+
}
|
|
1986
|
+
set x(e) {
|
|
1987
|
+
this.xSignal[1](K(e, 0));
|
|
1988
|
+
}
|
|
1989
|
+
get y() {
|
|
1990
|
+
return this.ySignal[0]();
|
|
1991
|
+
}
|
|
1992
|
+
set y(e) {
|
|
1993
|
+
this.ySignal[1](K(e, 0));
|
|
1994
|
+
}
|
|
1995
|
+
attributeChangedCallback(e, t, n) {
|
|
1996
|
+
Reflect.set(this, e, n ?? "");
|
|
1997
|
+
}
|
|
1998
|
+
sheet() {
|
|
1999
|
+
return Kn();
|
|
2000
|
+
}
|
|
2001
|
+
draw() {
|
|
2002
|
+
let e = `${Gn}-${++qn}`, t = this;
|
|
2003
|
+
return (() => {
|
|
2004
|
+
var n = Wn(), r = n.firstChild, i = r.firstChild, a = i.firstChild, o = r.nextSibling;
|
|
2005
|
+
return k(i, "id", e), k(o, "fill", `url(#${e})`), y((e) => {
|
|
2006
|
+
var n = Zt.width, r = Zt.height, o = `translate(${t.x} ${t.y}) scale(${t.scale})`, s = Qt[t.kind];
|
|
2007
|
+
return n !== e.e && k(i, "width", e.e = n), r !== e.t && k(i, "height", e.t = r), o !== e.a && k(i, "patternTransform", e.a = o), s !== e.o && k(a, "d", e.o = s), e;
|
|
2008
|
+
}, {
|
|
2009
|
+
e: void 0,
|
|
2010
|
+
t: void 0,
|
|
2011
|
+
a: void 0,
|
|
2012
|
+
o: void 0
|
|
2013
|
+
}), n;
|
|
2014
|
+
})();
|
|
2015
|
+
}
|
|
2016
|
+
}, Yn = () => wt(Gn, Jn);
|
|
2017
|
+
//#endregion
|
|
2018
|
+
//#region src/elements/index.ts
|
|
2019
|
+
function Xn() {
|
|
2020
|
+
It(), Yn(), Pn(), Hn(), Yt();
|
|
2021
|
+
}
|
|
2022
|
+
//#endregion
|
|
2023
|
+
export { Ot as _, zn as a, It as b, Nn as c, Sn as d, yn as f, Yt as g, Jt as h, Yn as i, An as l, Gt as m, Jn as n, Vn as o, Kt as p, Gn as r, Hn as s, Xn as t, Pn as u, Ft as v, tt as x, kt as y };
|