styllar-react-plugin 1.0.1 → 1.0.2
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/styllar-react-plugin.js +403 -346
- package/dist/styllar-react-plugin.umd.cjs +10 -10
- package/package.json +1 -1
- package/src/StyllarPlugin.jsx +126 -75
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
1
|
+
import Le, { useState as I, useEffect as pr } from "react";
|
|
2
|
+
var de = { exports: {} }, J = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.min.js
|
|
@@ -9,19 +9,19 @@ var fe = { exports: {} }, J = {};
|
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
var
|
|
19
|
-
N !== void 0 && (
|
|
20
|
-
for (
|
|
21
|
-
if (
|
|
22
|
-
return { $$typeof:
|
|
12
|
+
var ze;
|
|
13
|
+
function vr() {
|
|
14
|
+
if (ze) return J;
|
|
15
|
+
ze = 1;
|
|
16
|
+
var S = Le, _ = Symbol.for("react.element"), f = Symbol.for("react.fragment"), g = Object.prototype.hasOwnProperty, E = S.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, D = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
17
|
+
function F(O, y, N) {
|
|
18
|
+
var h, P = {}, C = null, z = null;
|
|
19
|
+
N !== void 0 && (C = "" + N), y.key !== void 0 && (C = "" + y.key), y.ref !== void 0 && (z = y.ref);
|
|
20
|
+
for (h in y) g.call(y, h) && !D.hasOwnProperty(h) && (P[h] = y[h]);
|
|
21
|
+
if (O && O.defaultProps) for (h in y = O.defaultProps, y) P[h] === void 0 && (P[h] = y[h]);
|
|
22
|
+
return { $$typeof: _, type: O, key: C, ref: z, props: P, _owner: E.current };
|
|
23
23
|
}
|
|
24
|
-
return J.Fragment =
|
|
24
|
+
return J.Fragment = f, J.jsx = F, J.jsxs = F, J;
|
|
25
25
|
}
|
|
26
26
|
var K = {};
|
|
27
27
|
/**
|
|
@@ -33,91 +33,91 @@ var K = {};
|
|
|
33
33
|
* This source code is licensed under the MIT license found in the
|
|
34
34
|
* LICENSE file in the root directory of this source tree.
|
|
35
35
|
*/
|
|
36
|
-
var
|
|
37
|
-
function
|
|
38
|
-
return
|
|
39
|
-
var
|
|
40
|
-
function
|
|
36
|
+
var $e;
|
|
37
|
+
function mr() {
|
|
38
|
+
return $e || ($e = 1, process.env.NODE_ENV !== "production" && function() {
|
|
39
|
+
var S = Le, _ = Symbol.for("react.element"), f = Symbol.for("react.portal"), g = Symbol.for("react.fragment"), E = Symbol.for("react.strict_mode"), D = Symbol.for("react.profiler"), F = Symbol.for("react.provider"), O = Symbol.for("react.context"), y = Symbol.for("react.forward_ref"), N = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), P = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), z = Symbol.for("react.offscreen"), M = Symbol.iterator, B = "@@iterator";
|
|
40
|
+
function q(e) {
|
|
41
41
|
if (e === null || typeof e != "object")
|
|
42
42
|
return null;
|
|
43
|
-
var r =
|
|
43
|
+
var r = M && e[M] || e[B];
|
|
44
44
|
return typeof r == "function" ? r : null;
|
|
45
45
|
}
|
|
46
|
-
var
|
|
47
|
-
function
|
|
46
|
+
var A = S.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
47
|
+
function x(e) {
|
|
48
48
|
{
|
|
49
49
|
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
50
50
|
t[n - 1] = arguments[n];
|
|
51
|
-
|
|
51
|
+
ee("error", e, t);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function ee(e, r, t) {
|
|
55
55
|
{
|
|
56
|
-
var n =
|
|
57
|
-
|
|
56
|
+
var n = A.ReactDebugCurrentFrame, l = n.getStackAddendum();
|
|
57
|
+
l !== "" && (r += "%s", t = t.concat([l]));
|
|
58
58
|
var c = t.map(function(i) {
|
|
59
59
|
return String(i);
|
|
60
60
|
});
|
|
61
61
|
c.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, c);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
var
|
|
65
|
-
|
|
66
|
-
function
|
|
67
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
64
|
+
var re = !1, te = !1, X = !1, ne = !1, s = !1, u;
|
|
65
|
+
u = Symbol.for("react.module.reference");
|
|
66
|
+
function p(e) {
|
|
67
|
+
return !!(typeof e == "string" || typeof e == "function" || e === g || e === D || s || e === E || e === N || e === h || ne || e === z || re || te || X || typeof e == "object" && e !== null && (e.$$typeof === C || e.$$typeof === P || e.$$typeof === F || e.$$typeof === O || e.$$typeof === y || // This needs to include all possible module reference object
|
|
68
68
|
// types supported by any Flight configuration anywhere since
|
|
69
69
|
// we don't know which Flight build this will end up being used
|
|
70
70
|
// with.
|
|
71
|
-
e.$$typeof ===
|
|
71
|
+
e.$$typeof === u || e.getModuleId !== void 0));
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function j(e, r, t) {
|
|
74
74
|
var n = e.displayName;
|
|
75
75
|
if (n)
|
|
76
76
|
return n;
|
|
77
|
-
var
|
|
78
|
-
return
|
|
77
|
+
var l = r.displayName || r.name || "";
|
|
78
|
+
return l !== "" ? t + "(" + l + ")" : t;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function w(e) {
|
|
81
81
|
return e.displayName || "Context";
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function v(e) {
|
|
84
84
|
if (e == null)
|
|
85
85
|
return null;
|
|
86
|
-
if (typeof e.tag == "number" &&
|
|
86
|
+
if (typeof e.tag == "number" && x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
87
87
|
return e.displayName || e.name || null;
|
|
88
88
|
if (typeof e == "string")
|
|
89
89
|
return e;
|
|
90
90
|
switch (e) {
|
|
91
|
-
case
|
|
91
|
+
case g:
|
|
92
92
|
return "Fragment";
|
|
93
|
-
case
|
|
93
|
+
case f:
|
|
94
94
|
return "Portal";
|
|
95
|
-
case
|
|
95
|
+
case D:
|
|
96
96
|
return "Profiler";
|
|
97
|
-
case
|
|
97
|
+
case E:
|
|
98
98
|
return "StrictMode";
|
|
99
99
|
case N:
|
|
100
100
|
return "Suspense";
|
|
101
|
-
case
|
|
101
|
+
case h:
|
|
102
102
|
return "SuspenseList";
|
|
103
103
|
}
|
|
104
104
|
if (typeof e == "object")
|
|
105
105
|
switch (e.$$typeof) {
|
|
106
|
-
case
|
|
106
|
+
case O:
|
|
107
107
|
var r = e;
|
|
108
|
-
return
|
|
109
|
-
case
|
|
108
|
+
return w(r) + ".Consumer";
|
|
109
|
+
case F:
|
|
110
110
|
var t = e;
|
|
111
|
-
return
|
|
112
|
-
case
|
|
113
|
-
return
|
|
114
|
-
case
|
|
111
|
+
return w(t._context) + ".Provider";
|
|
112
|
+
case y:
|
|
113
|
+
return j(e, e.render, "ForwardRef");
|
|
114
|
+
case P:
|
|
115
115
|
var n = e.displayName || null;
|
|
116
|
-
return n !== null ? n :
|
|
117
|
-
case
|
|
118
|
-
var
|
|
116
|
+
return n !== null ? n : v(e.type) || "Memo";
|
|
117
|
+
case C: {
|
|
118
|
+
var l = e, c = l._payload, i = l._init;
|
|
119
119
|
try {
|
|
120
|
-
return
|
|
120
|
+
return v(i(c));
|
|
121
121
|
} catch {
|
|
122
122
|
return null;
|
|
123
123
|
}
|
|
@@ -125,18 +125,18 @@ function vr() {
|
|
|
125
125
|
}
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
128
|
-
var
|
|
129
|
-
function
|
|
128
|
+
var b = Object.assign, $ = 0, ve, me, ge, he, be, ye, xe;
|
|
129
|
+
function _e() {
|
|
130
130
|
}
|
|
131
|
-
|
|
132
|
-
function
|
|
131
|
+
_e.__reactDisabledLog = !0;
|
|
132
|
+
function We() {
|
|
133
133
|
{
|
|
134
|
-
if (
|
|
135
|
-
|
|
134
|
+
if ($ === 0) {
|
|
135
|
+
ve = console.log, me = console.info, ge = console.warn, he = console.error, be = console.group, ye = console.groupCollapsed, xe = console.groupEnd;
|
|
136
136
|
var e = {
|
|
137
137
|
configurable: !0,
|
|
138
138
|
enumerable: !0,
|
|
139
|
-
value:
|
|
139
|
+
value: _e,
|
|
140
140
|
writable: !0
|
|
141
141
|
};
|
|
142
142
|
Object.defineProperties(console, {
|
|
@@ -149,77 +149,77 @@ function vr() {
|
|
|
149
149
|
groupEnd: e
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
-
|
|
152
|
+
$++;
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function Me() {
|
|
156
156
|
{
|
|
157
|
-
if (
|
|
157
|
+
if ($--, $ === 0) {
|
|
158
158
|
var e = {
|
|
159
159
|
configurable: !0,
|
|
160
160
|
enumerable: !0,
|
|
161
161
|
writable: !0
|
|
162
162
|
};
|
|
163
163
|
Object.defineProperties(console, {
|
|
164
|
-
log:
|
|
165
|
-
value: de
|
|
166
|
-
}),
|
|
167
|
-
info: A({}, e, {
|
|
164
|
+
log: b({}, e, {
|
|
168
165
|
value: ve
|
|
169
166
|
}),
|
|
170
|
-
|
|
171
|
-
value: pe
|
|
172
|
-
}),
|
|
173
|
-
error: A({}, e, {
|
|
167
|
+
info: b({}, e, {
|
|
174
168
|
value: me
|
|
175
169
|
}),
|
|
176
|
-
|
|
170
|
+
warn: b({}, e, {
|
|
177
171
|
value: ge
|
|
178
172
|
}),
|
|
179
|
-
|
|
173
|
+
error: b({}, e, {
|
|
180
174
|
value: he
|
|
181
175
|
}),
|
|
182
|
-
|
|
176
|
+
group: b({}, e, {
|
|
183
177
|
value: be
|
|
178
|
+
}),
|
|
179
|
+
groupCollapsed: b({}, e, {
|
|
180
|
+
value: ye
|
|
181
|
+
}),
|
|
182
|
+
groupEnd: b({}, e, {
|
|
183
|
+
value: xe
|
|
184
184
|
})
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
|
-
|
|
187
|
+
$ < 0 && x("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
var
|
|
191
|
-
function
|
|
190
|
+
var ae = A.ReactCurrentDispatcher, oe;
|
|
191
|
+
function G(e, r, t) {
|
|
192
192
|
{
|
|
193
|
-
if (
|
|
193
|
+
if (oe === void 0)
|
|
194
194
|
try {
|
|
195
195
|
throw Error();
|
|
196
|
-
} catch (
|
|
197
|
-
var n =
|
|
198
|
-
|
|
196
|
+
} catch (l) {
|
|
197
|
+
var n = l.stack.trim().match(/\n( *(at )?)/);
|
|
198
|
+
oe = n && n[1] || "";
|
|
199
199
|
}
|
|
200
200
|
return `
|
|
201
|
-
` +
|
|
201
|
+
` + oe + e;
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
var
|
|
204
|
+
var ie = !1, H;
|
|
205
205
|
{
|
|
206
|
-
var
|
|
207
|
-
|
|
206
|
+
var Ue = typeof WeakMap == "function" ? WeakMap : Map;
|
|
207
|
+
H = new Ue();
|
|
208
208
|
}
|
|
209
|
-
function
|
|
210
|
-
if (!e ||
|
|
209
|
+
function Ee(e, r) {
|
|
210
|
+
if (!e || ie)
|
|
211
211
|
return "";
|
|
212
212
|
{
|
|
213
|
-
var t =
|
|
213
|
+
var t = H.get(e);
|
|
214
214
|
if (t !== void 0)
|
|
215
215
|
return t;
|
|
216
216
|
}
|
|
217
217
|
var n;
|
|
218
|
-
|
|
219
|
-
var
|
|
218
|
+
ie = !0;
|
|
219
|
+
var l = Error.prepareStackTrace;
|
|
220
220
|
Error.prepareStackTrace = void 0;
|
|
221
221
|
var c;
|
|
222
|
-
c =
|
|
222
|
+
c = ae.current, ae.current = null, We();
|
|
223
223
|
try {
|
|
224
224
|
if (r) {
|
|
225
225
|
var i = function() {
|
|
@@ -232,167 +232,167 @@ function vr() {
|
|
|
232
232
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
233
233
|
try {
|
|
234
234
|
Reflect.construct(i, []);
|
|
235
|
-
} catch (
|
|
236
|
-
n =
|
|
235
|
+
} catch (T) {
|
|
236
|
+
n = T;
|
|
237
237
|
}
|
|
238
238
|
Reflect.construct(e, [], i);
|
|
239
239
|
} else {
|
|
240
240
|
try {
|
|
241
241
|
i.call();
|
|
242
|
-
} catch (
|
|
243
|
-
n =
|
|
242
|
+
} catch (T) {
|
|
243
|
+
n = T;
|
|
244
244
|
}
|
|
245
245
|
e.call(i.prototype);
|
|
246
246
|
}
|
|
247
247
|
} else {
|
|
248
248
|
try {
|
|
249
249
|
throw Error();
|
|
250
|
-
} catch (
|
|
251
|
-
n =
|
|
250
|
+
} catch (T) {
|
|
251
|
+
n = T;
|
|
252
252
|
}
|
|
253
253
|
e();
|
|
254
254
|
}
|
|
255
|
-
} catch (
|
|
256
|
-
if (
|
|
257
|
-
for (var a =
|
|
258
|
-
`),
|
|
259
|
-
`),
|
|
260
|
-
|
|
261
|
-
for (;
|
|
262
|
-
if (a[
|
|
263
|
-
if (
|
|
255
|
+
} catch (T) {
|
|
256
|
+
if (T && n && typeof T.stack == "string") {
|
|
257
|
+
for (var a = T.stack.split(`
|
|
258
|
+
`), R = n.stack.split(`
|
|
259
|
+
`), d = a.length - 1, m = R.length - 1; d >= 1 && m >= 0 && a[d] !== R[m]; )
|
|
260
|
+
m--;
|
|
261
|
+
for (; d >= 1 && m >= 0; d--, m--)
|
|
262
|
+
if (a[d] !== R[m]) {
|
|
263
|
+
if (d !== 1 || m !== 1)
|
|
264
264
|
do
|
|
265
|
-
if (
|
|
266
|
-
var
|
|
267
|
-
` + a[
|
|
268
|
-
return e.displayName &&
|
|
265
|
+
if (d--, m--, m < 0 || a[d] !== R[m]) {
|
|
266
|
+
var k = `
|
|
267
|
+
` + a[d].replace(" at new ", " at ");
|
|
268
|
+
return e.displayName && k.includes("<anonymous>") && (k = k.replace("<anonymous>", e.displayName)), typeof e == "function" && H.set(e, k), k;
|
|
269
269
|
}
|
|
270
|
-
while (
|
|
270
|
+
while (d >= 1 && m >= 0);
|
|
271
271
|
break;
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
} finally {
|
|
275
|
-
|
|
275
|
+
ie = !1, ae.current = c, Me(), Error.prepareStackTrace = l;
|
|
276
276
|
}
|
|
277
|
-
var
|
|
278
|
-
return typeof e == "function" &&
|
|
277
|
+
var Y = e ? e.displayName || e.name : "", L = Y ? G(Y) : "";
|
|
278
|
+
return typeof e == "function" && H.set(e, L), L;
|
|
279
279
|
}
|
|
280
280
|
function Ye(e, r, t) {
|
|
281
|
-
return
|
|
281
|
+
return Ee(e, !1);
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function Be(e) {
|
|
284
284
|
var r = e.prototype;
|
|
285
285
|
return !!(r && r.isReactComponent);
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function Z(e, r, t) {
|
|
288
288
|
if (e == null)
|
|
289
289
|
return "";
|
|
290
290
|
if (typeof e == "function")
|
|
291
|
-
return
|
|
291
|
+
return Ee(e, Be(e));
|
|
292
292
|
if (typeof e == "string")
|
|
293
|
-
return
|
|
293
|
+
return G(e);
|
|
294
294
|
switch (e) {
|
|
295
295
|
case N:
|
|
296
|
-
return
|
|
297
|
-
case
|
|
298
|
-
return
|
|
296
|
+
return G("Suspense");
|
|
297
|
+
case h:
|
|
298
|
+
return G("SuspenseList");
|
|
299
299
|
}
|
|
300
300
|
if (typeof e == "object")
|
|
301
301
|
switch (e.$$typeof) {
|
|
302
|
-
case
|
|
302
|
+
case y:
|
|
303
303
|
return Ye(e.render);
|
|
304
|
-
case
|
|
305
|
-
return
|
|
306
|
-
case
|
|
307
|
-
var n = e,
|
|
304
|
+
case P:
|
|
305
|
+
return Z(e.type, r, t);
|
|
306
|
+
case C: {
|
|
307
|
+
var n = e, l = n._payload, c = n._init;
|
|
308
308
|
try {
|
|
309
|
-
return
|
|
309
|
+
return Z(c(l), r, t);
|
|
310
310
|
} catch {
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
return "";
|
|
315
315
|
}
|
|
316
|
-
var
|
|
317
|
-
function
|
|
316
|
+
var V = Object.prototype.hasOwnProperty, we = {}, Re = A.ReactDebugCurrentFrame;
|
|
317
|
+
function Q(e) {
|
|
318
318
|
if (e) {
|
|
319
|
-
var r = e._owner, t =
|
|
320
|
-
|
|
319
|
+
var r = e._owner, t = Z(e.type, e._source, r ? r.type : null);
|
|
320
|
+
Re.setExtraStackFrame(t);
|
|
321
321
|
} else
|
|
322
|
-
|
|
322
|
+
Re.setExtraStackFrame(null);
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function qe(e, r, t, n, l) {
|
|
325
325
|
{
|
|
326
|
-
var c = Function.call.bind(
|
|
326
|
+
var c = Function.call.bind(V);
|
|
327
327
|
for (var i in e)
|
|
328
328
|
if (c(e, i)) {
|
|
329
329
|
var a = void 0;
|
|
330
330
|
try {
|
|
331
331
|
if (typeof e[i] != "function") {
|
|
332
|
-
var
|
|
333
|
-
throw
|
|
332
|
+
var R = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
333
|
+
throw R.name = "Invariant Violation", R;
|
|
334
334
|
}
|
|
335
335
|
a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
336
|
-
} catch (
|
|
337
|
-
a =
|
|
336
|
+
} catch (d) {
|
|
337
|
+
a = d;
|
|
338
338
|
}
|
|
339
|
-
a && !(a instanceof Error) && (
|
|
339
|
+
a && !(a instanceof Error) && (Q(l), x("%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).", n || "React class", t, i, typeof a), Q(null)), a instanceof Error && !(a.message in we) && (we[a.message] = !0, Q(l), x("Failed %s type: %s", t, a.message), Q(null));
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
343
|
var Ve = Array.isArray;
|
|
344
|
-
function
|
|
344
|
+
function se(e) {
|
|
345
345
|
return Ve(e);
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function Je(e) {
|
|
348
348
|
{
|
|
349
349
|
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
350
350
|
return t;
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function Ke(e) {
|
|
354
354
|
try {
|
|
355
|
-
return
|
|
355
|
+
return Se(e), !1;
|
|
356
356
|
} catch {
|
|
357
357
|
return !0;
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function Se(e) {
|
|
361
361
|
return "" + e;
|
|
362
362
|
}
|
|
363
|
-
function
|
|
364
|
-
if (
|
|
365
|
-
return
|
|
363
|
+
function je(e) {
|
|
364
|
+
if (Ke(e))
|
|
365
|
+
return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(e)), Se(e);
|
|
366
366
|
}
|
|
367
|
-
var
|
|
367
|
+
var Te = A.ReactCurrentOwner, Xe = {
|
|
368
368
|
key: !0,
|
|
369
369
|
ref: !0,
|
|
370
370
|
__self: !0,
|
|
371
371
|
__source: !0
|
|
372
|
-
},
|
|
373
|
-
function
|
|
374
|
-
if (
|
|
372
|
+
}, Pe, Ce;
|
|
373
|
+
function Ge(e) {
|
|
374
|
+
if (V.call(e, "ref")) {
|
|
375
375
|
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
376
376
|
if (r && r.isReactWarning)
|
|
377
377
|
return !1;
|
|
378
378
|
}
|
|
379
379
|
return e.ref !== void 0;
|
|
380
380
|
}
|
|
381
|
-
function
|
|
382
|
-
if (
|
|
381
|
+
function He(e) {
|
|
382
|
+
if (V.call(e, "key")) {
|
|
383
383
|
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
384
384
|
if (r && r.isReactWarning)
|
|
385
385
|
return !1;
|
|
386
386
|
}
|
|
387
387
|
return e.key !== void 0;
|
|
388
388
|
}
|
|
389
|
-
function
|
|
390
|
-
typeof e.ref == "string" &&
|
|
389
|
+
function Ze(e, r) {
|
|
390
|
+
typeof e.ref == "string" && Te.current;
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function Qe(e, r) {
|
|
393
393
|
{
|
|
394
394
|
var t = function() {
|
|
395
|
-
|
|
395
|
+
Pe || (Pe = !0, x("%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)", r));
|
|
396
396
|
};
|
|
397
397
|
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
398
398
|
get: t,
|
|
@@ -400,10 +400,10 @@ function vr() {
|
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function er(e, r) {
|
|
404
404
|
{
|
|
405
405
|
var t = function() {
|
|
406
|
-
|
|
406
|
+
Ce || (Ce = !0, x("%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)", r));
|
|
407
407
|
};
|
|
408
408
|
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
409
409
|
get: t,
|
|
@@ -411,10 +411,10 @@ function vr() {
|
|
|
411
411
|
});
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
|
-
var
|
|
414
|
+
var rr = function(e, r, t, n, l, c, i) {
|
|
415
415
|
var a = {
|
|
416
416
|
// This tag allows us to uniquely identify this as a React Element
|
|
417
|
-
$$typeof:
|
|
417
|
+
$$typeof: _,
|
|
418
418
|
// Built-in properties that belong on the element
|
|
419
419
|
type: e,
|
|
420
420
|
key: r,
|
|
@@ -437,44 +437,44 @@ function vr() {
|
|
|
437
437
|
configurable: !1,
|
|
438
438
|
enumerable: !1,
|
|
439
439
|
writable: !1,
|
|
440
|
-
value:
|
|
440
|
+
value: l
|
|
441
441
|
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
442
442
|
};
|
|
443
|
-
function
|
|
443
|
+
function tr(e, r, t, n, l) {
|
|
444
444
|
{
|
|
445
|
-
var c, i = {}, a = null,
|
|
446
|
-
t !== void 0 && (
|
|
445
|
+
var c, i = {}, a = null, R = null;
|
|
446
|
+
t !== void 0 && (je(t), a = "" + t), He(r) && (je(r.key), a = "" + r.key), Ge(r) && (R = r.ref, Ze(r, l));
|
|
447
447
|
for (c in r)
|
|
448
|
-
|
|
448
|
+
V.call(r, c) && !Xe.hasOwnProperty(c) && (i[c] = r[c]);
|
|
449
449
|
if (e && e.defaultProps) {
|
|
450
|
-
var
|
|
451
|
-
for (c in
|
|
452
|
-
i[c] === void 0 && (i[c] =
|
|
450
|
+
var d = e.defaultProps;
|
|
451
|
+
for (c in d)
|
|
452
|
+
i[c] === void 0 && (i[c] = d[c]);
|
|
453
453
|
}
|
|
454
|
-
if (a ||
|
|
455
|
-
var
|
|
456
|
-
a &&
|
|
454
|
+
if (a || R) {
|
|
455
|
+
var m = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
456
|
+
a && Qe(i, m), R && er(i, m);
|
|
457
457
|
}
|
|
458
|
-
return
|
|
458
|
+
return rr(e, a, R, l, n, Te.current, i);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
var
|
|
462
|
-
function
|
|
461
|
+
var le = A.ReactCurrentOwner, ke = A.ReactDebugCurrentFrame;
|
|
462
|
+
function U(e) {
|
|
463
463
|
if (e) {
|
|
464
|
-
var r = e._owner, t =
|
|
465
|
-
|
|
464
|
+
var r = e._owner, t = Z(e.type, e._source, r ? r.type : null);
|
|
465
|
+
ke.setExtraStackFrame(t);
|
|
466
466
|
} else
|
|
467
|
-
|
|
467
|
+
ke.setExtraStackFrame(null);
|
|
468
468
|
}
|
|
469
|
-
var
|
|
470
|
-
|
|
471
|
-
function
|
|
472
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
469
|
+
var ce;
|
|
470
|
+
ce = !1;
|
|
471
|
+
function ue(e) {
|
|
472
|
+
return typeof e == "object" && e !== null && e.$$typeof === _;
|
|
473
473
|
}
|
|
474
474
|
function Oe() {
|
|
475
475
|
{
|
|
476
|
-
if (
|
|
477
|
-
var e =
|
|
476
|
+
if (le.current) {
|
|
477
|
+
var e = v(le.current.type);
|
|
478
478
|
if (e)
|
|
479
479
|
return `
|
|
480
480
|
|
|
@@ -483,11 +483,11 @@ Check the render method of \`` + e + "`.";
|
|
|
483
483
|
return "";
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
|
-
function
|
|
486
|
+
function nr(e) {
|
|
487
487
|
return "";
|
|
488
488
|
}
|
|
489
|
-
var
|
|
490
|
-
function
|
|
489
|
+
var De = {};
|
|
490
|
+
function ar(e) {
|
|
491
491
|
{
|
|
492
492
|
var r = Oe();
|
|
493
493
|
if (!r) {
|
|
@@ -499,39 +499,39 @@ Check the top-level render call using <` + t + ">.");
|
|
|
499
499
|
return r;
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
|
-
function
|
|
502
|
+
function Ne(e, r) {
|
|
503
503
|
{
|
|
504
504
|
if (!e._store || e._store.validated || e.key != null)
|
|
505
505
|
return;
|
|
506
506
|
e._store.validated = !0;
|
|
507
|
-
var t =
|
|
508
|
-
if (
|
|
507
|
+
var t = ar(r);
|
|
508
|
+
if (De[t])
|
|
509
509
|
return;
|
|
510
|
-
|
|
510
|
+
De[t] = !0;
|
|
511
511
|
var n = "";
|
|
512
|
-
e && e._owner && e._owner !==
|
|
512
|
+
e && e._owner && e._owner !== le.current && (n = " It was passed a child from " + v(e._owner.type) + "."), U(e), x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), U(null);
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
|
-
function
|
|
515
|
+
function Ae(e, r) {
|
|
516
516
|
{
|
|
517
517
|
if (typeof e != "object")
|
|
518
518
|
return;
|
|
519
|
-
if (
|
|
519
|
+
if (se(e))
|
|
520
520
|
for (var t = 0; t < e.length; t++) {
|
|
521
521
|
var n = e[t];
|
|
522
|
-
|
|
522
|
+
ue(n) && Ne(n, r);
|
|
523
523
|
}
|
|
524
|
-
else if (
|
|
524
|
+
else if (ue(e))
|
|
525
525
|
e._store && (e._store.validated = !0);
|
|
526
526
|
else if (e) {
|
|
527
|
-
var
|
|
528
|
-
if (typeof
|
|
529
|
-
for (var c =
|
|
530
|
-
|
|
527
|
+
var l = q(e);
|
|
528
|
+
if (typeof l == "function" && l !== e.entries)
|
|
529
|
+
for (var c = l.call(e), i; !(i = c.next()).done; )
|
|
530
|
+
ue(i.value) && Ne(i.value, r);
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
|
-
function
|
|
534
|
+
function or(e) {
|
|
535
535
|
{
|
|
536
536
|
var r = e.type;
|
|
537
537
|
if (r == null || typeof r == "string")
|
|
@@ -539,262 +539,319 @@ Check the top-level render call using <` + t + ">.");
|
|
|
539
539
|
var t;
|
|
540
540
|
if (typeof r == "function")
|
|
541
541
|
t = r.propTypes;
|
|
542
|
-
else if (typeof r == "object" && (r.$$typeof ===
|
|
542
|
+
else if (typeof r == "object" && (r.$$typeof === y || // Note: Memo only checks outer props here.
|
|
543
543
|
// Inner props are checked in the reconciler.
|
|
544
|
-
r.$$typeof ===
|
|
544
|
+
r.$$typeof === P))
|
|
545
545
|
t = r.propTypes;
|
|
546
546
|
else
|
|
547
547
|
return;
|
|
548
548
|
if (t) {
|
|
549
|
-
var n =
|
|
550
|
-
|
|
551
|
-
} else if (r.PropTypes !== void 0 && !
|
|
552
|
-
|
|
553
|
-
var
|
|
554
|
-
|
|
549
|
+
var n = v(r);
|
|
550
|
+
qe(t, e.props, "prop", n, e);
|
|
551
|
+
} else if (r.PropTypes !== void 0 && !ce) {
|
|
552
|
+
ce = !0;
|
|
553
|
+
var l = v(r);
|
|
554
|
+
x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", l || "Unknown");
|
|
555
555
|
}
|
|
556
|
-
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved &&
|
|
556
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
|
-
function
|
|
559
|
+
function ir(e) {
|
|
560
560
|
{
|
|
561
561
|
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
562
562
|
var n = r[t];
|
|
563
563
|
if (n !== "children" && n !== "key") {
|
|
564
|
-
|
|
564
|
+
U(e), x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), U(null);
|
|
565
565
|
break;
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
|
-
e.ref !== null && (
|
|
568
|
+
e.ref !== null && (U(e), x("Invalid attribute `ref` supplied to `React.Fragment`."), U(null));
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
|
-
var
|
|
572
|
-
function
|
|
571
|
+
var Fe = {};
|
|
572
|
+
function Ie(e, r, t, n, l, c) {
|
|
573
573
|
{
|
|
574
|
-
var i =
|
|
574
|
+
var i = p(e);
|
|
575
575
|
if (!i) {
|
|
576
576
|
var a = "";
|
|
577
577
|
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
578
|
-
var
|
|
579
|
-
|
|
580
|
-
var
|
|
581
|
-
e === null ?
|
|
578
|
+
var R = nr();
|
|
579
|
+
R ? a += R : a += Oe();
|
|
580
|
+
var d;
|
|
581
|
+
e === null ? d = "null" : se(e) ? d = "array" : e !== void 0 && e.$$typeof === _ ? (d = "<" + (v(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : d = typeof e, x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", d, a);
|
|
582
582
|
}
|
|
583
|
-
var
|
|
584
|
-
if (
|
|
585
|
-
return
|
|
583
|
+
var m = tr(e, r, t, l, c);
|
|
584
|
+
if (m == null)
|
|
585
|
+
return m;
|
|
586
586
|
if (i) {
|
|
587
|
-
var
|
|
588
|
-
if (
|
|
587
|
+
var k = r.children;
|
|
588
|
+
if (k !== void 0)
|
|
589
589
|
if (n)
|
|
590
|
-
if (
|
|
591
|
-
for (var
|
|
592
|
-
|
|
593
|
-
Object.freeze && Object.freeze(
|
|
590
|
+
if (se(k)) {
|
|
591
|
+
for (var Y = 0; Y < k.length; Y++)
|
|
592
|
+
Ae(k[Y], e);
|
|
593
|
+
Object.freeze && Object.freeze(k);
|
|
594
594
|
} else
|
|
595
|
-
|
|
595
|
+
x("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
596
596
|
else
|
|
597
|
-
|
|
597
|
+
Ae(k, e);
|
|
598
598
|
}
|
|
599
|
-
if (
|
|
600
|
-
var
|
|
601
|
-
return
|
|
602
|
-
}),
|
|
603
|
-
if (!
|
|
604
|
-
var
|
|
605
|
-
|
|
599
|
+
if (V.call(r, "key")) {
|
|
600
|
+
var L = v(e), T = Object.keys(r).filter(function(dr) {
|
|
601
|
+
return dr !== "key";
|
|
602
|
+
}), fe = T.length > 0 ? "{key: someKey, " + T.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
603
|
+
if (!Fe[L + fe]) {
|
|
604
|
+
var fr = T.length > 0 ? "{" + T.join(": ..., ") + ": ...}" : "{}";
|
|
605
|
+
x(`A props object containing a "key" prop is being spread into JSX:
|
|
606
606
|
let props = %s;
|
|
607
607
|
<%s {...props} />
|
|
608
608
|
React keys must be passed directly to JSX without using spread:
|
|
609
609
|
let props = %s;
|
|
610
|
-
<%s key={someKey} {...props} />`,
|
|
610
|
+
<%s key={someKey} {...props} />`, fe, L, fr, L), Fe[L + fe] = !0;
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
|
-
return e ===
|
|
613
|
+
return e === g ? ir(m) : or(m), m;
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
|
-
function
|
|
617
|
-
return
|
|
616
|
+
function sr(e, r, t) {
|
|
617
|
+
return Ie(e, r, t, !0);
|
|
618
618
|
}
|
|
619
|
-
function
|
|
620
|
-
return
|
|
619
|
+
function lr(e, r, t) {
|
|
620
|
+
return Ie(e, r, t, !1);
|
|
621
621
|
}
|
|
622
|
-
var
|
|
623
|
-
K.Fragment =
|
|
622
|
+
var cr = lr, ur = sr;
|
|
623
|
+
K.Fragment = g, K.jsx = cr, K.jsxs = ur;
|
|
624
624
|
}()), K;
|
|
625
625
|
}
|
|
626
|
-
process.env.NODE_ENV === "production" ?
|
|
627
|
-
var
|
|
628
|
-
const
|
|
629
|
-
const
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
626
|
+
process.env.NODE_ENV === "production" ? de.exports = vr() : de.exports = mr();
|
|
627
|
+
var o = de.exports;
|
|
628
|
+
const gr = "StyllarDB", W = "user_profile", pe = () => new Promise((S, _) => {
|
|
629
|
+
const f = indexedDB.open(gr, 1);
|
|
630
|
+
f.onupgradeneeded = (g) => g.target.result.createObjectStore(W), f.onsuccess = () => S(f.result), f.onerror = () => _(f.error);
|
|
631
|
+
}), hr = async (S) => {
|
|
632
|
+
const _ = await pe();
|
|
633
|
+
return new Promise((f, g) => {
|
|
634
|
+
const D = _.transaction(W, "readwrite").objectStore(W).put(S, "userData");
|
|
635
|
+
D.onsuccess = () => f(), D.onerror = () => g(D.error);
|
|
636
|
+
});
|
|
637
|
+
}, br = async () => {
|
|
638
|
+
const S = await pe();
|
|
639
|
+
return new Promise((_, f) => {
|
|
640
|
+
const E = S.transaction(W, "readonly").objectStore(W).get("userData");
|
|
641
|
+
E.onsuccess = () => _(E.result), E.onerror = () => f(E.error);
|
|
642
|
+
});
|
|
643
|
+
}, yr = async () => {
|
|
644
|
+
const S = await pe();
|
|
645
|
+
return new Promise((_, f) => {
|
|
646
|
+
const E = S.transaction(W, "readwrite").objectStore(W).delete("userData");
|
|
647
|
+
E.onsuccess = () => _(), E.onerror = () => f(E.error);
|
|
648
|
+
});
|
|
649
|
+
}, _r = () => {
|
|
650
|
+
const [S, _] = I(!1), [f, g] = I("idle"), [E, D] = I(""), [F, O] = I(null), [y, N] = I(!1), [h, P] = I(""), [C, z] = I(""), [M, B] = I(null), [q, A] = I(null), x = "http://136.113.197.77:5000/predict/size-from-chart";
|
|
651
|
+
pr(() => {
|
|
652
|
+
(async () => {
|
|
653
|
+
try {
|
|
654
|
+
const u = await br();
|
|
655
|
+
u && u.frontImage && u.sideImage && (P(u.height), z(u.weight), B(u.frontImage), A(u.sideImage), N(!0), console.log("Styllar: Loaded user profile from memory."));
|
|
656
|
+
} catch (u) {
|
|
657
|
+
console.error("Styllar: Failed to load profile", u);
|
|
658
|
+
}
|
|
659
|
+
})();
|
|
660
|
+
}, []);
|
|
661
|
+
const ee = (s) => {
|
|
662
|
+
if (!s) return;
|
|
663
|
+
const u = () => {
|
|
664
|
+
const p = document.querySelectorAll('button, .size-swatch, .size-option, li[role="radio"], div[data-value]');
|
|
665
|
+
for (let j of p) {
|
|
666
|
+
const w = j.innerText.trim().toUpperCase(), v = String(s).trim().toUpperCase();
|
|
667
|
+
if (w === v || w === `SIZE ${v}`)
|
|
668
|
+
return j.click(), !0;
|
|
637
669
|
}
|
|
638
670
|
return !1;
|
|
639
671
|
};
|
|
640
|
-
if (!
|
|
641
|
-
let
|
|
642
|
-
const
|
|
643
|
-
|
|
672
|
+
if (!u()) {
|
|
673
|
+
let p = 0;
|
|
674
|
+
const j = setInterval(() => {
|
|
675
|
+
p++, (u() || p > 10) && clearInterval(j);
|
|
644
676
|
}, 500);
|
|
645
677
|
}
|
|
646
678
|
};
|
|
647
|
-
fr(() => {
|
|
648
|
-
typeof chrome < "u" && chrome.storage && chrome.storage.local.get(["styllar_last_size"], (o) => {
|
|
649
|
-
o.styllar_last_size && (console.log("Styllar: Found saved size:", o.styllar_last_size), setTimeout(() => O(o.styllar_last_size), 1e3));
|
|
650
|
-
});
|
|
651
|
-
}, []);
|
|
652
|
-
function m() {
|
|
653
|
-
var _;
|
|
654
|
-
let o = 0, h = 0;
|
|
655
|
-
const f = ["pant", "jeans", "trouser", "skirt", "short", "legging", "jogger", "bottom", "denim", "cargo"], y = ["shirt", "top", "tee", "blouse", "jacket", "coat", "hoodie", "sweater", "vest", "cardigan", "dress", "t-shirt"], g = (document.title + " " + (((_ = document.querySelector("h1")) == null ? void 0 : _.innerText) || "")).toLowerCase();
|
|
656
|
-
return f.forEach((E) => {
|
|
657
|
-
g.includes(E) && (h += 2);
|
|
658
|
-
}), y.forEach((E) => {
|
|
659
|
-
g.includes(E) && (o += 2);
|
|
660
|
-
}), h > o ? "bottom" : "top";
|
|
661
|
-
}
|
|
662
679
|
function re() {
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
}
|
|
672
|
-
const y = document.querySelector('.size-guide, #size-chart, .measurement-guide, [class*="SizeGuide"]');
|
|
673
|
-
return y ? (o.chart_type = "raw_text", o.chart_content = y.innerText, o) : (document.querySelectorAll("button, span, li").forEach((_) => {
|
|
674
|
-
const E = _.innerText.trim();
|
|
675
|
-
/^(XS|S|M|L|XL|XXL|[0-9]{2})$/i.test(E) && E.length < 4 && (o.available_sizes.includes(E) || o.available_sizes.push(E));
|
|
676
|
-
}), o);
|
|
680
|
+
var v;
|
|
681
|
+
let s = 0, u = 0;
|
|
682
|
+
const p = ["pant", "jeans", "trouser", "skirt", "short", "legging", "jogger", "bottom", "denim", "cargo"], j = ["shirt", "top", "tee", "blouse", "jacket", "coat", "hoodie", "sweater", "vest", "cardigan", "dress", "t-shirt"], w = (document.title + " " + (((v = document.querySelector("h1")) == null ? void 0 : v.innerText) || "")).toLowerCase();
|
|
683
|
+
return p.forEach((b) => {
|
|
684
|
+
w.includes(b) && (u += 2);
|
|
685
|
+
}), j.forEach((b) => {
|
|
686
|
+
w.includes(b) && (s += 2);
|
|
687
|
+
}), u > s ? "bottom" : "top";
|
|
677
688
|
}
|
|
678
|
-
|
|
679
|
-
|
|
689
|
+
function te() {
|
|
690
|
+
const s = { chart_type: "none", chart_content: null, available_sizes: [] }, u = document.querySelector("table");
|
|
691
|
+
if (u && /chest|waist|bust|hip|size/i.test(u.innerText))
|
|
692
|
+
return s.chart_type = "html_table", s.chart_content = u.outerHTML, s;
|
|
693
|
+
const p = document.querySelectorAll("img");
|
|
694
|
+
for (let v of p) {
|
|
695
|
+
const b = v.src.toLowerCase(), $ = (v.alt || "").toLowerCase();
|
|
696
|
+
if (b.includes("size") && b.includes("chart") || $.includes("size") && $.includes("guide"))
|
|
697
|
+
return s.chart_type = "image_url", s.chart_content = v.src, s;
|
|
698
|
+
}
|
|
699
|
+
const j = document.querySelector('.size-guide, #size-chart, .measurement-guide, [class*="SizeGuide"]');
|
|
700
|
+
return j ? (s.chart_type = "raw_text", s.chart_content = j.innerText, s) : (document.querySelectorAll("button, span, li").forEach((v) => {
|
|
701
|
+
const b = v.innerText.trim();
|
|
702
|
+
/^(XS|S|M|L|XL|XXL|[0-9]{2})$/i.test(b) && b.length < 4 && (s.available_sizes.includes(b) || s.available_sizes.push(b));
|
|
703
|
+
}), s);
|
|
704
|
+
}
|
|
705
|
+
const X = async () => {
|
|
706
|
+
if (!M || !q || !h || !C) {
|
|
680
707
|
alert("Please fill all fields.");
|
|
681
708
|
return;
|
|
682
709
|
}
|
|
683
|
-
|
|
684
|
-
const
|
|
685
|
-
|
|
710
|
+
g("loading"), await hr({ height: h, weight: C, frontImage: M, sideImage: q }), N(!0);
|
|
711
|
+
const s = re(), u = te(), p = new FormData();
|
|
712
|
+
p.append("front_image", M), p.append("side_image", q), p.append("height", h), p.append("weight", C), p.append("product_type", s), p.append("chart_type", u.chart_type), p.append("chart_content", u.chart_content), p.append("available_sizes", JSON.stringify(u.available_sizes));
|
|
686
713
|
try {
|
|
687
|
-
const
|
|
688
|
-
if (
|
|
689
|
-
|
|
690
|
-
} catch (
|
|
691
|
-
|
|
692
|
-
}
|
|
714
|
+
const w = await (await fetch(x, { method: "POST", body: p })).json();
|
|
715
|
+
if (w.error) throw new Error(w.error);
|
|
716
|
+
O(w), g("success"), w.recommended_size && ee(w.recommended_size);
|
|
717
|
+
} catch (j) {
|
|
718
|
+
D(j.message), g("error");
|
|
719
|
+
}
|
|
720
|
+
}, ne = async () => {
|
|
721
|
+
await yr(), P(""), z(""), B(null), A(null), N(!1), O(null), g("idle");
|
|
693
722
|
};
|
|
694
|
-
return /* @__PURE__ */
|
|
695
|
-
/* @__PURE__ */
|
|
723
|
+
return /* @__PURE__ */ o.jsxs("div", { className: "fixed bottom-6 right-6 z-[999999]", children: [
|
|
724
|
+
/* @__PURE__ */ o.jsx(
|
|
696
725
|
"button",
|
|
697
726
|
{
|
|
698
|
-
onClick: () =>
|
|
727
|
+
onClick: () => _(!S),
|
|
699
728
|
className: "bg-black text-white px-7 py-3.5 rounded-full shadow-xl font-bold text-sm hover:opacity-80 transition-opacity",
|
|
700
729
|
children: "Styllar"
|
|
701
730
|
}
|
|
702
731
|
),
|
|
703
|
-
|
|
704
|
-
/* @__PURE__ */
|
|
705
|
-
/* @__PURE__ */
|
|
706
|
-
/* @__PURE__ */
|
|
732
|
+
S && /* @__PURE__ */ o.jsxs("div", { className: "absolute bottom-20 right-0 w-[330px] bg-white rounded-2xl p-6 shadow-2xl border border-gray-100 text-black", children: [
|
|
733
|
+
/* @__PURE__ */ o.jsxs("div", { className: "flex justify-between items-center mb-4", children: [
|
|
734
|
+
/* @__PURE__ */ o.jsx("h3", { className: "m-0 text-lg font-bold", children: "Smart Fit Assistant" }),
|
|
735
|
+
/* @__PURE__ */ o.jsx("button", { onClick: () => _(!1), className: "text-gray-400 hover:text-black text-2xl leading-none", children: "×" })
|
|
707
736
|
] }),
|
|
708
|
-
|
|
709
|
-
/* @__PURE__ */
|
|
710
|
-
/* @__PURE__ */
|
|
737
|
+
f === "loading" && /* @__PURE__ */ o.jsxs("div", { className: "flex flex-col items-center justify-center py-8", children: [
|
|
738
|
+
/* @__PURE__ */ o.jsx("div", { className: "w-8 h-8 border-4 border-gray-200 border-t-black rounded-full animate-spin mb-4" }),
|
|
739
|
+
/* @__PURE__ */ o.jsx("p", { className: "text-sm text-gray-600", children: "Analyzing body & page data..." })
|
|
711
740
|
] }),
|
|
712
|
-
|
|
713
|
-
/* @__PURE__ */
|
|
714
|
-
/* @__PURE__ */
|
|
715
|
-
/* @__PURE__ */
|
|
741
|
+
f === "success" && F && /* @__PURE__ */ o.jsxs("div", { className: "text-center py-6", children: [
|
|
742
|
+
/* @__PURE__ */ o.jsx("div", { className: "text-sm text-green-600 font-bold tracking-wider", children: "MATCH FOUND" }),
|
|
743
|
+
/* @__PURE__ */ o.jsx("div", { className: "text-5xl font-black my-4 text-black", children: F.recommended_size }),
|
|
744
|
+
/* @__PURE__ */ o.jsxs("div", { className: "text-xs text-gray-500 mb-6", children: [
|
|
716
745
|
"Confidence: ",
|
|
717
|
-
|
|
746
|
+
F.confidence
|
|
718
747
|
] }),
|
|
719
|
-
/* @__PURE__ */
|
|
748
|
+
/* @__PURE__ */ o.jsx(
|
|
720
749
|
"button",
|
|
721
750
|
{
|
|
722
751
|
onClick: () => {
|
|
723
|
-
|
|
752
|
+
g("idle"), O(null);
|
|
724
753
|
},
|
|
725
754
|
className: "text-blue-600 text-sm underline hover:text-blue-800",
|
|
726
|
-
children: "
|
|
755
|
+
children: "Scan Another Product"
|
|
727
756
|
}
|
|
728
757
|
)
|
|
729
758
|
] }),
|
|
730
|
-
|
|
731
|
-
/* @__PURE__ */
|
|
759
|
+
f === "error" && /* @__PURE__ */ o.jsxs("div", { className: "py-4", children: [
|
|
760
|
+
/* @__PURE__ */ o.jsxs("p", { className: "text-red-500 text-sm mb-4", children: [
|
|
732
761
|
"Error: ",
|
|
733
|
-
|
|
762
|
+
E
|
|
734
763
|
] }),
|
|
735
|
-
/* @__PURE__ */
|
|
764
|
+
/* @__PURE__ */ o.jsx(
|
|
736
765
|
"button",
|
|
737
766
|
{
|
|
738
|
-
onClick: () =>
|
|
767
|
+
onClick: () => g("idle"),
|
|
739
768
|
className: "w-full bg-black text-white py-3 rounded-xl font-bold text-sm",
|
|
740
769
|
children: "Try Again"
|
|
741
770
|
}
|
|
742
771
|
)
|
|
743
772
|
] }),
|
|
744
|
-
|
|
745
|
-
/* @__PURE__ */
|
|
746
|
-
|
|
747
|
-
/* @__PURE__ */
|
|
773
|
+
f === "idle" && y && /* @__PURE__ */ o.jsxs("div", { className: "py-4", children: [
|
|
774
|
+
/* @__PURE__ */ o.jsxs("div", { className: "bg-gray-50 border border-gray-200 rounded-xl p-4 mb-5 text-center", children: [
|
|
775
|
+
/* @__PURE__ */ o.jsx("span", { className: "block text-xl mb-2", children: "👤" }),
|
|
776
|
+
/* @__PURE__ */ o.jsx("h4", { className: "font-bold text-sm mb-1", children: "Body Profile Saved" }),
|
|
777
|
+
/* @__PURE__ */ o.jsxs("p", { className: "text-xs text-gray-500", children: [
|
|
778
|
+
h,
|
|
779
|
+
"cm | ",
|
|
780
|
+
C,
|
|
781
|
+
"kg"
|
|
782
|
+
] })
|
|
783
|
+
] }),
|
|
784
|
+
/* @__PURE__ */ o.jsx(
|
|
785
|
+
"button",
|
|
786
|
+
{
|
|
787
|
+
onClick: X,
|
|
788
|
+
className: "w-full bg-black text-white py-3.5 rounded-xl font-bold text-sm hover:opacity-80 transition-opacity mb-3",
|
|
789
|
+
children: "⚡ Auto-Scan This Product"
|
|
790
|
+
}
|
|
791
|
+
),
|
|
792
|
+
/* @__PURE__ */ o.jsx(
|
|
793
|
+
"button",
|
|
794
|
+
{
|
|
795
|
+
onClick: ne,
|
|
796
|
+
className: "w-full text-gray-500 text-xs underline hover:text-black",
|
|
797
|
+
children: "Edit Profile / Upload New Photos"
|
|
798
|
+
}
|
|
799
|
+
)
|
|
800
|
+
] }),
|
|
801
|
+
f === "idle" && !y && /* @__PURE__ */ o.jsxs("div", { children: [
|
|
802
|
+
/* @__PURE__ */ o.jsx("p", { className: "text-sm text-gray-600 mb-5 leading-relaxed", children: "Upload photos for a precision body scan." }),
|
|
803
|
+
/* @__PURE__ */ o.jsxs("div", { className: "flex gap-3 mb-4", children: [
|
|
804
|
+
/* @__PURE__ */ o.jsx(
|
|
748
805
|
"input",
|
|
749
806
|
{
|
|
750
807
|
type: "number",
|
|
751
808
|
placeholder: "Height (cm)",
|
|
752
|
-
value:
|
|
753
|
-
onChange: (
|
|
809
|
+
value: h,
|
|
810
|
+
onChange: (s) => P(s.target.value),
|
|
754
811
|
className: "w-1/2 p-2.5 border border-gray-300 rounded-lg outline-none focus:border-black text-sm"
|
|
755
812
|
}
|
|
756
813
|
),
|
|
757
|
-
/* @__PURE__ */
|
|
814
|
+
/* @__PURE__ */ o.jsx(
|
|
758
815
|
"input",
|
|
759
816
|
{
|
|
760
817
|
type: "number",
|
|
761
818
|
placeholder: "Weight (kg)",
|
|
762
|
-
value:
|
|
763
|
-
onChange: (
|
|
819
|
+
value: C,
|
|
820
|
+
onChange: (s) => z(s.target.value),
|
|
764
821
|
className: "w-1/2 p-2.5 border border-gray-300 rounded-lg outline-none focus:border-black text-sm"
|
|
765
822
|
}
|
|
766
823
|
)
|
|
767
824
|
] }),
|
|
768
|
-
/* @__PURE__ */
|
|
769
|
-
/* @__PURE__ */
|
|
770
|
-
/* @__PURE__ */
|
|
825
|
+
/* @__PURE__ */ o.jsxs("div", { className: "mb-3", children: [
|
|
826
|
+
/* @__PURE__ */ o.jsx("label", { className: "text-[11px] font-bold text-gray-400 uppercase block mb-1", children: "Front Image" }),
|
|
827
|
+
/* @__PURE__ */ o.jsx(
|
|
771
828
|
"input",
|
|
772
829
|
{
|
|
773
830
|
type: "file",
|
|
774
831
|
accept: "image/*",
|
|
775
|
-
onChange: (
|
|
832
|
+
onChange: (s) => B(s.target.files[0]),
|
|
776
833
|
className: "w-full text-xs file:mr-3 file:py-1.5 file:px-3 file:rounded-md file:border-0 file:text-xs file:bg-gray-100 file:text-black hover:file:bg-gray-200"
|
|
777
834
|
}
|
|
778
835
|
)
|
|
779
836
|
] }),
|
|
780
|
-
/* @__PURE__ */
|
|
781
|
-
/* @__PURE__ */
|
|
782
|
-
/* @__PURE__ */
|
|
837
|
+
/* @__PURE__ */ o.jsxs("div", { className: "mb-5", children: [
|
|
838
|
+
/* @__PURE__ */ o.jsx("label", { className: "text-[11px] font-bold text-gray-400 uppercase block mb-1", children: "Side Image" }),
|
|
839
|
+
/* @__PURE__ */ o.jsx(
|
|
783
840
|
"input",
|
|
784
841
|
{
|
|
785
842
|
type: "file",
|
|
786
843
|
accept: "image/*",
|
|
787
|
-
onChange: (
|
|
844
|
+
onChange: (s) => A(s.target.files[0]),
|
|
788
845
|
className: "w-full text-xs file:mr-3 file:py-1.5 file:px-3 file:rounded-md file:border-0 file:text-xs file:bg-gray-100 file:text-black hover:file:bg-gray-200"
|
|
789
846
|
}
|
|
790
847
|
)
|
|
791
848
|
] }),
|
|
792
|
-
/* @__PURE__ */
|
|
849
|
+
/* @__PURE__ */ o.jsx(
|
|
793
850
|
"button",
|
|
794
851
|
{
|
|
795
|
-
onClick:
|
|
852
|
+
onClick: X,
|
|
796
853
|
className: "w-full bg-black text-white py-3.5 rounded-xl font-bold text-sm hover:opacity-80 transition-opacity",
|
|
797
|
-
children: "
|
|
854
|
+
children: "Save Profile & Scan"
|
|
798
855
|
}
|
|
799
856
|
)
|
|
800
857
|
] })
|
|
@@ -802,5 +859,5 @@ const mr = () => {
|
|
|
802
859
|
] });
|
|
803
860
|
};
|
|
804
861
|
export {
|
|
805
|
-
|
|
862
|
+
_r as StyllarPlugin
|
|
806
863
|
};
|