@zh-keyboard/vue 0.1.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/LICENSE +190 -0
- package/README.md +189 -0
- package/dist/App.vue.d.ts +2 -0
- package/dist/components/CandidateBar.vue.d.ts +15 -0
- package/dist/components/CandidateList.vue.d.ts +9 -0
- package/dist/components/CandidateSelection.vue.d.ts +11 -0
- package/dist/components/HandwritingInput.vue.d.ts +11 -0
- package/dist/components/KeyboardBase.vue.d.ts +17 -0
- package/dist/components/NumericKeyboard.vue.d.ts +9 -0
- package/dist/components/SymbolKeyboard.vue.d.ts +9 -0
- package/dist/components/ZhKeyboard.vue.d.ts +34 -0
- package/dist/lib.d.ts +8 -0
- package/dist/main.d.ts +1 -0
- package/dist/style.css +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/utils/handwriting.d.ts +11 -0
- package/dist/utils/useHandwritingRecognizer.d.ts +3 -0
- package/dist/zh-keyboard-vue.js +4576 -0
- package/dist/zh-keyboard-vue.js.map +1 -0
- package/dist/zh-keyboard-vue.umd.cjs +4 -0
- package/dist/zh-keyboard-vue.umd.cjs.map +1 -0
- package/package.json +53 -0
|
@@ -0,0 +1,4576 @@
|
|
|
1
|
+
var Wi = Object.defineProperty;
|
|
2
|
+
var Ui = (g, w, E) => w in g ? Wi(g, w, { enumerable: !0, configurable: !0, writable: !0, value: E }) : g[w] = E;
|
|
3
|
+
var he = (g, w, E) => Ui(g, typeof w != "symbol" ? w + "" : w, E);
|
|
4
|
+
import { watch as st, getCurrentScope as Yi, onScopeDispose as Xi, onMounted as mn, nextTick as fr, getCurrentInstance as ei, computed as be, toValue as gt, shallowRef as vn, watchEffect as hr, unref as Ve, ref as de, onUnmounted as ti, defineComponent as He, createElementBlock as Z, openBlock as Y, Fragment as ke, renderList as Te, toDisplayString as Ce, createVNode as ni, createElementVNode as $, mergeModels as sr, useModel as ri, withDirectives as ii, createCommentVNode as bt, createBlock as ot, vShow as ai, normalizeClass as Rt, createTextVNode as ur, Teleport as Gi, mergeProps as Qi, withModifiers as Zi } from "vue";
|
|
5
|
+
function gn(g) {
|
|
6
|
+
return Yi() ? (Xi(g), !0) : !1;
|
|
7
|
+
}
|
|
8
|
+
const Ji = typeof window < "u" && typeof document < "u";
|
|
9
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
10
|
+
const ea = (g) => g != null, ta = Object.prototype.toString, na = (g) => ta.call(g) === "[object Object]", ra = () => {
|
|
11
|
+
};
|
|
12
|
+
function Bt(g) {
|
|
13
|
+
return Array.isArray(g) ? g : [g];
|
|
14
|
+
}
|
|
15
|
+
function ia(g) {
|
|
16
|
+
return ei();
|
|
17
|
+
}
|
|
18
|
+
function aa(g, w = !0, E) {
|
|
19
|
+
ia() ? mn(g, E) : w ? g() : fr(g);
|
|
20
|
+
}
|
|
21
|
+
function oa(g, w, E) {
|
|
22
|
+
return st(
|
|
23
|
+
g,
|
|
24
|
+
w,
|
|
25
|
+
{
|
|
26
|
+
...E,
|
|
27
|
+
immediate: !0
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
const _t = Ji ? window : void 0;
|
|
32
|
+
function ze(g) {
|
|
33
|
+
var w;
|
|
34
|
+
const E = gt(g);
|
|
35
|
+
return (w = E == null ? void 0 : E.$el) != null ? w : E;
|
|
36
|
+
}
|
|
37
|
+
function pn(...g) {
|
|
38
|
+
const w = [], E = () => {
|
|
39
|
+
w.forEach((A) => A()), w.length = 0;
|
|
40
|
+
}, k = (A, R, H, L) => (A.addEventListener(R, H, L), () => A.removeEventListener(R, H, L)), K = be(() => {
|
|
41
|
+
const A = Bt(gt(g[0])).filter((R) => R != null);
|
|
42
|
+
return A.every((R) => typeof R != "string") ? A : void 0;
|
|
43
|
+
}), C = oa(
|
|
44
|
+
() => {
|
|
45
|
+
var A, R;
|
|
46
|
+
return [
|
|
47
|
+
(R = (A = K.value) == null ? void 0 : A.map((H) => ze(H))) != null ? R : [_t].filter((H) => H != null),
|
|
48
|
+
Bt(gt(K.value ? g[1] : g[0])),
|
|
49
|
+
Bt(Ve(K.value ? g[2] : g[1])),
|
|
50
|
+
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
51
|
+
gt(K.value ? g[3] : g[2])
|
|
52
|
+
];
|
|
53
|
+
},
|
|
54
|
+
([A, R, H, L]) => {
|
|
55
|
+
if (E(), !(A != null && A.length) || !(R != null && R.length) || !(H != null && H.length))
|
|
56
|
+
return;
|
|
57
|
+
const B = na(L) ? { ...L } : L;
|
|
58
|
+
w.push(
|
|
59
|
+
...A.flatMap(
|
|
60
|
+
(F) => R.flatMap(
|
|
61
|
+
(ee) => H.map((M) => k(F, ee, M, B))
|
|
62
|
+
)
|
|
63
|
+
)
|
|
64
|
+
);
|
|
65
|
+
},
|
|
66
|
+
{ flush: "post" }
|
|
67
|
+
), O = () => {
|
|
68
|
+
C(), E();
|
|
69
|
+
};
|
|
70
|
+
return gn(E), O;
|
|
71
|
+
}
|
|
72
|
+
function sa() {
|
|
73
|
+
const g = vn(!1), w = ei();
|
|
74
|
+
return w && mn(() => {
|
|
75
|
+
g.value = !0;
|
|
76
|
+
}, w), g;
|
|
77
|
+
}
|
|
78
|
+
function oi(g) {
|
|
79
|
+
const w = sa();
|
|
80
|
+
return be(() => (w.value, !!g()));
|
|
81
|
+
}
|
|
82
|
+
function ua(g, w, E = {}) {
|
|
83
|
+
const { window: k = _t, ...K } = E;
|
|
84
|
+
let C;
|
|
85
|
+
const O = oi(() => k && "MutationObserver" in k), A = () => {
|
|
86
|
+
C && (C.disconnect(), C = void 0);
|
|
87
|
+
}, R = be(() => {
|
|
88
|
+
const F = gt(g), ee = Bt(F).map(ze).filter(ea);
|
|
89
|
+
return new Set(ee);
|
|
90
|
+
}), H = st(
|
|
91
|
+
() => R.value,
|
|
92
|
+
(F) => {
|
|
93
|
+
A(), O.value && F.size && (C = new MutationObserver(w), F.forEach((ee) => C.observe(ee, K)));
|
|
94
|
+
},
|
|
95
|
+
{ immediate: !0, flush: "post" }
|
|
96
|
+
), L = () => C == null ? void 0 : C.takeRecords(), B = () => {
|
|
97
|
+
H(), A();
|
|
98
|
+
};
|
|
99
|
+
return gn(B), {
|
|
100
|
+
isSupported: O,
|
|
101
|
+
stop: B,
|
|
102
|
+
takeRecords: L
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
function ca(g, w, E = {}) {
|
|
106
|
+
const {
|
|
107
|
+
window: k = _t,
|
|
108
|
+
document: K = k == null ? void 0 : k.document,
|
|
109
|
+
flush: C = "sync"
|
|
110
|
+
} = E;
|
|
111
|
+
if (!k || !K)
|
|
112
|
+
return ra;
|
|
113
|
+
let O;
|
|
114
|
+
const A = (L) => {
|
|
115
|
+
O == null || O(), O = L;
|
|
116
|
+
}, R = hr(() => {
|
|
117
|
+
const L = ze(g);
|
|
118
|
+
if (L) {
|
|
119
|
+
const { stop: B } = ua(
|
|
120
|
+
K,
|
|
121
|
+
(F) => {
|
|
122
|
+
F.map((M) => [...M.removedNodes]).flat().some((M) => M === L || M.contains(L)) && w(F);
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
window: k,
|
|
126
|
+
childList: !0,
|
|
127
|
+
subtree: !0
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
A(B);
|
|
131
|
+
}
|
|
132
|
+
}, { flush: C }), H = () => {
|
|
133
|
+
R(), A();
|
|
134
|
+
};
|
|
135
|
+
return gn(H), H;
|
|
136
|
+
}
|
|
137
|
+
function la(g = {}) {
|
|
138
|
+
var w;
|
|
139
|
+
const {
|
|
140
|
+
window: E = _t,
|
|
141
|
+
deep: k = !0,
|
|
142
|
+
triggerOnRemoval: K = !1
|
|
143
|
+
} = g, C = (w = g.document) != null ? w : E == null ? void 0 : E.document, O = () => {
|
|
144
|
+
var H;
|
|
145
|
+
let L = C == null ? void 0 : C.activeElement;
|
|
146
|
+
if (k)
|
|
147
|
+
for (; L != null && L.shadowRoot; )
|
|
148
|
+
L = (H = L == null ? void 0 : L.shadowRoot) == null ? void 0 : H.activeElement;
|
|
149
|
+
return L;
|
|
150
|
+
}, A = vn(), R = () => {
|
|
151
|
+
A.value = O();
|
|
152
|
+
};
|
|
153
|
+
if (E) {
|
|
154
|
+
const H = {
|
|
155
|
+
capture: !0,
|
|
156
|
+
passive: !0
|
|
157
|
+
};
|
|
158
|
+
pn(
|
|
159
|
+
E,
|
|
160
|
+
"blur",
|
|
161
|
+
(L) => {
|
|
162
|
+
L.relatedTarget === null && R();
|
|
163
|
+
},
|
|
164
|
+
H
|
|
165
|
+
), pn(
|
|
166
|
+
E,
|
|
167
|
+
"focus",
|
|
168
|
+
R,
|
|
169
|
+
H
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
return K && ca(A, R, { document: C }), R(), A;
|
|
173
|
+
}
|
|
174
|
+
function fa(g, w, E = {}) {
|
|
175
|
+
const { window: k = _t, ...K } = E;
|
|
176
|
+
let C;
|
|
177
|
+
const O = oi(() => k && "ResizeObserver" in k), A = () => {
|
|
178
|
+
C && (C.disconnect(), C = void 0);
|
|
179
|
+
}, R = be(() => {
|
|
180
|
+
const B = gt(g);
|
|
181
|
+
return Array.isArray(B) ? B.map((F) => ze(F)) : [ze(B)];
|
|
182
|
+
}), H = st(
|
|
183
|
+
R,
|
|
184
|
+
(B) => {
|
|
185
|
+
if (A(), O.value && k) {
|
|
186
|
+
C = new ResizeObserver(w);
|
|
187
|
+
for (const F of B)
|
|
188
|
+
F && C.observe(F, K);
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
{ immediate: !0, flush: "post" }
|
|
192
|
+
), L = () => {
|
|
193
|
+
A(), H();
|
|
194
|
+
};
|
|
195
|
+
return gn(L), {
|
|
196
|
+
isSupported: O,
|
|
197
|
+
stop: L
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
function si(g, w = { width: 0, height: 0 }, E = {}) {
|
|
201
|
+
const { window: k = _t, box: K = "content-box" } = E, C = be(() => {
|
|
202
|
+
var B, F;
|
|
203
|
+
return (F = (B = ze(g)) == null ? void 0 : B.namespaceURI) == null ? void 0 : F.includes("svg");
|
|
204
|
+
}), O = vn(w.width), A = vn(w.height), { stop: R } = fa(
|
|
205
|
+
g,
|
|
206
|
+
([B]) => {
|
|
207
|
+
const F = K === "border-box" ? B.borderBoxSize : K === "content-box" ? B.contentBoxSize : B.devicePixelContentBoxSize;
|
|
208
|
+
if (k && C.value) {
|
|
209
|
+
const ee = ze(g);
|
|
210
|
+
if (ee) {
|
|
211
|
+
const M = ee.getBoundingClientRect();
|
|
212
|
+
O.value = M.width, A.value = M.height;
|
|
213
|
+
}
|
|
214
|
+
} else if (F) {
|
|
215
|
+
const ee = Bt(F);
|
|
216
|
+
O.value = ee.reduce((M, { inlineSize: ie }) => M + ie, 0), A.value = ee.reduce((M, { blockSize: ie }) => M + ie, 0);
|
|
217
|
+
} else
|
|
218
|
+
O.value = B.contentRect.width, A.value = B.contentRect.height;
|
|
219
|
+
},
|
|
220
|
+
E
|
|
221
|
+
);
|
|
222
|
+
aa(() => {
|
|
223
|
+
const B = ze(g);
|
|
224
|
+
B && (O.value = "offsetWidth" in B ? B.offsetWidth : w.width, A.value = "offsetHeight" in B ? B.offsetHeight : w.height);
|
|
225
|
+
});
|
|
226
|
+
const H = st(
|
|
227
|
+
() => ze(g),
|
|
228
|
+
(B) => {
|
|
229
|
+
O.value = B ? w.width : 0, A.value = B ? w.height : 0;
|
|
230
|
+
}
|
|
231
|
+
);
|
|
232
|
+
function L() {
|
|
233
|
+
R(), H();
|
|
234
|
+
}
|
|
235
|
+
return {
|
|
236
|
+
width: O,
|
|
237
|
+
height: A,
|
|
238
|
+
stop: L
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
var ha = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
242
|
+
function da(g) {
|
|
243
|
+
return g && g.__esModule && Object.prototype.hasOwnProperty.call(g, "default") ? g.default : g;
|
|
244
|
+
}
|
|
245
|
+
var dn = { exports: {} }, va = dn.exports, Qr;
|
|
246
|
+
function pa() {
|
|
247
|
+
return Qr || (Qr = 1, function(g, w) {
|
|
248
|
+
(function(E, k) {
|
|
249
|
+
g.exports = k();
|
|
250
|
+
})(va, function() {
|
|
251
|
+
var E = function(e, t) {
|
|
252
|
+
return (E = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, r) {
|
|
253
|
+
n.__proto__ = r;
|
|
254
|
+
} || function(n, r) {
|
|
255
|
+
for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (n[i] = r[i]);
|
|
256
|
+
})(e, t);
|
|
257
|
+
}, k = function() {
|
|
258
|
+
return (k = Object.assign || function(e) {
|
|
259
|
+
for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n]) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
260
|
+
return e;
|
|
261
|
+
}).apply(this, arguments);
|
|
262
|
+
};
|
|
263
|
+
function K(e, t, n) {
|
|
264
|
+
for (var r, i = 0, a = t.length; i < a; i++) !r && i in t || ((r = r || Array.prototype.slice.call(t, 0, i))[i] = t[i]);
|
|
265
|
+
return e.concat(r || Array.prototype.slice.call(t));
|
|
266
|
+
}
|
|
267
|
+
var C = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : ha, O = Object.keys, A = Array.isArray;
|
|
268
|
+
function R(e, t) {
|
|
269
|
+
return typeof t != "object" || O(t).forEach(function(n) {
|
|
270
|
+
e[n] = t[n];
|
|
271
|
+
}), e;
|
|
272
|
+
}
|
|
273
|
+
typeof Promise > "u" || C.Promise || (C.Promise = Promise);
|
|
274
|
+
var H = Object.getPrototypeOf, L = {}.hasOwnProperty;
|
|
275
|
+
function B(e, t) {
|
|
276
|
+
return L.call(e, t);
|
|
277
|
+
}
|
|
278
|
+
function F(e, t) {
|
|
279
|
+
typeof t == "function" && (t = t(H(e))), (typeof Reflect > "u" ? O : Reflect.ownKeys)(t).forEach(function(n) {
|
|
280
|
+
M(e, n, t[n]);
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
var ee = Object.defineProperty;
|
|
284
|
+
function M(e, t, n, r) {
|
|
285
|
+
ee(e, t, R(n && B(n, "get") && typeof n.get == "function" ? { get: n.get, set: n.set, configurable: !0 } : { value: n, configurable: !0, writable: !0 }, r));
|
|
286
|
+
}
|
|
287
|
+
function ie(e) {
|
|
288
|
+
return { from: function(t) {
|
|
289
|
+
return e.prototype = Object.create(t.prototype), M(e.prototype, "constructor", e), { extend: F.bind(null, e.prototype) };
|
|
290
|
+
} };
|
|
291
|
+
}
|
|
292
|
+
var je = Object.getOwnPropertyDescriptor, Ie = [].slice;
|
|
293
|
+
function Re(e, t, n) {
|
|
294
|
+
return Ie.call(e, t, n);
|
|
295
|
+
}
|
|
296
|
+
function Pe(e, t) {
|
|
297
|
+
return t(e);
|
|
298
|
+
}
|
|
299
|
+
function ge(e) {
|
|
300
|
+
if (!e) throw new Error("Assertion Failed");
|
|
301
|
+
}
|
|
302
|
+
function W(e) {
|
|
303
|
+
C.setImmediate ? setImmediate(e) : setTimeout(e, 0);
|
|
304
|
+
}
|
|
305
|
+
function ne(e, t) {
|
|
306
|
+
if (typeof t == "string" && B(e, t)) return e[t];
|
|
307
|
+
if (!t) return e;
|
|
308
|
+
if (typeof t != "string") {
|
|
309
|
+
for (var n = [], r = 0, i = t.length; r < i; ++r) {
|
|
310
|
+
var a = ne(e, t[r]);
|
|
311
|
+
n.push(a);
|
|
312
|
+
}
|
|
313
|
+
return n;
|
|
314
|
+
}
|
|
315
|
+
var o = t.indexOf(".");
|
|
316
|
+
if (o !== -1) {
|
|
317
|
+
var s = e[t.substr(0, o)];
|
|
318
|
+
return s == null ? void 0 : ne(s, t.substr(o + 1));
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
function se(e, t, n) {
|
|
322
|
+
if (e && t !== void 0 && !("isFrozen" in Object && Object.isFrozen(e))) if (typeof t != "string" && "length" in t) {
|
|
323
|
+
ge(typeof n != "string" && "length" in n);
|
|
324
|
+
for (var r = 0, i = t.length; r < i; ++r) se(e, t[r], n[r]);
|
|
325
|
+
} else {
|
|
326
|
+
var a, o, s = t.indexOf(".");
|
|
327
|
+
s !== -1 ? (a = t.substr(0, s), (o = t.substr(s + 1)) === "" ? n === void 0 ? A(e) && !isNaN(parseInt(a)) ? e.splice(a, 1) : delete e[a] : e[a] = n : se(s = !(s = e[a]) || !B(e, a) ? e[a] = {} : s, o, n)) : n === void 0 ? A(e) && !isNaN(parseInt(t)) ? e.splice(t, 1) : delete e[t] : e[t] = n;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
function We(e) {
|
|
331
|
+
var t, n = {};
|
|
332
|
+
for (t in e) B(e, t) && (n[t] = e[t]);
|
|
333
|
+
return n;
|
|
334
|
+
}
|
|
335
|
+
var bn = [].concat;
|
|
336
|
+
function _n(e) {
|
|
337
|
+
return bn.apply([], e);
|
|
338
|
+
}
|
|
339
|
+
var Ge = "BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(_n([8, 16, 32, 64].map(function(e) {
|
|
340
|
+
return ["Int", "Uint", "Float"].map(function(t) {
|
|
341
|
+
return t + e + "Array";
|
|
342
|
+
});
|
|
343
|
+
}))).filter(function(e) {
|
|
344
|
+
return C[e];
|
|
345
|
+
}), pr = new Set(Ge.map(function(e) {
|
|
346
|
+
return C[e];
|
|
347
|
+
})), wt = null;
|
|
348
|
+
function Ue(e) {
|
|
349
|
+
return wt = /* @__PURE__ */ new WeakMap(), e = function t(n) {
|
|
350
|
+
if (!n || typeof n != "object") return n;
|
|
351
|
+
var r = wt.get(n);
|
|
352
|
+
if (r) return r;
|
|
353
|
+
if (A(n)) {
|
|
354
|
+
r = [], wt.set(n, r);
|
|
355
|
+
for (var i = 0, a = n.length; i < a; ++i) r.push(t(n[i]));
|
|
356
|
+
} else if (pr.has(n.constructor)) r = n;
|
|
357
|
+
else {
|
|
358
|
+
var o, s = H(n);
|
|
359
|
+
for (o in r = s === Object.prototype ? {} : Object.create(s), wt.set(n, r), n) B(n, o) && (r[o] = t(n[o]));
|
|
360
|
+
}
|
|
361
|
+
return r;
|
|
362
|
+
}(e), wt = null, e;
|
|
363
|
+
}
|
|
364
|
+
var hi = {}.toString;
|
|
365
|
+
function wn(e) {
|
|
366
|
+
return hi.call(e).slice(8, -1);
|
|
367
|
+
}
|
|
368
|
+
var kn = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", di = typeof kn == "symbol" ? function(e) {
|
|
369
|
+
var t;
|
|
370
|
+
return e != null && (t = e[kn]) && t.apply(e);
|
|
371
|
+
} : function() {
|
|
372
|
+
return null;
|
|
373
|
+
};
|
|
374
|
+
function Ye(e, t) {
|
|
375
|
+
return t = e.indexOf(t), 0 <= t && e.splice(t, 1), 0 <= t;
|
|
376
|
+
}
|
|
377
|
+
var ut = {};
|
|
378
|
+
function Ke(e) {
|
|
379
|
+
var t, n, r, i;
|
|
380
|
+
if (arguments.length === 1) {
|
|
381
|
+
if (A(e)) return e.slice();
|
|
382
|
+
if (this === ut && typeof e == "string") return [e];
|
|
383
|
+
if (i = di(e)) {
|
|
384
|
+
for (n = []; !(r = i.next()).done; ) n.push(r.value);
|
|
385
|
+
return n;
|
|
386
|
+
}
|
|
387
|
+
if (e == null) return [e];
|
|
388
|
+
if (typeof (t = e.length) != "number") return [e];
|
|
389
|
+
for (n = new Array(t); t--; ) n[t] = e[t];
|
|
390
|
+
return n;
|
|
391
|
+
}
|
|
392
|
+
for (t = arguments.length, n = new Array(t); t--; ) n[t] = arguments[t];
|
|
393
|
+
return n;
|
|
394
|
+
}
|
|
395
|
+
var xn = typeof Symbol < "u" ? function(e) {
|
|
396
|
+
return e[Symbol.toStringTag] === "AsyncFunction";
|
|
397
|
+
} : function() {
|
|
398
|
+
return !1;
|
|
399
|
+
}, Ct = ["Unknown", "Constraint", "Data", "TransactionInactive", "ReadOnly", "Version", "NotFound", "InvalidState", "InvalidAccess", "Abort", "Timeout", "QuotaExceeded", "Syntax", "DataClone"], xe = ["Modify", "Bulk", "OpenFailed", "VersionChange", "Schema", "Upgrade", "InvalidTable", "MissingAPI", "NoSuchDatabase", "InvalidArgument", "SubTransaction", "Unsupported", "Internal", "DatabaseClosed", "PrematureCommit", "ForeignAwait"].concat(Ct), vi = { VersionChanged: "Database version changed by other database connection", DatabaseClosed: "Database has been closed", Abort: "Transaction aborted", TransactionInactive: "Transaction has already completed or failed", MissingAPI: "IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb" };
|
|
400
|
+
function ct(e, t) {
|
|
401
|
+
this.name = e, this.message = t;
|
|
402
|
+
}
|
|
403
|
+
function yr(e, t) {
|
|
404
|
+
return e + ". Errors: " + Object.keys(t).map(function(n) {
|
|
405
|
+
return t[n].toString();
|
|
406
|
+
}).filter(function(n, r, i) {
|
|
407
|
+
return i.indexOf(n) === r;
|
|
408
|
+
}).join(`
|
|
409
|
+
`);
|
|
410
|
+
}
|
|
411
|
+
function qt(e, t, n, r) {
|
|
412
|
+
this.failures = t, this.failedKeys = r, this.successCount = n, this.message = yr(e, t);
|
|
413
|
+
}
|
|
414
|
+
function lt(e, t) {
|
|
415
|
+
this.name = "BulkError", this.failures = Object.keys(t).map(function(n) {
|
|
416
|
+
return t[n];
|
|
417
|
+
}), this.failuresByPos = t, this.message = yr(e, this.failures);
|
|
418
|
+
}
|
|
419
|
+
ie(ct).from(Error).extend({ toString: function() {
|
|
420
|
+
return this.name + ": " + this.message;
|
|
421
|
+
} }), ie(qt).from(ct), ie(lt).from(ct);
|
|
422
|
+
var Cn = xe.reduce(function(e, t) {
|
|
423
|
+
return e[t] = t + "Error", e;
|
|
424
|
+
}, {}), pi = ct, V = xe.reduce(function(e, t) {
|
|
425
|
+
var n = t + "Error";
|
|
426
|
+
function r(i, a) {
|
|
427
|
+
this.name = n, i ? typeof i == "string" ? (this.message = "".concat(i).concat(a ? `
|
|
428
|
+
` + a : ""), this.inner = a || null) : typeof i == "object" && (this.message = "".concat(i.name, " ").concat(i.message), this.inner = i) : (this.message = vi[t] || n, this.inner = null);
|
|
429
|
+
}
|
|
430
|
+
return ie(r).from(pi), e[t] = r, e;
|
|
431
|
+
}, {});
|
|
432
|
+
V.Syntax = SyntaxError, V.Type = TypeError, V.Range = RangeError;
|
|
433
|
+
var mr = Ct.reduce(function(e, t) {
|
|
434
|
+
return e[t + "Error"] = V[t], e;
|
|
435
|
+
}, {}), Mt = xe.reduce(function(e, t) {
|
|
436
|
+
return ["Syntax", "Type", "Range"].indexOf(t) === -1 && (e[t + "Error"] = V[t]), e;
|
|
437
|
+
}, {});
|
|
438
|
+
function re() {
|
|
439
|
+
}
|
|
440
|
+
function kt(e) {
|
|
441
|
+
return e;
|
|
442
|
+
}
|
|
443
|
+
function yi(e, t) {
|
|
444
|
+
return e == null || e === kt ? t : function(n) {
|
|
445
|
+
return t(e(n));
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
function Xe(e, t) {
|
|
449
|
+
return function() {
|
|
450
|
+
e.apply(this, arguments), t.apply(this, arguments);
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
function mi(e, t) {
|
|
454
|
+
return e === re ? t : function() {
|
|
455
|
+
var n = e.apply(this, arguments);
|
|
456
|
+
n !== void 0 && (arguments[0] = n);
|
|
457
|
+
var r = this.onsuccess, i = this.onerror;
|
|
458
|
+
this.onsuccess = null, this.onerror = null;
|
|
459
|
+
var a = t.apply(this, arguments);
|
|
460
|
+
return r && (this.onsuccess = this.onsuccess ? Xe(r, this.onsuccess) : r), i && (this.onerror = this.onerror ? Xe(i, this.onerror) : i), a !== void 0 ? a : n;
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
function gi(e, t) {
|
|
464
|
+
return e === re ? t : function() {
|
|
465
|
+
e.apply(this, arguments);
|
|
466
|
+
var n = this.onsuccess, r = this.onerror;
|
|
467
|
+
this.onsuccess = this.onerror = null, t.apply(this, arguments), n && (this.onsuccess = this.onsuccess ? Xe(n, this.onsuccess) : n), r && (this.onerror = this.onerror ? Xe(r, this.onerror) : r);
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
function bi(e, t) {
|
|
471
|
+
return e === re ? t : function(n) {
|
|
472
|
+
var r = e.apply(this, arguments);
|
|
473
|
+
R(n, r);
|
|
474
|
+
var i = this.onsuccess, a = this.onerror;
|
|
475
|
+
return this.onsuccess = null, this.onerror = null, n = t.apply(this, arguments), i && (this.onsuccess = this.onsuccess ? Xe(i, this.onsuccess) : i), a && (this.onerror = this.onerror ? Xe(a, this.onerror) : a), r === void 0 ? n === void 0 ? void 0 : n : R(r, n);
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
function _i(e, t) {
|
|
479
|
+
return e === re ? t : function() {
|
|
480
|
+
return t.apply(this, arguments) !== !1 && e.apply(this, arguments);
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
function En(e, t) {
|
|
484
|
+
return e === re ? t : function() {
|
|
485
|
+
var n = e.apply(this, arguments);
|
|
486
|
+
if (n && typeof n.then == "function") {
|
|
487
|
+
for (var r = this, i = arguments.length, a = new Array(i); i--; ) a[i] = arguments[i];
|
|
488
|
+
return n.then(function() {
|
|
489
|
+
return t.apply(r, a);
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
return t.apply(this, arguments);
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
Mt.ModifyError = qt, Mt.DexieError = ct, Mt.BulkError = lt;
|
|
496
|
+
var Ee = typeof location < "u" && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
|
|
497
|
+
function gr(e) {
|
|
498
|
+
Ee = e;
|
|
499
|
+
}
|
|
500
|
+
var xt = {}, br = 100, Ge = typeof Promise > "u" ? [] : function() {
|
|
501
|
+
var e = Promise.resolve();
|
|
502
|
+
if (typeof crypto > "u" || !crypto.subtle) return [e, H(e), e];
|
|
503
|
+
var t = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
|
|
504
|
+
return [t, H(t), e];
|
|
505
|
+
}(), Ct = Ge[0], xe = Ge[1], Ge = Ge[2], xe = xe && xe.then, Qe = Ct && Ct.constructor, On = !!Ge, Et = function(e, t) {
|
|
506
|
+
Ot.push([e, t]), Lt && (queueMicrotask(ki), Lt = !1);
|
|
507
|
+
}, Sn = !0, Lt = !0, Ze = [], Nt = [], Pn = kt, Be = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: re, pgp: !1, env: {}, finalize: re }, N = Be, Ot = [], Je = 0, $t = [];
|
|
508
|
+
function I(e) {
|
|
509
|
+
if (typeof this != "object") throw new TypeError("Promises must be constructed via new");
|
|
510
|
+
this._listeners = [], this._lib = !1;
|
|
511
|
+
var t = this._PSD = N;
|
|
512
|
+
if (typeof e != "function") {
|
|
513
|
+
if (e !== xt) throw new TypeError("Not a function");
|
|
514
|
+
return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && Dn(this, this._value));
|
|
515
|
+
}
|
|
516
|
+
this._state = null, this._value = null, ++t.ref, function n(r, i) {
|
|
517
|
+
try {
|
|
518
|
+
i(function(a) {
|
|
519
|
+
if (r._state === null) {
|
|
520
|
+
if (a === r) throw new TypeError("A promise cannot be resolved with itself.");
|
|
521
|
+
var o = r._lib && ft();
|
|
522
|
+
a && typeof a.then == "function" ? n(r, function(s, c) {
|
|
523
|
+
a instanceof I ? a._then(s, c) : a.then(s, c);
|
|
524
|
+
}) : (r._state = !0, r._value = a, wr(r)), o && ht();
|
|
525
|
+
}
|
|
526
|
+
}, Dn.bind(null, r));
|
|
527
|
+
} catch (a) {
|
|
528
|
+
Dn(r, a);
|
|
529
|
+
}
|
|
530
|
+
}(this, e);
|
|
531
|
+
}
|
|
532
|
+
var Kn = { get: function() {
|
|
533
|
+
var e = N, t = Wt;
|
|
534
|
+
function n(r, i) {
|
|
535
|
+
var a = this, o = !e.global && (e !== N || t !== Wt), s = o && !Me(), c = new I(function(f, v) {
|
|
536
|
+
An(a, new _r(xr(r, e, o, s), xr(i, e, o, s), f, v, e));
|
|
537
|
+
});
|
|
538
|
+
return this._consoleTask && (c._consoleTask = this._consoleTask), c;
|
|
539
|
+
}
|
|
540
|
+
return n.prototype = xt, n;
|
|
541
|
+
}, set: function(e) {
|
|
542
|
+
M(this, "then", e && e.prototype === xt ? Kn : { get: function() {
|
|
543
|
+
return e;
|
|
544
|
+
}, set: Kn.set });
|
|
545
|
+
} };
|
|
546
|
+
function _r(e, t, n, r, i) {
|
|
547
|
+
this.onFulfilled = typeof e == "function" ? e : null, this.onRejected = typeof t == "function" ? t : null, this.resolve = n, this.reject = r, this.psd = i;
|
|
548
|
+
}
|
|
549
|
+
function Dn(e, t) {
|
|
550
|
+
var n, r;
|
|
551
|
+
Nt.push(t), e._state === null && (n = e._lib && ft(), t = Pn(t), e._state = !1, e._value = t, r = e, Ze.some(function(i) {
|
|
552
|
+
return i._value === r._value;
|
|
553
|
+
}) || Ze.push(r), wr(e), n && ht());
|
|
554
|
+
}
|
|
555
|
+
function wr(e) {
|
|
556
|
+
var t = e._listeners;
|
|
557
|
+
e._listeners = [];
|
|
558
|
+
for (var n = 0, r = t.length; n < r; ++n) An(e, t[n]);
|
|
559
|
+
var i = e._PSD;
|
|
560
|
+
--i.ref || i.finalize(), Je === 0 && (++Je, Et(function() {
|
|
561
|
+
--Je == 0 && zn();
|
|
562
|
+
}, []));
|
|
563
|
+
}
|
|
564
|
+
function An(e, t) {
|
|
565
|
+
if (e._state !== null) {
|
|
566
|
+
var n = e._state ? t.onFulfilled : t.onRejected;
|
|
567
|
+
if (n === null) return (e._state ? t.resolve : t.reject)(e._value);
|
|
568
|
+
++t.psd.ref, ++Je, Et(wi, [n, e, t]);
|
|
569
|
+
} else e._listeners.push(t);
|
|
570
|
+
}
|
|
571
|
+
function wi(e, t, n) {
|
|
572
|
+
try {
|
|
573
|
+
var r, i = t._value;
|
|
574
|
+
!t._state && Nt.length && (Nt = []), r = Ee && t._consoleTask ? t._consoleTask.run(function() {
|
|
575
|
+
return e(i);
|
|
576
|
+
}) : e(i), t._state || Nt.indexOf(i) !== -1 || function(a) {
|
|
577
|
+
for (var o = Ze.length; o; ) if (Ze[--o]._value === a._value) return Ze.splice(o, 1);
|
|
578
|
+
}(t), n.resolve(r);
|
|
579
|
+
} catch (a) {
|
|
580
|
+
n.reject(a);
|
|
581
|
+
} finally {
|
|
582
|
+
--Je == 0 && zn(), --n.psd.ref || n.psd.finalize();
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
function ki() {
|
|
586
|
+
et(Be, function() {
|
|
587
|
+
ft() && ht();
|
|
588
|
+
});
|
|
589
|
+
}
|
|
590
|
+
function ft() {
|
|
591
|
+
var e = Sn;
|
|
592
|
+
return Lt = Sn = !1, e;
|
|
593
|
+
}
|
|
594
|
+
function ht() {
|
|
595
|
+
var e, t, n;
|
|
596
|
+
do
|
|
597
|
+
for (; 0 < Ot.length; ) for (e = Ot, Ot = [], n = e.length, t = 0; t < n; ++t) {
|
|
598
|
+
var r = e[t];
|
|
599
|
+
r[0].apply(null, r[1]);
|
|
600
|
+
}
|
|
601
|
+
while (0 < Ot.length);
|
|
602
|
+
Lt = Sn = !0;
|
|
603
|
+
}
|
|
604
|
+
function zn() {
|
|
605
|
+
var e = Ze;
|
|
606
|
+
Ze = [], e.forEach(function(r) {
|
|
607
|
+
r._PSD.onunhandled.call(null, r._value, r);
|
|
608
|
+
});
|
|
609
|
+
for (var t = $t.slice(0), n = t.length; n; ) t[--n]();
|
|
610
|
+
}
|
|
611
|
+
function Ft(e) {
|
|
612
|
+
return new I(xt, !1, e);
|
|
613
|
+
}
|
|
614
|
+
function oe(e, t) {
|
|
615
|
+
var n = N;
|
|
616
|
+
return function() {
|
|
617
|
+
var r = ft(), i = N;
|
|
618
|
+
try {
|
|
619
|
+
return Le(n, !0), e.apply(this, arguments);
|
|
620
|
+
} catch (a) {
|
|
621
|
+
t && t(a);
|
|
622
|
+
} finally {
|
|
623
|
+
Le(i, !1), r && ht();
|
|
624
|
+
}
|
|
625
|
+
};
|
|
626
|
+
}
|
|
627
|
+
F(I.prototype, { then: Kn, _then: function(e, t) {
|
|
628
|
+
An(this, new _r(null, null, e, t, N));
|
|
629
|
+
}, catch: function(e) {
|
|
630
|
+
if (arguments.length === 1) return this.then(null, e);
|
|
631
|
+
var t = e, n = arguments[1];
|
|
632
|
+
return typeof t == "function" ? this.then(null, function(r) {
|
|
633
|
+
return (r instanceof t ? n : Ft)(r);
|
|
634
|
+
}) : this.then(null, function(r) {
|
|
635
|
+
return (r && r.name === t ? n : Ft)(r);
|
|
636
|
+
});
|
|
637
|
+
}, finally: function(e) {
|
|
638
|
+
return this.then(function(t) {
|
|
639
|
+
return I.resolve(e()).then(function() {
|
|
640
|
+
return t;
|
|
641
|
+
});
|
|
642
|
+
}, function(t) {
|
|
643
|
+
return I.resolve(e()).then(function() {
|
|
644
|
+
return Ft(t);
|
|
645
|
+
});
|
|
646
|
+
});
|
|
647
|
+
}, timeout: function(e, t) {
|
|
648
|
+
var n = this;
|
|
649
|
+
return e < 1 / 0 ? new I(function(r, i) {
|
|
650
|
+
var a = setTimeout(function() {
|
|
651
|
+
return i(new V.Timeout(t));
|
|
652
|
+
}, e);
|
|
653
|
+
n.then(r, i).finally(clearTimeout.bind(null, a));
|
|
654
|
+
}) : this;
|
|
655
|
+
} }), typeof Symbol < "u" && Symbol.toStringTag && M(I.prototype, Symbol.toStringTag, "Dexie.Promise"), Be.env = kr(), F(I, { all: function() {
|
|
656
|
+
var e = Ke.apply(null, arguments).map(Ut);
|
|
657
|
+
return new I(function(t, n) {
|
|
658
|
+
e.length === 0 && t([]);
|
|
659
|
+
var r = e.length;
|
|
660
|
+
e.forEach(function(i, a) {
|
|
661
|
+
return I.resolve(i).then(function(o) {
|
|
662
|
+
e[a] = o, --r || t(e);
|
|
663
|
+
}, n);
|
|
664
|
+
});
|
|
665
|
+
});
|
|
666
|
+
}, resolve: function(e) {
|
|
667
|
+
return e instanceof I ? e : e && typeof e.then == "function" ? new I(function(t, n) {
|
|
668
|
+
e.then(t, n);
|
|
669
|
+
}) : new I(xt, !0, e);
|
|
670
|
+
}, reject: Ft, race: function() {
|
|
671
|
+
var e = Ke.apply(null, arguments).map(Ut);
|
|
672
|
+
return new I(function(t, n) {
|
|
673
|
+
e.map(function(r) {
|
|
674
|
+
return I.resolve(r).then(t, n);
|
|
675
|
+
});
|
|
676
|
+
});
|
|
677
|
+
}, PSD: { get: function() {
|
|
678
|
+
return N;
|
|
679
|
+
}, set: function(e) {
|
|
680
|
+
return N = e;
|
|
681
|
+
} }, totalEchoes: { get: function() {
|
|
682
|
+
return Wt;
|
|
683
|
+
} }, newPSD: qe, usePSD: et, scheduler: { get: function() {
|
|
684
|
+
return Et;
|
|
685
|
+
}, set: function(e) {
|
|
686
|
+
Et = e;
|
|
687
|
+
} }, rejectionMapper: { get: function() {
|
|
688
|
+
return Pn;
|
|
689
|
+
}, set: function(e) {
|
|
690
|
+
Pn = e;
|
|
691
|
+
} }, follow: function(e, t) {
|
|
692
|
+
return new I(function(n, r) {
|
|
693
|
+
return qe(function(i, a) {
|
|
694
|
+
var o = N;
|
|
695
|
+
o.unhandleds = [], o.onunhandled = a, o.finalize = Xe(function() {
|
|
696
|
+
var s, c = this;
|
|
697
|
+
s = function() {
|
|
698
|
+
c.unhandleds.length === 0 ? i() : a(c.unhandleds[0]);
|
|
699
|
+
}, $t.push(function f() {
|
|
700
|
+
s(), $t.splice($t.indexOf(f), 1);
|
|
701
|
+
}), ++Je, Et(function() {
|
|
702
|
+
--Je == 0 && zn();
|
|
703
|
+
}, []);
|
|
704
|
+
}, o.finalize), e();
|
|
705
|
+
}, t, n, r);
|
|
706
|
+
});
|
|
707
|
+
} }), Qe && (Qe.allSettled && M(I, "allSettled", function() {
|
|
708
|
+
var e = Ke.apply(null, arguments).map(Ut);
|
|
709
|
+
return new I(function(t) {
|
|
710
|
+
e.length === 0 && t([]);
|
|
711
|
+
var n = e.length, r = new Array(n);
|
|
712
|
+
e.forEach(function(i, a) {
|
|
713
|
+
return I.resolve(i).then(function(o) {
|
|
714
|
+
return r[a] = { status: "fulfilled", value: o };
|
|
715
|
+
}, function(o) {
|
|
716
|
+
return r[a] = { status: "rejected", reason: o };
|
|
717
|
+
}).then(function() {
|
|
718
|
+
return --n || t(r);
|
|
719
|
+
});
|
|
720
|
+
});
|
|
721
|
+
});
|
|
722
|
+
}), Qe.any && typeof AggregateError < "u" && M(I, "any", function() {
|
|
723
|
+
var e = Ke.apply(null, arguments).map(Ut);
|
|
724
|
+
return new I(function(t, n) {
|
|
725
|
+
e.length === 0 && n(new AggregateError([]));
|
|
726
|
+
var r = e.length, i = new Array(r);
|
|
727
|
+
e.forEach(function(a, o) {
|
|
728
|
+
return I.resolve(a).then(function(s) {
|
|
729
|
+
return t(s);
|
|
730
|
+
}, function(s) {
|
|
731
|
+
i[o] = s, --r || n(new AggregateError(i));
|
|
732
|
+
});
|
|
733
|
+
});
|
|
734
|
+
});
|
|
735
|
+
}), Qe.withResolvers && (I.withResolvers = Qe.withResolvers));
|
|
736
|
+
var le = { awaits: 0, echoes: 0, id: 0 }, xi = 0, Vt = [], Ht = 0, Wt = 0, Ci = 0;
|
|
737
|
+
function qe(e, t, n, r) {
|
|
738
|
+
var i = N, a = Object.create(i);
|
|
739
|
+
return a.parent = i, a.ref = 0, a.global = !1, a.id = ++Ci, Be.env, a.env = On ? { Promise: I, PromiseProp: { value: I, configurable: !0, writable: !0 }, all: I.all, race: I.race, allSettled: I.allSettled, any: I.any, resolve: I.resolve, reject: I.reject } : {}, t && R(a, t), ++i.ref, a.finalize = function() {
|
|
740
|
+
--this.parent.ref || this.parent.finalize();
|
|
741
|
+
}, r = et(a, e, n, r), a.ref === 0 && a.finalize(), r;
|
|
742
|
+
}
|
|
743
|
+
function dt() {
|
|
744
|
+
return le.id || (le.id = ++xi), ++le.awaits, le.echoes += br, le.id;
|
|
745
|
+
}
|
|
746
|
+
function Me() {
|
|
747
|
+
return !!le.awaits && (--le.awaits == 0 && (le.id = 0), le.echoes = le.awaits * br, !0);
|
|
748
|
+
}
|
|
749
|
+
function Ut(e) {
|
|
750
|
+
return le.echoes && e && e.constructor === Qe ? (dt(), e.then(function(t) {
|
|
751
|
+
return Me(), t;
|
|
752
|
+
}, function(t) {
|
|
753
|
+
return Me(), ue(t);
|
|
754
|
+
})) : e;
|
|
755
|
+
}
|
|
756
|
+
function Ei() {
|
|
757
|
+
var e = Vt[Vt.length - 1];
|
|
758
|
+
Vt.pop(), Le(e, !1);
|
|
759
|
+
}
|
|
760
|
+
function Le(e, t) {
|
|
761
|
+
var n, r = N;
|
|
762
|
+
(t ? !le.echoes || Ht++ && e === N : !Ht || --Ht && e === N) || queueMicrotask(t ? (function(i) {
|
|
763
|
+
++Wt, le.echoes && --le.echoes != 0 || (le.echoes = le.awaits = le.id = 0), Vt.push(N), Le(i, !0);
|
|
764
|
+
}).bind(null, e) : Ei), e !== N && (N = e, r === Be && (Be.env = kr()), On && (n = Be.env.Promise, t = e.env, (r.global || e.global) && (Object.defineProperty(C, "Promise", t.PromiseProp), n.all = t.all, n.race = t.race, n.resolve = t.resolve, n.reject = t.reject, t.allSettled && (n.allSettled = t.allSettled), t.any && (n.any = t.any))));
|
|
765
|
+
}
|
|
766
|
+
function kr() {
|
|
767
|
+
var e = C.Promise;
|
|
768
|
+
return On ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(C, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject } : {};
|
|
769
|
+
}
|
|
770
|
+
function et(e, t, n, r, i) {
|
|
771
|
+
var a = N;
|
|
772
|
+
try {
|
|
773
|
+
return Le(e, !0), t(n, r, i);
|
|
774
|
+
} finally {
|
|
775
|
+
Le(a, !1);
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
function xr(e, t, n, r) {
|
|
779
|
+
return typeof e != "function" ? e : function() {
|
|
780
|
+
var i = N;
|
|
781
|
+
n && dt(), Le(t, !0);
|
|
782
|
+
try {
|
|
783
|
+
return e.apply(this, arguments);
|
|
784
|
+
} finally {
|
|
785
|
+
Le(i, !1), r && queueMicrotask(Me);
|
|
786
|
+
}
|
|
787
|
+
};
|
|
788
|
+
}
|
|
789
|
+
function Tn(e) {
|
|
790
|
+
Promise === Qe && le.echoes === 0 ? Ht === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
791
|
+
}
|
|
792
|
+
("" + xe).indexOf("[native code]") === -1 && (dt = Me = re);
|
|
793
|
+
var ue = I.reject, tt = "", De = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", Cr = "String expected.", vt = [], Yt = "__dbnames", jn = "readonly", In = "readwrite";
|
|
794
|
+
function nt(e, t) {
|
|
795
|
+
return e ? t ? function() {
|
|
796
|
+
return e.apply(this, arguments) && t.apply(this, arguments);
|
|
797
|
+
} : e : t;
|
|
798
|
+
}
|
|
799
|
+
var Er = { type: 3, lower: -1 / 0, lowerOpen: !1, upper: [[]], upperOpen: !1 };
|
|
800
|
+
function Xt(e) {
|
|
801
|
+
return typeof e != "string" || /\./.test(e) ? function(t) {
|
|
802
|
+
return t;
|
|
803
|
+
} : function(t) {
|
|
804
|
+
return t[e] === void 0 && e in t && delete (t = Ue(t))[e], t;
|
|
805
|
+
};
|
|
806
|
+
}
|
|
807
|
+
function Or() {
|
|
808
|
+
throw V.Type();
|
|
809
|
+
}
|
|
810
|
+
function J(e, t) {
|
|
811
|
+
try {
|
|
812
|
+
var n = Sr(e), r = Sr(t);
|
|
813
|
+
if (n !== r) return n === "Array" ? 1 : r === "Array" ? -1 : n === "binary" ? 1 : r === "binary" ? -1 : n === "string" ? 1 : r === "string" ? -1 : n === "Date" ? 1 : r !== "Date" ? NaN : -1;
|
|
814
|
+
switch (n) {
|
|
815
|
+
case "number":
|
|
816
|
+
case "Date":
|
|
817
|
+
case "string":
|
|
818
|
+
return t < e ? 1 : e < t ? -1 : 0;
|
|
819
|
+
case "binary":
|
|
820
|
+
return function(i, a) {
|
|
821
|
+
for (var o = i.length, s = a.length, c = o < s ? o : s, f = 0; f < c; ++f) if (i[f] !== a[f]) return i[f] < a[f] ? -1 : 1;
|
|
822
|
+
return o === s ? 0 : o < s ? -1 : 1;
|
|
823
|
+
}(Pr(e), Pr(t));
|
|
824
|
+
case "Array":
|
|
825
|
+
return function(i, a) {
|
|
826
|
+
for (var o = i.length, s = a.length, c = o < s ? o : s, f = 0; f < c; ++f) {
|
|
827
|
+
var v = J(i[f], a[f]);
|
|
828
|
+
if (v !== 0) return v;
|
|
829
|
+
}
|
|
830
|
+
return o === s ? 0 : o < s ? -1 : 1;
|
|
831
|
+
}(e, t);
|
|
832
|
+
}
|
|
833
|
+
} catch {
|
|
834
|
+
}
|
|
835
|
+
return NaN;
|
|
836
|
+
}
|
|
837
|
+
function Sr(e) {
|
|
838
|
+
var t = typeof e;
|
|
839
|
+
return t != "object" ? t : ArrayBuffer.isView(e) ? "binary" : (e = wn(e), e === "ArrayBuffer" ? "binary" : e);
|
|
840
|
+
}
|
|
841
|
+
function Pr(e) {
|
|
842
|
+
return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
|
|
843
|
+
}
|
|
844
|
+
var Kr = (ae.prototype._trans = function(e, t, n) {
|
|
845
|
+
var r = this._tx || N.trans, i = this.name, a = Ee && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
|
|
846
|
+
function o(f, v, u) {
|
|
847
|
+
if (!u.schema[i]) throw new V.NotFound("Table " + i + " not part of transaction");
|
|
848
|
+
return t(u.idbtrans, u);
|
|
849
|
+
}
|
|
850
|
+
var s = ft();
|
|
851
|
+
try {
|
|
852
|
+
var c = r && r.db._novip === this.db._novip ? r === N.trans ? r._promise(e, o, n) : qe(function() {
|
|
853
|
+
return r._promise(e, o, n);
|
|
854
|
+
}, { trans: r, transless: N.transless || N }) : function f(v, u, y, l) {
|
|
855
|
+
if (v.idbdb && (v._state.openComplete || N.letThrough || v._vip)) {
|
|
856
|
+
var d = v._createTransaction(u, y, v._dbSchema);
|
|
857
|
+
try {
|
|
858
|
+
d.create(), v._state.PR1398_maxLoop = 3;
|
|
859
|
+
} catch (p) {
|
|
860
|
+
return p.name === Cn.InvalidState && v.isOpen() && 0 < --v._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), v.close({ disableAutoOpen: !1 }), v.open().then(function() {
|
|
861
|
+
return f(v, u, y, l);
|
|
862
|
+
})) : ue(p);
|
|
863
|
+
}
|
|
864
|
+
return d._promise(u, function(p, h) {
|
|
865
|
+
return qe(function() {
|
|
866
|
+
return N.trans = d, l(p, h, d);
|
|
867
|
+
});
|
|
868
|
+
}).then(function(p) {
|
|
869
|
+
if (u === "readwrite") try {
|
|
870
|
+
d.idbtrans.commit();
|
|
871
|
+
} catch {
|
|
872
|
+
}
|
|
873
|
+
return u === "readonly" ? p : d._completion.then(function() {
|
|
874
|
+
return p;
|
|
875
|
+
});
|
|
876
|
+
});
|
|
877
|
+
}
|
|
878
|
+
if (v._state.openComplete) return ue(new V.DatabaseClosed(v._state.dbOpenError));
|
|
879
|
+
if (!v._state.isBeingOpened) {
|
|
880
|
+
if (!v._state.autoOpen) return ue(new V.DatabaseClosed());
|
|
881
|
+
v.open().catch(re);
|
|
882
|
+
}
|
|
883
|
+
return v._state.dbReadyPromise.then(function() {
|
|
884
|
+
return f(v, u, y, l);
|
|
885
|
+
});
|
|
886
|
+
}(this.db, e, [this.name], o);
|
|
887
|
+
return a && (c._consoleTask = a, c = c.catch(function(f) {
|
|
888
|
+
return console.trace(f), ue(f);
|
|
889
|
+
})), c;
|
|
890
|
+
} finally {
|
|
891
|
+
s && ht();
|
|
892
|
+
}
|
|
893
|
+
}, ae.prototype.get = function(e, t) {
|
|
894
|
+
var n = this;
|
|
895
|
+
return e && e.constructor === Object ? this.where(e).first(t) : e == null ? ue(new V.Type("Invalid argument to Table.get()")) : this._trans("readonly", function(r) {
|
|
896
|
+
return n.core.get({ trans: r, key: e }).then(function(i) {
|
|
897
|
+
return n.hook.reading.fire(i);
|
|
898
|
+
});
|
|
899
|
+
}).then(t);
|
|
900
|
+
}, ae.prototype.where = function(e) {
|
|
901
|
+
if (typeof e == "string") return new this.db.WhereClause(this, e);
|
|
902
|
+
if (A(e)) return new this.db.WhereClause(this, "[".concat(e.join("+"), "]"));
|
|
903
|
+
var t = O(e);
|
|
904
|
+
if (t.length === 1) return this.where(t[0]).equals(e[t[0]]);
|
|
905
|
+
var n = this.schema.indexes.concat(this.schema.primKey).filter(function(s) {
|
|
906
|
+
if (s.compound && t.every(function(f) {
|
|
907
|
+
return 0 <= s.keyPath.indexOf(f);
|
|
908
|
+
})) {
|
|
909
|
+
for (var c = 0; c < t.length; ++c) if (t.indexOf(s.keyPath[c]) === -1) return !1;
|
|
910
|
+
return !0;
|
|
911
|
+
}
|
|
912
|
+
return !1;
|
|
913
|
+
}).sort(function(s, c) {
|
|
914
|
+
return s.keyPath.length - c.keyPath.length;
|
|
915
|
+
})[0];
|
|
916
|
+
if (n && this.db._maxKey !== tt) {
|
|
917
|
+
var a = n.keyPath.slice(0, t.length);
|
|
918
|
+
return this.where(a).equals(a.map(function(c) {
|
|
919
|
+
return e[c];
|
|
920
|
+
}));
|
|
921
|
+
}
|
|
922
|
+
!n && Ee && console.warn("The query ".concat(JSON.stringify(e), " on ").concat(this.name, " would benefit from a ") + "compound index [".concat(t.join("+"), "]"));
|
|
923
|
+
var r = this.schema.idxByName;
|
|
924
|
+
function i(s, c) {
|
|
925
|
+
return J(s, c) === 0;
|
|
926
|
+
}
|
|
927
|
+
var o = t.reduce(function(u, c) {
|
|
928
|
+
var f = u[0], v = u[1], u = r[c], y = e[c];
|
|
929
|
+
return [f || u, f || !u ? nt(v, u && u.multi ? function(l) {
|
|
930
|
+
return l = ne(l, c), A(l) && l.some(function(d) {
|
|
931
|
+
return i(y, d);
|
|
932
|
+
});
|
|
933
|
+
} : function(l) {
|
|
934
|
+
return i(y, ne(l, c));
|
|
935
|
+
}) : v];
|
|
936
|
+
}, [null, null]), a = o[0], o = o[1];
|
|
937
|
+
return a ? this.where(a.name).equals(e[a.keyPath]).filter(o) : n ? this.filter(o) : this.where(t).equals("");
|
|
938
|
+
}, ae.prototype.filter = function(e) {
|
|
939
|
+
return this.toCollection().and(e);
|
|
940
|
+
}, ae.prototype.count = function(e) {
|
|
941
|
+
return this.toCollection().count(e);
|
|
942
|
+
}, ae.prototype.offset = function(e) {
|
|
943
|
+
return this.toCollection().offset(e);
|
|
944
|
+
}, ae.prototype.limit = function(e) {
|
|
945
|
+
return this.toCollection().limit(e);
|
|
946
|
+
}, ae.prototype.each = function(e) {
|
|
947
|
+
return this.toCollection().each(e);
|
|
948
|
+
}, ae.prototype.toArray = function(e) {
|
|
949
|
+
return this.toCollection().toArray(e);
|
|
950
|
+
}, ae.prototype.toCollection = function() {
|
|
951
|
+
return new this.db.Collection(new this.db.WhereClause(this));
|
|
952
|
+
}, ae.prototype.orderBy = function(e) {
|
|
953
|
+
return new this.db.Collection(new this.db.WhereClause(this, A(e) ? "[".concat(e.join("+"), "]") : e));
|
|
954
|
+
}, ae.prototype.reverse = function() {
|
|
955
|
+
return this.toCollection().reverse();
|
|
956
|
+
}, ae.prototype.mapToClass = function(e) {
|
|
957
|
+
var t, n = this.db, r = this.name;
|
|
958
|
+
function i() {
|
|
959
|
+
return t !== null && t.apply(this, arguments) || this;
|
|
960
|
+
}
|
|
961
|
+
(this.schema.mappedClass = e).prototype instanceof Or && (function(c, f) {
|
|
962
|
+
if (typeof f != "function" && f !== null) throw new TypeError("Class extends value " + String(f) + " is not a constructor or null");
|
|
963
|
+
function v() {
|
|
964
|
+
this.constructor = c;
|
|
965
|
+
}
|
|
966
|
+
E(c, f), c.prototype = f === null ? Object.create(f) : (v.prototype = f.prototype, new v());
|
|
967
|
+
}(i, t = e), Object.defineProperty(i.prototype, "db", { get: function() {
|
|
968
|
+
return n;
|
|
969
|
+
}, enumerable: !1, configurable: !0 }), i.prototype.table = function() {
|
|
970
|
+
return r;
|
|
971
|
+
}, e = i);
|
|
972
|
+
for (var a = /* @__PURE__ */ new Set(), o = e.prototype; o; o = H(o)) Object.getOwnPropertyNames(o).forEach(function(c) {
|
|
973
|
+
return a.add(c);
|
|
974
|
+
});
|
|
975
|
+
function s(c) {
|
|
976
|
+
if (!c) return c;
|
|
977
|
+
var f, v = Object.create(e.prototype);
|
|
978
|
+
for (f in c) if (!a.has(f)) try {
|
|
979
|
+
v[f] = c[f];
|
|
980
|
+
} catch {
|
|
981
|
+
}
|
|
982
|
+
return v;
|
|
983
|
+
}
|
|
984
|
+
return this.schema.readHook && this.hook.reading.unsubscribe(this.schema.readHook), this.schema.readHook = s, this.hook("reading", s), e;
|
|
985
|
+
}, ae.prototype.defineClass = function() {
|
|
986
|
+
return this.mapToClass(function(e) {
|
|
987
|
+
R(this, e);
|
|
988
|
+
});
|
|
989
|
+
}, ae.prototype.add = function(e, t) {
|
|
990
|
+
var n = this, r = this.schema.primKey, i = r.auto, a = r.keyPath, o = e;
|
|
991
|
+
return a && i && (o = Xt(a)(e)), this._trans("readwrite", function(s) {
|
|
992
|
+
return n.core.mutate({ trans: s, type: "add", keys: t != null ? [t] : null, values: [o] });
|
|
993
|
+
}).then(function(s) {
|
|
994
|
+
return s.numFailures ? I.reject(s.failures[0]) : s.lastResult;
|
|
995
|
+
}).then(function(s) {
|
|
996
|
+
if (a) try {
|
|
997
|
+
se(e, a, s);
|
|
998
|
+
} catch {
|
|
999
|
+
}
|
|
1000
|
+
return s;
|
|
1001
|
+
});
|
|
1002
|
+
}, ae.prototype.update = function(e, t) {
|
|
1003
|
+
return typeof e != "object" || A(e) ? this.where(":id").equals(e).modify(t) : (e = ne(e, this.schema.primKey.keyPath), e === void 0 ? ue(new V.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(t));
|
|
1004
|
+
}, ae.prototype.put = function(e, t) {
|
|
1005
|
+
var n = this, r = this.schema.primKey, i = r.auto, a = r.keyPath, o = e;
|
|
1006
|
+
return a && i && (o = Xt(a)(e)), this._trans("readwrite", function(s) {
|
|
1007
|
+
return n.core.mutate({ trans: s, type: "put", values: [o], keys: t != null ? [t] : null });
|
|
1008
|
+
}).then(function(s) {
|
|
1009
|
+
return s.numFailures ? I.reject(s.failures[0]) : s.lastResult;
|
|
1010
|
+
}).then(function(s) {
|
|
1011
|
+
if (a) try {
|
|
1012
|
+
se(e, a, s);
|
|
1013
|
+
} catch {
|
|
1014
|
+
}
|
|
1015
|
+
return s;
|
|
1016
|
+
});
|
|
1017
|
+
}, ae.prototype.delete = function(e) {
|
|
1018
|
+
var t = this;
|
|
1019
|
+
return this._trans("readwrite", function(n) {
|
|
1020
|
+
return t.core.mutate({ trans: n, type: "delete", keys: [e] });
|
|
1021
|
+
}).then(function(n) {
|
|
1022
|
+
return n.numFailures ? I.reject(n.failures[0]) : void 0;
|
|
1023
|
+
});
|
|
1024
|
+
}, ae.prototype.clear = function() {
|
|
1025
|
+
var e = this;
|
|
1026
|
+
return this._trans("readwrite", function(t) {
|
|
1027
|
+
return e.core.mutate({ trans: t, type: "deleteRange", range: Er });
|
|
1028
|
+
}).then(function(t) {
|
|
1029
|
+
return t.numFailures ? I.reject(t.failures[0]) : void 0;
|
|
1030
|
+
});
|
|
1031
|
+
}, ae.prototype.bulkGet = function(e) {
|
|
1032
|
+
var t = this;
|
|
1033
|
+
return this._trans("readonly", function(n) {
|
|
1034
|
+
return t.core.getMany({ keys: e, trans: n }).then(function(r) {
|
|
1035
|
+
return r.map(function(i) {
|
|
1036
|
+
return t.hook.reading.fire(i);
|
|
1037
|
+
});
|
|
1038
|
+
});
|
|
1039
|
+
});
|
|
1040
|
+
}, ae.prototype.bulkAdd = function(e, t, n) {
|
|
1041
|
+
var r = this, i = Array.isArray(t) ? t : void 0, a = (n = n || (i ? void 0 : t)) ? n.allKeys : void 0;
|
|
1042
|
+
return this._trans("readwrite", function(o) {
|
|
1043
|
+
var f = r.schema.primKey, s = f.auto, f = f.keyPath;
|
|
1044
|
+
if (f && i) throw new V.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
1045
|
+
if (i && i.length !== e.length) throw new V.InvalidArgument("Arguments objects and keys must have the same length");
|
|
1046
|
+
var c = e.length, f = f && s ? e.map(Xt(f)) : e;
|
|
1047
|
+
return r.core.mutate({ trans: o, type: "add", keys: i, values: f, wantResults: a }).then(function(d) {
|
|
1048
|
+
var u = d.numFailures, y = d.results, l = d.lastResult, d = d.failures;
|
|
1049
|
+
if (u === 0) return a ? y : l;
|
|
1050
|
+
throw new lt("".concat(r.name, ".bulkAdd(): ").concat(u, " of ").concat(c, " operations failed"), d);
|
|
1051
|
+
});
|
|
1052
|
+
});
|
|
1053
|
+
}, ae.prototype.bulkPut = function(e, t, n) {
|
|
1054
|
+
var r = this, i = Array.isArray(t) ? t : void 0, a = (n = n || (i ? void 0 : t)) ? n.allKeys : void 0;
|
|
1055
|
+
return this._trans("readwrite", function(o) {
|
|
1056
|
+
var f = r.schema.primKey, s = f.auto, f = f.keyPath;
|
|
1057
|
+
if (f && i) throw new V.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
1058
|
+
if (i && i.length !== e.length) throw new V.InvalidArgument("Arguments objects and keys must have the same length");
|
|
1059
|
+
var c = e.length, f = f && s ? e.map(Xt(f)) : e;
|
|
1060
|
+
return r.core.mutate({ trans: o, type: "put", keys: i, values: f, wantResults: a }).then(function(d) {
|
|
1061
|
+
var u = d.numFailures, y = d.results, l = d.lastResult, d = d.failures;
|
|
1062
|
+
if (u === 0) return a ? y : l;
|
|
1063
|
+
throw new lt("".concat(r.name, ".bulkPut(): ").concat(u, " of ").concat(c, " operations failed"), d);
|
|
1064
|
+
});
|
|
1065
|
+
});
|
|
1066
|
+
}, ae.prototype.bulkUpdate = function(e) {
|
|
1067
|
+
var t = this, n = this.core, r = e.map(function(o) {
|
|
1068
|
+
return o.key;
|
|
1069
|
+
}), i = e.map(function(o) {
|
|
1070
|
+
return o.changes;
|
|
1071
|
+
}), a = [];
|
|
1072
|
+
return this._trans("readwrite", function(o) {
|
|
1073
|
+
return n.getMany({ trans: o, keys: r, cache: "clone" }).then(function(s) {
|
|
1074
|
+
var c = [], f = [];
|
|
1075
|
+
e.forEach(function(u, y) {
|
|
1076
|
+
var l = u.key, d = u.changes, p = s[y];
|
|
1077
|
+
if (p) {
|
|
1078
|
+
for (var h = 0, m = Object.keys(d); h < m.length; h++) {
|
|
1079
|
+
var b = m[h], _ = d[b];
|
|
1080
|
+
if (b === t.schema.primKey.keyPath) {
|
|
1081
|
+
if (J(_, l) !== 0) throw new V.Constraint("Cannot update primary key in bulkUpdate()");
|
|
1082
|
+
} else se(p, b, _);
|
|
1083
|
+
}
|
|
1084
|
+
a.push(y), c.push(l), f.push(p);
|
|
1085
|
+
}
|
|
1086
|
+
});
|
|
1087
|
+
var v = c.length;
|
|
1088
|
+
return n.mutate({ trans: o, type: "put", keys: c, values: f, updates: { keys: r, changeSpecs: i } }).then(function(u) {
|
|
1089
|
+
var y = u.numFailures, l = u.failures;
|
|
1090
|
+
if (y === 0) return v;
|
|
1091
|
+
for (var d = 0, p = Object.keys(l); d < p.length; d++) {
|
|
1092
|
+
var h, m = p[d], b = a[Number(m)];
|
|
1093
|
+
b != null && (h = l[m], delete l[m], l[b] = h);
|
|
1094
|
+
}
|
|
1095
|
+
throw new lt("".concat(t.name, ".bulkUpdate(): ").concat(y, " of ").concat(v, " operations failed"), l);
|
|
1096
|
+
});
|
|
1097
|
+
});
|
|
1098
|
+
});
|
|
1099
|
+
}, ae.prototype.bulkDelete = function(e) {
|
|
1100
|
+
var t = this, n = e.length;
|
|
1101
|
+
return this._trans("readwrite", function(r) {
|
|
1102
|
+
return t.core.mutate({ trans: r, type: "delete", keys: e });
|
|
1103
|
+
}).then(function(o) {
|
|
1104
|
+
var i = o.numFailures, a = o.lastResult, o = o.failures;
|
|
1105
|
+
if (i === 0) return a;
|
|
1106
|
+
throw new lt("".concat(t.name, ".bulkDelete(): ").concat(i, " of ").concat(n, " operations failed"), o);
|
|
1107
|
+
});
|
|
1108
|
+
}, ae);
|
|
1109
|
+
function ae() {
|
|
1110
|
+
}
|
|
1111
|
+
function St(e) {
|
|
1112
|
+
function t(o, s) {
|
|
1113
|
+
if (s) {
|
|
1114
|
+
for (var c = arguments.length, f = new Array(c - 1); --c; ) f[c - 1] = arguments[c];
|
|
1115
|
+
return n[o].subscribe.apply(null, f), e;
|
|
1116
|
+
}
|
|
1117
|
+
if (typeof o == "string") return n[o];
|
|
1118
|
+
}
|
|
1119
|
+
var n = {};
|
|
1120
|
+
t.addEventType = a;
|
|
1121
|
+
for (var r = 1, i = arguments.length; r < i; ++r) a(arguments[r]);
|
|
1122
|
+
return t;
|
|
1123
|
+
function a(o, s, c) {
|
|
1124
|
+
if (typeof o != "object") {
|
|
1125
|
+
var f;
|
|
1126
|
+
s = s || _i;
|
|
1127
|
+
var v = { subscribers: [], fire: c = c || re, subscribe: function(u) {
|
|
1128
|
+
v.subscribers.indexOf(u) === -1 && (v.subscribers.push(u), v.fire = s(v.fire, u));
|
|
1129
|
+
}, unsubscribe: function(u) {
|
|
1130
|
+
v.subscribers = v.subscribers.filter(function(y) {
|
|
1131
|
+
return y !== u;
|
|
1132
|
+
}), v.fire = v.subscribers.reduce(s, c);
|
|
1133
|
+
} };
|
|
1134
|
+
return n[o] = t[o] = v;
|
|
1135
|
+
}
|
|
1136
|
+
O(f = o).forEach(function(u) {
|
|
1137
|
+
var y = f[u];
|
|
1138
|
+
if (A(y)) a(u, f[u][0], f[u][1]);
|
|
1139
|
+
else {
|
|
1140
|
+
if (y !== "asap") throw new V.InvalidArgument("Invalid event config");
|
|
1141
|
+
var l = a(u, kt, function() {
|
|
1142
|
+
for (var d = arguments.length, p = new Array(d); d--; ) p[d] = arguments[d];
|
|
1143
|
+
l.subscribers.forEach(function(h) {
|
|
1144
|
+
W(function() {
|
|
1145
|
+
h.apply(null, p);
|
|
1146
|
+
});
|
|
1147
|
+
});
|
|
1148
|
+
});
|
|
1149
|
+
}
|
|
1150
|
+
});
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
function Pt(e, t) {
|
|
1154
|
+
return ie(t).from({ prototype: e }), t;
|
|
1155
|
+
}
|
|
1156
|
+
function pt(e, t) {
|
|
1157
|
+
return !(e.filter || e.algorithm || e.or) && (t ? e.justLimit : !e.replayFilter);
|
|
1158
|
+
}
|
|
1159
|
+
function Rn(e, t) {
|
|
1160
|
+
e.filter = nt(e.filter, t);
|
|
1161
|
+
}
|
|
1162
|
+
function Bn(e, t, n) {
|
|
1163
|
+
var r = e.replayFilter;
|
|
1164
|
+
e.replayFilter = r ? function() {
|
|
1165
|
+
return nt(r(), t());
|
|
1166
|
+
} : t, e.justLimit = n && !r;
|
|
1167
|
+
}
|
|
1168
|
+
function Gt(e, t) {
|
|
1169
|
+
if (e.isPrimKey) return t.primaryKey;
|
|
1170
|
+
var n = t.getIndexByKeyPath(e.index);
|
|
1171
|
+
if (!n) throw new V.Schema("KeyPath " + e.index + " on object store " + t.name + " is not indexed");
|
|
1172
|
+
return n;
|
|
1173
|
+
}
|
|
1174
|
+
function Dr(e, t, n) {
|
|
1175
|
+
var r = Gt(e, t.schema);
|
|
1176
|
+
return t.openCursor({ trans: n, values: !e.keysOnly, reverse: e.dir === "prev", unique: !!e.unique, query: { index: r, range: e.range } });
|
|
1177
|
+
}
|
|
1178
|
+
function Qt(e, t, n, r) {
|
|
1179
|
+
var i = e.replayFilter ? nt(e.filter, e.replayFilter()) : e.filter;
|
|
1180
|
+
if (e.or) {
|
|
1181
|
+
var a = {}, o = function(s, c, f) {
|
|
1182
|
+
var v, u;
|
|
1183
|
+
i && !i(c, f, function(y) {
|
|
1184
|
+
return c.stop(y);
|
|
1185
|
+
}, function(y) {
|
|
1186
|
+
return c.fail(y);
|
|
1187
|
+
}) || ((u = "" + (v = c.primaryKey)) == "[object ArrayBuffer]" && (u = "" + new Uint8Array(v)), B(a, u) || (a[u] = !0, t(s, c, f)));
|
|
1188
|
+
};
|
|
1189
|
+
return Promise.all([e.or._iterate(o, n), Ar(Dr(e, r, n), e.algorithm, o, !e.keysOnly && e.valueMapper)]);
|
|
1190
|
+
}
|
|
1191
|
+
return Ar(Dr(e, r, n), nt(e.algorithm, i), t, !e.keysOnly && e.valueMapper);
|
|
1192
|
+
}
|
|
1193
|
+
function Ar(e, t, n, r) {
|
|
1194
|
+
var i = oe(r ? function(a, o, s) {
|
|
1195
|
+
return n(r(a), o, s);
|
|
1196
|
+
} : n);
|
|
1197
|
+
return e.then(function(a) {
|
|
1198
|
+
if (a) return a.start(function() {
|
|
1199
|
+
var o = function() {
|
|
1200
|
+
return a.continue();
|
|
1201
|
+
};
|
|
1202
|
+
t && !t(a, function(s) {
|
|
1203
|
+
return o = s;
|
|
1204
|
+
}, function(s) {
|
|
1205
|
+
a.stop(s), o = re;
|
|
1206
|
+
}, function(s) {
|
|
1207
|
+
a.fail(s), o = re;
|
|
1208
|
+
}) || i(a.value, a, function(s) {
|
|
1209
|
+
return o = s;
|
|
1210
|
+
}), o();
|
|
1211
|
+
});
|
|
1212
|
+
});
|
|
1213
|
+
}
|
|
1214
|
+
var Kt = (zr.prototype.execute = function(e) {
|
|
1215
|
+
var t = this["@@propmod"];
|
|
1216
|
+
if (t.add !== void 0) {
|
|
1217
|
+
var n = t.add;
|
|
1218
|
+
if (A(n)) return K(K([], A(e) ? e : [], !0), n).sort();
|
|
1219
|
+
if (typeof n == "number") return (Number(e) || 0) + n;
|
|
1220
|
+
if (typeof n == "bigint") try {
|
|
1221
|
+
return BigInt(e) + n;
|
|
1222
|
+
} catch {
|
|
1223
|
+
return BigInt(0) + n;
|
|
1224
|
+
}
|
|
1225
|
+
throw new TypeError("Invalid term ".concat(n));
|
|
1226
|
+
}
|
|
1227
|
+
if (t.remove !== void 0) {
|
|
1228
|
+
var r = t.remove;
|
|
1229
|
+
if (A(r)) return A(e) ? e.filter(function(i) {
|
|
1230
|
+
return !r.includes(i);
|
|
1231
|
+
}).sort() : [];
|
|
1232
|
+
if (typeof r == "number") return Number(e) - r;
|
|
1233
|
+
if (typeof r == "bigint") try {
|
|
1234
|
+
return BigInt(e) - r;
|
|
1235
|
+
} catch {
|
|
1236
|
+
return BigInt(0) - r;
|
|
1237
|
+
}
|
|
1238
|
+
throw new TypeError("Invalid subtrahend ".concat(r));
|
|
1239
|
+
}
|
|
1240
|
+
return n = (n = t.replacePrefix) === null || n === void 0 ? void 0 : n[0], n && typeof e == "string" && e.startsWith(n) ? t.replacePrefix[1] + e.substring(n.length) : e;
|
|
1241
|
+
}, zr);
|
|
1242
|
+
function zr(e) {
|
|
1243
|
+
this["@@propmod"] = e;
|
|
1244
|
+
}
|
|
1245
|
+
var Oi = (te.prototype._read = function(e, t) {
|
|
1246
|
+
var n = this._ctx;
|
|
1247
|
+
return n.error ? n.table._trans(null, ue.bind(null, n.error)) : n.table._trans("readonly", e).then(t);
|
|
1248
|
+
}, te.prototype._write = function(e) {
|
|
1249
|
+
var t = this._ctx;
|
|
1250
|
+
return t.error ? t.table._trans(null, ue.bind(null, t.error)) : t.table._trans("readwrite", e, "locked");
|
|
1251
|
+
}, te.prototype._addAlgorithm = function(e) {
|
|
1252
|
+
var t = this._ctx;
|
|
1253
|
+
t.algorithm = nt(t.algorithm, e);
|
|
1254
|
+
}, te.prototype._iterate = function(e, t) {
|
|
1255
|
+
return Qt(this._ctx, e, t, this._ctx.table.core);
|
|
1256
|
+
}, te.prototype.clone = function(e) {
|
|
1257
|
+
var t = Object.create(this.constructor.prototype), n = Object.create(this._ctx);
|
|
1258
|
+
return e && R(n, e), t._ctx = n, t;
|
|
1259
|
+
}, te.prototype.raw = function() {
|
|
1260
|
+
return this._ctx.valueMapper = null, this;
|
|
1261
|
+
}, te.prototype.each = function(e) {
|
|
1262
|
+
var t = this._ctx;
|
|
1263
|
+
return this._read(function(n) {
|
|
1264
|
+
return Qt(t, e, n, t.table.core);
|
|
1265
|
+
});
|
|
1266
|
+
}, te.prototype.count = function(e) {
|
|
1267
|
+
var t = this;
|
|
1268
|
+
return this._read(function(n) {
|
|
1269
|
+
var r = t._ctx, i = r.table.core;
|
|
1270
|
+
if (pt(r, !0)) return i.count({ trans: n, query: { index: Gt(r, i.schema), range: r.range } }).then(function(o) {
|
|
1271
|
+
return Math.min(o, r.limit);
|
|
1272
|
+
});
|
|
1273
|
+
var a = 0;
|
|
1274
|
+
return Qt(r, function() {
|
|
1275
|
+
return ++a, !1;
|
|
1276
|
+
}, n, i).then(function() {
|
|
1277
|
+
return a;
|
|
1278
|
+
});
|
|
1279
|
+
}).then(e);
|
|
1280
|
+
}, te.prototype.sortBy = function(e, t) {
|
|
1281
|
+
var n = e.split(".").reverse(), r = n[0], i = n.length - 1;
|
|
1282
|
+
function a(c, f) {
|
|
1283
|
+
return f ? a(c[n[f]], f - 1) : c[r];
|
|
1284
|
+
}
|
|
1285
|
+
var o = this._ctx.dir === "next" ? 1 : -1;
|
|
1286
|
+
function s(c, f) {
|
|
1287
|
+
return J(a(c, i), a(f, i)) * o;
|
|
1288
|
+
}
|
|
1289
|
+
return this.toArray(function(c) {
|
|
1290
|
+
return c.sort(s);
|
|
1291
|
+
}).then(t);
|
|
1292
|
+
}, te.prototype.toArray = function(e) {
|
|
1293
|
+
var t = this;
|
|
1294
|
+
return this._read(function(n) {
|
|
1295
|
+
var r = t._ctx;
|
|
1296
|
+
if (r.dir === "next" && pt(r, !0) && 0 < r.limit) {
|
|
1297
|
+
var i = r.valueMapper, a = Gt(r, r.table.core.schema);
|
|
1298
|
+
return r.table.core.query({ trans: n, limit: r.limit, values: !0, query: { index: a, range: r.range } }).then(function(s) {
|
|
1299
|
+
return s = s.result, i ? s.map(i) : s;
|
|
1300
|
+
});
|
|
1301
|
+
}
|
|
1302
|
+
var o = [];
|
|
1303
|
+
return Qt(r, function(s) {
|
|
1304
|
+
return o.push(s);
|
|
1305
|
+
}, n, r.table.core).then(function() {
|
|
1306
|
+
return o;
|
|
1307
|
+
});
|
|
1308
|
+
}, e);
|
|
1309
|
+
}, te.prototype.offset = function(e) {
|
|
1310
|
+
var t = this._ctx;
|
|
1311
|
+
return e <= 0 || (t.offset += e, pt(t) ? Bn(t, function() {
|
|
1312
|
+
var n = e;
|
|
1313
|
+
return function(r, i) {
|
|
1314
|
+
return n === 0 || (n === 1 ? --n : i(function() {
|
|
1315
|
+
r.advance(n), n = 0;
|
|
1316
|
+
}), !1);
|
|
1317
|
+
};
|
|
1318
|
+
}) : Bn(t, function() {
|
|
1319
|
+
var n = e;
|
|
1320
|
+
return function() {
|
|
1321
|
+
return --n < 0;
|
|
1322
|
+
};
|
|
1323
|
+
})), this;
|
|
1324
|
+
}, te.prototype.limit = function(e) {
|
|
1325
|
+
return this._ctx.limit = Math.min(this._ctx.limit, e), Bn(this._ctx, function() {
|
|
1326
|
+
var t = e;
|
|
1327
|
+
return function(n, r, i) {
|
|
1328
|
+
return --t <= 0 && r(i), 0 <= t;
|
|
1329
|
+
};
|
|
1330
|
+
}, !0), this;
|
|
1331
|
+
}, te.prototype.until = function(e, t) {
|
|
1332
|
+
return Rn(this._ctx, function(n, r, i) {
|
|
1333
|
+
return !e(n.value) || (r(i), t);
|
|
1334
|
+
}), this;
|
|
1335
|
+
}, te.prototype.first = function(e) {
|
|
1336
|
+
return this.limit(1).toArray(function(t) {
|
|
1337
|
+
return t[0];
|
|
1338
|
+
}).then(e);
|
|
1339
|
+
}, te.prototype.last = function(e) {
|
|
1340
|
+
return this.reverse().first(e);
|
|
1341
|
+
}, te.prototype.filter = function(e) {
|
|
1342
|
+
var t;
|
|
1343
|
+
return Rn(this._ctx, function(n) {
|
|
1344
|
+
return e(n.value);
|
|
1345
|
+
}), (t = this._ctx).isMatch = nt(t.isMatch, e), this;
|
|
1346
|
+
}, te.prototype.and = function(e) {
|
|
1347
|
+
return this.filter(e);
|
|
1348
|
+
}, te.prototype.or = function(e) {
|
|
1349
|
+
return new this.db.WhereClause(this._ctx.table, e, this);
|
|
1350
|
+
}, te.prototype.reverse = function() {
|
|
1351
|
+
return this._ctx.dir = this._ctx.dir === "prev" ? "next" : "prev", this._ondirectionchange && this._ondirectionchange(this._ctx.dir), this;
|
|
1352
|
+
}, te.prototype.desc = function() {
|
|
1353
|
+
return this.reverse();
|
|
1354
|
+
}, te.prototype.eachKey = function(e) {
|
|
1355
|
+
var t = this._ctx;
|
|
1356
|
+
return t.keysOnly = !t.isMatch, this.each(function(n, r) {
|
|
1357
|
+
e(r.key, r);
|
|
1358
|
+
});
|
|
1359
|
+
}, te.prototype.eachUniqueKey = function(e) {
|
|
1360
|
+
return this._ctx.unique = "unique", this.eachKey(e);
|
|
1361
|
+
}, te.prototype.eachPrimaryKey = function(e) {
|
|
1362
|
+
var t = this._ctx;
|
|
1363
|
+
return t.keysOnly = !t.isMatch, this.each(function(n, r) {
|
|
1364
|
+
e(r.primaryKey, r);
|
|
1365
|
+
});
|
|
1366
|
+
}, te.prototype.keys = function(e) {
|
|
1367
|
+
var t = this._ctx;
|
|
1368
|
+
t.keysOnly = !t.isMatch;
|
|
1369
|
+
var n = [];
|
|
1370
|
+
return this.each(function(r, i) {
|
|
1371
|
+
n.push(i.key);
|
|
1372
|
+
}).then(function() {
|
|
1373
|
+
return n;
|
|
1374
|
+
}).then(e);
|
|
1375
|
+
}, te.prototype.primaryKeys = function(e) {
|
|
1376
|
+
var t = this._ctx;
|
|
1377
|
+
if (t.dir === "next" && pt(t, !0) && 0 < t.limit) return this._read(function(r) {
|
|
1378
|
+
var i = Gt(t, t.table.core.schema);
|
|
1379
|
+
return t.table.core.query({ trans: r, values: !1, limit: t.limit, query: { index: i, range: t.range } });
|
|
1380
|
+
}).then(function(r) {
|
|
1381
|
+
return r.result;
|
|
1382
|
+
}).then(e);
|
|
1383
|
+
t.keysOnly = !t.isMatch;
|
|
1384
|
+
var n = [];
|
|
1385
|
+
return this.each(function(r, i) {
|
|
1386
|
+
n.push(i.primaryKey);
|
|
1387
|
+
}).then(function() {
|
|
1388
|
+
return n;
|
|
1389
|
+
}).then(e);
|
|
1390
|
+
}, te.prototype.uniqueKeys = function(e) {
|
|
1391
|
+
return this._ctx.unique = "unique", this.keys(e);
|
|
1392
|
+
}, te.prototype.firstKey = function(e) {
|
|
1393
|
+
return this.limit(1).keys(function(t) {
|
|
1394
|
+
return t[0];
|
|
1395
|
+
}).then(e);
|
|
1396
|
+
}, te.prototype.lastKey = function(e) {
|
|
1397
|
+
return this.reverse().firstKey(e);
|
|
1398
|
+
}, te.prototype.distinct = function() {
|
|
1399
|
+
var e = this._ctx, e = e.index && e.table.schema.idxByName[e.index];
|
|
1400
|
+
if (!e || !e.multi) return this;
|
|
1401
|
+
var t = {};
|
|
1402
|
+
return Rn(this._ctx, function(i) {
|
|
1403
|
+
var r = i.primaryKey.toString(), i = B(t, r);
|
|
1404
|
+
return t[r] = !0, !i;
|
|
1405
|
+
}), this;
|
|
1406
|
+
}, te.prototype.modify = function(e) {
|
|
1407
|
+
var t = this, n = this._ctx;
|
|
1408
|
+
return this._write(function(r) {
|
|
1409
|
+
var i, a, o;
|
|
1410
|
+
o = typeof e == "function" ? e : (i = O(e), a = i.length, function(h) {
|
|
1411
|
+
for (var m = !1, b = 0; b < a; ++b) {
|
|
1412
|
+
var _ = i[b], x = e[_], S = ne(h, _);
|
|
1413
|
+
x instanceof Kt ? (se(h, _, x.execute(S)), m = !0) : S !== x && (se(h, _, x), m = !0);
|
|
1414
|
+
}
|
|
1415
|
+
return m;
|
|
1416
|
+
});
|
|
1417
|
+
var s = n.table.core, u = s.schema.primaryKey, c = u.outbound, f = u.extractKey, v = 200, u = t.db._options.modifyChunkSize;
|
|
1418
|
+
u && (v = typeof u == "object" ? u[s.name] || u["*"] || 200 : u);
|
|
1419
|
+
function y(h, _) {
|
|
1420
|
+
var b = _.failures, _ = _.numFailures;
|
|
1421
|
+
d += h - _;
|
|
1422
|
+
for (var x = 0, S = O(b); x < S.length; x++) {
|
|
1423
|
+
var T = S[x];
|
|
1424
|
+
l.push(b[T]);
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
var l = [], d = 0, p = [];
|
|
1428
|
+
return t.clone().primaryKeys().then(function(h) {
|
|
1429
|
+
function m(_) {
|
|
1430
|
+
var x = Math.min(v, h.length - _);
|
|
1431
|
+
return s.getMany({ trans: r, keys: h.slice(_, _ + x), cache: "immutable" }).then(function(S) {
|
|
1432
|
+
for (var T = [], P = [], D = c ? [] : null, j = [], z = 0; z < x; ++z) {
|
|
1433
|
+
var q = S[z], X = { value: Ue(q), primKey: h[_ + z] };
|
|
1434
|
+
o.call(X, X.value, X) !== !1 && (X.value == null ? j.push(h[_ + z]) : c || J(f(q), f(X.value)) === 0 ? (P.push(X.value), c && D.push(h[_ + z])) : (j.push(h[_ + z]), T.push(X.value)));
|
|
1435
|
+
}
|
|
1436
|
+
return Promise.resolve(0 < T.length && s.mutate({ trans: r, type: "add", values: T }).then(function(G) {
|
|
1437
|
+
for (var Q in G.failures) j.splice(parseInt(Q), 1);
|
|
1438
|
+
y(T.length, G);
|
|
1439
|
+
})).then(function() {
|
|
1440
|
+
return (0 < P.length || b && typeof e == "object") && s.mutate({ trans: r, type: "put", keys: D, values: P, criteria: b, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < _ }).then(function(G) {
|
|
1441
|
+
return y(P.length, G);
|
|
1442
|
+
});
|
|
1443
|
+
}).then(function() {
|
|
1444
|
+
return (0 < j.length || b && e === qn) && s.mutate({ trans: r, type: "delete", keys: j, criteria: b, isAdditionalChunk: 0 < _ }).then(function(G) {
|
|
1445
|
+
return y(j.length, G);
|
|
1446
|
+
});
|
|
1447
|
+
}).then(function() {
|
|
1448
|
+
return h.length > _ + x && m(_ + v);
|
|
1449
|
+
});
|
|
1450
|
+
});
|
|
1451
|
+
}
|
|
1452
|
+
var b = pt(n) && n.limit === 1 / 0 && (typeof e != "function" || e === qn) && { index: n.index, range: n.range };
|
|
1453
|
+
return m(0).then(function() {
|
|
1454
|
+
if (0 < l.length) throw new qt("Error modifying one or more objects", l, d, p);
|
|
1455
|
+
return h.length;
|
|
1456
|
+
});
|
|
1457
|
+
});
|
|
1458
|
+
});
|
|
1459
|
+
}, te.prototype.delete = function() {
|
|
1460
|
+
var e = this._ctx, t = e.range;
|
|
1461
|
+
return pt(e) && (e.isPrimKey || t.type === 3) ? this._write(function(n) {
|
|
1462
|
+
var r = e.table.core.schema.primaryKey, i = t;
|
|
1463
|
+
return e.table.core.count({ trans: n, query: { index: r, range: i } }).then(function(a) {
|
|
1464
|
+
return e.table.core.mutate({ trans: n, type: "deleteRange", range: i }).then(function(o) {
|
|
1465
|
+
var s = o.failures;
|
|
1466
|
+
if (o.lastResult, o.results, o = o.numFailures, o) throw new qt("Could not delete some values", Object.keys(s).map(function(c) {
|
|
1467
|
+
return s[c];
|
|
1468
|
+
}), a - o);
|
|
1469
|
+
return a - o;
|
|
1470
|
+
});
|
|
1471
|
+
});
|
|
1472
|
+
}) : this.modify(qn);
|
|
1473
|
+
}, te);
|
|
1474
|
+
function te() {
|
|
1475
|
+
}
|
|
1476
|
+
var qn = function(e, t) {
|
|
1477
|
+
return t.value = null;
|
|
1478
|
+
};
|
|
1479
|
+
function Si(e, t) {
|
|
1480
|
+
return e < t ? -1 : e === t ? 0 : 1;
|
|
1481
|
+
}
|
|
1482
|
+
function Pi(e, t) {
|
|
1483
|
+
return t < e ? -1 : e === t ? 0 : 1;
|
|
1484
|
+
}
|
|
1485
|
+
function _e(e, t, n) {
|
|
1486
|
+
return e = e instanceof jr ? new e.Collection(e) : e, e._ctx.error = new (n || TypeError)(t), e;
|
|
1487
|
+
}
|
|
1488
|
+
function yt(e) {
|
|
1489
|
+
return new e.Collection(e, function() {
|
|
1490
|
+
return Tr("");
|
|
1491
|
+
}).limit(0);
|
|
1492
|
+
}
|
|
1493
|
+
function Zt(e, t, n, r) {
|
|
1494
|
+
var i, a, o, s, c, f, v, u = n.length;
|
|
1495
|
+
if (!n.every(function(d) {
|
|
1496
|
+
return typeof d == "string";
|
|
1497
|
+
})) return _e(e, Cr);
|
|
1498
|
+
function y(d) {
|
|
1499
|
+
i = d === "next" ? function(h) {
|
|
1500
|
+
return h.toUpperCase();
|
|
1501
|
+
} : function(h) {
|
|
1502
|
+
return h.toLowerCase();
|
|
1503
|
+
}, a = d === "next" ? function(h) {
|
|
1504
|
+
return h.toLowerCase();
|
|
1505
|
+
} : function(h) {
|
|
1506
|
+
return h.toUpperCase();
|
|
1507
|
+
}, o = d === "next" ? Si : Pi;
|
|
1508
|
+
var p = n.map(function(h) {
|
|
1509
|
+
return { lower: a(h), upper: i(h) };
|
|
1510
|
+
}).sort(function(h, m) {
|
|
1511
|
+
return o(h.lower, m.lower);
|
|
1512
|
+
});
|
|
1513
|
+
s = p.map(function(h) {
|
|
1514
|
+
return h.upper;
|
|
1515
|
+
}), c = p.map(function(h) {
|
|
1516
|
+
return h.lower;
|
|
1517
|
+
}), v = (f = d) === "next" ? "" : r;
|
|
1518
|
+
}
|
|
1519
|
+
y("next"), e = new e.Collection(e, function() {
|
|
1520
|
+
return Ne(s[0], c[u - 1] + r);
|
|
1521
|
+
}), e._ondirectionchange = function(d) {
|
|
1522
|
+
y(d);
|
|
1523
|
+
};
|
|
1524
|
+
var l = 0;
|
|
1525
|
+
return e._addAlgorithm(function(d, p, h) {
|
|
1526
|
+
var m = d.key;
|
|
1527
|
+
if (typeof m != "string") return !1;
|
|
1528
|
+
var b = a(m);
|
|
1529
|
+
if (t(b, c, l)) return !0;
|
|
1530
|
+
for (var _ = null, x = l; x < u; ++x) {
|
|
1531
|
+
var S = function(T, P, D, j, z, q) {
|
|
1532
|
+
for (var X = Math.min(T.length, j.length), G = -1, Q = 0; Q < X; ++Q) {
|
|
1533
|
+
var we = P[Q];
|
|
1534
|
+
if (we !== j[Q]) return z(T[Q], D[Q]) < 0 ? T.substr(0, Q) + D[Q] + D.substr(Q + 1) : z(T[Q], j[Q]) < 0 ? T.substr(0, Q) + j[Q] + D.substr(Q + 1) : 0 <= G ? T.substr(0, G) + P[G] + D.substr(G + 1) : null;
|
|
1535
|
+
z(T[Q], we) < 0 && (G = Q);
|
|
1536
|
+
}
|
|
1537
|
+
return X < j.length && q === "next" ? T + D.substr(T.length) : X < T.length && q === "prev" ? T.substr(0, D.length) : G < 0 ? null : T.substr(0, G) + j[G] + D.substr(G + 1);
|
|
1538
|
+
}(m, b, s[x], c[x], o, f);
|
|
1539
|
+
S === null && _ === null ? l = x + 1 : (_ === null || 0 < o(_, S)) && (_ = S);
|
|
1540
|
+
}
|
|
1541
|
+
return p(_ !== null ? function() {
|
|
1542
|
+
d.continue(_ + v);
|
|
1543
|
+
} : h), !1;
|
|
1544
|
+
}), e;
|
|
1545
|
+
}
|
|
1546
|
+
function Ne(e, t, n, r) {
|
|
1547
|
+
return { type: 2, lower: e, upper: t, lowerOpen: n, upperOpen: r };
|
|
1548
|
+
}
|
|
1549
|
+
function Tr(e) {
|
|
1550
|
+
return { type: 1, lower: e, upper: e };
|
|
1551
|
+
}
|
|
1552
|
+
var jr = (Object.defineProperty(fe.prototype, "Collection", { get: function() {
|
|
1553
|
+
return this._ctx.table.db.Collection;
|
|
1554
|
+
}, enumerable: !1, configurable: !0 }), fe.prototype.between = function(e, t, n, r) {
|
|
1555
|
+
n = n !== !1, r = r === !0;
|
|
1556
|
+
try {
|
|
1557
|
+
return 0 < this._cmp(e, t) || this._cmp(e, t) === 0 && (n || r) && (!n || !r) ? yt(this) : new this.Collection(this, function() {
|
|
1558
|
+
return Ne(e, t, !n, !r);
|
|
1559
|
+
});
|
|
1560
|
+
} catch {
|
|
1561
|
+
return _e(this, De);
|
|
1562
|
+
}
|
|
1563
|
+
}, fe.prototype.equals = function(e) {
|
|
1564
|
+
return e == null ? _e(this, De) : new this.Collection(this, function() {
|
|
1565
|
+
return Tr(e);
|
|
1566
|
+
});
|
|
1567
|
+
}, fe.prototype.above = function(e) {
|
|
1568
|
+
return e == null ? _e(this, De) : new this.Collection(this, function() {
|
|
1569
|
+
return Ne(e, void 0, !0);
|
|
1570
|
+
});
|
|
1571
|
+
}, fe.prototype.aboveOrEqual = function(e) {
|
|
1572
|
+
return e == null ? _e(this, De) : new this.Collection(this, function() {
|
|
1573
|
+
return Ne(e, void 0, !1);
|
|
1574
|
+
});
|
|
1575
|
+
}, fe.prototype.below = function(e) {
|
|
1576
|
+
return e == null ? _e(this, De) : new this.Collection(this, function() {
|
|
1577
|
+
return Ne(void 0, e, !1, !0);
|
|
1578
|
+
});
|
|
1579
|
+
}, fe.prototype.belowOrEqual = function(e) {
|
|
1580
|
+
return e == null ? _e(this, De) : new this.Collection(this, function() {
|
|
1581
|
+
return Ne(void 0, e);
|
|
1582
|
+
});
|
|
1583
|
+
}, fe.prototype.startsWith = function(e) {
|
|
1584
|
+
return typeof e != "string" ? _e(this, Cr) : this.between(e, e + tt, !0, !0);
|
|
1585
|
+
}, fe.prototype.startsWithIgnoreCase = function(e) {
|
|
1586
|
+
return e === "" ? this.startsWith(e) : Zt(this, function(t, n) {
|
|
1587
|
+
return t.indexOf(n[0]) === 0;
|
|
1588
|
+
}, [e], tt);
|
|
1589
|
+
}, fe.prototype.equalsIgnoreCase = function(e) {
|
|
1590
|
+
return Zt(this, function(t, n) {
|
|
1591
|
+
return t === n[0];
|
|
1592
|
+
}, [e], "");
|
|
1593
|
+
}, fe.prototype.anyOfIgnoreCase = function() {
|
|
1594
|
+
var e = Ke.apply(ut, arguments);
|
|
1595
|
+
return e.length === 0 ? yt(this) : Zt(this, function(t, n) {
|
|
1596
|
+
return n.indexOf(t) !== -1;
|
|
1597
|
+
}, e, "");
|
|
1598
|
+
}, fe.prototype.startsWithAnyOfIgnoreCase = function() {
|
|
1599
|
+
var e = Ke.apply(ut, arguments);
|
|
1600
|
+
return e.length === 0 ? yt(this) : Zt(this, function(t, n) {
|
|
1601
|
+
return n.some(function(r) {
|
|
1602
|
+
return t.indexOf(r) === 0;
|
|
1603
|
+
});
|
|
1604
|
+
}, e, tt);
|
|
1605
|
+
}, fe.prototype.anyOf = function() {
|
|
1606
|
+
var e = this, t = Ke.apply(ut, arguments), n = this._cmp;
|
|
1607
|
+
try {
|
|
1608
|
+
t.sort(n);
|
|
1609
|
+
} catch {
|
|
1610
|
+
return _e(this, De);
|
|
1611
|
+
}
|
|
1612
|
+
if (t.length === 0) return yt(this);
|
|
1613
|
+
var r = new this.Collection(this, function() {
|
|
1614
|
+
return Ne(t[0], t[t.length - 1]);
|
|
1615
|
+
});
|
|
1616
|
+
r._ondirectionchange = function(a) {
|
|
1617
|
+
n = a === "next" ? e._ascending : e._descending, t.sort(n);
|
|
1618
|
+
};
|
|
1619
|
+
var i = 0;
|
|
1620
|
+
return r._addAlgorithm(function(a, o, s) {
|
|
1621
|
+
for (var c = a.key; 0 < n(c, t[i]); ) if (++i === t.length) return o(s), !1;
|
|
1622
|
+
return n(c, t[i]) === 0 || (o(function() {
|
|
1623
|
+
a.continue(t[i]);
|
|
1624
|
+
}), !1);
|
|
1625
|
+
}), r;
|
|
1626
|
+
}, fe.prototype.notEqual = function(e) {
|
|
1627
|
+
return this.inAnyRange([[-1 / 0, e], [e, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
|
|
1628
|
+
}, fe.prototype.noneOf = function() {
|
|
1629
|
+
var e = Ke.apply(ut, arguments);
|
|
1630
|
+
if (e.length === 0) return new this.Collection(this);
|
|
1631
|
+
try {
|
|
1632
|
+
e.sort(this._ascending);
|
|
1633
|
+
} catch {
|
|
1634
|
+
return _e(this, De);
|
|
1635
|
+
}
|
|
1636
|
+
var t = e.reduce(function(n, r) {
|
|
1637
|
+
return n ? n.concat([[n[n.length - 1][1], r]]) : [[-1 / 0, r]];
|
|
1638
|
+
}, null);
|
|
1639
|
+
return t.push([e[e.length - 1], this.db._maxKey]), this.inAnyRange(t, { includeLowers: !1, includeUppers: !1 });
|
|
1640
|
+
}, fe.prototype.inAnyRange = function(m, t) {
|
|
1641
|
+
var n = this, r = this._cmp, i = this._ascending, a = this._descending, o = this._min, s = this._max;
|
|
1642
|
+
if (m.length === 0) return yt(this);
|
|
1643
|
+
if (!m.every(function(b) {
|
|
1644
|
+
return b[0] !== void 0 && b[1] !== void 0 && i(b[0], b[1]) <= 0;
|
|
1645
|
+
})) return _e(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", V.InvalidArgument);
|
|
1646
|
+
var c = !t || t.includeLowers !== !1, f = t && t.includeUppers === !0, v, u = i;
|
|
1647
|
+
function y(b, _) {
|
|
1648
|
+
return u(b[0], _[0]);
|
|
1649
|
+
}
|
|
1650
|
+
try {
|
|
1651
|
+
(v = m.reduce(function(b, _) {
|
|
1652
|
+
for (var x = 0, S = b.length; x < S; ++x) {
|
|
1653
|
+
var T = b[x];
|
|
1654
|
+
if (r(_[0], T[1]) < 0 && 0 < r(_[1], T[0])) {
|
|
1655
|
+
T[0] = o(T[0], _[0]), T[1] = s(T[1], _[1]);
|
|
1656
|
+
break;
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
return x === S && b.push(_), b;
|
|
1660
|
+
}, [])).sort(y);
|
|
1661
|
+
} catch {
|
|
1662
|
+
return _e(this, De);
|
|
1663
|
+
}
|
|
1664
|
+
var l = 0, d = f ? function(b) {
|
|
1665
|
+
return 0 < i(b, v[l][1]);
|
|
1666
|
+
} : function(b) {
|
|
1667
|
+
return 0 <= i(b, v[l][1]);
|
|
1668
|
+
}, p = c ? function(b) {
|
|
1669
|
+
return 0 < a(b, v[l][0]);
|
|
1670
|
+
} : function(b) {
|
|
1671
|
+
return 0 <= a(b, v[l][0]);
|
|
1672
|
+
}, h = d, m = new this.Collection(this, function() {
|
|
1673
|
+
return Ne(v[0][0], v[v.length - 1][1], !c, !f);
|
|
1674
|
+
});
|
|
1675
|
+
return m._ondirectionchange = function(b) {
|
|
1676
|
+
u = b === "next" ? (h = d, i) : (h = p, a), v.sort(y);
|
|
1677
|
+
}, m._addAlgorithm(function(b, _, x) {
|
|
1678
|
+
for (var S, T = b.key; h(T); ) if (++l === v.length) return _(x), !1;
|
|
1679
|
+
return !d(S = T) && !p(S) || (n._cmp(T, v[l][1]) === 0 || n._cmp(T, v[l][0]) === 0 || _(function() {
|
|
1680
|
+
u === i ? b.continue(v[l][0]) : b.continue(v[l][1]);
|
|
1681
|
+
}), !1);
|
|
1682
|
+
}), m;
|
|
1683
|
+
}, fe.prototype.startsWithAnyOf = function() {
|
|
1684
|
+
var e = Ke.apply(ut, arguments);
|
|
1685
|
+
return e.every(function(t) {
|
|
1686
|
+
return typeof t == "string";
|
|
1687
|
+
}) ? e.length === 0 ? yt(this) : this.inAnyRange(e.map(function(t) {
|
|
1688
|
+
return [t, t + tt];
|
|
1689
|
+
})) : _e(this, "startsWithAnyOf() only works with strings");
|
|
1690
|
+
}, fe);
|
|
1691
|
+
function fe() {
|
|
1692
|
+
}
|
|
1693
|
+
function Oe(e) {
|
|
1694
|
+
return oe(function(t) {
|
|
1695
|
+
return Dt(t), e(t.target.error), !1;
|
|
1696
|
+
});
|
|
1697
|
+
}
|
|
1698
|
+
function Dt(e) {
|
|
1699
|
+
e.stopPropagation && e.stopPropagation(), e.preventDefault && e.preventDefault();
|
|
1700
|
+
}
|
|
1701
|
+
var At = "storagemutated", Mn = "x-storagemutated-1", $e = St(null, At), Ki = (Se.prototype._lock = function() {
|
|
1702
|
+
return ge(!N.global), ++this._reculock, this._reculock !== 1 || N.global || (N.lockOwnerFor = this), this;
|
|
1703
|
+
}, Se.prototype._unlock = function() {
|
|
1704
|
+
if (ge(!N.global), --this._reculock == 0) for (N.global || (N.lockOwnerFor = null); 0 < this._blockedFuncs.length && !this._locked(); ) {
|
|
1705
|
+
var e = this._blockedFuncs.shift();
|
|
1706
|
+
try {
|
|
1707
|
+
et(e[1], e[0]);
|
|
1708
|
+
} catch {
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
return this;
|
|
1712
|
+
}, Se.prototype._locked = function() {
|
|
1713
|
+
return this._reculock && N.lockOwnerFor !== this;
|
|
1714
|
+
}, Se.prototype.create = function(e) {
|
|
1715
|
+
var t = this;
|
|
1716
|
+
if (!this.mode) return this;
|
|
1717
|
+
var n = this.db.idbdb, r = this.db._state.dbOpenError;
|
|
1718
|
+
if (ge(!this.idbtrans), !e && !n) switch (r && r.name) {
|
|
1719
|
+
case "DatabaseClosedError":
|
|
1720
|
+
throw new V.DatabaseClosed(r);
|
|
1721
|
+
case "MissingAPIError":
|
|
1722
|
+
throw new V.MissingAPI(r.message, r);
|
|
1723
|
+
default:
|
|
1724
|
+
throw new V.OpenFailed(r);
|
|
1725
|
+
}
|
|
1726
|
+
if (!this.active) throw new V.TransactionInactive();
|
|
1727
|
+
return ge(this._completion._state === null), (e = this.idbtrans = e || (this.db.core || n).transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability })).onerror = oe(function(i) {
|
|
1728
|
+
Dt(i), t._reject(e.error);
|
|
1729
|
+
}), e.onabort = oe(function(i) {
|
|
1730
|
+
Dt(i), t.active && t._reject(new V.Abort(e.error)), t.active = !1, t.on("abort").fire(i);
|
|
1731
|
+
}), e.oncomplete = oe(function() {
|
|
1732
|
+
t.active = !1, t._resolve(), "mutatedParts" in e && $e.storagemutated.fire(e.mutatedParts);
|
|
1733
|
+
}), this;
|
|
1734
|
+
}, Se.prototype._promise = function(e, t, n) {
|
|
1735
|
+
var r = this;
|
|
1736
|
+
if (e === "readwrite" && this.mode !== "readwrite") return ue(new V.ReadOnly("Transaction is readonly"));
|
|
1737
|
+
if (!this.active) return ue(new V.TransactionInactive());
|
|
1738
|
+
if (this._locked()) return new I(function(a, o) {
|
|
1739
|
+
r._blockedFuncs.push([function() {
|
|
1740
|
+
r._promise(e, t, n).then(a, o);
|
|
1741
|
+
}, N]);
|
|
1742
|
+
});
|
|
1743
|
+
if (n) return qe(function() {
|
|
1744
|
+
var a = new I(function(o, s) {
|
|
1745
|
+
r._lock();
|
|
1746
|
+
var c = t(o, s, r);
|
|
1747
|
+
c && c.then && c.then(o, s);
|
|
1748
|
+
});
|
|
1749
|
+
return a.finally(function() {
|
|
1750
|
+
return r._unlock();
|
|
1751
|
+
}), a._lib = !0, a;
|
|
1752
|
+
});
|
|
1753
|
+
var i = new I(function(a, o) {
|
|
1754
|
+
var s = t(a, o, r);
|
|
1755
|
+
s && s.then && s.then(a, o);
|
|
1756
|
+
});
|
|
1757
|
+
return i._lib = !0, i;
|
|
1758
|
+
}, Se.prototype._root = function() {
|
|
1759
|
+
return this.parent ? this.parent._root() : this;
|
|
1760
|
+
}, Se.prototype.waitFor = function(e) {
|
|
1761
|
+
var t, n = this._root(), r = I.resolve(e);
|
|
1762
|
+
n._waitingFor ? n._waitingFor = n._waitingFor.then(function() {
|
|
1763
|
+
return r;
|
|
1764
|
+
}) : (n._waitingFor = r, n._waitingQueue = [], t = n.idbtrans.objectStore(n.storeNames[0]), function a() {
|
|
1765
|
+
for (++n._spinCount; n._waitingQueue.length; ) n._waitingQueue.shift()();
|
|
1766
|
+
n._waitingFor && (t.get(-1 / 0).onsuccess = a);
|
|
1767
|
+
}());
|
|
1768
|
+
var i = n._waitingFor;
|
|
1769
|
+
return new I(function(a, o) {
|
|
1770
|
+
r.then(function(s) {
|
|
1771
|
+
return n._waitingQueue.push(oe(a.bind(null, s)));
|
|
1772
|
+
}, function(s) {
|
|
1773
|
+
return n._waitingQueue.push(oe(o.bind(null, s)));
|
|
1774
|
+
}).finally(function() {
|
|
1775
|
+
n._waitingFor === i && (n._waitingFor = null);
|
|
1776
|
+
});
|
|
1777
|
+
});
|
|
1778
|
+
}, Se.prototype.abort = function() {
|
|
1779
|
+
this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new V.Abort()));
|
|
1780
|
+
}, Se.prototype.table = function(e) {
|
|
1781
|
+
var t = this._memoizedTables || (this._memoizedTables = {});
|
|
1782
|
+
if (B(t, e)) return t[e];
|
|
1783
|
+
var n = this.schema[e];
|
|
1784
|
+
if (!n) throw new V.NotFound("Table " + e + " not part of transaction");
|
|
1785
|
+
return n = new this.db.Table(e, n, this), n.core = this.db.core.table(e), t[e] = n;
|
|
1786
|
+
}, Se);
|
|
1787
|
+
function Se() {
|
|
1788
|
+
}
|
|
1789
|
+
function Ln(e, t, n, r, i, a, o) {
|
|
1790
|
+
return { name: e, keyPath: t, unique: n, multi: r, auto: i, compound: a, src: (n && !o ? "&" : "") + (r ? "*" : "") + (i ? "++" : "") + Ir(t) };
|
|
1791
|
+
}
|
|
1792
|
+
function Ir(e) {
|
|
1793
|
+
return typeof e == "string" ? e : e ? "[" + [].join.call(e, "+") + "]" : "";
|
|
1794
|
+
}
|
|
1795
|
+
function Nn(e, t, n) {
|
|
1796
|
+
return { name: e, primKey: t, indexes: n, mappedClass: null, idxByName: (r = function(i) {
|
|
1797
|
+
return [i.name, i];
|
|
1798
|
+
}, n.reduce(function(i, a, o) {
|
|
1799
|
+
return o = r(a, o), o && (i[o[0]] = o[1]), i;
|
|
1800
|
+
}, {})) };
|
|
1801
|
+
var r;
|
|
1802
|
+
}
|
|
1803
|
+
var zt = function(e) {
|
|
1804
|
+
try {
|
|
1805
|
+
return e.only([[]]), zt = function() {
|
|
1806
|
+
return [[]];
|
|
1807
|
+
}, [[]];
|
|
1808
|
+
} catch {
|
|
1809
|
+
return zt = function() {
|
|
1810
|
+
return tt;
|
|
1811
|
+
}, tt;
|
|
1812
|
+
}
|
|
1813
|
+
};
|
|
1814
|
+
function $n(e) {
|
|
1815
|
+
return e == null ? function() {
|
|
1816
|
+
} : typeof e == "string" ? (t = e).split(".").length === 1 ? function(n) {
|
|
1817
|
+
return n[t];
|
|
1818
|
+
} : function(n) {
|
|
1819
|
+
return ne(n, t);
|
|
1820
|
+
} : function(n) {
|
|
1821
|
+
return ne(n, e);
|
|
1822
|
+
};
|
|
1823
|
+
var t;
|
|
1824
|
+
}
|
|
1825
|
+
function Rr(e) {
|
|
1826
|
+
return [].slice.call(e);
|
|
1827
|
+
}
|
|
1828
|
+
var Di = 0;
|
|
1829
|
+
function Tt(e) {
|
|
1830
|
+
return e == null ? ":id" : typeof e == "string" ? e : "[".concat(e.join("+"), "]");
|
|
1831
|
+
}
|
|
1832
|
+
function Ai(e, t, c) {
|
|
1833
|
+
function r(h) {
|
|
1834
|
+
if (h.type === 3) return null;
|
|
1835
|
+
if (h.type === 4) throw new Error("Cannot convert never type to IDBKeyRange");
|
|
1836
|
+
var l = h.lower, d = h.upper, p = h.lowerOpen, h = h.upperOpen;
|
|
1837
|
+
return l === void 0 ? d === void 0 ? null : t.upperBound(d, !!h) : d === void 0 ? t.lowerBound(l, !!p) : t.bound(l, d, !!p, !!h);
|
|
1838
|
+
}
|
|
1839
|
+
function i(y) {
|
|
1840
|
+
var l, d = y.name;
|
|
1841
|
+
return { name: d, schema: y, mutate: function(p) {
|
|
1842
|
+
var h = p.trans, m = p.type, b = p.keys, _ = p.values, x = p.range;
|
|
1843
|
+
return new Promise(function(S, T) {
|
|
1844
|
+
S = oe(S);
|
|
1845
|
+
var P = h.objectStore(d), D = P.keyPath == null, j = m === "put" || m === "add";
|
|
1846
|
+
if (!j && m !== "delete" && m !== "deleteRange") throw new Error("Invalid operation type: " + m);
|
|
1847
|
+
var z, q = (b || _ || { length: 1 }).length;
|
|
1848
|
+
if (b && _ && b.length !== _.length) throw new Error("Given keys array must have same length as given values array.");
|
|
1849
|
+
if (q === 0) return S({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
1850
|
+
function X(me) {
|
|
1851
|
+
++we, Dt(me);
|
|
1852
|
+
}
|
|
1853
|
+
var G = [], Q = [], we = 0;
|
|
1854
|
+
if (m === "deleteRange") {
|
|
1855
|
+
if (x.type === 4) return S({ numFailures: we, failures: Q, results: [], lastResult: void 0 });
|
|
1856
|
+
x.type === 3 ? G.push(z = P.clear()) : G.push(z = P.delete(r(x)));
|
|
1857
|
+
} else {
|
|
1858
|
+
var D = j ? D ? [_, b] : [_, null] : [b, null], U = D[0], pe = D[1];
|
|
1859
|
+
if (j) for (var ye = 0; ye < q; ++ye) G.push(z = pe && pe[ye] !== void 0 ? P[m](U[ye], pe[ye]) : P[m](U[ye])), z.onerror = X;
|
|
1860
|
+
else for (ye = 0; ye < q; ++ye) G.push(z = P[m](U[ye])), z.onerror = X;
|
|
1861
|
+
}
|
|
1862
|
+
function hn(me) {
|
|
1863
|
+
me = me.target.result, G.forEach(function(at, or) {
|
|
1864
|
+
return at.error != null && (Q[or] = at.error);
|
|
1865
|
+
}), S({ numFailures: we, failures: Q, results: m === "delete" ? b : G.map(function(at) {
|
|
1866
|
+
return at.result;
|
|
1867
|
+
}), lastResult: me });
|
|
1868
|
+
}
|
|
1869
|
+
z.onerror = function(me) {
|
|
1870
|
+
X(me), hn(me);
|
|
1871
|
+
}, z.onsuccess = hn;
|
|
1872
|
+
});
|
|
1873
|
+
}, getMany: function(p) {
|
|
1874
|
+
var h = p.trans, m = p.keys;
|
|
1875
|
+
return new Promise(function(b, _) {
|
|
1876
|
+
b = oe(b);
|
|
1877
|
+
for (var x, S = h.objectStore(d), T = m.length, P = new Array(T), D = 0, j = 0, z = function(G) {
|
|
1878
|
+
G = G.target, P[G._pos] = G.result, ++j === D && b(P);
|
|
1879
|
+
}, q = Oe(_), X = 0; X < T; ++X) m[X] != null && ((x = S.get(m[X]))._pos = X, x.onsuccess = z, x.onerror = q, ++D);
|
|
1880
|
+
D === 0 && b(P);
|
|
1881
|
+
});
|
|
1882
|
+
}, get: function(p) {
|
|
1883
|
+
var h = p.trans, m = p.key;
|
|
1884
|
+
return new Promise(function(b, _) {
|
|
1885
|
+
b = oe(b);
|
|
1886
|
+
var x = h.objectStore(d).get(m);
|
|
1887
|
+
x.onsuccess = function(S) {
|
|
1888
|
+
return b(S.target.result);
|
|
1889
|
+
}, x.onerror = Oe(_);
|
|
1890
|
+
});
|
|
1891
|
+
}, query: (l = f, function(p) {
|
|
1892
|
+
return new Promise(function(h, m) {
|
|
1893
|
+
h = oe(h);
|
|
1894
|
+
var b, _, x, D = p.trans, S = p.values, T = p.limit, z = p.query, P = T === 1 / 0 ? void 0 : T, j = z.index, z = z.range, D = D.objectStore(d), j = j.isPrimaryKey ? D : D.index(j.name), z = r(z);
|
|
1895
|
+
if (T === 0) return h({ result: [] });
|
|
1896
|
+
l ? ((P = S ? j.getAll(z, P) : j.getAllKeys(z, P)).onsuccess = function(q) {
|
|
1897
|
+
return h({ result: q.target.result });
|
|
1898
|
+
}, P.onerror = Oe(m)) : (b = 0, _ = !S && "openKeyCursor" in j ? j.openKeyCursor(z) : j.openCursor(z), x = [], _.onsuccess = function(q) {
|
|
1899
|
+
var X = _.result;
|
|
1900
|
+
return X ? (x.push(S ? X.value : X.primaryKey), ++b === T ? h({ result: x }) : void X.continue()) : h({ result: x });
|
|
1901
|
+
}, _.onerror = Oe(m));
|
|
1902
|
+
});
|
|
1903
|
+
}), openCursor: function(p) {
|
|
1904
|
+
var h = p.trans, m = p.values, b = p.query, _ = p.reverse, x = p.unique;
|
|
1905
|
+
return new Promise(function(S, T) {
|
|
1906
|
+
S = oe(S);
|
|
1907
|
+
var j = b.index, P = b.range, D = h.objectStore(d), D = j.isPrimaryKey ? D : D.index(j.name), j = _ ? x ? "prevunique" : "prev" : x ? "nextunique" : "next", z = !m && "openKeyCursor" in D ? D.openKeyCursor(r(P), j) : D.openCursor(r(P), j);
|
|
1908
|
+
z.onerror = Oe(T), z.onsuccess = oe(function(q) {
|
|
1909
|
+
var X, G, Q, we, U = z.result;
|
|
1910
|
+
U ? (U.___id = ++Di, U.done = !1, X = U.continue.bind(U), G = (G = U.continuePrimaryKey) && G.bind(U), Q = U.advance.bind(U), we = function() {
|
|
1911
|
+
throw new Error("Cursor not stopped");
|
|
1912
|
+
}, U.trans = h, U.stop = U.continue = U.continuePrimaryKey = U.advance = function() {
|
|
1913
|
+
throw new Error("Cursor not started");
|
|
1914
|
+
}, U.fail = oe(T), U.next = function() {
|
|
1915
|
+
var pe = this, ye = 1;
|
|
1916
|
+
return this.start(function() {
|
|
1917
|
+
return ye-- ? pe.continue() : pe.stop();
|
|
1918
|
+
}).then(function() {
|
|
1919
|
+
return pe;
|
|
1920
|
+
});
|
|
1921
|
+
}, U.start = function(pe) {
|
|
1922
|
+
function ye() {
|
|
1923
|
+
if (z.result) try {
|
|
1924
|
+
pe();
|
|
1925
|
+
} catch (me) {
|
|
1926
|
+
U.fail(me);
|
|
1927
|
+
}
|
|
1928
|
+
else U.done = !0, U.start = function() {
|
|
1929
|
+
throw new Error("Cursor behind last entry");
|
|
1930
|
+
}, U.stop();
|
|
1931
|
+
}
|
|
1932
|
+
var hn = new Promise(function(me, at) {
|
|
1933
|
+
me = oe(me), z.onerror = Oe(at), U.fail = at, U.stop = function(or) {
|
|
1934
|
+
U.stop = U.continue = U.continuePrimaryKey = U.advance = we, me(or);
|
|
1935
|
+
};
|
|
1936
|
+
});
|
|
1937
|
+
return z.onsuccess = oe(function(me) {
|
|
1938
|
+
z.onsuccess = ye, ye();
|
|
1939
|
+
}), U.continue = X, U.continuePrimaryKey = G, U.advance = Q, ye(), hn;
|
|
1940
|
+
}, S(U)) : S(null);
|
|
1941
|
+
}, T);
|
|
1942
|
+
});
|
|
1943
|
+
}, count: function(p) {
|
|
1944
|
+
var h = p.query, m = p.trans, b = h.index, _ = h.range;
|
|
1945
|
+
return new Promise(function(x, S) {
|
|
1946
|
+
var T = m.objectStore(d), P = b.isPrimaryKey ? T : T.index(b.name), T = r(_), P = T ? P.count(T) : P.count();
|
|
1947
|
+
P.onsuccess = oe(function(D) {
|
|
1948
|
+
return x(D.target.result);
|
|
1949
|
+
}), P.onerror = Oe(S);
|
|
1950
|
+
});
|
|
1951
|
+
} };
|
|
1952
|
+
}
|
|
1953
|
+
var a, o, s, v = (o = c, s = Rr((a = e).objectStoreNames), { schema: { name: a.name, tables: s.map(function(y) {
|
|
1954
|
+
return o.objectStore(y);
|
|
1955
|
+
}).map(function(y) {
|
|
1956
|
+
var l = y.keyPath, h = y.autoIncrement, d = A(l), p = {}, h = { name: y.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: l == null, compound: d, keyPath: l, autoIncrement: h, unique: !0, extractKey: $n(l) }, indexes: Rr(y.indexNames).map(function(m) {
|
|
1957
|
+
return y.index(m);
|
|
1958
|
+
}).map(function(x) {
|
|
1959
|
+
var b = x.name, _ = x.unique, S = x.multiEntry, x = x.keyPath, S = { name: b, compound: A(x), keyPath: x, unique: _, multiEntry: S, extractKey: $n(x) };
|
|
1960
|
+
return p[Tt(x)] = S;
|
|
1961
|
+
}), getIndexByKeyPath: function(m) {
|
|
1962
|
+
return p[Tt(m)];
|
|
1963
|
+
} };
|
|
1964
|
+
return p[":id"] = h.primaryKey, l != null && (p[Tt(l)] = h.primaryKey), h;
|
|
1965
|
+
}) }, hasGetAll: 0 < s.length && "getAll" in o.objectStore(s[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), c = v.schema, f = v.hasGetAll, v = c.tables.map(i), u = {};
|
|
1966
|
+
return v.forEach(function(y) {
|
|
1967
|
+
return u[y.name] = y;
|
|
1968
|
+
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(y) {
|
|
1969
|
+
if (!u[y]) throw new Error("Table '".concat(y, "' not found"));
|
|
1970
|
+
return u[y];
|
|
1971
|
+
}, MIN_KEY: -1 / 0, MAX_KEY: zt(t), schema: c };
|
|
1972
|
+
}
|
|
1973
|
+
function zi(e, t, n, r) {
|
|
1974
|
+
var i = n.IDBKeyRange;
|
|
1975
|
+
return n.indexedDB, { dbcore: (r = Ai(t, i, r), e.dbcore.reduce(function(a, o) {
|
|
1976
|
+
return o = o.create, k(k({}, a), o(a));
|
|
1977
|
+
}, r)) };
|
|
1978
|
+
}
|
|
1979
|
+
function Jt(e, r) {
|
|
1980
|
+
var n = r.db, r = zi(e._middlewares, n, e._deps, r);
|
|
1981
|
+
e.core = r.dbcore, e.tables.forEach(function(i) {
|
|
1982
|
+
var a = i.name;
|
|
1983
|
+
e.core.schema.tables.some(function(o) {
|
|
1984
|
+
return o.name === a;
|
|
1985
|
+
}) && (i.core = e.core.table(a), e[a] instanceof e.Table && (e[a].core = i.core));
|
|
1986
|
+
});
|
|
1987
|
+
}
|
|
1988
|
+
function en(e, t, n, r) {
|
|
1989
|
+
n.forEach(function(i) {
|
|
1990
|
+
var a = r[i];
|
|
1991
|
+
t.forEach(function(o) {
|
|
1992
|
+
var s = function c(f, v) {
|
|
1993
|
+
return je(f, v) || (f = H(f)) && c(f, v);
|
|
1994
|
+
}(o, i);
|
|
1995
|
+
(!s || "value" in s && s.value === void 0) && (o === e.Transaction.prototype || o instanceof e.Transaction ? M(o, i, { get: function() {
|
|
1996
|
+
return this.table(i);
|
|
1997
|
+
}, set: function(c) {
|
|
1998
|
+
ee(this, i, { value: c, writable: !0, configurable: !0, enumerable: !0 });
|
|
1999
|
+
} }) : o[i] = new e.Table(i, a));
|
|
2000
|
+
});
|
|
2001
|
+
});
|
|
2002
|
+
}
|
|
2003
|
+
function Fn(e, t) {
|
|
2004
|
+
t.forEach(function(n) {
|
|
2005
|
+
for (var r in n) n[r] instanceof e.Table && delete n[r];
|
|
2006
|
+
});
|
|
2007
|
+
}
|
|
2008
|
+
function Ti(e, t) {
|
|
2009
|
+
return e._cfg.version - t._cfg.version;
|
|
2010
|
+
}
|
|
2011
|
+
function ji(e, t, n, r) {
|
|
2012
|
+
var i = e._dbSchema;
|
|
2013
|
+
n.objectStoreNames.contains("$meta") && !i.$meta && (i.$meta = Nn("$meta", qr("")[0], []), e._storeNames.push("$meta"));
|
|
2014
|
+
var a = e._createTransaction("readwrite", e._storeNames, i);
|
|
2015
|
+
a.create(n), a._completion.catch(r);
|
|
2016
|
+
var o = a._reject.bind(a), s = N.transless || N;
|
|
2017
|
+
qe(function() {
|
|
2018
|
+
return N.trans = a, N.transless = s, t !== 0 ? (Jt(e, n), f = t, ((c = a).storeNames.includes("$meta") ? c.table("$meta").get("version").then(function(v) {
|
|
2019
|
+
return v ?? f;
|
|
2020
|
+
}) : I.resolve(f)).then(function(v) {
|
|
2021
|
+
return y = v, l = a, d = n, p = [], v = (u = e)._versions, h = u._dbSchema = nn(0, u.idbdb, d), (v = v.filter(function(m) {
|
|
2022
|
+
return m._cfg.version >= y;
|
|
2023
|
+
})).length !== 0 ? (v.forEach(function(m) {
|
|
2024
|
+
p.push(function() {
|
|
2025
|
+
var b = h, _ = m._cfg.dbschema;
|
|
2026
|
+
rn(u, b, d), rn(u, _, d), h = u._dbSchema = _;
|
|
2027
|
+
var x = Vn(b, _);
|
|
2028
|
+
x.add.forEach(function(j) {
|
|
2029
|
+
Hn(d, j[0], j[1].primKey, j[1].indexes);
|
|
2030
|
+
}), x.change.forEach(function(j) {
|
|
2031
|
+
if (j.recreate) throw new V.Upgrade("Not yet support for changing primary key");
|
|
2032
|
+
var z = d.objectStore(j.name);
|
|
2033
|
+
j.add.forEach(function(q) {
|
|
2034
|
+
return tn(z, q);
|
|
2035
|
+
}), j.change.forEach(function(q) {
|
|
2036
|
+
z.deleteIndex(q.name), tn(z, q);
|
|
2037
|
+
}), j.del.forEach(function(q) {
|
|
2038
|
+
return z.deleteIndex(q);
|
|
2039
|
+
});
|
|
2040
|
+
});
|
|
2041
|
+
var S = m._cfg.contentUpgrade;
|
|
2042
|
+
if (S && m._cfg.version > y) {
|
|
2043
|
+
Jt(u, d), l._memoizedTables = {};
|
|
2044
|
+
var T = We(_);
|
|
2045
|
+
x.del.forEach(function(j) {
|
|
2046
|
+
T[j] = b[j];
|
|
2047
|
+
}), Fn(u, [u.Transaction.prototype]), en(u, [u.Transaction.prototype], O(T), T), l.schema = T;
|
|
2048
|
+
var P, D = xn(S);
|
|
2049
|
+
return D && dt(), x = I.follow(function() {
|
|
2050
|
+
var j;
|
|
2051
|
+
(P = S(l)) && D && (j = Me.bind(null, null), P.then(j, j));
|
|
2052
|
+
}), P && typeof P.then == "function" ? I.resolve(P) : x.then(function() {
|
|
2053
|
+
return P;
|
|
2054
|
+
});
|
|
2055
|
+
}
|
|
2056
|
+
}), p.push(function(b) {
|
|
2057
|
+
var _, x, S = m._cfg.dbschema;
|
|
2058
|
+
_ = S, x = b, [].slice.call(x.db.objectStoreNames).forEach(function(T) {
|
|
2059
|
+
return _[T] == null && x.db.deleteObjectStore(T);
|
|
2060
|
+
}), Fn(u, [u.Transaction.prototype]), en(u, [u.Transaction.prototype], u._storeNames, u._dbSchema), l.schema = u._dbSchema;
|
|
2061
|
+
}), p.push(function(b) {
|
|
2062
|
+
u.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(u.idbdb.version / 10) === m._cfg.version ? (u.idbdb.deleteObjectStore("$meta"), delete u._dbSchema.$meta, u._storeNames = u._storeNames.filter(function(_) {
|
|
2063
|
+
return _ !== "$meta";
|
|
2064
|
+
})) : b.objectStore("$meta").put(m._cfg.version, "version"));
|
|
2065
|
+
});
|
|
2066
|
+
}), function m() {
|
|
2067
|
+
return p.length ? I.resolve(p.shift()(l.idbtrans)).then(m) : I.resolve();
|
|
2068
|
+
}().then(function() {
|
|
2069
|
+
Br(h, d);
|
|
2070
|
+
})) : I.resolve();
|
|
2071
|
+
var u, y, l, d, p, h;
|
|
2072
|
+
}).catch(o)) : (O(i).forEach(function(v) {
|
|
2073
|
+
Hn(n, v, i[v].primKey, i[v].indexes);
|
|
2074
|
+
}), Jt(e, n), void I.follow(function() {
|
|
2075
|
+
return e.on.populate.fire(a);
|
|
2076
|
+
}).catch(o));
|
|
2077
|
+
var c, f;
|
|
2078
|
+
});
|
|
2079
|
+
}
|
|
2080
|
+
function Ii(e, t) {
|
|
2081
|
+
Br(e._dbSchema, t), t.db.version % 10 != 0 || t.objectStoreNames.contains("$meta") || t.db.createObjectStore("$meta").add(Math.ceil(t.db.version / 10 - 1), "version");
|
|
2082
|
+
var n = nn(0, e.idbdb, t);
|
|
2083
|
+
rn(e, e._dbSchema, t);
|
|
2084
|
+
for (var r = 0, i = Vn(n, e._dbSchema).change; r < i.length; r++) {
|
|
2085
|
+
var a = function(o) {
|
|
2086
|
+
if (o.change.length || o.recreate) return console.warn("Unable to patch indexes of table ".concat(o.name, " because it has changes on the type of index or primary key.")), { value: void 0 };
|
|
2087
|
+
var s = t.objectStore(o.name);
|
|
2088
|
+
o.add.forEach(function(c) {
|
|
2089
|
+
Ee && console.debug("Dexie upgrade patch: Creating missing index ".concat(o.name, ".").concat(c.src)), tn(s, c);
|
|
2090
|
+
});
|
|
2091
|
+
}(i[r]);
|
|
2092
|
+
if (typeof a == "object") return a.value;
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
function Vn(e, t) {
|
|
2096
|
+
var n, r = { del: [], add: [], change: [] };
|
|
2097
|
+
for (n in e) t[n] || r.del.push(n);
|
|
2098
|
+
for (n in t) {
|
|
2099
|
+
var i = e[n], a = t[n];
|
|
2100
|
+
if (i) {
|
|
2101
|
+
var o = { name: n, def: a, recreate: !1, del: [], add: [], change: [] };
|
|
2102
|
+
if ("" + (i.primKey.keyPath || "") != "" + (a.primKey.keyPath || "") || i.primKey.auto !== a.primKey.auto) o.recreate = !0, r.change.push(o);
|
|
2103
|
+
else {
|
|
2104
|
+
var s = i.idxByName, c = a.idxByName, f = void 0;
|
|
2105
|
+
for (f in s) c[f] || o.del.push(f);
|
|
2106
|
+
for (f in c) {
|
|
2107
|
+
var v = s[f], u = c[f];
|
|
2108
|
+
v ? v.src !== u.src && o.change.push(u) : o.add.push(u);
|
|
2109
|
+
}
|
|
2110
|
+
(0 < o.del.length || 0 < o.add.length || 0 < o.change.length) && r.change.push(o);
|
|
2111
|
+
}
|
|
2112
|
+
} else r.add.push([n, a]);
|
|
2113
|
+
}
|
|
2114
|
+
return r;
|
|
2115
|
+
}
|
|
2116
|
+
function Hn(e, t, n, r) {
|
|
2117
|
+
var i = e.db.createObjectStore(t, n.keyPath ? { keyPath: n.keyPath, autoIncrement: n.auto } : { autoIncrement: n.auto });
|
|
2118
|
+
return r.forEach(function(a) {
|
|
2119
|
+
return tn(i, a);
|
|
2120
|
+
}), i;
|
|
2121
|
+
}
|
|
2122
|
+
function Br(e, t) {
|
|
2123
|
+
O(e).forEach(function(n) {
|
|
2124
|
+
t.db.objectStoreNames.contains(n) || (Ee && console.debug("Dexie: Creating missing table", n), Hn(t, n, e[n].primKey, e[n].indexes));
|
|
2125
|
+
});
|
|
2126
|
+
}
|
|
2127
|
+
function tn(e, t) {
|
|
2128
|
+
e.createIndex(t.name, t.keyPath, { unique: t.unique, multiEntry: t.multi });
|
|
2129
|
+
}
|
|
2130
|
+
function nn(e, t, n) {
|
|
2131
|
+
var r = {};
|
|
2132
|
+
return Re(t.objectStoreNames, 0).forEach(function(i) {
|
|
2133
|
+
for (var a = n.objectStore(i), o = Ln(Ir(f = a.keyPath), f || "", !0, !1, !!a.autoIncrement, f && typeof f != "string", !0), s = [], c = 0; c < a.indexNames.length; ++c) {
|
|
2134
|
+
var v = a.index(a.indexNames[c]), f = v.keyPath, v = Ln(v.name, f, !!v.unique, !!v.multiEntry, !1, f && typeof f != "string", !1);
|
|
2135
|
+
s.push(v);
|
|
2136
|
+
}
|
|
2137
|
+
r[i] = Nn(i, o, s);
|
|
2138
|
+
}), r;
|
|
2139
|
+
}
|
|
2140
|
+
function rn(e, t, n) {
|
|
2141
|
+
for (var r = n.db.objectStoreNames, i = 0; i < r.length; ++i) {
|
|
2142
|
+
var a = r[i], o = n.objectStore(a);
|
|
2143
|
+
e._hasGetAll = "getAll" in o;
|
|
2144
|
+
for (var s = 0; s < o.indexNames.length; ++s) {
|
|
2145
|
+
var c = o.indexNames[s], f = o.index(c).keyPath, v = typeof f == "string" ? f : "[" + Re(f).join("+") + "]";
|
|
2146
|
+
!t[a] || (f = t[a].idxByName[v]) && (f.name = c, delete t[a].idxByName[v], t[a].idxByName[c] = f);
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2149
|
+
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && C.WorkerGlobalScope && C instanceof C.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (e._hasGetAll = !1);
|
|
2150
|
+
}
|
|
2151
|
+
function qr(e) {
|
|
2152
|
+
return e.split(",").map(function(t, n) {
|
|
2153
|
+
var r = (t = t.trim()).replace(/([&*]|\+\+)/g, ""), i = /^\[/.test(r) ? r.match(/^\[(.*)\]$/)[1].split("+") : r;
|
|
2154
|
+
return Ln(r, i || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t), A(i), n === 0);
|
|
2155
|
+
});
|
|
2156
|
+
}
|
|
2157
|
+
var Ri = (an.prototype._parseStoresSpec = function(e, t) {
|
|
2158
|
+
O(e).forEach(function(n) {
|
|
2159
|
+
if (e[n] !== null) {
|
|
2160
|
+
var r = qr(e[n]), i = r.shift();
|
|
2161
|
+
if (i.unique = !0, i.multi) throw new V.Schema("Primary key cannot be multi-valued");
|
|
2162
|
+
r.forEach(function(a) {
|
|
2163
|
+
if (a.auto) throw new V.Schema("Only primary key can be marked as autoIncrement (++)");
|
|
2164
|
+
if (!a.keyPath) throw new V.Schema("Index must have a name and cannot be an empty string");
|
|
2165
|
+
}), t[n] = Nn(n, i, r);
|
|
2166
|
+
}
|
|
2167
|
+
});
|
|
2168
|
+
}, an.prototype.stores = function(n) {
|
|
2169
|
+
var t = this.db;
|
|
2170
|
+
this._cfg.storesSource = this._cfg.storesSource ? R(this._cfg.storesSource, n) : n;
|
|
2171
|
+
var n = t._versions, r = {}, i = {};
|
|
2172
|
+
return n.forEach(function(a) {
|
|
2173
|
+
R(r, a._cfg.storesSource), i = a._cfg.dbschema = {}, a._parseStoresSpec(r, i);
|
|
2174
|
+
}), t._dbSchema = i, Fn(t, [t._allTables, t, t.Transaction.prototype]), en(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables], O(i), i), t._storeNames = O(i), this;
|
|
2175
|
+
}, an.prototype.upgrade = function(e) {
|
|
2176
|
+
return this._cfg.contentUpgrade = En(this._cfg.contentUpgrade || re, e), this;
|
|
2177
|
+
}, an);
|
|
2178
|
+
function an() {
|
|
2179
|
+
}
|
|
2180
|
+
function Wn(e, t) {
|
|
2181
|
+
var n = e._dbNamesDB;
|
|
2182
|
+
return n || (n = e._dbNamesDB = new Ae(Yt, { addons: [], indexedDB: e, IDBKeyRange: t })).version(1).stores({ dbnames: "name" }), n.table("dbnames");
|
|
2183
|
+
}
|
|
2184
|
+
function Un(e) {
|
|
2185
|
+
return e && typeof e.databases == "function";
|
|
2186
|
+
}
|
|
2187
|
+
function Yn(e) {
|
|
2188
|
+
return qe(function() {
|
|
2189
|
+
return N.letThrough = !0, e();
|
|
2190
|
+
});
|
|
2191
|
+
}
|
|
2192
|
+
function Xn(e) {
|
|
2193
|
+
return !("from" in e);
|
|
2194
|
+
}
|
|
2195
|
+
var ve = function(e, t) {
|
|
2196
|
+
if (!this) {
|
|
2197
|
+
var n = new ve();
|
|
2198
|
+
return e && "d" in e && R(n, e), n;
|
|
2199
|
+
}
|
|
2200
|
+
R(this, arguments.length ? { d: 1, from: e, to: 1 < arguments.length ? t : e } : { d: 0 });
|
|
2201
|
+
};
|
|
2202
|
+
function jt(e, t, n) {
|
|
2203
|
+
var r = J(t, n);
|
|
2204
|
+
if (!isNaN(r)) {
|
|
2205
|
+
if (0 < r) throw RangeError();
|
|
2206
|
+
if (Xn(e)) return R(e, { from: t, to: n, d: 1 });
|
|
2207
|
+
var i = e.l, r = e.r;
|
|
2208
|
+
if (J(n, e.from) < 0) return i ? jt(i, t, n) : e.l = { from: t, to: n, d: 1, l: null, r: null }, Lr(e);
|
|
2209
|
+
if (0 < J(t, e.to)) return r ? jt(r, t, n) : e.r = { from: t, to: n, d: 1, l: null, r: null }, Lr(e);
|
|
2210
|
+
J(t, e.from) < 0 && (e.from = t, e.l = null, e.d = r ? r.d + 1 : 1), 0 < J(n, e.to) && (e.to = n, e.r = null, e.d = e.l ? e.l.d + 1 : 1), n = !e.r, i && !e.l && It(e, i), r && n && It(e, r);
|
|
2211
|
+
}
|
|
2212
|
+
}
|
|
2213
|
+
function It(e, t) {
|
|
2214
|
+
Xn(t) || function n(r, c) {
|
|
2215
|
+
var a = c.from, o = c.to, s = c.l, c = c.r;
|
|
2216
|
+
jt(r, a, o), s && n(r, s), c && n(r, c);
|
|
2217
|
+
}(e, t);
|
|
2218
|
+
}
|
|
2219
|
+
function Mr(e, t) {
|
|
2220
|
+
var n = on(t), r = n.next();
|
|
2221
|
+
if (r.done) return !1;
|
|
2222
|
+
for (var i = r.value, a = on(e), o = a.next(i.from), s = o.value; !r.done && !o.done; ) {
|
|
2223
|
+
if (J(s.from, i.to) <= 0 && 0 <= J(s.to, i.from)) return !0;
|
|
2224
|
+
J(i.from, s.from) < 0 ? i = (r = n.next(s.from)).value : s = (o = a.next(i.from)).value;
|
|
2225
|
+
}
|
|
2226
|
+
return !1;
|
|
2227
|
+
}
|
|
2228
|
+
function on(e) {
|
|
2229
|
+
var t = Xn(e) ? null : { s: 0, n: e };
|
|
2230
|
+
return { next: function(n) {
|
|
2231
|
+
for (var r = 0 < arguments.length; t; ) switch (t.s) {
|
|
2232
|
+
case 0:
|
|
2233
|
+
if (t.s = 1, r) for (; t.n.l && J(n, t.n.from) < 0; ) t = { up: t, n: t.n.l, s: 1 };
|
|
2234
|
+
else for (; t.n.l; ) t = { up: t, n: t.n.l, s: 1 };
|
|
2235
|
+
case 1:
|
|
2236
|
+
if (t.s = 2, !r || J(n, t.n.to) <= 0) return { value: t.n, done: !1 };
|
|
2237
|
+
case 2:
|
|
2238
|
+
if (t.n.r) {
|
|
2239
|
+
t.s = 3, t = { up: t, n: t.n.r, s: 0 };
|
|
2240
|
+
continue;
|
|
2241
|
+
}
|
|
2242
|
+
case 3:
|
|
2243
|
+
t = t.up;
|
|
2244
|
+
}
|
|
2245
|
+
return { done: !0 };
|
|
2246
|
+
} };
|
|
2247
|
+
}
|
|
2248
|
+
function Lr(e) {
|
|
2249
|
+
var t, n, r = (((t = e.r) === null || t === void 0 ? void 0 : t.d) || 0) - (((n = e.l) === null || n === void 0 ? void 0 : n.d) || 0), i = 1 < r ? "r" : r < -1 ? "l" : "";
|
|
2250
|
+
i && (t = i == "r" ? "l" : "r", n = k({}, e), r = e[i], e.from = r.from, e.to = r.to, e[i] = r[i], n[i] = r[t], (e[t] = n).d = Nr(n)), e.d = Nr(e);
|
|
2251
|
+
}
|
|
2252
|
+
function Nr(n) {
|
|
2253
|
+
var t = n.r, n = n.l;
|
|
2254
|
+
return (t ? n ? Math.max(t.d, n.d) : t.d : n ? n.d : 0) + 1;
|
|
2255
|
+
}
|
|
2256
|
+
function sn(e, t) {
|
|
2257
|
+
return O(t).forEach(function(n) {
|
|
2258
|
+
e[n] ? It(e[n], t[n]) : e[n] = function r(i) {
|
|
2259
|
+
var a, o, s = {};
|
|
2260
|
+
for (a in i) B(i, a) && (o = i[a], s[a] = !o || typeof o != "object" || pr.has(o.constructor) ? o : r(o));
|
|
2261
|
+
return s;
|
|
2262
|
+
}(t[n]);
|
|
2263
|
+
}), e;
|
|
2264
|
+
}
|
|
2265
|
+
function Gn(e, t) {
|
|
2266
|
+
return e.all || t.all || Object.keys(e).some(function(n) {
|
|
2267
|
+
return t[n] && Mr(t[n], e[n]);
|
|
2268
|
+
});
|
|
2269
|
+
}
|
|
2270
|
+
F(ve.prototype, ((xe = { add: function(e) {
|
|
2271
|
+
return It(this, e), this;
|
|
2272
|
+
}, addKey: function(e) {
|
|
2273
|
+
return jt(this, e, e), this;
|
|
2274
|
+
}, addKeys: function(e) {
|
|
2275
|
+
var t = this;
|
|
2276
|
+
return e.forEach(function(n) {
|
|
2277
|
+
return jt(t, n, n);
|
|
2278
|
+
}), this;
|
|
2279
|
+
}, hasKey: function(e) {
|
|
2280
|
+
var t = on(this).next(e).value;
|
|
2281
|
+
return t && J(t.from, e) <= 0 && 0 <= J(t.to, e);
|
|
2282
|
+
} })[kn] = function() {
|
|
2283
|
+
return on(this);
|
|
2284
|
+
}, xe));
|
|
2285
|
+
var rt = {}, Qn = {}, Zn = !1;
|
|
2286
|
+
function un(e) {
|
|
2287
|
+
sn(Qn, e), Zn || (Zn = !0, setTimeout(function() {
|
|
2288
|
+
Zn = !1, Jn(Qn, !(Qn = {}));
|
|
2289
|
+
}, 0));
|
|
2290
|
+
}
|
|
2291
|
+
function Jn(e, t) {
|
|
2292
|
+
t === void 0 && (t = !1);
|
|
2293
|
+
var n = /* @__PURE__ */ new Set();
|
|
2294
|
+
if (e.all) for (var r = 0, i = Object.values(rt); r < i.length; r++) $r(o = i[r], e, n, t);
|
|
2295
|
+
else for (var a in e) {
|
|
2296
|
+
var o, s = /^idb\:\/\/(.*)\/(.*)\//.exec(a);
|
|
2297
|
+
s && (a = s[1], s = s[2], (o = rt["idb://".concat(a, "/").concat(s)]) && $r(o, e, n, t));
|
|
2298
|
+
}
|
|
2299
|
+
n.forEach(function(c) {
|
|
2300
|
+
return c();
|
|
2301
|
+
});
|
|
2302
|
+
}
|
|
2303
|
+
function $r(e, t, n, r) {
|
|
2304
|
+
for (var i = [], a = 0, o = Object.entries(e.queries.query); a < o.length; a++) {
|
|
2305
|
+
for (var s = o[a], c = s[0], f = [], v = 0, u = s[1]; v < u.length; v++) {
|
|
2306
|
+
var y = u[v];
|
|
2307
|
+
Gn(t, y.obsSet) ? y.subscribers.forEach(function(h) {
|
|
2308
|
+
return n.add(h);
|
|
2309
|
+
}) : r && f.push(y);
|
|
2310
|
+
}
|
|
2311
|
+
r && i.push([c, f]);
|
|
2312
|
+
}
|
|
2313
|
+
if (r) for (var l = 0, d = i; l < d.length; l++) {
|
|
2314
|
+
var p = d[l], c = p[0], f = p[1];
|
|
2315
|
+
e.queries.query[c] = f;
|
|
2316
|
+
}
|
|
2317
|
+
}
|
|
2318
|
+
function Bi(e) {
|
|
2319
|
+
var t = e._state, n = e._deps.indexedDB;
|
|
2320
|
+
if (t.isBeingOpened || e.idbdb) return t.dbReadyPromise.then(function() {
|
|
2321
|
+
return t.dbOpenError ? ue(t.dbOpenError) : e;
|
|
2322
|
+
});
|
|
2323
|
+
t.isBeingOpened = !0, t.dbOpenError = null, t.openComplete = !1;
|
|
2324
|
+
var r = t.openCanceller, i = Math.round(10 * e.verno), a = !1;
|
|
2325
|
+
function o() {
|
|
2326
|
+
if (t.openCanceller !== r) throw new V.DatabaseClosed("db.open() was cancelled");
|
|
2327
|
+
}
|
|
2328
|
+
function s() {
|
|
2329
|
+
return new I(function(y, l) {
|
|
2330
|
+
if (o(), !n) throw new V.MissingAPI();
|
|
2331
|
+
var d = e.name, p = t.autoSchema || !i ? n.open(d) : n.open(d, i);
|
|
2332
|
+
if (!p) throw new V.MissingAPI();
|
|
2333
|
+
p.onerror = Oe(l), p.onblocked = oe(e._fireOnBlocked), p.onupgradeneeded = oe(function(h) {
|
|
2334
|
+
var m;
|
|
2335
|
+
v = p.transaction, t.autoSchema && !e._options.allowEmptyDB ? (p.onerror = Dt, v.abort(), p.result.close(), (m = n.deleteDatabase(d)).onsuccess = m.onerror = oe(function() {
|
|
2336
|
+
l(new V.NoSuchDatabase("Database ".concat(d, " doesnt exist")));
|
|
2337
|
+
})) : (v.onerror = Oe(l), h = h.oldVersion > Math.pow(2, 62) ? 0 : h.oldVersion, u = h < 1, e.idbdb = p.result, a && Ii(e, v), ji(e, h / 10, v, l));
|
|
2338
|
+
}, l), p.onsuccess = oe(function() {
|
|
2339
|
+
v = null;
|
|
2340
|
+
var h, m, b, _, x, S = e.idbdb = p.result, T = Re(S.objectStoreNames);
|
|
2341
|
+
if (0 < T.length) try {
|
|
2342
|
+
var P = S.transaction((_ = T).length === 1 ? _[0] : _, "readonly");
|
|
2343
|
+
if (t.autoSchema) m = S, b = P, (h = e).verno = m.version / 10, b = h._dbSchema = nn(0, m, b), h._storeNames = Re(m.objectStoreNames, 0), en(h, [h._allTables], O(b), b);
|
|
2344
|
+
else if (rn(e, e._dbSchema, P), ((x = Vn(nn(0, (x = e).idbdb, P), x._dbSchema)).add.length || x.change.some(function(D) {
|
|
2345
|
+
return D.add.length || D.change.length;
|
|
2346
|
+
})) && !a) return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."), S.close(), i = S.version + 1, a = !0, y(s());
|
|
2347
|
+
Jt(e, P);
|
|
2348
|
+
} catch {
|
|
2349
|
+
}
|
|
2350
|
+
vt.push(e), S.onversionchange = oe(function(D) {
|
|
2351
|
+
t.vcFired = !0, e.on("versionchange").fire(D);
|
|
2352
|
+
}), S.onclose = oe(function(D) {
|
|
2353
|
+
e.on("close").fire(D);
|
|
2354
|
+
}), u && (x = e._deps, P = d, S = x.indexedDB, x = x.IDBKeyRange, Un(S) || P === Yt || Wn(S, x).put({ name: P }).catch(re)), y();
|
|
2355
|
+
}, l);
|
|
2356
|
+
}).catch(function(y) {
|
|
2357
|
+
switch (y == null ? void 0 : y.name) {
|
|
2358
|
+
case "UnknownError":
|
|
2359
|
+
if (0 < t.PR1398_maxLoop) return t.PR1398_maxLoop--, console.warn("Dexie: Workaround for Chrome UnknownError on open()"), s();
|
|
2360
|
+
break;
|
|
2361
|
+
case "VersionError":
|
|
2362
|
+
if (0 < i) return i = 0, s();
|
|
2363
|
+
}
|
|
2364
|
+
return I.reject(y);
|
|
2365
|
+
});
|
|
2366
|
+
}
|
|
2367
|
+
var c, f = t.dbReadyResolve, v = null, u = !1;
|
|
2368
|
+
return I.race([r, (typeof navigator > "u" ? I.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(y) {
|
|
2369
|
+
function l() {
|
|
2370
|
+
return indexedDB.databases().finally(y);
|
|
2371
|
+
}
|
|
2372
|
+
c = setInterval(l, 100), l();
|
|
2373
|
+
}).finally(function() {
|
|
2374
|
+
return clearInterval(c);
|
|
2375
|
+
}) : Promise.resolve()).then(s)]).then(function() {
|
|
2376
|
+
return o(), t.onReadyBeingFired = [], I.resolve(Yn(function() {
|
|
2377
|
+
return e.on.ready.fire(e.vip);
|
|
2378
|
+
})).then(function y() {
|
|
2379
|
+
if (0 < t.onReadyBeingFired.length) {
|
|
2380
|
+
var l = t.onReadyBeingFired.reduce(En, re);
|
|
2381
|
+
return t.onReadyBeingFired = [], I.resolve(Yn(function() {
|
|
2382
|
+
return l(e.vip);
|
|
2383
|
+
})).then(y);
|
|
2384
|
+
}
|
|
2385
|
+
});
|
|
2386
|
+
}).finally(function() {
|
|
2387
|
+
t.openCanceller === r && (t.onReadyBeingFired = null, t.isBeingOpened = !1);
|
|
2388
|
+
}).catch(function(y) {
|
|
2389
|
+
t.dbOpenError = y;
|
|
2390
|
+
try {
|
|
2391
|
+
v && v.abort();
|
|
2392
|
+
} catch {
|
|
2393
|
+
}
|
|
2394
|
+
return r === t.openCanceller && e._close(), ue(y);
|
|
2395
|
+
}).finally(function() {
|
|
2396
|
+
t.openComplete = !0, f();
|
|
2397
|
+
}).then(function() {
|
|
2398
|
+
var y;
|
|
2399
|
+
return u && (y = {}, e.tables.forEach(function(l) {
|
|
2400
|
+
l.schema.indexes.forEach(function(d) {
|
|
2401
|
+
d.name && (y["idb://".concat(e.name, "/").concat(l.name, "/").concat(d.name)] = new ve(-1 / 0, [[[]]]));
|
|
2402
|
+
}), y["idb://".concat(e.name, "/").concat(l.name, "/")] = y["idb://".concat(e.name, "/").concat(l.name, "/:dels")] = new ve(-1 / 0, [[[]]]);
|
|
2403
|
+
}), $e(At).fire(y), Jn(y, !0)), e;
|
|
2404
|
+
});
|
|
2405
|
+
}
|
|
2406
|
+
function er(e) {
|
|
2407
|
+
function t(a) {
|
|
2408
|
+
return e.next(a);
|
|
2409
|
+
}
|
|
2410
|
+
var n = i(t), r = i(function(a) {
|
|
2411
|
+
return e.throw(a);
|
|
2412
|
+
});
|
|
2413
|
+
function i(a) {
|
|
2414
|
+
return function(c) {
|
|
2415
|
+
var s = a(c), c = s.value;
|
|
2416
|
+
return s.done ? c : c && typeof c.then == "function" ? c.then(n, r) : A(c) ? Promise.all(c).then(n, r) : n(c);
|
|
2417
|
+
};
|
|
2418
|
+
}
|
|
2419
|
+
return i(t)();
|
|
2420
|
+
}
|
|
2421
|
+
function cn(e, t, n) {
|
|
2422
|
+
for (var r = A(e) ? e.slice() : [e], i = 0; i < n; ++i) r.push(t);
|
|
2423
|
+
return r;
|
|
2424
|
+
}
|
|
2425
|
+
var qi = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
2426
|
+
return k(k({}, e), { table: function(t) {
|
|
2427
|
+
var n = e.table(t), r = n.schema, i = {}, a = [];
|
|
2428
|
+
function o(u, y, l) {
|
|
2429
|
+
var d = Tt(u), p = i[d] = i[d] || [], h = u == null ? 0 : typeof u == "string" ? 1 : u.length, m = 0 < y, m = k(k({}, l), { name: m ? "".concat(d, "(virtual-from:").concat(l.name, ")") : l.name, lowLevelIndex: l, isVirtual: m, keyTail: y, keyLength: h, extractKey: $n(u), unique: !m && l.unique });
|
|
2430
|
+
return p.push(m), m.isPrimaryKey || a.push(m), 1 < h && o(h === 2 ? u[0] : u.slice(0, h - 1), y + 1, l), p.sort(function(b, _) {
|
|
2431
|
+
return b.keyTail - _.keyTail;
|
|
2432
|
+
}), m;
|
|
2433
|
+
}
|
|
2434
|
+
t = o(r.primaryKey.keyPath, 0, r.primaryKey), i[":id"] = [t];
|
|
2435
|
+
for (var s = 0, c = r.indexes; s < c.length; s++) {
|
|
2436
|
+
var f = c[s];
|
|
2437
|
+
o(f.keyPath, 0, f);
|
|
2438
|
+
}
|
|
2439
|
+
function v(u) {
|
|
2440
|
+
var y, l = u.query.index;
|
|
2441
|
+
return l.isVirtual ? k(k({}, u), { query: { index: l.lowLevelIndex, range: (y = u.query.range, l = l.keyTail, { type: y.type === 1 ? 2 : y.type, lower: cn(y.lower, y.lowerOpen ? e.MAX_KEY : e.MIN_KEY, l), lowerOpen: !0, upper: cn(y.upper, y.upperOpen ? e.MIN_KEY : e.MAX_KEY, l), upperOpen: !0 }) } }) : u;
|
|
2442
|
+
}
|
|
2443
|
+
return k(k({}, n), { schema: k(k({}, r), { primaryKey: t, indexes: a, getIndexByKeyPath: function(u) {
|
|
2444
|
+
return (u = i[Tt(u)]) && u[0];
|
|
2445
|
+
} }), count: function(u) {
|
|
2446
|
+
return n.count(v(u));
|
|
2447
|
+
}, query: function(u) {
|
|
2448
|
+
return n.query(v(u));
|
|
2449
|
+
}, openCursor: function(u) {
|
|
2450
|
+
var y = u.query.index, l = y.keyTail, d = y.isVirtual, p = y.keyLength;
|
|
2451
|
+
return d ? n.openCursor(v(u)).then(function(m) {
|
|
2452
|
+
return m && h(m);
|
|
2453
|
+
}) : n.openCursor(u);
|
|
2454
|
+
function h(m) {
|
|
2455
|
+
return Object.create(m, { continue: { value: function(b) {
|
|
2456
|
+
b != null ? m.continue(cn(b, u.reverse ? e.MAX_KEY : e.MIN_KEY, l)) : u.unique ? m.continue(m.key.slice(0, p).concat(u.reverse ? e.MIN_KEY : e.MAX_KEY, l)) : m.continue();
|
|
2457
|
+
} }, continuePrimaryKey: { value: function(b, _) {
|
|
2458
|
+
m.continuePrimaryKey(cn(b, e.MAX_KEY, l), _);
|
|
2459
|
+
} }, primaryKey: { get: function() {
|
|
2460
|
+
return m.primaryKey;
|
|
2461
|
+
} }, key: { get: function() {
|
|
2462
|
+
var b = m.key;
|
|
2463
|
+
return p === 1 ? b[0] : b.slice(0, p);
|
|
2464
|
+
} }, value: { get: function() {
|
|
2465
|
+
return m.value;
|
|
2466
|
+
} } });
|
|
2467
|
+
}
|
|
2468
|
+
} });
|
|
2469
|
+
} });
|
|
2470
|
+
} };
|
|
2471
|
+
function tr(e, t, n, r) {
|
|
2472
|
+
return n = n || {}, r = r || "", O(e).forEach(function(i) {
|
|
2473
|
+
var a, o, s;
|
|
2474
|
+
B(t, i) ? (a = e[i], o = t[i], typeof a == "object" && typeof o == "object" && a && o ? (s = wn(a)) !== wn(o) ? n[r + i] = t[i] : s === "Object" ? tr(a, o, n, r + i + ".") : a !== o && (n[r + i] = t[i]) : a !== o && (n[r + i] = t[i])) : n[r + i] = void 0;
|
|
2475
|
+
}), O(t).forEach(function(i) {
|
|
2476
|
+
B(e, i) || (n[r + i] = t[i]);
|
|
2477
|
+
}), n;
|
|
2478
|
+
}
|
|
2479
|
+
function nr(e, t) {
|
|
2480
|
+
return t.type === "delete" ? t.keys : t.keys || t.values.map(e.extractKey);
|
|
2481
|
+
}
|
|
2482
|
+
var Mi = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e) {
|
|
2483
|
+
return k(k({}, e), { table: function(t) {
|
|
2484
|
+
var n = e.table(t), r = n.schema.primaryKey;
|
|
2485
|
+
return k(k({}, n), { mutate: function(i) {
|
|
2486
|
+
var a = N.trans, o = a.table(t).hook, s = o.deleting, c = o.creating, f = o.updating;
|
|
2487
|
+
switch (i.type) {
|
|
2488
|
+
case "add":
|
|
2489
|
+
if (c.fire === re) break;
|
|
2490
|
+
return a._promise("readwrite", function() {
|
|
2491
|
+
return v(i);
|
|
2492
|
+
}, !0);
|
|
2493
|
+
case "put":
|
|
2494
|
+
if (c.fire === re && f.fire === re) break;
|
|
2495
|
+
return a._promise("readwrite", function() {
|
|
2496
|
+
return v(i);
|
|
2497
|
+
}, !0);
|
|
2498
|
+
case "delete":
|
|
2499
|
+
if (s.fire === re) break;
|
|
2500
|
+
return a._promise("readwrite", function() {
|
|
2501
|
+
return v(i);
|
|
2502
|
+
}, !0);
|
|
2503
|
+
case "deleteRange":
|
|
2504
|
+
if (s.fire === re) break;
|
|
2505
|
+
return a._promise("readwrite", function() {
|
|
2506
|
+
return function u(y, l, d) {
|
|
2507
|
+
return n.query({ trans: y, values: !1, query: { index: r, range: l }, limit: d }).then(function(p) {
|
|
2508
|
+
var h = p.result;
|
|
2509
|
+
return v({ type: "delete", keys: h, trans: y }).then(function(m) {
|
|
2510
|
+
return 0 < m.numFailures ? Promise.reject(m.failures[0]) : h.length < d ? { failures: [], numFailures: 0, lastResult: void 0 } : u(y, k(k({}, l), { lower: h[h.length - 1], lowerOpen: !0 }), d);
|
|
2511
|
+
});
|
|
2512
|
+
});
|
|
2513
|
+
}(i.trans, i.range, 1e4);
|
|
2514
|
+
}, !0);
|
|
2515
|
+
}
|
|
2516
|
+
return n.mutate(i);
|
|
2517
|
+
function v(u) {
|
|
2518
|
+
var y, l, d, p = N.trans, h = u.keys || nr(r, u);
|
|
2519
|
+
if (!h) throw new Error("Keys missing");
|
|
2520
|
+
return (u = u.type === "add" || u.type === "put" ? k(k({}, u), { keys: h }) : k({}, u)).type !== "delete" && (u.values = K([], u.values)), u.keys && (u.keys = K([], u.keys)), y = n, d = h, ((l = u).type === "add" ? Promise.resolve([]) : y.getMany({ trans: l.trans, keys: d, cache: "immutable" })).then(function(m) {
|
|
2521
|
+
var b = h.map(function(_, x) {
|
|
2522
|
+
var S, T, P, D = m[x], j = { onerror: null, onsuccess: null };
|
|
2523
|
+
return u.type === "delete" ? s.fire.call(j, _, D, p) : u.type === "add" || D === void 0 ? (S = c.fire.call(j, _, u.values[x], p), _ == null && S != null && (u.keys[x] = _ = S, r.outbound || se(u.values[x], r.keyPath, _))) : (S = tr(D, u.values[x]), (T = f.fire.call(j, S, _, D, p)) && (P = u.values[x], Object.keys(T).forEach(function(z) {
|
|
2524
|
+
B(P, z) ? P[z] = T[z] : se(P, z, T[z]);
|
|
2525
|
+
}))), j;
|
|
2526
|
+
});
|
|
2527
|
+
return n.mutate(u).then(function(_) {
|
|
2528
|
+
for (var x = _.failures, S = _.results, T = _.numFailures, _ = _.lastResult, P = 0; P < h.length; ++P) {
|
|
2529
|
+
var D = (S || h)[P], j = b[P];
|
|
2530
|
+
D == null ? j.onerror && j.onerror(x[P]) : j.onsuccess && j.onsuccess(u.type === "put" && m[P] ? u.values[P] : D);
|
|
2531
|
+
}
|
|
2532
|
+
return { failures: x, results: S, numFailures: T, lastResult: _ };
|
|
2533
|
+
}).catch(function(_) {
|
|
2534
|
+
return b.forEach(function(x) {
|
|
2535
|
+
return x.onerror && x.onerror(_);
|
|
2536
|
+
}), Promise.reject(_);
|
|
2537
|
+
});
|
|
2538
|
+
});
|
|
2539
|
+
}
|
|
2540
|
+
} });
|
|
2541
|
+
} });
|
|
2542
|
+
} };
|
|
2543
|
+
function Fr(e, t, n) {
|
|
2544
|
+
try {
|
|
2545
|
+
if (!t || t.keys.length < e.length) return null;
|
|
2546
|
+
for (var r = [], i = 0, a = 0; i < t.keys.length && a < e.length; ++i) J(t.keys[i], e[a]) === 0 && (r.push(n ? Ue(t.values[i]) : t.values[i]), ++a);
|
|
2547
|
+
return r.length === e.length ? r : null;
|
|
2548
|
+
} catch {
|
|
2549
|
+
return null;
|
|
2550
|
+
}
|
|
2551
|
+
}
|
|
2552
|
+
var Li = { stack: "dbcore", level: -1, create: function(e) {
|
|
2553
|
+
return { table: function(t) {
|
|
2554
|
+
var n = e.table(t);
|
|
2555
|
+
return k(k({}, n), { getMany: function(r) {
|
|
2556
|
+
if (!r.cache) return n.getMany(r);
|
|
2557
|
+
var i = Fr(r.keys, r.trans._cache, r.cache === "clone");
|
|
2558
|
+
return i ? I.resolve(i) : n.getMany(r).then(function(a) {
|
|
2559
|
+
return r.trans._cache = { keys: r.keys, values: r.cache === "clone" ? Ue(a) : a }, a;
|
|
2560
|
+
});
|
|
2561
|
+
}, mutate: function(r) {
|
|
2562
|
+
return r.type !== "add" && (r.trans._cache = null), n.mutate(r);
|
|
2563
|
+
} });
|
|
2564
|
+
} };
|
|
2565
|
+
} };
|
|
2566
|
+
function Vr(e, t) {
|
|
2567
|
+
return e.trans.mode === "readonly" && !!e.subscr && !e.trans.explicit && e.trans.db._options.cache !== "disabled" && !t.schema.primaryKey.outbound;
|
|
2568
|
+
}
|
|
2569
|
+
function Hr(e, t) {
|
|
2570
|
+
switch (e) {
|
|
2571
|
+
case "query":
|
|
2572
|
+
return t.values && !t.unique;
|
|
2573
|
+
case "get":
|
|
2574
|
+
case "getMany":
|
|
2575
|
+
case "count":
|
|
2576
|
+
case "openCursor":
|
|
2577
|
+
return !1;
|
|
2578
|
+
}
|
|
2579
|
+
}
|
|
2580
|
+
var Ni = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
|
|
2581
|
+
var t = e.schema.name, n = new ve(e.MIN_KEY, e.MAX_KEY);
|
|
2582
|
+
return k(k({}, e), { transaction: function(r, i, a) {
|
|
2583
|
+
if (N.subscr && i !== "readonly") throw new V.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(N.querier));
|
|
2584
|
+
return e.transaction(r, i, a);
|
|
2585
|
+
}, table: function(r) {
|
|
2586
|
+
var i = e.table(r), a = i.schema, o = a.primaryKey, u = a.indexes, s = o.extractKey, c = o.outbound, f = o.autoIncrement && u.filter(function(l) {
|
|
2587
|
+
return l.compound && l.keyPath.includes(o.keyPath);
|
|
2588
|
+
}), v = k(k({}, i), { mutate: function(l) {
|
|
2589
|
+
function d(z) {
|
|
2590
|
+
return z = "idb://".concat(t, "/").concat(r, "/").concat(z), _[z] || (_[z] = new ve());
|
|
2591
|
+
}
|
|
2592
|
+
var p, h, m, b = l.trans, _ = l.mutatedParts || (l.mutatedParts = {}), x = d(""), S = d(":dels"), T = l.type, j = l.type === "deleteRange" ? [l.range] : l.type === "delete" ? [l.keys] : l.values.length < 50 ? [nr(o, l).filter(function(z) {
|
|
2593
|
+
return z;
|
|
2594
|
+
}), l.values] : [], P = j[0], D = j[1], j = l.trans._cache;
|
|
2595
|
+
return A(P) ? (x.addKeys(P), (j = T === "delete" || P.length === D.length ? Fr(P, j) : null) || S.addKeys(P), (j || D) && (p = d, h = j, m = D, a.indexes.forEach(function(z) {
|
|
2596
|
+
var q = p(z.name || "");
|
|
2597
|
+
function X(Q) {
|
|
2598
|
+
return Q != null ? z.extractKey(Q) : null;
|
|
2599
|
+
}
|
|
2600
|
+
function G(Q) {
|
|
2601
|
+
return z.multiEntry && A(Q) ? Q.forEach(function(we) {
|
|
2602
|
+
return q.addKey(we);
|
|
2603
|
+
}) : q.addKey(Q);
|
|
2604
|
+
}
|
|
2605
|
+
(h || m).forEach(function(Q, pe) {
|
|
2606
|
+
var U = h && X(h[pe]), pe = m && X(m[pe]);
|
|
2607
|
+
J(U, pe) !== 0 && (U != null && G(U), pe != null && G(pe));
|
|
2608
|
+
});
|
|
2609
|
+
}))) : P ? (D = { from: (D = P.lower) !== null && D !== void 0 ? D : e.MIN_KEY, to: (D = P.upper) !== null && D !== void 0 ? D : e.MAX_KEY }, S.add(D), x.add(D)) : (x.add(n), S.add(n), a.indexes.forEach(function(z) {
|
|
2610
|
+
return d(z.name).add(n);
|
|
2611
|
+
})), i.mutate(l).then(function(z) {
|
|
2612
|
+
return !P || l.type !== "add" && l.type !== "put" || (x.addKeys(z.results), f && f.forEach(function(q) {
|
|
2613
|
+
for (var X = l.values.map(function(U) {
|
|
2614
|
+
return q.extractKey(U);
|
|
2615
|
+
}), G = q.keyPath.findIndex(function(U) {
|
|
2616
|
+
return U === o.keyPath;
|
|
2617
|
+
}), Q = 0, we = z.results.length; Q < we; ++Q) X[Q][G] = z.results[Q];
|
|
2618
|
+
d(q.name).addKeys(X);
|
|
2619
|
+
})), b.mutatedParts = sn(b.mutatedParts || {}, _), z;
|
|
2620
|
+
});
|
|
2621
|
+
} }), u = function(d) {
|
|
2622
|
+
var p = d.query, d = p.index, p = p.range;
|
|
2623
|
+
return [d, new ve((d = p.lower) !== null && d !== void 0 ? d : e.MIN_KEY, (p = p.upper) !== null && p !== void 0 ? p : e.MAX_KEY)];
|
|
2624
|
+
}, y = { get: function(l) {
|
|
2625
|
+
return [o, new ve(l.key)];
|
|
2626
|
+
}, getMany: function(l) {
|
|
2627
|
+
return [o, new ve().addKeys(l.keys)];
|
|
2628
|
+
}, count: u, query: u, openCursor: u };
|
|
2629
|
+
return O(y).forEach(function(l) {
|
|
2630
|
+
v[l] = function(d) {
|
|
2631
|
+
var p = N.subscr, h = !!p, m = Vr(N, i) && Hr(l, d) ? d.obsSet = {} : p;
|
|
2632
|
+
if (h) {
|
|
2633
|
+
var b = function(D) {
|
|
2634
|
+
return D = "idb://".concat(t, "/").concat(r, "/").concat(D), m[D] || (m[D] = new ve());
|
|
2635
|
+
}, _ = b(""), x = b(":dels"), p = y[l](d), h = p[0], p = p[1];
|
|
2636
|
+
if ((l === "query" && h.isPrimaryKey && !d.values ? x : b(h.name || "")).add(p), !h.isPrimaryKey) {
|
|
2637
|
+
if (l !== "count") {
|
|
2638
|
+
var S = l === "query" && c && d.values && i.query(k(k({}, d), { values: !1 }));
|
|
2639
|
+
return i[l].apply(this, arguments).then(function(D) {
|
|
2640
|
+
if (l === "query") {
|
|
2641
|
+
if (c && d.values) return S.then(function(X) {
|
|
2642
|
+
return X = X.result, _.addKeys(X), D;
|
|
2643
|
+
});
|
|
2644
|
+
var j = d.values ? D.result.map(s) : D.result;
|
|
2645
|
+
(d.values ? _ : x).addKeys(j);
|
|
2646
|
+
} else if (l === "openCursor") {
|
|
2647
|
+
var z = D, q = d.values;
|
|
2648
|
+
return z && Object.create(z, { key: { get: function() {
|
|
2649
|
+
return x.addKey(z.primaryKey), z.key;
|
|
2650
|
+
} }, primaryKey: { get: function() {
|
|
2651
|
+
var X = z.primaryKey;
|
|
2652
|
+
return x.addKey(X), X;
|
|
2653
|
+
} }, value: { get: function() {
|
|
2654
|
+
return q && _.addKey(z.primaryKey), z.value;
|
|
2655
|
+
} } });
|
|
2656
|
+
}
|
|
2657
|
+
return D;
|
|
2658
|
+
});
|
|
2659
|
+
}
|
|
2660
|
+
x.add(n);
|
|
2661
|
+
}
|
|
2662
|
+
}
|
|
2663
|
+
return i[l].apply(this, arguments);
|
|
2664
|
+
};
|
|
2665
|
+
}), v;
|
|
2666
|
+
} });
|
|
2667
|
+
} };
|
|
2668
|
+
function Wr(e, t, n) {
|
|
2669
|
+
if (n.numFailures === 0) return t;
|
|
2670
|
+
if (t.type === "deleteRange") return null;
|
|
2671
|
+
var r = t.keys ? t.keys.length : "values" in t && t.values ? t.values.length : 1;
|
|
2672
|
+
return n.numFailures === r ? null : (t = k({}, t), A(t.keys) && (t.keys = t.keys.filter(function(i, a) {
|
|
2673
|
+
return !(a in n.failures);
|
|
2674
|
+
})), "values" in t && A(t.values) && (t.values = t.values.filter(function(i, a) {
|
|
2675
|
+
return !(a in n.failures);
|
|
2676
|
+
})), t);
|
|
2677
|
+
}
|
|
2678
|
+
function rr(e, t) {
|
|
2679
|
+
return n = e, ((r = t).lower === void 0 || (r.lowerOpen ? 0 < J(n, r.lower) : 0 <= J(n, r.lower))) && (e = e, (t = t).upper === void 0 || (t.upperOpen ? J(e, t.upper) < 0 : J(e, t.upper) <= 0));
|
|
2680
|
+
var n, r;
|
|
2681
|
+
}
|
|
2682
|
+
function Ur(e, t, y, r, i, a) {
|
|
2683
|
+
if (!y || y.length === 0) return e;
|
|
2684
|
+
var o = t.query.index, s = o.multiEntry, c = t.query.range, f = r.schema.primaryKey.extractKey, v = o.extractKey, u = (o.lowLevelIndex || o).extractKey, y = y.reduce(function(l, d) {
|
|
2685
|
+
var p = l, h = [];
|
|
2686
|
+
if (d.type === "add" || d.type === "put") for (var m = new ve(), b = d.values.length - 1; 0 <= b; --b) {
|
|
2687
|
+
var _, x = d.values[b], S = f(x);
|
|
2688
|
+
m.hasKey(S) || (_ = v(x), (s && A(_) ? _.some(function(z) {
|
|
2689
|
+
return rr(z, c);
|
|
2690
|
+
}) : rr(_, c)) && (m.addKey(S), h.push(x)));
|
|
2691
|
+
}
|
|
2692
|
+
switch (d.type) {
|
|
2693
|
+
case "add":
|
|
2694
|
+
var T = new ve().addKeys(t.values ? l.map(function(q) {
|
|
2695
|
+
return f(q);
|
|
2696
|
+
}) : l), p = l.concat(t.values ? h.filter(function(q) {
|
|
2697
|
+
return q = f(q), !T.hasKey(q) && (T.addKey(q), !0);
|
|
2698
|
+
}) : h.map(function(q) {
|
|
2699
|
+
return f(q);
|
|
2700
|
+
}).filter(function(q) {
|
|
2701
|
+
return !T.hasKey(q) && (T.addKey(q), !0);
|
|
2702
|
+
}));
|
|
2703
|
+
break;
|
|
2704
|
+
case "put":
|
|
2705
|
+
var P = new ve().addKeys(d.values.map(function(q) {
|
|
2706
|
+
return f(q);
|
|
2707
|
+
}));
|
|
2708
|
+
p = l.filter(function(q) {
|
|
2709
|
+
return !P.hasKey(t.values ? f(q) : q);
|
|
2710
|
+
}).concat(t.values ? h : h.map(function(q) {
|
|
2711
|
+
return f(q);
|
|
2712
|
+
}));
|
|
2713
|
+
break;
|
|
2714
|
+
case "delete":
|
|
2715
|
+
var D = new ve().addKeys(d.keys);
|
|
2716
|
+
p = l.filter(function(q) {
|
|
2717
|
+
return !D.hasKey(t.values ? f(q) : q);
|
|
2718
|
+
});
|
|
2719
|
+
break;
|
|
2720
|
+
case "deleteRange":
|
|
2721
|
+
var j = d.range;
|
|
2722
|
+
p = l.filter(function(q) {
|
|
2723
|
+
return !rr(f(q), j);
|
|
2724
|
+
});
|
|
2725
|
+
}
|
|
2726
|
+
return p;
|
|
2727
|
+
}, e);
|
|
2728
|
+
return y === e ? e : (y.sort(function(l, d) {
|
|
2729
|
+
return J(u(l), u(d)) || J(f(l), f(d));
|
|
2730
|
+
}), t.limit && t.limit < 1 / 0 && (y.length > t.limit ? y.length = t.limit : e.length === t.limit && y.length < t.limit && (i.dirty = !0)), a ? Object.freeze(y) : y);
|
|
2731
|
+
}
|
|
2732
|
+
function Yr(e, t) {
|
|
2733
|
+
return J(e.lower, t.lower) === 0 && J(e.upper, t.upper) === 0 && !!e.lowerOpen == !!t.lowerOpen && !!e.upperOpen == !!t.upperOpen;
|
|
2734
|
+
}
|
|
2735
|
+
function $i(e, t) {
|
|
2736
|
+
return function(n, r, i, a) {
|
|
2737
|
+
if (n === void 0) return r !== void 0 ? -1 : 0;
|
|
2738
|
+
if (r === void 0) return 1;
|
|
2739
|
+
if ((r = J(n, r)) === 0) {
|
|
2740
|
+
if (i && a) return 0;
|
|
2741
|
+
if (i) return 1;
|
|
2742
|
+
if (a) return -1;
|
|
2743
|
+
}
|
|
2744
|
+
return r;
|
|
2745
|
+
}(e.lower, t.lower, e.lowerOpen, t.lowerOpen) <= 0 && 0 <= function(n, r, i, a) {
|
|
2746
|
+
if (n === void 0) return r !== void 0 ? 1 : 0;
|
|
2747
|
+
if (r === void 0) return -1;
|
|
2748
|
+
if ((r = J(n, r)) === 0) {
|
|
2749
|
+
if (i && a) return 0;
|
|
2750
|
+
if (i) return -1;
|
|
2751
|
+
if (a) return 1;
|
|
2752
|
+
}
|
|
2753
|
+
return r;
|
|
2754
|
+
}(e.upper, t.upper, e.upperOpen, t.upperOpen);
|
|
2755
|
+
}
|
|
2756
|
+
function Fi(e, t, n, r) {
|
|
2757
|
+
e.subscribers.add(n), r.addEventListener("abort", function() {
|
|
2758
|
+
var i, a;
|
|
2759
|
+
e.subscribers.delete(n), e.subscribers.size === 0 && (i = e, a = t, setTimeout(function() {
|
|
2760
|
+
i.subscribers.size === 0 && Ye(a, i);
|
|
2761
|
+
}, 3e3));
|
|
2762
|
+
});
|
|
2763
|
+
}
|
|
2764
|
+
var Vi = { stack: "dbcore", level: 0, name: "Cache", create: function(e) {
|
|
2765
|
+
var t = e.schema.name;
|
|
2766
|
+
return k(k({}, e), { transaction: function(n, r, i) {
|
|
2767
|
+
var a, o, s = e.transaction(n, r, i);
|
|
2768
|
+
return r === "readwrite" && (o = (a = new AbortController()).signal, i = function(c) {
|
|
2769
|
+
return function() {
|
|
2770
|
+
if (a.abort(), r === "readwrite") {
|
|
2771
|
+
for (var f = /* @__PURE__ */ new Set(), v = 0, u = n; v < u.length; v++) {
|
|
2772
|
+
var y = u[v], l = rt["idb://".concat(t, "/").concat(y)];
|
|
2773
|
+
if (l) {
|
|
2774
|
+
var d = e.table(y), p = l.optimisticOps.filter(function(q) {
|
|
2775
|
+
return q.trans === s;
|
|
2776
|
+
});
|
|
2777
|
+
if (s._explicit && c && s.mutatedParts) for (var h = 0, m = Object.values(l.queries.query); h < m.length; h++) for (var b = 0, _ = (T = m[h]).slice(); b < _.length; b++) Gn((P = _[b]).obsSet, s.mutatedParts) && (Ye(T, P), P.subscribers.forEach(function(q) {
|
|
2778
|
+
return f.add(q);
|
|
2779
|
+
}));
|
|
2780
|
+
else if (0 < p.length) {
|
|
2781
|
+
l.optimisticOps = l.optimisticOps.filter(function(q) {
|
|
2782
|
+
return q.trans !== s;
|
|
2783
|
+
});
|
|
2784
|
+
for (var x = 0, S = Object.values(l.queries.query); x < S.length; x++) for (var T, P, D, j = 0, z = (T = S[x]).slice(); j < z.length; j++) (P = z[j]).res != null && s.mutatedParts && (c && !P.dirty ? (D = Object.isFrozen(P.res), D = Ur(P.res, P.req, p, d, P, D), P.dirty ? (Ye(T, P), P.subscribers.forEach(function(q) {
|
|
2785
|
+
return f.add(q);
|
|
2786
|
+
})) : D !== P.res && (P.res = D, P.promise = I.resolve({ result: D }))) : (P.dirty && Ye(T, P), P.subscribers.forEach(function(q) {
|
|
2787
|
+
return f.add(q);
|
|
2788
|
+
})));
|
|
2789
|
+
}
|
|
2790
|
+
}
|
|
2791
|
+
}
|
|
2792
|
+
f.forEach(function(q) {
|
|
2793
|
+
return q();
|
|
2794
|
+
});
|
|
2795
|
+
}
|
|
2796
|
+
};
|
|
2797
|
+
}, s.addEventListener("abort", i(!1), { signal: o }), s.addEventListener("error", i(!1), { signal: o }), s.addEventListener("complete", i(!0), { signal: o })), s;
|
|
2798
|
+
}, table: function(n) {
|
|
2799
|
+
var r = e.table(n), i = r.schema.primaryKey;
|
|
2800
|
+
return k(k({}, r), { mutate: function(a) {
|
|
2801
|
+
var o = N.trans;
|
|
2802
|
+
if (i.outbound || o.db._options.cache === "disabled" || o.explicit || o.idbtrans.mode !== "readwrite") return r.mutate(a);
|
|
2803
|
+
var s = rt["idb://".concat(t, "/").concat(n)];
|
|
2804
|
+
return s ? (o = r.mutate(a), a.type !== "add" && a.type !== "put" || !(50 <= a.values.length || nr(i, a).some(function(c) {
|
|
2805
|
+
return c == null;
|
|
2806
|
+
})) ? (s.optimisticOps.push(a), a.mutatedParts && un(a.mutatedParts), o.then(function(c) {
|
|
2807
|
+
0 < c.numFailures && (Ye(s.optimisticOps, a), (c = Wr(0, a, c)) && s.optimisticOps.push(c), a.mutatedParts && un(a.mutatedParts));
|
|
2808
|
+
}), o.catch(function() {
|
|
2809
|
+
Ye(s.optimisticOps, a), a.mutatedParts && un(a.mutatedParts);
|
|
2810
|
+
})) : o.then(function(c) {
|
|
2811
|
+
var f = Wr(0, k(k({}, a), { values: a.values.map(function(v, u) {
|
|
2812
|
+
var y;
|
|
2813
|
+
return c.failures[u] ? v : (v = (y = i.keyPath) !== null && y !== void 0 && y.includes(".") ? Ue(v) : k({}, v), se(v, i.keyPath, c.results[u]), v);
|
|
2814
|
+
}) }), c);
|
|
2815
|
+
s.optimisticOps.push(f), queueMicrotask(function() {
|
|
2816
|
+
return a.mutatedParts && un(a.mutatedParts);
|
|
2817
|
+
});
|
|
2818
|
+
}), o) : r.mutate(a);
|
|
2819
|
+
}, query: function(a) {
|
|
2820
|
+
if (!Vr(N, r) || !Hr("query", a)) return r.query(a);
|
|
2821
|
+
var o = ((f = N.trans) === null || f === void 0 ? void 0 : f.db._options.cache) === "immutable", u = N, s = u.requery, c = u.signal, f = function(d, p, h, m) {
|
|
2822
|
+
var b = rt["idb://".concat(d, "/").concat(p)];
|
|
2823
|
+
if (!b) return [];
|
|
2824
|
+
if (!(p = b.queries[h])) return [null, !1, b, null];
|
|
2825
|
+
var _ = p[(m.query ? m.query.index.name : null) || ""];
|
|
2826
|
+
if (!_) return [null, !1, b, null];
|
|
2827
|
+
switch (h) {
|
|
2828
|
+
case "query":
|
|
2829
|
+
var x = _.find(function(S) {
|
|
2830
|
+
return S.req.limit === m.limit && S.req.values === m.values && Yr(S.req.query.range, m.query.range);
|
|
2831
|
+
});
|
|
2832
|
+
return x ? [x, !0, b, _] : [_.find(function(S) {
|
|
2833
|
+
return ("limit" in S.req ? S.req.limit : 1 / 0) >= m.limit && (!m.values || S.req.values) && $i(S.req.query.range, m.query.range);
|
|
2834
|
+
}), !1, b, _];
|
|
2835
|
+
case "count":
|
|
2836
|
+
return x = _.find(function(S) {
|
|
2837
|
+
return Yr(S.req.query.range, m.query.range);
|
|
2838
|
+
}), [x, !!x, b, _];
|
|
2839
|
+
}
|
|
2840
|
+
}(t, n, "query", a), v = f[0], u = f[1], y = f[2], l = f[3];
|
|
2841
|
+
return v && u ? v.obsSet = a.obsSet : (u = r.query(a).then(function(d) {
|
|
2842
|
+
var p = d.result;
|
|
2843
|
+
if (v && (v.res = p), o) {
|
|
2844
|
+
for (var h = 0, m = p.length; h < m; ++h) Object.freeze(p[h]);
|
|
2845
|
+
Object.freeze(p);
|
|
2846
|
+
} else d.result = Ue(p);
|
|
2847
|
+
return d;
|
|
2848
|
+
}).catch(function(d) {
|
|
2849
|
+
return l && v && Ye(l, v), Promise.reject(d);
|
|
2850
|
+
}), v = { obsSet: a.obsSet, promise: u, subscribers: /* @__PURE__ */ new Set(), type: "query", req: a, dirty: !1 }, l ? l.push(v) : (l = [v], (y = y || (rt["idb://".concat(t, "/").concat(n)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[a.query.index.name || ""] = l)), Fi(v, l, s, c), v.promise.then(function(d) {
|
|
2851
|
+
return { result: Ur(d.result, a, y == null ? void 0 : y.optimisticOps, r, v, o) };
|
|
2852
|
+
});
|
|
2853
|
+
} });
|
|
2854
|
+
} });
|
|
2855
|
+
} };
|
|
2856
|
+
function ln(e, t) {
|
|
2857
|
+
return new Proxy(e, { get: function(n, r, i) {
|
|
2858
|
+
return r === "db" ? t : Reflect.get(n, r, i);
|
|
2859
|
+
} });
|
|
2860
|
+
}
|
|
2861
|
+
var Ae = (ce.prototype.version = function(e) {
|
|
2862
|
+
if (isNaN(e) || e < 0.1) throw new V.Type("Given version is not a positive number");
|
|
2863
|
+
if (e = Math.round(10 * e) / 10, this.idbdb || this._state.isBeingOpened) throw new V.Schema("Cannot add version when database is open");
|
|
2864
|
+
this.verno = Math.max(this.verno, e);
|
|
2865
|
+
var t = this._versions, n = t.filter(function(r) {
|
|
2866
|
+
return r._cfg.version === e;
|
|
2867
|
+
})[0];
|
|
2868
|
+
return n || (n = new this.Version(e), t.push(n), t.sort(Ti), n.stores({}), this._state.autoSchema = !1, n);
|
|
2869
|
+
}, ce.prototype._whenReady = function(e) {
|
|
2870
|
+
var t = this;
|
|
2871
|
+
return this.idbdb && (this._state.openComplete || N.letThrough || this._vip) ? e() : new I(function(n, r) {
|
|
2872
|
+
if (t._state.openComplete) return r(new V.DatabaseClosed(t._state.dbOpenError));
|
|
2873
|
+
if (!t._state.isBeingOpened) {
|
|
2874
|
+
if (!t._state.autoOpen) return void r(new V.DatabaseClosed());
|
|
2875
|
+
t.open().catch(re);
|
|
2876
|
+
}
|
|
2877
|
+
t._state.dbReadyPromise.then(n, r);
|
|
2878
|
+
}).then(e);
|
|
2879
|
+
}, ce.prototype.use = function(e) {
|
|
2880
|
+
var t = e.stack, n = e.create, r = e.level, i = e.name;
|
|
2881
|
+
return i && this.unuse({ stack: t, name: i }), e = this._middlewares[t] || (this._middlewares[t] = []), e.push({ stack: t, create: n, level: r ?? 10, name: i }), e.sort(function(a, o) {
|
|
2882
|
+
return a.level - o.level;
|
|
2883
|
+
}), this;
|
|
2884
|
+
}, ce.prototype.unuse = function(e) {
|
|
2885
|
+
var t = e.stack, n = e.name, r = e.create;
|
|
2886
|
+
return t && this._middlewares[t] && (this._middlewares[t] = this._middlewares[t].filter(function(i) {
|
|
2887
|
+
return r ? i.create !== r : !!n && i.name !== n;
|
|
2888
|
+
})), this;
|
|
2889
|
+
}, ce.prototype.open = function() {
|
|
2890
|
+
var e = this;
|
|
2891
|
+
return et(Be, function() {
|
|
2892
|
+
return Bi(e);
|
|
2893
|
+
});
|
|
2894
|
+
}, ce.prototype._close = function() {
|
|
2895
|
+
var e = this._state, t = vt.indexOf(this);
|
|
2896
|
+
if (0 <= t && vt.splice(t, 1), this.idbdb) {
|
|
2897
|
+
try {
|
|
2898
|
+
this.idbdb.close();
|
|
2899
|
+
} catch {
|
|
2900
|
+
}
|
|
2901
|
+
this.idbdb = null;
|
|
2902
|
+
}
|
|
2903
|
+
e.isBeingOpened || (e.dbReadyPromise = new I(function(n) {
|
|
2904
|
+
e.dbReadyResolve = n;
|
|
2905
|
+
}), e.openCanceller = new I(function(n, r) {
|
|
2906
|
+
e.cancelOpen = r;
|
|
2907
|
+
}));
|
|
2908
|
+
}, ce.prototype.close = function(n) {
|
|
2909
|
+
var t = (n === void 0 ? { disableAutoOpen: !0 } : n).disableAutoOpen, n = this._state;
|
|
2910
|
+
t ? (n.isBeingOpened && n.cancelOpen(new V.DatabaseClosed()), this._close(), n.autoOpen = !1, n.dbOpenError = new V.DatabaseClosed()) : (this._close(), n.autoOpen = this._options.autoOpen || n.isBeingOpened, n.openComplete = !1, n.dbOpenError = null);
|
|
2911
|
+
}, ce.prototype.delete = function(e) {
|
|
2912
|
+
var t = this;
|
|
2913
|
+
e === void 0 && (e = { disableAutoOpen: !0 });
|
|
2914
|
+
var n = 0 < arguments.length && typeof arguments[0] != "object", r = this._state;
|
|
2915
|
+
return new I(function(i, a) {
|
|
2916
|
+
function o() {
|
|
2917
|
+
t.close(e);
|
|
2918
|
+
var s = t._deps.indexedDB.deleteDatabase(t.name);
|
|
2919
|
+
s.onsuccess = oe(function() {
|
|
2920
|
+
var c, f, v;
|
|
2921
|
+
c = t._deps, f = t.name, v = c.indexedDB, c = c.IDBKeyRange, Un(v) || f === Yt || Wn(v, c).delete(f).catch(re), i();
|
|
2922
|
+
}), s.onerror = Oe(a), s.onblocked = t._fireOnBlocked;
|
|
2923
|
+
}
|
|
2924
|
+
if (n) throw new V.InvalidArgument("Invalid closeOptions argument to db.delete()");
|
|
2925
|
+
r.isBeingOpened ? r.dbReadyPromise.then(o) : o();
|
|
2926
|
+
});
|
|
2927
|
+
}, ce.prototype.backendDB = function() {
|
|
2928
|
+
return this.idbdb;
|
|
2929
|
+
}, ce.prototype.isOpen = function() {
|
|
2930
|
+
return this.idbdb !== null;
|
|
2931
|
+
}, ce.prototype.hasBeenClosed = function() {
|
|
2932
|
+
var e = this._state.dbOpenError;
|
|
2933
|
+
return e && e.name === "DatabaseClosed";
|
|
2934
|
+
}, ce.prototype.hasFailed = function() {
|
|
2935
|
+
return this._state.dbOpenError !== null;
|
|
2936
|
+
}, ce.prototype.dynamicallyOpened = function() {
|
|
2937
|
+
return this._state.autoSchema;
|
|
2938
|
+
}, Object.defineProperty(ce.prototype, "tables", { get: function() {
|
|
2939
|
+
var e = this;
|
|
2940
|
+
return O(this._allTables).map(function(t) {
|
|
2941
|
+
return e._allTables[t];
|
|
2942
|
+
});
|
|
2943
|
+
}, enumerable: !1, configurable: !0 }), ce.prototype.transaction = function() {
|
|
2944
|
+
var e = (function(t, n, r) {
|
|
2945
|
+
var i = arguments.length;
|
|
2946
|
+
if (i < 2) throw new V.InvalidArgument("Too few arguments");
|
|
2947
|
+
for (var a = new Array(i - 1); --i; ) a[i - 1] = arguments[i];
|
|
2948
|
+
return r = a.pop(), [t, _n(a), r];
|
|
2949
|
+
}).apply(this, arguments);
|
|
2950
|
+
return this._transaction.apply(this, e);
|
|
2951
|
+
}, ce.prototype._transaction = function(e, t, n) {
|
|
2952
|
+
var r = this, i = N.trans;
|
|
2953
|
+
i && i.db === this && e.indexOf("!") === -1 || (i = null);
|
|
2954
|
+
var a, o, s = e.indexOf("?") !== -1;
|
|
2955
|
+
e = e.replace("!", "").replace("?", "");
|
|
2956
|
+
try {
|
|
2957
|
+
if (o = t.map(function(f) {
|
|
2958
|
+
if (f = f instanceof r.Table ? f.name : f, typeof f != "string") throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");
|
|
2959
|
+
return f;
|
|
2960
|
+
}), e == "r" || e === jn) a = jn;
|
|
2961
|
+
else {
|
|
2962
|
+
if (e != "rw" && e != In) throw new V.InvalidArgument("Invalid transaction mode: " + e);
|
|
2963
|
+
a = In;
|
|
2964
|
+
}
|
|
2965
|
+
if (i) {
|
|
2966
|
+
if (i.mode === jn && a === In) {
|
|
2967
|
+
if (!s) throw new V.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
|
|
2968
|
+
i = null;
|
|
2969
|
+
}
|
|
2970
|
+
i && o.forEach(function(f) {
|
|
2971
|
+
if (i && i.storeNames.indexOf(f) === -1) {
|
|
2972
|
+
if (!s) throw new V.SubTransaction("Table " + f + " not included in parent transaction.");
|
|
2973
|
+
i = null;
|
|
2974
|
+
}
|
|
2975
|
+
}), s && i && !i.active && (i = null);
|
|
2976
|
+
}
|
|
2977
|
+
} catch (f) {
|
|
2978
|
+
return i ? i._promise(null, function(v, u) {
|
|
2979
|
+
u(f);
|
|
2980
|
+
}) : ue(f);
|
|
2981
|
+
}
|
|
2982
|
+
var c = (function f(v, u, y, l, d) {
|
|
2983
|
+
return I.resolve().then(function() {
|
|
2984
|
+
var p = N.transless || N, h = v._createTransaction(u, y, v._dbSchema, l);
|
|
2985
|
+
if (h.explicit = !0, p = { trans: h, transless: p }, l) h.idbtrans = l.idbtrans;
|
|
2986
|
+
else try {
|
|
2987
|
+
h.create(), h.idbtrans._explicit = !0, v._state.PR1398_maxLoop = 3;
|
|
2988
|
+
} catch (_) {
|
|
2989
|
+
return _.name === Cn.InvalidState && v.isOpen() && 0 < --v._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), v.close({ disableAutoOpen: !1 }), v.open().then(function() {
|
|
2990
|
+
return f(v, u, y, null, d);
|
|
2991
|
+
})) : ue(_);
|
|
2992
|
+
}
|
|
2993
|
+
var m, b = xn(d);
|
|
2994
|
+
return b && dt(), p = I.follow(function() {
|
|
2995
|
+
var _;
|
|
2996
|
+
(m = d.call(h, h)) && (b ? (_ = Me.bind(null, null), m.then(_, _)) : typeof m.next == "function" && typeof m.throw == "function" && (m = er(m)));
|
|
2997
|
+
}, p), (m && typeof m.then == "function" ? I.resolve(m).then(function(_) {
|
|
2998
|
+
return h.active ? _ : ue(new V.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
2999
|
+
}) : p.then(function() {
|
|
3000
|
+
return m;
|
|
3001
|
+
})).then(function(_) {
|
|
3002
|
+
return l && h._resolve(), h._completion.then(function() {
|
|
3003
|
+
return _;
|
|
3004
|
+
});
|
|
3005
|
+
}).catch(function(_) {
|
|
3006
|
+
return h._reject(_), ue(_);
|
|
3007
|
+
});
|
|
3008
|
+
});
|
|
3009
|
+
}).bind(null, this, a, o, i, n);
|
|
3010
|
+
return i ? i._promise(a, c, "lock") : N.trans ? et(N.transless, function() {
|
|
3011
|
+
return r._whenReady(c);
|
|
3012
|
+
}) : this._whenReady(c);
|
|
3013
|
+
}, ce.prototype.table = function(e) {
|
|
3014
|
+
if (!B(this._allTables, e)) throw new V.InvalidTable("Table ".concat(e, " does not exist"));
|
|
3015
|
+
return this._allTables[e];
|
|
3016
|
+
}, ce);
|
|
3017
|
+
function ce(e, t) {
|
|
3018
|
+
var n = this;
|
|
3019
|
+
this._middlewares = {}, this.verno = 0;
|
|
3020
|
+
var r = ce.dependencies;
|
|
3021
|
+
this._options = t = k({ addons: ce.addons, autoOpen: !0, indexedDB: r.indexedDB, IDBKeyRange: r.IDBKeyRange, cache: "cloned" }, t), this._deps = { indexedDB: t.indexedDB, IDBKeyRange: t.IDBKeyRange }, r = t.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
|
|
3022
|
+
var i, a, o, s, c, f = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: re, dbReadyPromise: null, cancelOpen: re, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
|
|
3023
|
+
f.dbReadyPromise = new I(function(u) {
|
|
3024
|
+
f.dbReadyResolve = u;
|
|
3025
|
+
}), f.openCanceller = new I(function(u, y) {
|
|
3026
|
+
f.cancelOpen = y;
|
|
3027
|
+
}), this._state = f, this.name = e, this.on = St(this, "populate", "blocked", "versionchange", "close", { ready: [En, re] }), this.on.ready.subscribe = Pe(this.on.ready.subscribe, function(u) {
|
|
3028
|
+
return function(y, l) {
|
|
3029
|
+
ce.vip(function() {
|
|
3030
|
+
var d, p = n._state;
|
|
3031
|
+
p.openComplete ? (p.dbOpenError || I.resolve().then(y), l && u(y)) : p.onReadyBeingFired ? (p.onReadyBeingFired.push(y), l && u(y)) : (u(y), d = n, l || u(function h() {
|
|
3032
|
+
d.on.ready.unsubscribe(y), d.on.ready.unsubscribe(h);
|
|
3033
|
+
}));
|
|
3034
|
+
});
|
|
3035
|
+
};
|
|
3036
|
+
}), this.Collection = (i = this, Pt(Oi.prototype, function(m, h) {
|
|
3037
|
+
this.db = i;
|
|
3038
|
+
var l = Er, d = null;
|
|
3039
|
+
if (h) try {
|
|
3040
|
+
l = h();
|
|
3041
|
+
} catch (b) {
|
|
3042
|
+
d = b;
|
|
3043
|
+
}
|
|
3044
|
+
var p = m._ctx, h = p.table, m = h.hook.reading.fire;
|
|
3045
|
+
this._ctx = { table: h, index: p.index, isPrimKey: !p.index || h.schema.primKey.keyPath && p.index === h.schema.primKey.name, range: l, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: d, or: p.or, valueMapper: m !== kt ? m : null };
|
|
3046
|
+
})), this.Table = (a = this, Pt(Kr.prototype, function(u, y, l) {
|
|
3047
|
+
this.db = a, this._tx = l, this.name = u, this.schema = y, this.hook = a._allTables[u] ? a._allTables[u].hook : St(null, { creating: [mi, re], reading: [yi, kt], updating: [bi, re], deleting: [gi, re] });
|
|
3048
|
+
})), this.Transaction = (o = this, Pt(Ki.prototype, function(u, y, l, d, p) {
|
|
3049
|
+
var h = this;
|
|
3050
|
+
this.db = o, this.mode = u, this.storeNames = y, this.schema = l, this.chromeTransactionDurability = d, this.idbtrans = null, this.on = St(this, "complete", "error", "abort"), this.parent = p || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new I(function(m, b) {
|
|
3051
|
+
h._resolve = m, h._reject = b;
|
|
3052
|
+
}), this._completion.then(function() {
|
|
3053
|
+
h.active = !1, h.on.complete.fire();
|
|
3054
|
+
}, function(m) {
|
|
3055
|
+
var b = h.active;
|
|
3056
|
+
return h.active = !1, h.on.error.fire(m), h.parent ? h.parent._reject(m) : b && h.idbtrans && h.idbtrans.abort(), ue(m);
|
|
3057
|
+
});
|
|
3058
|
+
})), this.Version = (s = this, Pt(Ri.prototype, function(u) {
|
|
3059
|
+
this.db = s, this._cfg = { version: u, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
3060
|
+
})), this.WhereClause = (c = this, Pt(jr.prototype, function(u, y, l) {
|
|
3061
|
+
if (this.db = c, this._ctx = { table: u, index: y === ":id" ? null : y, or: l }, this._cmp = this._ascending = J, this._descending = function(d, p) {
|
|
3062
|
+
return J(p, d);
|
|
3063
|
+
}, this._max = function(d, p) {
|
|
3064
|
+
return 0 < J(d, p) ? d : p;
|
|
3065
|
+
}, this._min = function(d, p) {
|
|
3066
|
+
return J(d, p) < 0 ? d : p;
|
|
3067
|
+
}, this._IDBKeyRange = c._deps.IDBKeyRange, !this._IDBKeyRange) throw new V.MissingAPI();
|
|
3068
|
+
})), this.on("versionchange", function(u) {
|
|
3069
|
+
0 < u.newVersion ? console.warn("Another connection wants to upgrade database '".concat(n.name, "'. Closing db now to resume the upgrade.")) : console.warn("Another connection wants to delete database '".concat(n.name, "'. Closing db now to resume the delete request.")), n.close({ disableAutoOpen: !1 });
|
|
3070
|
+
}), this.on("blocked", function(u) {
|
|
3071
|
+
!u.newVersion || u.newVersion < u.oldVersion ? console.warn("Dexie.delete('".concat(n.name, "') was blocked")) : console.warn("Upgrade '".concat(n.name, "' blocked by other connection holding version ").concat(u.oldVersion / 10));
|
|
3072
|
+
}), this._maxKey = zt(t.IDBKeyRange), this._createTransaction = function(u, y, l, d) {
|
|
3073
|
+
return new n.Transaction(u, y, l, n._options.chromeTransactionDurability, d);
|
|
3074
|
+
}, this._fireOnBlocked = function(u) {
|
|
3075
|
+
n.on("blocked").fire(u), vt.filter(function(y) {
|
|
3076
|
+
return y.name === n.name && y !== n && !y._state.vcFired;
|
|
3077
|
+
}).map(function(y) {
|
|
3078
|
+
return y.on("versionchange").fire(u);
|
|
3079
|
+
});
|
|
3080
|
+
}, this.use(Li), this.use(Vi), this.use(Ni), this.use(qi), this.use(Mi);
|
|
3081
|
+
var v = new Proxy(this, { get: function(u, y, l) {
|
|
3082
|
+
if (y === "_vip") return !0;
|
|
3083
|
+
if (y === "table") return function(p) {
|
|
3084
|
+
return ln(n.table(p), v);
|
|
3085
|
+
};
|
|
3086
|
+
var d = Reflect.get(u, y, l);
|
|
3087
|
+
return d instanceof Kr ? ln(d, v) : y === "tables" ? d.map(function(p) {
|
|
3088
|
+
return ln(p, v);
|
|
3089
|
+
}) : y === "_createTransaction" ? function() {
|
|
3090
|
+
return ln(d.apply(this, arguments), v);
|
|
3091
|
+
} : d;
|
|
3092
|
+
} });
|
|
3093
|
+
this.vip = v, r.forEach(function(u) {
|
|
3094
|
+
return u(n);
|
|
3095
|
+
});
|
|
3096
|
+
}
|
|
3097
|
+
var fn, xe = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable", Hi = (ir.prototype.subscribe = function(e, t, n) {
|
|
3098
|
+
return this._subscribe(e && typeof e != "function" ? e : { next: e, error: t, complete: n });
|
|
3099
|
+
}, ir.prototype[xe] = function() {
|
|
3100
|
+
return this;
|
|
3101
|
+
}, ir);
|
|
3102
|
+
function ir(e) {
|
|
3103
|
+
this._subscribe = e;
|
|
3104
|
+
}
|
|
3105
|
+
try {
|
|
3106
|
+
fn = { indexedDB: C.indexedDB || C.mozIndexedDB || C.webkitIndexedDB || C.msIndexedDB, IDBKeyRange: C.IDBKeyRange || C.webkitIDBKeyRange };
|
|
3107
|
+
} catch {
|
|
3108
|
+
fn = { indexedDB: null, IDBKeyRange: null };
|
|
3109
|
+
}
|
|
3110
|
+
function Xr(e) {
|
|
3111
|
+
var t, n = !1, r = new Hi(function(i) {
|
|
3112
|
+
var a = xn(e), o, s = !1, c = {}, f = {}, v = { get closed() {
|
|
3113
|
+
return s;
|
|
3114
|
+
}, unsubscribe: function() {
|
|
3115
|
+
s || (s = !0, o && o.abort(), u && $e.storagemutated.unsubscribe(l));
|
|
3116
|
+
} };
|
|
3117
|
+
i.start && i.start(v);
|
|
3118
|
+
var u = !1, y = function() {
|
|
3119
|
+
return Tn(d);
|
|
3120
|
+
}, l = function(p) {
|
|
3121
|
+
sn(c, p), Gn(f, c) && y();
|
|
3122
|
+
}, d = function() {
|
|
3123
|
+
var p, h, m;
|
|
3124
|
+
!s && fn.indexedDB && (c = {}, p = {}, o && o.abort(), o = new AbortController(), m = function(b) {
|
|
3125
|
+
var _ = ft();
|
|
3126
|
+
try {
|
|
3127
|
+
a && dt();
|
|
3128
|
+
var x = qe(e, b);
|
|
3129
|
+
return x = a ? x.finally(Me) : x;
|
|
3130
|
+
} finally {
|
|
3131
|
+
_ && ht();
|
|
3132
|
+
}
|
|
3133
|
+
}(h = { subscr: p, signal: o.signal, requery: y, querier: e, trans: null }), Promise.resolve(m).then(function(b) {
|
|
3134
|
+
n = !0, t = b, s || h.signal.aborted || (c = {}, function(_) {
|
|
3135
|
+
for (var x in _) if (B(_, x)) return;
|
|
3136
|
+
return 1;
|
|
3137
|
+
}(f = p) || u || ($e(At, l), u = !0), Tn(function() {
|
|
3138
|
+
return !s && i.next && i.next(b);
|
|
3139
|
+
}));
|
|
3140
|
+
}, function(b) {
|
|
3141
|
+
n = !1, ["DatabaseClosedError", "AbortError"].includes(b == null ? void 0 : b.name) || s || Tn(function() {
|
|
3142
|
+
s || i.error && i.error(b);
|
|
3143
|
+
});
|
|
3144
|
+
}));
|
|
3145
|
+
};
|
|
3146
|
+
return setTimeout(y, 0), v;
|
|
3147
|
+
});
|
|
3148
|
+
return r.hasValue = function() {
|
|
3149
|
+
return n;
|
|
3150
|
+
}, r.getValue = function() {
|
|
3151
|
+
return t;
|
|
3152
|
+
}, r;
|
|
3153
|
+
}
|
|
3154
|
+
var it = Ae;
|
|
3155
|
+
function ar(e) {
|
|
3156
|
+
var t = Fe;
|
|
3157
|
+
try {
|
|
3158
|
+
Fe = !0, $e.storagemutated.fire(e), Jn(e, !0);
|
|
3159
|
+
} finally {
|
|
3160
|
+
Fe = t;
|
|
3161
|
+
}
|
|
3162
|
+
}
|
|
3163
|
+
F(it, k(k({}, Mt), { delete: function(e) {
|
|
3164
|
+
return new it(e, { addons: [] }).delete();
|
|
3165
|
+
}, exists: function(e) {
|
|
3166
|
+
return new it(e, { addons: [] }).open().then(function(t) {
|
|
3167
|
+
return t.close(), !0;
|
|
3168
|
+
}).catch("NoSuchDatabaseError", function() {
|
|
3169
|
+
return !1;
|
|
3170
|
+
});
|
|
3171
|
+
}, getDatabaseNames: function(e) {
|
|
3172
|
+
try {
|
|
3173
|
+
return t = it.dependencies, n = t.indexedDB, t = t.IDBKeyRange, (Un(n) ? Promise.resolve(n.databases()).then(function(r) {
|
|
3174
|
+
return r.map(function(i) {
|
|
3175
|
+
return i.name;
|
|
3176
|
+
}).filter(function(i) {
|
|
3177
|
+
return i !== Yt;
|
|
3178
|
+
});
|
|
3179
|
+
}) : Wn(n, t).toCollection().primaryKeys()).then(e);
|
|
3180
|
+
} catch {
|
|
3181
|
+
return ue(new V.MissingAPI());
|
|
3182
|
+
}
|
|
3183
|
+
var t, n;
|
|
3184
|
+
}, defineClass: function() {
|
|
3185
|
+
return function(e) {
|
|
3186
|
+
R(this, e);
|
|
3187
|
+
};
|
|
3188
|
+
}, ignoreTransaction: function(e) {
|
|
3189
|
+
return N.trans ? et(N.transless, e) : e();
|
|
3190
|
+
}, vip: Yn, async: function(e) {
|
|
3191
|
+
return function() {
|
|
3192
|
+
try {
|
|
3193
|
+
var t = er(e.apply(this, arguments));
|
|
3194
|
+
return t && typeof t.then == "function" ? t : I.resolve(t);
|
|
3195
|
+
} catch (n) {
|
|
3196
|
+
return ue(n);
|
|
3197
|
+
}
|
|
3198
|
+
};
|
|
3199
|
+
}, spawn: function(e, t, n) {
|
|
3200
|
+
try {
|
|
3201
|
+
var r = er(e.apply(n, t || []));
|
|
3202
|
+
return r && typeof r.then == "function" ? r : I.resolve(r);
|
|
3203
|
+
} catch (i) {
|
|
3204
|
+
return ue(i);
|
|
3205
|
+
}
|
|
3206
|
+
}, currentTransaction: { get: function() {
|
|
3207
|
+
return N.trans || null;
|
|
3208
|
+
} }, waitFor: function(e, t) {
|
|
3209
|
+
return t = I.resolve(typeof e == "function" ? it.ignoreTransaction(e) : e).timeout(t || 6e4), N.trans ? N.trans.waitFor(t) : t;
|
|
3210
|
+
}, Promise: I, debug: { get: function() {
|
|
3211
|
+
return Ee;
|
|
3212
|
+
}, set: function(e) {
|
|
3213
|
+
gr(e);
|
|
3214
|
+
} }, derive: ie, extend: R, props: F, override: Pe, Events: St, on: $e, liveQuery: Xr, extendObservabilitySet: sn, getByKeyPath: ne, setByKeyPath: se, delByKeyPath: function(e, t) {
|
|
3215
|
+
typeof t == "string" ? se(e, t, void 0) : "length" in t && [].map.call(t, function(n) {
|
|
3216
|
+
se(e, n, void 0);
|
|
3217
|
+
});
|
|
3218
|
+
}, shallowClone: We, deepClone: Ue, getObjectDiff: tr, cmp: J, asap: W, minKey: -1 / 0, addons: [], connections: vt, errnames: Cn, dependencies: fn, cache: rt, semVer: "4.0.11", version: "4.0.11".split(".").map(function(e) {
|
|
3219
|
+
return parseInt(e);
|
|
3220
|
+
}).reduce(function(e, t, n) {
|
|
3221
|
+
return e + t / Math.pow(10, 2 * n);
|
|
3222
|
+
}) })), it.maxKey = zt(it.dependencies.IDBKeyRange), typeof dispatchEvent < "u" && typeof addEventListener < "u" && ($e(At, function(e) {
|
|
3223
|
+
Fe || (e = new CustomEvent(Mn, { detail: e }), Fe = !0, dispatchEvent(e), Fe = !1);
|
|
3224
|
+
}), addEventListener(Mn, function(e) {
|
|
3225
|
+
e = e.detail, Fe || ar(e);
|
|
3226
|
+
}));
|
|
3227
|
+
var mt, Fe = !1, Gr = function() {
|
|
3228
|
+
};
|
|
3229
|
+
return typeof BroadcastChannel < "u" && ((Gr = function() {
|
|
3230
|
+
(mt = new BroadcastChannel(Mn)).onmessage = function(e) {
|
|
3231
|
+
return e.data && ar(e.data);
|
|
3232
|
+
};
|
|
3233
|
+
})(), typeof mt.unref == "function" && mt.unref(), $e(At, function(e) {
|
|
3234
|
+
Fe || mt.postMessage(e);
|
|
3235
|
+
})), typeof addEventListener < "u" && (addEventListener("pagehide", function(e) {
|
|
3236
|
+
if (!Ae.disableBfCache && e.persisted) {
|
|
3237
|
+
Ee && console.debug("Dexie: handling persisted pagehide"), mt != null && mt.close();
|
|
3238
|
+
for (var t = 0, n = vt; t < n.length; t++) n[t].close({ disableAutoOpen: !1 });
|
|
3239
|
+
}
|
|
3240
|
+
}), addEventListener("pageshow", function(e) {
|
|
3241
|
+
!Ae.disableBfCache && e.persisted && (Ee && console.debug("Dexie: handling persisted pageshow"), Gr(), ar({ all: new ve(-1 / 0, [[]]) }));
|
|
3242
|
+
})), I.rejectionMapper = function(e, t) {
|
|
3243
|
+
return !e || e instanceof ct || e instanceof TypeError || e instanceof SyntaxError || !e.name || !mr[e.name] ? e : (t = new mr[e.name](t || e.message, e), "stack" in e && M(t, "stack", { get: function() {
|
|
3244
|
+
return this.inner.stack;
|
|
3245
|
+
} }), t);
|
|
3246
|
+
}, gr(Ee), k(Ae, Object.freeze({ __proto__: null, Dexie: Ae, liveQuery: Xr, Entity: Or, cmp: J, PropModification: Kt, replacePrefix: function(e, t) {
|
|
3247
|
+
return new Kt({ replacePrefix: [e, t] });
|
|
3248
|
+
}, add: function(e) {
|
|
3249
|
+
return new Kt({ add: e });
|
|
3250
|
+
}, remove: function(e) {
|
|
3251
|
+
return new Kt({ remove: e });
|
|
3252
|
+
}, default: Ae, RangeSet: ve, mergeRanges: It, rangesOverlap: Mr }), { default: Ae }), Ae;
|
|
3253
|
+
});
|
|
3254
|
+
}(dn)), dn.exports;
|
|
3255
|
+
}
|
|
3256
|
+
var ya = pa();
|
|
3257
|
+
const cr = /* @__PURE__ */ da(ya), Zr = Symbol.for("Dexie"), yn = globalThis[Zr] || (globalThis[Zr] = cr);
|
|
3258
|
+
if (cr.semVer !== yn.semVer)
|
|
3259
|
+
throw new Error(`Two different versions of Dexie loaded in the same app: ${cr.semVer} and ${yn.semVer}`);
|
|
3260
|
+
const {
|
|
3261
|
+
liveQuery: sv,
|
|
3262
|
+
mergeRanges: uv,
|
|
3263
|
+
rangesOverlap: cv,
|
|
3264
|
+
RangeSet: lv,
|
|
3265
|
+
cmp: fv,
|
|
3266
|
+
Entity: hv,
|
|
3267
|
+
PropModification: dv,
|
|
3268
|
+
replacePrefix: vv,
|
|
3269
|
+
add: pv,
|
|
3270
|
+
remove: yv
|
|
3271
|
+
} = yn;
|
|
3272
|
+
var ma = "阿啊呵腌嗄吖锕", ga = "额阿俄恶鹅遏鄂厄饿峨扼娥鳄哦蛾噩愕讹锷垩婀鹗萼谔莪腭锇颚呃阏屙苊轭", ba = "爱埃艾碍癌哀挨矮隘蔼唉皑哎霭捱暧嫒嗳瑷嗌锿砹", _a = "诶", wa = "系西席息希习吸喜细析戏洗悉锡溪惜稀袭夕洒晰昔牺腊烯熙媳栖膝隙犀蹊硒兮熄曦禧嬉玺奚汐徙羲铣淅嘻歙熹矽蟋郗唏皙隰樨浠忾蜥檄郄翕阋鳃舾屣葸螅咭粞觋欷僖醯鼷裼穸饩舄禊诶菥蓰", ka = "一以已意议义益亿易医艺食依移衣异伊仪宜射遗疑毅谊亦疫役忆抑尾乙译翼蛇溢椅沂泄逸蚁夷邑怡绎彝裔姨熠贻矣屹颐倚诣胰奕翌疙弈轶蛾驿壹猗臆弋铱旖漪迤佚翊诒怿痍懿饴峄揖眙镒仡黟肄咿翳挹缢呓刈咦嶷羿钇殪荑薏蜴镱噫癔苡悒嗌瘗衤佾埸圯舣酏劓", xa = "安案按岸暗鞍氨俺胺铵谙庵黯鹌桉埯犴揞厂广", Ca = "厂汉韩含旱寒汗涵函喊憾罕焊翰邯撼瀚憨捍酣悍鼾邗颔蚶晗菡旰顸犴焓撖", Ea = "昂仰盎肮", Oa = "奥澳傲熬凹鳌敖遨鏖袄坳翱嗷拗懊岙螯骜獒鏊艹媪廒聱", Sa = "瓦挖娃洼袜蛙凹哇佤娲呙腽", Pa = "于与育余预域予遇奥语誉玉鱼雨渔裕愈娱欲吁舆宇羽逾豫郁寓吾狱喻御浴愉禹俞邪榆愚渝尉淤虞屿峪粥驭瑜禺毓钰隅芋熨瘀迂煜昱汩於臾盂聿竽萸妪腴圄谕觎揄龉谀俣馀庾妤瘐鬻欤鹬阈嵛雩鹆圉蜮伛纡窬窳饫蓣狳肀舁蝓燠", Ka = "牛纽扭钮拗妞忸狃", Da = "哦噢喔", Aa = "把八巴拔伯吧坝爸霸罢芭跋扒叭靶疤笆耙鲅粑岜灞钯捌菝魃茇", za = "怕帕爬扒趴琶啪葩耙杷钯筢", Ta = "被批副否皮坏辟啤匹披疲罢僻毗坯脾譬劈媲屁琵邳裨痞癖陂丕枇噼霹吡纰砒铍淠郫埤濞睥芘蚍圮鼙罴蜱疋貔仳庀擗甓陴", ja = "比必币笔毕秘避闭佛辟壁弊彼逼碧鼻臂蔽拂泌璧庇痹毙弼匕鄙陛裨贲敝蓖吡篦纰俾铋毖筚荸薜婢哔跸濞秕荜愎睥妣芘箅髀畀滗狴萆嬖襞舭", Ia = "百白败摆伯拜柏佰掰呗擘捭稗", Ra = "波博播勃拨薄佛伯玻搏柏泊舶剥渤卜驳簿脖膊簸菠礴箔铂亳钵帛擘饽跛钹趵檗啵鹁擗踣", Ba = "北被备倍背杯勃贝辈悲碑臂卑悖惫蓓陂钡狈呗焙碚褙庳鞴孛鹎邶鐾", qa = "办版半班般板颁伴搬斑扮拌扳瓣坂阪绊钣瘢舨癍", Ma = "判盘番潘攀盼拚畔胖叛拌蹒磐爿蟠泮袢襻丬", La = "份宾频滨斌彬濒殡缤鬓槟摈膑玢镔豳髌傧", Na = "帮邦彭旁榜棒膀镑绑傍磅蚌谤梆浜蒡", $a = "旁庞乓磅螃彷滂逄耪", Fa = "泵崩蚌蹦迸绷甭嘣甏堋", Va = "报保包宝暴胞薄爆炮饱抱堡剥鲍曝葆瀑豹刨褒雹孢苞煲褓趵鸨龅勹", Ha = "不部步布补捕堡埔卜埠簿哺怖钚卟瓿逋晡醭钸", Wa = "普暴铺浦朴堡葡谱埔扑仆蒲曝瀑溥莆圃璞濮菩蹼匍噗氆攵镨攴镤", Ua = "面棉免绵缅勉眠冕娩腼渑湎沔黾宀眄", Ya = "破繁坡迫颇朴泊婆泼魄粕鄱珀陂叵笸泺皤钋钷", Xa = "反范犯繁饭泛翻凡返番贩烦拚帆樊藩矾梵蕃钒幡畈蘩蹯燔", Ga = "府服副负富复福夫妇幅付扶父符附腐赴佛浮覆辅傅伏抚赋辐腹弗肤阜袱缚甫氟斧孚敷俯拂俘咐腑孵芙涪釜脯茯馥宓绂讣呋罘麸蝠匐芾蜉跗凫滏蝮驸绋蚨砩桴赙菔呒趺苻拊阝鲋怫稃郛莩幞祓艴黻黼鳆", Qa = "本体奔苯笨夯贲锛畚坌", Za = "风丰封峰奉凤锋冯逢缝蜂枫疯讽烽俸沣酆砜葑唪", Ja = "变便边编遍辩鞭辨贬匾扁卞汴辫砭苄蝙鳊弁窆笾煸褊碥忭缏", eo = "便片篇偏骗翩扁骈胼蹁谝犏缏", to = "镇真针圳振震珍阵诊填侦臻贞枕桢赈祯帧甄斟缜箴疹砧榛鸩轸稹溱蓁胗椹朕畛浈", no = "表标彪镖裱飚膘飙镳婊骠飑杓髟鳔灬瘭", ro = "票朴漂飘嫖瓢剽缥殍瞟骠嘌莩螵", io = "和活或货获火伙惑霍祸豁嚯藿锪蠖钬耠镬夥灬劐攉", ao = "别鳖憋瘪蹩", oo = "民敏闽闵皿泯岷悯珉抿黾缗玟愍苠鳘", so = "分份纷奋粉氛芬愤粪坟汾焚酚吩忿棼玢鼢瀵偾鲼", uo = "并病兵冰屏饼炳秉丙摒柄槟禀枋邴冫", co = "更耕颈庚耿梗埂羹哽赓绠鲠", lo = "方放房防访纺芳仿坊妨肪邡舫彷枋鲂匚钫", fo = "现先县见线限显险献鲜洗宪纤陷闲贤仙衔掀咸嫌掺羡弦腺痫娴舷馅酰铣冼涎暹籼锨苋蚬跹岘藓燹鹇氙莶霰跣猃彡祆筅", ho = "不否缶", vo = "拆擦嚓礤", po = "查察差茶插叉刹茬楂岔诧碴嚓喳姹杈汊衩搽槎镲苴檫馇锸猹", yo = "才采财材菜彩裁蔡猜踩睬", mo = "参残餐灿惨蚕掺璨惭粲孱骖黪", go = "信深参身神什审申甚沈伸慎渗肾绅莘呻婶娠砷蜃哂椹葚吲糁渖诜谂矧胂", bo = "参岑涔", _o = "三参散伞叁糁馓毵", wo = "藏仓苍沧舱臧伧", ko = "藏脏葬赃臧奘驵", xo = "称陈沈沉晨琛臣尘辰衬趁忱郴宸谌碜嗔抻榇伧谶龀肜", Co = "草操曹槽糙嘈漕螬艚屮", Eo = "策测册侧厕栅恻", Oo = "责则泽择侧咋啧仄箦赜笮舴昃迮帻", So = "债择齐宅寨侧摘窄斋祭翟砦瘵哜", Po = "到道导岛倒刀盗稻蹈悼捣叨祷焘氘纛刂帱忉", Ko = "层曾蹭噌", Do = "查扎炸诈闸渣咋乍榨楂札栅眨咤柞喳喋铡蚱吒怍砟揸痄哳齄", Ao = "差拆柴钗豺侪虿瘥", zo = "次此差词辞刺瓷磁兹慈茨赐祠伺雌疵鹚糍呲粢", To = "资自子字齐咨滋仔姿紫兹孜淄籽梓鲻渍姊吱秭恣甾孳訾滓锱辎趑龇赀眦缁呲笫谘嵫髭茈粢觜耔", jo = "措错磋挫搓撮蹉锉厝嵯痤矬瘥脞鹾", Io = "产单阐崭缠掺禅颤铲蝉搀潺蟾馋忏婵孱觇廛谄谗澶骣羼躔蒇冁", Ro = "山单善陕闪衫擅汕扇掺珊禅删膳缮赡鄯栅煽姗跚鳝嬗潸讪舢苫疝掸膻钐剡蟮芟埏彡骟", Bo = "展战占站崭粘湛沾瞻颤詹斩盏辗绽毡栈蘸旃谵搌", qo = "新心信辛欣薪馨鑫芯锌忻莘昕衅歆囟忄镡", Mo = "联连练廉炼脸莲恋链帘怜涟敛琏镰濂楝鲢殓潋裢裣臁奁莶蠊蔹", Lo = "场长厂常偿昌唱畅倡尝肠敞倘猖娼淌裳徜昶怅嫦菖鲳阊伥苌氅惝鬯", No = "长张章障涨掌帐胀彰丈仗漳樟账杖璋嶂仉瘴蟑獐幛鄣嫜", $o = "超朝潮炒钞抄巢吵剿绰嘲晁焯耖怊", Fo = "着照招找召朝赵兆昭肇罩钊沼嘲爪诏濯啁棹笊", Vo = "调州周洲舟骤轴昼宙粥皱肘咒帚胄绉纣妯啁诌繇碡籀酎荮", Ho = "车彻撤尺扯澈掣坼砗屮", Wo = "车局据具举且居剧巨聚渠距句拒俱柜菊拘炬桔惧矩鞠驹锯踞咀瞿枸掬沮莒橘飓疽钜趄踽遽琚龃椐苣裾榘狙倨榉苴讵雎锔窭鞫犋屦醵", Uo = "成程城承称盛抢乘诚呈净惩撑澄秤橙骋逞瞠丞晟铛埕塍蛏柽铖酲裎枨", Yo = "容荣融绒溶蓉熔戎榕茸冗嵘肜狨蝾", Xo = "生声升胜盛乘圣剩牲甸省绳笙甥嵊晟渑眚", Go = "等登邓灯澄凳瞪蹬噔磴嶝镫簦戥", Qo = "制之治质职只志至指织支值知识直致执置止植纸拓智殖秩旨址滞氏枝芝脂帜汁肢挚稚酯掷峙炙栉侄芷窒咫吱趾痔蜘郅桎雉祉郦陟痣蛭帙枳踯徵胝栀贽祗豸鸷摭轵卮轾彘觯絷跖埴夂黹忮骘膣踬", Zo = "政正证争整征郑丁症挣蒸睁铮筝拯峥怔诤狰徵钲", Jo = "堂唐糖汤塘躺趟倘棠烫淌膛搪镗傥螳溏帑羰樘醣螗耥铴瑭", es = "持吃池迟赤驰尺斥齿翅匙痴耻炽侈弛叱啻坻眙嗤墀哧茌豉敕笞饬踟蚩柢媸魑篪褫彳鸱螭瘛眵傺", ts = "是时实事市十使世施式势视识师史示石食始士失适试什泽室似诗饰殖释驶氏硕逝湿蚀狮誓拾尸匙仕柿矢峙侍噬嗜栅拭嘘屎恃轼虱耆舐莳铈谥炻豕鲥饣螫酾筮埘弑礻蓍鲺贳", ns = "企其起期气七器汽奇齐启旗棋妻弃揭枝歧欺骑契迄亟漆戚岂稽岐琦栖缉琪泣乞砌祁崎绮祺祈凄淇杞脐麒圻憩芪伎俟畦耆葺沏萋骐鳍綦讫蕲屺颀亓碛柒啐汔綮萁嘁蛴槭欹芑桤丌蜞", rs = "揣踹啜搋膪", is = "托脱拓拖妥驼陀沱鸵驮唾椭坨佗砣跎庹柁橐乇铊沲酡鼍箨柝", as = "多度夺朵躲铎隋咄堕舵垛惰哆踱跺掇剁柁缍沲裰哚隳", os = "学血雪削薛穴靴谑噱鳕踅泶彐", ss = "重种充冲涌崇虫宠忡憧舂茺铳艟", us = "筹抽绸酬愁丑臭仇畴稠瞅踌惆俦瘳雠帱", cs = "求球秋丘邱仇酋裘龟囚遒鳅虬蚯泅楸湫犰逑巯艽俅蝤赇鼽糗", ls = "修秀休宿袖绣臭朽锈羞嗅岫溴庥馐咻髹鸺貅", fs = "出处础初助除储畜触楚厨雏矗橱锄滁躇怵绌搐刍蜍黜杵蹰亍樗憷楮", hs = "团揣湍疃抟彖", ds = "追坠缀揣椎锥赘惴隹骓缒", vs = "传川船穿串喘椽舛钏遄氚巛舡", ps = "专转传赚砖撰篆馔啭颛", ys = "元员院原源远愿园援圆缘袁怨渊苑宛冤媛猿垣沅塬垸鸳辕鸢瑗圜爰芫鼋橼螈眢箢掾", ms = "窜攒篡蹿撺爨汆镩", gs = "创床窗闯幢疮怆", bs = "装状庄壮撞妆幢桩奘僮戆", _s = "吹垂锤炊椎陲槌捶棰", ws = "春纯醇淳唇椿蠢鹑朐莼肫蝽", ks = "准屯淳谆肫窀", xs = "促趋趣粗簇醋卒蹴猝蹙蔟殂徂", Cs = "吨顿盾敦蹲墩囤沌钝炖盹遁趸砘礅", Es = "区去取曲趋渠趣驱屈躯衢娶祛瞿岖龋觑朐蛐癯蛆苣阒诎劬蕖蘧氍黢蠼璩麴鸲磲", Os = "需许续须序徐休蓄畜虚吁绪叙旭邪恤墟栩絮圩婿戌胥嘘浒煦酗诩朐盱蓿溆洫顼勖糈砉醑", Ss = "辍绰戳淖啜龊踔辶", Ps = "组族足祖租阻卒俎诅镞菹", Ks = "济机其技基记计系期际及集级几给积极己纪即继击既激绩急奇吉季齐疾迹鸡剂辑籍寄挤圾冀亟寂暨脊跻肌稽忌饥祭缉棘矶汲畸姬藉瘠骥羁妓讥稷蓟悸嫉岌叽伎鲫诘楫荠戟箕霁嵇觊麂畿玑笈犄芨唧屐髻戢佶偈笄跽蒺乩咭赍嵴虮掎齑殛鲚剞洎丌墼蕺彐芰哜", Ds = "从丛匆聪葱囱琮淙枞骢苁璁", As = "总从综宗纵踪棕粽鬃偬枞腙", zs = "凑辏腠楱", Ts = "衰催崔脆翠萃粹摧璀瘁悴淬啐隹毳榱", js = "为位委未维卫围违威伟危味微唯谓伪慰尾魏韦胃畏帷喂巍萎蔚纬潍尉渭惟薇苇炜圩娓诿玮崴桅偎逶倭猥囗葳隗痿猬涠嵬韪煨艉隹帏闱洧沩隈鲔軎", Is = "村存寸忖皴", Rs = "作做座左坐昨佐琢撮祚柞唑嘬酢怍笮阼胙", Bs = "钻纂攥缵躜", qs = "大达打答搭沓瘩惮嗒哒耷鞑靼褡笪怛妲", Ms = "大代带待贷毒戴袋歹呆隶逮岱傣棣怠殆黛甙埭诒绐玳呔迨", Ls = "大台太态泰抬胎汰钛苔薹肽跆邰鲐酞骀炱", Ns = "他它她拓塔踏塌榻沓漯獭嗒挞蹋趿遢铊鳎溻闼", $s = "但单石担丹胆旦弹蛋淡诞氮郸耽殚惮儋眈疸澹掸膻啖箪聃萏瘅赕", Fs = "路六陆录绿露鲁卢炉鹿禄赂芦庐碌麓颅泸卤潞鹭辘虏璐漉噜戮鲈掳橹轳逯渌蓼撸鸬栌氇胪镥簏舻辂垆", Vs = "谈探坦摊弹炭坛滩贪叹谭潭碳毯瘫檀痰袒坍覃忐昙郯澹钽锬", Hs = "人任认仁忍韧刃纫饪妊荏稔壬仞轫亻衽", Ws = "家结解价界接节她届介阶街借杰洁截姐揭捷劫戒皆竭桔诫楷秸睫藉拮芥诘碣嗟颉蚧孑婕疖桀讦疥偈羯袷哜喈卩鲒骱", Us = "研严验演言眼烟沿延盐炎燕岩宴艳颜殷彦掩淹阎衍铅雁咽厌焰堰砚唁焉晏檐蜒奄俨腌妍谚兖筵焱偃闫嫣鄢湮赝胭琰滟阉魇酽郾恹崦芫剡鼹菸餍埏谳讠厣罨", Ys = "当党档荡挡宕砀铛裆凼菪谠", Xs = "套讨跳陶涛逃桃萄淘掏滔韬叨洮啕绦饕鼗", Gs = "条调挑跳迢眺苕窕笤佻啁粜髫铫祧龆蜩鲦", Qs = "特忑忒铽慝", Zs = "的地得德底锝", Js = "得", eu = "的地第提低底抵弟迪递帝敌堤蒂缔滴涤翟娣笛棣荻谛狄邸嘀砥坻诋嫡镝碲骶氐柢籴羝睇觌", tu = "体提题弟替梯踢惕剔蹄棣啼屉剃涕锑倜悌逖嚏荑醍绨鹈缇裼", nu = "推退弟腿褪颓蜕忒煺", ru = "有由又优游油友右邮尤忧幼犹诱悠幽佑釉柚铀鱿囿酉攸黝莠猷蝣疣呦蚴莸莜铕宥繇卣牖鼬尢蚰侑", iu = "电点店典奠甸碘淀殿垫颠滇癫巅惦掂癜玷佃踮靛钿簟坫阽", au = "天田添填甜甸恬腆佃舔钿阗忝殄畋栝掭", ou = "主术住注助属逐宁著筑驻朱珠祝猪诸柱竹铸株瞩嘱贮煮烛苎褚蛛拄铢洙竺蛀渚伫杼侏澍诛茱箸炷躅翥潴邾槠舳橥丶瘃麈疰", su = "年念酿辗碾廿捻撵拈蔫鲶埝鲇辇黏", uu = "调掉雕吊钓刁貂凋碉鲷叼铫铞", cu = "要么约药邀摇耀腰遥姚窑瑶咬尧钥谣肴夭侥吆疟妖幺杳舀窕窈曜鹞爻繇徭轺铫鳐崾珧", lu = "跌叠蝶迭碟爹谍牒耋佚喋堞瓞鲽垤揲蹀", fu = "设社摄涉射折舍蛇拾舌奢慑赦赊佘麝歙畲厍猞揲滠", hu = "业也夜叶射野液冶喝页爷耶邪咽椰烨掖拽曳晔谒腋噎揶靥邺铘揲", du = "些解协写血叶谢械鞋胁斜携懈契卸谐泄蟹邪歇泻屑挟燮榭蝎撷偕亵楔颉缬邂鲑瀣勰榍薤绁渫廨獬躞", vu = "这者着著浙折哲蔗遮辙辄柘锗褶蜇蛰鹧谪赭摺乇磔螫", pu = "定订顶丁鼎盯钉锭叮仃铤町酊啶碇腚疔玎耵", yu = "丢铥", mu = "听庭停厅廷挺亭艇婷汀铤烃霆町蜓葶梃莛", gu = "动东董冬洞懂冻栋侗咚峒氡恫胴硐垌鸫岽胨", bu = "同通统童痛铜桶桐筒彤侗佟潼捅酮砼瞳恸峒仝嗵僮垌茼", _u = "中重种众终钟忠仲衷肿踵冢盅蚣忪锺舯螽夂", wu = "都斗读豆抖兜陡逗窦渎蚪痘蔸钭篼", ku = "度都独督读毒渡杜堵赌睹肚镀渎笃竺嘟犊妒牍蠹椟黩芏髑", xu = "断段短端锻缎煅椴簖", Cu = "对队追敦兑堆碓镦怼憝", Eu = "瑞兑锐睿芮蕊蕤蚋枘", Ou = "月说约越乐跃兑阅岳粤悦曰钥栎钺樾瀹龠哕刖", Su = "吞屯囤褪豚臀饨暾氽", Pu = "会回挥汇惠辉恢徽绘毁慧灰贿卉悔秽溃荟晖彗讳诲珲堕诙蕙晦睢麾烩茴喙桧蛔洄浍虺恚蟪咴隳缋哕", Ku = "务物无五武午吴舞伍污乌误亡恶屋晤悟吾雾芜梧勿巫侮坞毋诬呜钨邬捂鹜兀婺妩於戊鹉浯蜈唔骛仵焐芴鋈庑鼯牾怃圬忤痦迕杌寤阢", Du = "亚压雅牙押鸭呀轧涯崖邪芽哑讶鸦娅衙丫蚜碣垭伢氩桠琊揠吖睚痖疋迓岈砑", Au = "和合河何核盖贺喝赫荷盒鹤吓呵苛禾菏壑褐涸阂阖劾诃颌嗬貉曷翮纥盍", zu = "我握窝沃卧挝涡斡渥幄蜗喔倭莴龌肟硪", Tu = "恩摁蒽", ju = "嗯唔", Iu = "而二尔儿耳迩饵洱贰铒珥佴鸸鲕", Ru = "发法罚乏伐阀筏砝垡珐", Bu = "全权券泉圈拳劝犬铨痊诠荃醛蜷颧绻犭筌鬈悛辁畎", qu = "费非飞肥废菲肺啡沸匪斐蜚妃诽扉翡霏吠绯腓痱芾淝悱狒榧砩鲱篚镄", Mu = "配培坏赔佩陪沛裴胚妃霈淠旆帔呸醅辔锫", Lu = "平评凭瓶冯屏萍苹乒坪枰娉俜鲆", Nu = "佛", $u = "和护许户核湖互乎呼胡戏忽虎沪糊壶葫狐蝴弧瑚浒鹄琥扈唬滹惚祜囫斛笏芴醐猢怙唿戽槲觳煳鹕冱瓠虍岵鹱烀轷", Fu = "夹咖嘎尬噶旮伽尕钆尜", Vu = "个合各革格歌哥盖隔割阁戈葛鸽搁胳舸疙铬骼蛤咯圪镉颌仡硌嗝鬲膈纥袼搿塥哿虼", Hu = "哈蛤铪", Wu = "下夏峡厦辖霞夹虾狭吓侠暇遐瞎匣瑕唬呷黠硖罅狎瘕柙", Uu = "改该盖概溉钙丐芥赅垓陔戤", Yu = "海还害孩亥咳骸骇氦嗨胲醢", Xu = "干感赶敢甘肝杆赣乾柑尴竿秆橄矸淦苷擀酐绀泔坩旰疳澉", Gu = "港钢刚岗纲冈杠缸扛肛罡戆筻", Qu = "将强江港奖讲降疆蒋姜浆匠酱僵桨绛缰犟豇礓洚茳糨耩", Zu = "行航杭巷夯吭桁沆绗颃", Ju = "工公共供功红贡攻宫巩龚恭拱躬弓汞蚣珙觥肱廾", ec = "红宏洪轰虹鸿弘哄烘泓訇蕻闳讧荭黉薨", tc = "广光逛潢犷胱咣桄", nc = "穷琼穹邛茕筇跫蛩銎", rc = "高告搞稿膏糕镐皋羔锆杲郜睾诰藁篙缟槁槔", ic = "好号毫豪耗浩郝皓昊皋蒿壕灏嚎濠蚝貉颢嗥薅嚆", ac = "理力利立里李历例离励礼丽黎璃厉厘粒莉梨隶栗荔沥犁漓哩狸藜罹篱鲤砺吏澧俐骊溧砾莅锂笠蠡蛎痢雳俪傈醴栎郦俚枥喱逦娌鹂戾砬唳坜疠蜊黧猁鬲粝蓠呖跞疬缡鲡鳢嫠詈悝苈篥轹", oc = "家加价假佳架甲嘉贾驾嫁夹稼钾挟拮迦伽颊浃枷戛荚痂颉镓笳珈岬胛袈郏葭袷瘕铗跏蛱恝哿", sc = "落罗络洛逻螺锣骆萝裸漯烙摞骡咯箩珞捋荦硌雒椤镙跞瘰泺脶猡倮蠃", uc = "可科克客刻课颗渴壳柯棵呵坷恪苛咳磕珂稞瞌溘轲窠嗑疴蝌岢铪颏髁蚵缂氪骒钶锞", cc = "卡恰洽掐髂袷咭葜", lc = "给", fc = "根跟亘艮哏茛", hc = "很狠恨痕哏", dc = "构购够句沟狗钩拘勾苟垢枸篝佝媾诟岣彀缑笱鞲觏遘", vc = "口扣寇叩抠佝蔻芤眍筘", pc = "股古顾故固鼓骨估谷贾姑孤雇辜菇沽咕呱锢钴箍汩梏痼崮轱鸪牯蛊诂毂鹘菰罟嘏臌觚瞽蛄酤牿鲴", yc = "牌排派拍迫徘湃俳哌蒎", mc = "括挂瓜刮寡卦呱褂剐胍诖鸹栝呙", gc = "投头透偷愉骰亠", bc = "怪拐乖", _c = "会快块筷脍蒯侩浍郐蒉狯哙", wc = "关管观馆官贯冠惯灌罐莞纶棺斡矜倌鹳鳏盥掼涫", kc = "万完晚湾玩碗顽挽弯蔓丸莞皖宛婉腕蜿惋烷琬畹豌剜纨绾脘菀芄箢", xc = "呢哪呐讷疒", Cc = "规贵归轨桂柜圭鬼硅瑰跪龟匮闺诡癸鳜桧皈鲑刽晷傀眭妫炅庋簋刿宄匦", Ec = "军均俊君峻菌竣钧骏龟浚隽郡筠皲麇捃", Oc = "窘炯迥炅冂扃", Sc = "决绝角觉掘崛诀獗抉爵嚼倔厥蕨攫珏矍蹶谲镢鳜噱桷噘撅橛孓觖劂爝", Pc = "滚棍辊衮磙鲧绲丨", Kc = "婚混魂浑昏棍珲荤馄诨溷阍", Dc = "国过果郭锅裹帼涡椁囗蝈虢聒埚掴猓崞蜾呙馘", Ac = "黑嘿嗨", zc = "看刊勘堪坎砍侃嵌槛瞰阚龛戡凵莰", Tc = "衡横恒亨哼珩桁蘅", jc = "万没么模末冒莫摩墨默磨摸漠脉膜魔沫陌抹寞蘑摹蓦馍茉嘿谟秣蟆貉嫫镆殁耱嬷麽瘼貊貘", Ic = "鹏朋彭膨蓬碰苹棚捧亨烹篷澎抨硼怦砰嘭蟛堋", Rc = "后候厚侯猴喉吼逅篌糇骺後鲎瘊堠", Bc = "化华划话花画滑哗豁骅桦猾铧砉", qc = "怀坏淮徊槐踝", Mc = "还环换欢患缓唤焕幻痪桓寰涣宦垸洹浣豢奂郇圜獾鲩鬟萑逭漶锾缳擐", Lc = "讯训迅孙寻询循旬巡汛勋逊熏徇浚殉驯鲟薰荀浔洵峋埙巽郇醺恂荨窨蕈曛獯", Nc = "黄荒煌皇凰慌晃潢谎惶簧璜恍幌湟蝗磺隍徨遑肓篁鳇蟥癀", $c = "能乃奶耐奈鼐萘氖柰佴艿", Fc = "乱卵滦峦鸾栾銮挛孪脔娈", Vc = "切且契窃茄砌锲怯伽惬妾趄挈郄箧慊", Hc = "建间件见坚检健监减简艰践兼鉴键渐柬剑尖肩舰荐箭浅剪俭碱茧奸歼拣捡煎贱溅槛涧堑笺谏饯锏缄睑謇蹇腱菅翦戬毽笕犍硷鞯牮枧湔鲣囝裥踺搛缣鹣蒹谫僭戋趼楗", Wc = "南难男楠喃囡赧腩囝蝻", Uc = "前千钱签潜迁欠纤牵浅遣谦乾铅歉黔谴嵌倩钳茜虔堑钎骞阡掮钤扦芊犍荨仟芡悭缱佥愆褰凵肷岍搴箝慊椠", Yc = "强抢疆墙枪腔锵呛羌蔷襁羟跄樯戕嫱戗炝镪锖蜣", Xc = "向项相想乡象响香降像享箱羊祥湘详橡巷翔襄厢镶飨饷缃骧芗庠鲞葙蟓", Gc = "教交较校角觉叫脚缴胶轿郊焦骄浇椒礁佼蕉娇矫搅绞酵剿嚼饺窖跤蛟侥狡姣皎茭峤铰醮鲛湫徼鹪僬噍艽挢敫", Qc = "着著缴桌卓捉琢灼浊酌拙茁涿镯淖啄濯焯倬擢斫棹诼浞禚", Zc = "桥乔侨巧悄敲俏壳雀瞧翘窍峭锹撬荞跷樵憔鞘橇峤诮谯愀鞒硗劁缲", Jc = "小效销消校晓笑肖削孝萧俏潇硝宵啸嚣霄淆哮筱逍姣箫骁枭哓绡蛸崤枵魈", el = "司四思斯食私死似丝饲寺肆撕泗伺嗣祀厮驷嘶锶俟巳蛳咝耜笥纟糸鸶缌澌姒汜厶兕", tl = "开凯慨岂楷恺揩锴铠忾垲剀锎蒈", nl = "进金今近仅紧尽津斤禁锦劲晋谨筋巾浸襟靳瑾烬缙钅矜觐堇馑荩噤廑妗槿赆衿卺", rl = "亲勤侵秦钦琴禽芹沁寝擒覃噙矜嗪揿溱芩衾廑锓吣檎螓", il = "经京精境竞景警竟井惊径静劲敬净镜睛晶颈荆兢靖泾憬鲸茎腈菁胫阱旌粳靓痉箐儆迳婧肼刭弪獍", al = "应营影英景迎映硬盈赢颖婴鹰荧莹樱瑛蝇萦莺颍膺缨瀛楹罂荥萤鹦滢蓥郢茔嘤璎嬴瘿媵撄潆", ol = "就究九酒久救旧纠舅灸疚揪咎韭玖臼柩赳鸠鹫厩啾阄桕僦鬏", sl = "最罪嘴醉咀蕞觜", ul = "卷捐圈眷娟倦绢隽镌涓鹃鄄蠲狷锩桊", cl = "算酸蒜狻", ll = "员运云允孕蕴韵酝耘晕匀芸陨纭郧筠恽韫郓氲殒愠昀菀狁", fl = "群裙逡麇", hl = "卡喀咖咔咯佧胩", dl = "康抗扛慷炕亢糠伉钪闶", vl = "坑铿吭", pl = "考靠烤拷铐栲尻犒", yl = "肯垦恳啃龈裉", ml = "因引银印音饮阴隐姻殷淫尹荫吟瘾寅茵圻垠鄞湮蚓氤胤龈窨喑铟洇狺夤廴吲霪茚堙", gl = "空控孔恐倥崆箜", bl = "苦库哭酷裤枯窟挎骷堀绔刳喾", _l = "跨夸垮挎胯侉", wl = "亏奎愧魁馈溃匮葵窥盔逵睽馗聩喟夔篑岿喹揆隗傀暌跬蒉愦悝蝰", kl = "款宽髋", xl = "况矿框狂旷眶匡筐邝圹哐贶夼诳诓纩", Cl = "确却缺雀鹊阙瘸榷炔阕悫", El = "困昆坤捆琨锟鲲醌髡悃阃", Ol = "扩括阔廓蛞", Sl = "拉落垃腊啦辣蜡喇剌旯砬邋瘌", Pl = "来莱赖睐徕籁涞赉濑癞崃疠铼", Kl = "兰览蓝篮栏岚烂滥缆揽澜拦懒榄斓婪阑褴罱啉谰镧漤", Dl = "林临邻赁琳磷淋麟霖鳞凛拎遴蔺吝粼嶙躏廪檩啉辚膦瞵懔", Al = "浪朗郎廊狼琅榔螂阆锒莨啷蒗稂", zl = "量两粮良辆亮梁凉谅粱晾靓踉莨椋魉墚", Tl = "老劳落络牢捞涝烙姥佬崂唠酪潦痨醪铑铹栳耢", jl = "目模木亩幕母牧莫穆姆墓慕牟牡募睦缪沐暮拇姥钼苜仫毪坶", Il = "了乐勒肋叻鳓嘞仂泐", Rl = "类累雷勒泪蕾垒磊擂镭肋羸耒儡嫘缧酹嘞诔檑", Bl = "随岁虽碎尿隧遂髓穗绥隋邃睢祟濉燧谇眭荽", ql = "列烈劣裂猎冽咧趔洌鬣埒捩躐", Ml = "冷愣棱楞塄", Ll = "领令另零灵龄陵岭凌玲铃菱棱伶羚苓聆翎泠瓴囹绫呤棂蛉酃鲮柃", Nl = "俩", $l = "了料疗辽廖聊寥缪僚燎缭撂撩嘹潦镣寮蓼獠钌尥鹩", Fl = "流刘六留柳瘤硫溜碌浏榴琉馏遛鎏骝绺镏旒熘鹨锍", Vl = "论轮伦仑纶沦抡囵", Hl = "率律旅绿虑履吕铝屡氯缕滤侣驴榈闾偻褛捋膂稆", Wl = "楼露漏陋娄搂篓喽镂偻瘘髅耧蝼嵝蒌", Ul = "贸毛矛冒貌茂茅帽猫髦锚懋袤牦卯铆耄峁瑁蟊茆蝥旄泖昴瞀", Yl = "龙隆弄垄笼拢聋陇胧珑窿茏咙砻垅泷栊癃", Xl = "农浓弄脓侬哝", Gl = "双爽霜孀泷", Ql = "术书数属树输束述署朱熟殊蔬舒疏鼠淑叔暑枢墅俞曙抒竖蜀薯梳戍恕孰沭赎庶漱塾倏澍纾姝菽黍腧秫毹殳疋摅", Zl = "率衰帅摔甩蟀", Jl = "略掠锊", ef = "么马吗摩麻码妈玛嘛骂抹蚂唛蟆犸杩", tf = "么麽", nf = "买卖麦迈脉埋霾荬劢", rf = "满慢曼漫埋蔓瞒蛮鳗馒幔谩螨熳缦镘颟墁鞔", af = "米密秘迷弥蜜谜觅靡泌眯麋猕谧咪糜宓汨醚嘧弭脒冖幂祢縻蘼芈糸敉", of = "们门闷瞒汶扪焖懑鞔钔", sf = "忙盲茫芒氓莽蟒邙硭漭", uf = "蒙盟梦猛孟萌氓朦锰檬勐懵蟒蜢虻黾蠓艨甍艋瞢礞", cf = "苗秒妙描庙瞄缪渺淼藐缈邈鹋杪眇喵", lf = "某谋牟缪眸哞鍪蛑侔厶", ff = "缪谬", hf = "美没每煤梅媒枚妹眉魅霉昧媚玫酶镁湄寐莓袂楣糜嵋镅浼猸鹛", df = "文问闻稳温纹吻蚊雯紊瘟汶韫刎璺玟阌", vf = "灭蔑篾乜咩蠛", pf = "明名命鸣铭冥茗溟酩瞑螟暝", yf = "内南那纳拿哪娜钠呐捺衲镎肭", mf = "内那哪馁", gf = "难诺挪娜糯懦傩喏搦锘", bf = "若弱偌箬", _f = "囊馕囔曩攮", wf = "脑闹恼挠瑙淖孬垴铙桡呶硇猱蛲", kf = "你尼呢泥疑拟逆倪妮腻匿霓溺旎昵坭铌鲵伲怩睨猊", xf = "嫩恁", Cf = "能", Ef = "您恁", Of = "鸟尿溺袅脲茑嬲", Sf = "摄聂捏涅镍孽捻蘖啮蹑嗫臬镊颞乜陧", Pf = "娘酿", Kf = "宁凝拧泞柠咛狞佞聍甯", Df = "努怒奴弩驽帑孥胬", Af = "女钕衄恧", zf = "入如女乳儒辱汝茹褥孺濡蠕嚅缛溽铷洳薷襦颥蓐", Tf = "暖", jf = "虐疟", If = "热若惹喏", Rf = "区欧偶殴呕禺藕讴鸥瓯沤耦怄", Bf = "跑炮泡抛刨袍咆疱庖狍匏脬", qf = "剖掊裒", Mf = "喷盆湓", Lf = "瞥撇苤氕丿", Nf = "品贫聘频拼拚颦姘嫔榀牝", $f = "色塞瑟涩啬穑铯槭", Ff = "情青清请亲轻庆倾顷卿晴氢擎氰罄磬蜻箐鲭綮苘黥圊檠謦", Vf = "赞暂攒堑昝簪糌瓒錾趱拶", Hf = "少绍召烧稍邵哨韶捎勺梢鞘芍苕劭艄筲杓潲", Wf = "扫骚嫂梢缫搔瘙臊埽缲鳋", Uf = "沙厦杀纱砂啥莎刹杉傻煞鲨霎嗄痧裟挲铩唼歃", Yf = "县选宣券旋悬轩喧玄绚渲璇炫萱癣漩眩暄煊铉楦泫谖痃碹揎镟儇", Xf = "然染燃冉苒髯蚺", Gf = "让壤攘嚷瓤穰禳", Qf = "绕扰饶娆桡荛", Zf = "仍扔", Jf = "日", eh = "肉柔揉糅鞣蹂", th = "软阮朊", nh = "润闰", rh = "萨洒撒飒卅仨脎", ih = "所些索缩锁莎梭琐嗦唆唢娑蓑羧挲桫嗍睃", ah = "思赛塞腮噻鳃", oh = "说水税谁睡氵", sh = "桑丧嗓搡颡磉", uh = "森", ch = "僧", lh = "筛晒", fh = "上商尚伤赏汤裳墒晌垧觞殇熵绱", hh = "行省星腥猩惺兴刑型形邢饧醒幸杏性姓陉荇荥擤悻硎", dh = "收手受首售授守寿瘦兽狩绶艏扌", vh = "说数硕烁朔铄妁槊蒴搠", ph = "速素苏诉缩塑肃俗宿粟溯酥夙愫簌稣僳谡涑蔌嗉觫", yh = "刷耍唰", mh = "栓拴涮闩", gh = "顺瞬舜吮", bh = "送松宋讼颂耸诵嵩淞怂悚崧凇忪竦菘", _h = "艘搜擞嗽嗖叟馊薮飕嗾溲锼螋瞍", wh = "损孙笋荪榫隼狲飧", kh = "腾疼藤滕誊", xh = "铁贴帖餮萜", Ch = "土突图途徒涂吐屠兔秃凸荼钍菟堍酴", Eh = "外歪崴", Oh = "王望往网忘亡旺汪枉妄惘罔辋魍", Sh = "翁嗡瓮蓊蕹", Ph = "抓挝爪", Kh = "样养央阳洋扬杨羊详氧仰秧痒漾疡泱殃恙鸯徉佯怏炀烊鞅蛘", Dh = "雄兄熊胸凶匈汹芎", Ah = "哟唷", zh = "用永拥勇涌泳庸俑踊佣咏雍甬镛臃邕蛹恿慵壅痈鳙墉饔喁", Th = "杂扎咱砸咋匝咂拶", jh = "在再灾载栽仔宰哉崽甾", Ih = "造早遭枣噪灶燥糟凿躁藻皂澡蚤唣", Rh = "贼", Bh = "怎谮", qh = "增曾综赠憎锃甑罾缯", Mh = "这", Lh = "走邹奏揍诹驺陬楱鄹鲰", Nh = "转拽", $h = "尊遵鳟樽撙", Fh = "嗲", Vh = "耨", Hh = {
|
|
3273
|
+
a: ma,
|
|
3274
|
+
e: ga,
|
|
3275
|
+
ai: ba,
|
|
3276
|
+
ei: _a,
|
|
3277
|
+
xi: wa,
|
|
3278
|
+
yi: ka,
|
|
3279
|
+
an: xa,
|
|
3280
|
+
han: Ca,
|
|
3281
|
+
ang: Ea,
|
|
3282
|
+
ao: Oa,
|
|
3283
|
+
wa: Sa,
|
|
3284
|
+
yu: Pa,
|
|
3285
|
+
niu: Ka,
|
|
3286
|
+
o: Da,
|
|
3287
|
+
ba: Aa,
|
|
3288
|
+
pa: za,
|
|
3289
|
+
pi: Ta,
|
|
3290
|
+
bi: ja,
|
|
3291
|
+
bai: Ia,
|
|
3292
|
+
bo: Ra,
|
|
3293
|
+
bei: Ba,
|
|
3294
|
+
ban: qa,
|
|
3295
|
+
pan: Ma,
|
|
3296
|
+
bin: La,
|
|
3297
|
+
bang: Na,
|
|
3298
|
+
pang: $a,
|
|
3299
|
+
beng: Fa,
|
|
3300
|
+
bao: Va,
|
|
3301
|
+
bu: Ha,
|
|
3302
|
+
pu: Wa,
|
|
3303
|
+
mian: Ua,
|
|
3304
|
+
po: Ya,
|
|
3305
|
+
fan: Xa,
|
|
3306
|
+
fu: Ga,
|
|
3307
|
+
ben: Qa,
|
|
3308
|
+
feng: Za,
|
|
3309
|
+
bian: Ja,
|
|
3310
|
+
pian: eo,
|
|
3311
|
+
zhen: to,
|
|
3312
|
+
biao: no,
|
|
3313
|
+
piao: ro,
|
|
3314
|
+
huo: io,
|
|
3315
|
+
bie: ao,
|
|
3316
|
+
min: oo,
|
|
3317
|
+
fen: so,
|
|
3318
|
+
bing: uo,
|
|
3319
|
+
geng: co,
|
|
3320
|
+
fang: lo,
|
|
3321
|
+
xian: fo,
|
|
3322
|
+
fou: ho,
|
|
3323
|
+
ca: vo,
|
|
3324
|
+
cha: po,
|
|
3325
|
+
cai: yo,
|
|
3326
|
+
can: mo,
|
|
3327
|
+
shen: go,
|
|
3328
|
+
cen: bo,
|
|
3329
|
+
san: _o,
|
|
3330
|
+
cang: wo,
|
|
3331
|
+
zang: ko,
|
|
3332
|
+
chen: xo,
|
|
3333
|
+
cao: Co,
|
|
3334
|
+
ce: Eo,
|
|
3335
|
+
ze: Oo,
|
|
3336
|
+
zhai: So,
|
|
3337
|
+
dao: Po,
|
|
3338
|
+
ceng: Ko,
|
|
3339
|
+
zha: Do,
|
|
3340
|
+
chai: Ao,
|
|
3341
|
+
ci: zo,
|
|
3342
|
+
zi: To,
|
|
3343
|
+
cuo: jo,
|
|
3344
|
+
chan: Io,
|
|
3345
|
+
shan: Ro,
|
|
3346
|
+
zhan: Bo,
|
|
3347
|
+
xin: qo,
|
|
3348
|
+
lian: Mo,
|
|
3349
|
+
chang: Lo,
|
|
3350
|
+
zhang: No,
|
|
3351
|
+
chao: $o,
|
|
3352
|
+
zhao: Fo,
|
|
3353
|
+
zhou: Vo,
|
|
3354
|
+
che: Ho,
|
|
3355
|
+
ju: Wo,
|
|
3356
|
+
cheng: Uo,
|
|
3357
|
+
rong: Yo,
|
|
3358
|
+
sheng: Xo,
|
|
3359
|
+
deng: Go,
|
|
3360
|
+
zhi: Qo,
|
|
3361
|
+
zheng: Zo,
|
|
3362
|
+
tang: Jo,
|
|
3363
|
+
chi: es,
|
|
3364
|
+
shi: ts,
|
|
3365
|
+
qi: ns,
|
|
3366
|
+
chuai: rs,
|
|
3367
|
+
tuo: is,
|
|
3368
|
+
duo: as,
|
|
3369
|
+
xue: os,
|
|
3370
|
+
chong: ss,
|
|
3371
|
+
chou: us,
|
|
3372
|
+
qiu: cs,
|
|
3373
|
+
xiu: ls,
|
|
3374
|
+
chu: fs,
|
|
3375
|
+
tuan: hs,
|
|
3376
|
+
zhui: ds,
|
|
3377
|
+
chuan: vs,
|
|
3378
|
+
zhuan: ps,
|
|
3379
|
+
yuan: ys,
|
|
3380
|
+
cuan: ms,
|
|
3381
|
+
chuang: gs,
|
|
3382
|
+
zhuang: bs,
|
|
3383
|
+
chui: _s,
|
|
3384
|
+
chun: ws,
|
|
3385
|
+
zhun: ks,
|
|
3386
|
+
cu: xs,
|
|
3387
|
+
dun: Cs,
|
|
3388
|
+
qu: Es,
|
|
3389
|
+
xu: Os,
|
|
3390
|
+
chuo: Ss,
|
|
3391
|
+
zu: Ps,
|
|
3392
|
+
ji: Ks,
|
|
3393
|
+
cong: Ds,
|
|
3394
|
+
zong: As,
|
|
3395
|
+
cou: zs,
|
|
3396
|
+
cui: Ts,
|
|
3397
|
+
wei: js,
|
|
3398
|
+
cun: Is,
|
|
3399
|
+
zuo: Rs,
|
|
3400
|
+
zuan: Bs,
|
|
3401
|
+
da: qs,
|
|
3402
|
+
dai: Ms,
|
|
3403
|
+
tai: Ls,
|
|
3404
|
+
ta: Ns,
|
|
3405
|
+
dan: $s,
|
|
3406
|
+
lu: Fs,
|
|
3407
|
+
tan: Vs,
|
|
3408
|
+
ren: Hs,
|
|
3409
|
+
jie: Ws,
|
|
3410
|
+
yan: Us,
|
|
3411
|
+
dang: Ys,
|
|
3412
|
+
tao: Xs,
|
|
3413
|
+
tiao: Gs,
|
|
3414
|
+
te: Qs,
|
|
3415
|
+
de: Zs,
|
|
3416
|
+
dei: Js,
|
|
3417
|
+
di: eu,
|
|
3418
|
+
ti: tu,
|
|
3419
|
+
tui: nu,
|
|
3420
|
+
you: ru,
|
|
3421
|
+
dian: iu,
|
|
3422
|
+
tian: au,
|
|
3423
|
+
zhu: ou,
|
|
3424
|
+
nian: su,
|
|
3425
|
+
diao: uu,
|
|
3426
|
+
yao: cu,
|
|
3427
|
+
die: lu,
|
|
3428
|
+
she: fu,
|
|
3429
|
+
ye: hu,
|
|
3430
|
+
xie: du,
|
|
3431
|
+
zhe: vu,
|
|
3432
|
+
ding: pu,
|
|
3433
|
+
diu: yu,
|
|
3434
|
+
ting: mu,
|
|
3435
|
+
dong: gu,
|
|
3436
|
+
tong: bu,
|
|
3437
|
+
zhong: _u,
|
|
3438
|
+
dou: wu,
|
|
3439
|
+
du: ku,
|
|
3440
|
+
duan: xu,
|
|
3441
|
+
dui: Cu,
|
|
3442
|
+
rui: Eu,
|
|
3443
|
+
yue: Ou,
|
|
3444
|
+
tun: Su,
|
|
3445
|
+
hui: Pu,
|
|
3446
|
+
wu: Ku,
|
|
3447
|
+
ya: Du,
|
|
3448
|
+
he: Au,
|
|
3449
|
+
wo: zu,
|
|
3450
|
+
en: Tu,
|
|
3451
|
+
n: ju,
|
|
3452
|
+
er: Iu,
|
|
3453
|
+
fa: Ru,
|
|
3454
|
+
quan: Bu,
|
|
3455
|
+
fei: qu,
|
|
3456
|
+
pei: Mu,
|
|
3457
|
+
ping: Lu,
|
|
3458
|
+
fo: Nu,
|
|
3459
|
+
hu: $u,
|
|
3460
|
+
ga: Fu,
|
|
3461
|
+
ge: Vu,
|
|
3462
|
+
ha: Hu,
|
|
3463
|
+
xia: Wu,
|
|
3464
|
+
gai: Uu,
|
|
3465
|
+
hai: Yu,
|
|
3466
|
+
gan: Xu,
|
|
3467
|
+
gang: Gu,
|
|
3468
|
+
jiang: Qu,
|
|
3469
|
+
hang: Zu,
|
|
3470
|
+
gong: Ju,
|
|
3471
|
+
hong: ec,
|
|
3472
|
+
guang: tc,
|
|
3473
|
+
qiong: nc,
|
|
3474
|
+
gao: rc,
|
|
3475
|
+
hao: ic,
|
|
3476
|
+
li: ac,
|
|
3477
|
+
jia: oc,
|
|
3478
|
+
luo: sc,
|
|
3479
|
+
ke: uc,
|
|
3480
|
+
qia: cc,
|
|
3481
|
+
gei: lc,
|
|
3482
|
+
gen: fc,
|
|
3483
|
+
hen: hc,
|
|
3484
|
+
gou: dc,
|
|
3485
|
+
kou: vc,
|
|
3486
|
+
gu: pc,
|
|
3487
|
+
pai: yc,
|
|
3488
|
+
gua: mc,
|
|
3489
|
+
tou: gc,
|
|
3490
|
+
guai: bc,
|
|
3491
|
+
kuai: _c,
|
|
3492
|
+
guan: wc,
|
|
3493
|
+
wan: kc,
|
|
3494
|
+
ne: xc,
|
|
3495
|
+
gui: Cc,
|
|
3496
|
+
jun: Ec,
|
|
3497
|
+
jiong: Oc,
|
|
3498
|
+
jue: Sc,
|
|
3499
|
+
gun: Pc,
|
|
3500
|
+
hun: Kc,
|
|
3501
|
+
guo: Dc,
|
|
3502
|
+
hei: Ac,
|
|
3503
|
+
kan: zc,
|
|
3504
|
+
heng: Tc,
|
|
3505
|
+
mo: jc,
|
|
3506
|
+
peng: Ic,
|
|
3507
|
+
hou: Rc,
|
|
3508
|
+
hua: Bc,
|
|
3509
|
+
huai: qc,
|
|
3510
|
+
huan: Mc,
|
|
3511
|
+
xun: Lc,
|
|
3512
|
+
huang: Nc,
|
|
3513
|
+
nai: $c,
|
|
3514
|
+
luan: Fc,
|
|
3515
|
+
qie: Vc,
|
|
3516
|
+
jian: Hc,
|
|
3517
|
+
nan: Wc,
|
|
3518
|
+
qian: Uc,
|
|
3519
|
+
qiang: Yc,
|
|
3520
|
+
xiang: Xc,
|
|
3521
|
+
jiao: Gc,
|
|
3522
|
+
zhuo: Qc,
|
|
3523
|
+
qiao: Zc,
|
|
3524
|
+
xiao: Jc,
|
|
3525
|
+
si: el,
|
|
3526
|
+
kai: tl,
|
|
3527
|
+
jin: nl,
|
|
3528
|
+
qin: rl,
|
|
3529
|
+
jing: il,
|
|
3530
|
+
ying: al,
|
|
3531
|
+
jiu: ol,
|
|
3532
|
+
zui: sl,
|
|
3533
|
+
juan: ul,
|
|
3534
|
+
suan: cl,
|
|
3535
|
+
yun: ll,
|
|
3536
|
+
qun: fl,
|
|
3537
|
+
ka: hl,
|
|
3538
|
+
kang: dl,
|
|
3539
|
+
keng: vl,
|
|
3540
|
+
kao: pl,
|
|
3541
|
+
ken: yl,
|
|
3542
|
+
yin: ml,
|
|
3543
|
+
kong: gl,
|
|
3544
|
+
ku: bl,
|
|
3545
|
+
kua: _l,
|
|
3546
|
+
kui: wl,
|
|
3547
|
+
kuan: kl,
|
|
3548
|
+
kuang: xl,
|
|
3549
|
+
que: Cl,
|
|
3550
|
+
kun: El,
|
|
3551
|
+
kuo: Ol,
|
|
3552
|
+
la: Sl,
|
|
3553
|
+
lai: Pl,
|
|
3554
|
+
lan: Kl,
|
|
3555
|
+
lin: Dl,
|
|
3556
|
+
lang: Al,
|
|
3557
|
+
liang: zl,
|
|
3558
|
+
lao: Tl,
|
|
3559
|
+
mu: jl,
|
|
3560
|
+
le: Il,
|
|
3561
|
+
lei: Rl,
|
|
3562
|
+
sui: Bl,
|
|
3563
|
+
lie: ql,
|
|
3564
|
+
leng: Ml,
|
|
3565
|
+
ling: Ll,
|
|
3566
|
+
lia: Nl,
|
|
3567
|
+
liao: $l,
|
|
3568
|
+
liu: Fl,
|
|
3569
|
+
lun: Vl,
|
|
3570
|
+
lv: Hl,
|
|
3571
|
+
lou: Wl,
|
|
3572
|
+
mao: Ul,
|
|
3573
|
+
long: Yl,
|
|
3574
|
+
nong: Xl,
|
|
3575
|
+
shuang: Gl,
|
|
3576
|
+
shu: Ql,
|
|
3577
|
+
shuai: Zl,
|
|
3578
|
+
lve: Jl,
|
|
3579
|
+
ma: ef,
|
|
3580
|
+
me: tf,
|
|
3581
|
+
mai: nf,
|
|
3582
|
+
man: rf,
|
|
3583
|
+
mi: af,
|
|
3584
|
+
men: of,
|
|
3585
|
+
mang: sf,
|
|
3586
|
+
meng: uf,
|
|
3587
|
+
miao: cf,
|
|
3588
|
+
mou: lf,
|
|
3589
|
+
miu: ff,
|
|
3590
|
+
mei: hf,
|
|
3591
|
+
wen: df,
|
|
3592
|
+
mie: vf,
|
|
3593
|
+
ming: pf,
|
|
3594
|
+
na: yf,
|
|
3595
|
+
nei: mf,
|
|
3596
|
+
nuo: gf,
|
|
3597
|
+
ruo: bf,
|
|
3598
|
+
nang: _f,
|
|
3599
|
+
nao: wf,
|
|
3600
|
+
ni: kf,
|
|
3601
|
+
nen: xf,
|
|
3602
|
+
neng: Cf,
|
|
3603
|
+
nin: Ef,
|
|
3604
|
+
niao: Of,
|
|
3605
|
+
nie: Sf,
|
|
3606
|
+
niang: Pf,
|
|
3607
|
+
ning: Kf,
|
|
3608
|
+
nu: Df,
|
|
3609
|
+
nv: Af,
|
|
3610
|
+
ru: zf,
|
|
3611
|
+
nuan: Tf,
|
|
3612
|
+
nve: jf,
|
|
3613
|
+
re: If,
|
|
3614
|
+
ou: Rf,
|
|
3615
|
+
pao: Bf,
|
|
3616
|
+
pou: qf,
|
|
3617
|
+
pen: Mf,
|
|
3618
|
+
pie: Lf,
|
|
3619
|
+
pin: Nf,
|
|
3620
|
+
se: $f,
|
|
3621
|
+
qing: Ff,
|
|
3622
|
+
zan: Vf,
|
|
3623
|
+
shao: Hf,
|
|
3624
|
+
sao: Wf,
|
|
3625
|
+
sha: Uf,
|
|
3626
|
+
xuan: Yf,
|
|
3627
|
+
ran: Xf,
|
|
3628
|
+
rang: Gf,
|
|
3629
|
+
rao: Qf,
|
|
3630
|
+
reng: Zf,
|
|
3631
|
+
ri: Jf,
|
|
3632
|
+
rou: eh,
|
|
3633
|
+
ruan: th,
|
|
3634
|
+
run: nh,
|
|
3635
|
+
sa: rh,
|
|
3636
|
+
suo: ih,
|
|
3637
|
+
sai: ah,
|
|
3638
|
+
shui: oh,
|
|
3639
|
+
sang: sh,
|
|
3640
|
+
sen: uh,
|
|
3641
|
+
seng: ch,
|
|
3642
|
+
shai: lh,
|
|
3643
|
+
shang: fh,
|
|
3644
|
+
xing: hh,
|
|
3645
|
+
shou: dh,
|
|
3646
|
+
shuo: vh,
|
|
3647
|
+
su: ph,
|
|
3648
|
+
shua: yh,
|
|
3649
|
+
shuan: mh,
|
|
3650
|
+
shun: gh,
|
|
3651
|
+
song: bh,
|
|
3652
|
+
sou: _h,
|
|
3653
|
+
sun: wh,
|
|
3654
|
+
teng: kh,
|
|
3655
|
+
tie: xh,
|
|
3656
|
+
tu: Ch,
|
|
3657
|
+
wai: Eh,
|
|
3658
|
+
wang: Oh,
|
|
3659
|
+
weng: Sh,
|
|
3660
|
+
zhua: Ph,
|
|
3661
|
+
yang: Kh,
|
|
3662
|
+
xiong: Dh,
|
|
3663
|
+
yo: Ah,
|
|
3664
|
+
yong: zh,
|
|
3665
|
+
za: Th,
|
|
3666
|
+
zai: jh,
|
|
3667
|
+
zao: Ih,
|
|
3668
|
+
zei: Rh,
|
|
3669
|
+
zen: Bh,
|
|
3670
|
+
zeng: qh,
|
|
3671
|
+
zhei: Mh,
|
|
3672
|
+
zou: Lh,
|
|
3673
|
+
zhuai: Nh,
|
|
3674
|
+
zun: $h,
|
|
3675
|
+
dia: Fh,
|
|
3676
|
+
nou: Vh
|
|
3677
|
+
};
|
|
3678
|
+
const Wh = 5;
|
|
3679
|
+
var Uh = class {
|
|
3680
|
+
constructor() {
|
|
3681
|
+
he(this, "currentInput", "");
|
|
3682
|
+
he(this, "candidates", []);
|
|
3683
|
+
he(this, "db");
|
|
3684
|
+
he(this, "pinyinDict", Hh);
|
|
3685
|
+
he(this, "pinyinCharTable");
|
|
3686
|
+
he(this, "initializationPromise");
|
|
3687
|
+
this.db = new yn("PinyinCharDB"), this.db.version(1).stores({ pinyinCharEntries: "++id, &[pinyin+char], pinyin, char, weight" }), this.pinyinCharTable = this.db.table("pinyinCharEntries"), this.initializationPromise = this.initializeDatabase();
|
|
3688
|
+
}
|
|
3689
|
+
async initializeDatabase() {
|
|
3690
|
+
try {
|
|
3691
|
+
if (await this.pinyinCharTable.count() === 0) {
|
|
3692
|
+
const w = [];
|
|
3693
|
+
for (const [E, k] of Object.entries(this.pinyinDict)) for (const K of k.split("")) w.push({
|
|
3694
|
+
pinyin: E,
|
|
3695
|
+
char: K,
|
|
3696
|
+
weight: 1
|
|
3697
|
+
});
|
|
3698
|
+
await this.pinyinCharTable.bulkAdd(w);
|
|
3699
|
+
}
|
|
3700
|
+
} catch (g) {
|
|
3701
|
+
throw console.error("初始化 PinyinCharDB 失败:", g), g;
|
|
3702
|
+
}
|
|
3703
|
+
}
|
|
3704
|
+
async processInput(g) {
|
|
3705
|
+
if (await this.initializationPromise, this.currentInput = g.toLowerCase(), this.candidates = [], !this.currentInput) return [];
|
|
3706
|
+
const w = await this.pinyinCharTable.where("pinyin").startsWith(this.currentInput).toArray(), E = (k, K) => {
|
|
3707
|
+
const C = k.pinyin === K, O = k.weight > 1;
|
|
3708
|
+
return C && O ? 1 : !C && O ? 2 : C && !O ? 3 : !C && !O ? 4 : 5;
|
|
3709
|
+
};
|
|
3710
|
+
return w.sort((k, K) => {
|
|
3711
|
+
const C = E(k, this.currentInput), O = E(K, this.currentInput);
|
|
3712
|
+
return C !== O ? C - O : K.weight !== k.weight ? K.weight - k.weight : k.id - K.id;
|
|
3713
|
+
}), this.candidates = w.map((k) => k.char), this.candidates = [...new Set(this.candidates)], this.candidates;
|
|
3714
|
+
}
|
|
3715
|
+
async selectCandidate(g) {
|
|
3716
|
+
var k, K, C;
|
|
3717
|
+
if (await this.initializationPromise, !this.currentInput) return;
|
|
3718
|
+
let w = this.currentInput;
|
|
3719
|
+
for (const O of Object.keys(this.pinyinDict)) if (O.startsWith(this.currentInput) && this.pinyinDict[O].includes(g))
|
|
3720
|
+
if (O.length > w.length || O === this.currentInput) {
|
|
3721
|
+
if (w = O, (k = this.pinyinDict[this.currentInput]) != null && k.includes(g) && this.currentInput === O) break;
|
|
3722
|
+
} else w === this.currentInput && ((K = this.pinyinDict[O]) != null && K.includes(g)) && (w = O);
|
|
3723
|
+
if (!((C = this.pinyinDict[w]) != null && C.includes(g))) {
|
|
3724
|
+
for (const O of Object.keys(this.pinyinDict)) if (this.pinyinDict[O].includes(g)) {
|
|
3725
|
+
if (O.startsWith(this.currentInput)) {
|
|
3726
|
+
w = O;
|
|
3727
|
+
break;
|
|
3728
|
+
}
|
|
3729
|
+
w === this.currentInput && (w = O);
|
|
3730
|
+
}
|
|
3731
|
+
}
|
|
3732
|
+
const E = await this.pinyinCharTable.where({
|
|
3733
|
+
pinyin: w,
|
|
3734
|
+
char: g
|
|
3735
|
+
}).first();
|
|
3736
|
+
if (E && E.id !== void 0) {
|
|
3737
|
+
const O = Math.min((E.weight || 0) + 1, Wh);
|
|
3738
|
+
await this.pinyinCharTable.update(E.id, { weight: O });
|
|
3739
|
+
} else this.pinyinDict[w] ? await this.pinyinCharTable.add({
|
|
3740
|
+
pinyin: w,
|
|
3741
|
+
char: g,
|
|
3742
|
+
weight: 1
|
|
3743
|
+
}) : console.warn(`无法为 ${g} 添加条目,拼音 ${w} 不在字典中。`);
|
|
3744
|
+
this.clear();
|
|
3745
|
+
}
|
|
3746
|
+
clear() {
|
|
3747
|
+
this.currentInput = "", this.candidates = [];
|
|
3748
|
+
}
|
|
3749
|
+
getCurrentInput() {
|
|
3750
|
+
return this.currentInput;
|
|
3751
|
+
}
|
|
3752
|
+
getCandidates() {
|
|
3753
|
+
return this.candidates;
|
|
3754
|
+
}
|
|
3755
|
+
}, Yh = class {
|
|
3756
|
+
constructor(g, w = {}) {
|
|
3757
|
+
he(this, "canvas");
|
|
3758
|
+
he(this, "ctx");
|
|
3759
|
+
he(this, "lastX", 0);
|
|
3760
|
+
he(this, "lastY", 0);
|
|
3761
|
+
he(this, "strokeData", []);
|
|
3762
|
+
he(this, "clearTimerId", null);
|
|
3763
|
+
he(this, "isDrawing", !1);
|
|
3764
|
+
he(this, "options");
|
|
3765
|
+
he(this, "handleStart", (g) => {
|
|
3766
|
+
g.preventDefault(), this.isDrawing = !0;
|
|
3767
|
+
const { offsetX: w, offsetY: E } = this.getEventCoordinates(g);
|
|
3768
|
+
this.startDrawing(w, E), this.resetClearTimer();
|
|
3769
|
+
});
|
|
3770
|
+
he(this, "handleMove", (g) => {
|
|
3771
|
+
if (!this.isDrawing) return;
|
|
3772
|
+
g.preventDefault();
|
|
3773
|
+
const { offsetX: w, offsetY: E } = this.getEventCoordinates(g);
|
|
3774
|
+
this.draw(w, E), this.resetClearTimer();
|
|
3775
|
+
});
|
|
3776
|
+
he(this, "handleEnd", (g) => {
|
|
3777
|
+
this.isDrawing && (g.preventDefault(), this.isDrawing = !1, this.endStroke(), this.startClearTimer(), this.options.onDrawEnd && this.options.onDrawEnd());
|
|
3778
|
+
});
|
|
3779
|
+
this.canvas = g, this.options = {
|
|
3780
|
+
clearDelay: 1e3,
|
|
3781
|
+
...w
|
|
3782
|
+
};
|
|
3783
|
+
const E = this.canvas.getContext("2d");
|
|
3784
|
+
if (!E) throw new Error("Failed to get 2D rendering context");
|
|
3785
|
+
this.ctx = E, this.setupCanvas(), this.attachEvents();
|
|
3786
|
+
}
|
|
3787
|
+
setupCanvas() {
|
|
3788
|
+
this.ctx.lineJoin = "round", this.ctx.lineCap = "round", this.ctx.lineWidth = 3, this.ctx.strokeStyle = "#000", this.clearCanvas(), this.drawGrid();
|
|
3789
|
+
}
|
|
3790
|
+
drawGrid() {
|
|
3791
|
+
const g = this.canvas.width, w = this.canvas.height;
|
|
3792
|
+
this.ctx.save(), this.ctx.strokeStyle = "#ddd", this.ctx.lineWidth = 1, this.ctx.setLineDash([3, 3]), this.ctx.beginPath(), this.ctx.moveTo(0, w / 2), this.ctx.lineTo(g, w / 2), this.ctx.moveTo(g / 2, 0), this.ctx.lineTo(g / 2, w), this.ctx.stroke(), this.ctx.setLineDash([]), this.ctx.beginPath(), this.ctx.rect(0, 0, g, w), this.ctx.stroke(), this.ctx.restore();
|
|
3793
|
+
}
|
|
3794
|
+
clearCanvas() {
|
|
3795
|
+
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height), this.drawGrid(), this.strokeData = [], this.resetClearTimer();
|
|
3796
|
+
}
|
|
3797
|
+
startDrawing(g, w) {
|
|
3798
|
+
this.lastX = g, this.lastY = w, this.ctx.strokeStyle = "#000", this.ctx.lineWidth = 3, this.ctx.setLineDash([]), this.strokeData.push(g, w, 0);
|
|
3799
|
+
}
|
|
3800
|
+
draw(g, w) {
|
|
3801
|
+
this.ctx.beginPath(), this.ctx.moveTo(this.lastX, this.lastY), this.ctx.lineTo(g, w), this.ctx.stroke(), this.lastX = g, this.lastY = w, this.strokeData.push(g, w, 0);
|
|
3802
|
+
}
|
|
3803
|
+
endStroke() {
|
|
3804
|
+
this.strokeData.length >= 3 && (this.strokeData[this.strokeData.length - 1] = 1);
|
|
3805
|
+
}
|
|
3806
|
+
getStrokeData() {
|
|
3807
|
+
return this.strokeData;
|
|
3808
|
+
}
|
|
3809
|
+
resetClearTimer() {
|
|
3810
|
+
this.clearTimerId && (window.clearTimeout(this.clearTimerId), this.clearTimerId = null);
|
|
3811
|
+
}
|
|
3812
|
+
startClearTimer() {
|
|
3813
|
+
this.resetClearTimer(), this.clearTimerId = window.setTimeout(() => {
|
|
3814
|
+
this.clearCanvas(), this.clearTimerId = null;
|
|
3815
|
+
}, this.options.clearDelay);
|
|
3816
|
+
}
|
|
3817
|
+
getEventCoordinates(g) {
|
|
3818
|
+
if (g instanceof MouseEvent) return {
|
|
3819
|
+
offsetX: g.offsetX,
|
|
3820
|
+
offsetY: g.offsetY
|
|
3821
|
+
};
|
|
3822
|
+
{
|
|
3823
|
+
const w = g.touches[0] || g.changedTouches[0], E = g.target.getBoundingClientRect();
|
|
3824
|
+
return {
|
|
3825
|
+
offsetX: w.clientX - E.left,
|
|
3826
|
+
offsetY: w.clientY - E.top
|
|
3827
|
+
};
|
|
3828
|
+
}
|
|
3829
|
+
}
|
|
3830
|
+
attachEvents() {
|
|
3831
|
+
this.canvas.addEventListener("mousedown", this.handleStart), this.canvas.addEventListener("mousemove", this.handleMove), this.canvas.addEventListener("mouseup", this.handleEnd), this.canvas.addEventListener("mouseleave", this.handleEnd), this.canvas.addEventListener("touchstart", this.handleStart, { passive: !1 }), this.canvas.addEventListener("touchmove", this.handleMove, { passive: !1 }), this.canvas.addEventListener("touchend", this.handleEnd), this.canvas.addEventListener("touchcancel", this.handleEnd);
|
|
3832
|
+
}
|
|
3833
|
+
detachEvents() {
|
|
3834
|
+
this.canvas.removeEventListener("mousedown", this.handleStart), this.canvas.removeEventListener("mousemove", this.handleMove), this.canvas.removeEventListener("mouseup", this.handleEnd), this.canvas.removeEventListener("mouseleave", this.handleEnd), this.canvas.removeEventListener("touchstart", this.handleStart), this.canvas.removeEventListener("touchmove", this.handleMove), this.canvas.removeEventListener("touchend", this.handleEnd), this.canvas.removeEventListener("touchcancel", this.handleEnd);
|
|
3835
|
+
}
|
|
3836
|
+
destroy() {
|
|
3837
|
+
this.detachEvents(), this.resetClearTimer();
|
|
3838
|
+
}
|
|
3839
|
+
getCanvas() {
|
|
3840
|
+
return this.canvas;
|
|
3841
|
+
}
|
|
3842
|
+
getContext() {
|
|
3843
|
+
return this.ctx;
|
|
3844
|
+
}
|
|
3845
|
+
};
|
|
3846
|
+
function Xh(g, w, E) {
|
|
3847
|
+
if (!g || !w || E === "static") return null;
|
|
3848
|
+
let k, K;
|
|
3849
|
+
if (E === "bottom")
|
|
3850
|
+
k = window.innerHeight - w.offsetHeight, K = 0;
|
|
3851
|
+
else {
|
|
3852
|
+
const C = g.getBoundingClientRect(), O = w.offsetWidth;
|
|
3853
|
+
k = C.bottom + window.scrollY, K = C.left + window.scrollX + C.width / 2 - O / 2;
|
|
3854
|
+
const A = window.innerWidth;
|
|
3855
|
+
K + O > A && (K = A - O - 10), K < 10 && (K = 10);
|
|
3856
|
+
}
|
|
3857
|
+
return {
|
|
3858
|
+
top: `${k}px`,
|
|
3859
|
+
left: `${K}px`
|
|
3860
|
+
};
|
|
3861
|
+
}
|
|
3862
|
+
function Jr(g) {
|
|
3863
|
+
if (!g) return !1;
|
|
3864
|
+
if (g.tagName === "TEXTAREA") return !0;
|
|
3865
|
+
if (g.tagName === "INPUT") {
|
|
3866
|
+
const E = (g.type || "text").toLowerCase();
|
|
3867
|
+
return ![
|
|
3868
|
+
"checkbox",
|
|
3869
|
+
"radio",
|
|
3870
|
+
"button",
|
|
3871
|
+
"submit",
|
|
3872
|
+
"reset",
|
|
3873
|
+
"file",
|
|
3874
|
+
"image",
|
|
3875
|
+
"range",
|
|
3876
|
+
"color",
|
|
3877
|
+
"hidden",
|
|
3878
|
+
"date",
|
|
3879
|
+
"datetime-local",
|
|
3880
|
+
"month",
|
|
3881
|
+
"week",
|
|
3882
|
+
"time"
|
|
3883
|
+
].includes(E);
|
|
3884
|
+
}
|
|
3885
|
+
return !1;
|
|
3886
|
+
}
|
|
3887
|
+
function Gh(g, w, E) {
|
|
3888
|
+
g.value = w, ed(g, E), g.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
3889
|
+
}
|
|
3890
|
+
function Qh(g, w, E, k = "") {
|
|
3891
|
+
return g.slice(0, w) + k + g.slice(w + E);
|
|
3892
|
+
}
|
|
3893
|
+
function ui(g, w = "") {
|
|
3894
|
+
const E = Number(g.getAttribute("maxlength"));
|
|
3895
|
+
let k = g.selectionStart ?? 0;
|
|
3896
|
+
const K = g.selectionEnd ?? k;
|
|
3897
|
+
let C;
|
|
3898
|
+
if (w.length > 0) C = K - k;
|
|
3899
|
+
else {
|
|
3900
|
+
const R = K - k;
|
|
3901
|
+
if (R > 0) C = R;
|
|
3902
|
+
else if (k > 0)
|
|
3903
|
+
C = 1, k--;
|
|
3904
|
+
else return;
|
|
3905
|
+
}
|
|
3906
|
+
if (w.length > 0 && E && g.value.length - C + w.length > E) return;
|
|
3907
|
+
const O = Qh(g.value, k, C, w), A = k + w.length;
|
|
3908
|
+
Gh(g, O, A);
|
|
3909
|
+
}
|
|
3910
|
+
function Zh(g, w) {
|
|
3911
|
+
ui(g, w);
|
|
3912
|
+
}
|
|
3913
|
+
function Jh(g) {
|
|
3914
|
+
ui(g);
|
|
3915
|
+
}
|
|
3916
|
+
function ed(g, w) {
|
|
3917
|
+
g.selectionStart = w, g.selectionEnd = w;
|
|
3918
|
+
}
|
|
3919
|
+
let ci = null;
|
|
3920
|
+
function mv(g) {
|
|
3921
|
+
ci = g;
|
|
3922
|
+
}
|
|
3923
|
+
function lr() {
|
|
3924
|
+
return ci;
|
|
3925
|
+
}
|
|
3926
|
+
function td(g = !1) {
|
|
3927
|
+
const w = de(!1);
|
|
3928
|
+
async function E() {
|
|
3929
|
+
const K = lr();
|
|
3930
|
+
if (K)
|
|
3931
|
+
try {
|
|
3932
|
+
w.value = await K.initialize();
|
|
3933
|
+
} catch (C) {
|
|
3934
|
+
console.error("初始化手写识别服务失败:", C), w.value = !1;
|
|
3935
|
+
}
|
|
3936
|
+
else
|
|
3937
|
+
console.warn("未注册手写识别服务"), w.value = !1;
|
|
3938
|
+
}
|
|
3939
|
+
async function k() {
|
|
3940
|
+
const K = lr();
|
|
3941
|
+
if (K && w.value)
|
|
3942
|
+
try {
|
|
3943
|
+
await K.close(), w.value = !1;
|
|
3944
|
+
} catch (C) {
|
|
3945
|
+
console.error("关闭手写识别服务失败:", C);
|
|
3946
|
+
}
|
|
3947
|
+
}
|
|
3948
|
+
return mn(() => {
|
|
3949
|
+
g && E();
|
|
3950
|
+
}), ti(() => {
|
|
3951
|
+
k();
|
|
3952
|
+
}), {
|
|
3953
|
+
recognizerInitialized: w
|
|
3954
|
+
};
|
|
3955
|
+
}
|
|
3956
|
+
const dr = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M21,11H6.83L10.41,7.41L9,6L3,12L9,18L10.41,16.58L6.83,13H21V11Z'%20/%3e%3c/svg%3e", vr = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M19,7V11H5.83L9.41,7.41L8,6L2,12L8,18L9.41,16.58L5.83,13H21V7H19Z'%20/%3e%3c/svg%3e", nd = { class: "zhk-candidate-list" }, rd = ["onClick"], li = /* @__PURE__ */ He({
|
|
3957
|
+
__name: "CandidateList",
|
|
3958
|
+
props: {
|
|
3959
|
+
candidates: {}
|
|
3960
|
+
},
|
|
3961
|
+
emits: ["select"],
|
|
3962
|
+
setup(g, { emit: w }) {
|
|
3963
|
+
const E = w;
|
|
3964
|
+
function k(K) {
|
|
3965
|
+
E("select", K);
|
|
3966
|
+
}
|
|
3967
|
+
return (K, C) => (Y(), Z("div", nd, [
|
|
3968
|
+
(Y(!0), Z(ke, null, Te(K.candidates, (O, A) => (Y(), Z("button", {
|
|
3969
|
+
key: `candidate-${A}`,
|
|
3970
|
+
class: "zhk-candidate-list__item",
|
|
3971
|
+
onClick: (R) => k(O)
|
|
3972
|
+
}, Ce(O), 9, rd))), 128))
|
|
3973
|
+
]));
|
|
3974
|
+
}
|
|
3975
|
+
}), id = { class: "handwriting-input" }, ad = { class: "handwriting-buttons" }, od = { class: "handwriting-canvas-container" }, sd = ["width", "height"], ud = { class: "handwriting-buttons" }, cd = /* @__PURE__ */ He({
|
|
3976
|
+
__name: "HandwritingInput",
|
|
3977
|
+
emits: ["key", "exit"],
|
|
3978
|
+
setup(g, { emit: w }) {
|
|
3979
|
+
const E = w, k = de(null), K = de(null);
|
|
3980
|
+
let C = null;
|
|
3981
|
+
const O = de(!1), { height: A } = si(K);
|
|
3982
|
+
function R() {
|
|
3983
|
+
C && C.clearCanvas();
|
|
3984
|
+
}
|
|
3985
|
+
function H() {
|
|
3986
|
+
k.value && (C && C.destroy(), C = new Yh(k.value, {
|
|
3987
|
+
onDrawEnd: B
|
|
3988
|
+
}));
|
|
3989
|
+
}
|
|
3990
|
+
const L = de([]);
|
|
3991
|
+
async function B() {
|
|
3992
|
+
if (!C || C.getStrokeData().length === 0 || O.value)
|
|
3993
|
+
return;
|
|
3994
|
+
const ee = lr();
|
|
3995
|
+
if (ee) {
|
|
3996
|
+
O.value = !0;
|
|
3997
|
+
try {
|
|
3998
|
+
const M = [...C.getStrokeData()], ie = await ee.recognize(M);
|
|
3999
|
+
L.value = ie;
|
|
4000
|
+
} catch (M) {
|
|
4001
|
+
console.error("识别笔迹失败:", M);
|
|
4002
|
+
} finally {
|
|
4003
|
+
O.value = !1;
|
|
4004
|
+
}
|
|
4005
|
+
} else
|
|
4006
|
+
console.warn("手写识别服务不可用");
|
|
4007
|
+
}
|
|
4008
|
+
ti(() => {
|
|
4009
|
+
C && C.destroy();
|
|
4010
|
+
}), st(A, () => {
|
|
4011
|
+
k.value && fr(() => {
|
|
4012
|
+
H();
|
|
4013
|
+
});
|
|
4014
|
+
}), mn(() => {
|
|
4015
|
+
H();
|
|
4016
|
+
});
|
|
4017
|
+
function F(ee) {
|
|
4018
|
+
E("key", { key: ee }), L.value = [], R();
|
|
4019
|
+
}
|
|
4020
|
+
return (ee, M) => (Y(), Z("div", id, [
|
|
4021
|
+
ni(li, {
|
|
4022
|
+
candidates: L.value,
|
|
4023
|
+
onSelect: F
|
|
4024
|
+
}, null, 8, ["candidates"]),
|
|
4025
|
+
$("div", {
|
|
4026
|
+
ref_key: "containerRef",
|
|
4027
|
+
ref: K,
|
|
4028
|
+
class: "handwriting-content"
|
|
4029
|
+
}, [
|
|
4030
|
+
$("div", ad, [
|
|
4031
|
+
$("button", {
|
|
4032
|
+
class: "handwriting-btn handwriting-btn--function",
|
|
4033
|
+
onClick: M[0] || (M[0] = (ie) => E("key", { key: "。" }))
|
|
4034
|
+
}, " 。 "),
|
|
4035
|
+
$("button", {
|
|
4036
|
+
class: "handwriting-btn handwriting-btn--function",
|
|
4037
|
+
onClick: M[1] || (M[1] = (ie) => E("key", { key: "?" }))
|
|
4038
|
+
}, " ? "),
|
|
4039
|
+
$("button", {
|
|
4040
|
+
class: "handwriting-btn handwriting-btn--function",
|
|
4041
|
+
onClick: M[2] || (M[2] = (ie) => E("key", { key: "!" }))
|
|
4042
|
+
}, " ! "),
|
|
4043
|
+
$("button", {
|
|
4044
|
+
class: "handwriting-btn handwriting-btn--function",
|
|
4045
|
+
onClick: M[3] || (M[3] = (ie) => E("key", { key: "、" }))
|
|
4046
|
+
}, " 、 ")
|
|
4047
|
+
]),
|
|
4048
|
+
$("div", od, [
|
|
4049
|
+
$("canvas", {
|
|
4050
|
+
ref_key: "canvasRef",
|
|
4051
|
+
ref: k,
|
|
4052
|
+
class: "handwriting-canvas",
|
|
4053
|
+
width: Ve(A),
|
|
4054
|
+
height: Ve(A)
|
|
4055
|
+
}, null, 8, sd)
|
|
4056
|
+
]),
|
|
4057
|
+
$("div", ud, [
|
|
4058
|
+
$("button", {
|
|
4059
|
+
class: "handwriting-btn handwriting-btn--function",
|
|
4060
|
+
onClick: M[4] || (M[4] = (ie) => E("key", { key: "delete", isControl: !0 }))
|
|
4061
|
+
}, M[8] || (M[8] = [
|
|
4062
|
+
$("img", {
|
|
4063
|
+
src: dr,
|
|
4064
|
+
alt: "删除"
|
|
4065
|
+
}, null, -1)
|
|
4066
|
+
])),
|
|
4067
|
+
$("button", {
|
|
4068
|
+
class: "handwriting-btn handwriting-btn--function",
|
|
4069
|
+
onClick: M[5] || (M[5] = (ie) => E("exit"))
|
|
4070
|
+
}, " 返回 "),
|
|
4071
|
+
$("button", {
|
|
4072
|
+
class: "handwriting-btn handwriting-btn--function",
|
|
4073
|
+
onClick: M[6] || (M[6] = (ie) => E("key", { key: "," }))
|
|
4074
|
+
}, " , "),
|
|
4075
|
+
$("button", {
|
|
4076
|
+
class: "handwriting-btn handwriting-btn--function",
|
|
4077
|
+
onClick: M[7] || (M[7] = (ie) => E("key", { key: "enter", isControl: !0 }))
|
|
4078
|
+
}, M[9] || (M[9] = [
|
|
4079
|
+
$("img", {
|
|
4080
|
+
src: vr,
|
|
4081
|
+
alt: "回车"
|
|
4082
|
+
}, null, -1)
|
|
4083
|
+
]))
|
|
4084
|
+
])
|
|
4085
|
+
], 512)
|
|
4086
|
+
]));
|
|
4087
|
+
}
|
|
4088
|
+
}), ld = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M6,18H18V16H6M12,8.41L16.59,13L18,11.58L12,5.58L6,11.58L7.41,13L12,8.41Z'%20/%3e%3c/svg%3e", fi = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M3%2015H5V19H19V15H21V19C21%2020.1%2020.1%2021%2019%2021H5C3.9%2021%203%2020.1%203%2019V15Z'%20/%3e%3c/svg%3e", fd = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z'%20/%3e%3c/svg%3e", hd = { class: "zhk-selection" }, dd = { class: "zhk-selection__list" }, vd = ["onClick"], pd = /* @__PURE__ */ He({
|
|
4089
|
+
__name: "CandidateSelection",
|
|
4090
|
+
props: {
|
|
4091
|
+
candidates: {}
|
|
4092
|
+
},
|
|
4093
|
+
emits: ["select", "close"],
|
|
4094
|
+
setup(g, { emit: w }) {
|
|
4095
|
+
const E = w;
|
|
4096
|
+
function k(C) {
|
|
4097
|
+
E("select", C);
|
|
4098
|
+
}
|
|
4099
|
+
function K() {
|
|
4100
|
+
E("close");
|
|
4101
|
+
}
|
|
4102
|
+
return (C, O) => (Y(), Z("div", hd, [
|
|
4103
|
+
$("div", dd, [
|
|
4104
|
+
(Y(!0), Z(ke, null, Te(C.candidates, (A, R) => (Y(), Z("div", {
|
|
4105
|
+
key: R,
|
|
4106
|
+
class: "zhk-selection__text",
|
|
4107
|
+
onClick: (H) => k(A)
|
|
4108
|
+
}, Ce(A), 9, vd))), 128))
|
|
4109
|
+
]),
|
|
4110
|
+
$("div", { class: "zhk-selection__func" }, [
|
|
4111
|
+
$("button", {
|
|
4112
|
+
class: "zhk-selection__func-btn",
|
|
4113
|
+
onClick: K
|
|
4114
|
+
}, " 返回 ")
|
|
4115
|
+
])
|
|
4116
|
+
]));
|
|
4117
|
+
}
|
|
4118
|
+
}), yd = { class: "zhk-candidate" }, md = { class: "zhk-candidate__container" }, gd = {
|
|
4119
|
+
key: 0,
|
|
4120
|
+
class: "zhk-candidate__pinyin"
|
|
4121
|
+
}, bd = { class: "zhk-candidate__bottom-container" }, _d = /* @__PURE__ */ He({
|
|
4122
|
+
__name: "CandidateBar",
|
|
4123
|
+
props: {
|
|
4124
|
+
modelValue: {
|
|
4125
|
+
required: !0
|
|
4126
|
+
},
|
|
4127
|
+
modelModifiers: {}
|
|
4128
|
+
},
|
|
4129
|
+
emits: /* @__PURE__ */ sr(["key", "input"], ["update:modelValue"]),
|
|
4130
|
+
setup(g, { emit: w }) {
|
|
4131
|
+
const E = w, k = ri(g, "modelValue"), K = new Uh(), C = de([]);
|
|
4132
|
+
hr(async () => {
|
|
4133
|
+
C.value = await K.processInput(k.value);
|
|
4134
|
+
});
|
|
4135
|
+
const O = be(() => C.value.slice(0, 30)), A = de(!1);
|
|
4136
|
+
function R(H) {
|
|
4137
|
+
K.selectCandidate(H), E("input", H), k.value = "", A.value = !1;
|
|
4138
|
+
}
|
|
4139
|
+
return (H, L) => (Y(), Z("div", yd, [
|
|
4140
|
+
$("div", md, [
|
|
4141
|
+
k.value ? (Y(), Z("div", gd, Ce(k.value), 1)) : bt("", !0),
|
|
4142
|
+
$("div", bd, [
|
|
4143
|
+
C.value.length > 0 ? (Y(), ot(li, {
|
|
4144
|
+
key: 0,
|
|
4145
|
+
candidates: O.value,
|
|
4146
|
+
onSelect: R
|
|
4147
|
+
}, null, 8, ["candidates"])) : bt("", !0),
|
|
4148
|
+
C.value.length > 0 ? (Y(), Z("button", {
|
|
4149
|
+
key: 1,
|
|
4150
|
+
class: "zhk-candidate__more",
|
|
4151
|
+
onClick: L[0] || (L[0] = (B) => A.value = !0)
|
|
4152
|
+
}, L[2] || (L[2] = [
|
|
4153
|
+
$("img", {
|
|
4154
|
+
src: fd,
|
|
4155
|
+
alt: "更多"
|
|
4156
|
+
}, null, -1)
|
|
4157
|
+
]))) : bt("", !0)
|
|
4158
|
+
])
|
|
4159
|
+
]),
|
|
4160
|
+
ii(ni(pd, {
|
|
4161
|
+
candidates: C.value,
|
|
4162
|
+
onSelect: R,
|
|
4163
|
+
onClose: L[1] || (L[1] = (B) => A.value = !1)
|
|
4164
|
+
}, null, 8, ["candidates"]), [
|
|
4165
|
+
[ai, A.value]
|
|
4166
|
+
])
|
|
4167
|
+
]));
|
|
4168
|
+
}
|
|
4169
|
+
}), wd = { class: "zhk-base" }, kd = { class: "zhk-base__row" }, xd = ["onClick"], Cd = ["disabled"], Ed = {
|
|
4170
|
+
key: 1,
|
|
4171
|
+
src: ld,
|
|
4172
|
+
class: "zhk-base__key-icon",
|
|
4173
|
+
alt: "Shift"
|
|
4174
|
+
}, Od = ["onClick"], Sd = { class: "zhk-base__row" }, Pd = { class: "zhk-base__toggle-main" }, Kd = { class: "zhk-base__toggle-sub" }, Dd = /* @__PURE__ */ He({
|
|
4175
|
+
__name: "KeyboardBase",
|
|
4176
|
+
props: /* @__PURE__ */ sr({
|
|
4177
|
+
recognizerInitialized: { type: Boolean },
|
|
4178
|
+
enableHandwriting: { type: Boolean }
|
|
4179
|
+
}, {
|
|
4180
|
+
modelValue: {
|
|
4181
|
+
default: "en"
|
|
4182
|
+
},
|
|
4183
|
+
modelModifiers: {}
|
|
4184
|
+
}),
|
|
4185
|
+
emits: /* @__PURE__ */ sr(["key"], ["update:modelValue"]),
|
|
4186
|
+
setup(g, { emit: w }) {
|
|
4187
|
+
const E = g, k = w, K = ri(g, "modelValue"), C = de(!1), O = be(() => K.value === "zh"), A = be(() => O.value ? !0 : C.value);
|
|
4188
|
+
function R(ge, W = !1) {
|
|
4189
|
+
k("key", { key: ge, isControl: W });
|
|
4190
|
+
}
|
|
4191
|
+
function H() {
|
|
4192
|
+
O.value ? K.value = "hand" : C.value = !C.value;
|
|
4193
|
+
}
|
|
4194
|
+
function L() {
|
|
4195
|
+
K.value = "num";
|
|
4196
|
+
}
|
|
4197
|
+
function B() {
|
|
4198
|
+
K.value = "symbol";
|
|
4199
|
+
}
|
|
4200
|
+
const F = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"], ee = [
|
|
4201
|
+
["q", "w", "e", "r", "t", "y", "u", "i", "o", "p"],
|
|
4202
|
+
["a", "s", "d", "f", "g", "h", "j", "k", "l"],
|
|
4203
|
+
["z", "x", "c", "v", "b", "n", "m"]
|
|
4204
|
+
], M = de("");
|
|
4205
|
+
function ie() {
|
|
4206
|
+
if (K.value === "zh" && M.value) {
|
|
4207
|
+
M.value = M.value.slice(0, -1);
|
|
4208
|
+
return;
|
|
4209
|
+
}
|
|
4210
|
+
R("delete", !0);
|
|
4211
|
+
}
|
|
4212
|
+
function je(ge) {
|
|
4213
|
+
if (K.value === "zh") {
|
|
4214
|
+
M.value += ge;
|
|
4215
|
+
return;
|
|
4216
|
+
}
|
|
4217
|
+
const W = C.value ? ge.toUpperCase() : ge;
|
|
4218
|
+
R(W);
|
|
4219
|
+
}
|
|
4220
|
+
function Ie() {
|
|
4221
|
+
K.value = K.value === "zh" ? "en" : "zh";
|
|
4222
|
+
}
|
|
4223
|
+
const Re = be(() => E.enableHandwriting ? E.recognizerInitialized ? "手写" : "..." : "-"), Pe = be(() => !E.enableHandwriting || !E.recognizerInitialized);
|
|
4224
|
+
return (ge, W) => (Y(), Z("div", wd, [
|
|
4225
|
+
$("div", kd, [
|
|
4226
|
+
K.value === "zh" ? (Y(), ot(_d, {
|
|
4227
|
+
key: 0,
|
|
4228
|
+
modelValue: M.value,
|
|
4229
|
+
"onUpdate:modelValue": W[0] || (W[0] = (ne) => M.value = ne),
|
|
4230
|
+
onInput: W[1] || (W[1] = (ne) => R(ne, !1))
|
|
4231
|
+
}, null, 8, ["modelValue"])) : (Y(), Z(ke, { key: 1 }, Te(F, (ne, se) => $("button", {
|
|
4232
|
+
key: `number-${se}`,
|
|
4233
|
+
class: "zhk-base__key zhk-base__key--letter",
|
|
4234
|
+
onClick: (We) => je(ne)
|
|
4235
|
+
}, Ce(ne), 9, xd)), 64))
|
|
4236
|
+
]),
|
|
4237
|
+
(Y(), Z(ke, null, Te(ee, (ne, se) => $("div", {
|
|
4238
|
+
key: `row-${se}`,
|
|
4239
|
+
class: "zhk-base__row"
|
|
4240
|
+
}, [
|
|
4241
|
+
se === 2 ? (Y(), Z("button", {
|
|
4242
|
+
key: 0,
|
|
4243
|
+
class: Rt(["zhk-base__key zhk-base__key--function zhk-base__key--shift", {
|
|
4244
|
+
"zhk-base__key--active": !O.value && C.value,
|
|
4245
|
+
"zhk-base__key--disabled": O.value && Pe.value
|
|
4246
|
+
}]),
|
|
4247
|
+
disabled: O.value && Pe.value,
|
|
4248
|
+
onClick: H
|
|
4249
|
+
}, [
|
|
4250
|
+
O.value ? (Y(), Z(ke, { key: 0 }, [
|
|
4251
|
+
ur(Ce(Re.value), 1)
|
|
4252
|
+
], 64)) : (Y(), Z("img", Ed))
|
|
4253
|
+
], 10, Cd)) : bt("", !0),
|
|
4254
|
+
(Y(!0), Z(ke, null, Te(ne, (We, bn) => (Y(), Z("button", {
|
|
4255
|
+
key: `key-${se}-${bn}`,
|
|
4256
|
+
class: "zhk-base__key zhk-base__key--letter",
|
|
4257
|
+
onClick: (_n) => je(We)
|
|
4258
|
+
}, Ce(A.value ? We.toUpperCase() : We), 9, Od))), 128)),
|
|
4259
|
+
se === 2 ? (Y(), Z("button", {
|
|
4260
|
+
key: 1,
|
|
4261
|
+
class: "zhk-base__key zhk-base__key--function zhk-base__key--delete",
|
|
4262
|
+
onClick: W[2] || (W[2] = () => ie())
|
|
4263
|
+
}, W[7] || (W[7] = [
|
|
4264
|
+
$("img", {
|
|
4265
|
+
src: dr,
|
|
4266
|
+
class: "zhk-base__key-icon",
|
|
4267
|
+
alt: "Delete"
|
|
4268
|
+
}, null, -1)
|
|
4269
|
+
]))) : bt("", !0)
|
|
4270
|
+
])), 64)),
|
|
4271
|
+
$("div", Sd, [
|
|
4272
|
+
$("button", {
|
|
4273
|
+
class: "zhk-base__key zhk-base__key--function",
|
|
4274
|
+
onClick: B
|
|
4275
|
+
}, " 符 "),
|
|
4276
|
+
$("button", {
|
|
4277
|
+
class: "zhk-base__key zhk-base__key--function",
|
|
4278
|
+
onClick: L
|
|
4279
|
+
}, " 123 "),
|
|
4280
|
+
$("button", {
|
|
4281
|
+
class: "zhk-base__key",
|
|
4282
|
+
onClick: W[3] || (W[3] = () => R(","))
|
|
4283
|
+
}, " , "),
|
|
4284
|
+
$("button", {
|
|
4285
|
+
class: "zhk-base__key zhk-base__key--space",
|
|
4286
|
+
onClick: W[4] || (W[4] = () => R(" "))
|
|
4287
|
+
}, W[8] || (W[8] = [
|
|
4288
|
+
$("img", {
|
|
4289
|
+
src: fi,
|
|
4290
|
+
class: "zhk-base__key-icon",
|
|
4291
|
+
alt: "Space"
|
|
4292
|
+
}, null, -1)
|
|
4293
|
+
])),
|
|
4294
|
+
$("button", {
|
|
4295
|
+
class: "zhk-base__key",
|
|
4296
|
+
onClick: W[5] || (W[5] = () => R("。"))
|
|
4297
|
+
}, " 。 "),
|
|
4298
|
+
$("button", {
|
|
4299
|
+
class: "zhk-base__key zhk-base__key--function",
|
|
4300
|
+
onClick: Ie
|
|
4301
|
+
}, [
|
|
4302
|
+
$("span", Pd, Ce(K.value === "zh" ? "中" : "英"), 1),
|
|
4303
|
+
$("span", Kd, "/" + Ce(K.value === "zh" ? "英" : "中"), 1)
|
|
4304
|
+
]),
|
|
4305
|
+
$("button", {
|
|
4306
|
+
class: "zhk-base__key zhk-base__key--function",
|
|
4307
|
+
onClick: W[6] || (W[6] = () => R("enter", !0))
|
|
4308
|
+
}, W[9] || (W[9] = [
|
|
4309
|
+
$("img", {
|
|
4310
|
+
src: vr,
|
|
4311
|
+
class: "zhk-base__key-icon",
|
|
4312
|
+
alt: "Enter"
|
|
4313
|
+
}, null, -1)
|
|
4314
|
+
]))
|
|
4315
|
+
])
|
|
4316
|
+
]));
|
|
4317
|
+
}
|
|
4318
|
+
}), Ad = { class: "num-keyboard" }, zd = { class: "num-keyboard__container" }, Td = { class: "num-keyboard__left" }, jd = { class: "num-keyboard__rows" }, Id = ["onClick"], Rd = {
|
|
4319
|
+
key: 1,
|
|
4320
|
+
src: fi,
|
|
4321
|
+
class: "zhk-base__key-icon",
|
|
4322
|
+
alt: "Space"
|
|
4323
|
+
}, Bd = { class: "num-keyboard__right" }, qd = ["onClick"], Md = ["src", "alt"], Ld = { key: 1 }, Nd = /* @__PURE__ */ He({
|
|
4324
|
+
__name: "NumericKeyboard",
|
|
4325
|
+
emits: ["key", "exit"],
|
|
4326
|
+
setup(g, { emit: w }) {
|
|
4327
|
+
const E = w, k = [
|
|
4328
|
+
["1", "2", "3"],
|
|
4329
|
+
["4", "5", "6"],
|
|
4330
|
+
["7", "8", "9"],
|
|
4331
|
+
["back", "0", "space"]
|
|
4332
|
+
], K = [
|
|
4333
|
+
{ key: "delete", icon: dr, text: "", alt: "Delete" },
|
|
4334
|
+
{ key: ".", icon: "", text: ".", alt: "." },
|
|
4335
|
+
{ key: "@", icon: "", text: "@", alt: "@" },
|
|
4336
|
+
{ key: "enter", icon: vr, text: "", alt: "Enter" }
|
|
4337
|
+
];
|
|
4338
|
+
function C(R) {
|
|
4339
|
+
E("key", { key: R });
|
|
4340
|
+
}
|
|
4341
|
+
function O(R, H = !0) {
|
|
4342
|
+
E("key", { key: R, isControl: H });
|
|
4343
|
+
}
|
|
4344
|
+
function A() {
|
|
4345
|
+
E("exit");
|
|
4346
|
+
}
|
|
4347
|
+
return (R, H) => (Y(), Z("div", Ad, [
|
|
4348
|
+
$("div", zd, [
|
|
4349
|
+
$("div", Td, [
|
|
4350
|
+
$("div", jd, [
|
|
4351
|
+
(Y(), Z(ke, null, Te(k, (L, B) => $("div", {
|
|
4352
|
+
key: `row-${B}`,
|
|
4353
|
+
class: "num-keyboard__row"
|
|
4354
|
+
}, [
|
|
4355
|
+
(Y(!0), Z(ke, null, Te(L, (F, ee) => (Y(), Z("button", {
|
|
4356
|
+
key: `key-${B}-${ee}`,
|
|
4357
|
+
class: Rt(["num-keyboard__key", {
|
|
4358
|
+
"num-keyboard__key--back": F === "back",
|
|
4359
|
+
"num-keyboard__key--space": F === "space"
|
|
4360
|
+
}]),
|
|
4361
|
+
onClick: (M) => F === "back" ? A() : C(F === "space" ? " " : F)
|
|
4362
|
+
}, [
|
|
4363
|
+
F === "back" ? (Y(), Z(ke, { key: 0 }, [
|
|
4364
|
+
ur(" 返回 ")
|
|
4365
|
+
], 64)) : F === "space" ? (Y(), Z("img", Rd)) : (Y(), Z(ke, { key: 2 }, [
|
|
4366
|
+
ur(Ce(F), 1)
|
|
4367
|
+
], 64))
|
|
4368
|
+
], 10, Id))), 128))
|
|
4369
|
+
])), 64))
|
|
4370
|
+
])
|
|
4371
|
+
]),
|
|
4372
|
+
$("div", Bd, [
|
|
4373
|
+
(Y(), Z(ke, null, Te(K, (L, B) => $("button", {
|
|
4374
|
+
key: `func-${B}`,
|
|
4375
|
+
class: "num-keyboard__key num-keyboard__key--function",
|
|
4376
|
+
onClick: (F) => L.key === "." || L.key === "@" ? C(L.key) : O(L.key)
|
|
4377
|
+
}, [
|
|
4378
|
+
L.icon ? (Y(), Z("img", {
|
|
4379
|
+
key: 0,
|
|
4380
|
+
src: L.icon,
|
|
4381
|
+
class: "num-keyboard__key-icon",
|
|
4382
|
+
alt: L.alt
|
|
4383
|
+
}, null, 8, Md)) : (Y(), Z("span", Ld, Ce(L.text), 1))
|
|
4384
|
+
], 8, qd)), 64))
|
|
4385
|
+
])
|
|
4386
|
+
])
|
|
4387
|
+
]));
|
|
4388
|
+
}
|
|
4389
|
+
}), $d = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M18,20V10H6V20H18M18,8A2,2%200%200,1%2020,10V20A2,2%200%200,1%2018,22H6C4.89,22%204,21.1%204,20V10A2,2%200%200,1%206,8H15V6A3,3%200%200,0%2012,3A3,3%200%200,0%209,6H7A5,5%200%200,1%2012,1A5,5%200%200,1%2017,6V8H18M12,17A2,2%200%200,1%2010,15A2,2%200%200,1%2012,13A2,2%200%200,1%2014,15A2,2%200%200,1%2012,17Z'%20/%3e%3c/svg%3e", Fd = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M12,17C10.89,17%2010,16.1%2010,15C10,13.89%2010.89,13%2012,13A2,2%200%200,1%2014,15A2,2%200%200,1%2012,17M18,20V10H6V20H18M18,8A2,2%200%200,1%2020,10V20A2,2%200%200,1%2018,22H6C4.89,22%204,21.1%204,20V10C4,8.89%204.89,8%206,8H7V6A5,5%200%200,1%2012,1A5,5%200%200,1%2017,6V8H18M12,3A3,3%200%200,0%209,6V8H15V6A3,3%200%200,0%2012,3Z'%20/%3e%3c/svg%3e", Vd = { class: "symbol-keyboard" }, Hd = { class: "symbol-keyboard__content" }, Wd = { class: "symbol-keyboard__functions" }, Ud = { class: "symbol-keyboard__lang-selector" }, Yd = { class: "symbol-keyboard__control-group" }, Xd = ["src"], Gd = ["src"], Qd = { class: "symbol-keyboard__symbols-container" }, Zd = { class: "symbol-keyboard__symbols-grid" }, Jd = ["onClick"], ev = "!@#$%^&*(){}[]<>/\\|:;\"',.,?+-=_~`€£¥₹©®™°", tv = "!@#¥%…&*(){}[]<>/\|:;"',。?+-=_~·€£¥₹©®™°", nv = /* @__PURE__ */ He({
|
|
4390
|
+
__name: "SymbolKeyboard",
|
|
4391
|
+
emits: ["key", "exit"],
|
|
4392
|
+
setup(g, { emit: w }) {
|
|
4393
|
+
const E = w, k = de("en"), K = be(() => k.value === "zh" ? tv : ev), C = de(!1);
|
|
4394
|
+
function O(L) {
|
|
4395
|
+
E("key", { key: L }), C.value || E("exit");
|
|
4396
|
+
}
|
|
4397
|
+
function A() {
|
|
4398
|
+
E("exit");
|
|
4399
|
+
}
|
|
4400
|
+
function R(L) {
|
|
4401
|
+
k.value = L;
|
|
4402
|
+
}
|
|
4403
|
+
function H() {
|
|
4404
|
+
C.value = !C.value;
|
|
4405
|
+
}
|
|
4406
|
+
return (L, B) => (Y(), Z("div", Vd, [
|
|
4407
|
+
$("div", Hd, [
|
|
4408
|
+
$("div", Wd, [
|
|
4409
|
+
$("div", Ud, [
|
|
4410
|
+
$("button", {
|
|
4411
|
+
class: Rt(["symbol-keyboard__lang-btn", { "symbol-keyboard__lang-btn--active": k.value === "zh" }]),
|
|
4412
|
+
onClick: B[0] || (B[0] = (F) => R("zh"))
|
|
4413
|
+
}, " 中文 ", 2),
|
|
4414
|
+
$("button", {
|
|
4415
|
+
class: Rt(["symbol-keyboard__lang-btn", { "symbol-keyboard__lang-btn--active": k.value === "en" }]),
|
|
4416
|
+
onClick: B[1] || (B[1] = (F) => R("en"))
|
|
4417
|
+
}, " 英文 ", 2)
|
|
4418
|
+
]),
|
|
4419
|
+
$("div", Yd, [
|
|
4420
|
+
$("button", {
|
|
4421
|
+
class: Rt(["symbol-keyboard__key symbol-keyboard__key--function symbol-keyboard__key--lock", { "symbol-keyboard__key--locked": C.value }]),
|
|
4422
|
+
onClick: H
|
|
4423
|
+
}, [
|
|
4424
|
+
C.value ? (Y(), Z("img", {
|
|
4425
|
+
key: 1,
|
|
4426
|
+
src: Ve(Fd),
|
|
4427
|
+
alt: "Lock closed"
|
|
4428
|
+
}, null, 8, Gd)) : (Y(), Z("img", {
|
|
4429
|
+
key: 0,
|
|
4430
|
+
src: Ve($d),
|
|
4431
|
+
alt: "Lock open"
|
|
4432
|
+
}, null, 8, Xd))
|
|
4433
|
+
], 2),
|
|
4434
|
+
$("button", {
|
|
4435
|
+
class: "symbol-keyboard__key symbol-keyboard__key--function symbol-keyboard__key--back",
|
|
4436
|
+
onClick: A
|
|
4437
|
+
}, " 返回 ")
|
|
4438
|
+
])
|
|
4439
|
+
]),
|
|
4440
|
+
$("div", Qd, [
|
|
4441
|
+
$("div", Zd, [
|
|
4442
|
+
(Y(!0), Z(ke, null, Te(K.value, (F, ee) => (Y(), Z("button", {
|
|
4443
|
+
key: `key-${ee}`,
|
|
4444
|
+
class: "symbol-keyboard__key",
|
|
4445
|
+
onClick: (M) => O(F)
|
|
4446
|
+
}, Ce(F), 9, Jd))), 128))
|
|
4447
|
+
])
|
|
4448
|
+
])
|
|
4449
|
+
])
|
|
4450
|
+
]));
|
|
4451
|
+
}
|
|
4452
|
+
}), rv = {
|
|
4453
|
+
key: 0,
|
|
4454
|
+
class: "zhk__disabled-overlay"
|
|
4455
|
+
}, iv = /* @__PURE__ */ He({
|
|
4456
|
+
__name: "ZhKeyboard",
|
|
4457
|
+
props: {
|
|
4458
|
+
defaultMode: { default: "en" },
|
|
4459
|
+
enableHandwriting: { type: Boolean, default: !1 },
|
|
4460
|
+
position: { default: "static" },
|
|
4461
|
+
disableWhenNoFocus: { type: Boolean, default: !0 }
|
|
4462
|
+
},
|
|
4463
|
+
emits: ["key"],
|
|
4464
|
+
setup(g, { emit: w }) {
|
|
4465
|
+
const E = g, k = w, K = de(E.defaultMode || "en"), C = de(E.defaultMode || "en"), O = de([]), A = de(!1), R = de(null), H = de(null), { recognizerInitialized: L } = td(E.enableHandwriting);
|
|
4466
|
+
st(K, (W, ne) => {
|
|
4467
|
+
W !== ne && (C.value = ne);
|
|
4468
|
+
});
|
|
4469
|
+
const B = la(), F = be(() => B.value && Jr(B.value) ? B.value : null), ee = be(() => E.position === "static" || !!(B.value && Jr(B.value))), { height: M } = si(H);
|
|
4470
|
+
hr(() => {
|
|
4471
|
+
if (F.value) {
|
|
4472
|
+
const W = F.value.dataset.inputmode;
|
|
4473
|
+
W && (K.value = W);
|
|
4474
|
+
}
|
|
4475
|
+
}), st([ee, M, F], () => {
|
|
4476
|
+
ee.value && M.value && fr(() => {
|
|
4477
|
+
je();
|
|
4478
|
+
});
|
|
4479
|
+
});
|
|
4480
|
+
const ie = be(() => E.disableWhenNoFocus === !1 ? !1 : !F.value);
|
|
4481
|
+
function je() {
|
|
4482
|
+
if (!M.value)
|
|
4483
|
+
return;
|
|
4484
|
+
const W = Xh(
|
|
4485
|
+
F.value,
|
|
4486
|
+
H.value,
|
|
4487
|
+
E.position
|
|
4488
|
+
);
|
|
4489
|
+
R.value = W;
|
|
4490
|
+
}
|
|
4491
|
+
pn(window, "scroll", je, { passive: !0 }), pn(window, "resize", je, { passive: !0 });
|
|
4492
|
+
function Ie(W) {
|
|
4493
|
+
if (W.isControl) {
|
|
4494
|
+
switch (W.key) {
|
|
4495
|
+
case "delete":
|
|
4496
|
+
Jh(F.value);
|
|
4497
|
+
break;
|
|
4498
|
+
case "more":
|
|
4499
|
+
A.value = !0;
|
|
4500
|
+
break;
|
|
4501
|
+
}
|
|
4502
|
+
return;
|
|
4503
|
+
} else
|
|
4504
|
+
Re(W.key);
|
|
4505
|
+
k("key", W);
|
|
4506
|
+
}
|
|
4507
|
+
function Re(W) {
|
|
4508
|
+
Zh(F.value, W);
|
|
4509
|
+
}
|
|
4510
|
+
function Pe() {
|
|
4511
|
+
K.value = C.value;
|
|
4512
|
+
}
|
|
4513
|
+
function ge(W) {
|
|
4514
|
+
O.value = W;
|
|
4515
|
+
}
|
|
4516
|
+
return (W, ne) => (Y(), ot(Gi, {
|
|
4517
|
+
to: "body",
|
|
4518
|
+
disabled: W.position === "static"
|
|
4519
|
+
}, [
|
|
4520
|
+
ii($("div", Qi(W.$attrs, {
|
|
4521
|
+
ref_key: "keyboardRef",
|
|
4522
|
+
ref: H,
|
|
4523
|
+
class: ["zhk", {
|
|
4524
|
+
"zhk--floating": W.position === "float",
|
|
4525
|
+
"zhk--bottom": W.position === "bottom",
|
|
4526
|
+
"zhk--disabled": ie.value
|
|
4527
|
+
}],
|
|
4528
|
+
style: {
|
|
4529
|
+
"--keyboard-height": `${Ve(M)}px`,
|
|
4530
|
+
...R.value
|
|
4531
|
+
},
|
|
4532
|
+
onMousedown: ne[1] || (ne[1] = Zi(() => {
|
|
4533
|
+
}, ["prevent"]))
|
|
4534
|
+
}), [
|
|
4535
|
+
ie.value || !ee.value || !Ve(M) ? (Y(), Z("div", rv, ne[2] || (ne[2] = [
|
|
4536
|
+
$("span", null, "请选择输入框以启用键盘", -1)
|
|
4537
|
+
]))) : (Y(), Z(ke, { key: 1 }, [
|
|
4538
|
+
K.value === "hand" ? (Y(), ot(cd, {
|
|
4539
|
+
key: 0,
|
|
4540
|
+
onKey: Ie,
|
|
4541
|
+
onExit: Pe,
|
|
4542
|
+
onRecognize: ge
|
|
4543
|
+
})) : K.value === "num" ? (Y(), ot(Nd, {
|
|
4544
|
+
key: 1,
|
|
4545
|
+
onKey: Ie,
|
|
4546
|
+
onExit: Pe
|
|
4547
|
+
})) : K.value === "symbol" ? (Y(), ot(nv, {
|
|
4548
|
+
key: 2,
|
|
4549
|
+
onKey: Ie,
|
|
4550
|
+
onExit: Pe
|
|
4551
|
+
})) : K.value === "en" || K.value === "zh" ? (Y(), ot(Dd, {
|
|
4552
|
+
key: 3,
|
|
4553
|
+
modelValue: K.value,
|
|
4554
|
+
"onUpdate:modelValue": ne[0] || (ne[0] = (se) => K.value = se),
|
|
4555
|
+
"recognizer-initialized": Ve(L),
|
|
4556
|
+
"enable-handwriting": W.enableHandwriting,
|
|
4557
|
+
onKey: Ie
|
|
4558
|
+
}, null, 8, ["modelValue", "recognizer-initialized", "enable-handwriting"])) : bt("", !0)
|
|
4559
|
+
], 64))
|
|
4560
|
+
], 16), [
|
|
4561
|
+
[ai, ee.value]
|
|
4562
|
+
])
|
|
4563
|
+
], 8, ["disabled"]));
|
|
4564
|
+
}
|
|
4565
|
+
}), gv = {
|
|
4566
|
+
install: (g) => {
|
|
4567
|
+
g.component("ZhKeyboard", iv);
|
|
4568
|
+
}
|
|
4569
|
+
};
|
|
4570
|
+
export {
|
|
4571
|
+
iv as ZhKeyboard,
|
|
4572
|
+
gv as default,
|
|
4573
|
+
lr as getHandwritingRecognizer,
|
|
4574
|
+
mv as registerHandwritingRecognizer
|
|
4575
|
+
};
|
|
4576
|
+
//# sourceMappingURL=zh-keyboard-vue.js.map
|