image-salon-sdk 1.0.46 → 1.0.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/image-salon-sdk.js +1047 -1015
- package/dist/image-salon-sdk.umd.cjs +6 -6
- package/dist/image-salon.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/types/image-salon-types.d.ts +2 -1
- package/package.json +1 -1
package/dist/image-salon-sdk.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import './style.css';
|
|
2
|
-
var
|
|
3
|
-
var
|
|
2
|
+
var Xr = Object.defineProperty;
|
|
3
|
+
var qn = (s) => {
|
|
4
4
|
throw TypeError(s);
|
|
5
5
|
};
|
|
6
|
-
var
|
|
7
|
-
var he = (s, e, t) =>
|
|
8
|
-
var
|
|
9
|
-
function
|
|
6
|
+
var Gr = (s, e, t) => e in s ? Xr(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
7
|
+
var he = (s, e, t) => Gr(s, typeof e != "symbol" ? e + "" : e, t), Kn = (s, e, t) => e.has(s) || qn("Cannot " + t);
|
|
8
|
+
var A = (s, e, t) => (Kn(s, e, "read from private field"), t ? t.call(s) : e.get(s)), X = (s, e, t) => e.has(s) ? qn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, t), H = (s, e, t, n) => (Kn(s, e, "write to private field"), n ? n.call(s, t) : e.set(s, t), t);
|
|
9
|
+
function yr(s) {
|
|
10
10
|
let e = typeof s;
|
|
11
11
|
if (e == "object") {
|
|
12
12
|
if (Array.isArray(s))
|
|
@@ -16,20 +16,20 @@ function gr(s) {
|
|
|
16
16
|
}
|
|
17
17
|
return e;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function Jr(s) {
|
|
20
20
|
return s !== null && typeof s == "object" && !Array.isArray(s);
|
|
21
21
|
}
|
|
22
|
-
let wt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),
|
|
22
|
+
let wt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), vn = [];
|
|
23
23
|
for (let s = 0; s < wt.length; s++)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
function
|
|
24
|
+
vn[wt[s].charCodeAt(0)] = s;
|
|
25
|
+
vn[45] = wt.indexOf("+");
|
|
26
|
+
vn[95] = wt.indexOf("/");
|
|
27
|
+
function br(s) {
|
|
28
28
|
let e = s.length * 3 / 4;
|
|
29
29
|
s[s.length - 2] == "=" ? e -= 2 : s[s.length - 1] == "=" && (e -= 1);
|
|
30
30
|
let t = new Uint8Array(e), n = 0, r = 0, i, o = 0;
|
|
31
31
|
for (let a = 0; a < s.length; a++) {
|
|
32
|
-
if (i =
|
|
32
|
+
if (i = vn[s.charCodeAt(a)], i === void 0)
|
|
33
33
|
switch (s[a]) {
|
|
34
34
|
case "=":
|
|
35
35
|
r = 0;
|
|
@@ -61,7 +61,7 @@ function wr(s) {
|
|
|
61
61
|
throw Error("invalid base64 string.");
|
|
62
62
|
return t.subarray(0, n);
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function Cr(s) {
|
|
65
65
|
let e = "", t = 0, n, r = 0;
|
|
66
66
|
for (let i = 0; i < s.length; i++)
|
|
67
67
|
switch (n = s[i], t) {
|
|
@@ -93,14 +93,14 @@ var J;
|
|
|
93
93
|
}, s.last = (t, n) => s.list(t, n).slice(-1)[0];
|
|
94
94
|
const e = (t) => t && Array.isArray(t[s.symbol]);
|
|
95
95
|
})(J || (J = {}));
|
|
96
|
-
function
|
|
96
|
+
function Qr(s, e) {
|
|
97
97
|
return Object.assign(Object.assign({}, s), e);
|
|
98
98
|
}
|
|
99
99
|
var j;
|
|
100
100
|
(function(s) {
|
|
101
101
|
s[s.Varint = 0] = "Varint", s[s.Bit64 = 1] = "Bit64", s[s.LengthDelimited = 2] = "LengthDelimited", s[s.StartGroup = 3] = "StartGroup", s[s.EndGroup = 4] = "EndGroup", s[s.Bit32 = 5] = "Bit32";
|
|
102
102
|
})(j || (j = {}));
|
|
103
|
-
function
|
|
103
|
+
function Yr() {
|
|
104
104
|
let s = 0, e = 0;
|
|
105
105
|
for (let n = 0; n < 28; n += 7) {
|
|
106
106
|
let r = this.buf[this.pos++];
|
|
@@ -117,7 +117,7 @@ function Jr() {
|
|
|
117
117
|
}
|
|
118
118
|
throw new Error("invalid varint");
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function Nn(s, e, t) {
|
|
121
121
|
for (let i = 0; i < 28; i = i + 7) {
|
|
122
122
|
const o = s >>> i, a = !(!(o >>> 7) && e == 0), c = (a ? o | 128 : o) & 255;
|
|
123
123
|
if (t.push(c), !a)
|
|
@@ -133,21 +133,21 @@ function kn(s, e, t) {
|
|
|
133
133
|
t.push(e >>> 31 & 1);
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
-
const
|
|
137
|
-
function
|
|
136
|
+
const hn = 65536 * 65536;
|
|
137
|
+
function Er(s) {
|
|
138
138
|
let e = s[0] == "-";
|
|
139
139
|
e && (s = s.slice(1));
|
|
140
140
|
const t = 1e6;
|
|
141
141
|
let n = 0, r = 0;
|
|
142
142
|
function i(o, a) {
|
|
143
143
|
const c = Number(s.slice(o, a));
|
|
144
|
-
r *= t, n = n * t + c, n >=
|
|
144
|
+
r *= t, n = n * t + c, n >= hn && (r = r + (n / hn | 0), n = n % hn);
|
|
145
145
|
}
|
|
146
146
|
return i(-24, -18), i(-18, -12), i(-12, -6), i(-6), [e, n, r];
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function Sn(s, e) {
|
|
149
149
|
if (e >>> 0 <= 2097151)
|
|
150
|
-
return "" + (
|
|
150
|
+
return "" + (hn * e + (s >>> 0));
|
|
151
151
|
let t = s & 16777215, n = (s >>> 24 | e << 8) >>> 0 & 16777215, r = e >> 16 & 65535, i = t + n * 6777216 + r * 6710656, o = n + r * 8147497, a = r * 2, c = 1e7;
|
|
152
152
|
i >= c && (o += Math.floor(i / c), i %= c), o >= c && (a += Math.floor(o / c), o %= c);
|
|
153
153
|
function h(l, u) {
|
|
@@ -170,7 +170,7 @@ function Bn(s, e) {
|
|
|
170
170
|
1
|
|
171
171
|
);
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
function zn(s, e) {
|
|
174
174
|
if (s >= 0) {
|
|
175
175
|
for (; s > 127; )
|
|
176
176
|
e.push(s & 127 | 128), s = s >>> 7;
|
|
@@ -181,7 +181,7 @@ function qn(s, e) {
|
|
|
181
181
|
e.push(1);
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function ei() {
|
|
185
185
|
let s = this.buf[this.pos++], e = s & 127;
|
|
186
186
|
if (!(s & 128))
|
|
187
187
|
return this.assertBounds(), e;
|
|
@@ -199,7 +199,7 @@ function Qr() {
|
|
|
199
199
|
return this.assertBounds(), e >>> 0;
|
|
200
200
|
}
|
|
201
201
|
let oe;
|
|
202
|
-
function
|
|
202
|
+
function ti() {
|
|
203
203
|
const s = new DataView(new ArrayBuffer(8));
|
|
204
204
|
oe = globalThis.BigInt !== void 0 && typeof s.getBigInt64 == "function" && typeof s.getBigUint64 == "function" && typeof s.setBigInt64 == "function" && typeof s.setBigUint64 == "function" ? {
|
|
205
205
|
MIN: BigInt("-9223372036854775808"),
|
|
@@ -210,13 +210,13 @@ function Yr() {
|
|
|
210
210
|
V: s
|
|
211
211
|
} : void 0;
|
|
212
212
|
}
|
|
213
|
-
|
|
214
|
-
function
|
|
213
|
+
ti();
|
|
214
|
+
function vr(s) {
|
|
215
215
|
if (!s)
|
|
216
216
|
throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support");
|
|
217
217
|
}
|
|
218
|
-
const
|
|
219
|
-
class
|
|
218
|
+
const Ar = /^-?[0-9]+$/, fn = 4294967296, on = 2147483648;
|
|
219
|
+
class kr {
|
|
220
220
|
/**
|
|
221
221
|
* Create a new instance with the given bits.
|
|
222
222
|
*/
|
|
@@ -233,13 +233,13 @@ class Ar {
|
|
|
233
233
|
* Convert to a native number.
|
|
234
234
|
*/
|
|
235
235
|
toNumber() {
|
|
236
|
-
let e = this.hi *
|
|
236
|
+
let e = this.hi * fn + (this.lo >>> 0);
|
|
237
237
|
if (!Number.isSafeInteger(e))
|
|
238
238
|
throw new Error("cannot convert to safe number");
|
|
239
239
|
return e;
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
|
-
class De extends
|
|
242
|
+
class De extends kr {
|
|
243
243
|
/**
|
|
244
244
|
* Create instance from a `string`, `number` or `bigint`.
|
|
245
245
|
*/
|
|
@@ -270,9 +270,9 @@ class De extends Ar {
|
|
|
270
270
|
case "string":
|
|
271
271
|
if (e == "0")
|
|
272
272
|
return this.ZERO;
|
|
273
|
-
if (e = e.trim(), !
|
|
273
|
+
if (e = e.trim(), !Ar.test(e))
|
|
274
274
|
throw new Error("string is no integer");
|
|
275
|
-
let [t, n, r] =
|
|
275
|
+
let [t, n, r] = Er(e);
|
|
276
276
|
if (t)
|
|
277
277
|
throw new Error("signed value for ulong");
|
|
278
278
|
return new De(n, r);
|
|
@@ -283,7 +283,7 @@ class De extends Ar {
|
|
|
283
283
|
throw new Error("number is no integer");
|
|
284
284
|
if (e < 0)
|
|
285
285
|
throw new Error("signed value for ulong");
|
|
286
|
-
return new De(e, e /
|
|
286
|
+
return new De(e, e / fn);
|
|
287
287
|
}
|
|
288
288
|
throw new Error("unknown value " + typeof e);
|
|
289
289
|
}
|
|
@@ -291,17 +291,17 @@ class De extends Ar {
|
|
|
291
291
|
* Convert to decimal string.
|
|
292
292
|
*/
|
|
293
293
|
toString() {
|
|
294
|
-
return oe ? this.toBigInt().toString() :
|
|
294
|
+
return oe ? this.toBigInt().toString() : Sn(this.lo, this.hi);
|
|
295
295
|
}
|
|
296
296
|
/**
|
|
297
297
|
* Convert to native bigint.
|
|
298
298
|
*/
|
|
299
299
|
toBigInt() {
|
|
300
|
-
return
|
|
300
|
+
return vr(oe), oe.V.setInt32(0, this.lo, !0), oe.V.setInt32(4, this.hi, !0), oe.V.getBigUint64(0, !0);
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
303
|
De.ZERO = new De(0, 0);
|
|
304
|
-
class Ee extends
|
|
304
|
+
class Ee extends kr {
|
|
305
305
|
/**
|
|
306
306
|
* Create instance from a `string`, `number` or `bigint`.
|
|
307
307
|
*/
|
|
@@ -332,13 +332,13 @@ class Ee extends Ar {
|
|
|
332
332
|
case "string":
|
|
333
333
|
if (e == "0")
|
|
334
334
|
return this.ZERO;
|
|
335
|
-
if (e = e.trim(), !
|
|
335
|
+
if (e = e.trim(), !Ar.test(e))
|
|
336
336
|
throw new Error("string is no integer");
|
|
337
|
-
let [t, n, r] =
|
|
337
|
+
let [t, n, r] = Er(e);
|
|
338
338
|
if (t) {
|
|
339
|
-
if (r >
|
|
339
|
+
if (r > on || r == on && n != 0)
|
|
340
340
|
throw new Error("signed long too small");
|
|
341
|
-
} else if (r >=
|
|
341
|
+
} else if (r >= on)
|
|
342
342
|
throw new Error("signed long too large");
|
|
343
343
|
let i = new Ee(n, r);
|
|
344
344
|
return t ? i.negate() : i;
|
|
@@ -347,7 +347,7 @@ class Ee extends Ar {
|
|
|
347
347
|
return this.ZERO;
|
|
348
348
|
if (!Number.isSafeInteger(e))
|
|
349
349
|
throw new Error("number is no integer");
|
|
350
|
-
return e > 0 ? new Ee(e, e /
|
|
350
|
+
return e > 0 ? new Ee(e, e / fn) : new Ee(-e, -e / fn).negate();
|
|
351
351
|
}
|
|
352
352
|
throw new Error("unknown value " + typeof e);
|
|
353
353
|
}
|
|
@@ -355,7 +355,7 @@ class Ee extends Ar {
|
|
|
355
355
|
* Do we have a minus sign?
|
|
356
356
|
*/
|
|
357
357
|
isNegative() {
|
|
358
|
-
return (this.hi &
|
|
358
|
+
return (this.hi & on) !== 0;
|
|
359
359
|
}
|
|
360
360
|
/**
|
|
361
361
|
* Negate two's complement.
|
|
@@ -373,28 +373,28 @@ class Ee extends Ar {
|
|
|
373
373
|
return this.toBigInt().toString();
|
|
374
374
|
if (this.isNegative()) {
|
|
375
375
|
let e = this.negate();
|
|
376
|
-
return "-" +
|
|
376
|
+
return "-" + Sn(e.lo, e.hi);
|
|
377
377
|
}
|
|
378
|
-
return
|
|
378
|
+
return Sn(this.lo, this.hi);
|
|
379
379
|
}
|
|
380
380
|
/**
|
|
381
381
|
* Convert to native bigint.
|
|
382
382
|
*/
|
|
383
383
|
toBigInt() {
|
|
384
|
-
return
|
|
384
|
+
return vr(oe), oe.V.setInt32(0, this.lo, !0), oe.V.setInt32(4, this.hi, !0), oe.V.getBigInt64(0, !0);
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
387
|
Ee.ZERO = new Ee(0, 0);
|
|
388
|
-
const
|
|
388
|
+
const Xn = {
|
|
389
389
|
readUnknownField: !0,
|
|
390
|
-
readerFactory: (s) => new
|
|
390
|
+
readerFactory: (s) => new ri(s)
|
|
391
391
|
};
|
|
392
|
-
function
|
|
393
|
-
return s ? Object.assign(Object.assign({},
|
|
392
|
+
function ni(s) {
|
|
393
|
+
return s ? Object.assign(Object.assign({}, Xn), s) : Xn;
|
|
394
394
|
}
|
|
395
|
-
class
|
|
395
|
+
class ri {
|
|
396
396
|
constructor(e, t) {
|
|
397
|
-
this.varint64 =
|
|
397
|
+
this.varint64 = Yr, this.uint32 = ei, this.buf = e, this.len = e.length, this.pos = 0, this.view = new DataView(e.buffer, e.byteOffset, e.byteLength), this.textDecoder = t ?? new TextDecoder("utf-8", {
|
|
398
398
|
fatal: !0,
|
|
399
399
|
ignoreBOM: !0
|
|
400
400
|
});
|
|
@@ -538,33 +538,33 @@ function G(s, e) {
|
|
|
538
538
|
if (!s)
|
|
539
539
|
throw new Error(e);
|
|
540
540
|
}
|
|
541
|
-
const
|
|
542
|
-
function
|
|
541
|
+
const ii = 34028234663852886e22, si = -34028234663852886e22, oi = 4294967295, ai = 2147483647, li = -2147483648;
|
|
542
|
+
function Yt(s) {
|
|
543
543
|
if (typeof s != "number")
|
|
544
544
|
throw new Error("invalid int 32: " + typeof s);
|
|
545
|
-
if (!Number.isInteger(s) || s >
|
|
545
|
+
if (!Number.isInteger(s) || s > ai || s < li)
|
|
546
546
|
throw new Error("invalid int 32: " + s);
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function pn(s) {
|
|
549
549
|
if (typeof s != "number")
|
|
550
550
|
throw new Error("invalid uint 32: " + typeof s);
|
|
551
|
-
if (!Number.isInteger(s) || s >
|
|
551
|
+
if (!Number.isInteger(s) || s > oi || s < 0)
|
|
552
552
|
throw new Error("invalid uint 32: " + s);
|
|
553
553
|
}
|
|
554
|
-
function
|
|
554
|
+
function $n(s) {
|
|
555
555
|
if (typeof s != "number")
|
|
556
556
|
throw new Error("invalid float 32: " + typeof s);
|
|
557
|
-
if (Number.isFinite(s) && (s >
|
|
557
|
+
if (Number.isFinite(s) && (s > ii || s < si))
|
|
558
558
|
throw new Error("invalid float 32: " + s);
|
|
559
559
|
}
|
|
560
|
-
const
|
|
560
|
+
const Gn = {
|
|
561
561
|
writeUnknownFields: !0,
|
|
562
|
-
writerFactory: () => new
|
|
562
|
+
writerFactory: () => new di()
|
|
563
563
|
};
|
|
564
|
-
function
|
|
565
|
-
return s ? Object.assign(Object.assign({},
|
|
564
|
+
function ci(s) {
|
|
565
|
+
return s ? Object.assign(Object.assign({}, Gn), s) : Gn;
|
|
566
566
|
}
|
|
567
|
-
class
|
|
567
|
+
class di {
|
|
568
568
|
constructor(e) {
|
|
569
569
|
this.stack = [], this.textEncoder = e ?? new TextEncoder(), this.chunks = [], this.buf = [];
|
|
570
570
|
}
|
|
@@ -620,7 +620,7 @@ class li {
|
|
|
620
620
|
* Write a `uint32` value, an unsigned 32 bit varint.
|
|
621
621
|
*/
|
|
622
622
|
uint32(e) {
|
|
623
|
-
for (
|
|
623
|
+
for (pn(e); e > 127; )
|
|
624
624
|
this.buf.push(e & 127 | 128), e = e >>> 7;
|
|
625
625
|
return this.buf.push(e), this;
|
|
626
626
|
}
|
|
@@ -628,7 +628,7 @@ class li {
|
|
|
628
628
|
* Write a `int32` value, a signed 32 bit varint.
|
|
629
629
|
*/
|
|
630
630
|
int32(e) {
|
|
631
|
-
return
|
|
631
|
+
return Yt(e), zn(e, this.buf), this;
|
|
632
632
|
}
|
|
633
633
|
/**
|
|
634
634
|
* Write a `bool` value, a variant.
|
|
@@ -653,7 +653,7 @@ class li {
|
|
|
653
653
|
* Write a `float` value, 32-bit floating point number.
|
|
654
654
|
*/
|
|
655
655
|
float(e) {
|
|
656
|
-
|
|
656
|
+
$n(e);
|
|
657
657
|
let t = new Uint8Array(4);
|
|
658
658
|
return new DataView(t.buffer).setFloat32(0, e, !0), this.raw(t);
|
|
659
659
|
}
|
|
@@ -668,7 +668,7 @@ class li {
|
|
|
668
668
|
* Write a `fixed32` value, an unsigned, fixed-length 32-bit integer.
|
|
669
669
|
*/
|
|
670
670
|
fixed32(e) {
|
|
671
|
-
|
|
671
|
+
pn(e);
|
|
672
672
|
let t = new Uint8Array(4);
|
|
673
673
|
return new DataView(t.buffer).setUint32(0, e, !0), this.raw(t);
|
|
674
674
|
}
|
|
@@ -676,7 +676,7 @@ class li {
|
|
|
676
676
|
* Write a `sfixed32` value, a signed, fixed-length 32-bit integer.
|
|
677
677
|
*/
|
|
678
678
|
sfixed32(e) {
|
|
679
|
-
|
|
679
|
+
Yt(e);
|
|
680
680
|
let t = new Uint8Array(4);
|
|
681
681
|
return new DataView(t.buffer).setInt32(0, e, !0), this.raw(t);
|
|
682
682
|
}
|
|
@@ -684,7 +684,7 @@ class li {
|
|
|
684
684
|
* Write a `sint32` value, a signed, zigzag-encoded 32-bit varint.
|
|
685
685
|
*/
|
|
686
686
|
sint32(e) {
|
|
687
|
-
return
|
|
687
|
+
return Yt(e), e = (e << 1 ^ e >> 31) >>> 0, zn(e, this.buf), this;
|
|
688
688
|
}
|
|
689
689
|
/**
|
|
690
690
|
* Write a `fixed64` value, a signed, fixed-length 64-bit integer.
|
|
@@ -705,44 +705,44 @@ class li {
|
|
|
705
705
|
*/
|
|
706
706
|
int64(e) {
|
|
707
707
|
let t = Ee.from(e);
|
|
708
|
-
return
|
|
708
|
+
return Nn(t.lo, t.hi, this.buf), this;
|
|
709
709
|
}
|
|
710
710
|
/**
|
|
711
711
|
* Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint.
|
|
712
712
|
*/
|
|
713
713
|
sint64(e) {
|
|
714
714
|
let t = Ee.from(e), n = t.hi >> 31, r = t.lo << 1 ^ n, i = (t.hi << 1 | t.lo >>> 31) ^ n;
|
|
715
|
-
return
|
|
715
|
+
return Nn(r, i, this.buf), this;
|
|
716
716
|
}
|
|
717
717
|
/**
|
|
718
718
|
* Write a `uint64` value, an unsigned 64-bit varint.
|
|
719
719
|
*/
|
|
720
720
|
uint64(e) {
|
|
721
721
|
let t = De.from(e);
|
|
722
|
-
return
|
|
722
|
+
return Nn(t.lo, t.hi, this.buf), this;
|
|
723
723
|
}
|
|
724
724
|
}
|
|
725
|
-
const
|
|
725
|
+
const Jn = {
|
|
726
726
|
emitDefaultValues: !1,
|
|
727
727
|
enumAsInteger: !1,
|
|
728
728
|
useProtoFieldName: !1,
|
|
729
729
|
prettySpaces: 0
|
|
730
|
-
},
|
|
730
|
+
}, Qn = {
|
|
731
731
|
ignoreUnknownFields: !1
|
|
732
732
|
};
|
|
733
|
-
function
|
|
734
|
-
return s ? Object.assign(Object.assign({},
|
|
733
|
+
function hi(s) {
|
|
734
|
+
return s ? Object.assign(Object.assign({}, Qn), s) : Qn;
|
|
735
735
|
}
|
|
736
|
-
function
|
|
737
|
-
return s ? Object.assign(Object.assign({},
|
|
736
|
+
function ui(s) {
|
|
737
|
+
return s ? Object.assign(Object.assign({}, Jn), s) : Jn;
|
|
738
738
|
}
|
|
739
|
-
function
|
|
739
|
+
function fi(s, e) {
|
|
740
740
|
var t, n;
|
|
741
741
|
let r = Object.assign(Object.assign({}, s), e);
|
|
742
742
|
return r.typeRegistry = [...(t = s == null ? void 0 : s.typeRegistry) !== null && t !== void 0 ? t : [], ...(n = e == null ? void 0 : e.typeRegistry) !== null && n !== void 0 ? n : []], r;
|
|
743
743
|
}
|
|
744
|
-
const
|
|
745
|
-
function
|
|
744
|
+
const Fr = Symbol.for("protobuf-ts/message-type");
|
|
745
|
+
function Dn(s) {
|
|
746
746
|
let e = !1;
|
|
747
747
|
const t = [];
|
|
748
748
|
for (let n = 0; n < s.length; n++) {
|
|
@@ -759,15 +759,15 @@ var dt;
|
|
|
759
759
|
(function(s) {
|
|
760
760
|
s[s.BIGINT = 0] = "BIGINT", s[s.STRING = 1] = "STRING", s[s.NUMBER = 2] = "NUMBER";
|
|
761
761
|
})(dt || (dt = {}));
|
|
762
|
-
var
|
|
762
|
+
var mn;
|
|
763
763
|
(function(s) {
|
|
764
764
|
s[s.NO = 0] = "NO", s[s.PACKED = 1] = "PACKED", s[s.UNPACKED = 2] = "UNPACKED";
|
|
765
|
-
})(
|
|
766
|
-
function
|
|
765
|
+
})(mn || (mn = {}));
|
|
766
|
+
function pi(s) {
|
|
767
767
|
var e, t, n, r;
|
|
768
|
-
return s.localName = (e = s.localName) !== null && e !== void 0 ? e :
|
|
768
|
+
return s.localName = (e = s.localName) !== null && e !== void 0 ? e : Dn(s.name), s.jsonName = (t = s.jsonName) !== null && t !== void 0 ? t : Dn(s.name), s.repeat = (n = s.repeat) !== null && n !== void 0 ? n : mn.NO, s.opt = (r = s.opt) !== null && r !== void 0 ? r : s.repeat || s.oneof ? !1 : s.kind == "message", s;
|
|
769
769
|
}
|
|
770
|
-
function
|
|
770
|
+
function mi(s) {
|
|
771
771
|
if (typeof s != "object" || s === null || !s.hasOwnProperty("oneofKind"))
|
|
772
772
|
return !1;
|
|
773
773
|
switch (typeof s.oneofKind) {
|
|
@@ -779,7 +779,7 @@ function fi(s) {
|
|
|
779
779
|
return !1;
|
|
780
780
|
}
|
|
781
781
|
}
|
|
782
|
-
class
|
|
782
|
+
class gi {
|
|
783
783
|
constructor(e) {
|
|
784
784
|
var t;
|
|
785
785
|
this.fields = (t = e.fields) !== null && t !== void 0 ? t : [];
|
|
@@ -839,7 +839,7 @@ class pi {
|
|
|
839
839
|
return !0;
|
|
840
840
|
for (const o of i.oneofs) {
|
|
841
841
|
const a = e[o];
|
|
842
|
-
if (!
|
|
842
|
+
if (!mi(a))
|
|
843
843
|
return !1;
|
|
844
844
|
if (a.oneofKind === void 0)
|
|
845
845
|
continue;
|
|
@@ -965,7 +965,7 @@ function Je(s, e) {
|
|
|
965
965
|
return s.toString();
|
|
966
966
|
}
|
|
967
967
|
}
|
|
968
|
-
class
|
|
968
|
+
class wi {
|
|
969
969
|
constructor(e) {
|
|
970
970
|
this.info = e;
|
|
971
971
|
}
|
|
@@ -981,7 +981,7 @@ class mi {
|
|
|
981
981
|
// Cannot parse JSON <type of jsonValue> for <type name>#<fieldName>.
|
|
982
982
|
assert(e, t, n) {
|
|
983
983
|
if (!e) {
|
|
984
|
-
let r =
|
|
984
|
+
let r = yr(n);
|
|
985
985
|
throw (r == "number" || r == "boolean") && (r = n.toString()), new Error(`Cannot parse JSON ${r} for ${this.info.typeName}#${t}`);
|
|
986
986
|
}
|
|
987
987
|
}
|
|
@@ -1019,7 +1019,7 @@ class mi {
|
|
|
1019
1019
|
if (a.kind == "map") {
|
|
1020
1020
|
if (o === null)
|
|
1021
1021
|
continue;
|
|
1022
|
-
this.assert(
|
|
1022
|
+
this.assert(Jr(o), a.name, o);
|
|
1023
1023
|
const l = h[c];
|
|
1024
1024
|
for (const [u, d] of Object.entries(o)) {
|
|
1025
1025
|
this.assert(d !== null, a.name + " map value", null);
|
|
@@ -1135,7 +1135,7 @@ class mi {
|
|
|
1135
1135
|
i = "too large or small";
|
|
1136
1136
|
break;
|
|
1137
1137
|
}
|
|
1138
|
-
return t == D.FLOAT &&
|
|
1138
|
+
return t == D.FLOAT && $n(o), o;
|
|
1139
1139
|
case D.INT32:
|
|
1140
1140
|
case D.FIXED32:
|
|
1141
1141
|
case D.SFIXED32:
|
|
@@ -1146,7 +1146,7 @@ class mi {
|
|
|
1146
1146
|
let a;
|
|
1147
1147
|
if (typeof e == "number" ? a = e : e === "" ? i = "empty string" : typeof e == "string" && (e.trim().length !== e.length ? i = "extra whitespace" : a = Number(e)), a === void 0)
|
|
1148
1148
|
break;
|
|
1149
|
-
return t == D.UINT32 ?
|
|
1149
|
+
return t == D.UINT32 ? pn(a) : Yt(a), a;
|
|
1150
1150
|
case D.INT64:
|
|
1151
1151
|
case D.SFIXED64:
|
|
1152
1152
|
case D.SINT64:
|
|
@@ -1187,7 +1187,7 @@ class mi {
|
|
|
1187
1187
|
return new Uint8Array(0);
|
|
1188
1188
|
if (typeof e != "string")
|
|
1189
1189
|
break;
|
|
1190
|
-
return
|
|
1190
|
+
return br(e);
|
|
1191
1191
|
}
|
|
1192
1192
|
} catch (o) {
|
|
1193
1193
|
i = o.message;
|
|
@@ -1195,7 +1195,7 @@ class mi {
|
|
|
1195
1195
|
this.assert(!1, r + (i ? " - " + i : ""), e);
|
|
1196
1196
|
}
|
|
1197
1197
|
}
|
|
1198
|
-
class
|
|
1198
|
+
class yi {
|
|
1199
1199
|
constructor(e) {
|
|
1200
1200
|
var t;
|
|
1201
1201
|
this.fields = (t = e.fields) !== null && t !== void 0 ? t : [];
|
|
@@ -1316,12 +1316,12 @@ class gi {
|
|
|
1316
1316
|
case D.INT32:
|
|
1317
1317
|
case D.SFIXED32:
|
|
1318
1318
|
case D.SINT32:
|
|
1319
|
-
return t === 0 ? o ? 0 : void 0 : (
|
|
1319
|
+
return t === 0 ? o ? 0 : void 0 : (Yt(t), t);
|
|
1320
1320
|
case D.FIXED32:
|
|
1321
1321
|
case D.UINT32:
|
|
1322
|
-
return t === 0 ? o ? 0 : void 0 : (
|
|
1322
|
+
return t === 0 ? o ? 0 : void 0 : (pn(t), t);
|
|
1323
1323
|
case D.FLOAT:
|
|
1324
|
-
|
|
1324
|
+
$n(t);
|
|
1325
1325
|
case D.DOUBLE:
|
|
1326
1326
|
return t === 0 ? o ? 0 : void 0 : (G(typeof t == "number"), Number.isNaN(t) ? "NaN" : t === Number.POSITIVE_INFINITY ? "Infinity" : t === Number.NEGATIVE_INFINITY ? "-Infinity" : t);
|
|
1327
1327
|
case D.STRING:
|
|
@@ -1340,11 +1340,11 @@ class gi {
|
|
|
1340
1340
|
let c = Ee.from(t);
|
|
1341
1341
|
return c.isZero() && !o ? void 0 : c.toString();
|
|
1342
1342
|
case D.BYTES:
|
|
1343
|
-
return G(t instanceof Uint8Array), t.byteLength ?
|
|
1343
|
+
return G(t instanceof Uint8Array), t.byteLength ? Cr(t) : o ? "" : void 0;
|
|
1344
1344
|
}
|
|
1345
1345
|
}
|
|
1346
1346
|
}
|
|
1347
|
-
function
|
|
1347
|
+
function Rn(s, e = dt.STRING) {
|
|
1348
1348
|
switch (s) {
|
|
1349
1349
|
case D.BOOL:
|
|
1350
1350
|
return !1;
|
|
@@ -1366,7 +1366,7 @@ function Sn(s, e = dt.STRING) {
|
|
|
1366
1366
|
return 0;
|
|
1367
1367
|
}
|
|
1368
1368
|
}
|
|
1369
|
-
class
|
|
1369
|
+
class bi {
|
|
1370
1370
|
constructor(e) {
|
|
1371
1371
|
this.info = e;
|
|
1372
1372
|
}
|
|
@@ -1460,13 +1460,13 @@ class wi {
|
|
|
1460
1460
|
}
|
|
1461
1461
|
}
|
|
1462
1462
|
if (o === void 0) {
|
|
1463
|
-
let c =
|
|
1463
|
+
let c = Rn(e.K);
|
|
1464
1464
|
o = e.K == D.BOOL ? c.toString() : c;
|
|
1465
1465
|
}
|
|
1466
1466
|
if (a === void 0)
|
|
1467
1467
|
switch (e.V.kind) {
|
|
1468
1468
|
case "scalar":
|
|
1469
|
-
a =
|
|
1469
|
+
a = Rn(e.V.T, e.V.L);
|
|
1470
1470
|
break;
|
|
1471
1471
|
case "enum":
|
|
1472
1472
|
a = 0;
|
|
@@ -1512,7 +1512,7 @@ class wi {
|
|
|
1512
1512
|
}
|
|
1513
1513
|
}
|
|
1514
1514
|
}
|
|
1515
|
-
class
|
|
1515
|
+
class Ci {
|
|
1516
1516
|
constructor(e) {
|
|
1517
1517
|
this.info = e;
|
|
1518
1518
|
}
|
|
@@ -1541,7 +1541,7 @@ class yi {
|
|
|
1541
1541
|
case "enum":
|
|
1542
1542
|
let l = i.kind == "enum" ? D.INT32 : i.T;
|
|
1543
1543
|
if (c)
|
|
1544
|
-
if (G(Array.isArray(o)), c ==
|
|
1544
|
+
if (G(Array.isArray(o)), c == mn.PACKED)
|
|
1545
1545
|
this.packed(t, l, i.no, o);
|
|
1546
1546
|
else
|
|
1547
1547
|
for (const u of o)
|
|
@@ -1678,8 +1678,8 @@ class yi {
|
|
|
1678
1678
|
return [n, r, i || o];
|
|
1679
1679
|
}
|
|
1680
1680
|
}
|
|
1681
|
-
function
|
|
1682
|
-
const e = s.messagePrototype ? Object.create(s.messagePrototype) : Object.defineProperty({},
|
|
1681
|
+
function Ei(s) {
|
|
1682
|
+
const e = s.messagePrototype ? Object.create(s.messagePrototype) : Object.defineProperty({}, Fr, { value: s });
|
|
1683
1683
|
for (let t of s.fields) {
|
|
1684
1684
|
let n = t.localName;
|
|
1685
1685
|
if (!t.opt)
|
|
@@ -1690,7 +1690,7 @@ function bi(s) {
|
|
|
1690
1690
|
else
|
|
1691
1691
|
switch (t.kind) {
|
|
1692
1692
|
case "scalar":
|
|
1693
|
-
e[n] =
|
|
1693
|
+
e[n] = Rn(t.T, t.L);
|
|
1694
1694
|
break;
|
|
1695
1695
|
case "enum":
|
|
1696
1696
|
e[n] = 0;
|
|
@@ -1702,7 +1702,7 @@ function bi(s) {
|
|
|
1702
1702
|
}
|
|
1703
1703
|
return e;
|
|
1704
1704
|
}
|
|
1705
|
-
function
|
|
1705
|
+
function Ae(s, e, t) {
|
|
1706
1706
|
let n, r = t, i;
|
|
1707
1707
|
for (let o of s.fields) {
|
|
1708
1708
|
let a = o.localName;
|
|
@@ -1748,7 +1748,7 @@ function ve(s, e, t) {
|
|
|
1748
1748
|
}
|
|
1749
1749
|
}
|
|
1750
1750
|
}
|
|
1751
|
-
function
|
|
1751
|
+
function vi(s, e, t) {
|
|
1752
1752
|
if (e === t)
|
|
1753
1753
|
return !0;
|
|
1754
1754
|
if (!e || !t)
|
|
@@ -1759,24 +1759,24 @@ function Ci(s, e, t) {
|
|
|
1759
1759
|
case "enum":
|
|
1760
1760
|
case "scalar":
|
|
1761
1761
|
let a = n.kind == "enum" ? D.INT32 : n.T;
|
|
1762
|
-
if (!(n.repeat ?
|
|
1762
|
+
if (!(n.repeat ? Yn(a, i, o) : Nr(a, i, o)))
|
|
1763
1763
|
return !1;
|
|
1764
1764
|
break;
|
|
1765
1765
|
case "map":
|
|
1766
|
-
if (!(n.V.kind == "message" ?
|
|
1766
|
+
if (!(n.V.kind == "message" ? er(n.V.T(), an(i), an(o)) : Yn(n.V.kind == "enum" ? D.INT32 : n.V.T, an(i), an(o))))
|
|
1767
1767
|
return !1;
|
|
1768
1768
|
break;
|
|
1769
1769
|
case "message":
|
|
1770
1770
|
let c = n.T();
|
|
1771
|
-
if (!(n.repeat ?
|
|
1771
|
+
if (!(n.repeat ? er(c, i, o) : c.equals(i, o)))
|
|
1772
1772
|
return !1;
|
|
1773
1773
|
break;
|
|
1774
1774
|
}
|
|
1775
1775
|
}
|
|
1776
1776
|
return !0;
|
|
1777
1777
|
}
|
|
1778
|
-
const
|
|
1779
|
-
function
|
|
1778
|
+
const an = Object.values;
|
|
1779
|
+
function Nr(s, e, t) {
|
|
1780
1780
|
if (e === t)
|
|
1781
1781
|
return !0;
|
|
1782
1782
|
if (s !== D.BYTES)
|
|
@@ -1789,15 +1789,15 @@ function kr(s, e, t) {
|
|
|
1789
1789
|
return !1;
|
|
1790
1790
|
return !0;
|
|
1791
1791
|
}
|
|
1792
|
-
function
|
|
1792
|
+
function Yn(s, e, t) {
|
|
1793
1793
|
if (e.length !== t.length)
|
|
1794
1794
|
return !1;
|
|
1795
1795
|
for (let n = 0; n < e.length; n++)
|
|
1796
|
-
if (!
|
|
1796
|
+
if (!Nr(s, e[n], t[n]))
|
|
1797
1797
|
return !1;
|
|
1798
1798
|
return !0;
|
|
1799
1799
|
}
|
|
1800
|
-
function
|
|
1800
|
+
function er(s, e, t) {
|
|
1801
1801
|
if (e.length !== t.length)
|
|
1802
1802
|
return !1;
|
|
1803
1803
|
for (let n = 0; n < e.length; n++)
|
|
@@ -1805,14 +1805,14 @@ function Qn(s, e, t) {
|
|
|
1805
1805
|
return !1;
|
|
1806
1806
|
return !0;
|
|
1807
1807
|
}
|
|
1808
|
-
const
|
|
1808
|
+
const Ai = Object.getOwnPropertyDescriptors(Object.getPrototypeOf({}));
|
|
1809
1809
|
class xe {
|
|
1810
1810
|
constructor(e, t, n) {
|
|
1811
|
-
this.defaultCheckDepth = 16, this.typeName = e, this.fields = t.map(
|
|
1811
|
+
this.defaultCheckDepth = 16, this.typeName = e, this.fields = t.map(pi), this.options = n ?? {}, this.messagePrototype = Object.create(null, Object.assign(Object.assign({}, Ai), { [Fr]: { value: this } })), this.refTypeCheck = new gi(this), this.refJsonReader = new wi(this), this.refJsonWriter = new yi(this), this.refBinReader = new bi(this), this.refBinWriter = new Ci(this);
|
|
1812
1812
|
}
|
|
1813
1813
|
create(e) {
|
|
1814
|
-
let t =
|
|
1815
|
-
return e !== void 0 &&
|
|
1814
|
+
let t = Ei(this);
|
|
1815
|
+
return e !== void 0 && Ae(this, t, e), t;
|
|
1816
1816
|
}
|
|
1817
1817
|
/**
|
|
1818
1818
|
* Clone the message.
|
|
@@ -1821,7 +1821,7 @@ class xe {
|
|
|
1821
1821
|
*/
|
|
1822
1822
|
clone(e) {
|
|
1823
1823
|
let t = this.create();
|
|
1824
|
-
return
|
|
1824
|
+
return Ae(this, t, e), t;
|
|
1825
1825
|
}
|
|
1826
1826
|
/**
|
|
1827
1827
|
* Determines whether two message of the same type have the same field values.
|
|
@@ -1830,7 +1830,7 @@ class xe {
|
|
|
1830
1830
|
* Will also return true if both messages are `undefined`.
|
|
1831
1831
|
*/
|
|
1832
1832
|
equals(e, t) {
|
|
1833
|
-
return
|
|
1833
|
+
return vi(this, e, t);
|
|
1834
1834
|
}
|
|
1835
1835
|
/**
|
|
1836
1836
|
* Is the given value assignable to our message type
|
|
@@ -1850,20 +1850,20 @@ class xe {
|
|
|
1850
1850
|
* Copy partial data into the target message.
|
|
1851
1851
|
*/
|
|
1852
1852
|
mergePartial(e, t) {
|
|
1853
|
-
|
|
1853
|
+
Ae(this, e, t);
|
|
1854
1854
|
}
|
|
1855
1855
|
/**
|
|
1856
1856
|
* Create a new message from binary format.
|
|
1857
1857
|
*/
|
|
1858
1858
|
fromBinary(e, t) {
|
|
1859
|
-
let n =
|
|
1859
|
+
let n = ni(t);
|
|
1860
1860
|
return this.internalBinaryRead(n.readerFactory(e), e.byteLength, n);
|
|
1861
1861
|
}
|
|
1862
1862
|
/**
|
|
1863
1863
|
* Read a new message from a JSON value.
|
|
1864
1864
|
*/
|
|
1865
1865
|
fromJson(e, t) {
|
|
1866
|
-
return this.internalJsonRead(e,
|
|
1866
|
+
return this.internalJsonRead(e, hi(t));
|
|
1867
1867
|
}
|
|
1868
1868
|
/**
|
|
1869
1869
|
* Read a new message from a JSON string.
|
|
@@ -1877,7 +1877,7 @@ class xe {
|
|
|
1877
1877
|
* Write the message to canonical JSON value.
|
|
1878
1878
|
*/
|
|
1879
1879
|
toJson(e, t) {
|
|
1880
|
-
return this.internalJsonWrite(e,
|
|
1880
|
+
return this.internalJsonWrite(e, ui(t));
|
|
1881
1881
|
}
|
|
1882
1882
|
/**
|
|
1883
1883
|
* Convert the message to canonical JSON string.
|
|
@@ -1892,7 +1892,7 @@ class xe {
|
|
|
1892
1892
|
* Write the message to binary format.
|
|
1893
1893
|
*/
|
|
1894
1894
|
toBinary(e, t) {
|
|
1895
|
-
let n =
|
|
1895
|
+
let n = ci(t);
|
|
1896
1896
|
return this.internalBinaryWrite(e, n.writerFactory(), n).finish();
|
|
1897
1897
|
}
|
|
1898
1898
|
/**
|
|
@@ -1908,7 +1908,7 @@ class xe {
|
|
|
1908
1908
|
let r = n ?? this.create();
|
|
1909
1909
|
return this.refJsonReader.read(e, r, t), r;
|
|
1910
1910
|
}
|
|
1911
|
-
throw new Error(`Unable to parse message ${this.typeName} from JSON ${
|
|
1911
|
+
throw new Error(`Unable to parse message ${this.typeName} from JSON ${yr(e)}.`);
|
|
1912
1912
|
}
|
|
1913
1913
|
/**
|
|
1914
1914
|
* This is an internal method. If you just want to write a message
|
|
@@ -1942,14 +1942,14 @@ class xe {
|
|
|
1942
1942
|
return this.refBinReader.read(e, i, n, t), i;
|
|
1943
1943
|
}
|
|
1944
1944
|
}
|
|
1945
|
-
function
|
|
1945
|
+
function ki(s, e) {
|
|
1946
1946
|
var t, n, r;
|
|
1947
1947
|
let i = s;
|
|
1948
|
-
return i.service = e, i.localName = (t = i.localName) !== null && t !== void 0 ? t :
|
|
1948
|
+
return i.service = e, i.localName = (t = i.localName) !== null && t !== void 0 ? t : Dn(i.name), i.serverStreaming = !!i.serverStreaming, i.clientStreaming = !!i.clientStreaming, i.options = (n = i.options) !== null && n !== void 0 ? n : {}, i.idempotency = (r = i.idempotency) !== null && r !== void 0 ? r : void 0, i;
|
|
1949
1949
|
}
|
|
1950
|
-
class
|
|
1950
|
+
class Pn {
|
|
1951
1951
|
constructor(e, t, n) {
|
|
1952
|
-
this.typeName = e, this.methods = t.map((r) =>
|
|
1952
|
+
this.typeName = e, this.methods = t.map((r) => ki(r, this)), this.options = n ?? {};
|
|
1953
1953
|
}
|
|
1954
1954
|
}
|
|
1955
1955
|
class se extends Error {
|
|
@@ -1969,22 +1969,22 @@ class se extends Error {
|
|
|
1969
1969
|
`);
|
|
1970
1970
|
}
|
|
1971
1971
|
}
|
|
1972
|
-
function
|
|
1972
|
+
function Fi(s, e) {
|
|
1973
1973
|
if (!e)
|
|
1974
1974
|
return s;
|
|
1975
1975
|
let t = {};
|
|
1976
|
-
|
|
1976
|
+
ln(s, t), ln(e, t);
|
|
1977
1977
|
for (let n of Object.keys(e)) {
|
|
1978
1978
|
let r = e[n];
|
|
1979
1979
|
switch (n) {
|
|
1980
1980
|
case "jsonOptions":
|
|
1981
|
-
t.jsonOptions =
|
|
1981
|
+
t.jsonOptions = fi(s.jsonOptions, t.jsonOptions);
|
|
1982
1982
|
break;
|
|
1983
1983
|
case "binaryOptions":
|
|
1984
|
-
t.binaryOptions =
|
|
1984
|
+
t.binaryOptions = Qr(s.binaryOptions, t.binaryOptions);
|
|
1985
1985
|
break;
|
|
1986
1986
|
case "meta":
|
|
1987
|
-
t.meta = {},
|
|
1987
|
+
t.meta = {}, ln(s.meta, t.meta), ln(e.meta, t.meta);
|
|
1988
1988
|
break;
|
|
1989
1989
|
case "interceptors":
|
|
1990
1990
|
t.interceptors = s.interceptors ? s.interceptors.concat(r) : r.concat();
|
|
@@ -1993,7 +1993,7 @@ function vi(s, e) {
|
|
|
1993
1993
|
}
|
|
1994
1994
|
return t;
|
|
1995
1995
|
}
|
|
1996
|
-
function
|
|
1996
|
+
function ln(s, e) {
|
|
1997
1997
|
if (!s)
|
|
1998
1998
|
return;
|
|
1999
1999
|
let t = e;
|
|
@@ -2064,7 +2064,7 @@ class Ct {
|
|
|
2064
2064
|
this._state === Ze.PENDING && this.reject(e);
|
|
2065
2065
|
}
|
|
2066
2066
|
}
|
|
2067
|
-
class
|
|
2067
|
+
class Ni {
|
|
2068
2068
|
constructor() {
|
|
2069
2069
|
this._lis = {
|
|
2070
2070
|
nxt: [],
|
|
@@ -2171,7 +2171,7 @@ class ki {
|
|
|
2171
2171
|
t.q.push(e);
|
|
2172
2172
|
}
|
|
2173
2173
|
}
|
|
2174
|
-
var
|
|
2174
|
+
var Ii = function(s, e, t, n) {
|
|
2175
2175
|
function r(i) {
|
|
2176
2176
|
return i instanceof t ? i : new t(function(o) {
|
|
2177
2177
|
o(i);
|
|
@@ -2198,7 +2198,7 @@ var Fi = function(s, e, t, n) {
|
|
|
2198
2198
|
h((n = n.apply(s, e || [])).next());
|
|
2199
2199
|
});
|
|
2200
2200
|
};
|
|
2201
|
-
class
|
|
2201
|
+
class Li {
|
|
2202
2202
|
constructor(e, t, n, r, i, o, a) {
|
|
2203
2203
|
this.method = e, this.requestHeaders = t, this.request = n, this.headers = r, this.response = i, this.status = o, this.trailers = a;
|
|
2204
2204
|
}
|
|
@@ -2210,7 +2210,7 @@ class Ni {
|
|
|
2210
2210
|
return this.promiseFinished().then((n) => e ? Promise.resolve(e(n)) : n, (n) => t ? Promise.resolve(t(n)) : Promise.reject(n));
|
|
2211
2211
|
}
|
|
2212
2212
|
promiseFinished() {
|
|
2213
|
-
return
|
|
2213
|
+
return Ii(this, void 0, void 0, function* () {
|
|
2214
2214
|
let [e, t, n, r] = yield Promise.all([this.headers, this.response, this.status, this.trailers]);
|
|
2215
2215
|
return {
|
|
2216
2216
|
method: this.method,
|
|
@@ -2224,7 +2224,7 @@ class Ni {
|
|
|
2224
2224
|
});
|
|
2225
2225
|
}
|
|
2226
2226
|
}
|
|
2227
|
-
var
|
|
2227
|
+
var Ti = function(s, e, t, n) {
|
|
2228
2228
|
function r(i) {
|
|
2229
2229
|
return i instanceof t ? i : new t(function(o) {
|
|
2230
2230
|
o(i);
|
|
@@ -2251,7 +2251,7 @@ var Ii = function(s, e, t, n) {
|
|
|
2251
2251
|
h((n = n.apply(s, e || [])).next());
|
|
2252
2252
|
});
|
|
2253
2253
|
};
|
|
2254
|
-
class
|
|
2254
|
+
class xi {
|
|
2255
2255
|
constructor(e, t, n, r, i, o, a) {
|
|
2256
2256
|
this.method = e, this.requestHeaders = t, this.request = n, this.headers = r, this.responses = i, this.status = o, this.trailers = a;
|
|
2257
2257
|
}
|
|
@@ -2265,7 +2265,7 @@ class Li {
|
|
|
2265
2265
|
return this.promiseFinished().then((n) => e ? Promise.resolve(e(n)) : n, (n) => t ? Promise.resolve(t(n)) : Promise.reject(n));
|
|
2266
2266
|
}
|
|
2267
2267
|
promiseFinished() {
|
|
2268
|
-
return
|
|
2268
|
+
return Ti(this, void 0, void 0, function* () {
|
|
2269
2269
|
let [e, t, n] = yield Promise.all([this.headers, this.status, this.trailers]);
|
|
2270
2270
|
return {
|
|
2271
2271
|
method: this.method,
|
|
@@ -2289,11 +2289,11 @@ function qe(s, e, t, n, r) {
|
|
|
2289
2289
|
return o(t, r, n);
|
|
2290
2290
|
}
|
|
2291
2291
|
}
|
|
2292
|
-
var
|
|
2292
|
+
var W;
|
|
2293
2293
|
(function(s) {
|
|
2294
2294
|
s[s.OK = 0] = "OK", s[s.CANCELLED = 1] = "CANCELLED", s[s.UNKNOWN = 2] = "UNKNOWN", s[s.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT", s[s.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED", s[s.NOT_FOUND = 5] = "NOT_FOUND", s[s.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", s[s.PERMISSION_DENIED = 7] = "PERMISSION_DENIED", s[s.UNAUTHENTICATED = 16] = "UNAUTHENTICATED", s[s.RESOURCE_EXHAUSTED = 8] = "RESOURCE_EXHAUSTED", s[s.FAILED_PRECONDITION = 9] = "FAILED_PRECONDITION", s[s.ABORTED = 10] = "ABORTED", s[s.OUT_OF_RANGE = 11] = "OUT_OF_RANGE", s[s.UNIMPLEMENTED = 12] = "UNIMPLEMENTED", s[s.INTERNAL = 13] = "INTERNAL", s[s.UNAVAILABLE = 14] = "UNAVAILABLE", s[s.DATA_LOSS = 15] = "DATA_LOSS";
|
|
2295
|
-
})(
|
|
2296
|
-
var
|
|
2295
|
+
})(W || (W = {}));
|
|
2296
|
+
var _i = function(s, e, t, n) {
|
|
2297
2297
|
function r(i) {
|
|
2298
2298
|
return i instanceof t ? i : new t(function(o) {
|
|
2299
2299
|
o(i);
|
|
@@ -2320,7 +2320,7 @@ var Ti = function(s, e, t, n) {
|
|
|
2320
2320
|
h((n = n.apply(s, e || [])).next());
|
|
2321
2321
|
});
|
|
2322
2322
|
};
|
|
2323
|
-
function
|
|
2323
|
+
function tr(s, e, t, n, r) {
|
|
2324
2324
|
if (n)
|
|
2325
2325
|
for (let [i, o] of Object.entries(n))
|
|
2326
2326
|
if (typeof o == "string")
|
|
@@ -2330,24 +2330,24 @@ function Yn(s, e, t, n, r) {
|
|
|
2330
2330
|
s.append(i, a);
|
|
2331
2331
|
if (s.set("Content-Type", e === "text" ? "application/grpc-web-text" : "application/grpc-web+proto"), e == "text" && s.set("Accept", "application/grpc-web-text"), s.set("X-Grpc-Web", "1"), typeof t == "number") {
|
|
2332
2332
|
if (t <= 0)
|
|
2333
|
-
throw new se(`timeout ${t} ms exceeded`,
|
|
2333
|
+
throw new se(`timeout ${t} ms exceeded`, W[W.DEADLINE_EXCEEDED]);
|
|
2334
2334
|
s.set("grpc-timeout", `${t}m`);
|
|
2335
2335
|
} else if (t) {
|
|
2336
2336
|
const i = t.getTime(), o = Date.now();
|
|
2337
2337
|
if (i <= o)
|
|
2338
|
-
throw new se(`deadline ${t} exceeded`,
|
|
2338
|
+
throw new se(`deadline ${t} exceeded`, W[W.DEADLINE_EXCEEDED]);
|
|
2339
2339
|
s.set("grpc-timeout", `${i - o}m`);
|
|
2340
2340
|
}
|
|
2341
2341
|
return s;
|
|
2342
2342
|
}
|
|
2343
|
-
function
|
|
2343
|
+
function nr(s, e) {
|
|
2344
2344
|
let t = new Uint8Array(5 + s.length);
|
|
2345
2345
|
t[0] = Qe.DATA;
|
|
2346
2346
|
for (let n = s.length, r = 4; r > 0; r--)
|
|
2347
2347
|
t[r] = n % 256, n >>>= 8;
|
|
2348
|
-
return t.set(s, 5), e === "binary" ? t :
|
|
2348
|
+
return t.set(s, 5), e === "binary" ? t : Cr(t);
|
|
2349
2349
|
}
|
|
2350
|
-
function
|
|
2350
|
+
function Mn(s, e, t) {
|
|
2351
2351
|
if (arguments.length === 1) {
|
|
2352
2352
|
let c = s, h;
|
|
2353
2353
|
try {
|
|
@@ -2358,25 +2358,25 @@ function Dn(s, e, t) {
|
|
|
2358
2358
|
case "error":
|
|
2359
2359
|
case "opaque":
|
|
2360
2360
|
case "opaqueredirect":
|
|
2361
|
-
throw new se(`fetch response type ${c.type}`,
|
|
2361
|
+
throw new se(`fetch response type ${c.type}`, W[W.UNKNOWN]);
|
|
2362
2362
|
}
|
|
2363
|
-
return
|
|
2363
|
+
return Mn(Si(c.headers), c.status, c.statusText);
|
|
2364
2364
|
}
|
|
2365
|
-
let n = s, r = e >= 200 && e < 300, i =
|
|
2366
|
-
return (o === void 0 || o ===
|
|
2365
|
+
let n = s, r = e >= 200 && e < 300, i = Lr(n), [o, a] = Ir(n);
|
|
2366
|
+
return (o === void 0 || o === W.OK) && !r && (o = Di(e), a = t), [o, a, i];
|
|
2367
2367
|
}
|
|
2368
|
-
function
|
|
2369
|
-
let e =
|
|
2370
|
-
return [t ??
|
|
2368
|
+
function rr(s) {
|
|
2369
|
+
let e = Oi(s), [t, n] = Ir(e), r = Lr(e);
|
|
2370
|
+
return [t ?? W.OK, n, r];
|
|
2371
2371
|
}
|
|
2372
2372
|
var Qe;
|
|
2373
2373
|
(function(s) {
|
|
2374
2374
|
s[s.DATA = 0] = "DATA", s[s.TRAILER = 128] = "TRAILER";
|
|
2375
2375
|
})(Qe || (Qe = {}));
|
|
2376
|
-
function
|
|
2377
|
-
return
|
|
2378
|
-
let n, r = "", i = new Uint8Array(0), o =
|
|
2379
|
-
if (
|
|
2376
|
+
function ir(s, e, t) {
|
|
2377
|
+
return _i(this, void 0, void 0, function* () {
|
|
2378
|
+
let n, r = "", i = new Uint8Array(0), o = Bi(e);
|
|
2379
|
+
if (Ui(s)) {
|
|
2380
2380
|
let a = s.getReader();
|
|
2381
2381
|
n = {
|
|
2382
2382
|
next: () => a.read()
|
|
@@ -2392,9 +2392,9 @@ function nr(s, e, t) {
|
|
|
2392
2392
|
let c = r.length - r.length % 4;
|
|
2393
2393
|
if (c === 0)
|
|
2394
2394
|
continue;
|
|
2395
|
-
i =
|
|
2395
|
+
i = sr(i, br(r.substring(0, c))), r = r.substring(c);
|
|
2396
2396
|
} else
|
|
2397
|
-
i =
|
|
2397
|
+
i = sr(i, a.value);
|
|
2398
2398
|
for (; i.length >= 5 && i[0] === Qe.DATA; ) {
|
|
2399
2399
|
let c = 0;
|
|
2400
2400
|
for (let h = 1; h < 5; h++)
|
|
@@ -2409,19 +2409,19 @@ function nr(s, e, t) {
|
|
|
2409
2409
|
if (i.length === 0)
|
|
2410
2410
|
break;
|
|
2411
2411
|
if (i[0] !== Qe.TRAILER || i.length < 5)
|
|
2412
|
-
throw new se("premature EOF",
|
|
2412
|
+
throw new se("premature EOF", W[W.DATA_LOSS]);
|
|
2413
2413
|
t(Qe.TRAILER, i.subarray(5));
|
|
2414
2414
|
break;
|
|
2415
2415
|
}
|
|
2416
2416
|
}
|
|
2417
2417
|
});
|
|
2418
2418
|
}
|
|
2419
|
-
const
|
|
2420
|
-
function
|
|
2419
|
+
const Ui = (s) => typeof s.getReader == "function";
|
|
2420
|
+
function sr(s, e) {
|
|
2421
2421
|
let t = new Uint8Array(s.length + e.length);
|
|
2422
2422
|
return t.set(s), t.set(e, s.length), t;
|
|
2423
2423
|
}
|
|
2424
|
-
function
|
|
2424
|
+
function Bi(s) {
|
|
2425
2425
|
switch (s) {
|
|
2426
2426
|
case "application/grpc-web-text":
|
|
2427
2427
|
case "application/grpc-web-text+proto":
|
|
@@ -2431,28 +2431,28 @@ function _i(s) {
|
|
|
2431
2431
|
return "binary";
|
|
2432
2432
|
case void 0:
|
|
2433
2433
|
case null:
|
|
2434
|
-
throw new se("missing response content type",
|
|
2434
|
+
throw new se("missing response content type", W[W.INTERNAL]);
|
|
2435
2435
|
default:
|
|
2436
|
-
throw new se("unexpected response content type: " + s,
|
|
2436
|
+
throw new se("unexpected response content type: " + s, W[W.INTERNAL]);
|
|
2437
2437
|
}
|
|
2438
2438
|
}
|
|
2439
|
-
function
|
|
2439
|
+
function Ir(s) {
|
|
2440
2440
|
let e, t, n = s["grpc-message"];
|
|
2441
2441
|
if (n !== void 0) {
|
|
2442
2442
|
if (Array.isArray(n))
|
|
2443
|
-
return [
|
|
2443
|
+
return [W.INTERNAL, "invalid grpc-web message"];
|
|
2444
2444
|
t = n;
|
|
2445
2445
|
}
|
|
2446
2446
|
let r = s["grpc-status"];
|
|
2447
2447
|
if (r !== void 0) {
|
|
2448
2448
|
if (Array.isArray(r))
|
|
2449
|
-
return [
|
|
2450
|
-
if (e = parseInt(r, 10),
|
|
2451
|
-
return [
|
|
2449
|
+
return [W.INTERNAL, "invalid grpc-web status"];
|
|
2450
|
+
if (e = parseInt(r, 10), W[e] === void 0)
|
|
2451
|
+
return [W.INTERNAL, "invalid grpc-web status"];
|
|
2452
2452
|
}
|
|
2453
2453
|
return [e, t];
|
|
2454
2454
|
}
|
|
2455
|
-
function
|
|
2455
|
+
function Lr(s) {
|
|
2456
2456
|
let e = {};
|
|
2457
2457
|
for (let [t, n] of Object.entries(s))
|
|
2458
2458
|
switch (t) {
|
|
@@ -2465,7 +2465,7 @@ function Nr(s) {
|
|
|
2465
2465
|
}
|
|
2466
2466
|
return e;
|
|
2467
2467
|
}
|
|
2468
|
-
function
|
|
2468
|
+
function Oi(s) {
|
|
2469
2469
|
let e = {};
|
|
2470
2470
|
for (let t of String.fromCharCode.apply(String, s).trim().split(`\r
|
|
2471
2471
|
`)) {
|
|
@@ -2479,51 +2479,51 @@ function Ui(s) {
|
|
|
2479
2479
|
}
|
|
2480
2480
|
return e;
|
|
2481
2481
|
}
|
|
2482
|
-
function
|
|
2482
|
+
function Si(s) {
|
|
2483
2483
|
let e = {};
|
|
2484
2484
|
return s.forEach((t, n) => {
|
|
2485
2485
|
let r = e[n];
|
|
2486
2486
|
typeof r == "string" ? e[n] = [r, t] : Array.isArray(r) ? r.push(t) : e[n] = t;
|
|
2487
2487
|
}), e;
|
|
2488
2488
|
}
|
|
2489
|
-
function
|
|
2489
|
+
function Di(s) {
|
|
2490
2490
|
switch (s) {
|
|
2491
2491
|
case 200:
|
|
2492
|
-
return
|
|
2492
|
+
return W.OK;
|
|
2493
2493
|
case 400:
|
|
2494
|
-
return
|
|
2494
|
+
return W.INVALID_ARGUMENT;
|
|
2495
2495
|
case 401:
|
|
2496
|
-
return
|
|
2496
|
+
return W.UNAUTHENTICATED;
|
|
2497
2497
|
case 403:
|
|
2498
|
-
return
|
|
2498
|
+
return W.PERMISSION_DENIED;
|
|
2499
2499
|
case 404:
|
|
2500
|
-
return
|
|
2500
|
+
return W.NOT_FOUND;
|
|
2501
2501
|
case 409:
|
|
2502
|
-
return
|
|
2502
|
+
return W.ABORTED;
|
|
2503
2503
|
case 412:
|
|
2504
|
-
return
|
|
2504
|
+
return W.FAILED_PRECONDITION;
|
|
2505
2505
|
case 429:
|
|
2506
|
-
return
|
|
2506
|
+
return W.RESOURCE_EXHAUSTED;
|
|
2507
2507
|
case 499:
|
|
2508
|
-
return
|
|
2508
|
+
return W.CANCELLED;
|
|
2509
2509
|
case 500:
|
|
2510
|
-
return
|
|
2510
|
+
return W.UNKNOWN;
|
|
2511
2511
|
case 501:
|
|
2512
|
-
return
|
|
2512
|
+
return W.UNIMPLEMENTED;
|
|
2513
2513
|
case 503:
|
|
2514
|
-
return
|
|
2514
|
+
return W.UNAVAILABLE;
|
|
2515
2515
|
case 504:
|
|
2516
|
-
return
|
|
2516
|
+
return W.DEADLINE_EXCEEDED;
|
|
2517
2517
|
default:
|
|
2518
|
-
return
|
|
2518
|
+
return W.UNKNOWN;
|
|
2519
2519
|
}
|
|
2520
2520
|
}
|
|
2521
|
-
class
|
|
2521
|
+
class Ri {
|
|
2522
2522
|
constructor(e) {
|
|
2523
2523
|
this.defaultOptions = e;
|
|
2524
2524
|
}
|
|
2525
2525
|
mergeOptions(e) {
|
|
2526
|
-
return
|
|
2526
|
+
return Fi(this.defaultOptions, e);
|
|
2527
2527
|
}
|
|
2528
2528
|
/**
|
|
2529
2529
|
* Create an URI for a gRPC web call.
|
|
@@ -2546,116 +2546,116 @@ class Si {
|
|
|
2546
2546
|
return n.endsWith("/") && (n = n.substring(0, n.length - 1)), `${n}/${e.service.typeName}/${e.name}`;
|
|
2547
2547
|
}
|
|
2548
2548
|
clientStreaming(e) {
|
|
2549
|
-
const t = new se("Client streaming is not supported by grpc-web",
|
|
2549
|
+
const t = new se("Client streaming is not supported by grpc-web", W[W.UNIMPLEMENTED]);
|
|
2550
2550
|
throw t.methodName = e.name, t.serviceName = e.service.typeName, t;
|
|
2551
2551
|
}
|
|
2552
2552
|
duplex(e) {
|
|
2553
|
-
const t = new se("Duplex streaming is not supported by grpc-web",
|
|
2553
|
+
const t = new se("Duplex streaming is not supported by grpc-web", W[W.UNIMPLEMENTED]);
|
|
2554
2554
|
throw t.methodName = e.name, t.serviceName = e.service.typeName, t;
|
|
2555
2555
|
}
|
|
2556
2556
|
serverStreaming(e, t, n) {
|
|
2557
2557
|
var r, i, o, a;
|
|
2558
|
-
let c = n, h = (r = c.format) !== null && r !== void 0 ? r : "text", l = (i = c.fetchInit) !== null && i !== void 0 ? i : {}, u = this.makeUrl(e, c), d = e.I.toBinary(t, c.binaryOptions), f = new Ct(), y = new
|
|
2558
|
+
let c = n, h = (r = c.format) !== null && r !== void 0 ? r : "text", l = (i = c.fetchInit) !== null && i !== void 0 ? i : {}, u = this.makeUrl(e, c), d = e.I.toBinary(t, c.binaryOptions), f = new Ct(), y = new Ni(), I = !0, L, C = new Ct(), R, O = new Ct();
|
|
2559
2559
|
return globalThis.fetch(u, Object.assign(Object.assign({}, l), {
|
|
2560
2560
|
method: "POST",
|
|
2561
|
-
headers:
|
|
2562
|
-
body:
|
|
2561
|
+
headers: tr(new globalThis.Headers(), h, c.timeout, c.meta),
|
|
2562
|
+
body: nr(d, h),
|
|
2563
2563
|
signal: (o = n.abort) !== null && o !== void 0 ? o : null
|
|
2564
2564
|
// node-fetch@3.0.0-beta.9 rejects `undefined`
|
|
2565
|
-
})).then((
|
|
2566
|
-
let [x, b, B] =
|
|
2567
|
-
if (f.resolve(B), x != null && x !==
|
|
2568
|
-
throw new se(b ??
|
|
2565
|
+
})).then((k) => {
|
|
2566
|
+
let [x, b, B] = Mn(k);
|
|
2567
|
+
if (f.resolve(B), x != null && x !== W.OK)
|
|
2568
|
+
throw new se(b ?? W[x], W[x], B);
|
|
2569
2569
|
return x != null && (L = {
|
|
2570
|
-
code:
|
|
2571
|
-
detail: b ??
|
|
2572
|
-
}),
|
|
2573
|
-
}).then((
|
|
2574
|
-
if (!
|
|
2575
|
-
throw new se("missing response body",
|
|
2576
|
-
return
|
|
2570
|
+
code: W[x],
|
|
2571
|
+
detail: b ?? W[x]
|
|
2572
|
+
}), k;
|
|
2573
|
+
}).then((k) => {
|
|
2574
|
+
if (!k.body)
|
|
2575
|
+
throw new se("missing response body", W[W.INTERNAL]);
|
|
2576
|
+
return ir(k.body, k.headers.get("content-type"), (x, b) => {
|
|
2577
2577
|
switch (x) {
|
|
2578
2578
|
case Qe.DATA:
|
|
2579
2579
|
y.notifyMessage(e.O.fromBinary(b, c.binaryOptions)), I = !1;
|
|
2580
2580
|
break;
|
|
2581
2581
|
case Qe.TRAILER:
|
|
2582
2582
|
let B, m;
|
|
2583
|
-
[B, m, R] =
|
|
2584
|
-
code:
|
|
2585
|
-
detail: m ??
|
|
2583
|
+
[B, m, R] = rr(b), L = {
|
|
2584
|
+
code: W[B],
|
|
2585
|
+
detail: m ?? W[B]
|
|
2586
2586
|
};
|
|
2587
2587
|
break;
|
|
2588
2588
|
}
|
|
2589
2589
|
});
|
|
2590
2590
|
}).then(() => {
|
|
2591
2591
|
if (!R && !I)
|
|
2592
|
-
throw new se("missing trailers",
|
|
2592
|
+
throw new se("missing trailers", W[W.DATA_LOSS]);
|
|
2593
2593
|
if (!L)
|
|
2594
|
-
throw new se("missing status",
|
|
2594
|
+
throw new se("missing status", W[W.INTERNAL]);
|
|
2595
2595
|
if (L.code !== "OK")
|
|
2596
2596
|
throw new se(L.detail, L.code, R);
|
|
2597
2597
|
y.notifyComplete(), C.resolve(L), O.resolve(R || {});
|
|
2598
|
-
}).catch((
|
|
2598
|
+
}).catch((k) => {
|
|
2599
2599
|
let x;
|
|
2600
|
-
|
|
2601
|
-
}), new
|
|
2600
|
+
k instanceof se ? x = k : k instanceof Error && k.name === "AbortError" ? x = new se(k.message, W[W.CANCELLED]) : x = new se(k instanceof Error ? k.message : "" + k, W[W.INTERNAL]), x.methodName = e.name, x.serviceName = e.service.typeName, f.rejectPending(x), y.notifyError(x), C.rejectPending(x), O.rejectPending(x);
|
|
2601
|
+
}), new xi(e, (a = c.meta) !== null && a !== void 0 ? a : {}, t, f.promise, y, C.promise, O.promise);
|
|
2602
2602
|
}
|
|
2603
2603
|
unary(e, t, n) {
|
|
2604
2604
|
var r, i, o, a;
|
|
2605
2605
|
let c = n, h = (r = c.format) !== null && r !== void 0 ? r : "text", l = (i = c.fetchInit) !== null && i !== void 0 ? i : {}, u = this.makeUrl(e, c), d = e.I.toBinary(t, c.binaryOptions), f = new Ct(), y, I = new Ct(), L, C = new Ct(), R, O = new Ct();
|
|
2606
2606
|
return globalThis.fetch(u, Object.assign(Object.assign({}, l), {
|
|
2607
2607
|
method: "POST",
|
|
2608
|
-
headers:
|
|
2609
|
-
body:
|
|
2608
|
+
headers: tr(new globalThis.Headers(), h, c.timeout, c.meta),
|
|
2609
|
+
body: nr(d, h),
|
|
2610
2610
|
signal: (o = n.abort) !== null && o !== void 0 ? o : null
|
|
2611
2611
|
// node-fetch@3.0.0-beta.9 rejects `undefined`
|
|
2612
|
-
})).then((
|
|
2613
|
-
let [x, b, B] =
|
|
2614
|
-
if (f.resolve(B), x != null && x !==
|
|
2615
|
-
throw new se(b ??
|
|
2612
|
+
})).then((k) => {
|
|
2613
|
+
let [x, b, B] = Mn(k);
|
|
2614
|
+
if (f.resolve(B), x != null && x !== W.OK)
|
|
2615
|
+
throw new se(b ?? W[x], W[x], B);
|
|
2616
2616
|
return x != null && (L = {
|
|
2617
|
-
code:
|
|
2618
|
-
detail: b ??
|
|
2619
|
-
}),
|
|
2620
|
-
}).then((
|
|
2621
|
-
if (!
|
|
2622
|
-
throw new se("missing response body",
|
|
2623
|
-
return
|
|
2617
|
+
code: W[x],
|
|
2618
|
+
detail: b ?? W[x]
|
|
2619
|
+
}), k;
|
|
2620
|
+
}).then((k) => {
|
|
2621
|
+
if (!k.body)
|
|
2622
|
+
throw new se("missing response body", W[W.INTERNAL]);
|
|
2623
|
+
return ir(k.body, k.headers.get("content-type"), (x, b) => {
|
|
2624
2624
|
switch (x) {
|
|
2625
2625
|
case Qe.DATA:
|
|
2626
2626
|
if (y)
|
|
2627
|
-
throw new se("unary call received 2nd message",
|
|
2627
|
+
throw new se("unary call received 2nd message", W[W.DATA_LOSS]);
|
|
2628
2628
|
y = e.O.fromBinary(b, c.binaryOptions);
|
|
2629
2629
|
break;
|
|
2630
2630
|
case Qe.TRAILER:
|
|
2631
2631
|
let B, m;
|
|
2632
|
-
[B, m, R] =
|
|
2633
|
-
code:
|
|
2634
|
-
detail: m ??
|
|
2632
|
+
[B, m, R] = rr(b), L = {
|
|
2633
|
+
code: W[B],
|
|
2634
|
+
detail: m ?? W[B]
|
|
2635
2635
|
};
|
|
2636
2636
|
break;
|
|
2637
2637
|
}
|
|
2638
2638
|
});
|
|
2639
2639
|
}).then(() => {
|
|
2640
2640
|
if (!R && y)
|
|
2641
|
-
throw new se("missing trailers",
|
|
2641
|
+
throw new se("missing trailers", W[W.DATA_LOSS]);
|
|
2642
2642
|
if (!L)
|
|
2643
|
-
throw new se("missing status",
|
|
2643
|
+
throw new se("missing status", W[W.INTERNAL]);
|
|
2644
2644
|
if (!y && L.code === "OK")
|
|
2645
|
-
throw new se("expected error status",
|
|
2645
|
+
throw new se("expected error status", W[W.DATA_LOSS]);
|
|
2646
2646
|
if (!y)
|
|
2647
2647
|
throw new se(L.detail, L.code, R);
|
|
2648
2648
|
if (I.resolve(y), L.code !== "OK")
|
|
2649
2649
|
throw new se(L.detail, L.code, R);
|
|
2650
2650
|
C.resolve(L), O.resolve(R || {});
|
|
2651
|
-
}).catch((
|
|
2651
|
+
}).catch((k) => {
|
|
2652
2652
|
let x;
|
|
2653
|
-
|
|
2654
|
-
}), new
|
|
2653
|
+
k instanceof se ? x = k : k instanceof Error && k.name === "AbortError" ? x = new se(k.message, W[W.CANCELLED]) : x = new se(k instanceof Error ? k.message : "" + k, W[W.INTERNAL]), x.methodName = e.name, x.serviceName = e.service.typeName, f.rejectPending(x), I.rejectPending(x), C.rejectPending(x), O.rejectPending(x);
|
|
2654
|
+
}), new Li(e, (a = c.meta) !== null && a !== void 0 ? a : {}, t, f.promise, I.promise, C.promise, O.promise);
|
|
2655
2655
|
}
|
|
2656
2656
|
}
|
|
2657
|
-
var
|
|
2658
|
-
class
|
|
2657
|
+
var An = /* @__PURE__ */ ((s) => (s[s.IMAGE = 0] = "IMAGE", s[s.AUDIO = 1] = "AUDIO", s[s.VIDEO = 2] = "VIDEO", s[s.ALL = 3] = "ALL", s[s.FOLDER = 4] = "FOLDER", s))(An || {});
|
|
2658
|
+
class Mi extends xe {
|
|
2659
2659
|
constructor() {
|
|
2660
2660
|
super("com.hamropatro.grpc.cms.SearchRequest", [
|
|
2661
2661
|
{
|
|
@@ -2683,7 +2683,7 @@ class Di extends xe {
|
|
|
2683
2683
|
}
|
|
2684
2684
|
create(e) {
|
|
2685
2685
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
2686
|
-
return t.searchValue = "", t.cursor = "", t.limit = 0, e !== void 0 &&
|
|
2686
|
+
return t.searchValue = "", t.cursor = "", t.limit = 0, e !== void 0 && Ae(this, t, e), t;
|
|
2687
2687
|
}
|
|
2688
2688
|
internalBinaryRead(e, t, n, r) {
|
|
2689
2689
|
let i = r ?? this.create(), o = e.pos + t;
|
|
@@ -2718,8 +2718,8 @@ class Di extends xe {
|
|
|
2718
2718
|
return r !== !1 && (r == !0 ? J.onWrite : r)(this.typeName, e, t), t;
|
|
2719
2719
|
}
|
|
2720
2720
|
}
|
|
2721
|
-
const
|
|
2722
|
-
class
|
|
2721
|
+
const Tr = new Mi();
|
|
2722
|
+
class Vi extends xe {
|
|
2723
2723
|
constructor() {
|
|
2724
2724
|
super("com.hamropatro.grpc.cms.SearchResult", [
|
|
2725
2725
|
{ no: 1, name: "items", kind: "message", repeat: 1, T: () => Ye },
|
|
@@ -2734,7 +2734,7 @@ class Ri extends xe {
|
|
|
2734
2734
|
}
|
|
2735
2735
|
create(e) {
|
|
2736
2736
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
2737
|
-
return t.items = [], t.nextPageCursor = "", e !== void 0 &&
|
|
2737
|
+
return t.items = [], t.nextPageCursor = "", e !== void 0 && Ae(this, t, e), t;
|
|
2738
2738
|
}
|
|
2739
2739
|
internalBinaryRead(e, t, n, r) {
|
|
2740
2740
|
let i = r ?? this.create(), o = e.pos + t;
|
|
@@ -2767,8 +2767,8 @@ class Ri extends xe {
|
|
|
2767
2767
|
return r !== !1 && (r == !0 ? J.onWrite : r)(this.typeName, e, t), t;
|
|
2768
2768
|
}
|
|
2769
2769
|
}
|
|
2770
|
-
const
|
|
2771
|
-
class
|
|
2770
|
+
const Hi = new Vi();
|
|
2771
|
+
class $i extends xe {
|
|
2772
2772
|
constructor() {
|
|
2773
2773
|
super("com.hamropatro.grpc.cms.CreateFileRequest", [
|
|
2774
2774
|
{
|
|
@@ -2799,7 +2799,7 @@ class Vi extends xe {
|
|
|
2799
2799
|
T: 9
|
|
2800
2800
|
/*ScalarType.STRING*/
|
|
2801
2801
|
},
|
|
2802
|
-
{ no: 5, name: "type", kind: "enum", T: () => ["com.hamropatro.grpc.cms.FileType",
|
|
2802
|
+
{ no: 5, name: "type", kind: "enum", T: () => ["com.hamropatro.grpc.cms.FileType", An] },
|
|
2803
2803
|
{
|
|
2804
2804
|
no: 6,
|
|
2805
2805
|
name: "extension",
|
|
@@ -2811,7 +2811,7 @@ class Vi extends xe {
|
|
|
2811
2811
|
}
|
|
2812
2812
|
create(e) {
|
|
2813
2813
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
2814
|
-
return t.name = "", t.folderName = "", t.nestedFolderName = "", t.url = "", t.type = 0, t.extension = "", e !== void 0 &&
|
|
2814
|
+
return t.name = "", t.folderName = "", t.nestedFolderName = "", t.url = "", t.type = 0, t.extension = "", e !== void 0 && Ae(this, t, e), t;
|
|
2815
2815
|
}
|
|
2816
2816
|
internalBinaryRead(e, t, n, r) {
|
|
2817
2817
|
let i = r ?? this.create(), o = e.pos + t;
|
|
@@ -2858,8 +2858,8 @@ class Vi extends xe {
|
|
|
2858
2858
|
return r !== !1 && (r == !0 ? J.onWrite : r)(this.typeName, e, t), t;
|
|
2859
2859
|
}
|
|
2860
2860
|
}
|
|
2861
|
-
const
|
|
2862
|
-
class
|
|
2861
|
+
const xr = new $i();
|
|
2862
|
+
class Pi extends xe {
|
|
2863
2863
|
constructor() {
|
|
2864
2864
|
super("com.hamropatro.grpc.cms.CreateUserFileRequest", [
|
|
2865
2865
|
{
|
|
@@ -2869,7 +2869,7 @@ class Hi extends xe {
|
|
|
2869
2869
|
T: 9
|
|
2870
2870
|
/*ScalarType.STRING*/
|
|
2871
2871
|
},
|
|
2872
|
-
{ no: 2, name: "type", kind: "enum", T: () => ["com.hamropatro.grpc.cms.FileType",
|
|
2872
|
+
{ no: 2, name: "type", kind: "enum", T: () => ["com.hamropatro.grpc.cms.FileType", An] },
|
|
2873
2873
|
{
|
|
2874
2874
|
no: 3,
|
|
2875
2875
|
name: "extension",
|
|
@@ -2881,7 +2881,7 @@ class Hi extends xe {
|
|
|
2881
2881
|
}
|
|
2882
2882
|
create(e) {
|
|
2883
2883
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
2884
|
-
return t.url = "", t.type = 0, t.extension = "", e !== void 0 &&
|
|
2884
|
+
return t.url = "", t.type = 0, t.extension = "", e !== void 0 && Ae(this, t, e), t;
|
|
2885
2885
|
}
|
|
2886
2886
|
internalBinaryRead(e, t, n, r) {
|
|
2887
2887
|
let i = r ?? this.create(), o = e.pos + t;
|
|
@@ -2916,8 +2916,8 @@ class Hi extends xe {
|
|
|
2916
2916
|
return r !== !1 && (r == !0 ? J.onWrite : r)(this.typeName, e, t), t;
|
|
2917
2917
|
}
|
|
2918
2918
|
}
|
|
2919
|
-
const
|
|
2920
|
-
class
|
|
2919
|
+
const _r = new Pi();
|
|
2920
|
+
class Wi extends xe {
|
|
2921
2921
|
constructor() {
|
|
2922
2922
|
super("com.hamropatro.grpc.cms.File", [
|
|
2923
2923
|
{
|
|
@@ -2969,13 +2969,13 @@ class $i extends xe {
|
|
|
2969
2969
|
T: 9
|
|
2970
2970
|
/*ScalarType.STRING*/
|
|
2971
2971
|
},
|
|
2972
|
-
{ no: 8, name: "type", kind: "enum", T: () => ["com.hamropatro.grpc.cms.FileType",
|
|
2973
|
-
{ no: 9, name: "metadata", kind: "message", T: () =>
|
|
2972
|
+
{ no: 8, name: "type", kind: "enum", T: () => ["com.hamropatro.grpc.cms.FileType", An] },
|
|
2973
|
+
{ no: 9, name: "metadata", kind: "message", T: () => In }
|
|
2974
2974
|
]);
|
|
2975
2975
|
}
|
|
2976
2976
|
create(e) {
|
|
2977
2977
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
2978
|
-
return t.key = "", t.name = "", t.folderName = "", t.nestedFolderName = "", t.url = "", t.thumborUrl = "", t.proxyUrl = "", t.type = 0, e !== void 0 &&
|
|
2978
|
+
return t.key = "", t.name = "", t.folderName = "", t.nestedFolderName = "", t.url = "", t.thumborUrl = "", t.proxyUrl = "", t.type = 0, e !== void 0 && Ae(this, t, e), t;
|
|
2979
2979
|
}
|
|
2980
2980
|
internalBinaryRead(e, t, n, r) {
|
|
2981
2981
|
let i = r ?? this.create(), o = e.pos + t;
|
|
@@ -3016,7 +3016,7 @@ class $i extends xe {
|
|
|
3016
3016
|
break;
|
|
3017
3017
|
case /* com.hamropatro.grpc.cms.FileMetadata metadata */
|
|
3018
3018
|
9:
|
|
3019
|
-
i.metadata =
|
|
3019
|
+
i.metadata = In.internalBinaryRead(e, e.uint32(), n, i.metadata);
|
|
3020
3020
|
break;
|
|
3021
3021
|
default:
|
|
3022
3022
|
let h = n.readUnknownField;
|
|
@@ -3029,13 +3029,13 @@ class $i extends xe {
|
|
|
3029
3029
|
return i;
|
|
3030
3030
|
}
|
|
3031
3031
|
internalBinaryWrite(e, t, n) {
|
|
3032
|
-
e.key !== "" && t.tag(1, j.LengthDelimited).string(e.key), e.name !== "" && t.tag(2, j.LengthDelimited).string(e.name), e.folderName !== "" && t.tag(3, j.LengthDelimited).string(e.folderName), e.nestedFolderName !== "" && t.tag(4, j.LengthDelimited).string(e.nestedFolderName), e.url !== "" && t.tag(5, j.LengthDelimited).string(e.url), e.thumborUrl !== "" && t.tag(6, j.LengthDelimited).string(e.thumborUrl), e.proxyUrl !== "" && t.tag(7, j.LengthDelimited).string(e.proxyUrl), e.type !== 0 && t.tag(8, j.Varint).int32(e.type), e.metadata &&
|
|
3032
|
+
e.key !== "" && t.tag(1, j.LengthDelimited).string(e.key), e.name !== "" && t.tag(2, j.LengthDelimited).string(e.name), e.folderName !== "" && t.tag(3, j.LengthDelimited).string(e.folderName), e.nestedFolderName !== "" && t.tag(4, j.LengthDelimited).string(e.nestedFolderName), e.url !== "" && t.tag(5, j.LengthDelimited).string(e.url), e.thumborUrl !== "" && t.tag(6, j.LengthDelimited).string(e.thumborUrl), e.proxyUrl !== "" && t.tag(7, j.LengthDelimited).string(e.proxyUrl), e.type !== 0 && t.tag(8, j.Varint).int32(e.type), e.metadata && In.internalBinaryWrite(e.metadata, t.tag(9, j.LengthDelimited).fork(), n).join();
|
|
3033
3033
|
let r = n.writeUnknownFields;
|
|
3034
3034
|
return r !== !1 && (r == !0 ? J.onWrite : r)(this.typeName, e, t), t;
|
|
3035
3035
|
}
|
|
3036
3036
|
}
|
|
3037
|
-
const Ye = new
|
|
3038
|
-
class
|
|
3037
|
+
const Ye = new Wi();
|
|
3038
|
+
class ji extends xe {
|
|
3039
3039
|
constructor() {
|
|
3040
3040
|
super("com.hamropatro.grpc.cms.FileMetadata", [
|
|
3041
3041
|
{
|
|
@@ -3070,7 +3070,7 @@ class Wi extends xe {
|
|
|
3070
3070
|
}
|
|
3071
3071
|
create(e) {
|
|
3072
3072
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
3073
|
-
return t.height = 0, t.width = 0, t.backgroundColor = "", t.aspectRatio = 0, e !== void 0 &&
|
|
3073
|
+
return t.height = 0, t.width = 0, t.backgroundColor = "", t.aspectRatio = 0, e !== void 0 && Ae(this, t, e), t;
|
|
3074
3074
|
}
|
|
3075
3075
|
internalBinaryRead(e, t, n, r) {
|
|
3076
3076
|
let i = r ?? this.create(), o = e.pos + t;
|
|
@@ -3109,8 +3109,8 @@ class Wi extends xe {
|
|
|
3109
3109
|
return r !== !1 && (r == !0 ? J.onWrite : r)(this.typeName, e, t), t;
|
|
3110
3110
|
}
|
|
3111
3111
|
}
|
|
3112
|
-
const
|
|
3113
|
-
class
|
|
3112
|
+
const In = new ji();
|
|
3113
|
+
class Zi extends xe {
|
|
3114
3114
|
constructor() {
|
|
3115
3115
|
super("com.hamropatro.grpc.cms.DeleteFileRequest", [
|
|
3116
3116
|
{
|
|
@@ -3124,7 +3124,7 @@ class Pi extends xe {
|
|
|
3124
3124
|
}
|
|
3125
3125
|
create(e) {
|
|
3126
3126
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
3127
|
-
return t.key = "", e !== void 0 &&
|
|
3127
|
+
return t.key = "", e !== void 0 && Ae(this, t, e), t;
|
|
3128
3128
|
}
|
|
3129
3129
|
internalBinaryRead(e, t, n, r) {
|
|
3130
3130
|
let i = r ?? this.create(), o = e.pos + t;
|
|
@@ -3151,8 +3151,8 @@ class Pi extends xe {
|
|
|
3151
3151
|
return r !== !1 && (r == !0 ? J.onWrite : r)(this.typeName, e, t), t;
|
|
3152
3152
|
}
|
|
3153
3153
|
}
|
|
3154
|
-
const
|
|
3155
|
-
class
|
|
3154
|
+
const Ur = new Zi();
|
|
3155
|
+
class qi extends xe {
|
|
3156
3156
|
constructor() {
|
|
3157
3157
|
super("com.hamropatro.grpc.cms.DeleteFileResponse", [
|
|
3158
3158
|
{
|
|
@@ -3166,7 +3166,7 @@ class ji extends xe {
|
|
|
3166
3166
|
}
|
|
3167
3167
|
create(e) {
|
|
3168
3168
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
3169
|
-
return t.isDeleted = !1, e !== void 0 &&
|
|
3169
|
+
return t.isDeleted = !1, e !== void 0 && Ae(this, t, e), t;
|
|
3170
3170
|
}
|
|
3171
3171
|
internalBinaryRead(e, t, n, r) {
|
|
3172
3172
|
let i = r ?? this.create(), o = e.pos + t;
|
|
@@ -3193,8 +3193,8 @@ class ji extends xe {
|
|
|
3193
3193
|
return r !== !1 && (r == !0 ? J.onWrite : r)(this.typeName, e, t), t;
|
|
3194
3194
|
}
|
|
3195
3195
|
}
|
|
3196
|
-
const
|
|
3197
|
-
class
|
|
3196
|
+
const Ki = new qi();
|
|
3197
|
+
class zi extends xe {
|
|
3198
3198
|
constructor() {
|
|
3199
3199
|
super("com.hamropatro.grpc.cms.GetFilesByFolderRequest", [
|
|
3200
3200
|
{
|
|
@@ -3222,7 +3222,7 @@ class qi extends xe {
|
|
|
3222
3222
|
}
|
|
3223
3223
|
create(e) {
|
|
3224
3224
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
3225
|
-
return t.folderName = "", t.cursor = "", t.limit = 0, e !== void 0 &&
|
|
3225
|
+
return t.folderName = "", t.cursor = "", t.limit = 0, e !== void 0 && Ae(this, t, e), t;
|
|
3226
3226
|
}
|
|
3227
3227
|
internalBinaryRead(e, t, n, r) {
|
|
3228
3228
|
let i = r ?? this.create(), o = e.pos + t;
|
|
@@ -3257,8 +3257,8 @@ class qi extends xe {
|
|
|
3257
3257
|
return r !== !1 && (r == !0 ? J.onWrite : r)(this.typeName, e, t), t;
|
|
3258
3258
|
}
|
|
3259
3259
|
}
|
|
3260
|
-
const
|
|
3261
|
-
class
|
|
3260
|
+
const Br = new zi();
|
|
3261
|
+
class Xi extends xe {
|
|
3262
3262
|
constructor() {
|
|
3263
3263
|
super("com.hamropatro.grpc.cms.GetFilesByFolderResponse", [
|
|
3264
3264
|
{ no: 1, name: "files", kind: "message", repeat: 1, T: () => Ye },
|
|
@@ -3280,7 +3280,7 @@ class Ki extends xe {
|
|
|
3280
3280
|
}
|
|
3281
3281
|
create(e) {
|
|
3282
3282
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
3283
|
-
return t.files = [], t.nextCursor = "", t.hasMore = !1, e !== void 0 &&
|
|
3283
|
+
return t.files = [], t.nextCursor = "", t.hasMore = !1, e !== void 0 && Ae(this, t, e), t;
|
|
3284
3284
|
}
|
|
3285
3285
|
internalBinaryRead(e, t, n, r) {
|
|
3286
3286
|
let i = r ?? this.create(), o = e.pos + t;
|
|
@@ -3317,19 +3317,19 @@ class Ki extends xe {
|
|
|
3317
3317
|
return r !== !1 && (r == !0 ? J.onWrite : r)(this.typeName, e, t), t;
|
|
3318
3318
|
}
|
|
3319
3319
|
}
|
|
3320
|
-
const
|
|
3321
|
-
{ name: "createFile", options: {}, I:
|
|
3320
|
+
const Gi = new Xi(), Ln = new Pn("com.hamropatro.grpc.cms.FileService", [
|
|
3321
|
+
{ name: "createFile", options: {}, I: xr, O: Ye },
|
|
3322
3322
|
{ name: "updateFile", options: {}, I: Ye, O: Ye },
|
|
3323
|
-
{ name: "deleteFile", options: {}, I:
|
|
3324
|
-
{ name: "getFilesByFolder", options: {}, I:
|
|
3325
|
-
{ name: "createUserFile", options: {}, I:
|
|
3326
|
-
{ name: "search", options: {}, I:
|
|
3323
|
+
{ name: "deleteFile", options: {}, I: Ur, O: Ki },
|
|
3324
|
+
{ name: "getFilesByFolder", options: {}, I: Br, O: Gi },
|
|
3325
|
+
{ name: "createUserFile", options: {}, I: _r, O: Ye },
|
|
3326
|
+
{ name: "search", options: {}, I: Tr, O: Hi }
|
|
3327
3327
|
]);
|
|
3328
|
-
class
|
|
3328
|
+
class zt {
|
|
3329
3329
|
constructor(e) {
|
|
3330
|
-
he(this, "typeName",
|
|
3331
|
-
he(this, "methods",
|
|
3332
|
-
he(this, "options",
|
|
3330
|
+
he(this, "typeName", Ln.typeName);
|
|
3331
|
+
he(this, "methods", Ln.methods);
|
|
3332
|
+
he(this, "options", Ln.options);
|
|
3333
3333
|
this._transport = e;
|
|
3334
3334
|
}
|
|
3335
3335
|
/**
|
|
@@ -3377,10 +3377,10 @@ class Zt {
|
|
|
3377
3377
|
return qe("unary", this._transport, n, r, e);
|
|
3378
3378
|
}
|
|
3379
3379
|
}
|
|
3380
|
-
const
|
|
3380
|
+
const Ji = async (s, e, t, n, r, i) => {
|
|
3381
3381
|
var o;
|
|
3382
3382
|
try {
|
|
3383
|
-
const a = (o = window.ImageSalonSDK) == null ? void 0 : o.grpcConfig, c = new
|
|
3383
|
+
const a = (o = window.ImageSalonSDK) == null ? void 0 : o.grpcConfig, c = new zt(a), h = xr.create();
|
|
3384
3384
|
return h.name = s, h.nestedFolderName = e, h.url = t, h.type = n, h.folderName = r, await c.createFile(
|
|
3385
3385
|
h,
|
|
3386
3386
|
i
|
|
@@ -3388,10 +3388,10 @@ const Xi = async (s, e, t, n, r, i) => {
|
|
|
3388
3388
|
} catch (a) {
|
|
3389
3389
|
throw a;
|
|
3390
3390
|
}
|
|
3391
|
-
},
|
|
3391
|
+
}, Qi = async (s, e, t) => {
|
|
3392
3392
|
var n;
|
|
3393
3393
|
try {
|
|
3394
|
-
const r = (n = window.ImageSalonSDK) == null ? void 0 : n.grpcConfig, i = new
|
|
3394
|
+
const r = (n = window.ImageSalonSDK) == null ? void 0 : n.grpcConfig, i = new zt(r), o = _r.create();
|
|
3395
3395
|
return o.url = s, o.type = e, await i.createUserFile(
|
|
3396
3396
|
o,
|
|
3397
3397
|
t
|
|
@@ -3399,10 +3399,10 @@ const Xi = async (s, e, t, n, r, i) => {
|
|
|
3399
3399
|
} catch (r) {
|
|
3400
3400
|
throw r;
|
|
3401
3401
|
}
|
|
3402
|
-
},
|
|
3402
|
+
}, Yi = async (s, e, t, n) => {
|
|
3403
3403
|
var r;
|
|
3404
3404
|
try {
|
|
3405
|
-
const i = (r = window.ImageSalonSDK) == null ? void 0 : r.grpcConfig, o = new
|
|
3405
|
+
const i = (r = window.ImageSalonSDK) == null ? void 0 : r.grpcConfig, o = new zt(i), a = Br.create();
|
|
3406
3406
|
return a.folderName = s, a.cursor = e, a.limit = t, await o.getFilesByFolder(
|
|
3407
3407
|
a,
|
|
3408
3408
|
n
|
|
@@ -3410,10 +3410,10 @@ const Xi = async (s, e, t, n, r, i) => {
|
|
|
3410
3410
|
} catch (i) {
|
|
3411
3411
|
throw i;
|
|
3412
3412
|
}
|
|
3413
|
-
},
|
|
3413
|
+
}, es = async (s, e, t = 20, n) => {
|
|
3414
3414
|
var r;
|
|
3415
3415
|
try {
|
|
3416
|
-
const i = (r = window.ImageSalonSDK) == null ? void 0 : r.grpcConfig, o = new
|
|
3416
|
+
const i = (r = window.ImageSalonSDK) == null ? void 0 : r.grpcConfig, o = new zt(i), a = Tr.create();
|
|
3417
3417
|
return a.searchValue = s, a.cursor = e, a.limit = t, await o.search(
|
|
3418
3418
|
a,
|
|
3419
3419
|
n
|
|
@@ -3421,10 +3421,10 @@ const Xi = async (s, e, t, n, r, i) => {
|
|
|
3421
3421
|
} catch (i) {
|
|
3422
3422
|
throw i;
|
|
3423
3423
|
}
|
|
3424
|
-
},
|
|
3424
|
+
}, ts = async (s, e, t, n, r, i, o, a, c) => {
|
|
3425
3425
|
var h;
|
|
3426
3426
|
try {
|
|
3427
|
-
const l = (h = window.ImageSalonSDK) == null ? void 0 : h.grpcConfig, u = new
|
|
3427
|
+
const l = (h = window.ImageSalonSDK) == null ? void 0 : h.grpcConfig, u = new zt(l), d = Ye.create();
|
|
3428
3428
|
return d.key = s, d.name = e, d.nestedFolderName = t, d.url = n, d.thumborUrl = r, d.proxyUrl = i, d.type = o, d.folderName = a, await u.updateFile(
|
|
3429
3429
|
d,
|
|
3430
3430
|
c
|
|
@@ -3432,10 +3432,10 @@ const Xi = async (s, e, t, n, r, i) => {
|
|
|
3432
3432
|
} catch (l) {
|
|
3433
3433
|
throw l;
|
|
3434
3434
|
}
|
|
3435
|
-
},
|
|
3435
|
+
}, ns = async (s, e) => {
|
|
3436
3436
|
var t;
|
|
3437
3437
|
try {
|
|
3438
|
-
const n = (t = window.ImageSalonSDK) == null ? void 0 : t.grpcConfig, r = new
|
|
3438
|
+
const n = (t = window.ImageSalonSDK) == null ? void 0 : t.grpcConfig, r = new zt(n), i = Ur.create();
|
|
3439
3439
|
return i.key = s, await r.deleteFile(
|
|
3440
3440
|
i,
|
|
3441
3441
|
e
|
|
@@ -3444,7 +3444,7 @@ const Xi = async (s, e, t, n, r, i) => {
|
|
|
3444
3444
|
throw n;
|
|
3445
3445
|
}
|
|
3446
3446
|
};
|
|
3447
|
-
class
|
|
3447
|
+
class rs extends xe {
|
|
3448
3448
|
constructor() {
|
|
3449
3449
|
super("com.hamropatro.grpc.cms.DeleteFolderRequest", [
|
|
3450
3450
|
{
|
|
@@ -3458,7 +3458,7 @@ class ts extends xe {
|
|
|
3458
3458
|
}
|
|
3459
3459
|
create(e) {
|
|
3460
3460
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
3461
|
-
return t.key = "", e !== void 0 &&
|
|
3461
|
+
return t.key = "", e !== void 0 && Ae(this, t, e), t;
|
|
3462
3462
|
}
|
|
3463
3463
|
internalBinaryRead(e, t, n, r) {
|
|
3464
3464
|
let i = r ?? this.create(), o = e.pos + t;
|
|
@@ -3485,8 +3485,8 @@ class ts extends xe {
|
|
|
3485
3485
|
return r !== !1 && (r == !0 ? J.onWrite : r)(this.typeName, e, t), t;
|
|
3486
3486
|
}
|
|
3487
3487
|
}
|
|
3488
|
-
const
|
|
3489
|
-
class
|
|
3488
|
+
const Or = new rs();
|
|
3489
|
+
class is extends xe {
|
|
3490
3490
|
constructor() {
|
|
3491
3491
|
super("com.hamropatro.grpc.cms.CreateFolderRequest", [
|
|
3492
3492
|
{
|
|
@@ -3514,7 +3514,7 @@ class ns extends xe {
|
|
|
3514
3514
|
}
|
|
3515
3515
|
create(e) {
|
|
3516
3516
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
3517
|
-
return t.name = "", t.nestedFolderName = "", t.createdBy = "", e !== void 0 &&
|
|
3517
|
+
return t.name = "", t.nestedFolderName = "", t.createdBy = "", e !== void 0 && Ae(this, t, e), t;
|
|
3518
3518
|
}
|
|
3519
3519
|
internalBinaryRead(e, t, n, r) {
|
|
3520
3520
|
let i = r ?? this.create(), o = e.pos + t;
|
|
@@ -3549,8 +3549,8 @@ class ns extends xe {
|
|
|
3549
3549
|
return r !== !1 && (r == !0 ? J.onWrite : r)(this.typeName, e, t), t;
|
|
3550
3550
|
}
|
|
3551
3551
|
}
|
|
3552
|
-
const
|
|
3553
|
-
class
|
|
3552
|
+
const Sr = new is();
|
|
3553
|
+
class ss extends xe {
|
|
3554
3554
|
constructor() {
|
|
3555
3555
|
super("com.hamropatro.grpc.cms.GetAllFoldersRequest", [
|
|
3556
3556
|
{
|
|
@@ -3571,7 +3571,7 @@ class rs extends xe {
|
|
|
3571
3571
|
}
|
|
3572
3572
|
create(e) {
|
|
3573
3573
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
3574
|
-
return t.cursor = "", t.limit = 0, e !== void 0 &&
|
|
3574
|
+
return t.cursor = "", t.limit = 0, e !== void 0 && Ae(this, t, e), t;
|
|
3575
3575
|
}
|
|
3576
3576
|
internalBinaryRead(e, t, n, r) {
|
|
3577
3577
|
let i = r ?? this.create(), o = e.pos + t;
|
|
@@ -3602,8 +3602,8 @@ class rs extends xe {
|
|
|
3602
3602
|
return r !== !1 && (r == !0 ? J.onWrite : r)(this.typeName, e, t), t;
|
|
3603
3603
|
}
|
|
3604
3604
|
}
|
|
3605
|
-
const
|
|
3606
|
-
class
|
|
3605
|
+
const Dr = new ss();
|
|
3606
|
+
class os extends xe {
|
|
3607
3607
|
constructor() {
|
|
3608
3608
|
super("com.hamropatro.grpc.cms.GetAllFoldersResponse", [
|
|
3609
3609
|
{ no: 1, name: "folder", kind: "message", repeat: 1, T: () => Tt },
|
|
@@ -3625,7 +3625,7 @@ class is extends xe {
|
|
|
3625
3625
|
}
|
|
3626
3626
|
create(e) {
|
|
3627
3627
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
3628
|
-
return t.folder = [], t.nextCursor = "", t.hasMore = !1, e !== void 0 &&
|
|
3628
|
+
return t.folder = [], t.nextCursor = "", t.hasMore = !1, e !== void 0 && Ae(this, t, e), t;
|
|
3629
3629
|
}
|
|
3630
3630
|
internalBinaryRead(e, t, n, r) {
|
|
3631
3631
|
let i = r ?? this.create(), o = e.pos + t;
|
|
@@ -3662,8 +3662,8 @@ class is extends xe {
|
|
|
3662
3662
|
return r !== !1 && (r == !0 ? J.onWrite : r)(this.typeName, e, t), t;
|
|
3663
3663
|
}
|
|
3664
3664
|
}
|
|
3665
|
-
const
|
|
3666
|
-
class
|
|
3665
|
+
const as = new os();
|
|
3666
|
+
class ls extends xe {
|
|
3667
3667
|
constructor() {
|
|
3668
3668
|
super("com.hamropatro.grpc.cms.Folder", [
|
|
3669
3669
|
{
|
|
@@ -3698,7 +3698,7 @@ class os extends xe {
|
|
|
3698
3698
|
}
|
|
3699
3699
|
create(e) {
|
|
3700
3700
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
3701
|
-
return t.key = "", t.name = "", t.nestedFolderName = "", t.createdBy = "", e !== void 0 &&
|
|
3701
|
+
return t.key = "", t.name = "", t.nestedFolderName = "", t.createdBy = "", e !== void 0 && Ae(this, t, e), t;
|
|
3702
3702
|
}
|
|
3703
3703
|
internalBinaryRead(e, t, n, r) {
|
|
3704
3704
|
let i = r ?? this.create(), o = e.pos + t;
|
|
@@ -3737,17 +3737,17 @@ class os extends xe {
|
|
|
3737
3737
|
return r !== !1 && (r == !0 ? J.onWrite : r)(this.typeName, e, t), t;
|
|
3738
3738
|
}
|
|
3739
3739
|
}
|
|
3740
|
-
const Tt = new
|
|
3741
|
-
{ name: "createFolder", options: {}, I:
|
|
3742
|
-
{ name: "getFolders", options: {}, I:
|
|
3740
|
+
const Tt = new ls(), Tn = new Pn("com.hamropatro.grpc.cms.FolderService", [
|
|
3741
|
+
{ name: "createFolder", options: {}, I: Sr, O: Tt },
|
|
3742
|
+
{ name: "getFolders", options: {}, I: Dr, O: as },
|
|
3743
3743
|
{ name: "updateFolder", options: {}, I: Tt, O: Tt },
|
|
3744
|
-
{ name: "deleteFolder", options: {}, I:
|
|
3744
|
+
{ name: "deleteFolder", options: {}, I: Or, O: Tt }
|
|
3745
3745
|
]);
|
|
3746
|
-
class
|
|
3746
|
+
class kn {
|
|
3747
3747
|
constructor(e) {
|
|
3748
|
-
he(this, "typeName",
|
|
3749
|
-
he(this, "methods",
|
|
3750
|
-
he(this, "options",
|
|
3748
|
+
he(this, "typeName", Tn.typeName);
|
|
3749
|
+
he(this, "methods", Tn.methods);
|
|
3750
|
+
he(this, "options", Tn.options);
|
|
3751
3751
|
this._transport = e;
|
|
3752
3752
|
}
|
|
3753
3753
|
/**
|
|
@@ -3779,9 +3779,9 @@ class An {
|
|
|
3779
3779
|
return qe("unary", this._transport, n, r, e);
|
|
3780
3780
|
}
|
|
3781
3781
|
}
|
|
3782
|
-
const
|
|
3782
|
+
const cs = async (s, e = 20, t) => {
|
|
3783
3783
|
var o;
|
|
3784
|
-
const n = (o = window.ImageSalonSDK) == null ? void 0 : o.grpcConfig, r = new
|
|
3784
|
+
const n = (o = window.ImageSalonSDK) == null ? void 0 : o.grpcConfig, r = new kn(n), i = Dr.create();
|
|
3785
3785
|
try {
|
|
3786
3786
|
return i.cursor = s, i.limit = e, await r.getFolders(
|
|
3787
3787
|
i,
|
|
@@ -3790,10 +3790,10 @@ const as = async (s, e = 20, t) => {
|
|
|
3790
3790
|
} catch (a) {
|
|
3791
3791
|
throw a;
|
|
3792
3792
|
}
|
|
3793
|
-
},
|
|
3793
|
+
}, ds = async (s, e, t, n) => {
|
|
3794
3794
|
var r;
|
|
3795
3795
|
try {
|
|
3796
|
-
const i = (r = window.ImageSalonSDK) == null ? void 0 : r.grpcConfig, o = new
|
|
3796
|
+
const i = (r = window.ImageSalonSDK) == null ? void 0 : r.grpcConfig, o = new kn(i), a = Sr.create();
|
|
3797
3797
|
return a.name = s, a.nestedFolderName = e, a.createdBy = t, await o.createFolder(
|
|
3798
3798
|
a,
|
|
3799
3799
|
n
|
|
@@ -3801,10 +3801,10 @@ const as = async (s, e = 20, t) => {
|
|
|
3801
3801
|
} catch (i) {
|
|
3802
3802
|
throw i;
|
|
3803
3803
|
}
|
|
3804
|
-
},
|
|
3804
|
+
}, hs = async (s, e, t, n, r) => {
|
|
3805
3805
|
var i;
|
|
3806
3806
|
try {
|
|
3807
|
-
const o = (i = window.ImageSalonSDK) == null ? void 0 : i.grpcConfig, a = new
|
|
3807
|
+
const o = (i = window.ImageSalonSDK) == null ? void 0 : i.grpcConfig, a = new kn(o), c = Tt.create();
|
|
3808
3808
|
return c.name = e, c.key = s, c.nestedFolderName = t, c.createdBy = n, await a.updateFolder(
|
|
3809
3809
|
c,
|
|
3810
3810
|
r
|
|
@@ -3812,10 +3812,10 @@ const as = async (s, e = 20, t) => {
|
|
|
3812
3812
|
} catch (o) {
|
|
3813
3813
|
throw o;
|
|
3814
3814
|
}
|
|
3815
|
-
},
|
|
3815
|
+
}, us = async (s, e) => {
|
|
3816
3816
|
var t;
|
|
3817
3817
|
try {
|
|
3818
|
-
const n = (t = window.ImageSalonSDK) == null ? void 0 : t.grpcConfig, r = new
|
|
3818
|
+
const n = (t = window.ImageSalonSDK) == null ? void 0 : t.grpcConfig, r = new kn(n), i = Or.create();
|
|
3819
3819
|
return i.key = s, await r.deleteFolder(
|
|
3820
3820
|
i,
|
|
3821
3821
|
e
|
|
@@ -3823,7 +3823,7 @@ const as = async (s, e = 20, t) => {
|
|
|
3823
3823
|
} catch (n) {
|
|
3824
3824
|
throw n;
|
|
3825
3825
|
}
|
|
3826
|
-
},
|
|
3826
|
+
}, xn = (s, e, t) => {
|
|
3827
3827
|
const n = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3828
3828
|
n.setAttribute("xmlns", "http://www.w3.org/2000/svg"), n.setAttribute("width", s || "20"), n.setAttribute("height", e || "20"), n.setAttribute("viewBox", "0 0 24 24"), n.setAttribute("fill", "none"), n.setAttribute("stroke", t || "#ee3f3f"), n.setAttribute("stroke-width", "2"), n.setAttribute("stroke-linecap", "round"), n.setAttribute("stroke-linejoin", "round"), n.classList.add("lucide", "lucide-circle-alert");
|
|
3829
3829
|
const r = document.createElementNS(
|
|
@@ -3836,7 +3836,7 @@ const as = async (s, e = 20, t) => {
|
|
|
3836
3836
|
const o = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
3837
3837
|
return o.setAttribute("x1", "12"), o.setAttribute("x2", "12.01"), o.setAttribute("y1", "16"), o.setAttribute("y2", "16"), n.appendChild(r), n.appendChild(i), n.appendChild(o), n;
|
|
3838
3838
|
};
|
|
3839
|
-
function
|
|
3839
|
+
function or() {
|
|
3840
3840
|
const s = document.createElementNS(
|
|
3841
3841
|
"http://www.w3.org/2000/svg",
|
|
3842
3842
|
"svg"
|
|
@@ -3848,7 +3848,7 @@ function ir() {
|
|
|
3848
3848
|
"M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"
|
|
3849
3849
|
), s.appendChild(e), s;
|
|
3850
3850
|
}
|
|
3851
|
-
function
|
|
3851
|
+
function fs() {
|
|
3852
3852
|
const s = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3853
3853
|
s.setAttribute("xmlns", "http://www.w3.org/2000/svg"), s.setAttribute("width", "12"), s.setAttribute("height", "12"), s.setAttribute("viewBox", "0 0 24 24"), s.setAttribute("fill", "none"), s.setAttribute("stroke", "currentColor"), s.setAttribute("stroke-width", "2"), s.setAttribute("stroke-linecap", "round"), s.setAttribute("stroke-linejoin", "round"), s.classList.add("lucide", "lucide-music-4");
|
|
3854
3854
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
@@ -3866,7 +3866,7 @@ function hs() {
|
|
|
3866
3866
|
);
|
|
3867
3867
|
return r.setAttribute("cx", "18"), r.setAttribute("cy", "16"), r.setAttribute("r", "3"), s.appendChild(e), s.appendChild(t), s.appendChild(n), s.appendChild(r), document.body.appendChild(s), s;
|
|
3868
3868
|
}
|
|
3869
|
-
const
|
|
3869
|
+
const ar = (s) => {
|
|
3870
3870
|
const e = document.createElementNS(
|
|
3871
3871
|
"http://www.w3.org/2000/svg",
|
|
3872
3872
|
"svg"
|
|
@@ -3877,7 +3877,7 @@ const sr = (s) => {
|
|
|
3877
3877
|
const n = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3878
3878
|
return n.setAttribute("d", "m9 11 3 3L22 4"), e.appendChild(t), e.appendChild(n), e;
|
|
3879
3879
|
};
|
|
3880
|
-
function
|
|
3880
|
+
function Vn(s = "#333") {
|
|
3881
3881
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3882
3882
|
e.setAttribute("xmlns", "http://www.w3.org/2000/svg"), e.setAttribute("x", "0px"), e.setAttribute("y", "0px"), e.setAttribute("width", "18"), e.setAttribute("height", "18"), e.setAttribute("viewBox", "0 0 50 50"), e.setAttribute("fill", s);
|
|
3883
3883
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
@@ -3886,7 +3886,7 @@ function Rn(s = "#333") {
|
|
|
3886
3886
|
"M 9.15625 6.3125 L 6.3125 9.15625 L 22.15625 25 L 6.21875 40.96875 L 9.03125 43.78125 L 25 27.84375 L 40.9375 43.78125 L 43.78125 40.9375 L 27.84375 25 L 43.6875 9.15625 L 40.84375 6.3125 L 25 22.15625 Z"
|
|
3887
3887
|
), e.appendChild(t), e;
|
|
3888
3888
|
}
|
|
3889
|
-
function
|
|
3889
|
+
function lr() {
|
|
3890
3890
|
const s = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3891
3891
|
s.setAttribute("xmlns", "http://www.w3.org/2000/svg"), s.setAttribute("width", "16"), s.setAttribute("height", "16"), s.setAttribute("viewBox", "0 0 24 24"), s.setAttribute("fill", "none"), s.setAttribute("stroke", "#2c96f8"), s.setAttribute("stroke-width", "2"), s.setAttribute("stroke-linecap", "round"), s.setAttribute("stroke-linejoin", "round"), s.classList.add("lucide", "lucide-pencil");
|
|
3892
3892
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
@@ -3897,7 +3897,7 @@ function or() {
|
|
|
3897
3897
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3898
3898
|
return t.setAttribute("d", "m15 5 4 4"), s.appendChild(e), s.appendChild(t), document.body.appendChild(s), s;
|
|
3899
3899
|
}
|
|
3900
|
-
function
|
|
3900
|
+
function Gt() {
|
|
3901
3901
|
const s = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3902
3902
|
s.setAttribute("xmlns", "http://www.w3.org/2000/folder"), s.setAttribute("x", "0px"), s.setAttribute("y", "0px"), s.setAttribute("width", "24"), s.setAttribute("height", "24"), s.setAttribute("viewBox", "0 0 48 48");
|
|
3903
3903
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
@@ -3911,7 +3911,7 @@ function Kt() {
|
|
|
3911
3911
|
"M40,12H8c-2.2,0-4,1.8-4,4v20c0,2.2,1.8,4,4,4h32c2.2,0,4-1.8,4-4V16C44,13.8,42.2,12,40,12z"
|
|
3912
3912
|
), s.appendChild(e), s.appendChild(t), s;
|
|
3913
3913
|
}
|
|
3914
|
-
function
|
|
3914
|
+
function ps() {
|
|
3915
3915
|
const s = "http://www.w3.org/2000/svg", e = document.createElementNS(s, "svg");
|
|
3916
3916
|
e.setAttribute("width", "12"), e.setAttribute("height", "12"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("fill", "none"), e.setAttribute("stroke", "currentColor"), e.setAttribute("stroke-width", "3"), e.setAttribute("stroke-linecap", "round"), e.setAttribute("stroke-linejoin", "round"), e.classList.add("lucide", "lucide-image");
|
|
3917
3917
|
const t = document.createElementNS(s, "rect");
|
|
@@ -3921,7 +3921,7 @@ function us() {
|
|
|
3921
3921
|
const r = document.createElementNS(s, "path");
|
|
3922
3922
|
return r.setAttribute("d", "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"), e.appendChild(t), e.appendChild(n), e.appendChild(r), document.body.appendChild(e), e;
|
|
3923
3923
|
}
|
|
3924
|
-
function
|
|
3924
|
+
function ms() {
|
|
3925
3925
|
const s = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3926
3926
|
s.setAttribute("xmlns", "http://www.w3.org/2000/svg"), s.setAttribute("height", "24px"), s.setAttribute("viewBox", "0 -960 960 960"), s.setAttribute("width", "24px"), s.setAttribute("fill", "currentColor");
|
|
3927
3927
|
const e = document.createElementNS(
|
|
@@ -3933,13 +3933,13 @@ function fs() {
|
|
|
3933
3933
|
"m488-400-65 65 56 56 161-161-161-161-56 56 65 65H320v80h168ZM160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h240l80 80h320q33 0 56.5 23.5T880-640v400q0 33-23.5 56.5T800-160H160Zm0-80h640v-400H447l-80-80H160v480Zm0 0v-480 480Z"
|
|
3934
3934
|
), s.appendChild(e), s;
|
|
3935
3935
|
}
|
|
3936
|
-
function
|
|
3936
|
+
function cr() {
|
|
3937
3937
|
const s = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3938
3938
|
s.setAttribute("xmlns", "http://www.w3.org/2000/svg"), s.setAttribute("fill", "none"), s.setAttribute("width", "20"), s.setAttribute("height", "20"), s.setAttribute("viewBox", "0 0 24 24"), s.setAttribute("stroke-width", "1.5"), s.setAttribute("stroke", "currentColor"), s.setAttribute("class", "size-2");
|
|
3939
3939
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3940
3940
|
return e.setAttribute("stroke-linecap", "round"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("d", "M12 4.5v15m7.5-7.5h-15"), s.appendChild(e), s;
|
|
3941
3941
|
}
|
|
3942
|
-
function
|
|
3942
|
+
function gs() {
|
|
3943
3943
|
const s = "http://www.w3.org/2000/svg", e = document.createElementNS(s, "svg");
|
|
3944
3944
|
e.setAttribute("width", "16"), e.setAttribute("height", "16"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("fill", "none"), e.setAttribute("stroke", "currentColor"), e.setAttribute("stroke-width", "2"), e.setAttribute("stroke-linecap", "round"), e.setAttribute("stroke-linejoin", "round"), e.classList.add("lucide", "lucide-eye");
|
|
3945
3945
|
const t = document.createElementNS(s, "path");
|
|
@@ -3950,7 +3950,7 @@ function ps() {
|
|
|
3950
3950
|
const n = document.createElementNS(s, "circle");
|
|
3951
3951
|
return n.setAttribute("cx", "12"), n.setAttribute("cy", "12"), n.setAttribute("r", "3"), e.appendChild(n), document.body.appendChild(e), e;
|
|
3952
3952
|
}
|
|
3953
|
-
function
|
|
3953
|
+
function ws() {
|
|
3954
3954
|
const s = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3955
3955
|
s.setAttribute("xmlns", "http://www.w3.org/2000/svg"), s.setAttribute("height", "24px"), s.setAttribute("width", "24px"), s.setAttribute("viewBox", "0 0 30 30"), s.setAttribute("fill", "#999");
|
|
3956
3956
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
@@ -3959,7 +3959,7 @@ function ms() {
|
|
|
3959
3959
|
"M 13 3 C 7.4889971 3 3 7.4889971 3 13 C 3 18.511003 7.4889971 23 13 23 C 15.396508 23 17.597385 22.148986 19.322266 20.736328 L 25.292969 26.707031 A 1.0001 1.0001 0 1 0 26.707031 25.292969 L 20.736328 19.322266 C 22.148986 17.597385 23 15.396508 23 13 C 23 7.4889971 18.511003 3 13 3 z M 13 5 C 17.430123 5 21 8.5698774 21 13 C 21 17.430123 17.430123 21 13 21 C 8.5698774 21 5 17.430123 5 13 C 5 8.5698774 8.5698774 5 13 5 z"
|
|
3960
3960
|
), s.appendChild(e), s;
|
|
3961
3961
|
}
|
|
3962
|
-
function
|
|
3962
|
+
function dr() {
|
|
3963
3963
|
const s = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3964
3964
|
s.setAttribute("xmlns", "http://www.w3.org/2000/svg"), s.setAttribute("width", "16"), s.setAttribute("height", "16"), s.setAttribute("viewBox", "0 0 24 24"), s.setAttribute("fill", "none"), s.setAttribute("stroke", "#f14b4b"), s.setAttribute("stroke-width", "2"), s.setAttribute("stroke-linecap", "round"), s.setAttribute("stroke-linejoin", "round"), s.classList.add("lucide", "lucide-trash-2");
|
|
3965
3965
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
@@ -3973,7 +3973,7 @@ function lr() {
|
|
|
3973
3973
|
const i = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
3974
3974
|
return i.setAttribute("x1", "14"), i.setAttribute("x2", "14"), i.setAttribute("y1", "11"), i.setAttribute("y2", "17"), s.appendChild(e), s.appendChild(t), s.appendChild(n), s.appendChild(r), s.appendChild(i), document.body.appendChild(s), s;
|
|
3975
3975
|
}
|
|
3976
|
-
function
|
|
3976
|
+
function _n() {
|
|
3977
3977
|
const s = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3978
3978
|
s.setAttribute("xmlns", "http://www.w3.org/2000/svg"), s.setAttribute("width", "24"), s.setAttribute("height", "24"), s.setAttribute("viewBox", "0 0 24 24"), s.setAttribute("fill", "none"), s.setAttribute("stroke", "currentColor"), s.setAttribute("stroke-width", "2"), s.setAttribute("stroke-linecap", "round"), s.setAttribute("stroke-linejoin", "round"), s.classList.add("lucide", "lucide-upload");
|
|
3979
3979
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
@@ -3986,7 +3986,7 @@ function Tn() {
|
|
|
3986
3986
|
const n = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
3987
3987
|
return n.setAttribute("x1", "12"), n.setAttribute("x2", "12"), n.setAttribute("y1", "3"), n.setAttribute("y2", "15"), s.appendChild(e), s.appendChild(t), s.appendChild(n), s;
|
|
3988
3988
|
}
|
|
3989
|
-
function
|
|
3989
|
+
function ys() {
|
|
3990
3990
|
const s = "http://www.w3.org/2000/svg", e = document.createElementNS(s, "svg");
|
|
3991
3991
|
e.setAttribute("width", "12"), e.setAttribute("height", "12"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("fill", "none"), e.setAttribute("stroke", "currentColor"), e.setAttribute("stroke-width", "3"), e.setAttribute("stroke-linecap", "round"), e.setAttribute("stroke-linejoin", "round"), e.classList.add("lucide", "lucide-video");
|
|
3992
3992
|
const t = document.createElementNS(s, "path");
|
|
@@ -4002,30 +4002,30 @@ function ee(s, e, t, n, r) {
|
|
|
4002
4002
|
return e && (i.className += e), t && (i.style.cssText = t), n && (i.textContent = n), r && r.appendChild(i), i;
|
|
4003
4003
|
}
|
|
4004
4004
|
var ut, Xe, Vt;
|
|
4005
|
-
class
|
|
4005
|
+
class bs {
|
|
4006
4006
|
constructor() {
|
|
4007
4007
|
X(this, ut);
|
|
4008
4008
|
X(this, Xe);
|
|
4009
4009
|
// Store the circle element as a private property
|
|
4010
4010
|
X(this, Vt, "#fff");
|
|
4011
|
-
|
|
4011
|
+
H(this, ut, document.createElementNS(
|
|
4012
4012
|
"http://www.w3.org/2000/svg",
|
|
4013
4013
|
"svg"
|
|
4014
|
-
)),
|
|
4014
|
+
)), A(this, ut).setAttribute("viewBox", "25 25 50 50"), A(this, ut).classList.add("loader-svg"), H(this, Xe, document.createElementNS(
|
|
4015
4015
|
"http://www.w3.org/2000/svg",
|
|
4016
4016
|
"circle"
|
|
4017
|
-
)),
|
|
4017
|
+
)), A(this, Xe).setAttribute("r", "20"), A(this, Xe).setAttribute("cy", "50"), A(this, Xe).setAttribute("cx", "50"), A(this, Xe).setAttribute("stroke", A(this, Vt)), A(this, Xe).classList.add("loader-circle"), A(this, ut).appendChild(A(this, Xe));
|
|
4018
4018
|
}
|
|
4019
4019
|
show(e, t) {
|
|
4020
|
-
t && (
|
|
4020
|
+
t && (H(this, Vt, t), A(this, Xe).setAttribute("stroke", A(this, Vt))), e.appendChild(A(this, ut));
|
|
4021
4021
|
}
|
|
4022
4022
|
hide() {
|
|
4023
|
-
|
|
4023
|
+
A(this, ut).remove();
|
|
4024
4024
|
}
|
|
4025
4025
|
}
|
|
4026
4026
|
ut = new WeakMap(), Xe = new WeakMap(), Vt = new WeakMap();
|
|
4027
|
-
const
|
|
4028
|
-
class
|
|
4027
|
+
const hr = new bs(), cn = document.body;
|
|
4028
|
+
class Rr {
|
|
4029
4029
|
constructor() {
|
|
4030
4030
|
he(this, "main");
|
|
4031
4031
|
he(this, "dialogContainer");
|
|
@@ -4047,7 +4047,7 @@ class Sr {
|
|
|
4047
4047
|
"dialog-presentation",
|
|
4048
4048
|
"",
|
|
4049
4049
|
"",
|
|
4050
|
-
|
|
4050
|
+
cn
|
|
4051
4051
|
), this.main.setAttribute("role", "presentation"), this.dialogContainer = ee(
|
|
4052
4052
|
"div",
|
|
4053
4053
|
"dialog-container",
|
|
@@ -4088,9 +4088,9 @@ class Sr {
|
|
|
4088
4088
|
"",
|
|
4089
4089
|
this.dialogContent
|
|
4090
4090
|
);
|
|
4091
|
-
n.appendChild(
|
|
4091
|
+
n.appendChild(Vn()), n.onclick = () => this.hide();
|
|
4092
4092
|
}
|
|
4093
|
-
return e.header && this._setHeader(e), this._setBody(e), this._setFooter(e), this.confirmButton.textContent = e.confirmButtonText || "Upload", this.cancelButton.textContent = e.cancelButtonText || "Cancel",
|
|
4093
|
+
return e.header && this._setHeader(e), this._setBody(e), this._setFooter(e), this.confirmButton.textContent = e.confirmButtonText || "Upload", this.cancelButton.textContent = e.cancelButtonText || "Cancel", cn.style.overflow = "hidden", this.confirmButton.textContent = e.confirmButtonText || "Upload", this.cancelButton.textContent = e.cancelButtonText || "Cancel", cn.classList.add("dialog-visible"), new Promise((n) => {
|
|
4094
4094
|
const r = (i) => () => {
|
|
4095
4095
|
this.hide(), n(i === "confirm");
|
|
4096
4096
|
};
|
|
@@ -4142,16 +4142,16 @@ class Sr {
|
|
|
4142
4142
|
}, 150);
|
|
4143
4143
|
}
|
|
4144
4144
|
hide() {
|
|
4145
|
-
this.main ||
|
|
4145
|
+
this.main || cn.style.removeProperty("overflow"), this.dialog.style.transform = "scale(0.8)", this.dialog.style.transition = "transform 150ms ease-out", this.dialogBackdrop.style.opacity = "0", setTimeout(() => {
|
|
4146
4146
|
this.dialogContainer.style.opacity = "0", this.dialog.style.opacity = "0", this.dialogContent.style.opacity = "0", this.main.remove();
|
|
4147
4147
|
}, 150);
|
|
4148
4148
|
}
|
|
4149
4149
|
updateUploadBtn(e) {
|
|
4150
|
-
e ? (
|
|
4150
|
+
e ? (hr.show(this.confirmButton), this.confirmButton.disabled = !0) : (hr.hide(), this.confirmButton.disabled = !1);
|
|
4151
4151
|
}
|
|
4152
4152
|
}
|
|
4153
|
-
const
|
|
4154
|
-
class
|
|
4153
|
+
const dn = new Rr(), ye = new Rr();
|
|
4154
|
+
class Cs {
|
|
4155
4155
|
constructor() {
|
|
4156
4156
|
he(this, "main");
|
|
4157
4157
|
he(this, "dialogBody");
|
|
@@ -4164,28 +4164,28 @@ class ys {
|
|
|
4164
4164
|
this.main.remove();
|
|
4165
4165
|
}
|
|
4166
4166
|
}
|
|
4167
|
-
const je = new
|
|
4167
|
+
const je = new Cs();
|
|
4168
4168
|
var ct = /* @__PURE__ */ ((s) => (s[s.IMAGE = 0] = "IMAGE", s[s.AUDIO = 1] = "AUDIO", s[s.VIDEO = 2] = "VIDEO", s[s.ALL = 3] = "ALL", s[s.FOLDER = 4] = "FOLDER", s))(ct || {});
|
|
4169
|
-
const
|
|
4169
|
+
const Qt = {
|
|
4170
4170
|
0: "IMAGE",
|
|
4171
4171
|
1: "AUDIO",
|
|
4172
4172
|
2: "VIDEO",
|
|
4173
4173
|
3: "ALL",
|
|
4174
4174
|
4: "FOLDER"
|
|
4175
4175
|
};
|
|
4176
|
-
function
|
|
4176
|
+
function ur(s) {
|
|
4177
4177
|
switch (s) {
|
|
4178
4178
|
case "image":
|
|
4179
|
-
return
|
|
4179
|
+
return Qt[ct.IMAGE];
|
|
4180
4180
|
case "video":
|
|
4181
|
-
return
|
|
4181
|
+
return Qt[ct.VIDEO];
|
|
4182
4182
|
case "audio":
|
|
4183
|
-
return
|
|
4183
|
+
return Qt[ct.AUDIO];
|
|
4184
4184
|
default:
|
|
4185
|
-
return
|
|
4185
|
+
return Qt[ct.ALL];
|
|
4186
4186
|
}
|
|
4187
4187
|
}
|
|
4188
|
-
function
|
|
4188
|
+
function Es(s) {
|
|
4189
4189
|
const e = {};
|
|
4190
4190
|
s.forEach((r) => {
|
|
4191
4191
|
e[r.key] = { ...r, children: {} };
|
|
@@ -4197,7 +4197,7 @@ function bs(s) {
|
|
|
4197
4197
|
}), r);
|
|
4198
4198
|
return s.reduce((r, i) => (i.nestedFolderName || r.push(t(e[i.key])), r), []);
|
|
4199
4199
|
}
|
|
4200
|
-
function
|
|
4200
|
+
function vs(s, e) {
|
|
4201
4201
|
const t = (n) => {
|
|
4202
4202
|
if (n.key === e.nestedFolderName)
|
|
4203
4203
|
return n.children[e.key] = { ...e, children: {} }, !0;
|
|
@@ -4213,7 +4213,7 @@ function Cs(s, e) {
|
|
|
4213
4213
|
break;
|
|
4214
4214
|
return s;
|
|
4215
4215
|
}
|
|
4216
|
-
const
|
|
4216
|
+
const As = async (s, e) => {
|
|
4217
4217
|
let t;
|
|
4218
4218
|
try {
|
|
4219
4219
|
s && (t = {
|
|
@@ -4231,7 +4231,7 @@ function K(s, e) {
|
|
|
4231
4231
|
const t = document.createElement("div");
|
|
4232
4232
|
return s && (t.className = s), e && (t.id = e), t;
|
|
4233
4233
|
}
|
|
4234
|
-
function
|
|
4234
|
+
function Jt(s, e, t) {
|
|
4235
4235
|
const n = document.createElement("p");
|
|
4236
4236
|
return e && (n.className = e), t && (n.id = t), s && (n.textContent = s), n;
|
|
4237
4237
|
}
|
|
@@ -4239,15 +4239,15 @@ function ie(s, e) {
|
|
|
4239
4239
|
const t = document.createElement("span");
|
|
4240
4240
|
return e && (t.className = e), s && (t.textContent = s), t;
|
|
4241
4241
|
}
|
|
4242
|
-
function
|
|
4242
|
+
function fr(s, e, t, n) {
|
|
4243
4243
|
const r = document.createElement("img");
|
|
4244
4244
|
return e && (r.className = e), r.src = s, r;
|
|
4245
4245
|
}
|
|
4246
|
-
function
|
|
4246
|
+
function ks(s, e, t) {
|
|
4247
4247
|
const n = document.createElement("video"), r = document.createElement("source");
|
|
4248
4248
|
return n.className = e, r.src = s, n.appendChild(r), n;
|
|
4249
4249
|
}
|
|
4250
|
-
function
|
|
4250
|
+
function Fs(s, e, t) {
|
|
4251
4251
|
const n = document.createElement("audio"), r = document.createElement("source");
|
|
4252
4252
|
return n.className = e, n.controls = !0, r.src = s, n.appendChild(r), n;
|
|
4253
4253
|
}
|
|
@@ -4255,11 +4255,11 @@ function He(s, e, t, n, r) {
|
|
|
4255
4255
|
const i = document.createElement("button");
|
|
4256
4256
|
return e && (i.className = e), t && (i.id = t), s && (i.textContent = s), r && (i.innerHTML = r), i.disabled = n, i;
|
|
4257
4257
|
}
|
|
4258
|
-
function
|
|
4258
|
+
function Un(s, e, t) {
|
|
4259
4259
|
const n = document.createElement("input");
|
|
4260
4260
|
return n.className = e, n.defaultValue = t, s && (n.type = s), n;
|
|
4261
4261
|
}
|
|
4262
|
-
class
|
|
4262
|
+
class Ns extends xe {
|
|
4263
4263
|
constructor() {
|
|
4264
4264
|
super("com.hamropatro.grpc.cms.ImageUploadRequest", [
|
|
4265
4265
|
{
|
|
@@ -4273,7 +4273,7 @@ class ks extends xe {
|
|
|
4273
4273
|
}
|
|
4274
4274
|
create(e) {
|
|
4275
4275
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
4276
|
-
return t.mimeType = "", e !== void 0 &&
|
|
4276
|
+
return t.mimeType = "", e !== void 0 && Ae(this, t, e), t;
|
|
4277
4277
|
}
|
|
4278
4278
|
internalBinaryRead(e, t, n, r) {
|
|
4279
4279
|
let i = r ?? this.create(), o = e.pos + t;
|
|
@@ -4300,8 +4300,8 @@ class ks extends xe {
|
|
|
4300
4300
|
return r !== !1 && (r == !0 ? J.onWrite : r)(this.typeName, e, t), t;
|
|
4301
4301
|
}
|
|
4302
4302
|
}
|
|
4303
|
-
const
|
|
4304
|
-
class
|
|
4303
|
+
const Hn = new Ns();
|
|
4304
|
+
class Is extends xe {
|
|
4305
4305
|
constructor() {
|
|
4306
4306
|
super("com.hamropatro.grpc.cms.ImageUploadResponse", [
|
|
4307
4307
|
{
|
|
@@ -4322,7 +4322,7 @@ class Fs extends xe {
|
|
|
4322
4322
|
}
|
|
4323
4323
|
create(e) {
|
|
4324
4324
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
4325
|
-
return t.key = "", t.url = "", e !== void 0 &&
|
|
4325
|
+
return t.key = "", t.url = "", e !== void 0 && Ae(this, t, e), t;
|
|
4326
4326
|
}
|
|
4327
4327
|
internalBinaryRead(e, t, n, r) {
|
|
4328
4328
|
let i = r ?? this.create(), o = e.pos + t;
|
|
@@ -4353,15 +4353,15 @@ class Fs extends xe {
|
|
|
4353
4353
|
return r !== !1 && (r == !0 ? J.onWrite : r)(this.typeName, e, t), t;
|
|
4354
4354
|
}
|
|
4355
4355
|
}
|
|
4356
|
-
const
|
|
4357
|
-
{ name: "Upload", options: {}, I:
|
|
4358
|
-
{ name: "UploadUserImage", options: {}, I:
|
|
4356
|
+
const pr = new Is(), Bn = new Pn("com.hamropatro.grpc.cms.ImageUploadService", [
|
|
4357
|
+
{ name: "Upload", options: {}, I: Hn, O: pr },
|
|
4358
|
+
{ name: "UploadUserImage", options: {}, I: Hn, O: pr }
|
|
4359
4359
|
]);
|
|
4360
|
-
class
|
|
4360
|
+
class Ls {
|
|
4361
4361
|
constructor(e) {
|
|
4362
|
-
he(this, "typeName",
|
|
4363
|
-
he(this, "methods",
|
|
4364
|
-
he(this, "options",
|
|
4362
|
+
he(this, "typeName", Bn.typeName);
|
|
4363
|
+
he(this, "methods", Bn.methods);
|
|
4364
|
+
he(this, "options", Bn.options);
|
|
4365
4365
|
this._transport = e;
|
|
4366
4366
|
}
|
|
4367
4367
|
/**
|
|
@@ -4379,9 +4379,9 @@ class Ns {
|
|
|
4379
4379
|
return qe("unary", this._transport, n, r, e);
|
|
4380
4380
|
}
|
|
4381
4381
|
}
|
|
4382
|
-
const
|
|
4382
|
+
const Ts = async (s, e, t = !0) => {
|
|
4383
4383
|
var o;
|
|
4384
|
-
const n = (o = window.ImageSalonSDK) == null ? void 0 : o.grpcConfig, r = new
|
|
4384
|
+
const n = (o = window.ImageSalonSDK) == null ? void 0 : o.grpcConfig, r = new Ls(n), i = Hn.create();
|
|
4385
4385
|
try {
|
|
4386
4386
|
return i.mimeType = s, t ? await r.upload(i, e) : await r.uploadUserImage(
|
|
4387
4387
|
i,
|
|
@@ -4391,7 +4391,7 @@ const Is = async (s, e, t = !0) => {
|
|
|
4391
4391
|
throw a;
|
|
4392
4392
|
}
|
|
4393
4393
|
};
|
|
4394
|
-
function
|
|
4394
|
+
function xs(s, e) {
|
|
4395
4395
|
return e.forEach(function(t) {
|
|
4396
4396
|
t && typeof t != "string" && !Array.isArray(t) && Object.keys(t).forEach(function(n) {
|
|
4397
4397
|
if (n !== "default" && !(n in s)) {
|
|
@@ -4403,10 +4403,10 @@ function Ls(s, e) {
|
|
|
4403
4403
|
});
|
|
4404
4404
|
}), Object.freeze(s);
|
|
4405
4405
|
}
|
|
4406
|
-
function
|
|
4406
|
+
function Mr(s, e) {
|
|
4407
4407
|
return new Promise(function(t, n) {
|
|
4408
4408
|
let r;
|
|
4409
|
-
return
|
|
4409
|
+
return _s(s).then(function(i) {
|
|
4410
4410
|
try {
|
|
4411
4411
|
return r = i, t(new Blob([e.slice(0, 2), r, e.slice(2)], { type: "image/jpeg" }));
|
|
4412
4412
|
} catch (o) {
|
|
@@ -4415,7 +4415,7 @@ function Dr(s, e) {
|
|
|
4415
4415
|
}, n);
|
|
4416
4416
|
});
|
|
4417
4417
|
}
|
|
4418
|
-
const
|
|
4418
|
+
const _s = (s) => new Promise((e, t) => {
|
|
4419
4419
|
const n = new FileReader();
|
|
4420
4420
|
n.addEventListener("load", ({ target: { result: r } }) => {
|
|
4421
4421
|
const i = new DataView(r);
|
|
@@ -4454,14 +4454,14 @@ const Ts = (s) => new Promise((e, t) => {
|
|
|
4454
4454
|
return e(new Blob());
|
|
4455
4455
|
}), n.readAsArrayBuffer(s);
|
|
4456
4456
|
});
|
|
4457
|
-
var
|
|
4458
|
-
return
|
|
4457
|
+
var gn = {}, Us = { get exports() {
|
|
4458
|
+
return gn;
|
|
4459
4459
|
}, set exports(s) {
|
|
4460
|
-
|
|
4460
|
+
gn = s;
|
|
4461
4461
|
} };
|
|
4462
4462
|
(function(s) {
|
|
4463
4463
|
var e, t, n = {};
|
|
4464
|
-
|
|
4464
|
+
Us.exports = n, n.parse = function(r, i) {
|
|
4465
4465
|
for (var o = n.bin.readUshort, a = n.bin.readUint, c = 0, h = {}, l = new Uint8Array(r), u = l.length - 4; a(l, u) != 101010256; ) u--;
|
|
4466
4466
|
c = u, c += 4;
|
|
4467
4467
|
var d = o(l, c += 4);
|
|
@@ -4472,8 +4472,8 @@ var fn = {}, xs = { get exports() {
|
|
|
4472
4472
|
a(l, c), c += 4, c += 4, c += 4, a(l, c += 4), f = a(l, c += 4);
|
|
4473
4473
|
var L = a(l, c += 4), C = o(l, c += 4), R = o(l, c + 2), O = o(l, c + 4);
|
|
4474
4474
|
c += 6;
|
|
4475
|
-
var
|
|
4476
|
-
c += 4, c += C + R + O, n._readLocal(l,
|
|
4475
|
+
var k = a(l, c += 8);
|
|
4476
|
+
c += 4, c += C + R + O, n._readLocal(l, k, h, f, L, i);
|
|
4477
4477
|
}
|
|
4478
4478
|
return h;
|
|
4479
4479
|
}, n._readLocal = function(r, i, o, a, c, h) {
|
|
@@ -4525,8 +4525,8 @@ var fn = {}, xs = { get exports() {
|
|
|
4525
4525
|
var R = 0, O = I;
|
|
4526
4526
|
for (var l in h)
|
|
4527
4527
|
C = h[l], L.push(I), I = n._writeHeader(y, I, l, C, 1, L[R++]);
|
|
4528
|
-
var
|
|
4529
|
-
return a(y, I, 101010256), I += 4, c(y, I += 4, R), c(y, I += 2, R), a(y, I += 2,
|
|
4528
|
+
var k = I - O;
|
|
4529
|
+
return a(y, I, 101010256), I += 4, c(y, I += 4, R), c(y, I += 2, R), a(y, I += 2, k), a(y, I += 4, O), I += 4, I += 2, y.buffer;
|
|
4530
4530
|
}, n._noNeed = function(r) {
|
|
4531
4531
|
var i = r.split(".").pop().toLowerCase();
|
|
4532
4532
|
return "png,jpg,jpeg,zip".indexOf(i) != -1;
|
|
@@ -4606,7 +4606,7 @@ var fn = {}, xs = { get exports() {
|
|
|
4606
4606
|
u(i, f, d + (N = Math.min(65535, I - d)) == I ? 1 : 0), f = n.F._copyExact(r, d, N, i, f + 8), d += N;
|
|
4607
4607
|
return f >>> 3;
|
|
4608
4608
|
}
|
|
4609
|
-
var L = h.lits, C = h.strt, R = h.prev, O = 0,
|
|
4609
|
+
var L = h.lits, C = h.strt, R = h.prev, O = 0, k = 0, x = 0, b = 0, B = 0, m = 0;
|
|
4610
4610
|
for (I > 2 && (C[m = n.F._hash(r, 0)] = 0), d = 0; d < I; d++) {
|
|
4611
4611
|
if (B = m, d + 1 < I - 2) {
|
|
4612
4612
|
m = n.F._hash(r, d + 1);
|
|
@@ -4614,21 +4614,21 @@ var fn = {}, xs = { get exports() {
|
|
|
4614
4614
|
R[g] = C[m], C[m] = g;
|
|
4615
4615
|
}
|
|
4616
4616
|
if (y <= d) {
|
|
4617
|
-
(O > 14e3 ||
|
|
4618
|
-
var
|
|
4619
|
-
d < I - 2 && (
|
|
4620
|
-
var N =
|
|
4621
|
-
if (
|
|
4622
|
-
|
|
4623
|
-
var T = l(N =
|
|
4617
|
+
(O > 14e3 || k > 26697) && I - d > 100 && (y < d && (L[O] = d - y, O += 2, y = d), f = n.F._writeBlock(d == I - 1 || y == I ? 1 : 0, L, O, b, r, x, d - x, i, f), O = k = b = 0, x = d);
|
|
4618
|
+
var v = 0;
|
|
4619
|
+
d < I - 2 && (v = n.F._bestMatch(r, d, R, B, Math.min(c[2], I - d), c[3]));
|
|
4620
|
+
var N = v >>> 16, F = 65535 & v;
|
|
4621
|
+
if (v != 0) {
|
|
4622
|
+
F = 65535 & v;
|
|
4623
|
+
var T = l(N = v >>> 16, h.of0);
|
|
4624
4624
|
h.lhst[257 + T]++;
|
|
4625
|
-
var E = l(
|
|
4626
|
-
h.dhst[E]++, b += h.exb[T] + h.dxb[E], L[O] = N << 23 | d - y, L[O + 1] =
|
|
4625
|
+
var E = l(F, h.df0);
|
|
4626
|
+
h.dhst[E]++, b += h.exb[T] + h.dxb[E], L[O] = N << 23 | d - y, L[O + 1] = F << 16 | T << 8 | E, O += 2, y = d + N;
|
|
4627
4627
|
} else h.lhst[r[d]]++;
|
|
4628
|
-
|
|
4628
|
+
k++;
|
|
4629
4629
|
}
|
|
4630
4630
|
}
|
|
4631
|
-
for (x == d && r.length != 0 || (y < d && (L[O] = d - y, O += 2, y = d), f = n.F._writeBlock(1, L, O, b, r, x, d - x, i, f), O = 0,
|
|
4631
|
+
for (x == d && r.length != 0 || (y < d && (L[O] = d - y, O += 2, y = d), f = n.F._writeBlock(1, L, O, b, r, x, d - x, i, f), O = 0, k = 0, O = k = b = 0, x = d); 7 & f; ) f++;
|
|
4632
4632
|
return f >>> 3;
|
|
4633
4633
|
}, n.F._bestMatch = function(r, i, o, a, c, h) {
|
|
4634
4634
|
var l = 32767 & i, u = o[l], d = l - u + 32768 & 32767;
|
|
@@ -4640,8 +4640,8 @@ var fn = {}, xs = { get exports() {
|
|
|
4640
4640
|
if (y = d, (f = L) >= c) break;
|
|
4641
4641
|
d + 2 < L && (L = d + 2);
|
|
4642
4642
|
for (var C = 0, R = 0; R < L - 2; R++) {
|
|
4643
|
-
var O = i - d + R + 32768 & 32767,
|
|
4644
|
-
|
|
4643
|
+
var O = i - d + R + 32768 & 32767, k = O - o[O] + 32768 & 32767;
|
|
4644
|
+
k > C && (C = k, u = O);
|
|
4645
4645
|
}
|
|
4646
4646
|
}
|
|
4647
4647
|
}
|
|
@@ -4656,14 +4656,14 @@ var fn = {}, xs = { get exports() {
|
|
|
4656
4656
|
}, n.F._hash = function(r, i) {
|
|
4657
4657
|
return (r[i] << 8 | r[i + 1]) + (r[i + 2] << 4) & 65535;
|
|
4658
4658
|
}, n.saved = 0, n.F._writeBlock = function(r, i, o, a, c, h, l, u, d) {
|
|
4659
|
-
var f, y, I, L, C, R, O,
|
|
4660
|
-
b.lhst[256]++, y = (f = n.F.getTrees())[0], I = f[1], L = f[2], C = f[3], R = f[4], O = f[5],
|
|
4661
|
-
var g = 32 + (d + 3 & 7 ? 8 - (d + 3 & 7) : 0) + (l << 3),
|
|
4659
|
+
var f, y, I, L, C, R, O, k, x, b = n.F.U, B = n.F._putsF, m = n.F._putsE;
|
|
4660
|
+
b.lhst[256]++, y = (f = n.F.getTrees())[0], I = f[1], L = f[2], C = f[3], R = f[4], O = f[5], k = f[6], x = f[7];
|
|
4661
|
+
var g = 32 + (d + 3 & 7 ? 8 - (d + 3 & 7) : 0) + (l << 3), v = a + n.F.contSize(b.fltree, b.lhst) + n.F.contSize(b.fdtree, b.dhst), N = a + n.F.contSize(b.ltree, b.lhst) + n.F.contSize(b.dtree, b.dhst);
|
|
4662
4662
|
N += 14 + 3 * O + n.F.contSize(b.itree, b.ihst) + (2 * b.ihst[16] + 3 * b.ihst[17] + 7 * b.ihst[18]);
|
|
4663
|
-
for (var
|
|
4664
|
-
for (
|
|
4665
|
-
for (
|
|
4666
|
-
var T = g <
|
|
4663
|
+
for (var F = 0; F < 286; F++) b.lhst[F] = 0;
|
|
4664
|
+
for (F = 0; F < 30; F++) b.dhst[F] = 0;
|
|
4665
|
+
for (F = 0; F < 19; F++) b.ihst[F] = 0;
|
|
4666
|
+
var T = g < v && g < N ? 0 : v < N ? 1 : 2;
|
|
4667
4667
|
if (B(u, d, r), B(u, d + 1, T), d += 3, T == 0) {
|
|
4668
4668
|
for (; 7 & d; ) d++;
|
|
4669
4669
|
d = n.F._copyExact(c, h, l, u, d);
|
|
@@ -4672,13 +4672,13 @@ var fn = {}, xs = { get exports() {
|
|
|
4672
4672
|
if (T == 1 && (E = b.fltree, U = b.fdtree), T == 2) {
|
|
4673
4673
|
n.F.makeCodes(b.ltree, y), n.F.revCodes(b.ltree, y), n.F.makeCodes(b.dtree, I), n.F.revCodes(b.dtree, I), n.F.makeCodes(b.itree, L), n.F.revCodes(b.itree, L), E = b.ltree, U = b.dtree, m(u, d, C - 257), m(u, d += 5, R - 1), m(u, d += 5, O - 4), d += 4;
|
|
4674
4674
|
for (var w = 0; w < O; w++) m(u, d + 3 * w, b.itree[1 + (b.ordr[w] << 1)]);
|
|
4675
|
-
d += 3 * O, d = n.F._codeTiny(
|
|
4675
|
+
d += 3 * O, d = n.F._codeTiny(k, b.itree, u, d), d = n.F._codeTiny(x, b.itree, u, d);
|
|
4676
4676
|
}
|
|
4677
4677
|
for (var p = h, M = 0; M < o; M += 2) {
|
|
4678
4678
|
for (var _ = i[M], V = _ >>> 23, q = p + (8388607 & _); p < q; ) d = n.F._writeLit(c[p++], E, u, d);
|
|
4679
4679
|
if (V != 0) {
|
|
4680
|
-
var
|
|
4681
|
-
m(u, d = n.F._writeLit(257 +
|
|
4680
|
+
var P = i[M + 1], Z = P >> 16, $ = P >> 8 & 255, S = 255 & P;
|
|
4681
|
+
m(u, d = n.F._writeLit(257 + $, E, u, d), V - b.of0[$]), d += b.exb[$], B(u, d = n.F._writeLit(S, U, u, d), Z - b.df0[S]), d += b.dxb[S], p += V;
|
|
4682
4682
|
}
|
|
4683
4683
|
}
|
|
4684
4684
|
d = n.F._writeLit(256, E, u, d);
|
|
@@ -4733,8 +4733,8 @@ var fn = {}, xs = { get exports() {
|
|
|
4733
4733
|
var f = a[0].lit;
|
|
4734
4734
|
return d = f == 0 ? 1 : 0, i[1 + (f << 1)] = 1, i[1 + (d << 1)] = 1, 1;
|
|
4735
4735
|
}
|
|
4736
|
-
a.sort(function(
|
|
4737
|
-
return
|
|
4736
|
+
a.sort(function(k, x) {
|
|
4737
|
+
return k.f - x.f;
|
|
4738
4738
|
});
|
|
4739
4739
|
var y = a[0], I = a[1], L = 0, C = 1, R = 2;
|
|
4740
4740
|
for (a[0] = { lit: -1, f: y.f + I.f, l: y, r: I, d: 0 }; C != u - 1; ) y = L != C && (R == u || a[L].f < a[R].f) ? a[L++] : a[R++], I = L != C && (R == u || a[L].f < a[R].f) ? a[L++] : a[R++], a[C++] = { lit: -1, f: y.f + I.f, l: y, r: I };
|
|
@@ -4765,24 +4765,24 @@ var fn = {}, xs = { get exports() {
|
|
|
4765
4765
|
if (r[0] == 3 && r[1] == 0) return i || new o(0);
|
|
4766
4766
|
var a = n.F, c = a._bitsF, h = a._bitsE, l = a._decodeTiny, u = a.makeCodes, d = a.codes2map, f = a._get17, y = a.U, I = i == null;
|
|
4767
4767
|
I && (i = new o(r.length >>> 2 << 3));
|
|
4768
|
-
for (var L, C, R = 0, O = 0,
|
|
4768
|
+
for (var L, C, R = 0, O = 0, k = 0, x = 0, b = 0, B = 0, m = 0, g = 0, v = 0; R == 0; ) if (R = c(r, v, 1), O = c(r, v + 1, 2), v += 3, O != 0) {
|
|
4769
4769
|
if (I && (i = n.F._check(i, g + (1 << 17))), O == 1 && (L = y.flmap, C = y.fdmap, B = 511, m = 31), O == 2) {
|
|
4770
|
-
|
|
4770
|
+
k = h(r, v, 5) + 257, x = h(r, v + 5, 5) + 1, b = h(r, v + 10, 4) + 4, v += 14;
|
|
4771
4771
|
for (var N = 0; N < 38; N += 2) y.itree[N] = 0, y.itree[N + 1] = 0;
|
|
4772
|
-
var
|
|
4772
|
+
var F = 1;
|
|
4773
4773
|
for (N = 0; N < b; N++) {
|
|
4774
|
-
var T = h(r,
|
|
4775
|
-
y.itree[1 + (y.ordr[N] << 1)] = T, T >
|
|
4774
|
+
var T = h(r, v + 3 * N, 3);
|
|
4775
|
+
y.itree[1 + (y.ordr[N] << 1)] = T, T > F && (F = T);
|
|
4776
4776
|
}
|
|
4777
|
-
|
|
4778
|
-
var E = a._copyOut(y.ttree, 0,
|
|
4777
|
+
v += 3 * b, u(y.itree, F), d(y.itree, F, y.imap), L = y.lmap, C = y.dmap, v = l(y.imap, (1 << F) - 1, k + x, r, v, y.ttree);
|
|
4778
|
+
var E = a._copyOut(y.ttree, 0, k, y.ltree);
|
|
4779
4779
|
B = (1 << E) - 1;
|
|
4780
|
-
var U = a._copyOut(y.ttree,
|
|
4780
|
+
var U = a._copyOut(y.ttree, k, x, y.dtree);
|
|
4781
4781
|
m = (1 << U) - 1, u(y.ltree, E), d(y.ltree, E, L), u(y.dtree, U), d(y.dtree, U, C);
|
|
4782
4782
|
}
|
|
4783
4783
|
for (; ; ) {
|
|
4784
|
-
var w = L[f(r,
|
|
4785
|
-
|
|
4784
|
+
var w = L[f(r, v) & B];
|
|
4785
|
+
v += 15 & w;
|
|
4786
4786
|
var p = w >>> 4;
|
|
4787
4787
|
if (!(p >>> 8)) i[g++] = p;
|
|
4788
4788
|
else {
|
|
@@ -4790,19 +4790,19 @@ var fn = {}, xs = { get exports() {
|
|
|
4790
4790
|
var M = g + p - 254;
|
|
4791
4791
|
if (p > 264) {
|
|
4792
4792
|
var _ = y.ldef[p - 257];
|
|
4793
|
-
M = g + (_ >>> 3) + h(r,
|
|
4793
|
+
M = g + (_ >>> 3) + h(r, v, 7 & _), v += 7 & _;
|
|
4794
4794
|
}
|
|
4795
|
-
var V = C[f(r,
|
|
4796
|
-
|
|
4797
|
-
var q = V >>> 4,
|
|
4798
|
-
for (
|
|
4795
|
+
var V = C[f(r, v) & m];
|
|
4796
|
+
v += 15 & V;
|
|
4797
|
+
var q = V >>> 4, P = y.ddef[q], Z = (P >>> 4) + c(r, v, 15 & P);
|
|
4798
|
+
for (v += 15 & P, I && (i = n.F._check(i, g + (1 << 17))); g < M; ) i[g] = i[g++ - Z], i[g] = i[g++ - Z], i[g] = i[g++ - Z], i[g] = i[g++ - Z];
|
|
4799
4799
|
g = M;
|
|
4800
4800
|
}
|
|
4801
4801
|
}
|
|
4802
4802
|
} else {
|
|
4803
|
-
7 &
|
|
4804
|
-
var
|
|
4805
|
-
I && (i = n.F._check(i, g + S)), i.set(new o(r.buffer, r.byteOffset +
|
|
4803
|
+
7 & v && (v += 8 - (7 & v));
|
|
4804
|
+
var $ = 4 + (v >>> 3), S = r[$ - 4] | r[$ - 3] << 8;
|
|
4805
|
+
I && (i = n.F._check(i, g + S)), i.set(new o(r.buffer, r.byteOffset + $, S), g), v = $ + S << 3, g += S;
|
|
4806
4806
|
}
|
|
4807
4807
|
return i.length == g ? i : i.slice(0, g);
|
|
4808
4808
|
}, n.F._check = function(r, i) {
|
|
@@ -4872,7 +4872,7 @@ var fn = {}, xs = { get exports() {
|
|
|
4872
4872
|
a(r.fltree, 144, 8), a(r.fltree, 112, 9), a(r.fltree, 24, 7), a(r.fltree, 8, 8), n.F.makeCodes(r.fltree, 9), n.F.codes2map(r.fltree, 9, r.flmap), n.F.revCodes(r.fltree, 9), a(r.fdtree, 32, 5), n.F.makeCodes(r.fdtree, 5), n.F.codes2map(r.fdtree, 5, r.fdmap), n.F.revCodes(r.fdtree, 5), a(r.itree, 19, 0), a(r.ltree, 286, 0), a(r.dtree, 30, 0), a(r.ttree, 320, 0);
|
|
4873
4873
|
}();
|
|
4874
4874
|
})();
|
|
4875
|
-
var
|
|
4875
|
+
var Bs = xs({ __proto__: null, default: gn }, [gn]);
|
|
4876
4876
|
const ze = function() {
|
|
4877
4877
|
var s = { nextZero(l, u) {
|
|
4878
4878
|
for (; l[u] != 0; ) u++;
|
|
@@ -4902,71 +4902,71 @@ const ze = function() {
|
|
|
4902
4902
|
return f;
|
|
4903
4903
|
} };
|
|
4904
4904
|
function e(l, u, d, f) {
|
|
4905
|
-
const y = u * d, I = i(f), L = Math.ceil(u * I / 8), C = new Uint8Array(4 * y), R = new Uint32Array(C.buffer), { ctype: O } = f, { depth:
|
|
4905
|
+
const y = u * d, I = i(f), L = Math.ceil(u * I / 8), C = new Uint8Array(4 * y), R = new Uint32Array(C.buffer), { ctype: O } = f, { depth: k } = f, x = s.readUshort;
|
|
4906
4906
|
if (O == 6) {
|
|
4907
4907
|
const _ = y << 2;
|
|
4908
|
-
if (
|
|
4909
|
-
if (
|
|
4908
|
+
if (k == 8) for (var b = 0; b < _; b += 4) C[b] = l[b], C[b + 1] = l[b + 1], C[b + 2] = l[b + 2], C[b + 3] = l[b + 3];
|
|
4909
|
+
if (k == 16) for (b = 0; b < _; b++) C[b] = l[b << 1];
|
|
4910
4910
|
} else if (O == 2) {
|
|
4911
4911
|
const _ = f.tabs.tRNS;
|
|
4912
4912
|
if (_ == null) {
|
|
4913
|
-
if (
|
|
4913
|
+
if (k == 8) for (b = 0; b < y; b++) {
|
|
4914
4914
|
var B = 3 * b;
|
|
4915
4915
|
R[b] = 255 << 24 | l[B + 2] << 16 | l[B + 1] << 8 | l[B];
|
|
4916
4916
|
}
|
|
4917
|
-
if (
|
|
4917
|
+
if (k == 16) for (b = 0; b < y; b++)
|
|
4918
4918
|
B = 6 * b, R[b] = 255 << 24 | l[B + 4] << 16 | l[B + 2] << 8 | l[B];
|
|
4919
4919
|
} else {
|
|
4920
4920
|
var m = _[0];
|
|
4921
4921
|
const V = _[1], q = _[2];
|
|
4922
|
-
if (
|
|
4922
|
+
if (k == 8) for (b = 0; b < y; b++) {
|
|
4923
4923
|
var g = b << 2;
|
|
4924
4924
|
B = 3 * b, R[b] = 255 << 24 | l[B + 2] << 16 | l[B + 1] << 8 | l[B], l[B] == m && l[B + 1] == V && l[B + 2] == q && (C[g + 3] = 0);
|
|
4925
4925
|
}
|
|
4926
|
-
if (
|
|
4926
|
+
if (k == 16) for (b = 0; b < y; b++)
|
|
4927
4927
|
g = b << 2, B = 6 * b, R[b] = 255 << 24 | l[B + 4] << 16 | l[B + 2] << 8 | l[B], x(l, B) == m && x(l, B + 2) == V && x(l, B + 4) == q && (C[g + 3] = 0);
|
|
4928
4928
|
}
|
|
4929
4929
|
} else if (O == 3) {
|
|
4930
4930
|
const _ = f.tabs.PLTE, V = f.tabs.tRNS, q = V ? V.length : 0;
|
|
4931
|
-
if (
|
|
4932
|
-
var N =
|
|
4931
|
+
if (k == 1) for (var v = 0; v < d; v++) {
|
|
4932
|
+
var N = v * L, F = v * u;
|
|
4933
4933
|
for (b = 0; b < u; b++) {
|
|
4934
|
-
g =
|
|
4934
|
+
g = F + b << 2;
|
|
4935
4935
|
var T = 3 * (E = l[N + (b >> 3)] >> 7 - ((7 & b) << 0) & 1);
|
|
4936
4936
|
C[g] = _[T], C[g + 1] = _[T + 1], C[g + 2] = _[T + 2], C[g + 3] = E < q ? V[E] : 255;
|
|
4937
4937
|
}
|
|
4938
4938
|
}
|
|
4939
|
-
if (
|
|
4940
|
-
g =
|
|
4941
|
-
if (
|
|
4942
|
-
g =
|
|
4943
|
-
if (
|
|
4939
|
+
if (k == 2) for (v = 0; v < d; v++) for (N = v * L, F = v * u, b = 0; b < u; b++)
|
|
4940
|
+
g = F + b << 2, T = 3 * (E = l[N + (b >> 2)] >> 6 - ((3 & b) << 1) & 3), C[g] = _[T], C[g + 1] = _[T + 1], C[g + 2] = _[T + 2], C[g + 3] = E < q ? V[E] : 255;
|
|
4941
|
+
if (k == 4) for (v = 0; v < d; v++) for (N = v * L, F = v * u, b = 0; b < u; b++)
|
|
4942
|
+
g = F + b << 2, T = 3 * (E = l[N + (b >> 1)] >> 4 - ((1 & b) << 2) & 15), C[g] = _[T], C[g + 1] = _[T + 1], C[g + 2] = _[T + 2], C[g + 3] = E < q ? V[E] : 255;
|
|
4943
|
+
if (k == 8) for (b = 0; b < y; b++) {
|
|
4944
4944
|
var E;
|
|
4945
4945
|
g = b << 2, T = 3 * (E = l[b]), C[g] = _[T], C[g + 1] = _[T + 1], C[g + 2] = _[T + 2], C[g + 3] = E < q ? V[E] : 255;
|
|
4946
4946
|
}
|
|
4947
4947
|
} else if (O == 4) {
|
|
4948
|
-
if (
|
|
4948
|
+
if (k == 8) for (b = 0; b < y; b++) {
|
|
4949
4949
|
g = b << 2;
|
|
4950
4950
|
var U = l[w = b << 1];
|
|
4951
4951
|
C[g] = U, C[g + 1] = U, C[g + 2] = U, C[g + 3] = l[w + 1];
|
|
4952
4952
|
}
|
|
4953
|
-
if (
|
|
4953
|
+
if (k == 16) for (b = 0; b < y; b++) {
|
|
4954
4954
|
var w;
|
|
4955
4955
|
g = b << 2, U = l[w = b << 2], C[g] = U, C[g + 1] = U, C[g + 2] = U, C[g + 3] = l[w + 2];
|
|
4956
4956
|
}
|
|
4957
|
-
} else if (O == 0) for (m = f.tabs.tRNS ? f.tabs.tRNS : -1,
|
|
4958
|
-
const _ =
|
|
4959
|
-
if (
|
|
4957
|
+
} else if (O == 0) for (m = f.tabs.tRNS ? f.tabs.tRNS : -1, v = 0; v < d; v++) {
|
|
4958
|
+
const _ = v * L, V = v * u;
|
|
4959
|
+
if (k == 1) for (var p = 0; p < u; p++) {
|
|
4960
4960
|
var M = (U = 255 * (l[_ + (p >>> 3)] >>> 7 - (7 & p) & 1)) == 255 * m ? 0 : 255;
|
|
4961
4961
|
R[V + p] = M << 24 | U << 16 | U << 8 | U;
|
|
4962
4962
|
}
|
|
4963
|
-
else if (
|
|
4963
|
+
else if (k == 2) for (p = 0; p < u; p++)
|
|
4964
4964
|
M = (U = 85 * (l[_ + (p >>> 2)] >>> 6 - ((3 & p) << 1) & 3)) == 85 * m ? 0 : 255, R[V + p] = M << 24 | U << 16 | U << 8 | U;
|
|
4965
|
-
else if (
|
|
4965
|
+
else if (k == 4) for (p = 0; p < u; p++)
|
|
4966
4966
|
M = (U = 17 * (l[_ + (p >>> 1)] >>> 4 - ((1 & p) << 2) & 15)) == 17 * m ? 0 : 255, R[V + p] = M << 24 | U << 16 | U << 8 | U;
|
|
4967
|
-
else if (
|
|
4967
|
+
else if (k == 8) for (p = 0; p < u; p++)
|
|
4968
4968
|
M = (U = l[_ + p]) == m ? 0 : 255, R[V + p] = M << 24 | U << 16 | U << 8 | U;
|
|
4969
|
-
else if (
|
|
4969
|
+
else if (k == 16) for (p = 0; p < u; p++)
|
|
4970
4970
|
U = l[_ + (p << 1)], M = x(l, _ + (p << 1)) == m ? 0 : 255, R[V + p] = M << 24 | U << 16 | U << 8 | U;
|
|
4971
4971
|
}
|
|
4972
4972
|
return C;
|
|
@@ -4974,22 +4974,22 @@ const ze = function() {
|
|
|
4974
4974
|
function t(l, u, d, f) {
|
|
4975
4975
|
const y = i(l), I = Math.ceil(d * y / 8), L = new Uint8Array((I + 1 + l.interlace) * f);
|
|
4976
4976
|
return u = l.tabs.CgBI ? r(u, L) : n(u, L), l.interlace == 0 ? u = o(u, l, 0, d, f) : l.interlace == 1 && (u = function(R, O) {
|
|
4977
|
-
const
|
|
4978
|
-
let
|
|
4979
|
-
const N = [0, 0, 4, 0, 2, 0, 1],
|
|
4977
|
+
const k = O.width, x = O.height, b = i(O), B = b >> 3, m = Math.ceil(k * b / 8), g = new Uint8Array(x * m);
|
|
4978
|
+
let v = 0;
|
|
4979
|
+
const N = [0, 0, 4, 0, 2, 0, 1], F = [0, 4, 0, 2, 0, 1, 0], T = [8, 8, 8, 4, 4, 2, 2], E = [8, 8, 4, 4, 2, 2, 1];
|
|
4980
4980
|
let U = 0;
|
|
4981
4981
|
for (; U < 7; ) {
|
|
4982
4982
|
const p = T[U], M = E[U];
|
|
4983
4983
|
let _ = 0, V = 0, q = N[U];
|
|
4984
4984
|
for (; q < x; ) q += p, V++;
|
|
4985
|
-
let
|
|
4986
|
-
for (;
|
|
4985
|
+
let P = F[U];
|
|
4986
|
+
for (; P < k; ) P += M, _++;
|
|
4987
4987
|
const Z = Math.ceil(_ * b / 8);
|
|
4988
|
-
o(R, O,
|
|
4989
|
-
let
|
|
4988
|
+
o(R, O, v, _, V);
|
|
4989
|
+
let $ = 0, S = N[U];
|
|
4990
4990
|
for (; S < x; ) {
|
|
4991
|
-
let z =
|
|
4992
|
-
for (; z <
|
|
4991
|
+
let z = F[U], ae = v + $ * Z << 3;
|
|
4992
|
+
for (; z < k; ) {
|
|
4993
4993
|
var w;
|
|
4994
4994
|
if (b == 1 && (w = (w = R[ae >> 3]) >> 7 - (7 & ae) & 1, g[S * m + (z >> 3)] |= w << 7 - ((7 & z) << 0)), b == 2 && (w = (w = R[ae >> 3]) >> 6 - (7 & ae) & 3, g[S * m + (z >> 2)] |= w << 6 - ((3 & z) << 1)), b == 4 && (w = (w = R[ae >> 3]) >> 4 - (7 & ae) & 15, g[S * m + (z >> 1)] |= w << 4 - ((1 & z) << 2)), b >= 8) {
|
|
4995
4995
|
const te = S * m + z * B;
|
|
@@ -4997,9 +4997,9 @@ const ze = function() {
|
|
|
4997
4997
|
}
|
|
4998
4998
|
ae += b, z += M;
|
|
4999
4999
|
}
|
|
5000
|
-
|
|
5000
|
+
$++, S += p;
|
|
5001
5001
|
}
|
|
5002
|
-
_ * V != 0 && (
|
|
5002
|
+
_ * V != 0 && (v += V * (1 + Z)), U += 1;
|
|
5003
5003
|
}
|
|
5004
5004
|
return g;
|
|
5005
5005
|
}(u, l)), u;
|
|
@@ -5011,19 +5011,19 @@ const ze = function() {
|
|
|
5011
5011
|
const l = { H: {} };
|
|
5012
5012
|
return l.H.N = function(u, d) {
|
|
5013
5013
|
const f = Uint8Array;
|
|
5014
|
-
let y, I, L = 0, C = 0, R = 0, O = 0,
|
|
5014
|
+
let y, I, L = 0, C = 0, R = 0, O = 0, k = 0, x = 0, b = 0, B = 0, m = 0;
|
|
5015
5015
|
if (u[0] == 3 && u[1] == 0) return d || new f(0);
|
|
5016
|
-
const g = l.H,
|
|
5017
|
-
for (p && (d = new f(u.length >>> 2 << 5)); L == 0; ) if (L =
|
|
5016
|
+
const g = l.H, v = g.b, N = g.e, F = g.R, T = g.n, E = g.A, U = g.Z, w = g.m, p = d == null;
|
|
5017
|
+
for (p && (d = new f(u.length >>> 2 << 5)); L == 0; ) if (L = v(u, m, 1), C = v(u, m + 1, 2), m += 3, C != 0) {
|
|
5018
5018
|
if (p && (d = l.H.W(d, B + (1 << 17))), C == 1 && (y = w.J, I = w.h, x = 511, b = 31), C == 2) {
|
|
5019
|
-
R = N(u, m, 5) + 257, O = N(u, m + 5, 5) + 1,
|
|
5019
|
+
R = N(u, m, 5) + 257, O = N(u, m + 5, 5) + 1, k = N(u, m + 10, 4) + 4, m += 14;
|
|
5020
5020
|
let _ = 1;
|
|
5021
5021
|
for (var M = 0; M < 38; M += 2) w.Q[M] = 0, w.Q[M + 1] = 0;
|
|
5022
|
-
for (M = 0; M <
|
|
5023
|
-
const
|
|
5024
|
-
w.Q[1 + (w.X[M] << 1)] =
|
|
5022
|
+
for (M = 0; M < k; M++) {
|
|
5023
|
+
const P = N(u, m + 3 * M, 3);
|
|
5024
|
+
w.Q[1 + (w.X[M] << 1)] = P, P > _ && (_ = P);
|
|
5025
5025
|
}
|
|
5026
|
-
m += 3 *
|
|
5026
|
+
m += 3 * k, T(w.Q, _), E(w.Q, _, w.u), y = w.w, I = w.d, m = F(w.u, (1 << _) - 1, R + O, u, m, w.v);
|
|
5027
5027
|
const V = g.V(w.v, 0, R, w.C);
|
|
5028
5028
|
x = (1 << V) - 1;
|
|
5029
5029
|
const q = g.V(w.v, R, O, w.D);
|
|
@@ -5042,10 +5042,10 @@ const ze = function() {
|
|
|
5042
5042
|
const z = w.q[V - 257];
|
|
5043
5043
|
q = B + (z >>> 3) + N(u, m, 7 & z), m += 7 & z;
|
|
5044
5044
|
}
|
|
5045
|
-
const
|
|
5046
|
-
m += 15 &
|
|
5047
|
-
const Z =
|
|
5048
|
-
for (m += 15 &
|
|
5045
|
+
const P = I[U(u, m) & b];
|
|
5046
|
+
m += 15 & P;
|
|
5047
|
+
const Z = P >>> 4, $ = w.c[Z], S = ($ >>> 4) + v(u, m, 15 & $);
|
|
5048
|
+
for (m += 15 & $; B < q; ) d[B] = d[B++ - S], d[B] = d[B++ - S], d[B] = d[B++ - S], d[B] = d[B++ - S];
|
|
5049
5049
|
B = q;
|
|
5050
5050
|
}
|
|
5051
5051
|
}
|
|
@@ -5065,9 +5065,9 @@ const ze = function() {
|
|
|
5065
5065
|
const C = l.H.e, R = l.H.Z;
|
|
5066
5066
|
let O = 0;
|
|
5067
5067
|
for (; O < f; ) {
|
|
5068
|
-
const
|
|
5069
|
-
I += 15 &
|
|
5070
|
-
const x =
|
|
5068
|
+
const k = u[R(y, I) & d];
|
|
5069
|
+
I += 15 & k;
|
|
5070
|
+
const x = k >>> 4;
|
|
5071
5071
|
if (x <= 15) L[O] = x, O++;
|
|
5072
5072
|
else {
|
|
5073
5073
|
let b = 0, B = 0;
|
|
@@ -5090,17 +5090,17 @@ const ze = function() {
|
|
|
5090
5090
|
const f = l.H.m, y = u.length;
|
|
5091
5091
|
let I, L, C, R;
|
|
5092
5092
|
const O = f.j;
|
|
5093
|
-
for (var
|
|
5094
|
-
for (
|
|
5093
|
+
for (var k = 0; k <= d; k++) O[k] = 0;
|
|
5094
|
+
for (k = 1; k < y; k += 2) O[u[k]]++;
|
|
5095
5095
|
const x = f.K;
|
|
5096
5096
|
for (I = 0, O[0] = 0, L = 1; L <= d; L++) I = I + O[L - 1] << 1, x[L] = I;
|
|
5097
5097
|
for (C = 0; C < y; C += 2) R = u[C + 1], R != 0 && (u[C] = x[R], x[R]++);
|
|
5098
5098
|
}, l.H.A = function(u, d, f) {
|
|
5099
5099
|
const y = u.length, I = l.H.m.r;
|
|
5100
5100
|
for (let L = 0; L < y; L += 2) if (u[L + 1] != 0) {
|
|
5101
|
-
const C = L >> 1, R = u[L + 1], O = C << 4 | R,
|
|
5102
|
-
let x = u[L] <<
|
|
5103
|
-
const b = x + (1 <<
|
|
5101
|
+
const C = L >> 1, R = u[L + 1], O = C << 4 | R, k = d - R;
|
|
5102
|
+
let x = u[L] << k;
|
|
5103
|
+
const b = x + (1 << k);
|
|
5104
5104
|
for (; x != b; )
|
|
5105
5105
|
f[I[x] >>> 15 - d] = O, x++;
|
|
5106
5106
|
}
|
|
@@ -5150,19 +5150,19 @@ const ze = function() {
|
|
|
5150
5150
|
const L = Math.ceil(f * I / 8);
|
|
5151
5151
|
let C, R;
|
|
5152
5152
|
I = Math.ceil(I / 8);
|
|
5153
|
-
let O = l[d],
|
|
5154
|
-
if (O > 1 && (l[d] = [0, 0, 1][O - 2]), O == 3) for (
|
|
5155
|
-
for (let x = 0; x < y; x++) if (C = d + x * L, R = C + x + 1, O = l[R - 1],
|
|
5153
|
+
let O = l[d], k = 0;
|
|
5154
|
+
if (O > 1 && (l[d] = [0, 0, 1][O - 2]), O == 3) for (k = I; k < L; k++) l[k + 1] = l[k + 1] + (l[k + 1 - I] >>> 1) & 255;
|
|
5155
|
+
for (let x = 0; x < y; x++) if (C = d + x * L, R = C + x + 1, O = l[R - 1], k = 0, O == 0) for (; k < L; k++) l[C + k] = l[R + k];
|
|
5156
5156
|
else if (O == 1) {
|
|
5157
|
-
for (;
|
|
5158
|
-
for (;
|
|
5159
|
-
} else if (O == 2) for (;
|
|
5157
|
+
for (; k < I; k++) l[C + k] = l[R + k];
|
|
5158
|
+
for (; k < L; k++) l[C + k] = l[R + k] + l[C + k - I];
|
|
5159
|
+
} else if (O == 2) for (; k < L; k++) l[C + k] = l[R + k] + l[C + k - L];
|
|
5160
5160
|
else if (O == 3) {
|
|
5161
|
-
for (;
|
|
5162
|
-
for (;
|
|
5161
|
+
for (; k < I; k++) l[C + k] = l[R + k] + (l[C + k - L] >>> 1);
|
|
5162
|
+
for (; k < L; k++) l[C + k] = l[R + k] + (l[C + k - L] + l[C + k - I] >>> 1);
|
|
5163
5163
|
} else {
|
|
5164
|
-
for (;
|
|
5165
|
-
for (;
|
|
5164
|
+
for (; k < I; k++) l[C + k] = l[R + k] + a(0, l[C + k - L], 0);
|
|
5165
|
+
for (; k < L; k++) l[C + k] = l[R + k] + a(l[C + k - I], l[C + k - L], l[C + k - I - L]);
|
|
5166
5166
|
}
|
|
5167
5167
|
return l;
|
|
5168
5168
|
}
|
|
@@ -5174,17 +5174,17 @@ const ze = function() {
|
|
|
5174
5174
|
d.width = s.readUint(l, u), u += 4, d.height = s.readUint(l, u), u += 4, d.depth = l[u], u++, d.ctype = l[u], u++, d.compress = l[u], u++, d.filter = l[u], u++, d.interlace = l[u], u++;
|
|
5175
5175
|
}
|
|
5176
5176
|
function h(l, u, d, f, y, I, L, C, R) {
|
|
5177
|
-
const O = Math.min(u, y),
|
|
5177
|
+
const O = Math.min(u, y), k = Math.min(d, I);
|
|
5178
5178
|
let x = 0, b = 0;
|
|
5179
|
-
for (let U = 0; U <
|
|
5179
|
+
for (let U = 0; U < k; U++) for (let w = 0; w < O; w++) if (L >= 0 && C >= 0 ? (x = U * u + w << 2, b = (C + U) * y + L + w << 2) : (x = (-C + U) * u - L + w << 2, b = U * y + w << 2), R == 0) f[b] = l[x], f[b + 1] = l[x + 1], f[b + 2] = l[x + 2], f[b + 3] = l[x + 3];
|
|
5180
5180
|
else if (R == 1) {
|
|
5181
|
-
var B = l[x + 3] * 0.00392156862745098, m = l[x] * B, g = l[x + 1] * B,
|
|
5181
|
+
var B = l[x + 3] * 0.00392156862745098, m = l[x] * B, g = l[x + 1] * B, v = l[x + 2] * B, N = f[b + 3] * (1 / 255), F = f[b] * N, T = f[b + 1] * N, E = f[b + 2] * N;
|
|
5182
5182
|
const p = 1 - B, M = B + N * p, _ = M == 0 ? 0 : 1 / M;
|
|
5183
|
-
f[b + 3] = 255 * M, f[b + 0] = (m +
|
|
5183
|
+
f[b + 3] = 255 * M, f[b + 0] = (m + F * p) * _, f[b + 1] = (g + T * p) * _, f[b + 2] = (v + E * p) * _;
|
|
5184
5184
|
} else if (R == 2)
|
|
5185
|
-
B = l[x + 3], m = l[x], g = l[x + 1],
|
|
5185
|
+
B = l[x + 3], m = l[x], g = l[x + 1], v = l[x + 2], N = f[b + 3], F = f[b], T = f[b + 1], E = f[b + 2], B == N && m == F && g == T && v == E ? (f[b] = 0, f[b + 1] = 0, f[b + 2] = 0, f[b + 3] = 0) : (f[b] = m, f[b + 1] = g, f[b + 2] = v, f[b + 3] = B);
|
|
5186
5186
|
else if (R == 3) {
|
|
5187
|
-
if (B = l[x + 3], m = l[x], g = l[x + 1],
|
|
5187
|
+
if (B = l[x + 3], m = l[x], g = l[x + 1], v = l[x + 2], N = f[b + 3], F = f[b], T = f[b + 1], E = f[b + 2], B == N && m == F && g == T && v == E) continue;
|
|
5188
5188
|
if (B < 220 && N > 20) return !1;
|
|
5189
5189
|
}
|
|
5190
5190
|
return !0;
|
|
@@ -5193,7 +5193,7 @@ const ze = function() {
|
|
|
5193
5193
|
const d = new Uint8Array(u);
|
|
5194
5194
|
let f = 8;
|
|
5195
5195
|
const y = s, I = y.readUshort, L = y.readUint, C = { tabs: {}, frames: [] }, R = new Uint8Array(d.length);
|
|
5196
|
-
let O,
|
|
5196
|
+
let O, k = 0, x = 0;
|
|
5197
5197
|
const b = [137, 80, 78, 71, 13, 10, 26, 10];
|
|
5198
5198
|
for (var B = 0; B < 8; B++) if (d[B] != b[B]) throw "The input is not a PNG file!";
|
|
5199
5199
|
for (; f < d.length; ) {
|
|
@@ -5214,8 +5214,8 @@ const ze = function() {
|
|
|
5214
5214
|
C.tabs[w] = M;
|
|
5215
5215
|
} else if (w == "CgBI") C.tabs[w] = d.slice(f, f + 4);
|
|
5216
5216
|
else if (w == "IDAT") {
|
|
5217
|
-
for (B = 0; B < U; B++) R[
|
|
5218
|
-
|
|
5217
|
+
for (B = 0; B < U; B++) R[k + B] = d[f + B];
|
|
5218
|
+
k += U;
|
|
5219
5219
|
} else if (w == "acTL") C.tabs[w] = { num_frames: L(d, f), num_plays: L(d, f + 4) }, O = new Uint8Array(d.length);
|
|
5220
5220
|
else if (w == "fcTL") {
|
|
5221
5221
|
x != 0 && ((E = C.frames[C.frames.length - 1]).data = t(C, O.slice(0, x), E.rect.width, E.rect.height), x = 0);
|
|
@@ -5232,18 +5232,18 @@ const ze = function() {
|
|
|
5232
5232
|
for (C.tabs[w] = [], B = 0; B < 8; B++) C.tabs[w].push(y.readUint(d, f + 4 * B));
|
|
5233
5233
|
else if (w == "tEXt" || w == "zTXt") {
|
|
5234
5234
|
C.tabs[w] == null && (C.tabs[w] = {});
|
|
5235
|
-
var g = y.nextZero(d, f),
|
|
5235
|
+
var g = y.nextZero(d, f), v = y.readASCII(d, f, g - f), N = f + U - g - 1;
|
|
5236
5236
|
if (w == "tEXt") T = y.readASCII(d, g + 1, N);
|
|
5237
5237
|
else {
|
|
5238
|
-
var
|
|
5239
|
-
T = y.readUTF8(
|
|
5238
|
+
var F = n(d.slice(g + 2, g + 2 + N));
|
|
5239
|
+
T = y.readUTF8(F, 0, F.length);
|
|
5240
5240
|
}
|
|
5241
|
-
C.tabs[w][
|
|
5241
|
+
C.tabs[w][v] = T;
|
|
5242
5242
|
} else if (w == "iTXt") {
|
|
5243
|
-
C.tabs[w] == null && (C.tabs[w] = {}), g = 0, m = f, g = y.nextZero(d, m),
|
|
5243
|
+
C.tabs[w] == null && (C.tabs[w] = {}), g = 0, m = f, g = y.nextZero(d, m), v = y.readASCII(d, m, g - m);
|
|
5244
5244
|
const p = d[m = g + 1];
|
|
5245
5245
|
var T;
|
|
5246
|
-
d[m + 1], m += 2, g = y.nextZero(d, m), y.readASCII(d, m, g - m), m = g + 1, g = y.nextZero(d, m), y.readUTF8(d, m, g - m), N = U - ((m = g + 1) - f), p == 0 ? T = y.readUTF8(d, m, N) : (
|
|
5246
|
+
d[m + 1], m += 2, g = y.nextZero(d, m), y.readASCII(d, m, g - m), m = g + 1, g = y.nextZero(d, m), y.readUTF8(d, m, g - m), N = U - ((m = g + 1) - f), p == 0 ? T = y.readUTF8(d, m, N) : (F = n(d.slice(m, m + N)), T = y.readUTF8(F, 0, F.length)), C.tabs[w][v] = T;
|
|
5247
5247
|
} else if (w == "PLTE") C.tabs[w] = y.readBytes(d, f, U);
|
|
5248
5248
|
else if (w == "hIST") {
|
|
5249
5249
|
const p = C.tabs.PLTE.length / 3;
|
|
@@ -5263,10 +5263,10 @@ const ze = function() {
|
|
|
5263
5263
|
const y = [];
|
|
5264
5264
|
u.frames[0].data == null && (u.frames[0].data = u.data);
|
|
5265
5265
|
const I = d * f * 4, L = new Uint8Array(I), C = new Uint8Array(I), R = new Uint8Array(I);
|
|
5266
|
-
for (let
|
|
5267
|
-
const x = u.frames[
|
|
5268
|
-
if (
|
|
5269
|
-
if (x.blend == 0 ? h(
|
|
5266
|
+
for (let k = 0; k < u.frames.length; k++) {
|
|
5267
|
+
const x = u.frames[k], b = x.rect.x, B = x.rect.y, m = x.rect.width, g = x.rect.height, v = e(x.data, m, g, u);
|
|
5268
|
+
if (k != 0) for (var O = 0; O < I; O++) R[O] = L[O];
|
|
5269
|
+
if (x.blend == 0 ? h(v, m, g, L, d, f, b, B, 0) : x.blend == 1 && h(v, m, g, L, d, f, b, B, 1), y.push(L.buffer.slice(0)), x.dispose != 0) {
|
|
5270
5270
|
if (x.dispose == 1) h(C, m, g, L, d, f, b, B, 0);
|
|
5271
5271
|
else if (x.dispose == 2) for (O = 0; O < I; O++) L[O] = R[O];
|
|
5272
5272
|
}
|
|
@@ -5279,26 +5279,26 @@ const ze = function() {
|
|
|
5279
5279
|
var n = { table: function() {
|
|
5280
5280
|
const m = new Uint32Array(256);
|
|
5281
5281
|
for (let g = 0; g < 256; g++) {
|
|
5282
|
-
let
|
|
5283
|
-
for (let N = 0; N < 8; N++) 1 &
|
|
5284
|
-
m[g] =
|
|
5282
|
+
let v = g;
|
|
5283
|
+
for (let N = 0; N < 8; N++) 1 & v ? v = 3988292384 ^ v >>> 1 : v >>>= 1;
|
|
5284
|
+
m[g] = v;
|
|
5285
5285
|
}
|
|
5286
5286
|
return m;
|
|
5287
|
-
}(), update(m, g,
|
|
5288
|
-
for (let
|
|
5287
|
+
}(), update(m, g, v, N) {
|
|
5288
|
+
for (let F = 0; F < N; F++) m = n.table[255 & (m ^ g[v + F])] ^ m >>> 8;
|
|
5289
5289
|
return m;
|
|
5290
|
-
}, crc: (m, g,
|
|
5291
|
-
function r(m, g,
|
|
5292
|
-
g[
|
|
5290
|
+
}, crc: (m, g, v) => 4294967295 ^ n.update(4294967295, m, g, v) };
|
|
5291
|
+
function r(m, g, v, N) {
|
|
5292
|
+
g[v] += m[0] * N >> 4, g[v + 1] += m[1] * N >> 4, g[v + 2] += m[2] * N >> 4, g[v + 3] += m[3] * N >> 4;
|
|
5293
5293
|
}
|
|
5294
5294
|
function i(m) {
|
|
5295
5295
|
return Math.max(0, Math.min(255, m));
|
|
5296
5296
|
}
|
|
5297
5297
|
function o(m, g) {
|
|
5298
|
-
const
|
|
5299
|
-
return
|
|
5298
|
+
const v = m[0] - g[0], N = m[1] - g[1], F = m[2] - g[2], T = m[3] - g[3];
|
|
5299
|
+
return v * v + N * N + F * F + T * T;
|
|
5300
5300
|
}
|
|
5301
|
-
function a(m, g,
|
|
5301
|
+
function a(m, g, v, N, F, T, E) {
|
|
5302
5302
|
E == null && (E = 1);
|
|
5303
5303
|
const U = N.length, w = [];
|
|
5304
5304
|
for (var p = 0; p < U; p++) {
|
|
@@ -5312,74 +5312,74 @@ const ze = function() {
|
|
|
5312
5312
|
_ != p && V < S && (S = V, M = _);
|
|
5313
5313
|
}
|
|
5314
5314
|
}
|
|
5315
|
-
const q = new Uint32Array(
|
|
5315
|
+
const q = new Uint32Array(F.buffer), P = new Int16Array(g * v * 4), Z = [0, 8, 2, 10, 12, 4, 14, 6, 3, 11, 1, 9, 15, 7, 13, 5];
|
|
5316
5316
|
for (p = 0; p < Z.length; p++) Z[p] = 255 * ((Z[p] + 0.5) / 16 - 0.5);
|
|
5317
|
-
for (let S = 0; S <
|
|
5318
|
-
var
|
|
5319
|
-
p = 4 * (S * g + z), E != 2 ?
|
|
5317
|
+
for (let S = 0; S < v; S++) for (let z = 0; z < g; z++) {
|
|
5318
|
+
var $;
|
|
5319
|
+
p = 4 * (S * g + z), E != 2 ? $ = [i(m[p] + P[p]), i(m[p + 1] + P[p + 1]), i(m[p + 2] + P[p + 2]), i(m[p + 3] + P[p + 3])] : (V = Z[4 * (3 & S) + (3 & z)], $ = [i(m[p] + V), i(m[p + 1] + V), i(m[p + 2] + V), i(m[p + 3] + V)]), M = 0;
|
|
5320
5320
|
let ae = 16777215;
|
|
5321
5321
|
for (_ = 0; _ < U; _++) {
|
|
5322
|
-
const re = o(
|
|
5322
|
+
const re = o($, w[_]);
|
|
5323
5323
|
re < ae && (ae = re, M = _);
|
|
5324
5324
|
}
|
|
5325
|
-
const te = w[M], Q = [
|
|
5326
|
-
E == 1 && (z != g - 1 && r(Q,
|
|
5325
|
+
const te = w[M], Q = [$[0] - te[0], $[1] - te[1], $[2] - te[2], $[3] - te[3]];
|
|
5326
|
+
E == 1 && (z != g - 1 && r(Q, P, p + 4, 7), S != v - 1 && (z != 0 && r(Q, P, p + 4 * g - 4, 3), r(Q, P, p + 4 * g, 5), z != g - 1 && r(Q, P, p + 4 * g + 4, 1))), T[p >> 2] = M, q[p >> 2] = N[M];
|
|
5327
5327
|
}
|
|
5328
5328
|
}
|
|
5329
|
-
function c(m, g,
|
|
5330
|
-
|
|
5329
|
+
function c(m, g, v, N, F) {
|
|
5330
|
+
F == null && (F = {});
|
|
5331
5331
|
const { crc: T } = n, E = e.writeUint, U = e.writeUshort, w = e.writeASCII;
|
|
5332
5332
|
let p = 8;
|
|
5333
5333
|
const M = m.frames.length > 1;
|
|
5334
5334
|
let _, V = !1, q = 33 + (M ? 20 : 0);
|
|
5335
|
-
if (
|
|
5336
|
-
for (var
|
|
5337
|
-
q += 8 + 3 *
|
|
5335
|
+
if (F.sRGB != null && (q += 13), F.pHYs != null && (q += 21), F.iCCP != null && (_ = pako.deflate(F.iCCP), q += 21 + _.length + 4), m.ctype == 3) {
|
|
5336
|
+
for (var P = m.plte.length, Z = 0; Z < P; Z++) m.plte[Z] >>> 24 != 255 && (V = !0);
|
|
5337
|
+
q += 8 + 3 * P + 4 + (V ? 8 + 1 * P + 4 : 0);
|
|
5338
5338
|
}
|
|
5339
|
-
for (var
|
|
5340
|
-
M && (q += 38), q += (te = m.frames[
|
|
5339
|
+
for (var $ = 0; $ < m.frames.length; $++)
|
|
5340
|
+
M && (q += 38), q += (te = m.frames[$]).cimg.length + 12, $ != 0 && (q += 4);
|
|
5341
5341
|
q += 12;
|
|
5342
5342
|
const S = new Uint8Array(q), z = [137, 80, 78, 71, 13, 10, 26, 10];
|
|
5343
5343
|
for (Z = 0; Z < 8; Z++) S[Z] = z[Z];
|
|
5344
|
-
if (E(S, p, 13), p += 4, w(S, p, "IHDR"), p += 4, E(S, p, g), p += 4, E(S, p,
|
|
5344
|
+
if (E(S, p, 13), p += 4, w(S, p, "IHDR"), p += 4, E(S, p, g), p += 4, E(S, p, v), p += 4, S[p] = m.depth, p++, S[p] = m.ctype, p++, S[p] = 0, p++, S[p] = 0, p++, S[p] = 0, p++, E(S, p, T(S, p - 17, 17)), p += 4, F.sRGB != null && (E(S, p, 1), p += 4, w(S, p, "sRGB"), p += 4, S[p] = F.sRGB, p++, E(S, p, T(S, p - 5, 5)), p += 4), F.iCCP != null) {
|
|
5345
5345
|
const Q = 13 + _.length;
|
|
5346
5346
|
E(S, p, Q), p += 4, w(S, p, "iCCP"), p += 4, w(S, p, "ICC profile"), p += 11, p += 2, S.set(_, p), p += _.length, E(S, p, T(S, p - (Q + 4), Q + 4)), p += 4;
|
|
5347
5347
|
}
|
|
5348
|
-
if (
|
|
5349
|
-
for (E(S, p, 3 * (
|
|
5348
|
+
if (F.pHYs != null && (E(S, p, 9), p += 4, w(S, p, "pHYs"), p += 4, E(S, p, F.pHYs[0]), p += 4, E(S, p, F.pHYs[1]), p += 4, S[p] = F.pHYs[2], p++, E(S, p, T(S, p - 13, 13)), p += 4), M && (E(S, p, 8), p += 4, w(S, p, "acTL"), p += 4, E(S, p, m.frames.length), p += 4, E(S, p, F.loop != null ? F.loop : 0), p += 4, E(S, p, T(S, p - 12, 12)), p += 4), m.ctype == 3) {
|
|
5349
|
+
for (E(S, p, 3 * (P = m.plte.length)), p += 4, w(S, p, "PLTE"), p += 4, Z = 0; Z < P; Z++) {
|
|
5350
5350
|
const Q = 3 * Z, re = m.plte[Z], ue = 255 & re, we = re >>> 8 & 255, ht = re >>> 16 & 255;
|
|
5351
5351
|
S[p + Q + 0] = ue, S[p + Q + 1] = we, S[p + Q + 2] = ht;
|
|
5352
5352
|
}
|
|
5353
|
-
if (p += 3 *
|
|
5354
|
-
for (E(S, p,
|
|
5355
|
-
p +=
|
|
5353
|
+
if (p += 3 * P, E(S, p, T(S, p - 3 * P - 4, 3 * P + 4)), p += 4, V) {
|
|
5354
|
+
for (E(S, p, P), p += 4, w(S, p, "tRNS"), p += 4, Z = 0; Z < P; Z++) S[p + Z] = m.plte[Z] >>> 24 & 255;
|
|
5355
|
+
p += P, E(S, p, T(S, p - P - 4, P + 4)), p += 4;
|
|
5356
5356
|
}
|
|
5357
5357
|
}
|
|
5358
5358
|
let ae = 0;
|
|
5359
|
-
for (
|
|
5360
|
-
var te = m.frames[
|
|
5361
|
-
M && (E(S, p, 26), p += 4, w(S, p, "fcTL"), p += 4, E(S, p, ae++), p += 4, E(S, p, te.rect.width), p += 4, E(S, p, te.rect.height), p += 4, E(S, p, te.rect.x), p += 4, E(S, p, te.rect.y), p += 4, U(S, p, N[
|
|
5359
|
+
for ($ = 0; $ < m.frames.length; $++) {
|
|
5360
|
+
var te = m.frames[$];
|
|
5361
|
+
M && (E(S, p, 26), p += 4, w(S, p, "fcTL"), p += 4, E(S, p, ae++), p += 4, E(S, p, te.rect.width), p += 4, E(S, p, te.rect.height), p += 4, E(S, p, te.rect.x), p += 4, E(S, p, te.rect.y), p += 4, U(S, p, N[$]), p += 2, U(S, p, 1e3), p += 2, S[p] = te.dispose, p++, S[p] = te.blend, p++, E(S, p, T(S, p - 30, 30)), p += 4);
|
|
5362
5362
|
const Q = te.cimg;
|
|
5363
|
-
E(S, p, (
|
|
5363
|
+
E(S, p, (P = Q.length) + ($ == 0 ? 0 : 4)), p += 4;
|
|
5364
5364
|
const re = p;
|
|
5365
|
-
w(S, p,
|
|
5365
|
+
w(S, p, $ == 0 ? "IDAT" : "fdAT"), p += 4, $ != 0 && (E(S, p, ae++), p += 4), S.set(Q, p), p += P, E(S, p, T(S, re, p - re)), p += 4;
|
|
5366
5366
|
}
|
|
5367
5367
|
return E(S, p, 0), p += 4, w(S, p, "IEND"), p += 4, E(S, p, T(S, p - 4, 4)), p += 4, S.buffer;
|
|
5368
5368
|
}
|
|
5369
|
-
function h(m, g,
|
|
5369
|
+
function h(m, g, v) {
|
|
5370
5370
|
for (let N = 0; N < m.frames.length; N++) {
|
|
5371
|
-
const
|
|
5372
|
-
|
|
5373
|
-
const T =
|
|
5374
|
-
|
|
5371
|
+
const F = m.frames[N];
|
|
5372
|
+
F.rect.width;
|
|
5373
|
+
const T = F.rect.height, E = new Uint8Array(T * F.bpl + T);
|
|
5374
|
+
F.cimg = f(F.img, T, F.bpp, F.bpl, E, g, v);
|
|
5375
5375
|
}
|
|
5376
5376
|
}
|
|
5377
|
-
function l(m, g,
|
|
5378
|
-
const T =
|
|
5377
|
+
function l(m, g, v, N, F) {
|
|
5378
|
+
const T = F[0], E = F[1], U = F[2], w = F[3], p = F[4], M = F[5];
|
|
5379
5379
|
let _ = 6, V = 8, q = 255;
|
|
5380
|
-
for (var
|
|
5381
|
-
const Fe = new Uint8Array(m[
|
|
5382
|
-
for (var Z = Fe.length,
|
|
5380
|
+
for (var P = 0; P < m.length; P++) {
|
|
5381
|
+
const Fe = new Uint8Array(m[P]);
|
|
5382
|
+
for (var Z = Fe.length, $ = 0; $ < Z; $ += 4) q &= Fe[$ + 3];
|
|
5383
5383
|
}
|
|
5384
5384
|
const S = q != 255, z = function(le, ne, pe, Ne, me, Ie) {
|
|
5385
5385
|
const fe = [];
|
|
@@ -5388,17 +5388,17 @@ const ze = function() {
|
|
|
5388
5388
|
var Re;
|
|
5389
5389
|
let Ue = 0, Be = 0, Ke = ne, nt = pe, St = Ne ? 1 : 0;
|
|
5390
5390
|
if (Y != 0) {
|
|
5391
|
-
const
|
|
5391
|
+
const sn = Ie || Ne || Y == 1 || fe[Y - 2].dispose != 0 ? 1 : 2;
|
|
5392
5392
|
let Dt = 0, ce = 1e9;
|
|
5393
|
-
for (let
|
|
5394
|
-
var _e = new Uint8Array(le[Y - 1 -
|
|
5395
|
-
const rt = new Uint32Array(le[Y - 1 -
|
|
5396
|
-
let yt = ne, bt = pe, Rt = -1,
|
|
5393
|
+
for (let We = 0; We < sn; We++) {
|
|
5394
|
+
var _e = new Uint8Array(le[Y - 1 - We]);
|
|
5395
|
+
const rt = new Uint32Array(le[Y - 1 - We]);
|
|
5396
|
+
let yt = ne, bt = pe, Rt = -1, Xt = -1;
|
|
5397
5397
|
for (let xt = 0; xt < pe; xt++) for (let _t = 0; _t < ne; _t++)
|
|
5398
|
-
Me[
|
|
5399
|
-
Rt == -1 && (yt = bt = Rt =
|
|
5400
|
-
const
|
|
5401
|
-
|
|
5398
|
+
Me[ve = xt * ne + _t] != rt[ve] && (_t < yt && (yt = _t), _t > Rt && (Rt = _t), xt < bt && (bt = xt), xt > Xt && (Xt = xt));
|
|
5399
|
+
Rt == -1 && (yt = bt = Rt = Xt = 0), me && ((1 & yt) == 1 && yt--, (1 & bt) == 1 && bt--);
|
|
5400
|
+
const Zn = (Rt - yt + 1) * (Xt - bt + 1);
|
|
5401
|
+
Zn < ce && (ce = Zn, Dt = We, Ue = yt, Be = bt, Ke = Rt - yt + 1, nt = Xt - bt + 1);
|
|
5402
5402
|
}
|
|
5403
5403
|
_e = new Uint8Array(le[Y - 1 - Dt]), Dt == 1 && (fe[Y - 1].dispose = 2), Re = new Uint8Array(Ke * nt * 4), s(_e, ne, pe, Re, Ke, nt, -Ue, -Be, 0), St = s(Le, ne, pe, Re, Ke, nt, -Ue, -Be, 3) ? 1 : 0, St == 1 ? d(Le, ne, pe, Re, { x: Ue, y: Be, width: Ke, height: nt }) : s(Le, ne, pe, Re, Ke, nt, -Ue, -Be, 0);
|
|
5404
5404
|
} else Re = Le.slice(0);
|
|
@@ -5410,15 +5410,15 @@ const ze = function() {
|
|
|
5410
5410
|
fe[Y - 1].dispose = 1, Y - 1 != 0 && u(le, ne, pe, fe, Y - 1, Ke, me), u(le, ne, pe, fe, Y, Ke, me);
|
|
5411
5411
|
}
|
|
5412
5412
|
let et = 0;
|
|
5413
|
-
if (le.length != 1) for (var
|
|
5413
|
+
if (le.length != 1) for (var ve = 0; ve < fe.length; ve++) {
|
|
5414
5414
|
var tt;
|
|
5415
|
-
et += (tt = fe[
|
|
5415
|
+
et += (tt = fe[ve]).rect.width * tt.rect.height;
|
|
5416
5416
|
}
|
|
5417
5417
|
return fe;
|
|
5418
|
-
}(m, g,
|
|
5418
|
+
}(m, g, v, T, E, U), ae = {}, te = [], Q = [];
|
|
5419
5419
|
if (N != 0) {
|
|
5420
5420
|
const Fe = [];
|
|
5421
|
-
for (
|
|
5421
|
+
for ($ = 0; $ < z.length; $++) Fe.push(z[$].img.buffer);
|
|
5422
5422
|
const le = function(me) {
|
|
5423
5423
|
let Ie = 0;
|
|
5424
5424
|
for (var fe = 0; fe < me.length; fe++) Ie += me[fe].byteLength;
|
|
@@ -5426,145 +5426,145 @@ const ze = function() {
|
|
|
5426
5426
|
let Re = 0;
|
|
5427
5427
|
for (fe = 0; fe < me.length; fe++) {
|
|
5428
5428
|
const _e = new Uint8Array(me[fe]), et = _e.length;
|
|
5429
|
-
for (let
|
|
5430
|
-
let tt = _e[
|
|
5431
|
-
const Ue = _e[
|
|
5432
|
-
Ue == 0 && (tt = Le = Me = 0), Y[Re +
|
|
5429
|
+
for (let ve = 0; ve < et; ve += 4) {
|
|
5430
|
+
let tt = _e[ve], Le = _e[ve + 1], Me = _e[ve + 2];
|
|
5431
|
+
const Ue = _e[ve + 3];
|
|
5432
|
+
Ue == 0 && (tt = Le = Me = 0), Y[Re + ve] = tt, Y[Re + ve + 1] = Le, Y[Re + ve + 2] = Me, Y[Re + ve + 3] = Ue;
|
|
5433
5433
|
}
|
|
5434
5434
|
Re += et;
|
|
5435
5435
|
}
|
|
5436
5436
|
return Y.buffer;
|
|
5437
5437
|
}(Fe), ne = I(le, N);
|
|
5438
|
-
for (
|
|
5438
|
+
for ($ = 0; $ < ne.plte.length; $++) te.push(ne.plte[$].est.rgba);
|
|
5439
5439
|
let pe = 0;
|
|
5440
|
-
for (
|
|
5441
|
-
const Ne = (ue = z[
|
|
5440
|
+
for ($ = 0; $ < z.length; $++) {
|
|
5441
|
+
const Ne = (ue = z[$]).img.length;
|
|
5442
5442
|
var re = new Uint8Array(ne.inds.buffer, pe >> 2, Ne >> 2);
|
|
5443
5443
|
Q.push(re);
|
|
5444
5444
|
const me = new Uint8Array(ne.abuf, pe, Ne);
|
|
5445
5445
|
M && a(ue.img, ue.rect.width, ue.rect.height, te, me, re), ue.img.set(me), pe += Ne;
|
|
5446
5446
|
}
|
|
5447
|
-
} else for (
|
|
5448
|
-
var ue = z[
|
|
5447
|
+
} else for (P = 0; P < z.length; P++) {
|
|
5448
|
+
var ue = z[P];
|
|
5449
5449
|
const Fe = new Uint32Array(ue.img.buffer);
|
|
5450
5450
|
var we = ue.rect.width;
|
|
5451
|
-
for (Z = Fe.length, re = new Uint8Array(Z), Q.push(re),
|
|
5452
|
-
const le = Fe[
|
|
5453
|
-
if (
|
|
5454
|
-
else if (
|
|
5451
|
+
for (Z = Fe.length, re = new Uint8Array(Z), Q.push(re), $ = 0; $ < Z; $++) {
|
|
5452
|
+
const le = Fe[$];
|
|
5453
|
+
if ($ != 0 && le == Fe[$ - 1]) re[$] = re[$ - 1];
|
|
5454
|
+
else if ($ > we && le == Fe[$ - we]) re[$] = re[$ - we];
|
|
5455
5455
|
else {
|
|
5456
5456
|
let ne = ae[le];
|
|
5457
5457
|
if (ne == null && (ae[le] = ne = te.length, te.push(le), te.length >= 300)) break;
|
|
5458
|
-
re[
|
|
5458
|
+
re[$] = ne;
|
|
5459
5459
|
}
|
|
5460
5460
|
}
|
|
5461
5461
|
}
|
|
5462
5462
|
const ht = te.length;
|
|
5463
|
-
for (ht <= 256 && p == 0 && (V = ht <= 2 ? 1 : ht <= 4 ? 2 : ht <= 16 ? 4 : 8, V = Math.max(V, w)),
|
|
5464
|
-
(ue = z[
|
|
5463
|
+
for (ht <= 256 && p == 0 && (V = ht <= 2 ? 1 : ht <= 4 ? 2 : ht <= 16 ? 4 : 8, V = Math.max(V, w)), P = 0; P < z.length; P++) {
|
|
5464
|
+
(ue = z[P]).rect.x, ue.rect.y, we = ue.rect.width;
|
|
5465
5465
|
const Fe = ue.rect.height;
|
|
5466
5466
|
let le = ue.img;
|
|
5467
5467
|
new Uint32Array(le.buffer);
|
|
5468
5468
|
let ne = 4 * we, pe = 4;
|
|
5469
5469
|
if (ht <= 256 && p == 0) {
|
|
5470
5470
|
ne = Math.ceil(V * we / 8);
|
|
5471
|
-
var
|
|
5472
|
-
const Ne = Q[
|
|
5471
|
+
var Pe = new Uint8Array(ne * Fe);
|
|
5472
|
+
const Ne = Q[P];
|
|
5473
5473
|
for (let me = 0; me < Fe; me++) {
|
|
5474
|
-
|
|
5474
|
+
$ = me * ne;
|
|
5475
5475
|
const Ie = me * we;
|
|
5476
|
-
if (V == 8) for (var de = 0; de < we; de++)
|
|
5477
|
-
else if (V == 4) for (de = 0; de < we; de++)
|
|
5478
|
-
else if (V == 2) for (de = 0; de < we; de++)
|
|
5479
|
-
else if (V == 1) for (de = 0; de < we; de++)
|
|
5476
|
+
if (V == 8) for (var de = 0; de < we; de++) Pe[$ + de] = Ne[Ie + de];
|
|
5477
|
+
else if (V == 4) for (de = 0; de < we; de++) Pe[$ + (de >> 1)] |= Ne[Ie + de] << 4 - 4 * (1 & de);
|
|
5478
|
+
else if (V == 2) for (de = 0; de < we; de++) Pe[$ + (de >> 2)] |= Ne[Ie + de] << 6 - 2 * (3 & de);
|
|
5479
|
+
else if (V == 1) for (de = 0; de < we; de++) Pe[$ + (de >> 3)] |= Ne[Ie + de] << 7 - 1 * (7 & de);
|
|
5480
5480
|
}
|
|
5481
|
-
le =
|
|
5481
|
+
le = Pe, _ = 3, pe = 1;
|
|
5482
5482
|
} else if (S == 0 && z.length == 1) {
|
|
5483
|
-
|
|
5483
|
+
Pe = new Uint8Array(we * Fe * 3);
|
|
5484
5484
|
const Ne = we * Fe;
|
|
5485
|
-
for (
|
|
5486
|
-
const me = 3 *
|
|
5487
|
-
|
|
5485
|
+
for ($ = 0; $ < Ne; $++) {
|
|
5486
|
+
const me = 3 * $, Ie = 4 * $;
|
|
5487
|
+
Pe[me] = le[Ie], Pe[me + 1] = le[Ie + 1], Pe[me + 2] = le[Ie + 2];
|
|
5488
5488
|
}
|
|
5489
|
-
le =
|
|
5489
|
+
le = Pe, _ = 2, pe = 3, ne = 3 * we;
|
|
5490
5490
|
}
|
|
5491
5491
|
ue.img = le, ue.bpl = ne, ue.bpp = pe;
|
|
5492
5492
|
}
|
|
5493
5493
|
return { ctype: _, depth: V, plte: te, frames: z };
|
|
5494
5494
|
}
|
|
5495
|
-
function u(m, g,
|
|
5496
|
-
const U = Uint8Array, w = Uint32Array, p = new U(m[
|
|
5497
|
-
let
|
|
5495
|
+
function u(m, g, v, N, F, T, E) {
|
|
5496
|
+
const U = Uint8Array, w = Uint32Array, p = new U(m[F - 1]), M = new w(m[F - 1]), _ = F + 1 < m.length ? new U(m[F + 1]) : null, V = new U(m[F]), q = new w(V.buffer);
|
|
5497
|
+
let P = g, Z = v, $ = -1, S = -1;
|
|
5498
5498
|
for (let ae = 0; ae < T.height; ae++) for (let te = 0; te < T.width; te++) {
|
|
5499
5499
|
const Q = T.x + te, re = T.y + ae, ue = re * g + Q, we = q[ue];
|
|
5500
|
-
we == 0 || N[
|
|
5500
|
+
we == 0 || N[F - 1].dispose == 0 && M[ue] == we && (_ == null || _[4 * ue + 3] != 0) || (Q < P && (P = Q), Q > $ && ($ = Q), re < Z && (Z = re), re > S && (S = re));
|
|
5501
5501
|
}
|
|
5502
|
-
|
|
5503
|
-
const z = N[
|
|
5504
|
-
z.rect = T, z.blend = 1, z.img = new Uint8Array(T.width * T.height * 4), N[
|
|
5502
|
+
$ == -1 && (P = Z = $ = S = 0), E && ((1 & P) == 1 && P--, (1 & Z) == 1 && Z--), T = { x: P, y: Z, width: $ - P + 1, height: S - Z + 1 };
|
|
5503
|
+
const z = N[F];
|
|
5504
|
+
z.rect = T, z.blend = 1, z.img = new Uint8Array(T.width * T.height * 4), N[F - 1].dispose == 0 ? (s(p, g, v, z.img, T.width, T.height, -T.x, -T.y, 0), d(V, g, v, z.img, T)) : s(V, g, v, z.img, T.width, T.height, -T.x, -T.y, 0);
|
|
5505
5505
|
}
|
|
5506
|
-
function d(m, g,
|
|
5507
|
-
s(m, g,
|
|
5506
|
+
function d(m, g, v, N, F) {
|
|
5507
|
+
s(m, g, v, N, F.width, F.height, -F.x, -F.y, 2);
|
|
5508
5508
|
}
|
|
5509
|
-
function f(m, g,
|
|
5509
|
+
function f(m, g, v, N, F, T, E) {
|
|
5510
5510
|
const U = [];
|
|
5511
5511
|
let w, p = [0, 1, 2, 3, 4];
|
|
5512
|
-
T != -1 ? p = [T] : (g * N > 5e5 ||
|
|
5513
|
-
const M =
|
|
5512
|
+
T != -1 ? p = [T] : (g * N > 5e5 || v == 1) && (p = [0]), E && (w = { level: 0 });
|
|
5513
|
+
const M = Bs;
|
|
5514
5514
|
for (var _ = 0; _ < p.length; _++) {
|
|
5515
|
-
for (let
|
|
5516
|
-
U.push(M.deflate(
|
|
5515
|
+
for (let P = 0; P < g; P++) y(F, m, P, N, v, p[_]);
|
|
5516
|
+
U.push(M.deflate(F, w));
|
|
5517
5517
|
}
|
|
5518
5518
|
let V, q = 1e9;
|
|
5519
5519
|
for (_ = 0; _ < U.length; _++) U[_].length < q && (V = _, q = U[_].length);
|
|
5520
5520
|
return U[V];
|
|
5521
5521
|
}
|
|
5522
|
-
function y(m, g,
|
|
5523
|
-
const E =
|
|
5524
|
-
let U = E +
|
|
5522
|
+
function y(m, g, v, N, F, T) {
|
|
5523
|
+
const E = v * N;
|
|
5524
|
+
let U = E + v;
|
|
5525
5525
|
if (m[U] = T, U++, T == 0) if (N < 500) for (var w = 0; w < N; w++) m[U + w] = g[E + w];
|
|
5526
5526
|
else m.set(new Uint8Array(g.buffer, E, N), U);
|
|
5527
5527
|
else if (T == 1) {
|
|
5528
|
-
for (w = 0; w <
|
|
5529
|
-
for (w =
|
|
5530
|
-
} else if (
|
|
5531
|
-
for (w = 0; w <
|
|
5532
|
-
if (T == 2) for (w =
|
|
5533
|
-
if (T == 3) for (w =
|
|
5534
|
-
if (T == 4) for (w =
|
|
5528
|
+
for (w = 0; w < F; w++) m[U + w] = g[E + w];
|
|
5529
|
+
for (w = F; w < N; w++) m[U + w] = g[E + w] - g[E + w - F] + 256 & 255;
|
|
5530
|
+
} else if (v == 0) {
|
|
5531
|
+
for (w = 0; w < F; w++) m[U + w] = g[E + w];
|
|
5532
|
+
if (T == 2) for (w = F; w < N; w++) m[U + w] = g[E + w];
|
|
5533
|
+
if (T == 3) for (w = F; w < N; w++) m[U + w] = g[E + w] - (g[E + w - F] >> 1) + 256 & 255;
|
|
5534
|
+
if (T == 4) for (w = F; w < N; w++) m[U + w] = g[E + w] - t(g[E + w - F], 0, 0) + 256 & 255;
|
|
5535
5535
|
} else {
|
|
5536
5536
|
if (T == 2) for (w = 0; w < N; w++) m[U + w] = g[E + w] + 256 - g[E + w - N] & 255;
|
|
5537
5537
|
if (T == 3) {
|
|
5538
|
-
for (w = 0; w <
|
|
5539
|
-
for (w =
|
|
5538
|
+
for (w = 0; w < F; w++) m[U + w] = g[E + w] + 256 - (g[E + w - N] >> 1) & 255;
|
|
5539
|
+
for (w = F; w < N; w++) m[U + w] = g[E + w] + 256 - (g[E + w - N] + g[E + w - F] >> 1) & 255;
|
|
5540
5540
|
}
|
|
5541
5541
|
if (T == 4) {
|
|
5542
|
-
for (w = 0; w <
|
|
5543
|
-
for (w =
|
|
5542
|
+
for (w = 0; w < F; w++) m[U + w] = g[E + w] + 256 - t(0, g[E + w - N], 0) & 255;
|
|
5543
|
+
for (w = F; w < N; w++) m[U + w] = g[E + w] + 256 - t(g[E + w - F], g[E + w - N], g[E + w - F - N]) & 255;
|
|
5544
5544
|
}
|
|
5545
5545
|
}
|
|
5546
5546
|
}
|
|
5547
5547
|
function I(m, g) {
|
|
5548
|
-
const
|
|
5548
|
+
const v = new Uint8Array(m), N = v.slice(0), F = new Uint32Array(N.buffer), T = L(N, g), E = T[0], U = T[1], w = v.length, p = new Uint8Array(w >> 2);
|
|
5549
5549
|
let M;
|
|
5550
|
-
if (
|
|
5551
|
-
M = C(E, V =
|
|
5550
|
+
if (v.length < 2e7) for (var _ = 0; _ < w; _ += 4)
|
|
5551
|
+
M = C(E, V = v[_] * (1 / 255), q = v[_ + 1] * (1 / 255), P = v[_ + 2] * (1 / 255), Z = v[_ + 3] * (1 / 255)), p[_ >> 2] = M.ind, F[_ >> 2] = M.est.rgba;
|
|
5552
5552
|
else for (_ = 0; _ < w; _ += 4) {
|
|
5553
|
-
var V =
|
|
5554
|
-
for (M = E; M.left; ) M = R(M.est, V, q,
|
|
5555
|
-
p[_ >> 2] = M.ind,
|
|
5553
|
+
var V = v[_] * 0.00392156862745098, q = v[_ + 1] * (1 / 255), P = v[_ + 2] * (1 / 255), Z = v[_ + 3] * (1 / 255);
|
|
5554
|
+
for (M = E; M.left; ) M = R(M.est, V, q, P, Z) <= 0 ? M.left : M.right;
|
|
5555
|
+
p[_ >> 2] = M.ind, F[_ >> 2] = M.est.rgba;
|
|
5556
5556
|
}
|
|
5557
5557
|
return { abuf: N.buffer, inds: p, plte: U };
|
|
5558
5558
|
}
|
|
5559
|
-
function L(m, g,
|
|
5560
|
-
|
|
5561
|
-
const N = new Uint32Array(m.buffer),
|
|
5562
|
-
|
|
5563
|
-
const T = [
|
|
5559
|
+
function L(m, g, v) {
|
|
5560
|
+
v == null && (v = 1e-4);
|
|
5561
|
+
const N = new Uint32Array(m.buffer), F = { i0: 0, i1: m.length, bst: null, est: null, tdst: 0, left: null, right: null };
|
|
5562
|
+
F.bst = x(m, F.i0, F.i1), F.est = b(F.bst);
|
|
5563
|
+
const T = [F];
|
|
5564
5564
|
for (; T.length < g; ) {
|
|
5565
5565
|
let U = 0, w = 0;
|
|
5566
5566
|
for (var E = 0; E < T.length; E++) T[E].est.L > U && (U = T[E].est.L, w = E);
|
|
5567
|
-
if (U <
|
|
5567
|
+
if (U < v) break;
|
|
5568
5568
|
const p = T[w], M = O(m, N, p.i0, p.i1, p.est.e, p.est.eMq255);
|
|
5569
5569
|
if (p.i0 >= M || p.i1 <= M) {
|
|
5570
5570
|
p.est.L = 0;
|
|
@@ -5578,68 +5578,68 @@ const ze = function() {
|
|
|
5578
5578
|
V.est = b(V.bst), p.left = _, p.right = V, T[w] = _, T.push(V);
|
|
5579
5579
|
}
|
|
5580
5580
|
for (T.sort((U, w) => w.bst.N - U.bst.N), E = 0; E < T.length; E++) T[E].ind = E;
|
|
5581
|
-
return [
|
|
5582
|
-
}
|
|
5583
|
-
function C(m, g,
|
|
5584
|
-
if (m.left == null) return m.tdst = function(_, V, q,
|
|
5585
|
-
const
|
|
5586
|
-
return
|
|
5587
|
-
}(m.est.q, g,
|
|
5588
|
-
const T = R(m.est, g,
|
|
5581
|
+
return [F, T];
|
|
5582
|
+
}
|
|
5583
|
+
function C(m, g, v, N, F) {
|
|
5584
|
+
if (m.left == null) return m.tdst = function(_, V, q, P, Z) {
|
|
5585
|
+
const $ = V - _[0], S = q - _[1], z = P - _[2], ae = Z - _[3];
|
|
5586
|
+
return $ * $ + S * S + z * z + ae * ae;
|
|
5587
|
+
}(m.est.q, g, v, N, F), m;
|
|
5588
|
+
const T = R(m.est, g, v, N, F);
|
|
5589
5589
|
let E = m.left, U = m.right;
|
|
5590
5590
|
T > 0 && (E = m.right, U = m.left);
|
|
5591
|
-
const w = C(E, g,
|
|
5591
|
+
const w = C(E, g, v, N, F);
|
|
5592
5592
|
if (w.tdst <= T * T) return w;
|
|
5593
|
-
const p = C(U, g,
|
|
5593
|
+
const p = C(U, g, v, N, F);
|
|
5594
5594
|
return p.tdst < w.tdst ? p : w;
|
|
5595
5595
|
}
|
|
5596
|
-
function R(m, g,
|
|
5596
|
+
function R(m, g, v, N, F) {
|
|
5597
5597
|
const { e: T } = m;
|
|
5598
|
-
return T[0] * g + T[1] *
|
|
5598
|
+
return T[0] * g + T[1] * v + T[2] * N + T[3] * F - m.eMq;
|
|
5599
5599
|
}
|
|
5600
|
-
function O(m, g,
|
|
5601
|
-
for (N -= 4;
|
|
5602
|
-
for (;
|
|
5603
|
-
for (;
|
|
5604
|
-
if (
|
|
5605
|
-
const E = g[
|
|
5606
|
-
g[
|
|
5600
|
+
function O(m, g, v, N, F, T) {
|
|
5601
|
+
for (N -= 4; v < N; ) {
|
|
5602
|
+
for (; k(m, v, F) <= T; ) v += 4;
|
|
5603
|
+
for (; k(m, N, F) > T; ) N -= 4;
|
|
5604
|
+
if (v >= N) break;
|
|
5605
|
+
const E = g[v >> 2];
|
|
5606
|
+
g[v >> 2] = g[N >> 2], g[N >> 2] = E, v += 4, N -= 4;
|
|
5607
5607
|
}
|
|
5608
|
-
for (;
|
|
5609
|
-
return
|
|
5608
|
+
for (; k(m, v, F) > T; ) v -= 4;
|
|
5609
|
+
return v + 4;
|
|
5610
5610
|
}
|
|
5611
|
-
function
|
|
5612
|
-
return m[g] *
|
|
5611
|
+
function k(m, g, v) {
|
|
5612
|
+
return m[g] * v[0] + m[g + 1] * v[1] + m[g + 2] * v[2] + m[g + 3] * v[3];
|
|
5613
5613
|
}
|
|
5614
|
-
function x(m, g,
|
|
5615
|
-
const N = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
|
5616
|
-
for (let E = g; E <
|
|
5614
|
+
function x(m, g, v) {
|
|
5615
|
+
const N = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], F = [0, 0, 0, 0], T = v - g >> 2;
|
|
5616
|
+
for (let E = g; E < v; E += 4) {
|
|
5617
5617
|
const U = m[E] * 0.00392156862745098, w = m[E + 1] * (1 / 255), p = m[E + 2] * (1 / 255), M = m[E + 3] * (1 / 255);
|
|
5618
|
-
|
|
5618
|
+
F[0] += U, F[1] += w, F[2] += p, F[3] += M, N[0] += U * U, N[1] += U * w, N[2] += U * p, N[3] += U * M, N[5] += w * w, N[6] += w * p, N[7] += w * M, N[10] += p * p, N[11] += p * M, N[15] += M * M;
|
|
5619
5619
|
}
|
|
5620
|
-
return N[4] = N[1], N[8] = N[2], N[9] = N[6], N[12] = N[3], N[13] = N[7], N[14] = N[11], { R: N, m:
|
|
5620
|
+
return N[4] = N[1], N[8] = N[2], N[9] = N[6], N[12] = N[3], N[13] = N[7], N[14] = N[11], { R: N, m: F, N: T };
|
|
5621
5621
|
}
|
|
5622
5622
|
function b(m) {
|
|
5623
|
-
const { R: g } = m, { m:
|
|
5624
|
-
let V = [Math.random(), Math.random(), Math.random(), Math.random()], q = 0,
|
|
5625
|
-
if (N != 0) for (let
|
|
5626
|
-
const Z = [
|
|
5623
|
+
const { R: g } = m, { m: v } = m, { N } = m, F = v[0], T = v[1], E = v[2], U = v[3], w = N == 0 ? 0 : 1 / N, p = [g[0] - F * F * w, g[1] - F * T * w, g[2] - F * E * w, g[3] - F * U * w, g[4] - T * F * w, g[5] - T * T * w, g[6] - T * E * w, g[7] - T * U * w, g[8] - E * F * w, g[9] - E * T * w, g[10] - E * E * w, g[11] - E * U * w, g[12] - U * F * w, g[13] - U * T * w, g[14] - U * E * w, g[15] - U * U * w], M = p, _ = B;
|
|
5624
|
+
let V = [Math.random(), Math.random(), Math.random(), Math.random()], q = 0, P = 0;
|
|
5625
|
+
if (N != 0) for (let $ = 0; $ < 16 && (V = _.multVec(M, V), P = Math.sqrt(_.dot(V, V)), V = _.sml(1 / P, V), !($ != 0 && Math.abs(P - q) < 1e-9)); $++) q = P;
|
|
5626
|
+
const Z = [F * w, T * w, E * w, U * w];
|
|
5627
5627
|
return { Cov: p, q: Z, e: V, L: q, eMq255: _.dot(_.sml(255, Z), V), eMq: _.dot(V, Z), rgba: (Math.round(255 * Z[3]) << 24 | Math.round(255 * Z[2]) << 16 | Math.round(255 * Z[1]) << 8 | Math.round(255 * Z[0]) << 0) >>> 0 };
|
|
5628
5628
|
}
|
|
5629
5629
|
var B = { multVec: (m, g) => [m[0] * g[0] + m[1] * g[1] + m[2] * g[2] + m[3] * g[3], m[4] * g[0] + m[5] * g[1] + m[6] * g[2] + m[7] * g[3], m[8] * g[0] + m[9] * g[1] + m[10] * g[2] + m[11] * g[3], m[12] * g[0] + m[13] * g[1] + m[14] * g[2] + m[15] * g[3]], dot: (m, g) => m[0] * g[0] + m[1] * g[1] + m[2] * g[2] + m[3] * g[3], sml: (m, g) => [m * g[0], m * g[1], m * g[2], m * g[3]] };
|
|
5630
|
-
ze.encode = function(g,
|
|
5631
|
-
|
|
5632
|
-
const w = l(g,
|
|
5633
|
-
return h(w, -1), c(w,
|
|
5634
|
-
}, ze.encodeLL = function(g,
|
|
5635
|
-
const p = { ctype: 0 + (
|
|
5636
|
-
for (let V = 0; V < g.length; V++) p.frames.push({ rect: { x: 0, y: 0, width:
|
|
5637
|
-
return h(p, 0, !0), c(p,
|
|
5630
|
+
ze.encode = function(g, v, N, F, T, E, U) {
|
|
5631
|
+
F == null && (F = 0), U == null && (U = !1);
|
|
5632
|
+
const w = l(g, v, N, F, [!1, !1, !1, 0, U, !1]);
|
|
5633
|
+
return h(w, -1), c(w, v, N, T, E);
|
|
5634
|
+
}, ze.encodeLL = function(g, v, N, F, T, E, U, w) {
|
|
5635
|
+
const p = { ctype: 0 + (F == 1 ? 0 : 2) + (T == 0 ? 0 : 4), depth: E, frames: [] }, M = (F + T) * E, _ = M * v;
|
|
5636
|
+
for (let V = 0; V < g.length; V++) p.frames.push({ rect: { x: 0, y: 0, width: v, height: N }, img: new Uint8Array(g[V]), blend: 0, dispose: 1, bpp: Math.ceil(M / 8), bpl: Math.ceil(_ / 8) });
|
|
5637
|
+
return h(p, 0, !0), c(p, v, N, U, w);
|
|
5638
5638
|
}, ze.encode.compress = l, ze.encode.dither = a, ze.quantize = I, ze.quantize.getKDtree = L, ze.quantize.getNearest = C;
|
|
5639
5639
|
})();
|
|
5640
|
-
const
|
|
5640
|
+
const Vr = { toArrayBuffer(s, e) {
|
|
5641
5641
|
const t = s.width, n = s.height, r = t << 2, i = s.getContext("2d").getImageData(0, 0, t, n), o = new Uint32Array(i.data.buffer), a = (32 * t + 31) / 32 << 2, c = a * n, h = 122 + c, l = new ArrayBuffer(h), u = new DataView(l), d = 1 << 20;
|
|
5642
|
-
let f, y, I, L, C = d, R = 0, O = 0,
|
|
5642
|
+
let f, y, I, L, C = d, R = 0, O = 0, k = 0;
|
|
5643
5643
|
function x(m) {
|
|
5644
5644
|
u.setUint16(O, m, !0), O += 2;
|
|
5645
5645
|
}
|
|
@@ -5651,19 +5651,19 @@ const Rr = { toArrayBuffer(s, e) {
|
|
|
5651
5651
|
}
|
|
5652
5652
|
x(19778), b(h), B(4), b(122), b(108), b(t), b(-n >>> 0), x(1), x(32), b(3), b(c), b(2835), b(2835), B(8), b(16711680), b(65280), b(255), b(4278190080), b(1466527264), function m() {
|
|
5653
5653
|
for (; R < n && C > 0; ) {
|
|
5654
|
-
for (L = 122 + R * a, f = 0; f < r; ) C--, y = o[
|
|
5654
|
+
for (L = 122 + R * a, f = 0; f < r; ) C--, y = o[k++], I = y >>> 24, u.setUint32(L + f, y << 8 | I), f += 4;
|
|
5655
5655
|
R++;
|
|
5656
5656
|
}
|
|
5657
|
-
|
|
5657
|
+
k < o.length ? (C = d, setTimeout(m, Vr._dly)) : e(l);
|
|
5658
5658
|
}();
|
|
5659
5659
|
}, toBlob(s, e) {
|
|
5660
5660
|
this.toArrayBuffer(s, (t) => {
|
|
5661
5661
|
e(new Blob([t], { type: "image/bmp" }));
|
|
5662
5662
|
});
|
|
5663
5663
|
}, _dly: 9 };
|
|
5664
|
-
var Ve = { CHROME: "CHROME", FIREFOX: "FIREFOX", DESKTOP_SAFARI: "DESKTOP_SAFARI", IE: "IE", IOS: "IOS", ETC: "ETC" },
|
|
5665
|
-
const
|
|
5666
|
-
function
|
|
5664
|
+
var Ve = { CHROME: "CHROME", FIREFOX: "FIREFOX", DESKTOP_SAFARI: "DESKTOP_SAFARI", IE: "IE", IOS: "IOS", ETC: "ETC" }, Os = { [Ve.CHROME]: 16384, [Ve.FIREFOX]: 11180, [Ve.DESKTOP_SAFARI]: 16384, [Ve.IE]: 8192, [Ve.IOS]: 4096, [Ve.ETC]: 8192 };
|
|
5665
|
+
const Wn = typeof window < "u", Hr = typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope, wn = Wn && window.cordova && window.cordova.require && window.cordova.require("cordova/modulemapper"), Ss = (Wn || Hr) && (wn && wn.getOriginalSymbol(window, "File") || typeof File < "u" && File), $r = (Wn || Hr) && (wn && wn.getOriginalSymbol(window, "FileReader") || typeof FileReader < "u" && FileReader);
|
|
5666
|
+
function jn(s, e, t = Date.now()) {
|
|
5667
5667
|
return new Promise((n) => {
|
|
5668
5668
|
const r = s.split(","), i = r[0].match(/:(.*?);/)[1], o = globalThis.atob(r[1]);
|
|
5669
5669
|
let a = o.length;
|
|
@@ -5673,13 +5673,13 @@ function Wn(s, e, t = Date.now()) {
|
|
|
5673
5673
|
h.name = e, h.lastModified = t, n(h);
|
|
5674
5674
|
});
|
|
5675
5675
|
}
|
|
5676
|
-
function
|
|
5676
|
+
function Pr(s) {
|
|
5677
5677
|
return new Promise((e, t) => {
|
|
5678
|
-
const n = new
|
|
5678
|
+
const n = new $r();
|
|
5679
5679
|
n.onload = () => e(n.result), n.onerror = (r) => t(r), n.readAsDataURL(s);
|
|
5680
5680
|
});
|
|
5681
5681
|
}
|
|
5682
|
-
function
|
|
5682
|
+
function Wr(s) {
|
|
5683
5683
|
return new Promise((e, t) => {
|
|
5684
5684
|
const n = new Image();
|
|
5685
5685
|
n.onload = () => e(n), n.onerror = (r) => t(r), n.src = s;
|
|
@@ -5691,8 +5691,8 @@ function Ut() {
|
|
|
5691
5691
|
const { userAgent: e } = navigator;
|
|
5692
5692
|
return /Chrom(e|ium)/i.test(e) ? s = Ve.CHROME : /iP(ad|od|hone)/i.test(e) && /WebKit/i.test(e) ? s = Ve.IOS : /Safari/i.test(e) ? s = Ve.DESKTOP_SAFARI : /Firefox/i.test(e) ? s = Ve.FIREFOX : (/MSIE/i.test(e) || document.documentMode) && (s = Ve.IE), Ut.cachedResult = s, Ut.cachedResult;
|
|
5693
5693
|
}
|
|
5694
|
-
function
|
|
5695
|
-
const t = Ut(), n =
|
|
5694
|
+
function jr(s, e) {
|
|
5695
|
+
const t = Ut(), n = Os[t];
|
|
5696
5696
|
let r = s, i = e, o = r * i;
|
|
5697
5697
|
const a = r > i ? i / r : r / i;
|
|
5698
5698
|
for (; o > n * n; ) {
|
|
@@ -5701,7 +5701,7 @@ function Wr(s, e) {
|
|
|
5701
5701
|
}
|
|
5702
5702
|
return { width: r, height: i };
|
|
5703
5703
|
}
|
|
5704
|
-
function
|
|
5704
|
+
function Fn(s, e) {
|
|
5705
5705
|
let t, n;
|
|
5706
5706
|
try {
|
|
5707
5707
|
if (t = new OffscreenCanvas(s, e), n = t.getContext("2d"), n === null) throw new Error("getContext of OffscreenCanvas returns null");
|
|
@@ -5710,19 +5710,19 @@ function vn(s, e) {
|
|
|
5710
5710
|
}
|
|
5711
5711
|
return t.width = s, t.height = e, [t, n];
|
|
5712
5712
|
}
|
|
5713
|
-
function
|
|
5714
|
-
const { width: t, height: n } =
|
|
5713
|
+
function Zr(s, e) {
|
|
5714
|
+
const { width: t, height: n } = jr(s.width, s.height), [r, i] = Fn(t, n);
|
|
5715
5715
|
return e && /jpe?g/.test(e) && (i.fillStyle = "white", i.fillRect(0, 0, r.width, r.height)), i.drawImage(s, 0, 0, r.width, r.height), r;
|
|
5716
5716
|
}
|
|
5717
|
-
function
|
|
5718
|
-
return
|
|
5717
|
+
function un() {
|
|
5718
|
+
return un.cachedResult !== void 0 || (un.cachedResult = ["iPad Simulator", "iPhone Simulator", "iPod Simulator", "iPad", "iPhone", "iPod"].includes(navigator.platform) || navigator.userAgent.includes("Mac") && typeof document < "u" && "ontouchend" in document), un.cachedResult;
|
|
5719
5719
|
}
|
|
5720
|
-
function
|
|
5720
|
+
function yn(s, e = {}) {
|
|
5721
5721
|
return new Promise(function(t, n) {
|
|
5722
5722
|
let r, i;
|
|
5723
5723
|
var o = function() {
|
|
5724
5724
|
try {
|
|
5725
|
-
return i =
|
|
5725
|
+
return i = Zr(r, e.fileType || s.type), t([r, i]);
|
|
5726
5726
|
} catch (c) {
|
|
5727
5727
|
return n(c);
|
|
5728
5728
|
}
|
|
@@ -5737,9 +5737,9 @@ function mn(s, e = {}) {
|
|
|
5737
5737
|
};
|
|
5738
5738
|
try {
|
|
5739
5739
|
let l;
|
|
5740
|
-
return
|
|
5740
|
+
return Pr(s).then(function(u) {
|
|
5741
5741
|
try {
|
|
5742
|
-
return l = u,
|
|
5742
|
+
return l = u, Wr(l).then(function(d) {
|
|
5743
5743
|
try {
|
|
5744
5744
|
return r = d, function() {
|
|
5745
5745
|
try {
|
|
@@ -5764,7 +5764,7 @@ function mn(s, e = {}) {
|
|
|
5764
5764
|
}
|
|
5765
5765
|
};
|
|
5766
5766
|
try {
|
|
5767
|
-
if (
|
|
5767
|
+
if (un() || [Ve.DESKTOP_SAFARI, Ve.MOBILE_SAFARI].includes(Ut())) throw new Error("Skip createImageBitmap on IOS and Safari");
|
|
5768
5768
|
return createImageBitmap(s).then(function(c) {
|
|
5769
5769
|
try {
|
|
5770
5770
|
return r = c, o();
|
|
@@ -5777,7 +5777,7 @@ function mn(s, e = {}) {
|
|
|
5777
5777
|
}
|
|
5778
5778
|
});
|
|
5779
5779
|
}
|
|
5780
|
-
function
|
|
5780
|
+
function bn(s, e, t, n, r = 1) {
|
|
5781
5781
|
return new Promise(function(i, o) {
|
|
5782
5782
|
let a;
|
|
5783
5783
|
if (e === "image/png") {
|
|
@@ -5788,7 +5788,7 @@ function gn(s, e, t, n, r = 1) {
|
|
|
5788
5788
|
let h = function() {
|
|
5789
5789
|
return c.call(this);
|
|
5790
5790
|
};
|
|
5791
|
-
if (e === "image/bmp") return new Promise((l) =>
|
|
5791
|
+
if (e === "image/bmp") return new Promise((l) => Vr.toBlob(s, l)).then((function(l) {
|
|
5792
5792
|
try {
|
|
5793
5793
|
return a = l, a.name = t, a.lastModified = n, h.call(this);
|
|
5794
5794
|
} catch (u) {
|
|
@@ -5808,7 +5808,7 @@ function gn(s, e, t, n, r = 1) {
|
|
|
5808
5808
|
}).bind(this), o);
|
|
5809
5809
|
{
|
|
5810
5810
|
let u;
|
|
5811
|
-
return u = s.toDataURL(e, r),
|
|
5811
|
+
return u = s.toDataURL(e, r), jn(u, t, n).then((function(d) {
|
|
5812
5812
|
try {
|
|
5813
5813
|
return a = d, l.call(this);
|
|
5814
5814
|
} catch (f) {
|
|
@@ -5829,13 +5829,13 @@ function lt(s) {
|
|
|
5829
5829
|
function Mt() {
|
|
5830
5830
|
return new Promise(function(s, e) {
|
|
5831
5831
|
let t, n, r, i;
|
|
5832
|
-
return Mt.cachedResult !== void 0 ? s(Mt.cachedResult) :
|
|
5832
|
+
return Mt.cachedResult !== void 0 ? s(Mt.cachedResult) : jn("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==", "test.jpg", Date.now()).then(function(o) {
|
|
5833
5833
|
try {
|
|
5834
|
-
return t = o,
|
|
5834
|
+
return t = o, yn(t).then(function(a) {
|
|
5835
5835
|
try {
|
|
5836
|
-
return n = a[1],
|
|
5836
|
+
return n = a[1], bn(n, t.type, t.name, t.lastModified).then(function(c) {
|
|
5837
5837
|
try {
|
|
5838
|
-
return r = c, lt(n),
|
|
5838
|
+
return r = c, lt(n), yn(r).then(function(h) {
|
|
5839
5839
|
try {
|
|
5840
5840
|
return i = h[0], Mt.cachedResult = i.width === 1 && i.height === 2, s(Mt.cachedResult);
|
|
5841
5841
|
} catch (l) {
|
|
@@ -5856,9 +5856,9 @@ function Mt() {
|
|
|
5856
5856
|
}, e);
|
|
5857
5857
|
});
|
|
5858
5858
|
}
|
|
5859
|
-
function
|
|
5859
|
+
function qr(s) {
|
|
5860
5860
|
return new Promise((e, t) => {
|
|
5861
|
-
const n = new
|
|
5861
|
+
const n = new $r();
|
|
5862
5862
|
n.onload = (r) => {
|
|
5863
5863
|
const i = new DataView(r.target.result);
|
|
5864
5864
|
if (i.getUint16(0, !1) != 65496) return e(-2);
|
|
@@ -5883,13 +5883,13 @@ function jr(s) {
|
|
|
5883
5883
|
}, n.onerror = (r) => t(r), n.readAsArrayBuffer(s);
|
|
5884
5884
|
});
|
|
5885
5885
|
}
|
|
5886
|
-
function
|
|
5886
|
+
function Kr(s, e) {
|
|
5887
5887
|
const { width: t } = s, { height: n } = s, { maxWidthOrHeight: r } = e;
|
|
5888
5888
|
let i, o = s;
|
|
5889
|
-
return isFinite(r) && (t > r || n > r) && ([o, i] =
|
|
5889
|
+
return isFinite(r) && (t > r || n > r) && ([o, i] = Fn(t, n), t > n ? (o.width = r, o.height = n / t * r) : (o.width = t / n * r, o.height = r), i.drawImage(s, 0, 0, o.width, o.height), lt(s)), o;
|
|
5890
5890
|
}
|
|
5891
|
-
function
|
|
5892
|
-
const { width: t } = s, { height: n } = s, [r, i] =
|
|
5891
|
+
function zr(s, e) {
|
|
5892
|
+
const { width: t } = s, { height: n } = s, [r, i] = Fn(t, n);
|
|
5893
5893
|
switch (e > 4 && e < 9 ? (r.width = n, r.height = t) : (r.width = t, r.height = n), e) {
|
|
5894
5894
|
case 2:
|
|
5895
5895
|
i.transform(-1, 0, 0, 1, t, 0);
|
|
@@ -5914,22 +5914,22 @@ function qr(s, e) {
|
|
|
5914
5914
|
}
|
|
5915
5915
|
return i.drawImage(s, 0, 0, t, n), lt(s), r;
|
|
5916
5916
|
}
|
|
5917
|
-
function
|
|
5917
|
+
function mr(s, e, t = 0) {
|
|
5918
5918
|
return new Promise(function(n, r) {
|
|
5919
|
-
let i, o, a, c, h, l, u, d, f, y, I, L, C, R, O,
|
|
5919
|
+
let i, o, a, c, h, l, u, d, f, y, I, L, C, R, O, k, x, b, B, m;
|
|
5920
5920
|
function g(N = 5) {
|
|
5921
5921
|
if (e.signal && e.signal.aborted) throw e.signal.reason;
|
|
5922
5922
|
i += N, e.onProgress(Math.min(i, 100));
|
|
5923
5923
|
}
|
|
5924
|
-
function
|
|
5924
|
+
function v(N) {
|
|
5925
5925
|
if (e.signal && e.signal.aborted) throw e.signal.reason;
|
|
5926
5926
|
i = Math.min(Math.max(N, i), 100), e.onProgress(i);
|
|
5927
5927
|
}
|
|
5928
|
-
return i = t, o = e.maxIteration || 10, a = 1024 * e.maxSizeMB * 1024, g(),
|
|
5928
|
+
return i = t, o = e.maxIteration || 10, a = 1024 * e.maxSizeMB * 1024, g(), yn(s, e).then((function(N) {
|
|
5929
5929
|
try {
|
|
5930
|
-
return [, c] = N, g(), h =
|
|
5930
|
+
return [, c] = N, g(), h = Kr(c, e), g(), new Promise(function(F, T) {
|
|
5931
5931
|
var E;
|
|
5932
|
-
if (!(E = e.exifOrientation)) return
|
|
5932
|
+
if (!(E = e.exifOrientation)) return qr(s).then((function(w) {
|
|
5933
5933
|
try {
|
|
5934
5934
|
return E = w, U.call(this);
|
|
5935
5935
|
} catch (p) {
|
|
@@ -5937,22 +5937,22 @@ function fr(s, e, t = 0) {
|
|
|
5937
5937
|
}
|
|
5938
5938
|
}).bind(this), T);
|
|
5939
5939
|
function U() {
|
|
5940
|
-
return
|
|
5940
|
+
return F(E);
|
|
5941
5941
|
}
|
|
5942
5942
|
return U.call(this);
|
|
5943
|
-
}).then((function(
|
|
5943
|
+
}).then((function(F) {
|
|
5944
5944
|
try {
|
|
5945
|
-
return l =
|
|
5945
|
+
return l = F, g(), Mt().then((function(T) {
|
|
5946
5946
|
try {
|
|
5947
|
-
return u = T ? h :
|
|
5947
|
+
return u = T ? h : zr(h, l), g(), d = e.initialQuality || 1, f = e.fileType || s.type, bn(u, f, s.name, s.lastModified, d).then((function(E) {
|
|
5948
5948
|
try {
|
|
5949
5949
|
{
|
|
5950
5950
|
let w = function() {
|
|
5951
5951
|
if (o-- && (O > a || O > C)) {
|
|
5952
5952
|
let M, _;
|
|
5953
|
-
return M = m ? 0.95 * B.width : B.width, _ = m ? 0.95 * B.height : B.height, [x, b] =
|
|
5953
|
+
return M = m ? 0.95 * B.width : B.width, _ = m ? 0.95 * B.height : B.height, [x, b] = Fn(M, _), b.drawImage(B, 0, 0, M, _), d *= f === "image/png" ? 0.85 : 0.95, bn(x, f, s.name, s.lastModified, d).then(function(V) {
|
|
5954
5954
|
try {
|
|
5955
|
-
return
|
|
5955
|
+
return k = V, lt(B), B = x, O = k.size, v(Math.min(99, Math.floor((R - O) / (R - a) * 100))), w;
|
|
5956
5956
|
} catch (q) {
|
|
5957
5957
|
return r(q);
|
|
5958
5958
|
}
|
|
@@ -5960,9 +5960,9 @@ function fr(s, e, t = 0) {
|
|
|
5960
5960
|
}
|
|
5961
5961
|
return [1];
|
|
5962
5962
|
}, p = function() {
|
|
5963
|
-
return lt(B), lt(x), lt(h), lt(u), lt(c),
|
|
5963
|
+
return lt(B), lt(x), lt(h), lt(u), lt(c), v(100), n(k);
|
|
5964
5964
|
};
|
|
5965
|
-
if (y = E, g(), I = y.size > a, L = y.size > s.size, !I && !L) return
|
|
5965
|
+
if (y = E, g(), I = y.size > a, L = y.size > s.size, !I && !L) return v(100), n(y);
|
|
5966
5966
|
var U;
|
|
5967
5967
|
return C = s.size, R = y.size, O = R, B = u, m = !e.alwaysKeepResolution && I, (U = (function(M) {
|
|
5968
5968
|
for (; M; ) {
|
|
@@ -5990,13 +5990,13 @@ function fr(s, e, t = 0) {
|
|
|
5990
5990
|
return r(T);
|
|
5991
5991
|
}
|
|
5992
5992
|
}).bind(this), r);
|
|
5993
|
-
} catch (
|
|
5994
|
-
return r(
|
|
5993
|
+
} catch (F) {
|
|
5994
|
+
return r(F);
|
|
5995
5995
|
}
|
|
5996
5996
|
}).bind(this), r);
|
|
5997
5997
|
});
|
|
5998
5998
|
}
|
|
5999
|
-
const
|
|
5999
|
+
const Ds = `
|
|
6000
6000
|
let scriptImported = false
|
|
6001
6001
|
self.addEventListener('message', async (e) => {
|
|
6002
6002
|
const { file, id, imageCompressionLibUrl, options } = e.data
|
|
@@ -6016,14 +6016,14 @@ self.addEventListener('message', async (e) => {
|
|
|
6016
6016
|
}
|
|
6017
6017
|
})
|
|
6018
6018
|
`;
|
|
6019
|
-
let
|
|
6020
|
-
function
|
|
6019
|
+
let On;
|
|
6020
|
+
function Rs(s, e) {
|
|
6021
6021
|
return new Promise((t, n) => {
|
|
6022
|
-
|
|
6022
|
+
On || (On = function(o) {
|
|
6023
6023
|
const a = [];
|
|
6024
6024
|
return a.push(o), URL.createObjectURL(new Blob(a));
|
|
6025
|
-
}(
|
|
6026
|
-
const r = new Worker(
|
|
6025
|
+
}(Ds));
|
|
6026
|
+
const r = new Worker(On);
|
|
6027
6027
|
r.addEventListener("message", function(o) {
|
|
6028
6028
|
if (e.signal && e.signal.aborted) r.terminate();
|
|
6029
6029
|
else if (o.data.progress === void 0) {
|
|
@@ -6040,9 +6040,9 @@ function Oe(s, e) {
|
|
|
6040
6040
|
let r, i, o, a, c, h;
|
|
6041
6041
|
if (r = { ...e }, o = 0, { onProgress: a } = r, r.maxSizeMB = r.maxSizeMB || Number.POSITIVE_INFINITY, c = typeof r.useWebWorker != "boolean" || r.useWebWorker, delete r.useWebWorker, r.onProgress = (f) => {
|
|
6042
6042
|
o = f, typeof a == "function" && a(o);
|
|
6043
|
-
}, !(s instanceof Blob || s instanceof
|
|
6043
|
+
}, !(s instanceof Blob || s instanceof Ss)) return n(new Error("The file given is not an instance of Blob or File"));
|
|
6044
6044
|
if (!/^image/.test(s.type)) return n(new Error("The file given is not an image"));
|
|
6045
|
-
if (h = typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope, !c || typeof Worker != "function" || h) return
|
|
6045
|
+
if (h = typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope, !c || typeof Worker != "function" || h) return mr(s, r).then((function(f) {
|
|
6046
6046
|
try {
|
|
6047
6047
|
return i = f, d.call(this);
|
|
6048
6048
|
} catch (y) {
|
|
@@ -6057,7 +6057,7 @@ function Oe(s, e) {
|
|
|
6057
6057
|
}
|
|
6058
6058
|
}).bind(this), u = function(f) {
|
|
6059
6059
|
try {
|
|
6060
|
-
return
|
|
6060
|
+
return mr(s, r).then(function(y) {
|
|
6061
6061
|
try {
|
|
6062
6062
|
return i = y, l();
|
|
6063
6063
|
} catch (I) {
|
|
@@ -6069,7 +6069,7 @@ function Oe(s, e) {
|
|
|
6069
6069
|
}
|
|
6070
6070
|
};
|
|
6071
6071
|
try {
|
|
6072
|
-
return r.libURL = r.libURL || "https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",
|
|
6072
|
+
return r.libURL = r.libURL || "https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js", Rs(s, r).then(function(f) {
|
|
6073
6073
|
try {
|
|
6074
6074
|
return i = f, l();
|
|
6075
6075
|
} catch {
|
|
@@ -6085,17 +6085,17 @@ function Oe(s, e) {
|
|
|
6085
6085
|
} catch {
|
|
6086
6086
|
}
|
|
6087
6087
|
try {
|
|
6088
|
-
r.preserveExif && s.type === "image/jpeg" && (!r.fileType || r.fileType && r.fileType === s.type) && (i =
|
|
6088
|
+
r.preserveExif && s.type === "image/jpeg" && (!r.fileType || r.fileType && r.fileType === s.type) && (i = Mr(s, i));
|
|
6089
6089
|
} catch {
|
|
6090
6090
|
}
|
|
6091
6091
|
return t(i);
|
|
6092
6092
|
}
|
|
6093
6093
|
});
|
|
6094
6094
|
}
|
|
6095
|
-
Oe.getDataUrlFromFile =
|
|
6096
|
-
const
|
|
6095
|
+
Oe.getDataUrlFromFile = Pr, Oe.getFilefromDataUrl = jn, Oe.loadImage = Wr, Oe.drawImageInCanvas = Zr, Oe.drawFileInCanvas = yn, Oe.canvasToFile = bn, Oe.getExifOrientation = qr, Oe.handleMaxWidthOrHeight = Kr, Oe.followExifOrientation = zr, Oe.cleanupCanvasMemory = lt, Oe.isAutoOrientationInBrowser = Mt, Oe.approximateBelowMaximumCanvasSizeOfBrowser = jr, Oe.copyExifWithoutOrientation = Mr, Oe.getBrowserName = Ut, Oe.version = "2.0.2";
|
|
6096
|
+
const gr = async (s, e, t, n = !0) => {
|
|
6097
6097
|
try {
|
|
6098
|
-
const r =
|
|
6098
|
+
const r = Ms(s, e), o = (await Ts(e == null ? void 0 : e.type, t, n)).response.url;
|
|
6099
6099
|
return await fetch(o, {
|
|
6100
6100
|
method: "PUT",
|
|
6101
6101
|
headers: {
|
|
@@ -6107,7 +6107,7 @@ const pr = async (s, e, t, n = !0) => {
|
|
|
6107
6107
|
} catch (r) {
|
|
6108
6108
|
throw r;
|
|
6109
6109
|
}
|
|
6110
|
-
},
|
|
6110
|
+
}, Ms = (s, e) => {
|
|
6111
6111
|
const t = e.type.split("/")[0];
|
|
6112
6112
|
let n = "";
|
|
6113
6113
|
t === "video" ? n = s == null ? void 0 : s.replace(/^data:video\/\w+;base64,/, "") : t === "image" ? n = s == null ? void 0 : s.replace(/^data:image\/\w+;base64,/, "") : t === "audio" && (n = s == null ? void 0 : s.replace(/^data:audio\/\w+;base64,/, ""));
|
|
@@ -6116,7 +6116,7 @@ const pr = async (s, e, t, n = !0) => {
|
|
|
6116
6116
|
i[o] = r.charCodeAt(o);
|
|
6117
6117
|
return i;
|
|
6118
6118
|
};
|
|
6119
|
-
async function
|
|
6119
|
+
async function wr(s) {
|
|
6120
6120
|
const e = {
|
|
6121
6121
|
maxSizeMB: 2,
|
|
6122
6122
|
maxWidthOrHeight: 1920,
|
|
@@ -6128,8 +6128,8 @@ async function mr(s) {
|
|
|
6128
6128
|
throw Error(t);
|
|
6129
6129
|
}
|
|
6130
6130
|
}
|
|
6131
|
-
var Et, be, Ce, ft, ge, ke, it, $e, Bt,
|
|
6132
|
-
class
|
|
6131
|
+
var Et, be, Ce, ft, ge, ke, it, $e, Bt, vt, st, Ge, At, Ht, Cn, kt, Ft, pt, Ot, ot, at, Nt, It, mt, $t, en, Se, gt, tn, En, nn, Te, Pt, Lt, Wt, jt, Zt, qt, Kt, rn;
|
|
6132
|
+
class Hs {
|
|
6133
6133
|
constructor(e) {
|
|
6134
6134
|
X(this, Et);
|
|
6135
6135
|
X(this, be);
|
|
@@ -6140,12 +6140,12 @@ class Ms {
|
|
|
6140
6140
|
X(this, it);
|
|
6141
6141
|
X(this, $e);
|
|
6142
6142
|
X(this, Bt);
|
|
6143
|
-
X(this,
|
|
6143
|
+
X(this, vt);
|
|
6144
6144
|
X(this, st, []);
|
|
6145
6145
|
X(this, Ge);
|
|
6146
|
-
X(this,
|
|
6146
|
+
X(this, At);
|
|
6147
6147
|
X(this, Ht);
|
|
6148
|
-
X(this,
|
|
6148
|
+
X(this, Cn);
|
|
6149
6149
|
X(this, kt);
|
|
6150
6150
|
X(this, Ft);
|
|
6151
6151
|
X(this, pt);
|
|
@@ -6156,21 +6156,23 @@ class Ms {
|
|
|
6156
6156
|
X(this, It);
|
|
6157
6157
|
X(this, mt);
|
|
6158
6158
|
X(this, $t);
|
|
6159
|
-
X(this,
|
|
6159
|
+
X(this, en);
|
|
6160
6160
|
X(this, Se);
|
|
6161
6161
|
X(this, gt);
|
|
6162
|
-
X(this,
|
|
6163
|
-
X(this,
|
|
6164
|
-
X(this,
|
|
6162
|
+
X(this, tn, !1);
|
|
6163
|
+
X(this, En);
|
|
6164
|
+
X(this, nn);
|
|
6165
6165
|
X(this, Te);
|
|
6166
|
-
X(this, Wt);
|
|
6167
|
-
X(this, Lt);
|
|
6168
6166
|
X(this, Pt);
|
|
6169
|
-
X(this,
|
|
6170
|
-
X(this,
|
|
6167
|
+
X(this, Lt);
|
|
6168
|
+
X(this, Wt);
|
|
6171
6169
|
X(this, jt);
|
|
6172
|
-
|
|
6173
|
-
|
|
6170
|
+
X(this, Zt);
|
|
6171
|
+
X(this, qt);
|
|
6172
|
+
X(this, Kt);
|
|
6173
|
+
X(this, rn);
|
|
6174
|
+
H(this, nn, e.isAdmin), H(this, it, !1), H(this, Ht, e.handleUpload.bind(this)), H(this, en, e.accessToken), H(this, Wt, e == null ? void 0 : e.mode), this._grpcOptionInitializer(), this._init(e).then(() => {
|
|
6175
|
+
H(this, tn, !0), this._renderView(e), this.updateWindowObject({ initialized: !0 }), this._initializeGrpcConfig(e.mode, e.endPoint);
|
|
6174
6176
|
});
|
|
6175
6177
|
}
|
|
6176
6178
|
async _init(e) {
|
|
@@ -6185,14 +6187,14 @@ class Ms {
|
|
|
6185
6187
|
return e.isAdmin === !0;
|
|
6186
6188
|
}
|
|
6187
6189
|
_renderView(e) {
|
|
6188
|
-
return this._isAdminOptions(e) ? (
|
|
6190
|
+
return this._isAdminOptions(e) ? (H(this, $e, !1), H(this, Bt, !1), H(this, kt, 0), H(this, at, ""), H(this, mt, !1), H(this, Wt, e.mode), H(this, Nt, !1), H(this, Lt, ""), H(this, gt, null), this._removeToastContainer(), this._renderAdminView(e)) : (H(this, Pt, ""), H(this, jt, e.restrictedFileSize), H(this, Zt, e == null ? void 0 : e.localizedFileRestrictedMessage), H(this, Kt, e == null ? void 0 : e.localizedSuccessMessage), H(this, qt, e == null ? void 0 : e.localizedErrorMessage), H(this, rn, e.removeImagePreviewCB.bind(this)), this._removeUserToast(), this._renderUserView(e));
|
|
6189
6191
|
}
|
|
6190
6192
|
_renderAdminView(e) {
|
|
6191
|
-
if (!
|
|
6193
|
+
if (!A(this, tn)) return;
|
|
6192
6194
|
const { parentContainerId: t } = e;
|
|
6193
6195
|
if (e.isAdmin === !0)
|
|
6194
6196
|
var { buttonProps: n } = e;
|
|
6195
|
-
|
|
6197
|
+
H(this, Et, document.getElementById(t));
|
|
6196
6198
|
const r = document.createElement("button");
|
|
6197
6199
|
r.className = n != null && n.buttonClass ? n == null ? void 0 : n.buttonClass : "browse-image-button", r.addEventListener("focus", () => {
|
|
6198
6200
|
r.blur();
|
|
@@ -6202,20 +6204,20 @@ class Ms {
|
|
|
6202
6204
|
const o = document.createElement("span");
|
|
6203
6205
|
o.innerHTML = n != null && n.buttonIcon ? n == null ? void 0 : n.buttonIcon : "", r.type = "button", r.append(i, o), n != null && n.buttonStyle && Object.assign(r.style, n == null ? void 0 : n.buttonStyle), r.addEventListener("click", () => {
|
|
6204
6206
|
this._selectedImageContainer();
|
|
6205
|
-
}),
|
|
6207
|
+
}), A(this, Et).appendChild(r);
|
|
6206
6208
|
}
|
|
6207
6209
|
async _grpcOptionInitializer() {
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6210
|
+
H(this, Se, await As(
|
|
6211
|
+
A(this, en),
|
|
6212
|
+
A(this, Wt)
|
|
6211
6213
|
));
|
|
6212
6214
|
}
|
|
6213
6215
|
_selectedImageContainer() {
|
|
6214
6216
|
var u;
|
|
6215
|
-
|
|
6216
|
-
`Save (${(u =
|
|
6217
|
+
H(this, At, He(
|
|
6218
|
+
`Save (${(u = A(this, ge)) == null ? void 0 : u.length})`,
|
|
6217
6219
|
"dialog-btn confirm"
|
|
6218
|
-
)),
|
|
6220
|
+
)), H(this, Ft, K("folder-container")), H(this, pt, K("folder-list-wrapper")), this._fetchAllFolders();
|
|
6219
6221
|
const e = He("Cancel", "dialog-btn cancel");
|
|
6220
6222
|
He(
|
|
6221
6223
|
"",
|
|
@@ -6224,27 +6226,30 @@ class Ms {
|
|
|
6224
6226
|
!1,
|
|
6225
6227
|
'<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="24" height="24" viewBox="0 0 50 50"> <path d="M 9.15625 6.3125 L 6.3125 9.15625 L 22.15625 25 L 6.21875 40.96875 L 9.03125 43.78125 L 25 27.84375 L 40.9375 43.78125 L 43.78125 40.9375 L 27.84375 25 L 43.6875 9.15625 L 40.84375 6.3125 L 25 22.15625 Z"></path> </svg>'
|
|
6226
6228
|
).addEventListener("click", () => {
|
|
6227
|
-
|
|
6228
|
-
}),
|
|
6229
|
+
dn.hide(), H(this, ge, []), H(this, ke, []);
|
|
6230
|
+
}), H(this, be, K("browse-container"));
|
|
6229
6231
|
const n = K();
|
|
6230
6232
|
n.style.display = "flex", n.style.alignItems = "center", n.style.justifyContent = "space-between", n.style.padding = "10px 20px";
|
|
6231
|
-
const r =
|
|
6232
|
-
i.append(
|
|
6233
|
+
const r = Jt("Folders", "folder-title"), i = He("", "add-folder-btn");
|
|
6234
|
+
i.append(cr()), this._createUpdateFolderDialog(i, "create"), n.append(r, i), A(this, Ft).append(n, A(this, pt));
|
|
6233
6235
|
const o = this._renderSearchField(), a = this._createBrowseMoreContainer(), c = this._createBrowseImageMain(), h = K("footer");
|
|
6234
6236
|
e.onclick = () => {
|
|
6235
|
-
|
|
6236
|
-
},
|
|
6237
|
-
|
|
6238
|
-
}, h.append(e,
|
|
6237
|
+
A(this, Cn).call(this), dn.hide(), H(this, ke, []), H(this, ge, []);
|
|
6238
|
+
}, A(this, At).onclick = () => {
|
|
6239
|
+
A(this, Ht).call(this), dn.hide(), H(this, ge, []), H(this, ke, []);
|
|
6240
|
+
}, h.append(e, A(this, At));
|
|
6239
6241
|
const l = K("container-right-main");
|
|
6240
|
-
l.append(o, a, c, h),
|
|
6241
|
-
content:
|
|
6242
|
+
l.append(o, a, c, h), A(this, be).append(A(this, Ft), l), dn.show({
|
|
6243
|
+
content: A(this, be)
|
|
6242
6244
|
});
|
|
6243
6245
|
}
|
|
6244
6246
|
_renderUserView(e) {
|
|
6245
6247
|
const { parentContainerId: t, restrictedFileSize: n, imagePreview: r } = e;
|
|
6246
|
-
|
|
6247
|
-
const i = K(
|
|
6248
|
+
H(this, Et, document.getElementById(t)), H(this, Te, ee("div", "user-view-container"));
|
|
6249
|
+
const i = K(
|
|
6250
|
+
"user-view-browse-wrapper",
|
|
6251
|
+
"user-view-browse-wrapper"
|
|
6252
|
+
), o = ee(
|
|
6248
6253
|
"span",
|
|
6249
6254
|
"",
|
|
6250
6255
|
"",
|
|
@@ -6257,15 +6262,21 @@ class Ms {
|
|
|
6257
6262
|
"margin-block: 0px; font-size: 13px; color: #777",
|
|
6258
6263
|
`Max File size: ${n}MB`
|
|
6259
6264
|
);
|
|
6260
|
-
i.append(
|
|
6265
|
+
i.append(_n(), c, h);
|
|
6261
6266
|
} else
|
|
6262
|
-
i.append(
|
|
6263
|
-
|
|
6267
|
+
i.append(_n(), c);
|
|
6268
|
+
if (this._setupDragAndDrop(A(this, Te)), A(this, Te).append(i), r) {
|
|
6269
|
+
const h = document.getElementById(
|
|
6270
|
+
"user-view-browse-wrapper"
|
|
6271
|
+
);
|
|
6272
|
+
h && (h.style.display = "none"), this._renderImagePreview(r);
|
|
6273
|
+
}
|
|
6274
|
+
return A(this, Et).appendChild(A(this, Te)), A(this, Et);
|
|
6264
6275
|
}
|
|
6265
6276
|
_setupDragAndDrop(e) {
|
|
6266
6277
|
if (!e) return;
|
|
6267
6278
|
["dragenter", "dragover", "dragleave", "drop"].forEach((n) => {
|
|
6268
|
-
|
|
6279
|
+
A(this, Te).addEventListener(
|
|
6269
6280
|
n,
|
|
6270
6281
|
(r) => {
|
|
6271
6282
|
r.preventDefault(), r.stopPropagation();
|
|
@@ -6273,25 +6284,26 @@ class Ms {
|
|
|
6273
6284
|
!1
|
|
6274
6285
|
);
|
|
6275
6286
|
}), ["dragenter", "dragover"].forEach((n) => {
|
|
6276
|
-
|
|
6287
|
+
A(this, Te).addEventListener(
|
|
6277
6288
|
n,
|
|
6278
6289
|
() => {
|
|
6279
|
-
|
|
6290
|
+
A(this, Te).classList.add("highlight");
|
|
6280
6291
|
},
|
|
6281
6292
|
!1
|
|
6282
6293
|
);
|
|
6283
6294
|
}), ["dragleave", "drop"].forEach((n) => {
|
|
6284
|
-
|
|
6295
|
+
A(this, Te).addEventListener(
|
|
6285
6296
|
n,
|
|
6286
6297
|
() => {
|
|
6287
|
-
|
|
6298
|
+
A(this, Te).classList.remove("highlight");
|
|
6288
6299
|
},
|
|
6289
6300
|
!1
|
|
6290
6301
|
);
|
|
6291
|
-
}),
|
|
6302
|
+
}), A(this, Te).addEventListener(
|
|
6292
6303
|
"drop",
|
|
6293
6304
|
(n) => {
|
|
6294
6305
|
var i;
|
|
6306
|
+
this._removeUserToast();
|
|
6295
6307
|
let r = (i = n.dataTransfer) == null ? void 0 : i.files[0];
|
|
6296
6308
|
r && this._handleDroppedFile(r);
|
|
6297
6309
|
},
|
|
@@ -6299,53 +6311,71 @@ class Ms {
|
|
|
6299
6311
|
);
|
|
6300
6312
|
}
|
|
6301
6313
|
_renderImagePreview(e, t) {
|
|
6302
|
-
var
|
|
6303
|
-
const n = document.getElementById(
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
const
|
|
6314
|
+
var h;
|
|
6315
|
+
const n = document.getElementById(
|
|
6316
|
+
"user-view-browse-wrapper"
|
|
6317
|
+
);
|
|
6318
|
+
n && (n.style.display = "none");
|
|
6319
|
+
const r = document.getElementById("user-image-preview");
|
|
6320
|
+
r && r.remove();
|
|
6321
|
+
const i = ee("div", "user-image-preview");
|
|
6322
|
+
i.id = "user-image-preview";
|
|
6323
|
+
const o = ee(
|
|
6308
6324
|
"img",
|
|
6309
6325
|
"",
|
|
6310
6326
|
"max-width: 230px;max-height:250px;object-fit:cover;"
|
|
6311
6327
|
);
|
|
6312
|
-
|
|
6313
|
-
const
|
|
6328
|
+
o.src = e, o.alt = t || "";
|
|
6329
|
+
const a = ee(
|
|
6314
6330
|
"div",
|
|
6315
6331
|
"",
|
|
6316
|
-
"width: 18px; height: 18px; display:
|
|
6317
|
-
)
|
|
6318
|
-
a.
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6332
|
+
"width: 18px; height: 18px; display: none; cursor:pointer; align-items: center; justify-content: center; padding: 4px; position: absolute; top: -5px; right: -5px; background: #c10007; border-radius: 50%;z-index:1"
|
|
6333
|
+
);
|
|
6334
|
+
a.id = "remove-preview-btn";
|
|
6335
|
+
const c = Vn();
|
|
6336
|
+
c.style.fill = "#fff", a == null || a.appendChild(c), a.addEventListener("click", () => {
|
|
6337
|
+
var l;
|
|
6338
|
+
(l = A(this, Te)) == null || l.removeChild(i), this._removeUserToast(), A(this, rn).call(this), n && (n.style.display = "flex");
|
|
6339
|
+
}), i == null || i.append(o, a), (h = A(this, Te)) == null || h.append(i);
|
|
6340
|
+
}
|
|
6341
|
+
_renderRemovePreviewBtn() {
|
|
6342
|
+
const e = document.getElementById("remove-preview-btn");
|
|
6343
|
+
e && (e.style.display = "flex");
|
|
6322
6344
|
}
|
|
6323
6345
|
_handleDroppedFile(e) {
|
|
6324
6346
|
this._readFileAsBase64(e);
|
|
6325
6347
|
}
|
|
6326
6348
|
async _readFileAsBase64(e) {
|
|
6327
|
-
|
|
6349
|
+
const t = A(this, jt) * 1024 * 1024;
|
|
6350
|
+
if (e.size > t) {
|
|
6351
|
+
this._renderUserToast(
|
|
6352
|
+
A(this, Zt) ? A(this, Zt) : `File size must be less than ${A(this, jt)}MB.`,
|
|
6353
|
+
"error"
|
|
6354
|
+
);
|
|
6355
|
+
return;
|
|
6356
|
+
}
|
|
6357
|
+
H(this, it, !0);
|
|
6328
6358
|
try {
|
|
6329
|
-
const
|
|
6359
|
+
const n = await wr(e);
|
|
6330
6360
|
this._removeUserToast();
|
|
6331
|
-
const
|
|
6332
|
-
|
|
6361
|
+
const r = new FileReader();
|
|
6362
|
+
r.readAsDataURL(n), r.onload = () => {
|
|
6333
6363
|
this._userViewUploadAndAddSelectedImageList(
|
|
6334
|
-
|
|
6364
|
+
r.result,
|
|
6335
6365
|
e
|
|
6336
6366
|
);
|
|
6337
|
-
},
|
|
6338
|
-
console.error("Error reading file:",
|
|
6367
|
+
}, r.onerror = () => {
|
|
6368
|
+
console.error("Error reading file:", r.error);
|
|
6339
6369
|
};
|
|
6340
|
-
} catch (
|
|
6341
|
-
this._renderUserToast(
|
|
6370
|
+
} catch (n) {
|
|
6371
|
+
this._renderUserToast(n, "error");
|
|
6342
6372
|
}
|
|
6343
6373
|
}
|
|
6344
6374
|
_renderUserToast(e, t = "success") {
|
|
6345
6375
|
const n = ee(
|
|
6346
6376
|
"div",
|
|
6347
6377
|
"",
|
|
6348
|
-
"display:flex;align-items:center;gap:5px;"
|
|
6378
|
+
"display:flex;align-items:center;gap:5px;margin-top:5px;"
|
|
6349
6379
|
);
|
|
6350
6380
|
n.id = "user-toast-container";
|
|
6351
6381
|
const r = ee(
|
|
@@ -6354,15 +6384,15 @@ class Ms {
|
|
|
6354
6384
|
"margin-block:0px;font-size:14px;padding-top:3px"
|
|
6355
6385
|
);
|
|
6356
6386
|
r.textContent = e, r.style.color = t === "success" ? "#4caf50" : "#ee3f3f";
|
|
6357
|
-
const i = t === "success" ?
|
|
6358
|
-
i.style.width = "15px", i.style.height = "15px", n.append(i, r),
|
|
6387
|
+
const i = t === "success" ? ar("#4caf50") : xn();
|
|
6388
|
+
i.style.width = "15px", i.style.height = "15px", n.append(i, r), A(this, Te).appendChild(n);
|
|
6359
6389
|
}
|
|
6360
6390
|
_removeUserToast() {
|
|
6361
6391
|
const e = document.getElementById("user-toast-container");
|
|
6362
6392
|
e && e.remove();
|
|
6363
6393
|
}
|
|
6364
6394
|
_renderUserViewBrowseButton() {
|
|
6365
|
-
const e =
|
|
6395
|
+
const e = Un("file");
|
|
6366
6396
|
e.style.display = "none", e.setAttribute("multiple", "true"), e.setAttribute("accept", "image/*");
|
|
6367
6397
|
const t = ee(
|
|
6368
6398
|
"a",
|
|
@@ -6370,7 +6400,9 @@ class Ms {
|
|
|
6370
6400
|
"",
|
|
6371
6401
|
"Click to upload"
|
|
6372
6402
|
);
|
|
6373
|
-
return t.classList.add("user-upload-btn"), t.role = "button", t.addEventListener("click", () =>
|
|
6403
|
+
return t.classList.add("user-upload-btn"), t.role = "button", t.addEventListener("click", () => {
|
|
6404
|
+
this._removeUserToast(), e.click();
|
|
6405
|
+
}), e.addEventListener("change", () => {
|
|
6374
6406
|
const n = e.files[0];
|
|
6375
6407
|
n && this._readFileAsBase64(n), e.value = "";
|
|
6376
6408
|
}), t;
|
|
@@ -6379,11 +6411,11 @@ class Ms {
|
|
|
6379
6411
|
const e = ee(
|
|
6380
6412
|
"div",
|
|
6381
6413
|
"",
|
|
6382
|
-
"margin-top:
|
|
6414
|
+
"margin-top:5px;margin-bottom:8px;display:flex;flex-direction:column;align-items:center;gap:5px;font-weight:600;font-size:14px"
|
|
6383
6415
|
);
|
|
6384
6416
|
e.id = "user-uploading", e.innerHTML = "Uploading...";
|
|
6385
6417
|
const t = ee("div", "linear-loader");
|
|
6386
|
-
e.appendChild(t),
|
|
6418
|
+
e.appendChild(t), A(this, Te).append(e);
|
|
6387
6419
|
}
|
|
6388
6420
|
_removeUserUploading() {
|
|
6389
6421
|
const e = document.getElementById("user-uploading");
|
|
@@ -6393,32 +6425,32 @@ class Ms {
|
|
|
6393
6425
|
this._renderUserUploading();
|
|
6394
6426
|
try {
|
|
6395
6427
|
this._renderImagePreview(e, t.name);
|
|
6396
|
-
const n = await
|
|
6397
|
-
await this._uploadForUser(n, t), this._renderUserToast(
|
|
6428
|
+
const n = await gr(e, t, A(this, Se), !1);
|
|
6429
|
+
await this._uploadForUser(n, t), A(this, Kt) && this._renderUserToast(A(this, Kt), "success"), this._renderRemovePreviewBtn();
|
|
6398
6430
|
} catch {
|
|
6399
6431
|
this._renderUserToast(
|
|
6400
|
-
|
|
6432
|
+
A(this, qt) ? A(this, qt) : "Error uploading. Please try again later.",
|
|
6401
6433
|
"error"
|
|
6402
6434
|
);
|
|
6403
6435
|
} finally {
|
|
6404
|
-
|
|
6436
|
+
H(this, it, !1), this._removeUserUploading();
|
|
6405
6437
|
}
|
|
6406
6438
|
}
|
|
6407
6439
|
async _uploadForUser(e, t) {
|
|
6408
6440
|
var n;
|
|
6409
6441
|
try {
|
|
6410
|
-
const r = await
|
|
6442
|
+
const r = await Qi(
|
|
6411
6443
|
e,
|
|
6412
|
-
ct[
|
|
6413
|
-
|
|
6444
|
+
ct[ur((n = t.type) == null ? void 0 : n.split("/")[0])],
|
|
6445
|
+
A(this, Se)
|
|
6414
6446
|
);
|
|
6415
|
-
|
|
6447
|
+
H(this, Pt, r == null ? void 0 : r.response), A(this, Ht).call(this);
|
|
6416
6448
|
} catch (r) {
|
|
6417
6449
|
throw Error(r);
|
|
6418
6450
|
}
|
|
6419
6451
|
}
|
|
6420
6452
|
_createAllAndSelectedTab(e) {
|
|
6421
|
-
const t = K("select-options"), n =
|
|
6453
|
+
const t = K("select-options"), n = Jt("Browse", "select"), r = Jt(
|
|
6422
6454
|
"Selected",
|
|
6423
6455
|
"select",
|
|
6424
6456
|
"selected-images-tab"
|
|
@@ -6426,22 +6458,22 @@ class Ms {
|
|
|
6426
6458
|
n.classList.add("selected"), [n, r].forEach((o, a) => {
|
|
6427
6459
|
o.addEventListener("click", () => {
|
|
6428
6460
|
var c;
|
|
6429
|
-
|
|
6461
|
+
H(this, kt, a), (c = document.querySelector(".select.selected")) == null || c.classList.remove("selected"), o.classList.add("selected"), this._updateSelectedImageListContainerUI();
|
|
6430
6462
|
});
|
|
6431
6463
|
}), t.append(n, r), e.appendChild(t);
|
|
6432
6464
|
}
|
|
6433
6465
|
_renderUploadButton() {
|
|
6434
|
-
const e =
|
|
6435
|
-
e.style.display = "none", e.setAttribute("multiple", "true"), e.setAttribute("accept", "image/*,video/*,audio/*,.gif"),
|
|
6466
|
+
const e = Un("file");
|
|
6467
|
+
e.style.display = "none", e.setAttribute("multiple", "true"), e.setAttribute("accept", "image/*,video/*,audio/*,.gif"), H(this, ft, document.createElement("button")), A(this, ft).className = "browse-more-btn";
|
|
6436
6468
|
const t = document.createElement("span");
|
|
6437
|
-
return t.textContent = "Upload",
|
|
6469
|
+
return t.textContent = "Upload", A(this, ft).append(_n(), t), A(this, ft).type = "button", A(this, ft).addEventListener(
|
|
6438
6470
|
"click",
|
|
6439
6471
|
() => e.click()
|
|
6440
6472
|
), e.addEventListener("change", async () => {
|
|
6441
6473
|
const n = e.files[0];
|
|
6442
6474
|
try {
|
|
6443
|
-
|
|
6444
|
-
const r = await
|
|
6475
|
+
H(this, it, !0);
|
|
6476
|
+
const r = await wr(n), i = new FileReader();
|
|
6445
6477
|
i.readAsDataURL(r), i.onload = async () => {
|
|
6446
6478
|
await this._uploadAndAddSelectedImageList(
|
|
6447
6479
|
i.result,
|
|
@@ -6449,16 +6481,16 @@ class Ms {
|
|
|
6449
6481
|
);
|
|
6450
6482
|
};
|
|
6451
6483
|
} catch (r) {
|
|
6452
|
-
this._renderToastContainer(r, "error",
|
|
6484
|
+
this._renderToastContainer(r, "error", A(this, be));
|
|
6453
6485
|
}
|
|
6454
6486
|
e.value = "";
|
|
6455
|
-
}),
|
|
6487
|
+
}), A(this, ft);
|
|
6456
6488
|
}
|
|
6457
6489
|
_renderCreateFolderBtn() {
|
|
6458
6490
|
const e = document.createElement("button");
|
|
6459
6491
|
e.className = "create-folder-btn";
|
|
6460
6492
|
const t = document.createElement("span");
|
|
6461
|
-
return t.textContent = "Create", e.append(
|
|
6493
|
+
return t.textContent = "Create", e.append(cr(), t), this._createUpdateFolderDialog(e, "create"), e;
|
|
6462
6494
|
}
|
|
6463
6495
|
_renderSearchField() {
|
|
6464
6496
|
let e;
|
|
@@ -6466,42 +6498,42 @@ class Ms {
|
|
|
6466
6498
|
"search-input-wrapper",
|
|
6467
6499
|
"search-input-wrapper"
|
|
6468
6500
|
);
|
|
6469
|
-
|
|
6470
|
-
|
|
6501
|
+
H(this, It, Un("search")), A(this, It).value = "", A(this, It).addEventListener("input", (i) => {
|
|
6502
|
+
H(this, ke, []);
|
|
6471
6503
|
const o = i.target;
|
|
6472
6504
|
e && clearTimeout(e), e = setTimeout(() => {
|
|
6473
6505
|
if (!o.value) {
|
|
6474
|
-
|
|
6506
|
+
H(this, at, ""), H(this, Nt, !1), H(this, mt, !1), this._fetchFilesFromFolder(A(this, vt));
|
|
6475
6507
|
return;
|
|
6476
6508
|
}
|
|
6477
|
-
|
|
6509
|
+
H(this, mt, !0), H(this, $t, o.value), this._search(A(this, $t));
|
|
6478
6510
|
}, 750);
|
|
6479
|
-
}),
|
|
6480
|
-
const r =
|
|
6481
|
-
return r.style.position = "absolute", r.style.top = "50%", r.style.left = "5%", r.style.transform = "translate(-5%, -50%)", n.append(r,
|
|
6511
|
+
}), A(this, It).setAttribute("placeholder", "Search");
|
|
6512
|
+
const r = ws();
|
|
6513
|
+
return r.style.position = "absolute", r.style.top = "50%", r.style.left = "5%", r.style.transform = "translate(-5%, -50%)", n.append(r, A(this, It)), t.append(n), t;
|
|
6482
6514
|
}
|
|
6483
6515
|
_createBrowseMoreContainer() {
|
|
6484
|
-
|
|
6516
|
+
H(this, Ot, K("browse-more-btn-container")), this._createAllAndSelectedTab(A(this, Ot));
|
|
6485
6517
|
const e = this._renderUploadButton(), t = this._renderCreateFolderBtn(), n = document.createElement("div");
|
|
6486
|
-
return n.style.display = "flex", n.style.alignItems = "center", n.style.gap = "10px", n.append(e, t),
|
|
6518
|
+
return n.style.display = "flex", n.style.alignItems = "center", n.style.gap = "10px", n.append(e, t), A(this, Ot).appendChild(n), A(this, Ot);
|
|
6487
6519
|
}
|
|
6488
6520
|
_createBrowseImageMain() {
|
|
6489
6521
|
const e = K("browse-image-main");
|
|
6490
|
-
return
|
|
6491
|
-
const t =
|
|
6492
|
-
t + n >= r - 5 &&
|
|
6493
|
-
}), e.appendChild(
|
|
6522
|
+
return H(this, Ce, K("selected-image-container")), A(this, Ce).addEventListener("scroll", () => {
|
|
6523
|
+
const t = A(this, Ce).clientHeight, n = A(this, Ce).scrollTop, r = A(this, Ce).scrollHeight;
|
|
6524
|
+
t + n >= r - 5 && A(this, Nt) && (A(this, mt) ? this._search(A(this, $t)) : this._fetchFilesFromFolder(A(this, vt)));
|
|
6525
|
+
}), e.appendChild(A(this, Ce)), e;
|
|
6494
6526
|
}
|
|
6495
6527
|
_renderFetchingSkeletonUI() {
|
|
6496
6528
|
for (let e = 0; e < 20; e++) {
|
|
6497
6529
|
const t = K("skeleton");
|
|
6498
|
-
t.innerHTML = "",
|
|
6530
|
+
t.innerHTML = "", A(this, Ce).append(t);
|
|
6499
6531
|
}
|
|
6500
6532
|
}
|
|
6501
6533
|
_renderEmptyImageContainer() {
|
|
6502
|
-
if (
|
|
6534
|
+
if (A(this, $e) || A(this, it)) return;
|
|
6503
6535
|
const e = K(), t = K(), n = document.createElement("p");
|
|
6504
|
-
|
|
6536
|
+
A(this, mt) && A(this, kt) === 0 ? (t.innerHTML = `
|
|
6505
6537
|
<svg width="300" height="300" viewBox="0 0 1000 1000" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6506
6538
|
<g clip-path="url(#clip0_2304_257)">
|
|
6507
6539
|
<path d="M564.829 772.4H336.658V948.386H564.829V772.4Z" fill="#EBEBEB"/>
|
|
@@ -6585,14 +6617,14 @@ class Ms {
|
|
|
6585
6617
|
</clipPath>
|
|
6586
6618
|
</defs>
|
|
6587
6619
|
</svg>
|
|
6588
|
-
`, n.textContent = "Looks Empty!"), e.append(t, n),
|
|
6620
|
+
`, n.textContent = "Looks Empty!"), e.append(t, n), A(this, Ce).appendChild(e);
|
|
6589
6621
|
}
|
|
6590
6622
|
_renderLoadingUI() {
|
|
6591
6623
|
const e = K("skeleton");
|
|
6592
|
-
e.innerHTML = "",
|
|
6624
|
+
e.innerHTML = "", A(this, Ce).appendChild(e);
|
|
6593
6625
|
}
|
|
6594
6626
|
_fileCardBody(e) {
|
|
6595
|
-
var nt, St,
|
|
6627
|
+
var nt, St, sn, Dt;
|
|
6596
6628
|
const t = K("selected-image-content"), n = K("selected-image-top-bar"), r = He(
|
|
6597
6629
|
"",
|
|
6598
6630
|
"selected-image-btn",
|
|
@@ -6601,33 +6633,33 @@ class Ms {
|
|
|
6601
6633
|
'<svg width="20px" height="20px" viewBox="0 0 20 20" focusable="false" fill="currentColor"><path fill="none" d="M0 0h20v20H0V0z"></path><path d="M10 6c.82 0 1.5-.68 1.5-1.5S10.82 3 10 3s-1.5.67-1.5 1.5S9.18 6 10 6zm0 5.5c.82 0 1.5-.68 1.5-1.5s-.68-1.5-1.5-1.5-1.5.68-1.5 1.5.68 1.5 1.5 1.5zm0 5.5c.82 0 1.5-.67 1.5-1.5 0-.82-.68-1.5-1.5-1.5s-1.5.68-1.5 1.5c0 .83.68 1.5 1.5 1.5z"></path></svg>'
|
|
6602
6634
|
);
|
|
6603
6635
|
let i, o;
|
|
6604
|
-
(e == null ? void 0 : e.type) === ct.IMAGE && (i =
|
|
6636
|
+
(e == null ? void 0 : e.type) === ct.IMAGE && (i = fr(e == null ? void 0 : e.url, "selected-image"), o = ps()), (e == null ? void 0 : e.type) === ct.VIDEO && (i = ks(e == null ? void 0 : e.url, "uploaded-video"), o = ys()), (e == null ? void 0 : e.type) === ct.AUDIO && (i = Fs(e == null ? void 0 : e.url, "uploaded-audio"), o = fs());
|
|
6605
6637
|
const a = K("selected-image-wrapper");
|
|
6606
6638
|
a.setAttribute("data-key", e == null ? void 0 : e.key);
|
|
6607
|
-
const c =
|
|
6639
|
+
const c = Jt(e == null ? void 0 : e.name, "selected-image-name"), h = ie("", "selected-image-type");
|
|
6608
6640
|
h.append(o), n.append(h, r);
|
|
6609
6641
|
const l = K();
|
|
6610
6642
|
l.style.marginTop = "10px", l.style.display = "flex", l.style.justifyContent = "space-between", l.style.alignItems = "center", l.append(c), t.append(n, i), a.append(t, l);
|
|
6611
|
-
const u = K("action-wrapper"), d = He("", "action-option preview"), f = ie("Preview", ""), y =
|
|
6643
|
+
const u = K("action-wrapper"), d = He("", "action-option preview"), f = ie("Preview", ""), y = gs();
|
|
6612
6644
|
d.append(y, f);
|
|
6613
|
-
const I = He("", "action-option move"), L = ie("Move", ""), C =
|
|
6645
|
+
const I = He("", "action-option move"), L = ie("Move", ""), C = ms();
|
|
6614
6646
|
I.append(C, L);
|
|
6615
|
-
const R = He("", "action-option rename"), O = ie("Rename", ""),
|
|
6616
|
-
R.append(
|
|
6617
|
-
const x = He("", "action-option delete"), b = ie("Delete", ""), B =
|
|
6647
|
+
const R = He("", "action-option rename"), O = ie("Rename", ""), k = lr();
|
|
6648
|
+
R.append(k, O);
|
|
6649
|
+
const x = He("", "action-option delete"), b = ie("Delete", ""), B = dr();
|
|
6618
6650
|
x.append(B, b);
|
|
6619
|
-
const m = e.name.split(".")[0], g = e.name.split(".")[1],
|
|
6651
|
+
const m = e.name.split(".")[0], g = e.name.split(".")[1], v = Qt[e.type], N = K("edit-form-wrapper"), F = K("move-form-wrapper"), T = K("preview-details-container"), E = K("preview-details-wrapper"), U = K(
|
|
6620
6652
|
"preview-option-image-wrapper"
|
|
6621
6653
|
), w = K("preview-option-wrapper"), p = K("preview-option-wrapper"), M = K(
|
|
6622
6654
|
"preview-option-wrapper"
|
|
6623
6655
|
), _ = K("preview-option-wrapper"), V = K(
|
|
6624
6656
|
"preview-option-wrapper"
|
|
6625
|
-
), q = K("preview-option-wrapper"),
|
|
6657
|
+
), q = K("preview-option-wrapper"), P = K(
|
|
6626
6658
|
"preview-option-wrapper"
|
|
6627
|
-
), Z =
|
|
6659
|
+
), Z = fr(e.url, "preview-option-image");
|
|
6628
6660
|
U.append(Z);
|
|
6629
|
-
const
|
|
6630
|
-
S.innerHTML = e.name, w.append(
|
|
6661
|
+
const $ = ie("File name", "preview-title"), S = K("preview-option-name");
|
|
6662
|
+
S.innerHTML = e.name, w.append($, S);
|
|
6631
6663
|
const z = ie("Folder name", "preview-title"), ae = ie(
|
|
6632
6664
|
e.folderName,
|
|
6633
6665
|
"preview-option-name"
|
|
@@ -6647,7 +6679,7 @@ class Ms {
|
|
|
6647
6679
|
te,
|
|
6648
6680
|
Q
|
|
6649
6681
|
);
|
|
6650
|
-
const re = ie("File type", "preview-title"), ue = ie(
|
|
6682
|
+
const re = ie("File type", "preview-title"), ue = ie(v, "preview-option-name");
|
|
6651
6683
|
_.append(
|
|
6652
6684
|
re,
|
|
6653
6685
|
ue
|
|
@@ -6660,12 +6692,12 @@ class Ms {
|
|
|
6660
6692
|
we,
|
|
6661
6693
|
ht
|
|
6662
6694
|
);
|
|
6663
|
-
const
|
|
6695
|
+
const Pe = ie("URL", "preview-title"), de = ie(
|
|
6664
6696
|
e.url,
|
|
6665
6697
|
"preview-option-name url"
|
|
6666
6698
|
);
|
|
6667
6699
|
q.append(
|
|
6668
|
-
|
|
6700
|
+
Pe,
|
|
6669
6701
|
de
|
|
6670
6702
|
);
|
|
6671
6703
|
const Fe = ie(
|
|
@@ -6675,7 +6707,7 @@ class Ms {
|
|
|
6675
6707
|
e.nestedFolderName,
|
|
6676
6708
|
"preview-option-name"
|
|
6677
6709
|
);
|
|
6678
|
-
|
|
6710
|
+
P.append(
|
|
6679
6711
|
Fe,
|
|
6680
6712
|
le
|
|
6681
6713
|
), E.append(
|
|
@@ -6683,9 +6715,9 @@ class Ms {
|
|
|
6683
6715
|
w,
|
|
6684
6716
|
M,
|
|
6685
6717
|
_,
|
|
6686
|
-
((
|
|
6718
|
+
((sn = e == null ? void 0 : e.metadata) == null ? void 0 : sn.width) > 0 && ((Dt = e == null ? void 0 : e.metadata) == null ? void 0 : Dt.height) > 0 ? V : "",
|
|
6687
6719
|
q,
|
|
6688
|
-
e.nestedFolderName ?
|
|
6720
|
+
e.nestedFolderName ? P : ""
|
|
6689
6721
|
), T.append(
|
|
6690
6722
|
U,
|
|
6691
6723
|
E
|
|
@@ -6693,30 +6725,30 @@ class Ms {
|
|
|
6693
6725
|
const ne = K("form-control"), pe = document.createElement("input");
|
|
6694
6726
|
ne.appendChild(pe), pe.classList.add("input-field"), pe.value = e.name;
|
|
6695
6727
|
const Ne = K("form-control"), me = ie("Current Folder:", "input-label"), Ie = K("folder-field current");
|
|
6696
|
-
Ie.textContent = e.folderName, Ie.prepend(
|
|
6728
|
+
Ie.textContent = e.folderName, Ie.prepend(Gt()), Ne.append(me, Ie);
|
|
6697
6729
|
const fe = K("form-control"), Y = K();
|
|
6698
6730
|
Y.style.width = "100%", Y.style.display = "flex", Y.style.alignItems = "center", Y.style.justifyContent = "space-between";
|
|
6699
6731
|
const Re = ie(
|
|
6700
6732
|
"Suggested Folder List:",
|
|
6701
6733
|
"input-label"
|
|
6702
6734
|
), _e = ie();
|
|
6703
|
-
_e.style.display = "flex", _e.style.alignItems = "center", _e.style.gap = "5px", _e.style.fontSize = "14px", _e.textContent = "Move the file in selected folder", _e.appendChild(
|
|
6735
|
+
_e.style.display = "flex", _e.style.alignItems = "center", _e.style.gap = "5px", _e.style.fontSize = "14px", _e.textContent = "Move the file in selected folder", _e.appendChild(xn("14px", "14px", "#333")), Y.append(Re, _e);
|
|
6704
6736
|
const et = K();
|
|
6705
6737
|
et.style.width = "100%", et.style.maxHeight = "250px", et.style.overflowY = "auto";
|
|
6706
|
-
const
|
|
6707
|
-
|
|
6708
|
-
const
|
|
6709
|
-
|
|
6738
|
+
const ve = document.createElement("ul");
|
|
6739
|
+
ve.className = "folders", et.append(ve), fe.append(Y, et), A(this, st).forEach((ce) => {
|
|
6740
|
+
const We = this._renderEditFolderListContainer(ce);
|
|
6741
|
+
ve.appendChild(We);
|
|
6710
6742
|
});
|
|
6711
6743
|
const tt = K("form-control"), Le = ie("Destination Folder:", "input-label"), Me = K(
|
|
6712
6744
|
"folder-field source",
|
|
6713
6745
|
"source-folder-wrapper"
|
|
6714
6746
|
), Ue = document.createElement("span");
|
|
6715
|
-
Ue.id = "source-folder-name", Ue.textContent =
|
|
6747
|
+
Ue.id = "source-folder-name", Ue.textContent = A(this, Lt) ? A(this, Lt) : e.folderName, Me.append(Gt(), Ue);
|
|
6716
6748
|
let Be = "";
|
|
6717
6749
|
tt.append(Le, Me), pe.onchange = (ce) => {
|
|
6718
6750
|
Be = ce.target.value;
|
|
6719
|
-
}, Be = Be !== "" ? Be : e.name, N.append(ne),
|
|
6751
|
+
}, Be = Be !== "" ? Be : e.name, N.append(ne), F.append(
|
|
6720
6752
|
Ne,
|
|
6721
6753
|
fe,
|
|
6722
6754
|
tt
|
|
@@ -6737,7 +6769,7 @@ class Ms {
|
|
|
6737
6769
|
});
|
|
6738
6770
|
}, I.onclick = (ce) => {
|
|
6739
6771
|
ce.stopPropagation(), je.hide(), ye.show({
|
|
6740
|
-
content:
|
|
6772
|
+
content: F,
|
|
6741
6773
|
header: `Move "${e.name}"`,
|
|
6742
6774
|
confirmButtonText: "Move",
|
|
6743
6775
|
dialogContentStyle: {
|
|
@@ -6790,44 +6822,44 @@ class Ms {
|
|
|
6790
6822
|
content: u,
|
|
6791
6823
|
mainContainer: n,
|
|
6792
6824
|
divId: e.key
|
|
6793
|
-
}),
|
|
6825
|
+
}), H(this, gt, e.key);
|
|
6794
6826
|
}), i.addEventListener("click", () => {
|
|
6795
|
-
const ce =
|
|
6827
|
+
const ce = A(this, ge).findIndex(
|
|
6796
6828
|
(rt) => (rt == null ? void 0 : rt.key) === (e == null ? void 0 : e.key)
|
|
6797
6829
|
);
|
|
6798
6830
|
if (t.classList.contains("checked"))
|
|
6799
|
-
t.classList.remove("checked"), ce !== -1 && (
|
|
6831
|
+
t.classList.remove("checked"), ce !== -1 && (A(this, ge).splice(ce, 1), A(this, kt) === 1 && a.remove());
|
|
6800
6832
|
else {
|
|
6801
|
-
if (
|
|
6802
|
-
|
|
6833
|
+
if (A(this, En))
|
|
6834
|
+
A(this, ge).push(e);
|
|
6803
6835
|
else {
|
|
6804
6836
|
const rt = document.querySelector(
|
|
6805
6837
|
".selected-image-wrapper .checked"
|
|
6806
6838
|
);
|
|
6807
|
-
rt == null || rt.classList.remove("checked"),
|
|
6839
|
+
rt == null || rt.classList.remove("checked"), H(this, ge, [e]);
|
|
6808
6840
|
}
|
|
6809
6841
|
t.classList.add("checked");
|
|
6810
6842
|
}
|
|
6811
6843
|
this._updateContent();
|
|
6812
6844
|
}), document.addEventListener("click", (ce) => {
|
|
6813
|
-
const
|
|
6814
|
-
|
|
6815
|
-
}),
|
|
6845
|
+
const We = document.querySelector(`#${A(this, gt)}`);
|
|
6846
|
+
We && (ce.composedPath().includes(We) || je.hide());
|
|
6847
|
+
}), A(this, ge).findIndex(
|
|
6816
6848
|
(ce) => (ce == null ? void 0 : ce.key) === (e == null ? void 0 : e.key)
|
|
6817
|
-
) !== -1 ? (t.classList.add("checked"),
|
|
6849
|
+
) !== -1 ? (t.classList.add("checked"), A(this, mt) ? A(this, Ce).prepend(a) : A(this, Ce).appendChild(a)) : A(this, Ce).appendChild(a);
|
|
6818
6850
|
}
|
|
6819
6851
|
_renderImageCard(e) {
|
|
6820
6852
|
this._fileCardBody(e);
|
|
6821
6853
|
}
|
|
6822
6854
|
_renderImageListContainer() {
|
|
6823
6855
|
var e, t;
|
|
6824
|
-
((e =
|
|
6856
|
+
((e = A(this, ke)) == null ? void 0 : e.length) > 0 && ((t = A(this, ke)) == null || t.forEach((n) => {
|
|
6825
6857
|
this._renderImageCard(n);
|
|
6826
6858
|
}));
|
|
6827
6859
|
}
|
|
6828
6860
|
_renderSelectedImageListContainer() {
|
|
6829
6861
|
var e;
|
|
6830
|
-
((e =
|
|
6862
|
+
((e = A(this, ge)) == null ? void 0 : e.length) > 0 && A(this, ge).forEach((t) => {
|
|
6831
6863
|
this._renderImageCard(t);
|
|
6832
6864
|
});
|
|
6833
6865
|
}
|
|
@@ -6847,9 +6879,9 @@ class Ms {
|
|
|
6847
6879
|
const n = document.createElement("div");
|
|
6848
6880
|
n.style.position = "relative", n.style.display = "flex", n.style.alignItems = "center", n.style.gap = "2px";
|
|
6849
6881
|
const r = document.createElement("span"), i = document.createElement("span");
|
|
6850
|
-
if (i.className = "folder-name", i.textContent = e == null ? void 0 : e.name, r.appendChild(
|
|
6882
|
+
if (i.className = "folder-name", i.textContent = e == null ? void 0 : e.name, r.appendChild(Gt()), n.append(r, i), t.append(n), e.children && Object.keys(e.children).length > 0) {
|
|
6851
6883
|
const a = document.createElement("button");
|
|
6852
|
-
a.classList.add("expand-icon"), a.appendChild(
|
|
6884
|
+
a.classList.add("expand-icon"), a.appendChild(or()), n.prepend(a);
|
|
6853
6885
|
const c = document.createElement("ul");
|
|
6854
6886
|
c.className = "folders nested", t.appendChild(c), a.addEventListener("click", (h) => {
|
|
6855
6887
|
h.stopPropagation(), t.classList.toggle("active"), c.classList.toggle("visible");
|
|
@@ -6867,11 +6899,11 @@ class Ms {
|
|
|
6867
6899
|
"moveToInputField.disabled",
|
|
6868
6900
|
!1,
|
|
6869
6901
|
'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-ellipsis"><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/></svg>'
|
|
6870
|
-
), c = K("action-wrapper"), h = He("", "action-option edit"), l = ie("Edit", ""), u =
|
|
6902
|
+
), c = K("action-wrapper"), h = He("", "action-option edit"), l = ie("Edit", ""), u = lr();
|
|
6871
6903
|
h.append(u, l);
|
|
6872
6904
|
const d = K("edit-form-wrapper"), f = K("name-field-wrapper"), y = ie("Name", "input-label"), I = document.createElement("input");
|
|
6873
|
-
I.classList.add("input-field"), I.value = e.name, I.onchange = (
|
|
6874
|
-
|
|
6905
|
+
I.classList.add("input-field"), I.value = e.name, I.onchange = (k) => {
|
|
6906
|
+
k.target.value;
|
|
6875
6907
|
}, f.append(y, I), d.append(f);
|
|
6876
6908
|
const L = {
|
|
6877
6909
|
key: e.key,
|
|
@@ -6880,9 +6912,9 @@ class Ms {
|
|
|
6880
6912
|
createdBy: e.createdBy
|
|
6881
6913
|
};
|
|
6882
6914
|
this._createUpdateFolderDialog(h, "update", L);
|
|
6883
|
-
const C = He("", "action-option delete"), R = ie("Delete", ""), O =
|
|
6884
|
-
C.append(O, R), c.append(h, C), C.onclick = (
|
|
6885
|
-
|
|
6915
|
+
const C = He("", "action-option delete"), R = ie("Delete", ""), O = dr();
|
|
6916
|
+
C.append(O, R), c.append(h, C), C.onclick = (k) => {
|
|
6917
|
+
k.stopPropagation(), je.hide(), ye.show({
|
|
6886
6918
|
content: "",
|
|
6887
6919
|
dialogContentStyle: {
|
|
6888
6920
|
minWidth: "32rem",
|
|
@@ -6896,20 +6928,20 @@ class Ms {
|
|
|
6896
6928
|
this._deleteFolder(e.key);
|
|
6897
6929
|
}
|
|
6898
6930
|
});
|
|
6899
|
-
}, a.addEventListener("click", (
|
|
6900
|
-
|
|
6931
|
+
}, a.addEventListener("click", (k) => {
|
|
6932
|
+
k.stopPropagation();
|
|
6901
6933
|
const x = document.querySelector(`#${e.key}`);
|
|
6902
|
-
|
|
6934
|
+
H(this, gt, null), A(this, gt) === e.key && x !== null ? je.hide() : (je.hide(), je.show({
|
|
6903
6935
|
content: c,
|
|
6904
6936
|
mainContainer: n,
|
|
6905
6937
|
divId: e.key
|
|
6906
|
-
}),
|
|
6938
|
+
}), H(this, gt, e.key));
|
|
6907
6939
|
}), n.appendChild(a);
|
|
6908
6940
|
}
|
|
6909
6941
|
return t.addEventListener("click", (a) => {
|
|
6910
6942
|
var c;
|
|
6911
|
-
a.stopPropagation(),
|
|
6912
|
-
}), ((o =
|
|
6943
|
+
a.stopPropagation(), H(this, Ge, e), H(this, vt, e == null ? void 0 : e.name), H(this, ge, []), H(this, ke, []), H(this, at, ""), H(this, Nt, !1), (c = document.querySelector(".folder.selected")) == null || c.classList.remove("selected"), t.classList.add("selected"), this._fetchFilesFromFolder(e.name);
|
|
6944
|
+
}), ((o = A(this, Ge)) == null ? void 0 : o.key) === (e == null ? void 0 : e.key) && t.classList.add("selected"), t;
|
|
6913
6945
|
}
|
|
6914
6946
|
_renderEditFolderListContainer(e) {
|
|
6915
6947
|
var o;
|
|
@@ -6918,9 +6950,9 @@ class Ms {
|
|
|
6918
6950
|
const n = document.createElement("div");
|
|
6919
6951
|
n.style.position = "relative", n.style.display = "flex", n.style.alignItems = "center", n.style.gap = "2px";
|
|
6920
6952
|
const r = document.createElement("span"), i = document.createElement("span");
|
|
6921
|
-
if (i.className = "folder-name", i.textContent = e == null ? void 0 : e.name, r.appendChild(
|
|
6953
|
+
if (i.className = "folder-name", i.textContent = e == null ? void 0 : e.name, r.appendChild(Gt()), n.append(r, i), t.append(n), e.children && Object.keys(e.children).length > 0) {
|
|
6922
6954
|
const a = document.createElement("button");
|
|
6923
|
-
a.classList.add("expand-icon"), a.appendChild(
|
|
6955
|
+
a.classList.add("expand-icon"), a.appendChild(or()), n.prepend(a);
|
|
6924
6956
|
const c = document.createElement("ul");
|
|
6925
6957
|
c.className = "folders nested", t.appendChild(c), a.addEventListener("click", (h) => {
|
|
6926
6958
|
h.stopPropagation(), t.classList.toggle("active"), c.classList.toggle("visible");
|
|
@@ -6931,94 +6963,94 @@ class Ms {
|
|
|
6931
6963
|
}
|
|
6932
6964
|
return t.addEventListener("click", (a) => {
|
|
6933
6965
|
var h;
|
|
6934
|
-
a.stopPropagation(),
|
|
6966
|
+
a.stopPropagation(), H(this, Lt, e == null ? void 0 : e.name);
|
|
6935
6967
|
const c = document.querySelector(
|
|
6936
6968
|
"#source-folder-name"
|
|
6937
6969
|
);
|
|
6938
6970
|
c.textContent = "", c.textContent = e == null ? void 0 : e.name, (h = document.querySelector(".folder-move.selected")) == null || h.classList.remove("selected"), t.classList.add("selected");
|
|
6939
|
-
}), ((o =
|
|
6971
|
+
}), ((o = A(this, Ge)) == null ? void 0 : o.key) === (e == null ? void 0 : e.key) && t.classList.add("selected"), t;
|
|
6940
6972
|
}
|
|
6941
6973
|
_updateFolderListContainer() {
|
|
6942
|
-
if (
|
|
6943
|
-
if (
|
|
6974
|
+
if (A(this, Ft))
|
|
6975
|
+
if (A(this, pt).innerHTML = "", A(this, Bt)) {
|
|
6944
6976
|
const e = this._renderFolderListLoadingUI();
|
|
6945
|
-
|
|
6977
|
+
A(this, pt).appendChild(e);
|
|
6946
6978
|
} else {
|
|
6947
6979
|
const e = document.createElement("ul");
|
|
6948
|
-
e.className = "folders",
|
|
6980
|
+
e.className = "folders", A(this, pt).appendChild(e), A(this, st).forEach((t) => {
|
|
6949
6981
|
const n = this._renderFolderListContainer(t);
|
|
6950
6982
|
e.appendChild(n);
|
|
6951
|
-
}),
|
|
6983
|
+
}), A(this, Ft).appendChild(A(this, pt));
|
|
6952
6984
|
}
|
|
6953
6985
|
}
|
|
6954
6986
|
_renderToastContainer(e, t, n) {
|
|
6955
|
-
this._removeToastContainer(),
|
|
6956
|
-
const r =
|
|
6987
|
+
this._removeToastContainer(), H(this, ot, document.createElement("div")), A(this, ot).className = `message-container ${t}`;
|
|
6988
|
+
const r = Jt(e, "message"), i = t === "success" ? ar() : xn(), o = He("");
|
|
6957
6989
|
o.style.cursor = "pointer", o.style.border = "0", o.style.outline = "none", o.style.background = "transparent", o.appendChild(
|
|
6958
|
-
|
|
6990
|
+
Vn(t === "error" ? "#ee3f3f" : "#4caf50")
|
|
6959
6991
|
), o.setAttribute(
|
|
6960
6992
|
"fill",
|
|
6961
6993
|
t === "error" ? "#ee3f3f" : "#4caf50"
|
|
6962
|
-
), o.onclick = () => this._removeToastContainer(),
|
|
6994
|
+
), o.onclick = () => this._removeToastContainer(), A(this, ot).append(i, r, o), n.appendChild(A(this, ot)), setTimeout(() => {
|
|
6963
6995
|
this._removeToastContainer();
|
|
6964
6996
|
}, 5e3);
|
|
6965
6997
|
}
|
|
6966
6998
|
_removeToastContainer() {
|
|
6967
|
-
|
|
6999
|
+
A(this, ot) && (A(this, ot).remove(), H(this, ot, null));
|
|
6968
7000
|
}
|
|
6969
7001
|
_updateSelectedImageListContainerUI() {
|
|
6970
7002
|
var t, n;
|
|
6971
|
-
if (!
|
|
6972
|
-
|
|
7003
|
+
if (!A(this, Ce)) return;
|
|
7004
|
+
A(this, Ce).innerHTML = "", A(this, it) && this._renderLoadingUI(), A(this, $e) && this._renderFetchingSkeletonUI();
|
|
6973
7005
|
const e = document.getElementById(
|
|
6974
7006
|
"search-input-wrapper"
|
|
6975
7007
|
);
|
|
6976
|
-
|
|
7008
|
+
A(this, kt) === 0 ? (e && (e.style.visibility = "visible"), ((t = A(this, ke)) == null ? void 0 : t.length) === 0 && !A(this, $e) ? (A(this, Ce).classList.add(
|
|
6977
7009
|
"no-selected-image-container"
|
|
6978
|
-
), this._renderEmptyImageContainer()) : (
|
|
7010
|
+
), this._renderEmptyImageContainer()) : (A(this, Ce).classList.remove(
|
|
6979
7011
|
"no-selected-image-container"
|
|
6980
|
-
), this._renderImageListContainer())) : (e && (e.style.visibility = "hidden"), ((n =
|
|
7012
|
+
), this._renderImageListContainer())) : (e && (e.style.visibility = "hidden"), ((n = A(this, ge)) == null ? void 0 : n.length) === 0 ? (A(this, Ce).classList.add(
|
|
6981
7013
|
"no-selected-image-container"
|
|
6982
|
-
), this._renderEmptyImageContainer()) : (
|
|
7014
|
+
), this._renderEmptyImageContainer()) : (A(this, Ce).classList.remove(
|
|
6983
7015
|
"no-selected-image-container"
|
|
6984
7016
|
), this._renderSelectedImageListContainer())), this._updateContent();
|
|
6985
7017
|
}
|
|
6986
7018
|
_updateContent() {
|
|
6987
7019
|
var t, n, r;
|
|
6988
7020
|
const e = document.getElementById("selected-images-tab");
|
|
6989
|
-
e && (e.textContent = `Selected (${(t =
|
|
7021
|
+
e && (e.textContent = `Selected (${(t = A(this, ge)) == null ? void 0 : t.length})`), A(this, At).textContent = `Save (${(n = A(this, ge)) == null ? void 0 : n.length})`, A(this, At).disabled = ((r = A(this, ge)) == null ? void 0 : r.length) === 0;
|
|
6990
7022
|
}
|
|
6991
7023
|
async _uploadAndAddSelectedImageList(e, t) {
|
|
6992
7024
|
var n, r;
|
|
6993
7025
|
this._updateSelectedImageListContainerUI();
|
|
6994
7026
|
try {
|
|
6995
|
-
const i = await
|
|
7027
|
+
const i = await gr(e, t, A(this, Se)), o = await Ji(
|
|
6996
7028
|
t == null ? void 0 : t.name,
|
|
6997
7029
|
"",
|
|
6998
7030
|
i,
|
|
6999
|
-
ct[
|
|
7000
|
-
(r =
|
|
7001
|
-
|
|
7031
|
+
ct[ur((n = t.type) == null ? void 0 : n.split("/")[0])],
|
|
7032
|
+
(r = A(this, Ge)) == null ? void 0 : r.name,
|
|
7033
|
+
A(this, Se)
|
|
7002
7034
|
);
|
|
7003
|
-
|
|
7035
|
+
A(this, ke).unshift(o == null ? void 0 : o.response), this._renderToastContainer(
|
|
7004
7036
|
"File Uploaded Successfully",
|
|
7005
7037
|
"success",
|
|
7006
|
-
|
|
7038
|
+
A(this, be)
|
|
7007
7039
|
);
|
|
7008
7040
|
} catch {
|
|
7009
7041
|
this._renderToastContainer(
|
|
7010
7042
|
"Something went wrong while uploading file. Please try again later.",
|
|
7011
7043
|
"error",
|
|
7012
|
-
|
|
7044
|
+
A(this, be)
|
|
7013
7045
|
);
|
|
7014
7046
|
} finally {
|
|
7015
|
-
|
|
7047
|
+
H(this, it, !1), this._updateSelectedImageListContainerUI();
|
|
7016
7048
|
}
|
|
7017
7049
|
}
|
|
7018
7050
|
async _updateFile(e, t) {
|
|
7019
7051
|
ye.updateUploadBtn(!0);
|
|
7020
7052
|
try {
|
|
7021
|
-
const n = await
|
|
7053
|
+
const n = await ts(
|
|
7022
7054
|
t.key,
|
|
7023
7055
|
e,
|
|
7024
7056
|
t.nestedFolderName,
|
|
@@ -7026,21 +7058,21 @@ class Ms {
|
|
|
7026
7058
|
t.thumborUrl,
|
|
7027
7059
|
t.proxyUrl,
|
|
7028
7060
|
t.type,
|
|
7029
|
-
|
|
7030
|
-
|
|
7031
|
-
), r =
|
|
7061
|
+
A(this, Lt),
|
|
7062
|
+
A(this, Se)
|
|
7063
|
+
), r = A(this, ke).find(
|
|
7032
7064
|
(i) => i.key === n.response.key
|
|
7033
7065
|
);
|
|
7034
|
-
r.name = e, this._fetchFilesFromFolder(
|
|
7066
|
+
r.name = e, this._fetchFilesFromFolder(A(this, Ge).name), H(this, ke, []), H(this, ge, []), this._renderToastContainer(
|
|
7035
7067
|
"File Updated Successfully",
|
|
7036
7068
|
"success",
|
|
7037
|
-
|
|
7069
|
+
A(this, be)
|
|
7038
7070
|
);
|
|
7039
7071
|
} catch {
|
|
7040
7072
|
this._renderToastContainer(
|
|
7041
7073
|
"Something went wrong while updating the file. Please try again later.",
|
|
7042
7074
|
"error",
|
|
7043
|
-
|
|
7075
|
+
A(this, be)
|
|
7044
7076
|
);
|
|
7045
7077
|
} finally {
|
|
7046
7078
|
ye.updateUploadBtn(!1), ye.hide(), this._updateSelectedImageListContainerUI();
|
|
@@ -7049,16 +7081,16 @@ class Ms {
|
|
|
7049
7081
|
async _deleteFile(e) {
|
|
7050
7082
|
ye.updateUploadBtn(!0);
|
|
7051
7083
|
try {
|
|
7052
|
-
await
|
|
7084
|
+
await ns(e, A(this, Se)), H(this, ke, A(this, ke).filter((t) => e !== t.key)), this._renderToastContainer(
|
|
7053
7085
|
"File Deleted Successfully",
|
|
7054
7086
|
"success",
|
|
7055
|
-
|
|
7087
|
+
A(this, be)
|
|
7056
7088
|
);
|
|
7057
7089
|
} catch {
|
|
7058
7090
|
this._renderToastContainer(
|
|
7059
7091
|
"Something went wrong while deleting the file. Please try again later.",
|
|
7060
7092
|
"error",
|
|
7061
|
-
|
|
7093
|
+
A(this, be)
|
|
7062
7094
|
);
|
|
7063
7095
|
} finally {
|
|
7064
7096
|
ye.updateUploadBtn(!1), ye.hide(), this._updateSelectedImageListContainerUI();
|
|
@@ -7067,18 +7099,18 @@ class Ms {
|
|
|
7067
7099
|
async _createFolder(e, t = 2) {
|
|
7068
7100
|
var n;
|
|
7069
7101
|
try {
|
|
7070
|
-
const r = await
|
|
7102
|
+
const r = await ds(
|
|
7071
7103
|
e,
|
|
7072
|
-
(n =
|
|
7104
|
+
(n = A(this, Ge)) == null ? void 0 : n.name,
|
|
7073
7105
|
"",
|
|
7074
|
-
|
|
7106
|
+
A(this, Se)
|
|
7075
7107
|
);
|
|
7076
|
-
|
|
7077
|
-
const i =
|
|
7078
|
-
|
|
7108
|
+
H(this, ge, []), H(this, ke, []);
|
|
7109
|
+
const i = vs(A(this, st), r == null ? void 0 : r.response);
|
|
7110
|
+
H(this, st, i), H(this, vt, e), H(this, Ge, { ...r == null ? void 0 : r.response, children: {} }), this._fetchFilesFromFolder(e), this._renderToastContainer(
|
|
7079
7111
|
`Folder ${e} created successfully`,
|
|
7080
7112
|
"success",
|
|
7081
|
-
|
|
7113
|
+
A(this, be)
|
|
7082
7114
|
);
|
|
7083
7115
|
} catch {
|
|
7084
7116
|
if (t > 1)
|
|
@@ -7087,7 +7119,7 @@ class Ms {
|
|
|
7087
7119
|
throw this._renderToastContainer(
|
|
7088
7120
|
`Error creating folder "${e}". Either folder already exist or failed to create folder`,
|
|
7089
7121
|
"error",
|
|
7090
|
-
|
|
7122
|
+
A(this, be)
|
|
7091
7123
|
), new Error(
|
|
7092
7124
|
`Error creating folder "${e}". Either folder already exist or failed to create folder`
|
|
7093
7125
|
);
|
|
@@ -7096,83 +7128,83 @@ class Ms {
|
|
|
7096
7128
|
}
|
|
7097
7129
|
}
|
|
7098
7130
|
async _upload() {
|
|
7099
|
-
return
|
|
7131
|
+
return A(this, nn) ? A(this, ge) : A(this, Pt);
|
|
7100
7132
|
}
|
|
7101
7133
|
async _fetchFilesFromFolder(e) {
|
|
7102
7134
|
var t, n, r;
|
|
7103
|
-
|
|
7135
|
+
H(this, $e, !0), this._updateSelectedImageListContainerUI();
|
|
7104
7136
|
try {
|
|
7105
|
-
const i = await
|
|
7137
|
+
const i = await Yi(
|
|
7106
7138
|
e,
|
|
7107
|
-
|
|
7139
|
+
A(this, at),
|
|
7108
7140
|
20,
|
|
7109
|
-
|
|
7141
|
+
A(this, Se)
|
|
7110
7142
|
), o = (t = i.response) == null ? void 0 : t.files;
|
|
7111
|
-
|
|
7143
|
+
A(this, ke).push(...o), H(this, at, (n = i.response) == null ? void 0 : n.nextCursor), H(this, Nt, (r = i.response) == null ? void 0 : r.hasMore);
|
|
7112
7144
|
} catch {
|
|
7113
7145
|
throw this._renderToastContainer(
|
|
7114
7146
|
"Error while fetching files from folder" + e,
|
|
7115
7147
|
"error",
|
|
7116
|
-
|
|
7148
|
+
A(this, be)
|
|
7117
7149
|
), new Error(
|
|
7118
7150
|
"Something went wrong. Error while fetching files from folder" + e
|
|
7119
7151
|
);
|
|
7120
7152
|
} finally {
|
|
7121
|
-
|
|
7153
|
+
H(this, $e, !1), this._updateSelectedImageListContainerUI();
|
|
7122
7154
|
}
|
|
7123
7155
|
}
|
|
7124
7156
|
async _fetchAllFolders() {
|
|
7125
7157
|
var e, t;
|
|
7126
|
-
|
|
7158
|
+
H(this, $e, !0), H(this, Bt, !0), this._updateSelectedImageListContainerUI(), this._updateFolderListContainer(), this._removeToastContainer();
|
|
7127
7159
|
try {
|
|
7128
|
-
const r = (await
|
|
7129
|
-
|
|
7160
|
+
const r = (await cs("", 100, A(this, Se))).response.folder, i = Es(r);
|
|
7161
|
+
H(this, vt, (e = i[0]) == null ? void 0 : e.name), this._fetchFilesFromFolder((t = i[0]) == null ? void 0 : t.name), H(this, Ge, i[0]), H(this, st, i);
|
|
7130
7162
|
} catch {
|
|
7131
|
-
|
|
7163
|
+
H(this, $e, !1), this._renderToastContainer(
|
|
7132
7164
|
"Folder not found. Please create a folder or try again later",
|
|
7133
7165
|
"error",
|
|
7134
|
-
|
|
7166
|
+
A(this, be)
|
|
7135
7167
|
);
|
|
7136
7168
|
} finally {
|
|
7137
|
-
|
|
7169
|
+
H(this, Bt, !1), this._updateFolderListContainer();
|
|
7138
7170
|
}
|
|
7139
7171
|
}
|
|
7140
7172
|
async _search(e) {
|
|
7141
7173
|
var t, n;
|
|
7142
|
-
|
|
7174
|
+
H(this, $e, !0), this._updateSelectedImageListContainerUI(), this._removeToastContainer();
|
|
7143
7175
|
try {
|
|
7144
|
-
const r = await
|
|
7176
|
+
const r = await es(
|
|
7145
7177
|
e,
|
|
7146
|
-
|
|
7178
|
+
A(this, at),
|
|
7147
7179
|
10,
|
|
7148
|
-
|
|
7180
|
+
A(this, Se)
|
|
7149
7181
|
), i = (t = r.response) == null ? void 0 : t.items;
|
|
7150
|
-
|
|
7182
|
+
A(this, ke).push(...i), H(this, at, (n = r.response) == null ? void 0 : n.nextPageCursor);
|
|
7151
7183
|
} catch {
|
|
7152
7184
|
this._renderToastContainer(
|
|
7153
7185
|
"Error while searching files",
|
|
7154
7186
|
"error",
|
|
7155
|
-
|
|
7187
|
+
A(this, be)
|
|
7156
7188
|
);
|
|
7157
7189
|
} finally {
|
|
7158
|
-
|
|
7190
|
+
H(this, $e, !1), this._updateSelectedImageListContainerUI();
|
|
7159
7191
|
}
|
|
7160
7192
|
}
|
|
7161
7193
|
async _updateFolder(e, t) {
|
|
7162
7194
|
ye.updateUploadBtn(!0);
|
|
7163
7195
|
try {
|
|
7164
|
-
const n = await
|
|
7196
|
+
const n = await hs(
|
|
7165
7197
|
t.key,
|
|
7166
7198
|
e,
|
|
7167
7199
|
t.nestedFolderName,
|
|
7168
7200
|
t.createdBy,
|
|
7169
|
-
|
|
7201
|
+
A(this, Se)
|
|
7170
7202
|
);
|
|
7171
7203
|
} catch {
|
|
7172
7204
|
throw this._renderToastContainer(
|
|
7173
7205
|
"Something went wrong while updating the folder. Please try again later.",
|
|
7174
7206
|
"error",
|
|
7175
|
-
|
|
7207
|
+
A(this, be)
|
|
7176
7208
|
), new Error("Error updating the folder ");
|
|
7177
7209
|
} finally {
|
|
7178
7210
|
ye.updateUploadBtn(!1), ye.hide(), this._updateFolderListContainer();
|
|
@@ -7181,16 +7213,16 @@ class Ms {
|
|
|
7181
7213
|
async _deleteFolder(e) {
|
|
7182
7214
|
ye.updateUploadBtn(!0);
|
|
7183
7215
|
try {
|
|
7184
|
-
await
|
|
7216
|
+
await us(e, A(this, Se)), H(this, st, A(this, st).filter((t) => t.key !== e)), this._renderToastContainer(
|
|
7185
7217
|
"Folder Deleted Successfully",
|
|
7186
7218
|
"success",
|
|
7187
|
-
|
|
7219
|
+
A(this, be)
|
|
7188
7220
|
);
|
|
7189
7221
|
} catch {
|
|
7190
7222
|
throw this._renderToastContainer(
|
|
7191
7223
|
"Something went wrong while deleting the folder. Please try again later.",
|
|
7192
7224
|
"error",
|
|
7193
|
-
|
|
7225
|
+
A(this, be)
|
|
7194
7226
|
), new Error("Error deleting the folder ");
|
|
7195
7227
|
} finally {
|
|
7196
7228
|
ye.updateUploadBtn(!1), ye.hide(), this._updateFolderListContainer();
|
|
@@ -7205,7 +7237,7 @@ class Ms {
|
|
|
7205
7237
|
const l = document.createElement("input");
|
|
7206
7238
|
l.style.paddingLeft = "40px";
|
|
7207
7239
|
const u = ie();
|
|
7208
|
-
u.appendChild(
|
|
7240
|
+
u.appendChild(Gt()), u.style.position = "absolute", u.style.top = "50%", u.style.left = "5%", u.style.transform = "translate(-40%, -40%)", l.classList.add("input-field"), h.append(l, u), t === "update" && (l.value = n.name), l.onchange = (d) => {
|
|
7209
7241
|
i = d.target.value;
|
|
7210
7242
|
}, a.append(c, h), o.append(a), ye.show({
|
|
7211
7243
|
content: o,
|
|
@@ -7232,13 +7264,13 @@ class Ms {
|
|
|
7232
7264
|
_initializeGrpcConfig(e, t) {
|
|
7233
7265
|
let n = "https://hamro-cms-backend-grpc.hamrostack.com";
|
|
7234
7266
|
t && (e === "production" || e === "development") ? n = t : e === "production" && (n = "https://page-api-grpc.hamropatro.com");
|
|
7235
|
-
const r = new
|
|
7267
|
+
const r = new Ri({
|
|
7236
7268
|
baseUrl: n
|
|
7237
7269
|
});
|
|
7238
7270
|
this.updateWindowObject({ grpcConfig: r });
|
|
7239
7271
|
}
|
|
7240
7272
|
}
|
|
7241
|
-
Et = new WeakMap(), be = new WeakMap(), Ce = new WeakMap(), ft = new WeakMap(), ge = new WeakMap(), ke = new WeakMap(), it = new WeakMap(), $e = new WeakMap(), Bt = new WeakMap(),
|
|
7273
|
+
Et = new WeakMap(), be = new WeakMap(), Ce = new WeakMap(), ft = new WeakMap(), ge = new WeakMap(), ke = new WeakMap(), it = new WeakMap(), $e = new WeakMap(), Bt = new WeakMap(), vt = new WeakMap(), st = new WeakMap(), Ge = new WeakMap(), At = new WeakMap(), Ht = new WeakMap(), Cn = new WeakMap(), kt = new WeakMap(), Ft = new WeakMap(), pt = new WeakMap(), Ot = new WeakMap(), ot = new WeakMap(), at = new WeakMap(), Nt = new WeakMap(), It = new WeakMap(), mt = new WeakMap(), $t = new WeakMap(), en = new WeakMap(), Se = new WeakMap(), gt = new WeakMap(), tn = new WeakMap(), En = new WeakMap(), nn = new WeakMap(), Te = new WeakMap(), Pt = new WeakMap(), Lt = new WeakMap(), Wt = new WeakMap(), jt = new WeakMap(), Zt = new WeakMap(), qt = new WeakMap(), Kt = new WeakMap(), rn = new WeakMap();
|
|
7242
7274
|
export {
|
|
7243
|
-
|
|
7275
|
+
Hs as default
|
|
7244
7276
|
};
|