@uziee/document-scanner 1.1.1 → 1.1.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/index.es.js +391 -332
- package/dist/index.umd.js +10 -10
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
1
|
+
import Ye, { useRef as X, useState as le, useEffect as vr } from "react";
|
|
2
|
+
var Re = { exports: {} }, re = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.min.js
|
|
@@ -9,25 +9,25 @@ var he = { exports: {} }, Q = {};
|
|
|
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
|
|
12
|
+
var $e;
|
|
13
13
|
function pr() {
|
|
14
|
-
if (
|
|
15
|
-
return
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
function
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
for (
|
|
22
|
-
|
|
23
|
-
if (
|
|
24
|
-
for (
|
|
25
|
-
|
|
26
|
-
return { $$typeof: m, type:
|
|
14
|
+
if ($e)
|
|
15
|
+
return re;
|
|
16
|
+
$e = 1;
|
|
17
|
+
var $ = Ye, m = Symbol.for("react.element"), M = Symbol.for("react.fragment"), O = Object.prototype.hasOwnProperty, W = $.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, q = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
|
+
function I(Y, d, V) {
|
|
19
|
+
var x, P = {}, j = null, H = null;
|
|
20
|
+
V !== void 0 && (j = "" + V), d.key !== void 0 && (j = "" + d.key), d.ref !== void 0 && (H = d.ref);
|
|
21
|
+
for (x in d)
|
|
22
|
+
O.call(d, x) && !q.hasOwnProperty(x) && (P[x] = d[x]);
|
|
23
|
+
if (Y && Y.defaultProps)
|
|
24
|
+
for (x in d = Y.defaultProps, d)
|
|
25
|
+
P[x] === void 0 && (P[x] = d[x]);
|
|
26
|
+
return { $$typeof: m, type: Y, key: j, ref: H, props: P, _owner: W.current };
|
|
27
27
|
}
|
|
28
|
-
return
|
|
28
|
+
return re.Fragment = M, re.jsx = I, re.jsxs = I, re;
|
|
29
29
|
}
|
|
30
|
-
var
|
|
30
|
+
var te = {};
|
|
31
31
|
/**
|
|
32
32
|
* @license React
|
|
33
33
|
* react-jsx-runtime.development.js
|
|
@@ -40,88 +40,88 @@ var ee = {};
|
|
|
40
40
|
var Me;
|
|
41
41
|
function hr() {
|
|
42
42
|
return Me || (Me = 1, {}.NODE_ENV !== "production" && function() {
|
|
43
|
-
var
|
|
44
|
-
function
|
|
43
|
+
var $ = Ye, m = Symbol.for("react.element"), M = Symbol.for("react.portal"), O = Symbol.for("react.fragment"), W = Symbol.for("react.strict_mode"), q = Symbol.for("react.profiler"), I = Symbol.for("react.provider"), Y = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), V = Symbol.for("react.suspense"), x = Symbol.for("react.suspense_list"), P = Symbol.for("react.memo"), j = Symbol.for("react.lazy"), H = Symbol.for("react.offscreen"), ne = Symbol.iterator, ce = "@@iterator";
|
|
44
|
+
function ue(e) {
|
|
45
45
|
if (e === null || typeof e != "object")
|
|
46
46
|
return null;
|
|
47
|
-
var r =
|
|
47
|
+
var r = ne && e[ne] || e[ce];
|
|
48
48
|
return typeof r == "function" ? r : null;
|
|
49
49
|
}
|
|
50
|
-
var
|
|
51
|
-
function
|
|
50
|
+
var B = $.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
51
|
+
function R(e) {
|
|
52
52
|
{
|
|
53
53
|
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
54
54
|
t[n - 1] = arguments[n];
|
|
55
|
-
|
|
55
|
+
c("error", e, t);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function c(e, r, t) {
|
|
59
59
|
{
|
|
60
|
-
var n =
|
|
61
|
-
|
|
62
|
-
var
|
|
60
|
+
var n = B.ReactDebugCurrentFrame, o = n.getStackAddendum();
|
|
61
|
+
o !== "" && (r += "%s", t = t.concat([o]));
|
|
62
|
+
var u = t.map(function(i) {
|
|
63
63
|
return String(i);
|
|
64
64
|
});
|
|
65
|
-
|
|
65
|
+
u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
var
|
|
69
|
-
|
|
70
|
-
function
|
|
71
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
68
|
+
var v = !1, l = !1, s = !1, T = !1, k = !1, g;
|
|
69
|
+
g = Symbol.for("react.module.reference");
|
|
70
|
+
function _(e) {
|
|
71
|
+
return !!(typeof e == "string" || typeof e == "function" || e === O || e === q || k || e === W || e === V || e === x || T || e === H || v || l || s || typeof e == "object" && e !== null && (e.$$typeof === j || e.$$typeof === P || e.$$typeof === I || e.$$typeof === Y || e.$$typeof === d || // This needs to include all possible module reference object
|
|
72
72
|
// types supported by any Flight configuration anywhere since
|
|
73
73
|
// we don't know which Flight build this will end up being used
|
|
74
74
|
// with.
|
|
75
|
-
e.$$typeof ===
|
|
75
|
+
e.$$typeof === g || e.getModuleId !== void 0));
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function E(e, r, t) {
|
|
78
78
|
var n = e.displayName;
|
|
79
79
|
if (n)
|
|
80
80
|
return n;
|
|
81
|
-
var
|
|
82
|
-
return
|
|
81
|
+
var o = r.displayName || r.name || "";
|
|
82
|
+
return o !== "" ? t + "(" + o + ")" : t;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function U(e) {
|
|
85
85
|
return e.displayName || "Context";
|
|
86
86
|
}
|
|
87
87
|
function b(e) {
|
|
88
88
|
if (e == null)
|
|
89
89
|
return null;
|
|
90
|
-
if (typeof e.tag == "number" &&
|
|
90
|
+
if (typeof e.tag == "number" && R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
91
91
|
return e.displayName || e.name || null;
|
|
92
92
|
if (typeof e == "string")
|
|
93
93
|
return e;
|
|
94
94
|
switch (e) {
|
|
95
|
-
case
|
|
95
|
+
case O:
|
|
96
96
|
return "Fragment";
|
|
97
|
-
case
|
|
97
|
+
case M:
|
|
98
98
|
return "Portal";
|
|
99
|
-
case
|
|
99
|
+
case q:
|
|
100
100
|
return "Profiler";
|
|
101
101
|
case W:
|
|
102
102
|
return "StrictMode";
|
|
103
|
-
case
|
|
103
|
+
case V:
|
|
104
104
|
return "Suspense";
|
|
105
|
-
case
|
|
105
|
+
case x:
|
|
106
106
|
return "SuspenseList";
|
|
107
107
|
}
|
|
108
108
|
if (typeof e == "object")
|
|
109
109
|
switch (e.$$typeof) {
|
|
110
|
-
case
|
|
110
|
+
case Y:
|
|
111
111
|
var r = e;
|
|
112
|
-
return
|
|
113
|
-
case
|
|
112
|
+
return U(r) + ".Consumer";
|
|
113
|
+
case I:
|
|
114
114
|
var t = e;
|
|
115
|
-
return
|
|
116
|
-
case
|
|
117
|
-
return
|
|
118
|
-
case
|
|
115
|
+
return U(t._context) + ".Provider";
|
|
116
|
+
case d:
|
|
117
|
+
return E(e, e.render, "ForwardRef");
|
|
118
|
+
case P:
|
|
119
119
|
var n = e.displayName || null;
|
|
120
120
|
return n !== null ? n : b(e.type) || "Memo";
|
|
121
|
-
case
|
|
122
|
-
var
|
|
121
|
+
case j: {
|
|
122
|
+
var o = e, u = o._payload, i = o._init;
|
|
123
123
|
try {
|
|
124
|
-
return b(i(
|
|
124
|
+
return b(i(u));
|
|
125
125
|
} catch {
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
@@ -129,14 +129,14 @@ function hr() {
|
|
|
129
129
|
}
|
|
130
130
|
return null;
|
|
131
131
|
}
|
|
132
|
-
var
|
|
132
|
+
var D = Object.assign, w = 0, p, C, z, L, N, Z, fe;
|
|
133
133
|
function Ee() {
|
|
134
134
|
}
|
|
135
135
|
Ee.__reactDisabledLog = !0;
|
|
136
|
-
function
|
|
136
|
+
function Ue() {
|
|
137
137
|
{
|
|
138
|
-
if (
|
|
139
|
-
|
|
138
|
+
if (w === 0) {
|
|
139
|
+
p = console.log, C = console.info, z = console.warn, L = console.error, N = console.group, Z = console.groupCollapsed, fe = console.groupEnd;
|
|
140
140
|
var e = {
|
|
141
141
|
configurable: !0,
|
|
142
142
|
enumerable: !0,
|
|
@@ -153,77 +153,77 @@ function hr() {
|
|
|
153
153
|
groupEnd: e
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
|
-
|
|
156
|
+
w++;
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function Le() {
|
|
160
160
|
{
|
|
161
|
-
if (
|
|
161
|
+
if (w--, w === 0) {
|
|
162
162
|
var e = {
|
|
163
163
|
configurable: !0,
|
|
164
164
|
enumerable: !0,
|
|
165
165
|
writable: !0
|
|
166
166
|
};
|
|
167
167
|
Object.defineProperties(console, {
|
|
168
|
-
log:
|
|
169
|
-
value:
|
|
168
|
+
log: D({}, e, {
|
|
169
|
+
value: p
|
|
170
170
|
}),
|
|
171
|
-
info:
|
|
172
|
-
value:
|
|
171
|
+
info: D({}, e, {
|
|
172
|
+
value: C
|
|
173
173
|
}),
|
|
174
|
-
warn:
|
|
175
|
-
value:
|
|
174
|
+
warn: D({}, e, {
|
|
175
|
+
value: z
|
|
176
176
|
}),
|
|
177
|
-
error:
|
|
178
|
-
value:
|
|
177
|
+
error: D({}, e, {
|
|
178
|
+
value: L
|
|
179
179
|
}),
|
|
180
|
-
group:
|
|
181
|
-
value:
|
|
180
|
+
group: D({}, e, {
|
|
181
|
+
value: N
|
|
182
182
|
}),
|
|
183
|
-
groupCollapsed:
|
|
184
|
-
value:
|
|
183
|
+
groupCollapsed: D({}, e, {
|
|
184
|
+
value: Z
|
|
185
185
|
}),
|
|
186
|
-
groupEnd:
|
|
187
|
-
value:
|
|
186
|
+
groupEnd: D({}, e, {
|
|
187
|
+
value: fe
|
|
188
188
|
})
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
|
-
|
|
191
|
+
w < 0 && R("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
-
var
|
|
195
|
-
function
|
|
194
|
+
var de = B.ReactCurrentDispatcher, ve;
|
|
195
|
+
function ae(e, r, t) {
|
|
196
196
|
{
|
|
197
|
-
if (
|
|
197
|
+
if (ve === void 0)
|
|
198
198
|
try {
|
|
199
199
|
throw Error();
|
|
200
|
-
} catch (
|
|
201
|
-
var n =
|
|
202
|
-
|
|
200
|
+
} catch (o) {
|
|
201
|
+
var n = o.stack.trim().match(/\n( *(at )?)/);
|
|
202
|
+
ve = n && n[1] || "";
|
|
203
203
|
}
|
|
204
204
|
return `
|
|
205
|
-
` +
|
|
205
|
+
` + ve + e;
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
var
|
|
208
|
+
var pe = !1, ie;
|
|
209
209
|
{
|
|
210
|
-
var
|
|
211
|
-
|
|
210
|
+
var Ne = typeof WeakMap == "function" ? WeakMap : Map;
|
|
211
|
+
ie = new Ne();
|
|
212
212
|
}
|
|
213
213
|
function _e(e, r) {
|
|
214
|
-
if (!e ||
|
|
214
|
+
if (!e || pe)
|
|
215
215
|
return "";
|
|
216
216
|
{
|
|
217
|
-
var t =
|
|
217
|
+
var t = ie.get(e);
|
|
218
218
|
if (t !== void 0)
|
|
219
219
|
return t;
|
|
220
220
|
}
|
|
221
221
|
var n;
|
|
222
|
-
|
|
223
|
-
var
|
|
222
|
+
pe = !0;
|
|
223
|
+
var o = Error.prepareStackTrace;
|
|
224
224
|
Error.prepareStackTrace = void 0;
|
|
225
|
-
var
|
|
226
|
-
|
|
225
|
+
var u;
|
|
226
|
+
u = de.current, de.current = null, Ue();
|
|
227
227
|
try {
|
|
228
228
|
if (r) {
|
|
229
229
|
var i = function() {
|
|
@@ -236,147 +236,147 @@ function hr() {
|
|
|
236
236
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
237
237
|
try {
|
|
238
238
|
Reflect.construct(i, []);
|
|
239
|
-
} catch (
|
|
240
|
-
n =
|
|
239
|
+
} catch (F) {
|
|
240
|
+
n = F;
|
|
241
241
|
}
|
|
242
242
|
Reflect.construct(e, [], i);
|
|
243
243
|
} else {
|
|
244
244
|
try {
|
|
245
245
|
i.call();
|
|
246
|
-
} catch (
|
|
247
|
-
n =
|
|
246
|
+
} catch (F) {
|
|
247
|
+
n = F;
|
|
248
248
|
}
|
|
249
249
|
e.call(i.prototype);
|
|
250
250
|
}
|
|
251
251
|
} else {
|
|
252
252
|
try {
|
|
253
253
|
throw Error();
|
|
254
|
-
} catch (
|
|
255
|
-
n =
|
|
254
|
+
} catch (F) {
|
|
255
|
+
n = F;
|
|
256
256
|
}
|
|
257
257
|
e();
|
|
258
258
|
}
|
|
259
|
-
} catch (
|
|
260
|
-
if (
|
|
261
|
-
for (var
|
|
262
|
-
`),
|
|
263
|
-
`),
|
|
264
|
-
|
|
265
|
-
for (;
|
|
266
|
-
if (
|
|
267
|
-
if (
|
|
259
|
+
} catch (F) {
|
|
260
|
+
if (F && n && typeof F.stack == "string") {
|
|
261
|
+
for (var a = F.stack.split(`
|
|
262
|
+
`), S = n.stack.split(`
|
|
263
|
+
`), h = a.length - 1, y = S.length - 1; h >= 1 && y >= 0 && a[h] !== S[y]; )
|
|
264
|
+
y--;
|
|
265
|
+
for (; h >= 1 && y >= 0; h--, y--)
|
|
266
|
+
if (a[h] !== S[y]) {
|
|
267
|
+
if (h !== 1 || y !== 1)
|
|
268
268
|
do
|
|
269
|
-
if (
|
|
270
|
-
var
|
|
271
|
-
` +
|
|
272
|
-
return e.displayName &&
|
|
269
|
+
if (h--, y--, y < 0 || a[h] !== S[y]) {
|
|
270
|
+
var A = `
|
|
271
|
+
` + a[h].replace(" at new ", " at ");
|
|
272
|
+
return e.displayName && A.includes("<anonymous>") && (A = A.replace("<anonymous>", e.displayName)), typeof e == "function" && ie.set(e, A), A;
|
|
273
273
|
}
|
|
274
|
-
while (
|
|
274
|
+
while (h >= 1 && y >= 0);
|
|
275
275
|
break;
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
} finally {
|
|
279
|
-
|
|
279
|
+
pe = !1, de.current = u, Le(), Error.prepareStackTrace = o;
|
|
280
280
|
}
|
|
281
|
-
var
|
|
282
|
-
return typeof e == "function" &&
|
|
281
|
+
var G = e ? e.displayName || e.name : "", J = G ? ae(G) : "";
|
|
282
|
+
return typeof e == "function" && ie.set(e, J), J;
|
|
283
283
|
}
|
|
284
|
-
function
|
|
284
|
+
function Ve(e, r, t) {
|
|
285
285
|
return _e(e, !1);
|
|
286
286
|
}
|
|
287
287
|
function Be(e) {
|
|
288
288
|
var r = e.prototype;
|
|
289
289
|
return !!(r && r.isReactComponent);
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function oe(e, r, t) {
|
|
292
292
|
if (e == null)
|
|
293
293
|
return "";
|
|
294
294
|
if (typeof e == "function")
|
|
295
295
|
return _e(e, Be(e));
|
|
296
296
|
if (typeof e == "string")
|
|
297
|
-
return
|
|
297
|
+
return ae(e);
|
|
298
298
|
switch (e) {
|
|
299
|
-
case
|
|
300
|
-
return
|
|
301
|
-
case
|
|
302
|
-
return
|
|
299
|
+
case V:
|
|
300
|
+
return ae("Suspense");
|
|
301
|
+
case x:
|
|
302
|
+
return ae("SuspenseList");
|
|
303
303
|
}
|
|
304
304
|
if (typeof e == "object")
|
|
305
305
|
switch (e.$$typeof) {
|
|
306
|
-
case
|
|
307
|
-
return
|
|
308
|
-
case
|
|
309
|
-
return
|
|
310
|
-
case
|
|
311
|
-
var n = e,
|
|
306
|
+
case d:
|
|
307
|
+
return Ve(e.render);
|
|
308
|
+
case P:
|
|
309
|
+
return oe(e.type, r, t);
|
|
310
|
+
case j: {
|
|
311
|
+
var n = e, o = n._payload, u = n._init;
|
|
312
312
|
try {
|
|
313
|
-
return
|
|
313
|
+
return oe(u(o), r, t);
|
|
314
314
|
} catch {
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
return "";
|
|
319
319
|
}
|
|
320
|
-
var
|
|
321
|
-
function
|
|
320
|
+
var Q = Object.prototype.hasOwnProperty, we = {}, Ce = B.ReactDebugCurrentFrame;
|
|
321
|
+
function se(e) {
|
|
322
322
|
if (e) {
|
|
323
|
-
var r = e._owner, t =
|
|
323
|
+
var r = e._owner, t = oe(e.type, e._source, r ? r.type : null);
|
|
324
324
|
Ce.setExtraStackFrame(t);
|
|
325
325
|
} else
|
|
326
326
|
Ce.setExtraStackFrame(null);
|
|
327
327
|
}
|
|
328
|
-
function
|
|
328
|
+
function ze(e, r, t, n, o) {
|
|
329
329
|
{
|
|
330
|
-
var
|
|
330
|
+
var u = Function.call.bind(Q);
|
|
331
331
|
for (var i in e)
|
|
332
|
-
if (
|
|
333
|
-
var
|
|
332
|
+
if (u(e, i)) {
|
|
333
|
+
var a = void 0;
|
|
334
334
|
try {
|
|
335
335
|
if (typeof e[i] != "function") {
|
|
336
|
-
var
|
|
337
|
-
throw
|
|
336
|
+
var S = 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`.");
|
|
337
|
+
throw S.name = "Invariant Violation", S;
|
|
338
338
|
}
|
|
339
|
-
|
|
340
|
-
} catch (
|
|
341
|
-
|
|
339
|
+
a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
340
|
+
} catch (h) {
|
|
341
|
+
a = h;
|
|
342
342
|
}
|
|
343
|
-
|
|
343
|
+
a && !(a instanceof Error) && (se(o), R("%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), se(null)), a instanceof Error && !(a.message in we) && (we[a.message] = !0, se(o), R("Failed %s type: %s", t, a.message), se(null));
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
|
-
var
|
|
348
|
-
function
|
|
349
|
-
return
|
|
347
|
+
var qe = Array.isArray;
|
|
348
|
+
function he(e) {
|
|
349
|
+
return qe(e);
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function Je(e) {
|
|
352
352
|
{
|
|
353
353
|
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
354
354
|
return t;
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
|
-
function
|
|
357
|
+
function He(e) {
|
|
358
358
|
try {
|
|
359
|
-
return
|
|
359
|
+
return je(e), !1;
|
|
360
360
|
} catch {
|
|
361
361
|
return !0;
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
|
-
function
|
|
364
|
+
function je(e) {
|
|
365
365
|
return "" + e;
|
|
366
366
|
}
|
|
367
367
|
function Te(e) {
|
|
368
|
-
if (
|
|
369
|
-
return
|
|
368
|
+
if (He(e))
|
|
369
|
+
return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(e)), je(e);
|
|
370
370
|
}
|
|
371
|
-
var
|
|
371
|
+
var ee = B.ReactCurrentOwner, Ke = {
|
|
372
372
|
key: !0,
|
|
373
373
|
ref: !0,
|
|
374
374
|
__self: !0,
|
|
375
375
|
__source: !0
|
|
376
|
-
}, Se,
|
|
377
|
-
|
|
376
|
+
}, Se, Oe, ge;
|
|
377
|
+
ge = {};
|
|
378
378
|
function Ge(e) {
|
|
379
|
-
if (
|
|
379
|
+
if (Q.call(e, "ref")) {
|
|
380
380
|
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
381
381
|
if (r && r.isReactWarning)
|
|
382
382
|
return !1;
|
|
@@ -384,7 +384,7 @@ function hr() {
|
|
|
384
384
|
return e.ref !== void 0;
|
|
385
385
|
}
|
|
386
386
|
function Xe(e) {
|
|
387
|
-
if (
|
|
387
|
+
if (Q.call(e, "key")) {
|
|
388
388
|
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
389
389
|
if (r && r.isReactWarning)
|
|
390
390
|
return !1;
|
|
@@ -392,15 +392,15 @@ function hr() {
|
|
|
392
392
|
return e.key !== void 0;
|
|
393
393
|
}
|
|
394
394
|
function Ze(e, r) {
|
|
395
|
-
if (typeof e.ref == "string" &&
|
|
396
|
-
var t = b(
|
|
397
|
-
|
|
395
|
+
if (typeof e.ref == "string" && ee.current && r && ee.current.stateNode !== r) {
|
|
396
|
+
var t = b(ee.current.type);
|
|
397
|
+
ge[t] || (R('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', b(ee.current.type), e.ref), ge[t] = !0);
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
400
|
function Qe(e, r) {
|
|
401
401
|
{
|
|
402
402
|
var t = function() {
|
|
403
|
-
Se || (Se = !0,
|
|
403
|
+
Se || (Se = !0, R("%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));
|
|
404
404
|
};
|
|
405
405
|
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
406
406
|
get: t,
|
|
@@ -411,7 +411,7 @@ function hr() {
|
|
|
411
411
|
function er(e, r) {
|
|
412
412
|
{
|
|
413
413
|
var t = function() {
|
|
414
|
-
|
|
414
|
+
Oe || (Oe = !0, R("%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));
|
|
415
415
|
};
|
|
416
416
|
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
417
417
|
get: t,
|
|
@@ -419,8 +419,8 @@ function hr() {
|
|
|
419
419
|
});
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
|
-
var rr = function(e, r, t, n,
|
|
423
|
-
var
|
|
422
|
+
var rr = function(e, r, t, n, o, u, i) {
|
|
423
|
+
var a = {
|
|
424
424
|
// This tag allows us to uniquely identify this as a React Element
|
|
425
425
|
$$typeof: m,
|
|
426
426
|
// Built-in properties that belong on the element
|
|
@@ -429,60 +429,60 @@ function hr() {
|
|
|
429
429
|
ref: t,
|
|
430
430
|
props: i,
|
|
431
431
|
// Record the component responsible for creating this element.
|
|
432
|
-
_owner:
|
|
432
|
+
_owner: u
|
|
433
433
|
};
|
|
434
|
-
return
|
|
434
|
+
return a._store = {}, Object.defineProperty(a._store, "validated", {
|
|
435
435
|
configurable: !1,
|
|
436
436
|
enumerable: !1,
|
|
437
437
|
writable: !0,
|
|
438
438
|
value: !1
|
|
439
|
-
}), Object.defineProperty(
|
|
439
|
+
}), Object.defineProperty(a, "_self", {
|
|
440
440
|
configurable: !1,
|
|
441
441
|
enumerable: !1,
|
|
442
442
|
writable: !1,
|
|
443
443
|
value: n
|
|
444
|
-
}), Object.defineProperty(
|
|
444
|
+
}), Object.defineProperty(a, "_source", {
|
|
445
445
|
configurable: !1,
|
|
446
446
|
enumerable: !1,
|
|
447
447
|
writable: !1,
|
|
448
|
-
value:
|
|
449
|
-
}), Object.freeze && (Object.freeze(
|
|
448
|
+
value: o
|
|
449
|
+
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
450
450
|
};
|
|
451
|
-
function tr(e, r, t, n,
|
|
451
|
+
function tr(e, r, t, n, o) {
|
|
452
452
|
{
|
|
453
|
-
var
|
|
454
|
-
t !== void 0 && (Te(t),
|
|
455
|
-
for (
|
|
456
|
-
|
|
453
|
+
var u, i = {}, a = null, S = null;
|
|
454
|
+
t !== void 0 && (Te(t), a = "" + t), Xe(r) && (Te(r.key), a = "" + r.key), Ge(r) && (S = r.ref, Ze(r, o));
|
|
455
|
+
for (u in r)
|
|
456
|
+
Q.call(r, u) && !Ke.hasOwnProperty(u) && (i[u] = r[u]);
|
|
457
457
|
if (e && e.defaultProps) {
|
|
458
|
-
var
|
|
459
|
-
for (
|
|
460
|
-
i[
|
|
458
|
+
var h = e.defaultProps;
|
|
459
|
+
for (u in h)
|
|
460
|
+
i[u] === void 0 && (i[u] = h[u]);
|
|
461
461
|
}
|
|
462
|
-
if (
|
|
463
|
-
var
|
|
464
|
-
|
|
462
|
+
if (a || S) {
|
|
463
|
+
var y = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
464
|
+
a && Qe(i, y), S && er(i, y);
|
|
465
465
|
}
|
|
466
|
-
return rr(e,
|
|
466
|
+
return rr(e, a, S, o, n, ee.current, i);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
var
|
|
470
|
-
function
|
|
469
|
+
var be = B.ReactCurrentOwner, Pe = B.ReactDebugCurrentFrame;
|
|
470
|
+
function K(e) {
|
|
471
471
|
if (e) {
|
|
472
|
-
var r = e._owner, t =
|
|
473
|
-
|
|
472
|
+
var r = e._owner, t = oe(e.type, e._source, r ? r.type : null);
|
|
473
|
+
Pe.setExtraStackFrame(t);
|
|
474
474
|
} else
|
|
475
|
-
|
|
475
|
+
Pe.setExtraStackFrame(null);
|
|
476
476
|
}
|
|
477
|
-
var
|
|
478
|
-
|
|
479
|
-
function
|
|
477
|
+
var ye;
|
|
478
|
+
ye = !1;
|
|
479
|
+
function me(e) {
|
|
480
480
|
return typeof e == "object" && e !== null && e.$$typeof === m;
|
|
481
481
|
}
|
|
482
|
-
function
|
|
482
|
+
function ke() {
|
|
483
483
|
{
|
|
484
|
-
if (
|
|
485
|
-
var e = b(
|
|
484
|
+
if (be.current) {
|
|
485
|
+
var e = b(be.current.type);
|
|
486
486
|
if (e)
|
|
487
487
|
return `
|
|
488
488
|
|
|
@@ -502,10 +502,10 @@ Check your code at ` + r + ":" + t + ".";
|
|
|
502
502
|
return "";
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
|
-
var
|
|
505
|
+
var De = {};
|
|
506
506
|
function ar(e) {
|
|
507
507
|
{
|
|
508
|
-
var r =
|
|
508
|
+
var r = ke();
|
|
509
509
|
if (!r) {
|
|
510
510
|
var t = typeof e == "string" ? e : e.displayName || e.name;
|
|
511
511
|
t && (r = `
|
|
@@ -515,39 +515,39 @@ Check the top-level render call using <` + t + ">.");
|
|
|
515
515
|
return r;
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
|
-
function
|
|
518
|
+
function Fe(e, r) {
|
|
519
519
|
{
|
|
520
520
|
if (!e._store || e._store.validated || e.key != null)
|
|
521
521
|
return;
|
|
522
522
|
e._store.validated = !0;
|
|
523
523
|
var t = ar(r);
|
|
524
|
-
if (
|
|
524
|
+
if (De[t])
|
|
525
525
|
return;
|
|
526
|
-
|
|
526
|
+
De[t] = !0;
|
|
527
527
|
var n = "";
|
|
528
|
-
e && e._owner && e._owner !==
|
|
528
|
+
e && e._owner && e._owner !== be.current && (n = " It was passed a child from " + b(e._owner.type) + "."), K(e), R('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), K(null);
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
|
-
function
|
|
531
|
+
function Ie(e, r) {
|
|
532
532
|
{
|
|
533
533
|
if (typeof e != "object")
|
|
534
534
|
return;
|
|
535
|
-
if (
|
|
535
|
+
if (he(e))
|
|
536
536
|
for (var t = 0; t < e.length; t++) {
|
|
537
537
|
var n = e[t];
|
|
538
|
-
|
|
538
|
+
me(n) && Fe(n, r);
|
|
539
539
|
}
|
|
540
|
-
else if (
|
|
540
|
+
else if (me(e))
|
|
541
541
|
e._store && (e._store.validated = !0);
|
|
542
542
|
else if (e) {
|
|
543
|
-
var
|
|
544
|
-
if (typeof
|
|
545
|
-
for (var
|
|
546
|
-
|
|
543
|
+
var o = ue(e);
|
|
544
|
+
if (typeof o == "function" && o !== e.entries)
|
|
545
|
+
for (var u = o.call(e), i; !(i = u.next()).done; )
|
|
546
|
+
me(i.value) && Fe(i.value, r);
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
|
-
function
|
|
550
|
+
function ir(e) {
|
|
551
551
|
{
|
|
552
552
|
var r = e.type;
|
|
553
553
|
if (r == null || typeof r == "string")
|
|
@@ -555,194 +555,253 @@ Check the top-level render call using <` + t + ">.");
|
|
|
555
555
|
var t;
|
|
556
556
|
if (typeof r == "function")
|
|
557
557
|
t = r.propTypes;
|
|
558
|
-
else if (typeof r == "object" && (r.$$typeof ===
|
|
558
|
+
else if (typeof r == "object" && (r.$$typeof === d || // Note: Memo only checks outer props here.
|
|
559
559
|
// Inner props are checked in the reconciler.
|
|
560
|
-
r.$$typeof ===
|
|
560
|
+
r.$$typeof === P))
|
|
561
561
|
t = r.propTypes;
|
|
562
562
|
else
|
|
563
563
|
return;
|
|
564
564
|
if (t) {
|
|
565
565
|
var n = b(r);
|
|
566
|
-
|
|
567
|
-
} else if (r.PropTypes !== void 0 && !
|
|
568
|
-
|
|
569
|
-
var
|
|
570
|
-
|
|
566
|
+
ze(t, e.props, "prop", n, e);
|
|
567
|
+
} else if (r.PropTypes !== void 0 && !ye) {
|
|
568
|
+
ye = !0;
|
|
569
|
+
var o = b(r);
|
|
570
|
+
R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown");
|
|
571
571
|
}
|
|
572
|
-
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved &&
|
|
572
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
|
-
function
|
|
575
|
+
function or(e) {
|
|
576
576
|
{
|
|
577
577
|
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
578
578
|
var n = r[t];
|
|
579
579
|
if (n !== "children" && n !== "key") {
|
|
580
|
-
|
|
580
|
+
K(e), R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), K(null);
|
|
581
581
|
break;
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
|
-
e.ref !== null && (
|
|
584
|
+
e.ref !== null && (K(e), R("Invalid attribute `ref` supplied to `React.Fragment`."), K(null));
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
587
|
var Ae = {};
|
|
588
|
-
function
|
|
588
|
+
function We(e, r, t, n, o, u) {
|
|
589
589
|
{
|
|
590
|
-
var i =
|
|
590
|
+
var i = _(e);
|
|
591
591
|
if (!i) {
|
|
592
|
-
var
|
|
593
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (
|
|
594
|
-
var
|
|
595
|
-
|
|
596
|
-
var
|
|
597
|
-
e === null ?
|
|
592
|
+
var a = "";
|
|
593
|
+
(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.");
|
|
594
|
+
var S = nr(o);
|
|
595
|
+
S ? a += S : a += ke();
|
|
596
|
+
var h;
|
|
597
|
+
e === null ? h = "null" : he(e) ? h = "array" : e !== void 0 && e.$$typeof === m ? (h = "<" + (b(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : h = typeof e, R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", h, a);
|
|
598
598
|
}
|
|
599
|
-
var
|
|
600
|
-
if (
|
|
601
|
-
return
|
|
599
|
+
var y = tr(e, r, t, o, u);
|
|
600
|
+
if (y == null)
|
|
601
|
+
return y;
|
|
602
602
|
if (i) {
|
|
603
|
-
var
|
|
604
|
-
if (
|
|
603
|
+
var A = r.children;
|
|
604
|
+
if (A !== void 0)
|
|
605
605
|
if (n)
|
|
606
|
-
if (
|
|
607
|
-
for (var
|
|
608
|
-
|
|
609
|
-
Object.freeze && Object.freeze(
|
|
606
|
+
if (he(A)) {
|
|
607
|
+
for (var G = 0; G < A.length; G++)
|
|
608
|
+
Ie(A[G], e);
|
|
609
|
+
Object.freeze && Object.freeze(A);
|
|
610
610
|
} else
|
|
611
|
-
|
|
611
|
+
R("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
612
612
|
else
|
|
613
|
-
|
|
613
|
+
Ie(A, e);
|
|
614
614
|
}
|
|
615
|
-
if (
|
|
616
|
-
var
|
|
615
|
+
if (Q.call(r, "key")) {
|
|
616
|
+
var J = b(e), F = Object.keys(r).filter(function(dr) {
|
|
617
617
|
return dr !== "key";
|
|
618
|
-
}),
|
|
619
|
-
if (!Ae[
|
|
620
|
-
var fr =
|
|
621
|
-
|
|
618
|
+
}), xe = F.length > 0 ? "{key: someKey, " + F.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
619
|
+
if (!Ae[J + xe]) {
|
|
620
|
+
var fr = F.length > 0 ? "{" + F.join(": ..., ") + ": ...}" : "{}";
|
|
621
|
+
R(`A props object containing a "key" prop is being spread into JSX:
|
|
622
622
|
let props = %s;
|
|
623
623
|
<%s {...props} />
|
|
624
624
|
React keys must be passed directly to JSX without using spread:
|
|
625
625
|
let props = %s;
|
|
626
|
-
<%s key={someKey} {...props} />`,
|
|
626
|
+
<%s key={someKey} {...props} />`, xe, J, fr, J), Ae[J + xe] = !0;
|
|
627
627
|
}
|
|
628
628
|
}
|
|
629
|
-
return e ===
|
|
629
|
+
return e === O ? or(y) : ir(y), y;
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
632
|
function sr(e, r, t) {
|
|
633
|
-
return
|
|
633
|
+
return We(e, r, t, !0);
|
|
634
634
|
}
|
|
635
|
-
function
|
|
636
|
-
return
|
|
635
|
+
function lr(e, r, t) {
|
|
636
|
+
return We(e, r, t, !1);
|
|
637
637
|
}
|
|
638
|
-
var
|
|
639
|
-
|
|
640
|
-
}()),
|
|
638
|
+
var cr = lr, ur = sr;
|
|
639
|
+
te.Fragment = O, te.jsx = cr, te.jsxs = ur;
|
|
640
|
+
}()), te;
|
|
641
641
|
}
|
|
642
|
-
({}).NODE_ENV === "production" ?
|
|
643
|
-
var
|
|
644
|
-
const gr = ({ onCapture:
|
|
645
|
-
const m =
|
|
642
|
+
({}).NODE_ENV === "production" ? Re.exports = pr() : Re.exports = hr();
|
|
643
|
+
var f = Re.exports;
|
|
644
|
+
const gr = ({ onCapture: $ }) => {
|
|
645
|
+
const m = X(null), M = X(null), O = X(null), [W, q] = le(!1), [I, Y] = le(null), [d, V] = le([]), x = X(null), P = X([]), j = X(0);
|
|
646
646
|
vr(() => {
|
|
647
|
-
|
|
648
|
-
let
|
|
649
|
-
async function
|
|
647
|
+
O.current || (O.current = document.createElement("canvas"));
|
|
648
|
+
let c = null;
|
|
649
|
+
async function v() {
|
|
650
650
|
try {
|
|
651
651
|
const s = await navigator.mediaDevices.getUserMedia({
|
|
652
652
|
video: { facingMode: "environment", width: { ideal: 1920 } }
|
|
653
653
|
});
|
|
654
|
-
m.current && (m.current.srcObject = s, m.current.play(),
|
|
654
|
+
m.current && (m.current.srcObject = s, m.current.play(), c = requestAnimationFrame(l));
|
|
655
655
|
} catch (s) {
|
|
656
656
|
console.error("Camera access error:", s);
|
|
657
657
|
}
|
|
658
658
|
}
|
|
659
|
-
function
|
|
659
|
+
function l() {
|
|
660
660
|
var s;
|
|
661
661
|
if (((s = m.current) == null ? void 0 : s.readyState) >= 2) {
|
|
662
|
-
const
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
662
|
+
const T = m.current, k = M.current;
|
|
663
|
+
if (!k)
|
|
664
|
+
return;
|
|
665
|
+
const g = k.getContext("2d");
|
|
666
|
+
k.width !== T.videoWidth && (k.width = T.videoWidth, k.height = T.videoHeight), g.drawImage(T, 0, 0);
|
|
667
|
+
const _ = ne(T);
|
|
668
|
+
if (_) {
|
|
669
|
+
x.current && H(_, x.current) ? j.current = Math.min(15, j.current + 1) : j.current = 0, P.current.push(_), P.current.length > 10 && P.current.shift();
|
|
670
|
+
const E = ce(P.current);
|
|
671
|
+
x.current = E, j.current > 5 && (q(!0), Y(E));
|
|
672
|
+
} else
|
|
673
|
+
j.current = Math.max(0, j.current - 2), j.current === 0 && (x.current = null, q(!1), Y(null));
|
|
666
674
|
}
|
|
667
|
-
|
|
668
|
-
}
|
|
669
|
-
return
|
|
670
|
-
}, [
|
|
671
|
-
const
|
|
672
|
-
const
|
|
673
|
-
|
|
674
|
-
const
|
|
675
|
-
let
|
|
676
|
-
for (let
|
|
677
|
-
for (let
|
|
678
|
-
const
|
|
679
|
-
|
|
675
|
+
c = requestAnimationFrame(l);
|
|
676
|
+
}
|
|
677
|
+
return v(), () => cancelAnimationFrame(c);
|
|
678
|
+
}, []);
|
|
679
|
+
const H = (c, v) => Math.abs(c.tl[0] - v.tl[0]) + Math.abs(c.tl[1] - v.tl[1]) < 50, ne = (c) => {
|
|
680
|
+
const l = Math.floor(c.videoWidth * 0.15), s = Math.floor(c.videoHeight * 0.15), T = O.current.getContext("2d");
|
|
681
|
+
O.current.width = l, O.current.height = s, T.drawImage(c, 0, 0, l, s);
|
|
682
|
+
const k = T.getImageData(0, 0, l, s).data;
|
|
683
|
+
let g = [l, s], _ = [0, s], E = [l, 0], U = [0, 0], b = 0;
|
|
684
|
+
for (let p = 10; p < s - 10; p++)
|
|
685
|
+
for (let C = 10; C < l - 10; C++) {
|
|
686
|
+
const z = (p * l + C) * 4, L = k[z], N = k[z + 1], Z = k[z + 2];
|
|
687
|
+
L > 180 && N > 180 && Z > 170 && Math.abs(L - N) < 25 && Math.abs(N - Z) < 25 && (b++, C + p < g[0] + g[1] && (g = [C, p]), C - p > _[0] - _[1] && (_ = [C, p]), C - p < E[0] - E[1] && (E = [C, p]), C + p > U[0] + U[1] && (U = [C, p]));
|
|
680
688
|
}
|
|
681
|
-
const
|
|
682
|
-
return
|
|
683
|
-
tl: [
|
|
684
|
-
tr: [
|
|
685
|
-
bl: [
|
|
686
|
-
br: [
|
|
689
|
+
const D = _[0] - g[0], w = E[1] - g[1];
|
|
690
|
+
return b < l * s * 0.08 || D < l * 0.3 || w < s * 0.3 ? null : {
|
|
691
|
+
tl: [g[0] / 0.15, g[1] / 0.15],
|
|
692
|
+
tr: [_[0] / 0.15, _[1] / 0.15],
|
|
693
|
+
bl: [E[0] / 0.15, E[1] / 0.15],
|
|
694
|
+
br: [U[0] / 0.15, U[1] / 0.15]
|
|
687
695
|
};
|
|
688
|
-
},
|
|
689
|
-
const
|
|
690
|
-
return
|
|
696
|
+
}, ce = (c) => {
|
|
697
|
+
const v = { tl: [0, 0], tr: [0, 0], bl: [0, 0], br: [0, 0] };
|
|
698
|
+
return c.forEach((l) => {
|
|
691
699
|
["tl", "tr", "bl", "br"].forEach((s) => {
|
|
692
|
-
|
|
700
|
+
v[s][0] += l[s][0] / c.length, v[s][1] += l[s][1] / c.length;
|
|
693
701
|
});
|
|
694
|
-
}),
|
|
695
|
-
},
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
const a = m.current, f = j.current;
|
|
699
|
-
if (!a || !f)
|
|
702
|
+
}), v;
|
|
703
|
+
}, ue = () => {
|
|
704
|
+
const c = m.current, v = x.current;
|
|
705
|
+
if (!c || !v)
|
|
700
706
|
return;
|
|
701
|
-
const
|
|
702
|
-
|
|
703
|
-
const
|
|
704
|
-
|
|
705
|
-
const
|
|
706
|
-
for (let
|
|
707
|
-
for (let
|
|
708
|
-
const
|
|
709
|
-
|
|
707
|
+
const l = 1240, s = 1754, T = document.createElement("canvas");
|
|
708
|
+
T.width = l, T.height = s;
|
|
709
|
+
const k = T.getContext("2d"), g = document.createElement("canvas");
|
|
710
|
+
g.width = c.videoWidth, g.height = c.videoHeight, g.getContext("2d").drawImage(c, 0, 0);
|
|
711
|
+
const _ = g.getContext("2d").getImageData(0, 0, g.width, g.height), E = k.createImageData(l, s);
|
|
712
|
+
for (let b = 0; b < s; b++)
|
|
713
|
+
for (let D = 0; D < l; D++) {
|
|
714
|
+
const w = D / l, p = b / s, C = Math.floor((1 - w) * (1 - p) * v.tl[0] + w * (1 - p) * v.tr[0] + (1 - w) * p * v.bl[0] + w * p * v.br[0]), z = Math.floor((1 - w) * (1 - p) * v.tl[1] + w * (1 - p) * v.tr[1] + (1 - w) * p * v.bl[1] + w * p * v.br[1]), L = (b * l + D) * 4, N = (z * g.width + C) * 4;
|
|
715
|
+
E.data[L] = _.data[N], E.data[L + 1] = _.data[N + 1], E.data[L + 2] = _.data[N + 2], E.data[L + 3] = 255;
|
|
710
716
|
}
|
|
711
|
-
|
|
717
|
+
k.putImageData(E, 0, 0);
|
|
718
|
+
const U = T.toDataURL("image/jpeg", 0.92);
|
|
719
|
+
V((b) => [...b, U]);
|
|
720
|
+
}, B = () => {
|
|
721
|
+
d.length > 0 && $(d);
|
|
722
|
+
}, R = () => {
|
|
723
|
+
if (!I || !m.current)
|
|
724
|
+
return "";
|
|
725
|
+
const c = m.current.videoWidth, v = m.current.videoHeight, l = (s) => `${s[0] / c * 100},${s[1] / v * 100}`;
|
|
726
|
+
return `${l(I.tl)} ${l(I.tr)} ${l(I.br)} ${l(I.bl)}`;
|
|
712
727
|
};
|
|
713
|
-
return /* @__PURE__ */
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
728
|
+
return /* @__PURE__ */ f.jsxs("div", { style: {
|
|
729
|
+
position: "fixed",
|
|
730
|
+
inset: 0,
|
|
731
|
+
backgroundColor: "#000",
|
|
732
|
+
fontFamily: "system-ui, -apple-system, sans-serif",
|
|
733
|
+
overflow: "hidden"
|
|
734
|
+
}, children: [
|
|
735
|
+
/* @__PURE__ */ f.jsx("video", { ref: m, style: { display: "none" }, playsInline: !0, muted: !0 }),
|
|
736
|
+
/* @__PURE__ */ f.jsx("canvas", { ref: M, style: { width: "100vw", height: "100vh", objectFit: "cover" } }),
|
|
737
|
+
/* @__PURE__ */ f.jsx(
|
|
738
|
+
"svg",
|
|
739
|
+
{
|
|
740
|
+
viewBox: "0 0 100 100",
|
|
741
|
+
preserveAspectRatio: "none",
|
|
742
|
+
style: { position: "absolute", top: 0, left: 0, width: "100%", height: "100%", pointerEvents: "none", zIndex: 10 },
|
|
743
|
+
children: I && /* @__PURE__ */ f.jsx(
|
|
744
|
+
"polygon",
|
|
745
|
+
{
|
|
746
|
+
points: R(),
|
|
747
|
+
fill: "rgba(0, 255, 70, 0.15)",
|
|
748
|
+
stroke: "#00FF46",
|
|
749
|
+
strokeWidth: "0.5",
|
|
750
|
+
style: { transition: "all 0.1s ease-out" }
|
|
751
|
+
}
|
|
752
|
+
)
|
|
753
|
+
}
|
|
754
|
+
),
|
|
755
|
+
/* @__PURE__ */ f.jsx("div", { style: { position: "absolute", top: 0, width: "100%", padding: "40px 0 20px", background: "linear-gradient(rgba(0,0,0,0.6), transparent)", textAlign: "center", zIndex: 20 }, children: /* @__PURE__ */ f.jsx("div", { style: { display: "inline-block", padding: "6px 16px", borderRadius: "20px", backgroundColor: W ? "#00FF46" : "rgba(255,255,255,0.2)", color: W ? "#000" : "#fff", fontSize: "12px", fontWeight: "bold" }, children: W ? "READY TO SCAN" : "POSITION DOCUMENT" }) }),
|
|
756
|
+
/* @__PURE__ */ f.jsxs("div", { style: { position: "absolute", bottom: 0, width: "100%", height: "160px", background: "linear-gradient(transparent, rgba(0,0,0,0.8))", display: "flex", alignItems: "center", justifyContent: "space-around", zIndex: 20 }, children: [
|
|
757
|
+
/* @__PURE__ */ f.jsxs(
|
|
758
|
+
"div",
|
|
759
|
+
{
|
|
760
|
+
onClick: B,
|
|
761
|
+
style: {
|
|
762
|
+
width: "64px",
|
|
763
|
+
height: "64px",
|
|
764
|
+
position: "relative",
|
|
765
|
+
cursor: d.length > 0 ? "pointer" : "default",
|
|
766
|
+
opacity: d.length > 0 ? 1 : 0.4,
|
|
767
|
+
transition: "transform 0.2s"
|
|
768
|
+
},
|
|
769
|
+
onMouseDown: (c) => d.length > 0 && (c.currentTarget.style.transform = "scale(0.9)"),
|
|
770
|
+
onMouseUp: (c) => c.currentTarget.style.transform = "scale(1)",
|
|
771
|
+
children: [
|
|
772
|
+
d.length > 0 ? /* @__PURE__ */ f.jsxs(f.Fragment, { children: [
|
|
773
|
+
/* @__PURE__ */ f.jsx("img", { src: d[d.length - 1], style: { width: "100%", height: "100%", objectFit: "cover", border: "2px solid #fff", borderRadius: "4px" }, alt: "preview" }),
|
|
774
|
+
/* @__PURE__ */ f.jsx("div", { style: { position: "absolute", top: "-8px", right: "-8px", background: "#00FF46", color: "#000", width: "22px", height: "22px", borderRadius: "50%", fontSize: "12px", fontWeight: "bold", display: "flex", alignItems: "center", justifyContent: "center", border: "2px solid #000" }, children: d.length })
|
|
775
|
+
] }) : /* @__PURE__ */ f.jsx("div", { style: { width: "100%", height: "100%", borderRadius: "4px", backgroundColor: "rgba(255,255,255,0.1)", border: "1px dashed #555" } }),
|
|
776
|
+
/* @__PURE__ */ f.jsx("span", { style: { fontSize: "10px", display: "block", textAlign: "center", marginTop: "4px", color: "#fff" }, children: "DONE" })
|
|
777
|
+
]
|
|
778
|
+
}
|
|
779
|
+
),
|
|
780
|
+
/* @__PURE__ */ f.jsx("button", { onClick: ue, disabled: !W, style: { width: "84px", height: "84px", borderRadius: "50%", border: `4px solid ${W ? "#00FF46" : "#555"}`, backgroundColor: "transparent", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ f.jsx("div", { style: { width: "68px", height: "68px", borderRadius: "50%", backgroundColor: W ? "#fff" : "#444" } }) }),
|
|
781
|
+
/* @__PURE__ */ f.jsx("div", { style: { width: "64px" } })
|
|
782
|
+
] })
|
|
731
783
|
] });
|
|
732
784
|
};
|
|
733
|
-
function
|
|
734
|
-
const [
|
|
735
|
-
return /* @__PURE__ */
|
|
736
|
-
/* @__PURE__ */
|
|
737
|
-
|
|
738
|
-
/* @__PURE__ */
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
785
|
+
function yr() {
|
|
786
|
+
const [$, m] = le(null);
|
|
787
|
+
return /* @__PURE__ */ f.jsxs("div", { style: { textAlign: "center", padding: "20px", fontFamily: "sans-serif" }, children: [
|
|
788
|
+
/* @__PURE__ */ f.jsx("h1", { children: "JS Doc Scanner" }),
|
|
789
|
+
$ ? /* @__PURE__ */ f.jsxs("div", { children: [
|
|
790
|
+
/* @__PURE__ */ f.jsx("h3", { children: "Scanned Result:" }),
|
|
791
|
+
$ == null ? void 0 : $.map((M, O) => /* @__PURE__ */ f.jsx(
|
|
792
|
+
"img",
|
|
793
|
+
{
|
|
794
|
+
src: M,
|
|
795
|
+
style: { width: "100%", maxWidth: "400px", border: "2px solid #ccc", margin: "10px" }
|
|
796
|
+
},
|
|
797
|
+
O
|
|
798
|
+
)),
|
|
799
|
+
/* @__PURE__ */ f.jsx("br", {}),
|
|
800
|
+
/* @__PURE__ */ f.jsx("button", { onClick: () => m(null), children: "Scan Again" })
|
|
801
|
+
] }) : /* @__PURE__ */ f.jsx(gr, { onCapture: (M) => m(M) })
|
|
743
802
|
] });
|
|
744
803
|
}
|
|
745
804
|
export {
|
|
746
|
-
|
|
805
|
+
yr as App,
|
|
747
806
|
gr as DocumentScanner
|
|
748
807
|
};
|