@civet/core 1.4.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js ADDED
@@ -0,0 +1,1473 @@
1
+ import { createContext as xe, useContext as Ae, useMemo as se, useReducer as qe, useState as Pe, useEffect as de, useCallback as Le } from "react";
2
+ import { jsx as ue } from "react/jsx-runtime";
3
+ const ae = xe({});
4
+ ae.displayName = "ConfigContext";
5
+ const Ze = ae.Consumer, Ue = () => Ae(ae), fe = xe({
6
+ data: [],
7
+ notify: () => Promise.reject(new Error("Missing context provider"))
8
+ });
9
+ fe.displayName = "ResourceContext";
10
+ const et = fe.Consumer, tt = () => Ae(fe);
11
+ class Be {
12
+ listeners = /* @__PURE__ */ new Set();
13
+ subscribe = (s) => {
14
+ if (typeof s != "function")
15
+ throw new Error("Callback must be a function");
16
+ return this.listeners.add(s), () => {
17
+ this.listeners.delete(s);
18
+ };
19
+ };
20
+ isSubscribed = (s) => this.listeners.has(s);
21
+ trigger = (...s) => {
22
+ this.listeners.forEach((u) => u(...s));
23
+ };
24
+ }
25
+ class je {
26
+ notifier = new Be();
27
+ locked = !1;
28
+ aborted = !1;
29
+ constructor() {
30
+ Object.defineProperties(this, {
31
+ locked: {
32
+ value: !1,
33
+ enumerable: !0,
34
+ writable: !1,
35
+ configurable: !0
36
+ },
37
+ aborted: {
38
+ value: !1,
39
+ enumerable: !0,
40
+ writable: !1,
41
+ configurable: !0
42
+ }
43
+ });
44
+ }
45
+ listen = (s) => {
46
+ if (this.locked) return () => {
47
+ };
48
+ const u = this.notifier.isSubscribed(s), p = this.notifier.subscribe(s);
49
+ return this.aborted && !u && s(), p;
50
+ };
51
+ abort = () => {
52
+ this.locked || (this.lock(), Object.defineProperty(this, "aborted", {
53
+ value: !0,
54
+ enumerable: !0,
55
+ writable: !1,
56
+ configurable: !1
57
+ }), this.notifier.trigger());
58
+ };
59
+ lock = () => {
60
+ this.locked || Object.defineProperty(this, "locked", {
61
+ value: !0,
62
+ enumerable: !0,
63
+ writable: !1,
64
+ configurable: !1
65
+ });
66
+ };
67
+ proxy = () => {
68
+ const s = this;
69
+ return {
70
+ listen(u) {
71
+ return s.listen(u);
72
+ },
73
+ get locked() {
74
+ return s.locked;
75
+ },
76
+ get aborted() {
77
+ return s.aborted;
78
+ }
79
+ };
80
+ };
81
+ }
82
+ class ke {
83
+ channels = {};
84
+ subscribe = (s, u) => {
85
+ if (s == null || !`${s}`)
86
+ throw new Error("Channel is required");
87
+ return this.channels[s] == null && (this.channels[s] = new Be()), this.channels[s].subscribe(u);
88
+ };
89
+ isSubscribed = (s, u) => {
90
+ if (s == null || !`${s}`)
91
+ throw new Error("Channel is required");
92
+ return this.channels[s] != null && this.channels[s].isSubscribed(u);
93
+ };
94
+ trigger = (s, ...u) => {
95
+ s == null ? Object.values(this.channels).forEach(
96
+ (p) => p.trigger(...u)
97
+ ) : this.channels[s] != null && this.channels[s].trigger(...u);
98
+ };
99
+ }
100
+ function rt(...h) {
101
+ return h.length === 0 ? (s) => s : h.length === 1 ? h[0] : h.reduce((s, u) => (p) => s(u(p)));
102
+ }
103
+ function Ce(h) {
104
+ return h && h.__esModule && Object.prototype.hasOwnProperty.call(h, "default") ? h.default : h;
105
+ }
106
+ var he, Ee;
107
+ function De() {
108
+ return Ee || (Ee = 1, he = function h(s, u) {
109
+ if (s === u) return !0;
110
+ if (s && u && typeof s == "object" && typeof u == "object") {
111
+ if (s.constructor !== u.constructor) return !1;
112
+ var p, y, g;
113
+ if (Array.isArray(s)) {
114
+ if (p = s.length, p != u.length) return !1;
115
+ for (y = p; y-- !== 0; )
116
+ if (!h(s[y], u[y])) return !1;
117
+ return !0;
118
+ }
119
+ if (s.constructor === RegExp) return s.source === u.source && s.flags === u.flags;
120
+ if (s.valueOf !== Object.prototype.valueOf) return s.valueOf() === u.valueOf();
121
+ if (s.toString !== Object.prototype.toString) return s.toString() === u.toString();
122
+ if (g = Object.keys(s), p = g.length, p !== Object.keys(u).length) return !1;
123
+ for (y = p; y-- !== 0; )
124
+ if (!Object.prototype.hasOwnProperty.call(u, g[y])) return !1;
125
+ for (y = p; y-- !== 0; ) {
126
+ var B = g[y];
127
+ if (!h(s[B], u[B])) return !1;
128
+ }
129
+ return !0;
130
+ }
131
+ return s !== s && u !== u;
132
+ }), he;
133
+ }
134
+ var Oe = De();
135
+ const Re = /* @__PURE__ */ Ce(Oe);
136
+ function ie(h) {
137
+ throw new Error('Could not dynamically require "' + h + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
138
+ }
139
+ var pe = { exports: {} }, Ie;
140
+ function Ne() {
141
+ return Ie || (Ie = 1, (function(h, s) {
142
+ (function(u) {
143
+ h.exports = u();
144
+ })(function() {
145
+ return (function u(p, y, g) {
146
+ function B(q, M) {
147
+ if (!y[q]) {
148
+ if (!p[q]) {
149
+ var N = typeof ie == "function" && ie;
150
+ if (!M && N) return N(q, !0);
151
+ if (k) return k(q, !0);
152
+ throw new Error("Cannot find module '" + q + "'");
153
+ }
154
+ M = y[q] = { exports: {} }, p[q][0].call(M.exports, function(R) {
155
+ var T = p[q][1][R];
156
+ return B(T || R);
157
+ }, M, M.exports, u, p, y, g);
158
+ }
159
+ return y[q].exports;
160
+ }
161
+ for (var k = typeof ie == "function" && ie, D = 0; D < g.length; D++) B(g[D]);
162
+ return B;
163
+ })({ 1: [function(u, p, y) {
164
+ (function(g, B, k, D, q, M, N, R, T) {
165
+ var E = u("crypto");
166
+ function C(a, d) {
167
+ d = A(a, d);
168
+ var r;
169
+ return (r = d.algorithm !== "passthrough" ? E.createHash(d.algorithm) : new S()).write === void 0 && (r.write = r.update, r.end = r.update), v(d, r).dispatch(a), r.update || r.end(""), r.digest ? r.digest(d.encoding === "buffer" ? void 0 : d.encoding) : (a = r.read(), d.encoding !== "buffer" ? a.toString(d.encoding) : a);
170
+ }
171
+ (y = p.exports = C).sha1 = function(a) {
172
+ return C(a);
173
+ }, y.keys = function(a) {
174
+ return C(a, { excludeValues: !0, algorithm: "sha1", encoding: "hex" });
175
+ }, y.MD5 = function(a) {
176
+ return C(a, { algorithm: "md5", encoding: "hex" });
177
+ }, y.keysMD5 = function(a) {
178
+ return C(a, { algorithm: "md5", encoding: "hex", excludeValues: !0 });
179
+ };
180
+ var c = E.getHashes ? E.getHashes().slice() : ["sha1", "md5"], b = (c.push("passthrough"), ["buffer", "hex", "binary", "base64"]);
181
+ function A(a, d) {
182
+ var r = {};
183
+ if (r.algorithm = (d = d || {}).algorithm || "sha1", r.encoding = d.encoding || "hex", r.excludeValues = !!d.excludeValues, r.algorithm = r.algorithm.toLowerCase(), r.encoding = r.encoding.toLowerCase(), r.ignoreUnknown = d.ignoreUnknown === !0, r.respectType = d.respectType !== !1, r.respectFunctionNames = d.respectFunctionNames !== !1, r.respectFunctionProperties = d.respectFunctionProperties !== !1, r.unorderedArrays = d.unorderedArrays === !0, r.unorderedSets = d.unorderedSets !== !1, r.unorderedObjects = d.unorderedObjects !== !1, r.replacer = d.replacer || void 0, r.excludeKeys = d.excludeKeys || void 0, a === void 0) throw new Error("Object argument required.");
184
+ for (var o = 0; o < c.length; ++o) c[o].toLowerCase() === r.algorithm.toLowerCase() && (r.algorithm = c[o]);
185
+ if (c.indexOf(r.algorithm) === -1) throw new Error('Algorithm "' + r.algorithm + '" not supported. supported values: ' + c.join(", "));
186
+ if (b.indexOf(r.encoding) === -1 && r.algorithm !== "passthrough") throw new Error('Encoding "' + r.encoding + '" not supported. supported values: ' + b.join(", "));
187
+ return r;
188
+ }
189
+ function _(a) {
190
+ if (typeof a == "function") return /^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(a)) != null;
191
+ }
192
+ function v(a, d, r) {
193
+ r = r || [];
194
+ function o(t) {
195
+ return d.update ? d.update(t, "utf8") : d.write(t, "utf8");
196
+ }
197
+ return { dispatch: function(t) {
198
+ return this["_" + ((t = a.replacer ? a.replacer(t) : t) === null ? "null" : typeof t)](t);
199
+ }, _object: function(t) {
200
+ var f, l = Object.prototype.toString.call(t), P = /\[object (.*)\]/i.exec(l);
201
+ if (P = (P = P ? P[1] : "unknown:[" + l + "]").toLowerCase(), 0 <= (l = r.indexOf(t))) return this.dispatch("[CIRCULAR:" + l + "]");
202
+ if (r.push(t), k !== void 0 && k.isBuffer && k.isBuffer(t)) return o("buffer:"), o(t);
203
+ if (P === "object" || P === "function" || P === "asyncfunction") return l = Object.keys(t), a.unorderedObjects && (l = l.sort()), a.respectType === !1 || _(t) || l.splice(0, 0, "prototype", "__proto__", "constructor"), a.excludeKeys && (l = l.filter(function(L) {
204
+ return !a.excludeKeys(L);
205
+ })), o("object:" + l.length + ":"), f = this, l.forEach(function(L) {
206
+ f.dispatch(L), o(":"), a.excludeValues || f.dispatch(t[L]), o(",");
207
+ });
208
+ if (!this["_" + P]) {
209
+ if (a.ignoreUnknown) return o("[" + P + "]");
210
+ throw new Error('Unknown object type "' + P + '"');
211
+ }
212
+ this["_" + P](t);
213
+ }, _array: function(t, L) {
214
+ L = L !== void 0 ? L : a.unorderedArrays !== !1;
215
+ var l = this;
216
+ if (o("array:" + t.length + ":"), !L || t.length <= 1) return t.forEach(function(U) {
217
+ return l.dispatch(U);
218
+ });
219
+ var P = [], L = t.map(function(U) {
220
+ var j = new S(), Y = r.slice();
221
+ return v(a, j, Y).dispatch(U), P = P.concat(Y.slice(r.length)), j.read().toString();
222
+ });
223
+ return r = r.concat(P), L.sort(), this._array(L, !1);
224
+ }, _date: function(t) {
225
+ return o("date:" + t.toJSON());
226
+ }, _symbol: function(t) {
227
+ return o("symbol:" + t.toString());
228
+ }, _error: function(t) {
229
+ return o("error:" + t.toString());
230
+ }, _boolean: function(t) {
231
+ return o("bool:" + t.toString());
232
+ }, _string: function(t) {
233
+ o("string:" + t.length + ":"), o(t.toString());
234
+ }, _function: function(t) {
235
+ o("fn:"), _(t) ? this.dispatch("[native]") : this.dispatch(t.toString()), a.respectFunctionNames !== !1 && this.dispatch("function-name:" + String(t.name)), a.respectFunctionProperties && this._object(t);
236
+ }, _number: function(t) {
237
+ return o("number:" + t.toString());
238
+ }, _xml: function(t) {
239
+ return o("xml:" + t.toString());
240
+ }, _null: function() {
241
+ return o("Null");
242
+ }, _undefined: function() {
243
+ return o("Undefined");
244
+ }, _regexp: function(t) {
245
+ return o("regex:" + t.toString());
246
+ }, _uint8array: function(t) {
247
+ return o("uint8array:"), this.dispatch(Array.prototype.slice.call(t));
248
+ }, _uint8clampedarray: function(t) {
249
+ return o("uint8clampedarray:"), this.dispatch(Array.prototype.slice.call(t));
250
+ }, _int8array: function(t) {
251
+ return o("int8array:"), this.dispatch(Array.prototype.slice.call(t));
252
+ }, _uint16array: function(t) {
253
+ return o("uint16array:"), this.dispatch(Array.prototype.slice.call(t));
254
+ }, _int16array: function(t) {
255
+ return o("int16array:"), this.dispatch(Array.prototype.slice.call(t));
256
+ }, _uint32array: function(t) {
257
+ return o("uint32array:"), this.dispatch(Array.prototype.slice.call(t));
258
+ }, _int32array: function(t) {
259
+ return o("int32array:"), this.dispatch(Array.prototype.slice.call(t));
260
+ }, _float32array: function(t) {
261
+ return o("float32array:"), this.dispatch(Array.prototype.slice.call(t));
262
+ }, _float64array: function(t) {
263
+ return o("float64array:"), this.dispatch(Array.prototype.slice.call(t));
264
+ }, _arraybuffer: function(t) {
265
+ return o("arraybuffer:"), this.dispatch(new Uint8Array(t));
266
+ }, _url: function(t) {
267
+ return o("url:" + t.toString());
268
+ }, _map: function(t) {
269
+ return o("map:"), t = Array.from(t), this._array(t, a.unorderedSets !== !1);
270
+ }, _set: function(t) {
271
+ return o("set:"), t = Array.from(t), this._array(t, a.unorderedSets !== !1);
272
+ }, _file: function(t) {
273
+ return o("file:"), this.dispatch([t.name, t.size, t.type, t.lastModfied]);
274
+ }, _blob: function() {
275
+ if (a.ignoreUnknown) return o("[blob]");
276
+ throw Error(`Hashing Blob objects is currently not supported
277
+ (see https://github.com/puleos/object-hash/issues/26)
278
+ Use "options.replacer" or "options.ignoreUnknown"
279
+ `);
280
+ }, _domwindow: function() {
281
+ return o("domwindow");
282
+ }, _bigint: function(t) {
283
+ return o("bigint:" + t.toString());
284
+ }, _process: function() {
285
+ return o("process");
286
+ }, _timer: function() {
287
+ return o("timer");
288
+ }, _pipe: function() {
289
+ return o("pipe");
290
+ }, _tcp: function() {
291
+ return o("tcp");
292
+ }, _udp: function() {
293
+ return o("udp");
294
+ }, _tty: function() {
295
+ return o("tty");
296
+ }, _statwatcher: function() {
297
+ return o("statwatcher");
298
+ }, _securecontext: function() {
299
+ return o("securecontext");
300
+ }, _connection: function() {
301
+ return o("connection");
302
+ }, _zlib: function() {
303
+ return o("zlib");
304
+ }, _context: function() {
305
+ return o("context");
306
+ }, _nodescript: function() {
307
+ return o("nodescript");
308
+ }, _httpparser: function() {
309
+ return o("httpparser");
310
+ }, _dataview: function() {
311
+ return o("dataview");
312
+ }, _signal: function() {
313
+ return o("signal");
314
+ }, _fsevent: function() {
315
+ return o("fsevent");
316
+ }, _tlswrap: function() {
317
+ return o("tlswrap");
318
+ } };
319
+ }
320
+ function S() {
321
+ return { buf: "", write: function(a) {
322
+ this.buf += a;
323
+ }, end: function(a) {
324
+ this.buf += a;
325
+ }, read: function() {
326
+ return this.buf;
327
+ } };
328
+ }
329
+ y.writeToStream = function(a, d, r) {
330
+ return r === void 0 && (r = d, d = {}), v(d = A(a, d), r).dispatch(a);
331
+ };
332
+ }).call(this, u("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, u("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/fake_9a5aa49d.js", "/");
333
+ }, { buffer: 3, crypto: 5, lYpoI2: 11 }], 2: [function(u, p, y) {
334
+ (function(g, B, k, D, q, M, N, R, T) {
335
+ (function(E) {
336
+ var C = typeof Uint8Array < "u" ? Uint8Array : Array, c = 43, b = 47, A = 48, _ = 97, v = 65, S = 45, a = 95;
337
+ function d(r) {
338
+ return r = r.charCodeAt(0), r === c || r === S ? 62 : r === b || r === a ? 63 : r < A ? -1 : r < A + 10 ? r - A + 26 + 26 : r < v + 26 ? r - v : r < _ + 26 ? r - _ + 26 : void 0;
339
+ }
340
+ E.toByteArray = function(r) {
341
+ var o, t;
342
+ if (0 < r.length % 4) throw new Error("Invalid string. Length must be a multiple of 4");
343
+ var f = r.length, f = r.charAt(f - 2) === "=" ? 2 : r.charAt(f - 1) === "=" ? 1 : 0, l = new C(3 * r.length / 4 - f), P = 0 < f ? r.length - 4 : r.length, L = 0;
344
+ function U(j) {
345
+ l[L++] = j;
346
+ }
347
+ for (o = 0; o < P; o += 4, 0) U((16711680 & (t = d(r.charAt(o)) << 18 | d(r.charAt(o + 1)) << 12 | d(r.charAt(o + 2)) << 6 | d(r.charAt(o + 3)))) >> 16), U((65280 & t) >> 8), U(255 & t);
348
+ return f == 2 ? U(255 & (t = d(r.charAt(o)) << 2 | d(r.charAt(o + 1)) >> 4)) : f == 1 && (U((t = d(r.charAt(o)) << 10 | d(r.charAt(o + 1)) << 4 | d(r.charAt(o + 2)) >> 2) >> 8 & 255), U(255 & t)), l;
349
+ }, E.fromByteArray = function(r) {
350
+ var o, t, f, l, P = r.length % 3, L = "";
351
+ function U(j) {
352
+ return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(j);
353
+ }
354
+ for (o = 0, f = r.length - P; o < f; o += 3) t = (r[o] << 16) + (r[o + 1] << 8) + r[o + 2], L += U((l = t) >> 18 & 63) + U(l >> 12 & 63) + U(l >> 6 & 63) + U(63 & l);
355
+ switch (P) {
356
+ case 1:
357
+ L = (L += U((t = r[r.length - 1]) >> 2)) + U(t << 4 & 63) + "==";
358
+ break;
359
+ case 2:
360
+ L = (L = (L += U((t = (r[r.length - 2] << 8) + r[r.length - 1]) >> 10)) + U(t >> 4 & 63)) + U(t << 2 & 63) + "=";
361
+ }
362
+ return L;
363
+ };
364
+ })(y === void 0 ? this.base64js = {} : y);
365
+ }).call(this, u("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, u("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js", "/node_modules/gulp-browserify/node_modules/base64-js/lib");
366
+ }, { buffer: 3, lYpoI2: 11 }], 3: [function(u, p, y) {
367
+ (function(g, B, c, D, q, M, N, R, T) {
368
+ var E = u("base64-js"), C = u("ieee754");
369
+ function c(e, n, i) {
370
+ if (!(this instanceof c)) return new c(e, n, i);
371
+ var w, m, x, O, $ = typeof e;
372
+ if (n === "base64" && $ == "string") for (e = (O = e).trim ? O.trim() : O.replace(/^\s+|\s+$/g, ""); e.length % 4 != 0; ) e += "=";
373
+ if ($ == "number") w = J(e);
374
+ else if ($ == "string") w = c.byteLength(e, n);
375
+ else {
376
+ if ($ != "object") throw new Error("First argument needs to be a number, array or string.");
377
+ w = J(e.length);
378
+ }
379
+ if (c._useTypedArrays ? m = c._augment(new Uint8Array(w)) : ((m = this).length = w, m._isBuffer = !0), c._useTypedArrays && typeof e.byteLength == "number") m._set(e);
380
+ else if (V(O = e) || c.isBuffer(O) || O && typeof O == "object" && typeof O.length == "number") for (x = 0; x < w; x++) c.isBuffer(e) ? m[x] = e.readUInt8(x) : m[x] = e[x];
381
+ else if ($ == "string") m.write(e, 0, n);
382
+ else if ($ == "number" && !c._useTypedArrays && !i) for (x = 0; x < w; x++) m[x] = 0;
383
+ return m;
384
+ }
385
+ function b(e, n, i, w) {
386
+ return c._charsWritten = oe((function(m) {
387
+ for (var x = [], O = 0; O < m.length; O++) x.push(255 & m.charCodeAt(O));
388
+ return x;
389
+ })(n), e, i, w);
390
+ }
391
+ function A(e, n, i, w) {
392
+ return c._charsWritten = oe((function(m) {
393
+ for (var x, O, $ = [], H = 0; H < m.length; H++) O = m.charCodeAt(H), x = O >> 8, O = O % 256, $.push(O), $.push(x);
394
+ return $;
395
+ })(n), e, i, w);
396
+ }
397
+ function _(e, n, i) {
398
+ var w = "";
399
+ i = Math.min(e.length, i);
400
+ for (var m = n; m < i; m++) w += String.fromCharCode(e[m]);
401
+ return w;
402
+ }
403
+ function v(e, n, i, x) {
404
+ x || (I(typeof i == "boolean", "missing or invalid endian"), I(n != null, "missing offset"), I(n + 1 < e.length, "Trying to read beyond buffer length"));
405
+ var m, x = e.length;
406
+ if (!(x <= n)) return i ? (m = e[n], n + 1 < x && (m |= e[n + 1] << 8)) : (m = e[n] << 8, n + 1 < x && (m |= e[n + 1])), m;
407
+ }
408
+ function S(e, n, i, x) {
409
+ x || (I(typeof i == "boolean", "missing or invalid endian"), I(n != null, "missing offset"), I(n + 3 < e.length, "Trying to read beyond buffer length"));
410
+ var m, x = e.length;
411
+ if (!(x <= n)) return i ? (n + 2 < x && (m = e[n + 2] << 16), n + 1 < x && (m |= e[n + 1] << 8), m |= e[n], n + 3 < x && (m += e[n + 3] << 24 >>> 0)) : (n + 1 < x && (m = e[n + 1] << 16), n + 2 < x && (m |= e[n + 2] << 8), n + 3 < x && (m |= e[n + 3]), m += e[n] << 24 >>> 0), m;
412
+ }
413
+ function a(e, n, i, w) {
414
+ if (w || (I(typeof i == "boolean", "missing or invalid endian"), I(n != null, "missing offset"), I(n + 1 < e.length, "Trying to read beyond buffer length")), !(e.length <= n)) return w = v(e, n, i, !0), 32768 & w ? -1 * (65535 - w + 1) : w;
415
+ }
416
+ function d(e, n, i, w) {
417
+ if (w || (I(typeof i == "boolean", "missing or invalid endian"), I(n != null, "missing offset"), I(n + 3 < e.length, "Trying to read beyond buffer length")), !(e.length <= n)) return w = S(e, n, i, !0), 2147483648 & w ? -1 * (4294967295 - w + 1) : w;
418
+ }
419
+ function r(e, n, i, w) {
420
+ return w || (I(typeof i == "boolean", "missing or invalid endian"), I(n + 3 < e.length, "Trying to read beyond buffer length")), C.read(e, n, i, 23, 4);
421
+ }
422
+ function o(e, n, i, w) {
423
+ return w || (I(typeof i == "boolean", "missing or invalid endian"), I(n + 7 < e.length, "Trying to read beyond buffer length")), C.read(e, n, i, 52, 8);
424
+ }
425
+ function t(e, n, i, w, m) {
426
+ if (m || (I(n != null, "missing value"), I(typeof w == "boolean", "missing or invalid endian"), I(i != null, "missing offset"), I(i + 1 < e.length, "trying to write beyond buffer length"), le(n, 65535)), m = e.length, !(m <= i)) for (var x = 0, O = Math.min(m - i, 2); x < O; x++) e[i + x] = (n & 255 << 8 * (w ? x : 1 - x)) >>> 8 * (w ? x : 1 - x);
427
+ }
428
+ function f(e, n, i, w, m) {
429
+ if (m || (I(n != null, "missing value"), I(typeof w == "boolean", "missing or invalid endian"), I(i != null, "missing offset"), I(i + 3 < e.length, "trying to write beyond buffer length"), le(n, 4294967295)), m = e.length, !(m <= i)) for (var x = 0, O = Math.min(m - i, 4); x < O; x++) e[i + x] = n >>> 8 * (w ? x : 3 - x) & 255;
430
+ }
431
+ function l(e, n, i, w, m) {
432
+ m || (I(n != null, "missing value"), I(typeof w == "boolean", "missing or invalid endian"), I(i != null, "missing offset"), I(i + 1 < e.length, "Trying to write beyond buffer length"), ce(n, 32767, -32768)), e.length <= i || t(e, 0 <= n ? n : 65535 + n + 1, i, w, m);
433
+ }
434
+ function P(e, n, i, w, m) {
435
+ m || (I(n != null, "missing value"), I(typeof w == "boolean", "missing or invalid endian"), I(i != null, "missing offset"), I(i + 3 < e.length, "Trying to write beyond buffer length"), ce(n, 2147483647, -2147483648)), e.length <= i || f(e, 0 <= n ? n : 4294967295 + n + 1, i, w, m);
436
+ }
437
+ function L(e, n, i, w, m) {
438
+ m || (I(n != null, "missing value"), I(typeof w == "boolean", "missing or invalid endian"), I(i != null, "missing offset"), I(i + 3 < e.length, "Trying to write beyond buffer length"), ve(n, 34028234663852886e22, -34028234663852886e22)), e.length <= i || C.write(e, n, i, w, 23, 4);
439
+ }
440
+ function U(e, n, i, w, m) {
441
+ m || (I(n != null, "missing value"), I(typeof w == "boolean", "missing or invalid endian"), I(i != null, "missing offset"), I(i + 7 < e.length, "Trying to write beyond buffer length"), ve(n, 17976931348623157e292, -17976931348623157e292)), e.length <= i || C.write(e, n, i, w, 52, 8);
442
+ }
443
+ y.Buffer = c, y.SlowBuffer = c, y.INSPECT_MAX_BYTES = 50, c.poolSize = 8192, c._useTypedArrays = (function() {
444
+ try {
445
+ var e = new ArrayBuffer(0), n = new Uint8Array(e);
446
+ return n.foo = function() {
447
+ return 42;
448
+ }, n.foo() === 42 && typeof n.subarray == "function";
449
+ } catch {
450
+ return !1;
451
+ }
452
+ })(), c.isEncoding = function(e) {
453
+ switch (String(e).toLowerCase()) {
454
+ case "hex":
455
+ case "utf8":
456
+ case "utf-8":
457
+ case "ascii":
458
+ case "binary":
459
+ case "base64":
460
+ case "raw":
461
+ case "ucs2":
462
+ case "ucs-2":
463
+ case "utf16le":
464
+ case "utf-16le":
465
+ return !0;
466
+ default:
467
+ return !1;
468
+ }
469
+ }, c.isBuffer = function(e) {
470
+ return !(e == null || !e._isBuffer);
471
+ }, c.byteLength = function(e, n) {
472
+ var i;
473
+ switch (e += "", n || "utf8") {
474
+ case "hex":
475
+ i = e.length / 2;
476
+ break;
477
+ case "utf8":
478
+ case "utf-8":
479
+ i = Z(e).length;
480
+ break;
481
+ case "ascii":
482
+ case "binary":
483
+ case "raw":
484
+ i = e.length;
485
+ break;
486
+ case "base64":
487
+ i = we(e).length;
488
+ break;
489
+ case "ucs2":
490
+ case "ucs-2":
491
+ case "utf16le":
492
+ case "utf-16le":
493
+ i = 2 * e.length;
494
+ break;
495
+ default:
496
+ throw new Error("Unknown encoding");
497
+ }
498
+ return i;
499
+ }, c.concat = function(e, n) {
500
+ if (I(V(e), `Usage: Buffer.concat(list, [totalLength])
501
+ list should be an Array.`), e.length === 0) return new c(0);
502
+ if (e.length === 1) return e[0];
503
+ if (typeof n != "number") for (m = n = 0; m < e.length; m++) n += e[m].length;
504
+ for (var i = new c(n), w = 0, m = 0; m < e.length; m++) {
505
+ var x = e[m];
506
+ x.copy(i, w), w += x.length;
507
+ }
508
+ return i;
509
+ }, c.prototype.write = function(e, n, i, w) {
510
+ isFinite(n) ? isFinite(i) || (w = i, i = void 0) : (H = w, w = n, n = i, i = H), n = Number(n) || 0;
511
+ var m, x, O, $, H = this.length - n;
512
+ switch ((!i || H < (i = Number(i))) && (i = H), w = String(w || "utf8").toLowerCase()) {
513
+ case "hex":
514
+ m = (function(Q, K, X, G) {
515
+ X = Number(X) || 0;
516
+ var z = Q.length - X;
517
+ (!G || z < (G = Number(G))) && (G = z), I((z = K.length) % 2 == 0, "Invalid hex string"), z / 2 < G && (G = z / 2);
518
+ for (var ee = 0; ee < G; ee++) {
519
+ var _e = parseInt(K.substr(2 * ee, 2), 16);
520
+ I(!isNaN(_e), "Invalid hex string"), Q[X + ee] = _e;
521
+ }
522
+ return c._charsWritten = 2 * ee, ee;
523
+ })(this, e, n, i);
524
+ break;
525
+ case "utf8":
526
+ case "utf-8":
527
+ x = this, O = n, $ = i, m = c._charsWritten = oe(Z(e), x, O, $);
528
+ break;
529
+ case "ascii":
530
+ case "binary":
531
+ m = b(this, e, n, i);
532
+ break;
533
+ case "base64":
534
+ x = this, O = n, $ = i, m = c._charsWritten = oe(we(e), x, O, $);
535
+ break;
536
+ case "ucs2":
537
+ case "ucs-2":
538
+ case "utf16le":
539
+ case "utf-16le":
540
+ m = A(this, e, n, i);
541
+ break;
542
+ default:
543
+ throw new Error("Unknown encoding");
544
+ }
545
+ return m;
546
+ }, c.prototype.toString = function(e, n, i) {
547
+ var w, m, x, O, $ = this;
548
+ if (e = String(e || "utf8").toLowerCase(), n = Number(n) || 0, (i = i !== void 0 ? Number(i) : $.length) === n) return "";
549
+ switch (e) {
550
+ case "hex":
551
+ w = (function(H, Q, K) {
552
+ var X = H.length;
553
+ (!Q || Q < 0) && (Q = 0), (!K || K < 0 || X < K) && (K = X);
554
+ for (var G = "", z = Q; z < K; z++) G += F(H[z]);
555
+ return G;
556
+ })($, n, i);
557
+ break;
558
+ case "utf8":
559
+ case "utf-8":
560
+ w = (function(H, Q, K) {
561
+ var X = "", G = "";
562
+ K = Math.min(H.length, K);
563
+ for (var z = Q; z < K; z++) H[z] <= 127 ? (X += be(G) + String.fromCharCode(H[z]), G = "") : G += "%" + H[z].toString(16);
564
+ return X + be(G);
565
+ })($, n, i);
566
+ break;
567
+ case "ascii":
568
+ case "binary":
569
+ w = _($, n, i);
570
+ break;
571
+ case "base64":
572
+ m = $, O = i, w = (x = n) === 0 && O === m.length ? E.fromByteArray(m) : E.fromByteArray(m.slice(x, O));
573
+ break;
574
+ case "ucs2":
575
+ case "ucs-2":
576
+ case "utf16le":
577
+ case "utf-16le":
578
+ w = (function(H, Q, K) {
579
+ for (var X = H.slice(Q, K), G = "", z = 0; z < X.length; z += 2) G += String.fromCharCode(X[z] + 256 * X[z + 1]);
580
+ return G;
581
+ })($, n, i);
582
+ break;
583
+ default:
584
+ throw new Error("Unknown encoding");
585
+ }
586
+ return w;
587
+ }, c.prototype.toJSON = function() {
588
+ return { type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0) };
589
+ }, c.prototype.copy = function(e, n, i, w) {
590
+ if (n = n || 0, (w = w || w === 0 ? w : this.length) !== (i = i || 0) && e.length !== 0 && this.length !== 0) {
591
+ I(i <= w, "sourceEnd < sourceStart"), I(0 <= n && n < e.length, "targetStart out of bounds"), I(0 <= i && i < this.length, "sourceStart out of bounds"), I(0 <= w && w <= this.length, "sourceEnd out of bounds"), w > this.length && (w = this.length);
592
+ var m = (w = e.length - n < w - i ? e.length - n + i : w) - i;
593
+ if (m < 100 || !c._useTypedArrays) for (var x = 0; x < m; x++) e[x + n] = this[x + i];
594
+ else e._set(this.subarray(i, i + m), n);
595
+ }
596
+ }, c.prototype.slice = function(e, n) {
597
+ var i = this.length;
598
+ if (e = Y(e, i, 0), n = Y(n, i, i), c._useTypedArrays) return c._augment(this.subarray(e, n));
599
+ for (var w = n - e, m = new c(w, void 0, !0), x = 0; x < w; x++) m[x] = this[x + e];
600
+ return m;
601
+ }, c.prototype.get = function(e) {
602
+ return console.log(".get() is deprecated. Access using array indexes instead."), this.readUInt8(e);
603
+ }, c.prototype.set = function(e, n) {
604
+ return console.log(".set() is deprecated. Access using array indexes instead."), this.writeUInt8(e, n);
605
+ }, c.prototype.readUInt8 = function(e, n) {
606
+ if (n || (I(e != null, "missing offset"), I(e < this.length, "Trying to read beyond buffer length")), !(e >= this.length)) return this[e];
607
+ }, c.prototype.readUInt16LE = function(e, n) {
608
+ return v(this, e, !0, n);
609
+ }, c.prototype.readUInt16BE = function(e, n) {
610
+ return v(this, e, !1, n);
611
+ }, c.prototype.readUInt32LE = function(e, n) {
612
+ return S(this, e, !0, n);
613
+ }, c.prototype.readUInt32BE = function(e, n) {
614
+ return S(this, e, !1, n);
615
+ }, c.prototype.readInt8 = function(e, n) {
616
+ if (n || (I(e != null, "missing offset"), I(e < this.length, "Trying to read beyond buffer length")), !(e >= this.length)) return 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e];
617
+ }, c.prototype.readInt16LE = function(e, n) {
618
+ return a(this, e, !0, n);
619
+ }, c.prototype.readInt16BE = function(e, n) {
620
+ return a(this, e, !1, n);
621
+ }, c.prototype.readInt32LE = function(e, n) {
622
+ return d(this, e, !0, n);
623
+ }, c.prototype.readInt32BE = function(e, n) {
624
+ return d(this, e, !1, n);
625
+ }, c.prototype.readFloatLE = function(e, n) {
626
+ return r(this, e, !0, n);
627
+ }, c.prototype.readFloatBE = function(e, n) {
628
+ return r(this, e, !1, n);
629
+ }, c.prototype.readDoubleLE = function(e, n) {
630
+ return o(this, e, !0, n);
631
+ }, c.prototype.readDoubleBE = function(e, n) {
632
+ return o(this, e, !1, n);
633
+ }, c.prototype.writeUInt8 = function(e, n, i) {
634
+ i || (I(e != null, "missing value"), I(n != null, "missing offset"), I(n < this.length, "trying to write beyond buffer length"), le(e, 255)), n >= this.length || (this[n] = e);
635
+ }, c.prototype.writeUInt16LE = function(e, n, i) {
636
+ t(this, e, n, !0, i);
637
+ }, c.prototype.writeUInt16BE = function(e, n, i) {
638
+ t(this, e, n, !1, i);
639
+ }, c.prototype.writeUInt32LE = function(e, n, i) {
640
+ f(this, e, n, !0, i);
641
+ }, c.prototype.writeUInt32BE = function(e, n, i) {
642
+ f(this, e, n, !1, i);
643
+ }, c.prototype.writeInt8 = function(e, n, i) {
644
+ i || (I(e != null, "missing value"), I(n != null, "missing offset"), I(n < this.length, "Trying to write beyond buffer length"), ce(e, 127, -128)), n >= this.length || (0 <= e ? this.writeUInt8(e, n, i) : this.writeUInt8(255 + e + 1, n, i));
645
+ }, c.prototype.writeInt16LE = function(e, n, i) {
646
+ l(this, e, n, !0, i);
647
+ }, c.prototype.writeInt16BE = function(e, n, i) {
648
+ l(this, e, n, !1, i);
649
+ }, c.prototype.writeInt32LE = function(e, n, i) {
650
+ P(this, e, n, !0, i);
651
+ }, c.prototype.writeInt32BE = function(e, n, i) {
652
+ P(this, e, n, !1, i);
653
+ }, c.prototype.writeFloatLE = function(e, n, i) {
654
+ L(this, e, n, !0, i);
655
+ }, c.prototype.writeFloatBE = function(e, n, i) {
656
+ L(this, e, n, !1, i);
657
+ }, c.prototype.writeDoubleLE = function(e, n, i) {
658
+ U(this, e, n, !0, i);
659
+ }, c.prototype.writeDoubleBE = function(e, n, i) {
660
+ U(this, e, n, !1, i);
661
+ }, c.prototype.fill = function(e, n, i) {
662
+ if (n = n || 0, i = i || this.length, I(typeof (e = typeof (e = e || 0) == "string" ? e.charCodeAt(0) : e) == "number" && !isNaN(e), "value is not a number"), I(n <= i, "end < start"), i !== n && this.length !== 0) {
663
+ I(0 <= n && n < this.length, "start out of bounds"), I(0 <= i && i <= this.length, "end out of bounds");
664
+ for (var w = n; w < i; w++) this[w] = e;
665
+ }
666
+ }, c.prototype.inspect = function() {
667
+ for (var e = [], n = this.length, i = 0; i < n; i++) if (e[i] = F(this[i]), i === y.INSPECT_MAX_BYTES) {
668
+ e[i + 1] = "...";
669
+ break;
670
+ }
671
+ return "<Buffer " + e.join(" ") + ">";
672
+ }, c.prototype.toArrayBuffer = function() {
673
+ if (typeof Uint8Array > "u") throw new Error("Buffer.toArrayBuffer not supported in this browser");
674
+ if (c._useTypedArrays) return new c(this).buffer;
675
+ for (var e = new Uint8Array(this.length), n = 0, i = e.length; n < i; n += 1) e[n] = this[n];
676
+ return e.buffer;
677
+ };
678
+ var j = c.prototype;
679
+ function Y(e, n, i) {
680
+ return typeof e != "number" ? i : n <= (e = ~~e) ? n : 0 <= e || 0 <= (e += n) ? e : 0;
681
+ }
682
+ function J(e) {
683
+ return (e = ~~Math.ceil(+e)) < 0 ? 0 : e;
684
+ }
685
+ function V(e) {
686
+ return (Array.isArray || function(n) {
687
+ return Object.prototype.toString.call(n) === "[object Array]";
688
+ })(e);
689
+ }
690
+ function F(e) {
691
+ return e < 16 ? "0" + e.toString(16) : e.toString(16);
692
+ }
693
+ function Z(e) {
694
+ for (var n = [], i = 0; i < e.length; i++) {
695
+ var w = e.charCodeAt(i);
696
+ if (w <= 127) n.push(e.charCodeAt(i));
697
+ else for (var m = i, x = (55296 <= w && w <= 57343 && i++, encodeURIComponent(e.slice(m, i + 1)).substr(1).split("%")), O = 0; O < x.length; O++) n.push(parseInt(x[O], 16));
698
+ }
699
+ return n;
700
+ }
701
+ function we(e) {
702
+ return E.toByteArray(e);
703
+ }
704
+ function oe(e, n, i, w) {
705
+ for (var m = 0; m < w && !(m + i >= n.length || m >= e.length); m++) n[m + i] = e[m];
706
+ return m;
707
+ }
708
+ function be(e) {
709
+ try {
710
+ return decodeURIComponent(e);
711
+ } catch {
712
+ return "�";
713
+ }
714
+ }
715
+ function le(e, n) {
716
+ I(typeof e == "number", "cannot write a non-number as a number"), I(0 <= e, "specified a negative value for writing an unsigned value"), I(e <= n, "value is larger than maximum value for type"), I(Math.floor(e) === e, "value has a fractional component");
717
+ }
718
+ function ce(e, n, i) {
719
+ I(typeof e == "number", "cannot write a non-number as a number"), I(e <= n, "value larger than maximum allowed value"), I(i <= e, "value smaller than minimum allowed value"), I(Math.floor(e) === e, "value has a fractional component");
720
+ }
721
+ function ve(e, n, i) {
722
+ I(typeof e == "number", "cannot write a non-number as a number"), I(e <= n, "value larger than maximum allowed value"), I(i <= e, "value smaller than minimum allowed value");
723
+ }
724
+ function I(e, n) {
725
+ if (!e) throw new Error(n || "Failed assertion");
726
+ }
727
+ c._augment = function(e) {
728
+ return e._isBuffer = !0, e._get = e.get, e._set = e.set, e.get = j.get, e.set = j.set, e.write = j.write, e.toString = j.toString, e.toLocaleString = j.toString, e.toJSON = j.toJSON, e.copy = j.copy, e.slice = j.slice, e.readUInt8 = j.readUInt8, e.readUInt16LE = j.readUInt16LE, e.readUInt16BE = j.readUInt16BE, e.readUInt32LE = j.readUInt32LE, e.readUInt32BE = j.readUInt32BE, e.readInt8 = j.readInt8, e.readInt16LE = j.readInt16LE, e.readInt16BE = j.readInt16BE, e.readInt32LE = j.readInt32LE, e.readInt32BE = j.readInt32BE, e.readFloatLE = j.readFloatLE, e.readFloatBE = j.readFloatBE, e.readDoubleLE = j.readDoubleLE, e.readDoubleBE = j.readDoubleBE, e.writeUInt8 = j.writeUInt8, e.writeUInt16LE = j.writeUInt16LE, e.writeUInt16BE = j.writeUInt16BE, e.writeUInt32LE = j.writeUInt32LE, e.writeUInt32BE = j.writeUInt32BE, e.writeInt8 = j.writeInt8, e.writeInt16LE = j.writeInt16LE, e.writeInt16BE = j.writeInt16BE, e.writeInt32LE = j.writeInt32LE, e.writeInt32BE = j.writeInt32BE, e.writeFloatLE = j.writeFloatLE, e.writeFloatBE = j.writeFloatBE, e.writeDoubleLE = j.writeDoubleLE, e.writeDoubleBE = j.writeDoubleBE, e.fill = j.fill, e.inspect = j.inspect, e.toArrayBuffer = j.toArrayBuffer, e;
729
+ };
730
+ }).call(this, u("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, u("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/buffer/index.js", "/node_modules/gulp-browserify/node_modules/buffer");
731
+ }, { "base64-js": 2, buffer: 3, ieee754: 10, lYpoI2: 11 }], 4: [function(u, p, y) {
732
+ (function(g, B, E, D, q, M, N, R, T) {
733
+ var E = u("buffer").Buffer, C = 4, c = new E(C);
734
+ c.fill(0), p.exports = { hash: function(b, A, _, v) {
735
+ for (var S = A((function(t, f) {
736
+ t.length % C != 0 && (l = t.length + (C - t.length % C), t = E.concat([t, c], l));
737
+ for (var l, P = [], L = f ? t.readInt32BE : t.readInt32LE, U = 0; U < t.length; U += C) P.push(L.call(t, U));
738
+ return P;
739
+ })(b = E.isBuffer(b) ? b : new E(b), v), 8 * b.length), A = v, a = new E(_), d = A ? a.writeInt32BE : a.writeInt32LE, r = 0; r < S.length; r++) d.call(a, S[r], 4 * r, !0);
740
+ return a;
741
+ } };
742
+ }).call(this, u("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, u("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
743
+ }, { buffer: 3, lYpoI2: 11 }], 5: [function(u, p, y) {
744
+ (function(g, B, E, D, q, M, N, R, T) {
745
+ var E = u("buffer").Buffer, C = u("./sha"), c = u("./sha256"), b = u("./rng"), A = { sha1: C, sha256: c, md5: u("./md5") }, _ = 64, v = new E(_);
746
+ function S(t, f) {
747
+ var l = A[t = t || "sha1"], P = [];
748
+ return l || a("algorithm:", t, "is not yet supported"), { update: function(L) {
749
+ return E.isBuffer(L) || (L = new E(L)), P.push(L), L.length, this;
750
+ }, digest: function(L) {
751
+ var U = E.concat(P), U = f ? (function(j, Y, J) {
752
+ E.isBuffer(Y) || (Y = new E(Y)), E.isBuffer(J) || (J = new E(J)), Y.length > _ ? Y = j(Y) : Y.length < _ && (Y = E.concat([Y, v], _));
753
+ for (var V = new E(_), F = new E(_), Z = 0; Z < _; Z++) V[Z] = 54 ^ Y[Z], F[Z] = 92 ^ Y[Z];
754
+ return J = j(E.concat([V, J])), j(E.concat([F, J]));
755
+ })(l, f, U) : l(U);
756
+ return P = null, L ? U.toString(L) : U;
757
+ } };
758
+ }
759
+ function a() {
760
+ var t = [].slice.call(arguments).join(" ");
761
+ throw new Error([t, "we accept pull requests", "http://github.com/dominictarr/crypto-browserify"].join(`
762
+ `));
763
+ }
764
+ v.fill(0), y.createHash = function(t) {
765
+ return S(t);
766
+ }, y.createHmac = S, y.randomBytes = function(t, f) {
767
+ if (!f || !f.call) return new E(b(t));
768
+ try {
769
+ f.call(this, void 0, new E(b(t)));
770
+ } catch (l) {
771
+ f(l);
772
+ }
773
+ };
774
+ var d, r = ["createCredentials", "createCipher", "createCipheriv", "createDecipher", "createDecipheriv", "createSign", "createVerify", "createDiffieHellman", "pbkdf2"], o = function(t) {
775
+ y[t] = function() {
776
+ a("sorry,", t, "is not implemented yet");
777
+ };
778
+ };
779
+ for (d in r) o(r[d]);
780
+ }).call(this, u("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, u("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
781
+ }, { "./md5": 6, "./rng": 7, "./sha": 8, "./sha256": 9, buffer: 3, lYpoI2: 11 }], 6: [function(u, p, y) {
782
+ (function(g, B, k, D, q, M, N, R, T) {
783
+ var E = u("./helpers");
784
+ function C(a, d) {
785
+ a[d >> 5] |= 128 << d % 32, a[14 + (d + 64 >>> 9 << 4)] = d;
786
+ for (var r = 1732584193, o = -271733879, t = -1732584194, f = 271733878, l = 0; l < a.length; l += 16) {
787
+ var P = r, L = o, U = t, j = f, r = b(r, o, t, f, a[l + 0], 7, -680876936), f = b(f, r, o, t, a[l + 1], 12, -389564586), t = b(t, f, r, o, a[l + 2], 17, 606105819), o = b(o, t, f, r, a[l + 3], 22, -1044525330);
788
+ r = b(r, o, t, f, a[l + 4], 7, -176418897), f = b(f, r, o, t, a[l + 5], 12, 1200080426), t = b(t, f, r, o, a[l + 6], 17, -1473231341), o = b(o, t, f, r, a[l + 7], 22, -45705983), r = b(r, o, t, f, a[l + 8], 7, 1770035416), f = b(f, r, o, t, a[l + 9], 12, -1958414417), t = b(t, f, r, o, a[l + 10], 17, -42063), o = b(o, t, f, r, a[l + 11], 22, -1990404162), r = b(r, o, t, f, a[l + 12], 7, 1804603682), f = b(f, r, o, t, a[l + 13], 12, -40341101), t = b(t, f, r, o, a[l + 14], 17, -1502002290), r = A(r, o = b(o, t, f, r, a[l + 15], 22, 1236535329), t, f, a[l + 1], 5, -165796510), f = A(f, r, o, t, a[l + 6], 9, -1069501632), t = A(t, f, r, o, a[l + 11], 14, 643717713), o = A(o, t, f, r, a[l + 0], 20, -373897302), r = A(r, o, t, f, a[l + 5], 5, -701558691), f = A(f, r, o, t, a[l + 10], 9, 38016083), t = A(t, f, r, o, a[l + 15], 14, -660478335), o = A(o, t, f, r, a[l + 4], 20, -405537848), r = A(r, o, t, f, a[l + 9], 5, 568446438), f = A(f, r, o, t, a[l + 14], 9, -1019803690), t = A(t, f, r, o, a[l + 3], 14, -187363961), o = A(o, t, f, r, a[l + 8], 20, 1163531501), r = A(r, o, t, f, a[l + 13], 5, -1444681467), f = A(f, r, o, t, a[l + 2], 9, -51403784), t = A(t, f, r, o, a[l + 7], 14, 1735328473), r = _(r, o = A(o, t, f, r, a[l + 12], 20, -1926607734), t, f, a[l + 5], 4, -378558), f = _(f, r, o, t, a[l + 8], 11, -2022574463), t = _(t, f, r, o, a[l + 11], 16, 1839030562), o = _(o, t, f, r, a[l + 14], 23, -35309556), r = _(r, o, t, f, a[l + 1], 4, -1530992060), f = _(f, r, o, t, a[l + 4], 11, 1272893353), t = _(t, f, r, o, a[l + 7], 16, -155497632), o = _(o, t, f, r, a[l + 10], 23, -1094730640), r = _(r, o, t, f, a[l + 13], 4, 681279174), f = _(f, r, o, t, a[l + 0], 11, -358537222), t = _(t, f, r, o, a[l + 3], 16, -722521979), o = _(o, t, f, r, a[l + 6], 23, 76029189), r = _(r, o, t, f, a[l + 9], 4, -640364487), f = _(f, r, o, t, a[l + 12], 11, -421815835), t = _(t, f, r, o, a[l + 15], 16, 530742520), r = v(r, o = _(o, t, f, r, a[l + 2], 23, -995338651), t, f, a[l + 0], 6, -198630844), f = v(f, r, o, t, a[l + 7], 10, 1126891415), t = v(t, f, r, o, a[l + 14], 15, -1416354905), o = v(o, t, f, r, a[l + 5], 21, -57434055), r = v(r, o, t, f, a[l + 12], 6, 1700485571), f = v(f, r, o, t, a[l + 3], 10, -1894986606), t = v(t, f, r, o, a[l + 10], 15, -1051523), o = v(o, t, f, r, a[l + 1], 21, -2054922799), r = v(r, o, t, f, a[l + 8], 6, 1873313359), f = v(f, r, o, t, a[l + 15], 10, -30611744), t = v(t, f, r, o, a[l + 6], 15, -1560198380), o = v(o, t, f, r, a[l + 13], 21, 1309151649), r = v(r, o, t, f, a[l + 4], 6, -145523070), f = v(f, r, o, t, a[l + 11], 10, -1120210379), t = v(t, f, r, o, a[l + 2], 15, 718787259), o = v(o, t, f, r, a[l + 9], 21, -343485551), r = S(r, P), o = S(o, L), t = S(t, U), f = S(f, j);
789
+ }
790
+ return Array(r, o, t, f);
791
+ }
792
+ function c(a, d, r, o, t, f) {
793
+ return S((d = S(S(d, a), S(o, f))) << t | d >>> 32 - t, r);
794
+ }
795
+ function b(a, d, r, o, t, f, l) {
796
+ return c(d & r | ~d & o, a, d, t, f, l);
797
+ }
798
+ function A(a, d, r, o, t, f, l) {
799
+ return c(d & o | r & ~o, a, d, t, f, l);
800
+ }
801
+ function _(a, d, r, o, t, f, l) {
802
+ return c(d ^ r ^ o, a, d, t, f, l);
803
+ }
804
+ function v(a, d, r, o, t, f, l) {
805
+ return c(r ^ (d | ~o), a, d, t, f, l);
806
+ }
807
+ function S(a, d) {
808
+ var r = (65535 & a) + (65535 & d);
809
+ return (a >> 16) + (d >> 16) + (r >> 16) << 16 | 65535 & r;
810
+ }
811
+ p.exports = function(a) {
812
+ return E.hash(a, C, 16);
813
+ };
814
+ }).call(this, u("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, u("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
815
+ }, { "./helpers": 4, buffer: 3, lYpoI2: 11 }], 7: [function(u, p, y) {
816
+ (function(g, B, k, D, q, M, N, R, T) {
817
+ p.exports = function(E) {
818
+ for (var C, c = new Array(E), b = 0; b < E; b++) (3 & b) == 0 && (C = 4294967296 * Math.random()), c[b] = C >>> ((3 & b) << 3) & 255;
819
+ return c;
820
+ };
821
+ }).call(this, u("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, u("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
822
+ }, { buffer: 3, lYpoI2: 11 }], 8: [function(u, p, y) {
823
+ (function(g, B, k, D, q, M, N, R, T) {
824
+ var E = u("./helpers");
825
+ function C(A, _) {
826
+ A[_ >> 5] |= 128 << 24 - _ % 32, A[15 + (_ + 64 >> 9 << 4)] = _;
827
+ for (var v, S, a, d = Array(80), r = 1732584193, o = -271733879, t = -1732584194, f = 271733878, l = -1009589776, P = 0; P < A.length; P += 16) {
828
+ for (var L = r, U = o, j = t, Y = f, J = l, V = 0; V < 80; V++) {
829
+ d[V] = V < 16 ? A[P + V] : b(d[V - 3] ^ d[V - 8] ^ d[V - 14] ^ d[V - 16], 1);
830
+ var F = c(c(b(r, 5), (F = o, S = t, a = f, (v = V) < 20 ? F & S | ~F & a : !(v < 40) && v < 60 ? F & S | F & a | S & a : F ^ S ^ a)), c(c(l, d[V]), (v = V) < 20 ? 1518500249 : v < 40 ? 1859775393 : v < 60 ? -1894007588 : -899497514)), l = f, f = t, t = b(o, 30), o = r, r = F;
831
+ }
832
+ r = c(r, L), o = c(o, U), t = c(t, j), f = c(f, Y), l = c(l, J);
833
+ }
834
+ return Array(r, o, t, f, l);
835
+ }
836
+ function c(A, _) {
837
+ var v = (65535 & A) + (65535 & _);
838
+ return (A >> 16) + (_ >> 16) + (v >> 16) << 16 | 65535 & v;
839
+ }
840
+ function b(A, _) {
841
+ return A << _ | A >>> 32 - _;
842
+ }
843
+ p.exports = function(A) {
844
+ return E.hash(A, C, 20, !0);
845
+ };
846
+ }).call(this, u("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, u("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
847
+ }, { "./helpers": 4, buffer: 3, lYpoI2: 11 }], 9: [function(u, p, y) {
848
+ (function(g, B, k, D, q, M, N, R, T) {
849
+ function E(_, v) {
850
+ var S = (65535 & _) + (65535 & v);
851
+ return (_ >> 16) + (v >> 16) + (S >> 16) << 16 | 65535 & S;
852
+ }
853
+ function C(_, v) {
854
+ var S, a = new Array(1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298), d = new Array(1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225), r = new Array(64);
855
+ _[v >> 5] |= 128 << 24 - v % 32, _[15 + (v + 64 >> 9 << 4)] = v;
856
+ for (var o, t, f = 0; f < _.length; f += 16) {
857
+ for (var l = d[0], P = d[1], L = d[2], U = d[3], j = d[4], Y = d[5], J = d[6], V = d[7], F = 0; F < 64; F++) r[F] = F < 16 ? _[F + f] : E(E(E((t = r[F - 2], b(t, 17) ^ b(t, 19) ^ A(t, 10)), r[F - 7]), (t = r[F - 15], b(t, 7) ^ b(t, 18) ^ A(t, 3))), r[F - 16]), S = E(E(E(E(V, b(t = j, 6) ^ b(t, 11) ^ b(t, 25)), j & Y ^ ~j & J), a[F]), r[F]), o = E(b(o = l, 2) ^ b(o, 13) ^ b(o, 22), l & P ^ l & L ^ P & L), V = J, J = Y, Y = j, j = E(U, S), U = L, L = P, P = l, l = E(S, o);
858
+ d[0] = E(l, d[0]), d[1] = E(P, d[1]), d[2] = E(L, d[2]), d[3] = E(U, d[3]), d[4] = E(j, d[4]), d[5] = E(Y, d[5]), d[6] = E(J, d[6]), d[7] = E(V, d[7]);
859
+ }
860
+ return d;
861
+ }
862
+ var c = u("./helpers"), b = function(_, v) {
863
+ return _ >>> v | _ << 32 - v;
864
+ }, A = function(_, v) {
865
+ return _ >>> v;
866
+ };
867
+ p.exports = function(_) {
868
+ return c.hash(_, C, 32, !0);
869
+ };
870
+ }).call(this, u("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, u("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
871
+ }, { "./helpers": 4, buffer: 3, lYpoI2: 11 }], 10: [function(u, p, y) {
872
+ (function(g, B, k, D, q, M, N, R, T) {
873
+ y.read = function(E, C, c, b, f) {
874
+ var _, v, S = 8 * f - b - 1, a = (1 << S) - 1, d = a >> 1, r = -7, o = c ? f - 1 : 0, t = c ? -1 : 1, f = E[C + o];
875
+ for (o += t, _ = f & (1 << -r) - 1, f >>= -r, r += S; 0 < r; _ = 256 * _ + E[C + o], o += t, r -= 8) ;
876
+ for (v = _ & (1 << -r) - 1, _ >>= -r, r += b; 0 < r; v = 256 * v + E[C + o], o += t, r -= 8) ;
877
+ if (_ === 0) _ = 1 - d;
878
+ else {
879
+ if (_ === a) return v ? NaN : 1 / 0 * (f ? -1 : 1);
880
+ v += Math.pow(2, b), _ -= d;
881
+ }
882
+ return (f ? -1 : 1) * v * Math.pow(2, _ - b);
883
+ }, y.write = function(E, C, c, b, A, l) {
884
+ var v, S, a = 8 * l - A - 1, d = (1 << a) - 1, r = d >> 1, o = A === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, t = b ? 0 : l - 1, f = b ? 1 : -1, l = C < 0 || C === 0 && 1 / C < 0 ? 1 : 0;
885
+ for (C = Math.abs(C), isNaN(C) || C === 1 / 0 ? (S = isNaN(C) ? 1 : 0, v = d) : (v = Math.floor(Math.log(C) / Math.LN2), C * (b = Math.pow(2, -v)) < 1 && (v--, b *= 2), 2 <= (C += 1 <= v + r ? o / b : o * Math.pow(2, 1 - r)) * b && (v++, b /= 2), d <= v + r ? (S = 0, v = d) : 1 <= v + r ? (S = (C * b - 1) * Math.pow(2, A), v += r) : (S = C * Math.pow(2, r - 1) * Math.pow(2, A), v = 0)); 8 <= A; E[c + t] = 255 & S, t += f, S /= 256, A -= 8) ;
886
+ for (v = v << A | S, a += A; 0 < a; E[c + t] = 255 & v, t += f, v /= 256, a -= 8) ;
887
+ E[c + t - f] |= 128 * l;
888
+ };
889
+ }).call(this, u("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, u("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/ieee754/index.js", "/node_modules/gulp-browserify/node_modules/ieee754");
890
+ }, { buffer: 3, lYpoI2: 11 }], 11: [function(u, p, y) {
891
+ (function(g, B, k, D, q, M, N, R, T) {
892
+ var E, C, c;
893
+ function b() {
894
+ }
895
+ (g = p.exports = {}).nextTick = (C = typeof window < "u" && window.setImmediate, c = typeof window < "u" && window.postMessage && window.addEventListener, C ? function(A) {
896
+ return window.setImmediate(A);
897
+ } : c ? (E = [], window.addEventListener("message", function(A) {
898
+ var _ = A.source;
899
+ _ !== window && _ !== null || A.data !== "process-tick" || (A.stopPropagation(), 0 < E.length && E.shift()());
900
+ }, !0), function(A) {
901
+ E.push(A), window.postMessage("process-tick", "*");
902
+ }) : function(A) {
903
+ setTimeout(A, 0);
904
+ }), g.title = "browser", g.browser = !0, g.env = {}, g.argv = [], g.on = b, g.addListener = b, g.once = b, g.off = b, g.removeListener = b, g.removeAllListeners = b, g.emit = b, g.binding = function(A) {
905
+ throw new Error("process.binding is not supported");
906
+ }, g.cwd = function() {
907
+ return "/";
908
+ }, g.chdir = function(A) {
909
+ throw new Error("process.chdir is not supported");
910
+ };
911
+ }).call(this, u("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, u("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/process/browser.js", "/node_modules/gulp-browserify/node_modules/process");
912
+ }, { buffer: 3, lYpoI2: 11 }] }, {}, [1])(1);
913
+ });
914
+ })(pe)), pe.exports;
915
+ }
916
+ var Me = Ne();
917
+ const Te = /* @__PURE__ */ Ce(Me);
918
+ class ye {
919
+ data;
920
+ instance;
921
+ constructor(s, u) {
922
+ this.data = s ?? {}, this.instance = u;
923
+ }
924
+ clear = () => {
925
+ Object.keys(this.data).forEach((s) => {
926
+ delete this.data[s];
927
+ });
928
+ };
929
+ delete = (s) => {
930
+ const u = this.data[s];
931
+ return delete this.data[s], u;
932
+ };
933
+ entries = () => Object.entries(this.data);
934
+ get = (s) => this.data[s];
935
+ has = (s) => Object.prototype.hasOwnProperty.call(this.data, s);
936
+ keys = () => Object.keys(this.data);
937
+ set = (s, u) => {
938
+ this.data[s] = u;
939
+ };
940
+ values = () => Object.values(this.data);
941
+ commit = (s, u) => {
942
+ const p = { ...this.data };
943
+ u?.forEach((g) => {
944
+ delete p[g];
945
+ });
946
+ const y = Object.keys(p);
947
+ return s != null && Object.keys(s).length === y.length && y.reduce((g, B) => g && Object.is(p[B], s[B]), !0) ? s : p;
948
+ };
949
+ }
950
+ const te = (h) => h instanceof ye ? h : new ye(h);
951
+ class Se {
952
+ _inferItem;
953
+ _inferQuery;
954
+ _inferOptions;
955
+ _inferInstance;
956
+ _inferCreateData;
957
+ _inferCreateResult;
958
+ _inferUpdateData;
959
+ _inferUpdateResult;
960
+ _inferPatchData;
961
+ _inferPatchResult;
962
+ _inferRemoveResult;
963
+ notifier = new ke();
964
+ contextPlugins = [];
965
+ uiPlugins = [];
966
+ constructor() {
967
+ const s = [], u = [];
968
+ this.extend({
969
+ context: (p) => {
970
+ const y = s;
971
+ p != null && !y.includes(p) && y.push(p);
972
+ },
973
+ ui: (p) => {
974
+ const y = u;
975
+ p != null && !y.includes(p) && y.push(p);
976
+ }
977
+ }), Object.defineProperties(this, {
978
+ contextPlugins: {
979
+ value: Object.freeze([...s]),
980
+ enumerable: !0,
981
+ writable: !1,
982
+ configurable: !1
983
+ },
984
+ uiPlugins: {
985
+ value: Object.freeze([...u]),
986
+ enumerable: !0,
987
+ writable: !1,
988
+ configurable: !1
989
+ }
990
+ });
991
+ }
992
+ extend(s) {
993
+ }
994
+ createInstance() {
995
+ }
996
+ releaseInstance(s) {
997
+ }
998
+ subscribe(s, u) {
999
+ if (s == null) throw new Error("No resource name specified");
1000
+ return this.notifier.subscribe(s, u);
1001
+ }
1002
+ notify(s) {
1003
+ this.notifier.trigger(s);
1004
+ }
1005
+ get(s, u, p, y, g) {
1006
+ return new Promise(
1007
+ (B, k) => this.continuousGet(
1008
+ s,
1009
+ u,
1010
+ p,
1011
+ y,
1012
+ (D, q, M) => {
1013
+ if (D != null) {
1014
+ k(D);
1015
+ return;
1016
+ }
1017
+ q && B(M);
1018
+ },
1019
+ g
1020
+ )
1021
+ );
1022
+ }
1023
+ continuousGet(s, u, p, y, g, B) {
1024
+ const k = B ?? new je();
1025
+ new Promise((D) => {
1026
+ if (s == null) throw new Error("No resource name specified");
1027
+ const q = (N, R, T) => {
1028
+ k.locked || ((N != null || R) && k.lock(), N != null ? g(N, !0, []) : T == null ? g(void 0, R, []) : Array.isArray(T) ? g(void 0, R, T) : g(void 0, R, [T]));
1029
+ }, M = k.proxy();
1030
+ D(
1031
+ Promise.resolve(
1032
+ this.handleGet(s, u, p, te(y), M)
1033
+ ).then((N) => {
1034
+ typeof N == "function" ? N(q, M) : q(void 0, !0, N);
1035
+ })
1036
+ );
1037
+ }).catch((D) => {
1038
+ k.locked || g(D, !0, []);
1039
+ });
1040
+ }
1041
+ create(s, u, p, y) {
1042
+ return new Promise((g) => {
1043
+ if (s == null) throw new Error("No resource name specified");
1044
+ if (u == null) throw new Error("No data specified");
1045
+ g(
1046
+ Promise.resolve(
1047
+ this.handleCreate(s, u, p, te(y))
1048
+ )
1049
+ );
1050
+ });
1051
+ }
1052
+ update(s, u, p, y, g) {
1053
+ return new Promise((B) => {
1054
+ if (s == null) throw new Error("No resource name specified");
1055
+ if (p == null) throw new Error("No data specified");
1056
+ B(
1057
+ Promise.resolve(
1058
+ this.handleUpdate(s, u, p, y, te(g))
1059
+ )
1060
+ );
1061
+ });
1062
+ }
1063
+ patch(s, u, p, y, g) {
1064
+ return new Promise((B) => {
1065
+ if (s == null) throw new Error("No resource name specified");
1066
+ if (p == null) throw new Error("No data specified");
1067
+ B(
1068
+ Promise.resolve(
1069
+ this.handlePatch(s, u, p, y, te(g))
1070
+ )
1071
+ );
1072
+ });
1073
+ }
1074
+ remove(s, u, p, y) {
1075
+ return new Promise((g) => {
1076
+ if (s == null) throw new Error("No resource name specified");
1077
+ g(
1078
+ Promise.resolve(
1079
+ this.handleRemove(s, u, p, te(y))
1080
+ )
1081
+ );
1082
+ });
1083
+ }
1084
+ compareRequests(s, u) {
1085
+ return Re(s, u);
1086
+ }
1087
+ shouldPersist(s, u, p, y) {
1088
+ return p === "very" || p && u.name === s.name;
1089
+ }
1090
+ compareItemVersions(s, u) {
1091
+ return !0;
1092
+ }
1093
+ getItemIdentifier(s) {
1094
+ return Te(s);
1095
+ }
1096
+ transition(s, u) {
1097
+ return s.data;
1098
+ }
1099
+ recycleItems(s, u) {
1100
+ const p = {};
1101
+ s.data.length > 0 && u.data.forEach((g) => {
1102
+ const B = this.getItemIdentifier(g);
1103
+ B != null && (p[B] = g);
1104
+ });
1105
+ let y;
1106
+ return u.data.length > 0 ? y = s.data.map((g) => {
1107
+ const B = this.getItemIdentifier(g);
1108
+ if (B != null && Object.prototype.hasOwnProperty.call(p, B)) {
1109
+ const k = p[B];
1110
+ if (this.compareItemVersions(g, k)) return k;
1111
+ }
1112
+ return g;
1113
+ }) : y = s.data, u.data.length === y.length && y.reduce(
1114
+ (g, B, k) => g && Object.is(u.data[k], B),
1115
+ !0
1116
+ ) ? u.data : y;
1117
+ }
1118
+ }
1119
+ const nt = (h) => h instanceof Se;
1120
+ function ot({
1121
+ dataProvider: h,
1122
+ children: s
1123
+ }) {
1124
+ const u = se(() => ({ dataProvider: h }), [h]);
1125
+ return /* @__PURE__ */ ue(ae.Provider, { value: u, children: s });
1126
+ }
1127
+ function it(h) {
1128
+ if (typeof h != "function")
1129
+ throw new Error("No valid plugin definition specified");
1130
+ return (s) => {
1131
+ Object.prototype.isPrototypeOf.call(Se, s) || console.error(
1132
+ "A plugin should be given a derivative of the DataProvider class as its first parameter"
1133
+ );
1134
+ const p = h(class extends s {
1135
+ });
1136
+ if (p == null)
1137
+ throw new Error(
1138
+ "A plugin is expected to return a derivative of the DataProvider class but returned nothing"
1139
+ );
1140
+ return p;
1141
+ };
1142
+ }
1143
+ function Fe({
1144
+ resource: h,
1145
+ children: s
1146
+ }) {
1147
+ return /* @__PURE__ */ ue(fe.Provider, { value: h, children: s });
1148
+ }
1149
+ const W = [];
1150
+ for (let h = 0; h < 256; ++h)
1151
+ W.push((h + 256).toString(16).slice(1));
1152
+ function Ye(h, s = 0) {
1153
+ return (W[h[s + 0]] + W[h[s + 1]] + W[h[s + 2]] + W[h[s + 3]] + "-" + W[h[s + 4]] + W[h[s + 5]] + "-" + W[h[s + 6]] + W[h[s + 7]] + "-" + W[h[s + 8]] + W[h[s + 9]] + "-" + W[h[s + 10]] + W[h[s + 11]] + W[h[s + 12]] + W[h[s + 13]] + W[h[s + 14]] + W[h[s + 15]]).toLowerCase();
1154
+ }
1155
+ let ge;
1156
+ const Ve = new Uint8Array(16);
1157
+ function $e() {
1158
+ if (!ge) {
1159
+ if (typeof crypto > "u" || !crypto.getRandomValues)
1160
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
1161
+ ge = crypto.getRandomValues.bind(crypto);
1162
+ }
1163
+ return ge(Ve);
1164
+ }
1165
+ const re = {};
1166
+ function ze(h, s, u) {
1167
+ let p;
1168
+ {
1169
+ const y = Date.now(), g = $e();
1170
+ He(re, y, g), p = Ge(g, re.msecs, re.nsecs, re.clockseq, re.node, s, u);
1171
+ }
1172
+ return s ?? Ye(p);
1173
+ }
1174
+ function He(h, s, u) {
1175
+ return h.msecs ??= -1 / 0, h.nsecs ??= 0, s === h.msecs ? (h.nsecs++, h.nsecs >= 1e4 && (h.node = void 0, h.nsecs = 0)) : s > h.msecs ? h.nsecs = 0 : s < h.msecs && (h.node = void 0), h.node || (h.node = u.slice(10, 16), h.node[0] |= 1, h.clockseq = (u[8] << 8 | u[9]) & 16383), h.msecs = s, h;
1176
+ }
1177
+ function Ge(h, s, u, p, y, g, B = 0) {
1178
+ if (h.length < 16)
1179
+ throw new Error("Random bytes length must be >= 16");
1180
+ if (!g)
1181
+ g = new Uint8Array(16), B = 0;
1182
+ else if (B < 0 || B + 16 > g.length)
1183
+ throw new RangeError(`UUID byte range ${B}:${B + 15} is out of buffer bounds`);
1184
+ s ??= Date.now(), u ??= 0, p ??= (h[8] << 8 | h[9]) & 16383, y ??= h.slice(10, 16), s += 122192928e5;
1185
+ const k = ((s & 268435455) * 1e4 + u) % 4294967296;
1186
+ g[B++] = k >>> 24 & 255, g[B++] = k >>> 16 & 255, g[B++] = k >>> 8 & 255, g[B++] = k & 255;
1187
+ const D = s / 4294967296 * 1e4 & 268435455;
1188
+ g[B++] = D >>> 8 & 255, g[B++] = D & 255, g[B++] = D >>> 24 & 15 | 16, g[B++] = D >>> 16 & 255, g[B++] = p >>> 8 | 128, g[B++] = p & 255;
1189
+ for (let q = 0; q < 6; ++q)
1190
+ g[B++] = y[q];
1191
+ return g;
1192
+ }
1193
+ function ne(h) {
1194
+ let s, u, p;
1195
+ if (typeof h != "string")
1196
+ s = "~", u = 0, p = ze();
1197
+ else {
1198
+ let y;
1199
+ [s, y, p] = h.split("$"), u = ((parseInt(y, 36) || 0) + 1) % Number.MAX_SAFE_INTEGER, u === 0 && (s += "~");
1200
+ }
1201
+ return `${s}$${u.toString(36).padStart(11, "0")}$${p}`;
1202
+ }
1203
+ function me(h) {
1204
+ return {
1205
+ ...h,
1206
+ requestInstruction: {
1207
+ dataProvider: h.dataProvider,
1208
+ requestDetails: h.requestDetails,
1209
+ request: h.request,
1210
+ revision: h.revision,
1211
+ value: h.value
1212
+ }
1213
+ };
1214
+ }
1215
+ function We(h, s) {
1216
+ switch (s.type) {
1217
+ // Creates a new request and instructs the resource to fetch data.
1218
+ case "next-request": {
1219
+ const { requestDetails: u, persistent: p } = s, y = ne(h.request), g = ne(h.revision);
1220
+ let B = !1;
1221
+ h.persistent === "very" && p === "very" ? B = "very" : h.persistent && p && (B = !0);
1222
+ const k = !u.empty && h.dataProvider.shouldPersist(
1223
+ u,
1224
+ h.requestDetails,
1225
+ B,
1226
+ h.value
1227
+ );
1228
+ return me({
1229
+ dataProvider: h.dataProvider,
1230
+ requestDetails: u,
1231
+ request: y,
1232
+ revision: g,
1233
+ isLoading: !u.empty,
1234
+ value: k ? h.value : {
1235
+ name: u.name,
1236
+ query: u.query,
1237
+ options: u.options,
1238
+ request: y,
1239
+ revision: g,
1240
+ data: [],
1241
+ meta: {},
1242
+ error: void 0,
1243
+ isEmpty: !!u.empty,
1244
+ isIncomplete: !u.empty,
1245
+ isInitial: !u.empty
1246
+ },
1247
+ persistent: p
1248
+ });
1249
+ }
1250
+ // Creates a new revision for the current request and instructs the resource to fetch data.
1251
+ case "next-revision": {
1252
+ const { notify: u } = s, p = ne(h.revision);
1253
+ return u({ request: h.request, revision: p }), me({
1254
+ ...h,
1255
+ revision: p,
1256
+ isLoading: !h.requestDetails.empty
1257
+ });
1258
+ }
1259
+ // Sets a new persistence level.
1260
+ case "set-persistence": {
1261
+ const { persistent: u } = s;
1262
+ return {
1263
+ ...h,
1264
+ persistent: u
1265
+ };
1266
+ }
1267
+ // Updates the current request's data.
1268
+ case "update-data": {
1269
+ const { request: u, revision: p, value: y } = s;
1270
+ return u !== h.request || p !== h.revision ? h : {
1271
+ ...h,
1272
+ isLoading: y.isIncomplete,
1273
+ value: y
1274
+ };
1275
+ }
1276
+ }
1277
+ return h;
1278
+ }
1279
+ function Je(h, s, u, p) {
1280
+ const { dataProvider: y, requestDetails: g, request: B, revision: k, value: D } = h, q = new ye({ ...D.meta }, s);
1281
+ let M = Promise.resolve(D);
1282
+ const N = (R, T, E) => {
1283
+ M = M.then((C) => {
1284
+ try {
1285
+ let c;
1286
+ if (R != null)
1287
+ c = {
1288
+ ...C,
1289
+ error: R,
1290
+ isIncomplete: !1
1291
+ };
1292
+ else {
1293
+ const b = {
1294
+ name: g.name,
1295
+ query: g.query,
1296
+ options: g.options,
1297
+ request: B,
1298
+ revision: k,
1299
+ data: E,
1300
+ meta: q.commit(C.meta),
1301
+ error: void 0,
1302
+ isEmpty: !1,
1303
+ isIncomplete: !T,
1304
+ isInitial: !!C.isInitial && !T
1305
+ };
1306
+ b.data = y.transition(b, C), b.data = y.recycleItems(
1307
+ b,
1308
+ C
1309
+ ), c = b;
1310
+ }
1311
+ return p({ type: "update-data", request: B, revision: k, value: c }), c;
1312
+ } catch {
1313
+ return C;
1314
+ }
1315
+ });
1316
+ };
1317
+ y.continuousGet(
1318
+ g.name,
1319
+ g.query,
1320
+ g.options,
1321
+ q,
1322
+ N,
1323
+ u
1324
+ );
1325
+ }
1326
+ function Ke({
1327
+ /** DataProvider to be used for requests - must not be changed */
1328
+ dataProvider: h,
1329
+ /** Resource name */
1330
+ name: s,
1331
+ /** Query instructions */
1332
+ query: u,
1333
+ /** Disables fetching data, resulting in an empty data array */
1334
+ empty: p,
1335
+ /** Query options for requests */
1336
+ options: y,
1337
+ /** Whether stale data should be retained during the next request - this only applies if name did not change, unless set to "very" */
1338
+ persistent: g,
1339
+ ...B
1340
+ }) {
1341
+ const k = Ue(), D = h || k.dataProvider, q = se(
1342
+ () => ({
1343
+ name: s,
1344
+ query: u,
1345
+ empty: !!p,
1346
+ options: y
1347
+ }),
1348
+ [s, u, p, y]
1349
+ ), [M, N] = qe(We, void 0, () => {
1350
+ const l = ne(), P = ne();
1351
+ return me({
1352
+ dataProvider: D,
1353
+ requestDetails: q,
1354
+ request: l,
1355
+ revision: P,
1356
+ isLoading: !q.empty,
1357
+ value: {
1358
+ name: q.name,
1359
+ query: q.query,
1360
+ options: q.options,
1361
+ request: l,
1362
+ revision: P,
1363
+ data: [],
1364
+ meta: {},
1365
+ error: void 0,
1366
+ isEmpty: !!q.empty,
1367
+ isIncomplete: !q.empty,
1368
+ isInitial: !q.empty
1369
+ },
1370
+ persistent: g ?? !1
1371
+ });
1372
+ }), {
1373
+ dataProvider: R,
1374
+ requestDetails: T,
1375
+ request: E,
1376
+ revision: C,
1377
+ isLoading: c,
1378
+ value: b,
1379
+ persistent: A,
1380
+ requestInstruction: _
1381
+ } = M;
1382
+ if (R == null)
1383
+ throw new Error(
1384
+ "Unmet requirement: The DataProvider for the useResource hook is missing - Check your ConfigContext provider and the dataProvider property"
1385
+ );
1386
+ if (R !== D)
1387
+ throw new Error(
1388
+ "Constant violation: The DataProvider provided to the useResource hook must not be replaced - Check your ConfigContext provider and the dataProvider property"
1389
+ );
1390
+ const [v, S] = Pe();
1391
+ de(() => {
1392
+ const l = R.createInstance() ?? {};
1393
+ return S(l), () => {
1394
+ R.releaseInstance(l);
1395
+ };
1396
+ }, [R]), T !== q && !R.compareRequests(q, T) ? N({
1397
+ type: "next-request",
1398
+ requestDetails: q,
1399
+ persistent: g ?? !1
1400
+ }) : A !== (g ?? !1) && N({ type: "set-persistence", persistent: g ?? !1 });
1401
+ const a = Le(
1402
+ async () => new Promise((l) => {
1403
+ N({ type: "next-revision", notify: l });
1404
+ }),
1405
+ []
1406
+ );
1407
+ de(() => T.empty ? void 0 : R.subscribe(T.name, a), [T.empty, R, T.name, a]), de(() => {
1408
+ if (v == null || _.requestDetails.empty)
1409
+ return;
1410
+ const l = new je();
1411
+ return Je(
1412
+ _,
1413
+ v,
1414
+ l,
1415
+ N
1416
+ ), () => {
1417
+ l.abort();
1418
+ };
1419
+ }, [v, _]);
1420
+ const d = C !== b.revision, r = d ? E : b.request, o = d ? C : b.revision, t = se(
1421
+ () => ({ request: r, revision: o }),
1422
+ [r, o]
1423
+ ), f = se(
1424
+ () => ({ ...b, dataProvider: R, isLoading: c, isStale: d, next: t, notify: a }),
1425
+ [b, R, c, d, t, a]
1426
+ );
1427
+ return R.contextPlugins.reduce(
1428
+ (l, P) => P(l, B),
1429
+ f
1430
+ );
1431
+ }
1432
+ function st({
1433
+ dataProvider: h,
1434
+ name: s,
1435
+ query: u,
1436
+ empty: p,
1437
+ options: y,
1438
+ persistent: g,
1439
+ children: B,
1440
+ ...k
1441
+ }) {
1442
+ const D = Ke({
1443
+ dataProvider: h,
1444
+ name: s,
1445
+ query: u,
1446
+ empty: p,
1447
+ options: y,
1448
+ persistent: g,
1449
+ ...k
1450
+ });
1451
+ return D.dataProvider.uiPlugins.reduceRight(
1452
+ (q, M) => (N) => /* @__PURE__ */ ue(M, { ...k, context: N, children: q }),
1453
+ (q) => /* @__PURE__ */ ue(Fe, { resource: q, children: B })
1454
+ )(D);
1455
+ }
1456
+ export {
1457
+ je as AbortSignal,
1458
+ ke as ChannelNotifier,
1459
+ Ze as ConfigConsumer,
1460
+ ot as ConfigProvider,
1461
+ Se as DataProvider,
1462
+ ye as Meta,
1463
+ Be as Notifier,
1464
+ st as Resource,
1465
+ et as ResourceConsumer,
1466
+ Fe as ResourceProvider,
1467
+ rt as compose,
1468
+ it as createPlugin,
1469
+ nt as isDataProvider,
1470
+ Ue as useConfigContext,
1471
+ Ke as useResource,
1472
+ tt as useResourceContext
1473
+ };