image-salon-sdk 1.0.49 → 1.0.50
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 +652 -647
- package/dist/image-salon-sdk.umd.cjs +6 -6
- package/dist/style.css +1 -1
- package/dist/types/image-salon-types.d.ts +1 -0
- 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 Gr = Object.defineProperty;
|
|
3
|
+
var Kn = (s) => {
|
|
4
4
|
throw TypeError(s);
|
|
5
5
|
};
|
|
6
|
-
var
|
|
7
|
-
var he = (s, e, t) =>
|
|
8
|
-
var
|
|
9
|
-
function
|
|
6
|
+
var Jr = (s, e, t) => e in s ? Gr(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
7
|
+
var he = (s, e, t) => Jr(s, typeof e != "symbol" ? e + "" : e, t), zn = (s, e, t) => e.has(s) || Kn("Cannot " + t);
|
|
8
|
+
var v = (s, e, t) => (zn(s, e, "read from private field"), t ? t.call(s) : e.get(s)), X = (s, e, t) => e.has(s) ? Kn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, t), H = (s, e, t, n) => (zn(s, e, "write to private field"), n ? n.call(s, t) : e.set(s, t), t);
|
|
9
|
+
function br(s) {
|
|
10
10
|
let e = typeof s;
|
|
11
11
|
if (e == "object") {
|
|
12
12
|
if (Array.isArray(s))
|
|
@@ -16,20 +16,20 @@ function yr(s) {
|
|
|
16
16
|
}
|
|
17
17
|
return e;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function Qr(s) {
|
|
20
20
|
return s !== null && typeof s == "object" && !Array.isArray(s);
|
|
21
21
|
}
|
|
22
|
-
let wt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),
|
|
22
|
+
let wt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), An = [];
|
|
23
23
|
for (let s = 0; s < wt.length; s++)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
function
|
|
24
|
+
An[wt[s].charCodeAt(0)] = s;
|
|
25
|
+
An[45] = wt.indexOf("+");
|
|
26
|
+
An[95] = wt.indexOf("/");
|
|
27
|
+
function Cr(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 = An[s.charCodeAt(a)], i === void 0)
|
|
33
33
|
switch (s[a]) {
|
|
34
34
|
case "=":
|
|
35
35
|
r = 0;
|
|
@@ -61,7 +61,7 @@ function br(s) {
|
|
|
61
61
|
throw Error("invalid base64 string.");
|
|
62
62
|
return t.subarray(0, n);
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function Er(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 Yr(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 ei() {
|
|
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 Yr() {
|
|
|
117
117
|
}
|
|
118
118
|
throw new Error("invalid varint");
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function In(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 Nn(s, e, t) {
|
|
|
133
133
|
t.push(e >>> 31 & 1);
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
-
const
|
|
137
|
-
function
|
|
136
|
+
const un = 65536 * 65536;
|
|
137
|
+
function vr(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 >= un && (r = r + (n / un | 0), n = n % un);
|
|
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 Dn(s, e) {
|
|
149
149
|
if (e >>> 0 <= 2097151)
|
|
150
|
-
return "" + (
|
|
150
|
+
return "" + (un * 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 Sn(s, e) {
|
|
|
170
170
|
1
|
|
171
171
|
);
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
function Xn(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 zn(s, e) {
|
|
|
181
181
|
e.push(1);
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function ti() {
|
|
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 ei() {
|
|
|
199
199
|
return this.assertBounds(), e >>> 0;
|
|
200
200
|
}
|
|
201
201
|
let oe;
|
|
202
|
-
function
|
|
202
|
+
function ni() {
|
|
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 ti() {
|
|
|
210
210
|
V: s
|
|
211
211
|
} : void 0;
|
|
212
212
|
}
|
|
213
|
-
|
|
214
|
-
function
|
|
213
|
+
ni();
|
|
214
|
+
function Ar(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 kr = /^-?[0-9]+$/, pn = 4294967296, an = 2147483648;
|
|
219
|
+
class Fr {
|
|
220
220
|
/**
|
|
221
221
|
* Create a new instance with the given bits.
|
|
222
222
|
*/
|
|
@@ -233,13 +233,13 @@ class kr {
|
|
|
233
233
|
* Convert to a native number.
|
|
234
234
|
*/
|
|
235
235
|
toNumber() {
|
|
236
|
-
let e = this.hi *
|
|
236
|
+
let e = this.hi * pn + (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 Fr {
|
|
243
243
|
/**
|
|
244
244
|
* Create instance from a `string`, `number` or `bigint`.
|
|
245
245
|
*/
|
|
@@ -270,9 +270,9 @@ class De extends kr {
|
|
|
270
270
|
case "string":
|
|
271
271
|
if (e == "0")
|
|
272
272
|
return this.ZERO;
|
|
273
|
-
if (e = e.trim(), !
|
|
273
|
+
if (e = e.trim(), !kr.test(e))
|
|
274
274
|
throw new Error("string is no integer");
|
|
275
|
-
let [t, n, r] =
|
|
275
|
+
let [t, n, r] = vr(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 kr {
|
|
|
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 / pn);
|
|
287
287
|
}
|
|
288
288
|
throw new Error("unknown value " + typeof e);
|
|
289
289
|
}
|
|
@@ -291,17 +291,17 @@ class De extends kr {
|
|
|
291
291
|
* Convert to decimal string.
|
|
292
292
|
*/
|
|
293
293
|
toString() {
|
|
294
|
-
return oe ? this.toBigInt().toString() :
|
|
294
|
+
return oe ? this.toBigInt().toString() : Dn(this.lo, this.hi);
|
|
295
295
|
}
|
|
296
296
|
/**
|
|
297
297
|
* Convert to native bigint.
|
|
298
298
|
*/
|
|
299
299
|
toBigInt() {
|
|
300
|
-
return
|
|
300
|
+
return Ar(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 Fr {
|
|
305
305
|
/**
|
|
306
306
|
* Create instance from a `string`, `number` or `bigint`.
|
|
307
307
|
*/
|
|
@@ -332,13 +332,13 @@ class Ee extends kr {
|
|
|
332
332
|
case "string":
|
|
333
333
|
if (e == "0")
|
|
334
334
|
return this.ZERO;
|
|
335
|
-
if (e = e.trim(), !
|
|
335
|
+
if (e = e.trim(), !kr.test(e))
|
|
336
336
|
throw new Error("string is no integer");
|
|
337
|
-
let [t, n, r] =
|
|
337
|
+
let [t, n, r] = vr(e);
|
|
338
338
|
if (t) {
|
|
339
|
-
if (r >
|
|
339
|
+
if (r > an || r == an && n != 0)
|
|
340
340
|
throw new Error("signed long too small");
|
|
341
|
-
} else if (r >=
|
|
341
|
+
} else if (r >= an)
|
|
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 kr {
|
|
|
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 / pn) : new Ee(-e, -e / pn).negate();
|
|
351
351
|
}
|
|
352
352
|
throw new Error("unknown value " + typeof e);
|
|
353
353
|
}
|
|
@@ -355,7 +355,7 @@ class Ee extends kr {
|
|
|
355
355
|
* Do we have a minus sign?
|
|
356
356
|
*/
|
|
357
357
|
isNegative() {
|
|
358
|
-
return (this.hi &
|
|
358
|
+
return (this.hi & an) !== 0;
|
|
359
359
|
}
|
|
360
360
|
/**
|
|
361
361
|
* Negate two's complement.
|
|
@@ -373,28 +373,28 @@ class Ee extends kr {
|
|
|
373
373
|
return this.toBigInt().toString();
|
|
374
374
|
if (this.isNegative()) {
|
|
375
375
|
let e = this.negate();
|
|
376
|
-
return "-" +
|
|
376
|
+
return "-" + Dn(e.lo, e.hi);
|
|
377
377
|
}
|
|
378
|
-
return
|
|
378
|
+
return Dn(this.lo, this.hi);
|
|
379
379
|
}
|
|
380
380
|
/**
|
|
381
381
|
* Convert to native bigint.
|
|
382
382
|
*/
|
|
383
383
|
toBigInt() {
|
|
384
|
-
return
|
|
384
|
+
return Ar(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 Gn = {
|
|
389
389
|
readUnknownField: !0,
|
|
390
|
-
readerFactory: (s) => new
|
|
390
|
+
readerFactory: (s) => new ii(s)
|
|
391
391
|
};
|
|
392
|
-
function
|
|
393
|
-
return s ? Object.assign(Object.assign({},
|
|
392
|
+
function ri(s) {
|
|
393
|
+
return s ? Object.assign(Object.assign({}, Gn), s) : Gn;
|
|
394
394
|
}
|
|
395
|
-
class
|
|
395
|
+
class ii {
|
|
396
396
|
constructor(e, t) {
|
|
397
|
-
this.varint64 =
|
|
397
|
+
this.varint64 = ei, this.uint32 = ti, 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
|
|
541
|
+
const si = 34028234663852886e22, oi = -34028234663852886e22, ai = 4294967295, li = 2147483647, ci = -2147483648;
|
|
542
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 > li || s < ci)
|
|
546
546
|
throw new Error("invalid int 32: " + s);
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function mn(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 > ai || s < 0)
|
|
552
552
|
throw new Error("invalid uint 32: " + s);
|
|
553
553
|
}
|
|
554
|
-
function
|
|
554
|
+
function Pn(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 > si || s < oi))
|
|
558
558
|
throw new Error("invalid float 32: " + s);
|
|
559
559
|
}
|
|
560
|
-
const
|
|
560
|
+
const Jn = {
|
|
561
561
|
writeUnknownFields: !0,
|
|
562
|
-
writerFactory: () => new
|
|
562
|
+
writerFactory: () => new hi()
|
|
563
563
|
};
|
|
564
|
-
function
|
|
565
|
-
return s ? Object.assign(Object.assign({},
|
|
564
|
+
function di(s) {
|
|
565
|
+
return s ? Object.assign(Object.assign({}, Jn), s) : Jn;
|
|
566
566
|
}
|
|
567
|
-
class
|
|
567
|
+
class hi {
|
|
568
568
|
constructor(e) {
|
|
569
569
|
this.stack = [], this.textEncoder = e ?? new TextEncoder(), this.chunks = [], this.buf = [];
|
|
570
570
|
}
|
|
@@ -620,7 +620,7 @@ class di {
|
|
|
620
620
|
* Write a `uint32` value, an unsigned 32 bit varint.
|
|
621
621
|
*/
|
|
622
622
|
uint32(e) {
|
|
623
|
-
for (
|
|
623
|
+
for (mn(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 di {
|
|
|
628
628
|
* Write a `int32` value, a signed 32 bit varint.
|
|
629
629
|
*/
|
|
630
630
|
int32(e) {
|
|
631
|
-
return Yt(e),
|
|
631
|
+
return Yt(e), Xn(e, this.buf), this;
|
|
632
632
|
}
|
|
633
633
|
/**
|
|
634
634
|
* Write a `bool` value, a variant.
|
|
@@ -653,7 +653,7 @@ class di {
|
|
|
653
653
|
* Write a `float` value, 32-bit floating point number.
|
|
654
654
|
*/
|
|
655
655
|
float(e) {
|
|
656
|
-
|
|
656
|
+
Pn(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 di {
|
|
|
668
668
|
* Write a `fixed32` value, an unsigned, fixed-length 32-bit integer.
|
|
669
669
|
*/
|
|
670
670
|
fixed32(e) {
|
|
671
|
-
|
|
671
|
+
mn(e);
|
|
672
672
|
let t = new Uint8Array(4);
|
|
673
673
|
return new DataView(t.buffer).setUint32(0, e, !0), this.raw(t);
|
|
674
674
|
}
|
|
@@ -684,7 +684,7 @@ class di {
|
|
|
684
684
|
* Write a `sint32` value, a signed, zigzag-encoded 32-bit varint.
|
|
685
685
|
*/
|
|
686
686
|
sint32(e) {
|
|
687
|
-
return Yt(e), e = (e << 1 ^ e >> 31) >>> 0,
|
|
687
|
+
return Yt(e), e = (e << 1 ^ e >> 31) >>> 0, Xn(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 di {
|
|
|
705
705
|
*/
|
|
706
706
|
int64(e) {
|
|
707
707
|
let t = Ee.from(e);
|
|
708
|
-
return
|
|
708
|
+
return In(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 In(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 In(t.lo, t.hi, this.buf), this;
|
|
723
723
|
}
|
|
724
724
|
}
|
|
725
|
-
const
|
|
725
|
+
const Qn = {
|
|
726
726
|
emitDefaultValues: !1,
|
|
727
727
|
enumAsInteger: !1,
|
|
728
728
|
useProtoFieldName: !1,
|
|
729
729
|
prettySpaces: 0
|
|
730
|
-
},
|
|
730
|
+
}, Yn = {
|
|
731
731
|
ignoreUnknownFields: !1
|
|
732
732
|
};
|
|
733
|
-
function hi(s) {
|
|
734
|
-
return s ? Object.assign(Object.assign({}, Qn), s) : Qn;
|
|
735
|
-
}
|
|
736
733
|
function ui(s) {
|
|
737
|
-
return s ? Object.assign(Object.assign({},
|
|
734
|
+
return s ? Object.assign(Object.assign({}, Yn), s) : Yn;
|
|
735
|
+
}
|
|
736
|
+
function fi(s) {
|
|
737
|
+
return s ? Object.assign(Object.assign({}, Qn), s) : Qn;
|
|
738
738
|
}
|
|
739
|
-
function
|
|
739
|
+
function pi(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 Nr = Symbol.for("protobuf-ts/message-type");
|
|
745
|
+
function Rn(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 gn;
|
|
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
|
+
})(gn || (gn = {}));
|
|
766
|
+
function mi(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 : Rn(s.name), s.jsonName = (t = s.jsonName) !== null && t !== void 0 ? t : Rn(s.name), s.repeat = (n = s.repeat) !== null && n !== void 0 ? n : gn.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 gi(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 mi(s) {
|
|
|
779
779
|
return !1;
|
|
780
780
|
}
|
|
781
781
|
}
|
|
782
|
-
class
|
|
782
|
+
class wi {
|
|
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 gi {
|
|
|
839
839
|
return !0;
|
|
840
840
|
for (const o of i.oneofs) {
|
|
841
841
|
const a = e[o];
|
|
842
|
-
if (!
|
|
842
|
+
if (!gi(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 yi {
|
|
969
969
|
constructor(e) {
|
|
970
970
|
this.info = e;
|
|
971
971
|
}
|
|
@@ -981,7 +981,7 @@ class wi {
|
|
|
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 = br(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 wi {
|
|
|
1019
1019
|
if (a.kind == "map") {
|
|
1020
1020
|
if (o === null)
|
|
1021
1021
|
continue;
|
|
1022
|
-
this.assert(
|
|
1022
|
+
this.assert(Qr(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 wi {
|
|
|
1135
1135
|
i = "too large or small";
|
|
1136
1136
|
break;
|
|
1137
1137
|
}
|
|
1138
|
-
return t == D.FLOAT &&
|
|
1138
|
+
return t == D.FLOAT && Pn(o), o;
|
|
1139
1139
|
case D.INT32:
|
|
1140
1140
|
case D.FIXED32:
|
|
1141
1141
|
case D.SFIXED32:
|
|
@@ -1146,7 +1146,7 @@ class wi {
|
|
|
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 ? mn(a) : Yt(a), a;
|
|
1150
1150
|
case D.INT64:
|
|
1151
1151
|
case D.SFIXED64:
|
|
1152
1152
|
case D.SINT64:
|
|
@@ -1187,7 +1187,7 @@ class wi {
|
|
|
1187
1187
|
return new Uint8Array(0);
|
|
1188
1188
|
if (typeof e != "string")
|
|
1189
1189
|
break;
|
|
1190
|
-
return
|
|
1190
|
+
return Cr(e);
|
|
1191
1191
|
}
|
|
1192
1192
|
} catch (o) {
|
|
1193
1193
|
i = o.message;
|
|
@@ -1195,7 +1195,7 @@ class wi {
|
|
|
1195
1195
|
this.assert(!1, r + (i ? " - " + i : ""), e);
|
|
1196
1196
|
}
|
|
1197
1197
|
}
|
|
1198
|
-
class
|
|
1198
|
+
class bi {
|
|
1199
1199
|
constructor(e) {
|
|
1200
1200
|
var t;
|
|
1201
1201
|
this.fields = (t = e.fields) !== null && t !== void 0 ? t : [];
|
|
@@ -1319,9 +1319,9 @@ class yi {
|
|
|
1319
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 : (mn(t), t);
|
|
1323
1323
|
case D.FLOAT:
|
|
1324
|
-
|
|
1324
|
+
Pn(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 yi {
|
|
|
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 ? Er(t) : o ? "" : void 0;
|
|
1344
1344
|
}
|
|
1345
1345
|
}
|
|
1346
1346
|
}
|
|
1347
|
-
function
|
|
1347
|
+
function Mn(s, e = dt.STRING) {
|
|
1348
1348
|
switch (s) {
|
|
1349
1349
|
case D.BOOL:
|
|
1350
1350
|
return !1;
|
|
@@ -1366,7 +1366,7 @@ function Rn(s, e = dt.STRING) {
|
|
|
1366
1366
|
return 0;
|
|
1367
1367
|
}
|
|
1368
1368
|
}
|
|
1369
|
-
class
|
|
1369
|
+
class Ci {
|
|
1370
1370
|
constructor(e) {
|
|
1371
1371
|
this.info = e;
|
|
1372
1372
|
}
|
|
@@ -1460,13 +1460,13 @@ class bi {
|
|
|
1460
1460
|
}
|
|
1461
1461
|
}
|
|
1462
1462
|
if (o === void 0) {
|
|
1463
|
-
let c =
|
|
1463
|
+
let c = Mn(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 = Mn(e.V.T, e.V.L);
|
|
1470
1470
|
break;
|
|
1471
1471
|
case "enum":
|
|
1472
1472
|
a = 0;
|
|
@@ -1512,7 +1512,7 @@ class bi {
|
|
|
1512
1512
|
}
|
|
1513
1513
|
}
|
|
1514
1514
|
}
|
|
1515
|
-
class
|
|
1515
|
+
class Ei {
|
|
1516
1516
|
constructor(e) {
|
|
1517
1517
|
this.info = e;
|
|
1518
1518
|
}
|
|
@@ -1541,7 +1541,7 @@ class Ci {
|
|
|
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 == gn.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 Ci {
|
|
|
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 vi(s) {
|
|
1682
|
+
const e = s.messagePrototype ? Object.create(s.messagePrototype) : Object.defineProperty({}, Nr, { 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 Ei(s) {
|
|
|
1690
1690
|
else
|
|
1691
1691
|
switch (t.kind) {
|
|
1692
1692
|
case "scalar":
|
|
1693
|
-
e[n] =
|
|
1693
|
+
e[n] = Mn(t.T, t.L);
|
|
1694
1694
|
break;
|
|
1695
1695
|
case "enum":
|
|
1696
1696
|
e[n] = 0;
|
|
@@ -1748,7 +1748,7 @@ function Ae(s, e, t) {
|
|
|
1748
1748
|
}
|
|
1749
1749
|
}
|
|
1750
1750
|
}
|
|
1751
|
-
function
|
|
1751
|
+
function Ai(s, e, t) {
|
|
1752
1752
|
if (e === t)
|
|
1753
1753
|
return !0;
|
|
1754
1754
|
if (!e || !t)
|
|
@@ -1759,24 +1759,24 @@ function vi(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 ? er(a, i, o) : Ir(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" ? tr(n.V.T(), ln(i), ln(o)) : er(n.V.kind == "enum" ? D.INT32 : n.V.T, ln(i), ln(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 ? tr(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 ln = Object.values;
|
|
1779
|
+
function Ir(s, e, t) {
|
|
1780
1780
|
if (e === t)
|
|
1781
1781
|
return !0;
|
|
1782
1782
|
if (s !== D.BYTES)
|
|
@@ -1789,15 +1789,15 @@ function Nr(s, e, t) {
|
|
|
1789
1789
|
return !1;
|
|
1790
1790
|
return !0;
|
|
1791
1791
|
}
|
|
1792
|
-
function
|
|
1792
|
+
function er(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 (!Ir(s, e[n], t[n]))
|
|
1797
1797
|
return !1;
|
|
1798
1798
|
return !0;
|
|
1799
1799
|
}
|
|
1800
|
-
function
|
|
1800
|
+
function tr(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,13 +1805,13 @@ function er(s, e, t) {
|
|
|
1805
1805
|
return !1;
|
|
1806
1806
|
return !0;
|
|
1807
1807
|
}
|
|
1808
|
-
const
|
|
1808
|
+
const ki = 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(mi), this.options = n ?? {}, this.messagePrototype = Object.create(null, Object.assign(Object.assign({}, ki), { [Nr]: { value: this } })), this.refTypeCheck = new wi(this), this.refJsonReader = new yi(this), this.refJsonWriter = new bi(this), this.refBinReader = new Ci(this), this.refBinWriter = new Ei(this);
|
|
1812
1812
|
}
|
|
1813
1813
|
create(e) {
|
|
1814
|
-
let t =
|
|
1814
|
+
let t = vi(this);
|
|
1815
1815
|
return e !== void 0 && Ae(this, t, e), t;
|
|
1816
1816
|
}
|
|
1817
1817
|
/**
|
|
@@ -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 Ai(this, e, t);
|
|
1834
1834
|
}
|
|
1835
1835
|
/**
|
|
1836
1836
|
* Is the given value assignable to our message type
|
|
@@ -1856,14 +1856,14 @@ class xe {
|
|
|
1856
1856
|
* Create a new message from binary format.
|
|
1857
1857
|
*/
|
|
1858
1858
|
fromBinary(e, t) {
|
|
1859
|
-
let n =
|
|
1859
|
+
let n = ri(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, ui(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, fi(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 = di(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 ${br(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 Fi(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 : Rn(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 Wn {
|
|
1951
1951
|
constructor(e, t, n) {
|
|
1952
|
-
this.typeName = e, this.methods = t.map((r) =>
|
|
1952
|
+
this.typeName = e, this.methods = t.map((r) => Fi(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 Ni(s, e) {
|
|
1973
1973
|
if (!e)
|
|
1974
1974
|
return s;
|
|
1975
1975
|
let t = {};
|
|
1976
|
-
|
|
1976
|
+
cn(s, t), cn(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 = pi(s.jsonOptions, t.jsonOptions);
|
|
1982
1982
|
break;
|
|
1983
1983
|
case "binaryOptions":
|
|
1984
|
-
t.binaryOptions =
|
|
1984
|
+
t.binaryOptions = Yr(s.binaryOptions, t.binaryOptions);
|
|
1985
1985
|
break;
|
|
1986
1986
|
case "meta":
|
|
1987
|
-
t.meta = {},
|
|
1987
|
+
t.meta = {}, cn(s.meta, t.meta), cn(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 Fi(s, e) {
|
|
|
1993
1993
|
}
|
|
1994
1994
|
return t;
|
|
1995
1995
|
}
|
|
1996
|
-
function
|
|
1996
|
+
function cn(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 Ii {
|
|
2068
2068
|
constructor() {
|
|
2069
2069
|
this._lis = {
|
|
2070
2070
|
nxt: [],
|
|
@@ -2171,7 +2171,7 @@ class Ni {
|
|
|
2171
2171
|
t.q.push(e);
|
|
2172
2172
|
}
|
|
2173
2173
|
}
|
|
2174
|
-
var
|
|
2174
|
+
var Li = 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 Ii = function(s, e, t, n) {
|
|
|
2198
2198
|
h((n = n.apply(s, e || [])).next());
|
|
2199
2199
|
});
|
|
2200
2200
|
};
|
|
2201
|
-
class
|
|
2201
|
+
class Ti {
|
|
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 Li {
|
|
|
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 Li(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 Li {
|
|
|
2224
2224
|
});
|
|
2225
2225
|
}
|
|
2226
2226
|
}
|
|
2227
|
-
var
|
|
2227
|
+
var xi = 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 Ti = function(s, e, t, n) {
|
|
|
2251
2251
|
h((n = n.apply(s, e || [])).next());
|
|
2252
2252
|
});
|
|
2253
2253
|
};
|
|
2254
|
-
class
|
|
2254
|
+
class _i {
|
|
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 xi {
|
|
|
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 xi(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,
|
|
@@ -2293,7 +2293,7 @@ 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
2295
|
})(W || (W = {}));
|
|
2296
|
-
var
|
|
2296
|
+
var Ui = 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 _i = function(s, e, t, n) {
|
|
|
2320
2320
|
h((n = n.apply(s, e || [])).next());
|
|
2321
2321
|
});
|
|
2322
2322
|
};
|
|
2323
|
-
function
|
|
2323
|
+
function nr(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")
|
|
@@ -2340,14 +2340,14 @@ function tr(s, e, t, n, r) {
|
|
|
2340
2340
|
}
|
|
2341
2341
|
return s;
|
|
2342
2342
|
}
|
|
2343
|
-
function
|
|
2343
|
+
function rr(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 : Er(t);
|
|
2349
2349
|
}
|
|
2350
|
-
function
|
|
2350
|
+
function Vn(s, e, t) {
|
|
2351
2351
|
if (arguments.length === 1) {
|
|
2352
2352
|
let c = s, h;
|
|
2353
2353
|
try {
|
|
@@ -2360,23 +2360,23 @@ function Mn(s, e, t) {
|
|
|
2360
2360
|
case "opaqueredirect":
|
|
2361
2361
|
throw new se(`fetch response type ${c.type}`, W[W.UNKNOWN]);
|
|
2362
2362
|
}
|
|
2363
|
-
return
|
|
2363
|
+
return Vn(Di(c.headers), c.status, c.statusText);
|
|
2364
2364
|
}
|
|
2365
|
-
let n = s, r = e >= 200 && e < 300, i =
|
|
2366
|
-
return (o === void 0 || o === W.OK) && !r && (o =
|
|
2365
|
+
let n = s, r = e >= 200 && e < 300, i = Tr(n), [o, a] = Lr(n);
|
|
2366
|
+
return (o === void 0 || o === W.OK) && !r && (o = Ri(e), a = t), [o, a, i];
|
|
2367
2367
|
}
|
|
2368
|
-
function
|
|
2369
|
-
let e =
|
|
2368
|
+
function ir(s) {
|
|
2369
|
+
let e = Si(s), [t, n] = Lr(e), r = Tr(e);
|
|
2370
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 sr(s, e, t) {
|
|
2377
|
+
return Ui(this, void 0, void 0, function* () {
|
|
2378
|
+
let n, r = "", i = new Uint8Array(0), o = Oi(e);
|
|
2379
|
+
if (Bi(s)) {
|
|
2380
2380
|
let a = s.getReader();
|
|
2381
2381
|
n = {
|
|
2382
2382
|
next: () => a.read()
|
|
@@ -2392,9 +2392,9 @@ function ir(s, e, t) {
|
|
|
2392
2392
|
let c = r.length - r.length % 4;
|
|
2393
2393
|
if (c === 0)
|
|
2394
2394
|
continue;
|
|
2395
|
-
i =
|
|
2395
|
+
i = or(i, Cr(r.substring(0, c))), r = r.substring(c);
|
|
2396
2396
|
} else
|
|
2397
|
-
i =
|
|
2397
|
+
i = or(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++)
|
|
@@ -2416,12 +2416,12 @@ function ir(s, e, t) {
|
|
|
2416
2416
|
}
|
|
2417
2417
|
});
|
|
2418
2418
|
}
|
|
2419
|
-
const
|
|
2420
|
-
function
|
|
2419
|
+
const Bi = (s) => typeof s.getReader == "function";
|
|
2420
|
+
function or(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 Oi(s) {
|
|
2425
2425
|
switch (s) {
|
|
2426
2426
|
case "application/grpc-web-text":
|
|
2427
2427
|
case "application/grpc-web-text+proto":
|
|
@@ -2436,7 +2436,7 @@ function Bi(s) {
|
|
|
2436
2436
|
throw new se("unexpected response content type: " + s, W[W.INTERNAL]);
|
|
2437
2437
|
}
|
|
2438
2438
|
}
|
|
2439
|
-
function
|
|
2439
|
+
function Lr(s) {
|
|
2440
2440
|
let e, t, n = s["grpc-message"];
|
|
2441
2441
|
if (n !== void 0) {
|
|
2442
2442
|
if (Array.isArray(n))
|
|
@@ -2452,7 +2452,7 @@ function Ir(s) {
|
|
|
2452
2452
|
}
|
|
2453
2453
|
return [e, t];
|
|
2454
2454
|
}
|
|
2455
|
-
function
|
|
2455
|
+
function Tr(s) {
|
|
2456
2456
|
let e = {};
|
|
2457
2457
|
for (let [t, n] of Object.entries(s))
|
|
2458
2458
|
switch (t) {
|
|
@@ -2465,7 +2465,7 @@ function Lr(s) {
|
|
|
2465
2465
|
}
|
|
2466
2466
|
return e;
|
|
2467
2467
|
}
|
|
2468
|
-
function
|
|
2468
|
+
function Si(s) {
|
|
2469
2469
|
let e = {};
|
|
2470
2470
|
for (let t of String.fromCharCode.apply(String, s).trim().split(`\r
|
|
2471
2471
|
`)) {
|
|
@@ -2479,14 +2479,14 @@ function Oi(s) {
|
|
|
2479
2479
|
}
|
|
2480
2480
|
return e;
|
|
2481
2481
|
}
|
|
2482
|
-
function
|
|
2482
|
+
function Di(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 Ri(s) {
|
|
2490
2490
|
switch (s) {
|
|
2491
2491
|
case 200:
|
|
2492
2492
|
return W.OK;
|
|
@@ -2518,12 +2518,12 @@ function Di(s) {
|
|
|
2518
2518
|
return W.UNKNOWN;
|
|
2519
2519
|
}
|
|
2520
2520
|
}
|
|
2521
|
-
class
|
|
2521
|
+
class Mi {
|
|
2522
2522
|
constructor(e) {
|
|
2523
2523
|
this.defaultOptions = e;
|
|
2524
2524
|
}
|
|
2525
2525
|
mergeOptions(e) {
|
|
2526
|
-
return
|
|
2526
|
+
return Ni(this.defaultOptions, e);
|
|
2527
2527
|
}
|
|
2528
2528
|
/**
|
|
2529
2529
|
* Create an URI for a gRPC web call.
|
|
@@ -2555,15 +2555,15 @@ class Ri {
|
|
|
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 Ii(), 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: nr(new globalThis.Headers(), h, c.timeout, c.meta),
|
|
2562
|
+
body: rr(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
2565
|
})).then((k) => {
|
|
2566
|
-
let [x, b, B] =
|
|
2566
|
+
let [x, b, B] = Vn(k);
|
|
2567
2567
|
if (f.resolve(B), x != null && x !== W.OK)
|
|
2568
2568
|
throw new se(b ?? W[x], W[x], B);
|
|
2569
2569
|
return x != null && (L = {
|
|
@@ -2573,14 +2573,14 @@ class Ri {
|
|
|
2573
2573
|
}).then((k) => {
|
|
2574
2574
|
if (!k.body)
|
|
2575
2575
|
throw new se("missing response body", W[W.INTERNAL]);
|
|
2576
|
-
return
|
|
2576
|
+
return sr(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] =
|
|
2583
|
+
[B, m, R] = ir(b), L = {
|
|
2584
2584
|
code: W[B],
|
|
2585
2585
|
detail: m ?? W[B]
|
|
2586
2586
|
};
|
|
@@ -2598,19 +2598,19 @@ class Ri {
|
|
|
2598
2598
|
}).catch((k) => {
|
|
2599
2599
|
let x;
|
|
2600
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
|
|
2601
|
+
}), new _i(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: nr(new globalThis.Headers(), h, c.timeout, c.meta),
|
|
2609
|
+
body: rr(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
2612
|
})).then((k) => {
|
|
2613
|
-
let [x, b, B] =
|
|
2613
|
+
let [x, b, B] = Vn(k);
|
|
2614
2614
|
if (f.resolve(B), x != null && x !== W.OK)
|
|
2615
2615
|
throw new se(b ?? W[x], W[x], B);
|
|
2616
2616
|
return x != null && (L = {
|
|
@@ -2620,7 +2620,7 @@ class Ri {
|
|
|
2620
2620
|
}).then((k) => {
|
|
2621
2621
|
if (!k.body)
|
|
2622
2622
|
throw new se("missing response body", W[W.INTERNAL]);
|
|
2623
|
-
return
|
|
2623
|
+
return sr(k.body, k.headers.get("content-type"), (x, b) => {
|
|
2624
2624
|
switch (x) {
|
|
2625
2625
|
case Qe.DATA:
|
|
2626
2626
|
if (y)
|
|
@@ -2629,7 +2629,7 @@ class Ri {
|
|
|
2629
2629
|
break;
|
|
2630
2630
|
case Qe.TRAILER:
|
|
2631
2631
|
let B, m;
|
|
2632
|
-
[B, m, R] =
|
|
2632
|
+
[B, m, R] = ir(b), L = {
|
|
2633
2633
|
code: W[B],
|
|
2634
2634
|
detail: m ?? W[B]
|
|
2635
2635
|
};
|
|
@@ -2651,11 +2651,11 @@ class Ri {
|
|
|
2651
2651
|
}).catch((k) => {
|
|
2652
2652
|
let x;
|
|
2653
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
|
|
2654
|
+
}), new Ti(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 kn = /* @__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))(kn || {});
|
|
2658
|
+
class Vi extends xe {
|
|
2659
2659
|
constructor() {
|
|
2660
2660
|
super("com.hamropatro.grpc.cms.SearchRequest", [
|
|
2661
2661
|
{
|
|
@@ -2718,8 +2718,8 @@ class Mi 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 xr = new Vi();
|
|
2722
|
+
class Hi 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 },
|
|
@@ -2767,8 +2767,8 @@ class Vi 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 $i = new Hi();
|
|
2771
|
+
class Pi extends xe {
|
|
2772
2772
|
constructor() {
|
|
2773
2773
|
super("com.hamropatro.grpc.cms.CreateFileRequest", [
|
|
2774
2774
|
{
|
|
@@ -2799,7 +2799,7 @@ class $i 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", kn] },
|
|
2803
2803
|
{
|
|
2804
2804
|
no: 6,
|
|
2805
2805
|
name: "extension",
|
|
@@ -2858,8 +2858,8 @@ class $i 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 _r = new Pi();
|
|
2862
|
+
class Wi extends xe {
|
|
2863
2863
|
constructor() {
|
|
2864
2864
|
super("com.hamropatro.grpc.cms.CreateUserFileRequest", [
|
|
2865
2865
|
{
|
|
@@ -2869,7 +2869,7 @@ class Pi 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", kn] },
|
|
2873
2873
|
{
|
|
2874
2874
|
no: 3,
|
|
2875
2875
|
name: "extension",
|
|
@@ -2916,8 +2916,8 @@ class Pi 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 Ur = new Wi();
|
|
2920
|
+
class ji extends xe {
|
|
2921
2921
|
constructor() {
|
|
2922
2922
|
super("com.hamropatro.grpc.cms.File", [
|
|
2923
2923
|
{
|
|
@@ -2969,8 +2969,8 @@ class Wi 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", kn] },
|
|
2973
|
+
{ no: 9, name: "metadata", kind: "message", T: () => Ln }
|
|
2974
2974
|
]);
|
|
2975
2975
|
}
|
|
2976
2976
|
create(e) {
|
|
@@ -3016,7 +3016,7 @@ class Wi extends xe {
|
|
|
3016
3016
|
break;
|
|
3017
3017
|
case /* com.hamropatro.grpc.cms.FileMetadata metadata */
|
|
3018
3018
|
9:
|
|
3019
|
-
i.metadata =
|
|
3019
|
+
i.metadata = Ln.internalBinaryRead(e, e.uint32(), n, i.metadata);
|
|
3020
3020
|
break;
|
|
3021
3021
|
default:
|
|
3022
3022
|
let h = n.readUnknownField;
|
|
@@ -3029,13 +3029,13 @@ class Wi 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 && Ln.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 ji();
|
|
3038
|
+
class Zi extends xe {
|
|
3039
3039
|
constructor() {
|
|
3040
3040
|
super("com.hamropatro.grpc.cms.FileMetadata", [
|
|
3041
3041
|
{
|
|
@@ -3109,8 +3109,8 @@ class ji 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 Ln = new Zi();
|
|
3113
|
+
class qi extends xe {
|
|
3114
3114
|
constructor() {
|
|
3115
3115
|
super("com.hamropatro.grpc.cms.DeleteFileRequest", [
|
|
3116
3116
|
{
|
|
@@ -3151,8 +3151,8 @@ class Zi 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 Br = new qi();
|
|
3155
|
+
class Ki extends xe {
|
|
3156
3156
|
constructor() {
|
|
3157
3157
|
super("com.hamropatro.grpc.cms.DeleteFileResponse", [
|
|
3158
3158
|
{
|
|
@@ -3193,8 +3193,8 @@ class qi 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 zi = new Ki();
|
|
3197
|
+
class Xi extends xe {
|
|
3198
3198
|
constructor() {
|
|
3199
3199
|
super("com.hamropatro.grpc.cms.GetFilesByFolderRequest", [
|
|
3200
3200
|
{
|
|
@@ -3257,8 +3257,8 @@ class zi 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 Or = new Xi();
|
|
3261
|
+
class Gi 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 },
|
|
@@ -3317,19 +3317,19 @@ class Xi 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 Ji = new Gi(), Tn = new Wn("com.hamropatro.grpc.cms.FileService", [
|
|
3321
|
+
{ name: "createFile", options: {}, I: _r, 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: Br, O: zi },
|
|
3324
|
+
{ name: "getFilesByFolder", options: {}, I: Or, O: Ji },
|
|
3325
|
+
{ name: "createUserFile", options: {}, I: Ur, O: Ye },
|
|
3326
|
+
{ name: "search", options: {}, I: xr, O: $i }
|
|
3327
3327
|
]);
|
|
3328
3328
|
class zt {
|
|
3329
3329
|
constructor(e) {
|
|
3330
|
-
he(this, "typeName",
|
|
3331
|
-
he(this, "methods",
|
|
3332
|
-
he(this, "options",
|
|
3330
|
+
he(this, "typeName", Tn.typeName);
|
|
3331
|
+
he(this, "methods", Tn.methods);
|
|
3332
|
+
he(this, "options", Tn.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 Qi = 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 zt(a), h =
|
|
3383
|
+
const a = (o = window.ImageSalonSDK) == null ? void 0 : o.grpcConfig, c = new zt(a), h = _r.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 Ji = async (s, e, t, n, r, i) => {
|
|
|
3388
3388
|
} catch (a) {
|
|
3389
3389
|
throw a;
|
|
3390
3390
|
}
|
|
3391
|
-
},
|
|
3391
|
+
}, Yi = async (s, e, t) => {
|
|
3392
3392
|
var n;
|
|
3393
3393
|
try {
|
|
3394
|
-
const r = (n = window.ImageSalonSDK) == null ? void 0 : n.grpcConfig, i = new zt(r), o =
|
|
3394
|
+
const r = (n = window.ImageSalonSDK) == null ? void 0 : n.grpcConfig, i = new zt(r), o = Ur.create();
|
|
3395
3395
|
return o.url = s, o.type = e, await i.createUserFile(
|
|
3396
3396
|
o,
|
|
3397
3397
|
t
|
|
@@ -3399,10 +3399,10 @@ const Ji = async (s, e, t, n, r, i) => {
|
|
|
3399
3399
|
} catch (r) {
|
|
3400
3400
|
throw r;
|
|
3401
3401
|
}
|
|
3402
|
-
},
|
|
3402
|
+
}, es = 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 zt(i), a =
|
|
3405
|
+
const i = (r = window.ImageSalonSDK) == null ? void 0 : r.grpcConfig, o = new zt(i), a = Or.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 Ji = async (s, e, t, n, r, i) => {
|
|
|
3410
3410
|
} catch (i) {
|
|
3411
3411
|
throw i;
|
|
3412
3412
|
}
|
|
3413
|
-
},
|
|
3413
|
+
}, ts = 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 zt(i), a =
|
|
3416
|
+
const i = (r = window.ImageSalonSDK) == null ? void 0 : r.grpcConfig, o = new zt(i), a = xr.create();
|
|
3417
3417
|
return a.searchValue = s, a.cursor = e, a.limit = t, await o.search(
|
|
3418
3418
|
a,
|
|
3419
3419
|
n
|
|
@@ -3421,7 +3421,7 @@ const Ji = async (s, e, t, n, r, i) => {
|
|
|
3421
3421
|
} catch (i) {
|
|
3422
3422
|
throw i;
|
|
3423
3423
|
}
|
|
3424
|
-
},
|
|
3424
|
+
}, ns = async (s, e, t, n, r, i, o, a, c) => {
|
|
3425
3425
|
var h;
|
|
3426
3426
|
try {
|
|
3427
3427
|
const l = (h = window.ImageSalonSDK) == null ? void 0 : h.grpcConfig, u = new zt(l), d = Ye.create();
|
|
@@ -3432,10 +3432,10 @@ const Ji = async (s, e, t, n, r, i) => {
|
|
|
3432
3432
|
} catch (l) {
|
|
3433
3433
|
throw l;
|
|
3434
3434
|
}
|
|
3435
|
-
},
|
|
3435
|
+
}, rs = async (s, e) => {
|
|
3436
3436
|
var t;
|
|
3437
3437
|
try {
|
|
3438
|
-
const n = (t = window.ImageSalonSDK) == null ? void 0 : t.grpcConfig, r = new zt(n), i =
|
|
3438
|
+
const n = (t = window.ImageSalonSDK) == null ? void 0 : t.grpcConfig, r = new zt(n), i = Br.create();
|
|
3439
3439
|
return i.key = s, await r.deleteFile(
|
|
3440
3440
|
i,
|
|
3441
3441
|
e
|
|
@@ -3444,7 +3444,7 @@ const Ji = async (s, e, t, n, r, i) => {
|
|
|
3444
3444
|
throw n;
|
|
3445
3445
|
}
|
|
3446
3446
|
};
|
|
3447
|
-
class
|
|
3447
|
+
class is extends xe {
|
|
3448
3448
|
constructor() {
|
|
3449
3449
|
super("com.hamropatro.grpc.cms.DeleteFolderRequest", [
|
|
3450
3450
|
{
|
|
@@ -3485,8 +3485,8 @@ class rs 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 Sr = new is();
|
|
3489
|
+
class ss extends xe {
|
|
3490
3490
|
constructor() {
|
|
3491
3491
|
super("com.hamropatro.grpc.cms.CreateFolderRequest", [
|
|
3492
3492
|
{
|
|
@@ -3549,8 +3549,8 @@ class is 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 Dr = new ss();
|
|
3553
|
+
class os extends xe {
|
|
3554
3554
|
constructor() {
|
|
3555
3555
|
super("com.hamropatro.grpc.cms.GetAllFoldersRequest", [
|
|
3556
3556
|
{
|
|
@@ -3602,8 +3602,8 @@ class ss 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 Rr = new os();
|
|
3606
|
+
class as 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 },
|
|
@@ -3662,8 +3662,8 @@ class os 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 ls = new as();
|
|
3666
|
+
class cs extends xe {
|
|
3667
3667
|
constructor() {
|
|
3668
3668
|
super("com.hamropatro.grpc.cms.Folder", [
|
|
3669
3669
|
{
|
|
@@ -3737,17 +3737,17 @@ class ls 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 cs(), xn = new Wn("com.hamropatro.grpc.cms.FolderService", [
|
|
3741
|
+
{ name: "createFolder", options: {}, I: Dr, O: Tt },
|
|
3742
|
+
{ name: "getFolders", options: {}, I: Rr, O: ls },
|
|
3743
3743
|
{ name: "updateFolder", options: {}, I: Tt, O: Tt },
|
|
3744
|
-
{ name: "deleteFolder", options: {}, I:
|
|
3744
|
+
{ name: "deleteFolder", options: {}, I: Sr, O: Tt }
|
|
3745
3745
|
]);
|
|
3746
|
-
class
|
|
3746
|
+
class Fn {
|
|
3747
3747
|
constructor(e) {
|
|
3748
|
-
he(this, "typeName",
|
|
3749
|
-
he(this, "methods",
|
|
3750
|
-
he(this, "options",
|
|
3748
|
+
he(this, "typeName", xn.typeName);
|
|
3749
|
+
he(this, "methods", xn.methods);
|
|
3750
|
+
he(this, "options", xn.options);
|
|
3751
3751
|
this._transport = e;
|
|
3752
3752
|
}
|
|
3753
3753
|
/**
|
|
@@ -3779,9 +3779,9 @@ class kn {
|
|
|
3779
3779
|
return qe("unary", this._transport, n, r, e);
|
|
3780
3780
|
}
|
|
3781
3781
|
}
|
|
3782
|
-
const
|
|
3782
|
+
const ds = 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 Fn(n), i = Rr.create();
|
|
3785
3785
|
try {
|
|
3786
3786
|
return i.cursor = s, i.limit = e, await r.getFolders(
|
|
3787
3787
|
i,
|
|
@@ -3790,10 +3790,10 @@ const cs = async (s, e = 20, t) => {
|
|
|
3790
3790
|
} catch (a) {
|
|
3791
3791
|
throw a;
|
|
3792
3792
|
}
|
|
3793
|
-
},
|
|
3793
|
+
}, hs = 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 Fn(i), a = Dr.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 cs = async (s, e = 20, t) => {
|
|
|
3801
3801
|
} catch (i) {
|
|
3802
3802
|
throw i;
|
|
3803
3803
|
}
|
|
3804
|
-
},
|
|
3804
|
+
}, us = 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 Fn(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 cs = async (s, e = 20, t) => {
|
|
|
3812
3812
|
} catch (o) {
|
|
3813
3813
|
throw o;
|
|
3814
3814
|
}
|
|
3815
|
-
},
|
|
3815
|
+
}, fs = 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 Fn(n), i = Sr.create();
|
|
3819
3819
|
return i.key = s, await r.deleteFolder(
|
|
3820
3820
|
i,
|
|
3821
3821
|
e
|
|
@@ -3823,7 +3823,7 @@ const cs = async (s, e = 20, t) => {
|
|
|
3823
3823
|
} catch (n) {
|
|
3824
3824
|
throw n;
|
|
3825
3825
|
}
|
|
3826
|
-
},
|
|
3826
|
+
}, _n = (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 cs = 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 ar() {
|
|
3840
3840
|
const s = document.createElementNS(
|
|
3841
3841
|
"http://www.w3.org/2000/svg",
|
|
3842
3842
|
"svg"
|
|
@@ -3848,7 +3848,7 @@ function or() {
|
|
|
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 ps() {
|
|
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 fs() {
|
|
|
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 lr = (s) => {
|
|
3870
3870
|
const e = document.createElementNS(
|
|
3871
3871
|
"http://www.w3.org/2000/svg",
|
|
3872
3872
|
"svg"
|
|
@@ -3877,7 +3877,7 @@ const ar = (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 Hn(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 Vn(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 cr() {
|
|
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");
|
|
@@ -3911,7 +3911,7 @@ function Gt() {
|
|
|
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 ms() {
|
|
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 ps() {
|
|
|
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 gs() {
|
|
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 ms() {
|
|
|
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 dr() {
|
|
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 ws() {
|
|
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 gs() {
|
|
|
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 ys() {
|
|
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 ws() {
|
|
|
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 hr() {
|
|
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 dr() {
|
|
|
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 Un() {
|
|
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 _n() {
|
|
|
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 bs() {
|
|
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,7 +4002,7 @@ 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 Cs {
|
|
4006
4006
|
constructor() {
|
|
4007
4007
|
X(this, ut);
|
|
4008
4008
|
X(this, Xe);
|
|
@@ -4011,21 +4011,21 @@ class bs {
|
|
|
4011
4011
|
H(this, ut, document.createElementNS(
|
|
4012
4012
|
"http://www.w3.org/2000/svg",
|
|
4013
4013
|
"svg"
|
|
4014
|
-
)),
|
|
4014
|
+
)), v(this, ut).setAttribute("viewBox", "25 25 50 50"), v(this, ut).classList.add("loader-svg"), H(this, Xe, document.createElementNS(
|
|
4015
4015
|
"http://www.w3.org/2000/svg",
|
|
4016
4016
|
"circle"
|
|
4017
|
-
)),
|
|
4017
|
+
)), v(this, Xe).setAttribute("r", "20"), v(this, Xe).setAttribute("cy", "50"), v(this, Xe).setAttribute("cx", "50"), v(this, Xe).setAttribute("stroke", v(this, Vt)), v(this, Xe).classList.add("loader-circle"), v(this, ut).appendChild(v(this, Xe));
|
|
4018
4018
|
}
|
|
4019
4019
|
show(e, t) {
|
|
4020
|
-
t && (H(this, Vt, t),
|
|
4020
|
+
t && (H(this, Vt, t), v(this, Xe).setAttribute("stroke", v(this, Vt))), e.appendChild(v(this, ut));
|
|
4021
4021
|
}
|
|
4022
4022
|
hide() {
|
|
4023
|
-
|
|
4023
|
+
v(this, ut).remove();
|
|
4024
4024
|
}
|
|
4025
4025
|
}
|
|
4026
4026
|
ut = new WeakMap(), Xe = new WeakMap(), Vt = new WeakMap();
|
|
4027
|
-
const
|
|
4028
|
-
class
|
|
4027
|
+
const ur = new Cs(), dn = document.body;
|
|
4028
|
+
class Mr {
|
|
4029
4029
|
constructor() {
|
|
4030
4030
|
he(this, "main");
|
|
4031
4031
|
he(this, "dialogContainer");
|
|
@@ -4047,7 +4047,7 @@ class Rr {
|
|
|
4047
4047
|
"dialog-presentation",
|
|
4048
4048
|
"",
|
|
4049
4049
|
"",
|
|
4050
|
-
|
|
4050
|
+
dn
|
|
4051
4051
|
), this.main.setAttribute("role", "presentation"), this.dialogContainer = ee(
|
|
4052
4052
|
"div",
|
|
4053
4053
|
"dialog-container",
|
|
@@ -4088,9 +4088,9 @@ class Rr {
|
|
|
4088
4088
|
"",
|
|
4089
4089
|
this.dialogContent
|
|
4090
4090
|
);
|
|
4091
|
-
n.appendChild(
|
|
4091
|
+
n.appendChild(Hn()), 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", dn.style.overflow = "hidden", this.confirmButton.textContent = e.confirmButtonText || "Upload", this.cancelButton.textContent = e.cancelButtonText || "Cancel", dn.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 Rr {
|
|
|
4142
4142
|
}, 150);
|
|
4143
4143
|
}
|
|
4144
4144
|
hide() {
|
|
4145
|
-
this.main ||
|
|
4145
|
+
this.main || dn.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 ? (ur.show(this.confirmButton), this.confirmButton.disabled = !0) : (ur.hide(), this.confirmButton.disabled = !1);
|
|
4151
4151
|
}
|
|
4152
4152
|
}
|
|
4153
|
-
const
|
|
4154
|
-
class
|
|
4153
|
+
const hn = new Mr(), ye = new Mr();
|
|
4154
|
+
class Es {
|
|
4155
4155
|
constructor() {
|
|
4156
4156
|
he(this, "main");
|
|
4157
4157
|
he(this, "dialogBody");
|
|
@@ -4164,7 +4164,7 @@ class Cs {
|
|
|
4164
4164
|
this.main.remove();
|
|
4165
4165
|
}
|
|
4166
4166
|
}
|
|
4167
|
-
const je = new
|
|
4167
|
+
const je = new Es();
|
|
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
4169
|
const Qt = {
|
|
4170
4170
|
0: "IMAGE",
|
|
@@ -4173,7 +4173,7 @@ const Qt = {
|
|
|
4173
4173
|
3: "ALL",
|
|
4174
4174
|
4: "FOLDER"
|
|
4175
4175
|
};
|
|
4176
|
-
function
|
|
4176
|
+
function fr(s) {
|
|
4177
4177
|
switch (s) {
|
|
4178
4178
|
case "image":
|
|
4179
4179
|
return Qt[ct.IMAGE];
|
|
@@ -4185,7 +4185,7 @@ function ur(s) {
|
|
|
4185
4185
|
return Qt[ct.ALL];
|
|
4186
4186
|
}
|
|
4187
4187
|
}
|
|
4188
|
-
function
|
|
4188
|
+
function vs(s) {
|
|
4189
4189
|
const e = {};
|
|
4190
4190
|
s.forEach((r) => {
|
|
4191
4191
|
e[r.key] = { ...r, children: {} };
|
|
@@ -4197,7 +4197,7 @@ function Es(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 As(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 vs(s, e) {
|
|
|
4213
4213
|
break;
|
|
4214
4214
|
return s;
|
|
4215
4215
|
}
|
|
4216
|
-
const
|
|
4216
|
+
const ks = async (s, e) => {
|
|
4217
4217
|
let t;
|
|
4218
4218
|
try {
|
|
4219
4219
|
s && (t = {
|
|
@@ -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 pr(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 Fs(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 Ns(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 Bn(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 Is extends xe {
|
|
4263
4263
|
constructor() {
|
|
4264
4264
|
super("com.hamropatro.grpc.cms.ImageUploadRequest", [
|
|
4265
4265
|
{
|
|
@@ -4300,8 +4300,8 @@ class Ns 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 $n = new Is();
|
|
4304
|
+
class Ls extends xe {
|
|
4305
4305
|
constructor() {
|
|
4306
4306
|
super("com.hamropatro.grpc.cms.ImageUploadResponse", [
|
|
4307
4307
|
{
|
|
@@ -4353,15 +4353,15 @@ class Is 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 mr = new Ls(), On = new Wn("com.hamropatro.grpc.cms.ImageUploadService", [
|
|
4357
|
+
{ name: "Upload", options: {}, I: $n, O: mr },
|
|
4358
|
+
{ name: "UploadUserImage", options: {}, I: $n, O: mr }
|
|
4359
4359
|
]);
|
|
4360
|
-
class
|
|
4360
|
+
class Ts {
|
|
4361
4361
|
constructor(e) {
|
|
4362
|
-
he(this, "typeName",
|
|
4363
|
-
he(this, "methods",
|
|
4364
|
-
he(this, "options",
|
|
4362
|
+
he(this, "typeName", On.typeName);
|
|
4363
|
+
he(this, "methods", On.methods);
|
|
4364
|
+
he(this, "options", On.options);
|
|
4365
4365
|
this._transport = e;
|
|
4366
4366
|
}
|
|
4367
4367
|
/**
|
|
@@ -4379,9 +4379,9 @@ class Ls {
|
|
|
4379
4379
|
return qe("unary", this._transport, n, r, e);
|
|
4380
4380
|
}
|
|
4381
4381
|
}
|
|
4382
|
-
const
|
|
4382
|
+
const xs = 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 Ts(n), i = $n.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 Ts = async (s, e, t = !0) => {
|
|
|
4391
4391
|
throw a;
|
|
4392
4392
|
}
|
|
4393
4393
|
};
|
|
4394
|
-
function
|
|
4394
|
+
function _s(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 xs(s, e) {
|
|
|
4403
4403
|
});
|
|
4404
4404
|
}), Object.freeze(s);
|
|
4405
4405
|
}
|
|
4406
|
-
function
|
|
4406
|
+
function Vr(s, e) {
|
|
4407
4407
|
return new Promise(function(t, n) {
|
|
4408
4408
|
let r;
|
|
4409
|
-
return
|
|
4409
|
+
return Us(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 Mr(s, e) {
|
|
|
4415
4415
|
}, n);
|
|
4416
4416
|
});
|
|
4417
4417
|
}
|
|
4418
|
-
const
|
|
4418
|
+
const Us = (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 _s = (s) => new Promise((e, t) => {
|
|
|
4454
4454
|
return e(new Blob());
|
|
4455
4455
|
}), n.readAsArrayBuffer(s);
|
|
4456
4456
|
});
|
|
4457
|
-
var
|
|
4458
|
-
return
|
|
4457
|
+
var wn = {}, Bs = { get exports() {
|
|
4458
|
+
return wn;
|
|
4459
4459
|
}, set exports(s) {
|
|
4460
|
-
|
|
4460
|
+
wn = s;
|
|
4461
4461
|
} };
|
|
4462
4462
|
(function(s) {
|
|
4463
4463
|
var e, t, n = {};
|
|
4464
|
-
|
|
4464
|
+
Bs.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);
|
|
@@ -4615,12 +4615,12 @@ var gn = {}, Us = { get exports() {
|
|
|
4615
4615
|
}
|
|
4616
4616
|
if (y <= d) {
|
|
4617
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
|
|
4619
|
-
d < I - 2 && (
|
|
4620
|
-
var N =
|
|
4621
|
-
if (
|
|
4622
|
-
F = 65535 &
|
|
4623
|
-
var T = l(N =
|
|
4618
|
+
var A = 0;
|
|
4619
|
+
d < I - 2 && (A = n.F._bestMatch(r, d, R, B, Math.min(c[2], I - d), c[3]));
|
|
4620
|
+
var N = A >>> 16, F = 65535 & A;
|
|
4621
|
+
if (A != 0) {
|
|
4622
|
+
F = 65535 & A;
|
|
4623
|
+
var T = l(N = A >>> 16, h.of0);
|
|
4624
4624
|
h.lhst[257 + T]++;
|
|
4625
4625
|
var E = l(F, h.df0);
|
|
4626
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;
|
|
@@ -4658,12 +4658,12 @@ var gn = {}, Us = { get exports() {
|
|
|
4658
4658
|
}, n.saved = 0, n.F._writeBlock = function(r, i, o, a, c, h, l, u, d) {
|
|
4659
4659
|
var f, y, I, L, C, R, O, k, x, b = n.F.U, B = n.F._putsF, m = n.F._putsE;
|
|
4660
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),
|
|
4661
|
+
var g = 32 + (d + 3 & 7 ? 8 - (d + 3 & 7) : 0) + (l << 3), A = 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
4663
|
for (var F = 0; F < 286; F++) b.lhst[F] = 0;
|
|
4664
4664
|
for (F = 0; F < 30; F++) b.dhst[F] = 0;
|
|
4665
4665
|
for (F = 0; F < 19; F++) b.ihst[F] = 0;
|
|
4666
|
-
var T = g <
|
|
4666
|
+
var T = g < A && g < N ? 0 : A < 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);
|
|
@@ -4765,24 +4765,24 @@ var gn = {}, Us = { 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, k = 0, x = 0, b = 0, B = 0, m = 0, g = 0,
|
|
4768
|
+
for (var L, C, R = 0, O = 0, k = 0, x = 0, b = 0, B = 0, m = 0, g = 0, A = 0; R == 0; ) if (R = c(r, A, 1), O = c(r, A + 1, 2), A += 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
|
-
k = h(r,
|
|
4770
|
+
k = h(r, A, 5) + 257, x = h(r, A + 5, 5) + 1, b = h(r, A + 10, 4) + 4, A += 14;
|
|
4771
4771
|
for (var N = 0; N < 38; N += 2) y.itree[N] = 0, y.itree[N + 1] = 0;
|
|
4772
4772
|
var F = 1;
|
|
4773
4773
|
for (N = 0; N < b; N++) {
|
|
4774
|
-
var T = h(r,
|
|
4774
|
+
var T = h(r, A + 3 * N, 3);
|
|
4775
4775
|
y.itree[1 + (y.ordr[N] << 1)] = T, T > F && (F = T);
|
|
4776
4776
|
}
|
|
4777
|
-
|
|
4777
|
+
A += 3 * b, u(y.itree, F), d(y.itree, F, y.imap), L = y.lmap, C = y.dmap, A = l(y.imap, (1 << F) - 1, k + x, r, A, y.ttree);
|
|
4778
4778
|
var E = a._copyOut(y.ttree, 0, k, y.ltree);
|
|
4779
4779
|
B = (1 << E) - 1;
|
|
4780
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, A) & B];
|
|
4785
|
+
A += 15 & w;
|
|
4786
4786
|
var p = w >>> 4;
|
|
4787
4787
|
if (!(p >>> 8)) i[g++] = p;
|
|
4788
4788
|
else {
|
|
@@ -4790,19 +4790,19 @@ var gn = {}, Us = { 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, A, 7 & _), A += 7 & _;
|
|
4794
4794
|
}
|
|
4795
|
-
var V = C[f(r,
|
|
4796
|
-
|
|
4797
|
-
var q = V >>> 4, P = y.ddef[q], Z = (P >>> 4) + c(r,
|
|
4798
|
-
for (
|
|
4795
|
+
var V = C[f(r, A) & m];
|
|
4796
|
+
A += 15 & V;
|
|
4797
|
+
var q = V >>> 4, P = y.ddef[q], Z = (P >>> 4) + c(r, A, 15 & P);
|
|
4798
|
+
for (A += 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 $ = 4 + (
|
|
4805
|
-
I && (i = n.F._check(i, g + S)), i.set(new o(r.buffer, r.byteOffset + $, S), g),
|
|
4803
|
+
7 & A && (A += 8 - (7 & A));
|
|
4804
|
+
var $ = 4 + (A >>> 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), A = $ + 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 gn = {}, Us = { 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 Os = _s({ __proto__: null, default: wn }, [wn]);
|
|
4876
4876
|
const ze = function() {
|
|
4877
4877
|
var s = { nextZero(l, u) {
|
|
4878
4878
|
for (; l[u] != 0; ) u++;
|
|
@@ -4928,17 +4928,17 @@ const ze = function() {
|
|
|
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 (k == 1) for (var
|
|
4932
|
-
var N =
|
|
4931
|
+
if (k == 1) for (var A = 0; A < d; A++) {
|
|
4932
|
+
var N = A * L, F = A * u;
|
|
4933
4933
|
for (b = 0; b < u; b++) {
|
|
4934
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 (k == 2) for (
|
|
4939
|
+
if (k == 2) for (A = 0; A < d; A++) for (N = A * L, F = A * u, b = 0; b < u; b++)
|
|
4940
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 (
|
|
4941
|
+
if (k == 4) for (A = 0; A < d; A++) for (N = A * L, F = A * u, b = 0; b < u; b++)
|
|
4942
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
4943
|
if (k == 8) for (b = 0; b < y; b++) {
|
|
4944
4944
|
var E;
|
|
@@ -4954,8 +4954,8 @@ const ze = function() {
|
|
|
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 _ =
|
|
4957
|
+
} else if (O == 0) for (m = f.tabs.tRNS ? f.tabs.tRNS : -1, A = 0; A < d; A++) {
|
|
4958
|
+
const _ = A * L, V = A * u;
|
|
4959
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;
|
|
@@ -4975,7 +4975,7 @@ const ze = function() {
|
|
|
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
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
|
|
4978
|
+
let A = 0;
|
|
4979
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; ) {
|
|
@@ -4985,10 +4985,10 @@ const ze = function() {
|
|
|
4985
4985
|
let P = F[U];
|
|
4986
4986
|
for (; P < k; ) P += M, _++;
|
|
4987
4987
|
const Z = Math.ceil(_ * b / 8);
|
|
4988
|
-
o(R, O,
|
|
4988
|
+
o(R, O, A, _, V);
|
|
4989
4989
|
let $ = 0, S = N[U];
|
|
4990
4990
|
for (; S < x; ) {
|
|
4991
|
-
let z = F[U], ae =
|
|
4991
|
+
let z = F[U], ae = A + $ * Z << 3;
|
|
4992
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) {
|
|
@@ -4999,7 +4999,7 @@ const ze = function() {
|
|
|
4999
4999
|
}
|
|
5000
5000
|
$++, S += p;
|
|
5001
5001
|
}
|
|
5002
|
-
_ * V != 0 && (
|
|
5002
|
+
_ * V != 0 && (A += V * (1 + Z)), U += 1;
|
|
5003
5003
|
}
|
|
5004
5004
|
return g;
|
|
5005
5005
|
}(u, l)), u;
|
|
@@ -5013,8 +5013,8 @@ const ze = function() {
|
|
|
5013
5013
|
const f = Uint8Array;
|
|
5014
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, A = 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 = A(u, m, 1), C = A(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
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;
|
|
@@ -5044,7 +5044,7 @@ const ze = function() {
|
|
|
5044
5044
|
}
|
|
5045
5045
|
const P = I[U(u, m) & b];
|
|
5046
5046
|
m += 15 & P;
|
|
5047
|
-
const Z = P >>> 4, $ = w.c[Z], S = ($ >>> 4) +
|
|
5047
|
+
const Z = P >>> 4, $ = w.c[Z], S = ($ >>> 4) + A(u, m, 15 & $);
|
|
5048
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
|
}
|
|
@@ -5178,13 +5178,13 @@ const ze = function() {
|
|
|
5178
5178
|
let x = 0, b = 0;
|
|
5179
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, A = 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 + F * p) * _, f[b + 1] = (g + T * p) * _, f[b + 2] = (
|
|
5183
|
+
f[b + 3] = 255 * M, f[b + 0] = (m + F * p) * _, f[b + 1] = (g + T * p) * _, f[b + 2] = (A + 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], A = l[x + 2], N = f[b + 3], F = f[b], T = f[b + 1], E = f[b + 2], B == N && m == F && g == T && A == 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] = A, 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], A = l[x + 2], N = f[b + 3], F = f[b], T = f[b + 1], E = f[b + 2], B == N && m == F && g == T && A == E) continue;
|
|
5188
5188
|
if (B < 220 && N > 20) return !1;
|
|
5189
5189
|
}
|
|
5190
5190
|
return !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), A = 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
5238
|
var F = n(d.slice(g + 2, g + 2 + N));
|
|
5239
5239
|
T = y.readUTF8(F, 0, F.length);
|
|
5240
5240
|
}
|
|
5241
|
-
C.tabs[w][
|
|
5241
|
+
C.tabs[w][A] = 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), A = 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) : (F = n(d.slice(m, m + N)), T = y.readUTF8(F, 0, F.length)), C.tabs[w][
|
|
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][A] = 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;
|
|
@@ -5264,9 +5264,9 @@ const ze = function() {
|
|
|
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
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,
|
|
5267
|
+
const x = u.frames[k], b = x.rect.x, B = x.rect.y, m = x.rect.width, g = x.rect.height, A = e(x.data, m, g, u);
|
|
5268
5268
|
if (k != 0) for (var O = 0; O < I; O++) R[O] = L[O];
|
|
5269
|
-
if (x.blend == 0 ? h(
|
|
5269
|
+
if (x.blend == 0 ? h(A, m, g, L, d, f, b, B, 0) : x.blend == 1 && h(A, 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 A = g;
|
|
5283
|
+
for (let N = 0; N < 8; N++) 1 & A ? A = 3988292384 ^ A >>> 1 : A >>>= 1;
|
|
5284
|
+
m[g] = A;
|
|
5285
5285
|
}
|
|
5286
5286
|
return m;
|
|
5287
|
-
}(), update(m, g,
|
|
5288
|
-
for (let F = 0; F < N; F++) m = n.table[255 & (m ^ g[
|
|
5287
|
+
}(), update(m, g, A, N) {
|
|
5288
|
+
for (let F = 0; F < N; F++) m = n.table[255 & (m ^ g[A + F])] ^ m >>> 8;
|
|
5289
5289
|
return m;
|
|
5290
|
-
}, crc: (m, g,
|
|
5291
|
-
function r(m, g,
|
|
5292
|
-
g[
|
|
5290
|
+
}, crc: (m, g, A) => 4294967295 ^ n.update(4294967295, m, g, A) };
|
|
5291
|
+
function r(m, g, A, N) {
|
|
5292
|
+
g[A] += m[0] * N >> 4, g[A + 1] += m[1] * N >> 4, g[A + 2] += m[2] * N >> 4, g[A + 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 A = m[0] - g[0], N = m[1] - g[1], F = m[2] - g[2], T = m[3] - g[3];
|
|
5299
|
+
return A * A + N * N + F * F + T * T;
|
|
5300
5300
|
}
|
|
5301
|
-
function a(m, g,
|
|
5301
|
+
function a(m, g, A, 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,9 +5312,9 @@ const ze = function() {
|
|
|
5312
5312
|
_ != p && V < S && (S = V, M = _);
|
|
5313
5313
|
}
|
|
5314
5314
|
}
|
|
5315
|
-
const q = new Uint32Array(F.buffer), P = new Int16Array(g *
|
|
5315
|
+
const q = new Uint32Array(F.buffer), P = new Int16Array(g * A * 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 <
|
|
5317
|
+
for (let S = 0; S < A; S++) for (let z = 0; z < g; z++) {
|
|
5318
5318
|
var $;
|
|
5319
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;
|
|
@@ -5323,10 +5323,10 @@ const ze = function() {
|
|
|
5323
5323
|
re < ae && (ae = re, M = _);
|
|
5324
5324
|
}
|
|
5325
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 !=
|
|
5326
|
+
E == 1 && (z != g - 1 && r(Q, P, p + 4, 7), S != A - 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,
|
|
5329
|
+
function c(m, g, A, N, F) {
|
|
5330
5330
|
F == null && (F = {});
|
|
5331
5331
|
const { crc: T } = n, E = e.writeUint, U = e.writeUshort, w = e.writeASCII;
|
|
5332
5332
|
let p = 8;
|
|
@@ -5341,7 +5341,7 @@ const ze = function() {
|
|
|
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, A), 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
|
}
|
|
@@ -5366,15 +5366,15 @@ const ze = function() {
|
|
|
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, A) {
|
|
5370
5370
|
for (let N = 0; N < m.frames.length; N++) {
|
|
5371
5371
|
const F = m.frames[N];
|
|
5372
5372
|
F.rect.width;
|
|
5373
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,
|
|
5374
|
+
F.cimg = f(F.img, T, F.bpp, F.bpl, E, g, A);
|
|
5375
5375
|
}
|
|
5376
5376
|
}
|
|
5377
|
-
function l(m, g,
|
|
5377
|
+
function l(m, g, A, N, F) {
|
|
5378
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
5380
|
for (var P = 0; P < m.length; P++) {
|
|
@@ -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 on = Ie || Ne || Y == 1 || fe[Y - 2].dispose != 0 ? 1 : 2;
|
|
5392
5392
|
let Dt = 0, ce = 1e9;
|
|
5393
|
-
for (let We = 0; We <
|
|
5393
|
+
for (let We = 0; We < on; We++) {
|
|
5394
5394
|
var _e = new Uint8Array(le[Y - 1 - We]);
|
|
5395
5395
|
const rt = new Uint32Array(le[Y - 1 - We]);
|
|
5396
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
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
5399
|
Rt == -1 && (yt = bt = Rt = Xt = 0), me && ((1 & yt) == 1 && yt--, (1 & bt) == 1 && bt--);
|
|
5400
|
-
const
|
|
5401
|
-
|
|
5400
|
+
const qn = (Rt - yt + 1) * (Xt - bt + 1);
|
|
5401
|
+
qn < ce && (ce = qn, 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);
|
|
@@ -5415,7 +5415,7 @@ const ze = function() {
|
|
|
5415
5415
|
et += (tt = fe[ve]).rect.width * tt.rect.height;
|
|
5416
5416
|
}
|
|
5417
5417
|
return fe;
|
|
5418
|
-
}(m, g,
|
|
5418
|
+
}(m, g, A, T, E, U), ae = {}, te = [], Q = [];
|
|
5419
5419
|
if (N != 0) {
|
|
5420
5420
|
const Fe = [];
|
|
5421
5421
|
for ($ = 0; $ < z.length; $++) Fe.push(z[$].img.buffer);
|
|
@@ -5492,42 +5492,42 @@ const ze = function() {
|
|
|
5492
5492
|
}
|
|
5493
5493
|
return { ctype: _, depth: V, plte: te, frames: z };
|
|
5494
5494
|
}
|
|
5495
|
-
function u(m, g,
|
|
5495
|
+
function u(m, g, A, N, F, T, E) {
|
|
5496
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 =
|
|
5497
|
+
let P = g, Z = A, $ = -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
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
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
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,
|
|
5504
|
+
z.rect = T, z.blend = 1, z.img = new Uint8Array(T.width * T.height * 4), N[F - 1].dispose == 0 ? (s(p, g, A, z.img, T.width, T.height, -T.x, -T.y, 0), d(V, g, A, z.img, T)) : s(V, g, A, 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, A, N, F) {
|
|
5507
|
+
s(m, g, A, N, F.width, F.height, -F.x, -F.y, 2);
|
|
5508
5508
|
}
|
|
5509
|
-
function f(m, g,
|
|
5509
|
+
function f(m, g, A, 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 || A == 1) && (p = [0]), E && (w = { level: 0 });
|
|
5513
|
+
const M = Os;
|
|
5514
5514
|
for (var _ = 0; _ < p.length; _++) {
|
|
5515
|
-
for (let P = 0; P < g; P++) y(F, m, P, N,
|
|
5515
|
+
for (let P = 0; P < g; P++) y(F, m, P, N, A, p[_]);
|
|
5516
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, A, N, F, T) {
|
|
5523
|
+
const E = A * N;
|
|
5524
|
+
let U = E + A;
|
|
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
5528
|
for (w = 0; w < F; w++) m[U + w] = g[E + w];
|
|
5529
5529
|
for (w = F; w < N; w++) m[U + w] = g[E + w] - g[E + w - F] + 256 & 255;
|
|
5530
|
-
} else if (
|
|
5530
|
+
} else if (A == 0) {
|
|
5531
5531
|
for (w = 0; w < F; w++) m[U + w] = g[E + w];
|
|
5532
5532
|
if (T == 2) for (w = F; w < N; w++) m[U + w] = g[E + w];
|
|
5533
5533
|
if (T == 3) for (w = F; w < N; w++) m[U + w] = g[E + w] - (g[E + w - F] >> 1) + 256 & 255;
|
|
@@ -5545,26 +5545,26 @@ const ze = function() {
|
|
|
5545
5545
|
}
|
|
5546
5546
|
}
|
|
5547
5547
|
function I(m, g) {
|
|
5548
|
-
const
|
|
5548
|
+
const A = new Uint8Array(m), N = A.slice(0), F = new Uint32Array(N.buffer), T = L(N, g), E = T[0], U = T[1], w = A.length, p = new Uint8Array(w >> 2);
|
|
5549
5549
|
let M;
|
|
5550
|
-
if (
|
|
5551
|
-
M = C(E, V =
|
|
5550
|
+
if (A.length < 2e7) for (var _ = 0; _ < w; _ += 4)
|
|
5551
|
+
M = C(E, V = A[_] * (1 / 255), q = A[_ + 1] * (1 / 255), P = A[_ + 2] * (1 / 255), Z = A[_ + 3] * (1 / 255)), p[_ >> 2] = M.ind, F[_ >> 2] = M.est.rgba;
|
|
5552
5552
|
else for (_ = 0; _ < w; _ += 4) {
|
|
5553
|
-
var V =
|
|
5553
|
+
var V = A[_] * 0.00392156862745098, q = A[_ + 1] * (1 / 255), P = A[_ + 2] * (1 / 255), Z = A[_ + 3] * (1 / 255);
|
|
5554
5554
|
for (M = E; M.left; ) M = R(M.est, V, q, P, Z) <= 0 ? M.left : M.right;
|
|
5555
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
|
-
|
|
5559
|
+
function L(m, g, A) {
|
|
5560
|
+
A == null && (A = 1e-4);
|
|
5561
5561
|
const N = new Uint32Array(m.buffer), F = { i0: 0, i1: m.length, bst: null, est: null, tdst: 0, left: null, right: null };
|
|
5562
5562
|
F.bst = x(m, F.i0, F.i1), F.est = b(F.bst);
|
|
5563
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 < A) 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;
|
|
@@ -5580,64 +5580,64 @@ const ze = function() {
|
|
|
5580
5580
|
for (T.sort((U, w) => w.bst.N - U.bst.N), E = 0; E < T.length; E++) T[E].ind = E;
|
|
5581
5581
|
return [F, T];
|
|
5582
5582
|
}
|
|
5583
|
-
function C(m, g,
|
|
5583
|
+
function C(m, g, A, N, F) {
|
|
5584
5584
|
if (m.left == null) return m.tdst = function(_, V, q, P, Z) {
|
|
5585
5585
|
const $ = V - _[0], S = q - _[1], z = P - _[2], ae = Z - _[3];
|
|
5586
5586
|
return $ * $ + S * S + z * z + ae * ae;
|
|
5587
|
-
}(m.est.q, g,
|
|
5588
|
-
const T = R(m.est, g,
|
|
5587
|
+
}(m.est.q, g, A, N, F), m;
|
|
5588
|
+
const T = R(m.est, g, A, 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, A, N, F);
|
|
5592
5592
|
if (w.tdst <= T * T) return w;
|
|
5593
|
-
const p = C(U, g,
|
|
5593
|
+
const p = C(U, g, A, N, F);
|
|
5594
5594
|
return p.tdst < w.tdst ? p : w;
|
|
5595
5595
|
}
|
|
5596
|
-
function R(m, g,
|
|
5596
|
+
function R(m, g, A, N, F) {
|
|
5597
5597
|
const { e: T } = m;
|
|
5598
|
-
return T[0] * g + T[1] *
|
|
5598
|
+
return T[0] * g + T[1] * A + T[2] * N + T[3] * F - m.eMq;
|
|
5599
5599
|
}
|
|
5600
|
-
function O(m, g,
|
|
5601
|
-
for (N -= 4;
|
|
5602
|
-
for (; k(m,
|
|
5600
|
+
function O(m, g, A, N, F, T) {
|
|
5601
|
+
for (N -= 4; A < N; ) {
|
|
5602
|
+
for (; k(m, A, F) <= T; ) A += 4;
|
|
5603
5603
|
for (; k(m, N, F) > T; ) N -= 4;
|
|
5604
|
-
if (
|
|
5605
|
-
const E = g[
|
|
5606
|
-
g[
|
|
5604
|
+
if (A >= N) break;
|
|
5605
|
+
const E = g[A >> 2];
|
|
5606
|
+
g[A >> 2] = g[N >> 2], g[N >> 2] = E, A += 4, N -= 4;
|
|
5607
5607
|
}
|
|
5608
|
-
for (; k(m,
|
|
5609
|
-
return
|
|
5608
|
+
for (; k(m, A, F) > T; ) A -= 4;
|
|
5609
|
+
return A + 4;
|
|
5610
5610
|
}
|
|
5611
|
-
function k(m, g,
|
|
5612
|
-
return m[g] *
|
|
5611
|
+
function k(m, g, A) {
|
|
5612
|
+
return m[g] * A[0] + m[g + 1] * A[1] + m[g + 2] * A[2] + m[g + 3] * A[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], F = [0, 0, 0, 0], T =
|
|
5616
|
-
for (let E = g; E <
|
|
5614
|
+
function x(m, g, A) {
|
|
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 = A - g >> 2;
|
|
5616
|
+
for (let E = g; E < A; 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
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:
|
|
5623
|
+
const { R: g } = m, { m: A } = m, { N } = m, F = A[0], T = A[1], E = A[2], U = A[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
5624
|
let V = [Math.random(), Math.random(), Math.random(), Math.random()], q = 0, P = 0;
|
|
5625
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
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,
|
|
5630
|
+
ze.encode = function(g, A, N, F, T, E, U) {
|
|
5631
5631
|
F == null && (F = 0), U == null && (U = !1);
|
|
5632
|
-
const w = l(g,
|
|
5633
|
-
return h(w, -1), c(w,
|
|
5634
|
-
}, ze.encodeLL = function(g,
|
|
5635
|
-
const p = { ctype: 0 + (F == 1 ? 0 : 2) + (T == 0 ? 0 : 4), depth: E, frames: [] }, M = (F + T) * E, _ = M *
|
|
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,
|
|
5632
|
+
const w = l(g, A, N, F, [!1, !1, !1, 0, U, !1]);
|
|
5633
|
+
return h(w, -1), c(w, A, N, T, E);
|
|
5634
|
+
}, ze.encodeLL = function(g, A, 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 * A;
|
|
5636
|
+
for (let V = 0; V < g.length; V++) p.frames.push({ rect: { x: 0, y: 0, width: A, 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, A, 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 Hr = { 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
5642
|
let f, y, I, L, C = d, R = 0, O = 0, k = 0;
|
|
5643
5643
|
function x(m) {
|
|
@@ -5654,16 +5654,16 @@ const Vr = { toArrayBuffer(s, e) {
|
|
|
5654
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
|
-
k < o.length ? (C = d, setTimeout(m,
|
|
5657
|
+
k < o.length ? (C = d, setTimeout(m, Hr._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" }, Ss = { [Ve.CHROME]: 16384, [Ve.FIREFOX]: 11180, [Ve.DESKTOP_SAFARI]: 16384, [Ve.IE]: 8192, [Ve.IOS]: 4096, [Ve.ETC]: 8192 };
|
|
5665
|
+
const jn = typeof window < "u", $r = typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope, yn = jn && window.cordova && window.cordova.require && window.cordova.require("cordova/modulemapper"), Ds = (jn || $r) && (yn && yn.getOriginalSymbol(window, "File") || typeof File < "u" && File), Pr = (jn || $r) && (yn && yn.getOriginalSymbol(window, "FileReader") || typeof FileReader < "u" && FileReader);
|
|
5666
|
+
function Zn(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 jn(s, e, t = Date.now()) {
|
|
|
5673
5673
|
h.name = e, h.lastModified = t, n(h);
|
|
5674
5674
|
});
|
|
5675
5675
|
}
|
|
5676
|
-
function
|
|
5676
|
+
function Wr(s) {
|
|
5677
5677
|
return new Promise((e, t) => {
|
|
5678
|
-
const n = new
|
|
5678
|
+
const n = new Pr();
|
|
5679
5679
|
n.onload = () => e(n.result), n.onerror = (r) => t(r), n.readAsDataURL(s);
|
|
5680
5680
|
});
|
|
5681
5681
|
}
|
|
5682
|
-
function
|
|
5682
|
+
function jr(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 Zr(s, e) {
|
|
5695
|
+
const t = Ut(), n = Ss[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 jr(s, e) {
|
|
|
5701
5701
|
}
|
|
5702
5702
|
return { width: r, height: i };
|
|
5703
5703
|
}
|
|
5704
|
-
function
|
|
5704
|
+
function Nn(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 Fn(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 qr(s, e) {
|
|
5714
|
+
const { width: t, height: n } = Zr(s.width, s.height), [r, i] = Nn(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 fn() {
|
|
5718
|
+
return fn.cachedResult !== void 0 || (fn.cachedResult = ["iPad Simulator", "iPhone Simulator", "iPod Simulator", "iPad", "iPhone", "iPod"].includes(navigator.platform) || navigator.userAgent.includes("Mac") && typeof document < "u" && "ontouchend" in document), fn.cachedResult;
|
|
5719
5719
|
}
|
|
5720
|
-
function
|
|
5720
|
+
function bn(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 = qr(r, e.fileType || s.type), t([r, i]);
|
|
5726
5726
|
} catch (c) {
|
|
5727
5727
|
return n(c);
|
|
5728
5728
|
}
|
|
@@ -5737,9 +5737,9 @@ function yn(s, e = {}) {
|
|
|
5737
5737
|
};
|
|
5738
5738
|
try {
|
|
5739
5739
|
let l;
|
|
5740
|
-
return
|
|
5740
|
+
return Wr(s).then(function(u) {
|
|
5741
5741
|
try {
|
|
5742
|
-
return l = u,
|
|
5742
|
+
return l = u, jr(l).then(function(d) {
|
|
5743
5743
|
try {
|
|
5744
5744
|
return r = d, function() {
|
|
5745
5745
|
try {
|
|
@@ -5764,7 +5764,7 @@ function yn(s, e = {}) {
|
|
|
5764
5764
|
}
|
|
5765
5765
|
};
|
|
5766
5766
|
try {
|
|
5767
|
-
if (
|
|
5767
|
+
if (fn() || [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 yn(s, e = {}) {
|
|
|
5777
5777
|
}
|
|
5778
5778
|
});
|
|
5779
5779
|
}
|
|
5780
|
-
function
|
|
5780
|
+
function Cn(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 bn(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) => Hr.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 bn(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), Zn(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) : Zn("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, bn(t).then(function(a) {
|
|
5835
5835
|
try {
|
|
5836
|
-
return n = a[1],
|
|
5836
|
+
return n = a[1], Cn(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), bn(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 Kr(s) {
|
|
5860
5860
|
return new Promise((e, t) => {
|
|
5861
|
-
const n = new
|
|
5861
|
+
const n = new Pr();
|
|
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 qr(s) {
|
|
|
5883
5883
|
}, n.onerror = (r) => t(r), n.readAsArrayBuffer(s);
|
|
5884
5884
|
});
|
|
5885
5885
|
}
|
|
5886
|
-
function
|
|
5886
|
+
function zr(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] = Nn(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 Xr(s, e) {
|
|
5892
|
+
const { width: t } = s, { height: n } = s, [r, i] = Nn(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 zr(s, e) {
|
|
|
5914
5914
|
}
|
|
5915
5915
|
return i.drawImage(s, 0, 0, t, n), lt(s), r;
|
|
5916
5916
|
}
|
|
5917
|
-
function
|
|
5917
|
+
function gr(s, e, t = 0) {
|
|
5918
5918
|
return new Promise(function(n, r) {
|
|
5919
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 A(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(), bn(s, e).then((function(N) {
|
|
5929
5929
|
try {
|
|
5930
|
-
return [, c] = N, g(), h =
|
|
5930
|
+
return [, c] = N, g(), h = zr(c, e), g(), new Promise(function(F, T) {
|
|
5931
5931
|
var E;
|
|
5932
|
-
if (!(E = e.exifOrientation)) return
|
|
5932
|
+
if (!(E = e.exifOrientation)) return Kr(s).then((function(w) {
|
|
5933
5933
|
try {
|
|
5934
5934
|
return E = w, U.call(this);
|
|
5935
5935
|
} catch (p) {
|
|
@@ -5944,15 +5944,15 @@ function mr(s, e, t = 0) {
|
|
|
5944
5944
|
try {
|
|
5945
5945
|
return l = F, g(), Mt().then((function(T) {
|
|
5946
5946
|
try {
|
|
5947
|
-
return u = T ? h :
|
|
5947
|
+
return u = T ? h : Xr(h, l), g(), d = e.initialQuality || 1, f = e.fileType || s.type, Cn(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] = Nn(M, _), b.drawImage(B, 0, 0, M, _), d *= f === "image/png" ? 0.85 : 0.95, Cn(x, f, s.name, s.lastModified, d).then(function(V) {
|
|
5954
5954
|
try {
|
|
5955
|
-
return k = V, lt(B), B = x, O = k.size,
|
|
5955
|
+
return k = V, lt(B), B = x, O = k.size, A(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 mr(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), A(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 A(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; ) {
|
|
@@ -5996,7 +5996,7 @@ function mr(s, e, t = 0) {
|
|
|
5996
5996
|
}).bind(this), r);
|
|
5997
5997
|
});
|
|
5998
5998
|
}
|
|
5999
|
-
const
|
|
5999
|
+
const Rs = `
|
|
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 Sn;
|
|
6020
|
+
function Ms(s, e) {
|
|
6021
6021
|
return new Promise((t, n) => {
|
|
6022
|
-
|
|
6022
|
+
Sn || (Sn = function(o) {
|
|
6023
6023
|
const a = [];
|
|
6024
6024
|
return a.push(o), URL.createObjectURL(new Blob(a));
|
|
6025
|
-
}(
|
|
6026
|
-
const r = new Worker(
|
|
6025
|
+
}(Rs));
|
|
6026
|
+
const r = new Worker(Sn);
|
|
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 Ds)) 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 gr(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 gr(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", Ms(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 = Vr(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 = Wr, Oe.getFilefromDataUrl = Zn, Oe.loadImage = jr, Oe.drawImageInCanvas = qr, Oe.drawFileInCanvas = bn, Oe.canvasToFile = Cn, Oe.getExifOrientation = Kr, Oe.handleMaxWidthOrHeight = zr, Oe.followExifOrientation = Xr, Oe.cleanupCanvasMemory = lt, Oe.isAutoOrientationInBrowser = Mt, Oe.approximateBelowMaximumCanvasSizeOfBrowser = Zr, Oe.copyExifWithoutOrientation = Vr, Oe.getBrowserName = Ut, Oe.version = "2.0.2";
|
|
6096
|
+
const wr = async (s, e, t, n = !0) => {
|
|
6097
6097
|
try {
|
|
6098
|
-
const r =
|
|
6098
|
+
const r = Vs(s, e), o = (await xs(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 gr = async (s, e, t, n = !0) => {
|
|
|
6107
6107
|
} catch (r) {
|
|
6108
6108
|
throw r;
|
|
6109
6109
|
}
|
|
6110
|
-
},
|
|
6110
|
+
}, Vs = (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 gr = 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 yr(s) {
|
|
6120
6120
|
const e = {
|
|
6121
6121
|
maxSizeMB: 2,
|
|
6122
6122
|
maxWidthOrHeight: 1920,
|
|
@@ -6128,8 +6128,8 @@ async function wr(s) {
|
|
|
6128
6128
|
throw Error(t);
|
|
6129
6129
|
}
|
|
6130
6130
|
}
|
|
6131
|
-
var Et, be, Ce, ft, ge, ke, it, $e, Bt, vt, st, Ge, At, Ht,
|
|
6132
|
-
class
|
|
6131
|
+
var Et, be, Ce, ft, ge, ke, it, $e, Bt, vt, st, Ge, At, Ht, En, kt, Ft, pt, Ot, ot, at, Nt, It, mt, $t, en, Se, gt, tn, vn, nn, Te, Pt, Lt, Wt, jt, Zt, qt, Kt, rn, sn;
|
|
6132
|
+
class $s {
|
|
6133
6133
|
constructor(e) {
|
|
6134
6134
|
X(this, Et);
|
|
6135
6135
|
X(this, be);
|
|
@@ -6145,7 +6145,7 @@ class Hs {
|
|
|
6145
6145
|
X(this, Ge);
|
|
6146
6146
|
X(this, At);
|
|
6147
6147
|
X(this, Ht);
|
|
6148
|
-
X(this,
|
|
6148
|
+
X(this, En);
|
|
6149
6149
|
X(this, kt);
|
|
6150
6150
|
X(this, Ft);
|
|
6151
6151
|
X(this, pt);
|
|
@@ -6160,7 +6160,7 @@ class Hs {
|
|
|
6160
6160
|
X(this, Se);
|
|
6161
6161
|
X(this, gt);
|
|
6162
6162
|
X(this, tn, !1);
|
|
6163
|
-
X(this,
|
|
6163
|
+
X(this, vn);
|
|
6164
6164
|
X(this, nn);
|
|
6165
6165
|
X(this, Te);
|
|
6166
6166
|
X(this, Pt);
|
|
@@ -6171,6 +6171,7 @@ class Hs {
|
|
|
6171
6171
|
X(this, qt);
|
|
6172
6172
|
X(this, Kt);
|
|
6173
6173
|
X(this, rn);
|
|
6174
|
+
X(this, sn);
|
|
6174
6175
|
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
6176
|
H(this, tn, !0), this._renderView(e), this.updateWindowObject({ initialized: !0 }), this._initializeGrpcConfig(e.mode, e.endPoint);
|
|
6176
6177
|
});
|
|
@@ -6187,10 +6188,10 @@ class Hs {
|
|
|
6187
6188
|
return e.isAdmin === !0;
|
|
6188
6189
|
}
|
|
6189
6190
|
_renderView(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));
|
|
6191
|
+
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.removeImageConfirm.bind(this)), H(this, sn, e.removeImagePreviewCB.bind(this)), this._removeUserToast(), this._renderUserView(e));
|
|
6191
6192
|
}
|
|
6192
6193
|
_renderAdminView(e) {
|
|
6193
|
-
if (!
|
|
6194
|
+
if (!v(this, tn)) return;
|
|
6194
6195
|
const { parentContainerId: t } = e;
|
|
6195
6196
|
if (e.isAdmin === !0)
|
|
6196
6197
|
var { buttonProps: n } = e;
|
|
@@ -6204,18 +6205,18 @@ class Hs {
|
|
|
6204
6205
|
const o = document.createElement("span");
|
|
6205
6206
|
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", () => {
|
|
6206
6207
|
this._selectedImageContainer();
|
|
6207
|
-
}),
|
|
6208
|
+
}), v(this, Et).appendChild(r);
|
|
6208
6209
|
}
|
|
6209
6210
|
async _grpcOptionInitializer() {
|
|
6210
|
-
H(this, Se, await
|
|
6211
|
-
|
|
6212
|
-
|
|
6211
|
+
H(this, Se, await ks(
|
|
6212
|
+
v(this, en),
|
|
6213
|
+
v(this, Wt)
|
|
6213
6214
|
));
|
|
6214
6215
|
}
|
|
6215
6216
|
_selectedImageContainer() {
|
|
6216
6217
|
var u;
|
|
6217
6218
|
H(this, At, He(
|
|
6218
|
-
`Save (${(u =
|
|
6219
|
+
`Save (${(u = v(this, ge)) == null ? void 0 : u.length})`,
|
|
6219
6220
|
"dialog-btn confirm"
|
|
6220
6221
|
)), H(this, Ft, K("folder-container")), H(this, pt, K("folder-list-wrapper")), this._fetchAllFolders();
|
|
6221
6222
|
const e = He("Cancel", "dialog-btn cancel");
|
|
@@ -6226,21 +6227,21 @@ class Hs {
|
|
|
6226
6227
|
!1,
|
|
6227
6228
|
'<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>'
|
|
6228
6229
|
).addEventListener("click", () => {
|
|
6229
|
-
|
|
6230
|
+
hn.hide(), H(this, ge, []), H(this, ke, []);
|
|
6230
6231
|
}), H(this, be, K("browse-container"));
|
|
6231
6232
|
const n = K();
|
|
6232
6233
|
n.style.display = "flex", n.style.alignItems = "center", n.style.justifyContent = "space-between", n.style.padding = "10px 20px";
|
|
6233
6234
|
const r = Jt("Folders", "folder-title"), i = He("", "add-folder-btn");
|
|
6234
|
-
i.append(
|
|
6235
|
+
i.append(dr()), this._createUpdateFolderDialog(i, "create"), n.append(r, i), v(this, Ft).append(n, v(this, pt));
|
|
6235
6236
|
const o = this._renderSearchField(), a = this._createBrowseMoreContainer(), c = this._createBrowseImageMain(), h = K("footer");
|
|
6236
6237
|
e.onclick = () => {
|
|
6237
|
-
|
|
6238
|
-
},
|
|
6239
|
-
|
|
6240
|
-
}, h.append(e,
|
|
6238
|
+
v(this, En).call(this), hn.hide(), H(this, ke, []), H(this, ge, []);
|
|
6239
|
+
}, v(this, At).onclick = () => {
|
|
6240
|
+
v(this, Ht).call(this), hn.hide(), H(this, ge, []), H(this, ke, []);
|
|
6241
|
+
}, h.append(e, v(this, At));
|
|
6241
6242
|
const l = K("container-right-main");
|
|
6242
|
-
l.append(o, a, c, h),
|
|
6243
|
-
content:
|
|
6243
|
+
l.append(o, a, c, h), v(this, be).append(v(this, Ft), l), hn.show({
|
|
6244
|
+
content: v(this, be)
|
|
6244
6245
|
});
|
|
6245
6246
|
}
|
|
6246
6247
|
_renderUserView(e) {
|
|
@@ -6262,15 +6263,15 @@ class Hs {
|
|
|
6262
6263
|
"margin-block: 0px; font-size: 13px; color: #777",
|
|
6263
6264
|
`Max File size: ${n}MB`
|
|
6264
6265
|
);
|
|
6265
|
-
i.append(
|
|
6266
|
+
i.append(Un(), c, h);
|
|
6266
6267
|
} else
|
|
6267
|
-
i.append(
|
|
6268
|
-
return this._setupDragAndDrop(
|
|
6268
|
+
i.append(Un(), c);
|
|
6269
|
+
return this._setupDragAndDrop(v(this, Te)), v(this, Te).append(i), r && this._renderImagePreview(r, "", i, !0), v(this, Et).appendChild(v(this, Te)), v(this, Et);
|
|
6269
6270
|
}
|
|
6270
6271
|
_setupDragAndDrop(e) {
|
|
6271
6272
|
if (!e) return;
|
|
6272
6273
|
["dragenter", "dragover", "dragleave", "drop"].forEach((n) => {
|
|
6273
|
-
|
|
6274
|
+
v(this, Te).addEventListener(
|
|
6274
6275
|
n,
|
|
6275
6276
|
(r) => {
|
|
6276
6277
|
r.preventDefault(), r.stopPropagation();
|
|
@@ -6278,22 +6279,22 @@ class Hs {
|
|
|
6278
6279
|
!1
|
|
6279
6280
|
);
|
|
6280
6281
|
}), ["dragenter", "dragover"].forEach((n) => {
|
|
6281
|
-
|
|
6282
|
+
v(this, Te).addEventListener(
|
|
6282
6283
|
n,
|
|
6283
6284
|
() => {
|
|
6284
|
-
|
|
6285
|
+
v(this, Te).classList.add("highlight");
|
|
6285
6286
|
},
|
|
6286
6287
|
!1
|
|
6287
6288
|
);
|
|
6288
6289
|
}), ["dragleave", "drop"].forEach((n) => {
|
|
6289
|
-
|
|
6290
|
+
v(this, Te).addEventListener(
|
|
6290
6291
|
n,
|
|
6291
6292
|
() => {
|
|
6292
|
-
|
|
6293
|
+
v(this, Te).classList.remove("highlight");
|
|
6293
6294
|
},
|
|
6294
6295
|
!1
|
|
6295
6296
|
);
|
|
6296
|
-
}),
|
|
6297
|
+
}), v(this, Te).addEventListener(
|
|
6297
6298
|
"drop",
|
|
6298
6299
|
(n) => {
|
|
6299
6300
|
var i;
|
|
@@ -6305,7 +6306,7 @@ class Hs {
|
|
|
6305
6306
|
);
|
|
6306
6307
|
}
|
|
6307
6308
|
_renderImagePreview(e, t, n, r = !1) {
|
|
6308
|
-
var
|
|
6309
|
+
var f;
|
|
6309
6310
|
const i = document.getElementById(
|
|
6310
6311
|
"user-view-browse-wrapper"
|
|
6311
6312
|
), o = i || n;
|
|
@@ -6326,11 +6327,15 @@ class Hs {
|
|
|
6326
6327
|
`width: 18px; height: 18px; display: ${r ? "flex" : "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`
|
|
6327
6328
|
);
|
|
6328
6329
|
l.id = "remove-preview-btn";
|
|
6329
|
-
const u =
|
|
6330
|
+
const u = Hn();
|
|
6330
6331
|
u.style.fill = "#fff", l == null || l.appendChild(u), l.addEventListener("click", () => {
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
|
|
6332
|
+
this._removeUserToast(), v(this, rn).call(this);
|
|
6333
|
+
});
|
|
6334
|
+
const d = ee("button", "", "display:none");
|
|
6335
|
+
d.id = "image-preview-hidden-btn", d.addEventListener("click", () => {
|
|
6336
|
+
var y;
|
|
6337
|
+
(y = v(this, Te)) == null || y.removeChild(c), v(this, sn).call(this), o && (o.style.display = "flex");
|
|
6338
|
+
}), c == null || c.append(h, l, d), (f = v(this, Te)) == null || f.append(c);
|
|
6334
6339
|
}
|
|
6335
6340
|
_renderRemovePreviewBtn() {
|
|
6336
6341
|
const e = document.getElementById("remove-preview-btn");
|
|
@@ -6340,17 +6345,17 @@ class Hs {
|
|
|
6340
6345
|
this._readFileAsBase64(e);
|
|
6341
6346
|
}
|
|
6342
6347
|
async _readFileAsBase64(e) {
|
|
6343
|
-
const t =
|
|
6348
|
+
const t = v(this, jt) * 1024 * 1024;
|
|
6344
6349
|
if (e.size > t) {
|
|
6345
6350
|
this._renderUserToast(
|
|
6346
|
-
|
|
6351
|
+
v(this, Zt) ? v(this, Zt) : `File size must be less than ${v(this, jt)}MB.`,
|
|
6347
6352
|
"error"
|
|
6348
6353
|
);
|
|
6349
6354
|
return;
|
|
6350
6355
|
}
|
|
6351
6356
|
H(this, it, !0);
|
|
6352
6357
|
try {
|
|
6353
|
-
const n = await
|
|
6358
|
+
const n = await yr(e);
|
|
6354
6359
|
this._removeUserToast();
|
|
6355
6360
|
const r = new FileReader();
|
|
6356
6361
|
r.readAsDataURL(n), r.onload = () => {
|
|
@@ -6378,15 +6383,15 @@ class Hs {
|
|
|
6378
6383
|
"margin-block:0px;font-size:14px;padding-top:3px"
|
|
6379
6384
|
);
|
|
6380
6385
|
r.textContent = e, r.style.color = t === "success" ? "#4caf50" : "#ee3f3f";
|
|
6381
|
-
const i = t === "success" ?
|
|
6382
|
-
i.style.width = "15px", i.style.height = "15px", n.append(i, r),
|
|
6386
|
+
const i = t === "success" ? lr("#4caf50") : _n();
|
|
6387
|
+
i.style.width = "15px", i.style.height = "15px", n.append(i, r), v(this, Te).appendChild(n);
|
|
6383
6388
|
}
|
|
6384
6389
|
_removeUserToast() {
|
|
6385
6390
|
const e = document.getElementById("user-toast-container");
|
|
6386
6391
|
e && e.remove();
|
|
6387
6392
|
}
|
|
6388
6393
|
_renderUserViewBrowseButton() {
|
|
6389
|
-
const e =
|
|
6394
|
+
const e = Bn("file");
|
|
6390
6395
|
e.style.display = "none", e.setAttribute("multiple", "true"), e.setAttribute("accept", "image/*");
|
|
6391
6396
|
const t = ee(
|
|
6392
6397
|
"a",
|
|
@@ -6409,7 +6414,7 @@ class Hs {
|
|
|
6409
6414
|
);
|
|
6410
6415
|
e.id = "user-uploading", e.innerHTML = "Uploading...";
|
|
6411
6416
|
const t = ee("div", "linear-loader");
|
|
6412
|
-
e.appendChild(t),
|
|
6417
|
+
e.appendChild(t), v(this, Te).append(e);
|
|
6413
6418
|
}
|
|
6414
6419
|
_removeUserUploading() {
|
|
6415
6420
|
const e = document.getElementById("user-uploading");
|
|
@@ -6419,11 +6424,11 @@ class Hs {
|
|
|
6419
6424
|
this._renderUserUploading();
|
|
6420
6425
|
try {
|
|
6421
6426
|
this._renderImagePreview(e, t.name);
|
|
6422
|
-
const n = await
|
|
6423
|
-
await this._uploadForUser(n, t),
|
|
6427
|
+
const n = await wr(e, t, v(this, Se), !1);
|
|
6428
|
+
await this._uploadForUser(n, t), v(this, Kt) && this._renderUserToast(v(this, Kt), "success"), this._renderRemovePreviewBtn();
|
|
6424
6429
|
} catch {
|
|
6425
6430
|
this._renderUserToast(
|
|
6426
|
-
|
|
6431
|
+
v(this, qt) ? v(this, qt) : "Error uploading. Please try again later.",
|
|
6427
6432
|
"error"
|
|
6428
6433
|
);
|
|
6429
6434
|
} finally {
|
|
@@ -6433,12 +6438,12 @@ class Hs {
|
|
|
6433
6438
|
async _uploadForUser(e, t) {
|
|
6434
6439
|
var n;
|
|
6435
6440
|
try {
|
|
6436
|
-
const r = await
|
|
6441
|
+
const r = await Yi(
|
|
6437
6442
|
e,
|
|
6438
|
-
ct[
|
|
6439
|
-
|
|
6443
|
+
ct[fr((n = t.type) == null ? void 0 : n.split("/")[0])],
|
|
6444
|
+
v(this, Se)
|
|
6440
6445
|
);
|
|
6441
|
-
H(this, Pt, r == null ? void 0 : r.response),
|
|
6446
|
+
H(this, Pt, r == null ? void 0 : r.response), v(this, Ht).call(this);
|
|
6442
6447
|
} catch (r) {
|
|
6443
6448
|
throw Error(r);
|
|
6444
6449
|
}
|
|
@@ -6457,17 +6462,17 @@ class Hs {
|
|
|
6457
6462
|
}), t.append(n, r), e.appendChild(t);
|
|
6458
6463
|
}
|
|
6459
6464
|
_renderUploadButton() {
|
|
6460
|
-
const e =
|
|
6461
|
-
e.style.display = "none", e.setAttribute("multiple", "true"), e.setAttribute("accept", "image/*,video/*,audio/*,.gif"), H(this, ft, document.createElement("button")),
|
|
6465
|
+
const e = Bn("file");
|
|
6466
|
+
e.style.display = "none", e.setAttribute("multiple", "true"), e.setAttribute("accept", "image/*,video/*,audio/*,.gif"), H(this, ft, document.createElement("button")), v(this, ft).className = "browse-more-btn";
|
|
6462
6467
|
const t = document.createElement("span");
|
|
6463
|
-
return t.textContent = "Upload",
|
|
6468
|
+
return t.textContent = "Upload", v(this, ft).append(Un(), t), v(this, ft).type = "button", v(this, ft).addEventListener(
|
|
6464
6469
|
"click",
|
|
6465
6470
|
() => e.click()
|
|
6466
6471
|
), e.addEventListener("change", async () => {
|
|
6467
6472
|
const n = e.files[0];
|
|
6468
6473
|
try {
|
|
6469
6474
|
H(this, it, !0);
|
|
6470
|
-
const r = await
|
|
6475
|
+
const r = await yr(n), i = new FileReader();
|
|
6471
6476
|
i.readAsDataURL(r), i.onload = async () => {
|
|
6472
6477
|
await this._uploadAndAddSelectedImageList(
|
|
6473
6478
|
i.result,
|
|
@@ -6475,16 +6480,16 @@ class Hs {
|
|
|
6475
6480
|
);
|
|
6476
6481
|
};
|
|
6477
6482
|
} catch (r) {
|
|
6478
|
-
this._renderToastContainer(r, "error",
|
|
6483
|
+
this._renderToastContainer(r, "error", v(this, be));
|
|
6479
6484
|
}
|
|
6480
6485
|
e.value = "";
|
|
6481
|
-
}),
|
|
6486
|
+
}), v(this, ft);
|
|
6482
6487
|
}
|
|
6483
6488
|
_renderCreateFolderBtn() {
|
|
6484
6489
|
const e = document.createElement("button");
|
|
6485
6490
|
e.className = "create-folder-btn";
|
|
6486
6491
|
const t = document.createElement("span");
|
|
6487
|
-
return t.textContent = "Create", e.append(
|
|
6492
|
+
return t.textContent = "Create", e.append(dr(), t), this._createUpdateFolderDialog(e, "create"), e;
|
|
6488
6493
|
}
|
|
6489
6494
|
_renderSearchField() {
|
|
6490
6495
|
let e;
|
|
@@ -6492,42 +6497,42 @@ class Hs {
|
|
|
6492
6497
|
"search-input-wrapper",
|
|
6493
6498
|
"search-input-wrapper"
|
|
6494
6499
|
);
|
|
6495
|
-
H(this, It,
|
|
6500
|
+
H(this, It, Bn("search")), v(this, It).value = "", v(this, It).addEventListener("input", (i) => {
|
|
6496
6501
|
H(this, ke, []);
|
|
6497
6502
|
const o = i.target;
|
|
6498
6503
|
e && clearTimeout(e), e = setTimeout(() => {
|
|
6499
6504
|
if (!o.value) {
|
|
6500
|
-
H(this, at, ""), H(this, Nt, !1), H(this, mt, !1), this._fetchFilesFromFolder(
|
|
6505
|
+
H(this, at, ""), H(this, Nt, !1), H(this, mt, !1), this._fetchFilesFromFolder(v(this, vt));
|
|
6501
6506
|
return;
|
|
6502
6507
|
}
|
|
6503
|
-
H(this, mt, !0), H(this, $t, o.value), this._search(
|
|
6508
|
+
H(this, mt, !0), H(this, $t, o.value), this._search(v(this, $t));
|
|
6504
6509
|
}, 750);
|
|
6505
|
-
}),
|
|
6506
|
-
const r =
|
|
6507
|
-
return r.style.position = "absolute", r.style.top = "50%", r.style.left = "5%", r.style.transform = "translate(-5%, -50%)", n.append(r,
|
|
6510
|
+
}), v(this, It).setAttribute("placeholder", "Search");
|
|
6511
|
+
const r = ys();
|
|
6512
|
+
return r.style.position = "absolute", r.style.top = "50%", r.style.left = "5%", r.style.transform = "translate(-5%, -50%)", n.append(r, v(this, It)), t.append(n), t;
|
|
6508
6513
|
}
|
|
6509
6514
|
_createBrowseMoreContainer() {
|
|
6510
|
-
H(this, Ot, K("browse-more-btn-container")), this._createAllAndSelectedTab(
|
|
6515
|
+
H(this, Ot, K("browse-more-btn-container")), this._createAllAndSelectedTab(v(this, Ot));
|
|
6511
6516
|
const e = this._renderUploadButton(), t = this._renderCreateFolderBtn(), n = document.createElement("div");
|
|
6512
|
-
return n.style.display = "flex", n.style.alignItems = "center", n.style.gap = "10px", n.append(e, t),
|
|
6517
|
+
return n.style.display = "flex", n.style.alignItems = "center", n.style.gap = "10px", n.append(e, t), v(this, Ot).appendChild(n), v(this, Ot);
|
|
6513
6518
|
}
|
|
6514
6519
|
_createBrowseImageMain() {
|
|
6515
6520
|
const e = K("browse-image-main");
|
|
6516
|
-
return H(this, Ce, K("selected-image-container")),
|
|
6517
|
-
const t =
|
|
6518
|
-
t + n >= r - 5 &&
|
|
6519
|
-
}), e.appendChild(
|
|
6521
|
+
return H(this, Ce, K("selected-image-container")), v(this, Ce).addEventListener("scroll", () => {
|
|
6522
|
+
const t = v(this, Ce).clientHeight, n = v(this, Ce).scrollTop, r = v(this, Ce).scrollHeight;
|
|
6523
|
+
t + n >= r - 5 && v(this, Nt) && (v(this, mt) ? this._search(v(this, $t)) : this._fetchFilesFromFolder(v(this, vt)));
|
|
6524
|
+
}), e.appendChild(v(this, Ce)), e;
|
|
6520
6525
|
}
|
|
6521
6526
|
_renderFetchingSkeletonUI() {
|
|
6522
6527
|
for (let e = 0; e < 20; e++) {
|
|
6523
6528
|
const t = K("skeleton");
|
|
6524
|
-
t.innerHTML = "",
|
|
6529
|
+
t.innerHTML = "", v(this, Ce).append(t);
|
|
6525
6530
|
}
|
|
6526
6531
|
}
|
|
6527
6532
|
_renderEmptyImageContainer() {
|
|
6528
|
-
if (
|
|
6533
|
+
if (v(this, $e) || v(this, it)) return;
|
|
6529
6534
|
const e = K(), t = K(), n = document.createElement("p");
|
|
6530
|
-
|
|
6535
|
+
v(this, mt) && v(this, kt) === 0 ? (t.innerHTML = `
|
|
6531
6536
|
<svg width="300" height="300" viewBox="0 0 1000 1000" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6532
6537
|
<g clip-path="url(#clip0_2304_257)">
|
|
6533
6538
|
<path d="M564.829 772.4H336.658V948.386H564.829V772.4Z" fill="#EBEBEB"/>
|
|
@@ -6611,14 +6616,14 @@ class Hs {
|
|
|
6611
6616
|
</clipPath>
|
|
6612
6617
|
</defs>
|
|
6613
6618
|
</svg>
|
|
6614
|
-
`, n.textContent = "Looks Empty!"), e.append(t, n),
|
|
6619
|
+
`, n.textContent = "Looks Empty!"), e.append(t, n), v(this, Ce).appendChild(e);
|
|
6615
6620
|
}
|
|
6616
6621
|
_renderLoadingUI() {
|
|
6617
6622
|
const e = K("skeleton");
|
|
6618
|
-
e.innerHTML = "",
|
|
6623
|
+
e.innerHTML = "", v(this, Ce).appendChild(e);
|
|
6619
6624
|
}
|
|
6620
6625
|
_fileCardBody(e) {
|
|
6621
|
-
var nt, St,
|
|
6626
|
+
var nt, St, on, Dt;
|
|
6622
6627
|
const t = K("selected-image-content"), n = K("selected-image-top-bar"), r = He(
|
|
6623
6628
|
"",
|
|
6624
6629
|
"selected-image-btn",
|
|
@@ -6627,22 +6632,22 @@ class Hs {
|
|
|
6627
6632
|
'<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>'
|
|
6628
6633
|
);
|
|
6629
6634
|
let i, o;
|
|
6630
|
-
(e == null ? void 0 : e.type) === ct.IMAGE && (i =
|
|
6635
|
+
(e == null ? void 0 : e.type) === ct.IMAGE && (i = pr(e == null ? void 0 : e.url, "selected-image"), o = ms()), (e == null ? void 0 : e.type) === ct.VIDEO && (i = Fs(e == null ? void 0 : e.url, "uploaded-video"), o = bs()), (e == null ? void 0 : e.type) === ct.AUDIO && (i = Ns(e == null ? void 0 : e.url, "uploaded-audio"), o = ps());
|
|
6631
6636
|
const a = K("selected-image-wrapper");
|
|
6632
6637
|
a.setAttribute("data-key", e == null ? void 0 : e.key);
|
|
6633
6638
|
const c = Jt(e == null ? void 0 : e.name, "selected-image-name"), h = ie("", "selected-image-type");
|
|
6634
6639
|
h.append(o), n.append(h, r);
|
|
6635
6640
|
const l = K();
|
|
6636
6641
|
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);
|
|
6637
|
-
const u = K("action-wrapper"), d = He("", "action-option preview"), f = ie("Preview", ""), y =
|
|
6642
|
+
const u = K("action-wrapper"), d = He("", "action-option preview"), f = ie("Preview", ""), y = ws();
|
|
6638
6643
|
d.append(y, f);
|
|
6639
|
-
const I = He("", "action-option move"), L = ie("Move", ""), C =
|
|
6644
|
+
const I = He("", "action-option move"), L = ie("Move", ""), C = gs();
|
|
6640
6645
|
I.append(C, L);
|
|
6641
|
-
const R = He("", "action-option rename"), O = ie("Rename", ""), k =
|
|
6646
|
+
const R = He("", "action-option rename"), O = ie("Rename", ""), k = cr();
|
|
6642
6647
|
R.append(k, O);
|
|
6643
|
-
const x = He("", "action-option delete"), b = ie("Delete", ""), B =
|
|
6648
|
+
const x = He("", "action-option delete"), b = ie("Delete", ""), B = hr();
|
|
6644
6649
|
x.append(B, b);
|
|
6645
|
-
const m = e.name.split(".")[0], g = e.name.split(".")[1],
|
|
6650
|
+
const m = e.name.split(".")[0], g = e.name.split(".")[1], A = 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(
|
|
6646
6651
|
"preview-option-image-wrapper"
|
|
6647
6652
|
), w = K("preview-option-wrapper"), p = K("preview-option-wrapper"), M = K(
|
|
6648
6653
|
"preview-option-wrapper"
|
|
@@ -6650,7 +6655,7 @@ class Hs {
|
|
|
6650
6655
|
"preview-option-wrapper"
|
|
6651
6656
|
), q = K("preview-option-wrapper"), P = K(
|
|
6652
6657
|
"preview-option-wrapper"
|
|
6653
|
-
), Z =
|
|
6658
|
+
), Z = pr(e.url, "preview-option-image");
|
|
6654
6659
|
U.append(Z);
|
|
6655
6660
|
const $ = ie("File name", "preview-title"), S = K("preview-option-name");
|
|
6656
6661
|
S.innerHTML = e.name, w.append($, S);
|
|
@@ -6673,7 +6678,7 @@ class Hs {
|
|
|
6673
6678
|
te,
|
|
6674
6679
|
Q
|
|
6675
6680
|
);
|
|
6676
|
-
const re = ie("File type", "preview-title"), ue = ie(
|
|
6681
|
+
const re = ie("File type", "preview-title"), ue = ie(A, "preview-option-name");
|
|
6677
6682
|
_.append(
|
|
6678
6683
|
re,
|
|
6679
6684
|
ue
|
|
@@ -6709,7 +6714,7 @@ class Hs {
|
|
|
6709
6714
|
w,
|
|
6710
6715
|
M,
|
|
6711
6716
|
_,
|
|
6712
|
-
((
|
|
6717
|
+
((on = e == null ? void 0 : e.metadata) == null ? void 0 : on.width) > 0 && ((Dt = e == null ? void 0 : e.metadata) == null ? void 0 : Dt.height) > 0 ? V : "",
|
|
6713
6718
|
q,
|
|
6714
6719
|
e.nestedFolderName ? P : ""
|
|
6715
6720
|
), T.append(
|
|
@@ -6726,11 +6731,11 @@ class Hs {
|
|
|
6726
6731
|
"Suggested Folder List:",
|
|
6727
6732
|
"input-label"
|
|
6728
6733
|
), _e = ie();
|
|
6729
|
-
_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(
|
|
6734
|
+
_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(_n("14px", "14px", "#333")), Y.append(Re, _e);
|
|
6730
6735
|
const et = K();
|
|
6731
6736
|
et.style.width = "100%", et.style.maxHeight = "250px", et.style.overflowY = "auto";
|
|
6732
6737
|
const ve = document.createElement("ul");
|
|
6733
|
-
ve.className = "folders", et.append(ve), fe.append(Y, et),
|
|
6738
|
+
ve.className = "folders", et.append(ve), fe.append(Y, et), v(this, st).forEach((ce) => {
|
|
6734
6739
|
const We = this._renderEditFolderListContainer(ce);
|
|
6735
6740
|
ve.appendChild(We);
|
|
6736
6741
|
});
|
|
@@ -6738,7 +6743,7 @@ class Hs {
|
|
|
6738
6743
|
"folder-field source",
|
|
6739
6744
|
"source-folder-wrapper"
|
|
6740
6745
|
), Ue = document.createElement("span");
|
|
6741
|
-
Ue.id = "source-folder-name", Ue.textContent =
|
|
6746
|
+
Ue.id = "source-folder-name", Ue.textContent = v(this, Lt) ? v(this, Lt) : e.folderName, Me.append(Gt(), Ue);
|
|
6742
6747
|
let Be = "";
|
|
6743
6748
|
tt.append(Le, Me), pe.onchange = (ce) => {
|
|
6744
6749
|
Be = ce.target.value;
|
|
@@ -6818,14 +6823,14 @@ class Hs {
|
|
|
6818
6823
|
divId: e.key
|
|
6819
6824
|
}), H(this, gt, e.key);
|
|
6820
6825
|
}), i.addEventListener("click", () => {
|
|
6821
|
-
const ce =
|
|
6826
|
+
const ce = v(this, ge).findIndex(
|
|
6822
6827
|
(rt) => (rt == null ? void 0 : rt.key) === (e == null ? void 0 : e.key)
|
|
6823
6828
|
);
|
|
6824
6829
|
if (t.classList.contains("checked"))
|
|
6825
|
-
t.classList.remove("checked"), ce !== -1 && (
|
|
6830
|
+
t.classList.remove("checked"), ce !== -1 && (v(this, ge).splice(ce, 1), v(this, kt) === 1 && a.remove());
|
|
6826
6831
|
else {
|
|
6827
|
-
if (
|
|
6828
|
-
|
|
6832
|
+
if (v(this, vn))
|
|
6833
|
+
v(this, ge).push(e);
|
|
6829
6834
|
else {
|
|
6830
6835
|
const rt = document.querySelector(
|
|
6831
6836
|
".selected-image-wrapper .checked"
|
|
@@ -6836,24 +6841,24 @@ class Hs {
|
|
|
6836
6841
|
}
|
|
6837
6842
|
this._updateContent();
|
|
6838
6843
|
}), document.addEventListener("click", (ce) => {
|
|
6839
|
-
const We = document.querySelector(`#${
|
|
6844
|
+
const We = document.querySelector(`#${v(this, gt)}`);
|
|
6840
6845
|
We && (ce.composedPath().includes(We) || je.hide());
|
|
6841
|
-
}),
|
|
6846
|
+
}), v(this, ge).findIndex(
|
|
6842
6847
|
(ce) => (ce == null ? void 0 : ce.key) === (e == null ? void 0 : e.key)
|
|
6843
|
-
) !== -1 ? (t.classList.add("checked"),
|
|
6848
|
+
) !== -1 ? (t.classList.add("checked"), v(this, mt) ? v(this, Ce).prepend(a) : v(this, Ce).appendChild(a)) : v(this, Ce).appendChild(a);
|
|
6844
6849
|
}
|
|
6845
6850
|
_renderImageCard(e) {
|
|
6846
6851
|
this._fileCardBody(e);
|
|
6847
6852
|
}
|
|
6848
6853
|
_renderImageListContainer() {
|
|
6849
6854
|
var e, t;
|
|
6850
|
-
((e =
|
|
6855
|
+
((e = v(this, ke)) == null ? void 0 : e.length) > 0 && ((t = v(this, ke)) == null || t.forEach((n) => {
|
|
6851
6856
|
this._renderImageCard(n);
|
|
6852
6857
|
}));
|
|
6853
6858
|
}
|
|
6854
6859
|
_renderSelectedImageListContainer() {
|
|
6855
6860
|
var e;
|
|
6856
|
-
((e =
|
|
6861
|
+
((e = v(this, ge)) == null ? void 0 : e.length) > 0 && v(this, ge).forEach((t) => {
|
|
6857
6862
|
this._renderImageCard(t);
|
|
6858
6863
|
});
|
|
6859
6864
|
}
|
|
@@ -6875,7 +6880,7 @@ class Hs {
|
|
|
6875
6880
|
const r = document.createElement("span"), i = document.createElement("span");
|
|
6876
6881
|
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) {
|
|
6877
6882
|
const a = document.createElement("button");
|
|
6878
|
-
a.classList.add("expand-icon"), a.appendChild(
|
|
6883
|
+
a.classList.add("expand-icon"), a.appendChild(ar()), n.prepend(a);
|
|
6879
6884
|
const c = document.createElement("ul");
|
|
6880
6885
|
c.className = "folders nested", t.appendChild(c), a.addEventListener("click", (h) => {
|
|
6881
6886
|
h.stopPropagation(), t.classList.toggle("active"), c.classList.toggle("visible");
|
|
@@ -6893,7 +6898,7 @@ class Hs {
|
|
|
6893
6898
|
"moveToInputField.disabled",
|
|
6894
6899
|
!1,
|
|
6895
6900
|
'<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>'
|
|
6896
|
-
), c = K("action-wrapper"), h = He("", "action-option edit"), l = ie("Edit", ""), u =
|
|
6901
|
+
), c = K("action-wrapper"), h = He("", "action-option edit"), l = ie("Edit", ""), u = cr();
|
|
6897
6902
|
h.append(u, l);
|
|
6898
6903
|
const d = K("edit-form-wrapper"), f = K("name-field-wrapper"), y = ie("Name", "input-label"), I = document.createElement("input");
|
|
6899
6904
|
I.classList.add("input-field"), I.value = e.name, I.onchange = (k) => {
|
|
@@ -6906,7 +6911,7 @@ class Hs {
|
|
|
6906
6911
|
createdBy: e.createdBy
|
|
6907
6912
|
};
|
|
6908
6913
|
this._createUpdateFolderDialog(h, "update", L);
|
|
6909
|
-
const C = He("", "action-option delete"), R = ie("Delete", ""), O =
|
|
6914
|
+
const C = He("", "action-option delete"), R = ie("Delete", ""), O = hr();
|
|
6910
6915
|
C.append(O, R), c.append(h, C), C.onclick = (k) => {
|
|
6911
6916
|
k.stopPropagation(), je.hide(), ye.show({
|
|
6912
6917
|
content: "",
|
|
@@ -6925,7 +6930,7 @@ class Hs {
|
|
|
6925
6930
|
}, a.addEventListener("click", (k) => {
|
|
6926
6931
|
k.stopPropagation();
|
|
6927
6932
|
const x = document.querySelector(`#${e.key}`);
|
|
6928
|
-
H(this, gt, null),
|
|
6933
|
+
H(this, gt, null), v(this, gt) === e.key && x !== null ? je.hide() : (je.hide(), je.show({
|
|
6929
6934
|
content: c,
|
|
6930
6935
|
mainContainer: n,
|
|
6931
6936
|
divId: e.key
|
|
@@ -6935,7 +6940,7 @@ class Hs {
|
|
|
6935
6940
|
return t.addEventListener("click", (a) => {
|
|
6936
6941
|
var c;
|
|
6937
6942
|
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);
|
|
6938
|
-
}), ((o =
|
|
6943
|
+
}), ((o = v(this, Ge)) == null ? void 0 : o.key) === (e == null ? void 0 : e.key) && t.classList.add("selected"), t;
|
|
6939
6944
|
}
|
|
6940
6945
|
_renderEditFolderListContainer(e) {
|
|
6941
6946
|
var o;
|
|
@@ -6946,7 +6951,7 @@ class Hs {
|
|
|
6946
6951
|
const r = document.createElement("span"), i = document.createElement("span");
|
|
6947
6952
|
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) {
|
|
6948
6953
|
const a = document.createElement("button");
|
|
6949
|
-
a.classList.add("expand-icon"), a.appendChild(
|
|
6954
|
+
a.classList.add("expand-icon"), a.appendChild(ar()), n.prepend(a);
|
|
6950
6955
|
const c = document.createElement("ul");
|
|
6951
6956
|
c.className = "folders nested", t.appendChild(c), a.addEventListener("click", (h) => {
|
|
6952
6957
|
h.stopPropagation(), t.classList.toggle("active"), c.classList.toggle("visible");
|
|
@@ -6962,80 +6967,80 @@ class Hs {
|
|
|
6962
6967
|
"#source-folder-name"
|
|
6963
6968
|
);
|
|
6964
6969
|
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");
|
|
6965
|
-
}), ((o =
|
|
6970
|
+
}), ((o = v(this, Ge)) == null ? void 0 : o.key) === (e == null ? void 0 : e.key) && t.classList.add("selected"), t;
|
|
6966
6971
|
}
|
|
6967
6972
|
_updateFolderListContainer() {
|
|
6968
|
-
if (
|
|
6969
|
-
if (
|
|
6973
|
+
if (v(this, Ft))
|
|
6974
|
+
if (v(this, pt).innerHTML = "", v(this, Bt)) {
|
|
6970
6975
|
const e = this._renderFolderListLoadingUI();
|
|
6971
|
-
|
|
6976
|
+
v(this, pt).appendChild(e);
|
|
6972
6977
|
} else {
|
|
6973
6978
|
const e = document.createElement("ul");
|
|
6974
|
-
e.className = "folders",
|
|
6979
|
+
e.className = "folders", v(this, pt).appendChild(e), v(this, st).forEach((t) => {
|
|
6975
6980
|
const n = this._renderFolderListContainer(t);
|
|
6976
6981
|
e.appendChild(n);
|
|
6977
|
-
}),
|
|
6982
|
+
}), v(this, Ft).appendChild(v(this, pt));
|
|
6978
6983
|
}
|
|
6979
6984
|
}
|
|
6980
6985
|
_renderToastContainer(e, t, n) {
|
|
6981
|
-
this._removeToastContainer(), H(this, ot, document.createElement("div")),
|
|
6982
|
-
const r = Jt(e, "message"), i = t === "success" ?
|
|
6986
|
+
this._removeToastContainer(), H(this, ot, document.createElement("div")), v(this, ot).className = `message-container ${t}`;
|
|
6987
|
+
const r = Jt(e, "message"), i = t === "success" ? lr() : _n(), o = He("");
|
|
6983
6988
|
o.style.cursor = "pointer", o.style.border = "0", o.style.outline = "none", o.style.background = "transparent", o.appendChild(
|
|
6984
|
-
|
|
6989
|
+
Hn(t === "error" ? "#ee3f3f" : "#4caf50")
|
|
6985
6990
|
), o.setAttribute(
|
|
6986
6991
|
"fill",
|
|
6987
6992
|
t === "error" ? "#ee3f3f" : "#4caf50"
|
|
6988
|
-
), o.onclick = () => this._removeToastContainer(),
|
|
6993
|
+
), o.onclick = () => this._removeToastContainer(), v(this, ot).append(i, r, o), n.appendChild(v(this, ot)), setTimeout(() => {
|
|
6989
6994
|
this._removeToastContainer();
|
|
6990
6995
|
}, 5e3);
|
|
6991
6996
|
}
|
|
6992
6997
|
_removeToastContainer() {
|
|
6993
|
-
|
|
6998
|
+
v(this, ot) && (v(this, ot).remove(), H(this, ot, null));
|
|
6994
6999
|
}
|
|
6995
7000
|
_updateSelectedImageListContainerUI() {
|
|
6996
7001
|
var t, n;
|
|
6997
|
-
if (!
|
|
6998
|
-
|
|
7002
|
+
if (!v(this, Ce)) return;
|
|
7003
|
+
v(this, Ce).innerHTML = "", v(this, it) && this._renderLoadingUI(), v(this, $e) && this._renderFetchingSkeletonUI();
|
|
6999
7004
|
const e = document.getElementById(
|
|
7000
7005
|
"search-input-wrapper"
|
|
7001
7006
|
);
|
|
7002
|
-
|
|
7007
|
+
v(this, kt) === 0 ? (e && (e.style.visibility = "visible"), ((t = v(this, ke)) == null ? void 0 : t.length) === 0 && !v(this, $e) ? (v(this, Ce).classList.add(
|
|
7003
7008
|
"no-selected-image-container"
|
|
7004
|
-
), this._renderEmptyImageContainer()) : (
|
|
7009
|
+
), this._renderEmptyImageContainer()) : (v(this, Ce).classList.remove(
|
|
7005
7010
|
"no-selected-image-container"
|
|
7006
|
-
), this._renderImageListContainer())) : (e && (e.style.visibility = "hidden"), ((n =
|
|
7011
|
+
), this._renderImageListContainer())) : (e && (e.style.visibility = "hidden"), ((n = v(this, ge)) == null ? void 0 : n.length) === 0 ? (v(this, Ce).classList.add(
|
|
7007
7012
|
"no-selected-image-container"
|
|
7008
|
-
), this._renderEmptyImageContainer()) : (
|
|
7013
|
+
), this._renderEmptyImageContainer()) : (v(this, Ce).classList.remove(
|
|
7009
7014
|
"no-selected-image-container"
|
|
7010
7015
|
), this._renderSelectedImageListContainer())), this._updateContent();
|
|
7011
7016
|
}
|
|
7012
7017
|
_updateContent() {
|
|
7013
7018
|
var t, n, r;
|
|
7014
7019
|
const e = document.getElementById("selected-images-tab");
|
|
7015
|
-
e && (e.textContent = `Selected (${(t =
|
|
7020
|
+
e && (e.textContent = `Selected (${(t = v(this, ge)) == null ? void 0 : t.length})`), v(this, At).textContent = `Save (${(n = v(this, ge)) == null ? void 0 : n.length})`, v(this, At).disabled = ((r = v(this, ge)) == null ? void 0 : r.length) === 0;
|
|
7016
7021
|
}
|
|
7017
7022
|
async _uploadAndAddSelectedImageList(e, t) {
|
|
7018
7023
|
var n, r;
|
|
7019
7024
|
this._updateSelectedImageListContainerUI();
|
|
7020
7025
|
try {
|
|
7021
|
-
const i = await
|
|
7026
|
+
const i = await wr(e, t, v(this, Se)), o = await Qi(
|
|
7022
7027
|
t == null ? void 0 : t.name,
|
|
7023
7028
|
"",
|
|
7024
7029
|
i,
|
|
7025
|
-
ct[
|
|
7026
|
-
(r =
|
|
7027
|
-
|
|
7030
|
+
ct[fr((n = t.type) == null ? void 0 : n.split("/")[0])],
|
|
7031
|
+
(r = v(this, Ge)) == null ? void 0 : r.name,
|
|
7032
|
+
v(this, Se)
|
|
7028
7033
|
);
|
|
7029
|
-
|
|
7034
|
+
v(this, ke).unshift(o == null ? void 0 : o.response), this._renderToastContainer(
|
|
7030
7035
|
"File Uploaded Successfully",
|
|
7031
7036
|
"success",
|
|
7032
|
-
|
|
7037
|
+
v(this, be)
|
|
7033
7038
|
);
|
|
7034
7039
|
} catch {
|
|
7035
7040
|
this._renderToastContainer(
|
|
7036
7041
|
"Something went wrong while uploading file. Please try again later.",
|
|
7037
7042
|
"error",
|
|
7038
|
-
|
|
7043
|
+
v(this, be)
|
|
7039
7044
|
);
|
|
7040
7045
|
} finally {
|
|
7041
7046
|
H(this, it, !1), this._updateSelectedImageListContainerUI();
|
|
@@ -7044,7 +7049,7 @@ class Hs {
|
|
|
7044
7049
|
async _updateFile(e, t) {
|
|
7045
7050
|
ye.updateUploadBtn(!0);
|
|
7046
7051
|
try {
|
|
7047
|
-
const n = await
|
|
7052
|
+
const n = await ns(
|
|
7048
7053
|
t.key,
|
|
7049
7054
|
e,
|
|
7050
7055
|
t.nestedFolderName,
|
|
@@ -7052,21 +7057,21 @@ class Hs {
|
|
|
7052
7057
|
t.thumborUrl,
|
|
7053
7058
|
t.proxyUrl,
|
|
7054
7059
|
t.type,
|
|
7055
|
-
|
|
7056
|
-
|
|
7057
|
-
), r =
|
|
7060
|
+
v(this, Lt),
|
|
7061
|
+
v(this, Se)
|
|
7062
|
+
), r = v(this, ke).find(
|
|
7058
7063
|
(i) => i.key === n.response.key
|
|
7059
7064
|
);
|
|
7060
|
-
r.name = e, this._fetchFilesFromFolder(
|
|
7065
|
+
r.name = e, this._fetchFilesFromFolder(v(this, Ge).name), H(this, ke, []), H(this, ge, []), this._renderToastContainer(
|
|
7061
7066
|
"File Updated Successfully",
|
|
7062
7067
|
"success",
|
|
7063
|
-
|
|
7068
|
+
v(this, be)
|
|
7064
7069
|
);
|
|
7065
7070
|
} catch {
|
|
7066
7071
|
this._renderToastContainer(
|
|
7067
7072
|
"Something went wrong while updating the file. Please try again later.",
|
|
7068
7073
|
"error",
|
|
7069
|
-
|
|
7074
|
+
v(this, be)
|
|
7070
7075
|
);
|
|
7071
7076
|
} finally {
|
|
7072
7077
|
ye.updateUploadBtn(!1), ye.hide(), this._updateSelectedImageListContainerUI();
|
|
@@ -7075,16 +7080,16 @@ class Hs {
|
|
|
7075
7080
|
async _deleteFile(e) {
|
|
7076
7081
|
ye.updateUploadBtn(!0);
|
|
7077
7082
|
try {
|
|
7078
|
-
await
|
|
7083
|
+
await rs(e, v(this, Se)), H(this, ke, v(this, ke).filter((t) => e !== t.key)), this._renderToastContainer(
|
|
7079
7084
|
"File Deleted Successfully",
|
|
7080
7085
|
"success",
|
|
7081
|
-
|
|
7086
|
+
v(this, be)
|
|
7082
7087
|
);
|
|
7083
7088
|
} catch {
|
|
7084
7089
|
this._renderToastContainer(
|
|
7085
7090
|
"Something went wrong while deleting the file. Please try again later.",
|
|
7086
7091
|
"error",
|
|
7087
|
-
|
|
7092
|
+
v(this, be)
|
|
7088
7093
|
);
|
|
7089
7094
|
} finally {
|
|
7090
7095
|
ye.updateUploadBtn(!1), ye.hide(), this._updateSelectedImageListContainerUI();
|
|
@@ -7093,18 +7098,18 @@ class Hs {
|
|
|
7093
7098
|
async _createFolder(e, t = 2) {
|
|
7094
7099
|
var n;
|
|
7095
7100
|
try {
|
|
7096
|
-
const r = await
|
|
7101
|
+
const r = await hs(
|
|
7097
7102
|
e,
|
|
7098
|
-
(n =
|
|
7103
|
+
(n = v(this, Ge)) == null ? void 0 : n.name,
|
|
7099
7104
|
"",
|
|
7100
|
-
|
|
7105
|
+
v(this, Se)
|
|
7101
7106
|
);
|
|
7102
7107
|
H(this, ge, []), H(this, ke, []);
|
|
7103
|
-
const i =
|
|
7108
|
+
const i = As(v(this, st), r == null ? void 0 : r.response);
|
|
7104
7109
|
H(this, st, i), H(this, vt, e), H(this, Ge, { ...r == null ? void 0 : r.response, children: {} }), this._fetchFilesFromFolder(e), this._renderToastContainer(
|
|
7105
7110
|
`Folder ${e} created successfully`,
|
|
7106
7111
|
"success",
|
|
7107
|
-
|
|
7112
|
+
v(this, be)
|
|
7108
7113
|
);
|
|
7109
7114
|
} catch {
|
|
7110
7115
|
if (t > 1)
|
|
@@ -7113,7 +7118,7 @@ class Hs {
|
|
|
7113
7118
|
throw this._renderToastContainer(
|
|
7114
7119
|
`Error creating folder "${e}". Either folder already exist or failed to create folder`,
|
|
7115
7120
|
"error",
|
|
7116
|
-
|
|
7121
|
+
v(this, be)
|
|
7117
7122
|
), new Error(
|
|
7118
7123
|
`Error creating folder "${e}". Either folder already exist or failed to create folder`
|
|
7119
7124
|
);
|
|
@@ -7122,24 +7127,24 @@ class Hs {
|
|
|
7122
7127
|
}
|
|
7123
7128
|
}
|
|
7124
7129
|
async _upload() {
|
|
7125
|
-
return
|
|
7130
|
+
return v(this, nn) ? v(this, ge) : v(this, Pt);
|
|
7126
7131
|
}
|
|
7127
7132
|
async _fetchFilesFromFolder(e) {
|
|
7128
7133
|
var t, n, r;
|
|
7129
7134
|
H(this, $e, !0), this._updateSelectedImageListContainerUI();
|
|
7130
7135
|
try {
|
|
7131
|
-
const i = await
|
|
7136
|
+
const i = await es(
|
|
7132
7137
|
e,
|
|
7133
|
-
|
|
7138
|
+
v(this, at),
|
|
7134
7139
|
20,
|
|
7135
|
-
|
|
7140
|
+
v(this, Se)
|
|
7136
7141
|
), o = (t = i.response) == null ? void 0 : t.files;
|
|
7137
|
-
|
|
7142
|
+
v(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);
|
|
7138
7143
|
} catch {
|
|
7139
7144
|
throw this._renderToastContainer(
|
|
7140
7145
|
"Error while fetching files from folder" + e,
|
|
7141
7146
|
"error",
|
|
7142
|
-
|
|
7147
|
+
v(this, be)
|
|
7143
7148
|
), new Error(
|
|
7144
7149
|
"Something went wrong. Error while fetching files from folder" + e
|
|
7145
7150
|
);
|
|
@@ -7151,13 +7156,13 @@ class Hs {
|
|
|
7151
7156
|
var e, t;
|
|
7152
7157
|
H(this, $e, !0), H(this, Bt, !0), this._updateSelectedImageListContainerUI(), this._updateFolderListContainer(), this._removeToastContainer();
|
|
7153
7158
|
try {
|
|
7154
|
-
const r = (await
|
|
7159
|
+
const r = (await ds("", 100, v(this, Se))).response.folder, i = vs(r);
|
|
7155
7160
|
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);
|
|
7156
7161
|
} catch {
|
|
7157
7162
|
H(this, $e, !1), this._renderToastContainer(
|
|
7158
7163
|
"Folder not found. Please create a folder or try again later",
|
|
7159
7164
|
"error",
|
|
7160
|
-
|
|
7165
|
+
v(this, be)
|
|
7161
7166
|
);
|
|
7162
7167
|
} finally {
|
|
7163
7168
|
H(this, Bt, !1), this._updateFolderListContainer();
|
|
@@ -7167,18 +7172,18 @@ class Hs {
|
|
|
7167
7172
|
var t, n;
|
|
7168
7173
|
H(this, $e, !0), this._updateSelectedImageListContainerUI(), this._removeToastContainer();
|
|
7169
7174
|
try {
|
|
7170
|
-
const r = await
|
|
7175
|
+
const r = await ts(
|
|
7171
7176
|
e,
|
|
7172
|
-
|
|
7177
|
+
v(this, at),
|
|
7173
7178
|
10,
|
|
7174
|
-
|
|
7179
|
+
v(this, Se)
|
|
7175
7180
|
), i = (t = r.response) == null ? void 0 : t.items;
|
|
7176
|
-
|
|
7181
|
+
v(this, ke).push(...i), H(this, at, (n = r.response) == null ? void 0 : n.nextPageCursor);
|
|
7177
7182
|
} catch {
|
|
7178
7183
|
this._renderToastContainer(
|
|
7179
7184
|
"Error while searching files",
|
|
7180
7185
|
"error",
|
|
7181
|
-
|
|
7186
|
+
v(this, be)
|
|
7182
7187
|
);
|
|
7183
7188
|
} finally {
|
|
7184
7189
|
H(this, $e, !1), this._updateSelectedImageListContainerUI();
|
|
@@ -7187,18 +7192,18 @@ class Hs {
|
|
|
7187
7192
|
async _updateFolder(e, t) {
|
|
7188
7193
|
ye.updateUploadBtn(!0);
|
|
7189
7194
|
try {
|
|
7190
|
-
const n = await
|
|
7195
|
+
const n = await us(
|
|
7191
7196
|
t.key,
|
|
7192
7197
|
e,
|
|
7193
7198
|
t.nestedFolderName,
|
|
7194
7199
|
t.createdBy,
|
|
7195
|
-
|
|
7200
|
+
v(this, Se)
|
|
7196
7201
|
);
|
|
7197
7202
|
} catch {
|
|
7198
7203
|
throw this._renderToastContainer(
|
|
7199
7204
|
"Something went wrong while updating the folder. Please try again later.",
|
|
7200
7205
|
"error",
|
|
7201
|
-
|
|
7206
|
+
v(this, be)
|
|
7202
7207
|
), new Error("Error updating the folder ");
|
|
7203
7208
|
} finally {
|
|
7204
7209
|
ye.updateUploadBtn(!1), ye.hide(), this._updateFolderListContainer();
|
|
@@ -7207,16 +7212,16 @@ class Hs {
|
|
|
7207
7212
|
async _deleteFolder(e) {
|
|
7208
7213
|
ye.updateUploadBtn(!0);
|
|
7209
7214
|
try {
|
|
7210
|
-
await
|
|
7215
|
+
await fs(e, v(this, Se)), H(this, st, v(this, st).filter((t) => t.key !== e)), this._renderToastContainer(
|
|
7211
7216
|
"Folder Deleted Successfully",
|
|
7212
7217
|
"success",
|
|
7213
|
-
|
|
7218
|
+
v(this, be)
|
|
7214
7219
|
);
|
|
7215
7220
|
} catch {
|
|
7216
7221
|
throw this._renderToastContainer(
|
|
7217
7222
|
"Something went wrong while deleting the folder. Please try again later.",
|
|
7218
7223
|
"error",
|
|
7219
|
-
|
|
7224
|
+
v(this, be)
|
|
7220
7225
|
), new Error("Error deleting the folder ");
|
|
7221
7226
|
} finally {
|
|
7222
7227
|
ye.updateUploadBtn(!1), ye.hide(), this._updateFolderListContainer();
|
|
@@ -7258,13 +7263,13 @@ class Hs {
|
|
|
7258
7263
|
_initializeGrpcConfig(e, t) {
|
|
7259
7264
|
let n = "https://hamro-cms-backend-grpc.hamrostack.com";
|
|
7260
7265
|
t && (e === "production" || e === "development") ? n = t : e === "production" && (n = "https://page-api-grpc.hamropatro.com");
|
|
7261
|
-
const r = new
|
|
7266
|
+
const r = new Mi({
|
|
7262
7267
|
baseUrl: n
|
|
7263
7268
|
});
|
|
7264
7269
|
this.updateWindowObject({ grpcConfig: r });
|
|
7265
7270
|
}
|
|
7266
7271
|
}
|
|
7267
|
-
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(),
|
|
7272
|
+
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(), En = 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(), vn = 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(), sn = new WeakMap();
|
|
7268
7273
|
export {
|
|
7269
|
-
|
|
7274
|
+
$s as default
|
|
7270
7275
|
};
|