3d-shape-particle-text 1.0.1 → 1.0.3
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/3d-shape-particle-text.es.js +311 -894
- package/dist/3d-shape-particle-text.umd.js +1 -30
- package/index.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,964 +1,381 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
* LICENSE file in the root directory of this source tree.
|
|
12
|
-
*/
|
|
13
|
-
var ot;
|
|
14
|
-
function ht() {
|
|
15
|
-
if (ot) return Ge;
|
|
16
|
-
ot = 1;
|
|
17
|
-
var ge = lt, L = Symbol.for("react.element"), ye = Symbol.for("react.fragment"), X = Object.prototype.hasOwnProperty, se = ge.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, be = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
|
-
function ce(V, R, U) {
|
|
19
|
-
var x, M = {}, B = null, le = null;
|
|
20
|
-
U !== void 0 && (B = "" + U), R.key !== void 0 && (B = "" + R.key), R.ref !== void 0 && (le = R.ref);
|
|
21
|
-
for (x in R) X.call(R, x) && !be.hasOwnProperty(x) && (M[x] = R[x]);
|
|
22
|
-
if (V && V.defaultProps) for (x in R = V.defaultProps, R) M[x] === void 0 && (M[x] = R[x]);
|
|
23
|
-
return { $$typeof: L, type: V, key: B, ref: le, props: M, _owner: se.current };
|
|
1
|
+
import { jsx as Ae } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as Re, useEffect as Ye } from "react";
|
|
3
|
+
import * as a from "three";
|
|
4
|
+
const Ie = (e) => e ? {
|
|
5
|
+
error: (...s) => console.error(...s),
|
|
6
|
+
warn: (...s) => console.warn(...s)
|
|
7
|
+
} : {
|
|
8
|
+
error: () => {
|
|
9
|
+
},
|
|
10
|
+
warn: () => {
|
|
24
11
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return null;
|
|
44
|
-
var t = Ce && e[Ce] || e[Ye];
|
|
45
|
-
return typeof t == "function" ? t : null;
|
|
46
|
-
}
|
|
47
|
-
var K = ge.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
48
|
-
function _(e) {
|
|
49
|
-
{
|
|
50
|
-
for (var t = arguments.length, a = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++)
|
|
51
|
-
a[s - 1] = arguments[s];
|
|
52
|
-
Xe("error", e, a);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
function Xe(e, t, a) {
|
|
56
|
-
{
|
|
57
|
-
var s = K.ReactDebugCurrentFrame, f = s.getStackAddendum();
|
|
58
|
-
f !== "" && (t += "%s", a = a.concat([f]));
|
|
59
|
-
var h = a.map(function(l) {
|
|
60
|
-
return String(l);
|
|
61
|
-
});
|
|
62
|
-
h.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, h);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
var Je = !1, $e = !1, we = !1, E = !1, ue = !1, xe;
|
|
66
|
-
xe = Symbol.for("react.module.reference");
|
|
67
|
-
function it(e) {
|
|
68
|
-
return !!(typeof e == "string" || typeof e == "function" || e === X || e === be || ue || e === se || e === U || e === x || E || e === le || Je || $e || we || typeof e == "object" && e !== null && (e.$$typeof === B || e.$$typeof === M || e.$$typeof === ce || e.$$typeof === V || e.$$typeof === R || // This needs to include all possible module reference object
|
|
69
|
-
// types supported by any Flight configuration anywhere since
|
|
70
|
-
// we don't know which Flight build this will end up being used
|
|
71
|
-
// with.
|
|
72
|
-
e.$$typeof === xe || e.getModuleId !== void 0));
|
|
73
|
-
}
|
|
74
|
-
function ne(e, t, a) {
|
|
75
|
-
var s = e.displayName;
|
|
76
|
-
if (s)
|
|
77
|
-
return s;
|
|
78
|
-
var f = t.displayName || t.name || "";
|
|
79
|
-
return f !== "" ? a + "(" + f + ")" : a;
|
|
80
|
-
}
|
|
81
|
-
function Z(e) {
|
|
82
|
-
return e.displayName || "Context";
|
|
83
|
-
}
|
|
84
|
-
function y(e) {
|
|
85
|
-
if (e == null)
|
|
86
|
-
return null;
|
|
87
|
-
if (typeof e.tag == "number" && _("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
88
|
-
return e.displayName || e.name || null;
|
|
89
|
-
if (typeof e == "string")
|
|
90
|
-
return e;
|
|
91
|
-
switch (e) {
|
|
92
|
-
case X:
|
|
93
|
-
return "Fragment";
|
|
94
|
-
case ye:
|
|
95
|
-
return "Portal";
|
|
96
|
-
case be:
|
|
97
|
-
return "Profiler";
|
|
98
|
-
case se:
|
|
99
|
-
return "StrictMode";
|
|
100
|
-
case U:
|
|
101
|
-
return "Suspense";
|
|
102
|
-
case x:
|
|
103
|
-
return "SuspenseList";
|
|
104
|
-
}
|
|
105
|
-
if (typeof e == "object")
|
|
106
|
-
switch (e.$$typeof) {
|
|
107
|
-
case V:
|
|
108
|
-
var t = e;
|
|
109
|
-
return Z(t) + ".Consumer";
|
|
110
|
-
case ce:
|
|
111
|
-
var a = e;
|
|
112
|
-
return Z(a._context) + ".Provider";
|
|
113
|
-
case R:
|
|
114
|
-
return ne(e, e.render, "ForwardRef");
|
|
115
|
-
case M:
|
|
116
|
-
var s = e.displayName || null;
|
|
117
|
-
return s !== null ? s : y(e.type) || "Memo";
|
|
118
|
-
case B: {
|
|
119
|
-
var f = e, h = f._payload, l = f._init;
|
|
120
|
-
try {
|
|
121
|
-
return y(l(h));
|
|
122
|
-
} catch {
|
|
123
|
-
return null;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
return null;
|
|
128
|
-
}
|
|
129
|
-
var q = Object.assign, O = 0, W, ae, N, fe, F, je, Ee;
|
|
130
|
-
function Re() {
|
|
131
|
-
}
|
|
132
|
-
Re.__reactDisabledLog = !0;
|
|
133
|
-
function G() {
|
|
134
|
-
{
|
|
135
|
-
if (O === 0) {
|
|
136
|
-
W = console.log, ae = console.info, N = console.warn, fe = console.error, F = console.group, je = console.groupCollapsed, Ee = console.groupEnd;
|
|
137
|
-
var e = {
|
|
138
|
-
configurable: !0,
|
|
139
|
-
enumerable: !0,
|
|
140
|
-
value: Re,
|
|
141
|
-
writable: !0
|
|
142
|
-
};
|
|
143
|
-
Object.defineProperties(console, {
|
|
144
|
-
info: e,
|
|
145
|
-
log: e,
|
|
146
|
-
warn: e,
|
|
147
|
-
error: e,
|
|
148
|
-
group: e,
|
|
149
|
-
groupCollapsed: e,
|
|
150
|
-
groupEnd: e
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
O++;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
function C() {
|
|
157
|
-
{
|
|
158
|
-
if (O--, O === 0) {
|
|
159
|
-
var e = {
|
|
160
|
-
configurable: !0,
|
|
161
|
-
enumerable: !0,
|
|
162
|
-
writable: !0
|
|
163
|
-
};
|
|
164
|
-
Object.defineProperties(console, {
|
|
165
|
-
log: q({}, e, {
|
|
166
|
-
value: W
|
|
167
|
-
}),
|
|
168
|
-
info: q({}, e, {
|
|
169
|
-
value: ae
|
|
170
|
-
}),
|
|
171
|
-
warn: q({}, e, {
|
|
172
|
-
value: N
|
|
173
|
-
}),
|
|
174
|
-
error: q({}, e, {
|
|
175
|
-
value: fe
|
|
176
|
-
}),
|
|
177
|
-
group: q({}, e, {
|
|
178
|
-
value: F
|
|
179
|
-
}),
|
|
180
|
-
groupCollapsed: q({}, e, {
|
|
181
|
-
value: je
|
|
182
|
-
}),
|
|
183
|
-
groupEnd: q({}, e, {
|
|
184
|
-
value: Ee
|
|
185
|
-
})
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
O < 0 && _("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
var p = K.ReactCurrentDispatcher, ze;
|
|
192
|
-
function S(e, t, a) {
|
|
193
|
-
{
|
|
194
|
-
if (ze === void 0)
|
|
195
|
-
try {
|
|
196
|
-
throw Error();
|
|
197
|
-
} catch (f) {
|
|
198
|
-
var s = f.stack.trim().match(/\n( *(at )?)/);
|
|
199
|
-
ze = s && s[1] || "";
|
|
200
|
-
}
|
|
201
|
-
return `
|
|
202
|
-
` + ze + e;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
var ke = !1, _e;
|
|
206
|
-
{
|
|
207
|
-
var Ke = typeof WeakMap == "function" ? WeakMap : Map;
|
|
208
|
-
_e = new Ke();
|
|
209
|
-
}
|
|
210
|
-
function H(e, t) {
|
|
211
|
-
if (!e || ke)
|
|
212
|
-
return "";
|
|
213
|
-
{
|
|
214
|
-
var a = _e.get(e);
|
|
215
|
-
if (a !== void 0)
|
|
216
|
-
return a;
|
|
217
|
-
}
|
|
218
|
-
var s;
|
|
219
|
-
ke = !0;
|
|
220
|
-
var f = Error.prepareStackTrace;
|
|
221
|
-
Error.prepareStackTrace = void 0;
|
|
222
|
-
var h;
|
|
223
|
-
h = p.current, p.current = null, G();
|
|
224
|
-
try {
|
|
225
|
-
if (t) {
|
|
226
|
-
var l = function() {
|
|
227
|
-
throw Error();
|
|
228
|
-
};
|
|
229
|
-
if (Object.defineProperty(l.prototype, "props", {
|
|
230
|
-
set: function() {
|
|
231
|
-
throw Error();
|
|
232
|
-
}
|
|
233
|
-
}), typeof Reflect == "object" && Reflect.construct) {
|
|
234
|
-
try {
|
|
235
|
-
Reflect.construct(l, []);
|
|
236
|
-
} catch (A) {
|
|
237
|
-
s = A;
|
|
238
|
-
}
|
|
239
|
-
Reflect.construct(e, [], l);
|
|
240
|
-
} else {
|
|
241
|
-
try {
|
|
242
|
-
l.call();
|
|
243
|
-
} catch (A) {
|
|
244
|
-
s = A;
|
|
245
|
-
}
|
|
246
|
-
e.call(l.prototype);
|
|
247
|
-
}
|
|
248
|
-
} else {
|
|
249
|
-
try {
|
|
250
|
-
throw Error();
|
|
251
|
-
} catch (A) {
|
|
252
|
-
s = A;
|
|
253
|
-
}
|
|
254
|
-
e();
|
|
255
|
-
}
|
|
256
|
-
} catch (A) {
|
|
257
|
-
if (A && s && typeof A.stack == "string") {
|
|
258
|
-
for (var d = A.stack.split(`
|
|
259
|
-
`), w = s.stack.split(`
|
|
260
|
-
`), m = d.length - 1, b = w.length - 1; m >= 1 && b >= 0 && d[m] !== w[b]; )
|
|
261
|
-
b--;
|
|
262
|
-
for (; m >= 1 && b >= 0; m--, b--)
|
|
263
|
-
if (d[m] !== w[b]) {
|
|
264
|
-
if (m !== 1 || b !== 1)
|
|
265
|
-
do
|
|
266
|
-
if (m--, b--, b < 0 || d[m] !== w[b]) {
|
|
267
|
-
var z = `
|
|
268
|
-
` + d[m].replace(" at new ", " at ");
|
|
269
|
-
return e.displayName && z.includes("<anonymous>") && (z = z.replace("<anonymous>", e.displayName)), typeof e == "function" && _e.set(e, z), z;
|
|
270
|
-
}
|
|
271
|
-
while (m >= 1 && b >= 0);
|
|
272
|
-
break;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
} finally {
|
|
276
|
-
ke = !1, p.current = h, C(), Error.prepareStackTrace = f;
|
|
277
|
-
}
|
|
278
|
-
var Oe = e ? e.displayName || e.name : "", me = Oe ? S(Oe) : "";
|
|
279
|
-
return typeof e == "function" && _e.set(e, me), me;
|
|
280
|
-
}
|
|
281
|
-
function Ze(e, t, a) {
|
|
282
|
-
return H(e, !1);
|
|
283
|
-
}
|
|
284
|
-
function Qe(e) {
|
|
285
|
-
var t = e.prototype;
|
|
286
|
-
return !!(t && t.isReactComponent);
|
|
287
|
-
}
|
|
288
|
-
function Pe(e, t, a) {
|
|
289
|
-
if (e == null)
|
|
290
|
-
return "";
|
|
291
|
-
if (typeof e == "function")
|
|
292
|
-
return H(e, Qe(e));
|
|
293
|
-
if (typeof e == "string")
|
|
294
|
-
return S(e);
|
|
295
|
-
switch (e) {
|
|
296
|
-
case U:
|
|
297
|
-
return S("Suspense");
|
|
298
|
-
case x:
|
|
299
|
-
return S("SuspenseList");
|
|
300
|
-
}
|
|
301
|
-
if (typeof e == "object")
|
|
302
|
-
switch (e.$$typeof) {
|
|
303
|
-
case R:
|
|
304
|
-
return Ze(e.render);
|
|
305
|
-
case M:
|
|
306
|
-
return Pe(e.type, t, a);
|
|
307
|
-
case B: {
|
|
308
|
-
var s = e, f = s._payload, h = s._init;
|
|
309
|
-
try {
|
|
310
|
-
return Pe(h(f), t, a);
|
|
311
|
-
} catch {
|
|
312
|
-
}
|
|
313
|
-
}
|
|
12
|
+
}, ze = (e, s) => {
|
|
13
|
+
if (!e) return s;
|
|
14
|
+
if (typeof e == "string") {
|
|
15
|
+
const l = new a.Color(e);
|
|
16
|
+
return { r: l.r, g: l.g, b: l.b };
|
|
17
|
+
}
|
|
18
|
+
return typeof e == "object" && typeof e.r == "number" ? e : s;
|
|
19
|
+
}, Ue = (e) => {
|
|
20
|
+
if (!(!e || e.__shapeParticleTextPatched)) {
|
|
21
|
+
if (Object.defineProperty(e, "__shapeParticleTextPatched", {
|
|
22
|
+
value: !0,
|
|
23
|
+
configurable: !0
|
|
24
|
+
}), typeof e.getShaderPrecisionFormat == "function" && !e.getShaderPrecisionFormat.__shapeParticleTextPatched) {
|
|
25
|
+
const s = e.getShaderPrecisionFormat.bind(e), l = (...n) => {
|
|
26
|
+
try {
|
|
27
|
+
const t = s(...n);
|
|
28
|
+
if (t && typeof t.precision == "number") return t;
|
|
29
|
+
} catch {
|
|
314
30
|
}
|
|
315
|
-
|
|
316
|
-
}
|
|
317
|
-
var de = Object.prototype.hasOwnProperty, Ae = {}, Fe = K.ReactDebugCurrentFrame;
|
|
318
|
-
function he(e) {
|
|
319
|
-
if (e) {
|
|
320
|
-
var t = e._owner, a = Pe(e.type, e._source, t ? t.type : null);
|
|
321
|
-
Fe.setExtraStackFrame(a);
|
|
322
|
-
} else
|
|
323
|
-
Fe.setExtraStackFrame(null);
|
|
324
|
-
}
|
|
325
|
-
function Me(e, t, a, s, f) {
|
|
326
|
-
{
|
|
327
|
-
var h = Function.call.bind(de);
|
|
328
|
-
for (var l in e)
|
|
329
|
-
if (h(e, l)) {
|
|
330
|
-
var d = void 0;
|
|
331
|
-
try {
|
|
332
|
-
if (typeof e[l] != "function") {
|
|
333
|
-
var w = Error((s || "React class") + ": " + a + " type `" + l + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[l] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
334
|
-
throw w.name = "Invariant Violation", w;
|
|
335
|
-
}
|
|
336
|
-
d = e[l](t, l, s, a, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
337
|
-
} catch (m) {
|
|
338
|
-
d = m;
|
|
339
|
-
}
|
|
340
|
-
d && !(d instanceof Error) && (he(f), _("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", s || "React class", a, l, typeof d), he(null)), d instanceof Error && !(d.message in Ae) && (Ae[d.message] = !0, he(f), _("Failed %s type: %s", a, d.message), he(null));
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
var Q = Array.isArray;
|
|
345
|
-
function pe(e) {
|
|
346
|
-
return Q(e);
|
|
347
|
-
}
|
|
348
|
-
function et(e) {
|
|
349
|
-
{
|
|
350
|
-
var t = typeof Symbol == "function" && Symbol.toStringTag, a = t && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
351
|
-
return a;
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
function Be(e) {
|
|
355
|
-
try {
|
|
356
|
-
return Ve(e), !1;
|
|
357
|
-
} catch {
|
|
358
|
-
return !0;
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
function Ve(e) {
|
|
362
|
-
return "" + e;
|
|
363
|
-
}
|
|
364
|
-
function Ue(e) {
|
|
365
|
-
if (Be(e))
|
|
366
|
-
return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", et(e)), Ve(e);
|
|
367
|
-
}
|
|
368
|
-
var ve = K.ReactCurrentOwner, Te = {
|
|
369
|
-
key: !0,
|
|
370
|
-
ref: !0,
|
|
371
|
-
__self: !0,
|
|
372
|
-
__source: !0
|
|
373
|
-
}, ee, De;
|
|
374
|
-
function ie(e) {
|
|
375
|
-
if (de.call(e, "ref")) {
|
|
376
|
-
var t = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
377
|
-
if (t && t.isReactWarning)
|
|
378
|
-
return !1;
|
|
379
|
-
}
|
|
380
|
-
return e.ref !== void 0;
|
|
381
|
-
}
|
|
382
|
-
function tt(e) {
|
|
383
|
-
if (de.call(e, "key")) {
|
|
384
|
-
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
385
|
-
if (t && t.isReactWarning)
|
|
386
|
-
return !1;
|
|
387
|
-
}
|
|
388
|
-
return e.key !== void 0;
|
|
389
|
-
}
|
|
390
|
-
function te(e, t) {
|
|
391
|
-
typeof e.ref == "string" && ve.current;
|
|
392
|
-
}
|
|
393
|
-
function qe(e, t) {
|
|
394
|
-
{
|
|
395
|
-
var a = function() {
|
|
396
|
-
ee || (ee = !0, _("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
|
|
397
|
-
};
|
|
398
|
-
a.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
399
|
-
get: a,
|
|
400
|
-
configurable: !0
|
|
401
|
-
});
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
function Ne(e, t) {
|
|
405
|
-
{
|
|
406
|
-
var a = function() {
|
|
407
|
-
De || (De = !0, _("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
|
|
408
|
-
};
|
|
409
|
-
a.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
410
|
-
get: a,
|
|
411
|
-
configurable: !0
|
|
412
|
-
});
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
var Le = function(e, t, a, s, f, h, l) {
|
|
416
|
-
var d = {
|
|
417
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
418
|
-
$$typeof: L,
|
|
419
|
-
// Built-in properties that belong on the element
|
|
420
|
-
type: e,
|
|
421
|
-
key: t,
|
|
422
|
-
ref: a,
|
|
423
|
-
props: l,
|
|
424
|
-
// Record the component responsible for creating this element.
|
|
425
|
-
_owner: h
|
|
31
|
+
return { rangeMin: 127, rangeMax: 127, precision: 23 };
|
|
426
32
|
};
|
|
427
|
-
|
|
428
|
-
configurable: !1,
|
|
429
|
-
enumerable: !1,
|
|
430
|
-
writable: !0,
|
|
431
|
-
value: !1
|
|
432
|
-
}), Object.defineProperty(d, "_self", {
|
|
433
|
-
configurable: !1,
|
|
434
|
-
enumerable: !1,
|
|
435
|
-
writable: !1,
|
|
436
|
-
value: s
|
|
437
|
-
}), Object.defineProperty(d, "_source", {
|
|
438
|
-
configurable: !1,
|
|
439
|
-
enumerable: !1,
|
|
440
|
-
writable: !1,
|
|
441
|
-
value: f
|
|
442
|
-
}), Object.freeze && (Object.freeze(d.props), Object.freeze(d)), d;
|
|
443
|
-
};
|
|
444
|
-
function He(e, t, a, s, f) {
|
|
445
|
-
{
|
|
446
|
-
var h, l = {}, d = null, w = null;
|
|
447
|
-
a !== void 0 && (Ue(a), d = "" + a), tt(t) && (Ue(t.key), d = "" + t.key), ie(t) && (w = t.ref, te(t, f));
|
|
448
|
-
for (h in t)
|
|
449
|
-
de.call(t, h) && !Te.hasOwnProperty(h) && (l[h] = t[h]);
|
|
450
|
-
if (e && e.defaultProps) {
|
|
451
|
-
var m = e.defaultProps;
|
|
452
|
-
for (h in m)
|
|
453
|
-
l[h] === void 0 && (l[h] = m[h]);
|
|
454
|
-
}
|
|
455
|
-
if (d || w) {
|
|
456
|
-
var b = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
457
|
-
d && qe(l, b), w && Ne(l, b);
|
|
458
|
-
}
|
|
459
|
-
return Le(e, d, w, f, s, ve.current, l);
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
var Se = K.ReactCurrentOwner, We = K.ReactDebugCurrentFrame;
|
|
463
|
-
function re(e) {
|
|
464
|
-
if (e) {
|
|
465
|
-
var t = e._owner, a = Pe(e.type, e._source, t ? t.type : null);
|
|
466
|
-
We.setExtraStackFrame(a);
|
|
467
|
-
} else
|
|
468
|
-
We.setExtraStackFrame(null);
|
|
469
|
-
}
|
|
470
|
-
var r;
|
|
471
|
-
r = !1;
|
|
472
|
-
function n(e) {
|
|
473
|
-
return typeof e == "object" && e !== null && e.$$typeof === L;
|
|
474
|
-
}
|
|
475
|
-
function o() {
|
|
476
|
-
{
|
|
477
|
-
if (Se.current) {
|
|
478
|
-
var e = y(Se.current.type);
|
|
479
|
-
if (e)
|
|
480
|
-
return `
|
|
481
|
-
|
|
482
|
-
Check the render method of \`` + e + "`.";
|
|
483
|
-
}
|
|
484
|
-
return "";
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
function c(e) {
|
|
488
|
-
return "";
|
|
33
|
+
Object.defineProperty(l, "__shapeParticleTextPatched", { value: !0 }), Object.defineProperty(e, "getShaderPrecisionFormat", { value: l, configurable: !0 });
|
|
489
34
|
}
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
Check the top-level render call using <` + a + ">.");
|
|
35
|
+
if (typeof e.getParameter == "function" && !e.getParameter.__shapeParticleTextPatched) {
|
|
36
|
+
const s = e.getParameter.bind(e), l = (...n) => {
|
|
37
|
+
let t;
|
|
38
|
+
try {
|
|
39
|
+
t = s(...n);
|
|
40
|
+
} catch {
|
|
41
|
+
t = void 0;
|
|
499
42
|
}
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
{
|
|
505
|
-
if (!e._store || e._store.validated || e.key != null)
|
|
506
|
-
return;
|
|
507
|
-
e._store.validated = !0;
|
|
508
|
-
var a = g(t);
|
|
509
|
-
if (i[a])
|
|
510
|
-
return;
|
|
511
|
-
i[a] = !0;
|
|
512
|
-
var s = "";
|
|
513
|
-
e && e._owner && e._owner !== Se.current && (s = " It was passed a child from " + y(e._owner.type) + "."), re(e), _('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', a, s), re(null);
|
|
514
|
-
}
|
|
43
|
+
const h = n[0];
|
|
44
|
+
return t ?? (h === 7938 ? "WebGL 1.0 (Three.js Mock)" : h === 35724 ? "WebGL GLSL ES 1.0 (Three.js Mock)" : h === 7936 ? "Three.js Mock Vendor" : h === 7937 ? "Three.js Mock Renderer" : h === 34921 || h === 34930 || h === 35657 || h === 35658 ? 16 : "");
|
|
45
|
+
};
|
|
46
|
+
Object.defineProperty(l, "__shapeParticleTextPatched", { value: !0 }), Object.defineProperty(e, "getParameter", { value: l, configurable: !0 });
|
|
515
47
|
}
|
|
516
|
-
|
|
517
|
-
{
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
n(s) && T(s, t);
|
|
524
|
-
}
|
|
525
|
-
else if (n(e))
|
|
526
|
-
e._store && (e._store.validated = !0);
|
|
527
|
-
else if (e) {
|
|
528
|
-
var f = J(e);
|
|
529
|
-
if (typeof f == "function" && f !== e.entries)
|
|
530
|
-
for (var h = f.call(e), l; !(l = h.next()).done; )
|
|
531
|
-
n(l.value) && T(l.value, t);
|
|
48
|
+
if (typeof e.getExtension == "function" && !e.getExtension.__shapeParticleTextPatched) {
|
|
49
|
+
const s = e.getExtension.bind(e), l = (...n) => {
|
|
50
|
+
let t;
|
|
51
|
+
try {
|
|
52
|
+
t = s(...n);
|
|
53
|
+
} catch {
|
|
54
|
+
t = null;
|
|
532
55
|
}
|
|
533
|
-
|
|
56
|
+
return t === null && n[0] === "WEBGL_debug_renderer_info" ? null : t;
|
|
57
|
+
};
|
|
58
|
+
Object.defineProperty(l, "__shapeParticleTextPatched", { value: !0 }), Object.defineProperty(e, "getExtension", { value: l, configurable: !0 });
|
|
534
59
|
}
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
60
|
+
}
|
|
61
|
+
}, Ge = ({ canvas: e, context: s, contextAttributes: l, log: n }) => {
|
|
62
|
+
try {
|
|
63
|
+
const t = new a.WebGLRenderer({
|
|
64
|
+
canvas: e,
|
|
65
|
+
context: s,
|
|
66
|
+
precision: "mediump",
|
|
67
|
+
...l
|
|
68
|
+
});
|
|
69
|
+
return t.capabilities && (t.capabilities.isWebGL2 || (t.capabilities.isWebGL2 = !0), t.capabilities.precision || (t.capabilities.precision = "mediump")), t;
|
|
70
|
+
} catch (t) {
|
|
71
|
+
return n.warn("ShapeParticleText: Failed to initialize WebGL renderer", t), null;
|
|
72
|
+
}
|
|
73
|
+
}, Ze = ({ canvas: e, context: s, contextAttributes: l, log: n }) => {
|
|
74
|
+
const t = Ge({ canvas: e, context: s, contextAttributes: l, log: { warn: () => {
|
|
75
|
+
} } });
|
|
76
|
+
if (t) return t;
|
|
77
|
+
Ue(s);
|
|
78
|
+
const h = Ge({ canvas: e, context: s, contextAttributes: l, log: n });
|
|
79
|
+
if (h) return h;
|
|
80
|
+
n.warn("ShapeParticleText: Failed to initialize custom context renderer, attempting hard fallback...");
|
|
81
|
+
try {
|
|
82
|
+
return new a.WebGLRenderer({ canvas: e });
|
|
83
|
+
} catch (g) {
|
|
84
|
+
return n.error("ShapeParticleText: Fatal error initializing WebGL renderer:", g), null;
|
|
85
|
+
}
|
|
86
|
+
}, $e = (e, s = 1.5) => {
|
|
87
|
+
const l = e && e.trim().length > 0 ? e : "AI", n = document.createElement("canvas"), t = n.getContext("2d");
|
|
88
|
+
n.width = 1024, n.height = 512, t.fillStyle = "white", t.textAlign = "center", t.textBaseline = "middle";
|
|
89
|
+
let h = 350;
|
|
90
|
+
t.font = `bold ${h}px Arial`;
|
|
91
|
+
const g = n.width * 0.85;
|
|
92
|
+
let E = t.measureText(l);
|
|
93
|
+
for (; (E.width > g || h > n.height * 0.7) && h > 20; )
|
|
94
|
+
h -= 10, t.font = `bold ${h}px Arial`, E = t.measureText(l);
|
|
95
|
+
t.fillText(l, n.width / 2, n.height / 2);
|
|
96
|
+
const C = t.getImageData(0, 0, n.width, n.height), m = [], p = 3, z = 220;
|
|
97
|
+
let G = 1 / 0, q = -1 / 0, V = 1 / 0, X = -1 / 0;
|
|
98
|
+
for (let w = 0; w < n.height; w += p)
|
|
99
|
+
for (let Y = 0; Y < n.width; Y += p) {
|
|
100
|
+
const re = (Math.floor(w) * n.width + Math.floor(Y)) * 4;
|
|
101
|
+
if (C.data[re + 3] > 160) {
|
|
102
|
+
const b = (Y - n.width / 2) / z * s, d = -(w - n.height / 2) / z * s, F = (Math.random() - 0.5) * 0.25;
|
|
103
|
+
m.push({ x: b, y: d, z: F }), b < G && (G = b), b > q && (q = b), d < V && (V = d), d > X && (X = d);
|
|
558
104
|
}
|
|
559
105
|
}
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
106
|
+
const y = q - G, K = X - V, Q = 3.2, D = 2.5;
|
|
107
|
+
let T = 1;
|
|
108
|
+
return y > Q && (T = Q / y), K * T > D && (T = D / K), T < 1 && m.forEach((w) => {
|
|
109
|
+
w.x *= T, w.y *= T, w.z *= T;
|
|
110
|
+
}), m;
|
|
111
|
+
}, Ne = ({ textParticlesData: e, actualCount: s }) => {
|
|
112
|
+
const l = [];
|
|
113
|
+
if (e.length > 0)
|
|
114
|
+
if (e.length > s) {
|
|
115
|
+
const n = e.length / s;
|
|
116
|
+
for (let t = 0; t < s; t++) {
|
|
117
|
+
const h = Math.floor(t * n), g = e[Math.min(h, e.length - 1)];
|
|
118
|
+
l.push(g.x, g.y, g.z);
|
|
570
119
|
}
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
e === null ? m = "null" : pe(e) ? m = "array" : e !== void 0 && e.$$typeof === L ? (m = "<" + (y(e.type) || "Unknown") + " />", d = " Did you accidentally export a JSX literal instead of a component?") : m = typeof e, _("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", m, d);
|
|
120
|
+
} else
|
|
121
|
+
for (let n = 0; n < s; n++)
|
|
122
|
+
if (n < e.length)
|
|
123
|
+
l.push(e[n].x, e[n].y, e[n].z);
|
|
124
|
+
else {
|
|
125
|
+
const t = e[Math.floor(Math.random() * e.length)];
|
|
126
|
+
l.push(
|
|
127
|
+
t.x + (Math.random() - 0.5) * 0.5,
|
|
128
|
+
t.y + (Math.random() - 0.5) * 0.5,
|
|
129
|
+
t.z + (Math.random() - 0.5) * 0.3
|
|
130
|
+
);
|
|
583
131
|
}
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
function oe(e, t, a) {
|
|
618
|
-
return D(e, t, a, !0);
|
|
619
|
-
}
|
|
620
|
-
function k(e, t, a) {
|
|
621
|
-
return D(e, t, a, !1);
|
|
622
|
-
}
|
|
623
|
-
var Y = k, $ = oe;
|
|
624
|
-
Ie.Fragment = X, Ie.jsx = Y, Ie.jsxs = $;
|
|
625
|
-
}()), Ie;
|
|
626
|
-
}
|
|
627
|
-
process.env.NODE_ENV === "production" ? at.exports = ht() : at.exports = pt();
|
|
628
|
-
var ct = at.exports;
|
|
629
|
-
const mt = ({
|
|
630
|
-
text: ge = "AI",
|
|
631
|
-
particleCount: L = 24e3,
|
|
632
|
-
particleSize: ye = 0.01,
|
|
633
|
-
primaryColor: X = { r: 0.396, g: 0.239, b: 0.82 },
|
|
132
|
+
else
|
|
133
|
+
for (let n = 0; n < s; n++)
|
|
134
|
+
l.push(0, 0, 0);
|
|
135
|
+
return l;
|
|
136
|
+
}, _e = (e) => new a.Vector3(
|
|
137
|
+
(Math.random() - 0.5) * e,
|
|
138
|
+
(Math.random() - 0.5) * e,
|
|
139
|
+
(Math.random() - 0.5) * e
|
|
140
|
+
), Je = ({ start: e, end: s, zapSpread: l, zapWidth: n, lightningColor: t }) => {
|
|
141
|
+
const h = e.clone().lerp(s, 0.3).add(_e(l)), g = e.clone().lerp(s, 0.7).add(_e(l)), E = new a.CatmullRomCurve3([e, h, g, s]), C = new a.TubeGeometry(E, 12, n, 4, !1);
|
|
142
|
+
let m;
|
|
143
|
+
t ? t.r !== void 0 ? m = new a.Color(t.r, t.g, t.b) : m = new a.Color(t) : m = new a.Color().setHSL(0.7 + Math.random() * 0.08, 1, 0.7 + Math.random() * 0.15);
|
|
144
|
+
const p = new a.MeshBasicMaterial({
|
|
145
|
+
color: m,
|
|
146
|
+
transparent: !0,
|
|
147
|
+
opacity: 0.85,
|
|
148
|
+
blending: a.AdditiveBlending
|
|
149
|
+
}), z = new a.Mesh(C, p), G = {
|
|
150
|
+
line: z,
|
|
151
|
+
material: p,
|
|
152
|
+
life: 0,
|
|
153
|
+
maxLife: 0.5 + Math.random() * 0.9,
|
|
154
|
+
flickerSpeed: 18 + Math.random() * 20,
|
|
155
|
+
phase: Math.random() * Math.PI * 2
|
|
156
|
+
};
|
|
157
|
+
return { line: z, material: p, segment: G };
|
|
158
|
+
}, et = ({
|
|
159
|
+
text: e = "AI",
|
|
160
|
+
particleCount: s = 24e3,
|
|
161
|
+
particleSize: l = 0.01,
|
|
162
|
+
primaryColor: n = { r: 0.396, g: 0.239, b: 0.82 },
|
|
634
163
|
// #653DD1
|
|
635
|
-
secondaryColor:
|
|
164
|
+
secondaryColor: t = { r: 0.537, g: 0.239, b: 0.82 },
|
|
636
165
|
// Purple variant
|
|
637
|
-
backgroundColor:
|
|
638
|
-
transparent:
|
|
639
|
-
morphDuration:
|
|
640
|
-
rotationSpeed:
|
|
641
|
-
hoverIntensity:
|
|
642
|
-
lightningIntensity:
|
|
643
|
-
lightningColor:
|
|
166
|
+
backgroundColor: h = "#000000",
|
|
167
|
+
transparent: g = !1,
|
|
168
|
+
morphDuration: E = 2.5,
|
|
169
|
+
rotationSpeed: C = 0.4,
|
|
170
|
+
hoverIntensity: m = 0.05,
|
|
171
|
+
lightningIntensity: p = 1,
|
|
172
|
+
lightningColor: z = null,
|
|
644
173
|
// Optional hex or {r,g,b} object. If null, uses random colors
|
|
645
|
-
zapSpread:
|
|
174
|
+
zapSpread: G = 0.7,
|
|
646
175
|
// Amplitude/Spread of lightning
|
|
647
|
-
zapWidth:
|
|
176
|
+
zapWidth: q = 0.02,
|
|
648
177
|
// Thickness of lightning
|
|
649
|
-
cameraDistance:
|
|
650
|
-
globeOpacity:
|
|
651
|
-
globeColor:
|
|
178
|
+
cameraDistance: V = 5.5,
|
|
179
|
+
globeOpacity: X = 0.08,
|
|
180
|
+
globeColor: y = null,
|
|
652
181
|
// Optional override for globe color
|
|
653
182
|
showGlobe: K = !0,
|
|
654
|
-
glowEffect:
|
|
655
|
-
|
|
656
|
-
|
|
183
|
+
glowEffect: Q = !0,
|
|
184
|
+
debug: D = !1,
|
|
185
|
+
className: T = "",
|
|
186
|
+
style: w = {},
|
|
187
|
+
...Y
|
|
657
188
|
}) => {
|
|
658
|
-
const
|
|
659
|
-
return
|
|
660
|
-
const
|
|
661
|
-
if (!
|
|
662
|
-
|
|
189
|
+
const re = Re(null), b = Re(null);
|
|
190
|
+
return Ye(() => {
|
|
191
|
+
const d = re.current, F = Ie(D);
|
|
192
|
+
if (!d) {
|
|
193
|
+
F.error("ShapeParticleText: Canvas element not found");
|
|
663
194
|
return;
|
|
664
195
|
}
|
|
665
|
-
let
|
|
666
|
-
const
|
|
196
|
+
let ee = !0;
|
|
197
|
+
const ce = [];
|
|
667
198
|
return (() => {
|
|
668
|
-
var
|
|
669
|
-
if (!
|
|
670
|
-
const
|
|
671
|
-
let
|
|
199
|
+
var Te, Le;
|
|
200
|
+
if (!ee) return;
|
|
201
|
+
const I = new a.Scene(), U = new a.PerspectiveCamera(50, d.offsetWidth / d.offsetHeight, 0.1, 1e3);
|
|
202
|
+
let L;
|
|
672
203
|
try {
|
|
673
204
|
const r = {
|
|
674
205
|
alpha: !0,
|
|
675
206
|
antialias: !0,
|
|
676
207
|
powerPreference: "default"
|
|
677
|
-
}, n = E.getContext("webgl2", r) || E.getContext("webgl", r) || E.getContext("experimental-webgl", r);
|
|
678
|
-
if (!n) {
|
|
679
|
-
console.error("ShapeParticleText: WebGL not supported in this environment");
|
|
680
|
-
return;
|
|
681
|
-
}
|
|
682
|
-
const o = (c, i) => {
|
|
683
|
-
const g = Object.getOwnPropertyDescriptor(c, i);
|
|
684
|
-
return g && !g.writable && !g.configurable;
|
|
685
208
|
};
|
|
686
|
-
|
|
687
|
-
const c = n.getShaderPrecisionFormat, i = function(...g) {
|
|
688
|
-
return { rangeMin: 127, rangeMax: 127, precision: 23 };
|
|
689
|
-
};
|
|
690
|
-
i._isPatched = !0, Object.defineProperty(n, "getShaderPrecisionFormat", {
|
|
691
|
-
value: i,
|
|
692
|
-
configurable: !0
|
|
693
|
-
});
|
|
694
|
-
}
|
|
695
|
-
if (!n.getParameter._isPatched) {
|
|
696
|
-
const c = n.getParameter, i = function(...g) {
|
|
697
|
-
let T = null;
|
|
698
|
-
try {
|
|
699
|
-
T = c.apply(n, g);
|
|
700
|
-
} catch {
|
|
701
|
-
}
|
|
702
|
-
const v = g[0];
|
|
703
|
-
return T ?? (v === 7938 ? "WebGL 1.0 (Three.js Mock)" : v === 35724 ? "WebGL GLSL ES 1.0 (Three.js Mock)" : v === 7936 ? "Three.js Mock Vendor" : v === 7937 ? "Three.js Mock Renderer" : v === 34921 || v === 34930 || v === 35657 || v === 35658 ? 16 : "");
|
|
704
|
-
};
|
|
705
|
-
i._isPatched = !0, Object.defineProperty(n, "getParameter", {
|
|
706
|
-
value: i,
|
|
707
|
-
configurable: !0
|
|
708
|
-
});
|
|
709
|
-
}
|
|
710
|
-
if (!n.getExtension._isPatched) {
|
|
711
|
-
const c = n.getExtension, i = function(...g) {
|
|
712
|
-
let T = null;
|
|
713
|
-
try {
|
|
714
|
-
T = c.apply(n, g);
|
|
715
|
-
} catch {
|
|
716
|
-
}
|
|
717
|
-
return T === null && g[0] === "WEBGL_debug_renderer_info" ? null : T;
|
|
718
|
-
};
|
|
719
|
-
i._isPatched = !0, Object.defineProperty(n, "getExtension", {
|
|
720
|
-
value: i,
|
|
721
|
-
configurable: !0
|
|
722
|
-
});
|
|
723
|
-
}
|
|
724
|
-
y = new u.WebGLRenderer({
|
|
725
|
-
canvas: E,
|
|
726
|
-
context: n,
|
|
727
|
-
precision: "mediump",
|
|
728
|
-
...r
|
|
729
|
-
}), y.capabilities && (y.capabilities.isWebGL2 || (y.capabilities.isWebGL2 = !0), y.capabilities.precision || (y.capabilities.precision = "mediump"));
|
|
730
|
-
} catch (r) {
|
|
731
|
-
console.warn("ShapeParticleText: Failed to initialize custom context renderer, attempting hard fallback...", r);
|
|
209
|
+
let i = null;
|
|
732
210
|
try {
|
|
733
|
-
|
|
734
|
-
} catch
|
|
735
|
-
|
|
211
|
+
i = d.getContext("webgl2", r) || d.getContext("webgl", r) || d.getContext("experimental-webgl", r);
|
|
212
|
+
} catch {
|
|
213
|
+
i = null;
|
|
214
|
+
}
|
|
215
|
+
if (!i) {
|
|
216
|
+
F.error("ShapeParticleText: WebGL not supported in this environment");
|
|
736
217
|
return;
|
|
737
218
|
}
|
|
219
|
+
if (L = Ze({ canvas: d, context: i, contextAttributes: r, log: F }), !L) return;
|
|
220
|
+
} catch (r) {
|
|
221
|
+
F.error("ShapeParticleText: Unexpected error initializing scene:", r);
|
|
222
|
+
return;
|
|
738
223
|
}
|
|
739
|
-
|
|
740
|
-
const
|
|
741
|
-
|
|
742
|
-
if (typeof r == "string") {
|
|
743
|
-
const o = new u.Color(r);
|
|
744
|
-
return { r: o.r, g: o.g, b: o.b };
|
|
745
|
-
}
|
|
746
|
-
return typeof r == "object" && typeof r.r == "number" ? r : n;
|
|
747
|
-
}, O = q(X, { r: 0.396, g: 0.239, b: 0.82 }), W = q(se, { r: 0.537, g: 0.239, b: 0.82 });
|
|
748
|
-
let ae = null;
|
|
224
|
+
L.setSize(d.offsetWidth, d.offsetHeight), L.setPixelRatio(Math.min(window.devicePixelRatio, 2)), L.setClearColor(0, 0);
|
|
225
|
+
const S = ze(n, { r: 0.396, g: 0.239, b: 0.82 }), A = ze(t, { r: 0.537, g: 0.239, b: 0.82 });
|
|
226
|
+
let te = null;
|
|
749
227
|
if (K) {
|
|
750
|
-
const r = new
|
|
751
|
-
let
|
|
752
|
-
|
|
753
|
-
const o = new
|
|
754
|
-
color:
|
|
228
|
+
const r = new a.SphereGeometry(2, 48, 48);
|
|
229
|
+
let i;
|
|
230
|
+
y ? i = typeof y == "string" ? new a.Color(y) : new a.Color(y.r, y.g, y.b) : i = new a.Color(S.r, S.g, S.b);
|
|
231
|
+
const o = new a.MeshBasicMaterial({
|
|
232
|
+
color: i,
|
|
755
233
|
wireframe: !0,
|
|
756
234
|
transparent: !0,
|
|
757
|
-
opacity:
|
|
235
|
+
opacity: X
|
|
758
236
|
});
|
|
759
|
-
|
|
237
|
+
te = new a.Mesh(r, o), I.add(te);
|
|
760
238
|
}
|
|
761
|
-
const
|
|
762
|
-
let
|
|
763
|
-
for (let r = 0; r <
|
|
764
|
-
const
|
|
765
|
-
let
|
|
766
|
-
|
|
767
|
-
const
|
|
768
|
-
|
|
769
|
-
const
|
|
770
|
-
if (
|
|
239
|
+
const W = new a.Group(), ne = new Float32Array(s * 3), x = new Float32Array(s * 3), pe = new Float32Array(s), le = [], he = [], P = [], v = [];
|
|
240
|
+
let f = 0;
|
|
241
|
+
for (let r = 0; r < s; r++) {
|
|
242
|
+
const i = r < s / 2 ? -1 : 1, o = Math.random() * Math.PI, u = Math.random() * Math.PI * 2, c = 1.4 + Math.random() * 0.3, H = 1.2 + Math.random() * 0.2, ue = 1 + Math.random() * 0.2;
|
|
243
|
+
let M = c * Math.sin(o) * Math.cos(u), _ = H * Math.sin(o) * Math.sin(u), O = ue * Math.cos(o);
|
|
244
|
+
M = M * 0.85 + i * 0.35;
|
|
245
|
+
const me = (Math.sin(o * 8) * Math.cos(u * 6) + Math.sin(o * 12) * Math.sin(u * 8)) * 0.12, se = Math.sqrt(M * M + _ * _ + O * O);
|
|
246
|
+
se > 0.1 && (M += me * (M / se), _ += me * (_ / se), O += me * (O / se));
|
|
247
|
+
const Se = Math.sqrt(M * M + _ * _ + O * O);
|
|
248
|
+
if (Se < 1 || Se > 2 || i === -1 && M > -0.15 || i === 1 && M < 0.15)
|
|
771
249
|
continue;
|
|
772
|
-
const
|
|
773
|
-
|
|
774
|
-
const
|
|
775
|
-
if (
|
|
776
|
-
|
|
777
|
-
else if (
|
|
778
|
-
const
|
|
779
|
-
|
|
250
|
+
const R = new a.Vector3(M, _, O);
|
|
251
|
+
R.x < 0 ? le.push(R.clone()) : he.push(R.clone()), ne[f * 3] = R.x, ne[f * 3 + 1] = R.y, ne[f * 3 + 2] = R.z, P.push(R.x, R.y, R.z);
|
|
252
|
+
const N = (_ + H) / (H * 2);
|
|
253
|
+
if (N < 0.3)
|
|
254
|
+
x[f * 3] = S.r * 0.5 + N * 0.4, x[f * 3 + 1] = S.g * 1 + N * 0.05, x[f * 3 + 2] = S.b * 1 + N * 0.05;
|
|
255
|
+
else if (N < 0.6) {
|
|
256
|
+
const J = (N - 0.3) / 0.3;
|
|
257
|
+
x[f * 3] = (S.r * (1 - J) + A.r * J) * 1.1, x[f * 3 + 1] = (S.g * (1 - J) + A.g * J) * 1.1, x[f * 3 + 2] = (S.b * (1 - J) + A.b * J) * 1.1;
|
|
780
258
|
} else
|
|
781
|
-
|
|
782
|
-
|
|
259
|
+
x[f * 3] = A.r * 1, x[f * 3 + 1] = A.g * 1, x[f * 3 + 2] = A.b * 1;
|
|
260
|
+
pe[f] = Math.random() * 1.5 + 0.8, f++;
|
|
783
261
|
}
|
|
784
|
-
const
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
let v = i.measureText(o);
|
|
791
|
-
for (; (v.width > T || g > c.height * 0.7) && g > 20; )
|
|
792
|
-
g -= 10, i.font = `bold ${g}px Arial`, v = i.measureText(o);
|
|
793
|
-
i.fillText(o, c.width / 2, c.height / 2);
|
|
794
|
-
const j = i.getImageData(0, 0, c.width, c.height), P = [], I = 3, D = 220;
|
|
795
|
-
let oe = 1 / 0, k = -1 / 0, Y = 1 / 0, $ = -1 / 0;
|
|
796
|
-
for (let h = 0; h < c.height; h += I)
|
|
797
|
-
for (let l = 0; l < c.width; l += I) {
|
|
798
|
-
const d = (Math.floor(h) * c.width + Math.floor(l)) * 4;
|
|
799
|
-
if (j.data[d + 3] > 160) {
|
|
800
|
-
const w = (l - c.width / 2) / D * n, m = -(h - c.height / 2) / D * n, b = (Math.random() - 0.5) * 0.25;
|
|
801
|
-
P.push({ x: w, y: m, z: b }), w < oe && (oe = w), w > k && (k = w), m < Y && (Y = m), m > $ && ($ = m);
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
const e = k - oe, t = $ - Y, a = 3.2, s = 2.5;
|
|
805
|
-
let f = 1;
|
|
806
|
-
return e > a && (f = a / e), t * f > s && (f = s / t), f < 1 && P.forEach((h) => {
|
|
807
|
-
h.x *= f, h.y *= f, h.z *= f;
|
|
808
|
-
}), P;
|
|
809
|
-
})(ge, 1.8);
|
|
810
|
-
if (S.length > 0)
|
|
811
|
-
if (S.length > p) {
|
|
812
|
-
const r = S.length / p;
|
|
813
|
-
for (let n = 0; n < p; n++) {
|
|
814
|
-
const o = Math.floor(n * r), c = S[Math.min(o, S.length - 1)];
|
|
815
|
-
C.push(c.x, c.y, c.z);
|
|
816
|
-
}
|
|
817
|
-
} else
|
|
818
|
-
for (let r = 0; r < p; r++)
|
|
819
|
-
if (r < S.length)
|
|
820
|
-
C.push(
|
|
821
|
-
S[r].x,
|
|
822
|
-
S[r].y,
|
|
823
|
-
S[r].z
|
|
824
|
-
);
|
|
825
|
-
else {
|
|
826
|
-
const n = S[Math.floor(Math.random() * S.length)];
|
|
827
|
-
C.push(
|
|
828
|
-
n.x + (Math.random() - 0.5) * 0.5,
|
|
829
|
-
n.y + (Math.random() - 0.5) * 0.5,
|
|
830
|
-
n.z + (Math.random() - 0.5) * 0.3
|
|
831
|
-
);
|
|
832
|
-
}
|
|
833
|
-
else
|
|
834
|
-
for (let r = 0; r < p; r++)
|
|
835
|
-
C.push(0, 0, 0);
|
|
836
|
-
const ke = fe.slice(0, p * 3), _e = F.slice(0, p * 3), Ke = je.slice(0, p), H = new u.BufferGeometry();
|
|
837
|
-
H.setAttribute("position", new u.BufferAttribute(ke, 3)), H.setAttribute("color", new u.BufferAttribute(_e, 3)), H.setAttribute("size", new u.BufferAttribute(Ke, 1)), H.setDrawRange(0, p);
|
|
838
|
-
const Ze = new u.PointsMaterial({
|
|
839
|
-
size: ye,
|
|
262
|
+
const Ee = $e(e, 1.8);
|
|
263
|
+
v.push(...Ne({ textParticlesData: Ee, actualCount: f }));
|
|
264
|
+
const Fe = ne.slice(0, f * 3), We = x.slice(0, f * 3), Be = pe.slice(0, f), B = new a.BufferGeometry();
|
|
265
|
+
B.setAttribute("position", new a.BufferAttribute(Fe, 3)), B.setAttribute("color", new a.BufferAttribute(We, 3)), B.setAttribute("size", new a.BufferAttribute(Be, 1)), B.setDrawRange(0, f);
|
|
266
|
+
const ke = new a.PointsMaterial({
|
|
267
|
+
size: l,
|
|
840
268
|
vertexColors: !0,
|
|
841
269
|
transparent: !0,
|
|
842
270
|
opacity: 1,
|
|
843
|
-
blending:
|
|
271
|
+
blending: Q ? a.AdditiveBlending : a.NormalBlending,
|
|
844
272
|
sizeAttenuation: !0
|
|
845
|
-
}),
|
|
846
|
-
|
|
847
|
-
const
|
|
848
|
-
color:
|
|
273
|
+
}), je = new a.Points(B, ke);
|
|
274
|
+
W.add(je), I.add(W);
|
|
275
|
+
const He = new a.Color(A.r, A.g, A.b), Oe = new a.LineBasicMaterial({
|
|
276
|
+
color: He,
|
|
849
277
|
transparent: !0,
|
|
850
278
|
opacity: 0.2
|
|
851
|
-
}),
|
|
852
|
-
if (
|
|
279
|
+
}), ge = new a.Group(), Me = le.length, ye = he.length;
|
|
280
|
+
if (Me > 0 && ye > 0)
|
|
853
281
|
for (let r = 0; r < 80; r++) {
|
|
854
|
-
const
|
|
855
|
-
if (!
|
|
856
|
-
const
|
|
857
|
-
|
|
282
|
+
const i = (Te = le[Math.floor(Math.random() * Me)]) == null ? void 0 : Te.clone(), o = (Le = he[Math.floor(Math.random() * ye)]) == null ? void 0 : Le.clone();
|
|
283
|
+
if (!i || !o) continue;
|
|
284
|
+
const u = new a.BufferGeometry().setFromPoints([i, o]), c = new a.Line(u, Oe);
|
|
285
|
+
ge.add(c);
|
|
858
286
|
}
|
|
859
|
-
|
|
860
|
-
const
|
|
861
|
-
|
|
862
|
-
const
|
|
863
|
-
let
|
|
864
|
-
const
|
|
865
|
-
(
|
|
866
|
-
(Math.random()
|
|
867
|
-
(
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
color: P,
|
|
877
|
-
transparent: !0,
|
|
878
|
-
opacity: 0.85,
|
|
879
|
-
blending: u.AdditiveBlending
|
|
880
|
-
}), D = new u.Mesh(j, I);
|
|
881
|
-
Me.add(D), Q.push({
|
|
882
|
-
line: D,
|
|
883
|
-
material: I,
|
|
884
|
-
life: 0,
|
|
885
|
-
maxLife: 0.5 + Math.random() * 0.9,
|
|
886
|
-
flickerSpeed: 18 + Math.random() * 20,
|
|
887
|
-
phase: Math.random() * Math.PI * 2
|
|
888
|
-
});
|
|
889
|
-
}, Ue = new u.Clock();
|
|
890
|
-
Z.position.set(0, 0, Ce);
|
|
891
|
-
const ve = { x: 0, y: 0 }, Te = { x: 0, y: 0 }, ee = { x: 0, y: 0 }, De = (r) => {
|
|
892
|
-
if (!E) return;
|
|
893
|
-
const n = E.getBoundingClientRect();
|
|
894
|
-
ve.x = (r.clientX - n.left) / n.width * 2 - 1, ve.y = -((r.clientY - n.top) / n.height) * 2 + 1, Te.y = ve.x * 0.3 * (U / 0.05), Te.x = ve.y * 0.2 * (U / 0.05);
|
|
287
|
+
W.add(ge);
|
|
288
|
+
const ie = new a.Group();
|
|
289
|
+
W.add(ie);
|
|
290
|
+
const k = [];
|
|
291
|
+
let fe = 0;
|
|
292
|
+
const Ce = 6, qe = () => {
|
|
293
|
+
if (!ee || !f) return;
|
|
294
|
+
const r = Math.floor(Math.random() * f), i = Math.floor(Math.random() * f), o = B.attributes.position.array, u = new a.Vector3(o[r * 3], o[r * 3 + 1], o[r * 3 + 2]), c = new a.Vector3(o[i * 3], o[i * 3 + 1], o[i * 3 + 2]);
|
|
295
|
+
if (u.lengthSq() < 0.1 || c.lengthSq() < 0.1 || u.distanceToSquared(c) < 0.5) return;
|
|
296
|
+
const { line: H, segment: ue } = Je({ start: u, end: c, zapSpread: G, zapWidth: q, lightningColor: z });
|
|
297
|
+
ie.add(H), k.push(ue);
|
|
298
|
+
}, Ve = new a.Clock();
|
|
299
|
+
U.position.set(0, 0, V);
|
|
300
|
+
const oe = { x: 0, y: 0 }, ae = { x: 0, y: 0 }, Z = { x: 0, y: 0 }, we = (r) => {
|
|
301
|
+
if (!d) return;
|
|
302
|
+
const i = d.getBoundingClientRect();
|
|
303
|
+
oe.x = (r.clientX - i.left) / i.width * 2 - 1, oe.y = -((r.clientY - i.top) / i.height) * 2 + 1, ae.y = oe.x * 0.3 * (m / 0.05), ae.x = oe.y * 0.2 * (m / 0.05);
|
|
895
304
|
};
|
|
896
|
-
|
|
897
|
-
|
|
305
|
+
d.addEventListener("mousemove", we), ce.push(() => {
|
|
306
|
+
d.removeEventListener("mousemove", we);
|
|
898
307
|
});
|
|
899
|
-
let
|
|
900
|
-
const
|
|
901
|
-
let
|
|
902
|
-
const
|
|
903
|
-
let
|
|
904
|
-
function
|
|
905
|
-
if (!
|
|
906
|
-
|
|
907
|
-
const r =
|
|
908
|
-
if (
|
|
909
|
-
|
|
910
|
-
const
|
|
911
|
-
for (let
|
|
912
|
-
const
|
|
913
|
-
|
|
308
|
+
let $ = 0;
|
|
309
|
+
const Xe = 0.08;
|
|
310
|
+
let j = 0, be = 1;
|
|
311
|
+
const xe = 3;
|
|
312
|
+
let de = xe;
|
|
313
|
+
function Pe() {
|
|
314
|
+
if (!ee) return;
|
|
315
|
+
b.current = requestAnimationFrame(Pe);
|
|
316
|
+
const r = Ve.getDelta();
|
|
317
|
+
if ($ += r, Z.x += (ae.x - Z.x) * 0.05, Z.y += (ae.y - Z.y) * 0.05, te && (te.rotation.y += r * 0.1, te.rotation.x = Math.sin($ * 0.3) * 0.03), W.rotation.y = Math.sin($ * 0.4) * C + Z.y, W.rotation.x = Math.sin($ * 0.25) * Xe + Z.x, W.rotation.z = Math.cos($ * 0.15) * 0.015, de -= r, de <= 0) {
|
|
318
|
+
j += r / E, j >= 1 && (j = 0, be *= -1, de = xe);
|
|
319
|
+
const i = j < 0.5 ? 2 * j * j : 1 - Math.pow(-2 * j + 2, 2) / 2, o = B.attributes.position;
|
|
320
|
+
for (let u = 0; u < f; u++) {
|
|
321
|
+
const c = u * 3;
|
|
322
|
+
be === 1 ? (o.array[c] = P[c] + (v[c] - P[c]) * i, o.array[c + 1] = P[c + 1] + (v[c + 1] - P[c + 1]) * i, o.array[c + 2] = P[c + 2] + (v[c + 2] - P[c + 2]) * i) : (o.array[c] = v[c] + (P[c] - v[c]) * i, o.array[c + 1] = v[c + 1] + (P[c + 1] - v[c + 1]) * i, o.array[c + 2] = v[c + 2] + (P[c + 2] - v[c + 2]) * i);
|
|
914
323
|
}
|
|
915
324
|
o.needsUpdate = !0;
|
|
916
325
|
}
|
|
917
|
-
|
|
918
|
-
for (let
|
|
919
|
-
const o =
|
|
326
|
+
fe -= r, p > 0 && fe <= 0 && k.length < Ce * p && (qe(), fe = (0.12 + Math.random() * 0.25) / Math.max(0.1, p));
|
|
327
|
+
for (let i = k.length - 1; i >= 0; i--) {
|
|
328
|
+
const o = k[i];
|
|
920
329
|
if (!o || !o.material) continue;
|
|
921
330
|
o.life += r;
|
|
922
|
-
const
|
|
923
|
-
o.material.opacity = Math.max(0,
|
|
331
|
+
const u = o.life / o.maxLife, c = Math.pow(Math.max(0, 1 - u), 1.5), H = 0.6 + Math.sin($ * o.flickerSpeed + o.phase) * 0.4;
|
|
332
|
+
o.material.opacity = Math.max(0, c * H * Math.min(1, p)), o.life >= o.maxLife && (ie.remove(o.line), o.line.geometry && o.line.geometry.dispose(), o.material && o.material.dispose(), k.splice(i, 1));
|
|
924
333
|
}
|
|
925
|
-
|
|
334
|
+
L.render(I, U);
|
|
926
335
|
}
|
|
927
|
-
|
|
928
|
-
const
|
|
929
|
-
if (!
|
|
930
|
-
const r =
|
|
931
|
-
r === 0 ||
|
|
336
|
+
Pe();
|
|
337
|
+
const ve = () => {
|
|
338
|
+
if (!ee || !d) return;
|
|
339
|
+
const r = d.offsetWidth, i = d.offsetHeight;
|
|
340
|
+
r === 0 || i === 0 || (U.aspect = r / i, U.updateProjectionMatrix(), L.setSize(r, i), L.setPixelRatio(Math.min(window.devicePixelRatio * 1.5, 3)));
|
|
932
341
|
};
|
|
933
|
-
window.addEventListener("resize",
|
|
934
|
-
window.removeEventListener("resize",
|
|
935
|
-
r.line && (
|
|
936
|
-
}),
|
|
937
|
-
r.geometry && r.geometry.dispose(), r.material && (Array.isArray(r.material) ? r.material.forEach((
|
|
938
|
-
}),
|
|
342
|
+
window.addEventListener("resize", ve), ce.push(() => {
|
|
343
|
+
window.removeEventListener("resize", ve), k.forEach((r) => {
|
|
344
|
+
r.line && (ie.remove(r.line), r.line.geometry && r.line.geometry.dispose(), r.material && r.material.dispose());
|
|
345
|
+
}), k.length = 0, I.traverse((r) => {
|
|
346
|
+
r.geometry && r.geometry.dispose(), r.material && (Array.isArray(r.material) ? r.material.forEach((i) => i.dispose()) : r.material.dispose());
|
|
347
|
+
}), L.dispose();
|
|
939
348
|
});
|
|
940
349
|
})(), () => {
|
|
941
|
-
|
|
350
|
+
ee = !1, b.current && (cancelAnimationFrame(b.current), b.current = null), ce.forEach((I) => {
|
|
942
351
|
try {
|
|
943
|
-
|
|
944
|
-
} catch (
|
|
945
|
-
|
|
352
|
+
I();
|
|
353
|
+
} catch (U) {
|
|
354
|
+
F.error("Cleanup error:", U);
|
|
946
355
|
}
|
|
947
356
|
});
|
|
948
357
|
};
|
|
949
|
-
}, [
|
|
950
|
-
"
|
|
358
|
+
}, [e, s, l, n, t, E, C, m, p, z, G, q, V, X, y, K, Q, D]), /* @__PURE__ */ Ae(
|
|
359
|
+
"div",
|
|
951
360
|
{
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
361
|
+
...Y,
|
|
362
|
+
className: T,
|
|
363
|
+
style: { position: "relative", width: "100%", height: "100%", backgroundColor: g ? "transparent" : h, ...w },
|
|
364
|
+
children: /* @__PURE__ */ Ae(
|
|
365
|
+
"canvas",
|
|
366
|
+
{
|
|
367
|
+
ref: re,
|
|
368
|
+
style: {
|
|
369
|
+
display: "block",
|
|
370
|
+
width: "100%",
|
|
371
|
+
height: "100%",
|
|
372
|
+
outline: "none"
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
)
|
|
959
376
|
}
|
|
960
|
-
)
|
|
377
|
+
);
|
|
961
378
|
};
|
|
962
379
|
export {
|
|
963
|
-
|
|
380
|
+
et as ShapeParticleText
|
|
964
381
|
};
|