image-salon-sdk 1.0.38 → 1.0.40
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/api/file-service.d.ts +1 -0
- package/dist/components/loader/loader.d.ts +1 -1
- package/dist/grpc/generated/exposed-file-service.client.d.ts +13 -1
- package/dist/grpc/generated/exposed-file-service.d.ts +31 -0
- package/dist/image-salon-sdk.js +1050 -877
- package/dist/image-salon-sdk.umd.cjs +5 -5
- package/dist/image-salon.d.ts +5 -1
- package/dist/style.css +1 -1
- package/dist/types/image-salon-types.d.ts +5 -1
- package/package.json +1 -1
package/dist/image-salon-sdk.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import './style.css';
|
|
2
|
-
var
|
|
3
|
-
var
|
|
2
|
+
var li = Object.defineProperty;
|
|
3
|
+
var Qt = (i) => {
|
|
4
4
|
throw TypeError(i);
|
|
5
5
|
};
|
|
6
|
-
var
|
|
7
|
-
var x = (i, e, t) =>
|
|
8
|
-
var d = (i, e, t) => (
|
|
9
|
-
function
|
|
6
|
+
var ci = (i, e, t) => e in i ? li(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
7
|
+
var x = (i, e, t) => ci(i, typeof e != "symbol" ? e + "" : e, t), en = (i, e, t) => e.has(i) || Qt("Cannot " + t);
|
|
8
|
+
var d = (i, e, t) => (en(i, e, "read from private field"), t ? t.call(i) : e.get(i)), C = (i, e, t) => e.has(i) ? Qt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, t), p = (i, e, t, n) => (en(i, e, "write to private field"), n ? n.call(i, t) : e.set(i, t), t);
|
|
9
|
+
function kn(i) {
|
|
10
10
|
let e = typeof i;
|
|
11
11
|
if (e == "object") {
|
|
12
12
|
if (Array.isArray(i))
|
|
@@ -16,20 +16,20 @@ function bn(i) {
|
|
|
16
16
|
}
|
|
17
17
|
return e;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function di(i) {
|
|
20
20
|
return i !== null && typeof i == "object" && !Array.isArray(i);
|
|
21
21
|
}
|
|
22
|
-
let
|
|
23
|
-
for (let i = 0; i <
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
function
|
|
22
|
+
let be = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), dt = [];
|
|
23
|
+
for (let i = 0; i < be.length; i++)
|
|
24
|
+
dt[be[i].charCodeAt(0)] = i;
|
|
25
|
+
dt[45] = be.indexOf("+");
|
|
26
|
+
dt[95] = be.indexOf("/");
|
|
27
|
+
function Nn(i) {
|
|
28
28
|
let e = i.length * 3 / 4;
|
|
29
29
|
i[i.length - 2] == "=" ? e -= 2 : i[i.length - 1] == "=" && (e -= 1);
|
|
30
30
|
let t = new Uint8Array(e), n = 0, r = 0, s, o = 0;
|
|
31
31
|
for (let a = 0; a < i.length; a++) {
|
|
32
|
-
if (s =
|
|
32
|
+
if (s = dt[i.charCodeAt(a)], s === void 0)
|
|
33
33
|
switch (i[a]) {
|
|
34
34
|
case "=":
|
|
35
35
|
r = 0;
|
|
@@ -61,21 +61,21 @@ function Cn(i) {
|
|
|
61
61
|
throw Error("invalid base64 string.");
|
|
62
62
|
return t.subarray(0, n);
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function Fn(i) {
|
|
65
65
|
let e = "", t = 0, n, r = 0;
|
|
66
66
|
for (let s = 0; s < i.length; s++)
|
|
67
67
|
switch (n = i[s], t) {
|
|
68
68
|
case 0:
|
|
69
|
-
e +=
|
|
69
|
+
e += be[n >> 2], r = (n & 3) << 4, t = 1;
|
|
70
70
|
break;
|
|
71
71
|
case 1:
|
|
72
|
-
e +=
|
|
72
|
+
e += be[r | n >> 4], r = (n & 15) << 2, t = 2;
|
|
73
73
|
break;
|
|
74
74
|
case 2:
|
|
75
|
-
e +=
|
|
75
|
+
e += be[r | n >> 6], e += be[n & 63], t = 0;
|
|
76
76
|
break;
|
|
77
77
|
}
|
|
78
|
-
return t && (e +=
|
|
78
|
+
return t && (e += be[r], e += "=", t == 1 && (e += "=")), e;
|
|
79
79
|
}
|
|
80
80
|
var N;
|
|
81
81
|
(function(i) {
|
|
@@ -93,14 +93,14 @@ var N;
|
|
|
93
93
|
}, i.last = (t, n) => i.list(t, n).slice(-1)[0];
|
|
94
94
|
const e = (t) => t && Array.isArray(t[i.symbol]);
|
|
95
95
|
})(N || (N = {}));
|
|
96
|
-
function
|
|
96
|
+
function hi(i, e) {
|
|
97
97
|
return Object.assign(Object.assign({}, i), e);
|
|
98
98
|
}
|
|
99
99
|
var m;
|
|
100
100
|
(function(i) {
|
|
101
101
|
i[i.Varint = 0] = "Varint", i[i.Bit64 = 1] = "Bit64", i[i.LengthDelimited = 2] = "LengthDelimited", i[i.StartGroup = 3] = "StartGroup", i[i.EndGroup = 4] = "EndGroup", i[i.Bit32 = 5] = "Bit32";
|
|
102
102
|
})(m || (m = {}));
|
|
103
|
-
function
|
|
103
|
+
function ui() {
|
|
104
104
|
let i = 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 li() {
|
|
|
117
117
|
}
|
|
118
118
|
throw new Error("invalid varint");
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function gt(i, e, t) {
|
|
121
121
|
for (let s = 0; s < 28; s = s + 7) {
|
|
122
122
|
const o = i >>> s, a = !(!(o >>> 7) && e == 0), l = (a ? o | 128 : o) & 255;
|
|
123
123
|
if (t.push(l), !a)
|
|
@@ -133,21 +133,21 @@ function ht(i, e, t) {
|
|
|
133
133
|
t.push(e >>> 31 & 1);
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
-
const
|
|
137
|
-
function
|
|
136
|
+
const st = 65536 * 65536;
|
|
137
|
+
function Ln(i) {
|
|
138
138
|
let e = i[0] == "-";
|
|
139
139
|
e && (i = i.slice(1));
|
|
140
140
|
const t = 1e6;
|
|
141
141
|
let n = 0, r = 0;
|
|
142
142
|
function s(o, a) {
|
|
143
143
|
const l = Number(i.slice(o, a));
|
|
144
|
-
r *= t, n = n * t + l, n >=
|
|
144
|
+
r *= t, n = n * t + l, n >= st && (r = r + (n / st | 0), n = n % st);
|
|
145
145
|
}
|
|
146
146
|
return s(-24, -18), s(-18, -12), s(-12, -6), s(-6), [e, n, r];
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function Ft(i, e) {
|
|
149
149
|
if (e >>> 0 <= 2097151)
|
|
150
|
-
return "" + (
|
|
150
|
+
return "" + (st * e + (i >>> 0));
|
|
151
151
|
let t = i & 16777215, n = (i >>> 24 | e << 8) >>> 0 & 16777215, r = e >> 16 & 65535, s = t + n * 6777216 + r * 6710656, o = n + r * 8147497, a = r * 2, l = 1e7;
|
|
152
152
|
s >= l && (o += Math.floor(s / l), s %= l), o >= l && (a += Math.floor(o / l), o %= l);
|
|
153
153
|
function c(h, g) {
|
|
@@ -170,7 +170,7 @@ function yt(i, e) {
|
|
|
170
170
|
1
|
|
171
171
|
);
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
function tn(i, e) {
|
|
174
174
|
if (i >= 0) {
|
|
175
175
|
for (; i > 127; )
|
|
176
176
|
e.push(i & 127 | 128), i = i >>> 7;
|
|
@@ -181,7 +181,7 @@ function Jt(i, e) {
|
|
|
181
181
|
e.push(1);
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function pi() {
|
|
185
185
|
let i = this.buf[this.pos++], e = i & 127;
|
|
186
186
|
if (!(i & 128))
|
|
187
187
|
return this.assertBounds(), e;
|
|
@@ -199,7 +199,7 @@ function ci() {
|
|
|
199
199
|
return this.assertBounds(), e >>> 0;
|
|
200
200
|
}
|
|
201
201
|
let v;
|
|
202
|
-
function
|
|
202
|
+
function fi() {
|
|
203
203
|
const i = new DataView(new ArrayBuffer(8));
|
|
204
204
|
v = globalThis.BigInt !== void 0 && typeof i.getBigInt64 == "function" && typeof i.getBigUint64 == "function" && typeof i.setBigInt64 == "function" && typeof i.setBigUint64 == "function" ? {
|
|
205
205
|
MIN: BigInt("-9223372036854775808"),
|
|
@@ -210,13 +210,13 @@ function di() {
|
|
|
210
210
|
V: i
|
|
211
211
|
} : void 0;
|
|
212
212
|
}
|
|
213
|
-
|
|
214
|
-
function
|
|
213
|
+
fi();
|
|
214
|
+
function An(i) {
|
|
215
215
|
if (!i)
|
|
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 In = /^-?[0-9]+$/, ot = 4294967296, et = 2147483648;
|
|
219
|
+
class Tn {
|
|
220
220
|
/**
|
|
221
221
|
* Create a new instance with the given bits.
|
|
222
222
|
*/
|
|
@@ -233,13 +233,13 @@ class Fn {
|
|
|
233
233
|
* Convert to a native number.
|
|
234
234
|
*/
|
|
235
235
|
toNumber() {
|
|
236
|
-
let e = this.hi *
|
|
236
|
+
let e = this.hi * ot + (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
|
|
242
|
+
class P extends Tn {
|
|
243
243
|
/**
|
|
244
244
|
* Create instance from a `string`, `number` or `bigint`.
|
|
245
245
|
*/
|
|
@@ -263,19 +263,19 @@ class j extends Fn {
|
|
|
263
263
|
throw new Error("signed value for ulong");
|
|
264
264
|
if (e > v.UMAX)
|
|
265
265
|
throw new Error("ulong too large");
|
|
266
|
-
return v.V.setBigUint64(0, e, !0), new
|
|
266
|
+
return v.V.setBigUint64(0, e, !0), new P(v.V.getInt32(0, !0), v.V.getInt32(4, !0));
|
|
267
267
|
}
|
|
268
268
|
else
|
|
269
269
|
switch (typeof e) {
|
|
270
270
|
case "string":
|
|
271
271
|
if (e == "0")
|
|
272
272
|
return this.ZERO;
|
|
273
|
-
if (e = e.trim(), !
|
|
273
|
+
if (e = e.trim(), !In.test(e))
|
|
274
274
|
throw new Error("string is no integer");
|
|
275
|
-
let [t, n, r] =
|
|
275
|
+
let [t, n, r] = Ln(e);
|
|
276
276
|
if (t)
|
|
277
277
|
throw new Error("signed value for ulong");
|
|
278
|
-
return new
|
|
278
|
+
return new P(n, r);
|
|
279
279
|
case "number":
|
|
280
280
|
if (e == 0)
|
|
281
281
|
return this.ZERO;
|
|
@@ -283,7 +283,7 @@ class j extends Fn {
|
|
|
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
|
|
286
|
+
return new P(e, e / ot);
|
|
287
287
|
}
|
|
288
288
|
throw new Error("unknown value " + typeof e);
|
|
289
289
|
}
|
|
@@ -291,17 +291,17 @@ class j extends Fn {
|
|
|
291
291
|
* Convert to decimal string.
|
|
292
292
|
*/
|
|
293
293
|
toString() {
|
|
294
|
-
return v ? this.toBigInt().toString() :
|
|
294
|
+
return v ? this.toBigInt().toString() : Ft(this.lo, this.hi);
|
|
295
295
|
}
|
|
296
296
|
/**
|
|
297
297
|
* Convert to native bigint.
|
|
298
298
|
*/
|
|
299
299
|
toBigInt() {
|
|
300
|
-
return
|
|
300
|
+
return An(v), v.V.setInt32(0, this.lo, !0), v.V.setInt32(4, this.hi, !0), v.V.getBigUint64(0, !0);
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
|
-
|
|
304
|
-
class R extends
|
|
303
|
+
P.ZERO = new P(0, 0);
|
|
304
|
+
class R extends Tn {
|
|
305
305
|
/**
|
|
306
306
|
* Create instance from a `string`, `number` or `bigint`.
|
|
307
307
|
*/
|
|
@@ -332,13 +332,13 @@ class R extends Fn {
|
|
|
332
332
|
case "string":
|
|
333
333
|
if (e == "0")
|
|
334
334
|
return this.ZERO;
|
|
335
|
-
if (e = e.trim(), !
|
|
335
|
+
if (e = e.trim(), !In.test(e))
|
|
336
336
|
throw new Error("string is no integer");
|
|
337
|
-
let [t, n, r] =
|
|
337
|
+
let [t, n, r] = Ln(e);
|
|
338
338
|
if (t) {
|
|
339
|
-
if (r >
|
|
339
|
+
if (r > et || r == et && n != 0)
|
|
340
340
|
throw new Error("signed long too small");
|
|
341
|
-
} else if (r >=
|
|
341
|
+
} else if (r >= et)
|
|
342
342
|
throw new Error("signed long too large");
|
|
343
343
|
let s = new R(n, r);
|
|
344
344
|
return t ? s.negate() : s;
|
|
@@ -347,7 +347,7 @@ class R extends Fn {
|
|
|
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 R(e, e /
|
|
350
|
+
return e > 0 ? new R(e, e / ot) : new R(-e, -e / ot).negate();
|
|
351
351
|
}
|
|
352
352
|
throw new Error("unknown value " + typeof e);
|
|
353
353
|
}
|
|
@@ -355,7 +355,7 @@ class R extends Fn {
|
|
|
355
355
|
* Do we have a minus sign?
|
|
356
356
|
*/
|
|
357
357
|
isNegative() {
|
|
358
|
-
return (this.hi &
|
|
358
|
+
return (this.hi & et) !== 0;
|
|
359
359
|
}
|
|
360
360
|
/**
|
|
361
361
|
* Negate two's complement.
|
|
@@ -373,28 +373,28 @@ class R extends Fn {
|
|
|
373
373
|
return this.toBigInt().toString();
|
|
374
374
|
if (this.isNegative()) {
|
|
375
375
|
let e = this.negate();
|
|
376
|
-
return "-" +
|
|
376
|
+
return "-" + Ft(e.lo, e.hi);
|
|
377
377
|
}
|
|
378
|
-
return
|
|
378
|
+
return Ft(this.lo, this.hi);
|
|
379
379
|
}
|
|
380
380
|
/**
|
|
381
381
|
* Convert to native bigint.
|
|
382
382
|
*/
|
|
383
383
|
toBigInt() {
|
|
384
|
-
return
|
|
384
|
+
return An(v), v.V.setInt32(0, this.lo, !0), v.V.setInt32(4, this.hi, !0), v.V.getBigInt64(0, !0);
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
387
|
R.ZERO = new R(0, 0);
|
|
388
|
-
const
|
|
388
|
+
const nn = {
|
|
389
389
|
readUnknownField: !0,
|
|
390
|
-
readerFactory: (i) => new
|
|
390
|
+
readerFactory: (i) => new gi(i)
|
|
391
391
|
};
|
|
392
|
-
function
|
|
393
|
-
return i ? Object.assign(Object.assign({},
|
|
392
|
+
function mi(i) {
|
|
393
|
+
return i ? Object.assign(Object.assign({}, nn), i) : nn;
|
|
394
394
|
}
|
|
395
|
-
class
|
|
395
|
+
class gi {
|
|
396
396
|
constructor(e, t) {
|
|
397
|
-
this.varint64 =
|
|
397
|
+
this.varint64 = ui, this.uint32 = pi, 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
|
});
|
|
@@ -468,7 +468,7 @@ class ui {
|
|
|
468
468
|
* Read a `uint64` field, an unsigned 64-bit varint.
|
|
469
469
|
*/
|
|
470
470
|
uint64() {
|
|
471
|
-
return new
|
|
471
|
+
return new P(...this.varint64());
|
|
472
472
|
}
|
|
473
473
|
/**
|
|
474
474
|
* Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint.
|
|
@@ -500,7 +500,7 @@ class ui {
|
|
|
500
500
|
* Read a `fixed64` field, an unsigned, fixed-length 64 bit integer.
|
|
501
501
|
*/
|
|
502
502
|
fixed64() {
|
|
503
|
-
return new
|
|
503
|
+
return new P(this.sfixed32(), this.sfixed32());
|
|
504
504
|
}
|
|
505
505
|
/**
|
|
506
506
|
* Read a `fixed64` field, a signed, fixed-length 64-bit integer.
|
|
@@ -534,37 +534,37 @@ class ui {
|
|
|
534
534
|
return this.textDecoder.decode(this.bytes());
|
|
535
535
|
}
|
|
536
536
|
}
|
|
537
|
-
function
|
|
537
|
+
function k(i, e) {
|
|
538
538
|
if (!i)
|
|
539
539
|
throw new Error(e);
|
|
540
540
|
}
|
|
541
|
-
const
|
|
542
|
-
function
|
|
541
|
+
const wi = 34028234663852886e22, yi = -34028234663852886e22, bi = 4294967295, Ci = 2147483647, Ei = -2147483648;
|
|
542
|
+
function Xe(i) {
|
|
543
543
|
if (typeof i != "number")
|
|
544
544
|
throw new Error("invalid int 32: " + typeof i);
|
|
545
|
-
if (!Number.isInteger(i) || i >
|
|
545
|
+
if (!Number.isInteger(i) || i > Ci || i < Ei)
|
|
546
546
|
throw new Error("invalid int 32: " + i);
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function at(i) {
|
|
549
549
|
if (typeof i != "number")
|
|
550
550
|
throw new Error("invalid uint 32: " + typeof i);
|
|
551
|
-
if (!Number.isInteger(i) || i >
|
|
551
|
+
if (!Number.isInteger(i) || i > bi || i < 0)
|
|
552
552
|
throw new Error("invalid uint 32: " + i);
|
|
553
553
|
}
|
|
554
|
-
function
|
|
554
|
+
function vt(i) {
|
|
555
555
|
if (typeof i != "number")
|
|
556
556
|
throw new Error("invalid float 32: " + typeof i);
|
|
557
|
-
if (Number.isFinite(i) && (i >
|
|
557
|
+
if (Number.isFinite(i) && (i > wi || i < yi))
|
|
558
558
|
throw new Error("invalid float 32: " + i);
|
|
559
559
|
}
|
|
560
|
-
const
|
|
560
|
+
const rn = {
|
|
561
561
|
writeUnknownFields: !0,
|
|
562
|
-
writerFactory: () => new
|
|
562
|
+
writerFactory: () => new Ni()
|
|
563
563
|
};
|
|
564
|
-
function
|
|
565
|
-
return i ? Object.assign(Object.assign({},
|
|
564
|
+
function ki(i) {
|
|
565
|
+
return i ? Object.assign(Object.assign({}, rn), i) : rn;
|
|
566
566
|
}
|
|
567
|
-
class
|
|
567
|
+
class Ni {
|
|
568
568
|
constructor(e) {
|
|
569
569
|
this.stack = [], this.textEncoder = e ?? new TextEncoder(), this.chunks = [], this.buf = [];
|
|
570
570
|
}
|
|
@@ -620,7 +620,7 @@ class bi {
|
|
|
620
620
|
* Write a `uint32` value, an unsigned 32 bit varint.
|
|
621
621
|
*/
|
|
622
622
|
uint32(e) {
|
|
623
|
-
for (
|
|
623
|
+
for (at(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 bi {
|
|
|
628
628
|
* Write a `int32` value, a signed 32 bit varint.
|
|
629
629
|
*/
|
|
630
630
|
int32(e) {
|
|
631
|
-
return
|
|
631
|
+
return Xe(e), tn(e, this.buf), this;
|
|
632
632
|
}
|
|
633
633
|
/**
|
|
634
634
|
* Write a `bool` value, a variant.
|
|
@@ -653,7 +653,7 @@ class bi {
|
|
|
653
653
|
* Write a `float` value, 32-bit floating point number.
|
|
654
654
|
*/
|
|
655
655
|
float(e) {
|
|
656
|
-
|
|
656
|
+
vt(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 bi {
|
|
|
668
668
|
* Write a `fixed32` value, an unsigned, fixed-length 32-bit integer.
|
|
669
669
|
*/
|
|
670
670
|
fixed32(e) {
|
|
671
|
-
|
|
671
|
+
at(e);
|
|
672
672
|
let t = new Uint8Array(4);
|
|
673
673
|
return new DataView(t.buffer).setUint32(0, e, !0), this.raw(t);
|
|
674
674
|
}
|
|
@@ -676,7 +676,7 @@ class bi {
|
|
|
676
676
|
* Write a `sfixed32` value, a signed, fixed-length 32-bit integer.
|
|
677
677
|
*/
|
|
678
678
|
sfixed32(e) {
|
|
679
|
-
|
|
679
|
+
Xe(e);
|
|
680
680
|
let t = new Uint8Array(4);
|
|
681
681
|
return new DataView(t.buffer).setInt32(0, e, !0), this.raw(t);
|
|
682
682
|
}
|
|
@@ -684,7 +684,7 @@ class bi {
|
|
|
684
684
|
* Write a `sint32` value, a signed, zigzag-encoded 32-bit varint.
|
|
685
685
|
*/
|
|
686
686
|
sint32(e) {
|
|
687
|
-
return
|
|
687
|
+
return Xe(e), e = (e << 1 ^ e >> 31) >>> 0, tn(e, this.buf), this;
|
|
688
688
|
}
|
|
689
689
|
/**
|
|
690
690
|
* Write a `fixed64` value, a signed, fixed-length 64-bit integer.
|
|
@@ -697,7 +697,7 @@ class bi {
|
|
|
697
697
|
* Write a `fixed64` value, an unsigned, fixed-length 64 bit integer.
|
|
698
698
|
*/
|
|
699
699
|
fixed64(e) {
|
|
700
|
-
let t = new Uint8Array(8), n = new DataView(t.buffer), r =
|
|
700
|
+
let t = new Uint8Array(8), n = new DataView(t.buffer), r = P.from(e);
|
|
701
701
|
return n.setInt32(0, r.lo, !0), n.setInt32(4, r.hi, !0), this.raw(t);
|
|
702
702
|
}
|
|
703
703
|
/**
|
|
@@ -705,44 +705,44 @@ class bi {
|
|
|
705
705
|
*/
|
|
706
706
|
int64(e) {
|
|
707
707
|
let t = R.from(e);
|
|
708
|
-
return
|
|
708
|
+
return gt(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 = R.from(e), n = t.hi >> 31, r = t.lo << 1 ^ n, s = (t.hi << 1 | t.lo >>> 31) ^ n;
|
|
715
|
-
return
|
|
715
|
+
return gt(r, s, 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
|
-
let t =
|
|
722
|
-
return
|
|
721
|
+
let t = P.from(e);
|
|
722
|
+
return gt(t.lo, t.hi, this.buf), this;
|
|
723
723
|
}
|
|
724
724
|
}
|
|
725
|
-
const
|
|
725
|
+
const sn = {
|
|
726
726
|
emitDefaultValues: !1,
|
|
727
727
|
enumAsInteger: !1,
|
|
728
728
|
useProtoFieldName: !1,
|
|
729
729
|
prettySpaces: 0
|
|
730
|
-
},
|
|
730
|
+
}, on = {
|
|
731
731
|
ignoreUnknownFields: !1
|
|
732
732
|
};
|
|
733
|
-
function
|
|
734
|
-
return i ? Object.assign(Object.assign({},
|
|
733
|
+
function Fi(i) {
|
|
734
|
+
return i ? Object.assign(Object.assign({}, on), i) : on;
|
|
735
735
|
}
|
|
736
|
-
function
|
|
737
|
-
return i ? Object.assign(Object.assign({},
|
|
736
|
+
function Li(i) {
|
|
737
|
+
return i ? Object.assign(Object.assign({}, sn), i) : sn;
|
|
738
738
|
}
|
|
739
|
-
function
|
|
739
|
+
function Ai(i, e) {
|
|
740
740
|
var t, n;
|
|
741
741
|
let r = Object.assign(Object.assign({}, i), e);
|
|
742
742
|
return r.typeRegistry = [...(t = i == null ? void 0 : i.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 vn = Symbol.for("protobuf-ts/message-type");
|
|
745
|
+
function Lt(i) {
|
|
746
746
|
let e = !1;
|
|
747
747
|
const t = [];
|
|
748
748
|
for (let n = 0; n < i.length; n++) {
|
|
@@ -755,19 +755,19 @@ var u;
|
|
|
755
755
|
(function(i) {
|
|
756
756
|
i[i.DOUBLE = 1] = "DOUBLE", i[i.FLOAT = 2] = "FLOAT", i[i.INT64 = 3] = "INT64", i[i.UINT64 = 4] = "UINT64", i[i.INT32 = 5] = "INT32", i[i.FIXED64 = 6] = "FIXED64", i[i.FIXED32 = 7] = "FIXED32", i[i.BOOL = 8] = "BOOL", i[i.STRING = 9] = "STRING", i[i.BYTES = 12] = "BYTES", i[i.UINT32 = 13] = "UINT32", i[i.SFIXED32 = 15] = "SFIXED32", i[i.SFIXED64 = 16] = "SFIXED64", i[i.SINT32 = 17] = "SINT32", i[i.SINT64 = 18] = "SINT64";
|
|
757
757
|
})(u || (u = {}));
|
|
758
|
-
var
|
|
758
|
+
var ue;
|
|
759
759
|
(function(i) {
|
|
760
760
|
i[i.BIGINT = 0] = "BIGINT", i[i.STRING = 1] = "STRING", i[i.NUMBER = 2] = "NUMBER";
|
|
761
|
-
})(
|
|
762
|
-
var
|
|
761
|
+
})(ue || (ue = {}));
|
|
762
|
+
var lt;
|
|
763
763
|
(function(i) {
|
|
764
764
|
i[i.NO = 0] = "NO", i[i.PACKED = 1] = "PACKED", i[i.UNPACKED = 2] = "UNPACKED";
|
|
765
|
-
})(
|
|
766
|
-
function
|
|
765
|
+
})(lt || (lt = {}));
|
|
766
|
+
function Ii(i) {
|
|
767
767
|
var e, t, n, r;
|
|
768
|
-
return i.localName = (e = i.localName) !== null && e !== void 0 ? e :
|
|
768
|
+
return i.localName = (e = i.localName) !== null && e !== void 0 ? e : Lt(i.name), i.jsonName = (t = i.jsonName) !== null && t !== void 0 ? t : Lt(i.name), i.repeat = (n = i.repeat) !== null && n !== void 0 ? n : lt.NO, i.opt = (r = i.opt) !== null && r !== void 0 ? r : i.repeat || i.oneof ? !1 : i.kind == "message", i;
|
|
769
769
|
}
|
|
770
|
-
function
|
|
770
|
+
function Ti(i) {
|
|
771
771
|
if (typeof i != "object" || i === null || !i.hasOwnProperty("oneofKind"))
|
|
772
772
|
return !1;
|
|
773
773
|
switch (typeof i.oneofKind) {
|
|
@@ -779,7 +779,7 @@ function Ai(i) {
|
|
|
779
779
|
return !1;
|
|
780
780
|
}
|
|
781
781
|
}
|
|
782
|
-
class
|
|
782
|
+
class vi {
|
|
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 Fi {
|
|
|
839
839
|
return !0;
|
|
840
840
|
for (const o of s.oneofs) {
|
|
841
841
|
const a = e[o];
|
|
842
|
-
if (!
|
|
842
|
+
if (!Ti(a))
|
|
843
843
|
return !1;
|
|
844
844
|
if (a.oneofKind === void 0)
|
|
845
845
|
continue;
|
|
@@ -907,9 +907,9 @@ class Fi {
|
|
|
907
907
|
case u.SFIXED64:
|
|
908
908
|
case u.SINT64:
|
|
909
909
|
switch (n) {
|
|
910
|
-
case
|
|
910
|
+
case ue.BIGINT:
|
|
911
911
|
return r == "bigint";
|
|
912
|
-
case
|
|
912
|
+
case ue.NUMBER:
|
|
913
913
|
return r == "number" && !isNaN(e);
|
|
914
914
|
default:
|
|
915
915
|
return r == "string";
|
|
@@ -951,21 +951,21 @@ class Fi {
|
|
|
951
951
|
case u.BOOL:
|
|
952
952
|
return this.scalars(r.slice(0, n).map((s) => s == "true" ? !0 : s == "false" ? !1 : s), t, n);
|
|
953
953
|
default:
|
|
954
|
-
return this.scalars(r, t, n,
|
|
954
|
+
return this.scalars(r, t, n, ue.STRING);
|
|
955
955
|
}
|
|
956
956
|
}
|
|
957
957
|
}
|
|
958
|
-
function
|
|
958
|
+
function re(i, e) {
|
|
959
959
|
switch (e) {
|
|
960
|
-
case
|
|
960
|
+
case ue.BIGINT:
|
|
961
961
|
return i.toBigInt();
|
|
962
|
-
case
|
|
962
|
+
case ue.NUMBER:
|
|
963
963
|
return i.toNumber();
|
|
964
964
|
default:
|
|
965
965
|
return i.toString();
|
|
966
966
|
}
|
|
967
967
|
}
|
|
968
|
-
class
|
|
968
|
+
class Bi {
|
|
969
969
|
constructor(e) {
|
|
970
970
|
this.info = e;
|
|
971
971
|
}
|
|
@@ -981,7 +981,7 @@ class Li {
|
|
|
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 = kn(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,26 +1019,26 @@ class Li {
|
|
|
1019
1019
|
if (a.kind == "map") {
|
|
1020
1020
|
if (o === null)
|
|
1021
1021
|
continue;
|
|
1022
|
-
this.assert(
|
|
1022
|
+
this.assert(di(o), a.name, o);
|
|
1023
1023
|
const h = c[l];
|
|
1024
1024
|
for (const [g, w] of Object.entries(o)) {
|
|
1025
1025
|
this.assert(w !== null, a.name + " map value", null);
|
|
1026
|
-
let
|
|
1026
|
+
let L;
|
|
1027
1027
|
switch (a.V.kind) {
|
|
1028
1028
|
case "message":
|
|
1029
|
-
|
|
1029
|
+
L = a.V.T().internalJsonRead(w, n);
|
|
1030
1030
|
break;
|
|
1031
1031
|
case "enum":
|
|
1032
|
-
if (
|
|
1032
|
+
if (L = this.enum(a.V.T(), w, a.name, n.ignoreUnknownFields), L === !1)
|
|
1033
1033
|
continue;
|
|
1034
1034
|
break;
|
|
1035
1035
|
case "scalar":
|
|
1036
|
-
|
|
1036
|
+
L = this.scalar(w, a.V.T, a.V.L, a.name);
|
|
1037
1037
|
break;
|
|
1038
1038
|
}
|
|
1039
|
-
this.assert(
|
|
1039
|
+
this.assert(L !== void 0, a.name + " map value", w);
|
|
1040
1040
|
let B = g;
|
|
1041
|
-
a.K == u.BOOL && (B = B == "true" ? !0 : B == "false" ? !1 : B), B = this.scalar(B, a.K,
|
|
1041
|
+
a.K == u.BOOL && (B = B == "true" ? !0 : B == "false" ? !1 : B), B = this.scalar(B, a.K, ue.STRING, a.name).toString(), h[B] = L;
|
|
1042
1042
|
}
|
|
1043
1043
|
} else if (a.repeat) {
|
|
1044
1044
|
if (o === null)
|
|
@@ -1089,18 +1089,18 @@ class Li {
|
|
|
1089
1089
|
* google.protobuf.NullValue accepts only JSON `null` (or the old `"NULL_VALUE"`).
|
|
1090
1090
|
*/
|
|
1091
1091
|
enum(e, t, n, r) {
|
|
1092
|
-
if (e[0] == "google.protobuf.NullValue" &&
|
|
1092
|
+
if (e[0] == "google.protobuf.NullValue" && k(t === null || t === "NULL_VALUE", `Unable to parse field ${this.info.typeName}#${n}, enum ${e[0]} only accepts null.`), t === null)
|
|
1093
1093
|
return 0;
|
|
1094
1094
|
switch (typeof t) {
|
|
1095
1095
|
case "number":
|
|
1096
|
-
return
|
|
1096
|
+
return k(Number.isInteger(t), `Unable to parse field ${this.info.typeName}#${n}, enum can only be integral number, got ${t}.`), t;
|
|
1097
1097
|
case "string":
|
|
1098
1098
|
let s = t;
|
|
1099
1099
|
e[2] && t.substring(0, e[2].length) === e[2] && (s = t.substring(e[2].length));
|
|
1100
1100
|
let o = e[1][s];
|
|
1101
|
-
return typeof o > "u" && r ? !1 : (
|
|
1101
|
+
return typeof o > "u" && r ? !1 : (k(typeof o == "number", `Unable to parse field ${this.info.typeName}#${n}, enum ${e[0]} has no value for "${t}".`), o);
|
|
1102
1102
|
}
|
|
1103
|
-
|
|
1103
|
+
k(!1, `Unable to parse field ${this.info.typeName}#${n}, cannot parse enum value from ${typeof t}".`);
|
|
1104
1104
|
}
|
|
1105
1105
|
scalar(e, t, n, r) {
|
|
1106
1106
|
let s;
|
|
@@ -1135,7 +1135,7 @@ class Li {
|
|
|
1135
1135
|
s = "too large or small";
|
|
1136
1136
|
break;
|
|
1137
1137
|
}
|
|
1138
|
-
return t == u.FLOAT &&
|
|
1138
|
+
return t == u.FLOAT && vt(o), o;
|
|
1139
1139
|
case u.INT32:
|
|
1140
1140
|
case u.FIXED32:
|
|
1141
1141
|
case u.SFIXED32:
|
|
@@ -1146,22 +1146,22 @@ class Li {
|
|
|
1146
1146
|
let a;
|
|
1147
1147
|
if (typeof e == "number" ? a = e : e === "" ? s = "empty string" : typeof e == "string" && (e.trim().length !== e.length ? s = "extra whitespace" : a = Number(e)), a === void 0)
|
|
1148
1148
|
break;
|
|
1149
|
-
return t == u.UINT32 ?
|
|
1149
|
+
return t == u.UINT32 ? at(a) : Xe(a), a;
|
|
1150
1150
|
case u.INT64:
|
|
1151
1151
|
case u.SFIXED64:
|
|
1152
1152
|
case u.SINT64:
|
|
1153
1153
|
if (e === null)
|
|
1154
|
-
return
|
|
1154
|
+
return re(R.ZERO, n);
|
|
1155
1155
|
if (typeof e != "number" && typeof e != "string")
|
|
1156
1156
|
break;
|
|
1157
|
-
return
|
|
1157
|
+
return re(R.from(e), n);
|
|
1158
1158
|
case u.FIXED64:
|
|
1159
1159
|
case u.UINT64:
|
|
1160
1160
|
if (e === null)
|
|
1161
|
-
return
|
|
1161
|
+
return re(P.ZERO, n);
|
|
1162
1162
|
if (typeof e != "number" && typeof e != "string")
|
|
1163
1163
|
break;
|
|
1164
|
-
return
|
|
1164
|
+
return re(P.from(e), n);
|
|
1165
1165
|
case u.BOOL:
|
|
1166
1166
|
if (e === null)
|
|
1167
1167
|
return !1;
|
|
@@ -1187,7 +1187,7 @@ class Li {
|
|
|
1187
1187
|
return new Uint8Array(0);
|
|
1188
1188
|
if (typeof e != "string")
|
|
1189
1189
|
break;
|
|
1190
|
-
return
|
|
1190
|
+
return Nn(e);
|
|
1191
1191
|
}
|
|
1192
1192
|
} catch (o) {
|
|
1193
1193
|
s = o.message;
|
|
@@ -1195,7 +1195,7 @@ class Li {
|
|
|
1195
1195
|
this.assert(!1, r + (s ? " - " + s : ""), e);
|
|
1196
1196
|
}
|
|
1197
1197
|
}
|
|
1198
|
-
class
|
|
1198
|
+
class xi {
|
|
1199
1199
|
constructor(e) {
|
|
1200
1200
|
var t;
|
|
1201
1201
|
this.fields = (t = e.fields) !== null && t !== void 0 ? t : [];
|
|
@@ -1216,62 +1216,62 @@ class Ii {
|
|
|
1216
1216
|
continue;
|
|
1217
1217
|
const a = s.kind == "scalar" || s.kind == "enum" ? Object.assign(Object.assign({}, t), { emitDefaultValues: !0 }) : t;
|
|
1218
1218
|
let l = this.field(s, o[s.localName], a);
|
|
1219
|
-
|
|
1219
|
+
k(l !== void 0), n[t.useProtoFieldName ? s.name : s.jsonName] = l;
|
|
1220
1220
|
}
|
|
1221
1221
|
return n;
|
|
1222
1222
|
}
|
|
1223
1223
|
field(e, t, n) {
|
|
1224
1224
|
let r;
|
|
1225
1225
|
if (e.kind == "map") {
|
|
1226
|
-
|
|
1226
|
+
k(typeof t == "object" && t !== null);
|
|
1227
1227
|
const s = {};
|
|
1228
1228
|
switch (e.V.kind) {
|
|
1229
1229
|
case "scalar":
|
|
1230
1230
|
for (const [l, c] of Object.entries(t)) {
|
|
1231
1231
|
const h = this.scalar(e.V.T, c, e.name, !1, !0);
|
|
1232
|
-
|
|
1232
|
+
k(h !== void 0), s[l.toString()] = h;
|
|
1233
1233
|
}
|
|
1234
1234
|
break;
|
|
1235
1235
|
case "message":
|
|
1236
1236
|
const o = e.V.T();
|
|
1237
1237
|
for (const [l, c] of Object.entries(t)) {
|
|
1238
1238
|
const h = this.message(o, c, e.name, n);
|
|
1239
|
-
|
|
1239
|
+
k(h !== void 0), s[l.toString()] = h;
|
|
1240
1240
|
}
|
|
1241
1241
|
break;
|
|
1242
1242
|
case "enum":
|
|
1243
1243
|
const a = e.V.T();
|
|
1244
1244
|
for (const [l, c] of Object.entries(t)) {
|
|
1245
|
-
|
|
1245
|
+
k(c === void 0 || typeof c == "number");
|
|
1246
1246
|
const h = this.enum(a, c, e.name, !1, !0, n.enumAsInteger);
|
|
1247
|
-
|
|
1247
|
+
k(h !== void 0), s[l.toString()] = h;
|
|
1248
1248
|
}
|
|
1249
1249
|
break;
|
|
1250
1250
|
}
|
|
1251
1251
|
(n.emitDefaultValues || Object.keys(s).length > 0) && (r = s);
|
|
1252
1252
|
} else if (e.repeat) {
|
|
1253
|
-
|
|
1253
|
+
k(Array.isArray(t));
|
|
1254
1254
|
const s = [];
|
|
1255
1255
|
switch (e.kind) {
|
|
1256
1256
|
case "scalar":
|
|
1257
1257
|
for (let l = 0; l < t.length; l++) {
|
|
1258
1258
|
const c = this.scalar(e.T, t[l], e.name, e.opt, !0);
|
|
1259
|
-
|
|
1259
|
+
k(c !== void 0), s.push(c);
|
|
1260
1260
|
}
|
|
1261
1261
|
break;
|
|
1262
1262
|
case "enum":
|
|
1263
1263
|
const o = e.T();
|
|
1264
1264
|
for (let l = 0; l < t.length; l++) {
|
|
1265
|
-
|
|
1265
|
+
k(t[l] === void 0 || typeof t[l] == "number");
|
|
1266
1266
|
const c = this.enum(o, t[l], e.name, e.opt, !0, n.enumAsInteger);
|
|
1267
|
-
|
|
1267
|
+
k(c !== void 0), s.push(c);
|
|
1268
1268
|
}
|
|
1269
1269
|
break;
|
|
1270
1270
|
case "message":
|
|
1271
1271
|
const a = e.T();
|
|
1272
1272
|
for (let l = 0; l < t.length; l++) {
|
|
1273
1273
|
const c = this.message(a, t[l], e.name, n);
|
|
1274
|
-
|
|
1274
|
+
k(c !== void 0), s.push(c);
|
|
1275
1275
|
}
|
|
1276
1276
|
break;
|
|
1277
1277
|
}
|
|
@@ -1297,18 +1297,18 @@ class Ii {
|
|
|
1297
1297
|
if (e[0] == "google.protobuf.NullValue")
|
|
1298
1298
|
return !s && !r ? void 0 : null;
|
|
1299
1299
|
if (t === void 0) {
|
|
1300
|
-
|
|
1300
|
+
k(r);
|
|
1301
1301
|
return;
|
|
1302
1302
|
}
|
|
1303
1303
|
if (!(t === 0 && !s && !r))
|
|
1304
|
-
return
|
|
1304
|
+
return k(typeof t == "number"), k(Number.isInteger(t)), o || !e[1].hasOwnProperty(t) ? t : e[2] ? e[2] + e[1][t] : e[1][t];
|
|
1305
1305
|
}
|
|
1306
1306
|
message(e, t, n, r) {
|
|
1307
1307
|
return t === void 0 ? r.emitDefaultValues ? null : void 0 : e.internalJsonWrite(t, r);
|
|
1308
1308
|
}
|
|
1309
1309
|
scalar(e, t, n, r, s) {
|
|
1310
1310
|
if (t === void 0) {
|
|
1311
|
-
|
|
1311
|
+
k(r);
|
|
1312
1312
|
return;
|
|
1313
1313
|
}
|
|
1314
1314
|
const o = s || r;
|
|
@@ -1316,45 +1316,45 @@ class Ii {
|
|
|
1316
1316
|
case u.INT32:
|
|
1317
1317
|
case u.SFIXED32:
|
|
1318
1318
|
case u.SINT32:
|
|
1319
|
-
return t === 0 ? o ? 0 : void 0 : (
|
|
1319
|
+
return t === 0 ? o ? 0 : void 0 : (Xe(t), t);
|
|
1320
1320
|
case u.FIXED32:
|
|
1321
1321
|
case u.UINT32:
|
|
1322
|
-
return t === 0 ? o ? 0 : void 0 : (
|
|
1322
|
+
return t === 0 ? o ? 0 : void 0 : (at(t), t);
|
|
1323
1323
|
case u.FLOAT:
|
|
1324
|
-
|
|
1324
|
+
vt(t);
|
|
1325
1325
|
case u.DOUBLE:
|
|
1326
|
-
return t === 0 ? o ? 0 : void 0 : (
|
|
1326
|
+
return t === 0 ? o ? 0 : void 0 : (k(typeof t == "number"), Number.isNaN(t) ? "NaN" : t === Number.POSITIVE_INFINITY ? "Infinity" : t === Number.NEGATIVE_INFINITY ? "-Infinity" : t);
|
|
1327
1327
|
case u.STRING:
|
|
1328
|
-
return t === "" ? o ? "" : void 0 : (
|
|
1328
|
+
return t === "" ? o ? "" : void 0 : (k(typeof t == "string"), t);
|
|
1329
1329
|
case u.BOOL:
|
|
1330
|
-
return t === !1 ? o ? !1 : void 0 : (
|
|
1330
|
+
return t === !1 ? o ? !1 : void 0 : (k(typeof t == "boolean"), t);
|
|
1331
1331
|
case u.UINT64:
|
|
1332
1332
|
case u.FIXED64:
|
|
1333
|
-
|
|
1334
|
-
let a =
|
|
1333
|
+
k(typeof t == "number" || typeof t == "string" || typeof t == "bigint");
|
|
1334
|
+
let a = P.from(t);
|
|
1335
1335
|
return a.isZero() && !o ? void 0 : a.toString();
|
|
1336
1336
|
case u.INT64:
|
|
1337
1337
|
case u.SFIXED64:
|
|
1338
1338
|
case u.SINT64:
|
|
1339
|
-
|
|
1339
|
+
k(typeof t == "number" || typeof t == "string" || typeof t == "bigint");
|
|
1340
1340
|
let l = R.from(t);
|
|
1341
1341
|
return l.isZero() && !o ? void 0 : l.toString();
|
|
1342
1342
|
case u.BYTES:
|
|
1343
|
-
return
|
|
1343
|
+
return k(t instanceof Uint8Array), t.byteLength ? Fn(t) : o ? "" : void 0;
|
|
1344
1344
|
}
|
|
1345
1345
|
}
|
|
1346
1346
|
}
|
|
1347
|
-
function
|
|
1347
|
+
function At(i, e = ue.STRING) {
|
|
1348
1348
|
switch (i) {
|
|
1349
1349
|
case u.BOOL:
|
|
1350
1350
|
return !1;
|
|
1351
1351
|
case u.UINT64:
|
|
1352
1352
|
case u.FIXED64:
|
|
1353
|
-
return
|
|
1353
|
+
return re(P.ZERO, e);
|
|
1354
1354
|
case u.INT64:
|
|
1355
1355
|
case u.SFIXED64:
|
|
1356
1356
|
case u.SINT64:
|
|
1357
|
-
return
|
|
1357
|
+
return re(R.ZERO, e);
|
|
1358
1358
|
case u.DOUBLE:
|
|
1359
1359
|
case u.FLOAT:
|
|
1360
1360
|
return 0;
|
|
@@ -1366,7 +1366,7 @@ function Ct(i, e = le.STRING) {
|
|
|
1366
1366
|
return 0;
|
|
1367
1367
|
}
|
|
1368
1368
|
}
|
|
1369
|
-
class
|
|
1369
|
+
class _i {
|
|
1370
1370
|
constructor(e) {
|
|
1371
1371
|
this.info = e;
|
|
1372
1372
|
}
|
|
@@ -1395,8 +1395,8 @@ class vi {
|
|
|
1395
1395
|
let w = n.readUnknownField;
|
|
1396
1396
|
if (w == "throw")
|
|
1397
1397
|
throw new Error(`Unknown field ${o} (wire type ${a}) for ${this.info.typeName}`);
|
|
1398
|
-
let
|
|
1399
|
-
w !== !1 && (w === !0 ? N.onRead : w)(this.info.typeName, t, o, a,
|
|
1398
|
+
let L = e.skip(a);
|
|
1399
|
+
w !== !1 && (w === !0 ? N.onRead : w)(this.info.typeName, t, o, a, L);
|
|
1400
1400
|
continue;
|
|
1401
1401
|
}
|
|
1402
1402
|
let c = t, h = l.repeat, g = l.localName;
|
|
@@ -1405,28 +1405,28 @@ class vi {
|
|
|
1405
1405
|
})), l.kind) {
|
|
1406
1406
|
case "scalar":
|
|
1407
1407
|
case "enum":
|
|
1408
|
-
let w = l.kind == "enum" ? u.INT32 : l.T,
|
|
1408
|
+
let w = l.kind == "enum" ? u.INT32 : l.T, L = l.kind == "scalar" ? l.L : void 0;
|
|
1409
1409
|
if (h) {
|
|
1410
|
-
let
|
|
1410
|
+
let A = c[g];
|
|
1411
1411
|
if (a == m.LengthDelimited && w != u.STRING && w != u.BYTES) {
|
|
1412
|
-
let
|
|
1413
|
-
for (; e.pos <
|
|
1414
|
-
|
|
1412
|
+
let W = e.uint32() + e.pos;
|
|
1413
|
+
for (; e.pos < W; )
|
|
1414
|
+
A.push(this.scalar(e, w, L));
|
|
1415
1415
|
} else
|
|
1416
|
-
|
|
1416
|
+
A.push(this.scalar(e, w, L));
|
|
1417
1417
|
} else
|
|
1418
|
-
c[g] = this.scalar(e, w,
|
|
1418
|
+
c[g] = this.scalar(e, w, L);
|
|
1419
1419
|
break;
|
|
1420
1420
|
case "message":
|
|
1421
1421
|
if (h) {
|
|
1422
|
-
let
|
|
1423
|
-
|
|
1422
|
+
let A = c[g], W = l.T().internalBinaryRead(e, e.uint32(), n);
|
|
1423
|
+
A.push(W);
|
|
1424
1424
|
} else
|
|
1425
1425
|
c[g] = l.T().internalBinaryRead(e, e.uint32(), n, c[g]);
|
|
1426
1426
|
break;
|
|
1427
1427
|
case "map":
|
|
1428
|
-
let [B,
|
|
1429
|
-
c[g][B] =
|
|
1428
|
+
let [B, $] = this.mapEntry(l, e, n);
|
|
1429
|
+
c[g][B] = $;
|
|
1430
1430
|
break;
|
|
1431
1431
|
}
|
|
1432
1432
|
}
|
|
@@ -1440,7 +1440,7 @@ class vi {
|
|
|
1440
1440
|
let [l, c] = t.tag();
|
|
1441
1441
|
switch (l) {
|
|
1442
1442
|
case 1:
|
|
1443
|
-
e.K == u.BOOL ? o = t.bool().toString() : o = this.scalar(t, e.K,
|
|
1443
|
+
e.K == u.BOOL ? o = t.bool().toString() : o = this.scalar(t, e.K, ue.STRING);
|
|
1444
1444
|
break;
|
|
1445
1445
|
case 2:
|
|
1446
1446
|
switch (e.V.kind) {
|
|
@@ -1460,13 +1460,13 @@ class vi {
|
|
|
1460
1460
|
}
|
|
1461
1461
|
}
|
|
1462
1462
|
if (o === void 0) {
|
|
1463
|
-
let l =
|
|
1463
|
+
let l = At(e.K);
|
|
1464
1464
|
o = e.K == u.BOOL ? l.toString() : l;
|
|
1465
1465
|
}
|
|
1466
1466
|
if (a === void 0)
|
|
1467
1467
|
switch (e.V.kind) {
|
|
1468
1468
|
case "scalar":
|
|
1469
|
-
a =
|
|
1469
|
+
a = At(e.V.T, e.V.L);
|
|
1470
1470
|
break;
|
|
1471
1471
|
case "enum":
|
|
1472
1472
|
a = 0;
|
|
@@ -1490,11 +1490,11 @@ class vi {
|
|
|
1490
1490
|
case u.FLOAT:
|
|
1491
1491
|
return e.float();
|
|
1492
1492
|
case u.INT64:
|
|
1493
|
-
return
|
|
1493
|
+
return re(e.int64(), n);
|
|
1494
1494
|
case u.UINT64:
|
|
1495
|
-
return
|
|
1495
|
+
return re(e.uint64(), n);
|
|
1496
1496
|
case u.FIXED64:
|
|
1497
|
-
return
|
|
1497
|
+
return re(e.fixed64(), n);
|
|
1498
1498
|
case u.FIXED32:
|
|
1499
1499
|
return e.fixed32();
|
|
1500
1500
|
case u.BYTES:
|
|
@@ -1504,15 +1504,15 @@ class vi {
|
|
|
1504
1504
|
case u.SFIXED32:
|
|
1505
1505
|
return e.sfixed32();
|
|
1506
1506
|
case u.SFIXED64:
|
|
1507
|
-
return
|
|
1507
|
+
return re(e.sfixed64(), n);
|
|
1508
1508
|
case u.SINT32:
|
|
1509
1509
|
return e.sint32();
|
|
1510
1510
|
case u.SINT64:
|
|
1511
|
-
return
|
|
1511
|
+
return re(e.sint64(), n);
|
|
1512
1512
|
}
|
|
1513
1513
|
}
|
|
1514
1514
|
}
|
|
1515
|
-
class
|
|
1515
|
+
class Oi {
|
|
1516
1516
|
constructor(e) {
|
|
1517
1517
|
this.info = e;
|
|
1518
1518
|
}
|
|
@@ -1541,23 +1541,23 @@ class Ti {
|
|
|
1541
1541
|
case "enum":
|
|
1542
1542
|
let h = s.kind == "enum" ? u.INT32 : s.T;
|
|
1543
1543
|
if (l)
|
|
1544
|
-
if (
|
|
1544
|
+
if (k(Array.isArray(o)), l == lt.PACKED)
|
|
1545
1545
|
this.packed(t, h, s.no, o);
|
|
1546
1546
|
else
|
|
1547
1547
|
for (const g of o)
|
|
1548
1548
|
this.scalar(t, h, s.no, g, !0);
|
|
1549
|
-
else o === void 0 ?
|
|
1549
|
+
else o === void 0 ? k(s.opt) : this.scalar(t, h, s.no, o, a || s.opt);
|
|
1550
1550
|
break;
|
|
1551
1551
|
case "message":
|
|
1552
1552
|
if (l) {
|
|
1553
|
-
|
|
1553
|
+
k(Array.isArray(o));
|
|
1554
1554
|
for (const g of o)
|
|
1555
1555
|
this.message(t, n, s.T(), s.no, g);
|
|
1556
1556
|
} else
|
|
1557
1557
|
this.message(t, n, s.T(), s.no, o);
|
|
1558
1558
|
break;
|
|
1559
1559
|
case "map":
|
|
1560
|
-
|
|
1560
|
+
k(typeof o == "object" && o !== null);
|
|
1561
1561
|
for (const [g, w] of Object.entries(o))
|
|
1562
1562
|
this.mapEntry(t, n, s, g, w);
|
|
1563
1563
|
break;
|
|
@@ -1578,7 +1578,7 @@ class Ti {
|
|
|
1578
1578
|
o = Number.parseInt(r);
|
|
1579
1579
|
break;
|
|
1580
1580
|
case u.BOOL:
|
|
1581
|
-
|
|
1581
|
+
k(r == "true" || r == "false"), o = r == "true";
|
|
1582
1582
|
break;
|
|
1583
1583
|
}
|
|
1584
1584
|
switch (this.scalar(e, n.K, 1, o, !0), n.V.kind) {
|
|
@@ -1610,7 +1610,7 @@ class Ti {
|
|
|
1610
1610
|
packed(e, t, n, r) {
|
|
1611
1611
|
if (!r.length)
|
|
1612
1612
|
return;
|
|
1613
|
-
|
|
1613
|
+
k(t !== u.BYTES && t !== u.STRING), e.tag(n, m.LengthDelimited), e.fork();
|
|
1614
1614
|
let [, s] = this.scalarInfo(t);
|
|
1615
1615
|
for (let o = 0; o < r.length; o++)
|
|
1616
1616
|
e[s](r[o]);
|
|
@@ -1651,10 +1651,10 @@ class Ti {
|
|
|
1651
1651
|
o = s || R.from(t).isZero(), r = "int64";
|
|
1652
1652
|
break;
|
|
1653
1653
|
case u.UINT64:
|
|
1654
|
-
o = s ||
|
|
1654
|
+
o = s || P.from(t).isZero(), r = "uint64";
|
|
1655
1655
|
break;
|
|
1656
1656
|
case u.FIXED64:
|
|
1657
|
-
o = s ||
|
|
1657
|
+
o = s || P.from(t).isZero(), n = m.Bit64, r = "fixed64";
|
|
1658
1658
|
break;
|
|
1659
1659
|
case u.BYTES:
|
|
1660
1660
|
o = s || !t.byteLength, n = m.LengthDelimited, r = "bytes";
|
|
@@ -1678,8 +1678,8 @@ class Ti {
|
|
|
1678
1678
|
return [n, r, s || o];
|
|
1679
1679
|
}
|
|
1680
1680
|
}
|
|
1681
|
-
function
|
|
1682
|
-
const e = i.messagePrototype ? Object.create(i.messagePrototype) : Object.defineProperty({},
|
|
1681
|
+
function Ui(i) {
|
|
1682
|
+
const e = i.messagePrototype ? Object.create(i.messagePrototype) : Object.defineProperty({}, vn, { value: i });
|
|
1683
1683
|
for (let t of i.fields) {
|
|
1684
1684
|
let n = t.localName;
|
|
1685
1685
|
if (!t.opt)
|
|
@@ -1690,7 +1690,7 @@ function Bi(i) {
|
|
|
1690
1690
|
else
|
|
1691
1691
|
switch (t.kind) {
|
|
1692
1692
|
case "scalar":
|
|
1693
|
-
e[n] =
|
|
1693
|
+
e[n] = At(t.T, t.L);
|
|
1694
1694
|
break;
|
|
1695
1695
|
case "enum":
|
|
1696
1696
|
e[n] = 0;
|
|
@@ -1748,7 +1748,7 @@ function V(i, e, t) {
|
|
|
1748
1748
|
}
|
|
1749
1749
|
}
|
|
1750
1750
|
}
|
|
1751
|
-
function
|
|
1751
|
+
function Di(i, e, t) {
|
|
1752
1752
|
if (e === t)
|
|
1753
1753
|
return !0;
|
|
1754
1754
|
if (!e || !t)
|
|
@@ -1759,24 +1759,24 @@ function xi(i, e, t) {
|
|
|
1759
1759
|
case "enum":
|
|
1760
1760
|
case "scalar":
|
|
1761
1761
|
let a = n.kind == "enum" ? u.INT32 : n.T;
|
|
1762
|
-
if (!(n.repeat ?
|
|
1762
|
+
if (!(n.repeat ? an(a, s, o) : Bn(a, s, o)))
|
|
1763
1763
|
return !1;
|
|
1764
1764
|
break;
|
|
1765
1765
|
case "map":
|
|
1766
|
-
if (!(n.V.kind == "message" ?
|
|
1766
|
+
if (!(n.V.kind == "message" ? ln(n.V.T(), tt(s), tt(o)) : an(n.V.kind == "enum" ? u.INT32 : n.V.T, tt(s), tt(o))))
|
|
1767
1767
|
return !1;
|
|
1768
1768
|
break;
|
|
1769
1769
|
case "message":
|
|
1770
1770
|
let l = n.T();
|
|
1771
|
-
if (!(n.repeat ?
|
|
1771
|
+
if (!(n.repeat ? ln(l, s, o) : l.equals(s, o)))
|
|
1772
1772
|
return !1;
|
|
1773
1773
|
break;
|
|
1774
1774
|
}
|
|
1775
1775
|
}
|
|
1776
1776
|
return !0;
|
|
1777
1777
|
}
|
|
1778
|
-
const
|
|
1779
|
-
function
|
|
1778
|
+
const tt = Object.values;
|
|
1779
|
+
function Bn(i, e, t) {
|
|
1780
1780
|
if (e === t)
|
|
1781
1781
|
return !0;
|
|
1782
1782
|
if (i !== u.BYTES)
|
|
@@ -1789,15 +1789,15 @@ function In(i, e, t) {
|
|
|
1789
1789
|
return !1;
|
|
1790
1790
|
return !0;
|
|
1791
1791
|
}
|
|
1792
|
-
function
|
|
1792
|
+
function an(i, 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 (!Bn(i, e[n], t[n]))
|
|
1797
1797
|
return !1;
|
|
1798
1798
|
return !0;
|
|
1799
1799
|
}
|
|
1800
|
-
function
|
|
1800
|
+
function ln(i, 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 nn(i, e, t) {
|
|
|
1805
1805
|
return !1;
|
|
1806
1806
|
return !0;
|
|
1807
1807
|
}
|
|
1808
|
-
const
|
|
1808
|
+
const Si = Object.getOwnPropertyDescriptors(Object.getPrototypeOf({}));
|
|
1809
1809
|
class Z {
|
|
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(Ii), this.options = n ?? {}, this.messagePrototype = Object.create(null, Object.assign(Object.assign({}, Si), { [vn]: { value: this } })), this.refTypeCheck = new vi(this), this.refJsonReader = new Bi(this), this.refJsonWriter = new xi(this), this.refBinReader = new _i(this), this.refBinWriter = new Oi(this);
|
|
1812
1812
|
}
|
|
1813
1813
|
create(e) {
|
|
1814
|
-
let t =
|
|
1814
|
+
let t = Ui(this);
|
|
1815
1815
|
return e !== void 0 && V(this, t, e), t;
|
|
1816
1816
|
}
|
|
1817
1817
|
/**
|
|
@@ -1830,7 +1830,7 @@ class Z {
|
|
|
1830
1830
|
* Will also return true if both messages are `undefined`.
|
|
1831
1831
|
*/
|
|
1832
1832
|
equals(e, t) {
|
|
1833
|
-
return
|
|
1833
|
+
return Di(this, e, t);
|
|
1834
1834
|
}
|
|
1835
1835
|
/**
|
|
1836
1836
|
* Is the given value assignable to our message type
|
|
@@ -1856,14 +1856,14 @@ class Z {
|
|
|
1856
1856
|
* Create a new message from binary format.
|
|
1857
1857
|
*/
|
|
1858
1858
|
fromBinary(e, t) {
|
|
1859
|
-
let n =
|
|
1859
|
+
let n = mi(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, Fi(t));
|
|
1867
1867
|
}
|
|
1868
1868
|
/**
|
|
1869
1869
|
* Read a new message from a JSON string.
|
|
@@ -1877,7 +1877,7 @@ class Z {
|
|
|
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, Li(t));
|
|
1881
1881
|
}
|
|
1882
1882
|
/**
|
|
1883
1883
|
* Convert the message to canonical JSON string.
|
|
@@ -1892,7 +1892,7 @@ class Z {
|
|
|
1892
1892
|
* Write the message to binary format.
|
|
1893
1893
|
*/
|
|
1894
1894
|
toBinary(e, t) {
|
|
1895
|
-
let n =
|
|
1895
|
+
let n = ki(t);
|
|
1896
1896
|
return this.internalBinaryWrite(e, n.writerFactory(), n).finish();
|
|
1897
1897
|
}
|
|
1898
1898
|
/**
|
|
@@ -1908,7 +1908,7 @@ class Z {
|
|
|
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 ${kn(e)}.`);
|
|
1912
1912
|
}
|
|
1913
1913
|
/**
|
|
1914
1914
|
* This is an internal method. If you just want to write a message
|
|
@@ -1942,17 +1942,17 @@ class Z {
|
|
|
1942
1942
|
return this.refBinReader.read(e, s, n, t), s;
|
|
1943
1943
|
}
|
|
1944
1944
|
}
|
|
1945
|
-
function
|
|
1945
|
+
function Ri(i, e) {
|
|
1946
1946
|
var t, n, r;
|
|
1947
1947
|
let s = i;
|
|
1948
|
-
return s.service = e, s.localName = (t = s.localName) !== null && t !== void 0 ? t :
|
|
1948
|
+
return s.service = e, s.localName = (t = s.localName) !== null && t !== void 0 ? t : Lt(s.name), s.serverStreaming = !!s.serverStreaming, s.clientStreaming = !!s.clientStreaming, s.options = (n = s.options) !== null && n !== void 0 ? n : {}, s.idempotency = (r = s.idempotency) !== null && r !== void 0 ? r : void 0, s;
|
|
1949
1949
|
}
|
|
1950
|
-
class
|
|
1950
|
+
class Bt {
|
|
1951
1951
|
constructor(e, t, n) {
|
|
1952
|
-
this.typeName = e, this.methods = t.map((r) =>
|
|
1952
|
+
this.typeName = e, this.methods = t.map((r) => Ri(r, this)), this.options = n ?? {};
|
|
1953
1953
|
}
|
|
1954
1954
|
}
|
|
1955
|
-
class
|
|
1955
|
+
class T extends Error {
|
|
1956
1956
|
constructor(e, t = "UNKNOWN", n) {
|
|
1957
1957
|
super(e), this.name = "RpcError", Object.setPrototypeOf(this, new.target.prototype), this.code = t, this.meta = n ?? {};
|
|
1958
1958
|
}
|
|
@@ -1969,22 +1969,22 @@ class I extends Error {
|
|
|
1969
1969
|
`);
|
|
1970
1970
|
}
|
|
1971
1971
|
}
|
|
1972
|
-
function
|
|
1972
|
+
function Mi(i, e) {
|
|
1973
1973
|
if (!e)
|
|
1974
1974
|
return i;
|
|
1975
1975
|
let t = {};
|
|
1976
|
-
|
|
1976
|
+
nt(i, t), nt(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 = Ai(i.jsonOptions, t.jsonOptions);
|
|
1982
1982
|
break;
|
|
1983
1983
|
case "binaryOptions":
|
|
1984
|
-
t.binaryOptions =
|
|
1984
|
+
t.binaryOptions = hi(i.binaryOptions, t.binaryOptions);
|
|
1985
1985
|
break;
|
|
1986
1986
|
case "meta":
|
|
1987
|
-
t.meta = {},
|
|
1987
|
+
t.meta = {}, nt(i.meta, t.meta), nt(e.meta, t.meta);
|
|
1988
1988
|
break;
|
|
1989
1989
|
case "interceptors":
|
|
1990
1990
|
t.interceptors = i.interceptors ? i.interceptors.concat(r) : r.concat();
|
|
@@ -1993,18 +1993,18 @@ function Di(i, e) {
|
|
|
1993
1993
|
}
|
|
1994
1994
|
return t;
|
|
1995
1995
|
}
|
|
1996
|
-
function
|
|
1996
|
+
function nt(i, e) {
|
|
1997
1997
|
if (!i)
|
|
1998
1998
|
return;
|
|
1999
1999
|
let t = e;
|
|
2000
2000
|
for (let [n, r] of Object.entries(i))
|
|
2001
2001
|
r instanceof Date ? t[n] = new Date(r.getTime()) : Array.isArray(r) ? t[n] = r.concat() : t[n] = r;
|
|
2002
2002
|
}
|
|
2003
|
-
var
|
|
2003
|
+
var Y;
|
|
2004
2004
|
(function(i) {
|
|
2005
2005
|
i[i.PENDING = 0] = "PENDING", i[i.REJECTED = 1] = "REJECTED", i[i.RESOLVED = 2] = "RESOLVED";
|
|
2006
|
-
})(
|
|
2007
|
-
class
|
|
2006
|
+
})(Y || (Y = {}));
|
|
2007
|
+
class Ee {
|
|
2008
2008
|
/**
|
|
2009
2009
|
* @param preventUnhandledRejectionWarning - prevents the warning
|
|
2010
2010
|
* "Unhandled Promise rejection" by adding a noop rejection handler.
|
|
@@ -2018,7 +2018,7 @@ class we {
|
|
|
2018
2018
|
* others.
|
|
2019
2019
|
*/
|
|
2020
2020
|
constructor(e = !0) {
|
|
2021
|
-
this._state =
|
|
2021
|
+
this._state = Y.PENDING, this._promise = new Promise((t, n) => {
|
|
2022
2022
|
this._resolve = t, this._reject = n;
|
|
2023
2023
|
}), e && this._promise.catch((t) => {
|
|
2024
2024
|
});
|
|
@@ -2039,32 +2039,32 @@ class we {
|
|
|
2039
2039
|
* Resolve the promise. Throws if the promise is already resolved or rejected.
|
|
2040
2040
|
*/
|
|
2041
2041
|
resolve(e) {
|
|
2042
|
-
if (this.state !==
|
|
2043
|
-
throw new Error(`cannot resolve ${
|
|
2044
|
-
this._resolve(e), this._state =
|
|
2042
|
+
if (this.state !== Y.PENDING)
|
|
2043
|
+
throw new Error(`cannot resolve ${Y[this.state].toLowerCase()}`);
|
|
2044
|
+
this._resolve(e), this._state = Y.RESOLVED;
|
|
2045
2045
|
}
|
|
2046
2046
|
/**
|
|
2047
2047
|
* Reject the promise. Throws if the promise is already resolved or rejected.
|
|
2048
2048
|
*/
|
|
2049
2049
|
reject(e) {
|
|
2050
|
-
if (this.state !==
|
|
2051
|
-
throw new Error(`cannot reject ${
|
|
2052
|
-
this._reject(e), this._state =
|
|
2050
|
+
if (this.state !== Y.PENDING)
|
|
2051
|
+
throw new Error(`cannot reject ${Y[this.state].toLowerCase()}`);
|
|
2052
|
+
this._reject(e), this._state = Y.REJECTED;
|
|
2053
2053
|
}
|
|
2054
2054
|
/**
|
|
2055
2055
|
* Resolve the promise. Ignore if not pending.
|
|
2056
2056
|
*/
|
|
2057
2057
|
resolvePending(e) {
|
|
2058
|
-
this._state ===
|
|
2058
|
+
this._state === Y.PENDING && this.resolve(e);
|
|
2059
2059
|
}
|
|
2060
2060
|
/**
|
|
2061
2061
|
* Reject the promise. Ignore if not pending.
|
|
2062
2062
|
*/
|
|
2063
2063
|
rejectPending(e) {
|
|
2064
|
-
this._state ===
|
|
2064
|
+
this._state === Y.PENDING && this.reject(e);
|
|
2065
2065
|
}
|
|
2066
2066
|
}
|
|
2067
|
-
class
|
|
2067
|
+
class Vi {
|
|
2068
2068
|
constructor() {
|
|
2069
2069
|
this._lis = {
|
|
2070
2070
|
nxt: [],
|
|
@@ -2110,7 +2110,7 @@ class Si {
|
|
|
2110
2110
|
* Can be used to wrap a stream by using the other stream's `onNext`.
|
|
2111
2111
|
*/
|
|
2112
2112
|
notifyNext(e, t, n) {
|
|
2113
|
-
|
|
2113
|
+
k((e ? 1 : 0) + (t ? 1 : 0) + (n ? 1 : 0) <= 1, "only one emission at a time"), e && this.notifyMessage(e), t && this.notifyError(t), n && this.notifyComplete();
|
|
2114
2114
|
}
|
|
2115
2115
|
/**
|
|
2116
2116
|
* Emits a new message. Throws if stream is closed.
|
|
@@ -2118,7 +2118,7 @@ class Si {
|
|
|
2118
2118
|
* Triggers onNext and onMessage callbacks.
|
|
2119
2119
|
*/
|
|
2120
2120
|
notifyMessage(e) {
|
|
2121
|
-
|
|
2121
|
+
k(!this.closed, "stream is closed"), this.pushIt({ value: e, done: !1 }), this._lis.msg.forEach((t) => t(e)), this._lis.nxt.forEach((t) => t(e, void 0, !1));
|
|
2122
2122
|
}
|
|
2123
2123
|
/**
|
|
2124
2124
|
* Closes the stream with an error. Throws if stream is closed.
|
|
@@ -2126,7 +2126,7 @@ class Si {
|
|
|
2126
2126
|
* Triggers onNext and onError callbacks.
|
|
2127
2127
|
*/
|
|
2128
2128
|
notifyError(e) {
|
|
2129
|
-
|
|
2129
|
+
k(!this.closed, "stream is closed"), this._closed = e, this.pushIt(e), this._lis.err.forEach((t) => t(e)), this._lis.nxt.forEach((t) => t(void 0, e, !1)), this.clearLis();
|
|
2130
2130
|
}
|
|
2131
2131
|
/**
|
|
2132
2132
|
* Closes the stream successfully. Throws if stream is closed.
|
|
@@ -2134,7 +2134,7 @@ class Si {
|
|
|
2134
2134
|
* Triggers onNext and onComplete callbacks.
|
|
2135
2135
|
*/
|
|
2136
2136
|
notifyComplete() {
|
|
2137
|
-
|
|
2137
|
+
k(!this.closed, "stream is closed"), this._closed = !0, this.pushIt({ value: null, done: !0 }), this._lis.cmp.forEach((e) => e()), this._lis.nxt.forEach((e) => e(void 0, void 0, !0)), this.clearLis();
|
|
2138
2138
|
}
|
|
2139
2139
|
/**
|
|
2140
2140
|
* Creates an async iterator (that can be used with `for await {...}`)
|
|
@@ -2153,9 +2153,9 @@ class Si {
|
|
|
2153
2153
|
return this._itState || (this._itState = { q: [] }), this._closed === !0 ? this.pushIt({ value: null, done: !0 }) : this._closed !== !1 && this.pushIt(this._closed), {
|
|
2154
2154
|
next: () => {
|
|
2155
2155
|
let e = this._itState;
|
|
2156
|
-
|
|
2156
|
+
k(e, "bad state"), k(!e.p, "iterator contract broken");
|
|
2157
2157
|
let t = e.q.shift();
|
|
2158
|
-
return t ? "value" in t ? Promise.resolve(t) : Promise.reject(t) : (e.p = new
|
|
2158
|
+
return t ? "value" in t ? Promise.resolve(t) : Promise.reject(t) : (e.p = new Ee(), e.p.promise);
|
|
2159
2159
|
}
|
|
2160
2160
|
};
|
|
2161
2161
|
}
|
|
@@ -2166,12 +2166,12 @@ class Si {
|
|
|
2166
2166
|
if (t)
|
|
2167
2167
|
if (t.p) {
|
|
2168
2168
|
const n = t.p;
|
|
2169
|
-
|
|
2169
|
+
k(n.state == Y.PENDING, "iterator contract broken"), "value" in e ? n.resolve(e) : n.reject(e), delete t.p;
|
|
2170
2170
|
} else
|
|
2171
2171
|
t.q.push(e);
|
|
2172
2172
|
}
|
|
2173
2173
|
}
|
|
2174
|
-
var
|
|
2174
|
+
var Hi = function(i, e, t, n) {
|
|
2175
2175
|
function r(s) {
|
|
2176
2176
|
return s instanceof t ? s : new t(function(o) {
|
|
2177
2177
|
o(s);
|
|
@@ -2198,7 +2198,7 @@ var Ui = function(i, e, t, n) {
|
|
|
2198
2198
|
c((n = n.apply(i, e || [])).next());
|
|
2199
2199
|
});
|
|
2200
2200
|
};
|
|
2201
|
-
class
|
|
2201
|
+
class $i {
|
|
2202
2202
|
constructor(e, t, n, r, s, o, a) {
|
|
2203
2203
|
this.method = e, this.requestHeaders = t, this.request = n, this.headers = r, this.response = s, this.status = o, this.trailers = a;
|
|
2204
2204
|
}
|
|
@@ -2210,7 +2210,7 @@ class Ri {
|
|
|
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 Hi(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 Ri {
|
|
|
2224
2224
|
});
|
|
2225
2225
|
}
|
|
2226
2226
|
}
|
|
2227
|
-
var
|
|
2227
|
+
var Wi = function(i, e, t, n) {
|
|
2228
2228
|
function r(s) {
|
|
2229
2229
|
return s instanceof t ? s : new t(function(o) {
|
|
2230
2230
|
o(s);
|
|
@@ -2251,7 +2251,7 @@ var Mi = function(i, e, t, n) {
|
|
|
2251
2251
|
c((n = n.apply(i, e || [])).next());
|
|
2252
2252
|
});
|
|
2253
2253
|
};
|
|
2254
|
-
class
|
|
2254
|
+
class ji {
|
|
2255
2255
|
constructor(e, t, n, r, s, o, a) {
|
|
2256
2256
|
this.method = e, this.requestHeaders = t, this.request = n, this.headers = r, this.responses = s, this.status = o, this.trailers = a;
|
|
2257
2257
|
}
|
|
@@ -2265,7 +2265,7 @@ class Vi {
|
|
|
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 Wi(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,
|
|
@@ -2278,7 +2278,7 @@ class Vi {
|
|
|
2278
2278
|
});
|
|
2279
2279
|
}
|
|
2280
2280
|
}
|
|
2281
|
-
function
|
|
2281
|
+
function ie(i, e, t, n, r) {
|
|
2282
2282
|
var s;
|
|
2283
2283
|
{
|
|
2284
2284
|
let o = (a, l, c) => e.unary(a, l, c);
|
|
@@ -2293,7 +2293,7 @@ var f;
|
|
|
2293
2293
|
(function(i) {
|
|
2294
2294
|
i[i.OK = 0] = "OK", i[i.CANCELLED = 1] = "CANCELLED", i[i.UNKNOWN = 2] = "UNKNOWN", i[i.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT", i[i.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED", i[i.NOT_FOUND = 5] = "NOT_FOUND", i[i.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", i[i.PERMISSION_DENIED = 7] = "PERMISSION_DENIED", i[i.UNAUTHENTICATED = 16] = "UNAUTHENTICATED", i[i.RESOURCE_EXHAUSTED = 8] = "RESOURCE_EXHAUSTED", i[i.FAILED_PRECONDITION = 9] = "FAILED_PRECONDITION", i[i.ABORTED = 10] = "ABORTED", i[i.OUT_OF_RANGE = 11] = "OUT_OF_RANGE", i[i.UNIMPLEMENTED = 12] = "UNIMPLEMENTED", i[i.INTERNAL = 13] = "INTERNAL", i[i.UNAVAILABLE = 14] = "UNAVAILABLE", i[i.DATA_LOSS = 15] = "DATA_LOSS";
|
|
2295
2295
|
})(f || (f = {}));
|
|
2296
|
-
var
|
|
2296
|
+
var Zi = function(i, e, t, n) {
|
|
2297
2297
|
function r(s) {
|
|
2298
2298
|
return s instanceof t ? s : new t(function(o) {
|
|
2299
2299
|
o(s);
|
|
@@ -2320,7 +2320,7 @@ var Hi = function(i, e, t, n) {
|
|
|
2320
2320
|
c((n = n.apply(i, e || [])).next());
|
|
2321
2321
|
});
|
|
2322
2322
|
};
|
|
2323
|
-
function
|
|
2323
|
+
function cn(i, e, t, n, r) {
|
|
2324
2324
|
if (n)
|
|
2325
2325
|
for (let [s, o] of Object.entries(n))
|
|
2326
2326
|
if (typeof o == "string")
|
|
@@ -2330,24 +2330,24 @@ function rn(i, e, t, n, r) {
|
|
|
2330
2330
|
i.append(s, a);
|
|
2331
2331
|
if (i.set("Content-Type", e === "text" ? "application/grpc-web-text" : "application/grpc-web+proto"), e == "text" && i.set("Accept", "application/grpc-web-text"), i.set("X-Grpc-Web", "1"), typeof t == "number") {
|
|
2332
2332
|
if (t <= 0)
|
|
2333
|
-
throw new
|
|
2333
|
+
throw new T(`timeout ${t} ms exceeded`, f[f.DEADLINE_EXCEEDED]);
|
|
2334
2334
|
i.set("grpc-timeout", `${t}m`);
|
|
2335
2335
|
} else if (t) {
|
|
2336
2336
|
const s = t.getTime(), o = Date.now();
|
|
2337
2337
|
if (s <= o)
|
|
2338
|
-
throw new
|
|
2338
|
+
throw new T(`deadline ${t} exceeded`, f[f.DEADLINE_EXCEEDED]);
|
|
2339
2339
|
i.set("grpc-timeout", `${s - o}m`);
|
|
2340
2340
|
}
|
|
2341
2341
|
return i;
|
|
2342
2342
|
}
|
|
2343
|
-
function
|
|
2343
|
+
function dn(i, e) {
|
|
2344
2344
|
let t = new Uint8Array(5 + i.length);
|
|
2345
|
-
t[0] =
|
|
2345
|
+
t[0] = se.DATA;
|
|
2346
2346
|
for (let n = i.length, r = 4; r > 0; r--)
|
|
2347
2347
|
t[r] = n % 256, n >>>= 8;
|
|
2348
|
-
return t.set(i, 5), e === "binary" ? t :
|
|
2348
|
+
return t.set(i, 5), e === "binary" ? t : Fn(t);
|
|
2349
2349
|
}
|
|
2350
|
-
function
|
|
2350
|
+
function It(i, e, t) {
|
|
2351
2351
|
if (arguments.length === 1) {
|
|
2352
2352
|
let l = i, c;
|
|
2353
2353
|
try {
|
|
@@ -2358,25 +2358,25 @@ function Et(i, e, t) {
|
|
|
2358
2358
|
case "error":
|
|
2359
2359
|
case "opaque":
|
|
2360
2360
|
case "opaqueredirect":
|
|
2361
|
-
throw new
|
|
2361
|
+
throw new T(`fetch response type ${l.type}`, f[f.UNKNOWN]);
|
|
2362
2362
|
}
|
|
2363
|
-
return
|
|
2363
|
+
return It(Xi(l.headers), l.status, l.statusText);
|
|
2364
2364
|
}
|
|
2365
|
-
let n = i, r = e >= 200 && e < 300, s =
|
|
2366
|
-
return (o === void 0 || o === f.OK) && !r && (o =
|
|
2365
|
+
let n = i, r = e >= 200 && e < 300, s = _n(n), [o, a] = xn(n);
|
|
2366
|
+
return (o === void 0 || o === f.OK) && !r && (o = zi(e), a = t), [o, a, s];
|
|
2367
2367
|
}
|
|
2368
|
-
function
|
|
2369
|
-
let e =
|
|
2368
|
+
function hn(i) {
|
|
2369
|
+
let e = Ki(i), [t, n] = xn(e), r = _n(e);
|
|
2370
2370
|
return [t ?? f.OK, n, r];
|
|
2371
2371
|
}
|
|
2372
|
-
var
|
|
2372
|
+
var se;
|
|
2373
2373
|
(function(i) {
|
|
2374
2374
|
i[i.DATA = 0] = "DATA", i[i.TRAILER = 128] = "TRAILER";
|
|
2375
|
-
})(
|
|
2376
|
-
function
|
|
2377
|
-
return
|
|
2378
|
-
let n, r = "", s = new Uint8Array(0), o =
|
|
2379
|
-
if (
|
|
2375
|
+
})(se || (se = {}));
|
|
2376
|
+
function un(i, e, t) {
|
|
2377
|
+
return Zi(this, void 0, void 0, function* () {
|
|
2378
|
+
let n, r = "", s = new Uint8Array(0), o = Pi(e);
|
|
2379
|
+
if (qi(i)) {
|
|
2380
2380
|
let a = i.getReader();
|
|
2381
2381
|
n = {
|
|
2382
2382
|
next: () => a.read()
|
|
@@ -2392,15 +2392,15 @@ function an(i, e, t) {
|
|
|
2392
2392
|
let l = r.length - r.length % 4;
|
|
2393
2393
|
if (l === 0)
|
|
2394
2394
|
continue;
|
|
2395
|
-
s =
|
|
2395
|
+
s = pn(s, Nn(r.substring(0, l))), r = r.substring(l);
|
|
2396
2396
|
} else
|
|
2397
|
-
s =
|
|
2398
|
-
for (; s.length >= 5 && s[0] ===
|
|
2397
|
+
s = pn(s, a.value);
|
|
2398
|
+
for (; s.length >= 5 && s[0] === se.DATA; ) {
|
|
2399
2399
|
let l = 0;
|
|
2400
2400
|
for (let c = 1; c < 5; c++)
|
|
2401
2401
|
l = (l << 8) + s[c];
|
|
2402
2402
|
if (s.length - 5 >= l)
|
|
2403
|
-
t(
|
|
2403
|
+
t(se.DATA, s.subarray(5, 5 + l)), s = s.subarray(5 + l);
|
|
2404
2404
|
else
|
|
2405
2405
|
break;
|
|
2406
2406
|
}
|
|
@@ -2408,20 +2408,20 @@ function an(i, e, t) {
|
|
|
2408
2408
|
if (a.done) {
|
|
2409
2409
|
if (s.length === 0)
|
|
2410
2410
|
break;
|
|
2411
|
-
if (s[0] !==
|
|
2412
|
-
throw new
|
|
2413
|
-
t(
|
|
2411
|
+
if (s[0] !== se.TRAILER || s.length < 5)
|
|
2412
|
+
throw new T("premature EOF", f[f.DATA_LOSS]);
|
|
2413
|
+
t(se.TRAILER, s.subarray(5));
|
|
2414
2414
|
break;
|
|
2415
2415
|
}
|
|
2416
2416
|
}
|
|
2417
2417
|
});
|
|
2418
2418
|
}
|
|
2419
|
-
const
|
|
2420
|
-
function
|
|
2419
|
+
const qi = (i) => typeof i.getReader == "function";
|
|
2420
|
+
function pn(i, e) {
|
|
2421
2421
|
let t = new Uint8Array(i.length + e.length);
|
|
2422
2422
|
return t.set(i), t.set(e, i.length), t;
|
|
2423
2423
|
}
|
|
2424
|
-
function
|
|
2424
|
+
function Pi(i) {
|
|
2425
2425
|
switch (i) {
|
|
2426
2426
|
case "application/grpc-web-text":
|
|
2427
2427
|
case "application/grpc-web-text+proto":
|
|
@@ -2431,12 +2431,12 @@ function Wi(i) {
|
|
|
2431
2431
|
return "binary";
|
|
2432
2432
|
case void 0:
|
|
2433
2433
|
case null:
|
|
2434
|
-
throw new
|
|
2434
|
+
throw new T("missing response content type", f[f.INTERNAL]);
|
|
2435
2435
|
default:
|
|
2436
|
-
throw new
|
|
2436
|
+
throw new T("unexpected response content type: " + i, f[f.INTERNAL]);
|
|
2437
2437
|
}
|
|
2438
2438
|
}
|
|
2439
|
-
function
|
|
2439
|
+
function xn(i) {
|
|
2440
2440
|
let e, t, n = i["grpc-message"];
|
|
2441
2441
|
if (n !== void 0) {
|
|
2442
2442
|
if (Array.isArray(n))
|
|
@@ -2452,7 +2452,7 @@ function vn(i) {
|
|
|
2452
2452
|
}
|
|
2453
2453
|
return [e, t];
|
|
2454
2454
|
}
|
|
2455
|
-
function
|
|
2455
|
+
function _n(i) {
|
|
2456
2456
|
let e = {};
|
|
2457
2457
|
for (let [t, n] of Object.entries(i))
|
|
2458
2458
|
switch (t) {
|
|
@@ -2465,7 +2465,7 @@ function Tn(i) {
|
|
|
2465
2465
|
}
|
|
2466
2466
|
return e;
|
|
2467
2467
|
}
|
|
2468
|
-
function
|
|
2468
|
+
function Ki(i) {
|
|
2469
2469
|
let e = {};
|
|
2470
2470
|
for (let t of String.fromCharCode.apply(String, i).trim().split(`\r
|
|
2471
2471
|
`)) {
|
|
@@ -2479,14 +2479,14 @@ function ji(i) {
|
|
|
2479
2479
|
}
|
|
2480
2480
|
return e;
|
|
2481
2481
|
}
|
|
2482
|
-
function
|
|
2482
|
+
function Xi(i) {
|
|
2483
2483
|
let e = {};
|
|
2484
2484
|
return i.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 zi(i) {
|
|
2490
2490
|
switch (i) {
|
|
2491
2491
|
case 200:
|
|
2492
2492
|
return f.OK;
|
|
@@ -2518,12 +2518,12 @@ function qi(i) {
|
|
|
2518
2518
|
return f.UNKNOWN;
|
|
2519
2519
|
}
|
|
2520
2520
|
}
|
|
2521
|
-
class
|
|
2521
|
+
class Gi {
|
|
2522
2522
|
constructor(e) {
|
|
2523
2523
|
this.defaultOptions = e;
|
|
2524
2524
|
}
|
|
2525
2525
|
mergeOptions(e) {
|
|
2526
|
-
return
|
|
2526
|
+
return Mi(this.defaultOptions, e);
|
|
2527
2527
|
}
|
|
2528
2528
|
/**
|
|
2529
2529
|
* Create an URI for a gRPC web call.
|
|
@@ -2546,116 +2546,116 @@ class Pi {
|
|
|
2546
2546
|
return n.endsWith("/") && (n = n.substring(0, n.length - 1)), `${n}/${e.service.typeName}/${e.name}`;
|
|
2547
2547
|
}
|
|
2548
2548
|
clientStreaming(e) {
|
|
2549
|
-
const t = new
|
|
2549
|
+
const t = new T("Client streaming is not supported by grpc-web", f[f.UNIMPLEMENTED]);
|
|
2550
2550
|
throw t.methodName = e.name, t.serviceName = e.service.typeName, t;
|
|
2551
2551
|
}
|
|
2552
2552
|
duplex(e) {
|
|
2553
|
-
const t = new
|
|
2553
|
+
const t = new T("Duplex streaming is not supported by grpc-web", f[f.UNIMPLEMENTED]);
|
|
2554
2554
|
throw t.methodName = e.name, t.serviceName = e.service.typeName, t;
|
|
2555
2555
|
}
|
|
2556
2556
|
serverStreaming(e, t, n) {
|
|
2557
2557
|
var r, s, o, a;
|
|
2558
|
-
let l = n, c = (r = l.format) !== null && r !== void 0 ? r : "text", h = (s = l.fetchInit) !== null && s !== void 0 ? s : {}, g = this.makeUrl(e, l), w = e.I.toBinary(t, l.binaryOptions),
|
|
2558
|
+
let l = n, c = (r = l.format) !== null && r !== void 0 ? r : "text", h = (s = l.fetchInit) !== null && s !== void 0 ? s : {}, g = this.makeUrl(e, l), w = e.I.toBinary(t, l.binaryOptions), L = new Ee(), B = new Vi(), $ = !0, A, W = new Ee(), q, Q = new Ee();
|
|
2559
2559
|
return globalThis.fetch(g, Object.assign(Object.assign({}, h), {
|
|
2560
2560
|
method: "POST",
|
|
2561
|
-
headers:
|
|
2562
|
-
body:
|
|
2561
|
+
headers: cn(new globalThis.Headers(), c, l.timeout, l.meta),
|
|
2562
|
+
body: dn(w, c),
|
|
2563
2563
|
signal: (o = n.abort) !== null && o !== void 0 ? o : null
|
|
2564
2564
|
// node-fetch@3.0.0-beta.9 rejects `undefined`
|
|
2565
|
-
})).then((
|
|
2566
|
-
let [b,
|
|
2567
|
-
if (
|
|
2568
|
-
throw new
|
|
2569
|
-
return b != null && (
|
|
2565
|
+
})).then((E) => {
|
|
2566
|
+
let [b, U, K] = It(E);
|
|
2567
|
+
if (L.resolve(K), b != null && b !== f.OK)
|
|
2568
|
+
throw new T(U ?? f[b], f[b], K);
|
|
2569
|
+
return b != null && (A = {
|
|
2570
2570
|
code: f[b],
|
|
2571
|
-
detail:
|
|
2572
|
-
}),
|
|
2573
|
-
}).then((
|
|
2574
|
-
if (!
|
|
2575
|
-
throw new
|
|
2576
|
-
return
|
|
2571
|
+
detail: U ?? f[b]
|
|
2572
|
+
}), E;
|
|
2573
|
+
}).then((E) => {
|
|
2574
|
+
if (!E.body)
|
|
2575
|
+
throw new T("missing response body", f[f.INTERNAL]);
|
|
2576
|
+
return un(E.body, E.headers.get("content-type"), (b, U) => {
|
|
2577
2577
|
switch (b) {
|
|
2578
|
-
case
|
|
2579
|
-
B.notifyMessage(e.O.fromBinary(
|
|
2578
|
+
case se.DATA:
|
|
2579
|
+
B.notifyMessage(e.O.fromBinary(U, l.binaryOptions)), $ = !1;
|
|
2580
2580
|
break;
|
|
2581
|
-
case
|
|
2582
|
-
let
|
|
2583
|
-
[
|
|
2584
|
-
code: f[
|
|
2585
|
-
detail:
|
|
2581
|
+
case se.TRAILER:
|
|
2582
|
+
let K, ee;
|
|
2583
|
+
[K, ee, q] = hn(U), A = {
|
|
2584
|
+
code: f[K],
|
|
2585
|
+
detail: ee ?? f[K]
|
|
2586
2586
|
};
|
|
2587
2587
|
break;
|
|
2588
2588
|
}
|
|
2589
2589
|
});
|
|
2590
2590
|
}).then(() => {
|
|
2591
|
-
if (!
|
|
2592
|
-
throw new
|
|
2593
|
-
if (!
|
|
2594
|
-
throw new
|
|
2595
|
-
if (
|
|
2596
|
-
throw new
|
|
2597
|
-
B.notifyComplete(),
|
|
2598
|
-
}).catch((
|
|
2591
|
+
if (!q && !$)
|
|
2592
|
+
throw new T("missing trailers", f[f.DATA_LOSS]);
|
|
2593
|
+
if (!A)
|
|
2594
|
+
throw new T("missing status", f[f.INTERNAL]);
|
|
2595
|
+
if (A.code !== "OK")
|
|
2596
|
+
throw new T(A.detail, A.code, q);
|
|
2597
|
+
B.notifyComplete(), W.resolve(A), Q.resolve(q || {});
|
|
2598
|
+
}).catch((E) => {
|
|
2599
2599
|
let b;
|
|
2600
|
-
|
|
2601
|
-
}), new
|
|
2600
|
+
E instanceof T ? b = E : E instanceof Error && E.name === "AbortError" ? b = new T(E.message, f[f.CANCELLED]) : b = new T(E instanceof Error ? E.message : "" + E, f[f.INTERNAL]), b.methodName = e.name, b.serviceName = e.service.typeName, L.rejectPending(b), B.notifyError(b), W.rejectPending(b), Q.rejectPending(b);
|
|
2601
|
+
}), new ji(e, (a = l.meta) !== null && a !== void 0 ? a : {}, t, L.promise, B, W.promise, Q.promise);
|
|
2602
2602
|
}
|
|
2603
2603
|
unary(e, t, n) {
|
|
2604
2604
|
var r, s, o, a;
|
|
2605
|
-
let l = n, c = (r = l.format) !== null && r !== void 0 ? r : "text", h = (s = l.fetchInit) !== null && s !== void 0 ? s : {}, g = this.makeUrl(e, l), w = e.I.toBinary(t, l.binaryOptions),
|
|
2605
|
+
let l = n, c = (r = l.format) !== null && r !== void 0 ? r : "text", h = (s = l.fetchInit) !== null && s !== void 0 ? s : {}, g = this.makeUrl(e, l), w = e.I.toBinary(t, l.binaryOptions), L = new Ee(), B, $ = new Ee(), A, W = new Ee(), q, Q = new Ee();
|
|
2606
2606
|
return globalThis.fetch(g, Object.assign(Object.assign({}, h), {
|
|
2607
2607
|
method: "POST",
|
|
2608
|
-
headers:
|
|
2609
|
-
body:
|
|
2608
|
+
headers: cn(new globalThis.Headers(), c, l.timeout, l.meta),
|
|
2609
|
+
body: dn(w, c),
|
|
2610
2610
|
signal: (o = n.abort) !== null && o !== void 0 ? o : null
|
|
2611
2611
|
// node-fetch@3.0.0-beta.9 rejects `undefined`
|
|
2612
|
-
})).then((
|
|
2613
|
-
let [b,
|
|
2614
|
-
if (
|
|
2615
|
-
throw new
|
|
2616
|
-
return b != null && (
|
|
2612
|
+
})).then((E) => {
|
|
2613
|
+
let [b, U, K] = It(E);
|
|
2614
|
+
if (L.resolve(K), b != null && b !== f.OK)
|
|
2615
|
+
throw new T(U ?? f[b], f[b], K);
|
|
2616
|
+
return b != null && (A = {
|
|
2617
2617
|
code: f[b],
|
|
2618
|
-
detail:
|
|
2619
|
-
}),
|
|
2620
|
-
}).then((
|
|
2621
|
-
if (!
|
|
2622
|
-
throw new
|
|
2623
|
-
return
|
|
2618
|
+
detail: U ?? f[b]
|
|
2619
|
+
}), E;
|
|
2620
|
+
}).then((E) => {
|
|
2621
|
+
if (!E.body)
|
|
2622
|
+
throw new T("missing response body", f[f.INTERNAL]);
|
|
2623
|
+
return un(E.body, E.headers.get("content-type"), (b, U) => {
|
|
2624
2624
|
switch (b) {
|
|
2625
|
-
case
|
|
2625
|
+
case se.DATA:
|
|
2626
2626
|
if (B)
|
|
2627
|
-
throw new
|
|
2628
|
-
B = e.O.fromBinary(
|
|
2627
|
+
throw new T("unary call received 2nd message", f[f.DATA_LOSS]);
|
|
2628
|
+
B = e.O.fromBinary(U, l.binaryOptions);
|
|
2629
2629
|
break;
|
|
2630
|
-
case
|
|
2631
|
-
let
|
|
2632
|
-
[
|
|
2633
|
-
code: f[
|
|
2634
|
-
detail:
|
|
2630
|
+
case se.TRAILER:
|
|
2631
|
+
let K, ee;
|
|
2632
|
+
[K, ee, q] = hn(U), A = {
|
|
2633
|
+
code: f[K],
|
|
2634
|
+
detail: ee ?? f[K]
|
|
2635
2635
|
};
|
|
2636
2636
|
break;
|
|
2637
2637
|
}
|
|
2638
2638
|
});
|
|
2639
2639
|
}).then(() => {
|
|
2640
|
-
if (!
|
|
2641
|
-
throw new
|
|
2642
|
-
if (!
|
|
2643
|
-
throw new
|
|
2644
|
-
if (!B &&
|
|
2645
|
-
throw new
|
|
2640
|
+
if (!q && B)
|
|
2641
|
+
throw new T("missing trailers", f[f.DATA_LOSS]);
|
|
2642
|
+
if (!A)
|
|
2643
|
+
throw new T("missing status", f[f.INTERNAL]);
|
|
2644
|
+
if (!B && A.code === "OK")
|
|
2645
|
+
throw new T("expected error status", f[f.DATA_LOSS]);
|
|
2646
2646
|
if (!B)
|
|
2647
|
-
throw new
|
|
2648
|
-
if (
|
|
2649
|
-
throw new
|
|
2650
|
-
|
|
2651
|
-
}).catch((
|
|
2647
|
+
throw new T(A.detail, A.code, q);
|
|
2648
|
+
if ($.resolve(B), A.code !== "OK")
|
|
2649
|
+
throw new T(A.detail, A.code, q);
|
|
2650
|
+
W.resolve(A), Q.resolve(q || {});
|
|
2651
|
+
}).catch((E) => {
|
|
2652
2652
|
let b;
|
|
2653
|
-
|
|
2654
|
-
}), new
|
|
2653
|
+
E instanceof T ? b = E : E instanceof Error && E.name === "AbortError" ? b = new T(E.message, f[f.CANCELLED]) : b = new T(E instanceof Error ? E.message : "" + E, f[f.INTERNAL]), b.methodName = e.name, b.serviceName = e.service.typeName, L.rejectPending(b), $.rejectPending(b), W.rejectPending(b), Q.rejectPending(b);
|
|
2654
|
+
}), new $i(e, (a = l.meta) !== null && a !== void 0 ? a : {}, t, L.promise, $.promise, W.promise, Q.promise);
|
|
2655
2655
|
}
|
|
2656
2656
|
}
|
|
2657
|
-
var
|
|
2658
|
-
class
|
|
2657
|
+
var ht = /* @__PURE__ */ ((i) => (i[i.IMAGE = 0] = "IMAGE", i[i.AUDIO = 1] = "AUDIO", i[i.VIDEO = 2] = "VIDEO", i[i.ALL = 3] = "ALL", i[i.FOLDER = 4] = "FOLDER", i))(ht || {});
|
|
2658
|
+
class Ji extends Z {
|
|
2659
2659
|
constructor() {
|
|
2660
2660
|
super("com.hamropatro.grpc.cms.SearchRequest", [
|
|
2661
2661
|
{
|
|
@@ -2718,11 +2718,11 @@ class Ki extends Z {
|
|
|
2718
2718
|
return r !== !1 && (r == !0 ? N.onWrite : r)(this.typeName, e, t), t;
|
|
2719
2719
|
}
|
|
2720
2720
|
}
|
|
2721
|
-
const
|
|
2722
|
-
class
|
|
2721
|
+
const On = new Ji();
|
|
2722
|
+
class Yi extends Z {
|
|
2723
2723
|
constructor() {
|
|
2724
2724
|
super("com.hamropatro.grpc.cms.SearchResult", [
|
|
2725
|
-
{ no: 1, name: "items", kind: "message", repeat: 1, T: () =>
|
|
2725
|
+
{ no: 1, name: "items", kind: "message", repeat: 1, T: () => oe },
|
|
2726
2726
|
{
|
|
2727
2727
|
no: 2,
|
|
2728
2728
|
name: "next_page_cursor",
|
|
@@ -2743,7 +2743,7 @@ class Xi extends Z {
|
|
|
2743
2743
|
switch (a) {
|
|
2744
2744
|
case /* repeated com.hamropatro.grpc.cms.File items */
|
|
2745
2745
|
1:
|
|
2746
|
-
s.items.push(
|
|
2746
|
+
s.items.push(oe.internalBinaryRead(e, e.uint32(), n));
|
|
2747
2747
|
break;
|
|
2748
2748
|
case /* string next_page_cursor */
|
|
2749
2749
|
2:
|
|
@@ -2761,14 +2761,14 @@ class Xi extends Z {
|
|
|
2761
2761
|
}
|
|
2762
2762
|
internalBinaryWrite(e, t, n) {
|
|
2763
2763
|
for (let s = 0; s < e.items.length; s++)
|
|
2764
|
-
|
|
2764
|
+
oe.internalBinaryWrite(e.items[s], t.tag(1, m.LengthDelimited).fork(), n).join();
|
|
2765
2765
|
e.nextPageCursor !== "" && t.tag(2, m.LengthDelimited).string(e.nextPageCursor);
|
|
2766
2766
|
let r = n.writeUnknownFields;
|
|
2767
2767
|
return r !== !1 && (r == !0 ? N.onWrite : r)(this.typeName, e, t), t;
|
|
2768
2768
|
}
|
|
2769
2769
|
}
|
|
2770
|
-
const
|
|
2771
|
-
class
|
|
2770
|
+
const Qi = new Yi();
|
|
2771
|
+
class er extends Z {
|
|
2772
2772
|
constructor() {
|
|
2773
2773
|
super("com.hamropatro.grpc.cms.CreateFileRequest", [
|
|
2774
2774
|
{
|
|
@@ -2799,12 +2799,19 @@ class Ji extends Z {
|
|
|
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", ht] },
|
|
2803
|
+
{
|
|
2804
|
+
no: 6,
|
|
2805
|
+
name: "extension",
|
|
2806
|
+
kind: "scalar",
|
|
2807
|
+
T: 9
|
|
2808
|
+
/*ScalarType.STRING*/
|
|
2809
|
+
}
|
|
2803
2810
|
]);
|
|
2804
2811
|
}
|
|
2805
2812
|
create(e) {
|
|
2806
2813
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
2807
|
-
return t.name = "", t.folderName = "", t.nestedFolderName = "", t.url = "", t.type = 0, e !== void 0 && V(this, t, e), t;
|
|
2814
|
+
return t.name = "", t.folderName = "", t.nestedFolderName = "", t.url = "", t.type = 0, t.extension = "", e !== void 0 && V(this, t, e), t;
|
|
2808
2815
|
}
|
|
2809
2816
|
internalBinaryRead(e, t, n, r) {
|
|
2810
2817
|
let s = r ?? this.create(), o = e.pos + t;
|
|
@@ -2831,6 +2838,10 @@ class Ji extends Z {
|
|
|
2831
2838
|
5:
|
|
2832
2839
|
s.type = e.int32();
|
|
2833
2840
|
break;
|
|
2841
|
+
case /* string extension */
|
|
2842
|
+
6:
|
|
2843
|
+
s.extension = e.string();
|
|
2844
|
+
break;
|
|
2834
2845
|
default:
|
|
2835
2846
|
let c = n.readUnknownField;
|
|
2836
2847
|
if (c === "throw")
|
|
@@ -2842,13 +2853,71 @@ class Ji extends Z {
|
|
|
2842
2853
|
return s;
|
|
2843
2854
|
}
|
|
2844
2855
|
internalBinaryWrite(e, t, n) {
|
|
2845
|
-
e.name !== "" && t.tag(1, m.LengthDelimited).string(e.name), e.folderName !== "" && t.tag(2, m.LengthDelimited).string(e.folderName), e.nestedFolderName !== "" && t.tag(3, m.LengthDelimited).string(e.nestedFolderName), e.url !== "" && t.tag(4, m.LengthDelimited).string(e.url), e.type !== 0 && t.tag(5, m.Varint).int32(e.type);
|
|
2856
|
+
e.name !== "" && t.tag(1, m.LengthDelimited).string(e.name), e.folderName !== "" && t.tag(2, m.LengthDelimited).string(e.folderName), e.nestedFolderName !== "" && t.tag(3, m.LengthDelimited).string(e.nestedFolderName), e.url !== "" && t.tag(4, m.LengthDelimited).string(e.url), e.type !== 0 && t.tag(5, m.Varint).int32(e.type), e.extension !== "" && t.tag(6, m.LengthDelimited).string(e.extension);
|
|
2846
2857
|
let r = n.writeUnknownFields;
|
|
2847
2858
|
return r !== !1 && (r == !0 ? N.onWrite : r)(this.typeName, e, t), t;
|
|
2848
2859
|
}
|
|
2849
2860
|
}
|
|
2850
|
-
const
|
|
2851
|
-
class
|
|
2861
|
+
const Un = new er();
|
|
2862
|
+
class tr extends Z {
|
|
2863
|
+
constructor() {
|
|
2864
|
+
super("com.hamropatro.grpc.cms.CreateUserFileRequest", [
|
|
2865
|
+
{
|
|
2866
|
+
no: 1,
|
|
2867
|
+
name: "url",
|
|
2868
|
+
kind: "scalar",
|
|
2869
|
+
T: 9
|
|
2870
|
+
/*ScalarType.STRING*/
|
|
2871
|
+
},
|
|
2872
|
+
{ no: 2, name: "type", kind: "enum", T: () => ["com.hamropatro.grpc.cms.FileType", ht] },
|
|
2873
|
+
{
|
|
2874
|
+
no: 3,
|
|
2875
|
+
name: "extension",
|
|
2876
|
+
kind: "scalar",
|
|
2877
|
+
T: 9
|
|
2878
|
+
/*ScalarType.STRING*/
|
|
2879
|
+
}
|
|
2880
|
+
]);
|
|
2881
|
+
}
|
|
2882
|
+
create(e) {
|
|
2883
|
+
const t = globalThis.Object.create(this.messagePrototype);
|
|
2884
|
+
return t.url = "", t.type = 0, t.extension = "", e !== void 0 && V(this, t, e), t;
|
|
2885
|
+
}
|
|
2886
|
+
internalBinaryRead(e, t, n, r) {
|
|
2887
|
+
let s = r ?? this.create(), o = e.pos + t;
|
|
2888
|
+
for (; e.pos < o; ) {
|
|
2889
|
+
let [a, l] = e.tag();
|
|
2890
|
+
switch (a) {
|
|
2891
|
+
case /* string url */
|
|
2892
|
+
1:
|
|
2893
|
+
s.url = e.string();
|
|
2894
|
+
break;
|
|
2895
|
+
case /* com.hamropatro.grpc.cms.FileType type */
|
|
2896
|
+
2:
|
|
2897
|
+
s.type = e.int32();
|
|
2898
|
+
break;
|
|
2899
|
+
case /* string extension */
|
|
2900
|
+
3:
|
|
2901
|
+
s.extension = e.string();
|
|
2902
|
+
break;
|
|
2903
|
+
default:
|
|
2904
|
+
let c = n.readUnknownField;
|
|
2905
|
+
if (c === "throw")
|
|
2906
|
+
throw new globalThis.Error(`Unknown field ${a} (wire type ${l}) for ${this.typeName}`);
|
|
2907
|
+
let h = e.skip(l);
|
|
2908
|
+
c !== !1 && (c === !0 ? N.onRead : c)(this.typeName, s, a, l, h);
|
|
2909
|
+
}
|
|
2910
|
+
}
|
|
2911
|
+
return s;
|
|
2912
|
+
}
|
|
2913
|
+
internalBinaryWrite(e, t, n) {
|
|
2914
|
+
e.url !== "" && t.tag(1, m.LengthDelimited).string(e.url), e.type !== 0 && t.tag(2, m.Varint).int32(e.type), e.extension !== "" && t.tag(3, m.LengthDelimited).string(e.extension);
|
|
2915
|
+
let r = n.writeUnknownFields;
|
|
2916
|
+
return r !== !1 && (r == !0 ? N.onWrite : r)(this.typeName, e, t), t;
|
|
2917
|
+
}
|
|
2918
|
+
}
|
|
2919
|
+
const Dn = new tr();
|
|
2920
|
+
class nr extends Z {
|
|
2852
2921
|
constructor() {
|
|
2853
2922
|
super("com.hamropatro.grpc.cms.File", [
|
|
2854
2923
|
{
|
|
@@ -2900,8 +2969,8 @@ class zi extends Z {
|
|
|
2900
2969
|
T: 9
|
|
2901
2970
|
/*ScalarType.STRING*/
|
|
2902
2971
|
},
|
|
2903
|
-
{ no: 8, name: "type", kind: "enum", T: () => ["com.hamropatro.grpc.cms.FileType",
|
|
2904
|
-
{ no: 9, name: "metadata", kind: "message", T: () =>
|
|
2972
|
+
{ no: 8, name: "type", kind: "enum", T: () => ["com.hamropatro.grpc.cms.FileType", ht] },
|
|
2973
|
+
{ no: 9, name: "metadata", kind: "message", T: () => wt }
|
|
2905
2974
|
]);
|
|
2906
2975
|
}
|
|
2907
2976
|
create(e) {
|
|
@@ -2947,7 +3016,7 @@ class zi extends Z {
|
|
|
2947
3016
|
break;
|
|
2948
3017
|
case /* com.hamropatro.grpc.cms.FileMetadata metadata */
|
|
2949
3018
|
9:
|
|
2950
|
-
s.metadata =
|
|
3019
|
+
s.metadata = wt.internalBinaryRead(e, e.uint32(), n, s.metadata);
|
|
2951
3020
|
break;
|
|
2952
3021
|
default:
|
|
2953
3022
|
let c = n.readUnknownField;
|
|
@@ -2960,13 +3029,13 @@ class zi extends Z {
|
|
|
2960
3029
|
return s;
|
|
2961
3030
|
}
|
|
2962
3031
|
internalBinaryWrite(e, t, n) {
|
|
2963
|
-
e.key !== "" && t.tag(1, m.LengthDelimited).string(e.key), e.name !== "" && t.tag(2, m.LengthDelimited).string(e.name), e.folderName !== "" && t.tag(3, m.LengthDelimited).string(e.folderName), e.nestedFolderName !== "" && t.tag(4, m.LengthDelimited).string(e.nestedFolderName), e.url !== "" && t.tag(5, m.LengthDelimited).string(e.url), e.thumborUrl !== "" && t.tag(6, m.LengthDelimited).string(e.thumborUrl), e.proxyUrl !== "" && t.tag(7, m.LengthDelimited).string(e.proxyUrl), e.type !== 0 && t.tag(8, m.Varint).int32(e.type), e.metadata &&
|
|
3032
|
+
e.key !== "" && t.tag(1, m.LengthDelimited).string(e.key), e.name !== "" && t.tag(2, m.LengthDelimited).string(e.name), e.folderName !== "" && t.tag(3, m.LengthDelimited).string(e.folderName), e.nestedFolderName !== "" && t.tag(4, m.LengthDelimited).string(e.nestedFolderName), e.url !== "" && t.tag(5, m.LengthDelimited).string(e.url), e.thumborUrl !== "" && t.tag(6, m.LengthDelimited).string(e.thumborUrl), e.proxyUrl !== "" && t.tag(7, m.LengthDelimited).string(e.proxyUrl), e.type !== 0 && t.tag(8, m.Varint).int32(e.type), e.metadata && wt.internalBinaryWrite(e.metadata, t.tag(9, m.LengthDelimited).fork(), n).join();
|
|
2964
3033
|
let r = n.writeUnknownFields;
|
|
2965
3034
|
return r !== !1 && (r == !0 ? N.onWrite : r)(this.typeName, e, t), t;
|
|
2966
3035
|
}
|
|
2967
3036
|
}
|
|
2968
|
-
const
|
|
2969
|
-
class
|
|
3037
|
+
const oe = new nr();
|
|
3038
|
+
class ir extends Z {
|
|
2970
3039
|
constructor() {
|
|
2971
3040
|
super("com.hamropatro.grpc.cms.FileMetadata", [
|
|
2972
3041
|
{
|
|
@@ -3040,8 +3109,8 @@ class Yi extends Z {
|
|
|
3040
3109
|
return r !== !1 && (r == !0 ? N.onWrite : r)(this.typeName, e, t), t;
|
|
3041
3110
|
}
|
|
3042
3111
|
}
|
|
3043
|
-
const
|
|
3044
|
-
class
|
|
3112
|
+
const wt = new ir();
|
|
3113
|
+
class rr extends Z {
|
|
3045
3114
|
constructor() {
|
|
3046
3115
|
super("com.hamropatro.grpc.cms.DeleteFileRequest", [
|
|
3047
3116
|
{
|
|
@@ -3082,8 +3151,8 @@ class Qi extends Z {
|
|
|
3082
3151
|
return r !== !1 && (r == !0 ? N.onWrite : r)(this.typeName, e, t), t;
|
|
3083
3152
|
}
|
|
3084
3153
|
}
|
|
3085
|
-
const
|
|
3086
|
-
class
|
|
3154
|
+
const Sn = new rr();
|
|
3155
|
+
class sr extends Z {
|
|
3087
3156
|
constructor() {
|
|
3088
3157
|
super("com.hamropatro.grpc.cms.DeleteFileResponse", [
|
|
3089
3158
|
{
|
|
@@ -3124,8 +3193,8 @@ class er extends Z {
|
|
|
3124
3193
|
return r !== !1 && (r == !0 ? N.onWrite : r)(this.typeName, e, t), t;
|
|
3125
3194
|
}
|
|
3126
3195
|
}
|
|
3127
|
-
const
|
|
3128
|
-
class
|
|
3196
|
+
const or = new sr();
|
|
3197
|
+
class ar extends Z {
|
|
3129
3198
|
constructor() {
|
|
3130
3199
|
super("com.hamropatro.grpc.cms.GetFilesByFolderRequest", [
|
|
3131
3200
|
{
|
|
@@ -3188,11 +3257,11 @@ class nr extends Z {
|
|
|
3188
3257
|
return r !== !1 && (r == !0 ? N.onWrite : r)(this.typeName, e, t), t;
|
|
3189
3258
|
}
|
|
3190
3259
|
}
|
|
3191
|
-
const
|
|
3192
|
-
class
|
|
3260
|
+
const Rn = new ar();
|
|
3261
|
+
class lr extends Z {
|
|
3193
3262
|
constructor() {
|
|
3194
3263
|
super("com.hamropatro.grpc.cms.GetFilesByFolderResponse", [
|
|
3195
|
-
{ no: 1, name: "files", kind: "message", repeat: 1, T: () =>
|
|
3264
|
+
{ no: 1, name: "files", kind: "message", repeat: 1, T: () => oe },
|
|
3196
3265
|
{
|
|
3197
3266
|
no: 2,
|
|
3198
3267
|
name: "next_cursor",
|
|
@@ -3220,7 +3289,7 @@ class ir extends Z {
|
|
|
3220
3289
|
switch (a) {
|
|
3221
3290
|
case /* repeated com.hamropatro.grpc.cms.File files */
|
|
3222
3291
|
1:
|
|
3223
|
-
s.files.push(
|
|
3292
|
+
s.files.push(oe.internalBinaryRead(e, e.uint32(), n));
|
|
3224
3293
|
break;
|
|
3225
3294
|
case /* string next_cursor */
|
|
3226
3295
|
2:
|
|
@@ -3242,24 +3311,25 @@ class ir extends Z {
|
|
|
3242
3311
|
}
|
|
3243
3312
|
internalBinaryWrite(e, t, n) {
|
|
3244
3313
|
for (let s = 0; s < e.files.length; s++)
|
|
3245
|
-
|
|
3314
|
+
oe.internalBinaryWrite(e.files[s], t.tag(1, m.LengthDelimited).fork(), n).join();
|
|
3246
3315
|
e.nextCursor !== "" && t.tag(2, m.LengthDelimited).string(e.nextCursor), e.hasMore !== !1 && t.tag(3, m.Varint).bool(e.hasMore);
|
|
3247
3316
|
let r = n.writeUnknownFields;
|
|
3248
3317
|
return r !== !1 && (r == !0 ? N.onWrite : r)(this.typeName, e, t), t;
|
|
3249
3318
|
}
|
|
3250
3319
|
}
|
|
3251
|
-
const
|
|
3252
|
-
{ name: "createFile", options: {}, I:
|
|
3253
|
-
{ name: "updateFile", options: {}, I:
|
|
3254
|
-
{ name: "deleteFile", options: {}, I:
|
|
3255
|
-
{ name: "getFilesByFolder", options: {}, I:
|
|
3256
|
-
{ name: "
|
|
3320
|
+
const cr = new lr(), yt = new Bt("com.hamropatro.grpc.cms.FileService", [
|
|
3321
|
+
{ name: "createFile", options: {}, I: Un, O: oe },
|
|
3322
|
+
{ name: "updateFile", options: {}, I: oe, O: oe },
|
|
3323
|
+
{ name: "deleteFile", options: {}, I: Sn, O: or },
|
|
3324
|
+
{ name: "getFilesByFolder", options: {}, I: Rn, O: cr },
|
|
3325
|
+
{ name: "createUserFile", options: {}, I: Dn, O: oe },
|
|
3326
|
+
{ name: "search", options: {}, I: On, O: Qi }
|
|
3257
3327
|
]);
|
|
3258
|
-
class
|
|
3328
|
+
class je {
|
|
3259
3329
|
constructor(e) {
|
|
3260
|
-
x(this, "typeName",
|
|
3261
|
-
x(this, "methods",
|
|
3262
|
-
x(this, "options",
|
|
3330
|
+
x(this, "typeName", yt.typeName);
|
|
3331
|
+
x(this, "methods", yt.methods);
|
|
3332
|
+
x(this, "options", yt.options);
|
|
3263
3333
|
this._transport = e;
|
|
3264
3334
|
}
|
|
3265
3335
|
/**
|
|
@@ -3267,41 +3337,50 @@ class Xe {
|
|
|
3267
3337
|
*/
|
|
3268
3338
|
createFile(e, t) {
|
|
3269
3339
|
const n = this.methods[0], r = this._transport.mergeOptions(t);
|
|
3270
|
-
return
|
|
3340
|
+
return ie("unary", this._transport, n, r, e);
|
|
3271
3341
|
}
|
|
3272
3342
|
/**
|
|
3273
3343
|
* @generated from protobuf rpc: updateFile(com.hamropatro.grpc.cms.File) returns (com.hamropatro.grpc.cms.File);
|
|
3274
3344
|
*/
|
|
3275
3345
|
updateFile(e, t) {
|
|
3276
3346
|
const n = this.methods[1], r = this._transport.mergeOptions(t);
|
|
3277
|
-
return
|
|
3347
|
+
return ie("unary", this._transport, n, r, e);
|
|
3278
3348
|
}
|
|
3279
3349
|
/**
|
|
3280
3350
|
* @generated from protobuf rpc: deleteFile(com.hamropatro.grpc.cms.DeleteFileRequest) returns (com.hamropatro.grpc.cms.DeleteFileResponse);
|
|
3281
3351
|
*/
|
|
3282
3352
|
deleteFile(e, t) {
|
|
3283
3353
|
const n = this.methods[2], r = this._transport.mergeOptions(t);
|
|
3284
|
-
return
|
|
3354
|
+
return ie("unary", this._transport, n, r, e);
|
|
3285
3355
|
}
|
|
3286
3356
|
/**
|
|
3287
3357
|
* @generated from protobuf rpc: getFilesByFolder(com.hamropatro.grpc.cms.GetFilesByFolderRequest) returns (com.hamropatro.grpc.cms.GetFilesByFolderResponse);
|
|
3288
3358
|
*/
|
|
3289
3359
|
getFilesByFolder(e, t) {
|
|
3290
3360
|
const n = this.methods[3], r = this._transport.mergeOptions(t);
|
|
3291
|
-
return
|
|
3361
|
+
return ie("unary", this._transport, n, r, e);
|
|
3362
|
+
}
|
|
3363
|
+
/**
|
|
3364
|
+
* user sepecific file
|
|
3365
|
+
*
|
|
3366
|
+
* @generated from protobuf rpc: createUserFile(com.hamropatro.grpc.cms.CreateUserFileRequest) returns (com.hamropatro.grpc.cms.File);
|
|
3367
|
+
*/
|
|
3368
|
+
createUserFile(e, t) {
|
|
3369
|
+
const n = this.methods[4], r = this._transport.mergeOptions(t);
|
|
3370
|
+
return ie("unary", this._transport, n, r, e);
|
|
3292
3371
|
}
|
|
3293
3372
|
/**
|
|
3294
3373
|
* @generated from protobuf rpc: search(com.hamropatro.grpc.cms.SearchRequest) returns (com.hamropatro.grpc.cms.SearchResult);
|
|
3295
3374
|
*/
|
|
3296
3375
|
search(e, t) {
|
|
3297
|
-
const n = this.methods[
|
|
3298
|
-
return
|
|
3376
|
+
const n = this.methods[5], r = this._transport.mergeOptions(t);
|
|
3377
|
+
return ie("unary", this._transport, n, r, e);
|
|
3299
3378
|
}
|
|
3300
3379
|
}
|
|
3301
|
-
const
|
|
3380
|
+
const dr = async (i, e, t, n, r, s) => {
|
|
3302
3381
|
var o;
|
|
3303
3382
|
try {
|
|
3304
|
-
const a = (o = window.ImageSalonSDK) == null ? void 0 : o.grpcConfig, l = new
|
|
3383
|
+
const a = (o = window.ImageSalonSDK) == null ? void 0 : o.grpcConfig, l = new je(a), c = Un.create();
|
|
3305
3384
|
return c.name = i, c.nestedFolderName = e, c.url = t, c.type = n, c.folderName = r, await l.createFile(
|
|
3306
3385
|
c,
|
|
3307
3386
|
s
|
|
@@ -3309,10 +3388,21 @@ const cn = async (i, e, t, n, r, s) => {
|
|
|
3309
3388
|
} catch (a) {
|
|
3310
3389
|
throw a;
|
|
3311
3390
|
}
|
|
3312
|
-
},
|
|
3391
|
+
}, hr = async (i, e, t) => {
|
|
3392
|
+
var n;
|
|
3393
|
+
try {
|
|
3394
|
+
const r = (n = window.ImageSalonSDK) == null ? void 0 : n.grpcConfig, s = new je(r), o = Dn.create();
|
|
3395
|
+
return o.url = i, o.type = e, await s.createUserFile(
|
|
3396
|
+
o,
|
|
3397
|
+
t
|
|
3398
|
+
);
|
|
3399
|
+
} catch (r) {
|
|
3400
|
+
throw r;
|
|
3401
|
+
}
|
|
3402
|
+
}, ur = async (i, e, t, n) => {
|
|
3313
3403
|
var r;
|
|
3314
3404
|
try {
|
|
3315
|
-
const s = (r = window.ImageSalonSDK) == null ? void 0 : r.grpcConfig, o = new
|
|
3405
|
+
const s = (r = window.ImageSalonSDK) == null ? void 0 : r.grpcConfig, o = new je(s), a = Rn.create();
|
|
3316
3406
|
return a.folderName = i, a.cursor = e, a.limit = t, await o.getFilesByFolder(
|
|
3317
3407
|
a,
|
|
3318
3408
|
n
|
|
@@ -3320,10 +3410,10 @@ const cn = async (i, e, t, n, r, s) => {
|
|
|
3320
3410
|
} catch (s) {
|
|
3321
3411
|
throw s;
|
|
3322
3412
|
}
|
|
3323
|
-
},
|
|
3413
|
+
}, pr = async (i, e, t = 20, n) => {
|
|
3324
3414
|
var r;
|
|
3325
3415
|
try {
|
|
3326
|
-
const s = (r = window.ImageSalonSDK) == null ? void 0 : r.grpcConfig, o = new
|
|
3416
|
+
const s = (r = window.ImageSalonSDK) == null ? void 0 : r.grpcConfig, o = new je(s), a = On.create();
|
|
3327
3417
|
return a.searchValue = i, a.cursor = e, a.limit = t, await o.search(
|
|
3328
3418
|
a,
|
|
3329
3419
|
n
|
|
@@ -3331,10 +3421,10 @@ const cn = async (i, e, t, n, r, s) => {
|
|
|
3331
3421
|
} catch (s) {
|
|
3332
3422
|
throw s;
|
|
3333
3423
|
}
|
|
3334
|
-
},
|
|
3424
|
+
}, fr = async (i, e, t, n, r, s, o, a, l) => {
|
|
3335
3425
|
var c;
|
|
3336
3426
|
try {
|
|
3337
|
-
const h = (c = window.ImageSalonSDK) == null ? void 0 : c.grpcConfig, g = new
|
|
3427
|
+
const h = (c = window.ImageSalonSDK) == null ? void 0 : c.grpcConfig, g = new je(h), w = oe.create();
|
|
3338
3428
|
return w.key = i, w.name = e, w.nestedFolderName = t, w.url = n, w.thumborUrl = r, w.proxyUrl = s, w.type = o, w.folderName = a, await g.updateFile(
|
|
3339
3429
|
w,
|
|
3340
3430
|
l
|
|
@@ -3342,10 +3432,10 @@ const cn = async (i, e, t, n, r, s) => {
|
|
|
3342
3432
|
} catch (h) {
|
|
3343
3433
|
throw h;
|
|
3344
3434
|
}
|
|
3345
|
-
},
|
|
3435
|
+
}, mr = async (i, e) => {
|
|
3346
3436
|
var t;
|
|
3347
3437
|
try {
|
|
3348
|
-
const n = (t = window.ImageSalonSDK) == null ? void 0 : t.grpcConfig, r = new
|
|
3438
|
+
const n = (t = window.ImageSalonSDK) == null ? void 0 : t.grpcConfig, r = new je(n), s = Sn.create();
|
|
3349
3439
|
return s.key = i, await r.deleteFile(
|
|
3350
3440
|
s,
|
|
3351
3441
|
e
|
|
@@ -3354,7 +3444,7 @@ const cn = async (i, e, t, n, r, s) => {
|
|
|
3354
3444
|
throw n;
|
|
3355
3445
|
}
|
|
3356
3446
|
};
|
|
3357
|
-
class
|
|
3447
|
+
class gr extends Z {
|
|
3358
3448
|
constructor() {
|
|
3359
3449
|
super("com.hamropatro.grpc.cms.DeleteFolderRequest", [
|
|
3360
3450
|
{
|
|
@@ -3395,8 +3485,8 @@ class cr extends Z {
|
|
|
3395
3485
|
return r !== !1 && (r == !0 ? N.onWrite : r)(this.typeName, e, t), t;
|
|
3396
3486
|
}
|
|
3397
3487
|
}
|
|
3398
|
-
const
|
|
3399
|
-
class
|
|
3488
|
+
const Mn = new gr();
|
|
3489
|
+
class wr extends Z {
|
|
3400
3490
|
constructor() {
|
|
3401
3491
|
super("com.hamropatro.grpc.cms.CreateFolderRequest", [
|
|
3402
3492
|
{
|
|
@@ -3459,8 +3549,8 @@ class dr extends Z {
|
|
|
3459
3549
|
return r !== !1 && (r == !0 ? N.onWrite : r)(this.typeName, e, t), t;
|
|
3460
3550
|
}
|
|
3461
3551
|
}
|
|
3462
|
-
const
|
|
3463
|
-
class
|
|
3552
|
+
const Vn = new wr();
|
|
3553
|
+
class yr extends Z {
|
|
3464
3554
|
constructor() {
|
|
3465
3555
|
super("com.hamropatro.grpc.cms.GetAllFoldersRequest", [
|
|
3466
3556
|
{
|
|
@@ -3512,11 +3602,11 @@ class hr extends Z {
|
|
|
3512
3602
|
return r !== !1 && (r == !0 ? N.onWrite : r)(this.typeName, e, t), t;
|
|
3513
3603
|
}
|
|
3514
3604
|
}
|
|
3515
|
-
const
|
|
3516
|
-
class
|
|
3605
|
+
const Hn = new yr();
|
|
3606
|
+
class br extends Z {
|
|
3517
3607
|
constructor() {
|
|
3518
3608
|
super("com.hamropatro.grpc.cms.GetAllFoldersResponse", [
|
|
3519
|
-
{ no: 1, name: "folder", kind: "message", repeat: 1, T: () =>
|
|
3609
|
+
{ no: 1, name: "folder", kind: "message", repeat: 1, T: () => ve },
|
|
3520
3610
|
{
|
|
3521
3611
|
no: 2,
|
|
3522
3612
|
name: "next_cursor",
|
|
@@ -3544,7 +3634,7 @@ class ur extends Z {
|
|
|
3544
3634
|
switch (a) {
|
|
3545
3635
|
case /* repeated com.hamropatro.grpc.cms.Folder folder */
|
|
3546
3636
|
1:
|
|
3547
|
-
s.folder.push(
|
|
3637
|
+
s.folder.push(ve.internalBinaryRead(e, e.uint32(), n));
|
|
3548
3638
|
break;
|
|
3549
3639
|
case /* string next_cursor */
|
|
3550
3640
|
2:
|
|
@@ -3566,14 +3656,14 @@ class ur extends Z {
|
|
|
3566
3656
|
}
|
|
3567
3657
|
internalBinaryWrite(e, t, n) {
|
|
3568
3658
|
for (let s = 0; s < e.folder.length; s++)
|
|
3569
|
-
|
|
3659
|
+
ve.internalBinaryWrite(e.folder[s], t.tag(1, m.LengthDelimited).fork(), n).join();
|
|
3570
3660
|
e.nextCursor !== "" && t.tag(2, m.LengthDelimited).string(e.nextCursor), e.hasMore !== !1 && t.tag(3, m.Varint).bool(e.hasMore);
|
|
3571
3661
|
let r = n.writeUnknownFields;
|
|
3572
3662
|
return r !== !1 && (r == !0 ? N.onWrite : r)(this.typeName, e, t), t;
|
|
3573
3663
|
}
|
|
3574
3664
|
}
|
|
3575
|
-
const
|
|
3576
|
-
class
|
|
3665
|
+
const Cr = new br();
|
|
3666
|
+
class Er extends Z {
|
|
3577
3667
|
constructor() {
|
|
3578
3668
|
super("com.hamropatro.grpc.cms.Folder", [
|
|
3579
3669
|
{
|
|
@@ -3647,17 +3737,17 @@ class fr extends Z {
|
|
|
3647
3737
|
return r !== !1 && (r == !0 ? N.onWrite : r)(this.typeName, e, t), t;
|
|
3648
3738
|
}
|
|
3649
3739
|
}
|
|
3650
|
-
const
|
|
3651
|
-
{ name: "createFolder", options: {}, I:
|
|
3652
|
-
{ name: "getFolders", options: {}, I:
|
|
3653
|
-
{ name: "updateFolder", options: {}, I:
|
|
3654
|
-
{ name: "deleteFolder", options: {}, I:
|
|
3740
|
+
const ve = new Er(), bt = new Bt("com.hamropatro.grpc.cms.FolderService", [
|
|
3741
|
+
{ name: "createFolder", options: {}, I: Vn, O: ve },
|
|
3742
|
+
{ name: "getFolders", options: {}, I: Hn, O: Cr },
|
|
3743
|
+
{ name: "updateFolder", options: {}, I: ve, O: ve },
|
|
3744
|
+
{ name: "deleteFolder", options: {}, I: Mn, O: ve }
|
|
3655
3745
|
]);
|
|
3656
|
-
class
|
|
3746
|
+
class ut {
|
|
3657
3747
|
constructor(e) {
|
|
3658
|
-
x(this, "typeName",
|
|
3659
|
-
x(this, "methods",
|
|
3660
|
-
x(this, "options",
|
|
3748
|
+
x(this, "typeName", bt.typeName);
|
|
3749
|
+
x(this, "methods", bt.methods);
|
|
3750
|
+
x(this, "options", bt.options);
|
|
3661
3751
|
this._transport = e;
|
|
3662
3752
|
}
|
|
3663
3753
|
/**
|
|
@@ -3665,33 +3755,33 @@ class at {
|
|
|
3665
3755
|
*/
|
|
3666
3756
|
createFolder(e, t) {
|
|
3667
3757
|
const n = this.methods[0], r = this._transport.mergeOptions(t);
|
|
3668
|
-
return
|
|
3758
|
+
return ie("unary", this._transport, n, r, e);
|
|
3669
3759
|
}
|
|
3670
3760
|
/**
|
|
3671
3761
|
* @generated from protobuf rpc: getFolders(com.hamropatro.grpc.cms.GetAllFoldersRequest) returns (com.hamropatro.grpc.cms.GetAllFoldersResponse);
|
|
3672
3762
|
*/
|
|
3673
3763
|
getFolders(e, t) {
|
|
3674
3764
|
const n = this.methods[1], r = this._transport.mergeOptions(t);
|
|
3675
|
-
return
|
|
3765
|
+
return ie("unary", this._transport, n, r, e);
|
|
3676
3766
|
}
|
|
3677
3767
|
/**
|
|
3678
3768
|
* @generated from protobuf rpc: updateFolder(com.hamropatro.grpc.cms.Folder) returns (com.hamropatro.grpc.cms.Folder);
|
|
3679
3769
|
*/
|
|
3680
3770
|
updateFolder(e, t) {
|
|
3681
3771
|
const n = this.methods[2], r = this._transport.mergeOptions(t);
|
|
3682
|
-
return
|
|
3772
|
+
return ie("unary", this._transport, n, r, e);
|
|
3683
3773
|
}
|
|
3684
3774
|
/**
|
|
3685
3775
|
* @generated from protobuf rpc: deleteFolder(com.hamropatro.grpc.cms.DeleteFolderRequest) returns (com.hamropatro.grpc.cms.Folder);
|
|
3686
3776
|
*/
|
|
3687
3777
|
deleteFolder(e, t) {
|
|
3688
3778
|
const n = this.methods[3], r = this._transport.mergeOptions(t);
|
|
3689
|
-
return
|
|
3779
|
+
return ie("unary", this._transport, n, r, e);
|
|
3690
3780
|
}
|
|
3691
3781
|
}
|
|
3692
|
-
const
|
|
3782
|
+
const kr = async (i, e = 20, t) => {
|
|
3693
3783
|
var o;
|
|
3694
|
-
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 ut(n), s = Hn.create();
|
|
3695
3785
|
try {
|
|
3696
3786
|
return s.cursor = i, s.limit = e, await r.getFolders(
|
|
3697
3787
|
s,
|
|
@@ -3700,10 +3790,10 @@ const mr = async (i, e = 20, t) => {
|
|
|
3700
3790
|
} catch (a) {
|
|
3701
3791
|
throw a;
|
|
3702
3792
|
}
|
|
3703
|
-
},
|
|
3793
|
+
}, Nr = async (i, e, t, n) => {
|
|
3704
3794
|
var r;
|
|
3705
3795
|
try {
|
|
3706
|
-
const s = (r = window.ImageSalonSDK) == null ? void 0 : r.grpcConfig, o = new
|
|
3796
|
+
const s = (r = window.ImageSalonSDK) == null ? void 0 : r.grpcConfig, o = new ut(s), a = Vn.create();
|
|
3707
3797
|
return a.name = i, a.nestedFolderName = e, a.createdBy = t, await o.createFolder(
|
|
3708
3798
|
a,
|
|
3709
3799
|
n
|
|
@@ -3711,10 +3801,10 @@ const mr = async (i, e = 20, t) => {
|
|
|
3711
3801
|
} catch (s) {
|
|
3712
3802
|
throw s;
|
|
3713
3803
|
}
|
|
3714
|
-
},
|
|
3804
|
+
}, Fr = async (i, e, t, n, r) => {
|
|
3715
3805
|
var s;
|
|
3716
3806
|
try {
|
|
3717
|
-
const o = (s = window.ImageSalonSDK) == null ? void 0 : s.grpcConfig, a = new
|
|
3807
|
+
const o = (s = window.ImageSalonSDK) == null ? void 0 : s.grpcConfig, a = new ut(o), l = ve.create();
|
|
3718
3808
|
return l.name = e, l.key = i, l.nestedFolderName = t, l.createdBy = n, await a.updateFolder(
|
|
3719
3809
|
l,
|
|
3720
3810
|
r
|
|
@@ -3722,10 +3812,10 @@ const mr = async (i, e = 20, t) => {
|
|
|
3722
3812
|
} catch (o) {
|
|
3723
3813
|
throw o;
|
|
3724
3814
|
}
|
|
3725
|
-
},
|
|
3815
|
+
}, Lr = async (i, e) => {
|
|
3726
3816
|
var t;
|
|
3727
3817
|
try {
|
|
3728
|
-
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 ut(n), s = Mn.create();
|
|
3729
3819
|
return s.key = i, await r.deleteFolder(
|
|
3730
3820
|
s,
|
|
3731
3821
|
e
|
|
@@ -3733,7 +3823,7 @@ const mr = async (i, e = 20, t) => {
|
|
|
3733
3823
|
} catch (n) {
|
|
3734
3824
|
throw n;
|
|
3735
3825
|
}
|
|
3736
|
-
},
|
|
3826
|
+
}, Ct = (i, e, t) => {
|
|
3737
3827
|
const n = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3738
3828
|
n.setAttribute("xmlns", "http://www.w3.org/2000/svg"), n.setAttribute("width", i || "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");
|
|
3739
3829
|
const r = document.createElementNS(
|
|
@@ -3746,7 +3836,7 @@ const mr = async (i, e = 20, t) => {
|
|
|
3746
3836
|
const o = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
3747
3837
|
return o.setAttribute("x1", "12"), o.setAttribute("x2", "12.01"), o.setAttribute("y1", "16"), o.setAttribute("y2", "16"), n.appendChild(r), n.appendChild(s), n.appendChild(o), n;
|
|
3748
3838
|
};
|
|
3749
|
-
function
|
|
3839
|
+
function fn() {
|
|
3750
3840
|
const i = document.createElementNS(
|
|
3751
3841
|
"http://www.w3.org/2000/svg",
|
|
3752
3842
|
"svg"
|
|
@@ -3758,7 +3848,7 @@ function hn() {
|
|
|
3758
3848
|
"M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"
|
|
3759
3849
|
), i.appendChild(e), i;
|
|
3760
3850
|
}
|
|
3761
|
-
function
|
|
3851
|
+
function Ar() {
|
|
3762
3852
|
const i = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3763
3853
|
i.setAttribute("xmlns", "http://www.w3.org/2000/svg"), i.setAttribute("width", "12"), i.setAttribute("height", "12"), i.setAttribute("viewBox", "0 0 24 24"), i.setAttribute("fill", "none"), i.setAttribute("stroke", "currentColor"), i.setAttribute("stroke-width", "2"), i.setAttribute("stroke-linecap", "round"), i.setAttribute("stroke-linejoin", "round"), i.classList.add("lucide", "lucide-music-4");
|
|
3764
3854
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
@@ -3776,7 +3866,7 @@ function br() {
|
|
|
3776
3866
|
);
|
|
3777
3867
|
return r.setAttribute("cx", "18"), r.setAttribute("cy", "16"), r.setAttribute("r", "3"), i.appendChild(e), i.appendChild(t), i.appendChild(n), i.appendChild(r), document.body.appendChild(i), i;
|
|
3778
3868
|
}
|
|
3779
|
-
const
|
|
3869
|
+
const Ir = () => {
|
|
3780
3870
|
const i = document.createElementNS(
|
|
3781
3871
|
"http://www.w3.org/2000/svg",
|
|
3782
3872
|
"svg"
|
|
@@ -3787,7 +3877,7 @@ const Cr = () => {
|
|
|
3787
3877
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3788
3878
|
return t.setAttribute("d", "m9 11 3 3L22 4"), i.appendChild(e), i.appendChild(t), i;
|
|
3789
3879
|
};
|
|
3790
|
-
function
|
|
3880
|
+
function Tt(i = "#333") {
|
|
3791
3881
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3792
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", i);
|
|
3793
3883
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
@@ -3796,7 +3886,7 @@ function kt(i = "#333") {
|
|
|
3796
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"
|
|
3797
3887
|
), e.appendChild(t), e;
|
|
3798
3888
|
}
|
|
3799
|
-
function
|
|
3889
|
+
function mn() {
|
|
3800
3890
|
const i = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3801
3891
|
i.setAttribute("xmlns", "http://www.w3.org/2000/svg"), i.setAttribute("width", "16"), i.setAttribute("height", "16"), i.setAttribute("viewBox", "0 0 24 24"), i.setAttribute("fill", "none"), i.setAttribute("stroke", "#2c96f8"), i.setAttribute("stroke-width", "2"), i.setAttribute("stroke-linecap", "round"), i.setAttribute("stroke-linejoin", "round"), i.classList.add("lucide", "lucide-pencil");
|
|
3802
3892
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
@@ -3807,7 +3897,7 @@ function un() {
|
|
|
3807
3897
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3808
3898
|
return t.setAttribute("d", "m15 5 4 4"), i.appendChild(e), i.appendChild(t), document.body.appendChild(i), i;
|
|
3809
3899
|
}
|
|
3810
|
-
function
|
|
3900
|
+
function qe() {
|
|
3811
3901
|
const i = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3812
3902
|
i.setAttribute("xmlns", "http://www.w3.org/2000/folder"), i.setAttribute("x", "0px"), i.setAttribute("y", "0px"), i.setAttribute("width", "24"), i.setAttribute("height", "24"), i.setAttribute("viewBox", "0 0 48 48");
|
|
3813
3903
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
@@ -3821,7 +3911,7 @@ function He() {
|
|
|
3821
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"
|
|
3822
3912
|
), i.appendChild(e), i.appendChild(t), i;
|
|
3823
3913
|
}
|
|
3824
|
-
function
|
|
3914
|
+
function Tr() {
|
|
3825
3915
|
const i = "http://www.w3.org/2000/svg", e = document.createElementNS(i, "svg");
|
|
3826
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");
|
|
3827
3917
|
const t = document.createElementNS(i, "rect");
|
|
@@ -3831,7 +3921,7 @@ function Er() {
|
|
|
3831
3921
|
const r = document.createElementNS(i, "path");
|
|
3832
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;
|
|
3833
3923
|
}
|
|
3834
|
-
function
|
|
3924
|
+
function vr() {
|
|
3835
3925
|
const i = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3836
3926
|
i.setAttribute("xmlns", "http://www.w3.org/2000/svg"), i.setAttribute("height", "24px"), i.setAttribute("viewBox", "0 -960 960 960"), i.setAttribute("width", "24px"), i.setAttribute("fill", "currentColor");
|
|
3837
3927
|
const e = document.createElementNS(
|
|
@@ -3843,13 +3933,13 @@ function kr() {
|
|
|
3843
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"
|
|
3844
3934
|
), i.appendChild(e), i;
|
|
3845
3935
|
}
|
|
3846
|
-
function
|
|
3936
|
+
function gn() {
|
|
3847
3937
|
const i = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3848
3938
|
i.setAttribute("xmlns", "http://www.w3.org/2000/svg"), i.setAttribute("fill", "none"), i.setAttribute("width", "20"), i.setAttribute("height", "20"), i.setAttribute("viewBox", "0 0 24 24"), i.setAttribute("stroke-width", "1.5"), i.setAttribute("stroke", "currentColor"), i.setAttribute("class", "size-2");
|
|
3849
3939
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3850
3940
|
return e.setAttribute("stroke-linecap", "round"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("d", "M12 4.5v15m7.5-7.5h-15"), i.appendChild(e), i;
|
|
3851
3941
|
}
|
|
3852
|
-
function
|
|
3942
|
+
function Br() {
|
|
3853
3943
|
const i = "http://www.w3.org/2000/svg", e = document.createElementNS(i, "svg");
|
|
3854
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");
|
|
3855
3945
|
const t = document.createElementNS(i, "path");
|
|
@@ -3860,7 +3950,7 @@ function Nr() {
|
|
|
3860
3950
|
const n = document.createElementNS(i, "circle");
|
|
3861
3951
|
return n.setAttribute("cx", "12"), n.setAttribute("cy", "12"), n.setAttribute("r", "3"), e.appendChild(n), document.body.appendChild(e), e;
|
|
3862
3952
|
}
|
|
3863
|
-
function
|
|
3953
|
+
function xr() {
|
|
3864
3954
|
const i = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3865
3955
|
i.setAttribute("xmlns", "http://www.w3.org/2000/svg"), i.setAttribute("height", "24px"), i.setAttribute("width", "24px"), i.setAttribute("viewBox", "0 0 30 30"), i.setAttribute("fill", "#999");
|
|
3866
3956
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
@@ -3869,7 +3959,7 @@ function Ar() {
|
|
|
3869
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"
|
|
3870
3960
|
), i.appendChild(e), i;
|
|
3871
3961
|
}
|
|
3872
|
-
function
|
|
3962
|
+
function wn() {
|
|
3873
3963
|
const i = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3874
3964
|
i.setAttribute("xmlns", "http://www.w3.org/2000/svg"), i.setAttribute("width", "16"), i.setAttribute("height", "16"), i.setAttribute("viewBox", "0 0 24 24"), i.setAttribute("fill", "none"), i.setAttribute("stroke", "#f14b4b"), i.setAttribute("stroke-width", "2"), i.setAttribute("stroke-linecap", "round"), i.setAttribute("stroke-linejoin", "round"), i.classList.add("lucide", "lucide-trash-2");
|
|
3875
3965
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
@@ -3883,7 +3973,7 @@ function fn() {
|
|
|
3883
3973
|
const s = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
3884
3974
|
return s.setAttribute("x1", "14"), s.setAttribute("x2", "14"), s.setAttribute("y1", "11"), s.setAttribute("y2", "17"), i.appendChild(e), i.appendChild(t), i.appendChild(n), i.appendChild(r), i.appendChild(s), document.body.appendChild(i), i;
|
|
3885
3975
|
}
|
|
3886
|
-
function
|
|
3976
|
+
function Et() {
|
|
3887
3977
|
const i = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3888
3978
|
i.setAttribute("xmlns", "http://www.w3.org/2000/svg"), i.setAttribute("width", "24"), i.setAttribute("height", "24"), i.setAttribute("viewBox", "0 0 24 24"), i.setAttribute("fill", "none"), i.setAttribute("stroke", "currentColor"), i.setAttribute("stroke-width", "2"), i.setAttribute("stroke-linecap", "round"), i.setAttribute("stroke-linejoin", "round"), i.classList.add("lucide", "lucide-upload");
|
|
3889
3979
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
@@ -3896,7 +3986,7 @@ function mt() {
|
|
|
3896
3986
|
const n = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
3897
3987
|
return n.setAttribute("x1", "12"), n.setAttribute("x2", "12"), n.setAttribute("y1", "3"), n.setAttribute("y2", "15"), i.appendChild(e), i.appendChild(t), i.appendChild(n), i;
|
|
3898
3988
|
}
|
|
3899
|
-
function
|
|
3989
|
+
function _r() {
|
|
3900
3990
|
const i = "http://www.w3.org/2000/svg", e = document.createElementNS(i, "svg");
|
|
3901
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");
|
|
3902
3992
|
const t = document.createElementNS(i, "path");
|
|
@@ -3907,34 +3997,35 @@ function Fr() {
|
|
|
3907
3997
|
const n = document.createElementNS(i, "rect");
|
|
3908
3998
|
return n.setAttribute("x", "2"), n.setAttribute("y", "6"), n.setAttribute("width", "14"), n.setAttribute("height", "12"), n.setAttribute("rx", "2"), e.appendChild(t), e.appendChild(n), document.body.appendChild(e), e;
|
|
3909
3999
|
}
|
|
3910
|
-
function
|
|
4000
|
+
function F(i, e, t, n, r) {
|
|
3911
4001
|
let s = document.createElement(i);
|
|
3912
4002
|
return e && (s.className += e), t && (s.style.cssText = t), n && (s.textContent = n), r && r.appendChild(s), s;
|
|
3913
4003
|
}
|
|
3914
|
-
var
|
|
3915
|
-
class
|
|
4004
|
+
var pe, te, Se;
|
|
4005
|
+
class Or {
|
|
3916
4006
|
constructor() {
|
|
3917
|
-
|
|
3918
|
-
|
|
4007
|
+
C(this, pe);
|
|
4008
|
+
C(this, te);
|
|
4009
|
+
// Store the circle element as a private property
|
|
4010
|
+
C(this, Se, "#fff");
|
|
4011
|
+
p(this, pe, document.createElementNS(
|
|
3919
4012
|
"http://www.w3.org/2000/svg",
|
|
3920
4013
|
"svg"
|
|
3921
|
-
)), d(this,
|
|
3922
|
-
const e = document.createElementNS(
|
|
4014
|
+
)), d(this, pe).setAttribute("viewBox", "25 25 50 50"), d(this, pe).classList.add("loader-svg"), p(this, te, document.createElementNS(
|
|
3923
4015
|
"http://www.w3.org/2000/svg",
|
|
3924
4016
|
"circle"
|
|
3925
|
-
);
|
|
3926
|
-
e.setAttribute("r", "20"), e.setAttribute("cy", "50"), e.setAttribute("cx", "50"), e.classList.add("loader-circle"), d(this, de).appendChild(e);
|
|
4017
|
+
)), d(this, te).setAttribute("r", "20"), d(this, te).setAttribute("cy", "50"), d(this, te).setAttribute("cx", "50"), d(this, te).setAttribute("stroke", d(this, Se)), d(this, te).classList.add("loader-circle"), d(this, pe).appendChild(d(this, te));
|
|
3927
4018
|
}
|
|
3928
|
-
show(e) {
|
|
3929
|
-
e.appendChild(d(this,
|
|
4019
|
+
show(e, t) {
|
|
4020
|
+
t && (p(this, Se, t), d(this, te).setAttribute("stroke", d(this, Se))), e.appendChild(d(this, pe));
|
|
3930
4021
|
}
|
|
3931
4022
|
hide() {
|
|
3932
|
-
d(this,
|
|
4023
|
+
d(this, pe).remove();
|
|
3933
4024
|
}
|
|
3934
4025
|
}
|
|
3935
|
-
|
|
3936
|
-
const
|
|
3937
|
-
class
|
|
4026
|
+
pe = new WeakMap(), te = new WeakMap(), Se = new WeakMap();
|
|
4027
|
+
const yn = new Or(), it = document.body;
|
|
4028
|
+
class $n {
|
|
3938
4029
|
constructor() {
|
|
3939
4030
|
x(this, "main");
|
|
3940
4031
|
x(this, "dialogContainer");
|
|
@@ -3948,58 +4039,58 @@ class Rn {
|
|
|
3948
4039
|
x(this, "cancelButton");
|
|
3949
4040
|
x(this, "confirmCallback");
|
|
3950
4041
|
x(this, "cancelCallback");
|
|
3951
|
-
this.main =
|
|
4042
|
+
this.main = F("div"), this.dialog = F("div"), this.confirmCallback = void 0, this.cancelCallback = void 0;
|
|
3952
4043
|
}
|
|
3953
4044
|
_init(e) {
|
|
3954
|
-
this.main =
|
|
4045
|
+
this.main = F(
|
|
3955
4046
|
"div",
|
|
3956
4047
|
"dialog-presentation",
|
|
3957
4048
|
"",
|
|
3958
4049
|
"",
|
|
3959
|
-
|
|
3960
|
-
), this.main.setAttribute("role", "presentation"), this.dialogContainer =
|
|
4050
|
+
it
|
|
4051
|
+
), this.main.setAttribute("role", "presentation"), this.dialogContainer = F(
|
|
3961
4052
|
"div",
|
|
3962
4053
|
"dialog-container",
|
|
3963
4054
|
"",
|
|
3964
4055
|
"",
|
|
3965
4056
|
this.main
|
|
3966
|
-
), this.dialogBackdrop =
|
|
4057
|
+
), this.dialogBackdrop = F(
|
|
3967
4058
|
"div",
|
|
3968
4059
|
"dialog-backdrop",
|
|
3969
4060
|
"",
|
|
3970
4061
|
"",
|
|
3971
4062
|
this.dialogContainer
|
|
3972
|
-
), this.dialog =
|
|
4063
|
+
), this.dialog = F("div", "dialog", "", "", this.dialogContainer), this.dialog.setAttribute("tabIndex", "-1");
|
|
3973
4064
|
const t = document.activeElement;
|
|
3974
|
-
if (t && t !== document.body && (t.blur(), this.dialog.focus()), this.dialog.className = "dialog", this.dialogContent =
|
|
4065
|
+
if (t && t !== document.body && (t.blur(), this.dialog.focus()), this.dialog.className = "dialog", this.dialogContent = F(
|
|
3975
4066
|
"div",
|
|
3976
4067
|
"dialog-content",
|
|
3977
4068
|
"",
|
|
3978
4069
|
"",
|
|
3979
4070
|
this.dialog
|
|
3980
|
-
), e != null && e.dialogContentStyle && Object.assign(this.dialogContent.style, e.dialogContentStyle), this.confirmButton =
|
|
4071
|
+
), e != null && e.dialogContentStyle && Object.assign(this.dialogContent.style, e.dialogContentStyle), this.confirmButton = F(
|
|
3981
4072
|
"button",
|
|
3982
4073
|
"dialog-btn confirm",
|
|
3983
4074
|
"",
|
|
3984
4075
|
"",
|
|
3985
4076
|
this.dialogFooter
|
|
3986
|
-
), this.confirmButton.type = "button", this.cancelButton =
|
|
4077
|
+
), this.confirmButton.type = "button", this.cancelButton = F(
|
|
3987
4078
|
"button",
|
|
3988
4079
|
"dialog-btn cancel",
|
|
3989
4080
|
"",
|
|
3990
4081
|
"",
|
|
3991
4082
|
this.dialogFooter
|
|
3992
4083
|
), this.cancelButton.type = "button", e.showCloseBtn) {
|
|
3993
|
-
const n =
|
|
4084
|
+
const n = F(
|
|
3994
4085
|
"button",
|
|
3995
4086
|
"dialog-close-btn",
|
|
3996
4087
|
"",
|
|
3997
4088
|
"",
|
|
3998
4089
|
this.dialogContent
|
|
3999
4090
|
);
|
|
4000
|
-
n.appendChild(
|
|
4091
|
+
n.appendChild(Tt()), n.onclick = () => this.hide();
|
|
4001
4092
|
}
|
|
4002
|
-
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", it.style.overflow = "hidden", this.confirmButton.textContent = e.confirmButtonText || "Upload", this.cancelButton.textContent = e.cancelButtonText || "Cancel", it.classList.add("dialog-visible"), new Promise((n) => {
|
|
4003
4094
|
const r = (s) => () => {
|
|
4004
4095
|
this.hide(), n(s === "confirm");
|
|
4005
4096
|
};
|
|
@@ -4007,7 +4098,7 @@ class Rn {
|
|
|
4007
4098
|
});
|
|
4008
4099
|
}
|
|
4009
4100
|
_setHeader(e) {
|
|
4010
|
-
if (this.dialogHeader =
|
|
4101
|
+
if (this.dialogHeader = F(
|
|
4011
4102
|
"div",
|
|
4012
4103
|
"dialog-header",
|
|
4013
4104
|
"",
|
|
@@ -4016,7 +4107,7 @@ class Rn {
|
|
|
4016
4107
|
), !e.header)
|
|
4017
4108
|
this.dialogHeader.innerHTML = "";
|
|
4018
4109
|
else if (typeof e.header == "string") {
|
|
4019
|
-
const t =
|
|
4110
|
+
const t = F(
|
|
4020
4111
|
"h4",
|
|
4021
4112
|
"dialog-header-text",
|
|
4022
4113
|
"",
|
|
@@ -4028,7 +4119,7 @@ class Rn {
|
|
|
4028
4119
|
this.dialogHeader.innerHTML = "", this.dialogHeader.appendChild(e.header);
|
|
4029
4120
|
}
|
|
4030
4121
|
_setBody(e) {
|
|
4031
|
-
this.dialogBody =
|
|
4122
|
+
this.dialogBody = F(
|
|
4032
4123
|
"div",
|
|
4033
4124
|
"dialog-body",
|
|
4034
4125
|
"",
|
|
@@ -4037,7 +4128,7 @@ class Rn {
|
|
|
4037
4128
|
), typeof e.content == "string" ? this.dialogBody.innerHTML = e.content : (this.dialogBody.innerHTML = "", this.dialogBody.appendChild(e.content));
|
|
4038
4129
|
}
|
|
4039
4130
|
_setFooter(e) {
|
|
4040
|
-
this.dialogFooter =
|
|
4131
|
+
this.dialogFooter = F(
|
|
4041
4132
|
"div",
|
|
4042
4133
|
"dialog-footer",
|
|
4043
4134
|
"",
|
|
@@ -4051,50 +4142,50 @@ class Rn {
|
|
|
4051
4142
|
}, 150);
|
|
4052
4143
|
}
|
|
4053
4144
|
hide() {
|
|
4054
|
-
this.main ||
|
|
4145
|
+
this.main || it.style.removeProperty("overflow"), this.dialog.style.transform = "scale(0.8)", this.dialog.style.transition = "transform 150ms ease-out", this.dialogBackdrop.style.opacity = "0", setTimeout(() => {
|
|
4055
4146
|
this.dialogContainer.style.opacity = "0", this.dialog.style.opacity = "0", this.dialogContent.style.opacity = "0", this.main.remove();
|
|
4056
4147
|
}, 150);
|
|
4057
4148
|
}
|
|
4058
4149
|
updateUploadBtn(e) {
|
|
4059
|
-
e ? (
|
|
4150
|
+
e ? (yn.show(this.confirmButton), this.confirmButton.disabled = !0) : (yn.hide(), this.confirmButton.disabled = !1);
|
|
4060
4151
|
}
|
|
4061
4152
|
}
|
|
4062
|
-
const
|
|
4063
|
-
class
|
|
4153
|
+
const rt = new $n(), D = new $n();
|
|
4154
|
+
class Ur {
|
|
4064
4155
|
constructor() {
|
|
4065
4156
|
x(this, "main");
|
|
4066
4157
|
x(this, "dialogBody");
|
|
4067
|
-
this.main =
|
|
4158
|
+
this.main = F("div"), this.dialogBody = F("div"), this.hide();
|
|
4068
4159
|
}
|
|
4069
4160
|
show(e) {
|
|
4070
|
-
this.main =
|
|
4161
|
+
this.main = F("div", "popover", "", "", e.mainContainer), this.dialogBody = F("div", "popover-body", "", "", this.main), this.main.id = e.divId, this.dialogBody.append(e.content);
|
|
4071
4162
|
}
|
|
4072
4163
|
hide() {
|
|
4073
4164
|
this.main.remove();
|
|
4074
4165
|
}
|
|
4075
4166
|
}
|
|
4076
|
-
const J = new
|
|
4077
|
-
var
|
|
4078
|
-
const
|
|
4167
|
+
const J = new Ur();
|
|
4168
|
+
var he = /* @__PURE__ */ ((i) => (i[i.IMAGE = 0] = "IMAGE", i[i.AUDIO = 1] = "AUDIO", i[i.VIDEO = 2] = "VIDEO", i[i.ALL = 3] = "ALL", i[i.FOLDER = 4] = "FOLDER", i))(he || {});
|
|
4169
|
+
const Ke = {
|
|
4079
4170
|
0: "IMAGE",
|
|
4080
4171
|
1: "AUDIO",
|
|
4081
4172
|
2: "VIDEO",
|
|
4082
4173
|
3: "ALL",
|
|
4083
4174
|
4: "FOLDER"
|
|
4084
4175
|
};
|
|
4085
|
-
function
|
|
4176
|
+
function bn(i) {
|
|
4086
4177
|
switch (i) {
|
|
4087
4178
|
case "image":
|
|
4088
|
-
return
|
|
4179
|
+
return Ke[he.IMAGE];
|
|
4089
4180
|
case "video":
|
|
4090
|
-
return
|
|
4181
|
+
return Ke[he.VIDEO];
|
|
4091
4182
|
case "audio":
|
|
4092
|
-
return
|
|
4183
|
+
return Ke[he.AUDIO];
|
|
4093
4184
|
default:
|
|
4094
|
-
return
|
|
4185
|
+
return Ke[he.ALL];
|
|
4095
4186
|
}
|
|
4096
4187
|
}
|
|
4097
|
-
function
|
|
4188
|
+
function Dr(i) {
|
|
4098
4189
|
const e = {};
|
|
4099
4190
|
i.forEach((r) => {
|
|
4100
4191
|
e[r.key] = { ...r, children: {} };
|
|
@@ -4106,7 +4197,7 @@ function vr(i) {
|
|
|
4106
4197
|
}), r);
|
|
4107
4198
|
return i.reduce((r, s) => (s.nestedFolderName || r.push(t(e[s.key])), r), []);
|
|
4108
4199
|
}
|
|
4109
|
-
function
|
|
4200
|
+
function Sr(i, e) {
|
|
4110
4201
|
const t = (n) => {
|
|
4111
4202
|
if (n.key === e.nestedFolderName)
|
|
4112
4203
|
return n.children[e.key] = { ...e, children: {} }, !0;
|
|
@@ -4122,7 +4213,7 @@ function Tr(i, e) {
|
|
|
4122
4213
|
break;
|
|
4123
4214
|
return i;
|
|
4124
4215
|
}
|
|
4125
|
-
const
|
|
4216
|
+
const Rr = async (i, e) => {
|
|
4126
4217
|
let t;
|
|
4127
4218
|
try {
|
|
4128
4219
|
i && (t = {
|
|
@@ -4140,35 +4231,35 @@ function y(i, e) {
|
|
|
4140
4231
|
const t = document.createElement("div");
|
|
4141
4232
|
return i && (t.className = i), e && (t.id = e), t;
|
|
4142
4233
|
}
|
|
4143
|
-
function
|
|
4234
|
+
function Pe(i, e, t) {
|
|
4144
4235
|
const n = document.createElement("p");
|
|
4145
4236
|
return e && (n.className = e), t && (n.id = t), i && (n.textContent = i), n;
|
|
4146
4237
|
}
|
|
4147
|
-
function
|
|
4238
|
+
function I(i, e) {
|
|
4148
4239
|
const t = document.createElement("span");
|
|
4149
4240
|
return e && (t.className = e), i && (t.textContent = i), t;
|
|
4150
4241
|
}
|
|
4151
|
-
function
|
|
4242
|
+
function Cn(i, e, t, n) {
|
|
4152
4243
|
const r = document.createElement("img");
|
|
4153
4244
|
return e && (r.className = e), r.src = i, r;
|
|
4154
4245
|
}
|
|
4155
|
-
function
|
|
4246
|
+
function Mr(i, e, t) {
|
|
4156
4247
|
const n = document.createElement("video"), r = document.createElement("source");
|
|
4157
4248
|
return n.className = e, r.src = i, n.appendChild(r), n;
|
|
4158
4249
|
}
|
|
4159
|
-
function
|
|
4250
|
+
function Vr(i, e, t) {
|
|
4160
4251
|
const n = document.createElement("audio"), r = document.createElement("source");
|
|
4161
4252
|
return n.className = e, n.controls = !0, r.src = i, n.appendChild(r), n;
|
|
4162
4253
|
}
|
|
4163
|
-
function
|
|
4254
|
+
function z(i, e, t, n, r) {
|
|
4164
4255
|
const s = document.createElement("button");
|
|
4165
4256
|
return e && (s.className = e), t && (s.id = t), i && (s.textContent = i), r && (s.innerHTML = r), s.disabled = n, s;
|
|
4166
4257
|
}
|
|
4167
|
-
function
|
|
4258
|
+
function kt(i, e, t) {
|
|
4168
4259
|
const n = document.createElement("input");
|
|
4169
4260
|
return n.className = e, n.defaultValue = t, i && (n.type = i), n;
|
|
4170
4261
|
}
|
|
4171
|
-
class
|
|
4262
|
+
class Hr extends Z {
|
|
4172
4263
|
constructor() {
|
|
4173
4264
|
super("com.hamropatro.grpc.cms.ImageUploadRequest", [
|
|
4174
4265
|
{
|
|
@@ -4209,8 +4300,8 @@ class Or extends Z {
|
|
|
4209
4300
|
return r !== !1 && (r == !0 ? N.onWrite : r)(this.typeName, e, t), t;
|
|
4210
4301
|
}
|
|
4211
4302
|
}
|
|
4212
|
-
const
|
|
4213
|
-
class
|
|
4303
|
+
const Wn = new Hr();
|
|
4304
|
+
class $r extends Z {
|
|
4214
4305
|
constructor() {
|
|
4215
4306
|
super("com.hamropatro.grpc.cms.ImageUploadResponse", [
|
|
4216
4307
|
{
|
|
@@ -4262,14 +4353,14 @@ class Dr extends Z {
|
|
|
4262
4353
|
return r !== !1 && (r == !0 ? N.onWrite : r)(this.typeName, e, t), t;
|
|
4263
4354
|
}
|
|
4264
4355
|
}
|
|
4265
|
-
const
|
|
4266
|
-
{ name: "Upload", options: {}, I:
|
|
4356
|
+
const Wr = new $r(), Nt = new Bt("com.hamropatro.grpc.cms.ImageUploadService", [
|
|
4357
|
+
{ name: "Upload", options: {}, I: Wn, O: Wr }
|
|
4267
4358
|
]);
|
|
4268
|
-
class
|
|
4359
|
+
class jr {
|
|
4269
4360
|
constructor(e) {
|
|
4270
|
-
x(this, "typeName",
|
|
4271
|
-
x(this, "methods",
|
|
4272
|
-
x(this, "options",
|
|
4361
|
+
x(this, "typeName", Nt.typeName);
|
|
4362
|
+
x(this, "methods", Nt.methods);
|
|
4363
|
+
x(this, "options", Nt.options);
|
|
4273
4364
|
this._transport = e;
|
|
4274
4365
|
}
|
|
4275
4366
|
/**
|
|
@@ -4277,12 +4368,12 @@ class Ur {
|
|
|
4277
4368
|
*/
|
|
4278
4369
|
upload(e, t) {
|
|
4279
4370
|
const n = this.methods[0], r = this._transport.mergeOptions(t);
|
|
4280
|
-
return
|
|
4371
|
+
return ie("unary", this._transport, n, r, e);
|
|
4281
4372
|
}
|
|
4282
4373
|
}
|
|
4283
|
-
const
|
|
4374
|
+
const Zr = async (i) => {
|
|
4284
4375
|
var r;
|
|
4285
|
-
const e = (r = window.ImageSalonSDK) == null ? void 0 : r.grpcConfig, t = new
|
|
4376
|
+
const e = (r = window.ImageSalonSDK) == null ? void 0 : r.grpcConfig, t = new jr(e), n = Wn.create();
|
|
4286
4377
|
try {
|
|
4287
4378
|
return n.mimeType = i, await t.upload(
|
|
4288
4379
|
n
|
|
@@ -4290,9 +4381,9 @@ const Rr = async (i) => {
|
|
|
4290
4381
|
} catch (s) {
|
|
4291
4382
|
throw s;
|
|
4292
4383
|
}
|
|
4293
|
-
},
|
|
4384
|
+
}, En = async (i, e) => {
|
|
4294
4385
|
try {
|
|
4295
|
-
const t =
|
|
4386
|
+
const t = qr(i, e), r = (await Zr(e == null ? void 0 : e.type)).response.url;
|
|
4296
4387
|
return await fetch(r, {
|
|
4297
4388
|
method: "PUT",
|
|
4298
4389
|
headers: {
|
|
@@ -4304,7 +4395,7 @@ const Rr = async (i) => {
|
|
|
4304
4395
|
} catch (t) {
|
|
4305
4396
|
throw t;
|
|
4306
4397
|
}
|
|
4307
|
-
},
|
|
4398
|
+
}, qr = (i, e) => {
|
|
4308
4399
|
const t = e.type.split("/")[0];
|
|
4309
4400
|
let n = "";
|
|
4310
4401
|
t === "video" ? n = i == null ? void 0 : i.replace(/^data:video\/\w+;base64,/, "") : t === "image" ? n = i == null ? void 0 : i.replace(/^data:image\/\w+;base64,/, "") : t === "audio" && (n = i == null ? void 0 : i.replace(/^data:audio\/\w+;base64,/, ""));
|
|
@@ -4313,47 +4404,49 @@ const Rr = async (i) => {
|
|
|
4313
4404
|
s[o] = r.charCodeAt(o);
|
|
4314
4405
|
return s;
|
|
4315
4406
|
};
|
|
4316
|
-
var
|
|
4317
|
-
class
|
|
4407
|
+
var ke, M, S, fe, O, H, ae, G, xe, me, le, ne, Ne, Re, Fe, Le, ge, _e, ce, de, Ae, Ie, we, Me, ze, X, ye, Ge, ct, Je, j, Ve, Te, Ye, He, $e, We;
|
|
4408
|
+
class Xr {
|
|
4318
4409
|
constructor(e) {
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4410
|
+
C(this, ke);
|
|
4411
|
+
C(this, M);
|
|
4412
|
+
C(this, S);
|
|
4413
|
+
C(this, fe);
|
|
4414
|
+
C(this, O, []);
|
|
4415
|
+
C(this, H, []);
|
|
4416
|
+
C(this, ae);
|
|
4417
|
+
C(this, G);
|
|
4418
|
+
C(this, xe);
|
|
4419
|
+
C(this, me);
|
|
4420
|
+
C(this, le, []);
|
|
4421
|
+
C(this, ne);
|
|
4422
|
+
C(this, Ne);
|
|
4423
|
+
C(this, Re);
|
|
4424
|
+
C(this, Fe);
|
|
4425
|
+
C(this, Le);
|
|
4426
|
+
C(this, ge);
|
|
4427
|
+
C(this, _e);
|
|
4428
|
+
C(this, ce);
|
|
4429
|
+
C(this, de);
|
|
4430
|
+
C(this, Ae);
|
|
4431
|
+
C(this, Ie);
|
|
4432
|
+
C(this, we);
|
|
4433
|
+
C(this, Me);
|
|
4434
|
+
C(this, ze);
|
|
4435
|
+
C(this, X);
|
|
4436
|
+
C(this, ye);
|
|
4437
|
+
C(this, Ge, !1);
|
|
4438
|
+
C(this, ct);
|
|
4439
|
+
C(this, Je);
|
|
4440
|
+
C(this, j);
|
|
4441
|
+
C(this, Ve);
|
|
4442
|
+
C(this, Te);
|
|
4443
|
+
C(this, Ye);
|
|
4444
|
+
C(this, He);
|
|
4445
|
+
C(this, $e);
|
|
4446
|
+
C(this, We);
|
|
4447
|
+
p(this, Je, e.isAdmin), p(this, ae, !1), p(this, Re, e.handleUpload.bind(this)), p(this, ze, e.accessToken), this._grpcOptionInitializer(), this._init(e).then(() => {
|
|
4448
|
+
p(this, Ge, !0), this._renderView(e), this.updateWindowObject({ initialized: !0 }), this._initializeGrpcConfig(e.mode, e.endPoint);
|
|
4449
|
+
});
|
|
4357
4450
|
}
|
|
4358
4451
|
async _init(e) {
|
|
4359
4452
|
try {
|
|
@@ -4367,14 +4460,14 @@ class $r {
|
|
|
4367
4460
|
return e.isAdmin === !0;
|
|
4368
4461
|
}
|
|
4369
4462
|
_renderView(e) {
|
|
4370
|
-
return this._isAdminOptions(e) ? this._renderAdminView(e) : this._renderUserView(e);
|
|
4463
|
+
return this._isAdminOptions(e) ? (p(this, G, !1), p(this, xe, !1), p(this, Fe, 0), p(this, de, ""), p(this, we, !1), p(this, Ye, e.mode), p(this, Ae, !1), p(this, Te, ""), p(this, ye, null), this._removeToastContainer(), this._renderAdminView(e)) : (p(this, Ve, ""), p(this, me, e == null ? void 0 : e.folderName), p(this, He, e.restrictedFileSize), p(this, $e, e == null ? void 0 : e.localizedFileRestrictedMessage), p(this, We, e == null ? void 0 : e.localizedErrorMessage), this._removeUserToast(), this._renderUserView(e));
|
|
4371
4464
|
}
|
|
4372
4465
|
_renderAdminView(e) {
|
|
4373
|
-
if (!d(this,
|
|
4466
|
+
if (!d(this, Ge)) return;
|
|
4374
4467
|
const { parentContainerId: t } = e;
|
|
4375
4468
|
if (e.isAdmin === !0)
|
|
4376
4469
|
var { buttonProps: n } = e;
|
|
4377
|
-
p(this,
|
|
4470
|
+
p(this, ke, document.getElementById(t));
|
|
4378
4471
|
const r = document.createElement("button");
|
|
4379
4472
|
r.className = n != null && n.buttonClass ? n == null ? void 0 : n.buttonClass : "browse-image-button", r.addEventListener("focus", () => {
|
|
4380
4473
|
r.blur();
|
|
@@ -4384,70 +4477,70 @@ class $r {
|
|
|
4384
4477
|
const o = document.createElement("span");
|
|
4385
4478
|
o.innerHTML = n != null && n.buttonIcon ? n == null ? void 0 : n.buttonIcon : "", r.type = "button", r.append(s, o), n != null && n.buttonStyle && Object.assign(r.style, n == null ? void 0 : n.buttonStyle), r.addEventListener("click", () => {
|
|
4386
4479
|
this._selectedImageContainer();
|
|
4387
|
-
}), d(this,
|
|
4480
|
+
}), d(this, ke).appendChild(r);
|
|
4388
4481
|
}
|
|
4389
4482
|
async _grpcOptionInitializer() {
|
|
4390
|
-
p(this,
|
|
4391
|
-
d(this,
|
|
4392
|
-
d(this,
|
|
4483
|
+
p(this, X, await Rr(
|
|
4484
|
+
d(this, ze),
|
|
4485
|
+
d(this, Ye)
|
|
4393
4486
|
));
|
|
4394
4487
|
}
|
|
4395
4488
|
_selectedImageContainer() {
|
|
4396
4489
|
var g;
|
|
4397
|
-
p(this,
|
|
4490
|
+
p(this, Ne, z(
|
|
4398
4491
|
`Save (${(g = d(this, O)) == null ? void 0 : g.length})`,
|
|
4399
4492
|
"dialog-btn confirm"
|
|
4400
|
-
)), p(this,
|
|
4401
|
-
const e =
|
|
4402
|
-
|
|
4493
|
+
)), p(this, Le, y("folder-container")), p(this, ge, y("folder-list-wrapper")), this._fetchAllFolders();
|
|
4494
|
+
const e = z("Cancel", "dialog-btn cancel");
|
|
4495
|
+
z(
|
|
4403
4496
|
"",
|
|
4404
4497
|
"dialog-modal-close-btn",
|
|
4405
4498
|
"",
|
|
4406
4499
|
!1,
|
|
4407
4500
|
'<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>'
|
|
4408
4501
|
).addEventListener("click", () => {
|
|
4409
|
-
|
|
4410
|
-
}), p(this,
|
|
4502
|
+
rt.hide(), p(this, O, []), p(this, H, []);
|
|
4503
|
+
}), p(this, M, y("browse-container"));
|
|
4411
4504
|
const n = y();
|
|
4412
4505
|
n.style.display = "flex", n.style.alignItems = "center", n.style.justifyContent = "space-between", n.style.padding = "10px 20px";
|
|
4413
|
-
const r =
|
|
4414
|
-
s.append(
|
|
4506
|
+
const r = Pe("Folders", "folder-title"), s = z("", "add-folder-btn");
|
|
4507
|
+
s.append(gn()), this._createUpdateFolderDialog(s, "create"), n.append(r, s), d(this, Le).append(n, d(this, ge));
|
|
4415
4508
|
const o = this._renderSearchField(), a = this._createBrowseMoreContainer(), l = this._createBrowseImageMain(), c = y("footer");
|
|
4416
4509
|
e.onclick = () => {
|
|
4417
|
-
|
|
4418
|
-
}, d(this,
|
|
4419
|
-
d(this,
|
|
4420
|
-
}, c.append(e, d(this,
|
|
4510
|
+
rt.hide(), p(this, H, []), p(this, O, []);
|
|
4511
|
+
}, d(this, Ne).onclick = () => {
|
|
4512
|
+
d(this, Re).call(this), rt.hide(), p(this, O, []), p(this, H, []);
|
|
4513
|
+
}, c.append(e, d(this, Ne));
|
|
4421
4514
|
const h = y("container-right-main");
|
|
4422
|
-
h.append(o, a, l, c), d(this,
|
|
4423
|
-
content: d(this,
|
|
4515
|
+
h.append(o, a, l, c), d(this, M).append(d(this, Le), h), rt.show({
|
|
4516
|
+
content: d(this, M)
|
|
4424
4517
|
});
|
|
4425
4518
|
}
|
|
4426
4519
|
_renderUserView(e) {
|
|
4427
|
-
const { parentContainerId: t, restrictedFileSize: n } = e;
|
|
4428
|
-
p(this,
|
|
4429
|
-
const
|
|
4520
|
+
const { parentContainerId: t, restrictedFileSize: n, imagePreview: r } = e;
|
|
4521
|
+
p(this, ke, document.getElementById(t)), p(this, j, F("div", "user-view-container"));
|
|
4522
|
+
const s = y("user-view-browse-wrapper"), o = F(
|
|
4430
4523
|
"span",
|
|
4431
4524
|
"",
|
|
4432
4525
|
"",
|
|
4433
4526
|
"Drag & Drop or "
|
|
4434
|
-
),
|
|
4435
|
-
if (
|
|
4436
|
-
const
|
|
4527
|
+
), a = this._renderUserViewBrowseButton(), l = F("p", "", "margin-block: 0px; font-size:14px");
|
|
4528
|
+
if (l.append(o, a), n) {
|
|
4529
|
+
const c = F(
|
|
4437
4530
|
"p",
|
|
4438
4531
|
"",
|
|
4439
4532
|
"margin-block: 0px; font-size: 13px; color: #777",
|
|
4440
|
-
`Max File size: ${n}`
|
|
4533
|
+
`Max File size: ${n}MB`
|
|
4441
4534
|
);
|
|
4442
|
-
|
|
4535
|
+
s.append(Et(), l, c);
|
|
4443
4536
|
} else
|
|
4444
|
-
|
|
4445
|
-
return this._setupDragAndDrop(d(this,
|
|
4537
|
+
s.append(Et(), l);
|
|
4538
|
+
return this._setupDragAndDrop(d(this, j)), d(this, j).append(s), r && this._renderImagePreview(r), d(this, ke).appendChild(d(this, j)), d(this, ke);
|
|
4446
4539
|
}
|
|
4447
4540
|
_setupDragAndDrop(e) {
|
|
4448
4541
|
if (!e) return;
|
|
4449
4542
|
["dragenter", "dragover", "dragleave", "drop"].forEach((n) => {
|
|
4450
|
-
d(this,
|
|
4543
|
+
d(this, j).addEventListener(
|
|
4451
4544
|
n,
|
|
4452
4545
|
(r) => {
|
|
4453
4546
|
r.preventDefault(), r.stopPropagation();
|
|
@@ -4455,22 +4548,22 @@ class $r {
|
|
|
4455
4548
|
!1
|
|
4456
4549
|
);
|
|
4457
4550
|
}), ["dragenter", "dragover"].forEach((n) => {
|
|
4458
|
-
d(this,
|
|
4551
|
+
d(this, j).addEventListener(
|
|
4459
4552
|
n,
|
|
4460
4553
|
() => {
|
|
4461
|
-
d(this,
|
|
4554
|
+
d(this, j).classList.add("highlight");
|
|
4462
4555
|
},
|
|
4463
4556
|
!1
|
|
4464
4557
|
);
|
|
4465
4558
|
}), ["dragleave", "drop"].forEach((n) => {
|
|
4466
|
-
d(this,
|
|
4559
|
+
d(this, j).addEventListener(
|
|
4467
4560
|
n,
|
|
4468
4561
|
() => {
|
|
4469
|
-
d(this,
|
|
4562
|
+
d(this, j).classList.remove("highlight");
|
|
4470
4563
|
},
|
|
4471
4564
|
!1
|
|
4472
4565
|
);
|
|
4473
|
-
}), d(this,
|
|
4566
|
+
}), d(this, j).addEventListener(
|
|
4474
4567
|
"drop",
|
|
4475
4568
|
(n) => {
|
|
4476
4569
|
var s;
|
|
@@ -4481,40 +4574,73 @@ class $r {
|
|
|
4481
4574
|
);
|
|
4482
4575
|
}
|
|
4483
4576
|
_renderImagePreview(e, t) {
|
|
4484
|
-
|
|
4577
|
+
var l;
|
|
4578
|
+
const n = document.getElementById("user-image-preview");
|
|
4579
|
+
n && n.remove();
|
|
4580
|
+
const r = F("div", "user-image-preview");
|
|
4581
|
+
r.id = "user-image-preview";
|
|
4582
|
+
const s = F(
|
|
4485
4583
|
"img",
|
|
4486
4584
|
"",
|
|
4487
|
-
"width:
|
|
4585
|
+
"max-width: 230px;max-height:250px;object-fit:cover;"
|
|
4488
4586
|
);
|
|
4489
|
-
|
|
4490
|
-
const
|
|
4587
|
+
s.src = e, s.alt = t || "";
|
|
4588
|
+
const o = F(
|
|
4491
4589
|
"div",
|
|
4492
4590
|
"",
|
|
4493
4591
|
"width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; padding: 4px; position: absolute; top: -10px; right: -10px; background: #c10007; border-radius: 50%;z-index:1"
|
|
4494
|
-
),
|
|
4495
|
-
|
|
4496
|
-
var
|
|
4497
|
-
(
|
|
4498
|
-
}),
|
|
4592
|
+
), a = Tt();
|
|
4593
|
+
a.style.fill = "#fff", o == null || o.appendChild(a), o.addEventListener("click", () => {
|
|
4594
|
+
var c;
|
|
4595
|
+
(c = d(this, j)) == null || c.removeChild(r), this._removeUserToast();
|
|
4596
|
+
}), r == null || r.append(s, o), (l = d(this, j)) == null || l.append(r);
|
|
4499
4597
|
}
|
|
4500
4598
|
_handleDroppedFile(e) {
|
|
4501
4599
|
this._readFileAsBase64(e);
|
|
4502
4600
|
}
|
|
4503
4601
|
_readFileAsBase64(e) {
|
|
4504
|
-
const t =
|
|
4505
|
-
|
|
4602
|
+
const t = d(this, He) * 1024 * 1024;
|
|
4603
|
+
if (e.size > t) {
|
|
4604
|
+
this._renderUserToast(
|
|
4605
|
+
d(this, $e) ? d(this, $e) : `File size must be less than ${d(this, He)}MB.`
|
|
4606
|
+
);
|
|
4607
|
+
return;
|
|
4608
|
+
}
|
|
4609
|
+
this._removeUserToast();
|
|
4610
|
+
const n = new FileReader();
|
|
4611
|
+
n.readAsDataURL(e), n.onload = () => {
|
|
4506
4612
|
this._userViewUploadAndAddSelectedImageList(
|
|
4507
|
-
|
|
4613
|
+
n.result,
|
|
4508
4614
|
e
|
|
4509
4615
|
);
|
|
4510
|
-
},
|
|
4511
|
-
console.error("Error reading file:",
|
|
4616
|
+
}, n.onerror = () => {
|
|
4617
|
+
console.error("Error reading file:", n.error);
|
|
4512
4618
|
};
|
|
4513
4619
|
}
|
|
4620
|
+
_renderUserToast(e) {
|
|
4621
|
+
const t = F(
|
|
4622
|
+
"div",
|
|
4623
|
+
"",
|
|
4624
|
+
"display:flex;align-items:center;gap:5px;"
|
|
4625
|
+
);
|
|
4626
|
+
t.id = "user-toast-container";
|
|
4627
|
+
const n = F(
|
|
4628
|
+
"p",
|
|
4629
|
+
"",
|
|
4630
|
+
"color:#ee3f3f;margin-block:0px;font-size:14px;padding-top:3px"
|
|
4631
|
+
);
|
|
4632
|
+
n.textContent = e;
|
|
4633
|
+
const r = Ct();
|
|
4634
|
+
r.style.width = "15px", r.style.height = "15px", t.append(r, n), d(this, j).firstChild.appendChild(t);
|
|
4635
|
+
}
|
|
4636
|
+
_removeUserToast() {
|
|
4637
|
+
const e = document.getElementById("user-toast-container");
|
|
4638
|
+
e && e.remove();
|
|
4639
|
+
}
|
|
4514
4640
|
_renderUserViewBrowseButton() {
|
|
4515
|
-
const e =
|
|
4641
|
+
const e = kt("file");
|
|
4516
4642
|
e.style.display = "none", e.setAttribute("multiple", "true"), e.setAttribute("accept", "image/*");
|
|
4517
|
-
const t =
|
|
4643
|
+
const t = F(
|
|
4518
4644
|
"a",
|
|
4519
4645
|
"user-upload-btn",
|
|
4520
4646
|
"",
|
|
@@ -4525,16 +4651,49 @@ class $r {
|
|
|
4525
4651
|
n && this._readFileAsBase64(n), e.value = "";
|
|
4526
4652
|
}), t;
|
|
4527
4653
|
}
|
|
4654
|
+
_renderUserUploading() {
|
|
4655
|
+
const e = F(
|
|
4656
|
+
"div",
|
|
4657
|
+
"",
|
|
4658
|
+
"margin-top:10px;display:flex;flex-direction:column;align-items:center;gap:5px;font-weight:600;font-size:14px"
|
|
4659
|
+
);
|
|
4660
|
+
e.id = "user-uploading", e.innerHTML = "Uploading...";
|
|
4661
|
+
const t = F("div", "linear-loader");
|
|
4662
|
+
e.appendChild(t), d(this, j).append(e);
|
|
4663
|
+
}
|
|
4664
|
+
_removeUserUploading() {
|
|
4665
|
+
const e = document.getElementById("user-uploading");
|
|
4666
|
+
e && e.remove();
|
|
4667
|
+
}
|
|
4528
4668
|
async _userViewUploadAndAddSelectedImageList(e, t) {
|
|
4669
|
+
p(this, ae, !0), this._renderUserUploading();
|
|
4529
4670
|
try {
|
|
4530
|
-
|
|
4531
|
-
const n = await
|
|
4532
|
-
|
|
4671
|
+
this._renderImagePreview(e, t.name);
|
|
4672
|
+
const n = await En(e, t);
|
|
4673
|
+
await this._uploadForUser(n, t);
|
|
4533
4674
|
} catch {
|
|
4675
|
+
this._renderUserToast(
|
|
4676
|
+
d(this, We) ? d(this, We) : "Error uploading. Please try again later."
|
|
4677
|
+
);
|
|
4678
|
+
} finally {
|
|
4679
|
+
p(this, ae, !1), this._removeUserUploading();
|
|
4680
|
+
}
|
|
4681
|
+
}
|
|
4682
|
+
async _uploadForUser(e, t) {
|
|
4683
|
+
var n;
|
|
4684
|
+
try {
|
|
4685
|
+
const r = await hr(
|
|
4686
|
+
e,
|
|
4687
|
+
he[bn((n = t.type) == null ? void 0 : n.split("/")[0])],
|
|
4688
|
+
d(this, X)
|
|
4689
|
+
);
|
|
4690
|
+
p(this, Ve, r == null ? void 0 : r.response), d(this, Re).call(this);
|
|
4691
|
+
} catch (r) {
|
|
4692
|
+
throw Error(r);
|
|
4534
4693
|
}
|
|
4535
4694
|
}
|
|
4536
4695
|
_createAllAndSelectedTab(e) {
|
|
4537
|
-
const t = y("select-options"), n =
|
|
4696
|
+
const t = y("select-options"), n = Pe("Browse", "select"), r = Pe(
|
|
4538
4697
|
"Selected",
|
|
4539
4698
|
"select",
|
|
4540
4699
|
"selected-images-tab"
|
|
@@ -4542,15 +4701,15 @@ class $r {
|
|
|
4542
4701
|
n.classList.add("selected"), [n, r].forEach((o, a) => {
|
|
4543
4702
|
o.addEventListener("click", () => {
|
|
4544
4703
|
var l;
|
|
4545
|
-
p(this,
|
|
4704
|
+
p(this, Fe, a), (l = document.querySelector(".select.selected")) == null || l.classList.remove("selected"), o.classList.add("selected"), this._updateSelectedImageListContainerUI();
|
|
4546
4705
|
});
|
|
4547
4706
|
}), t.append(n, r), e.appendChild(t);
|
|
4548
4707
|
}
|
|
4549
4708
|
_renderUploadButton() {
|
|
4550
|
-
const e =
|
|
4551
|
-
e.style.display = "none", e.setAttribute("multiple", "true"), e.setAttribute("accept", "image/*,video/*,audio/*,.gif"), p(this,
|
|
4709
|
+
const e = kt("file");
|
|
4710
|
+
e.style.display = "none", e.setAttribute("multiple", "true"), e.setAttribute("accept", "image/*,video/*,audio/*,.gif"), p(this, fe, document.createElement("button")), d(this, fe).className = "browse-more-btn";
|
|
4552
4711
|
const t = document.createElement("span");
|
|
4553
|
-
return t.textContent = "Upload", d(this,
|
|
4712
|
+
return t.textContent = "Upload", d(this, fe).append(Et(), t), d(this, fe).type = "button", d(this, fe).addEventListener(
|
|
4554
4713
|
"click",
|
|
4555
4714
|
() => e.click()
|
|
4556
4715
|
), e.addEventListener("change", () => {
|
|
@@ -4564,13 +4723,13 @@ class $r {
|
|
|
4564
4723
|
);
|
|
4565
4724
|
};
|
|
4566
4725
|
}), e.value = "";
|
|
4567
|
-
}), d(this,
|
|
4726
|
+
}), d(this, fe);
|
|
4568
4727
|
}
|
|
4569
4728
|
_renderCreateFolderBtn() {
|
|
4570
4729
|
const e = document.createElement("button");
|
|
4571
4730
|
e.className = "create-folder-btn";
|
|
4572
4731
|
const t = document.createElement("span");
|
|
4573
|
-
return t.textContent = "Create", e.append(
|
|
4732
|
+
return t.textContent = "Create", e.append(gn(), t), this._createUpdateFolderDialog(e, "create"), e;
|
|
4574
4733
|
}
|
|
4575
4734
|
_renderSearchField() {
|
|
4576
4735
|
let e;
|
|
@@ -4578,42 +4737,42 @@ class $r {
|
|
|
4578
4737
|
"search-input-wrapper",
|
|
4579
4738
|
"search-input-wrapper"
|
|
4580
4739
|
);
|
|
4581
|
-
p(this,
|
|
4582
|
-
p(this,
|
|
4740
|
+
p(this, Ie, kt("search")), d(this, Ie).value = "", d(this, Ie).addEventListener("input", (s) => {
|
|
4741
|
+
p(this, H, []);
|
|
4583
4742
|
const o = s.target;
|
|
4584
4743
|
e && clearTimeout(e), e = setTimeout(() => {
|
|
4585
4744
|
if (!o.value) {
|
|
4586
|
-
p(this,
|
|
4745
|
+
p(this, de, ""), p(this, Ae, !1), p(this, we, !1), this._fetchFilesFromFolder(d(this, me));
|
|
4587
4746
|
return;
|
|
4588
4747
|
}
|
|
4589
|
-
p(this,
|
|
4748
|
+
p(this, we, !0), p(this, Me, o.value), this._search(d(this, Me));
|
|
4590
4749
|
}, 750);
|
|
4591
|
-
}), d(this,
|
|
4592
|
-
const r =
|
|
4593
|
-
return r.style.position = "absolute", r.style.top = "50%", r.style.left = "5%", r.style.transform = "translate(-5%, -50%)", n.append(r, d(this,
|
|
4750
|
+
}), d(this, Ie).setAttribute("placeholder", "Search");
|
|
4751
|
+
const r = xr();
|
|
4752
|
+
return r.style.position = "absolute", r.style.top = "50%", r.style.left = "5%", r.style.transform = "translate(-5%, -50%)", n.append(r, d(this, Ie)), t.append(n), t;
|
|
4594
4753
|
}
|
|
4595
4754
|
_createBrowseMoreContainer() {
|
|
4596
|
-
p(this,
|
|
4755
|
+
p(this, _e, y("browse-more-btn-container")), this._createAllAndSelectedTab(d(this, _e));
|
|
4597
4756
|
const e = this._renderUploadButton(), t = this._renderCreateFolderBtn(), n = document.createElement("div");
|
|
4598
|
-
return n.style.display = "flex", n.style.alignItems = "center", n.style.gap = "10px", n.append(e, t), d(this,
|
|
4757
|
+
return n.style.display = "flex", n.style.alignItems = "center", n.style.gap = "10px", n.append(e, t), d(this, _e).appendChild(n), d(this, _e);
|
|
4599
4758
|
}
|
|
4600
4759
|
_createBrowseImageMain() {
|
|
4601
4760
|
const e = y("browse-image-main");
|
|
4602
|
-
return p(this,
|
|
4603
|
-
const t = d(this,
|
|
4604
|
-
t + n >= r - 5 && d(this, Ae) && (d(this,
|
|
4605
|
-
}), e.appendChild(d(this,
|
|
4761
|
+
return p(this, S, y("selected-image-container")), d(this, S).addEventListener("scroll", () => {
|
|
4762
|
+
const t = d(this, S).clientHeight, n = d(this, S).scrollTop, r = d(this, S).scrollHeight;
|
|
4763
|
+
t + n >= r - 5 && d(this, Ae) && (d(this, we) ? this._search(d(this, Me)) : this._fetchFilesFromFolder(d(this, me)));
|
|
4764
|
+
}), e.appendChild(d(this, S)), e;
|
|
4606
4765
|
}
|
|
4607
4766
|
_renderFetchingSkeletonUI() {
|
|
4608
4767
|
for (let e = 0; e < 20; e++) {
|
|
4609
4768
|
const t = y("skeleton");
|
|
4610
|
-
t.innerHTML = "", d(this,
|
|
4769
|
+
t.innerHTML = "", d(this, S).append(t);
|
|
4611
4770
|
}
|
|
4612
4771
|
}
|
|
4613
4772
|
_renderEmptyImageContainer() {
|
|
4614
|
-
if (d(this, G) || d(this,
|
|
4773
|
+
if (d(this, G) || d(this, ae)) return;
|
|
4615
4774
|
const e = y(), t = y(), n = document.createElement("p");
|
|
4616
|
-
d(this,
|
|
4775
|
+
d(this, we) && d(this, Fe) === 0 ? (t.innerHTML = `
|
|
4617
4776
|
<svg width="300" height="300" viewBox="0 0 1000 1000" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4618
4777
|
<g clip-path="url(#clip0_2304_257)">
|
|
4619
4778
|
<path d="M564.829 772.4H336.658V948.386H564.829V772.4Z" fill="#EBEBEB"/>
|
|
@@ -4697,15 +4856,15 @@ class $r {
|
|
|
4697
4856
|
</clipPath>
|
|
4698
4857
|
</defs>
|
|
4699
4858
|
</svg>
|
|
4700
|
-
`, n.textContent = "Looks Empty!"), e.append(t, n), d(this,
|
|
4859
|
+
`, n.textContent = "Looks Empty!"), e.append(t, n), d(this, S).appendChild(e);
|
|
4701
4860
|
}
|
|
4702
4861
|
_renderLoadingUI() {
|
|
4703
4862
|
const e = y("skeleton");
|
|
4704
|
-
e.innerHTML = "", d(this,
|
|
4863
|
+
e.innerHTML = "", d(this, S).appendChild(e);
|
|
4705
4864
|
}
|
|
4706
4865
|
_fileCardBody(e) {
|
|
4707
|
-
var
|
|
4708
|
-
const t = y("selected-image-content"), n = y("selected-image-top-bar"), r =
|
|
4866
|
+
var zt, Gt, Jt, Yt;
|
|
4867
|
+
const t = y("selected-image-content"), n = y("selected-image-top-bar"), r = z(
|
|
4709
4868
|
"",
|
|
4710
4869
|
"selected-image-btn",
|
|
4711
4870
|
"",
|
|
@@ -4713,143 +4872,143 @@ class $r {
|
|
|
4713
4872
|
'<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>'
|
|
4714
4873
|
);
|
|
4715
4874
|
let s, o;
|
|
4716
|
-
(e == null ? void 0 : e.type) ===
|
|
4875
|
+
(e == null ? void 0 : e.type) === he.IMAGE && (s = Cn(e == null ? void 0 : e.url, "selected-image"), o = Tr()), (e == null ? void 0 : e.type) === he.VIDEO && (s = Mr(e == null ? void 0 : e.url, "uploaded-video"), o = _r()), (e == null ? void 0 : e.type) === he.AUDIO && (s = Vr(e == null ? void 0 : e.url, "uploaded-audio"), o = Ar());
|
|
4717
4876
|
const a = y("selected-image-wrapper");
|
|
4718
4877
|
a.setAttribute("data-key", e == null ? void 0 : e.key);
|
|
4719
|
-
const l =
|
|
4878
|
+
const l = Pe(e == null ? void 0 : e.name, "selected-image-name"), c = I("", "selected-image-type");
|
|
4720
4879
|
c.append(o), n.append(c, r);
|
|
4721
4880
|
const h = y();
|
|
4722
4881
|
h.style.marginTop = "10px", h.style.display = "flex", h.style.justifyContent = "space-between", h.style.alignItems = "center", h.append(l), t.append(n, s), a.append(t, h);
|
|
4723
|
-
const g = y("action-wrapper"), w =
|
|
4724
|
-
w.append(B,
|
|
4725
|
-
const
|
|
4726
|
-
|
|
4727
|
-
const
|
|
4728
|
-
|
|
4729
|
-
const b =
|
|
4730
|
-
b.append(
|
|
4731
|
-
const
|
|
4882
|
+
const g = y("action-wrapper"), w = z("", "action-option preview"), L = I("Preview", ""), B = Br();
|
|
4883
|
+
w.append(B, L);
|
|
4884
|
+
const $ = z("", "action-option move"), A = I("Move", ""), W = vr();
|
|
4885
|
+
$.append(W, A);
|
|
4886
|
+
const q = z("", "action-option rename"), Q = I("Rename", ""), E = mn();
|
|
4887
|
+
q.append(E, Q);
|
|
4888
|
+
const b = z("", "action-option delete"), U = I("Delete", ""), K = wn();
|
|
4889
|
+
b.append(K, U);
|
|
4890
|
+
const ee = e.name.split(".")[0], jn = e.name.split(".")[1], Zn = Ke[e.type], xt = y("edit-form-wrapper"), _t = y("move-form-wrapper"), Ot = y("preview-details-container"), Ut = y("preview-details-wrapper"), Dt = y(
|
|
4732
4891
|
"preview-option-image-wrapper"
|
|
4733
|
-
),
|
|
4892
|
+
), St = y("preview-option-wrapper"), Rt = y("preview-option-wrapper"), Mt = y(
|
|
4734
4893
|
"preview-option-wrapper"
|
|
4735
|
-
),
|
|
4894
|
+
), Vt = y("preview-option-wrapper"), Ht = y(
|
|
4736
4895
|
"preview-option-wrapper"
|
|
4737
|
-
),
|
|
4896
|
+
), $t = y("preview-option-wrapper"), Wt = y(
|
|
4738
4897
|
"preview-option-wrapper"
|
|
4739
|
-
),
|
|
4740
|
-
|
|
4741
|
-
const
|
|
4742
|
-
|
|
4743
|
-
const
|
|
4898
|
+
), qn = Cn(e.url, "preview-option-image");
|
|
4899
|
+
Dt.append(qn);
|
|
4900
|
+
const Pn = I("File name", "preview-title"), jt = y("preview-option-name");
|
|
4901
|
+
jt.innerHTML = e.name, St.append(Pn, jt);
|
|
4902
|
+
const Kn = I("Folder name", "preview-title"), Xn = I(
|
|
4744
4903
|
e.folderName,
|
|
4745
4904
|
"preview-option-name"
|
|
4746
4905
|
);
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4906
|
+
Rt.append(
|
|
4907
|
+
Kn,
|
|
4908
|
+
Xn
|
|
4750
4909
|
);
|
|
4751
|
-
const
|
|
4910
|
+
const zn = I(
|
|
4752
4911
|
"File Extension",
|
|
4753
4912
|
"preview-title"
|
|
4754
|
-
),
|
|
4755
|
-
|
|
4913
|
+
), Gn = I(
|
|
4914
|
+
jn,
|
|
4756
4915
|
"preview-option-name extension"
|
|
4757
4916
|
);
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4917
|
+
Mt.append(
|
|
4918
|
+
zn,
|
|
4919
|
+
Gn
|
|
4761
4920
|
);
|
|
4762
|
-
const
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4921
|
+
const Jn = I("File type", "preview-title"), Yn = I(Zn, "preview-option-name");
|
|
4922
|
+
Vt.append(
|
|
4923
|
+
Jn,
|
|
4924
|
+
Yn
|
|
4766
4925
|
);
|
|
4767
|
-
const
|
|
4768
|
-
`${(
|
|
4926
|
+
const Qn = I("Dimension", "preview-title"), ei = I(
|
|
4927
|
+
`${(zt = e == null ? void 0 : e.metadata) == null ? void 0 : zt.width} * ${(Gt = e == null ? void 0 : e.metadata) == null ? void 0 : Gt.height}`,
|
|
4769
4928
|
"preview-option-name"
|
|
4770
4929
|
);
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4930
|
+
Ht.append(
|
|
4931
|
+
Qn,
|
|
4932
|
+
ei
|
|
4774
4933
|
);
|
|
4775
|
-
const
|
|
4934
|
+
const ti = I("URL", "preview-title"), ni = I(
|
|
4776
4935
|
e.url,
|
|
4777
4936
|
"preview-option-name url"
|
|
4778
4937
|
);
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4938
|
+
$t.append(
|
|
4939
|
+
ti,
|
|
4940
|
+
ni
|
|
4782
4941
|
);
|
|
4783
|
-
const
|
|
4942
|
+
const ii = I(
|
|
4784
4943
|
"Parent folder",
|
|
4785
4944
|
"preview-title"
|
|
4786
|
-
),
|
|
4945
|
+
), ri = I(
|
|
4787
4946
|
e.nestedFolderName,
|
|
4788
4947
|
"preview-option-name"
|
|
4789
4948
|
);
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
),
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4949
|
+
Wt.append(
|
|
4950
|
+
ii,
|
|
4951
|
+
ri
|
|
4952
|
+
), Ut.append(
|
|
4953
|
+
Rt,
|
|
4954
|
+
St,
|
|
4955
|
+
Mt,
|
|
4956
|
+
Vt,
|
|
4957
|
+
((Jt = e == null ? void 0 : e.metadata) == null ? void 0 : Jt.width) > 0 && ((Yt = e == null ? void 0 : e.metadata) == null ? void 0 : Yt.height) > 0 ? Ht : "",
|
|
4958
|
+
$t,
|
|
4959
|
+
e.nestedFolderName ? Wt : ""
|
|
4960
|
+
), Ot.append(
|
|
4797
4961
|
Dt,
|
|
4798
|
-
|
|
4799
|
-
Ut,
|
|
4800
|
-
e.nestedFolderName ? Rt : ""
|
|
4801
|
-
), vt.append(
|
|
4802
|
-
Bt,
|
|
4803
|
-
Tt
|
|
4962
|
+
Ut
|
|
4804
4963
|
);
|
|
4805
|
-
const
|
|
4806
|
-
|
|
4807
|
-
const
|
|
4808
|
-
|
|
4809
|
-
const
|
|
4810
|
-
|
|
4811
|
-
const
|
|
4964
|
+
const Zt = y("form-control"), Qe = document.createElement("input");
|
|
4965
|
+
Zt.appendChild(Qe), Qe.classList.add("input-field"), Qe.value = e.name;
|
|
4966
|
+
const qt = y("form-control"), si = I("Current Folder:", "input-label"), pt = y("folder-field current");
|
|
4967
|
+
pt.textContent = e.folderName, pt.prepend(qe()), qt.append(si, pt);
|
|
4968
|
+
const Pt = y("form-control"), Oe = y();
|
|
4969
|
+
Oe.style.width = "100%", Oe.style.display = "flex", Oe.style.alignItems = "center", Oe.style.justifyContent = "space-between";
|
|
4970
|
+
const oi = I(
|
|
4812
4971
|
"Suggested Folder List:",
|
|
4813
4972
|
"input-label"
|
|
4814
|
-
),
|
|
4815
|
-
|
|
4816
|
-
const
|
|
4817
|
-
|
|
4818
|
-
const
|
|
4819
|
-
|
|
4973
|
+
), Be = I();
|
|
4974
|
+
Be.style.display = "flex", Be.style.alignItems = "center", Be.style.gap = "5px", Be.style.fontSize = "14px", Be.textContent = "Move the file in selected folder", Be.appendChild(Ct("14px", "14px", "#333")), Oe.append(oi, Be);
|
|
4975
|
+
const Ze = y();
|
|
4976
|
+
Ze.style.width = "100%", Ze.style.maxHeight = "250px", Ze.style.overflowY = "auto";
|
|
4977
|
+
const ft = document.createElement("ul");
|
|
4978
|
+
ft.className = "folders", Ze.append(ft), Pt.append(Oe, Ze), d(this, le).forEach((_) => {
|
|
4820
4979
|
const De = this._renderEditFolderListContainer(_);
|
|
4821
|
-
|
|
4980
|
+
ft.appendChild(De);
|
|
4822
4981
|
});
|
|
4823
|
-
const
|
|
4982
|
+
const Kt = y("form-control"), ai = I("Destination Folder:", "input-label"), Xt = y(
|
|
4824
4983
|
"folder-field source",
|
|
4825
4984
|
"source-folder-wrapper"
|
|
4826
|
-
),
|
|
4827
|
-
|
|
4828
|
-
let
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
},
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4985
|
+
), mt = document.createElement("span");
|
|
4986
|
+
mt.id = "source-folder-name", mt.textContent = d(this, Te) ? d(this, Te) : e.folderName, Xt.append(qe(), mt);
|
|
4987
|
+
let Ue = "";
|
|
4988
|
+
Kt.append(ai, Xt), Qe.onchange = (_) => {
|
|
4989
|
+
Ue = _.target.value;
|
|
4990
|
+
}, Ue = Ue !== "" ? Ue : e.name, xt.append(Zt), _t.append(
|
|
4991
|
+
qt,
|
|
4992
|
+
Pt,
|
|
4993
|
+
Kt
|
|
4835
4994
|
), g.append(
|
|
4836
4995
|
w,
|
|
4837
|
-
|
|
4838
|
-
|
|
4996
|
+
$,
|
|
4997
|
+
q,
|
|
4839
4998
|
b
|
|
4840
4999
|
), w.onclick = (_) => {
|
|
4841
|
-
_.stopPropagation(), J.hide(),
|
|
4842
|
-
content:
|
|
4843
|
-
header:
|
|
5000
|
+
_.stopPropagation(), J.hide(), D.show({
|
|
5001
|
+
content: Ot,
|
|
5002
|
+
header: ee,
|
|
4844
5003
|
dialogContentStyle: {
|
|
4845
5004
|
minWidth: "60rem",
|
|
4846
5005
|
padding: "10px"
|
|
4847
5006
|
},
|
|
4848
5007
|
showCloseBtn: !0
|
|
4849
5008
|
});
|
|
4850
|
-
},
|
|
4851
|
-
_.stopPropagation(), J.hide(),
|
|
4852
|
-
content:
|
|
5009
|
+
}, $.onclick = (_) => {
|
|
5010
|
+
_.stopPropagation(), J.hide(), D.show({
|
|
5011
|
+
content: _t,
|
|
4853
5012
|
header: `Move "${e.name}"`,
|
|
4854
5013
|
confirmButtonText: "Move",
|
|
4855
5014
|
dialogContentStyle: {
|
|
@@ -4859,15 +5018,15 @@ class $r {
|
|
|
4859
5018
|
showCloseBtn: !0,
|
|
4860
5019
|
showFooter: !0,
|
|
4861
5020
|
onCancel: () => {
|
|
4862
|
-
|
|
5021
|
+
D.hide();
|
|
4863
5022
|
},
|
|
4864
5023
|
onConfirm: () => {
|
|
4865
|
-
this._updateFile(
|
|
5024
|
+
this._updateFile(Ue, e);
|
|
4866
5025
|
}
|
|
4867
5026
|
});
|
|
4868
|
-
},
|
|
4869
|
-
_.stopPropagation(), J.hide(),
|
|
4870
|
-
content:
|
|
5027
|
+
}, q.onclick = (_) => {
|
|
5028
|
+
_.stopPropagation(), J.hide(), D.show({
|
|
5029
|
+
content: xt,
|
|
4871
5030
|
header: "Rename",
|
|
4872
5031
|
confirmButtonText: "Update",
|
|
4873
5032
|
dialogContentStyle: {
|
|
@@ -4876,14 +5035,14 @@ class $r {
|
|
|
4876
5035
|
showCloseBtn: !0,
|
|
4877
5036
|
showFooter: !0,
|
|
4878
5037
|
onCancel: () => {
|
|
4879
|
-
|
|
5038
|
+
D.hide();
|
|
4880
5039
|
},
|
|
4881
5040
|
onConfirm: () => {
|
|
4882
|
-
this._updateFile(
|
|
5041
|
+
this._updateFile(Ue, e);
|
|
4883
5042
|
}
|
|
4884
5043
|
});
|
|
4885
5044
|
}, b.onclick = (_) => {
|
|
4886
|
-
_.stopPropagation(), J.hide(),
|
|
5045
|
+
_.stopPropagation(), J.hide(), D.show({
|
|
4887
5046
|
content: "",
|
|
4888
5047
|
dialogContentStyle: {
|
|
4889
5048
|
minWidth: "32rem",
|
|
@@ -4902,38 +5061,38 @@ class $r {
|
|
|
4902
5061
|
content: g,
|
|
4903
5062
|
mainContainer: n,
|
|
4904
5063
|
divId: e.key
|
|
4905
|
-
}), p(this,
|
|
5064
|
+
}), p(this, ye, e.key);
|
|
4906
5065
|
}), s.addEventListener("click", () => {
|
|
4907
5066
|
const _ = d(this, O).findIndex(
|
|
4908
|
-
(
|
|
5067
|
+
(Ce) => (Ce == null ? void 0 : Ce.key) === (e == null ? void 0 : e.key)
|
|
4909
5068
|
);
|
|
4910
5069
|
if (t.classList.contains("checked"))
|
|
4911
|
-
t.classList.remove("checked"), _ !== -1 && (d(this, O).splice(_, 1), d(this,
|
|
5070
|
+
t.classList.remove("checked"), _ !== -1 && (d(this, O).splice(_, 1), d(this, Fe) === 1 && a.remove());
|
|
4912
5071
|
else {
|
|
4913
|
-
if (d(this,
|
|
5072
|
+
if (d(this, ct))
|
|
4914
5073
|
d(this, O).push(e);
|
|
4915
5074
|
else {
|
|
4916
|
-
const
|
|
5075
|
+
const Ce = document.querySelector(
|
|
4917
5076
|
".selected-image-wrapper .checked"
|
|
4918
5077
|
);
|
|
4919
|
-
|
|
5078
|
+
Ce == null || Ce.classList.remove("checked"), p(this, O, [e]);
|
|
4920
5079
|
}
|
|
4921
5080
|
t.classList.add("checked");
|
|
4922
5081
|
}
|
|
4923
5082
|
this._updateContent();
|
|
4924
5083
|
}), document.addEventListener("click", (_) => {
|
|
4925
|
-
const De = document.querySelector(`#${d(this,
|
|
5084
|
+
const De = document.querySelector(`#${d(this, ye)}`);
|
|
4926
5085
|
De && (_.composedPath().includes(De) || J.hide());
|
|
4927
5086
|
}), d(this, O).findIndex(
|
|
4928
5087
|
(_) => (_ == null ? void 0 : _.key) === (e == null ? void 0 : e.key)
|
|
4929
|
-
) !== -1 ? (t.classList.add("checked"), d(this,
|
|
5088
|
+
) !== -1 ? (t.classList.add("checked"), d(this, we) ? d(this, S).prepend(a) : d(this, S).appendChild(a)) : d(this, S).appendChild(a);
|
|
4930
5089
|
}
|
|
4931
5090
|
_renderImageCard(e) {
|
|
4932
5091
|
this._fileCardBody(e);
|
|
4933
5092
|
}
|
|
4934
5093
|
_renderImageListContainer() {
|
|
4935
5094
|
var e, t;
|
|
4936
|
-
((e = d(this,
|
|
5095
|
+
((e = d(this, H)) == null ? void 0 : e.length) > 0 && ((t = d(this, H)) == null || t.forEach((n) => {
|
|
4937
5096
|
this._renderImageCard(n);
|
|
4938
5097
|
}));
|
|
4939
5098
|
}
|
|
@@ -4959,9 +5118,9 @@ class $r {
|
|
|
4959
5118
|
const n = document.createElement("div");
|
|
4960
5119
|
n.style.position = "relative", n.style.display = "flex", n.style.alignItems = "center", n.style.gap = "2px";
|
|
4961
5120
|
const r = document.createElement("span"), s = document.createElement("span");
|
|
4962
|
-
if (s.className = "folder-name", s.textContent = e == null ? void 0 : e.name, r.appendChild(
|
|
5121
|
+
if (s.className = "folder-name", s.textContent = e == null ? void 0 : e.name, r.appendChild(qe()), n.append(r, s), t.append(n), e.children && Object.keys(e.children).length > 0) {
|
|
4963
5122
|
const a = document.createElement("button");
|
|
4964
|
-
a.classList.add("expand-icon"), a.appendChild(
|
|
5123
|
+
a.classList.add("expand-icon"), a.appendChild(fn()), n.prepend(a);
|
|
4965
5124
|
const l = document.createElement("ul");
|
|
4966
5125
|
l.className = "folders nested", t.appendChild(l), a.addEventListener("click", (c) => {
|
|
4967
5126
|
c.stopPropagation(), t.classList.toggle("active"), l.classList.toggle("visible");
|
|
@@ -4973,28 +5132,28 @@ class $r {
|
|
|
4973
5132
|
);
|
|
4974
5133
|
}
|
|
4975
5134
|
if (e.nestedFolderName) {
|
|
4976
|
-
const a =
|
|
5135
|
+
const a = z(
|
|
4977
5136
|
"",
|
|
4978
5137
|
"folder-option-btn",
|
|
4979
5138
|
"moveToInputField.disabled",
|
|
4980
5139
|
!1,
|
|
4981
5140
|
'<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>'
|
|
4982
|
-
), l = y("action-wrapper"), c =
|
|
5141
|
+
), l = y("action-wrapper"), c = z("", "action-option edit"), h = I("Edit", ""), g = mn();
|
|
4983
5142
|
c.append(g, h);
|
|
4984
|
-
const w = y("edit-form-wrapper"),
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
},
|
|
4988
|
-
const
|
|
5143
|
+
const w = y("edit-form-wrapper"), L = y("name-field-wrapper"), B = I("Name", "input-label"), $ = document.createElement("input");
|
|
5144
|
+
$.classList.add("input-field"), $.value = e.name, $.onchange = (E) => {
|
|
5145
|
+
E.target.value;
|
|
5146
|
+
}, L.append(B, $), w.append(L);
|
|
5147
|
+
const A = {
|
|
4989
5148
|
key: e.key,
|
|
4990
5149
|
name: e.name,
|
|
4991
5150
|
nestedFolderName: e.nestedFolderName,
|
|
4992
5151
|
createdBy: e.createdBy
|
|
4993
5152
|
};
|
|
4994
|
-
this._createUpdateFolderDialog(c, "update",
|
|
4995
|
-
const
|
|
4996
|
-
|
|
4997
|
-
|
|
5153
|
+
this._createUpdateFolderDialog(c, "update", A);
|
|
5154
|
+
const W = z("", "action-option delete"), q = I("Delete", ""), Q = wn();
|
|
5155
|
+
W.append(Q, q), l.append(c, W), W.onclick = (E) => {
|
|
5156
|
+
E.stopPropagation(), J.hide(), D.show({
|
|
4998
5157
|
content: "",
|
|
4999
5158
|
dialogContentStyle: {
|
|
5000
5159
|
minWidth: "32rem",
|
|
@@ -5008,20 +5167,20 @@ class $r {
|
|
|
5008
5167
|
this._deleteFolder(e.key);
|
|
5009
5168
|
}
|
|
5010
5169
|
});
|
|
5011
|
-
}, a.addEventListener("click", (
|
|
5012
|
-
|
|
5170
|
+
}, a.addEventListener("click", (E) => {
|
|
5171
|
+
E.stopPropagation();
|
|
5013
5172
|
const b = document.querySelector(`#${e.key}`);
|
|
5014
|
-
p(this,
|
|
5173
|
+
p(this, ye, null), d(this, ye) === e.key && b !== null ? J.hide() : (J.hide(), J.show({
|
|
5015
5174
|
content: l,
|
|
5016
5175
|
mainContainer: n,
|
|
5017
5176
|
divId: e.key
|
|
5018
|
-
}), p(this,
|
|
5177
|
+
}), p(this, ye, e.key));
|
|
5019
5178
|
}), n.appendChild(a);
|
|
5020
5179
|
}
|
|
5021
5180
|
return t.addEventListener("click", (a) => {
|
|
5022
5181
|
var l;
|
|
5023
|
-
a.stopPropagation(), p(this,
|
|
5024
|
-
}), ((o = d(this,
|
|
5182
|
+
a.stopPropagation(), p(this, ne, e), p(this, me, e == null ? void 0 : e.name), p(this, O, []), p(this, H, []), p(this, de, ""), p(this, Ae, !1), (l = document.querySelector(".folder.selected")) == null || l.classList.remove("selected"), t.classList.add("selected"), this._fetchFilesFromFolder(e.name);
|
|
5183
|
+
}), ((o = d(this, ne)) == null ? void 0 : o.key) === (e == null ? void 0 : e.key) && t.classList.add("selected"), t;
|
|
5025
5184
|
}
|
|
5026
5185
|
_renderEditFolderListContainer(e) {
|
|
5027
5186
|
var o;
|
|
@@ -5030,9 +5189,9 @@ class $r {
|
|
|
5030
5189
|
const n = document.createElement("div");
|
|
5031
5190
|
n.style.position = "relative", n.style.display = "flex", n.style.alignItems = "center", n.style.gap = "2px";
|
|
5032
5191
|
const r = document.createElement("span"), s = document.createElement("span");
|
|
5033
|
-
if (s.className = "folder-name", s.textContent = e == null ? void 0 : e.name, r.appendChild(
|
|
5192
|
+
if (s.className = "folder-name", s.textContent = e == null ? void 0 : e.name, r.appendChild(qe()), n.append(r, s), t.append(n), e.children && Object.keys(e.children).length > 0) {
|
|
5034
5193
|
const a = document.createElement("button");
|
|
5035
|
-
a.classList.add("expand-icon"), a.appendChild(
|
|
5194
|
+
a.classList.add("expand-icon"), a.appendChild(fn()), n.prepend(a);
|
|
5036
5195
|
const l = document.createElement("ul");
|
|
5037
5196
|
l.className = "folders nested", t.appendChild(l), a.addEventListener("click", (c) => {
|
|
5038
5197
|
c.stopPropagation(), t.classList.toggle("active"), l.classList.toggle("visible");
|
|
@@ -5043,89 +5202,94 @@ class $r {
|
|
|
5043
5202
|
}
|
|
5044
5203
|
return t.addEventListener("click", (a) => {
|
|
5045
5204
|
var c;
|
|
5046
|
-
a.stopPropagation(), p(this,
|
|
5205
|
+
a.stopPropagation(), p(this, Te, e == null ? void 0 : e.name);
|
|
5047
5206
|
const l = document.querySelector(
|
|
5048
5207
|
"#source-folder-name"
|
|
5049
5208
|
);
|
|
5050
5209
|
l.textContent = "", l.textContent = e == null ? void 0 : e.name, (c = document.querySelector(".folder-move.selected")) == null || c.classList.remove("selected"), t.classList.add("selected");
|
|
5051
|
-
}), ((o = d(this,
|
|
5210
|
+
}), ((o = d(this, ne)) == null ? void 0 : o.key) === (e == null ? void 0 : e.key) && t.classList.add("selected"), t;
|
|
5052
5211
|
}
|
|
5053
5212
|
_updateFolderListContainer() {
|
|
5054
|
-
if (d(this,
|
|
5055
|
-
if (d(this,
|
|
5213
|
+
if (d(this, Le))
|
|
5214
|
+
if (d(this, ge).innerHTML = "", d(this, xe)) {
|
|
5056
5215
|
const e = this._renderFolderListLoadingUI();
|
|
5057
|
-
d(this,
|
|
5216
|
+
d(this, ge).appendChild(e);
|
|
5058
5217
|
} else {
|
|
5059
5218
|
const e = document.createElement("ul");
|
|
5060
|
-
e.className = "folders", d(this,
|
|
5219
|
+
e.className = "folders", d(this, ge).appendChild(e), d(this, le).forEach((t) => {
|
|
5061
5220
|
const n = this._renderFolderListContainer(t);
|
|
5062
5221
|
e.appendChild(n);
|
|
5063
|
-
}), d(this,
|
|
5222
|
+
}), d(this, Le).appendChild(d(this, ge));
|
|
5064
5223
|
}
|
|
5065
5224
|
}
|
|
5066
|
-
_renderToastContainer(e, t) {
|
|
5067
|
-
this._removeToastContainer(), p(this,
|
|
5068
|
-
const
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
),
|
|
5225
|
+
_renderToastContainer(e, t, n) {
|
|
5226
|
+
this._removeToastContainer(), p(this, ce, document.createElement("div")), d(this, ce).className = `message-container ${t}`;
|
|
5227
|
+
const r = Pe(e, "message"), s = t === "success" ? Ir() : Ct(), o = z("");
|
|
5228
|
+
o.style.cursor = "pointer", o.style.border = "0", o.style.outline = "none", o.style.background = "transparent", o.appendChild(
|
|
5229
|
+
Tt(t === "error" ? "#ee3f3f" : "#4caf50")
|
|
5230
|
+
), o.setAttribute(
|
|
5072
5231
|
"fill",
|
|
5073
5232
|
t === "error" ? "#ee3f3f" : "#4caf50"
|
|
5074
|
-
),
|
|
5233
|
+
), o.onclick = () => this._removeToastContainer(), d(this, ce).append(s, r, o), n.appendChild(d(this, ce)), setTimeout(() => {
|
|
5075
5234
|
this._removeToastContainer();
|
|
5076
5235
|
}, 5e3);
|
|
5077
5236
|
}
|
|
5078
5237
|
_removeToastContainer() {
|
|
5079
|
-
d(this,
|
|
5238
|
+
d(this, ce) && (d(this, ce).remove(), p(this, ce, null));
|
|
5080
5239
|
}
|
|
5081
5240
|
_updateSelectedImageListContainerUI() {
|
|
5082
5241
|
var t, n;
|
|
5083
|
-
if (!d(this,
|
|
5084
|
-
d(this,
|
|
5242
|
+
if (!d(this, S)) return;
|
|
5243
|
+
d(this, S).innerHTML = "", d(this, G) && this._renderFetchingSkeletonUI(), d(this, ae) && this._renderLoadingUI();
|
|
5085
5244
|
const e = document.getElementById(
|
|
5086
5245
|
"search-input-wrapper"
|
|
5087
5246
|
);
|
|
5088
|
-
d(this,
|
|
5247
|
+
d(this, Fe) === 0 ? (e && (e.style.visibility = "visible"), ((t = d(this, H)) == null ? void 0 : t.length) === 0 && !d(this, G) ? (d(this, S).classList.add(
|
|
5089
5248
|
"no-selected-image-container"
|
|
5090
|
-
), this._renderEmptyImageContainer()) : (d(this,
|
|
5249
|
+
), this._renderEmptyImageContainer()) : (d(this, S).classList.remove(
|
|
5091
5250
|
"no-selected-image-container"
|
|
5092
|
-
), this._renderImageListContainer())) : (e && (e.style.visibility = "hidden"), ((n = d(this, O)) == null ? void 0 : n.length) === 0 ? (d(this,
|
|
5251
|
+
), this._renderImageListContainer())) : (e && (e.style.visibility = "hidden"), ((n = d(this, O)) == null ? void 0 : n.length) === 0 ? (d(this, S).classList.add(
|
|
5093
5252
|
"no-selected-image-container"
|
|
5094
|
-
), this._renderEmptyImageContainer()) : (d(this,
|
|
5253
|
+
), this._renderEmptyImageContainer()) : (d(this, S).classList.remove(
|
|
5095
5254
|
"no-selected-image-container"
|
|
5096
5255
|
), this._renderSelectedImageListContainer())), this._updateContent();
|
|
5097
5256
|
}
|
|
5098
5257
|
_updateContent() {
|
|
5099
5258
|
var t, n, r;
|
|
5100
5259
|
const e = document.getElementById("selected-images-tab");
|
|
5101
|
-
e && (e.textContent = `Selected (${(t = d(this, O)) == null ? void 0 : t.length})`), d(this,
|
|
5260
|
+
e && (e.textContent = `Selected (${(t = d(this, O)) == null ? void 0 : t.length})`), d(this, Ne).textContent = `Save (${(n = d(this, O)) == null ? void 0 : n.length})`, d(this, Ne).disabled = ((r = d(this, O)) == null ? void 0 : r.length) === 0;
|
|
5102
5261
|
}
|
|
5103
5262
|
async _uploadAndAddSelectedImageList(e, t) {
|
|
5104
5263
|
var n, r;
|
|
5105
|
-
p(this,
|
|
5264
|
+
p(this, ae, !0), this._updateSelectedImageListContainerUI();
|
|
5106
5265
|
try {
|
|
5107
|
-
const s = await
|
|
5266
|
+
const s = await En(e, t), o = await dr(
|
|
5108
5267
|
t == null ? void 0 : t.name,
|
|
5109
5268
|
"",
|
|
5110
5269
|
s,
|
|
5111
|
-
|
|
5112
|
-
(r = d(this,
|
|
5113
|
-
d(this,
|
|
5270
|
+
he[bn((n = t.type) == null ? void 0 : n.split("/")[0])],
|
|
5271
|
+
(r = d(this, ne)) == null ? void 0 : r.name,
|
|
5272
|
+
d(this, X)
|
|
5273
|
+
);
|
|
5274
|
+
d(this, H).unshift(o == null ? void 0 : o.response), this._renderToastContainer(
|
|
5275
|
+
"File Uploaded Successfully",
|
|
5276
|
+
"success",
|
|
5277
|
+
d(this, M)
|
|
5114
5278
|
);
|
|
5115
|
-
d(this, M).unshift(o == null ? void 0 : o.response), this._renderToastContainer("File Uploaded Successfully", "success");
|
|
5116
5279
|
} catch {
|
|
5117
5280
|
this._renderToastContainer(
|
|
5118
5281
|
"Something went wrong while uploading file. Please try again later.",
|
|
5119
|
-
"error"
|
|
5282
|
+
"error",
|
|
5283
|
+
d(this, M)
|
|
5120
5284
|
);
|
|
5121
5285
|
} finally {
|
|
5122
|
-
p(this,
|
|
5286
|
+
p(this, ae, !1), this._updateSelectedImageListContainerUI();
|
|
5123
5287
|
}
|
|
5124
5288
|
}
|
|
5125
5289
|
async _updateFile(e, t) {
|
|
5126
|
-
|
|
5290
|
+
D.updateUploadBtn(!0);
|
|
5127
5291
|
try {
|
|
5128
|
-
const n = await
|
|
5292
|
+
const n = await fr(
|
|
5129
5293
|
t.key,
|
|
5130
5294
|
e,
|
|
5131
5295
|
t.nestedFolderName,
|
|
@@ -5133,48 +5297,59 @@ class $r {
|
|
|
5133
5297
|
t.thumborUrl,
|
|
5134
5298
|
t.proxyUrl,
|
|
5135
5299
|
t.type,
|
|
5136
|
-
d(this,
|
|
5137
|
-
d(this,
|
|
5138
|
-
), r = d(this,
|
|
5300
|
+
d(this, Te),
|
|
5301
|
+
d(this, X)
|
|
5302
|
+
), r = d(this, H).find(
|
|
5139
5303
|
(s) => s.key === n.response.key
|
|
5140
5304
|
);
|
|
5141
|
-
r.name = e, this._fetchFilesFromFolder(d(this,
|
|
5305
|
+
r.name = e, this._fetchFilesFromFolder(d(this, ne).name), p(this, H, []), p(this, O, []), this._renderToastContainer(
|
|
5306
|
+
"File Updated Successfully",
|
|
5307
|
+
"success",
|
|
5308
|
+
d(this, M)
|
|
5309
|
+
);
|
|
5142
5310
|
} catch {
|
|
5143
5311
|
this._renderToastContainer(
|
|
5144
5312
|
"Something went wrong while updating the file. Please try again later.",
|
|
5145
|
-
"error"
|
|
5313
|
+
"error",
|
|
5314
|
+
d(this, M)
|
|
5146
5315
|
);
|
|
5147
5316
|
} finally {
|
|
5148
|
-
|
|
5317
|
+
D.updateUploadBtn(!1), D.hide(), this._updateSelectedImageListContainerUI();
|
|
5149
5318
|
}
|
|
5150
5319
|
}
|
|
5151
5320
|
async _deleteFile(e) {
|
|
5152
|
-
|
|
5321
|
+
D.updateUploadBtn(!0);
|
|
5153
5322
|
try {
|
|
5154
|
-
await
|
|
5323
|
+
await mr(e, d(this, X)), p(this, H, d(this, H).filter((t) => e !== t.key)), this._renderToastContainer(
|
|
5324
|
+
"File Deleted Successfully",
|
|
5325
|
+
"success",
|
|
5326
|
+
d(this, M)
|
|
5327
|
+
);
|
|
5155
5328
|
} catch {
|
|
5156
5329
|
this._renderToastContainer(
|
|
5157
5330
|
"Something went wrong while deleting the file. Please try again later.",
|
|
5158
|
-
"error"
|
|
5331
|
+
"error",
|
|
5332
|
+
d(this, M)
|
|
5159
5333
|
);
|
|
5160
5334
|
} finally {
|
|
5161
|
-
|
|
5335
|
+
D.updateUploadBtn(!1), D.hide(), this._updateSelectedImageListContainerUI();
|
|
5162
5336
|
}
|
|
5163
5337
|
}
|
|
5164
5338
|
async _createFolder(e, t = 2) {
|
|
5165
5339
|
var n;
|
|
5166
5340
|
try {
|
|
5167
|
-
const r = await
|
|
5341
|
+
const r = await Nr(
|
|
5168
5342
|
e,
|
|
5169
|
-
(n = d(this,
|
|
5343
|
+
(n = d(this, ne)) == null ? void 0 : n.name,
|
|
5170
5344
|
"",
|
|
5171
|
-
d(this,
|
|
5345
|
+
d(this, X)
|
|
5172
5346
|
);
|
|
5173
|
-
p(this, O, []), p(this,
|
|
5174
|
-
const s =
|
|
5175
|
-
p(this,
|
|
5347
|
+
p(this, O, []), p(this, H, []);
|
|
5348
|
+
const s = Sr(d(this, le), r == null ? void 0 : r.response);
|
|
5349
|
+
p(this, le, s), p(this, me, e), p(this, ne, { ...r == null ? void 0 : r.response, children: {} }), this._fetchFilesFromFolder(e), this._renderToastContainer(
|
|
5176
5350
|
`Folder ${e} created successfully`,
|
|
5177
|
-
"success"
|
|
5351
|
+
"success",
|
|
5352
|
+
d(this, M)
|
|
5178
5353
|
);
|
|
5179
5354
|
} catch {
|
|
5180
5355
|
if (t > 1)
|
|
@@ -5182,7 +5357,8 @@ class $r {
|
|
|
5182
5357
|
else
|
|
5183
5358
|
throw this._renderToastContainer(
|
|
5184
5359
|
`Error creating folder "${e}". Either folder already exist or failed to create folder`,
|
|
5185
|
-
"error"
|
|
5360
|
+
"error",
|
|
5361
|
+
d(this, M)
|
|
5186
5362
|
), new Error(
|
|
5187
5363
|
`Error creating folder "${e}". Either folder already exist or failed to create folder`
|
|
5188
5364
|
);
|
|
@@ -5190,39 +5366,25 @@ class $r {
|
|
|
5190
5366
|
this._updateFolderListContainer();
|
|
5191
5367
|
}
|
|
5192
5368
|
}
|
|
5193
|
-
async _userViewUpload(e, t) {
|
|
5194
|
-
var n;
|
|
5195
|
-
try {
|
|
5196
|
-
return await cn(
|
|
5197
|
-
d(this, Me).name,
|
|
5198
|
-
"",
|
|
5199
|
-
e,
|
|
5200
|
-
ae[gn((n = d(this, Me).type) == null ? void 0 : n.split("/")[0])],
|
|
5201
|
-
t,
|
|
5202
|
-
d(this, K)
|
|
5203
|
-
), "Image saved successfully";
|
|
5204
|
-
} catch {
|
|
5205
|
-
return "Unable to save the image";
|
|
5206
|
-
}
|
|
5207
|
-
}
|
|
5208
5369
|
async _upload() {
|
|
5209
|
-
return d(this,
|
|
5370
|
+
return d(this, Je) ? d(this, O) : d(this, Ve);
|
|
5210
5371
|
}
|
|
5211
5372
|
async _fetchFilesFromFolder(e) {
|
|
5212
5373
|
var t, n, r;
|
|
5213
5374
|
p(this, G, !0), this._updateSelectedImageListContainerUI();
|
|
5214
5375
|
try {
|
|
5215
|
-
const s = await
|
|
5376
|
+
const s = await ur(
|
|
5216
5377
|
e,
|
|
5217
|
-
d(this,
|
|
5378
|
+
d(this, de),
|
|
5218
5379
|
20,
|
|
5219
|
-
d(this,
|
|
5380
|
+
d(this, X)
|
|
5220
5381
|
), o = (t = s.response) == null ? void 0 : t.files;
|
|
5221
|
-
d(this,
|
|
5382
|
+
d(this, H).push(...o), p(this, de, (n = s.response) == null ? void 0 : n.nextCursor), p(this, Ae, (r = s.response) == null ? void 0 : r.hasMore);
|
|
5222
5383
|
} catch {
|
|
5223
5384
|
throw this._renderToastContainer(
|
|
5224
5385
|
"Error while fetching files from folder" + e,
|
|
5225
|
-
"error"
|
|
5386
|
+
"error",
|
|
5387
|
+
d(this, M)
|
|
5226
5388
|
), new Error(
|
|
5227
5389
|
"Something went wrong. Error while fetching files from folder" + e
|
|
5228
5390
|
);
|
|
@@ -5232,80 +5394,91 @@ class $r {
|
|
|
5232
5394
|
}
|
|
5233
5395
|
async _fetchAllFolders() {
|
|
5234
5396
|
var e, t;
|
|
5235
|
-
p(this, G, !0), p(this,
|
|
5397
|
+
p(this, G, !0), p(this, xe, !0), this._updateSelectedImageListContainerUI(), this._updateFolderListContainer(), this._removeToastContainer();
|
|
5236
5398
|
try {
|
|
5237
|
-
const r = (await
|
|
5238
|
-
p(this,
|
|
5399
|
+
const r = (await kr("", 100, d(this, X))).response.folder, s = Dr(r);
|
|
5400
|
+
p(this, me, (e = s[0]) == null ? void 0 : e.name), this._fetchFilesFromFolder((t = s[0]) == null ? void 0 : t.name), p(this, ne, s[0]), p(this, le, s);
|
|
5239
5401
|
} catch {
|
|
5240
5402
|
p(this, G, !1), this._renderToastContainer(
|
|
5241
5403
|
"Folder not found. Please create a folder or try again later",
|
|
5242
|
-
"error"
|
|
5404
|
+
"error",
|
|
5405
|
+
d(this, M)
|
|
5243
5406
|
);
|
|
5244
5407
|
} finally {
|
|
5245
|
-
p(this,
|
|
5408
|
+
p(this, xe, !1), this._updateFolderListContainer();
|
|
5246
5409
|
}
|
|
5247
5410
|
}
|
|
5248
5411
|
async _search(e) {
|
|
5249
5412
|
var t, n;
|
|
5250
5413
|
p(this, G, !0), this._updateSelectedImageListContainerUI(), this._removeToastContainer();
|
|
5251
5414
|
try {
|
|
5252
|
-
const r = await
|
|
5415
|
+
const r = await pr(
|
|
5253
5416
|
e,
|
|
5254
|
-
d(this,
|
|
5417
|
+
d(this, de),
|
|
5255
5418
|
10,
|
|
5256
|
-
d(this,
|
|
5419
|
+
d(this, X)
|
|
5257
5420
|
), s = (t = r.response) == null ? void 0 : t.items;
|
|
5258
|
-
d(this,
|
|
5421
|
+
d(this, H).push(...s), p(this, de, (n = r.response) == null ? void 0 : n.nextPageCursor);
|
|
5259
5422
|
} catch {
|
|
5260
|
-
this._renderToastContainer(
|
|
5423
|
+
this._renderToastContainer(
|
|
5424
|
+
"Error while searching files",
|
|
5425
|
+
"error",
|
|
5426
|
+
d(this, M)
|
|
5427
|
+
);
|
|
5261
5428
|
} finally {
|
|
5262
5429
|
p(this, G, !1), this._updateSelectedImageListContainerUI();
|
|
5263
5430
|
}
|
|
5264
5431
|
}
|
|
5265
5432
|
async _updateFolder(e, t) {
|
|
5266
|
-
|
|
5433
|
+
D.updateUploadBtn(!0);
|
|
5267
5434
|
try {
|
|
5268
|
-
const n = await
|
|
5435
|
+
const n = await Fr(
|
|
5269
5436
|
t.key,
|
|
5270
5437
|
e,
|
|
5271
5438
|
t.nestedFolderName,
|
|
5272
5439
|
t.createdBy,
|
|
5273
|
-
d(this,
|
|
5440
|
+
d(this, X)
|
|
5274
5441
|
);
|
|
5275
5442
|
} catch {
|
|
5276
5443
|
throw this._renderToastContainer(
|
|
5277
5444
|
"Something went wrong while updating the folder. Please try again later.",
|
|
5278
|
-
"error"
|
|
5445
|
+
"error",
|
|
5446
|
+
d(this, M)
|
|
5279
5447
|
), new Error("Error updating the folder ");
|
|
5280
5448
|
} finally {
|
|
5281
|
-
|
|
5449
|
+
D.updateUploadBtn(!1), D.hide(), this._updateFolderListContainer();
|
|
5282
5450
|
}
|
|
5283
5451
|
}
|
|
5284
5452
|
async _deleteFolder(e) {
|
|
5285
|
-
|
|
5453
|
+
D.updateUploadBtn(!0);
|
|
5286
5454
|
try {
|
|
5287
|
-
await
|
|
5455
|
+
await Lr(e, d(this, X)), p(this, le, d(this, le).filter((t) => t.key !== e)), this._renderToastContainer(
|
|
5456
|
+
"Folder Deleted Successfully",
|
|
5457
|
+
"success",
|
|
5458
|
+
d(this, M)
|
|
5459
|
+
);
|
|
5288
5460
|
} catch {
|
|
5289
5461
|
throw this._renderToastContainer(
|
|
5290
5462
|
"Something went wrong while deleting the folder. Please try again later.",
|
|
5291
|
-
"error"
|
|
5463
|
+
"error",
|
|
5464
|
+
d(this, M)
|
|
5292
5465
|
), new Error("Error deleting the folder ");
|
|
5293
5466
|
} finally {
|
|
5294
|
-
|
|
5467
|
+
D.updateUploadBtn(!1), D.hide(), this._updateFolderListContainer();
|
|
5295
5468
|
}
|
|
5296
5469
|
}
|
|
5297
5470
|
_createUpdateFolderDialog(e, t, n) {
|
|
5298
5471
|
e.addEventListener("click", (r) => {
|
|
5299
5472
|
r.stopPropagation(), J.hide();
|
|
5300
5473
|
let s;
|
|
5301
|
-
const o = y("edit-form-wrapper"), a = y("form-control"), l =
|
|
5474
|
+
const o = y("edit-form-wrapper"), a = y("form-control"), l = I("Folder Name", "input-label"), c = y();
|
|
5302
5475
|
c.style.position = "relative";
|
|
5303
5476
|
const h = document.createElement("input");
|
|
5304
5477
|
h.style.paddingLeft = "40px";
|
|
5305
|
-
const g =
|
|
5306
|
-
g.appendChild(
|
|
5478
|
+
const g = I();
|
|
5479
|
+
g.appendChild(qe()), g.style.position = "absolute", g.style.top = "50%", g.style.left = "5%", g.style.transform = "translate(-40%, -40%)", h.classList.add("input-field"), c.append(h, g), t === "update" && (h.value = n.name), h.onchange = (w) => {
|
|
5307
5480
|
s = w.target.value;
|
|
5308
|
-
}, a.append(l, c), o.append(a),
|
|
5481
|
+
}, a.append(l, c), o.append(a), D.show({
|
|
5309
5482
|
content: o,
|
|
5310
5483
|
header: t === "update" ? "Update Folder" : "Create Folder",
|
|
5311
5484
|
confirmButtonText: t === "create" ? "Save" : "Update",
|
|
@@ -5316,7 +5489,7 @@ class $r {
|
|
|
5316
5489
|
showFooter: !0,
|
|
5317
5490
|
showCloseBtn: !0,
|
|
5318
5491
|
onConfirm: () => {
|
|
5319
|
-
t === "create" ? this._createFolder(s) : this._updateFolder(s, n),
|
|
5492
|
+
t === "create" ? this._createFolder(s) : this._updateFolder(s, n), D.hide();
|
|
5320
5493
|
}
|
|
5321
5494
|
});
|
|
5322
5495
|
});
|
|
@@ -5330,13 +5503,13 @@ class $r {
|
|
|
5330
5503
|
_initializeGrpcConfig(e, t) {
|
|
5331
5504
|
let n = "https://hamro-cms-backend-grpc.hamrostack.com";
|
|
5332
5505
|
t && (e === "production" || e === "development") ? n = t : e === "production" && (n = "https://page-api-grpc.hamropatro.com");
|
|
5333
|
-
const r = new
|
|
5506
|
+
const r = new Gi({
|
|
5334
5507
|
baseUrl: n
|
|
5335
5508
|
});
|
|
5336
5509
|
this.updateWindowObject({ grpcConfig: r });
|
|
5337
5510
|
}
|
|
5338
5511
|
}
|
|
5339
|
-
|
|
5512
|
+
ke = new WeakMap(), M = new WeakMap(), S = new WeakMap(), fe = new WeakMap(), O = new WeakMap(), H = new WeakMap(), ae = new WeakMap(), G = new WeakMap(), xe = new WeakMap(), me = new WeakMap(), le = new WeakMap(), ne = new WeakMap(), Ne = new WeakMap(), Re = new WeakMap(), Fe = new WeakMap(), Le = new WeakMap(), ge = new WeakMap(), _e = new WeakMap(), ce = new WeakMap(), de = new WeakMap(), Ae = new WeakMap(), Ie = new WeakMap(), we = new WeakMap(), Me = new WeakMap(), ze = new WeakMap(), X = new WeakMap(), ye = new WeakMap(), Ge = new WeakMap(), ct = new WeakMap(), Je = new WeakMap(), j = new WeakMap(), Ve = new WeakMap(), Te = new WeakMap(), Ye = new WeakMap(), He = new WeakMap(), $e = new WeakMap(), We = new WeakMap();
|
|
5340
5513
|
export {
|
|
5341
|
-
|
|
5514
|
+
Xr as default
|
|
5342
5515
|
};
|