easy-email-pro-kit 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.es.js +505 -521
- package/package.json +1 -1
package/lib/index.es.js
CHANGED
|
@@ -12,37 +12,37 @@ var De = (e, n, u) => n in e ? an(e, n, { enumerable: !0, configurable: !0, writ
|
|
|
12
12
|
}, At = (e, n) => sn(e, ln(n));
|
|
13
13
|
var Le = (e, n) => {
|
|
14
14
|
var u = {};
|
|
15
|
-
for (var
|
|
16
|
-
We.call(e,
|
|
15
|
+
for (var g in e)
|
|
16
|
+
We.call(e, g) && n.indexOf(g) < 0 && (u[g] = e[g]);
|
|
17
17
|
if (e != null && Pt)
|
|
18
|
-
for (var
|
|
19
|
-
n.indexOf(
|
|
18
|
+
for (var g of Pt(e))
|
|
19
|
+
n.indexOf(g) < 0 && Ce.call(e, g) && (u[g] = e[g]);
|
|
20
20
|
return u;
|
|
21
21
|
};
|
|
22
|
-
var Zt = (e, n, u) => new Promise((
|
|
23
|
-
var w = (
|
|
22
|
+
var Zt = (e, n, u) => new Promise((g, f) => {
|
|
23
|
+
var w = (p) => {
|
|
24
24
|
try {
|
|
25
|
-
s(u.next(
|
|
25
|
+
s(u.next(p));
|
|
26
26
|
} catch (y) {
|
|
27
27
|
f(y);
|
|
28
28
|
}
|
|
29
|
-
},
|
|
29
|
+
}, m = (p) => {
|
|
30
30
|
try {
|
|
31
|
-
s(u.throw(
|
|
31
|
+
s(u.throw(p));
|
|
32
32
|
} catch (y) {
|
|
33
33
|
f(y);
|
|
34
34
|
}
|
|
35
|
-
}, s = (
|
|
35
|
+
}, s = (p) => p.done ? g(p.value) : Promise.resolve(p.value).then(w, m);
|
|
36
36
|
s((u = u.apply(e, n)).next());
|
|
37
37
|
});
|
|
38
|
-
import { createCustomBlock as de, t as A, mergeBlock as ue, ElementCategory as he, NodeUtils as cn, components as
|
|
39
|
-
import { AttributesPanelWrapper as
|
|
40
|
-
import { flatMap as un, get as hn, cloneDeep as Xt, isEqual as Jt, set as jt, merge as
|
|
41
|
-
import G, { useState as xe, useEffect as Rt, useRef as Ie, useMemo as
|
|
42
|
-
import
|
|
38
|
+
import { createCustomBlock as de, t as A, mergeBlock as ue, ElementCategory as he, NodeUtils as cn, components as me, ElementPlugin as pe, BlockManager as be } from "easy-email-pro-core";
|
|
39
|
+
import { AttributesPanelWrapper as ge, ResponsiveTabs as ye, useEditorContext as fe, CollapseWrapper as we, AttributeField as nt, ResponsiveField as it, previewLoadImage as Fe, useElementInteract as dn, ConfigPanelsMap as Me } from "easy-email-pro-theme";
|
|
40
|
+
import { flatMap as un, get as hn, cloneDeep as Xt, isEqual as Jt, set as jt, merge as mn } from "lodash";
|
|
41
|
+
import G, { useState as xe, useEffect as Rt, useRef as Ie, useMemo as pn } from "react";
|
|
42
|
+
import bn from "react-dom/server";
|
|
43
43
|
import { Collapse as vt, Button as ve, Message as Te, Grid as te, Divider as ee } from "@arco-design/web-react";
|
|
44
44
|
import { ActiveTabKeys as ft, useEditorProps as Ze, useSelectedNode as Se, useEditorState as Ne } from "easy-email-pro-editor";
|
|
45
|
-
import { useSlate as Je, ReactEditor as
|
|
45
|
+
import { useSlate as Je, ReactEditor as gn } from "slate-react";
|
|
46
46
|
import { HistoryEditor as yn } from "slate-history";
|
|
47
47
|
const Ot = {
|
|
48
48
|
MARKETING_SHOPWINDOW: "marketing-shopwindow",
|
|
@@ -50,28 +50,28 @@ const Ot = {
|
|
|
50
50
|
MARKETING_QR_CODE: "marketing-qr-code"
|
|
51
51
|
}, se = 60, Ut = 60 * se, Qt = 24 * Ut;
|
|
52
52
|
function Re(e) {
|
|
53
|
-
const n = Math.floor(e / Qt), u = Math.floor((e - n * Qt) / Ut),
|
|
53
|
+
const n = Math.floor(e / Qt), u = Math.floor((e - n * Qt) / Ut), g = Math.floor((e - n * Qt - u * Ut) / se), f = Math.floor(e - n * Qt - u * Ut - g * se);
|
|
54
54
|
return {
|
|
55
55
|
day: n < 10 ? "0" + n : n.toString(),
|
|
56
56
|
hour: u < 10 ? "0" + u : u.toString(),
|
|
57
|
-
minute:
|
|
57
|
+
minute: g < 10 ? "0" + g : g.toString(),
|
|
58
58
|
second: f < 10 ? "0" + f : f.toString()
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
61
|
function fn(e) {
|
|
62
62
|
const { attributes: n, data: u } = e;
|
|
63
|
-
let
|
|
63
|
+
let g = u.remainingTime;
|
|
64
64
|
switch (u.unit) {
|
|
65
65
|
case "minute":
|
|
66
|
-
|
|
66
|
+
g = 60 * g;
|
|
67
67
|
break;
|
|
68
68
|
case "hour":
|
|
69
|
-
|
|
69
|
+
g = 60 * 60 * g;
|
|
70
70
|
break;
|
|
71
71
|
case "day":
|
|
72
|
-
|
|
72
|
+
g = 60 * 60 * 24 * g;
|
|
73
73
|
}
|
|
74
|
-
const { day: f, hour: w, minute:
|
|
74
|
+
const { day: f, hour: w, minute: m, second: s } = Re(g), p = [
|
|
75
75
|
{
|
|
76
76
|
unit: "days",
|
|
77
77
|
value: f
|
|
@@ -82,7 +82,7 @@ function fn(e) {
|
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
unit: "mins",
|
|
85
|
-
value:
|
|
85
|
+
value: m
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
unit: "secs",
|
|
@@ -106,7 +106,7 @@ function fn(e) {
|
|
|
106
106
|
paddingBottom: 15
|
|
107
107
|
}
|
|
108
108
|
},
|
|
109
|
-
|
|
109
|
+
p.map((y, v) => /* @__PURE__ */ G.createElement(
|
|
110
110
|
"div",
|
|
111
111
|
{
|
|
112
112
|
key: y.unit,
|
|
@@ -134,7 +134,7 @@ function fn(e) {
|
|
|
134
134
|
},
|
|
135
135
|
/* @__PURE__ */ G.createElement("div", { style: { height: "100%", overflow: "hidden" } }, /* @__PURE__ */ G.createElement("div", { className: y.unit }, y.value))
|
|
136
136
|
),
|
|
137
|
-
v !==
|
|
137
|
+
v !== p.length - 1 && /* @__PURE__ */ G.createElement(
|
|
138
138
|
"div",
|
|
139
139
|
{
|
|
140
140
|
key: y.unit,
|
|
@@ -153,7 +153,7 @@ function fn(e) {
|
|
|
153
153
|
paddingBottom: 10
|
|
154
154
|
}
|
|
155
155
|
},
|
|
156
|
-
|
|
156
|
+
p.map((y, v) => /* @__PURE__ */ G.createElement(
|
|
157
157
|
"div",
|
|
158
158
|
{
|
|
159
159
|
key: y.unit,
|
|
@@ -179,7 +179,7 @@ function fn(e) {
|
|
|
179
179
|
},
|
|
180
180
|
y.unit
|
|
181
181
|
),
|
|
182
|
-
v !==
|
|
182
|
+
v !== p.length - 1 && /* @__PURE__ */ G.createElement(
|
|
183
183
|
"div",
|
|
184
184
|
{
|
|
185
185
|
style: {
|
|
@@ -194,7 +194,7 @@ function fn(e) {
|
|
|
194
194
|
))
|
|
195
195
|
);
|
|
196
196
|
}
|
|
197
|
-
const { Image: wn, Raw: Mn, Spacer: xn, ContentEditableBlock: vn, HtmlDomNode: Ye } =
|
|
197
|
+
const { Image: wn, Raw: Mn, Spacer: xn, ContentEditableBlock: vn, HtmlDomNode: Ye } = me, ne = {
|
|
198
198
|
attributes: {
|
|
199
199
|
color: "#ffffff",
|
|
200
200
|
"padding-top": "20px",
|
|
@@ -258,9 +258,9 @@ const { Image: wn, Raw: Mn, Spacer: xn, ContentEditableBlock: vn, HtmlDomNode: Y
|
|
|
258
258
|
},
|
|
259
259
|
category: he.UNKNOWN_CONTENT,
|
|
260
260
|
render(e) {
|
|
261
|
-
const { node: n, mode: u } = e, { attributes:
|
|
261
|
+
const { node: n, mode: u } = e, { attributes: g, children: f } = n;
|
|
262
262
|
if (u === "testing") {
|
|
263
|
-
const w =
|
|
263
|
+
const w = bn.renderToString(
|
|
264
264
|
/* @__PURE__ */ G.createElement(fn, { attributes: n.attributes, data: n.data })
|
|
265
265
|
);
|
|
266
266
|
return /* @__PURE__ */ G.createElement(
|
|
@@ -268,11 +268,11 @@ const { Image: wn, Raw: Mn, Spacer: xn, ContentEditableBlock: vn, HtmlDomNode: Y
|
|
|
268
268
|
{
|
|
269
269
|
tagName: "div",
|
|
270
270
|
style: {
|
|
271
|
-
backgroundColor:
|
|
272
|
-
paddingBottom:
|
|
273
|
-
paddingTop:
|
|
274
|
-
paddingLeft:
|
|
275
|
-
paddingRight:
|
|
271
|
+
backgroundColor: g["background-color"],
|
|
272
|
+
paddingBottom: g["padding-bottom"],
|
|
273
|
+
paddingTop: g["padding-top"],
|
|
274
|
+
paddingLeft: g["padding-left"],
|
|
275
|
+
paddingRight: g["padding-right"],
|
|
276
276
|
fontSize: "0px",
|
|
277
277
|
lineHeight: 1
|
|
278
278
|
}
|
|
@@ -287,7 +287,7 @@ const { Image: wn, Raw: Mn, Spacer: xn, ContentEditableBlock: vn, HtmlDomNode: Y
|
|
|
287
287
|
display: "table"
|
|
288
288
|
}
|
|
289
289
|
},
|
|
290
|
-
f.map((
|
|
290
|
+
f.map((m, s) => cn.isTextElement(m) ? /* @__PURE__ */ G.createElement(vn, { key: s, node: m }) : null),
|
|
291
291
|
/* @__PURE__ */ G.createElement(xn, { height: "20px" }),
|
|
292
292
|
/* @__PURE__ */ G.createElement(Mn, null, w)
|
|
293
293
|
)
|
|
@@ -302,7 +302,7 @@ const { Image: wn, Raw: Mn, Spacer: xn, ContentEditableBlock: vn, HtmlDomNode: Y
|
|
|
302
302
|
})
|
|
303
303
|
);
|
|
304
304
|
}
|
|
305
|
-
}), { Image: Tn } =
|
|
305
|
+
}), { Image: Tn } = me, ke = {
|
|
306
306
|
attributes: {
|
|
307
307
|
align: "center",
|
|
308
308
|
border: "0",
|
|
@@ -350,29 +350,29 @@ const { Image: wn, Raw: Mn, Spacer: xn, ContentEditableBlock: vn, HtmlDomNode: Y
|
|
|
350
350
|
},
|
|
351
351
|
category: he.IMAGE,
|
|
352
352
|
render(e) {
|
|
353
|
-
const { node: n } = e,
|
|
353
|
+
const { node: n } = e, p = n.attributes, {
|
|
354
354
|
"border-enabled": u,
|
|
355
|
-
"border-width":
|
|
355
|
+
"border-width": g,
|
|
356
356
|
"border-style": f,
|
|
357
357
|
"border-color": w
|
|
358
|
-
} =
|
|
358
|
+
} = p, m = Le(p, [
|
|
359
359
|
"border-enabled",
|
|
360
360
|
"border-width",
|
|
361
361
|
"border-style",
|
|
362
362
|
"border-color"
|
|
363
|
-
]), s = u ? `${
|
|
363
|
+
]), s = u ? `${g || "1px"} ${f || "solid"} ${w || "#AAAAAA"}` : "";
|
|
364
364
|
return /* @__PURE__ */ G.createElement(
|
|
365
365
|
Tn,
|
|
366
366
|
At(Tt({
|
|
367
367
|
idx: e.idx
|
|
368
|
-
},
|
|
368
|
+
}, m), {
|
|
369
369
|
data: n.data,
|
|
370
370
|
border: s,
|
|
371
371
|
children: n.children
|
|
372
372
|
})
|
|
373
373
|
);
|
|
374
374
|
}
|
|
375
|
-
}), { Image: Zn } =
|
|
375
|
+
}), { Image: Zn } = me, re = {
|
|
376
376
|
attributes: {
|
|
377
377
|
"dot-color": "#4267b2",
|
|
378
378
|
"dot-color-rotation": 0,
|
|
@@ -436,16 +436,16 @@ const { Image: wn, Raw: Mn, Spacer: xn, ContentEditableBlock: vn, HtmlDomNode: Y
|
|
|
436
436
|
}
|
|
437
437
|
}), Ft = document.createElement("canvas"), Ke = Ft.getContext("2d"), Sn = (e) => Zt(void 0, null, function* () {
|
|
438
438
|
const n = new Image();
|
|
439
|
-
return n.src = e, yield new Promise((u,
|
|
440
|
-
n.onload = u, n.onerror =
|
|
439
|
+
return n.src = e, yield new Promise((u, g) => {
|
|
440
|
+
n.onload = u, n.onerror = g;
|
|
441
441
|
}), n;
|
|
442
442
|
}), Nn = (e) => Zt(void 0, null, function* () {
|
|
443
443
|
const n = new Image();
|
|
444
|
-
return n.crossOrigin = "anonymous", new Promise((u,
|
|
444
|
+
return n.crossOrigin = "anonymous", new Promise((u, g) => {
|
|
445
445
|
n.onload = () => {
|
|
446
446
|
const f = n.width, w = n.height;
|
|
447
447
|
Ft.width = f, Ft.height = w, Ke.clearRect(0, 0, f, w), Ke.drawImage(n, 0, 0), u(Ft.toDataURL());
|
|
448
|
-
}, n.onerror =
|
|
448
|
+
}, n.onerror = g, n.src = e.src;
|
|
449
449
|
});
|
|
450
450
|
}), Dn = un(
|
|
451
451
|
["padding", "margin", "border"].map((e) => [
|
|
@@ -483,15 +483,15 @@ function He(e) {
|
|
|
483
483
|
if (!(n instanceof HTMLElement && e instanceof HTMLElement))
|
|
484
484
|
return n;
|
|
485
485
|
const u = window.getComputedStyle(e);
|
|
486
|
-
return Wn.forEach((
|
|
487
|
-
n.style.setProperty(
|
|
488
|
-
}), n.childNodes.forEach((
|
|
489
|
-
n.replaceChild(He(e.childNodes[f]),
|
|
486
|
+
return Wn.forEach((g) => {
|
|
487
|
+
n.style.setProperty(g, u.getPropertyValue(g));
|
|
488
|
+
}), n.childNodes.forEach((g, f) => {
|
|
489
|
+
n.replaceChild(He(e.childNodes[f]), g);
|
|
490
490
|
}), n;
|
|
491
491
|
}
|
|
492
492
|
const Cn = function(u) {
|
|
493
493
|
return Zt(this, arguments, function* (e, n = {}) {
|
|
494
|
-
const
|
|
494
|
+
const g = n.width || e.offsetWidth, f = n.height || e.offsetHeight, { overwrite: w = [], wrapper: m = (v) => v } = n, s = He(e);
|
|
495
495
|
if (s.setAttribute("xmlns", "http://www.w3.org/1999/xhtml"), s.classList.remove("outline"), n.styleText) {
|
|
496
496
|
const v = document.createElement("style");
|
|
497
497
|
v.innerHTML = n.styleText, s.appendChild(v);
|
|
@@ -520,8 +520,8 @@ const Cn = function(u) {
|
|
|
520
520
|
v.src = yield Nn(v);
|
|
521
521
|
}))
|
|
522
522
|
);
|
|
523
|
-
const
|
|
524
|
-
let y = 'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="' +
|
|
523
|
+
const p = new XMLSerializer().serializeToString(m(s));
|
|
524
|
+
let y = 'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="' + g + '" height="' + f + '"><foreignObject x="0" y="0" width="100%" height="100%">' + p + "</foreignObject></svg>";
|
|
525
525
|
return y = y.replace(/\n/g, "").replace(/\t/g, "").replace(/#/g, "%23"), y;
|
|
526
526
|
});
|
|
527
527
|
};
|
|
@@ -532,20 +532,20 @@ var Ln = Object.defineProperty, In = Object.defineProperties, Yn = Object.getOwn
|
|
|
532
532
|
for (var u of Xe(n))
|
|
533
533
|
kn.call(n, u) && Oe(e, u, n[u]);
|
|
534
534
|
return e;
|
|
535
|
-
}, Vt = (e, n) => In(e, Yn(n)), Ct = (e, n, u) => new Promise((
|
|
536
|
-
var w = (
|
|
535
|
+
}, Vt = (e, n) => In(e, Yn(n)), Ct = (e, n, u) => new Promise((g, f) => {
|
|
536
|
+
var w = (p) => {
|
|
537
537
|
try {
|
|
538
|
-
s(u.next(
|
|
538
|
+
s(u.next(p));
|
|
539
539
|
} catch (y) {
|
|
540
540
|
f(y);
|
|
541
541
|
}
|
|
542
|
-
},
|
|
542
|
+
}, m = (p) => {
|
|
543
543
|
try {
|
|
544
|
-
s(u.throw(
|
|
544
|
+
s(u.throw(p));
|
|
545
545
|
} catch (y) {
|
|
546
546
|
f(y);
|
|
547
547
|
}
|
|
548
|
-
}, s = (
|
|
548
|
+
}, s = (p) => p.done ? g(p.value) : Promise.resolve(p.value).then(w, m);
|
|
549
549
|
s((u = u.apply(e, n)).next());
|
|
550
550
|
});
|
|
551
551
|
const En = typeof window < "u", at = 65536 - 1, Kt = at * at, zn = 512 - 1, oe = [
|
|
@@ -1327,8 +1327,8 @@ function ie(e) {
|
|
|
1327
1327
|
return at;
|
|
1328
1328
|
n = e * (e * (e + -144107) / at + 132114) / at + 14379;
|
|
1329
1329
|
for (let u = 0; u < 2; u++) {
|
|
1330
|
-
const
|
|
1331
|
-
n = (n * (2 * e + (
|
|
1330
|
+
const g = n * n * n, f = e + (2 * g + Kt / 2) / Kt;
|
|
1331
|
+
n = (n * (2 * e + (g + Kt / 2) / Kt) + f / 2) / f;
|
|
1332
1332
|
}
|
|
1333
1333
|
return n;
|
|
1334
1334
|
}
|
|
@@ -1336,11 +1336,11 @@ function Dt(e, n) {
|
|
|
1336
1336
|
return (e ^ n) < 0 ? (e - n / 2) / n : (e + n / 2) / n;
|
|
1337
1337
|
}
|
|
1338
1338
|
function Be(e) {
|
|
1339
|
-
const n = oe[e >> 16 & 255], u = oe[e >> 8 & 255],
|
|
1339
|
+
const n = oe[e >> 16 & 255], u = oe[e >> 8 & 255], g = oe[e & 255], f = (27015 * n + 35149 * u + 3372 * g + at / 2) / at, w = (13887 * n + 44610 * u + 7038 * g + at / 2) / at, m = (5787 * n + 18462 * u + 41286 * g + at / 2) / at, s = ie(f), p = ie(w), y = ie(m);
|
|
1340
1340
|
return [
|
|
1341
|
-
Dt(13792 * s + 52010 *
|
|
1342
|
-
Dt(129628 * s - 159158 *
|
|
1343
|
-
Dt(1698 * s + 51299 *
|
|
1341
|
+
Dt(13792 * s + 52010 * p - 267 * y, at),
|
|
1342
|
+
Dt(129628 * s - 159158 * p + 29530 * y, at),
|
|
1343
|
+
Dt(1698 * s + 51299 * p - 52997 * y, at)
|
|
1344
1344
|
];
|
|
1345
1345
|
}
|
|
1346
1346
|
function ae(e) {
|
|
@@ -1349,17 +1349,17 @@ function ae(e) {
|
|
|
1349
1349
|
if (e >= at)
|
|
1350
1350
|
return 255;
|
|
1351
1351
|
{
|
|
1352
|
-
const n = e * zn, u = ~~(n / at),
|
|
1353
|
-
return (
|
|
1352
|
+
const n = e * zn, u = ~~(n / at), g = n % at, f = je[u], w = je[u + 1];
|
|
1353
|
+
return (g * (w - f) + at / 2) / at + f;
|
|
1354
1354
|
}
|
|
1355
1355
|
}
|
|
1356
1356
|
function Kn(e) {
|
|
1357
|
-
const n = e[0] + Dt(25974 * e[1], at) + Dt(14143 * e[2], at), u = e[0] + Dt(-6918 * e[1], at) + Dt(-4185 * e[2], at),
|
|
1358
|
-
return s << 16 |
|
|
1357
|
+
const n = e[0] + Dt(25974 * e[1], at) + Dt(14143 * e[2], at), u = e[0] + Dt(-6918 * e[1], at) + Dt(-4185 * e[2], at), g = e[0] + Dt(-5864 * e[1], at) + Dt(-84638 * e[2], at), f = St(n, 2) * n / Kt, w = St(u, 2) * u / Kt, m = St(g, 2) * g / Kt, s = ae((267169 * f + -216771 * w + 15137 * m + at / 2) / at), p = ae((-83127 * f + 171030 * w + -22368 * m + at / 2) / at), y = ae((-275 * f + -46099 * w + 111909 * m + at / 2) / at);
|
|
1358
|
+
return s << 16 | p << 8 | y;
|
|
1359
1359
|
}
|
|
1360
1360
|
function Xn(e) {
|
|
1361
|
-
const n = { l: 0, a: 1, b: 2 }, u = e[0],
|
|
1362
|
-
return (
|
|
1361
|
+
const n = { l: 0, a: 1, b: 2 }, u = e[0], g = e[1], f = e[2], w = n[u], m = n[g], s = n[f];
|
|
1362
|
+
return (p, y) => p.oklab[w] - y.oklab[w] || p.oklab[m] - y.oklab[m] || p.oklab[s] - y.oklab[s];
|
|
1363
1363
|
}
|
|
1364
1364
|
function On(e, n, u) {
|
|
1365
1365
|
return e >= n ? n >= u ? "lab" : e >= u ? "lba" : "bla" : e >= u ? "alb" : n >= u ? "abl" : "bal";
|
|
@@ -1380,12 +1380,12 @@ function Pn(e = {}) {
|
|
|
1380
1380
|
const {
|
|
1381
1381
|
maxColors: n = 256,
|
|
1382
1382
|
statsMode: u = "full",
|
|
1383
|
-
samples:
|
|
1383
|
+
samples: g = [],
|
|
1384
1384
|
skipTransparent: f = !0
|
|
1385
1385
|
} = e;
|
|
1386
1386
|
return {
|
|
1387
1387
|
__CONTEXT__: !0,
|
|
1388
|
-
samples:
|
|
1388
|
+
samples: g,
|
|
1389
1389
|
maxColors: n,
|
|
1390
1390
|
statsMode: u,
|
|
1391
1391
|
skipTransparent: f,
|
|
@@ -1399,68 +1399,68 @@ function Pn(e = {}) {
|
|
|
1399
1399
|
function qe(e) {
|
|
1400
1400
|
const n = _e(e) ? e : e.context, {
|
|
1401
1401
|
colorBoxesIndexTree: u,
|
|
1402
|
-
finderCache:
|
|
1402
|
+
finderCache: g
|
|
1403
1403
|
} = n;
|
|
1404
|
-
function f(
|
|
1405
|
-
const { left: y, right: v, longest: E, oklab: C, colorBoxIndex: K } = u[
|
|
1404
|
+
function f(m, s, p) {
|
|
1405
|
+
const { left: y, right: v, longest: E, oklab: C, colorBoxIndex: K } = u[m], I = Math.min(
|
|
1406
1406
|
St(s[0] - C[0], 2) + St(s[1] - C[1], 2) + St(s[2] - C[2], 2),
|
|
1407
1407
|
4294967295 - 1
|
|
1408
1408
|
);
|
|
1409
|
-
I <
|
|
1409
|
+
I < p.dist && (p.colorBoxIndex = K, p.dist = I);
|
|
1410
1410
|
let T, X;
|
|
1411
1411
|
if (y !== -1 || v !== -1) {
|
|
1412
1412
|
const _ = s[E] - C[E];
|
|
1413
|
-
_ <= 0 ? (T = y, X = v) : (T = v, X = y), T !== -1 && f(T, s,
|
|
1413
|
+
_ <= 0 ? (T = y, X = v) : (T = v, X = y), T !== -1 && f(T, s, p), X !== -1 && St(_, 2) < p.dist && f(X, s, p);
|
|
1414
1414
|
}
|
|
1415
1415
|
}
|
|
1416
|
-
function w(
|
|
1416
|
+
function w(m) {
|
|
1417
1417
|
const s = {
|
|
1418
1418
|
dist: Number.MAX_SAFE_INTEGER,
|
|
1419
1419
|
colorBoxIndex: -1
|
|
1420
1420
|
};
|
|
1421
|
-
return f(0,
|
|
1421
|
+
return f(0, m, s), s.colorBoxIndex;
|
|
1422
1422
|
}
|
|
1423
|
-
return (
|
|
1424
|
-
const s =
|
|
1425
|
-
let
|
|
1426
|
-
|
|
1427
|
-
let y =
|
|
1428
|
-
return y !== void 0 || (y = w(Be(
|
|
1423
|
+
return (m) => {
|
|
1424
|
+
const s = m % 32768;
|
|
1425
|
+
let p = g.get(s);
|
|
1426
|
+
p || (p = /* @__PURE__ */ new Map(), g.set(s, p));
|
|
1427
|
+
let y = p.get(m);
|
|
1428
|
+
return y !== void 0 || (y = w(Be(m)), p.set(m, y)), y;
|
|
1429
1429
|
};
|
|
1430
1430
|
}
|
|
1431
1431
|
function An(e, n) {
|
|
1432
|
-
const { colorBoxes: u } = e,
|
|
1432
|
+
const { colorBoxes: u } = e, g = u.reduce((m, s) => m + s.weight, 0);
|
|
1433
1433
|
if (!n)
|
|
1434
|
-
return e.colorBoxes.map((
|
|
1435
|
-
const { srgb: s, weight:
|
|
1434
|
+
return e.colorBoxes.map((m) => {
|
|
1435
|
+
const { srgb: s, weight: p } = m;
|
|
1436
1436
|
return {
|
|
1437
1437
|
value: s,
|
|
1438
|
-
percentage:
|
|
1438
|
+
percentage: p / g
|
|
1439
1439
|
};
|
|
1440
1440
|
});
|
|
1441
1441
|
const f = [];
|
|
1442
|
-
for (let
|
|
1443
|
-
const { srgb:
|
|
1442
|
+
for (let m = u.length, s = 0; s < m; s++) {
|
|
1443
|
+
const { srgb: p, weight: y } = u[s];
|
|
1444
1444
|
f.push({
|
|
1445
1445
|
value: [
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1446
|
+
p >> 16 & 255,
|
|
1447
|
+
p >> 8 & 255,
|
|
1448
|
+
p & 255
|
|
1449
1449
|
],
|
|
1450
|
-
percentage: y /
|
|
1450
|
+
percentage: y / g
|
|
1451
1451
|
});
|
|
1452
1452
|
}
|
|
1453
1453
|
let w;
|
|
1454
1454
|
if (n === "buffer") {
|
|
1455
1455
|
w = new Uint8ClampedArray(f.length * 4);
|
|
1456
|
-
for (let
|
|
1457
|
-
const
|
|
1458
|
-
w[
|
|
1456
|
+
for (let m = f.length, s = 0; s < m; s++) {
|
|
1457
|
+
const p = s * 4, y = f[s].value;
|
|
1458
|
+
w[p] = y[0], w[p + 1] = y[1], w[p + 2] = y[2], w[p + 3] = 255;
|
|
1459
1459
|
}
|
|
1460
1460
|
} else if (n === "hex") {
|
|
1461
1461
|
w = [];
|
|
1462
|
-
for (let
|
|
1463
|
-
const { value:
|
|
1462
|
+
for (let m = f.length, s = 0; s < m; s++) {
|
|
1463
|
+
const { value: p, percentage: y } = f[s], v = p[0].toString(16).padStart(2, "0"), E = p[1].toString(16).padStart(2, "0"), C = p[2].toString(16).padStart(2, "0");
|
|
1464
1464
|
w.push({
|
|
1465
1465
|
value: `#${v}${E}${C}`,
|
|
1466
1466
|
percentage: y
|
|
@@ -1471,10 +1471,10 @@ function An(e, n) {
|
|
|
1471
1471
|
return w;
|
|
1472
1472
|
}
|
|
1473
1473
|
function le(e, n, u) {
|
|
1474
|
-
var
|
|
1474
|
+
var g, f, w, m;
|
|
1475
1475
|
const {
|
|
1476
1476
|
getContext2d: s,
|
|
1477
|
-
previousSample:
|
|
1477
|
+
previousSample: p,
|
|
1478
1478
|
skipTransparent: y
|
|
1479
1479
|
} = u, {
|
|
1480
1480
|
statsMode: v,
|
|
@@ -1491,10 +1491,10 @@ function le(e, n, u) {
|
|
|
1491
1491
|
const I = [];
|
|
1492
1492
|
for (let T = n.length, X = 0; X < T; X++)
|
|
1493
1493
|
I.push(
|
|
1494
|
-
(
|
|
1494
|
+
(g = n[X][0]) != null ? g : 0,
|
|
1495
1495
|
(f = n[X][1]) != null ? f : 0,
|
|
1496
1496
|
(w = n[X][2]) != null ? w : 0,
|
|
1497
|
-
(
|
|
1497
|
+
(m = n[X][3]) != null ? m : 255
|
|
1498
1498
|
);
|
|
1499
1499
|
K = new Uint8ClampedArray(I);
|
|
1500
1500
|
} else
|
|
@@ -1522,44 +1522,44 @@ function le(e, n, u) {
|
|
|
1522
1522
|
}
|
|
1523
1523
|
for (let I = K.length, T = 0; T < I; T += 4) {
|
|
1524
1524
|
const X = K[T], _ = K[T + 1], ot = K[T + 2], P = K[T + 3];
|
|
1525
|
-
if (y && P === 0 || v === "diff" &&
|
|
1525
|
+
if (y && P === 0 || v === "diff" && p && X === p[T] && _ === p[T + 1] && ot === p[T + 2] && P === p[T + 3])
|
|
1526
1526
|
continue;
|
|
1527
1527
|
const R = X << 16 | _ << 8 | ot, J = P * 1e8 + R, k = J % 32768;
|
|
1528
1528
|
let st = C.get(k);
|
|
1529
1529
|
st || (st = /* @__PURE__ */ new Map(), C.set(k, st));
|
|
1530
|
-
let
|
|
1531
|
-
if (
|
|
1532
|
-
E[
|
|
1530
|
+
let mt = st.get(J);
|
|
1531
|
+
if (mt !== void 0) {
|
|
1532
|
+
E[mt].count++;
|
|
1533
1533
|
continue;
|
|
1534
1534
|
}
|
|
1535
|
-
|
|
1535
|
+
mt = E.push({
|
|
1536
1536
|
alpha: P,
|
|
1537
1537
|
srgb: R,
|
|
1538
1538
|
oklab: Be(R),
|
|
1539
1539
|
count: 1
|
|
1540
|
-
}) - 1, st.set(J,
|
|
1540
|
+
}) - 1, st.set(J, mt);
|
|
1541
1541
|
}
|
|
1542
1542
|
return K;
|
|
1543
1543
|
}
|
|
1544
1544
|
function $e(e, n) {
|
|
1545
|
-
const { colorSamples: u } = n, { start:
|
|
1546
|
-
e.length = f -
|
|
1545
|
+
const { colorSamples: u } = n, { start: g, end: f } = e;
|
|
1546
|
+
e.length = f - g, e.weight = 0;
|
|
1547
1547
|
const w = [0, 0, 0];
|
|
1548
|
-
for (let s =
|
|
1549
|
-
const
|
|
1550
|
-
w[0] +=
|
|
1548
|
+
for (let s = g; s < f; s++) {
|
|
1549
|
+
const p = u[s];
|
|
1550
|
+
w[0] += p.oklab[0] * p.count, w[1] += p.oklab[1] * p.count, w[2] += p.oklab[2] * p.count, e.weight += p.count;
|
|
1551
1551
|
}
|
|
1552
1552
|
e.oklab = [
|
|
1553
1553
|
w[0] / e.weight,
|
|
1554
1554
|
w[1] / e.weight,
|
|
1555
1555
|
w[2] / e.weight
|
|
1556
1556
|
];
|
|
1557
|
-
const
|
|
1558
|
-
for (let s =
|
|
1559
|
-
const
|
|
1560
|
-
|
|
1557
|
+
const m = [0, 0, 0];
|
|
1558
|
+
for (let s = g; s < f; s++) {
|
|
1559
|
+
const p = u[s];
|
|
1560
|
+
m[0] += St(p.oklab[0] - e.oklab[0], 2) * p.count, m[1] += St(p.oklab[1] - e.oklab[1], 2) * p.count, m[2] += St(p.oklab[2] - e.oklab[2], 2) * p.count;
|
|
1561
1561
|
}
|
|
1562
|
-
e.sort = On(
|
|
1562
|
+
e.sort = On(m[0], m[1], m[2]), e.score = Math.max(m[0], m[1], m[2]);
|
|
1563
1563
|
}
|
|
1564
1564
|
function Ve(e, n) {
|
|
1565
1565
|
const u = Lt({
|
|
@@ -1576,79 +1576,79 @@ function Ve(e, n) {
|
|
|
1576
1576
|
return $e(u, n), u;
|
|
1577
1577
|
}
|
|
1578
1578
|
function Qn(e) {
|
|
1579
|
-
const { colorBoxes: n } = e, u = [],
|
|
1580
|
-
for (let
|
|
1581
|
-
const { srgb: y } = n[
|
|
1582
|
-
if (y ===
|
|
1583
|
-
|
|
1579
|
+
const { colorBoxes: n } = e, u = [], g = /* @__PURE__ */ new Map();
|
|
1580
|
+
for (let m = -1, s = n.length, p = 0; p < s; p++) {
|
|
1581
|
+
const { srgb: y } = n[p];
|
|
1582
|
+
if (y === m) {
|
|
1583
|
+
g.set(p, !0);
|
|
1584
1584
|
continue;
|
|
1585
1585
|
}
|
|
1586
|
-
|
|
1586
|
+
m = y;
|
|
1587
1587
|
}
|
|
1588
1588
|
w({
|
|
1589
1589
|
min: [-65535, -65535, -65535],
|
|
1590
1590
|
max: [65535, 65535, 65535]
|
|
1591
1591
|
});
|
|
1592
|
-
function f(
|
|
1592
|
+
function f(m) {
|
|
1593
1593
|
const s = {
|
|
1594
1594
|
min: [65535, 65535, 65535],
|
|
1595
1595
|
max: [-65535, -65535, -65535]
|
|
1596
1596
|
};
|
|
1597
|
-
let
|
|
1597
|
+
let p = 0;
|
|
1598
1598
|
const y = [];
|
|
1599
1599
|
for (let I = n.length, T = 0; T < I; T++) {
|
|
1600
1600
|
const { oklab: X } = n[T];
|
|
1601
|
-
|
|
1601
|
+
g.has(T) || X[0] < m.min[0] || X[1] < m.min[1] || X[2] < m.min[2] || X[0] > m.max[0] || X[1] > m.max[1] || X[2] > m.max[2] || (X[0] < s.min[0] && (s.min[0] = X[0]), X[1] < s.min[1] && (s.min[1] = X[1]), X[2] < s.min[2] && (s.min[2] = X[2]), X[0] > s.max[0] && (s.max[0] = X[0]), X[1] > s.max[1] && (s.max[1] = X[1]), X[2] > s.max[2] && (s.max[2] = X[2]), y[p++] = {
|
|
1602
1602
|
oklab: X,
|
|
1603
1603
|
colorBoxIndex: T
|
|
1604
1604
|
});
|
|
1605
1605
|
}
|
|
1606
1606
|
let v = 0;
|
|
1607
|
-
if (!
|
|
1607
|
+
if (!p)
|
|
1608
1608
|
return { colorBoxIndex: -1, longest: v };
|
|
1609
1609
|
const E = s.max[0] - s.min[0], C = s.max[1] - s.min[1], K = s.max[2] - s.min[2];
|
|
1610
1610
|
return E >= C && E >= K ? v = 0 : K >= E && K >= C ? v = 2 : C >= E && C >= K && (v = 1), {
|
|
1611
|
-
colorBoxIndex: y.sort((I, T) => I.oklab[v] - T.oklab[v])[
|
|
1611
|
+
colorBoxIndex: y.sort((I, T) => I.oklab[v] - T.oklab[v])[p >> 1].colorBoxIndex,
|
|
1612
1612
|
longest: v
|
|
1613
1613
|
};
|
|
1614
1614
|
}
|
|
1615
|
-
function w(
|
|
1616
|
-
const { colorBoxIndex: s, longest:
|
|
1615
|
+
function w(m) {
|
|
1616
|
+
const { colorBoxIndex: s, longest: p } = f(m);
|
|
1617
1617
|
if (s < 0)
|
|
1618
1618
|
return -1;
|
|
1619
1619
|
const { oklab: y } = n[s], v = {
|
|
1620
|
-
longest:
|
|
1620
|
+
longest: p,
|
|
1621
1621
|
oklab: y,
|
|
1622
1622
|
colorBoxIndex: s
|
|
1623
1623
|
}, E = u.push(v) - 1;
|
|
1624
|
-
|
|
1625
|
-
const C = { max: [...
|
|
1626
|
-
C.max[
|
|
1624
|
+
g.set(s, !0);
|
|
1625
|
+
const C = { max: [...m.max], min: [...m.min] }, K = { max: [...m.max], min: [...m.min] };
|
|
1626
|
+
C.max[p] = y[p], K.min[p] = Math.min(y[p] + 1, 65535);
|
|
1627
1627
|
const I = w(C);
|
|
1628
1628
|
let T = -1;
|
|
1629
|
-
return K.min[
|
|
1629
|
+
return K.min[p] <= K.max[p] && (T = w(K)), v.left = I, v.right = T, E;
|
|
1630
1630
|
}
|
|
1631
1631
|
return u;
|
|
1632
1632
|
}
|
|
1633
1633
|
function Un(e, n = {}) {
|
|
1634
1634
|
const {
|
|
1635
1635
|
maxColors: u,
|
|
1636
|
-
colorSamples:
|
|
1636
|
+
colorSamples: g
|
|
1637
1637
|
} = e;
|
|
1638
|
-
if (!
|
|
1638
|
+
if (!g.length)
|
|
1639
1639
|
return;
|
|
1640
1640
|
const {
|
|
1641
1641
|
maxColors: f = u,
|
|
1642
1642
|
clearSamples: w = !0
|
|
1643
1643
|
} = n;
|
|
1644
|
-
let
|
|
1645
|
-
const
|
|
1644
|
+
let m = Ve({ end: g.length }, e), s = 1;
|
|
1645
|
+
const p = [m];
|
|
1646
1646
|
function y() {
|
|
1647
1647
|
let E = -1, C = -1;
|
|
1648
1648
|
if (s === f)
|
|
1649
1649
|
return -1;
|
|
1650
1650
|
for (let K = 0; K < s; K++) {
|
|
1651
|
-
const I =
|
|
1651
|
+
const I = p[K];
|
|
1652
1652
|
I.length >= 2 && I.score > C && (E = K, C = I.score);
|
|
1653
1653
|
}
|
|
1654
1654
|
return E;
|
|
@@ -1659,40 +1659,40 @@ function Un(e, n = {}) {
|
|
|
1659
1659
|
end: E.end,
|
|
1660
1660
|
sorted: E.sorted
|
|
1661
1661
|
}, e);
|
|
1662
|
-
E.end -= K.length, $e(E, e),
|
|
1662
|
+
E.end -= K.length, $e(E, e), p.push(K), s++;
|
|
1663
1663
|
}
|
|
1664
|
-
for (;
|
|
1665
|
-
const { start: E, end: C, sort: K, sorted: I } =
|
|
1664
|
+
for (; m && m.length > 1; ) {
|
|
1665
|
+
const { start: E, end: C, sort: K, sorted: I } = m;
|
|
1666
1666
|
if (K !== I) {
|
|
1667
|
-
const P =
|
|
1667
|
+
const P = g.slice(E, C).sort(Xn(K));
|
|
1668
1668
|
for (let R = P.length, J = 0; J < R; J++)
|
|
1669
|
-
|
|
1670
|
-
|
|
1669
|
+
g[E + J] = P[J];
|
|
1670
|
+
m.sorted = K;
|
|
1671
1671
|
}
|
|
1672
|
-
const T =
|
|
1672
|
+
const T = m.weight + 1 >> 1;
|
|
1673
1673
|
let X = E, _ = 0;
|
|
1674
|
-
for (let P = C - 2; X < P && (_ +=
|
|
1674
|
+
for (let P = C - 2; X < P && (_ += g[X].count, !(_ > T)); X++)
|
|
1675
1675
|
;
|
|
1676
|
-
v(
|
|
1676
|
+
v(m, X);
|
|
1677
1677
|
const ot = y();
|
|
1678
|
-
|
|
1678
|
+
m = ot >= 0 ? p[ot] : null;
|
|
1679
1679
|
}
|
|
1680
|
-
for (let E =
|
|
1681
|
-
|
|
1682
|
-
e.colorBoxes =
|
|
1680
|
+
for (let E = p.length, C = 0; C < E; C++)
|
|
1681
|
+
p[C].srgb = Kn(p[C].oklab);
|
|
1682
|
+
e.colorBoxes = p.sort((E, C) => E.srgb - C.srgb), e.colorBoxesIndexTree = Qn(e), w && (e.colorSamples = [], e.colorSamplesCache.clear()), e.finderCache.clear();
|
|
1683
1683
|
}
|
|
1684
1684
|
function Fn(e, n, u) {
|
|
1685
|
-
const { colorBoxes:
|
|
1685
|
+
const { colorBoxes: g } = e;
|
|
1686
1686
|
if (!n)
|
|
1687
1687
|
return;
|
|
1688
1688
|
let f;
|
|
1689
1689
|
if (typeof u == "number")
|
|
1690
1690
|
f = u;
|
|
1691
1691
|
else if (typeof u == "string") {
|
|
1692
|
-
const
|
|
1693
|
-
`${
|
|
1694
|
-
`${
|
|
1695
|
-
`${
|
|
1692
|
+
const p = u.replace(/^#/, ""), y = [
|
|
1693
|
+
`${p[0]}${p[1]}`,
|
|
1694
|
+
`${p[2]}${p[3]}`,
|
|
1695
|
+
`${p[4]}${p[5]}`
|
|
1696
1696
|
].map((v) => parseInt(v, 16));
|
|
1697
1697
|
f = y[0] << 16 | y[1] << 8 | y[2];
|
|
1698
1698
|
} else if (Array.isArray(u))
|
|
@@ -1702,14 +1702,14 @@ function Fn(e, n, u) {
|
|
|
1702
1702
|
const w = n(f);
|
|
1703
1703
|
if (w === void 0)
|
|
1704
1704
|
return;
|
|
1705
|
-
const
|
|
1706
|
-
if (!
|
|
1705
|
+
const m = g[w];
|
|
1706
|
+
if (!m)
|
|
1707
1707
|
return;
|
|
1708
|
-
const { srgb: s } =
|
|
1708
|
+
const { srgb: s } = m;
|
|
1709
1709
|
if (typeof u == "string") {
|
|
1710
|
-
const
|
|
1710
|
+
const p = (s >> 16 & 255).toString(16).padStart(2, "0"), y = (s >> 8 & 255).toString(16).padStart(2, "0"), v = (s & 255).toString(16).padStart(2, "0");
|
|
1711
1711
|
return {
|
|
1712
|
-
value: `#${
|
|
1712
|
+
value: `#${p}${y}${v}`,
|
|
1713
1713
|
index: w
|
|
1714
1714
|
};
|
|
1715
1715
|
} else if (typeof u == "object" && Array.isArray(u))
|
|
@@ -1732,7 +1732,7 @@ function Jn(e) {
|
|
|
1732
1732
|
function Pe(e) {
|
|
1733
1733
|
const n = Vn(e), {
|
|
1734
1734
|
statsMode: u,
|
|
1735
|
-
samples:
|
|
1735
|
+
samples: g,
|
|
1736
1736
|
skipTransparent: f
|
|
1737
1737
|
} = n, w = function() {
|
|
1738
1738
|
let y;
|
|
@@ -1740,56 +1740,56 @@ function Pe(e) {
|
|
|
1740
1740
|
willReadFrequently: !0
|
|
1741
1741
|
})), y);
|
|
1742
1742
|
}();
|
|
1743
|
-
let
|
|
1744
|
-
const
|
|
1743
|
+
let m = null, s = null;
|
|
1744
|
+
const p = {
|
|
1745
1745
|
context: n,
|
|
1746
1746
|
addSample: (y) => {
|
|
1747
|
-
n.colorSamples.length === 0 && (
|
|
1747
|
+
n.colorSamples.length === 0 && (m = null);
|
|
1748
1748
|
const v = le(n, y, {
|
|
1749
1749
|
getContext2d: w,
|
|
1750
|
-
previousSample:
|
|
1750
|
+
previousSample: m,
|
|
1751
1751
|
skipTransparent: f
|
|
1752
1752
|
});
|
|
1753
1753
|
return (v instanceof Promise ? v : Promise.resolve().then(() => v)).then((E) => {
|
|
1754
|
-
E && u === "diff" && (
|
|
1754
|
+
E && u === "diff" && (m = E);
|
|
1755
1755
|
}), v;
|
|
1756
1756
|
},
|
|
1757
1757
|
generate(y = {}) {
|
|
1758
1758
|
const { clearSamples: v = !0 } = y;
|
|
1759
|
-
return v && (
|
|
1759
|
+
return v && (m = null), Un(n, y), this;
|
|
1760
1760
|
},
|
|
1761
1761
|
getColors: (y) => An(n, y),
|
|
1762
1762
|
findNearestColor: (y) => (s || (s = qe(n)), Fn(n, s, y)),
|
|
1763
1763
|
reset: () => Jn(n)
|
|
1764
1764
|
};
|
|
1765
|
-
return
|
|
1765
|
+
return g.length && (g.forEach((y) => p.addSample(y)), n.samples = []), p;
|
|
1766
1766
|
}
|
|
1767
1767
|
const Ht = "[modern-gif]", Rn = "GIF", Hn = 44, tn = 33, Bn = 255, _n = 11, qn = 249, $n = 4, tr = 59, er = (...e) => console.warn(Ht, ...e), nr = (...e) => console.debug(Ht, ...e), rr = (e) => console.time(`${Ht} ${e}`), or = (e) => console.timeEnd(`${Ht} ${e}`);
|
|
1768
1768
|
function ir(e) {
|
|
1769
1769
|
const n = new Uint8Array(
|
|
1770
|
-
e.reduce((u,
|
|
1770
|
+
e.reduce((u, g) => u + g.byteLength, 0)
|
|
1771
1771
|
);
|
|
1772
|
-
return e.reduce((u,
|
|
1772
|
+
return e.reduce((u, g) => (n.set(g, u), u + g.byteLength), 0), n;
|
|
1773
1773
|
}
|
|
1774
1774
|
function ar(e, n, u) {
|
|
1775
|
-
let
|
|
1775
|
+
let g;
|
|
1776
1776
|
if (ArrayBuffer.isView(e))
|
|
1777
|
-
|
|
1777
|
+
g = e.buffer;
|
|
1778
1778
|
else if (e instanceof ArrayBuffer)
|
|
1779
|
-
|
|
1779
|
+
g = e;
|
|
1780
1780
|
else {
|
|
1781
|
-
const f = document.createElement("canvas"), { width: w, height:
|
|
1781
|
+
const f = document.createElement("canvas"), { width: w, height: m } = u || {}, s = f.getContext("2d");
|
|
1782
1782
|
if (!s)
|
|
1783
1783
|
throw new Error("Failed to create canvas context2d");
|
|
1784
|
-
f.width = w != null ? w : typeof e.width == "number" ? e.width : e.width.baseVal.value, f.height =
|
|
1784
|
+
f.width = w != null ? w : typeof e.width == "number" ? e.width : e.width.baseVal.value, f.height = m != null ? m : typeof e.height == "number" ? e.height : e.height.baseVal.value, s.drawImage(e, 0, 0, f.width, f.height), g = s.getImageData(0, 0, f.width, f.height).data.buffer;
|
|
1785
1785
|
}
|
|
1786
1786
|
switch (n) {
|
|
1787
1787
|
case "uint8Array":
|
|
1788
|
-
return new Uint8Array(
|
|
1788
|
+
return new Uint8Array(g);
|
|
1789
1789
|
case "uint8ClampedArray":
|
|
1790
|
-
return new Uint8ClampedArray(
|
|
1790
|
+
return new Uint8ClampedArray(g);
|
|
1791
1791
|
case "dataView":
|
|
1792
|
-
return new DataView(
|
|
1792
|
+
return new DataView(g);
|
|
1793
1793
|
default:
|
|
1794
1794
|
throw new Error("Unsupported output format");
|
|
1795
1795
|
}
|
|
@@ -1800,14 +1800,14 @@ function sr(e) {
|
|
|
1800
1800
|
}
|
|
1801
1801
|
function lr(e) {
|
|
1802
1802
|
return new Promise((n, u) => {
|
|
1803
|
-
const
|
|
1804
|
-
|
|
1803
|
+
const g = sr(e);
|
|
1804
|
+
g.onload = () => n(g), g.onerror = u;
|
|
1805
1805
|
});
|
|
1806
1806
|
}
|
|
1807
1807
|
function cr(e, n) {
|
|
1808
1808
|
var u;
|
|
1809
|
-
const { top:
|
|
1810
|
-
for (let T = 0; T <
|
|
1809
|
+
const { top: g = 0, left: f = 0, width: w, height: m, rawWidth: s, rate: p = 4, callback: y } = n, v = new Uint8ClampedArray(w * m * p), E = f * p, C = g * p, K = w * p, I = s * p;
|
|
1810
|
+
for (let T = 0; T < m; T++)
|
|
1811
1811
|
for (let X = 0; X < K; X++) {
|
|
1812
1812
|
const _ = (C + T) * I + (E + X);
|
|
1813
1813
|
v[T * K + X] = (u = y == null ? void 0 : y(_)) != null ? u : e[_];
|
|
@@ -1818,32 +1818,32 @@ function en(e = {}) {
|
|
|
1818
1818
|
const {
|
|
1819
1819
|
chunkSize: n = 4096
|
|
1820
1820
|
} = e;
|
|
1821
|
-
let u = [new Uint8Array(n)],
|
|
1822
|
-
const w = (s,
|
|
1823
|
-
|
|
1824
|
-
},
|
|
1821
|
+
let u = [new Uint8Array(n)], g = 0, f = 0;
|
|
1822
|
+
const w = (s, p) => {
|
|
1823
|
+
p ? u[p[0]][p[1]] = s : (f >= n && (u[++g] = new Uint8Array(n), f = 0), u[g][f++] = s);
|
|
1824
|
+
}, m = (s) => s.forEach((p) => w(p));
|
|
1825
1825
|
return {
|
|
1826
|
-
getCursor: () => [
|
|
1826
|
+
getCursor: () => [g, f],
|
|
1827
1827
|
setCursor: (s) => {
|
|
1828
|
-
|
|
1828
|
+
g = s[0], f = s[1];
|
|
1829
1829
|
},
|
|
1830
|
-
calculateDistance: (s) =>
|
|
1830
|
+
calculateDistance: (s) => g * n + f - (s[0] * n + s[1]),
|
|
1831
1831
|
writeByte: w,
|
|
1832
|
-
writeBytes:
|
|
1833
|
-
writeString: (s) => s.split("").forEach((
|
|
1834
|
-
writeUnsigned: (s) =>
|
|
1832
|
+
writeBytes: m,
|
|
1833
|
+
writeString: (s) => s.split("").forEach((p, y) => w(s.charCodeAt(y))),
|
|
1834
|
+
writeUnsigned: (s) => m([s & 255, s >> 8 & 255]),
|
|
1835
1835
|
flush: () => {
|
|
1836
|
-
u[
|
|
1836
|
+
u[g] = u[g].slice(0, f);
|
|
1837
1837
|
const s = new Uint8Array(u.reduce((y, v) => y + v.byteLength, 0));
|
|
1838
|
-
let
|
|
1838
|
+
let p = 0;
|
|
1839
1839
|
return u.forEach((y) => {
|
|
1840
|
-
s.set(y,
|
|
1841
|
-
}), u = [new Uint8Array(n)],
|
|
1840
|
+
s.set(y, p), p += y.byteLength;
|
|
1841
|
+
}), u = [new Uint8Array(n)], g = 0, f = 0, s;
|
|
1842
1842
|
}
|
|
1843
1843
|
};
|
|
1844
1844
|
}
|
|
1845
1845
|
function dr(e) {
|
|
1846
|
-
var n, u,
|
|
1846
|
+
var n, u, g;
|
|
1847
1847
|
const f = Lt({
|
|
1848
1848
|
version: "89a",
|
|
1849
1849
|
looped: !0,
|
|
@@ -1870,47 +1870,47 @@ function dr(e) {
|
|
|
1870
1870
|
if (f.backgroundColorIndex === 0)
|
|
1871
1871
|
throw new Error("Background index explicitly passed as 0.");
|
|
1872
1872
|
}
|
|
1873
|
-
const
|
|
1873
|
+
const m = en(), {
|
|
1874
1874
|
writeByte: s,
|
|
1875
|
-
writeBytes:
|
|
1875
|
+
writeBytes: p,
|
|
1876
1876
|
writeUnsigned: y,
|
|
1877
1877
|
writeString: v,
|
|
1878
1878
|
flush: E
|
|
1879
|
-
} =
|
|
1880
|
-
return v(Rn), v(f.version), y(f.width), y(f.height), s(parseInt(`${f.colorTableSize ? 1 : 0}1110${f.colorTableSize.toString(2).padStart(3, "0")}`, 2)), s(f.backgroundColorIndex), s(f.pixelAspectRatio),
|
|
1879
|
+
} = m;
|
|
1880
|
+
return v(Rn), v(f.version), y(f.width), y(f.height), s(parseInt(`${f.colorTableSize ? 1 : 0}1110${f.colorTableSize.toString(2).padStart(3, "0")}`, 2)), s(f.backgroundColorIndex), s(f.pixelAspectRatio), p((g = (u = f.colorTable) == null ? void 0 : u.flat()) != null ? g : []), f.looped && (s(tn), s(Bn), s(_n), v("NETSCAPE2.0"), s(3), s(1), y(f.loopCount), s(0)), E();
|
|
1881
1881
|
}
|
|
1882
1882
|
function ur(e, n, u) {
|
|
1883
|
-
const { writeByte:
|
|
1884
|
-
|
|
1885
|
-
let
|
|
1886
|
-
|
|
1887
|
-
const s = 1 << e,
|
|
1883
|
+
const { writeByte: g, getCursor: f, calculateDistance: w } = u;
|
|
1884
|
+
g(e);
|
|
1885
|
+
let m = f();
|
|
1886
|
+
g(0);
|
|
1887
|
+
const s = 1 << e, p = s - 1, y = s + 1;
|
|
1888
1888
|
let v = y + 1, E = e + 1, C = 0, K = 0;
|
|
1889
1889
|
function I(J) {
|
|
1890
1890
|
for (; C >= J; )
|
|
1891
|
-
|
|
1891
|
+
g(K & 255), K >>= 8, C -= 8, w(m) === 256 && (g(255, m), m = f(), g(0));
|
|
1892
1892
|
}
|
|
1893
1893
|
function T(J) {
|
|
1894
1894
|
K |= J << C, C += E, I(8);
|
|
1895
1895
|
}
|
|
1896
|
-
let X = n[0] &
|
|
1896
|
+
let X = n[0] & p, _ = {}, ot, P, R;
|
|
1897
1897
|
T(s);
|
|
1898
1898
|
for (let J = n.length, k = 1; k < J; ++k)
|
|
1899
|
-
if (R = n[k] &
|
|
1899
|
+
if (R = n[k] & p, ot = X << 8 | R, P = _[ot], P === void 0) {
|
|
1900
1900
|
for (K |= X << C, C += E; C >= 8; )
|
|
1901
|
-
|
|
1901
|
+
g(K & 255), K >>= 8, C -= 8, w(m) === 256 && (g(255, m), m = f(), g(0));
|
|
1902
1902
|
v === 4096 ? (T(s), v = y + 1, E = e + 1, _ = {}) : (v >= 1 << E && ++E, _[ot] = v++), X = R;
|
|
1903
1903
|
} else
|
|
1904
1904
|
X = P;
|
|
1905
|
-
T(X), T(y), I(1), w(
|
|
1905
|
+
T(X), T(y), I(1), w(m) === 1 ? g(0, m) : (g(w(m) - 1, m), g(0));
|
|
1906
1906
|
}
|
|
1907
1907
|
function hr(e) {
|
|
1908
|
-
var n, u,
|
|
1908
|
+
var n, u, g;
|
|
1909
1909
|
const f = en(), {
|
|
1910
1910
|
writeByte: w,
|
|
1911
|
-
writeBytes:
|
|
1911
|
+
writeBytes: m,
|
|
1912
1912
|
writeUnsigned: s,
|
|
1913
|
-
flush:
|
|
1913
|
+
flush: p
|
|
1914
1914
|
} = f, {
|
|
1915
1915
|
left: y = 0,
|
|
1916
1916
|
top: v = 0,
|
|
@@ -1923,7 +1923,7 @@ function hr(e) {
|
|
|
1923
1923
|
disposal: T = 0
|
|
1924
1924
|
} = e;
|
|
1925
1925
|
const X = (n = e.graphicControl) == null ? void 0 : n.transparent;
|
|
1926
|
-
let _ = (
|
|
1926
|
+
let _ = (g = (u = e.graphicControl) == null ? void 0 : u.transparentIndex) != null ? g : 255;
|
|
1927
1927
|
if (y < 0 || y > 65535)
|
|
1928
1928
|
throw new Error("Left invalid.");
|
|
1929
1929
|
if (v < 0 || v > 65535)
|
|
@@ -1939,39 +1939,39 @@ function hr(e) {
|
|
|
1939
1939
|
for (; P >>= 1; )
|
|
1940
1940
|
++ot;
|
|
1941
1941
|
}
|
|
1942
|
-
return w(tn), w(qn), w($n), X ? T || (T = 2) : _ = 0, w(parseInt(`000${Number(T & 7).toString(2).padStart(3, "0")}0${X ? 1 : 0}`, 2)), s(K / 10), w(_), w(0), w(Hn), s(y), s(v), s(E), s(C), I != null && I.length ? (w(parseInt(`10000${(ot - 1).toString(2).padStart(3, "0")}`, 2)),
|
|
1942
|
+
return w(tn), w(qn), w($n), X ? T || (T = 2) : _ = 0, w(parseInt(`000${Number(T & 7).toString(2).padStart(3, "0")}0${X ? 1 : 0}`, 2)), s(K / 10), w(_), w(0), w(Hn), s(y), s(v), s(E), s(C), I != null && I.length ? (w(parseInt(`10000${(ot - 1).toString(2).padStart(3, "0")}`, 2)), m(I.flat())) : w(0), ur(ot, e.imageData, f), p();
|
|
1943
1943
|
}
|
|
1944
|
-
function
|
|
1944
|
+
function mr(e) {
|
|
1945
1945
|
const {
|
|
1946
1946
|
frames: n,
|
|
1947
1947
|
palette: u,
|
|
1948
|
-
transparentIndex:
|
|
1948
|
+
transparentIndex: g
|
|
1949
1949
|
} = e, f = qe(u);
|
|
1950
1950
|
return n.map(({ imageData: w }) => {
|
|
1951
|
-
let
|
|
1951
|
+
let m = !1;
|
|
1952
1952
|
const s = new Uint8ClampedArray(w.length / 4);
|
|
1953
|
-
for (let
|
|
1954
|
-
w[y + 3] === 0 ? (s[y / 4] =
|
|
1953
|
+
for (let p = w.length, y = 0; y < p; y += 4)
|
|
1954
|
+
w[y + 3] === 0 ? (s[y / 4] = g, m = !0) : s[y / 4] = f(
|
|
1955
1955
|
w[y] << 16 | w[y + 1] << 8 | w[y + 2]
|
|
1956
1956
|
);
|
|
1957
1957
|
return {
|
|
1958
1958
|
imageData: s,
|
|
1959
|
-
transparent:
|
|
1959
|
+
transparent: m
|
|
1960
1960
|
};
|
|
1961
1961
|
});
|
|
1962
1962
|
}
|
|
1963
|
-
function
|
|
1963
|
+
function pr(e) {
|
|
1964
1964
|
const { frames: n, transparentIndex: u } = e;
|
|
1965
|
-
let
|
|
1965
|
+
let g;
|
|
1966
1966
|
const f = n.length;
|
|
1967
|
-
return n.map((w,
|
|
1967
|
+
return n.map((w, m) => {
|
|
1968
1968
|
const {
|
|
1969
1969
|
width: s,
|
|
1970
|
-
height:
|
|
1970
|
+
height: p,
|
|
1971
1971
|
transparent: y,
|
|
1972
1972
|
imageData: v
|
|
1973
1973
|
} = w;
|
|
1974
|
-
let E = 0, C = 0, K = s - 1, I =
|
|
1974
|
+
let E = 0, C = 0, K = s - 1, I = p - 1, T;
|
|
1975
1975
|
if (y) {
|
|
1976
1976
|
for (; C < I; ) {
|
|
1977
1977
|
let P = !0;
|
|
@@ -2018,12 +2018,12 @@ function mr(e) {
|
|
|
2018
2018
|
K--;
|
|
2019
2019
|
}
|
|
2020
2020
|
} else {
|
|
2021
|
-
if (
|
|
2021
|
+
if (g) {
|
|
2022
2022
|
for (; C < I; ) {
|
|
2023
2023
|
let P = !0;
|
|
2024
2024
|
for (let R = 0; R < s; R++) {
|
|
2025
2025
|
const J = s * C + R;
|
|
2026
|
-
if (v[J] !==
|
|
2026
|
+
if (v[J] !== g[J]) {
|
|
2027
2027
|
P = !1;
|
|
2028
2028
|
break;
|
|
2029
2029
|
}
|
|
@@ -2036,7 +2036,7 @@ function mr(e) {
|
|
|
2036
2036
|
let P = !0;
|
|
2037
2037
|
for (let R = 0; R < s; R++) {
|
|
2038
2038
|
const J = s * I + R;
|
|
2039
|
-
if (v[J] !==
|
|
2039
|
+
if (v[J] !== g[J]) {
|
|
2040
2040
|
P = !1;
|
|
2041
2041
|
break;
|
|
2042
2042
|
}
|
|
@@ -2052,7 +2052,7 @@ function mr(e) {
|
|
|
2052
2052
|
let P = !0;
|
|
2053
2053
|
for (let R = C; R <= I; R++) {
|
|
2054
2054
|
const J = R * s + E;
|
|
2055
|
-
if (v[J] !==
|
|
2055
|
+
if (v[J] !== g[J]) {
|
|
2056
2056
|
P = !1;
|
|
2057
2057
|
break;
|
|
2058
2058
|
}
|
|
@@ -2065,7 +2065,7 @@ function mr(e) {
|
|
|
2065
2065
|
let P = !0;
|
|
2066
2066
|
for (let R = C; R <= I; R++) {
|
|
2067
2067
|
const J = R * s + K;
|
|
2068
|
-
if (v[J] !==
|
|
2068
|
+
if (v[J] !== g[J]) {
|
|
2069
2069
|
P = !1;
|
|
2070
2070
|
break;
|
|
2071
2071
|
}
|
|
@@ -2076,7 +2076,7 @@ function mr(e) {
|
|
|
2076
2076
|
}
|
|
2077
2077
|
}
|
|
2078
2078
|
}
|
|
2079
|
-
T =
|
|
2079
|
+
T = g, g = v;
|
|
2080
2080
|
}
|
|
2081
2081
|
const X = K + 1 - E, _ = I + 1 - C, ot = cr(
|
|
2082
2082
|
v,
|
|
@@ -2098,12 +2098,12 @@ function mr(e) {
|
|
|
2098
2098
|
top: C,
|
|
2099
2099
|
width: X,
|
|
2100
2100
|
height: _,
|
|
2101
|
-
disposal: y &&
|
|
2101
|
+
disposal: y && m !== f - 1 ? 2 : 1,
|
|
2102
2102
|
imageData: ot
|
|
2103
2103
|
};
|
|
2104
2104
|
});
|
|
2105
2105
|
}
|
|
2106
|
-
function
|
|
2106
|
+
function br(e) {
|
|
2107
2107
|
return {
|
|
2108
2108
|
time: (n) => e && rr(n),
|
|
2109
2109
|
timeEnd: (n) => e && or(n),
|
|
@@ -2111,10 +2111,10 @@ function gr(e) {
|
|
|
2111
2111
|
warn: (...n) => e && er(...n)
|
|
2112
2112
|
};
|
|
2113
2113
|
}
|
|
2114
|
-
function
|
|
2114
|
+
function gr(e) {
|
|
2115
2115
|
const n = /* @__PURE__ */ new Map(), { workerUrl: u } = e;
|
|
2116
|
-
let { workerNumber:
|
|
2117
|
-
const f = [...new Array(u ?
|
|
2116
|
+
let { workerNumber: g = 1 } = e;
|
|
2117
|
+
const f = [...new Array(u ? g : 0)].map(() => {
|
|
2118
2118
|
try {
|
|
2119
2119
|
const s = new Worker(u);
|
|
2120
2120
|
return s.onmessage = w, s;
|
|
@@ -2122,24 +2122,24 @@ function br(e) {
|
|
|
2122
2122
|
return null;
|
|
2123
2123
|
}
|
|
2124
2124
|
}).filter(Boolean);
|
|
2125
|
-
|
|
2125
|
+
g = f.length;
|
|
2126
2126
|
function w(s) {
|
|
2127
|
-
var
|
|
2127
|
+
var p;
|
|
2128
2128
|
const { id: y, data: v } = s.data;
|
|
2129
|
-
(
|
|
2129
|
+
(p = n.get(y)) == null || p(v), n.delete(y);
|
|
2130
2130
|
}
|
|
2131
|
-
const
|
|
2131
|
+
const m = function() {
|
|
2132
2132
|
let s = 0;
|
|
2133
|
-
return (
|
|
2133
|
+
return (p) => f[(p != null ? p : s++) % g];
|
|
2134
2134
|
}();
|
|
2135
2135
|
return {
|
|
2136
2136
|
call: function() {
|
|
2137
2137
|
let s = 0;
|
|
2138
|
-
return (
|
|
2139
|
-
const K =
|
|
2138
|
+
return (p, y, v, E) => new Promise((C) => {
|
|
2139
|
+
const K = m(E);
|
|
2140
2140
|
if (!K)
|
|
2141
2141
|
return C(void 0);
|
|
2142
|
-
n.set(s, C), K.postMessage({ id: s++, type:
|
|
2142
|
+
n.set(s, C), K.postMessage({ id: s++, type: p, data: y }, { transfer: v });
|
|
2143
2143
|
});
|
|
2144
2144
|
}()
|
|
2145
2145
|
};
|
|
@@ -2148,22 +2148,22 @@ function yr(e) {
|
|
|
2148
2148
|
const {
|
|
2149
2149
|
width: n,
|
|
2150
2150
|
height: u,
|
|
2151
|
-
workerUrl:
|
|
2151
|
+
workerUrl: g,
|
|
2152
2152
|
workerNumber: f = 1,
|
|
2153
2153
|
colorTableSize: w = 256,
|
|
2154
|
-
backgroundColorIndex:
|
|
2154
|
+
backgroundColorIndex: m = w - 1,
|
|
2155
2155
|
maxColors: s = w - 1,
|
|
2156
|
-
debug:
|
|
2156
|
+
debug: p = !1
|
|
2157
2157
|
} = e, y = {
|
|
2158
2158
|
width: n,
|
|
2159
2159
|
height: u,
|
|
2160
2160
|
maxColors: s,
|
|
2161
2161
|
frames: [],
|
|
2162
|
-
log:
|
|
2162
|
+
log: br(p),
|
|
2163
2163
|
palette: Pe({
|
|
2164
2164
|
skipTransparent: !1
|
|
2165
2165
|
}),
|
|
2166
|
-
worker:
|
|
2166
|
+
worker: gr({ workerUrl: g, workerNumber: f }),
|
|
2167
2167
|
encodeId: 0,
|
|
2168
2168
|
encode(T) {
|
|
2169
2169
|
return Ct(this, null, function* () {
|
|
@@ -2174,7 +2174,7 @@ function yr(e) {
|
|
|
2174
2174
|
X.time(`palette:sample-${ot}`);
|
|
2175
2175
|
try {
|
|
2176
2176
|
st = typeof st == "string" ? yield lr(st) : st;
|
|
2177
|
-
const
|
|
2177
|
+
const mt = ar(st, "uint8ClampedArray", {
|
|
2178
2178
|
width: J,
|
|
2179
2179
|
height: k
|
|
2180
2180
|
});
|
|
@@ -2182,8 +2182,8 @@ function yr(e) {
|
|
|
2182
2182
|
width: J,
|
|
2183
2183
|
height: k
|
|
2184
2184
|
}, T), {
|
|
2185
|
-
imageData:
|
|
2186
|
-
})), yield v(
|
|
2185
|
+
imageData: mt
|
|
2186
|
+
})), yield v(mt);
|
|
2187
2187
|
} finally {
|
|
2188
2188
|
X.timeEnd(`palette:sample-${ot}`);
|
|
2189
2189
|
}
|
|
@@ -2199,45 +2199,45 @@ function yr(e) {
|
|
|
2199
2199
|
const W = D[0].toString(16).padStart(2, "0"), N = D[1].toString(16).padStart(2, "0"), M = D[2].toString(16).padStart(2, "0");
|
|
2200
2200
|
return `#${W}${N}${M}`;
|
|
2201
2201
|
});
|
|
2202
|
-
for (
|
|
2202
|
+
for (p && console.debug(
|
|
2203
2203
|
st.map(() => "%c ").join(""),
|
|
2204
2204
|
...st.map((D) => `margin: 1px; background: ${D}`)
|
|
2205
2205
|
); k.length < w; )
|
|
2206
2206
|
k.push([0, 0, 0]);
|
|
2207
2207
|
T.timeEnd("palette:generate"), T.time("frames:index");
|
|
2208
|
-
const
|
|
2208
|
+
const mt = yield C({
|
|
2209
2209
|
frames: X,
|
|
2210
2210
|
palette: J,
|
|
2211
|
-
transparentIndex:
|
|
2211
|
+
transparentIndex: m
|
|
2212
2212
|
});
|
|
2213
2213
|
T.timeEnd("frames:index"), T.time("frames:crop");
|
|
2214
2214
|
const xt = yield K({
|
|
2215
|
-
frames:
|
|
2215
|
+
frames: mt.map((D, W) => {
|
|
2216
2216
|
const { width: N = 1, height: M = 1 } = X[W];
|
|
2217
2217
|
return Vt(Lt({}, D), {
|
|
2218
2218
|
width: N,
|
|
2219
2219
|
height: M
|
|
2220
2220
|
});
|
|
2221
2221
|
}),
|
|
2222
|
-
transparentIndex:
|
|
2222
|
+
transparentIndex: m
|
|
2223
2223
|
});
|
|
2224
2224
|
T.timeEnd("frames:crop"), T.time("frames:encode");
|
|
2225
2225
|
const Wt = yield Promise.all(X.map((D, W) => I(
|
|
2226
2226
|
Vt(Lt(Lt({}, D), xt[W]), {
|
|
2227
2227
|
graphicControl: Vt(Lt({}, D.graphicControl), {
|
|
2228
2228
|
transparent: !0,
|
|
2229
|
-
transparentIndex:
|
|
2229
|
+
transparentIndex: m
|
|
2230
2230
|
})
|
|
2231
2231
|
})
|
|
2232
2232
|
)));
|
|
2233
2233
|
T.timeEnd("frames:encode"), T.time("output");
|
|
2234
|
-
const
|
|
2234
|
+
const gt = dr(Vt(Lt({}, e), {
|
|
2235
2235
|
colorTable: k,
|
|
2236
|
-
backgroundColorIndex:
|
|
2236
|
+
backgroundColorIndex: m,
|
|
2237
2237
|
width: _,
|
|
2238
2238
|
height: ot
|
|
2239
|
-
})), It = ir(Wt), Y = new Uint8Array(
|
|
2240
|
-
return Y.set(
|
|
2239
|
+
})), It = ir(Wt), Y = new Uint8Array(gt.length + It.byteLength + 1);
|
|
2240
|
+
return Y.set(gt), Y.set(It, gt.byteLength), Y[Y.length - 1] = tr, T.timeEnd("output"), R.reset(), y.frames = [], y.encodeId = 0, Y;
|
|
2241
2241
|
});
|
|
2242
2242
|
}
|
|
2243
2243
|
};
|
|
@@ -2266,7 +2266,7 @@ function yr(e) {
|
|
|
2266
2266
|
return (yield y.worker.call(
|
|
2267
2267
|
"frames:index",
|
|
2268
2268
|
T
|
|
2269
|
-
)) ||
|
|
2269
|
+
)) || mr(T);
|
|
2270
2270
|
});
|
|
2271
2271
|
}
|
|
2272
2272
|
function K(T) {
|
|
@@ -2275,7 +2275,7 @@ function yr(e) {
|
|
|
2275
2275
|
"frames:crop",
|
|
2276
2276
|
T,
|
|
2277
2277
|
T.frames.map((_) => _.imageData.buffer)
|
|
2278
|
-
)) ||
|
|
2278
|
+
)) || pr(T);
|
|
2279
2279
|
});
|
|
2280
2280
|
}
|
|
2281
2281
|
function I(T) {
|
|
@@ -2292,7 +2292,7 @@ function yr(e) {
|
|
|
2292
2292
|
function fr(e) {
|
|
2293
2293
|
return Ct(this, null, function* () {
|
|
2294
2294
|
const { frames: n } = e, u = yr(e);
|
|
2295
|
-
for (let
|
|
2295
|
+
for (let g = n.length, f = 0; f < g; f++)
|
|
2296
2296
|
yield u.encode(n[f]);
|
|
2297
2297
|
return yield u.flush();
|
|
2298
2298
|
});
|
|
@@ -2301,15 +2301,15 @@ const wr = "data:application/javascript;base64,dmFyIEdlPU9iamVjdC5kZWZpbmVQcm9wZ
|
|
|
2301
2301
|
const {
|
|
2302
2302
|
perFrameTime: n = 1e3 / 24,
|
|
2303
2303
|
gif: u,
|
|
2304
|
-
images:
|
|
2304
|
+
images: g,
|
|
2305
2305
|
autoSize: f = !0
|
|
2306
|
-
} = e, w = Tt({}, u),
|
|
2306
|
+
} = e, w = Tt({}, u), m = [];
|
|
2307
2307
|
if (f) {
|
|
2308
|
-
const y = (u == null ? void 0 : u.width) || Math.min(...
|
|
2308
|
+
const y = (u == null ? void 0 : u.width) || Math.min(...g.map((E) => E.width)), v = (u == null ? void 0 : u.height) || Math.min(...g.map((E) => E.height));
|
|
2309
2309
|
w.width = y, w.height = v;
|
|
2310
2310
|
}
|
|
2311
|
-
|
|
2312
|
-
|
|
2311
|
+
g.forEach((y) => {
|
|
2312
|
+
m.push({
|
|
2313
2313
|
imageData: y,
|
|
2314
2314
|
delay: n
|
|
2315
2315
|
});
|
|
@@ -2319,7 +2319,7 @@ const wr = "data:application/javascript;base64,dmFyIEdlPU9iamVjdC5kZWZpbmVQcm9wZ
|
|
|
2319
2319
|
width: w.width || 200,
|
|
2320
2320
|
height: w.height || 200,
|
|
2321
2321
|
maxColors: 255,
|
|
2322
|
-
frames:
|
|
2322
|
+
frames: m
|
|
2323
2323
|
});
|
|
2324
2324
|
return new Blob([s], { type: "image/gif" });
|
|
2325
2325
|
}), Mr = {
|
|
@@ -2329,7 +2329,7 @@ const wr = "data:application/javascript;base64,dmFyIEdlPU9iamVjdC5kZWZpbmVQcm9wZ
|
|
|
2329
2329
|
normalize(e) {
|
|
2330
2330
|
return e ? "true" : void 0;
|
|
2331
2331
|
}
|
|
2332
|
-
}, xr = ({ nodePath: e }) => /* @__PURE__ */ G.createElement(
|
|
2332
|
+
}, xr = ({ nodePath: e }) => /* @__PURE__ */ G.createElement(ge, null, /* @__PURE__ */ G.createElement(
|
|
2333
2333
|
ye,
|
|
2334
2334
|
{
|
|
2335
2335
|
desktop: /* @__PURE__ */ G.createElement(
|
|
@@ -2352,10 +2352,10 @@ function Ae({
|
|
|
2352
2352
|
nodePath: e,
|
|
2353
2353
|
mode: n
|
|
2354
2354
|
}) {
|
|
2355
|
-
const { onUpload: u } = Ze(), { setFieldValue:
|
|
2356
|
-
|
|
2355
|
+
const { onUpload: u } = Ze(), { setFieldValue: g } = fe(), { selectedNode: f } = Se(), { setLock: w } = Ne(), [m, s] = xe(!1), p = G.useRef();
|
|
2356
|
+
p.current || (p.current = Xt(f)), Rt(() => {
|
|
2357
2357
|
var v;
|
|
2358
|
-
Jt((v =
|
|
2358
|
+
Jt((v = p.current) == null ? void 0 : v.data.list, f == null ? void 0 : f.data.list) ? w(!1) : w(!0);
|
|
2359
2359
|
}, [f, w]);
|
|
2360
2360
|
const y = () => Zt(this, null, function* () {
|
|
2361
2361
|
if (f)
|
|
@@ -2367,7 +2367,7 @@ function Ae({
|
|
|
2367
2367
|
images: v,
|
|
2368
2368
|
perFrameTime: 1e3
|
|
2369
2369
|
}), C = yield u == null ? void 0 : u(new File([E], "shopwindow.gif"));
|
|
2370
|
-
|
|
2370
|
+
g(
|
|
2371
2371
|
e,
|
|
2372
2372
|
n === ft.DESKTOP ? "attributes.src" : "mobileAttributes.src",
|
|
2373
2373
|
C
|
|
@@ -2377,7 +2377,7 @@ function Ae({
|
|
|
2377
2377
|
K,
|
|
2378
2378
|
n === ft.DESKTOP ? "attributes.src" : "mobileAttributes.src",
|
|
2379
2379
|
C
|
|
2380
|
-
),
|
|
2380
|
+
), p.current = K;
|
|
2381
2381
|
} catch (v) {
|
|
2382
2382
|
console.error(v), Te.error(String(v));
|
|
2383
2383
|
} finally {
|
|
@@ -2389,7 +2389,7 @@ function Ae({
|
|
|
2389
2389
|
{
|
|
2390
2390
|
name: "3",
|
|
2391
2391
|
header: A("Image"),
|
|
2392
|
-
extra: /* @__PURE__ */ G.createElement(ve, { loading:
|
|
2392
|
+
extra: /* @__PURE__ */ G.createElement(ve, { loading: m, type: "primary", onClick: y }, A("Save as gif"))
|
|
2393
2393
|
},
|
|
2394
2394
|
/* @__PURE__ */ G.createElement(
|
|
2395
2395
|
nt.EditPanelTabsField,
|
|
@@ -2476,7 +2476,7 @@ function Ae({
|
|
|
2476
2476
|
function vr({ index: e, path: n }) {
|
|
2477
2477
|
return /* @__PURE__ */ G.createElement("div", { style: { paddingTop: 20 } }, /* @__PURE__ */ G.createElement(nt.ImageUrl, { path: n, name: `data.list.[${e}].src` }));
|
|
2478
2478
|
}
|
|
2479
|
-
const Tr = ({ nodePath: e }) => /* @__PURE__ */ G.createElement(
|
|
2479
|
+
const Tr = ({ nodePath: e }) => /* @__PURE__ */ G.createElement(ge, null, /* @__PURE__ */ G.createElement(
|
|
2480
2480
|
ye,
|
|
2481
2481
|
{
|
|
2482
2482
|
desktop: /* @__PURE__ */ G.createElement(
|
|
@@ -2499,15 +2499,15 @@ function Qe({
|
|
|
2499
2499
|
nodePath: e,
|
|
2500
2500
|
mode: n
|
|
2501
2501
|
}) {
|
|
2502
|
-
const u = Je(), { onUpload:
|
|
2502
|
+
const u = Je(), { onUpload: g } = Ze(), { setFieldValue: f } = fe(), { selectedNode: w } = Se(), { setLock: m } = Ne(), [s, p] = xe(!1), y = G.useRef();
|
|
2503
2503
|
y.current || (y.current = Xt(w)), Rt(() => {
|
|
2504
|
-
Jt(y.current, w) ?
|
|
2505
|
-
}, [w,
|
|
2504
|
+
Jt(y.current, w) ? m(!1) : m(!0);
|
|
2505
|
+
}, [w, m]);
|
|
2506
2506
|
const v = () => Zt(this, null, function* () {
|
|
2507
2507
|
if (w)
|
|
2508
2508
|
try {
|
|
2509
|
-
|
|
2510
|
-
const E =
|
|
2509
|
+
p(!0);
|
|
2510
|
+
const E = gn.toDOMNode(u, w), C = [], K = w.data;
|
|
2511
2511
|
let I = K.remainingTime;
|
|
2512
2512
|
switch (K.unit) {
|
|
2513
2513
|
case "minute":
|
|
@@ -2523,10 +2523,10 @@ function Qe({
|
|
|
2523
2523
|
for (let P = 0; P < T; P++) {
|
|
2524
2524
|
const { day: R, hour: J, minute: k, second: st } = Re(
|
|
2525
2525
|
I -= 1
|
|
2526
|
-
),
|
|
2526
|
+
), mt = yield Cn(E, {
|
|
2527
2527
|
wrapper(Wt) {
|
|
2528
|
-
const
|
|
2529
|
-
return
|
|
2528
|
+
const gt = document.createElement("table");
|
|
2529
|
+
return gt.style.width = "100%", gt.border = "0", gt.cellPadding = "0", gt.cellSpacing = "0", gt.role = "presentation", gt.style.verticalAlign = "top", gt.appendChild(Wt), gt;
|
|
2530
2530
|
},
|
|
2531
2531
|
styleText: "td {padding: 0px};",
|
|
2532
2532
|
overwrite: [
|
|
@@ -2547,13 +2547,13 @@ function Qe({
|
|
|
2547
2547
|
innerText: st
|
|
2548
2548
|
}
|
|
2549
2549
|
]
|
|
2550
|
-
}), xt = yield Sn(
|
|
2550
|
+
}), xt = yield Sn(mt);
|
|
2551
2551
|
C.push(xt);
|
|
2552
2552
|
}
|
|
2553
2553
|
const X = yield nn({
|
|
2554
2554
|
images: C,
|
|
2555
2555
|
perFrameTime: 1e3
|
|
2556
|
-
}), _ = yield
|
|
2556
|
+
}), _ = yield g == null ? void 0 : g(new File([X], "countdown.gif"));
|
|
2557
2557
|
f(
|
|
2558
2558
|
e,
|
|
2559
2559
|
n === ft.DESKTOP ? "attributes.src" : "mobileAttributes.src",
|
|
@@ -2568,7 +2568,7 @@ function Qe({
|
|
|
2568
2568
|
} catch (E) {
|
|
2569
2569
|
console.error(E), Te.error(String(E));
|
|
2570
2570
|
} finally {
|
|
2571
|
-
|
|
2571
|
+
p(!1);
|
|
2572
2572
|
}
|
|
2573
2573
|
});
|
|
2574
2574
|
return w ? /* @__PURE__ */ G.createElement(we, { defaultActiveKey: ["0", "1", "2", "3"] }, /* @__PURE__ */ G.createElement(
|
|
@@ -2669,22 +2669,14 @@ function Qe({
|
|
|
2669
2669
|
name: "background-color",
|
|
2670
2670
|
label: A("Background color")
|
|
2671
2671
|
}
|
|
2672
|
-
)), /* @__PURE__ */ G.createElement(
|
|
2673
|
-
|
|
2672
|
+
)), /* @__PURE__ */ G.createElement(vt.Item, { name: "2", header: A("Dimension") }, /* @__PURE__ */ G.createElement(
|
|
2673
|
+
it,
|
|
2674
2674
|
{
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
}
|
|
2679
|
-
|
|
2680
|
-
it,
|
|
2681
|
-
{
|
|
2682
|
-
component: nt.Padding,
|
|
2683
|
-
path: e,
|
|
2684
|
-
name: ""
|
|
2685
|
-
}
|
|
2686
|
-
)
|
|
2687
|
-
)) : null;
|
|
2675
|
+
component: nt.Padding,
|
|
2676
|
+
path: e,
|
|
2677
|
+
name: ""
|
|
2678
|
+
}
|
|
2679
|
+
))) : null;
|
|
2688
2680
|
}
|
|
2689
2681
|
function Zr(e) {
|
|
2690
2682
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
@@ -2698,27 +2690,27 @@ var ce = {}, Sr = {
|
|
|
2698
2690
|
}
|
|
2699
2691
|
};
|
|
2700
2692
|
(function(e, n) {
|
|
2701
|
-
(function(u,
|
|
2702
|
-
e.exports =
|
|
2693
|
+
(function(u, g) {
|
|
2694
|
+
e.exports = g();
|
|
2703
2695
|
})(self, function() {
|
|
2704
2696
|
return (() => {
|
|
2705
|
-
var u = { 192: (w,
|
|
2706
|
-
var s,
|
|
2697
|
+
var u = { 192: (w, m) => {
|
|
2698
|
+
var s, p, y = function() {
|
|
2707
2699
|
var v = function(Y, D) {
|
|
2708
|
-
var W = Y, N = X[D], M = null, z = 0, Q = null, j = [], U = {},
|
|
2700
|
+
var W = Y, N = X[D], M = null, z = 0, Q = null, j = [], U = {}, pt = function(a, c) {
|
|
2709
2701
|
M = function(i) {
|
|
2710
|
-
for (var
|
|
2711
|
-
|
|
2702
|
+
for (var b = new Array(i), x = 0; x < i; x += 1) {
|
|
2703
|
+
b[x] = new Array(i);
|
|
2712
2704
|
for (var O = 0; O < i; O += 1)
|
|
2713
|
-
|
|
2705
|
+
b[x][O] = null;
|
|
2714
2706
|
}
|
|
2715
|
-
return
|
|
2707
|
+
return b;
|
|
2716
2708
|
}(z = 4 * W + 17), Z(0, 0), Z(z - 7, 0), Z(0, z - 7), o(), t(), l(a, c), W >= 7 && r(a), Q == null && (Q = d(W, N, j)), h(Q, c);
|
|
2717
2709
|
}, Z = function(a, c) {
|
|
2718
2710
|
for (var i = -1; i <= 7; i += 1)
|
|
2719
2711
|
if (!(a + i <= -1 || z <= a + i))
|
|
2720
|
-
for (var
|
|
2721
|
-
c +
|
|
2712
|
+
for (var b = -1; b <= 7; b += 1)
|
|
2713
|
+
c + b <= -1 || z <= c + b || (M[a + i][c + b] = 0 <= i && i <= 6 && (b == 0 || b == 6) || 0 <= b && b <= 6 && (i == 0 || i == 6) || 2 <= i && i <= 4 && 2 <= b && b <= 4);
|
|
2722
2714
|
}, t = function() {
|
|
2723
2715
|
for (var a = 8; a < z - 8; a += 1)
|
|
2724
2716
|
M[a][6] == null && (M[a][6] = a % 2 == 0);
|
|
@@ -2727,48 +2719,48 @@ var ce = {}, Sr = {
|
|
|
2727
2719
|
}, o = function() {
|
|
2728
2720
|
for (var a = _.getPatternPosition(W), c = 0; c < a.length; c += 1)
|
|
2729
2721
|
for (var i = 0; i < a.length; i += 1) {
|
|
2730
|
-
var
|
|
2731
|
-
if (M[
|
|
2722
|
+
var b = a[c], x = a[i];
|
|
2723
|
+
if (M[b][x] == null)
|
|
2732
2724
|
for (var O = -2; O <= 2; O += 1)
|
|
2733
2725
|
for (var V = -2; V <= 2; V += 1)
|
|
2734
|
-
M[
|
|
2726
|
+
M[b + O][x + V] = O == -2 || O == 2 || V == -2 || V == 2 || O == 0 && V == 0;
|
|
2735
2727
|
}
|
|
2736
2728
|
}, r = function(a) {
|
|
2737
2729
|
for (var c = _.getBCHTypeNumber(W), i = 0; i < 18; i += 1) {
|
|
2738
|
-
var
|
|
2739
|
-
M[Math.floor(i / 3)][i % 3 + z - 8 - 3] =
|
|
2730
|
+
var b = !a && (c >> i & 1) == 1;
|
|
2731
|
+
M[Math.floor(i / 3)][i % 3 + z - 8 - 3] = b;
|
|
2740
2732
|
}
|
|
2741
2733
|
for (i = 0; i < 18; i += 1)
|
|
2742
|
-
|
|
2734
|
+
b = !a && (c >> i & 1) == 1, M[i % 3 + z - 8 - 3][Math.floor(i / 3)] = b;
|
|
2743
2735
|
}, l = function(a, c) {
|
|
2744
|
-
for (var i = N << 3 | c,
|
|
2745
|
-
var O = !a && (
|
|
2736
|
+
for (var i = N << 3 | c, b = _.getBCHTypeInfo(i), x = 0; x < 15; x += 1) {
|
|
2737
|
+
var O = !a && (b >> x & 1) == 1;
|
|
2746
2738
|
x < 6 ? M[x][8] = O : x < 8 ? M[x + 1][8] = O : M[z - 15 + x][8] = O;
|
|
2747
2739
|
}
|
|
2748
2740
|
for (x = 0; x < 15; x += 1)
|
|
2749
|
-
O = !a && (
|
|
2741
|
+
O = !a && (b >> x & 1) == 1, x < 8 ? M[8][z - x - 1] = O : x < 9 ? M[8][15 - x - 1 + 1] = O : M[8][15 - x - 1] = O;
|
|
2750
2742
|
M[z - 8][8] = !a;
|
|
2751
2743
|
}, h = function(a, c) {
|
|
2752
|
-
for (var i = -1,
|
|
2744
|
+
for (var i = -1, b = z - 1, x = 7, O = 0, V = _.getMaskFunction(c), L = z - 1; L > 0; L -= 2)
|
|
2753
2745
|
for (L == 6 && (L -= 1); ; ) {
|
|
2754
2746
|
for (var F = 0; F < 2; F += 1)
|
|
2755
|
-
if (M[
|
|
2747
|
+
if (M[b][L - F] == null) {
|
|
2756
2748
|
var B = !1;
|
|
2757
|
-
O < a.length && (B = (a[O] >>> x & 1) == 1), V(
|
|
2749
|
+
O < a.length && (B = (a[O] >>> x & 1) == 1), V(b, L - F) && (B = !B), M[b][L - F] = B, (x -= 1) == -1 && (O += 1, x = 7);
|
|
2758
2750
|
}
|
|
2759
|
-
if ((
|
|
2760
|
-
|
|
2751
|
+
if ((b += i) < 0 || z <= b) {
|
|
2752
|
+
b -= i, i = -i;
|
|
2761
2753
|
break;
|
|
2762
2754
|
}
|
|
2763
2755
|
}
|
|
2764
2756
|
}, d = function(a, c, i) {
|
|
2765
|
-
for (var
|
|
2757
|
+
for (var b = R.getRSBlocks(a, c), x = J(), O = 0; O < i.length; O += 1) {
|
|
2766
2758
|
var V = i[O];
|
|
2767
2759
|
x.put(V.getMode(), 4), x.put(V.getLength(), _.getLengthInBits(V.getMode(), a)), V.write(x);
|
|
2768
2760
|
}
|
|
2769
2761
|
var L = 0;
|
|
2770
|
-
for (O = 0; O <
|
|
2771
|
-
L +=
|
|
2762
|
+
for (O = 0; O < b.length; O += 1)
|
|
2763
|
+
L += b[O].dataCount;
|
|
2772
2764
|
if (x.getLengthInBits() > 8 * L)
|
|
2773
2765
|
throw "code length overflow. (" + x.getLengthInBits() + ">" + 8 * L + ")";
|
|
2774
2766
|
for (x.getLengthInBits() + 4 <= 8 * L && x.put(0, 4); x.getLengthInBits() % 8 != 0; )
|
|
@@ -2788,10 +2780,10 @@ var ce = {}, Sr = {
|
|
|
2788
2780
|
q[et][rt] = ht >= 0 ? ct.getAt(ht) : 0;
|
|
2789
2781
|
}
|
|
2790
2782
|
}
|
|
2791
|
-
var
|
|
2783
|
+
var bt = 0;
|
|
2792
2784
|
for (rt = 0; rt < B.length; rt += 1)
|
|
2793
|
-
|
|
2794
|
-
var yt = new Array(
|
|
2785
|
+
bt += B[rt].totalCount;
|
|
2786
|
+
var yt = new Array(bt), wt = 0;
|
|
2795
2787
|
for (rt = 0; rt < lt; rt += 1)
|
|
2796
2788
|
for (et = 0; et < B.length; et += 1)
|
|
2797
2789
|
rt < tt[et].length && (yt[wt] = tt[et][rt], wt += 1);
|
|
@@ -2799,7 +2791,7 @@ var ce = {}, Sr = {
|
|
|
2799
2791
|
for (et = 0; et < B.length; et += 1)
|
|
2800
2792
|
rt < q[et].length && (yt[wt] = q[et][rt], wt += 1);
|
|
2801
2793
|
return yt;
|
|
2802
|
-
}(x,
|
|
2794
|
+
}(x, b);
|
|
2803
2795
|
};
|
|
2804
2796
|
U.addData = function(a, c) {
|
|
2805
2797
|
var i = null;
|
|
@@ -2811,7 +2803,7 @@ var ce = {}, Sr = {
|
|
|
2811
2803
|
i = st(a);
|
|
2812
2804
|
break;
|
|
2813
2805
|
case "Byte":
|
|
2814
|
-
i =
|
|
2806
|
+
i = mt(a);
|
|
2815
2807
|
break;
|
|
2816
2808
|
case "Kanji":
|
|
2817
2809
|
i = xt(a);
|
|
@@ -2829,21 +2821,21 @@ var ce = {}, Sr = {
|
|
|
2829
2821
|
}, U.make = function() {
|
|
2830
2822
|
if (W < 1) {
|
|
2831
2823
|
for (var a = 1; a < 40; a++) {
|
|
2832
|
-
for (var c = R.getRSBlocks(a, N), i = J(),
|
|
2833
|
-
var x = j[
|
|
2824
|
+
for (var c = R.getRSBlocks(a, N), i = J(), b = 0; b < j.length; b++) {
|
|
2825
|
+
var x = j[b];
|
|
2834
2826
|
i.put(x.getMode(), 4), i.put(x.getLength(), _.getLengthInBits(x.getMode(), a)), x.write(i);
|
|
2835
2827
|
}
|
|
2836
2828
|
var O = 0;
|
|
2837
|
-
for (
|
|
2838
|
-
O += c[
|
|
2829
|
+
for (b = 0; b < c.length; b++)
|
|
2830
|
+
O += c[b].dataCount;
|
|
2839
2831
|
if (i.getLengthInBits() <= 8 * O)
|
|
2840
2832
|
break;
|
|
2841
2833
|
}
|
|
2842
2834
|
W = a;
|
|
2843
2835
|
}
|
|
2844
|
-
|
|
2836
|
+
pt(!1, function() {
|
|
2845
2837
|
for (var V = 0, L = 0, F = 0; F < 8; F += 1) {
|
|
2846
|
-
|
|
2838
|
+
pt(!0, F);
|
|
2847
2839
|
var B = _.getLostPoint(U);
|
|
2848
2840
|
(F == 0 || V > B) && (V = B, L = F);
|
|
2849
2841
|
}
|
|
@@ -2853,40 +2845,40 @@ var ce = {}, Sr = {
|
|
|
2853
2845
|
a = a || 2;
|
|
2854
2846
|
var i = "";
|
|
2855
2847
|
i += '<table style="', i += " border-width: 0px; border-style: none;", i += " border-collapse: collapse;", i += " padding: 0px; margin: " + (c = c === void 0 ? 4 * a : c) + "px;", i += '">', i += "<tbody>";
|
|
2856
|
-
for (var
|
|
2848
|
+
for (var b = 0; b < U.getModuleCount(); b += 1) {
|
|
2857
2849
|
i += "<tr>";
|
|
2858
2850
|
for (var x = 0; x < U.getModuleCount(); x += 1)
|
|
2859
|
-
i += '<td style="', i += " border-width: 0px; border-style: none;", i += " border-collapse: collapse;", i += " padding: 0px; margin: 0px;", i += " width: " + a + "px;", i += " height: " + a + "px;", i += " background-color: ", i += U.isDark(
|
|
2851
|
+
i += '<td style="', i += " border-width: 0px; border-style: none;", i += " border-collapse: collapse;", i += " padding: 0px; margin: 0px;", i += " width: " + a + "px;", i += " height: " + a + "px;", i += " background-color: ", i += U.isDark(b, x) ? "#000000" : "#ffffff", i += ";", i += '"/>';
|
|
2860
2852
|
i += "</tr>";
|
|
2861
2853
|
}
|
|
2862
2854
|
return (i += "</tbody>") + "</table>";
|
|
2863
|
-
}, U.createSvgTag = function(a, c, i,
|
|
2855
|
+
}, U.createSvgTag = function(a, c, i, b) {
|
|
2864
2856
|
var x = {};
|
|
2865
|
-
typeof arguments[0] == "object" && (a = (x = arguments[0]).cellSize, c = x.margin, i = x.alt,
|
|
2857
|
+
typeof arguments[0] == "object" && (a = (x = arguments[0]).cellSize, c = x.margin, i = x.alt, b = x.title), a = a || 2, c = c === void 0 ? 4 * a : c, (i = typeof i == "string" ? { text: i } : i || {}).text = i.text || null, i.id = i.text ? i.id || "qrcode-description" : null, (b = typeof b == "string" ? { text: b } : b || {}).text = b.text || null, b.id = b.text ? b.id || "qrcode-title" : null;
|
|
2866
2858
|
var O, V, L, F, B = U.getModuleCount() * a + 2 * c, $ = "";
|
|
2867
|
-
for (F = "l" + a + ",0 0," + a + " -" + a + ",0 0,-" + a + "z ", $ += '<svg version="1.1" xmlns="http://www.w3.org/2000/svg"', $ += x.scalable ? "" : ' width="' + B + 'px" height="' + B + 'px"', $ += ' viewBox="0 0 ' + B + " " + B + '" ', $ += ' preserveAspectRatio="xMinYMin meet"', $ +=
|
|
2859
|
+
for (F = "l" + a + ",0 0," + a + " -" + a + ",0 0,-" + a + "z ", $ += '<svg version="1.1" xmlns="http://www.w3.org/2000/svg"', $ += x.scalable ? "" : ' width="' + B + 'px" height="' + B + 'px"', $ += ' viewBox="0 0 ' + B + " " + B + '" ', $ += ' preserveAspectRatio="xMinYMin meet"', $ += b.text || i.text ? ' role="img" aria-labelledby="' + S([b.id, i.id].join(" ").trim()) + '"' : "", $ += ">", $ += b.text ? '<title id="' + S(b.id) + '">' + S(b.text) + "</title>" : "", $ += i.text ? '<description id="' + S(i.id) + '">' + S(i.text) + "</description>" : "", $ += '<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>', $ += '<path d="', V = 0; V < U.getModuleCount(); V += 1)
|
|
2868
2860
|
for (L = V * a + c, O = 0; O < U.getModuleCount(); O += 1)
|
|
2869
2861
|
U.isDark(V, O) && ($ += "M" + (O * a + c) + "," + L + F);
|
|
2870
2862
|
return ($ += '" stroke="transparent" fill="black"/>') + "</svg>";
|
|
2871
2863
|
}, U.createDataURL = function(a, c) {
|
|
2872
2864
|
a = a || 2, c = c === void 0 ? 4 * a : c;
|
|
2873
|
-
var i = U.getModuleCount() * a + 2 * c,
|
|
2865
|
+
var i = U.getModuleCount() * a + 2 * c, b = c, x = i - c;
|
|
2874
2866
|
return It(i, i, function(O, V) {
|
|
2875
|
-
if (
|
|
2876
|
-
var L = Math.floor((O -
|
|
2867
|
+
if (b <= O && O < x && b <= V && V < x) {
|
|
2868
|
+
var L = Math.floor((O - b) / a), F = Math.floor((V - b) / a);
|
|
2877
2869
|
return U.isDark(F, L) ? 0 : 1;
|
|
2878
2870
|
}
|
|
2879
2871
|
return 1;
|
|
2880
2872
|
});
|
|
2881
2873
|
}, U.createImgTag = function(a, c, i) {
|
|
2882
2874
|
a = a || 2, c = c === void 0 ? 4 * a : c;
|
|
2883
|
-
var
|
|
2884
|
-
return x += "<img", x += ' src="', x += U.createDataURL(a, c), x += '"', x += ' width="', x +=
|
|
2875
|
+
var b = U.getModuleCount() * a + 2 * c, x = "";
|
|
2876
|
+
return x += "<img", x += ' src="', x += U.createDataURL(a, c), x += '"', x += ' width="', x += b, x += '"', x += ' height="', x += b, x += '"', i && (x += ' alt="', x += S(i), x += '"'), x + "/>";
|
|
2885
2877
|
};
|
|
2886
2878
|
var S = function(a) {
|
|
2887
2879
|
for (var c = "", i = 0; i < a.length; i += 1) {
|
|
2888
|
-
var
|
|
2889
|
-
switch (
|
|
2880
|
+
var b = a.charAt(i);
|
|
2881
|
+
switch (b) {
|
|
2890
2882
|
case "<":
|
|
2891
2883
|
c += "<";
|
|
2892
2884
|
break;
|
|
@@ -2900,7 +2892,7 @@ var ce = {}, Sr = {
|
|
|
2900
2892
|
c += """;
|
|
2901
2893
|
break;
|
|
2902
2894
|
default:
|
|
2903
|
-
c +=
|
|
2895
|
+
c += b;
|
|
2904
2896
|
}
|
|
2905
2897
|
}
|
|
2906
2898
|
return c;
|
|
@@ -2909,20 +2901,20 @@ var ce = {}, Sr = {
|
|
|
2909
2901
|
if ((a = a || 1) < 2)
|
|
2910
2902
|
return function(tt) {
|
|
2911
2903
|
tt = tt === void 0 ? 2 : tt;
|
|
2912
|
-
var q, et, Mt, dt, rt, ut = 1 * U.getModuleCount() + 2 * tt, ct = tt, ht = ut - tt,
|
|
2904
|
+
var q, et, Mt, dt, rt, ut = 1 * U.getModuleCount() + 2 * tt, ct = tt, ht = ut - tt, bt = { "██": "█", "█ ": "▀", " █": "▄", " ": " " }, yt = { "██": "▀", "█ ": "▀", " █": " ", " ": " " }, wt = "";
|
|
2913
2905
|
for (q = 0; q < ut; q += 2) {
|
|
2914
2906
|
for (Mt = Math.floor((q - ct) / 1), dt = Math.floor((q + 1 - ct) / 1), et = 0; et < ut; et += 1)
|
|
2915
|
-
rt = "█", ct <= et && et < ht && ct <= q && q < ht && U.isDark(Mt, Math.floor((et - ct) / 1)) && (rt = " "), ct <= et && et < ht && ct <= q + 1 && q + 1 < ht && U.isDark(dt, Math.floor((et - ct) / 1)) ? rt += " " : rt += "█", wt += tt < 1 && q + 1 >= ht ? yt[rt] :
|
|
2907
|
+
rt = "█", ct <= et && et < ht && ct <= q && q < ht && U.isDark(Mt, Math.floor((et - ct) / 1)) && (rt = " "), ct <= et && et < ht && ct <= q + 1 && q + 1 < ht && U.isDark(dt, Math.floor((et - ct) / 1)) ? rt += " " : rt += "█", wt += tt < 1 && q + 1 >= ht ? yt[rt] : bt[rt];
|
|
2916
2908
|
wt += `
|
|
2917
2909
|
`;
|
|
2918
2910
|
}
|
|
2919
2911
|
return ut % 2 && tt > 0 ? wt.substring(0, wt.length - ut - 1) + Array(ut + 1).join("▀") : wt.substring(0, wt.length - 1);
|
|
2920
2912
|
}(c);
|
|
2921
2913
|
a -= 1, c = c === void 0 ? 2 * a : c;
|
|
2922
|
-
var i,
|
|
2914
|
+
var i, b, x, O, V = U.getModuleCount() * a + 2 * c, L = c, F = V - c, B = Array(a + 1).join("██"), $ = Array(a + 1).join(" "), lt = "", H = "";
|
|
2923
2915
|
for (i = 0; i < V; i += 1) {
|
|
2924
|
-
for (x = Math.floor((i - L) / a), H = "",
|
|
2925
|
-
O = 1, L <=
|
|
2916
|
+
for (x = Math.floor((i - L) / a), H = "", b = 0; b < V; b += 1)
|
|
2917
|
+
O = 1, L <= b && b < F && L <= i && i < F && U.isDark(x, Math.floor((b - L) / a)) && (O = 0), H += O ? B : $;
|
|
2926
2918
|
for (x = 0; x < a; x += 1)
|
|
2927
2919
|
lt += H + `
|
|
2928
2920
|
`;
|
|
@@ -2930,9 +2922,9 @@ var ce = {}, Sr = {
|
|
|
2930
2922
|
return lt.substring(0, lt.length - 1);
|
|
2931
2923
|
}, U.renderTo2dContext = function(a, c) {
|
|
2932
2924
|
c = c || 2;
|
|
2933
|
-
for (var i = U.getModuleCount(),
|
|
2925
|
+
for (var i = U.getModuleCount(), b = 0; b < i; b++)
|
|
2934
2926
|
for (var x = 0; x < i; x++)
|
|
2935
|
-
a.fillStyle = U.isDark(
|
|
2927
|
+
a.fillStyle = U.isDark(b, x) ? "black" : "white", a.fillRect(b * c, x * c, c, c);
|
|
2936
2928
|
}, U;
|
|
2937
2929
|
};
|
|
2938
2930
|
v.stringToBytes = (v.stringToBytesFuncs = { default: function(Y) {
|
|
@@ -2943,7 +2935,7 @@ var ce = {}, Sr = {
|
|
|
2943
2935
|
return D;
|
|
2944
2936
|
} }).default, v.createStringToBytes = function(Y, D) {
|
|
2945
2937
|
var W = function() {
|
|
2946
|
-
for (var M =
|
|
2938
|
+
for (var M = gt(Y), z = function() {
|
|
2947
2939
|
var t = M.read();
|
|
2948
2940
|
if (t == -1)
|
|
2949
2941
|
throw "eof";
|
|
@@ -2952,8 +2944,8 @@ var ce = {}, Sr = {
|
|
|
2952
2944
|
var U = M.read();
|
|
2953
2945
|
if (U == -1)
|
|
2954
2946
|
break;
|
|
2955
|
-
var
|
|
2956
|
-
j[String.fromCharCode(U << 8 |
|
|
2947
|
+
var pt = z(), Z = z() << 8 | z();
|
|
2948
|
+
j[String.fromCharCode(U << 8 | pt)] = Z, Q += 1;
|
|
2957
2949
|
}
|
|
2958
2950
|
if (Q != D)
|
|
2959
2951
|
throw Q + " != " + D;
|
|
@@ -3080,8 +3072,8 @@ var ce = {}, Sr = {
|
|
|
3080
3072
|
}
|
|
3081
3073
|
for (N = 0; N < D - 1; N += 1)
|
|
3082
3074
|
for (M = 0; M < D - 1; M += 1) {
|
|
3083
|
-
var
|
|
3084
|
-
Y.isDark(N, M) && (
|
|
3075
|
+
var pt = 0;
|
|
3076
|
+
Y.isDark(N, M) && (pt += 1), Y.isDark(N + 1, M) && (pt += 1), Y.isDark(N, M + 1) && (pt += 1), Y.isDark(N + 1, M + 1) && (pt += 1), pt != 0 && pt != 4 || (W += 3);
|
|
3085
3077
|
}
|
|
3086
3078
|
for (N = 0; N < D; N += 1)
|
|
3087
3079
|
for (M = 0; M < D - 6; M += 1)
|
|
@@ -3164,7 +3156,7 @@ var ce = {}, Sr = {
|
|
|
3164
3156
|
if (z === void 0)
|
|
3165
3157
|
throw "bad rs block @ typeNumber:" + N + "/errorCorrectionLevel:" + M;
|
|
3166
3158
|
for (var Q = z.length / 3, j = [], U = 0; U < Q; U += 1)
|
|
3167
|
-
for (var
|
|
3159
|
+
for (var pt = z[3 * U + 0], Z = z[3 * U + 1], t = z[3 * U + 2], o = 0; o < pt; o += 1)
|
|
3168
3160
|
j.push(D(Z, t));
|
|
3169
3161
|
return j;
|
|
3170
3162
|
} };
|
|
@@ -3242,7 +3234,7 @@ var ce = {}, Sr = {
|
|
|
3242
3234
|
}
|
|
3243
3235
|
};
|
|
3244
3236
|
return W;
|
|
3245
|
-
},
|
|
3237
|
+
}, mt = function(Y) {
|
|
3246
3238
|
var D = v.stringToBytes(Y);
|
|
3247
3239
|
return { getMode: function() {
|
|
3248
3240
|
return 4;
|
|
@@ -3303,7 +3295,7 @@ var ce = {}, Sr = {
|
|
|
3303
3295
|
return W + "]";
|
|
3304
3296
|
} };
|
|
3305
3297
|
return D;
|
|
3306
|
-
},
|
|
3298
|
+
}, gt = function(Y) {
|
|
3307
3299
|
var D = Y, W = 0, N = 0, M = 0, z = { read: function() {
|
|
3308
3300
|
for (; M < 8; ) {
|
|
3309
3301
|
if (W >= D.length) {
|
|
@@ -3344,7 +3336,7 @@ var ce = {}, Sr = {
|
|
|
3344
3336
|
a.writeByte(255), a.writeBytes(c, i, 255), i += 255;
|
|
3345
3337
|
a.writeByte(c.length - i), a.writeBytes(c, i, c.length - i), a.writeByte(0), a.writeString(";");
|
|
3346
3338
|
} }, d = function(a) {
|
|
3347
|
-
for (var c = 1 << a, i = 1 + (1 << a),
|
|
3339
|
+
for (var c = 1 << a, i = 1 + (1 << a), b = a + 1, x = S(), O = 0; O < c; O += 1)
|
|
3348
3340
|
x.add(String.fromCharCode(O));
|
|
3349
3341
|
x.add(String.fromCharCode(c)), x.add(String.fromCharCode(i));
|
|
3350
3342
|
var V, L, F, B = Wt(), $ = (V = B, L = 0, F = 0, { write: function(q, et) {
|
|
@@ -3356,24 +3348,24 @@ var ce = {}, Sr = {
|
|
|
3356
3348
|
}, flush: function() {
|
|
3357
3349
|
L > 0 && V.writeByte(F);
|
|
3358
3350
|
} });
|
|
3359
|
-
$.write(c,
|
|
3351
|
+
$.write(c, b);
|
|
3360
3352
|
var lt = 0, H = String.fromCharCode(l[lt]);
|
|
3361
3353
|
for (lt += 1; lt < l.length; ) {
|
|
3362
3354
|
var tt = String.fromCharCode(l[lt]);
|
|
3363
|
-
lt += 1, x.contains(H + tt) ? H += tt : ($.write(x.indexOf(H),
|
|
3355
|
+
lt += 1, x.contains(H + tt) ? H += tt : ($.write(x.indexOf(H), b), x.size() < 4095 && (x.size() == 1 << b && (b += 1), x.add(H + tt)), H = tt);
|
|
3364
3356
|
}
|
|
3365
|
-
return $.write(x.indexOf(H),
|
|
3357
|
+
return $.write(x.indexOf(H), b), $.write(i, b), $.flush(), B.toByteArray();
|
|
3366
3358
|
}, S = function() {
|
|
3367
|
-
var a = {}, c = 0, i = { add: function(
|
|
3368
|
-
if (i.contains(
|
|
3369
|
-
throw "dup key:" +
|
|
3370
|
-
a[
|
|
3359
|
+
var a = {}, c = 0, i = { add: function(b) {
|
|
3360
|
+
if (i.contains(b))
|
|
3361
|
+
throw "dup key:" + b;
|
|
3362
|
+
a[b] = c, c += 1;
|
|
3371
3363
|
}, size: function() {
|
|
3372
3364
|
return c;
|
|
3373
|
-
}, indexOf: function(
|
|
3374
|
-
return a[
|
|
3375
|
-
}, contains: function(
|
|
3376
|
-
return a[
|
|
3365
|
+
}, indexOf: function(b) {
|
|
3366
|
+
return a[b];
|
|
3367
|
+
}, contains: function(b) {
|
|
3368
|
+
return a[b] !== void 0;
|
|
3377
3369
|
} };
|
|
3378
3370
|
return i;
|
|
3379
3371
|
};
|
|
@@ -3411,8 +3403,8 @@ var ce = {}, Sr = {
|
|
|
3411
3403
|
}, l.toString = function() {
|
|
3412
3404
|
return r;
|
|
3413
3405
|
}, l;
|
|
3414
|
-
}(), U = Q.toByteArray(),
|
|
3415
|
-
j.writeByte(U[
|
|
3406
|
+
}(), U = Q.toByteArray(), pt = 0; pt < U.length; pt += 1)
|
|
3407
|
+
j.writeByte(U[pt]);
|
|
3416
3408
|
return j.flush(), "data:image/gif;base64," + j;
|
|
3417
3409
|
};
|
|
3418
3410
|
return v;
|
|
@@ -3425,13 +3417,13 @@ var ce = {}, Sr = {
|
|
|
3425
3417
|
}
|
|
3426
3418
|
return C;
|
|
3427
3419
|
}(v);
|
|
3428
|
-
}, (
|
|
3420
|
+
}, (p = typeof (s = function() {
|
|
3429
3421
|
return y;
|
|
3430
|
-
}) == "function" ? s.apply(
|
|
3431
|
-
}, 676: (w,
|
|
3432
|
-
s.d(
|
|
3433
|
-
var
|
|
3434
|
-
return (
|
|
3422
|
+
}) == "function" ? s.apply(m, []) : s) === void 0 || (w.exports = p);
|
|
3423
|
+
}, 676: (w, m, s) => {
|
|
3424
|
+
s.d(m, { default: () => pt });
|
|
3425
|
+
var p = function() {
|
|
3426
|
+
return (p = Object.assign || function(Z) {
|
|
3435
3427
|
for (var t, o = 1, r = arguments.length; o < r; o++)
|
|
3436
3428
|
for (var l in t = arguments[o])
|
|
3437
3429
|
Object.prototype.hasOwnProperty.call(t, l) && (Z[l] = t[l]);
|
|
@@ -3454,7 +3446,7 @@ var ce = {}, Sr = {
|
|
|
3454
3446
|
if (!t.length)
|
|
3455
3447
|
return Z;
|
|
3456
3448
|
var r = t.shift();
|
|
3457
|
-
return r !== void 0 && v(Z) && v(r) ? (Z =
|
|
3449
|
+
return r !== void 0 && v(Z) && v(r) ? (Z = p({}, Z), Object.keys(r).forEach(function(l) {
|
|
3458
3450
|
var h = Z[l], d = r[l];
|
|
3459
3451
|
Array.isArray(h) && Array.isArray(d) ? Z[l] = d : v(h) && v(d) ? Z[l] = E(Object.assign({}, h), d) : Z[l] = d;
|
|
3460
3452
|
}), E.apply(void 0, y([Z], t))) : Z;
|
|
@@ -3466,7 +3458,7 @@ var ce = {}, Sr = {
|
|
|
3466
3458
|
function K(Z) {
|
|
3467
3459
|
return t = this, o = void 0, l = function() {
|
|
3468
3460
|
return function(h, d) {
|
|
3469
|
-
var S, a, c, i,
|
|
3461
|
+
var S, a, c, i, b = { label: 0, sent: function() {
|
|
3470
3462
|
if (1 & c[0])
|
|
3471
3463
|
throw c[1];
|
|
3472
3464
|
return c[1];
|
|
@@ -3479,7 +3471,7 @@ var ce = {}, Sr = {
|
|
|
3479
3471
|
return function(L) {
|
|
3480
3472
|
if (S)
|
|
3481
3473
|
throw new TypeError("Generator is already executing.");
|
|
3482
|
-
for (;
|
|
3474
|
+
for (; b; )
|
|
3483
3475
|
try {
|
|
3484
3476
|
if (S = 1, a && (c = 2 & L[0] ? a.return : L[0] ? a.throw || ((c = a.return) && c.call(a), 0) : a.next) && !(c = c.call(a, L[1])).done)
|
|
3485
3477
|
return c;
|
|
@@ -3489,34 +3481,34 @@ var ce = {}, Sr = {
|
|
|
3489
3481
|
c = L;
|
|
3490
3482
|
break;
|
|
3491
3483
|
case 4:
|
|
3492
|
-
return
|
|
3484
|
+
return b.label++, { value: L[1], done: !1 };
|
|
3493
3485
|
case 5:
|
|
3494
|
-
|
|
3486
|
+
b.label++, a = L[1], L = [0];
|
|
3495
3487
|
continue;
|
|
3496
3488
|
case 7:
|
|
3497
|
-
L =
|
|
3489
|
+
L = b.ops.pop(), b.trys.pop();
|
|
3498
3490
|
continue;
|
|
3499
3491
|
default:
|
|
3500
|
-
if (!((c = (c =
|
|
3501
|
-
|
|
3492
|
+
if (!((c = (c = b.trys).length > 0 && c[c.length - 1]) || L[0] !== 6 && L[0] !== 2)) {
|
|
3493
|
+
b = 0;
|
|
3502
3494
|
continue;
|
|
3503
3495
|
}
|
|
3504
3496
|
if (L[0] === 3 && (!c || L[1] > c[0] && L[1] < c[3])) {
|
|
3505
|
-
|
|
3497
|
+
b.label = L[1];
|
|
3506
3498
|
break;
|
|
3507
3499
|
}
|
|
3508
|
-
if (L[0] === 6 &&
|
|
3509
|
-
|
|
3500
|
+
if (L[0] === 6 && b.label < c[1]) {
|
|
3501
|
+
b.label = c[1], c = L;
|
|
3510
3502
|
break;
|
|
3511
3503
|
}
|
|
3512
|
-
if (c &&
|
|
3513
|
-
|
|
3504
|
+
if (c && b.label < c[2]) {
|
|
3505
|
+
b.label = c[2], b.ops.push(L);
|
|
3514
3506
|
break;
|
|
3515
3507
|
}
|
|
3516
|
-
c[2] &&
|
|
3508
|
+
c[2] && b.ops.pop(), b.trys.pop();
|
|
3517
3509
|
continue;
|
|
3518
3510
|
}
|
|
3519
|
-
L = d.call(h,
|
|
3511
|
+
L = d.call(h, b);
|
|
3520
3512
|
} catch (F) {
|
|
3521
3513
|
L = [6, F], a = 0;
|
|
3522
3514
|
} finally {
|
|
@@ -3543,21 +3535,21 @@ var ce = {}, Sr = {
|
|
|
3543
3535
|
function S(i) {
|
|
3544
3536
|
try {
|
|
3545
3537
|
c(l.next(i));
|
|
3546
|
-
} catch (
|
|
3547
|
-
d(
|
|
3538
|
+
} catch (b) {
|
|
3539
|
+
d(b);
|
|
3548
3540
|
}
|
|
3549
3541
|
}
|
|
3550
3542
|
function a(i) {
|
|
3551
3543
|
try {
|
|
3552
3544
|
c(l.throw(i));
|
|
3553
|
-
} catch (
|
|
3554
|
-
d(
|
|
3545
|
+
} catch (b) {
|
|
3546
|
+
d(b);
|
|
3555
3547
|
}
|
|
3556
3548
|
}
|
|
3557
3549
|
function c(i) {
|
|
3558
|
-
var
|
|
3559
|
-
i.done ? h(i.value) : (
|
|
3560
|
-
x(
|
|
3550
|
+
var b;
|
|
3551
|
+
i.done ? h(i.value) : (b = i.value, b instanceof r ? b : new r(function(x) {
|
|
3552
|
+
x(b);
|
|
3561
3553
|
})).then(S, a);
|
|
3562
3554
|
}
|
|
3563
3555
|
c((l = l.apply(t, o || [])).next());
|
|
@@ -3647,11 +3639,11 @@ var ce = {}, Sr = {
|
|
|
3647
3639
|
this._basicSquare({ x: o, y: r, size: l, rotation: 0 });
|
|
3648
3640
|
else {
|
|
3649
3641
|
if (i === 2) {
|
|
3650
|
-
var
|
|
3651
|
-
return d && a ?
|
|
3642
|
+
var b = 0;
|
|
3643
|
+
return d && a ? b = Math.PI / 2 : a && S ? b = Math.PI : S && c && (b = -Math.PI / 2), void this._basicCornerRounded({ x: o, y: r, size: l, rotation: b });
|
|
3652
3644
|
}
|
|
3653
3645
|
if (i === 1)
|
|
3654
|
-
return
|
|
3646
|
+
return b = 0, a ? b = Math.PI / 2 : S ? b = Math.PI : c && (b = -Math.PI / 2), void this._basicSideRounded({ x: o, y: r, size: l, rotation: b });
|
|
3655
3647
|
}
|
|
3656
3648
|
else
|
|
3657
3649
|
this._basicDot({ x: o, y: r, size: l, rotation: 0 });
|
|
@@ -3662,11 +3654,11 @@ var ce = {}, Sr = {
|
|
|
3662
3654
|
this._basicSquare({ x: o, y: r, size: l, rotation: 0 });
|
|
3663
3655
|
else {
|
|
3664
3656
|
if (i === 2) {
|
|
3665
|
-
var
|
|
3666
|
-
return d && a ?
|
|
3657
|
+
var b = 0;
|
|
3658
|
+
return d && a ? b = Math.PI / 2 : a && S ? b = Math.PI : S && c && (b = -Math.PI / 2), void this._basicCornerExtraRounded({ x: o, y: r, size: l, rotation: b });
|
|
3667
3659
|
}
|
|
3668
3660
|
if (i === 1)
|
|
3669
|
-
return
|
|
3661
|
+
return b = 0, a ? b = Math.PI / 2 : S ? b = Math.PI : c && (b = -Math.PI / 2), void this._basicSideRounded({ x: o, y: r, size: l, rotation: b });
|
|
3670
3662
|
}
|
|
3671
3663
|
else
|
|
3672
3664
|
this._basicDot({ x: o, y: r, size: l, rotation: 0 });
|
|
@@ -3797,8 +3789,8 @@ var ce = {}, Sr = {
|
|
|
3797
3789
|
}
|
|
3798
3790
|
function a(c) {
|
|
3799
3791
|
var i;
|
|
3800
|
-
c.done ? l(c.value) : (i = c.value, i instanceof o ? i : new o(function(
|
|
3801
|
-
|
|
3792
|
+
c.done ? l(c.value) : (i = c.value, i instanceof o ? i : new o(function(b) {
|
|
3793
|
+
b(i);
|
|
3802
3794
|
})).then(d, S);
|
|
3803
3795
|
}
|
|
3804
3796
|
a((r = r.apply(Z, t || [])).next());
|
|
@@ -3855,8 +3847,8 @@ var ce = {}, Sr = {
|
|
|
3855
3847
|
continue;
|
|
3856
3848
|
}
|
|
3857
3849
|
i = t.call(Z, d);
|
|
3858
|
-
} catch (
|
|
3859
|
-
i = [6,
|
|
3850
|
+
} catch (b) {
|
|
3851
|
+
i = [6, b], r = 0;
|
|
3860
3852
|
} finally {
|
|
3861
3853
|
o = l = 0;
|
|
3862
3854
|
}
|
|
@@ -3866,7 +3858,7 @@ var ce = {}, Sr = {
|
|
|
3866
3858
|
}([a, c]);
|
|
3867
3859
|
};
|
|
3868
3860
|
}
|
|
3869
|
-
},
|
|
3861
|
+
}, mt = [[1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1]], xt = [[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]];
|
|
3870
3862
|
const Wt = function() {
|
|
3871
3863
|
function Z(t) {
|
|
3872
3864
|
this._element = document.createElementNS("http://www.w3.org/2000/svg", "svg"), this._element.setAttribute("width", String(t.width)), this._element.setAttribute("height", String(t.height)), this._defs = document.createElementNS("http://www.w3.org/2000/svg", "defs"), this._element.appendChild(this._defs), this._options = t;
|
|
@@ -3879,7 +3871,7 @@ var ce = {}, Sr = {
|
|
|
3879
3871
|
return this._element;
|
|
3880
3872
|
}, Z.prototype.drawQR = function(t) {
|
|
3881
3873
|
return k(this, void 0, void 0, function() {
|
|
3882
|
-
var o, r, l, h, d, S, a, c, i,
|
|
3874
|
+
var o, r, l, h, d, S, a, c, i, b, x = this;
|
|
3883
3875
|
return st(this, function(O) {
|
|
3884
3876
|
switch (O.label) {
|
|
3885
3877
|
case 0:
|
|
@@ -3887,17 +3879,17 @@ var ce = {}, Sr = {
|
|
|
3887
3879
|
case 1:
|
|
3888
3880
|
if (O.sent(), !this._image)
|
|
3889
3881
|
return [2];
|
|
3890
|
-
S = this._options, a = S.imageOptions, c = S.qrOptions, i = a.imageSize * I[c.errorCorrectionLevel],
|
|
3882
|
+
S = this._options, a = S.imageOptions, c = S.qrOptions, i = a.imageSize * I[c.errorCorrectionLevel], b = Math.floor(i * o * o), d = function(V) {
|
|
3891
3883
|
var L = V.originalHeight, F = V.originalWidth, B = V.maxHiddenDots, $ = V.maxHiddenAxisDots, lt = V.dotSize, H = { x: 0, y: 0 }, tt = { x: 0, y: 0 };
|
|
3892
3884
|
if (L <= 0 || F <= 0 || B <= 0 || lt <= 0)
|
|
3893
3885
|
return { height: 0, width: 0, hideYDots: 0, hideXDots: 0 };
|
|
3894
3886
|
var q = L / F;
|
|
3895
3887
|
return H.x = Math.floor(Math.sqrt(B / q)), H.x <= 0 && (H.x = 1), $ && $ < H.x && (H.x = $), H.x % 2 == 0 && H.x--, tt.x = H.x * lt, H.y = 1 + 2 * Math.ceil((H.x * q - 1) / 2), tt.y = Math.round(tt.x * q), (H.y * H.x > B || $ && $ < H.y) && ($ && $ < H.y ? (H.y = $, H.y % 2 == 0 && H.x--) : H.y -= 2, tt.y = H.y * lt, H.x = 1 + 2 * Math.ceil((H.y / q - 1) / 2), tt.x = Math.round(tt.y / q)), { height: tt.y, width: tt.x, hideYDots: H.y, hideXDots: H.x };
|
|
3896
|
-
}({ originalWidth: this._image.width, originalHeight: this._image.height, maxHiddenDots:
|
|
3888
|
+
}({ originalWidth: this._image.width, originalHeight: this._image.height, maxHiddenDots: b, maxHiddenAxisDots: o - 14, dotSize: h }), O.label = 2;
|
|
3897
3889
|
case 2:
|
|
3898
3890
|
return this.drawBackground(), this.drawDots(function(V, L) {
|
|
3899
3891
|
var F, B, $, lt, H, tt;
|
|
3900
|
-
return !(x._options.imageOptions.hideBackgroundDots && V >= (o - d.hideXDots) / 2 && V < (o + d.hideXDots) / 2 && L >= (o - d.hideYDots) / 2 && L < (o + d.hideYDots) / 2 || !((F =
|
|
3892
|
+
return !(x._options.imageOptions.hideBackgroundDots && V >= (o - d.hideXDots) / 2 && V < (o + d.hideXDots) / 2 && L >= (o - d.hideYDots) / 2 && L < (o + d.hideYDots) / 2 || !((F = mt[V]) === null || F === void 0) && F[L] || !((B = mt[V - o + 7]) === null || B === void 0) && B[L] || !(($ = mt[V]) === null || $ === void 0) && $[L - o + 7] || !((lt = xt[V]) === null || lt === void 0) && lt[L] || !((H = xt[V - o + 7]) === null || H === void 0) && H[L] || !((tt = xt[V]) === null || tt === void 0) && tt[L - o + 7]);
|
|
3901
3893
|
}), this.drawCorners(), this._options.image ? [4, this.drawImage({ width: d.width, height: d.height, count: o, dotSize: h })] : [3, 4];
|
|
3902
3894
|
case 3:
|
|
3903
3895
|
O.sent(), O.label = 4;
|
|
@@ -3922,19 +3914,19 @@ var ce = {}, Sr = {
|
|
|
3922
3914
|
var h = this._options, d = this._qr.getModuleCount();
|
|
3923
3915
|
if (d > h.width || d > h.height)
|
|
3924
3916
|
throw "The canvas is too small.";
|
|
3925
|
-
var S = Math.min(h.width, h.height) - 2 * h.margin, a = h.shape === J ? S / Math.sqrt(2) : S, c = Math.floor(a / d), i = Math.floor((h.width - d * c) / 2),
|
|
3917
|
+
var S = Math.min(h.width, h.height) - 2 * h.margin, a = h.shape === J ? S / Math.sqrt(2) : S, c = Math.floor(a / d), i = Math.floor((h.width - d * c) / 2), b = Math.floor((h.height - d * c) / 2), x = new X({ svg: this._element, type: h.dotsOptions.type });
|
|
3926
3918
|
this._dotsClipPath = document.createElementNS("http://www.w3.org/2000/svg", "clipPath"), this._dotsClipPath.setAttribute("id", "clip-path-dot-color"), this._defs.appendChild(this._dotsClipPath), this._createColor({ options: (o = h.dotsOptions) === null || o === void 0 ? void 0 : o.gradient, color: h.dotsOptions.color, additionalRotation: 0, x: 0, y: 0, height: h.height, width: h.width, name: "dot-color" });
|
|
3927
3919
|
for (var O = function(dt) {
|
|
3928
3920
|
for (var rt = function(ct) {
|
|
3929
|
-
return t && !t(dt, ct) ? "continue" : !((r = V._qr) === null || r === void 0) && r.isDark(dt, ct) ? (x.draw(i + dt * c,
|
|
3930
|
-
return !(dt + ht < 0 || ct +
|
|
3921
|
+
return t && !t(dt, ct) ? "continue" : !((r = V._qr) === null || r === void 0) && r.isDark(dt, ct) ? (x.draw(i + dt * c, b + ct * c, c, function(ht, bt) {
|
|
3922
|
+
return !(dt + ht < 0 || ct + bt < 0 || dt + ht >= d || ct + bt >= d) && !(t && !t(dt + ht, ct + bt)) && !!l._qr && l._qr.isDark(dt + ht, ct + bt);
|
|
3931
3923
|
}), void (x._element && V._dotsClipPath && V._dotsClipPath.appendChild(x._element))) : "continue";
|
|
3932
3924
|
}, ut = 0; ut < d; ut++)
|
|
3933
3925
|
rt(ut);
|
|
3934
3926
|
}, V = this, L = 0; L < d; L++)
|
|
3935
3927
|
O(L);
|
|
3936
3928
|
if (h.shape === J) {
|
|
3937
|
-
var F = Math.floor((S / c - d) / 2), B = d + 2 * F, $ = i - F * c, lt =
|
|
3929
|
+
var F = Math.floor((S / c - d) / 2), B = d + 2 * F, $ = i - F * c, lt = b - F * c, H = [], tt = Math.floor(B / 2);
|
|
3938
3930
|
for (L = 0; L < B; L++) {
|
|
3939
3931
|
H[L] = [];
|
|
3940
3932
|
for (var q = 0; q < B; q++)
|
|
@@ -3944,9 +3936,9 @@ var ce = {}, Sr = {
|
|
|
3944
3936
|
for (var rt = function(ct) {
|
|
3945
3937
|
if (!H[dt][ct])
|
|
3946
3938
|
return "continue";
|
|
3947
|
-
x.draw($ + dt * c, lt + ct * c, c, function(ht,
|
|
3939
|
+
x.draw($ + dt * c, lt + ct * c, c, function(ht, bt) {
|
|
3948
3940
|
var yt;
|
|
3949
|
-
return !!(!((yt = H[dt + ht]) === null || yt === void 0) && yt[ct +
|
|
3941
|
+
return !!(!((yt = H[dt + ht]) === null || yt === void 0) && yt[ct + bt]);
|
|
3950
3942
|
}), x._element && Mt._dotsClipPath && Mt._dotsClipPath.appendChild(x._element);
|
|
3951
3943
|
}, ut = 0; ut < B; ut++)
|
|
3952
3944
|
rt(ut);
|
|
@@ -3961,24 +3953,24 @@ var ce = {}, Sr = {
|
|
|
3961
3953
|
var o = this._element, r = this._options;
|
|
3962
3954
|
if (!o)
|
|
3963
3955
|
throw "Element code is not defined";
|
|
3964
|
-
var l = this._qr.getModuleCount(), h = Math.min(r.width, r.height) - 2 * r.margin, d = r.shape === J ? h / Math.sqrt(2) : h, S = Math.floor(d / l), a = 7 * S, c = 3 * S, i = Math.floor((r.width - l * S) / 2),
|
|
3956
|
+
var l = this._qr.getModuleCount(), h = Math.min(r.width, r.height) - 2 * r.margin, d = r.shape === J ? h / Math.sqrt(2) : h, S = Math.floor(d / l), a = 7 * S, c = 3 * S, i = Math.floor((r.width - l * S) / 2), b = Math.floor((r.height - l * S) / 2);
|
|
3965
3957
|
[[0, 0, 0], [1, 0, Math.PI / 2], [0, 1, -Math.PI / 2]].forEach(function(x) {
|
|
3966
|
-
var O, V, L, F, B, $, lt, H, tt, q, et, Mt, dt = x[0], rt = x[1], ut = x[2], ct = i + dt * S * (l - 7), ht =
|
|
3967
|
-
if ((!((O = r.cornersSquareOptions) === null || O === void 0) && O.gradient || !((V = r.cornersSquareOptions) === null || V === void 0) && V.color) && ((
|
|
3958
|
+
var O, V, L, F, B, $, lt, H, tt, q, et, Mt, dt = x[0], rt = x[1], ut = x[2], ct = i + dt * S * (l - 7), ht = b + rt * S * (l - 7), bt = t._dotsClipPath, yt = t._dotsClipPath;
|
|
3959
|
+
if ((!((O = r.cornersSquareOptions) === null || O === void 0) && O.gradient || !((V = r.cornersSquareOptions) === null || V === void 0) && V.color) && ((bt = document.createElementNS("http://www.w3.org/2000/svg", "clipPath")).setAttribute("id", "clip-path-corners-square-color-" + dt + "-" + rt), t._defs.appendChild(bt), t._cornersSquareClipPath = t._cornersDotClipPath = yt = bt, t._createColor({ options: (L = r.cornersSquareOptions) === null || L === void 0 ? void 0 : L.gradient, color: (F = r.cornersSquareOptions) === null || F === void 0 ? void 0 : F.color, additionalRotation: ut, x: ct, y: ht, height: a, width: a, name: "corners-square-color-" + dt + "-" + rt })), (B = r.cornersSquareOptions) === null || B === void 0 ? void 0 : B.type) {
|
|
3968
3960
|
var wt = new ot({ svg: t._element, type: r.cornersSquareOptions.type });
|
|
3969
|
-
wt.draw(ct, ht, a, ut), wt._element &&
|
|
3961
|
+
wt.draw(ct, ht, a, ut), wt._element && bt && bt.appendChild(wt._element);
|
|
3970
3962
|
} else
|
|
3971
3963
|
for (var Yt = new X({ svg: t._element, type: r.dotsOptions.type }), rn = function(Nt) {
|
|
3972
3964
|
for (var _t = function(Et) {
|
|
3973
|
-
if (!(!(($ =
|
|
3965
|
+
if (!(!(($ = mt[Nt]) === null || $ === void 0) && $[Et]))
|
|
3974
3966
|
return "continue";
|
|
3975
3967
|
Yt.draw(ct + Nt * S, ht + Et * S, S, function(qt, $t) {
|
|
3976
3968
|
var zt;
|
|
3977
|
-
return !!(!((zt =
|
|
3978
|
-
}), Yt._element &&
|
|
3979
|
-
}, kt = 0; kt <
|
|
3969
|
+
return !!(!((zt = mt[Nt + qt]) === null || zt === void 0) && zt[Et + $t]);
|
|
3970
|
+
}), Yt._element && bt && bt.appendChild(Yt._element);
|
|
3971
|
+
}, kt = 0; kt < mt[Nt].length; kt++)
|
|
3980
3972
|
_t(kt);
|
|
3981
|
-
}, Gt = 0; Gt <
|
|
3973
|
+
}, Gt = 0; Gt < mt.length; Gt++)
|
|
3982
3974
|
rn(Gt);
|
|
3983
3975
|
if ((!((lt = r.cornersDotOptions) === null || lt === void 0) && lt.gradient || !((H = r.cornersDotOptions) === null || H === void 0) && H.color) && ((yt = document.createElementNS("http://www.w3.org/2000/svg", "clipPath")).setAttribute("id", "clip-path-corners-dot-color-" + dt + "-" + rt), t._defs.appendChild(yt), t._cornersDotClipPath = yt, t._createColor({ options: (tt = r.cornersDotOptions) === null || tt === void 0 ? void 0 : tt.gradient, color: (q = r.cornersDotOptions) === null || q === void 0 ? void 0 : q.color, additionalRotation: ut, x: ct + 2 * S, y: ht + 2 * S, height: c, width: c, name: "corners-dot-color-" + dt + "-" + rt })), (et = r.cornersDotOptions) === null || et === void 0 ? void 0 : et.type) {
|
|
3984
3976
|
var Bt = new R({ svg: t._element, type: r.cornersDotOptions.type });
|
|
@@ -4013,19 +4005,19 @@ var ce = {}, Sr = {
|
|
|
4013
4005
|
}, Z.prototype.drawImage = function(t) {
|
|
4014
4006
|
var o = t.width, r = t.height, l = t.count, h = t.dotSize;
|
|
4015
4007
|
return k(this, void 0, void 0, function() {
|
|
4016
|
-
var d, S, a, c, i,
|
|
4008
|
+
var d, S, a, c, i, b, x, O, V;
|
|
4017
4009
|
return st(this, function(L) {
|
|
4018
4010
|
switch (L.label) {
|
|
4019
4011
|
case 0:
|
|
4020
|
-
return d = this._options, S = Math.floor((d.width - l * h) / 2), a = Math.floor((d.height - l * h) / 2), c = S + d.imageOptions.margin + (l * h - o) / 2, i = a + d.imageOptions.margin + (l * h - r) / 2,
|
|
4012
|
+
return d = this._options, S = Math.floor((d.width - l * h) / 2), a = Math.floor((d.height - l * h) / 2), c = S + d.imageOptions.margin + (l * h - o) / 2, i = a + d.imageOptions.margin + (l * h - r) / 2, b = o - 2 * d.imageOptions.margin, x = r - 2 * d.imageOptions.margin, (O = document.createElementNS("http://www.w3.org/2000/svg", "image")).setAttribute("x", String(c)), O.setAttribute("y", String(i)), O.setAttribute("width", b + "px"), O.setAttribute("height", x + "px"), [4, K(d.image || "")];
|
|
4021
4013
|
case 1:
|
|
4022
4014
|
return V = L.sent(), O.setAttribute("href", V || ""), this._element.appendChild(O), [2];
|
|
4023
4015
|
}
|
|
4024
4016
|
});
|
|
4025
4017
|
});
|
|
4026
4018
|
}, Z.prototype._createColor = function(t) {
|
|
4027
|
-
var o = t.options, r = t.color, l = t.additionalRotation, h = t.x, d = t.y, S = t.height, a = t.width, c = t.name, i = a > S ? a : S,
|
|
4028
|
-
if (
|
|
4019
|
+
var o = t.options, r = t.color, l = t.additionalRotation, h = t.x, d = t.y, S = t.height, a = t.width, c = t.name, i = a > S ? a : S, b = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
4020
|
+
if (b.setAttribute("x", String(h)), b.setAttribute("y", String(d)), b.setAttribute("height", String(S)), b.setAttribute("width", String(a)), b.setAttribute("clip-path", "url('#clip-path-" + c + "')"), o) {
|
|
4029
4021
|
var x;
|
|
4030
4022
|
if (o.type === "radial")
|
|
4031
4023
|
(x = document.createElementNS("http://www.w3.org/2000/svg", "radialGradient")).setAttribute("id", c), x.setAttribute("gradientUnits", "userSpaceOnUse"), x.setAttribute("fx", String(h + a / 2)), x.setAttribute("fy", String(d + S / 2)), x.setAttribute("cx", String(h + a / 2)), x.setAttribute("cy", String(d + S / 2)), x.setAttribute("r", String(i / 2));
|
|
@@ -4036,15 +4028,15 @@ var ce = {}, Sr = {
|
|
|
4036
4028
|
o.colorStops.forEach(function(lt) {
|
|
4037
4029
|
var H = lt.offset, tt = lt.color, q = document.createElementNS("http://www.w3.org/2000/svg", "stop");
|
|
4038
4030
|
q.setAttribute("offset", 100 * H + "%"), q.setAttribute("stop-color", tt), x.appendChild(q);
|
|
4039
|
-
}),
|
|
4031
|
+
}), b.setAttribute("fill", "url('#" + c + "')"), this._defs.appendChild(x);
|
|
4040
4032
|
} else
|
|
4041
|
-
r &&
|
|
4042
|
-
this._element.appendChild(
|
|
4033
|
+
r && b.setAttribute("fill", r);
|
|
4034
|
+
this._element.appendChild(b);
|
|
4043
4035
|
}, Z;
|
|
4044
|
-
}(),
|
|
4036
|
+
}(), gt = "canvas";
|
|
4045
4037
|
for (var It = {}, Y = 0; Y <= 40; Y++)
|
|
4046
4038
|
It[Y] = Y;
|
|
4047
|
-
const D = { type:
|
|
4039
|
+
const D = { type: gt, shape: "square", width: 300, height: 300, data: "", margin: 0, qrOptions: { typeNumber: It[0], mode: void 0, errorCorrectionLevel: "Q" }, imageOptions: { hideBackgroundDots: !0, imageSize: 0.4, crossOrigin: void 0, margin: 0 }, dotsOptions: { type: "square", color: "#000" }, backgroundOptions: { round: 0, color: "#fff" } };
|
|
4048
4040
|
var W = function() {
|
|
4049
4041
|
return (W = Object.assign || function(Z) {
|
|
4050
4042
|
for (var t, o = 1, r = arguments.length; o < r; o++)
|
|
@@ -4083,8 +4075,8 @@ var ce = {}, Sr = {
|
|
|
4083
4075
|
}
|
|
4084
4076
|
function a(c) {
|
|
4085
4077
|
var i;
|
|
4086
|
-
c.done ? l(c.value) : (i = c.value, i instanceof o ? i : new o(function(
|
|
4087
|
-
|
|
4078
|
+
c.done ? l(c.value) : (i = c.value, i instanceof o ? i : new o(function(b) {
|
|
4079
|
+
b(i);
|
|
4088
4080
|
})).then(d, S);
|
|
4089
4081
|
}
|
|
4090
4082
|
a((r = r.apply(Z, t || [])).next());
|
|
@@ -4141,8 +4133,8 @@ var ce = {}, Sr = {
|
|
|
4141
4133
|
continue;
|
|
4142
4134
|
}
|
|
4143
4135
|
i = t.call(Z, d);
|
|
4144
|
-
} catch (
|
|
4145
|
-
i = [6,
|
|
4136
|
+
} catch (b) {
|
|
4137
|
+
i = [6, b], r = 0;
|
|
4146
4138
|
} finally {
|
|
4147
4139
|
o = l = 0;
|
|
4148
4140
|
}
|
|
@@ -4153,7 +4145,7 @@ var ce = {}, Sr = {
|
|
|
4153
4145
|
};
|
|
4154
4146
|
}
|
|
4155
4147
|
};
|
|
4156
|
-
const
|
|
4148
|
+
const pt = function() {
|
|
4157
4149
|
function Z(t) {
|
|
4158
4150
|
this._options = t ? M(E(D, t)) : D, this.update();
|
|
4159
4151
|
}
|
|
@@ -4208,12 +4200,12 @@ var ce = {}, Sr = {
|
|
|
4208
4200
|
default:
|
|
4209
4201
|
return "Byte";
|
|
4210
4202
|
}
|
|
4211
|
-
}(this._options.data)), this._qr.make(), this._options.type ===
|
|
4203
|
+
}(this._options.data)), this._qr.make(), this._options.type === gt ? this._setupCanvas() : this._setupSvg(), this.append(this._container));
|
|
4212
4204
|
}, Z.prototype.append = function(t) {
|
|
4213
4205
|
if (t) {
|
|
4214
4206
|
if (typeof t.appendChild != "function")
|
|
4215
4207
|
throw "Container should be a single DOM node";
|
|
4216
|
-
this._options.type ===
|
|
4208
|
+
this._options.type === gt ? this._canvas && t.appendChild(this._canvas) : this._svg && t.appendChild(this._svg), this._container = t;
|
|
4217
4209
|
}
|
|
4218
4210
|
}, Z.prototype.applyExtension = function(t) {
|
|
4219
4211
|
if (!t)
|
|
@@ -4255,24 +4247,24 @@ var ce = {}, Sr = {
|
|
|
4255
4247
|
});
|
|
4256
4248
|
}, Z;
|
|
4257
4249
|
}();
|
|
4258
|
-
} },
|
|
4250
|
+
} }, g = {};
|
|
4259
4251
|
function f(w) {
|
|
4260
|
-
if (
|
|
4261
|
-
return
|
|
4262
|
-
var
|
|
4263
|
-
return u[w](
|
|
4252
|
+
if (g[w])
|
|
4253
|
+
return g[w].exports;
|
|
4254
|
+
var m = g[w] = { exports: {} };
|
|
4255
|
+
return u[w](m, m.exports, f), m.exports;
|
|
4264
4256
|
}
|
|
4265
4257
|
return f.n = (w) => {
|
|
4266
|
-
var
|
|
4267
|
-
return f.d(
|
|
4268
|
-
}, f.d = (w,
|
|
4269
|
-
for (var s in
|
|
4270
|
-
f.o(
|
|
4271
|
-
}, f.o = (w,
|
|
4258
|
+
var m = w && w.__esModule ? () => w.default : () => w;
|
|
4259
|
+
return f.d(m, { a: m }), m;
|
|
4260
|
+
}, f.d = (w, m) => {
|
|
4261
|
+
for (var s in m)
|
|
4262
|
+
f.o(m, s) && !f.o(w, s) && Object.defineProperty(w, s, { enumerable: !0, get: m[s] });
|
|
4263
|
+
}, f.o = (w, m) => Object.prototype.hasOwnProperty.call(w, m), f(676);
|
|
4272
4264
|
})().default;
|
|
4273
4265
|
});
|
|
4274
4266
|
})(Sr);
|
|
4275
|
-
const Nr = /* @__PURE__ */ Zr(ce), Dr = ({ nodePath: e }) => /* @__PURE__ */ G.createElement(
|
|
4267
|
+
const Nr = /* @__PURE__ */ Zr(ce), Dr = ({ nodePath: e }) => /* @__PURE__ */ G.createElement(ge, null, /* @__PURE__ */ G.createElement(
|
|
4276
4268
|
ye,
|
|
4277
4269
|
{
|
|
4278
4270
|
desktop: /* @__PURE__ */ G.createElement(
|
|
@@ -4295,7 +4287,7 @@ function Ue({
|
|
|
4295
4287
|
nodePath: e,
|
|
4296
4288
|
mode: n
|
|
4297
4289
|
}) {
|
|
4298
|
-
const u = Je(), { onUpload:
|
|
4290
|
+
const u = Je(), { onUpload: g } = Ze(), { setFieldValue: f, getFieldValue: w } = fe(), { selectedNode: m, selectedNodePath: s } = Se(), { setLock: p } = Ne(), { isChanged: y } = dn(), [v, E] = xe(!1), C = Ie(null), K = 600, I = Ie(new Nr()), T = s && w(
|
|
4299
4291
|
s,
|
|
4300
4292
|
n === ft.DESKTOP ? "attributes.dot-color-type" : "mobileAttributes.dot-color-type"
|
|
4301
4293
|
) !== "single", X = s && w(
|
|
@@ -4304,18 +4296,18 @@ function Ue({
|
|
|
4304
4296
|
) !== "single", _ = s && w(
|
|
4305
4297
|
s,
|
|
4306
4298
|
n === ft.DESKTOP ? "attributes.corner-square-color-type" : "mobileAttributes.corner-square-color-type"
|
|
4307
|
-
) !== "single", ot =
|
|
4308
|
-
const k = n === ft.DESKTOP ?
|
|
4299
|
+
) !== "single", ot = pn(() => {
|
|
4300
|
+
const k = n === ft.DESKTOP ? m == null ? void 0 : m.attributes : mn({}, m == null ? void 0 : m.attributes, m == null ? void 0 : m.mobileAttributes);
|
|
4309
4301
|
if (!k)
|
|
4310
4302
|
return {};
|
|
4311
4303
|
const st = {
|
|
4312
4304
|
width: K,
|
|
4313
4305
|
height: K,
|
|
4314
|
-
data: (
|
|
4306
|
+
data: (m == null ? void 0 : m.data.text) || "",
|
|
4315
4307
|
margin: parseInt(
|
|
4316
4308
|
((k == null ? void 0 : k.margin) / 100 * K).toString()
|
|
4317
4309
|
),
|
|
4318
|
-
image:
|
|
4310
|
+
image: m == null ? void 0 : m.data.logo,
|
|
4319
4311
|
cornersDotOptions: {
|
|
4320
4312
|
color: k == null ? void 0 : k["corner-dot-color"],
|
|
4321
4313
|
type: k == null ? void 0 : k["corner-dot-type"],
|
|
@@ -4382,10 +4374,10 @@ function Ue({
|
|
|
4382
4374
|
return Jt(C.current, st) ? C.current : (C.current = st, st);
|
|
4383
4375
|
}, [
|
|
4384
4376
|
n,
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4377
|
+
m == null ? void 0 : m.attributes,
|
|
4378
|
+
m == null ? void 0 : m.data.logo,
|
|
4379
|
+
m == null ? void 0 : m.data.text,
|
|
4380
|
+
m == null ? void 0 : m.mobileAttributes
|
|
4389
4381
|
]);
|
|
4390
4382
|
Rt(() => {
|
|
4391
4383
|
if (!y)
|
|
@@ -4408,23 +4400,23 @@ function Ue({
|
|
|
4408
4400
|
});
|
|
4409
4401
|
}, [u, y, n, e, ot, f]);
|
|
4410
4402
|
const P = G.useRef();
|
|
4411
|
-
P.current || (P.current = Xt(
|
|
4412
|
-
Jt(P.current,
|
|
4413
|
-
}, [
|
|
4403
|
+
P.current || (P.current = Xt(m)), Rt(() => {
|
|
4404
|
+
Jt(P.current, m) ? p(!1) : p(!0);
|
|
4405
|
+
}, [m, p]);
|
|
4414
4406
|
const R = () => Zt(this, null, function* () {
|
|
4415
|
-
if (
|
|
4407
|
+
if (m)
|
|
4416
4408
|
try {
|
|
4417
4409
|
E(!0);
|
|
4418
4410
|
const J = yield I.current.getRawData("png");
|
|
4419
4411
|
if (!J)
|
|
4420
4412
|
return;
|
|
4421
|
-
const k = yield
|
|
4413
|
+
const k = yield g == null ? void 0 : g(J);
|
|
4422
4414
|
f(
|
|
4423
4415
|
e,
|
|
4424
4416
|
n === ft.DESKTOP ? "attributes.src" : "mobileAttributes.src",
|
|
4425
4417
|
k
|
|
4426
4418
|
);
|
|
4427
|
-
const st = Xt(
|
|
4419
|
+
const st = Xt(m);
|
|
4428
4420
|
jt(
|
|
4429
4421
|
st,
|
|
4430
4422
|
n === ft.DESKTOP ? "attributes.src" : "mobileAttributes.src",
|
|
@@ -4436,7 +4428,7 @@ function Ue({
|
|
|
4436
4428
|
E(!1);
|
|
4437
4429
|
}
|
|
4438
4430
|
});
|
|
4439
|
-
return
|
|
4431
|
+
return m ? /* @__PURE__ */ G.createElement(we, { defaultActiveKey: ["0", "1", "2", "3"] }, /* @__PURE__ */ G.createElement(
|
|
4440
4432
|
vt.Item,
|
|
4441
4433
|
{
|
|
4442
4434
|
name: "0",
|
|
@@ -4467,7 +4459,7 @@ function Ue({
|
|
|
4467
4459
|
name: "data.logo",
|
|
4468
4460
|
label: A("Logo"),
|
|
4469
4461
|
hideInput: !0,
|
|
4470
|
-
uploadHandler:
|
|
4462
|
+
uploadHandler: g
|
|
4471
4463
|
}
|
|
4472
4464
|
), /* @__PURE__ */ G.createElement(
|
|
4473
4465
|
it,
|
|
@@ -4709,36 +4701,28 @@ function Ue({
|
|
|
4709
4701
|
name: "background-color",
|
|
4710
4702
|
label: A("Background color")
|
|
4711
4703
|
}
|
|
4712
|
-
)), /* @__PURE__ */ G.createElement(
|
|
4713
|
-
|
|
4704
|
+
)), /* @__PURE__ */ G.createElement(vt.Item, { name: "2", header: A("Dimension") }, /* @__PURE__ */ G.createElement(
|
|
4705
|
+
it,
|
|
4714
4706
|
{
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
}
|
|
4719
|
-
|
|
4720
|
-
it,
|
|
4721
|
-
{
|
|
4722
|
-
component: nt.Padding,
|
|
4723
|
-
path: e,
|
|
4724
|
-
name: ""
|
|
4725
|
-
}
|
|
4726
|
-
)
|
|
4727
|
-
)) : null;
|
|
4707
|
+
component: nt.Padding,
|
|
4708
|
+
path: e,
|
|
4709
|
+
name: ""
|
|
4710
|
+
}
|
|
4711
|
+
))) : null;
|
|
4728
4712
|
}
|
|
4729
|
-
class Xr extends
|
|
4713
|
+
class Xr extends pe {
|
|
4730
4714
|
generateElement() {
|
|
4731
|
-
|
|
4715
|
+
be.registerBlocks([Ee]), jt(Me, Ee.type, xr);
|
|
4732
4716
|
}
|
|
4733
4717
|
}
|
|
4734
|
-
class Or extends
|
|
4718
|
+
class Or extends pe {
|
|
4735
4719
|
generateElement() {
|
|
4736
|
-
|
|
4720
|
+
be.registerBlocks([Ge]), jt(Me, Ge.type, Tr);
|
|
4737
4721
|
}
|
|
4738
4722
|
}
|
|
4739
|
-
class jr extends
|
|
4723
|
+
class jr extends pe {
|
|
4740
4724
|
generateElement() {
|
|
4741
|
-
|
|
4725
|
+
be.registerBlocks([ze]), jt(Me, ze.type, Dr);
|
|
4742
4726
|
}
|
|
4743
4727
|
}
|
|
4744
4728
|
export {
|