image-salon-sdk 1.0.22 → 1.0.23
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/README.md +1 -1
- package/dist/assets/icons/audio.d.ts +1 -0
- package/dist/assets/icons/edit.d.ts +1 -0
- package/dist/assets/icons/gallery.d.ts +1 -0
- package/dist/assets/icons/trash.d.ts +1 -0
- package/dist/assets/icons/video.d.ts +1 -0
- package/dist/components/popover/popover.d.ts +14 -0
- package/dist/image-salon-sdk.js +1312 -1183
- package/dist/image-salon-sdk.umd.cjs +4 -5
- package/dist/style.css +1 -1
- package/dist/types/image-salon-types.d.ts +1 -1
- package/dist/utils/folder.d.ts +2 -0
- package/package.json +1 -1
- package/dist/assets/icons/cloud-upload.d.ts +0 -1
- /package/dist/{components → utils}/generic-grpc-authorization.d.ts +0 -0
package/dist/image-salon-sdk.js
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
1
|
import './style.css';
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
throw TypeError(
|
|
2
|
+
var Yt = Object.defineProperty;
|
|
3
|
+
var ft = (i) => {
|
|
4
|
+
throw TypeError(i);
|
|
5
5
|
};
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var u = (
|
|
9
|
-
function
|
|
10
|
-
let n = document.createElement(
|
|
6
|
+
var zt = (i, e, t) => e in i ? Yt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
7
|
+
var _ = (i, e, t) => zt(i, typeof e != "symbol" ? e + "" : e, t), mt = (i, e, t) => e.has(i) || ft("Cannot " + t);
|
|
8
|
+
var u = (i, e, t) => (mt(i, e, "read from private field"), t ? t.call(i) : e.get(i)), E = (i, e, t) => e.has(i) ? ft("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, t), m = (i, e, t, n) => (mt(i, e, "write to private field"), n ? n.call(i, t) : e.set(i, t), t);
|
|
9
|
+
function S(i, e, t) {
|
|
10
|
+
let n = document.createElement(i);
|
|
11
11
|
return n.className += e, t && t.appendChild(n), n;
|
|
12
12
|
}
|
|
13
|
-
var
|
|
14
|
-
class
|
|
13
|
+
var te;
|
|
14
|
+
class Qt {
|
|
15
15
|
constructor() {
|
|
16
|
-
E(this,
|
|
17
|
-
|
|
16
|
+
E(this, te);
|
|
17
|
+
m(this, te, document.createElementNS(
|
|
18
18
|
"http://www.w3.org/2000/svg",
|
|
19
19
|
"svg"
|
|
20
|
-
)), u(this,
|
|
20
|
+
)), u(this, te).setAttribute("viewBox", "25 25 50 50"), u(this, te).classList.add("loader-svg");
|
|
21
21
|
const e = document.createElementNS(
|
|
22
22
|
"http://www.w3.org/2000/svg",
|
|
23
23
|
"circle"
|
|
24
24
|
);
|
|
25
|
-
e.setAttribute("r", "20"), e.setAttribute("cy", "50"), e.setAttribute("cx", "50"), e.classList.add("loader-circle"), u(this,
|
|
25
|
+
e.setAttribute("r", "20"), e.setAttribute("cy", "50"), e.setAttribute("cx", "50"), e.classList.add("loader-circle"), u(this, te).appendChild(e);
|
|
26
26
|
}
|
|
27
27
|
show(e) {
|
|
28
|
-
e.appendChild(u(this,
|
|
28
|
+
e.appendChild(u(this, te));
|
|
29
29
|
}
|
|
30
30
|
hide() {
|
|
31
|
-
u(this,
|
|
31
|
+
u(this, te).remove();
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
class
|
|
34
|
+
te = new WeakMap();
|
|
35
|
+
const pt = new Qt(), Ze = document.body;
|
|
36
|
+
class en {
|
|
37
37
|
constructor() {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
this.main =
|
|
38
|
+
_(this, "main");
|
|
39
|
+
_(this, "dialogHeader");
|
|
40
|
+
_(this, "dialogBody");
|
|
41
|
+
_(this, "dialogFooter");
|
|
42
|
+
_(this, "confirmButton");
|
|
43
|
+
_(this, "cancelButton");
|
|
44
|
+
_(this, "confirmCallback");
|
|
45
|
+
_(this, "cancelCallback");
|
|
46
|
+
this.main = S("div"), this.dialogHeader = S("div"), this.dialogBody = S("div"), this.dialogFooter = S("div"), this.confirmButton = document.createElement("button"), this.cancelButton = document.createElement("button"), this.confirmCallback = void 0, this.cancelCallback = void 0;
|
|
47
47
|
}
|
|
48
48
|
show(e) {
|
|
49
|
-
this.main =
|
|
50
|
-
const t =
|
|
51
|
-
return this.dialogHeader =
|
|
49
|
+
this.main = S("div", "dialog", Ze);
|
|
50
|
+
const t = S("div", "dialog-content", this.main);
|
|
51
|
+
return this.dialogHeader = S("div", "dialog-header", t), this.dialogBody = S("div", "dialog-body", t), this.dialogFooter = S("div", "dialog-footer", t), this.confirmButton = S(
|
|
52
52
|
"button",
|
|
53
53
|
"dialog-btn confirm",
|
|
54
54
|
this.dialogFooter
|
|
55
|
-
), this.confirmButton.type = "button", this.confirmButton.disabled = !0, this.cancelButton =
|
|
55
|
+
), this.confirmButton.type = "button", this.confirmButton.disabled = !0, this.cancelButton = S(
|
|
56
56
|
"button",
|
|
57
57
|
"dialog-btn cancel",
|
|
58
58
|
this.dialogFooter
|
|
59
|
-
), this.cancelButton.type = "button", e.header ? typeof e.header == "string" ? this.dialogHeader.innerHTML = e.header : (this.dialogHeader.innerHTML = "", this.dialogHeader.appendChild(e.header)) : this.dialogHeader.innerHTML = "", typeof e.content == "string" ? this.dialogBody.innerHTML = e.content : (this.dialogBody.innerHTML = "", this.dialogBody.appendChild(e.content)), e.showFooter ? this.dialogFooter.append(this.confirmButton, this.cancelButton) : (this.dialogFooter.innerHTML = "", this.dialogFooter.remove()), this.confirmButton.textContent = e.confirmButtonText || "Upload", this.cancelButton.textContent = e.cancelButtonText || "Cancel",
|
|
60
|
-
const
|
|
59
|
+
), this.cancelButton.type = "button", e.header ? typeof e.header == "string" ? this.dialogHeader.innerHTML = e.header : (this.dialogHeader.innerHTML = "", this.dialogHeader.appendChild(e.header)) : this.dialogHeader.innerHTML = "", typeof e.content == "string" ? this.dialogBody.innerHTML = e.content : (this.dialogBody.innerHTML = "", this.dialogBody.appendChild(e.content)), e.showFooter ? this.dialogFooter.append(this.confirmButton, this.cancelButton) : (this.dialogFooter.innerHTML = "", this.dialogFooter.remove()), this.confirmButton.textContent = e.confirmButtonText || "Upload", this.cancelButton.textContent = e.cancelButtonText || "Cancel", Ze.classList.add("dialog-visible"), new Promise((n) => {
|
|
60
|
+
const r = (s) => () => {
|
|
61
61
|
this.hide(), n(s === "confirm");
|
|
62
62
|
};
|
|
63
|
-
this.confirmCallback = e.onConfirm ||
|
|
63
|
+
this.confirmCallback = e.onConfirm || r("confirm"), this.confirmButton.addEventListener("click", this.confirmCallback), this.cancelCallback = e.onCancel || r("cancel"), this.cancelButton.addEventListener("click", this.cancelCallback);
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
hide() {
|
|
67
|
-
|
|
67
|
+
Ze.classList.remove("dialog-visible"), this.main.remove();
|
|
68
68
|
}
|
|
69
69
|
updateUploadBtnText(e) {
|
|
70
70
|
this.confirmButton && (this.confirmButton.textContent = e);
|
|
@@ -73,65 +73,69 @@ class Yt {
|
|
|
73
73
|
this.confirmButton && (this.confirmButton.disabled = e);
|
|
74
74
|
}
|
|
75
75
|
updateUploadBtn(e) {
|
|
76
|
-
e ? (
|
|
76
|
+
e ? (pt.show(this.confirmButton), this.disableConfirmButton(!0)) : (pt.hide(), this.disableConfirmButton(!1));
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
const Re = new
|
|
80
|
-
function
|
|
79
|
+
const Re = new en();
|
|
80
|
+
function F(i, e) {
|
|
81
81
|
const t = document.createElement("div");
|
|
82
|
-
return
|
|
82
|
+
return i && (t.className = i), e && (t.id = e), t;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function Oe(i, e, t) {
|
|
85
85
|
const n = document.createElement("p");
|
|
86
|
-
return e && n.classList.add(e), t && (n.id = t),
|
|
86
|
+
return e && n.classList.add(e), t && (n.id = t), i && (n.textContent = i), n;
|
|
87
|
+
}
|
|
88
|
+
function Ye(i, e) {
|
|
89
|
+
const t = document.createElement("span");
|
|
90
|
+
return e && t.classList.add(e), i && (t.textContent = i), t;
|
|
87
91
|
}
|
|
88
|
-
function
|
|
89
|
-
const
|
|
90
|
-
return
|
|
92
|
+
function tn(i, e, t, n) {
|
|
93
|
+
const r = document.createElement("img");
|
|
94
|
+
return r.classList.add(e), r.src = i, r;
|
|
91
95
|
}
|
|
92
|
-
function
|
|
93
|
-
const n = document.createElement("video"),
|
|
94
|
-
return n.classList.add(e),
|
|
96
|
+
function nn(i, e, t) {
|
|
97
|
+
const n = document.createElement("video"), r = document.createElement("source");
|
|
98
|
+
return n.classList.add(e), r.src = i, n.appendChild(r), n;
|
|
95
99
|
}
|
|
96
|
-
function
|
|
97
|
-
const n = document.createElement("audio"),
|
|
98
|
-
return n.classList.add(e), n.controls = !0,
|
|
100
|
+
function rn(i, e, t) {
|
|
101
|
+
const n = document.createElement("audio"), r = document.createElement("source");
|
|
102
|
+
return n.classList.add(e), n.controls = !0, r.src = i, n.appendChild(r), n;
|
|
99
103
|
}
|
|
100
|
-
function
|
|
104
|
+
function Be(i, e, t, n, r) {
|
|
101
105
|
const s = document.createElement("button");
|
|
102
|
-
return e && (s.className = e), t && (s.id = t),
|
|
106
|
+
return e && (s.className = e), t && (s.id = t), i && (s.textContent = i), r && (s.innerHTML = r), s.disabled = n, s;
|
|
103
107
|
}
|
|
104
|
-
function
|
|
108
|
+
function gt(i) {
|
|
105
109
|
const e = document.createElement("input");
|
|
106
|
-
return
|
|
110
|
+
return i && (e.type = i), e;
|
|
107
111
|
}
|
|
108
|
-
function
|
|
109
|
-
let e = typeof
|
|
112
|
+
function Ct(i) {
|
|
113
|
+
let e = typeof i;
|
|
110
114
|
if (e == "object") {
|
|
111
|
-
if (Array.isArray(
|
|
115
|
+
if (Array.isArray(i))
|
|
112
116
|
return "array";
|
|
113
|
-
if (
|
|
117
|
+
if (i === null)
|
|
114
118
|
return "null";
|
|
115
119
|
}
|
|
116
120
|
return e;
|
|
117
121
|
}
|
|
118
|
-
function
|
|
119
|
-
return
|
|
122
|
+
function sn(i) {
|
|
123
|
+
return i !== null && typeof i == "object" && !Array.isArray(i);
|
|
120
124
|
}
|
|
121
|
-
let
|
|
122
|
-
for (let
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
function
|
|
127
|
-
let e =
|
|
128
|
-
|
|
129
|
-
let t = new Uint8Array(e), n = 0,
|
|
130
|
-
for (let a = 0; a <
|
|
131
|
-
if (s =
|
|
132
|
-
switch (
|
|
125
|
+
let ae = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), Ge = [];
|
|
126
|
+
for (let i = 0; i < ae.length; i++)
|
|
127
|
+
Ge[ae[i].charCodeAt(0)] = i;
|
|
128
|
+
Ge[45] = ae.indexOf("+");
|
|
129
|
+
Ge[95] = ae.indexOf("/");
|
|
130
|
+
function vt(i) {
|
|
131
|
+
let e = i.length * 3 / 4;
|
|
132
|
+
i[i.length - 2] == "=" ? e -= 2 : i[i.length - 1] == "=" && (e -= 1);
|
|
133
|
+
let t = new Uint8Array(e), n = 0, r = 0, s, o = 0;
|
|
134
|
+
for (let a = 0; a < i.length; a++) {
|
|
135
|
+
if (s = Ge[i.charCodeAt(a)], s === void 0)
|
|
136
|
+
switch (i[a]) {
|
|
133
137
|
case "=":
|
|
134
|
-
|
|
138
|
+
r = 0;
|
|
135
139
|
case `
|
|
136
140
|
`:
|
|
137
141
|
case "\r":
|
|
@@ -141,89 +145,89 @@ function Lt(r) {
|
|
|
141
145
|
default:
|
|
142
146
|
throw Error("invalid base64 string.");
|
|
143
147
|
}
|
|
144
|
-
switch (
|
|
148
|
+
switch (r) {
|
|
145
149
|
case 0:
|
|
146
|
-
o = s,
|
|
150
|
+
o = s, r = 1;
|
|
147
151
|
break;
|
|
148
152
|
case 1:
|
|
149
|
-
t[n++] = o << 2 | (s & 48) >> 4, o = s,
|
|
153
|
+
t[n++] = o << 2 | (s & 48) >> 4, o = s, r = 2;
|
|
150
154
|
break;
|
|
151
155
|
case 2:
|
|
152
|
-
t[n++] = (o & 15) << 4 | (s & 60) >> 2, o = s,
|
|
156
|
+
t[n++] = (o & 15) << 4 | (s & 60) >> 2, o = s, r = 3;
|
|
153
157
|
break;
|
|
154
158
|
case 3:
|
|
155
|
-
t[n++] = (o & 3) << 6 | s,
|
|
159
|
+
t[n++] = (o & 3) << 6 | s, r = 0;
|
|
156
160
|
break;
|
|
157
161
|
}
|
|
158
162
|
}
|
|
159
|
-
if (
|
|
163
|
+
if (r == 1)
|
|
160
164
|
throw Error("invalid base64 string.");
|
|
161
165
|
return t.subarray(0, n);
|
|
162
166
|
}
|
|
163
|
-
function
|
|
164
|
-
let e = "", t = 0, n,
|
|
165
|
-
for (let s = 0; s <
|
|
166
|
-
switch (n =
|
|
167
|
+
function _t(i) {
|
|
168
|
+
let e = "", t = 0, n, r = 0;
|
|
169
|
+
for (let s = 0; s < i.length; s++)
|
|
170
|
+
switch (n = i[s], t) {
|
|
167
171
|
case 0:
|
|
168
|
-
e +=
|
|
172
|
+
e += ae[n >> 2], r = (n & 3) << 4, t = 1;
|
|
169
173
|
break;
|
|
170
174
|
case 1:
|
|
171
|
-
e +=
|
|
175
|
+
e += ae[r | n >> 4], r = (n & 15) << 2, t = 2;
|
|
172
176
|
break;
|
|
173
177
|
case 2:
|
|
174
|
-
e +=
|
|
178
|
+
e += ae[r | n >> 6], e += ae[n & 63], t = 0;
|
|
175
179
|
break;
|
|
176
180
|
}
|
|
177
|
-
return t && (e +=
|
|
181
|
+
return t && (e += ae[r], e += "=", t == 1 && (e += "=")), e;
|
|
178
182
|
}
|
|
179
|
-
var
|
|
180
|
-
(function(
|
|
181
|
-
|
|
182
|
-
(e(n) ? n[
|
|
183
|
-
},
|
|
184
|
-
for (let { no: s, wireType: o, data: a } of
|
|
185
|
-
|
|
186
|
-
},
|
|
183
|
+
var k;
|
|
184
|
+
(function(i) {
|
|
185
|
+
i.symbol = Symbol.for("protobuf-ts/unknown"), i.onRead = (t, n, r, s, o) => {
|
|
186
|
+
(e(n) ? n[i.symbol] : n[i.symbol] = []).push({ no: r, wireType: s, data: o });
|
|
187
|
+
}, i.onWrite = (t, n, r) => {
|
|
188
|
+
for (let { no: s, wireType: o, data: a } of i.list(n))
|
|
189
|
+
r.tag(s, o).raw(a);
|
|
190
|
+
}, i.list = (t, n) => {
|
|
187
191
|
if (e(t)) {
|
|
188
|
-
let
|
|
189
|
-
return n ?
|
|
192
|
+
let r = t[i.symbol];
|
|
193
|
+
return n ? r.filter((s) => s.no == n) : r;
|
|
190
194
|
}
|
|
191
195
|
return [];
|
|
192
|
-
},
|
|
193
|
-
const e = (t) => t && Array.isArray(t[
|
|
194
|
-
})(
|
|
195
|
-
function
|
|
196
|
-
return Object.assign(Object.assign({},
|
|
196
|
+
}, i.last = (t, n) => i.list(t, n).slice(-1)[0];
|
|
197
|
+
const e = (t) => t && Array.isArray(t[i.symbol]);
|
|
198
|
+
})(k || (k = {}));
|
|
199
|
+
function on(i, e) {
|
|
200
|
+
return Object.assign(Object.assign({}, i), e);
|
|
197
201
|
}
|
|
198
|
-
var
|
|
199
|
-
(function(
|
|
200
|
-
|
|
201
|
-
})(
|
|
202
|
-
function
|
|
203
|
-
let
|
|
202
|
+
var p;
|
|
203
|
+
(function(i) {
|
|
204
|
+
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";
|
|
205
|
+
})(p || (p = {}));
|
|
206
|
+
function an() {
|
|
207
|
+
let i = 0, e = 0;
|
|
204
208
|
for (let n = 0; n < 28; n += 7) {
|
|
205
|
-
let
|
|
206
|
-
if (
|
|
207
|
-
return this.assertBounds(), [
|
|
209
|
+
let r = this.buf[this.pos++];
|
|
210
|
+
if (i |= (r & 127) << n, !(r & 128))
|
|
211
|
+
return this.assertBounds(), [i, e];
|
|
208
212
|
}
|
|
209
213
|
let t = this.buf[this.pos++];
|
|
210
|
-
if (
|
|
211
|
-
return this.assertBounds(), [
|
|
214
|
+
if (i |= (t & 15) << 28, e = (t & 112) >> 4, !(t & 128))
|
|
215
|
+
return this.assertBounds(), [i, e];
|
|
212
216
|
for (let n = 3; n <= 31; n += 7) {
|
|
213
|
-
let
|
|
214
|
-
if (e |= (
|
|
215
|
-
return this.assertBounds(), [
|
|
217
|
+
let r = this.buf[this.pos++];
|
|
218
|
+
if (e |= (r & 127) << n, !(r & 128))
|
|
219
|
+
return this.assertBounds(), [i, e];
|
|
216
220
|
}
|
|
217
221
|
throw new Error("invalid varint");
|
|
218
222
|
}
|
|
219
|
-
function
|
|
223
|
+
function ze(i, e, t) {
|
|
220
224
|
for (let s = 0; s < 28; s = s + 7) {
|
|
221
|
-
const o =
|
|
225
|
+
const o = i >>> s, a = !(!(o >>> 7) && e == 0), l = (a ? o | 128 : o) & 255;
|
|
222
226
|
if (t.push(l), !a)
|
|
223
227
|
return;
|
|
224
228
|
}
|
|
225
|
-
const n =
|
|
226
|
-
if (t.push((
|
|
229
|
+
const n = i >>> 28 & 15 | (e & 7) << 4, r = !!(e >> 3);
|
|
230
|
+
if (t.push((r ? n | 128 : n) & 255), !!r) {
|
|
227
231
|
for (let s = 3; s < 31; s = s + 7) {
|
|
228
232
|
const o = e >>> s, a = !!(o >>> 7), l = (a ? o | 128 : o) & 255;
|
|
229
233
|
if (t.push(l), !a)
|
|
@@ -232,26 +236,26 @@ function Ge(r, e, t) {
|
|
|
232
236
|
t.push(e >>> 31 & 1);
|
|
233
237
|
}
|
|
234
238
|
}
|
|
235
|
-
const
|
|
236
|
-
function
|
|
237
|
-
let e =
|
|
238
|
-
e && (
|
|
239
|
+
const qe = 65536 * 65536;
|
|
240
|
+
function xt(i) {
|
|
241
|
+
let e = i[0] == "-";
|
|
242
|
+
e && (i = i.slice(1));
|
|
239
243
|
const t = 1e6;
|
|
240
|
-
let n = 0,
|
|
244
|
+
let n = 0, r = 0;
|
|
241
245
|
function s(o, a) {
|
|
242
|
-
const l = Number(
|
|
243
|
-
|
|
246
|
+
const l = Number(i.slice(o, a));
|
|
247
|
+
r *= t, n = n * t + l, n >= qe && (r = r + (n / qe | 0), n = n % qe);
|
|
244
248
|
}
|
|
245
|
-
return s(-24, -18), s(-18, -12), s(-12, -6), s(-6), [e, n,
|
|
249
|
+
return s(-24, -18), s(-18, -12), s(-12, -6), s(-6), [e, n, r];
|
|
246
250
|
}
|
|
247
|
-
function
|
|
251
|
+
function rt(i, e) {
|
|
248
252
|
if (e >>> 0 <= 2097151)
|
|
249
|
-
return "" + (
|
|
250
|
-
let t =
|
|
253
|
+
return "" + (qe * e + (i >>> 0));
|
|
254
|
+
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;
|
|
251
255
|
s >= l && (o += Math.floor(s / l), s %= l), o >= l && (a += Math.floor(o / l), o %= l);
|
|
252
256
|
function c(d, g) {
|
|
253
|
-
let
|
|
254
|
-
return g ? "0000000".slice(
|
|
257
|
+
let N = d ? String(d) : "";
|
|
258
|
+
return g ? "0000000".slice(N.length) + N : N;
|
|
255
259
|
}
|
|
256
260
|
return c(
|
|
257
261
|
a,
|
|
@@ -269,53 +273,53 @@ function et(r, e) {
|
|
|
269
273
|
1
|
|
270
274
|
);
|
|
271
275
|
}
|
|
272
|
-
function
|
|
273
|
-
if (
|
|
274
|
-
for (;
|
|
275
|
-
e.push(
|
|
276
|
-
e.push(
|
|
276
|
+
function wt(i, e) {
|
|
277
|
+
if (i >= 0) {
|
|
278
|
+
for (; i > 127; )
|
|
279
|
+
e.push(i & 127 | 128), i = i >>> 7;
|
|
280
|
+
e.push(i);
|
|
277
281
|
} else {
|
|
278
282
|
for (let t = 0; t < 9; t++)
|
|
279
|
-
e.push(
|
|
283
|
+
e.push(i & 127 | 128), i = i >> 7;
|
|
280
284
|
e.push(1);
|
|
281
285
|
}
|
|
282
286
|
}
|
|
283
|
-
function
|
|
284
|
-
let
|
|
285
|
-
if (!(
|
|
287
|
+
function ln() {
|
|
288
|
+
let i = this.buf[this.pos++], e = i & 127;
|
|
289
|
+
if (!(i & 128))
|
|
286
290
|
return this.assertBounds(), e;
|
|
287
|
-
if (
|
|
291
|
+
if (i = this.buf[this.pos++], e |= (i & 127) << 7, !(i & 128))
|
|
288
292
|
return this.assertBounds(), e;
|
|
289
|
-
if (
|
|
293
|
+
if (i = this.buf[this.pos++], e |= (i & 127) << 14, !(i & 128))
|
|
290
294
|
return this.assertBounds(), e;
|
|
291
|
-
if (
|
|
295
|
+
if (i = this.buf[this.pos++], e |= (i & 127) << 21, !(i & 128))
|
|
292
296
|
return this.assertBounds(), e;
|
|
293
|
-
|
|
294
|
-
for (let t = 5;
|
|
295
|
-
|
|
296
|
-
if (
|
|
297
|
+
i = this.buf[this.pos++], e |= (i & 15) << 28;
|
|
298
|
+
for (let t = 5; i & 128 && t < 10; t++)
|
|
299
|
+
i = this.buf[this.pos++];
|
|
300
|
+
if (i & 128)
|
|
297
301
|
throw new Error("invalid varint");
|
|
298
302
|
return this.assertBounds(), e >>> 0;
|
|
299
303
|
}
|
|
300
|
-
let
|
|
301
|
-
function
|
|
302
|
-
const
|
|
303
|
-
|
|
304
|
+
let A;
|
|
305
|
+
function cn() {
|
|
306
|
+
const i = new DataView(new ArrayBuffer(8));
|
|
307
|
+
A = globalThis.BigInt !== void 0 && typeof i.getBigInt64 == "function" && typeof i.getBigUint64 == "function" && typeof i.setBigInt64 == "function" && typeof i.setBigUint64 == "function" ? {
|
|
304
308
|
MIN: BigInt("-9223372036854775808"),
|
|
305
309
|
MAX: BigInt("9223372036854775807"),
|
|
306
310
|
UMIN: BigInt("0"),
|
|
307
311
|
UMAX: BigInt("18446744073709551615"),
|
|
308
312
|
C: BigInt,
|
|
309
|
-
V:
|
|
313
|
+
V: i
|
|
310
314
|
} : void 0;
|
|
311
315
|
}
|
|
312
|
-
|
|
313
|
-
function
|
|
314
|
-
if (!
|
|
316
|
+
cn();
|
|
317
|
+
function Dt(i) {
|
|
318
|
+
if (!i)
|
|
315
319
|
throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support");
|
|
316
320
|
}
|
|
317
|
-
const
|
|
318
|
-
class
|
|
321
|
+
const Rt = /^-?[0-9]+$/, Ke = 4294967296, Ue = 2147483648;
|
|
322
|
+
class Ut {
|
|
319
323
|
/**
|
|
320
324
|
* Create a new instance with the given bits.
|
|
321
325
|
*/
|
|
@@ -332,49 +336,49 @@ class Ct {
|
|
|
332
336
|
* Convert to a native number.
|
|
333
337
|
*/
|
|
334
338
|
toNumber() {
|
|
335
|
-
let e = this.hi *
|
|
339
|
+
let e = this.hi * Ke + (this.lo >>> 0);
|
|
336
340
|
if (!Number.isSafeInteger(e))
|
|
337
341
|
throw new Error("cannot convert to safe number");
|
|
338
342
|
return e;
|
|
339
343
|
}
|
|
340
344
|
}
|
|
341
|
-
class
|
|
345
|
+
class U extends Ut {
|
|
342
346
|
/**
|
|
343
347
|
* Create instance from a `string`, `number` or `bigint`.
|
|
344
348
|
*/
|
|
345
349
|
static from(e) {
|
|
346
|
-
if (
|
|
350
|
+
if (A)
|
|
347
351
|
switch (typeof e) {
|
|
348
352
|
case "string":
|
|
349
353
|
if (e == "0")
|
|
350
354
|
return this.ZERO;
|
|
351
355
|
if (e == "")
|
|
352
356
|
throw new Error("string is no integer");
|
|
353
|
-
e =
|
|
357
|
+
e = A.C(e);
|
|
354
358
|
case "number":
|
|
355
359
|
if (e === 0)
|
|
356
360
|
return this.ZERO;
|
|
357
|
-
e =
|
|
361
|
+
e = A.C(e);
|
|
358
362
|
case "bigint":
|
|
359
363
|
if (!e)
|
|
360
364
|
return this.ZERO;
|
|
361
|
-
if (e <
|
|
365
|
+
if (e < A.UMIN)
|
|
362
366
|
throw new Error("signed value for ulong");
|
|
363
|
-
if (e >
|
|
367
|
+
if (e > A.UMAX)
|
|
364
368
|
throw new Error("ulong too large");
|
|
365
|
-
return
|
|
369
|
+
return A.V.setBigUint64(0, e, !0), new U(A.V.getInt32(0, !0), A.V.getInt32(4, !0));
|
|
366
370
|
}
|
|
367
371
|
else
|
|
368
372
|
switch (typeof e) {
|
|
369
373
|
case "string":
|
|
370
374
|
if (e == "0")
|
|
371
375
|
return this.ZERO;
|
|
372
|
-
if (e = e.trim(), !
|
|
376
|
+
if (e = e.trim(), !Rt.test(e))
|
|
373
377
|
throw new Error("string is no integer");
|
|
374
|
-
let [t, n,
|
|
378
|
+
let [t, n, r] = xt(e);
|
|
375
379
|
if (t)
|
|
376
380
|
throw new Error("signed value for ulong");
|
|
377
|
-
return new
|
|
381
|
+
return new U(n, r);
|
|
378
382
|
case "number":
|
|
379
383
|
if (e == 0)
|
|
380
384
|
return this.ZERO;
|
|
@@ -382,7 +386,7 @@ class S extends Ct {
|
|
|
382
386
|
throw new Error("number is no integer");
|
|
383
387
|
if (e < 0)
|
|
384
388
|
throw new Error("signed value for ulong");
|
|
385
|
-
return new
|
|
389
|
+
return new U(e, e / Ke);
|
|
386
390
|
}
|
|
387
391
|
throw new Error("unknown value " + typeof e);
|
|
388
392
|
}
|
|
@@ -390,63 +394,63 @@ class S extends Ct {
|
|
|
390
394
|
* Convert to decimal string.
|
|
391
395
|
*/
|
|
392
396
|
toString() {
|
|
393
|
-
return
|
|
397
|
+
return A ? this.toBigInt().toString() : rt(this.lo, this.hi);
|
|
394
398
|
}
|
|
395
399
|
/**
|
|
396
400
|
* Convert to native bigint.
|
|
397
401
|
*/
|
|
398
402
|
toBigInt() {
|
|
399
|
-
return
|
|
403
|
+
return Dt(A), A.V.setInt32(0, this.lo, !0), A.V.setInt32(4, this.hi, !0), A.V.getBigUint64(0, !0);
|
|
400
404
|
}
|
|
401
405
|
}
|
|
402
|
-
|
|
403
|
-
class
|
|
406
|
+
U.ZERO = new U(0, 0);
|
|
407
|
+
class C extends Ut {
|
|
404
408
|
/**
|
|
405
409
|
* Create instance from a `string`, `number` or `bigint`.
|
|
406
410
|
*/
|
|
407
411
|
static from(e) {
|
|
408
|
-
if (
|
|
412
|
+
if (A)
|
|
409
413
|
switch (typeof e) {
|
|
410
414
|
case "string":
|
|
411
415
|
if (e == "0")
|
|
412
416
|
return this.ZERO;
|
|
413
417
|
if (e == "")
|
|
414
418
|
throw new Error("string is no integer");
|
|
415
|
-
e =
|
|
419
|
+
e = A.C(e);
|
|
416
420
|
case "number":
|
|
417
421
|
if (e === 0)
|
|
418
422
|
return this.ZERO;
|
|
419
|
-
e =
|
|
423
|
+
e = A.C(e);
|
|
420
424
|
case "bigint":
|
|
421
425
|
if (!e)
|
|
422
426
|
return this.ZERO;
|
|
423
|
-
if (e <
|
|
427
|
+
if (e < A.MIN)
|
|
424
428
|
throw new Error("signed long too small");
|
|
425
|
-
if (e >
|
|
429
|
+
if (e > A.MAX)
|
|
426
430
|
throw new Error("signed long too large");
|
|
427
|
-
return
|
|
431
|
+
return A.V.setBigInt64(0, e, !0), new C(A.V.getInt32(0, !0), A.V.getInt32(4, !0));
|
|
428
432
|
}
|
|
429
433
|
else
|
|
430
434
|
switch (typeof e) {
|
|
431
435
|
case "string":
|
|
432
436
|
if (e == "0")
|
|
433
437
|
return this.ZERO;
|
|
434
|
-
if (e = e.trim(), !
|
|
438
|
+
if (e = e.trim(), !Rt.test(e))
|
|
435
439
|
throw new Error("string is no integer");
|
|
436
|
-
let [t, n,
|
|
440
|
+
let [t, n, r] = xt(e);
|
|
437
441
|
if (t) {
|
|
438
|
-
if (
|
|
442
|
+
if (r > Ue || r == Ue && n != 0)
|
|
439
443
|
throw new Error("signed long too small");
|
|
440
|
-
} else if (
|
|
444
|
+
} else if (r >= Ue)
|
|
441
445
|
throw new Error("signed long too large");
|
|
442
|
-
let s = new
|
|
446
|
+
let s = new C(n, r);
|
|
443
447
|
return t ? s.negate() : s;
|
|
444
448
|
case "number":
|
|
445
449
|
if (e == 0)
|
|
446
450
|
return this.ZERO;
|
|
447
451
|
if (!Number.isSafeInteger(e))
|
|
448
452
|
throw new Error("number is no integer");
|
|
449
|
-
return e > 0 ? new
|
|
453
|
+
return e > 0 ? new C(e, e / Ke) : new C(-e, -e / Ke).negate();
|
|
450
454
|
}
|
|
451
455
|
throw new Error("unknown value " + typeof e);
|
|
452
456
|
}
|
|
@@ -454,7 +458,7 @@ class B extends Ct {
|
|
|
454
458
|
* Do we have a minus sign?
|
|
455
459
|
*/
|
|
456
460
|
isNegative() {
|
|
457
|
-
return (this.hi &
|
|
461
|
+
return (this.hi & Ue) !== 0;
|
|
458
462
|
}
|
|
459
463
|
/**
|
|
460
464
|
* Negate two's complement.
|
|
@@ -462,38 +466,38 @@ class B extends Ct {
|
|
|
462
466
|
*/
|
|
463
467
|
negate() {
|
|
464
468
|
let e = ~this.hi, t = this.lo;
|
|
465
|
-
return t ? t = ~t + 1 : e += 1, new
|
|
469
|
+
return t ? t = ~t + 1 : e += 1, new C(t, e);
|
|
466
470
|
}
|
|
467
471
|
/**
|
|
468
472
|
* Convert to decimal string.
|
|
469
473
|
*/
|
|
470
474
|
toString() {
|
|
471
|
-
if (
|
|
475
|
+
if (A)
|
|
472
476
|
return this.toBigInt().toString();
|
|
473
477
|
if (this.isNegative()) {
|
|
474
478
|
let e = this.negate();
|
|
475
|
-
return "-" +
|
|
479
|
+
return "-" + rt(e.lo, e.hi);
|
|
476
480
|
}
|
|
477
|
-
return
|
|
481
|
+
return rt(this.lo, this.hi);
|
|
478
482
|
}
|
|
479
483
|
/**
|
|
480
484
|
* Convert to native bigint.
|
|
481
485
|
*/
|
|
482
486
|
toBigInt() {
|
|
483
|
-
return
|
|
487
|
+
return Dt(A), A.V.setInt32(0, this.lo, !0), A.V.setInt32(4, this.hi, !0), A.V.getBigInt64(0, !0);
|
|
484
488
|
}
|
|
485
489
|
}
|
|
486
|
-
|
|
487
|
-
const
|
|
490
|
+
C.ZERO = new C(0, 0);
|
|
491
|
+
const bt = {
|
|
488
492
|
readUnknownField: !0,
|
|
489
|
-
readerFactory: (
|
|
493
|
+
readerFactory: (i) => new un(i)
|
|
490
494
|
};
|
|
491
|
-
function
|
|
492
|
-
return
|
|
495
|
+
function hn(i) {
|
|
496
|
+
return i ? Object.assign(Object.assign({}, bt), i) : bt;
|
|
493
497
|
}
|
|
494
|
-
class
|
|
498
|
+
class un {
|
|
495
499
|
constructor(e, t) {
|
|
496
|
-
this.varint64 =
|
|
500
|
+
this.varint64 = an, this.uint32 = ln, 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", {
|
|
497
501
|
fatal: !0,
|
|
498
502
|
ignoreBOM: !0
|
|
499
503
|
});
|
|
@@ -514,23 +518,23 @@ class ln {
|
|
|
514
518
|
skip(e) {
|
|
515
519
|
let t = this.pos;
|
|
516
520
|
switch (e) {
|
|
517
|
-
case
|
|
521
|
+
case p.Varint:
|
|
518
522
|
for (; this.buf[this.pos++] & 128; )
|
|
519
523
|
;
|
|
520
524
|
break;
|
|
521
|
-
case
|
|
525
|
+
case p.Bit64:
|
|
522
526
|
this.pos += 4;
|
|
523
|
-
case
|
|
527
|
+
case p.Bit32:
|
|
524
528
|
this.pos += 4;
|
|
525
529
|
break;
|
|
526
|
-
case
|
|
530
|
+
case p.LengthDelimited:
|
|
527
531
|
let n = this.uint32();
|
|
528
532
|
this.pos += n;
|
|
529
533
|
break;
|
|
530
|
-
case
|
|
531
|
-
let
|
|
532
|
-
for (; (
|
|
533
|
-
this.skip(
|
|
534
|
+
case p.StartGroup:
|
|
535
|
+
let r;
|
|
536
|
+
for (; (r = this.tag()[1]) !== p.EndGroup; )
|
|
537
|
+
this.skip(r);
|
|
534
538
|
break;
|
|
535
539
|
default:
|
|
536
540
|
throw new Error("cant skip wire type " + e);
|
|
@@ -561,20 +565,20 @@ class ln {
|
|
|
561
565
|
* Read a `int64` field, a signed 64-bit varint.
|
|
562
566
|
*/
|
|
563
567
|
int64() {
|
|
564
|
-
return new
|
|
568
|
+
return new C(...this.varint64());
|
|
565
569
|
}
|
|
566
570
|
/**
|
|
567
571
|
* Read a `uint64` field, an unsigned 64-bit varint.
|
|
568
572
|
*/
|
|
569
573
|
uint64() {
|
|
570
|
-
return new
|
|
574
|
+
return new U(...this.varint64());
|
|
571
575
|
}
|
|
572
576
|
/**
|
|
573
577
|
* Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint.
|
|
574
578
|
*/
|
|
575
579
|
sint64() {
|
|
576
580
|
let [e, t] = this.varint64(), n = -(e & 1);
|
|
577
|
-
return e = (e >>> 1 | (t & 1) << 31) ^ n, t = t >>> 1 ^ n, new
|
|
581
|
+
return e = (e >>> 1 | (t & 1) << 31) ^ n, t = t >>> 1 ^ n, new C(e, t);
|
|
578
582
|
}
|
|
579
583
|
/**
|
|
580
584
|
* Read a `bool` field, a variant.
|
|
@@ -599,13 +603,13 @@ class ln {
|
|
|
599
603
|
* Read a `fixed64` field, an unsigned, fixed-length 64 bit integer.
|
|
600
604
|
*/
|
|
601
605
|
fixed64() {
|
|
602
|
-
return new
|
|
606
|
+
return new U(this.sfixed32(), this.sfixed32());
|
|
603
607
|
}
|
|
604
608
|
/**
|
|
605
609
|
* Read a `fixed64` field, a signed, fixed-length 64-bit integer.
|
|
606
610
|
*/
|
|
607
611
|
sfixed64() {
|
|
608
|
-
return new
|
|
612
|
+
return new C(this.sfixed32(), this.sfixed32());
|
|
609
613
|
}
|
|
610
614
|
/**
|
|
611
615
|
* Read a `float` field, 32-bit floating point number.
|
|
@@ -633,37 +637,37 @@ class ln {
|
|
|
633
637
|
return this.textDecoder.decode(this.bytes());
|
|
634
638
|
}
|
|
635
639
|
}
|
|
636
|
-
function
|
|
637
|
-
if (!
|
|
640
|
+
function y(i, e) {
|
|
641
|
+
if (!i)
|
|
638
642
|
throw new Error(e);
|
|
639
643
|
}
|
|
640
|
-
const
|
|
641
|
-
function
|
|
642
|
-
if (typeof
|
|
643
|
-
throw new Error("invalid int 32: " + typeof
|
|
644
|
-
if (!Number.isInteger(
|
|
645
|
-
throw new Error("invalid int 32: " +
|
|
644
|
+
const dn = 34028234663852886e22, fn = -34028234663852886e22, mn = 4294967295, pn = 2147483647, gn = -2147483648;
|
|
645
|
+
function Ce(i) {
|
|
646
|
+
if (typeof i != "number")
|
|
647
|
+
throw new Error("invalid int 32: " + typeof i);
|
|
648
|
+
if (!Number.isInteger(i) || i > pn || i < gn)
|
|
649
|
+
throw new Error("invalid int 32: " + i);
|
|
646
650
|
}
|
|
647
|
-
function
|
|
648
|
-
if (typeof
|
|
649
|
-
throw new Error("invalid uint 32: " + typeof
|
|
650
|
-
if (!Number.isInteger(
|
|
651
|
-
throw new Error("invalid uint 32: " +
|
|
651
|
+
function Xe(i) {
|
|
652
|
+
if (typeof i != "number")
|
|
653
|
+
throw new Error("invalid uint 32: " + typeof i);
|
|
654
|
+
if (!Number.isInteger(i) || i > mn || i < 0)
|
|
655
|
+
throw new Error("invalid uint 32: " + i);
|
|
652
656
|
}
|
|
653
|
-
function
|
|
654
|
-
if (typeof
|
|
655
|
-
throw new Error("invalid float 32: " + typeof
|
|
656
|
-
if (Number.isFinite(
|
|
657
|
-
throw new Error("invalid float 32: " +
|
|
657
|
+
function lt(i) {
|
|
658
|
+
if (typeof i != "number")
|
|
659
|
+
throw new Error("invalid float 32: " + typeof i);
|
|
660
|
+
if (Number.isFinite(i) && (i > dn || i < fn))
|
|
661
|
+
throw new Error("invalid float 32: " + i);
|
|
658
662
|
}
|
|
659
|
-
const
|
|
663
|
+
const yt = {
|
|
660
664
|
writeUnknownFields: !0,
|
|
661
|
-
writerFactory: () => new
|
|
665
|
+
writerFactory: () => new bn()
|
|
662
666
|
};
|
|
663
|
-
function
|
|
664
|
-
return
|
|
667
|
+
function wn(i) {
|
|
668
|
+
return i ? Object.assign(Object.assign({}, yt), i) : yt;
|
|
665
669
|
}
|
|
666
|
-
class
|
|
670
|
+
class bn {
|
|
667
671
|
constructor(e) {
|
|
668
672
|
this.stack = [], this.textEncoder = e ?? new TextEncoder(), this.chunks = [], this.buf = [];
|
|
669
673
|
}
|
|
@@ -673,11 +677,11 @@ class pn {
|
|
|
673
677
|
finish() {
|
|
674
678
|
this.chunks.push(new Uint8Array(this.buf));
|
|
675
679
|
let e = 0;
|
|
676
|
-
for (let
|
|
677
|
-
e += this.chunks[
|
|
680
|
+
for (let r = 0; r < this.chunks.length; r++)
|
|
681
|
+
e += this.chunks[r].length;
|
|
678
682
|
let t = new Uint8Array(e), n = 0;
|
|
679
|
-
for (let
|
|
680
|
-
t.set(this.chunks[
|
|
683
|
+
for (let r = 0; r < this.chunks.length; r++)
|
|
684
|
+
t.set(this.chunks[r], n), n += this.chunks[r].length;
|
|
681
685
|
return this.chunks = [], t;
|
|
682
686
|
}
|
|
683
687
|
/**
|
|
@@ -719,7 +723,7 @@ class pn {
|
|
|
719
723
|
* Write a `uint32` value, an unsigned 32 bit varint.
|
|
720
724
|
*/
|
|
721
725
|
uint32(e) {
|
|
722
|
-
for (
|
|
726
|
+
for (Xe(e); e > 127; )
|
|
723
727
|
this.buf.push(e & 127 | 128), e = e >>> 7;
|
|
724
728
|
return this.buf.push(e), this;
|
|
725
729
|
}
|
|
@@ -727,7 +731,7 @@ class pn {
|
|
|
727
731
|
* Write a `int32` value, a signed 32 bit varint.
|
|
728
732
|
*/
|
|
729
733
|
int32(e) {
|
|
730
|
-
return
|
|
734
|
+
return Ce(e), wt(e, this.buf), this;
|
|
731
735
|
}
|
|
732
736
|
/**
|
|
733
737
|
* Write a `bool` value, a variant.
|
|
@@ -752,7 +756,7 @@ class pn {
|
|
|
752
756
|
* Write a `float` value, 32-bit floating point number.
|
|
753
757
|
*/
|
|
754
758
|
float(e) {
|
|
755
|
-
|
|
759
|
+
lt(e);
|
|
756
760
|
let t = new Uint8Array(4);
|
|
757
761
|
return new DataView(t.buffer).setFloat32(0, e, !0), this.raw(t);
|
|
758
762
|
}
|
|
@@ -767,7 +771,7 @@ class pn {
|
|
|
767
771
|
* Write a `fixed32` value, an unsigned, fixed-length 32-bit integer.
|
|
768
772
|
*/
|
|
769
773
|
fixed32(e) {
|
|
770
|
-
|
|
774
|
+
Xe(e);
|
|
771
775
|
let t = new Uint8Array(4);
|
|
772
776
|
return new DataView(t.buffer).setUint32(0, e, !0), this.raw(t);
|
|
773
777
|
}
|
|
@@ -775,7 +779,7 @@ class pn {
|
|
|
775
779
|
* Write a `sfixed32` value, a signed, fixed-length 32-bit integer.
|
|
776
780
|
*/
|
|
777
781
|
sfixed32(e) {
|
|
778
|
-
|
|
782
|
+
Ce(e);
|
|
779
783
|
let t = new Uint8Array(4);
|
|
780
784
|
return new DataView(t.buffer).setInt32(0, e, !0), this.raw(t);
|
|
781
785
|
}
|
|
@@ -783,102 +787,102 @@ class pn {
|
|
|
783
787
|
* Write a `sint32` value, a signed, zigzag-encoded 32-bit varint.
|
|
784
788
|
*/
|
|
785
789
|
sint32(e) {
|
|
786
|
-
return
|
|
790
|
+
return Ce(e), e = (e << 1 ^ e >> 31) >>> 0, wt(e, this.buf), this;
|
|
787
791
|
}
|
|
788
792
|
/**
|
|
789
793
|
* Write a `fixed64` value, a signed, fixed-length 64-bit integer.
|
|
790
794
|
*/
|
|
791
795
|
sfixed64(e) {
|
|
792
|
-
let t = new Uint8Array(8), n = new DataView(t.buffer),
|
|
793
|
-
return n.setInt32(0,
|
|
796
|
+
let t = new Uint8Array(8), n = new DataView(t.buffer), r = C.from(e);
|
|
797
|
+
return n.setInt32(0, r.lo, !0), n.setInt32(4, r.hi, !0), this.raw(t);
|
|
794
798
|
}
|
|
795
799
|
/**
|
|
796
800
|
* Write a `fixed64` value, an unsigned, fixed-length 64 bit integer.
|
|
797
801
|
*/
|
|
798
802
|
fixed64(e) {
|
|
799
|
-
let t = new Uint8Array(8), n = new DataView(t.buffer),
|
|
800
|
-
return n.setInt32(0,
|
|
803
|
+
let t = new Uint8Array(8), n = new DataView(t.buffer), r = U.from(e);
|
|
804
|
+
return n.setInt32(0, r.lo, !0), n.setInt32(4, r.hi, !0), this.raw(t);
|
|
801
805
|
}
|
|
802
806
|
/**
|
|
803
807
|
* Write a `int64` value, a signed 64-bit varint.
|
|
804
808
|
*/
|
|
805
809
|
int64(e) {
|
|
806
|
-
let t =
|
|
807
|
-
return
|
|
810
|
+
let t = C.from(e);
|
|
811
|
+
return ze(t.lo, t.hi, this.buf), this;
|
|
808
812
|
}
|
|
809
813
|
/**
|
|
810
814
|
* Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint.
|
|
811
815
|
*/
|
|
812
816
|
sint64(e) {
|
|
813
|
-
let t =
|
|
814
|
-
return
|
|
817
|
+
let t = C.from(e), n = t.hi >> 31, r = t.lo << 1 ^ n, s = (t.hi << 1 | t.lo >>> 31) ^ n;
|
|
818
|
+
return ze(r, s, this.buf), this;
|
|
815
819
|
}
|
|
816
820
|
/**
|
|
817
821
|
* Write a `uint64` value, an unsigned 64-bit varint.
|
|
818
822
|
*/
|
|
819
823
|
uint64(e) {
|
|
820
|
-
let t =
|
|
821
|
-
return
|
|
824
|
+
let t = U.from(e);
|
|
825
|
+
return ze(t.lo, t.hi, this.buf), this;
|
|
822
826
|
}
|
|
823
827
|
}
|
|
824
|
-
const
|
|
828
|
+
const Nt = {
|
|
825
829
|
emitDefaultValues: !1,
|
|
826
830
|
enumAsInteger: !1,
|
|
827
831
|
useProtoFieldName: !1,
|
|
828
832
|
prettySpaces: 0
|
|
829
|
-
},
|
|
833
|
+
}, kt = {
|
|
830
834
|
ignoreUnknownFields: !1
|
|
831
835
|
};
|
|
832
|
-
function
|
|
833
|
-
return
|
|
836
|
+
function yn(i) {
|
|
837
|
+
return i ? Object.assign(Object.assign({}, kt), i) : kt;
|
|
834
838
|
}
|
|
835
|
-
function
|
|
836
|
-
return
|
|
839
|
+
function Nn(i) {
|
|
840
|
+
return i ? Object.assign(Object.assign({}, Nt), i) : Nt;
|
|
837
841
|
}
|
|
838
|
-
function
|
|
842
|
+
function kn(i, e) {
|
|
839
843
|
var t, n;
|
|
840
|
-
let
|
|
841
|
-
return
|
|
844
|
+
let r = Object.assign(Object.assign({}, i), e);
|
|
845
|
+
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;
|
|
842
846
|
}
|
|
843
|
-
const
|
|
844
|
-
function
|
|
847
|
+
const St = Symbol.for("protobuf-ts/message-type");
|
|
848
|
+
function st(i) {
|
|
845
849
|
let e = !1;
|
|
846
850
|
const t = [];
|
|
847
|
-
for (let n = 0; n <
|
|
848
|
-
let
|
|
849
|
-
|
|
851
|
+
for (let n = 0; n < i.length; n++) {
|
|
852
|
+
let r = i.charAt(n);
|
|
853
|
+
r == "_" ? e = !0 : /\d/.test(r) ? (t.push(r), e = !0) : e ? (t.push(r.toUpperCase()), e = !1) : n == 0 ? t.push(r.toLowerCase()) : t.push(r);
|
|
850
854
|
}
|
|
851
855
|
return t.join("");
|
|
852
856
|
}
|
|
853
857
|
var h;
|
|
854
|
-
(function(
|
|
855
|
-
|
|
858
|
+
(function(i) {
|
|
859
|
+
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";
|
|
856
860
|
})(h || (h = {}));
|
|
857
|
-
var
|
|
858
|
-
(function(
|
|
859
|
-
|
|
860
|
-
})(
|
|
861
|
-
var
|
|
862
|
-
(function(
|
|
863
|
-
|
|
864
|
-
})(
|
|
865
|
-
function
|
|
866
|
-
var e, t, n,
|
|
867
|
-
return
|
|
861
|
+
var Q;
|
|
862
|
+
(function(i) {
|
|
863
|
+
i[i.BIGINT = 0] = "BIGINT", i[i.STRING = 1] = "STRING", i[i.NUMBER = 2] = "NUMBER";
|
|
864
|
+
})(Q || (Q = {}));
|
|
865
|
+
var He;
|
|
866
|
+
(function(i) {
|
|
867
|
+
i[i.NO = 0] = "NO", i[i.PACKED = 1] = "PACKED", i[i.UNPACKED = 2] = "UNPACKED";
|
|
868
|
+
})(He || (He = {}));
|
|
869
|
+
function En(i) {
|
|
870
|
+
var e, t, n, r;
|
|
871
|
+
return i.localName = (e = i.localName) !== null && e !== void 0 ? e : st(i.name), i.jsonName = (t = i.jsonName) !== null && t !== void 0 ? t : st(i.name), i.repeat = (n = i.repeat) !== null && n !== void 0 ? n : He.NO, i.opt = (r = i.opt) !== null && r !== void 0 ? r : i.repeat || i.oneof ? !1 : i.kind == "message", i;
|
|
868
872
|
}
|
|
869
|
-
function
|
|
870
|
-
if (typeof
|
|
873
|
+
function In(i) {
|
|
874
|
+
if (typeof i != "object" || i === null || !i.hasOwnProperty("oneofKind"))
|
|
871
875
|
return !1;
|
|
872
|
-
switch (typeof
|
|
876
|
+
switch (typeof i.oneofKind) {
|
|
873
877
|
case "string":
|
|
874
|
-
return
|
|
878
|
+
return i[i.oneofKind] === void 0 ? !1 : Object.keys(i).length == 2;
|
|
875
879
|
case "undefined":
|
|
876
|
-
return Object.keys(
|
|
880
|
+
return Object.keys(i).length == 1;
|
|
877
881
|
default:
|
|
878
882
|
return !1;
|
|
879
883
|
}
|
|
880
884
|
}
|
|
881
|
-
class
|
|
885
|
+
class An {
|
|
882
886
|
constructor(e) {
|
|
883
887
|
var t;
|
|
884
888
|
this.fields = (t = e.fields) !== null && t !== void 0 ? t : [];
|
|
@@ -887,20 +891,20 @@ class kn {
|
|
|
887
891
|
if (this.data)
|
|
888
892
|
return;
|
|
889
893
|
const e = [], t = [], n = [];
|
|
890
|
-
for (let
|
|
891
|
-
if (
|
|
892
|
-
n.includes(
|
|
894
|
+
for (let r of this.fields)
|
|
895
|
+
if (r.oneof)
|
|
896
|
+
n.includes(r.oneof) || (n.push(r.oneof), e.push(r.oneof), t.push(r.oneof));
|
|
893
897
|
else
|
|
894
|
-
switch (t.push(
|
|
898
|
+
switch (t.push(r.localName), r.kind) {
|
|
895
899
|
case "scalar":
|
|
896
900
|
case "enum":
|
|
897
|
-
(!
|
|
901
|
+
(!r.opt || r.repeat) && e.push(r.localName);
|
|
898
902
|
break;
|
|
899
903
|
case "message":
|
|
900
|
-
|
|
904
|
+
r.repeat && e.push(r.localName);
|
|
901
905
|
break;
|
|
902
906
|
case "map":
|
|
903
|
-
e.push(
|
|
907
|
+
e.push(r.localName);
|
|
904
908
|
break;
|
|
905
909
|
}
|
|
906
910
|
this.data = { req: e, known: t, oneofs: Object.values(n) };
|
|
@@ -931,14 +935,14 @@ class kn {
|
|
|
931
935
|
if (e == null || typeof e != "object")
|
|
932
936
|
return !1;
|
|
933
937
|
this.prepare();
|
|
934
|
-
let
|
|
935
|
-
if (
|
|
938
|
+
let r = Object.keys(e), s = this.data;
|
|
939
|
+
if (r.length < s.req.length || s.req.some((o) => !r.includes(o)) || !n && r.some((o) => !s.known.includes(o)))
|
|
936
940
|
return !1;
|
|
937
941
|
if (t < 1)
|
|
938
942
|
return !0;
|
|
939
943
|
for (const o of s.oneofs) {
|
|
940
944
|
const a = e[o];
|
|
941
|
-
if (!
|
|
945
|
+
if (!In(a))
|
|
942
946
|
return !1;
|
|
943
947
|
if (a.oneofKind === void 0)
|
|
944
948
|
continue;
|
|
@@ -951,54 +955,54 @@ class kn {
|
|
|
951
955
|
return !1;
|
|
952
956
|
return !0;
|
|
953
957
|
}
|
|
954
|
-
field(e, t, n,
|
|
958
|
+
field(e, t, n, r) {
|
|
955
959
|
let s = t.repeat;
|
|
956
960
|
switch (t.kind) {
|
|
957
961
|
case "scalar":
|
|
958
|
-
return e === void 0 ? t.opt : s ? this.scalars(e, t.T,
|
|
962
|
+
return e === void 0 ? t.opt : s ? this.scalars(e, t.T, r, t.L) : this.scalar(e, t.T, t.L);
|
|
959
963
|
case "enum":
|
|
960
|
-
return e === void 0 ? t.opt : s ? this.scalars(e, h.INT32,
|
|
964
|
+
return e === void 0 ? t.opt : s ? this.scalars(e, h.INT32, r) : this.scalar(e, h.INT32);
|
|
961
965
|
case "message":
|
|
962
|
-
return e === void 0 ? !0 : s ? this.messages(e, t.T(), n,
|
|
966
|
+
return e === void 0 ? !0 : s ? this.messages(e, t.T(), n, r) : this.message(e, t.T(), n, r);
|
|
963
967
|
case "map":
|
|
964
968
|
if (typeof e != "object" || e === null)
|
|
965
969
|
return !1;
|
|
966
|
-
if (
|
|
970
|
+
if (r < 2)
|
|
967
971
|
return !0;
|
|
968
|
-
if (!this.mapKeys(e, t.K,
|
|
972
|
+
if (!this.mapKeys(e, t.K, r))
|
|
969
973
|
return !1;
|
|
970
974
|
switch (t.V.kind) {
|
|
971
975
|
case "scalar":
|
|
972
|
-
return this.scalars(Object.values(e), t.V.T,
|
|
976
|
+
return this.scalars(Object.values(e), t.V.T, r, t.V.L);
|
|
973
977
|
case "enum":
|
|
974
|
-
return this.scalars(Object.values(e), h.INT32,
|
|
978
|
+
return this.scalars(Object.values(e), h.INT32, r);
|
|
975
979
|
case "message":
|
|
976
|
-
return this.messages(Object.values(e), t.V.T(), n,
|
|
980
|
+
return this.messages(Object.values(e), t.V.T(), n, r);
|
|
977
981
|
}
|
|
978
982
|
break;
|
|
979
983
|
}
|
|
980
984
|
return !0;
|
|
981
985
|
}
|
|
982
|
-
message(e, t, n,
|
|
983
|
-
return n ? t.isAssignable(e,
|
|
986
|
+
message(e, t, n, r) {
|
|
987
|
+
return n ? t.isAssignable(e, r) : t.is(e, r);
|
|
984
988
|
}
|
|
985
|
-
messages(e, t, n,
|
|
989
|
+
messages(e, t, n, r) {
|
|
986
990
|
if (!Array.isArray(e))
|
|
987
991
|
return !1;
|
|
988
|
-
if (
|
|
992
|
+
if (r < 2)
|
|
989
993
|
return !0;
|
|
990
994
|
if (n) {
|
|
991
|
-
for (let s = 0; s < e.length && s <
|
|
992
|
-
if (!t.isAssignable(e[s],
|
|
995
|
+
for (let s = 0; s < e.length && s < r; s++)
|
|
996
|
+
if (!t.isAssignable(e[s], r - 1))
|
|
993
997
|
return !1;
|
|
994
998
|
} else
|
|
995
|
-
for (let s = 0; s < e.length && s <
|
|
996
|
-
if (!t.is(e[s],
|
|
999
|
+
for (let s = 0; s < e.length && s < r; s++)
|
|
1000
|
+
if (!t.is(e[s], r - 1))
|
|
997
1001
|
return !1;
|
|
998
1002
|
return !0;
|
|
999
1003
|
}
|
|
1000
1004
|
scalar(e, t, n) {
|
|
1001
|
-
let
|
|
1005
|
+
let r = typeof e;
|
|
1002
1006
|
switch (t) {
|
|
1003
1007
|
case h.UINT64:
|
|
1004
1008
|
case h.FIXED64:
|
|
@@ -1006,65 +1010,65 @@ class kn {
|
|
|
1006
1010
|
case h.SFIXED64:
|
|
1007
1011
|
case h.SINT64:
|
|
1008
1012
|
switch (n) {
|
|
1009
|
-
case
|
|
1010
|
-
return
|
|
1011
|
-
case
|
|
1012
|
-
return
|
|
1013
|
+
case Q.BIGINT:
|
|
1014
|
+
return r == "bigint";
|
|
1015
|
+
case Q.NUMBER:
|
|
1016
|
+
return r == "number" && !isNaN(e);
|
|
1013
1017
|
default:
|
|
1014
|
-
return
|
|
1018
|
+
return r == "string";
|
|
1015
1019
|
}
|
|
1016
1020
|
case h.BOOL:
|
|
1017
|
-
return
|
|
1021
|
+
return r == "boolean";
|
|
1018
1022
|
case h.STRING:
|
|
1019
|
-
return
|
|
1023
|
+
return r == "string";
|
|
1020
1024
|
case h.BYTES:
|
|
1021
1025
|
return e instanceof Uint8Array;
|
|
1022
1026
|
case h.DOUBLE:
|
|
1023
1027
|
case h.FLOAT:
|
|
1024
|
-
return
|
|
1028
|
+
return r == "number" && !isNaN(e);
|
|
1025
1029
|
default:
|
|
1026
|
-
return
|
|
1030
|
+
return r == "number" && Number.isInteger(e);
|
|
1027
1031
|
}
|
|
1028
1032
|
}
|
|
1029
|
-
scalars(e, t, n,
|
|
1033
|
+
scalars(e, t, n, r) {
|
|
1030
1034
|
if (!Array.isArray(e))
|
|
1031
1035
|
return !1;
|
|
1032
1036
|
if (n < 2)
|
|
1033
1037
|
return !0;
|
|
1034
1038
|
if (Array.isArray(e)) {
|
|
1035
1039
|
for (let s = 0; s < e.length && s < n; s++)
|
|
1036
|
-
if (!this.scalar(e[s], t,
|
|
1040
|
+
if (!this.scalar(e[s], t, r))
|
|
1037
1041
|
return !1;
|
|
1038
1042
|
}
|
|
1039
1043
|
return !0;
|
|
1040
1044
|
}
|
|
1041
1045
|
mapKeys(e, t, n) {
|
|
1042
|
-
let
|
|
1046
|
+
let r = Object.keys(e);
|
|
1043
1047
|
switch (t) {
|
|
1044
1048
|
case h.INT32:
|
|
1045
1049
|
case h.FIXED32:
|
|
1046
1050
|
case h.SFIXED32:
|
|
1047
1051
|
case h.SINT32:
|
|
1048
1052
|
case h.UINT32:
|
|
1049
|
-
return this.scalars(
|
|
1053
|
+
return this.scalars(r.slice(0, n).map((s) => parseInt(s)), t, n);
|
|
1050
1054
|
case h.BOOL:
|
|
1051
|
-
return this.scalars(
|
|
1055
|
+
return this.scalars(r.slice(0, n).map((s) => s == "true" ? !0 : s == "false" ? !1 : s), t, n);
|
|
1052
1056
|
default:
|
|
1053
|
-
return this.scalars(
|
|
1057
|
+
return this.scalars(r, t, n, Q.STRING);
|
|
1054
1058
|
}
|
|
1055
1059
|
}
|
|
1056
1060
|
}
|
|
1057
|
-
function X(
|
|
1061
|
+
function X(i, e) {
|
|
1058
1062
|
switch (e) {
|
|
1059
|
-
case
|
|
1060
|
-
return
|
|
1061
|
-
case
|
|
1062
|
-
return
|
|
1063
|
+
case Q.BIGINT:
|
|
1064
|
+
return i.toBigInt();
|
|
1065
|
+
case Q.NUMBER:
|
|
1066
|
+
return i.toNumber();
|
|
1063
1067
|
default:
|
|
1064
|
-
return
|
|
1068
|
+
return i.toString();
|
|
1065
1069
|
}
|
|
1066
1070
|
}
|
|
1067
|
-
class
|
|
1071
|
+
class Tn {
|
|
1068
1072
|
constructor(e) {
|
|
1069
1073
|
this.info = e;
|
|
1070
1074
|
}
|
|
@@ -1080,8 +1084,8 @@ class En {
|
|
|
1080
1084
|
// Cannot parse JSON <type of jsonValue> for <type name>#<fieldName>.
|
|
1081
1085
|
assert(e, t, n) {
|
|
1082
1086
|
if (!e) {
|
|
1083
|
-
let
|
|
1084
|
-
throw (
|
|
1087
|
+
let r = Ct(n);
|
|
1088
|
+
throw (r == "number" || r == "boolean") && (r = n.toString()), new Error(`Cannot parse JSON ${r} for ${this.info.typeName}#${t}`);
|
|
1085
1089
|
}
|
|
1086
1090
|
}
|
|
1087
1091
|
/**
|
|
@@ -1095,7 +1099,7 @@ class En {
|
|
|
1095
1099
|
*/
|
|
1096
1100
|
read(e, t, n) {
|
|
1097
1101
|
this.prepare();
|
|
1098
|
-
const
|
|
1102
|
+
const r = [];
|
|
1099
1103
|
for (const [s, o] of Object.entries(e)) {
|
|
1100
1104
|
const a = this.fMap[s];
|
|
1101
1105
|
if (!a) {
|
|
@@ -1108,9 +1112,9 @@ class En {
|
|
|
1108
1112
|
if (a.oneof) {
|
|
1109
1113
|
if (o === null && (a.kind !== "enum" || a.T()[0] !== "google.protobuf.NullValue"))
|
|
1110
1114
|
continue;
|
|
1111
|
-
if (
|
|
1115
|
+
if (r.includes(a.oneof))
|
|
1112
1116
|
throw new Error(`Multiple members of the oneof group "${a.oneof}" of ${this.info.typeName} are present in JSON.`);
|
|
1113
|
-
|
|
1117
|
+
r.push(a.oneof), c = t[a.oneof] = {
|
|
1114
1118
|
oneofKind: l
|
|
1115
1119
|
};
|
|
1116
1120
|
} else
|
|
@@ -1118,26 +1122,26 @@ class En {
|
|
|
1118
1122
|
if (a.kind == "map") {
|
|
1119
1123
|
if (o === null)
|
|
1120
1124
|
continue;
|
|
1121
|
-
this.assert(
|
|
1125
|
+
this.assert(sn(o), a.name, o);
|
|
1122
1126
|
const d = c[l];
|
|
1123
|
-
for (const [g,
|
|
1124
|
-
this.assert(
|
|
1125
|
-
let
|
|
1127
|
+
for (const [g, N] of Object.entries(o)) {
|
|
1128
|
+
this.assert(N !== null, a.name + " map value", null);
|
|
1129
|
+
let L;
|
|
1126
1130
|
switch (a.V.kind) {
|
|
1127
1131
|
case "message":
|
|
1128
|
-
|
|
1132
|
+
L = a.V.T().internalJsonRead(N, n);
|
|
1129
1133
|
break;
|
|
1130
1134
|
case "enum":
|
|
1131
|
-
if (
|
|
1135
|
+
if (L = this.enum(a.V.T(), N, a.name, n.ignoreUnknownFields), L === !1)
|
|
1132
1136
|
continue;
|
|
1133
1137
|
break;
|
|
1134
1138
|
case "scalar":
|
|
1135
|
-
|
|
1139
|
+
L = this.scalar(N, a.V.T, a.V.L, a.name);
|
|
1136
1140
|
break;
|
|
1137
1141
|
}
|
|
1138
|
-
this.assert(
|
|
1139
|
-
let
|
|
1140
|
-
a.K == h.BOOL && (
|
|
1142
|
+
this.assert(L !== void 0, a.name + " map value", N);
|
|
1143
|
+
let O = g;
|
|
1144
|
+
a.K == h.BOOL && (O = O == "true" ? !0 : O == "false" ? !1 : O), O = this.scalar(O, a.K, Q.STRING, a.name).toString(), d[O] = L;
|
|
1141
1145
|
}
|
|
1142
1146
|
} else if (a.repeat) {
|
|
1143
1147
|
if (o === null)
|
|
@@ -1146,20 +1150,20 @@ class En {
|
|
|
1146
1150
|
const d = c[l];
|
|
1147
1151
|
for (const g of o) {
|
|
1148
1152
|
this.assert(g !== null, a.name, null);
|
|
1149
|
-
let
|
|
1153
|
+
let N;
|
|
1150
1154
|
switch (a.kind) {
|
|
1151
1155
|
case "message":
|
|
1152
|
-
|
|
1156
|
+
N = a.T().internalJsonRead(g, n);
|
|
1153
1157
|
break;
|
|
1154
1158
|
case "enum":
|
|
1155
|
-
if (
|
|
1159
|
+
if (N = this.enum(a.T(), g, a.name, n.ignoreUnknownFields), N === !1)
|
|
1156
1160
|
continue;
|
|
1157
1161
|
break;
|
|
1158
1162
|
case "scalar":
|
|
1159
|
-
|
|
1163
|
+
N = this.scalar(g, a.T, a.L, a.name);
|
|
1160
1164
|
break;
|
|
1161
1165
|
}
|
|
1162
|
-
this.assert(
|
|
1166
|
+
this.assert(N !== void 0, a.name, o), d.push(N);
|
|
1163
1167
|
}
|
|
1164
1168
|
} else
|
|
1165
1169
|
switch (a.kind) {
|
|
@@ -1187,21 +1191,21 @@ class En {
|
|
|
1187
1191
|
*
|
|
1188
1192
|
* google.protobuf.NullValue accepts only JSON `null` (or the old `"NULL_VALUE"`).
|
|
1189
1193
|
*/
|
|
1190
|
-
enum(e, t, n,
|
|
1191
|
-
if (e[0] == "google.protobuf.NullValue" &&
|
|
1194
|
+
enum(e, t, n, r) {
|
|
1195
|
+
if (e[0] == "google.protobuf.NullValue" && y(t === null || t === "NULL_VALUE", `Unable to parse field ${this.info.typeName}#${n}, enum ${e[0]} only accepts null.`), t === null)
|
|
1192
1196
|
return 0;
|
|
1193
1197
|
switch (typeof t) {
|
|
1194
1198
|
case "number":
|
|
1195
|
-
return
|
|
1199
|
+
return y(Number.isInteger(t), `Unable to parse field ${this.info.typeName}#${n}, enum can only be integral number, got ${t}.`), t;
|
|
1196
1200
|
case "string":
|
|
1197
1201
|
let s = t;
|
|
1198
1202
|
e[2] && t.substring(0, e[2].length) === e[2] && (s = t.substring(e[2].length));
|
|
1199
1203
|
let o = e[1][s];
|
|
1200
|
-
return typeof o > "u" &&
|
|
1204
|
+
return typeof o > "u" && r ? !1 : (y(typeof o == "number", `Unable to parse field ${this.info.typeName}#${n}, enum ${e[0]} has no value for "${t}".`), o);
|
|
1201
1205
|
}
|
|
1202
|
-
|
|
1206
|
+
y(!1, `Unable to parse field ${this.info.typeName}#${n}, cannot parse enum value from ${typeof t}".`);
|
|
1203
1207
|
}
|
|
1204
|
-
scalar(e, t, n,
|
|
1208
|
+
scalar(e, t, n, r) {
|
|
1205
1209
|
let s;
|
|
1206
1210
|
try {
|
|
1207
1211
|
switch (t) {
|
|
@@ -1234,7 +1238,7 @@ class En {
|
|
|
1234
1238
|
s = "too large or small";
|
|
1235
1239
|
break;
|
|
1236
1240
|
}
|
|
1237
|
-
return t == h.FLOAT &&
|
|
1241
|
+
return t == h.FLOAT && lt(o), o;
|
|
1238
1242
|
case h.INT32:
|
|
1239
1243
|
case h.FIXED32:
|
|
1240
1244
|
case h.SFIXED32:
|
|
@@ -1245,22 +1249,22 @@ class En {
|
|
|
1245
1249
|
let a;
|
|
1246
1250
|
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)
|
|
1247
1251
|
break;
|
|
1248
|
-
return t == h.UINT32 ?
|
|
1252
|
+
return t == h.UINT32 ? Xe(a) : Ce(a), a;
|
|
1249
1253
|
case h.INT64:
|
|
1250
1254
|
case h.SFIXED64:
|
|
1251
1255
|
case h.SINT64:
|
|
1252
1256
|
if (e === null)
|
|
1253
|
-
return X(
|
|
1257
|
+
return X(C.ZERO, n);
|
|
1254
1258
|
if (typeof e != "number" && typeof e != "string")
|
|
1255
1259
|
break;
|
|
1256
|
-
return X(
|
|
1260
|
+
return X(C.from(e), n);
|
|
1257
1261
|
case h.FIXED64:
|
|
1258
1262
|
case h.UINT64:
|
|
1259
1263
|
if (e === null)
|
|
1260
|
-
return X(
|
|
1264
|
+
return X(U.ZERO, n);
|
|
1261
1265
|
if (typeof e != "number" && typeof e != "string")
|
|
1262
1266
|
break;
|
|
1263
|
-
return X(
|
|
1267
|
+
return X(U.from(e), n);
|
|
1264
1268
|
case h.BOOL:
|
|
1265
1269
|
if (e === null)
|
|
1266
1270
|
return !1;
|
|
@@ -1286,15 +1290,15 @@ class En {
|
|
|
1286
1290
|
return new Uint8Array(0);
|
|
1287
1291
|
if (typeof e != "string")
|
|
1288
1292
|
break;
|
|
1289
|
-
return
|
|
1293
|
+
return vt(e);
|
|
1290
1294
|
}
|
|
1291
1295
|
} catch (o) {
|
|
1292
1296
|
s = o.message;
|
|
1293
1297
|
}
|
|
1294
|
-
this.assert(!1,
|
|
1298
|
+
this.assert(!1, r + (s ? " - " + s : ""), e);
|
|
1295
1299
|
}
|
|
1296
1300
|
}
|
|
1297
|
-
class
|
|
1301
|
+
class Fn {
|
|
1298
1302
|
constructor(e) {
|
|
1299
1303
|
var t;
|
|
1300
1304
|
this.fields = (t = e.fields) !== null && t !== void 0 ? t : [];
|
|
@@ -1303,157 +1307,157 @@ class In {
|
|
|
1303
1307
|
* Converts the message to a JSON object, based on the field descriptors.
|
|
1304
1308
|
*/
|
|
1305
1309
|
write(e, t) {
|
|
1306
|
-
const n = {},
|
|
1310
|
+
const n = {}, r = e;
|
|
1307
1311
|
for (const s of this.fields) {
|
|
1308
1312
|
if (!s.oneof) {
|
|
1309
|
-
let c = this.field(s,
|
|
1313
|
+
let c = this.field(s, r[s.localName], t);
|
|
1310
1314
|
c !== void 0 && (n[t.useProtoFieldName ? s.name : s.jsonName] = c);
|
|
1311
1315
|
continue;
|
|
1312
1316
|
}
|
|
1313
|
-
const o =
|
|
1317
|
+
const o = r[s.oneof];
|
|
1314
1318
|
if (o.oneofKind !== s.localName)
|
|
1315
1319
|
continue;
|
|
1316
1320
|
const a = s.kind == "scalar" || s.kind == "enum" ? Object.assign(Object.assign({}, t), { emitDefaultValues: !0 }) : t;
|
|
1317
1321
|
let l = this.field(s, o[s.localName], a);
|
|
1318
|
-
|
|
1322
|
+
y(l !== void 0), n[t.useProtoFieldName ? s.name : s.jsonName] = l;
|
|
1319
1323
|
}
|
|
1320
1324
|
return n;
|
|
1321
1325
|
}
|
|
1322
1326
|
field(e, t, n) {
|
|
1323
|
-
let
|
|
1327
|
+
let r;
|
|
1324
1328
|
if (e.kind == "map") {
|
|
1325
|
-
|
|
1329
|
+
y(typeof t == "object" && t !== null);
|
|
1326
1330
|
const s = {};
|
|
1327
1331
|
switch (e.V.kind) {
|
|
1328
1332
|
case "scalar":
|
|
1329
1333
|
for (const [l, c] of Object.entries(t)) {
|
|
1330
1334
|
const d = this.scalar(e.V.T, c, e.name, !1, !0);
|
|
1331
|
-
|
|
1335
|
+
y(d !== void 0), s[l.toString()] = d;
|
|
1332
1336
|
}
|
|
1333
1337
|
break;
|
|
1334
1338
|
case "message":
|
|
1335
1339
|
const o = e.V.T();
|
|
1336
1340
|
for (const [l, c] of Object.entries(t)) {
|
|
1337
1341
|
const d = this.message(o, c, e.name, n);
|
|
1338
|
-
|
|
1342
|
+
y(d !== void 0), s[l.toString()] = d;
|
|
1339
1343
|
}
|
|
1340
1344
|
break;
|
|
1341
1345
|
case "enum":
|
|
1342
1346
|
const a = e.V.T();
|
|
1343
1347
|
for (const [l, c] of Object.entries(t)) {
|
|
1344
|
-
|
|
1348
|
+
y(c === void 0 || typeof c == "number");
|
|
1345
1349
|
const d = this.enum(a, c, e.name, !1, !0, n.enumAsInteger);
|
|
1346
|
-
|
|
1350
|
+
y(d !== void 0), s[l.toString()] = d;
|
|
1347
1351
|
}
|
|
1348
1352
|
break;
|
|
1349
1353
|
}
|
|
1350
|
-
(n.emitDefaultValues || Object.keys(s).length > 0) && (
|
|
1354
|
+
(n.emitDefaultValues || Object.keys(s).length > 0) && (r = s);
|
|
1351
1355
|
} else if (e.repeat) {
|
|
1352
|
-
|
|
1356
|
+
y(Array.isArray(t));
|
|
1353
1357
|
const s = [];
|
|
1354
1358
|
switch (e.kind) {
|
|
1355
1359
|
case "scalar":
|
|
1356
1360
|
for (let l = 0; l < t.length; l++) {
|
|
1357
1361
|
const c = this.scalar(e.T, t[l], e.name, e.opt, !0);
|
|
1358
|
-
|
|
1362
|
+
y(c !== void 0), s.push(c);
|
|
1359
1363
|
}
|
|
1360
1364
|
break;
|
|
1361
1365
|
case "enum":
|
|
1362
1366
|
const o = e.T();
|
|
1363
1367
|
for (let l = 0; l < t.length; l++) {
|
|
1364
|
-
|
|
1368
|
+
y(t[l] === void 0 || typeof t[l] == "number");
|
|
1365
1369
|
const c = this.enum(o, t[l], e.name, e.opt, !0, n.enumAsInteger);
|
|
1366
|
-
|
|
1370
|
+
y(c !== void 0), s.push(c);
|
|
1367
1371
|
}
|
|
1368
1372
|
break;
|
|
1369
1373
|
case "message":
|
|
1370
1374
|
const a = e.T();
|
|
1371
1375
|
for (let l = 0; l < t.length; l++) {
|
|
1372
1376
|
const c = this.message(a, t[l], e.name, n);
|
|
1373
|
-
|
|
1377
|
+
y(c !== void 0), s.push(c);
|
|
1374
1378
|
}
|
|
1375
1379
|
break;
|
|
1376
1380
|
}
|
|
1377
|
-
(n.emitDefaultValues || s.length > 0 || n.emitDefaultValues) && (
|
|
1381
|
+
(n.emitDefaultValues || s.length > 0 || n.emitDefaultValues) && (r = s);
|
|
1378
1382
|
} else
|
|
1379
1383
|
switch (e.kind) {
|
|
1380
1384
|
case "scalar":
|
|
1381
|
-
|
|
1385
|
+
r = this.scalar(e.T, t, e.name, e.opt, n.emitDefaultValues);
|
|
1382
1386
|
break;
|
|
1383
1387
|
case "enum":
|
|
1384
|
-
|
|
1388
|
+
r = this.enum(e.T(), t, e.name, e.opt, n.emitDefaultValues, n.enumAsInteger);
|
|
1385
1389
|
break;
|
|
1386
1390
|
case "message":
|
|
1387
|
-
|
|
1391
|
+
r = this.message(e.T(), t, e.name, n);
|
|
1388
1392
|
break;
|
|
1389
1393
|
}
|
|
1390
|
-
return
|
|
1394
|
+
return r;
|
|
1391
1395
|
}
|
|
1392
1396
|
/**
|
|
1393
1397
|
* Returns `null` as the default for google.protobuf.NullValue.
|
|
1394
1398
|
*/
|
|
1395
|
-
enum(e, t, n,
|
|
1399
|
+
enum(e, t, n, r, s, o) {
|
|
1396
1400
|
if (e[0] == "google.protobuf.NullValue")
|
|
1397
|
-
return !s && !
|
|
1401
|
+
return !s && !r ? void 0 : null;
|
|
1398
1402
|
if (t === void 0) {
|
|
1399
|
-
|
|
1403
|
+
y(r);
|
|
1400
1404
|
return;
|
|
1401
1405
|
}
|
|
1402
|
-
if (!(t === 0 && !s && !
|
|
1403
|
-
return
|
|
1406
|
+
if (!(t === 0 && !s && !r))
|
|
1407
|
+
return y(typeof t == "number"), y(Number.isInteger(t)), o || !e[1].hasOwnProperty(t) ? t : e[2] ? e[2] + e[1][t] : e[1][t];
|
|
1404
1408
|
}
|
|
1405
|
-
message(e, t, n,
|
|
1406
|
-
return t === void 0 ?
|
|
1409
|
+
message(e, t, n, r) {
|
|
1410
|
+
return t === void 0 ? r.emitDefaultValues ? null : void 0 : e.internalJsonWrite(t, r);
|
|
1407
1411
|
}
|
|
1408
|
-
scalar(e, t, n,
|
|
1412
|
+
scalar(e, t, n, r, s) {
|
|
1409
1413
|
if (t === void 0) {
|
|
1410
|
-
|
|
1414
|
+
y(r);
|
|
1411
1415
|
return;
|
|
1412
1416
|
}
|
|
1413
|
-
const o = s ||
|
|
1417
|
+
const o = s || r;
|
|
1414
1418
|
switch (e) {
|
|
1415
1419
|
case h.INT32:
|
|
1416
1420
|
case h.SFIXED32:
|
|
1417
1421
|
case h.SINT32:
|
|
1418
|
-
return t === 0 ? o ? 0 : void 0 : (
|
|
1422
|
+
return t === 0 ? o ? 0 : void 0 : (Ce(t), t);
|
|
1419
1423
|
case h.FIXED32:
|
|
1420
1424
|
case h.UINT32:
|
|
1421
|
-
return t === 0 ? o ? 0 : void 0 : (
|
|
1425
|
+
return t === 0 ? o ? 0 : void 0 : (Xe(t), t);
|
|
1422
1426
|
case h.FLOAT:
|
|
1423
|
-
|
|
1427
|
+
lt(t);
|
|
1424
1428
|
case h.DOUBLE:
|
|
1425
|
-
return t === 0 ? o ? 0 : void 0 : (
|
|
1429
|
+
return t === 0 ? o ? 0 : void 0 : (y(typeof t == "number"), Number.isNaN(t) ? "NaN" : t === Number.POSITIVE_INFINITY ? "Infinity" : t === Number.NEGATIVE_INFINITY ? "-Infinity" : t);
|
|
1426
1430
|
case h.STRING:
|
|
1427
|
-
return t === "" ? o ? "" : void 0 : (
|
|
1431
|
+
return t === "" ? o ? "" : void 0 : (y(typeof t == "string"), t);
|
|
1428
1432
|
case h.BOOL:
|
|
1429
|
-
return t === !1 ? o ? !1 : void 0 : (
|
|
1433
|
+
return t === !1 ? o ? !1 : void 0 : (y(typeof t == "boolean"), t);
|
|
1430
1434
|
case h.UINT64:
|
|
1431
1435
|
case h.FIXED64:
|
|
1432
|
-
|
|
1433
|
-
let a =
|
|
1436
|
+
y(typeof t == "number" || typeof t == "string" || typeof t == "bigint");
|
|
1437
|
+
let a = U.from(t);
|
|
1434
1438
|
return a.isZero() && !o ? void 0 : a.toString();
|
|
1435
1439
|
case h.INT64:
|
|
1436
1440
|
case h.SFIXED64:
|
|
1437
1441
|
case h.SINT64:
|
|
1438
|
-
|
|
1439
|
-
let l =
|
|
1442
|
+
y(typeof t == "number" || typeof t == "string" || typeof t == "bigint");
|
|
1443
|
+
let l = C.from(t);
|
|
1440
1444
|
return l.isZero() && !o ? void 0 : l.toString();
|
|
1441
1445
|
case h.BYTES:
|
|
1442
|
-
return
|
|
1446
|
+
return y(t instanceof Uint8Array), t.byteLength ? _t(t) : o ? "" : void 0;
|
|
1443
1447
|
}
|
|
1444
1448
|
}
|
|
1445
1449
|
}
|
|
1446
|
-
function
|
|
1447
|
-
switch (
|
|
1450
|
+
function ot(i, e = Q.STRING) {
|
|
1451
|
+
switch (i) {
|
|
1448
1452
|
case h.BOOL:
|
|
1449
1453
|
return !1;
|
|
1450
1454
|
case h.UINT64:
|
|
1451
1455
|
case h.FIXED64:
|
|
1452
|
-
return X(
|
|
1456
|
+
return X(U.ZERO, e);
|
|
1453
1457
|
case h.INT64:
|
|
1454
1458
|
case h.SFIXED64:
|
|
1455
1459
|
case h.SINT64:
|
|
1456
|
-
return X(
|
|
1460
|
+
return X(C.ZERO, e);
|
|
1457
1461
|
case h.DOUBLE:
|
|
1458
1462
|
case h.FLOAT:
|
|
1459
1463
|
return 0;
|
|
@@ -1465,7 +1469,7 @@ function nt(r, e = z.STRING) {
|
|
|
1465
1469
|
return 0;
|
|
1466
1470
|
}
|
|
1467
1471
|
}
|
|
1468
|
-
class
|
|
1472
|
+
class Ln {
|
|
1469
1473
|
constructor(e) {
|
|
1470
1474
|
this.info = e;
|
|
1471
1475
|
}
|
|
@@ -1485,17 +1489,17 @@ class Tn {
|
|
|
1485
1489
|
* If a message field is already present, it will be merged with the
|
|
1486
1490
|
* new data.
|
|
1487
1491
|
*/
|
|
1488
|
-
read(e, t, n,
|
|
1492
|
+
read(e, t, n, r) {
|
|
1489
1493
|
this.prepare();
|
|
1490
|
-
const s =
|
|
1494
|
+
const s = r === void 0 ? e.len : e.pos + r;
|
|
1491
1495
|
for (; e.pos < s; ) {
|
|
1492
1496
|
const [o, a] = e.tag(), l = this.fieldNoToField.get(o);
|
|
1493
1497
|
if (!l) {
|
|
1494
|
-
let
|
|
1495
|
-
if (
|
|
1498
|
+
let N = n.readUnknownField;
|
|
1499
|
+
if (N == "throw")
|
|
1496
1500
|
throw new Error(`Unknown field ${o} (wire type ${a}) for ${this.info.typeName}`);
|
|
1497
|
-
let
|
|
1498
|
-
|
|
1501
|
+
let L = e.skip(a);
|
|
1502
|
+
N !== !1 && (N === !0 ? k.onRead : N)(this.info.typeName, t, o, a, L);
|
|
1499
1503
|
continue;
|
|
1500
1504
|
}
|
|
1501
1505
|
let c = t, d = l.repeat, g = l.localName;
|
|
@@ -1504,28 +1508,28 @@ class Tn {
|
|
|
1504
1508
|
})), l.kind) {
|
|
1505
1509
|
case "scalar":
|
|
1506
1510
|
case "enum":
|
|
1507
|
-
let
|
|
1511
|
+
let N = l.kind == "enum" ? h.INT32 : l.T, L = l.kind == "scalar" ? l.L : void 0;
|
|
1508
1512
|
if (d) {
|
|
1509
|
-
let
|
|
1510
|
-
if (a ==
|
|
1511
|
-
let
|
|
1512
|
-
for (; e.pos <
|
|
1513
|
-
|
|
1513
|
+
let T = c[g];
|
|
1514
|
+
if (a == p.LengthDelimited && N != h.STRING && N != h.BYTES) {
|
|
1515
|
+
let $ = e.uint32() + e.pos;
|
|
1516
|
+
for (; e.pos < $; )
|
|
1517
|
+
T.push(this.scalar(e, N, L));
|
|
1514
1518
|
} else
|
|
1515
|
-
|
|
1519
|
+
T.push(this.scalar(e, N, L));
|
|
1516
1520
|
} else
|
|
1517
|
-
c[g] = this.scalar(e,
|
|
1521
|
+
c[g] = this.scalar(e, N, L);
|
|
1518
1522
|
break;
|
|
1519
1523
|
case "message":
|
|
1520
1524
|
if (d) {
|
|
1521
|
-
let
|
|
1522
|
-
|
|
1525
|
+
let T = c[g], $ = l.T().internalBinaryRead(e, e.uint32(), n);
|
|
1526
|
+
T.push($);
|
|
1523
1527
|
} else
|
|
1524
1528
|
c[g] = l.T().internalBinaryRead(e, e.uint32(), n, c[g]);
|
|
1525
1529
|
break;
|
|
1526
1530
|
case "map":
|
|
1527
|
-
let [
|
|
1528
|
-
c[g][
|
|
1531
|
+
let [O, J] = this.mapEntry(l, e, n);
|
|
1532
|
+
c[g][O] = J;
|
|
1529
1533
|
break;
|
|
1530
1534
|
}
|
|
1531
1535
|
}
|
|
@@ -1534,12 +1538,12 @@ class Tn {
|
|
|
1534
1538
|
* Read a map field, expecting key field = 1, value field = 2
|
|
1535
1539
|
*/
|
|
1536
1540
|
mapEntry(e, t, n) {
|
|
1537
|
-
let
|
|
1541
|
+
let r = t.uint32(), s = t.pos + r, o, a;
|
|
1538
1542
|
for (; t.pos < s; ) {
|
|
1539
1543
|
let [l, c] = t.tag();
|
|
1540
1544
|
switch (l) {
|
|
1541
1545
|
case 1:
|
|
1542
|
-
e.K == h.BOOL ? o = t.bool().toString() : o = this.scalar(t, e.K,
|
|
1546
|
+
e.K == h.BOOL ? o = t.bool().toString() : o = this.scalar(t, e.K, Q.STRING);
|
|
1543
1547
|
break;
|
|
1544
1548
|
case 2:
|
|
1545
1549
|
switch (e.V.kind) {
|
|
@@ -1559,13 +1563,13 @@ class Tn {
|
|
|
1559
1563
|
}
|
|
1560
1564
|
}
|
|
1561
1565
|
if (o === void 0) {
|
|
1562
|
-
let l =
|
|
1566
|
+
let l = ot(e.K);
|
|
1563
1567
|
o = e.K == h.BOOL ? l.toString() : l;
|
|
1564
1568
|
}
|
|
1565
1569
|
if (a === void 0)
|
|
1566
1570
|
switch (e.V.kind) {
|
|
1567
1571
|
case "scalar":
|
|
1568
|
-
a =
|
|
1572
|
+
a = ot(e.V.T, e.V.L);
|
|
1569
1573
|
break;
|
|
1570
1574
|
case "enum":
|
|
1571
1575
|
a = 0;
|
|
@@ -1611,7 +1615,7 @@ class Tn {
|
|
|
1611
1615
|
}
|
|
1612
1616
|
}
|
|
1613
1617
|
}
|
|
1614
|
-
class
|
|
1618
|
+
class On {
|
|
1615
1619
|
constructor(e) {
|
|
1616
1620
|
this.info = e;
|
|
1617
1621
|
}
|
|
@@ -1640,44 +1644,44 @@ class An {
|
|
|
1640
1644
|
case "enum":
|
|
1641
1645
|
let d = s.kind == "enum" ? h.INT32 : s.T;
|
|
1642
1646
|
if (l)
|
|
1643
|
-
if (
|
|
1647
|
+
if (y(Array.isArray(o)), l == He.PACKED)
|
|
1644
1648
|
this.packed(t, d, s.no, o);
|
|
1645
1649
|
else
|
|
1646
1650
|
for (const g of o)
|
|
1647
1651
|
this.scalar(t, d, s.no, g, !0);
|
|
1648
|
-
else o === void 0 ?
|
|
1652
|
+
else o === void 0 ? y(s.opt) : this.scalar(t, d, s.no, o, a || s.opt);
|
|
1649
1653
|
break;
|
|
1650
1654
|
case "message":
|
|
1651
1655
|
if (l) {
|
|
1652
|
-
|
|
1656
|
+
y(Array.isArray(o));
|
|
1653
1657
|
for (const g of o)
|
|
1654
1658
|
this.message(t, n, s.T(), s.no, g);
|
|
1655
1659
|
} else
|
|
1656
1660
|
this.message(t, n, s.T(), s.no, o);
|
|
1657
1661
|
break;
|
|
1658
1662
|
case "map":
|
|
1659
|
-
|
|
1660
|
-
for (const [g,
|
|
1661
|
-
this.mapEntry(t, n, s, g,
|
|
1663
|
+
y(typeof o == "object" && o !== null);
|
|
1664
|
+
for (const [g, N] of Object.entries(o))
|
|
1665
|
+
this.mapEntry(t, n, s, g, N);
|
|
1662
1666
|
break;
|
|
1663
1667
|
}
|
|
1664
1668
|
}
|
|
1665
|
-
let
|
|
1666
|
-
|
|
1669
|
+
let r = n.writeUnknownFields;
|
|
1670
|
+
r !== !1 && (r === !0 ? k.onWrite : r)(this.info.typeName, e, t);
|
|
1667
1671
|
}
|
|
1668
|
-
mapEntry(e, t, n,
|
|
1669
|
-
e.tag(n.no,
|
|
1670
|
-
let o =
|
|
1672
|
+
mapEntry(e, t, n, r, s) {
|
|
1673
|
+
e.tag(n.no, p.LengthDelimited), e.fork();
|
|
1674
|
+
let o = r;
|
|
1671
1675
|
switch (n.K) {
|
|
1672
1676
|
case h.INT32:
|
|
1673
1677
|
case h.FIXED32:
|
|
1674
1678
|
case h.UINT32:
|
|
1675
1679
|
case h.SFIXED32:
|
|
1676
1680
|
case h.SINT32:
|
|
1677
|
-
o = Number.parseInt(
|
|
1681
|
+
o = Number.parseInt(r);
|
|
1678
1682
|
break;
|
|
1679
1683
|
case h.BOOL:
|
|
1680
|
-
|
|
1684
|
+
y(r == "true" || r == "false"), o = r == "true";
|
|
1681
1685
|
break;
|
|
1682
1686
|
}
|
|
1683
1687
|
switch (this.scalar(e, n.K, 1, o, !0), n.V.kind) {
|
|
@@ -1693,26 +1697,26 @@ class An {
|
|
|
1693
1697
|
}
|
|
1694
1698
|
e.join();
|
|
1695
1699
|
}
|
|
1696
|
-
message(e, t, n,
|
|
1697
|
-
s !== void 0 && (n.internalBinaryWrite(s, e.tag(
|
|
1700
|
+
message(e, t, n, r, s) {
|
|
1701
|
+
s !== void 0 && (n.internalBinaryWrite(s, e.tag(r, p.LengthDelimited).fork(), t), e.join());
|
|
1698
1702
|
}
|
|
1699
1703
|
/**
|
|
1700
1704
|
* Write a single scalar value.
|
|
1701
1705
|
*/
|
|
1702
|
-
scalar(e, t, n,
|
|
1703
|
-
let [o, a, l] = this.scalarInfo(t,
|
|
1704
|
-
(!l || s) && (e.tag(n, o), e[a](
|
|
1706
|
+
scalar(e, t, n, r, s) {
|
|
1707
|
+
let [o, a, l] = this.scalarInfo(t, r);
|
|
1708
|
+
(!l || s) && (e.tag(n, o), e[a](r));
|
|
1705
1709
|
}
|
|
1706
1710
|
/**
|
|
1707
1711
|
* Write an array of scalar values in packed format.
|
|
1708
1712
|
*/
|
|
1709
|
-
packed(e, t, n,
|
|
1710
|
-
if (!
|
|
1713
|
+
packed(e, t, n, r) {
|
|
1714
|
+
if (!r.length)
|
|
1711
1715
|
return;
|
|
1712
|
-
|
|
1716
|
+
y(t !== h.BYTES && t !== h.STRING), e.tag(n, p.LengthDelimited), e.fork();
|
|
1713
1717
|
let [, s] = this.scalarInfo(t);
|
|
1714
|
-
for (let o = 0; o <
|
|
1715
|
-
e[s](
|
|
1718
|
+
for (let o = 0; o < r.length; o++)
|
|
1719
|
+
e[s](r[o]);
|
|
1716
1720
|
e.join();
|
|
1717
1721
|
}
|
|
1718
1722
|
/**
|
|
@@ -1726,60 +1730,60 @@ class An {
|
|
|
1726
1730
|
* If argument `value` is omitted, [2] is always false.
|
|
1727
1731
|
*/
|
|
1728
1732
|
scalarInfo(e, t) {
|
|
1729
|
-
let n =
|
|
1733
|
+
let n = p.Varint, r, s = t === void 0, o = t === 0;
|
|
1730
1734
|
switch (e) {
|
|
1731
1735
|
case h.INT32:
|
|
1732
|
-
|
|
1736
|
+
r = "int32";
|
|
1733
1737
|
break;
|
|
1734
1738
|
case h.STRING:
|
|
1735
|
-
o = s || !t.length, n =
|
|
1739
|
+
o = s || !t.length, n = p.LengthDelimited, r = "string";
|
|
1736
1740
|
break;
|
|
1737
1741
|
case h.BOOL:
|
|
1738
|
-
o = t === !1,
|
|
1742
|
+
o = t === !1, r = "bool";
|
|
1739
1743
|
break;
|
|
1740
1744
|
case h.UINT32:
|
|
1741
|
-
|
|
1745
|
+
r = "uint32";
|
|
1742
1746
|
break;
|
|
1743
1747
|
case h.DOUBLE:
|
|
1744
|
-
n =
|
|
1748
|
+
n = p.Bit64, r = "double";
|
|
1745
1749
|
break;
|
|
1746
1750
|
case h.FLOAT:
|
|
1747
|
-
n =
|
|
1751
|
+
n = p.Bit32, r = "float";
|
|
1748
1752
|
break;
|
|
1749
1753
|
case h.INT64:
|
|
1750
|
-
o = s ||
|
|
1754
|
+
o = s || C.from(t).isZero(), r = "int64";
|
|
1751
1755
|
break;
|
|
1752
1756
|
case h.UINT64:
|
|
1753
|
-
o = s ||
|
|
1757
|
+
o = s || U.from(t).isZero(), r = "uint64";
|
|
1754
1758
|
break;
|
|
1755
1759
|
case h.FIXED64:
|
|
1756
|
-
o = s ||
|
|
1760
|
+
o = s || U.from(t).isZero(), n = p.Bit64, r = "fixed64";
|
|
1757
1761
|
break;
|
|
1758
1762
|
case h.BYTES:
|
|
1759
|
-
o = s || !t.byteLength, n =
|
|
1763
|
+
o = s || !t.byteLength, n = p.LengthDelimited, r = "bytes";
|
|
1760
1764
|
break;
|
|
1761
1765
|
case h.FIXED32:
|
|
1762
|
-
n =
|
|
1766
|
+
n = p.Bit32, r = "fixed32";
|
|
1763
1767
|
break;
|
|
1764
1768
|
case h.SFIXED32:
|
|
1765
|
-
n =
|
|
1769
|
+
n = p.Bit32, r = "sfixed32";
|
|
1766
1770
|
break;
|
|
1767
1771
|
case h.SFIXED64:
|
|
1768
|
-
o = s ||
|
|
1772
|
+
o = s || C.from(t).isZero(), n = p.Bit64, r = "sfixed64";
|
|
1769
1773
|
break;
|
|
1770
1774
|
case h.SINT32:
|
|
1771
|
-
|
|
1775
|
+
r = "sint32";
|
|
1772
1776
|
break;
|
|
1773
1777
|
case h.SINT64:
|
|
1774
|
-
o = s ||
|
|
1778
|
+
o = s || C.from(t).isZero(), r = "sint64";
|
|
1775
1779
|
break;
|
|
1776
1780
|
}
|
|
1777
|
-
return [n,
|
|
1781
|
+
return [n, r, s || o];
|
|
1778
1782
|
}
|
|
1779
1783
|
}
|
|
1780
|
-
function
|
|
1781
|
-
const e =
|
|
1782
|
-
for (let t of
|
|
1784
|
+
function Bn(i) {
|
|
1785
|
+
const e = i.messagePrototype ? Object.create(i.messagePrototype) : Object.defineProperty({}, St, { value: i });
|
|
1786
|
+
for (let t of i.fields) {
|
|
1783
1787
|
let n = t.localName;
|
|
1784
1788
|
if (!t.opt)
|
|
1785
1789
|
if (t.oneof)
|
|
@@ -1789,7 +1793,7 @@ function Fn(r) {
|
|
|
1789
1793
|
else
|
|
1790
1794
|
switch (t.kind) {
|
|
1791
1795
|
case "scalar":
|
|
1792
|
-
e[n] =
|
|
1796
|
+
e[n] = ot(t.T, t.L);
|
|
1793
1797
|
break;
|
|
1794
1798
|
case "enum":
|
|
1795
1799
|
e[n] = 0;
|
|
@@ -1801,19 +1805,19 @@ function Fn(r) {
|
|
|
1801
1805
|
}
|
|
1802
1806
|
return e;
|
|
1803
1807
|
}
|
|
1804
|
-
function
|
|
1805
|
-
let n,
|
|
1806
|
-
for (let o of
|
|
1808
|
+
function D(i, e, t) {
|
|
1809
|
+
let n, r = t, s;
|
|
1810
|
+
for (let o of i.fields) {
|
|
1807
1811
|
let a = o.localName;
|
|
1808
1812
|
if (o.oneof) {
|
|
1809
|
-
const l =
|
|
1813
|
+
const l = r[o.oneof];
|
|
1810
1814
|
if ((l == null ? void 0 : l.oneofKind) == null)
|
|
1811
1815
|
continue;
|
|
1812
1816
|
if (n = l[a], s = e[o.oneof], s.oneofKind = l.oneofKind, n == null) {
|
|
1813
1817
|
delete s[a];
|
|
1814
1818
|
continue;
|
|
1815
1819
|
}
|
|
1816
|
-
} else if (n =
|
|
1820
|
+
} else if (n = r[a], s = e, n == null)
|
|
1817
1821
|
continue;
|
|
1818
1822
|
switch (o.repeat && (s[a].length = n.length), o.kind) {
|
|
1819
1823
|
case "scalar":
|
|
@@ -1847,71 +1851,71 @@ function R(r, e, t) {
|
|
|
1847
1851
|
}
|
|
1848
1852
|
}
|
|
1849
1853
|
}
|
|
1850
|
-
function
|
|
1854
|
+
function Cn(i, e, t) {
|
|
1851
1855
|
if (e === t)
|
|
1852
1856
|
return !0;
|
|
1853
1857
|
if (!e || !t)
|
|
1854
1858
|
return !1;
|
|
1855
|
-
for (let n of
|
|
1856
|
-
let
|
|
1859
|
+
for (let n of i.fields) {
|
|
1860
|
+
let r = n.localName, s = n.oneof ? e[n.oneof][r] : e[r], o = n.oneof ? t[n.oneof][r] : t[r];
|
|
1857
1861
|
switch (n.kind) {
|
|
1858
1862
|
case "enum":
|
|
1859
1863
|
case "scalar":
|
|
1860
1864
|
let a = n.kind == "enum" ? h.INT32 : n.T;
|
|
1861
|
-
if (!(n.repeat ?
|
|
1865
|
+
if (!(n.repeat ? Et(a, s, o) : Mt(a, s, o)))
|
|
1862
1866
|
return !1;
|
|
1863
1867
|
break;
|
|
1864
1868
|
case "map":
|
|
1865
|
-
if (!(n.V.kind == "message" ?
|
|
1869
|
+
if (!(n.V.kind == "message" ? It(n.V.T(), Se(s), Se(o)) : Et(n.V.kind == "enum" ? h.INT32 : n.V.T, Se(s), Se(o))))
|
|
1866
1870
|
return !1;
|
|
1867
1871
|
break;
|
|
1868
1872
|
case "message":
|
|
1869
1873
|
let l = n.T();
|
|
1870
|
-
if (!(n.repeat ?
|
|
1874
|
+
if (!(n.repeat ? It(l, s, o) : l.equals(s, o)))
|
|
1871
1875
|
return !1;
|
|
1872
1876
|
break;
|
|
1873
1877
|
}
|
|
1874
1878
|
}
|
|
1875
1879
|
return !0;
|
|
1876
1880
|
}
|
|
1877
|
-
const
|
|
1878
|
-
function
|
|
1881
|
+
const Se = Object.values;
|
|
1882
|
+
function Mt(i, e, t) {
|
|
1879
1883
|
if (e === t)
|
|
1880
1884
|
return !0;
|
|
1881
|
-
if (
|
|
1885
|
+
if (i !== h.BYTES)
|
|
1882
1886
|
return !1;
|
|
1883
|
-
let n = e,
|
|
1884
|
-
if (n.length !==
|
|
1887
|
+
let n = e, r = t;
|
|
1888
|
+
if (n.length !== r.length)
|
|
1885
1889
|
return !1;
|
|
1886
1890
|
for (let s = 0; s < n.length; s++)
|
|
1887
|
-
if (n[s] !=
|
|
1891
|
+
if (n[s] != r[s])
|
|
1888
1892
|
return !1;
|
|
1889
1893
|
return !0;
|
|
1890
1894
|
}
|
|
1891
|
-
function
|
|
1895
|
+
function Et(i, e, t) {
|
|
1892
1896
|
if (e.length !== t.length)
|
|
1893
1897
|
return !1;
|
|
1894
1898
|
for (let n = 0; n < e.length; n++)
|
|
1895
|
-
if (!
|
|
1899
|
+
if (!Mt(i, e[n], t[n]))
|
|
1896
1900
|
return !1;
|
|
1897
1901
|
return !0;
|
|
1898
1902
|
}
|
|
1899
|
-
function
|
|
1903
|
+
function It(i, e, t) {
|
|
1900
1904
|
if (e.length !== t.length)
|
|
1901
1905
|
return !1;
|
|
1902
1906
|
for (let n = 0; n < e.length; n++)
|
|
1903
|
-
if (!
|
|
1907
|
+
if (!i.equals(e[n], t[n]))
|
|
1904
1908
|
return !1;
|
|
1905
1909
|
return !0;
|
|
1906
1910
|
}
|
|
1907
|
-
const
|
|
1911
|
+
const vn = Object.getOwnPropertyDescriptors(Object.getPrototypeOf({}));
|
|
1908
1912
|
class M {
|
|
1909
1913
|
constructor(e, t, n) {
|
|
1910
|
-
this.defaultCheckDepth = 16, this.typeName = e, this.fields = t.map(
|
|
1914
|
+
this.defaultCheckDepth = 16, this.typeName = e, this.fields = t.map(En), this.options = n ?? {}, this.messagePrototype = Object.create(null, Object.assign(Object.assign({}, vn), { [St]: { value: this } })), this.refTypeCheck = new An(this), this.refJsonReader = new Tn(this), this.refJsonWriter = new Fn(this), this.refBinReader = new Ln(this), this.refBinWriter = new On(this);
|
|
1911
1915
|
}
|
|
1912
1916
|
create(e) {
|
|
1913
|
-
let t =
|
|
1914
|
-
return e !== void 0 &&
|
|
1917
|
+
let t = Bn(this);
|
|
1918
|
+
return e !== void 0 && D(this, t, e), t;
|
|
1915
1919
|
}
|
|
1916
1920
|
/**
|
|
1917
1921
|
* Clone the message.
|
|
@@ -1920,7 +1924,7 @@ class M {
|
|
|
1920
1924
|
*/
|
|
1921
1925
|
clone(e) {
|
|
1922
1926
|
let t = this.create();
|
|
1923
|
-
return
|
|
1927
|
+
return D(this, t, e), t;
|
|
1924
1928
|
}
|
|
1925
1929
|
/**
|
|
1926
1930
|
* Determines whether two message of the same type have the same field values.
|
|
@@ -1929,7 +1933,7 @@ class M {
|
|
|
1929
1933
|
* Will also return true if both messages are `undefined`.
|
|
1930
1934
|
*/
|
|
1931
1935
|
equals(e, t) {
|
|
1932
|
-
return
|
|
1936
|
+
return Cn(this, e, t);
|
|
1933
1937
|
}
|
|
1934
1938
|
/**
|
|
1935
1939
|
* Is the given value assignable to our message type
|
|
@@ -1949,20 +1953,20 @@ class M {
|
|
|
1949
1953
|
* Copy partial data into the target message.
|
|
1950
1954
|
*/
|
|
1951
1955
|
mergePartial(e, t) {
|
|
1952
|
-
|
|
1956
|
+
D(this, e, t);
|
|
1953
1957
|
}
|
|
1954
1958
|
/**
|
|
1955
1959
|
* Create a new message from binary format.
|
|
1956
1960
|
*/
|
|
1957
1961
|
fromBinary(e, t) {
|
|
1958
|
-
let n =
|
|
1962
|
+
let n = hn(t);
|
|
1959
1963
|
return this.internalBinaryRead(n.readerFactory(e), e.byteLength, n);
|
|
1960
1964
|
}
|
|
1961
1965
|
/**
|
|
1962
1966
|
* Read a new message from a JSON value.
|
|
1963
1967
|
*/
|
|
1964
1968
|
fromJson(e, t) {
|
|
1965
|
-
return this.internalJsonRead(e,
|
|
1969
|
+
return this.internalJsonRead(e, yn(t));
|
|
1966
1970
|
}
|
|
1967
1971
|
/**
|
|
1968
1972
|
* Read a new message from a JSON string.
|
|
@@ -1976,7 +1980,7 @@ class M {
|
|
|
1976
1980
|
* Write the message to canonical JSON value.
|
|
1977
1981
|
*/
|
|
1978
1982
|
toJson(e, t) {
|
|
1979
|
-
return this.internalJsonWrite(e,
|
|
1983
|
+
return this.internalJsonWrite(e, Nn(t));
|
|
1980
1984
|
}
|
|
1981
1985
|
/**
|
|
1982
1986
|
* Convert the message to canonical JSON string.
|
|
@@ -1984,14 +1988,14 @@ class M {
|
|
|
1984
1988
|
*/
|
|
1985
1989
|
toJsonString(e, t) {
|
|
1986
1990
|
var n;
|
|
1987
|
-
let
|
|
1988
|
-
return JSON.stringify(
|
|
1991
|
+
let r = this.toJson(e, t);
|
|
1992
|
+
return JSON.stringify(r, null, (n = t == null ? void 0 : t.prettySpaces) !== null && n !== void 0 ? n : 0);
|
|
1989
1993
|
}
|
|
1990
1994
|
/**
|
|
1991
1995
|
* Write the message to binary format.
|
|
1992
1996
|
*/
|
|
1993
1997
|
toBinary(e, t) {
|
|
1994
|
-
let n =
|
|
1998
|
+
let n = wn(t);
|
|
1995
1999
|
return this.internalBinaryWrite(e, n.writerFactory(), n).finish();
|
|
1996
2000
|
}
|
|
1997
2001
|
/**
|
|
@@ -2004,10 +2008,10 @@ class M {
|
|
|
2004
2008
|
*/
|
|
2005
2009
|
internalJsonRead(e, t, n) {
|
|
2006
2010
|
if (e !== null && typeof e == "object" && !Array.isArray(e)) {
|
|
2007
|
-
let
|
|
2008
|
-
return this.refJsonReader.read(e,
|
|
2011
|
+
let r = n ?? this.create();
|
|
2012
|
+
return this.refJsonReader.read(e, r, t), r;
|
|
2009
2013
|
}
|
|
2010
|
-
throw new Error(`Unable to parse message ${this.typeName} from JSON ${
|
|
2014
|
+
throw new Error(`Unable to parse message ${this.typeName} from JSON ${Ct(e)}.`);
|
|
2011
2015
|
}
|
|
2012
2016
|
/**
|
|
2013
2017
|
* This is an internal method. If you just want to write a message
|
|
@@ -2036,19 +2040,19 @@ class M {
|
|
|
2036
2040
|
* the target according to protobuf rules. If the target is
|
|
2037
2041
|
* omitted, a new instance is created first.
|
|
2038
2042
|
*/
|
|
2039
|
-
internalBinaryRead(e, t, n,
|
|
2040
|
-
let s =
|
|
2043
|
+
internalBinaryRead(e, t, n, r) {
|
|
2044
|
+
let s = r ?? this.create();
|
|
2041
2045
|
return this.refBinReader.read(e, s, n, t), s;
|
|
2042
2046
|
}
|
|
2043
2047
|
}
|
|
2044
|
-
function
|
|
2045
|
-
var t, n,
|
|
2046
|
-
let s =
|
|
2047
|
-
return s.service = e, s.localName = (t = s.localName) !== null && t !== void 0 ? t :
|
|
2048
|
+
function _n(i, e) {
|
|
2049
|
+
var t, n, r;
|
|
2050
|
+
let s = i;
|
|
2051
|
+
return s.service = e, s.localName = (t = s.localName) !== null && t !== void 0 ? t : st(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;
|
|
2048
2052
|
}
|
|
2049
|
-
class
|
|
2053
|
+
class ct {
|
|
2050
2054
|
constructor(e, t, n) {
|
|
2051
|
-
this.typeName = e, this.methods = t.map((
|
|
2055
|
+
this.typeName = e, this.methods = t.map((r) => _n(r, this)), this.options = n ?? {};
|
|
2052
2056
|
}
|
|
2053
2057
|
}
|
|
2054
2058
|
class I extends Error {
|
|
@@ -2061,49 +2065,49 @@ class I extends Error {
|
|
|
2061
2065
|
let t = Object.entries(this.meta);
|
|
2062
2066
|
if (t.length) {
|
|
2063
2067
|
e.push(""), e.push("Meta:");
|
|
2064
|
-
for (let [n,
|
|
2065
|
-
e.push(` ${n}: ${
|
|
2068
|
+
for (let [n, r] of t)
|
|
2069
|
+
e.push(` ${n}: ${r}`);
|
|
2066
2070
|
}
|
|
2067
2071
|
return e.join(`
|
|
2068
2072
|
`);
|
|
2069
2073
|
}
|
|
2070
2074
|
}
|
|
2071
|
-
function
|
|
2075
|
+
function xn(i, e) {
|
|
2072
2076
|
if (!e)
|
|
2073
|
-
return
|
|
2077
|
+
return i;
|
|
2074
2078
|
let t = {};
|
|
2075
|
-
|
|
2079
|
+
Me(i, t), Me(e, t);
|
|
2076
2080
|
for (let n of Object.keys(e)) {
|
|
2077
|
-
let
|
|
2081
|
+
let r = e[n];
|
|
2078
2082
|
switch (n) {
|
|
2079
2083
|
case "jsonOptions":
|
|
2080
|
-
t.jsonOptions =
|
|
2084
|
+
t.jsonOptions = kn(i.jsonOptions, t.jsonOptions);
|
|
2081
2085
|
break;
|
|
2082
2086
|
case "binaryOptions":
|
|
2083
|
-
t.binaryOptions =
|
|
2087
|
+
t.binaryOptions = on(i.binaryOptions, t.binaryOptions);
|
|
2084
2088
|
break;
|
|
2085
2089
|
case "meta":
|
|
2086
|
-
t.meta = {},
|
|
2090
|
+
t.meta = {}, Me(i.meta, t.meta), Me(e.meta, t.meta);
|
|
2087
2091
|
break;
|
|
2088
2092
|
case "interceptors":
|
|
2089
|
-
t.interceptors =
|
|
2093
|
+
t.interceptors = i.interceptors ? i.interceptors.concat(r) : r.concat();
|
|
2090
2094
|
break;
|
|
2091
2095
|
}
|
|
2092
2096
|
}
|
|
2093
2097
|
return t;
|
|
2094
2098
|
}
|
|
2095
|
-
function
|
|
2096
|
-
if (!
|
|
2099
|
+
function Me(i, e) {
|
|
2100
|
+
if (!i)
|
|
2097
2101
|
return;
|
|
2098
2102
|
let t = e;
|
|
2099
|
-
for (let [n,
|
|
2100
|
-
|
|
2103
|
+
for (let [n, r] of Object.entries(i))
|
|
2104
|
+
r instanceof Date ? t[n] = new Date(r.getTime()) : Array.isArray(r) ? t[n] = r.concat() : t[n] = r;
|
|
2101
2105
|
}
|
|
2102
|
-
var
|
|
2103
|
-
(function(
|
|
2104
|
-
|
|
2105
|
-
})(
|
|
2106
|
-
class
|
|
2106
|
+
var q;
|
|
2107
|
+
(function(i) {
|
|
2108
|
+
i[i.PENDING = 0] = "PENDING", i[i.REJECTED = 1] = "REJECTED", i[i.RESOLVED = 2] = "RESOLVED";
|
|
2109
|
+
})(q || (q = {}));
|
|
2110
|
+
class ue {
|
|
2107
2111
|
/**
|
|
2108
2112
|
* @param preventUnhandledRejectionWarning - prevents the warning
|
|
2109
2113
|
* "Unhandled Promise rejection" by adding a noop rejection handler.
|
|
@@ -2117,7 +2121,7 @@ class le {
|
|
|
2117
2121
|
* others.
|
|
2118
2122
|
*/
|
|
2119
2123
|
constructor(e = !0) {
|
|
2120
|
-
this._state =
|
|
2124
|
+
this._state = q.PENDING, this._promise = new Promise((t, n) => {
|
|
2121
2125
|
this._resolve = t, this._reject = n;
|
|
2122
2126
|
}), e && this._promise.catch((t) => {
|
|
2123
2127
|
});
|
|
@@ -2138,29 +2142,29 @@ class le {
|
|
|
2138
2142
|
* Resolve the promise. Throws if the promise is already resolved or rejected.
|
|
2139
2143
|
*/
|
|
2140
2144
|
resolve(e) {
|
|
2141
|
-
if (this.state !==
|
|
2142
|
-
throw new Error(`cannot resolve ${
|
|
2143
|
-
this._resolve(e), this._state =
|
|
2145
|
+
if (this.state !== q.PENDING)
|
|
2146
|
+
throw new Error(`cannot resolve ${q[this.state].toLowerCase()}`);
|
|
2147
|
+
this._resolve(e), this._state = q.RESOLVED;
|
|
2144
2148
|
}
|
|
2145
2149
|
/**
|
|
2146
2150
|
* Reject the promise. Throws if the promise is already resolved or rejected.
|
|
2147
2151
|
*/
|
|
2148
2152
|
reject(e) {
|
|
2149
|
-
if (this.state !==
|
|
2150
|
-
throw new Error(`cannot reject ${
|
|
2151
|
-
this._reject(e), this._state =
|
|
2153
|
+
if (this.state !== q.PENDING)
|
|
2154
|
+
throw new Error(`cannot reject ${q[this.state].toLowerCase()}`);
|
|
2155
|
+
this._reject(e), this._state = q.REJECTED;
|
|
2152
2156
|
}
|
|
2153
2157
|
/**
|
|
2154
2158
|
* Resolve the promise. Ignore if not pending.
|
|
2155
2159
|
*/
|
|
2156
2160
|
resolvePending(e) {
|
|
2157
|
-
this._state ===
|
|
2161
|
+
this._state === q.PENDING && this.resolve(e);
|
|
2158
2162
|
}
|
|
2159
2163
|
/**
|
|
2160
2164
|
* Reject the promise. Ignore if not pending.
|
|
2161
2165
|
*/
|
|
2162
2166
|
rejectPending(e) {
|
|
2163
|
-
this._state ===
|
|
2167
|
+
this._state === q.PENDING && this.reject(e);
|
|
2164
2168
|
}
|
|
2165
2169
|
}
|
|
2166
2170
|
class Dn {
|
|
@@ -2209,7 +2213,7 @@ class Dn {
|
|
|
2209
2213
|
* Can be used to wrap a stream by using the other stream's `onNext`.
|
|
2210
2214
|
*/
|
|
2211
2215
|
notifyNext(e, t, n) {
|
|
2212
|
-
|
|
2216
|
+
y((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();
|
|
2213
2217
|
}
|
|
2214
2218
|
/**
|
|
2215
2219
|
* Emits a new message. Throws if stream is closed.
|
|
@@ -2217,7 +2221,7 @@ class Dn {
|
|
|
2217
2221
|
* Triggers onNext and onMessage callbacks.
|
|
2218
2222
|
*/
|
|
2219
2223
|
notifyMessage(e) {
|
|
2220
|
-
|
|
2224
|
+
y(!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));
|
|
2221
2225
|
}
|
|
2222
2226
|
/**
|
|
2223
2227
|
* Closes the stream with an error. Throws if stream is closed.
|
|
@@ -2225,7 +2229,7 @@ class Dn {
|
|
|
2225
2229
|
* Triggers onNext and onError callbacks.
|
|
2226
2230
|
*/
|
|
2227
2231
|
notifyError(e) {
|
|
2228
|
-
|
|
2232
|
+
y(!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();
|
|
2229
2233
|
}
|
|
2230
2234
|
/**
|
|
2231
2235
|
* Closes the stream successfully. Throws if stream is closed.
|
|
@@ -2233,7 +2237,7 @@ class Dn {
|
|
|
2233
2237
|
* Triggers onNext and onComplete callbacks.
|
|
2234
2238
|
*/
|
|
2235
2239
|
notifyComplete() {
|
|
2236
|
-
|
|
2240
|
+
y(!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();
|
|
2237
2241
|
}
|
|
2238
2242
|
/**
|
|
2239
2243
|
* Creates an async iterator (that can be used with `for await {...}`)
|
|
@@ -2252,9 +2256,9 @@ class Dn {
|
|
|
2252
2256
|
return this._itState || (this._itState = { q: [] }), this._closed === !0 ? this.pushIt({ value: null, done: !0 }) : this._closed !== !1 && this.pushIt(this._closed), {
|
|
2253
2257
|
next: () => {
|
|
2254
2258
|
let e = this._itState;
|
|
2255
|
-
|
|
2259
|
+
y(e, "bad state"), y(!e.p, "iterator contract broken");
|
|
2256
2260
|
let t = e.q.shift();
|
|
2257
|
-
return t ? "value" in t ? Promise.resolve(t) : Promise.reject(t) : (e.p = new
|
|
2261
|
+
return t ? "value" in t ? Promise.resolve(t) : Promise.reject(t) : (e.p = new ue(), e.p.promise);
|
|
2258
2262
|
}
|
|
2259
2263
|
};
|
|
2260
2264
|
}
|
|
@@ -2265,13 +2269,13 @@ class Dn {
|
|
|
2265
2269
|
if (t)
|
|
2266
2270
|
if (t.p) {
|
|
2267
2271
|
const n = t.p;
|
|
2268
|
-
|
|
2272
|
+
y(n.state == q.PENDING, "iterator contract broken"), "value" in e ? n.resolve(e) : n.reject(e), delete t.p;
|
|
2269
2273
|
} else
|
|
2270
2274
|
t.q.push(e);
|
|
2271
2275
|
}
|
|
2272
2276
|
}
|
|
2273
|
-
var
|
|
2274
|
-
function
|
|
2277
|
+
var Rn = function(i, e, t, n) {
|
|
2278
|
+
function r(s) {
|
|
2275
2279
|
return s instanceof t ? s : new t(function(o) {
|
|
2276
2280
|
o(s);
|
|
2277
2281
|
});
|
|
@@ -2292,14 +2296,14 @@ var Cn = function(r, e, t, n) {
|
|
|
2292
2296
|
}
|
|
2293
2297
|
}
|
|
2294
2298
|
function c(d) {
|
|
2295
|
-
d.done ? s(d.value) :
|
|
2299
|
+
d.done ? s(d.value) : r(d.value).then(a, l);
|
|
2296
2300
|
}
|
|
2297
|
-
c((n = n.apply(
|
|
2301
|
+
c((n = n.apply(i, e || [])).next());
|
|
2298
2302
|
});
|
|
2299
2303
|
};
|
|
2300
2304
|
class Un {
|
|
2301
|
-
constructor(e, t, n,
|
|
2302
|
-
this.method = e, this.requestHeaders = t, this.request = n, this.headers =
|
|
2305
|
+
constructor(e, t, n, r, s, o, a) {
|
|
2306
|
+
this.method = e, this.requestHeaders = t, this.request = n, this.headers = r, this.response = s, this.status = o, this.trailers = a;
|
|
2303
2307
|
}
|
|
2304
2308
|
/**
|
|
2305
2309
|
* If you are only interested in the final outcome of this call,
|
|
@@ -2309,8 +2313,8 @@ class Un {
|
|
|
2309
2313
|
return this.promiseFinished().then((n) => e ? Promise.resolve(e(n)) : n, (n) => t ? Promise.resolve(t(n)) : Promise.reject(n));
|
|
2310
2314
|
}
|
|
2311
2315
|
promiseFinished() {
|
|
2312
|
-
return
|
|
2313
|
-
let [e, t, n,
|
|
2316
|
+
return Rn(this, void 0, void 0, function* () {
|
|
2317
|
+
let [e, t, n, r] = yield Promise.all([this.headers, this.response, this.status, this.trailers]);
|
|
2314
2318
|
return {
|
|
2315
2319
|
method: this.method,
|
|
2316
2320
|
requestHeaders: this.requestHeaders,
|
|
@@ -2318,13 +2322,13 @@ class Un {
|
|
|
2318
2322
|
headers: e,
|
|
2319
2323
|
response: t,
|
|
2320
2324
|
status: n,
|
|
2321
|
-
trailers:
|
|
2325
|
+
trailers: r
|
|
2322
2326
|
};
|
|
2323
2327
|
});
|
|
2324
2328
|
}
|
|
2325
2329
|
}
|
|
2326
|
-
var
|
|
2327
|
-
function
|
|
2330
|
+
var Sn = function(i, e, t, n) {
|
|
2331
|
+
function r(s) {
|
|
2328
2332
|
return s instanceof t ? s : new t(function(o) {
|
|
2329
2333
|
o(s);
|
|
2330
2334
|
});
|
|
@@ -2345,14 +2349,14 @@ var Rn = function(r, e, t, n) {
|
|
|
2345
2349
|
}
|
|
2346
2350
|
}
|
|
2347
2351
|
function c(d) {
|
|
2348
|
-
d.done ? s(d.value) :
|
|
2352
|
+
d.done ? s(d.value) : r(d.value).then(a, l);
|
|
2349
2353
|
}
|
|
2350
|
-
c((n = n.apply(
|
|
2354
|
+
c((n = n.apply(i, e || [])).next());
|
|
2351
2355
|
});
|
|
2352
2356
|
};
|
|
2353
|
-
class
|
|
2354
|
-
constructor(e, t, n,
|
|
2355
|
-
this.method = e, this.requestHeaders = t, this.request = n, this.headers =
|
|
2357
|
+
class Mn {
|
|
2358
|
+
constructor(e, t, n, r, s, o, a) {
|
|
2359
|
+
this.method = e, this.requestHeaders = t, this.request = n, this.headers = r, this.responses = s, this.status = o, this.trailers = a;
|
|
2356
2360
|
}
|
|
2357
2361
|
/**
|
|
2358
2362
|
* Instead of awaiting the response status and trailers, you can
|
|
@@ -2364,7 +2368,7 @@ class xn {
|
|
|
2364
2368
|
return this.promiseFinished().then((n) => e ? Promise.resolve(e(n)) : n, (n) => t ? Promise.resolve(t(n)) : Promise.reject(n));
|
|
2365
2369
|
}
|
|
2366
2370
|
promiseFinished() {
|
|
2367
|
-
return
|
|
2371
|
+
return Sn(this, void 0, void 0, function* () {
|
|
2368
2372
|
let [e, t, n] = yield Promise.all([this.headers, this.status, this.trailers]);
|
|
2369
2373
|
return {
|
|
2370
2374
|
method: this.method,
|
|
@@ -2377,7 +2381,7 @@ class xn {
|
|
|
2377
2381
|
});
|
|
2378
2382
|
}
|
|
2379
2383
|
}
|
|
2380
|
-
function
|
|
2384
|
+
function le(i, e, t, n, r) {
|
|
2381
2385
|
var s;
|
|
2382
2386
|
{
|
|
2383
2387
|
let o = (a, l, c) => e.unary(a, l, c);
|
|
@@ -2385,15 +2389,15 @@ function se(r, e, t, n, i) {
|
|
|
2385
2389
|
const l = o;
|
|
2386
2390
|
o = (c, d, g) => a.interceptUnary(l, c, d, g);
|
|
2387
2391
|
}
|
|
2388
|
-
return o(t,
|
|
2392
|
+
return o(t, r, n);
|
|
2389
2393
|
}
|
|
2390
2394
|
}
|
|
2391
2395
|
var f;
|
|
2392
|
-
(function(
|
|
2393
|
-
|
|
2396
|
+
(function(i) {
|
|
2397
|
+
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";
|
|
2394
2398
|
})(f || (f = {}));
|
|
2395
|
-
var
|
|
2396
|
-
function
|
|
2399
|
+
var Vn = function(i, e, t, n) {
|
|
2400
|
+
function r(s) {
|
|
2397
2401
|
return s instanceof t ? s : new t(function(o) {
|
|
2398
2402
|
o(s);
|
|
2399
2403
|
});
|
|
@@ -2414,41 +2418,41 @@ var vn = function(r, e, t, n) {
|
|
|
2414
2418
|
}
|
|
2415
2419
|
}
|
|
2416
2420
|
function c(d) {
|
|
2417
|
-
d.done ? s(d.value) :
|
|
2421
|
+
d.done ? s(d.value) : r(d.value).then(a, l);
|
|
2418
2422
|
}
|
|
2419
|
-
c((n = n.apply(
|
|
2423
|
+
c((n = n.apply(i, e || [])).next());
|
|
2420
2424
|
});
|
|
2421
2425
|
};
|
|
2422
|
-
function
|
|
2426
|
+
function At(i, e, t, n, r) {
|
|
2423
2427
|
if (n)
|
|
2424
2428
|
for (let [s, o] of Object.entries(n))
|
|
2425
2429
|
if (typeof o == "string")
|
|
2426
|
-
|
|
2430
|
+
i.append(s, o);
|
|
2427
2431
|
else
|
|
2428
2432
|
for (let a of o)
|
|
2429
|
-
|
|
2430
|
-
if (
|
|
2433
|
+
i.append(s, a);
|
|
2434
|
+
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") {
|
|
2431
2435
|
if (t <= 0)
|
|
2432
2436
|
throw new I(`timeout ${t} ms exceeded`, f[f.DEADLINE_EXCEEDED]);
|
|
2433
|
-
|
|
2437
|
+
i.set("grpc-timeout", `${t}m`);
|
|
2434
2438
|
} else if (t) {
|
|
2435
2439
|
const s = t.getTime(), o = Date.now();
|
|
2436
2440
|
if (s <= o)
|
|
2437
2441
|
throw new I(`deadline ${t} exceeded`, f[f.DEADLINE_EXCEEDED]);
|
|
2438
|
-
|
|
2442
|
+
i.set("grpc-timeout", `${s - o}m`);
|
|
2439
2443
|
}
|
|
2440
|
-
return
|
|
2444
|
+
return i;
|
|
2441
2445
|
}
|
|
2442
|
-
function
|
|
2443
|
-
let t = new Uint8Array(5 +
|
|
2446
|
+
function Tt(i, e) {
|
|
2447
|
+
let t = new Uint8Array(5 + i.length);
|
|
2444
2448
|
t[0] = H.DATA;
|
|
2445
|
-
for (let n =
|
|
2446
|
-
t[
|
|
2447
|
-
return t.set(
|
|
2449
|
+
for (let n = i.length, r = 4; r > 0; r--)
|
|
2450
|
+
t[r] = n % 256, n >>>= 8;
|
|
2451
|
+
return t.set(i, 5), e === "binary" ? t : _t(t);
|
|
2448
2452
|
}
|
|
2449
|
-
function
|
|
2453
|
+
function at(i, e, t) {
|
|
2450
2454
|
if (arguments.length === 1) {
|
|
2451
|
-
let l =
|
|
2455
|
+
let l = i, c;
|
|
2452
2456
|
try {
|
|
2453
2457
|
c = l.type;
|
|
2454
2458
|
} catch {
|
|
@@ -2459,41 +2463,41 @@ function rt(r, e, t) {
|
|
|
2459
2463
|
case "opaqueredirect":
|
|
2460
2464
|
throw new I(`fetch response type ${l.type}`, f[f.UNKNOWN]);
|
|
2461
2465
|
}
|
|
2462
|
-
return
|
|
2466
|
+
return at(Wn(l.headers), l.status, l.statusText);
|
|
2463
2467
|
}
|
|
2464
|
-
let n =
|
|
2465
|
-
return (o === void 0 || o === f.OK) && !
|
|
2468
|
+
let n = i, r = e >= 200 && e < 300, s = $t(n), [o, a] = Vt(n);
|
|
2469
|
+
return (o === void 0 || o === f.OK) && !r && (o = qn(e), a = t), [o, a, s];
|
|
2466
2470
|
}
|
|
2467
|
-
function
|
|
2468
|
-
let e =
|
|
2469
|
-
return [t ?? f.OK, n,
|
|
2471
|
+
function Ft(i) {
|
|
2472
|
+
let e = jn(i), [t, n] = Vt(e), r = $t(e);
|
|
2473
|
+
return [t ?? f.OK, n, r];
|
|
2470
2474
|
}
|
|
2471
2475
|
var H;
|
|
2472
|
-
(function(
|
|
2473
|
-
|
|
2476
|
+
(function(i) {
|
|
2477
|
+
i[i.DATA = 0] = "DATA", i[i.TRAILER = 128] = "TRAILER";
|
|
2474
2478
|
})(H || (H = {}));
|
|
2475
|
-
function
|
|
2476
|
-
return
|
|
2477
|
-
let n,
|
|
2478
|
-
if (
|
|
2479
|
-
let a =
|
|
2479
|
+
function Lt(i, e, t) {
|
|
2480
|
+
return Vn(this, void 0, void 0, function* () {
|
|
2481
|
+
let n, r = "", s = new Uint8Array(0), o = Pn(e);
|
|
2482
|
+
if ($n(i)) {
|
|
2483
|
+
let a = i.getReader();
|
|
2480
2484
|
n = {
|
|
2481
2485
|
next: () => a.read()
|
|
2482
2486
|
};
|
|
2483
2487
|
} else
|
|
2484
|
-
n =
|
|
2488
|
+
n = i[Symbol.asyncIterator]();
|
|
2485
2489
|
for (; ; ) {
|
|
2486
2490
|
let a = yield n.next();
|
|
2487
2491
|
if (a.value !== void 0) {
|
|
2488
2492
|
if (o === "text") {
|
|
2489
2493
|
for (let c = 0; c < a.value.length; c++)
|
|
2490
|
-
|
|
2491
|
-
let l =
|
|
2494
|
+
r += String.fromCharCode(a.value[c]);
|
|
2495
|
+
let l = r.length - r.length % 4;
|
|
2492
2496
|
if (l === 0)
|
|
2493
2497
|
continue;
|
|
2494
|
-
s =
|
|
2498
|
+
s = Ot(s, vt(r.substring(0, l))), r = r.substring(l);
|
|
2495
2499
|
} else
|
|
2496
|
-
s =
|
|
2500
|
+
s = Ot(s, a.value);
|
|
2497
2501
|
for (; s.length >= 5 && s[0] === H.DATA; ) {
|
|
2498
2502
|
let l = 0;
|
|
2499
2503
|
for (let c = 1; c < 5; c++)
|
|
@@ -2515,13 +2519,13 @@ function It(r, e, t) {
|
|
|
2515
2519
|
}
|
|
2516
2520
|
});
|
|
2517
2521
|
}
|
|
2518
|
-
const
|
|
2519
|
-
function
|
|
2520
|
-
let t = new Uint8Array(
|
|
2521
|
-
return t.set(
|
|
2522
|
+
const $n = (i) => typeof i.getReader == "function";
|
|
2523
|
+
function Ot(i, e) {
|
|
2524
|
+
let t = new Uint8Array(i.length + e.length);
|
|
2525
|
+
return t.set(i), t.set(e, i.length), t;
|
|
2522
2526
|
}
|
|
2523
|
-
function
|
|
2524
|
-
switch (
|
|
2527
|
+
function Pn(i) {
|
|
2528
|
+
switch (i) {
|
|
2525
2529
|
case "application/grpc-web-text":
|
|
2526
2530
|
case "application/grpc-web-text+proto":
|
|
2527
2531
|
return "text";
|
|
@@ -2532,28 +2536,28 @@ function Mn(r) {
|
|
|
2532
2536
|
case null:
|
|
2533
2537
|
throw new I("missing response content type", f[f.INTERNAL]);
|
|
2534
2538
|
default:
|
|
2535
|
-
throw new I("unexpected response content type: " +
|
|
2539
|
+
throw new I("unexpected response content type: " + i, f[f.INTERNAL]);
|
|
2536
2540
|
}
|
|
2537
2541
|
}
|
|
2538
|
-
function
|
|
2539
|
-
let e, t, n =
|
|
2542
|
+
function Vt(i) {
|
|
2543
|
+
let e, t, n = i["grpc-message"];
|
|
2540
2544
|
if (n !== void 0) {
|
|
2541
2545
|
if (Array.isArray(n))
|
|
2542
2546
|
return [f.INTERNAL, "invalid grpc-web message"];
|
|
2543
2547
|
t = n;
|
|
2544
2548
|
}
|
|
2545
|
-
let
|
|
2546
|
-
if (
|
|
2547
|
-
if (Array.isArray(
|
|
2549
|
+
let r = i["grpc-status"];
|
|
2550
|
+
if (r !== void 0) {
|
|
2551
|
+
if (Array.isArray(r))
|
|
2548
2552
|
return [f.INTERNAL, "invalid grpc-web status"];
|
|
2549
|
-
if (e = parseInt(
|
|
2553
|
+
if (e = parseInt(r, 10), f[e] === void 0)
|
|
2550
2554
|
return [f.INTERNAL, "invalid grpc-web status"];
|
|
2551
2555
|
}
|
|
2552
2556
|
return [e, t];
|
|
2553
2557
|
}
|
|
2554
|
-
function
|
|
2558
|
+
function $t(i) {
|
|
2555
2559
|
let e = {};
|
|
2556
|
-
for (let [t, n] of Object.entries(
|
|
2560
|
+
for (let [t, n] of Object.entries(i))
|
|
2557
2561
|
switch (t) {
|
|
2558
2562
|
case "grpc-message":
|
|
2559
2563
|
case "grpc-status":
|
|
@@ -2564,29 +2568,29 @@ function vt(r) {
|
|
|
2564
2568
|
}
|
|
2565
2569
|
return e;
|
|
2566
2570
|
}
|
|
2567
|
-
function
|
|
2571
|
+
function jn(i) {
|
|
2568
2572
|
let e = {};
|
|
2569
|
-
for (let t of String.fromCharCode.apply(String,
|
|
2573
|
+
for (let t of String.fromCharCode.apply(String, i).trim().split(`\r
|
|
2570
2574
|
`)) {
|
|
2571
2575
|
if (t == "")
|
|
2572
2576
|
continue;
|
|
2573
|
-
let [n, ...
|
|
2574
|
-
const s =
|
|
2577
|
+
let [n, ...r] = t.split(":");
|
|
2578
|
+
const s = r.join(":").trim();
|
|
2575
2579
|
n = n.trim();
|
|
2576
2580
|
let o = e[n];
|
|
2577
2581
|
typeof o == "string" ? e[n] = [o, s] : Array.isArray(o) ? o.push(s) : e[n] = s;
|
|
2578
2582
|
}
|
|
2579
2583
|
return e;
|
|
2580
2584
|
}
|
|
2581
|
-
function
|
|
2585
|
+
function Wn(i) {
|
|
2582
2586
|
let e = {};
|
|
2583
|
-
return
|
|
2584
|
-
let
|
|
2585
|
-
typeof
|
|
2587
|
+
return i.forEach((t, n) => {
|
|
2588
|
+
let r = e[n];
|
|
2589
|
+
typeof r == "string" ? e[n] = [r, t] : Array.isArray(r) ? r.push(t) : e[n] = t;
|
|
2586
2590
|
}), e;
|
|
2587
2591
|
}
|
|
2588
|
-
function
|
|
2589
|
-
switch (
|
|
2592
|
+
function qn(i) {
|
|
2593
|
+
switch (i) {
|
|
2590
2594
|
case 200:
|
|
2591
2595
|
return f.OK;
|
|
2592
2596
|
case 400:
|
|
@@ -2617,12 +2621,12 @@ function Pn(r) {
|
|
|
2617
2621
|
return f.UNKNOWN;
|
|
2618
2622
|
}
|
|
2619
2623
|
}
|
|
2620
|
-
class
|
|
2624
|
+
class Kn {
|
|
2621
2625
|
constructor(e) {
|
|
2622
2626
|
this.defaultOptions = e;
|
|
2623
2627
|
}
|
|
2624
2628
|
mergeOptions(e) {
|
|
2625
|
-
return
|
|
2629
|
+
return xn(this.defaultOptions, e);
|
|
2626
2630
|
}
|
|
2627
2631
|
/**
|
|
2628
2632
|
* Create an URI for a gRPC web call.
|
|
@@ -2653,107 +2657,107 @@ class jn {
|
|
|
2653
2657
|
throw t.methodName = e.name, t.serviceName = e.service.typeName, t;
|
|
2654
2658
|
}
|
|
2655
2659
|
serverStreaming(e, t, n) {
|
|
2656
|
-
var
|
|
2657
|
-
let l = n, c = (
|
|
2660
|
+
var r, s, o, a;
|
|
2661
|
+
let l = n, c = (r = l.format) !== null && r !== void 0 ? r : "text", d = (s = l.fetchInit) !== null && s !== void 0 ? s : {}, g = this.makeUrl(e, l), N = e.I.toBinary(t, l.binaryOptions), L = new ue(), O = new Dn(), J = !0, T, $ = new ue(), W, Z = new ue();
|
|
2658
2662
|
return globalThis.fetch(g, Object.assign(Object.assign({}, d), {
|
|
2659
2663
|
method: "POST",
|
|
2660
|
-
headers:
|
|
2661
|
-
body:
|
|
2664
|
+
headers: At(new globalThis.Headers(), c, l.timeout, l.meta),
|
|
2665
|
+
body: Tt(N, c),
|
|
2662
2666
|
signal: (o = n.abort) !== null && o !== void 0 ? o : null
|
|
2663
2667
|
// node-fetch@3.0.0-beta.9 rejects `undefined`
|
|
2664
|
-
})).then((
|
|
2665
|
-
let [b,
|
|
2666
|
-
if (
|
|
2667
|
-
throw new I(
|
|
2668
|
-
return b != null && (
|
|
2668
|
+
})).then((w) => {
|
|
2669
|
+
let [b, v, P] = at(w);
|
|
2670
|
+
if (L.resolve(P), b != null && b !== f.OK)
|
|
2671
|
+
throw new I(v ?? f[b], f[b], P);
|
|
2672
|
+
return b != null && (T = {
|
|
2669
2673
|
code: f[b],
|
|
2670
|
-
detail:
|
|
2671
|
-
}),
|
|
2672
|
-
}).then((
|
|
2673
|
-
if (!
|
|
2674
|
+
detail: v ?? f[b]
|
|
2675
|
+
}), w;
|
|
2676
|
+
}).then((w) => {
|
|
2677
|
+
if (!w.body)
|
|
2674
2678
|
throw new I("missing response body", f[f.INTERNAL]);
|
|
2675
|
-
return
|
|
2679
|
+
return Lt(w.body, w.headers.get("content-type"), (b, v) => {
|
|
2676
2680
|
switch (b) {
|
|
2677
2681
|
case H.DATA:
|
|
2678
|
-
|
|
2682
|
+
O.notifyMessage(e.O.fromBinary(v, l.binaryOptions)), J = !1;
|
|
2679
2683
|
break;
|
|
2680
2684
|
case H.TRAILER:
|
|
2681
|
-
let
|
|
2682
|
-
[
|
|
2683
|
-
code: f[
|
|
2684
|
-
detail:
|
|
2685
|
+
let P, ee;
|
|
2686
|
+
[P, ee, W] = Ft(v), T = {
|
|
2687
|
+
code: f[P],
|
|
2688
|
+
detail: ee ?? f[P]
|
|
2685
2689
|
};
|
|
2686
2690
|
break;
|
|
2687
2691
|
}
|
|
2688
2692
|
});
|
|
2689
2693
|
}).then(() => {
|
|
2690
|
-
if (!
|
|
2694
|
+
if (!W && !J)
|
|
2691
2695
|
throw new I("missing trailers", f[f.DATA_LOSS]);
|
|
2692
|
-
if (!
|
|
2696
|
+
if (!T)
|
|
2693
2697
|
throw new I("missing status", f[f.INTERNAL]);
|
|
2694
|
-
if (
|
|
2695
|
-
throw new I(
|
|
2696
|
-
|
|
2697
|
-
}).catch((
|
|
2698
|
+
if (T.code !== "OK")
|
|
2699
|
+
throw new I(T.detail, T.code, W);
|
|
2700
|
+
O.notifyComplete(), $.resolve(T), Z.resolve(W || {});
|
|
2701
|
+
}).catch((w) => {
|
|
2698
2702
|
let b;
|
|
2699
|
-
|
|
2700
|
-
}), new
|
|
2703
|
+
w instanceof I ? b = w : w instanceof Error && w.name === "AbortError" ? b = new I(w.message, f[f.CANCELLED]) : b = new I(w instanceof Error ? w.message : "" + w, f[f.INTERNAL]), b.methodName = e.name, b.serviceName = e.service.typeName, L.rejectPending(b), O.notifyError(b), $.rejectPending(b), Z.rejectPending(b);
|
|
2704
|
+
}), new Mn(e, (a = l.meta) !== null && a !== void 0 ? a : {}, t, L.promise, O, $.promise, Z.promise);
|
|
2701
2705
|
}
|
|
2702
2706
|
unary(e, t, n) {
|
|
2703
|
-
var
|
|
2704
|
-
let l = n, c = (
|
|
2707
|
+
var r, s, o, a;
|
|
2708
|
+
let l = n, c = (r = l.format) !== null && r !== void 0 ? r : "text", d = (s = l.fetchInit) !== null && s !== void 0 ? s : {}, g = this.makeUrl(e, l), N = e.I.toBinary(t, l.binaryOptions), L = new ue(), O, J = new ue(), T, $ = new ue(), W, Z = new ue();
|
|
2705
2709
|
return globalThis.fetch(g, Object.assign(Object.assign({}, d), {
|
|
2706
2710
|
method: "POST",
|
|
2707
|
-
headers:
|
|
2708
|
-
body:
|
|
2711
|
+
headers: At(new globalThis.Headers(), c, l.timeout, l.meta),
|
|
2712
|
+
body: Tt(N, c),
|
|
2709
2713
|
signal: (o = n.abort) !== null && o !== void 0 ? o : null
|
|
2710
2714
|
// node-fetch@3.0.0-beta.9 rejects `undefined`
|
|
2711
|
-
})).then((
|
|
2712
|
-
let [b,
|
|
2713
|
-
if (
|
|
2714
|
-
throw new I(
|
|
2715
|
-
return b != null && (
|
|
2715
|
+
})).then((w) => {
|
|
2716
|
+
let [b, v, P] = at(w);
|
|
2717
|
+
if (L.resolve(P), b != null && b !== f.OK)
|
|
2718
|
+
throw new I(v ?? f[b], f[b], P);
|
|
2719
|
+
return b != null && (T = {
|
|
2716
2720
|
code: f[b],
|
|
2717
|
-
detail:
|
|
2718
|
-
}),
|
|
2719
|
-
}).then((
|
|
2720
|
-
if (!
|
|
2721
|
+
detail: v ?? f[b]
|
|
2722
|
+
}), w;
|
|
2723
|
+
}).then((w) => {
|
|
2724
|
+
if (!w.body)
|
|
2721
2725
|
throw new I("missing response body", f[f.INTERNAL]);
|
|
2722
|
-
return
|
|
2726
|
+
return Lt(w.body, w.headers.get("content-type"), (b, v) => {
|
|
2723
2727
|
switch (b) {
|
|
2724
2728
|
case H.DATA:
|
|
2725
|
-
if (
|
|
2729
|
+
if (O)
|
|
2726
2730
|
throw new I("unary call received 2nd message", f[f.DATA_LOSS]);
|
|
2727
|
-
|
|
2731
|
+
O = e.O.fromBinary(v, l.binaryOptions);
|
|
2728
2732
|
break;
|
|
2729
2733
|
case H.TRAILER:
|
|
2730
|
-
let
|
|
2731
|
-
[
|
|
2732
|
-
code: f[
|
|
2733
|
-
detail:
|
|
2734
|
+
let P, ee;
|
|
2735
|
+
[P, ee, W] = Ft(v), T = {
|
|
2736
|
+
code: f[P],
|
|
2737
|
+
detail: ee ?? f[P]
|
|
2734
2738
|
};
|
|
2735
2739
|
break;
|
|
2736
2740
|
}
|
|
2737
2741
|
});
|
|
2738
2742
|
}).then(() => {
|
|
2739
|
-
if (!
|
|
2743
|
+
if (!W && O)
|
|
2740
2744
|
throw new I("missing trailers", f[f.DATA_LOSS]);
|
|
2741
|
-
if (!
|
|
2745
|
+
if (!T)
|
|
2742
2746
|
throw new I("missing status", f[f.INTERNAL]);
|
|
2743
|
-
if (!
|
|
2747
|
+
if (!O && T.code === "OK")
|
|
2744
2748
|
throw new I("expected error status", f[f.DATA_LOSS]);
|
|
2745
|
-
if (!
|
|
2746
|
-
throw new I(
|
|
2747
|
-
if (
|
|
2748
|
-
throw new I(
|
|
2749
|
-
|
|
2750
|
-
}).catch((
|
|
2749
|
+
if (!O)
|
|
2750
|
+
throw new I(T.detail, T.code, W);
|
|
2751
|
+
if (J.resolve(O), T.code !== "OK")
|
|
2752
|
+
throw new I(T.detail, T.code, W);
|
|
2753
|
+
$.resolve(T), Z.resolve(W || {});
|
|
2754
|
+
}).catch((w) => {
|
|
2751
2755
|
let b;
|
|
2752
|
-
|
|
2753
|
-
}), new Un(e, (a = l.meta) !== null && a !== void 0 ? a : {}, t,
|
|
2756
|
+
w instanceof I ? b = w : w instanceof Error && w.name === "AbortError" ? b = new I(w.message, f[f.CANCELLED]) : b = new I(w instanceof Error ? w.message : "" + w, f[f.INTERNAL]), b.methodName = e.name, b.serviceName = e.service.typeName, L.rejectPending(b), J.rejectPending(b), $.rejectPending(b), Z.rejectPending(b);
|
|
2757
|
+
}), new Un(e, (a = l.meta) !== null && a !== void 0 ? a : {}, t, L.promise, J.promise, $.promise, Z.promise);
|
|
2754
2758
|
}
|
|
2755
2759
|
}
|
|
2756
|
-
class
|
|
2760
|
+
class Xn extends M {
|
|
2757
2761
|
constructor() {
|
|
2758
2762
|
super("com.hamropatro.grpc.cms.CreateFolderRequest", [
|
|
2759
2763
|
{
|
|
@@ -2781,10 +2785,10 @@ class Wn extends M {
|
|
|
2781
2785
|
}
|
|
2782
2786
|
create(e) {
|
|
2783
2787
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
2784
|
-
return t.name = "", t.nestedFolderName = "", t.createdBy = "", e !== void 0 &&
|
|
2788
|
+
return t.name = "", t.nestedFolderName = "", t.createdBy = "", e !== void 0 && D(this, t, e), t;
|
|
2785
2789
|
}
|
|
2786
|
-
internalBinaryRead(e, t, n,
|
|
2787
|
-
let s =
|
|
2790
|
+
internalBinaryRead(e, t, n, r) {
|
|
2791
|
+
let s = r ?? this.create(), o = e.pos + t;
|
|
2788
2792
|
for (; e.pos < o; ) {
|
|
2789
2793
|
let [a, l] = e.tag();
|
|
2790
2794
|
switch (a) {
|
|
@@ -2805,19 +2809,19 @@ class Wn extends M {
|
|
|
2805
2809
|
if (c === "throw")
|
|
2806
2810
|
throw new globalThis.Error(`Unknown field ${a} (wire type ${l}) for ${this.typeName}`);
|
|
2807
2811
|
let d = e.skip(l);
|
|
2808
|
-
c !== !1 && (c === !0 ?
|
|
2812
|
+
c !== !1 && (c === !0 ? k.onRead : c)(this.typeName, s, a, l, d);
|
|
2809
2813
|
}
|
|
2810
2814
|
}
|
|
2811
2815
|
return s;
|
|
2812
2816
|
}
|
|
2813
2817
|
internalBinaryWrite(e, t, n) {
|
|
2814
|
-
e.name !== "" && t.tag(1,
|
|
2815
|
-
let
|
|
2816
|
-
return
|
|
2818
|
+
e.name !== "" && t.tag(1, p.LengthDelimited).string(e.name), e.nestedFolderName !== "" && t.tag(2, p.LengthDelimited).string(e.nestedFolderName), e.createdBy !== "" && t.tag(3, p.LengthDelimited).string(e.createdBy);
|
|
2819
|
+
let r = n.writeUnknownFields;
|
|
2820
|
+
return r !== !1 && (r == !0 ? k.onWrite : r)(this.typeName, e, t), t;
|
|
2817
2821
|
}
|
|
2818
2822
|
}
|
|
2819
|
-
const
|
|
2820
|
-
class
|
|
2823
|
+
const Pt = new Xn();
|
|
2824
|
+
class Hn extends M {
|
|
2821
2825
|
constructor() {
|
|
2822
2826
|
super("com.hamropatro.grpc.cms.GetAllFoldersRequest", [
|
|
2823
2827
|
{
|
|
@@ -2838,10 +2842,10 @@ class qn extends M {
|
|
|
2838
2842
|
}
|
|
2839
2843
|
create(e) {
|
|
2840
2844
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
2841
|
-
return t.cursor = "", t.limit = 0, e !== void 0 &&
|
|
2845
|
+
return t.cursor = "", t.limit = 0, e !== void 0 && D(this, t, e), t;
|
|
2842
2846
|
}
|
|
2843
|
-
internalBinaryRead(e, t, n,
|
|
2844
|
-
let s =
|
|
2847
|
+
internalBinaryRead(e, t, n, r) {
|
|
2848
|
+
let s = r ?? this.create(), o = e.pos + t;
|
|
2845
2849
|
for (; e.pos < o; ) {
|
|
2846
2850
|
let [a, l] = e.tag();
|
|
2847
2851
|
switch (a) {
|
|
@@ -2858,22 +2862,22 @@ class qn extends M {
|
|
|
2858
2862
|
if (c === "throw")
|
|
2859
2863
|
throw new globalThis.Error(`Unknown field ${a} (wire type ${l}) for ${this.typeName}`);
|
|
2860
2864
|
let d = e.skip(l);
|
|
2861
|
-
c !== !1 && (c === !0 ?
|
|
2865
|
+
c !== !1 && (c === !0 ? k.onRead : c)(this.typeName, s, a, l, d);
|
|
2862
2866
|
}
|
|
2863
2867
|
}
|
|
2864
2868
|
return s;
|
|
2865
2869
|
}
|
|
2866
2870
|
internalBinaryWrite(e, t, n) {
|
|
2867
|
-
e.cursor !== "" && t.tag(1,
|
|
2868
|
-
let
|
|
2869
|
-
return
|
|
2871
|
+
e.cursor !== "" && t.tag(1, p.LengthDelimited).string(e.cursor), e.limit !== 0 && t.tag(2, p.Varint).int32(e.limit);
|
|
2872
|
+
let r = n.writeUnknownFields;
|
|
2873
|
+
return r !== !1 && (r == !0 ? k.onWrite : r)(this.typeName, e, t), t;
|
|
2870
2874
|
}
|
|
2871
2875
|
}
|
|
2872
|
-
const
|
|
2873
|
-
class
|
|
2876
|
+
const jt = new Hn();
|
|
2877
|
+
class Gn extends M {
|
|
2874
2878
|
constructor() {
|
|
2875
2879
|
super("com.hamropatro.grpc.cms.GetAllFoldersResponse", [
|
|
2876
|
-
{ no: 1, name: "folder", kind: "message", repeat: 1, T: () =>
|
|
2880
|
+
{ no: 1, name: "folder", kind: "message", repeat: 1, T: () => Fe },
|
|
2877
2881
|
{
|
|
2878
2882
|
no: 2,
|
|
2879
2883
|
name: "next_cursor",
|
|
@@ -2892,16 +2896,16 @@ class Kn extends M {
|
|
|
2892
2896
|
}
|
|
2893
2897
|
create(e) {
|
|
2894
2898
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
2895
|
-
return t.folder = [], t.nextCursor = "", t.hasMore = !1, e !== void 0 &&
|
|
2899
|
+
return t.folder = [], t.nextCursor = "", t.hasMore = !1, e !== void 0 && D(this, t, e), t;
|
|
2896
2900
|
}
|
|
2897
|
-
internalBinaryRead(e, t, n,
|
|
2898
|
-
let s =
|
|
2901
|
+
internalBinaryRead(e, t, n, r) {
|
|
2902
|
+
let s = r ?? this.create(), o = e.pos + t;
|
|
2899
2903
|
for (; e.pos < o; ) {
|
|
2900
2904
|
let [a, l] = e.tag();
|
|
2901
2905
|
switch (a) {
|
|
2902
2906
|
case /* repeated com.hamropatro.grpc.cms.Folder folder */
|
|
2903
2907
|
1:
|
|
2904
|
-
s.folder.push(
|
|
2908
|
+
s.folder.push(Fe.internalBinaryRead(e, e.uint32(), n));
|
|
2905
2909
|
break;
|
|
2906
2910
|
case /* string next_cursor */
|
|
2907
2911
|
2:
|
|
@@ -2916,21 +2920,21 @@ class Kn extends M {
|
|
|
2916
2920
|
if (c === "throw")
|
|
2917
2921
|
throw new globalThis.Error(`Unknown field ${a} (wire type ${l}) for ${this.typeName}`);
|
|
2918
2922
|
let d = e.skip(l);
|
|
2919
|
-
c !== !1 && (c === !0 ?
|
|
2923
|
+
c !== !1 && (c === !0 ? k.onRead : c)(this.typeName, s, a, l, d);
|
|
2920
2924
|
}
|
|
2921
2925
|
}
|
|
2922
2926
|
return s;
|
|
2923
2927
|
}
|
|
2924
2928
|
internalBinaryWrite(e, t, n) {
|
|
2925
2929
|
for (let s = 0; s < e.folder.length; s++)
|
|
2926
|
-
|
|
2927
|
-
e.nextCursor !== "" && t.tag(2,
|
|
2928
|
-
let
|
|
2929
|
-
return
|
|
2930
|
+
Fe.internalBinaryWrite(e.folder[s], t.tag(1, p.LengthDelimited).fork(), n).join();
|
|
2931
|
+
e.nextCursor !== "" && t.tag(2, p.LengthDelimited).string(e.nextCursor), e.hasMore !== !1 && t.tag(3, p.Varint).bool(e.hasMore);
|
|
2932
|
+
let r = n.writeUnknownFields;
|
|
2933
|
+
return r !== !1 && (r == !0 ? k.onWrite : r)(this.typeName, e, t), t;
|
|
2930
2934
|
}
|
|
2931
2935
|
}
|
|
2932
|
-
const
|
|
2933
|
-
class
|
|
2936
|
+
const Jn = new Gn();
|
|
2937
|
+
class Zn extends M {
|
|
2934
2938
|
constructor() {
|
|
2935
2939
|
super("com.hamropatro.grpc.cms.Folder", [
|
|
2936
2940
|
{
|
|
@@ -2965,10 +2969,10 @@ class Hn extends M {
|
|
|
2965
2969
|
}
|
|
2966
2970
|
create(e) {
|
|
2967
2971
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
2968
|
-
return t.key = "", t.name = "", t.nestedFolderName = "", t.createdBy = "", e !== void 0 &&
|
|
2972
|
+
return t.key = "", t.name = "", t.nestedFolderName = "", t.createdBy = "", e !== void 0 && D(this, t, e), t;
|
|
2969
2973
|
}
|
|
2970
|
-
internalBinaryRead(e, t, n,
|
|
2971
|
-
let s =
|
|
2974
|
+
internalBinaryRead(e, t, n, r) {
|
|
2975
|
+
let s = r ?? this.create(), o = e.pos + t;
|
|
2972
2976
|
for (; e.pos < o; ) {
|
|
2973
2977
|
let [a, l] = e.tag();
|
|
2974
2978
|
switch (a) {
|
|
@@ -2993,53 +2997,53 @@ class Hn extends M {
|
|
|
2993
2997
|
if (c === "throw")
|
|
2994
2998
|
throw new globalThis.Error(`Unknown field ${a} (wire type ${l}) for ${this.typeName}`);
|
|
2995
2999
|
let d = e.skip(l);
|
|
2996
|
-
c !== !1 && (c === !0 ?
|
|
3000
|
+
c !== !1 && (c === !0 ? k.onRead : c)(this.typeName, s, a, l, d);
|
|
2997
3001
|
}
|
|
2998
3002
|
}
|
|
2999
3003
|
return s;
|
|
3000
3004
|
}
|
|
3001
3005
|
internalBinaryWrite(e, t, n) {
|
|
3002
|
-
e.key !== "" && t.tag(1,
|
|
3003
|
-
let
|
|
3004
|
-
return
|
|
3006
|
+
e.key !== "" && t.tag(1, p.LengthDelimited).string(e.key), e.name !== "" && t.tag(2, p.LengthDelimited).string(e.name), e.nestedFolderName !== "" && t.tag(3, p.LengthDelimited).string(e.nestedFolderName), e.createdBy !== "" && t.tag(4, p.LengthDelimited).string(e.createdBy);
|
|
3007
|
+
let r = n.writeUnknownFields;
|
|
3008
|
+
return r !== !1 && (r == !0 ? k.onWrite : r)(this.typeName, e, t), t;
|
|
3005
3009
|
}
|
|
3006
3010
|
}
|
|
3007
|
-
const
|
|
3008
|
-
{ name: "createFolder", options: {}, I:
|
|
3009
|
-
{ name: "getFolders", options: {}, I:
|
|
3010
|
-
{ name: "updateFolder", options: {}, I:
|
|
3011
|
+
const Fe = new Zn(), Qe = new ct("com.hamropatro.grpc.cms.FolderService", [
|
|
3012
|
+
{ name: "createFolder", options: {}, I: Pt, O: Fe },
|
|
3013
|
+
{ name: "getFolders", options: {}, I: jt, O: Jn },
|
|
3014
|
+
{ name: "updateFolder", options: {}, I: Fe, O: Fe }
|
|
3011
3015
|
]);
|
|
3012
|
-
class
|
|
3016
|
+
class Yn {
|
|
3013
3017
|
constructor(e) {
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3018
|
+
_(this, "typeName", Qe.typeName);
|
|
3019
|
+
_(this, "methods", Qe.methods);
|
|
3020
|
+
_(this, "options", Qe.options);
|
|
3017
3021
|
this._transport = e;
|
|
3018
3022
|
}
|
|
3019
3023
|
/**
|
|
3020
3024
|
* @generated from protobuf rpc: createFolder(com.hamropatro.grpc.cms.CreateFolderRequest) returns (com.hamropatro.grpc.cms.Folder);
|
|
3021
3025
|
*/
|
|
3022
3026
|
createFolder(e, t) {
|
|
3023
|
-
const n = this.methods[0],
|
|
3024
|
-
return
|
|
3027
|
+
const n = this.methods[0], r = this._transport.mergeOptions(t);
|
|
3028
|
+
return le("unary", this._transport, n, r, e);
|
|
3025
3029
|
}
|
|
3026
3030
|
/**
|
|
3027
3031
|
* @generated from protobuf rpc: getFolders(com.hamropatro.grpc.cms.GetAllFoldersRequest) returns (com.hamropatro.grpc.cms.GetAllFoldersResponse);
|
|
3028
3032
|
*/
|
|
3029
3033
|
getFolders(e, t) {
|
|
3030
|
-
const n = this.methods[1],
|
|
3031
|
-
return
|
|
3034
|
+
const n = this.methods[1], r = this._transport.mergeOptions(t);
|
|
3035
|
+
return le("unary", this._transport, n, r, e);
|
|
3032
3036
|
}
|
|
3033
3037
|
/**
|
|
3034
3038
|
* @generated from protobuf rpc: updateFolder(com.hamropatro.grpc.cms.Folder) returns (com.hamropatro.grpc.cms.Folder);
|
|
3035
3039
|
*/
|
|
3036
3040
|
updateFolder(e, t) {
|
|
3037
|
-
const n = this.methods[2],
|
|
3038
|
-
return
|
|
3041
|
+
const n = this.methods[2], r = this._transport.mergeOptions(t);
|
|
3042
|
+
return le("unary", this._transport, n, r, e);
|
|
3039
3043
|
}
|
|
3040
3044
|
}
|
|
3041
|
-
var
|
|
3042
|
-
class
|
|
3045
|
+
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 || {});
|
|
3046
|
+
class zn extends M {
|
|
3043
3047
|
constructor() {
|
|
3044
3048
|
super("com.hamropatro.grpc.cms.SearchRequest", [
|
|
3045
3049
|
{
|
|
@@ -3067,10 +3071,10 @@ class Jn extends M {
|
|
|
3067
3071
|
}
|
|
3068
3072
|
create(e) {
|
|
3069
3073
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
3070
|
-
return t.searchValue = "", t.cursor = "", t.limit = 0, e !== void 0 &&
|
|
3074
|
+
return t.searchValue = "", t.cursor = "", t.limit = 0, e !== void 0 && D(this, t, e), t;
|
|
3071
3075
|
}
|
|
3072
|
-
internalBinaryRead(e, t, n,
|
|
3073
|
-
let s =
|
|
3076
|
+
internalBinaryRead(e, t, n, r) {
|
|
3077
|
+
let s = r ?? this.create(), o = e.pos + t;
|
|
3074
3078
|
for (; e.pos < o; ) {
|
|
3075
3079
|
let [a, l] = e.tag();
|
|
3076
3080
|
switch (a) {
|
|
@@ -3091,22 +3095,22 @@ class Jn extends M {
|
|
|
3091
3095
|
if (c === "throw")
|
|
3092
3096
|
throw new globalThis.Error(`Unknown field ${a} (wire type ${l}) for ${this.typeName}`);
|
|
3093
3097
|
let d = e.skip(l);
|
|
3094
|
-
c !== !1 && (c === !0 ?
|
|
3098
|
+
c !== !1 && (c === !0 ? k.onRead : c)(this.typeName, s, a, l, d);
|
|
3095
3099
|
}
|
|
3096
3100
|
}
|
|
3097
3101
|
return s;
|
|
3098
3102
|
}
|
|
3099
3103
|
internalBinaryWrite(e, t, n) {
|
|
3100
|
-
e.searchValue !== "" && t.tag(1,
|
|
3101
|
-
let
|
|
3102
|
-
return
|
|
3104
|
+
e.searchValue !== "" && t.tag(1, p.LengthDelimited).string(e.searchValue), e.cursor !== "" && t.tag(2, p.LengthDelimited).string(e.cursor), e.limit !== 0 && t.tag(3, p.Varint).int32(e.limit);
|
|
3105
|
+
let r = n.writeUnknownFields;
|
|
3106
|
+
return r !== !1 && (r == !0 ? k.onWrite : r)(this.typeName, e, t), t;
|
|
3103
3107
|
}
|
|
3104
3108
|
}
|
|
3105
|
-
const
|
|
3106
|
-
class
|
|
3109
|
+
const Wt = new zn();
|
|
3110
|
+
class Qn extends M {
|
|
3107
3111
|
constructor() {
|
|
3108
3112
|
super("com.hamropatro.grpc.cms.SearchResult", [
|
|
3109
|
-
{ no: 1, name: "items", kind: "message", repeat: 1, T: () =>
|
|
3113
|
+
{ no: 1, name: "items", kind: "message", repeat: 1, T: () => he },
|
|
3110
3114
|
{
|
|
3111
3115
|
no: 2,
|
|
3112
3116
|
name: "next_page_cursor",
|
|
@@ -3118,16 +3122,16 @@ class Zn extends M {
|
|
|
3118
3122
|
}
|
|
3119
3123
|
create(e) {
|
|
3120
3124
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
3121
|
-
return t.items = [], t.nextPageCursor = "", e !== void 0 &&
|
|
3125
|
+
return t.items = [], t.nextPageCursor = "", e !== void 0 && D(this, t, e), t;
|
|
3122
3126
|
}
|
|
3123
|
-
internalBinaryRead(e, t, n,
|
|
3124
|
-
let s =
|
|
3127
|
+
internalBinaryRead(e, t, n, r) {
|
|
3128
|
+
let s = r ?? this.create(), o = e.pos + t;
|
|
3125
3129
|
for (; e.pos < o; ) {
|
|
3126
3130
|
let [a, l] = e.tag();
|
|
3127
3131
|
switch (a) {
|
|
3128
3132
|
case /* repeated com.hamropatro.grpc.cms.File items */
|
|
3129
3133
|
1:
|
|
3130
|
-
s.items.push(
|
|
3134
|
+
s.items.push(he.internalBinaryRead(e, e.uint32(), n));
|
|
3131
3135
|
break;
|
|
3132
3136
|
case /* string next_page_cursor */
|
|
3133
3137
|
2:
|
|
@@ -3138,21 +3142,21 @@ class Zn extends M {
|
|
|
3138
3142
|
if (c === "throw")
|
|
3139
3143
|
throw new globalThis.Error(`Unknown field ${a} (wire type ${l}) for ${this.typeName}`);
|
|
3140
3144
|
let d = e.skip(l);
|
|
3141
|
-
c !== !1 && (c === !0 ?
|
|
3145
|
+
c !== !1 && (c === !0 ? k.onRead : c)(this.typeName, s, a, l, d);
|
|
3142
3146
|
}
|
|
3143
3147
|
}
|
|
3144
3148
|
return s;
|
|
3145
3149
|
}
|
|
3146
3150
|
internalBinaryWrite(e, t, n) {
|
|
3147
3151
|
for (let s = 0; s < e.items.length; s++)
|
|
3148
|
-
|
|
3149
|
-
e.nextPageCursor !== "" && t.tag(2,
|
|
3150
|
-
let
|
|
3151
|
-
return
|
|
3152
|
+
he.internalBinaryWrite(e.items[s], t.tag(1, p.LengthDelimited).fork(), n).join();
|
|
3153
|
+
e.nextPageCursor !== "" && t.tag(2, p.LengthDelimited).string(e.nextPageCursor);
|
|
3154
|
+
let r = n.writeUnknownFields;
|
|
3155
|
+
return r !== !1 && (r == !0 ? k.onWrite : r)(this.typeName, e, t), t;
|
|
3152
3156
|
}
|
|
3153
3157
|
}
|
|
3154
|
-
const
|
|
3155
|
-
class
|
|
3158
|
+
const ei = new Qn();
|
|
3159
|
+
class ti extends M {
|
|
3156
3160
|
constructor() {
|
|
3157
3161
|
super("com.hamropatro.grpc.cms.CreateFileRequest", [
|
|
3158
3162
|
{
|
|
@@ -3183,15 +3187,15 @@ class zn extends M {
|
|
|
3183
3187
|
T: 9
|
|
3184
3188
|
/*ScalarType.STRING*/
|
|
3185
3189
|
},
|
|
3186
|
-
{ no: 5, name: "type", kind: "enum", T: () => ["com.hamropatro.grpc.cms.FileType",
|
|
3190
|
+
{ no: 5, name: "type", kind: "enum", T: () => ["com.hamropatro.grpc.cms.FileType", ht] }
|
|
3187
3191
|
]);
|
|
3188
3192
|
}
|
|
3189
3193
|
create(e) {
|
|
3190
3194
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
3191
|
-
return t.name = "", t.folderName = "", t.nestedFolderName = "", t.url = "", t.type = 0, e !== void 0 &&
|
|
3195
|
+
return t.name = "", t.folderName = "", t.nestedFolderName = "", t.url = "", t.type = 0, e !== void 0 && D(this, t, e), t;
|
|
3192
3196
|
}
|
|
3193
|
-
internalBinaryRead(e, t, n,
|
|
3194
|
-
let s =
|
|
3197
|
+
internalBinaryRead(e, t, n, r) {
|
|
3198
|
+
let s = r ?? this.create(), o = e.pos + t;
|
|
3195
3199
|
for (; e.pos < o; ) {
|
|
3196
3200
|
let [a, l] = e.tag();
|
|
3197
3201
|
switch (a) {
|
|
@@ -3220,19 +3224,19 @@ class zn extends M {
|
|
|
3220
3224
|
if (c === "throw")
|
|
3221
3225
|
throw new globalThis.Error(`Unknown field ${a} (wire type ${l}) for ${this.typeName}`);
|
|
3222
3226
|
let d = e.skip(l);
|
|
3223
|
-
c !== !1 && (c === !0 ?
|
|
3227
|
+
c !== !1 && (c === !0 ? k.onRead : c)(this.typeName, s, a, l, d);
|
|
3224
3228
|
}
|
|
3225
3229
|
}
|
|
3226
3230
|
return s;
|
|
3227
3231
|
}
|
|
3228
3232
|
internalBinaryWrite(e, t, n) {
|
|
3229
|
-
e.name !== "" && t.tag(1,
|
|
3230
|
-
let
|
|
3231
|
-
return
|
|
3233
|
+
e.name !== "" && t.tag(1, p.LengthDelimited).string(e.name), e.folderName !== "" && t.tag(2, p.LengthDelimited).string(e.folderName), e.nestedFolderName !== "" && t.tag(3, p.LengthDelimited).string(e.nestedFolderName), e.url !== "" && t.tag(4, p.LengthDelimited).string(e.url), e.type !== 0 && t.tag(5, p.Varint).int32(e.type);
|
|
3234
|
+
let r = n.writeUnknownFields;
|
|
3235
|
+
return r !== !1 && (r == !0 ? k.onWrite : r)(this.typeName, e, t), t;
|
|
3232
3236
|
}
|
|
3233
3237
|
}
|
|
3234
|
-
const
|
|
3235
|
-
class
|
|
3238
|
+
const qt = new ti();
|
|
3239
|
+
class ni extends M {
|
|
3236
3240
|
constructor() {
|
|
3237
3241
|
super("com.hamropatro.grpc.cms.File", [
|
|
3238
3242
|
{
|
|
@@ -3284,16 +3288,16 @@ class Qn extends M {
|
|
|
3284
3288
|
T: 9
|
|
3285
3289
|
/*ScalarType.STRING*/
|
|
3286
3290
|
},
|
|
3287
|
-
{ no: 8, name: "type", kind: "enum", T: () => ["com.hamropatro.grpc.cms.FileType",
|
|
3288
|
-
{ no: 9, name: "metadata", kind: "message", T: () =>
|
|
3291
|
+
{ no: 8, name: "type", kind: "enum", T: () => ["com.hamropatro.grpc.cms.FileType", ht] },
|
|
3292
|
+
{ no: 9, name: "metadata", kind: "message", T: () => et }
|
|
3289
3293
|
]);
|
|
3290
3294
|
}
|
|
3291
3295
|
create(e) {
|
|
3292
3296
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
3293
|
-
return t.key = "", t.name = "", t.folderName = "", t.nestedFolderName = "", t.url = "", t.thumborUrl = "", t.proxyUrl = "", t.type = 0, e !== void 0 &&
|
|
3297
|
+
return t.key = "", t.name = "", t.folderName = "", t.nestedFolderName = "", t.url = "", t.thumborUrl = "", t.proxyUrl = "", t.type = 0, e !== void 0 && D(this, t, e), t;
|
|
3294
3298
|
}
|
|
3295
|
-
internalBinaryRead(e, t, n,
|
|
3296
|
-
let s =
|
|
3299
|
+
internalBinaryRead(e, t, n, r) {
|
|
3300
|
+
let s = r ?? this.create(), o = e.pos + t;
|
|
3297
3301
|
for (; e.pos < o; ) {
|
|
3298
3302
|
let [a, l] = e.tag();
|
|
3299
3303
|
switch (a) {
|
|
@@ -3331,26 +3335,26 @@ class Qn extends M {
|
|
|
3331
3335
|
break;
|
|
3332
3336
|
case /* com.hamropatro.grpc.cms.FileMetadata metadata */
|
|
3333
3337
|
9:
|
|
3334
|
-
s.metadata =
|
|
3338
|
+
s.metadata = et.internalBinaryRead(e, e.uint32(), n, s.metadata);
|
|
3335
3339
|
break;
|
|
3336
3340
|
default:
|
|
3337
3341
|
let c = n.readUnknownField;
|
|
3338
3342
|
if (c === "throw")
|
|
3339
3343
|
throw new globalThis.Error(`Unknown field ${a} (wire type ${l}) for ${this.typeName}`);
|
|
3340
3344
|
let d = e.skip(l);
|
|
3341
|
-
c !== !1 && (c === !0 ?
|
|
3345
|
+
c !== !1 && (c === !0 ? k.onRead : c)(this.typeName, s, a, l, d);
|
|
3342
3346
|
}
|
|
3343
3347
|
}
|
|
3344
3348
|
return s;
|
|
3345
3349
|
}
|
|
3346
3350
|
internalBinaryWrite(e, t, n) {
|
|
3347
|
-
e.key !== "" && t.tag(1,
|
|
3348
|
-
let
|
|
3349
|
-
return
|
|
3351
|
+
e.key !== "" && t.tag(1, p.LengthDelimited).string(e.key), e.name !== "" && t.tag(2, p.LengthDelimited).string(e.name), e.folderName !== "" && t.tag(3, p.LengthDelimited).string(e.folderName), e.nestedFolderName !== "" && t.tag(4, p.LengthDelimited).string(e.nestedFolderName), e.url !== "" && t.tag(5, p.LengthDelimited).string(e.url), e.thumborUrl !== "" && t.tag(6, p.LengthDelimited).string(e.thumborUrl), e.proxyUrl !== "" && t.tag(7, p.LengthDelimited).string(e.proxyUrl), e.type !== 0 && t.tag(8, p.Varint).int32(e.type), e.metadata && et.internalBinaryWrite(e.metadata, t.tag(9, p.LengthDelimited).fork(), n).join();
|
|
3352
|
+
let r = n.writeUnknownFields;
|
|
3353
|
+
return r !== !1 && (r == !0 ? k.onWrite : r)(this.typeName, e, t), t;
|
|
3350
3354
|
}
|
|
3351
3355
|
}
|
|
3352
|
-
const
|
|
3353
|
-
class
|
|
3356
|
+
const he = new ni();
|
|
3357
|
+
class ii extends M {
|
|
3354
3358
|
constructor() {
|
|
3355
3359
|
super("com.hamropatro.grpc.cms.FileMetadata", [
|
|
3356
3360
|
{
|
|
@@ -3385,10 +3389,10 @@ class er extends M {
|
|
|
3385
3389
|
}
|
|
3386
3390
|
create(e) {
|
|
3387
3391
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
3388
|
-
return t.height = 0, t.width = 0, t.backgroundColor = "", t.aspectRatio = 0, e !== void 0 &&
|
|
3392
|
+
return t.height = 0, t.width = 0, t.backgroundColor = "", t.aspectRatio = 0, e !== void 0 && D(this, t, e), t;
|
|
3389
3393
|
}
|
|
3390
|
-
internalBinaryRead(e, t, n,
|
|
3391
|
-
let s =
|
|
3394
|
+
internalBinaryRead(e, t, n, r) {
|
|
3395
|
+
let s = r ?? this.create(), o = e.pos + t;
|
|
3392
3396
|
for (; e.pos < o; ) {
|
|
3393
3397
|
let [a, l] = e.tag();
|
|
3394
3398
|
switch (a) {
|
|
@@ -3413,19 +3417,19 @@ class er extends M {
|
|
|
3413
3417
|
if (c === "throw")
|
|
3414
3418
|
throw new globalThis.Error(`Unknown field ${a} (wire type ${l}) for ${this.typeName}`);
|
|
3415
3419
|
let d = e.skip(l);
|
|
3416
|
-
c !== !1 && (c === !0 ?
|
|
3420
|
+
c !== !1 && (c === !0 ? k.onRead : c)(this.typeName, s, a, l, d);
|
|
3417
3421
|
}
|
|
3418
3422
|
}
|
|
3419
3423
|
return s;
|
|
3420
3424
|
}
|
|
3421
3425
|
internalBinaryWrite(e, t, n) {
|
|
3422
|
-
e.height !== 0 && t.tag(1,
|
|
3423
|
-
let
|
|
3424
|
-
return
|
|
3426
|
+
e.height !== 0 && t.tag(1, p.Varint).int32(e.height), e.width !== 0 && t.tag(2, p.Varint).int32(e.width), e.backgroundColor !== "" && t.tag(3, p.LengthDelimited).string(e.backgroundColor), e.aspectRatio !== 0 && t.tag(4, p.Bit64).double(e.aspectRatio);
|
|
3427
|
+
let r = n.writeUnknownFields;
|
|
3428
|
+
return r !== !1 && (r == !0 ? k.onWrite : r)(this.typeName, e, t), t;
|
|
3425
3429
|
}
|
|
3426
3430
|
}
|
|
3427
|
-
const
|
|
3428
|
-
class
|
|
3431
|
+
const et = new ii();
|
|
3432
|
+
class ri extends M {
|
|
3429
3433
|
constructor() {
|
|
3430
3434
|
super("com.hamropatro.grpc.cms.DeleteFileRequest", [
|
|
3431
3435
|
{
|
|
@@ -3439,10 +3443,10 @@ class tr extends M {
|
|
|
3439
3443
|
}
|
|
3440
3444
|
create(e) {
|
|
3441
3445
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
3442
|
-
return t.key = "", e !== void 0 &&
|
|
3446
|
+
return t.key = "", e !== void 0 && D(this, t, e), t;
|
|
3443
3447
|
}
|
|
3444
|
-
internalBinaryRead(e, t, n,
|
|
3445
|
-
let s =
|
|
3448
|
+
internalBinaryRead(e, t, n, r) {
|
|
3449
|
+
let s = r ?? this.create(), o = e.pos + t;
|
|
3446
3450
|
for (; e.pos < o; ) {
|
|
3447
3451
|
let [a, l] = e.tag();
|
|
3448
3452
|
switch (a) {
|
|
@@ -3455,19 +3459,19 @@ class tr extends M {
|
|
|
3455
3459
|
if (c === "throw")
|
|
3456
3460
|
throw new globalThis.Error(`Unknown field ${a} (wire type ${l}) for ${this.typeName}`);
|
|
3457
3461
|
let d = e.skip(l);
|
|
3458
|
-
c !== !1 && (c === !0 ?
|
|
3462
|
+
c !== !1 && (c === !0 ? k.onRead : c)(this.typeName, s, a, l, d);
|
|
3459
3463
|
}
|
|
3460
3464
|
}
|
|
3461
3465
|
return s;
|
|
3462
3466
|
}
|
|
3463
3467
|
internalBinaryWrite(e, t, n) {
|
|
3464
|
-
e.key !== "" && t.tag(1,
|
|
3465
|
-
let
|
|
3466
|
-
return
|
|
3468
|
+
e.key !== "" && t.tag(1, p.LengthDelimited).string(e.key);
|
|
3469
|
+
let r = n.writeUnknownFields;
|
|
3470
|
+
return r !== !1 && (r == !0 ? k.onWrite : r)(this.typeName, e, t), t;
|
|
3467
3471
|
}
|
|
3468
3472
|
}
|
|
3469
|
-
const
|
|
3470
|
-
class
|
|
3473
|
+
const si = new ri();
|
|
3474
|
+
class oi extends M {
|
|
3471
3475
|
constructor() {
|
|
3472
3476
|
super("com.hamropatro.grpc.cms.DeleteFileResponse", [
|
|
3473
3477
|
{
|
|
@@ -3481,10 +3485,10 @@ class rr extends M {
|
|
|
3481
3485
|
}
|
|
3482
3486
|
create(e) {
|
|
3483
3487
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
3484
|
-
return t.isDeleted = !1, e !== void 0 &&
|
|
3488
|
+
return t.isDeleted = !1, e !== void 0 && D(this, t, e), t;
|
|
3485
3489
|
}
|
|
3486
|
-
internalBinaryRead(e, t, n,
|
|
3487
|
-
let s =
|
|
3490
|
+
internalBinaryRead(e, t, n, r) {
|
|
3491
|
+
let s = r ?? this.create(), o = e.pos + t;
|
|
3488
3492
|
for (; e.pos < o; ) {
|
|
3489
3493
|
let [a, l] = e.tag();
|
|
3490
3494
|
switch (a) {
|
|
@@ -3497,19 +3501,19 @@ class rr extends M {
|
|
|
3497
3501
|
if (c === "throw")
|
|
3498
3502
|
throw new globalThis.Error(`Unknown field ${a} (wire type ${l}) for ${this.typeName}`);
|
|
3499
3503
|
let d = e.skip(l);
|
|
3500
|
-
c !== !1 && (c === !0 ?
|
|
3504
|
+
c !== !1 && (c === !0 ? k.onRead : c)(this.typeName, s, a, l, d);
|
|
3501
3505
|
}
|
|
3502
3506
|
}
|
|
3503
3507
|
return s;
|
|
3504
3508
|
}
|
|
3505
3509
|
internalBinaryWrite(e, t, n) {
|
|
3506
|
-
e.isDeleted !== !1 && t.tag(1,
|
|
3507
|
-
let
|
|
3508
|
-
return
|
|
3510
|
+
e.isDeleted !== !1 && t.tag(1, p.Varint).bool(e.isDeleted);
|
|
3511
|
+
let r = n.writeUnknownFields;
|
|
3512
|
+
return r !== !1 && (r == !0 ? k.onWrite : r)(this.typeName, e, t), t;
|
|
3509
3513
|
}
|
|
3510
3514
|
}
|
|
3511
|
-
const
|
|
3512
|
-
class
|
|
3515
|
+
const ai = new oi();
|
|
3516
|
+
class li extends M {
|
|
3513
3517
|
constructor() {
|
|
3514
3518
|
super("com.hamropatro.grpc.cms.GetFilesByFolderRequest", [
|
|
3515
3519
|
{
|
|
@@ -3537,10 +3541,10 @@ class sr extends M {
|
|
|
3537
3541
|
}
|
|
3538
3542
|
create(e) {
|
|
3539
3543
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
3540
|
-
return t.folderName = "", t.cursor = "", t.limit = 0, e !== void 0 &&
|
|
3544
|
+
return t.folderName = "", t.cursor = "", t.limit = 0, e !== void 0 && D(this, t, e), t;
|
|
3541
3545
|
}
|
|
3542
|
-
internalBinaryRead(e, t, n,
|
|
3543
|
-
let s =
|
|
3546
|
+
internalBinaryRead(e, t, n, r) {
|
|
3547
|
+
let s = r ?? this.create(), o = e.pos + t;
|
|
3544
3548
|
for (; e.pos < o; ) {
|
|
3545
3549
|
let [a, l] = e.tag();
|
|
3546
3550
|
switch (a) {
|
|
@@ -3561,22 +3565,22 @@ class sr extends M {
|
|
|
3561
3565
|
if (c === "throw")
|
|
3562
3566
|
throw new globalThis.Error(`Unknown field ${a} (wire type ${l}) for ${this.typeName}`);
|
|
3563
3567
|
let d = e.skip(l);
|
|
3564
|
-
c !== !1 && (c === !0 ?
|
|
3568
|
+
c !== !1 && (c === !0 ? k.onRead : c)(this.typeName, s, a, l, d);
|
|
3565
3569
|
}
|
|
3566
3570
|
}
|
|
3567
3571
|
return s;
|
|
3568
3572
|
}
|
|
3569
3573
|
internalBinaryWrite(e, t, n) {
|
|
3570
|
-
e.folderName !== "" && t.tag(1,
|
|
3571
|
-
let
|
|
3572
|
-
return
|
|
3574
|
+
e.folderName !== "" && t.tag(1, p.LengthDelimited).string(e.folderName), e.cursor !== "" && t.tag(2, p.LengthDelimited).string(e.cursor), e.limit !== 0 && t.tag(3, p.Varint).int32(e.limit);
|
|
3575
|
+
let r = n.writeUnknownFields;
|
|
3576
|
+
return r !== !1 && (r == !0 ? k.onWrite : r)(this.typeName, e, t), t;
|
|
3573
3577
|
}
|
|
3574
3578
|
}
|
|
3575
|
-
const
|
|
3576
|
-
class
|
|
3579
|
+
const Kt = new li();
|
|
3580
|
+
class ci extends M {
|
|
3577
3581
|
constructor() {
|
|
3578
3582
|
super("com.hamropatro.grpc.cms.GetFilesByFolderResponse", [
|
|
3579
|
-
{ no: 1, name: "files", kind: "message", repeat: 1, T: () =>
|
|
3583
|
+
{ no: 1, name: "files", kind: "message", repeat: 1, T: () => he },
|
|
3580
3584
|
{
|
|
3581
3585
|
no: 2,
|
|
3582
3586
|
name: "next_cursor",
|
|
@@ -3595,16 +3599,16 @@ class or extends M {
|
|
|
3595
3599
|
}
|
|
3596
3600
|
create(e) {
|
|
3597
3601
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
3598
|
-
return t.files = [], t.nextCursor = "", t.hasMore = !1, e !== void 0 &&
|
|
3602
|
+
return t.files = [], t.nextCursor = "", t.hasMore = !1, e !== void 0 && D(this, t, e), t;
|
|
3599
3603
|
}
|
|
3600
|
-
internalBinaryRead(e, t, n,
|
|
3601
|
-
let s =
|
|
3604
|
+
internalBinaryRead(e, t, n, r) {
|
|
3605
|
+
let s = r ?? this.create(), o = e.pos + t;
|
|
3602
3606
|
for (; e.pos < o; ) {
|
|
3603
3607
|
let [a, l] = e.tag();
|
|
3604
3608
|
switch (a) {
|
|
3605
3609
|
case /* repeated com.hamropatro.grpc.cms.File files */
|
|
3606
3610
|
1:
|
|
3607
|
-
s.files.push(
|
|
3611
|
+
s.files.push(he.internalBinaryRead(e, e.uint32(), n));
|
|
3608
3612
|
break;
|
|
3609
3613
|
case /* string next_cursor */
|
|
3610
3614
|
2:
|
|
@@ -3619,87 +3623,87 @@ class or extends M {
|
|
|
3619
3623
|
if (c === "throw")
|
|
3620
3624
|
throw new globalThis.Error(`Unknown field ${a} (wire type ${l}) for ${this.typeName}`);
|
|
3621
3625
|
let d = e.skip(l);
|
|
3622
|
-
c !== !1 && (c === !0 ?
|
|
3626
|
+
c !== !1 && (c === !0 ? k.onRead : c)(this.typeName, s, a, l, d);
|
|
3623
3627
|
}
|
|
3624
3628
|
}
|
|
3625
3629
|
return s;
|
|
3626
3630
|
}
|
|
3627
3631
|
internalBinaryWrite(e, t, n) {
|
|
3628
3632
|
for (let s = 0; s < e.files.length; s++)
|
|
3629
|
-
|
|
3630
|
-
e.nextCursor !== "" && t.tag(2,
|
|
3631
|
-
let
|
|
3632
|
-
return
|
|
3633
|
+
he.internalBinaryWrite(e.files[s], t.tag(1, p.LengthDelimited).fork(), n).join();
|
|
3634
|
+
e.nextCursor !== "" && t.tag(2, p.LengthDelimited).string(e.nextCursor), e.hasMore !== !1 && t.tag(3, p.Varint).bool(e.hasMore);
|
|
3635
|
+
let r = n.writeUnknownFields;
|
|
3636
|
+
return r !== !1 && (r == !0 ? k.onWrite : r)(this.typeName, e, t), t;
|
|
3633
3637
|
}
|
|
3634
3638
|
}
|
|
3635
|
-
const
|
|
3636
|
-
{ name: "createFile", options: {}, I:
|
|
3637
|
-
{ name: "updateFile", options: {}, I:
|
|
3638
|
-
{ name: "deleteFile", options: {}, I:
|
|
3639
|
-
{ name: "getFilesByFolder", options: {}, I:
|
|
3640
|
-
{ name: "search", options: {}, I:
|
|
3639
|
+
const hi = new ci(), tt = new ct("com.hamropatro.grpc.cms.FileService", [
|
|
3640
|
+
{ name: "createFile", options: {}, I: qt, O: he },
|
|
3641
|
+
{ name: "updateFile", options: {}, I: he, O: he },
|
|
3642
|
+
{ name: "deleteFile", options: {}, I: si, O: ai },
|
|
3643
|
+
{ name: "getFilesByFolder", options: {}, I: Kt, O: hi },
|
|
3644
|
+
{ name: "search", options: {}, I: Wt, O: ei }
|
|
3641
3645
|
]);
|
|
3642
|
-
class
|
|
3646
|
+
class ui {
|
|
3643
3647
|
constructor(e) {
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3648
|
+
_(this, "typeName", tt.typeName);
|
|
3649
|
+
_(this, "methods", tt.methods);
|
|
3650
|
+
_(this, "options", tt.options);
|
|
3647
3651
|
this._transport = e;
|
|
3648
3652
|
}
|
|
3649
3653
|
/**
|
|
3650
3654
|
* @generated from protobuf rpc: createFile(com.hamropatro.grpc.cms.CreateFileRequest) returns (com.hamropatro.grpc.cms.File);
|
|
3651
3655
|
*/
|
|
3652
3656
|
createFile(e, t) {
|
|
3653
|
-
const n = this.methods[0],
|
|
3654
|
-
return
|
|
3657
|
+
const n = this.methods[0], r = this._transport.mergeOptions(t);
|
|
3658
|
+
return le("unary", this._transport, n, r, e);
|
|
3655
3659
|
}
|
|
3656
3660
|
/**
|
|
3657
3661
|
* @generated from protobuf rpc: updateFile(com.hamropatro.grpc.cms.File) returns (com.hamropatro.grpc.cms.File);
|
|
3658
3662
|
*/
|
|
3659
3663
|
updateFile(e, t) {
|
|
3660
|
-
const n = this.methods[1],
|
|
3661
|
-
return
|
|
3664
|
+
const n = this.methods[1], r = this._transport.mergeOptions(t);
|
|
3665
|
+
return le("unary", this._transport, n, r, e);
|
|
3662
3666
|
}
|
|
3663
3667
|
/**
|
|
3664
3668
|
* @generated from protobuf rpc: deleteFile(com.hamropatro.grpc.cms.DeleteFileRequest) returns (com.hamropatro.grpc.cms.DeleteFileResponse);
|
|
3665
3669
|
*/
|
|
3666
3670
|
deleteFile(e, t) {
|
|
3667
|
-
const n = this.methods[2],
|
|
3668
|
-
return
|
|
3671
|
+
const n = this.methods[2], r = this._transport.mergeOptions(t);
|
|
3672
|
+
return le("unary", this._transport, n, r, e);
|
|
3669
3673
|
}
|
|
3670
3674
|
/**
|
|
3671
3675
|
* @generated from protobuf rpc: getFilesByFolder(com.hamropatro.grpc.cms.GetFilesByFolderRequest) returns (com.hamropatro.grpc.cms.GetFilesByFolderResponse);
|
|
3672
3676
|
*/
|
|
3673
3677
|
getFilesByFolder(e, t) {
|
|
3674
|
-
const n = this.methods[3],
|
|
3675
|
-
return
|
|
3678
|
+
const n = this.methods[3], r = this._transport.mergeOptions(t);
|
|
3679
|
+
return le("unary", this._transport, n, r, e);
|
|
3676
3680
|
}
|
|
3677
3681
|
/**
|
|
3678
3682
|
* @generated from protobuf rpc: search(com.hamropatro.grpc.cms.SearchRequest) returns (com.hamropatro.grpc.cms.SearchResult);
|
|
3679
3683
|
*/
|
|
3680
3684
|
search(e, t) {
|
|
3681
|
-
const n = this.methods[4],
|
|
3682
|
-
return
|
|
3685
|
+
const n = this.methods[4], r = this._transport.mergeOptions(t);
|
|
3686
|
+
return le("unary", this._transport, n, r, e);
|
|
3683
3687
|
}
|
|
3684
3688
|
}
|
|
3685
|
-
class
|
|
3689
|
+
class di extends M {
|
|
3686
3690
|
constructor() {
|
|
3687
3691
|
super("com.hamropatro.grpc.cms.ImageUploadRequest", []);
|
|
3688
3692
|
}
|
|
3689
3693
|
create(e) {
|
|
3690
3694
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
3691
|
-
return e !== void 0 &&
|
|
3695
|
+
return e !== void 0 && D(this, t, e), t;
|
|
3692
3696
|
}
|
|
3693
|
-
internalBinaryRead(e, t, n,
|
|
3694
|
-
return
|
|
3697
|
+
internalBinaryRead(e, t, n, r) {
|
|
3698
|
+
return r ?? this.create();
|
|
3695
3699
|
}
|
|
3696
3700
|
internalBinaryWrite(e, t, n) {
|
|
3697
|
-
let
|
|
3698
|
-
return
|
|
3701
|
+
let r = n.writeUnknownFields;
|
|
3702
|
+
return r !== !1 && (r == !0 ? k.onWrite : r)(this.typeName, e, t), t;
|
|
3699
3703
|
}
|
|
3700
3704
|
}
|
|
3701
|
-
const
|
|
3702
|
-
class
|
|
3705
|
+
const Xt = new di();
|
|
3706
|
+
class fi extends M {
|
|
3703
3707
|
constructor() {
|
|
3704
3708
|
super("com.hamropatro.grpc.cms.ImageUploadResponse", [
|
|
3705
3709
|
{
|
|
@@ -3720,10 +3724,10 @@ class hr extends M {
|
|
|
3720
3724
|
}
|
|
3721
3725
|
create(e) {
|
|
3722
3726
|
const t = globalThis.Object.create(this.messagePrototype);
|
|
3723
|
-
return t.key = "", t.url = "", e !== void 0 &&
|
|
3727
|
+
return t.key = "", t.url = "", e !== void 0 && D(this, t, e), t;
|
|
3724
3728
|
}
|
|
3725
|
-
internalBinaryRead(e, t, n,
|
|
3726
|
-
let s =
|
|
3729
|
+
internalBinaryRead(e, t, n, r) {
|
|
3730
|
+
let s = r ?? this.create(), o = e.pos + t;
|
|
3727
3731
|
for (; e.pos < o; ) {
|
|
3728
3732
|
let [a, l] = e.tag();
|
|
3729
3733
|
switch (a) {
|
|
@@ -3740,132 +3744,132 @@ class hr extends M {
|
|
|
3740
3744
|
if (c === "throw")
|
|
3741
3745
|
throw new globalThis.Error(`Unknown field ${a} (wire type ${l}) for ${this.typeName}`);
|
|
3742
3746
|
let d = e.skip(l);
|
|
3743
|
-
c !== !1 && (c === !0 ?
|
|
3747
|
+
c !== !1 && (c === !0 ? k.onRead : c)(this.typeName, s, a, l, d);
|
|
3744
3748
|
}
|
|
3745
3749
|
}
|
|
3746
3750
|
return s;
|
|
3747
3751
|
}
|
|
3748
3752
|
internalBinaryWrite(e, t, n) {
|
|
3749
|
-
e.key !== "" && t.tag(1,
|
|
3750
|
-
let
|
|
3751
|
-
return
|
|
3753
|
+
e.key !== "" && t.tag(1, p.LengthDelimited).string(e.key), e.url !== "" && t.tag(2, p.LengthDelimited).string(e.url);
|
|
3754
|
+
let r = n.writeUnknownFields;
|
|
3755
|
+
return r !== !1 && (r == !0 ? k.onWrite : r)(this.typeName, e, t), t;
|
|
3752
3756
|
}
|
|
3753
3757
|
}
|
|
3754
|
-
const
|
|
3755
|
-
{ name: "Upload", options: {}, I:
|
|
3758
|
+
const mi = new fi(), nt = new ct("com.hamropatro.grpc.cms.ImageUploadService", [
|
|
3759
|
+
{ name: "Upload", options: {}, I: Xt, O: mi }
|
|
3756
3760
|
]);
|
|
3757
|
-
class
|
|
3761
|
+
class pi {
|
|
3758
3762
|
constructor(e) {
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3763
|
+
_(this, "typeName", nt.typeName);
|
|
3764
|
+
_(this, "methods", nt.methods);
|
|
3765
|
+
_(this, "options", nt.options);
|
|
3762
3766
|
this._transport = e;
|
|
3763
3767
|
}
|
|
3764
3768
|
/**
|
|
3765
3769
|
* @generated from protobuf rpc: Upload(com.hamropatro.grpc.cms.ImageUploadRequest) returns (com.hamropatro.grpc.cms.ImageUploadResponse);
|
|
3766
3770
|
*/
|
|
3767
3771
|
upload(e, t) {
|
|
3768
|
-
const n = this.methods[0],
|
|
3769
|
-
return
|
|
3772
|
+
const n = this.methods[0], r = this._transport.mergeOptions(t);
|
|
3773
|
+
return le("unary", this._transport, n, r, e);
|
|
3770
3774
|
}
|
|
3771
3775
|
}
|
|
3772
|
-
const
|
|
3776
|
+
const gi = {
|
|
3773
3777
|
baseUrl: "https://hamro-cms-backend-grpc.hamrostack.com"
|
|
3774
|
-
},
|
|
3775
|
-
baseUrl:
|
|
3776
|
-
}),
|
|
3777
|
-
jt.create();
|
|
3778
|
-
const qt = async () => {
|
|
3778
|
+
}, ut = new Kn({
|
|
3779
|
+
baseUrl: gi.baseUrl
|
|
3780
|
+
}), Ht = new Yn(ut), Ve = Pt.create(), it = jt.create(), dt = new ui(ut), Te = qt.create(), $e = Kt.create(), Pe = Wt.create(), wi = new pi(ut), bi = Xt.create(), yi = async () => {
|
|
3779
3781
|
try {
|
|
3780
|
-
return await
|
|
3781
|
-
|
|
3782
|
-
|
|
3782
|
+
return await wi.upload(
|
|
3783
|
+
bi
|
|
3784
|
+
);
|
|
3785
|
+
} catch (i) {
|
|
3786
|
+
throw i;
|
|
3783
3787
|
}
|
|
3784
|
-
},
|
|
3788
|
+
}, Ni = async (i, e) => {
|
|
3785
3789
|
try {
|
|
3786
|
-
const t =
|
|
3787
|
-
return await fetch(
|
|
3790
|
+
const t = ki(i, e), r = (await yi()).response.url;
|
|
3791
|
+
return await fetch(r, {
|
|
3788
3792
|
method: "PUT",
|
|
3789
3793
|
headers: {
|
|
3790
3794
|
"Content-Type": "image/*",
|
|
3791
3795
|
"x-amz-acl": "public-read"
|
|
3792
3796
|
},
|
|
3793
3797
|
body: t
|
|
3794
|
-
}),
|
|
3798
|
+
}), r == null ? void 0 : r.split("?")[0];
|
|
3795
3799
|
} catch (t) {
|
|
3796
3800
|
throw t;
|
|
3797
3801
|
}
|
|
3798
|
-
},
|
|
3802
|
+
}, ki = (i, e) => {
|
|
3799
3803
|
const t = e.type.split("/")[0];
|
|
3800
3804
|
let n = "";
|
|
3801
|
-
t === "video" ? n =
|
|
3802
|
-
const
|
|
3803
|
-
for (let o = 0; o <
|
|
3804
|
-
s[o] =
|
|
3805
|
+
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,/, ""));
|
|
3806
|
+
const r = atob(n), s = new Uint8Array(r.length);
|
|
3807
|
+
for (let o = 0; o < r.length; o++)
|
|
3808
|
+
s[o] = r.charCodeAt(o);
|
|
3805
3809
|
return s;
|
|
3806
|
-
},
|
|
3810
|
+
}, Ei = async (i, e = 20, t) => {
|
|
3807
3811
|
try {
|
|
3808
|
-
return
|
|
3809
|
-
|
|
3812
|
+
return it.cursor = i, it.limit = e, await Ht.getFolders(
|
|
3813
|
+
it,
|
|
3810
3814
|
t
|
|
3811
3815
|
);
|
|
3812
3816
|
} catch (n) {
|
|
3813
3817
|
throw n;
|
|
3814
3818
|
}
|
|
3815
|
-
},
|
|
3819
|
+
}, Ii = async (i, e, t, n) => {
|
|
3816
3820
|
try {
|
|
3817
|
-
return
|
|
3818
|
-
|
|
3821
|
+
return Ve.name = i, Ve.nestedFolderName = e, Ve.createdBy = t, await Ht.createFolder(
|
|
3822
|
+
Ve,
|
|
3819
3823
|
n
|
|
3820
3824
|
);
|
|
3821
|
-
} catch (
|
|
3822
|
-
throw
|
|
3825
|
+
} catch (r) {
|
|
3826
|
+
throw r;
|
|
3823
3827
|
}
|
|
3824
|
-
},
|
|
3828
|
+
}, Ai = async (i, e, t, n, r, s) => {
|
|
3825
3829
|
try {
|
|
3826
|
-
return
|
|
3827
|
-
|
|
3830
|
+
return Te.name = i, Te.nestedFolderName = e, Te.url = t, Te.type = n, Te.folderName = r, await dt.createFile(
|
|
3831
|
+
Te,
|
|
3828
3832
|
s
|
|
3829
3833
|
);
|
|
3830
3834
|
} catch (o) {
|
|
3831
3835
|
throw o;
|
|
3832
3836
|
}
|
|
3833
|
-
},
|
|
3837
|
+
}, Ti = async (i, e, t, n) => {
|
|
3834
3838
|
try {
|
|
3835
|
-
return
|
|
3836
|
-
|
|
3839
|
+
return $e.folderName = i, $e.cursor = e, $e.limit = t, await dt.getFilesByFolder(
|
|
3840
|
+
$e,
|
|
3837
3841
|
n
|
|
3838
3842
|
);
|
|
3839
|
-
} catch (
|
|
3840
|
-
throw
|
|
3843
|
+
} catch (r) {
|
|
3844
|
+
throw r;
|
|
3841
3845
|
}
|
|
3842
|
-
},
|
|
3846
|
+
}, Fi = async (i, e, t = 20, n) => {
|
|
3843
3847
|
try {
|
|
3844
|
-
return
|
|
3845
|
-
|
|
3848
|
+
return Pe.searchValue = i, Pe.cursor = e, Pe.limit = t, await dt.search(
|
|
3849
|
+
Pe,
|
|
3846
3850
|
n
|
|
3847
3851
|
);
|
|
3848
|
-
} catch (
|
|
3849
|
-
throw
|
|
3852
|
+
} catch (r) {
|
|
3853
|
+
throw r;
|
|
3850
3854
|
}
|
|
3851
3855
|
};
|
|
3852
|
-
var
|
|
3853
|
-
const
|
|
3856
|
+
var ce = /* @__PURE__ */ ((i) => (i[i.IMAGE = 0] = "IMAGE", i[i.AUDIO = 1] = "AUDIO", i[i.VIDEO = 2] = "VIDEO", i[i.ALL = 3] = "ALL", i))(ce || {});
|
|
3857
|
+
const je = {
|
|
3854
3858
|
0: "IMAGE",
|
|
3855
3859
|
1: "AUDIO",
|
|
3856
3860
|
2: "VIDEO",
|
|
3857
3861
|
3: "ALL"
|
|
3858
3862
|
};
|
|
3859
|
-
function
|
|
3860
|
-
switch (
|
|
3863
|
+
function Li(i) {
|
|
3864
|
+
switch (i) {
|
|
3861
3865
|
case "image":
|
|
3862
|
-
return
|
|
3866
|
+
return je[ce.IMAGE];
|
|
3863
3867
|
case "video":
|
|
3864
|
-
return
|
|
3868
|
+
return je[ce.VIDEO];
|
|
3865
3869
|
case "audio":
|
|
3866
|
-
return
|
|
3870
|
+
return je[ce.AUDIO];
|
|
3867
3871
|
default:
|
|
3868
|
-
return
|
|
3872
|
+
return je[ce.ALL];
|
|
3869
3873
|
}
|
|
3870
3874
|
}
|
|
3871
3875
|
const G = document.createElementNS(
|
|
@@ -3878,15 +3882,15 @@ G.setAttribute("y", "0px");
|
|
|
3878
3882
|
G.setAttribute("width", "18");
|
|
3879
3883
|
G.setAttribute("height", "18");
|
|
3880
3884
|
G.setAttribute("viewBox", "0 0 50 50");
|
|
3881
|
-
const
|
|
3882
|
-
|
|
3885
|
+
const Gt = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3886
|
+
Gt.setAttribute(
|
|
3883
3887
|
"d",
|
|
3884
3888
|
"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"
|
|
3885
3889
|
);
|
|
3886
|
-
G.appendChild(
|
|
3887
|
-
function
|
|
3888
|
-
const
|
|
3889
|
-
|
|
3890
|
+
G.appendChild(Gt);
|
|
3891
|
+
function Oi() {
|
|
3892
|
+
const i = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3893
|
+
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");
|
|
3890
3894
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3891
3895
|
e.setAttribute("fill", "#FFA000"), e.setAttribute(
|
|
3892
3896
|
"d",
|
|
@@ -3896,28 +3900,28 @@ function Ir() {
|
|
|
3896
3900
|
return t.setAttribute("fill", "#FFCA28"), t.setAttribute(
|
|
3897
3901
|
"d",
|
|
3898
3902
|
"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"
|
|
3899
|
-
),
|
|
3903
|
+
), i.appendChild(e), i.appendChild(t), i;
|
|
3900
3904
|
}
|
|
3901
|
-
const
|
|
3905
|
+
const j = document.createElementNS(
|
|
3902
3906
|
"http://www.w3.org/2000/svg",
|
|
3903
3907
|
"svg"
|
|
3904
3908
|
);
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
const
|
|
3916
|
-
|
|
3917
|
-
const
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3909
|
+
j.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
3910
|
+
j.setAttribute("width", "20");
|
|
3911
|
+
j.setAttribute("height", "20");
|
|
3912
|
+
j.setAttribute("viewBox", "0 0 24 24");
|
|
3913
|
+
j.setAttribute("fill", "none");
|
|
3914
|
+
j.setAttribute("stroke", "currentColor");
|
|
3915
|
+
j.setAttribute("stroke-width", "2");
|
|
3916
|
+
j.setAttribute("stroke-linecap", "round");
|
|
3917
|
+
j.setAttribute("stroke-linejoin", "round");
|
|
3918
|
+
j.classList.add("lucide", "lucide-circle-check-big");
|
|
3919
|
+
const Jt = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3920
|
+
Jt.setAttribute("d", "M21.801 10A10 10 0 1 1 17 3.335");
|
|
3921
|
+
const Zt = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3922
|
+
Zt.setAttribute("d", "m9 11 3 3L22 4");
|
|
3923
|
+
j.appendChild(Jt);
|
|
3924
|
+
j.appendChild(Zt);
|
|
3921
3925
|
const V = document.createElementNS(
|
|
3922
3926
|
"http://www.w3.org/2000/svg",
|
|
3923
3927
|
"svg"
|
|
@@ -3932,76 +3936,113 @@ V.setAttribute("stroke-width", "2");
|
|
|
3932
3936
|
V.setAttribute("stroke-linecap", "round");
|
|
3933
3937
|
V.setAttribute("stroke-linejoin", "round");
|
|
3934
3938
|
V.classList.add("lucide", "lucide-circle-alert");
|
|
3935
|
-
const
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
const
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
const
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
V.appendChild(
|
|
3950
|
-
V.appendChild(
|
|
3951
|
-
V.appendChild(
|
|
3952
|
-
function
|
|
3953
|
-
const
|
|
3939
|
+
const Je = document.createElementNS("http://www.w3.org/2000/svg", "circle");
|
|
3940
|
+
Je.setAttribute("cx", "12");
|
|
3941
|
+
Je.setAttribute("cy", "12");
|
|
3942
|
+
Je.setAttribute("r", "10");
|
|
3943
|
+
const xe = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
3944
|
+
xe.setAttribute("x1", "12");
|
|
3945
|
+
xe.setAttribute("x2", "12");
|
|
3946
|
+
xe.setAttribute("y1", "8");
|
|
3947
|
+
xe.setAttribute("y2", "12");
|
|
3948
|
+
const De = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
3949
|
+
De.setAttribute("x1", "12");
|
|
3950
|
+
De.setAttribute("x2", "12.01");
|
|
3951
|
+
De.setAttribute("y1", "16");
|
|
3952
|
+
De.setAttribute("y2", "16");
|
|
3953
|
+
V.appendChild(Je);
|
|
3954
|
+
V.appendChild(xe);
|
|
3955
|
+
V.appendChild(De);
|
|
3956
|
+
function Bi() {
|
|
3957
|
+
const i = document.createElementNS(
|
|
3954
3958
|
"http://www.w3.org/2000/svg",
|
|
3955
3959
|
"svg"
|
|
3956
3960
|
);
|
|
3957
|
-
|
|
3961
|
+
i.setAttribute("xmlns", "http://www.w3.org/2000/svg"), i.setAttribute("height", "24px"), i.setAttribute("width", "24px"), i.setAttribute("viewBox", "0 -960 960 960"), i.setAttribute("fill", "#333");
|
|
3958
3962
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3959
3963
|
return e.setAttribute(
|
|
3960
3964
|
"d",
|
|
3961
3965
|
"M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"
|
|
3962
|
-
),
|
|
3966
|
+
), i.appendChild(e), i;
|
|
3963
3967
|
}
|
|
3964
|
-
function
|
|
3965
|
-
const
|
|
3966
|
-
|
|
3968
|
+
function Bt() {
|
|
3969
|
+
const i = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3970
|
+
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");
|
|
3967
3971
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3968
|
-
return e.setAttribute("stroke-linecap", "round"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("d", "M12 4.5v15m7.5-7.5h-15"),
|
|
3972
|
+
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;
|
|
3969
3973
|
}
|
|
3970
|
-
function
|
|
3974
|
+
function Ci(i) {
|
|
3971
3975
|
const e = {};
|
|
3972
|
-
|
|
3973
|
-
e[
|
|
3976
|
+
i.forEach((r) => {
|
|
3977
|
+
e[r.key] = { ...r, children: {} };
|
|
3974
3978
|
});
|
|
3975
|
-
const t = (
|
|
3976
|
-
(o) => o.nestedFolderName ==
|
|
3979
|
+
const t = (r) => (Object.values(e).filter(
|
|
3980
|
+
(o) => o.nestedFolderName == r.key
|
|
3977
3981
|
).forEach((o) => {
|
|
3978
|
-
|
|
3979
|
-
}),
|
|
3980
|
-
return
|
|
3982
|
+
r.children[o.key] = t(o);
|
|
3983
|
+
}), r);
|
|
3984
|
+
return i.reduce((r, s) => (s.nestedFolderName || r.push(t(e[s.key])), r), []);
|
|
3981
3985
|
}
|
|
3982
|
-
function
|
|
3983
|
-
const
|
|
3984
|
-
|
|
3986
|
+
function vi(i, e) {
|
|
3987
|
+
const t = (n) => {
|
|
3988
|
+
if (n.key === e.nestedFolderName)
|
|
3989
|
+
return n.children[e.key] = { ...e, children: {} }, !0;
|
|
3990
|
+
for (const r in n.children) {
|
|
3991
|
+
const s = n.children[r];
|
|
3992
|
+
if (t(s))
|
|
3993
|
+
return !0;
|
|
3994
|
+
}
|
|
3995
|
+
return !1;
|
|
3996
|
+
};
|
|
3997
|
+
for (const n of i)
|
|
3998
|
+
if (t(n))
|
|
3999
|
+
break;
|
|
4000
|
+
return i;
|
|
4001
|
+
}
|
|
4002
|
+
function _i() {
|
|
4003
|
+
const i = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
4004
|
+
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");
|
|
3985
4005
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3986
4006
|
return e.setAttribute(
|
|
3987
4007
|
"d",
|
|
3988
4008
|
"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"
|
|
3989
|
-
),
|
|
4009
|
+
), i.appendChild(e), i;
|
|
3990
4010
|
}
|
|
3991
|
-
function
|
|
3992
|
-
const
|
|
3993
|
-
e.setAttribute("xmlns",
|
|
3994
|
-
const t = document.createElementNS(
|
|
4011
|
+
function xi() {
|
|
4012
|
+
const i = "http://www.w3.org/2000/svg", e = document.createElementNS(i, "svg");
|
|
4013
|
+
e.setAttribute("xmlns", i), e.setAttribute("height", "20px"), e.setAttribute("viewBox", "0 -960 960 960"), e.setAttribute("width", "20px"), e.setAttribute("fill", "#fff");
|
|
4014
|
+
const t = document.createElementNS(i, "path");
|
|
3995
4015
|
return t.setAttribute(
|
|
3996
4016
|
"d",
|
|
3997
4017
|
"M440-320v-326L336-542l-56-58 200-200 200 200-56 58-104-104v326h-80ZM240-160q-33 0-56.5-23.5T160-240v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-160H240Z"
|
|
3998
4018
|
), e.appendChild(t), e;
|
|
3999
4019
|
}
|
|
4000
|
-
|
|
4020
|
+
function Di() {
|
|
4021
|
+
const i = "http://www.w3.org/2000/svg", e = document.createElementNS(i, "svg");
|
|
4022
|
+
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");
|
|
4023
|
+
const t = document.createElementNS(i, "path");
|
|
4024
|
+
t.setAttribute(
|
|
4025
|
+
"d",
|
|
4026
|
+
"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"
|
|
4027
|
+
);
|
|
4028
|
+
const n = document.createElementNS(i, "rect");
|
|
4029
|
+
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;
|
|
4030
|
+
}
|
|
4031
|
+
function Ri() {
|
|
4032
|
+
const i = "http://www.w3.org/2000/svg", e = document.createElementNS(i, "svg");
|
|
4033
|
+
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");
|
|
4034
|
+
const t = document.createElementNS(i, "rect");
|
|
4035
|
+
t.setAttribute("width", "18"), t.setAttribute("height", "18"), t.setAttribute("x", "3"), t.setAttribute("y", "3"), t.setAttribute("rx", "2"), t.setAttribute("ry", "2");
|
|
4036
|
+
const n = document.createElementNS(i, "circle");
|
|
4037
|
+
n.setAttribute("cx", "9"), n.setAttribute("cy", "9"), n.setAttribute("r", "2");
|
|
4038
|
+
const r = document.createElementNS(i, "path");
|
|
4039
|
+
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;
|
|
4040
|
+
}
|
|
4041
|
+
const Ui = async (i) => {
|
|
4001
4042
|
let e;
|
|
4002
4043
|
try {
|
|
4003
|
-
|
|
4004
|
-
Authorization: "Bearer " +
|
|
4044
|
+
i && (e = {
|
|
4045
|
+
Authorization: "Bearer " + i
|
|
4005
4046
|
});
|
|
4006
4047
|
} catch (n) {
|
|
4007
4048
|
if (n) throw n;
|
|
@@ -4010,221 +4051,288 @@ const Or = async (r) => {
|
|
|
4010
4051
|
meta: e
|
|
4011
4052
|
};
|
|
4012
4053
|
};
|
|
4013
|
-
|
|
4014
|
-
|
|
4054
|
+
class Si {
|
|
4055
|
+
constructor() {
|
|
4056
|
+
_(this, "main");
|
|
4057
|
+
_(this, "dialogBody");
|
|
4058
|
+
this.main = S("div"), this.dialogBody = S("div"), this.hide();
|
|
4059
|
+
}
|
|
4060
|
+
show(e) {
|
|
4061
|
+
this.main = S("div", "popover", e.mainContainer), this.dialogBody = S("div", "popover-body", this.main), this.main.id = e.divId, this.dialogBody.append(e.content);
|
|
4062
|
+
}
|
|
4063
|
+
hide() {
|
|
4064
|
+
this.main.remove();
|
|
4065
|
+
}
|
|
4066
|
+
}
|
|
4067
|
+
const We = new Si();
|
|
4068
|
+
function Mi() {
|
|
4069
|
+
const i = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
4070
|
+
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");
|
|
4071
|
+
const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
4072
|
+
e.setAttribute(
|
|
4073
|
+
"d",
|
|
4074
|
+
"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"
|
|
4075
|
+
);
|
|
4076
|
+
const t = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
4077
|
+
return t.setAttribute("d", "m15 5 4 4"), i.appendChild(e), i.appendChild(t), document.body.appendChild(i), i;
|
|
4078
|
+
}
|
|
4079
|
+
function Vi() {
|
|
4080
|
+
const i = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
4081
|
+
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");
|
|
4082
|
+
const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
4083
|
+
e.setAttribute("d", "M3 6h18");
|
|
4084
|
+
const t = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
4085
|
+
t.setAttribute("d", "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6");
|
|
4086
|
+
const n = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
4087
|
+
n.setAttribute("d", "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2");
|
|
4088
|
+
const r = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
4089
|
+
r.setAttribute("x1", "10"), r.setAttribute("x2", "10"), r.setAttribute("y1", "11"), r.setAttribute("y2", "17");
|
|
4090
|
+
const s = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
4091
|
+
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;
|
|
4092
|
+
}
|
|
4093
|
+
function $i() {
|
|
4094
|
+
const i = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
4095
|
+
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");
|
|
4096
|
+
const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
4097
|
+
e.setAttribute("d", "M9 18V5l12-2v13");
|
|
4098
|
+
const t = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
4099
|
+
t.setAttribute("d", "m9 9 12-2");
|
|
4100
|
+
const n = document.createElementNS(
|
|
4101
|
+
"http://www.w3.org/2000/svg",
|
|
4102
|
+
"circle"
|
|
4103
|
+
);
|
|
4104
|
+
n.setAttribute("cx", "6"), n.setAttribute("cy", "18"), n.setAttribute("r", "3");
|
|
4105
|
+
const r = document.createElementNS(
|
|
4106
|
+
"http://www.w3.org/2000/svg",
|
|
4107
|
+
"circle"
|
|
4108
|
+
);
|
|
4109
|
+
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;
|
|
4110
|
+
}
|
|
4111
|
+
var ye, Ne, B, ne, x, R, de, K, ke, fe, Ee, ie, me, ve, pe, ge, re, Ie, Y, z, we, Ae, se, Le, _e, oe, be;
|
|
4112
|
+
class ji {
|
|
4015
4113
|
constructor(e) {
|
|
4016
|
-
E(this, ge);
|
|
4017
|
-
E(this, be);
|
|
4018
|
-
E(this, x);
|
|
4019
|
-
E(this, te);
|
|
4020
|
-
E(this, L, []);
|
|
4021
|
-
E(this, v, []);
|
|
4022
|
-
E(this, ce);
|
|
4023
|
-
E(this, W);
|
|
4024
|
-
E(this, we);
|
|
4025
4114
|
E(this, ye);
|
|
4026
|
-
E(this,
|
|
4027
|
-
E(this,
|
|
4028
|
-
E(this, ue);
|
|
4029
|
-
E(this, Be);
|
|
4115
|
+
E(this, Ne);
|
|
4116
|
+
E(this, B);
|
|
4030
4117
|
E(this, ne);
|
|
4118
|
+
E(this, x, []);
|
|
4119
|
+
E(this, R, []);
|
|
4031
4120
|
E(this, de);
|
|
4032
|
-
E(this,
|
|
4033
|
-
E(this, Ne);
|
|
4034
|
-
E(this, Y);
|
|
4035
|
-
E(this, fe);
|
|
4121
|
+
E(this, K);
|
|
4036
4122
|
E(this, ke);
|
|
4037
|
-
E(this,
|
|
4038
|
-
E(this,
|
|
4039
|
-
E(this,
|
|
4123
|
+
E(this, fe);
|
|
4124
|
+
E(this, Ee, []);
|
|
4125
|
+
E(this, ie);
|
|
4126
|
+
E(this, me);
|
|
4127
|
+
E(this, ve);
|
|
4128
|
+
E(this, pe);
|
|
4129
|
+
E(this, ge);
|
|
4040
4130
|
E(this, re);
|
|
4041
|
-
|
|
4131
|
+
E(this, Ie);
|
|
4132
|
+
E(this, Y);
|
|
4133
|
+
E(this, z);
|
|
4134
|
+
E(this, we);
|
|
4135
|
+
E(this, Ae);
|
|
4136
|
+
E(this, se);
|
|
4137
|
+
E(this, Le);
|
|
4138
|
+
E(this, _e);
|
|
4139
|
+
E(this, oe);
|
|
4140
|
+
E(this, be);
|
|
4141
|
+
m(this, de, !1), m(this, K, !1), m(this, ke, !1), m(this, ve, e.handleUpload.bind(this)), m(this, pe, 0), m(this, z, ""), m(this, we, !1), m(this, se, !1), m(this, _e, e.accessToken), m(this, be, null), this._removeToastContainer(), this._grpcOptionInitializer();
|
|
4042
4142
|
}
|
|
4043
4143
|
create(e) {
|
|
4044
4144
|
const {
|
|
4045
4145
|
parentContainerId: t,
|
|
4046
4146
|
buttonText: n,
|
|
4047
|
-
buttonClass:
|
|
4147
|
+
buttonClass: r,
|
|
4048
4148
|
buttonStyle: s,
|
|
4049
4149
|
buttonIcon: o
|
|
4050
4150
|
} = e;
|
|
4051
|
-
|
|
4151
|
+
m(this, ye, document.getElementById(t));
|
|
4052
4152
|
const a = document.createElement("button");
|
|
4053
|
-
a.className =
|
|
4153
|
+
a.className = r || "browse-image-button";
|
|
4054
4154
|
const l = document.createElement("span");
|
|
4055
4155
|
l.textContent = n || "Browse Files";
|
|
4056
4156
|
const c = document.createElement("span");
|
|
4057
4157
|
return c.innerHTML = o || "", a.type = "button", a.append(l, c), s && Object.assign(a.style, s), a.addEventListener("click", () => {
|
|
4058
4158
|
this._selectedImageContainer();
|
|
4059
|
-
}), u(this,
|
|
4159
|
+
}), u(this, ye) && u(this, ye).appendChild(a), u(this, ye);
|
|
4060
4160
|
}
|
|
4061
4161
|
async _grpcOptionInitializer() {
|
|
4062
|
-
|
|
4162
|
+
m(this, oe, await Ui(u(this, _e)));
|
|
4063
4163
|
}
|
|
4064
4164
|
_selectedImageContainer() {
|
|
4065
4165
|
var g;
|
|
4066
|
-
|
|
4067
|
-
`
|
|
4166
|
+
m(this, me, Be(
|
|
4167
|
+
`Save (${(g = u(this, x)) == null ? void 0 : g.length})`,
|
|
4068
4168
|
"dialog-btn confirm"
|
|
4069
|
-
)),
|
|
4070
|
-
const e =
|
|
4071
|
-
|
|
4169
|
+
)), m(this, ge, F("folder-container")), m(this, re, F("folder-list-wrapper")), this._fetchAllFolders();
|
|
4170
|
+
const e = Be("Cancel", "dialog-btn cancel");
|
|
4171
|
+
Be(
|
|
4072
4172
|
"",
|
|
4073
4173
|
"dialog-modal-close-btn",
|
|
4074
4174
|
"",
|
|
4075
4175
|
!1,
|
|
4076
4176
|
'<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>'
|
|
4077
4177
|
).addEventListener("click", () => {
|
|
4078
|
-
Re.hide(),
|
|
4079
|
-
}),
|
|
4080
|
-
const n =
|
|
4178
|
+
Re.hide(), m(this, x, []), m(this, R, []);
|
|
4179
|
+
}), m(this, Ne, F("browse-container"));
|
|
4180
|
+
const n = F();
|
|
4081
4181
|
n.style.display = "flex", n.style.alignItems = "center", n.style.justifyContent = "space-between", n.style.padding = "10px 20px";
|
|
4082
|
-
const
|
|
4083
|
-
s.append(
|
|
4084
|
-
const o = this._renderSearchField(), a = this._createBrowseMoreContainer(), l = this._createBrowseImageMain(), c =
|
|
4182
|
+
const r = Oe("Folders", "folder-title"), s = Be("", "add-folder-btn");
|
|
4183
|
+
s.append(Bt()), this._createFolderPrompt(s), n.append(r, s), u(this, ge).append(n, u(this, re));
|
|
4184
|
+
const o = this._renderSearchField(), a = this._createBrowseMoreContainer(), l = this._createBrowseImageMain(), c = F("footer");
|
|
4085
4185
|
e.onclick = () => {
|
|
4086
|
-
Re.hide(),
|
|
4087
|
-
}, u(this,
|
|
4088
|
-
u(this,
|
|
4089
|
-
}, c.append(u(this,
|
|
4090
|
-
const d =
|
|
4091
|
-
d.append(o, a, l, c), u(this,
|
|
4092
|
-
content: u(this,
|
|
4186
|
+
Re.hide(), m(this, R, []), m(this, x, []);
|
|
4187
|
+
}, u(this, me).onclick = () => {
|
|
4188
|
+
u(this, ve).call(this), Re.hide(), m(this, x, []), m(this, R, []);
|
|
4189
|
+
}, c.append(u(this, me), e);
|
|
4190
|
+
const d = F("container-right-main");
|
|
4191
|
+
d.append(o, a, l, c), u(this, Ne).append(u(this, ge), d), Re.show({
|
|
4192
|
+
content: u(this, Ne)
|
|
4093
4193
|
});
|
|
4094
4194
|
}
|
|
4095
4195
|
_createAllAndSelectedTab(e) {
|
|
4096
|
-
const t =
|
|
4196
|
+
const t = F("select-options"), n = Oe("Browse", "select"), r = Oe(
|
|
4097
4197
|
"Selected",
|
|
4098
4198
|
"select",
|
|
4099
4199
|
"selected-images-tab"
|
|
4100
4200
|
);
|
|
4101
|
-
n.classList.add("selected"), [n,
|
|
4201
|
+
n.classList.add("selected"), [n, r].forEach((o, a) => {
|
|
4102
4202
|
o.addEventListener("click", () => {
|
|
4103
4203
|
var l;
|
|
4104
|
-
|
|
4204
|
+
m(this, pe, a), (l = document.querySelector(".select.selected")) == null || l.classList.remove("selected"), o.classList.add("selected"), this._updateSelectedImageListContainerUI();
|
|
4105
4205
|
});
|
|
4106
|
-
}), t.append(n,
|
|
4206
|
+
}), t.append(n, r), e.appendChild(t);
|
|
4107
4207
|
}
|
|
4108
4208
|
_renderUploadButton() {
|
|
4109
|
-
const e =
|
|
4110
|
-
e.style.display = "none", e.setAttribute("multiple", "true"), e.setAttribute("accept", "image/*,video/*,audio/*,.gif"),
|
|
4209
|
+
const e = gt("file");
|
|
4210
|
+
e.style.display = "none", e.setAttribute("multiple", "true"), e.setAttribute("accept", "image/*,video/*,audio/*,.gif"), m(this, ne, document.createElement("button")), u(this, ne).className = "browse-more-btn";
|
|
4111
4211
|
const t = document.createElement("span");
|
|
4112
|
-
return t.textContent = "Upload", u(this,
|
|
4212
|
+
return t.textContent = "Upload", u(this, ne).append(xi(), t), u(this, ne).type = "button", u(this, ne).addEventListener(
|
|
4113
4213
|
"click",
|
|
4114
4214
|
() => e.click()
|
|
4115
4215
|
), e.addEventListener("change", () => {
|
|
4116
4216
|
const n = e.files;
|
|
4117
|
-
Object.values(n).forEach((
|
|
4217
|
+
Object.values(n).forEach((r) => {
|
|
4118
4218
|
const s = new FileReader();
|
|
4119
|
-
s.readAsDataURL(
|
|
4219
|
+
s.readAsDataURL(r), s.onload = async () => {
|
|
4120
4220
|
await this._uploadAndAddSelectedImageList(
|
|
4121
4221
|
s.result,
|
|
4122
|
-
|
|
4222
|
+
r
|
|
4123
4223
|
);
|
|
4124
4224
|
};
|
|
4125
4225
|
}), e.value = "";
|
|
4126
|
-
}), u(this,
|
|
4226
|
+
}), u(this, ne);
|
|
4127
4227
|
}
|
|
4128
4228
|
_renderCreateFolderBtn() {
|
|
4129
4229
|
const e = document.createElement("button");
|
|
4130
4230
|
e.className = "create-folder-btn";
|
|
4131
4231
|
const t = document.createElement("span");
|
|
4132
|
-
return t.textContent = "Create", e.append(
|
|
4232
|
+
return t.textContent = "Create", e.append(Bt(), t), this._createFolderPrompt(e), e;
|
|
4133
4233
|
}
|
|
4134
4234
|
_renderSearchField() {
|
|
4135
4235
|
let e;
|
|
4136
|
-
const t =
|
|
4236
|
+
const t = F("search-browse-container"), n = F(
|
|
4137
4237
|
"search-input-wrapper",
|
|
4138
4238
|
"search-input-wrapper"
|
|
4139
4239
|
);
|
|
4140
|
-
|
|
4141
|
-
|
|
4240
|
+
m(this, Ae, gt("search")), u(this, Ae).addEventListener("input", (s) => {
|
|
4241
|
+
m(this, R, []);
|
|
4142
4242
|
const o = s.target;
|
|
4143
4243
|
e && clearTimeout(e), e = setTimeout(() => {
|
|
4144
4244
|
if (!o.value) {
|
|
4145
|
-
this._fetchFilesFromFolder(u(this,
|
|
4245
|
+
m(this, z, ""), m(this, we, !1), m(this, se, !1), this._fetchFilesFromFolder(u(this, fe));
|
|
4146
4246
|
return;
|
|
4147
4247
|
}
|
|
4148
|
-
|
|
4248
|
+
m(this, se, !0), m(this, Le, o.value), this._search(u(this, Le));
|
|
4149
4249
|
}, 750);
|
|
4150
|
-
}), u(this,
|
|
4151
|
-
const
|
|
4152
|
-
return
|
|
4250
|
+
}), u(this, Ae).setAttribute("placeholder", "Search");
|
|
4251
|
+
const r = _i();
|
|
4252
|
+
return r.style.position = "absolute", r.style.top = "50%", r.style.left = "5%", r.style.transform = "translate(-5%, -50%)", n.append(r, u(this, Ae)), t.append(n), t;
|
|
4153
4253
|
}
|
|
4154
4254
|
_createBrowseMoreContainer() {
|
|
4155
|
-
|
|
4255
|
+
m(this, Ie, F("browse-more-btn-container")), this._createAllAndSelectedTab(u(this, Ie));
|
|
4156
4256
|
const e = this._renderUploadButton(), t = this._renderCreateFolderBtn(), n = document.createElement("div");
|
|
4157
|
-
return n.style.display = "flex", n.style.alignItems = "center", n.style.gap = "10px", n.append(e, t), u(this,
|
|
4257
|
+
return n.style.display = "flex", n.style.alignItems = "center", n.style.gap = "10px", n.append(e, t), u(this, Ie).appendChild(n), u(this, Ie);
|
|
4158
4258
|
}
|
|
4159
4259
|
_createBrowseImageMain() {
|
|
4160
|
-
const e =
|
|
4161
|
-
return
|
|
4162
|
-
const t = u(this,
|
|
4163
|
-
t + n >=
|
|
4164
|
-
}), this._updateSelectedImageListContainerUI(), e.appendChild(u(this,
|
|
4260
|
+
const e = F("browse-image-main");
|
|
4261
|
+
return m(this, B, F("selected-image-container")), u(this, B).addEventListener("scroll", () => {
|
|
4262
|
+
const t = u(this, B).clientHeight, n = u(this, B).scrollTop, r = u(this, B).scrollHeight;
|
|
4263
|
+
t + n >= r - 5 && u(this, we) && (u(this, se) ? this._search(u(this, Le)) : this._fetchFilesFromFolder(u(this, fe)));
|
|
4264
|
+
}), this._updateSelectedImageListContainerUI(), e.appendChild(u(this, B)), e;
|
|
4165
4265
|
}
|
|
4166
4266
|
_renderFetchingSkeletonUI() {
|
|
4167
|
-
for (let e = 0; e <
|
|
4168
|
-
const t =
|
|
4169
|
-
t.innerHTML = "", u(this,
|
|
4267
|
+
for (let e = 0; e < 6; e++) {
|
|
4268
|
+
const t = F("skeleton");
|
|
4269
|
+
t.innerHTML = "", u(this, B).append(t);
|
|
4170
4270
|
}
|
|
4171
4271
|
}
|
|
4172
4272
|
_renderEmptyImageContainer() {
|
|
4173
|
-
if (u(this,
|
|
4174
|
-
const e =
|
|
4175
|
-
|
|
4273
|
+
if (u(this, K) || u(this, de)) return;
|
|
4274
|
+
const e = F(), t = document.createElement("p");
|
|
4275
|
+
u(this, se) && u(this, pe) === 0 ? t.textContent = "No Result Found!" : t.textContent = "Looks Empty!", e.appendChild(t), u(this, B).appendChild(e);
|
|
4176
4276
|
}
|
|
4177
4277
|
_renderLoadingUI() {
|
|
4178
|
-
const e =
|
|
4179
|
-
e.innerHTML = "", u(this,
|
|
4278
|
+
const e = F("skeleton");
|
|
4279
|
+
e.innerHTML = "", u(this, B).appendChild(e);
|
|
4180
4280
|
}
|
|
4181
4281
|
_fileCardBody(e) {
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4282
|
+
const t = F("selected-image-content"), n = F("selected-image-top-bar"), r = Be(
|
|
4283
|
+
"",
|
|
4284
|
+
"selected-image-btn",
|
|
4285
|
+
"",
|
|
4286
|
+
!1,
|
|
4287
|
+
'<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>'
|
|
4288
|
+
);
|
|
4289
|
+
let s, o;
|
|
4290
|
+
(e == null ? void 0 : e.type) === ce.IMAGE && (s = tn(e == null ? void 0 : e.url, "selected-image"), o = Ri()), (e == null ? void 0 : e.type) === ce.VIDEO && (s = nn(e == null ? void 0 : e.url, "uploaded-video"), o = Di()), (e == null ? void 0 : e.type) === ce.AUDIO && (s = rn(e == null ? void 0 : e.url, "uploaded-audio"), o = $i());
|
|
4291
|
+
const a = F(
|
|
4187
4292
|
"selected-image-wrapper",
|
|
4188
4293
|
"selected-image-wrapper"
|
|
4189
|
-
),
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
` ${(y = e == null ? void 0 : e.metadata) == null ? void 0 : y.width} *
|
|
4196
|
-
${(O = e == null ? void 0 : e.metadata) == null ? void 0 : O.height}`,
|
|
4197
|
-
"selected-image-size"
|
|
4294
|
+
), l = Oe(e == null ? void 0 : e.name, "selected-image-name"), c = Ye("", "selected-image-type");
|
|
4295
|
+
c.append(o), n.append(c, r);
|
|
4296
|
+
const d = F();
|
|
4297
|
+
d.style.marginTop = "10px", d.style.display = "flex", d.style.justifyContent = "space-between", d.style.alignItems = "center", d.append(l), t.append(n, s), a.append(t, d);
|
|
4298
|
+
const g = u(this, x).findIndex(
|
|
4299
|
+
(w) => (w == null ? void 0 : w.key) === (e == null ? void 0 : e.key)
|
|
4198
4300
|
);
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
l,
|
|
4202
|
-
((F = e == null ? void 0 : e.metadata) == null ? void 0 : F.width) > 0 && ((q = e == null ? void 0 : e.metadata) == null ? void 0 : q.height) > 0 ? c : "",
|
|
4203
|
-
n
|
|
4204
|
-
), (A = u(this, L)) != null && A.includes(e) && t.classList.add("checked"), u(this, x).appendChild(s);
|
|
4205
|
-
const d = u(this, L).findIndex(
|
|
4206
|
-
(_) => (_ == null ? void 0 : _.key) === (e == null ? void 0 : e.key)
|
|
4207
|
-
), g = u(this, v).findIndex(
|
|
4208
|
-
(_) => (_ == null ? void 0 : _.key) === (e == null ? void 0 : e.key)
|
|
4301
|
+
u(this, R).findIndex(
|
|
4302
|
+
(w) => (w == null ? void 0 : w.key) === (e == null ? void 0 : e.key)
|
|
4209
4303
|
);
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4304
|
+
const N = F("image-action-wrapper"), L = F("file-action edit"), O = Ye("Edit", ""), J = Mi();
|
|
4305
|
+
L.append(J, O);
|
|
4306
|
+
const T = F("file-action delete"), $ = Ye("Delete", ""), W = Vi();
|
|
4307
|
+
T.append(W, $), N.append(L, T);
|
|
4308
|
+
const Z = F("");
|
|
4309
|
+
Z.appendChild(N), r.addEventListener("click", (w) => {
|
|
4310
|
+
w.stopPropagation();
|
|
4311
|
+
const b = document.querySelector(`#${e.key}`);
|
|
4312
|
+
u(this, be) === e.key && b !== null ? (We.hide(), m(this, be, null)) : (We.hide(), We.show({
|
|
4313
|
+
content: Z,
|
|
4314
|
+
mainContainer: n,
|
|
4315
|
+
divId: e.key
|
|
4316
|
+
}), m(this, be, e.key));
|
|
4317
|
+
}), document.addEventListener("click", (w) => {
|
|
4318
|
+
const b = document.querySelector(`#${u(this, be)}`);
|
|
4319
|
+
b && (w.composedPath().includes(b) || We.hide());
|
|
4320
|
+
}), s.addEventListener("click", () => {
|
|
4321
|
+
t.classList.contains("checked") ? (t.classList.remove("checked"), g !== -1 && (u(this, x).splice(g, 1), u(this, pe) === 1 && a.remove())) : (t.classList.add("checked"), u(this, x).push(e)), this._updateSelectedImageListContainerUI();
|
|
4322
|
+
}), g !== -1 ? (t.classList.add("checked"), u(this, se) ? u(this, B).prepend(a) : u(this, B).appendChild(a)) : u(this, B).appendChild(a);
|
|
4215
4323
|
}
|
|
4216
4324
|
_renderImageCard(e) {
|
|
4217
4325
|
this._fileCardBody(e);
|
|
4218
4326
|
}
|
|
4219
4327
|
_renderImageListContainer() {
|
|
4220
4328
|
var e, t;
|
|
4221
|
-
((e = u(this,
|
|
4329
|
+
((e = u(this, R)) == null ? void 0 : e.length) > 0 && ((t = u(this, R)) == null || t.forEach((n) => {
|
|
4222
4330
|
this._renderImageCard(n);
|
|
4223
4331
|
}));
|
|
4224
4332
|
}
|
|
4225
4333
|
_renderSelectedImageListContainer() {
|
|
4226
4334
|
var e;
|
|
4227
|
-
((e = u(this,
|
|
4335
|
+
((e = u(this, x)) == null ? void 0 : e.length) > 0 && u(this, x).forEach((t) => {
|
|
4228
4336
|
this._renderImageCard(t);
|
|
4229
4337
|
});
|
|
4230
4338
|
}
|
|
@@ -4232,7 +4340,7 @@ class _r {
|
|
|
4232
4340
|
const e = document.createElement("div");
|
|
4233
4341
|
e.style.paddingInline = "20px";
|
|
4234
4342
|
for (let t = 0; t < 4; t++) {
|
|
4235
|
-
const n =
|
|
4343
|
+
const n = F("skeleton");
|
|
4236
4344
|
n.className = "skeleton folder", n.innerHTML = "", e.appendChild(n);
|
|
4237
4345
|
}
|
|
4238
4346
|
return e;
|
|
@@ -4243,10 +4351,10 @@ class _r {
|
|
|
4243
4351
|
t.className = "folder";
|
|
4244
4352
|
const n = document.createElement("div");
|
|
4245
4353
|
n.style.display = "flex", n.style.alignItems = "center", n.style.gap = "10px";
|
|
4246
|
-
const
|
|
4247
|
-
if (s.textContent = e == null ? void 0 : e.name,
|
|
4354
|
+
const r = document.createElement("span"), s = document.createElement("span");
|
|
4355
|
+
if (s.className = "folder-name", s.textContent = e == null ? void 0 : e.name, r.appendChild(Oi()), n.append(r, s), t.appendChild(n), e.children && Object.keys(e.children).length > 0) {
|
|
4248
4356
|
const a = document.createElement("button");
|
|
4249
|
-
a.classList.add("expand-icon"), a.appendChild(
|
|
4357
|
+
a.classList.add("expand-icon"), a.appendChild(Bi()), n.append(a);
|
|
4250
4358
|
const l = document.createElement("ul");
|
|
4251
4359
|
l.className = "folders nested", t.appendChild(l), a.addEventListener("click", (c) => {
|
|
4252
4360
|
c.stopPropagation(), t.classList.toggle("active"), l.classList.toggle("visible");
|
|
@@ -4257,103 +4365,119 @@ class _r {
|
|
|
4257
4365
|
}
|
|
4258
4366
|
return t.addEventListener("click", (a) => {
|
|
4259
4367
|
var l;
|
|
4260
|
-
a.stopPropagation(),
|
|
4261
|
-
}), ((o = u(this,
|
|
4368
|
+
a.stopPropagation(), m(this, ie, e), m(this, fe, e == null ? void 0 : e.name), m(this, x, []), m(this, R, []), m(this, z, ""), m(this, we, !1), (l = document.querySelector(".folder.selected")) == null || l.classList.remove("selected"), t.classList.add("selected"), this._fetchFilesFromFolder(e.name);
|
|
4369
|
+
}), ((o = u(this, ie)) == null ? void 0 : o.key) === (e == null ? void 0 : e.key) && t.classList.add("selected"), t;
|
|
4262
4370
|
}
|
|
4263
4371
|
_updateFolderListContainer() {
|
|
4264
|
-
if (u(this,
|
|
4265
|
-
if (u(this,
|
|
4372
|
+
if (u(this, ge))
|
|
4373
|
+
if (u(this, re).innerHTML = "", u(this, ke)) {
|
|
4266
4374
|
const e = this._renderFolderListLoadingUI();
|
|
4267
|
-
u(this,
|
|
4375
|
+
u(this, re).appendChild(e);
|
|
4268
4376
|
} else {
|
|
4269
4377
|
const e = document.createElement("ul");
|
|
4270
|
-
e.className = "folders", u(this,
|
|
4378
|
+
e.className = "folders", u(this, re).appendChild(e), u(this, Ee).forEach((t) => {
|
|
4271
4379
|
const n = this._renderFolderListContainer(t);
|
|
4272
4380
|
e.appendChild(n);
|
|
4273
|
-
}), u(this,
|
|
4381
|
+
}), u(this, ge).appendChild(u(this, re));
|
|
4274
4382
|
}
|
|
4275
4383
|
}
|
|
4276
4384
|
_renderToastContainer(e, t) {
|
|
4277
|
-
this._removeToastContainer(),
|
|
4278
|
-
const n =
|
|
4279
|
-
G.style.cursor = "pointer", G.setAttribute("fill", t === "error" ? "#ee3f3f" : "#4caf50"), G.onclick = () => this._removeToastContainer(), u(this, Y).append(
|
|
4385
|
+
this._removeToastContainer(), m(this, Y, document.createElement("div")), u(this, Y).className = `message-container ${t}`;
|
|
4386
|
+
const n = Oe(e, "message"), r = t === "success" ? j : V;
|
|
4387
|
+
G.style.cursor = "pointer", G.setAttribute("fill", t === "error" ? "#ee3f3f" : "#4caf50"), G.onclick = () => this._removeToastContainer(), u(this, Y).append(r, n, G), u(this, Ne).appendChild(u(this, Y)), setTimeout(() => {
|
|
4280
4388
|
this._removeToastContainer();
|
|
4281
4389
|
}, 5e3);
|
|
4282
4390
|
}
|
|
4283
4391
|
_removeToastContainer() {
|
|
4284
|
-
u(this, Y) && (u(this, Y).remove(),
|
|
4392
|
+
u(this, Y) && (u(this, Y).remove(), m(this, Y, null));
|
|
4285
4393
|
}
|
|
4286
4394
|
_updateSelectedImageListContainerUI() {
|
|
4287
|
-
var t, n
|
|
4288
|
-
if (!u(this,
|
|
4289
|
-
u(this,
|
|
4395
|
+
var t, n;
|
|
4396
|
+
if (!u(this, B)) return;
|
|
4397
|
+
u(this, B).innerHTML = "", u(this, K) && this._renderFetchingSkeletonUI(), u(this, de) && this._renderLoadingUI();
|
|
4398
|
+
const e = document.getElementById(
|
|
4399
|
+
"search-input-wrapper"
|
|
4400
|
+
);
|
|
4401
|
+
u(this, pe) === 0 ? (e && (e.style.visibility = "visible"), ((t = u(this, R)) == null ? void 0 : t.length) === 0 ? (u(this, B).classList.add(
|
|
4402
|
+
"no-selected-image-container"
|
|
4403
|
+
), this._renderEmptyImageContainer()) : (u(this, B).classList.remove(
|
|
4404
|
+
"no-selected-image-container"
|
|
4405
|
+
), this._renderImageListContainer())) : (e && (e.style.visibility = "hidden"), ((n = u(this, x)) == null ? void 0 : n.length) === 0 ? (u(this, B).classList.add(
|
|
4406
|
+
"no-selected-image-container"
|
|
4407
|
+
), this._renderEmptyImageContainer()) : (u(this, B).classList.remove(
|
|
4290
4408
|
"no-selected-image-container"
|
|
4291
|
-
),
|
|
4409
|
+
), this._renderSelectedImageListContainer())), this._updateContent();
|
|
4292
4410
|
}
|
|
4293
4411
|
_updateContent() {
|
|
4294
|
-
var t, n,
|
|
4412
|
+
var t, n, r;
|
|
4295
4413
|
const e = document.getElementById("selected-images-tab");
|
|
4296
|
-
e && (e.textContent = `Selected (${(t = u(this,
|
|
4414
|
+
e && (e.textContent = `Selected (${(t = u(this, x)) == null ? void 0 : t.length})`), u(this, me).textContent = `Save (${(n = u(this, x)) == null ? void 0 : n.length})`, u(this, me).disabled = ((r = u(this, x)) == null ? void 0 : r.length) <= 0;
|
|
4297
4415
|
}
|
|
4298
4416
|
async _uploadAndAddSelectedImageList(e, t) {
|
|
4299
|
-
var n,
|
|
4300
|
-
|
|
4417
|
+
var n, r;
|
|
4418
|
+
m(this, de, !0), this._updateSelectedImageListContainerUI();
|
|
4301
4419
|
try {
|
|
4302
|
-
const s = await
|
|
4420
|
+
const s = await Ni(e, t), o = await Ai(
|
|
4303
4421
|
t == null ? void 0 : t.name,
|
|
4304
4422
|
"",
|
|
4305
4423
|
s,
|
|
4306
|
-
|
|
4307
|
-
(
|
|
4308
|
-
u(this,
|
|
4424
|
+
ce[Li((n = t.type) == null ? void 0 : n.split("/")[0])],
|
|
4425
|
+
(r = u(this, ie)) == null ? void 0 : r.name,
|
|
4426
|
+
u(this, oe)
|
|
4309
4427
|
);
|
|
4310
|
-
u(this,
|
|
4428
|
+
u(this, R).unshift(o == null ? void 0 : o.response), this._renderToastContainer("File Uploaded Successfully", "success");
|
|
4311
4429
|
} catch {
|
|
4312
4430
|
this._renderToastContainer(
|
|
4313
4431
|
"Something went wrong while uploading file. Please try again later.",
|
|
4314
4432
|
"error"
|
|
4315
4433
|
);
|
|
4316
4434
|
} finally {
|
|
4317
|
-
|
|
4435
|
+
m(this, de, !1), this._updateSelectedImageListContainerUI();
|
|
4318
4436
|
}
|
|
4319
4437
|
}
|
|
4320
4438
|
async _createFolder(e, t = 2) {
|
|
4321
|
-
var n
|
|
4439
|
+
var n;
|
|
4322
4440
|
try {
|
|
4323
|
-
const
|
|
4441
|
+
const r = await Ii(
|
|
4324
4442
|
e,
|
|
4325
|
-
(n = u(this,
|
|
4443
|
+
(n = u(this, ie)) == null ? void 0 : n.name,
|
|
4326
4444
|
"",
|
|
4327
|
-
u(this,
|
|
4445
|
+
u(this, oe)
|
|
4328
4446
|
);
|
|
4329
|
-
(
|
|
4447
|
+
m(this, x, []), m(this, R, []);
|
|
4448
|
+
const s = vi(u(this, Ee), r == null ? void 0 : r.response);
|
|
4449
|
+
m(this, Ee, s), m(this, fe, e), m(this, ie, { ...r == null ? void 0 : r.response, children: {} }), this._fetchFilesFromFolder(e), this._renderToastContainer(
|
|
4330
4450
|
`Folder ${e} created successfully`,
|
|
4331
4451
|
"success"
|
|
4332
4452
|
);
|
|
4333
|
-
} catch {
|
|
4334
|
-
if (t > 1)
|
|
4453
|
+
} catch (r) {
|
|
4454
|
+
if (console.log("ERROR", r), t > 1)
|
|
4335
4455
|
this._createFolder(e, --t);
|
|
4336
4456
|
else
|
|
4337
4457
|
throw this._renderToastContainer(
|
|
4338
|
-
|
|
4458
|
+
`Error creating folder "${e}". Either folder already exist or failed to create folder`,
|
|
4339
4459
|
"error"
|
|
4340
|
-
), new Error(
|
|
4460
|
+
), new Error(
|
|
4461
|
+
`Error creating folder "${e}". Either folder already exist or failed to create folder`
|
|
4462
|
+
);
|
|
4463
|
+
} finally {
|
|
4464
|
+
this._updateFolderListContainer();
|
|
4341
4465
|
}
|
|
4342
4466
|
}
|
|
4343
4467
|
async _upload() {
|
|
4344
|
-
return u(this,
|
|
4468
|
+
return u(this, x);
|
|
4345
4469
|
}
|
|
4346
4470
|
async _fetchFilesFromFolder(e) {
|
|
4347
|
-
var t, n,
|
|
4348
|
-
|
|
4471
|
+
var t, n, r;
|
|
4472
|
+
m(this, K, !0), this._updateSelectedImageListContainerUI();
|
|
4349
4473
|
try {
|
|
4350
|
-
const s = await
|
|
4474
|
+
const s = await Ti(
|
|
4351
4475
|
e,
|
|
4352
|
-
u(this,
|
|
4353
|
-
|
|
4354
|
-
u(this,
|
|
4476
|
+
u(this, z),
|
|
4477
|
+
20,
|
|
4478
|
+
u(this, oe)
|
|
4355
4479
|
), o = (t = s.response) == null ? void 0 : t.files;
|
|
4356
|
-
u(this,
|
|
4480
|
+
u(this, R).push(...o), m(this, z, (n = s.response) == null ? void 0 : n.nextCursor), m(this, we, (r = s.response) == null ? void 0 : r.hasMore);
|
|
4357
4481
|
} catch {
|
|
4358
4482
|
throw this._renderToastContainer(
|
|
4359
4483
|
"Error while fetching files from folder" + e,
|
|
@@ -4362,44 +4486,49 @@ class _r {
|
|
|
4362
4486
|
"Something went wrong. Error while fetching files from folder" + e
|
|
4363
4487
|
);
|
|
4364
4488
|
} finally {
|
|
4365
|
-
|
|
4489
|
+
m(this, K, !1), this._updateSelectedImageListContainerUI();
|
|
4366
4490
|
}
|
|
4367
4491
|
}
|
|
4368
4492
|
async _fetchAllFolders() {
|
|
4369
4493
|
var e, t;
|
|
4370
|
-
|
|
4494
|
+
m(this, K, !0), m(this, ke, !0), this._updateSelectedImageListContainerUI(), this._updateFolderListContainer(), this._removeToastContainer();
|
|
4371
4495
|
try {
|
|
4372
|
-
const
|
|
4373
|
-
|
|
4496
|
+
const r = (await Ei("", 100, u(this, oe))).response.folder, s = Ci(r);
|
|
4497
|
+
m(this, fe, (e = s[0]) == null ? void 0 : e.name), this._fetchFilesFromFolder((t = s[0]) == null ? void 0 : t.name), m(this, ie, s[0]), m(this, Ee, s);
|
|
4374
4498
|
} catch {
|
|
4375
|
-
|
|
4499
|
+
m(this, K, !1), this._renderToastContainer(
|
|
4376
4500
|
"Folder not found. Please create a folder or try again later",
|
|
4377
4501
|
"error"
|
|
4378
4502
|
);
|
|
4379
4503
|
} finally {
|
|
4380
|
-
|
|
4504
|
+
m(this, ke, !1), this._updateFolderListContainer();
|
|
4381
4505
|
}
|
|
4382
4506
|
}
|
|
4383
4507
|
async _search(e) {
|
|
4384
4508
|
var t, n;
|
|
4385
|
-
|
|
4509
|
+
m(this, K, !0), this._updateSelectedImageListContainerUI(), this._removeToastContainer();
|
|
4386
4510
|
try {
|
|
4387
|
-
const
|
|
4388
|
-
|
|
4511
|
+
const r = await Fi(
|
|
4512
|
+
e,
|
|
4513
|
+
u(this, z),
|
|
4514
|
+
10,
|
|
4515
|
+
u(this, oe)
|
|
4516
|
+
), s = (t = r.response) == null ? void 0 : t.items;
|
|
4517
|
+
u(this, R).push(...s), m(this, z, (n = r.response) == null ? void 0 : n.nextPageCursor);
|
|
4389
4518
|
} catch {
|
|
4390
4519
|
this._renderToastContainer("Error while searching files", "error");
|
|
4391
4520
|
} finally {
|
|
4392
|
-
|
|
4521
|
+
m(this, K, !1), this._updateSelectedImageListContainerUI();
|
|
4393
4522
|
}
|
|
4394
4523
|
}
|
|
4395
4524
|
_createFolderPrompt(e) {
|
|
4396
4525
|
e.addEventListener("click", () => {
|
|
4397
4526
|
const t = window.prompt("Please enter the folder name.");
|
|
4398
|
-
t &&
|
|
4527
|
+
t && this._createFolder(t);
|
|
4399
4528
|
});
|
|
4400
4529
|
}
|
|
4401
4530
|
}
|
|
4402
|
-
|
|
4531
|
+
ye = new WeakMap(), Ne = new WeakMap(), B = new WeakMap(), ne = new WeakMap(), x = new WeakMap(), R = new WeakMap(), de = new WeakMap(), K = new WeakMap(), ke = new WeakMap(), fe = new WeakMap(), Ee = new WeakMap(), ie = new WeakMap(), me = new WeakMap(), ve = new WeakMap(), pe = new WeakMap(), ge = new WeakMap(), re = new WeakMap(), Ie = new WeakMap(), Y = new WeakMap(), z = new WeakMap(), we = new WeakMap(), Ae = new WeakMap(), se = new WeakMap(), Le = new WeakMap(), _e = new WeakMap(), oe = new WeakMap(), be = new WeakMap();
|
|
4403
4532
|
export {
|
|
4404
|
-
|
|
4533
|
+
ji as default
|
|
4405
4534
|
};
|