@wisemen/wise-crm-web 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ActivityIcon-DNdtN-M_.js +19 -0
- package/dist/AppSkeletonLoader-Dq6pKznm.js +1112 -0
- package/dist/{AttachmentIcon-CsucE3yf.js → AttachmentIcon-BLUd7LaN.js} +9 -7
- package/dist/BoldIcon-WRYUWz15.js +16 -0
- package/dist/{BookIcon-DgT3flV5.js → BookIcon-Bb3r5y_J.js} +9 -7
- package/dist/{BuildingIcon-Bm18omgW.js → BuildingIcon-DFutRg8d.js} +9 -7
- package/dist/{BuildingsIcon-D4X7QciL.js → BuildingsIcon-BVHy6yoa.js} +9 -7
- package/dist/{BulletListIcon-CNCV-cOS.js → BulletListIcon-BhOXLSBa.js} +9 -7
- package/dist/BusinessDetailSidebarProvider-a6VeNUii.js +2946 -0
- package/dist/BusinessDetailView-Dz3wDSx5.js +24 -0
- package/dist/ChevronDownIcon-BmyTSPND.js +19 -0
- package/dist/ClockIcon-BYfZAvIE.js +23 -0
- package/dist/ClockPlusIcon-BcNi0Y9I.js +23 -0
- package/dist/{CopyIcon-CUomKXdn.js → CopyIcon-2eV8MRv_.js} +9 -7
- package/dist/CrmDetailHeaderCard-BkA0Z-Cu.js +2523 -0
- package/dist/CrmDetailView-BhZEQqUH.js +67 -0
- package/dist/DealCommunicationTabView-Drp9MEPu.js +140 -0
- package/dist/DealDetailView-DWLudchX.js +1049 -0
- package/dist/DealExternalAttachment-B6l0gDqF.js +179 -0
- package/dist/{DealIcon-CpO-DkyS.js → DealIcon-BwUWYDxo.js} +9 -7
- package/dist/DealSendMailDialog-Dqei4933.js +1566 -0
- package/dist/DownloadCloudIcon-BSrLGGrY.js +19 -0
- package/dist/{EditWithLineIcon-C0WMD50F.js → EditWithLineIcon-BKYDPJOY.js} +9 -7
- package/dist/{Error-X0deDY-N.js → Error-za-wClcU.js} +2591 -2462
- package/dist/{FileIcon-3FebXgYQ.js → FileIcon-DL1e1tAu.js} +9 -7
- package/dist/FilterLinesIcon-DgVMySAE.js +22 -0
- package/dist/H1Icon-B6NEsEbj.js +17 -0
- package/dist/{H2Icon-CuEmp9I0.js → H2Icon-CNof5Ohu.js} +9 -7
- package/dist/{H3Icon-wAPhdYIf.js → H3Icon-B2F2Tb6r.js} +9 -7
- package/dist/HashIcon-C_XttKfW.js +19 -0
- package/dist/HomeFilledIcon-DtZ2eXxt.js +16 -0
- package/dist/IndividualDetailSidebarProvider-jjRoK1Av.js +609 -0
- package/dist/IndividualDetailView-BqIRHn-0.js +24 -0
- package/dist/ItalicIcon-DqBns3yy.js +17 -0
- package/dist/{LayersTreeIcon-Ct-owndO.js → LayersTreeIcon-DZZCSCY9.js} +10 -8
- package/dist/{LinkBrokenIcon-CTlqmapl.js → LinkBrokenIcon-BNBpWSi7.js} +9 -7
- package/dist/{LinkExternalIcon-LOVtSqBT.js → LinkExternalIcon-B7SHeB1_.js} +9 -7
- package/dist/LinkIcon-8bCrZEv9.js +17 -0
- package/dist/{LocationPinIcon-Cp-wRgk2.js → LocationPinIcon-UySRqSfG.js} +9 -7
- package/dist/{MailIcon-CnTrB1k3.js → MailIcon-BT7gSIZb.js} +9 -7
- package/dist/{MobilePhoneIcon-B747hmpS.js → MobilePhoneIcon-_KQGnCSS.js} +9 -7
- package/dist/NumberedListIcon-B-JVTSAe.js +17 -0
- package/dist/{PhoneIcon-94MYVL85.js → PhoneIcon-DGGW_MNR.js} +9 -7
- package/dist/{RefreshIcon-DRe3coBc.js → RefreshIcon-D1QWfdPD.js} +9 -7
- package/dist/{SendIcon-MYItp1xI.js → SendIcon-BtJ-NCec.js} +9 -7
- package/dist/{SettingsIcon-C0qTAv0w.js → SettingsIcon-CWFwJelS.js} +10 -8
- package/dist/{StarOutlineIcon-CiFLgepk.js → StarOutlineIcon-C-ELTCDQ.js} +9 -7
- package/dist/{StarYellowIcon-C0v_XGwI.js → StarYellowIcon-7wuNWaQO.js} +9 -7
- package/dist/{ThreeDotsIcon-lujOTU3G.js → ThreeDotsIcon-C56RWk-0.js} +12 -10
- package/dist/TimeLineMarkerIcon-DLmPwfs6.js +18 -0
- package/dist/{TrashIcon-v4L9SEK_.js → TrashIcon-o4PWmcYe.js} +9 -7
- package/dist/UploadCloudIcon-D2tWB0NP.js +19 -0
- package/dist/{UserCircleIcon-BjUt_2C4.js → UserCircleIcon-DiDajcIH.js} +10 -8
- package/dist/UserIcon-Bv1eF7ln.js +22 -0
- package/dist/{VerticalDotsIcon-Y3m6tlQ2.js → VerticalDotsIcon-YcD73UqY.js} +9 -7
- package/dist/{WalletIcon-pPsKbzmh.js → WalletIcon-CUh92U5K.js} +9 -7
- package/dist/_plugin-vue_export-helper-D3hKq4w_.js +8 -0
- package/dist/client-9P6xe_5g.js +4188 -0
- package/dist/components/auto-focus/AutoFocus.vue.d.ts +13 -0
- package/dist/components/column-layout/ColumnLayout.vue.d.ts +1 -1
- package/dist/components/row-layout/RowLayout.vue.d.ts +1 -1
- package/dist/components/text/Text.vue.d.ts +1 -1
- package/dist/index.js +1881 -1693
- package/dist/style.css +2 -2
- package/dist/testing.js +102 -98
- package/dist/utils/color.util.d.ts +6 -0
- package/dist/{uuid.util-C1p-yuFc.js → uuid.util-DpiDKVoj.js} +4 -2
- package/package.json +30 -30
- package/dist/ActivityIcon-DFD9ZhO0.js +0 -17
- package/dist/AppSkeletonLoader-BAhoOmFD.js +0 -1106
- package/dist/BoldIcon-DY2FlAS0.js +0 -14
- package/dist/BusinessDetailSidebarProvider-Dm6Dd7Nq.js +0 -2899
- package/dist/BusinessDetailView-BHVUfCpV.js +0 -24
- package/dist/ChevronDownIcon-CfBAAAca.js +0 -17
- package/dist/ClockIcon-Ckr1IQBt.js +0 -21
- package/dist/ClockPlusIcon-CVN69pCS.js +0 -21
- package/dist/CrmDetailHeaderCard-CiVLyIuw.js +0 -2516
- package/dist/CrmDetailView-DaAuWeiB.js +0 -65
- package/dist/DealCommunicationTabView-xq_zOAsr.js +0 -137
- package/dist/DealDetailView-C54XpYN1.js +0 -1021
- package/dist/DealExternalAttachment-Dp44vkgt.js +0 -177
- package/dist/DealSendMailDialog-D11Tgd_A.js +0 -1552
- package/dist/DownloadCloudIcon-VMmB9vit.js +0 -17
- package/dist/FilterLinesIcon-DHpRPKJB.js +0 -20
- package/dist/H1Icon-CPVGTTtl.js +0 -15
- package/dist/HashIcon-C2kfHjTC.js +0 -17
- package/dist/HomeFilledIcon-CxIazF0B.js +0 -14
- package/dist/IndividualDetailSidebarProvider-BvjhFng9.js +0 -608
- package/dist/IndividualDetailView-Cq8iAwQv.js +0 -24
- package/dist/ItalicIcon-DfV3EOdk.js +0 -15
- package/dist/LinkIcon-DqBbVrvs.js +0 -15
- package/dist/NumberedListIcon-amJxDaaD.js +0 -15
- package/dist/TimeLineMarkerIcon-C4LfErbc.js +0 -16
- package/dist/UploadCloudIcon-j1-1Rvqb.js +0 -17
- package/dist/UserIcon-Cb2jFKLr.js +0 -20
- package/dist/_plugin-vue_export-helper-BSi1g3Lh.js +0 -6
- package/dist/client-S6BLV3Ct.js +0 -4191
|
@@ -1,1106 +0,0 @@
|
|
|
1
|
-
import { t as __plugin_vue_export_helper_default } from "./_plugin-vue_export-helper-BSi1g3Lh.js";
|
|
2
|
-
import z$1 from "zod";
|
|
3
|
-
import { computed, createElementBlock, defineComponent, getCurrentScope, hasInjectionContext, inject, isRef, normalizeClass, onScopeDispose, openBlock, reactive, readonly, renderSlot, shallowReactive, shallowReadonly, toRefs, unref, watch } from "vue";
|
|
4
|
-
import { useI18n } from "vue-i18n";
|
|
5
|
-
import { useInjectConfigContext } from "@wisemen/vue-core-components";
|
|
6
|
-
import { Temporal } from "temporal-polyfill";
|
|
7
|
-
var I = class {
|
|
8
|
-
constructor() {
|
|
9
|
-
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
10
|
-
}
|
|
11
|
-
subscribe(e) {
|
|
12
|
-
return this.listeners.add(e), this.onSubscribe(), () => {
|
|
13
|
-
this.listeners.delete(e), this.onUnsubscribe();
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
hasListeners() {
|
|
17
|
-
return this.listeners.size > 0;
|
|
18
|
-
}
|
|
19
|
-
onSubscribe() {}
|
|
20
|
-
onUnsubscribe() {}
|
|
21
|
-
}, N = typeof window > "u" || "Deno" in globalThis;
|
|
22
|
-
function ge() {}
|
|
23
|
-
function V(e) {
|
|
24
|
-
return typeof e == "number" && e >= 0 && e !== Infinity;
|
|
25
|
-
}
|
|
26
|
-
function ye(e, l) {
|
|
27
|
-
return Math.max(e + (l || 0) - Date.now(), 0);
|
|
28
|
-
}
|
|
29
|
-
function q(e, l) {
|
|
30
|
-
return typeof e == "function" ? e(l) : e;
|
|
31
|
-
}
|
|
32
|
-
function P(e, l) {
|
|
33
|
-
return typeof e == "function" ? e(l) : e;
|
|
34
|
-
}
|
|
35
|
-
function z$2(e) {
|
|
36
|
-
return JSON.stringify(e, (e, l) => T(l) ? Object.keys(l).sort().reduce((e, u) => (e[u] = l[u], e), {}) : l);
|
|
37
|
-
}
|
|
38
|
-
function M(e, l) {
|
|
39
|
-
if (e === l) return e;
|
|
40
|
-
let u = B(e) && B(l);
|
|
41
|
-
if (u || T(e) && T(l)) {
|
|
42
|
-
let d = u ? e : Object.keys(e), f = d.length, p = u ? l : Object.keys(l), m = p.length, h = u ? [] : {}, g = 0;
|
|
43
|
-
for (let f = 0; f < m; f++) {
|
|
44
|
-
let m = u ? f : p[f];
|
|
45
|
-
(!u && d.includes(m) || u) && e[m] === void 0 && l[m] === void 0 ? (h[m] = void 0, g++) : (h[m] = M(e[m], l[m]), h[m] === e[m] && e[m] !== void 0 && g++);
|
|
46
|
-
}
|
|
47
|
-
return f === m && g === f ? e : h;
|
|
48
|
-
}
|
|
49
|
-
return l;
|
|
50
|
-
}
|
|
51
|
-
function Q(e, l) {
|
|
52
|
-
if (!l || Object.keys(e).length !== Object.keys(l).length) return !1;
|
|
53
|
-
for (let u in e) if (e[u] !== l[u]) return !1;
|
|
54
|
-
return !0;
|
|
55
|
-
}
|
|
56
|
-
function B(e) {
|
|
57
|
-
return Array.isArray(e) && e.length === Object.keys(e).length;
|
|
58
|
-
}
|
|
59
|
-
function T(e) {
|
|
60
|
-
if (!H(e)) return !1;
|
|
61
|
-
let l = e.constructor;
|
|
62
|
-
if (l === void 0) return !0;
|
|
63
|
-
let u = l.prototype;
|
|
64
|
-
return !(!H(u) || !u.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
|
|
65
|
-
}
|
|
66
|
-
function H(e) {
|
|
67
|
-
return Object.prototype.toString.call(e) === "[object Object]";
|
|
68
|
-
}
|
|
69
|
-
function W(e, l, u) {
|
|
70
|
-
if (typeof u.structuralSharing == "function") return u.structuralSharing(e, l);
|
|
71
|
-
if (u.structuralSharing !== !1) {
|
|
72
|
-
if (process.env.NODE_ENV !== "production") try {
|
|
73
|
-
return M(e, l);
|
|
74
|
-
} catch (e) {
|
|
75
|
-
throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${u.queryHash}]: ${e}`), e;
|
|
76
|
-
}
|
|
77
|
-
return M(e, l);
|
|
78
|
-
}
|
|
79
|
-
return l;
|
|
80
|
-
}
|
|
81
|
-
function be(e, l, u = 0) {
|
|
82
|
-
let d = [...e, l];
|
|
83
|
-
return u && d.length > u ? d.slice(1) : d;
|
|
84
|
-
}
|
|
85
|
-
function ve(e, l, u = 0) {
|
|
86
|
-
let d = [l, ...e];
|
|
87
|
-
return u && d.length > u ? d.slice(0, -1) : d;
|
|
88
|
-
}
|
|
89
|
-
var J = Symbol();
|
|
90
|
-
function me(e, l) {
|
|
91
|
-
return process.env.NODE_ENV !== "production" && e.queryFn === J && console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`), !e.queryFn && l?.initialPromise ? () => l.initialPromise : !e.queryFn || e.queryFn === J ? () => Promise.reject(/* @__PURE__ */ Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn;
|
|
92
|
-
}
|
|
93
|
-
function L(e, l) {
|
|
94
|
-
return typeof e == "function" ? e(...l) : !!e;
|
|
95
|
-
}
|
|
96
|
-
var Pe = new class extends I {
|
|
97
|
-
#e;
|
|
98
|
-
#t;
|
|
99
|
-
#n;
|
|
100
|
-
constructor() {
|
|
101
|
-
super(), this.#n = (e) => {
|
|
102
|
-
if (!N && window.addEventListener) {
|
|
103
|
-
let l = () => e();
|
|
104
|
-
return window.addEventListener("visibilitychange", l, !1), () => {
|
|
105
|
-
window.removeEventListener("visibilitychange", l);
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
onSubscribe() {
|
|
111
|
-
this.#t || this.setEventListener(this.#n);
|
|
112
|
-
}
|
|
113
|
-
onUnsubscribe() {
|
|
114
|
-
this.hasListeners() || (this.#t?.(), this.#t = void 0);
|
|
115
|
-
}
|
|
116
|
-
setEventListener(e) {
|
|
117
|
-
this.#n = e, this.#t?.(), this.#t = e((e) => {
|
|
118
|
-
typeof e == "boolean" ? this.setFocused(e) : this.onFocus();
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
setFocused(e) {
|
|
122
|
-
this.#e !== e && (this.#e = e, this.onFocus());
|
|
123
|
-
}
|
|
124
|
-
onFocus() {
|
|
125
|
-
let e = this.isFocused();
|
|
126
|
-
this.listeners.forEach((l) => {
|
|
127
|
-
l(e);
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
isFocused() {
|
|
131
|
-
return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
|
|
132
|
-
}
|
|
133
|
-
}(), Re = new class extends I {
|
|
134
|
-
#e = !0;
|
|
135
|
-
#t;
|
|
136
|
-
#n;
|
|
137
|
-
constructor() {
|
|
138
|
-
super(), this.#n = (e) => {
|
|
139
|
-
if (!N && window.addEventListener) {
|
|
140
|
-
let l = () => e(!0), u = () => e(!1);
|
|
141
|
-
return window.addEventListener("online", l, !1), window.addEventListener("offline", u, !1), () => {
|
|
142
|
-
window.removeEventListener("online", l), window.removeEventListener("offline", u);
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
onSubscribe() {
|
|
148
|
-
this.#t || this.setEventListener(this.#n);
|
|
149
|
-
}
|
|
150
|
-
onUnsubscribe() {
|
|
151
|
-
this.hasListeners() || (this.#t?.(), this.#t = void 0);
|
|
152
|
-
}
|
|
153
|
-
setEventListener(e) {
|
|
154
|
-
this.#n = e, this.#t?.(), this.#t = e(this.setOnline.bind(this));
|
|
155
|
-
}
|
|
156
|
-
setOnline(e) {
|
|
157
|
-
this.#e !== e && (this.#e = e, this.listeners.forEach((l) => {
|
|
158
|
-
l(e);
|
|
159
|
-
}));
|
|
160
|
-
}
|
|
161
|
-
isOnline() {
|
|
162
|
-
return this.#e;
|
|
163
|
-
}
|
|
164
|
-
}();
|
|
165
|
-
function Y() {
|
|
166
|
-
let e, l, u = new Promise((u, d) => {
|
|
167
|
-
e = u, l = d;
|
|
168
|
-
});
|
|
169
|
-
u.status = "pending", u.catch(() => {});
|
|
170
|
-
function d(e) {
|
|
171
|
-
Object.assign(u, e), delete u.resolve, delete u.reject;
|
|
172
|
-
}
|
|
173
|
-
return u.resolve = (l) => {
|
|
174
|
-
d({
|
|
175
|
-
status: "fulfilled",
|
|
176
|
-
value: l
|
|
177
|
-
}), e(l);
|
|
178
|
-
}, u.reject = (e) => {
|
|
179
|
-
d({
|
|
180
|
-
status: "rejected",
|
|
181
|
-
reason: e
|
|
182
|
-
}), l(e);
|
|
183
|
-
}, u;
|
|
184
|
-
}
|
|
185
|
-
function Se(e) {
|
|
186
|
-
return (e ?? "online") === "online" ? Re.isOnline() : !0;
|
|
187
|
-
}
|
|
188
|
-
var Fe = (e) => setTimeout(e, 0);
|
|
189
|
-
function Ee() {
|
|
190
|
-
let e = [], l = 0, u = (e) => {
|
|
191
|
-
e();
|
|
192
|
-
}, d = (e) => {
|
|
193
|
-
e();
|
|
194
|
-
}, f = Fe, p = (d) => {
|
|
195
|
-
l ? e.push(d) : f(() => {
|
|
196
|
-
u(d);
|
|
197
|
-
});
|
|
198
|
-
}, m = () => {
|
|
199
|
-
let l = e;
|
|
200
|
-
e = [], l.length && f(() => {
|
|
201
|
-
d(() => {
|
|
202
|
-
l.forEach((e) => {
|
|
203
|
-
u(e);
|
|
204
|
-
});
|
|
205
|
-
});
|
|
206
|
-
});
|
|
207
|
-
};
|
|
208
|
-
return {
|
|
209
|
-
batch: (e) => {
|
|
210
|
-
let u;
|
|
211
|
-
l++;
|
|
212
|
-
try {
|
|
213
|
-
u = e();
|
|
214
|
-
} finally {
|
|
215
|
-
l--, l || m();
|
|
216
|
-
}
|
|
217
|
-
return u;
|
|
218
|
-
},
|
|
219
|
-
batchCalls: (e) => (...l) => {
|
|
220
|
-
p(() => {
|
|
221
|
-
e(...l);
|
|
222
|
-
});
|
|
223
|
-
},
|
|
224
|
-
schedule: p,
|
|
225
|
-
setNotifyFunction: (e) => {
|
|
226
|
-
u = e;
|
|
227
|
-
},
|
|
228
|
-
setBatchNotifyFunction: (e) => {
|
|
229
|
-
d = e;
|
|
230
|
-
},
|
|
231
|
-
setScheduler: (e) => {
|
|
232
|
-
f = e;
|
|
233
|
-
}
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
var ue = Ee();
|
|
237
|
-
function Ce(e, l) {
|
|
238
|
-
return {
|
|
239
|
-
fetchFailureCount: 0,
|
|
240
|
-
fetchFailureReason: null,
|
|
241
|
-
fetchStatus: Se(l.networkMode) ? "fetching" : "paused",
|
|
242
|
-
...e === void 0 && {
|
|
243
|
-
error: null,
|
|
244
|
-
status: "pending"
|
|
245
|
-
}
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
function je() {
|
|
249
|
-
return {
|
|
250
|
-
context: void 0,
|
|
251
|
-
data: void 0,
|
|
252
|
-
error: null,
|
|
253
|
-
failureCount: 0,
|
|
254
|
-
failureReason: null,
|
|
255
|
-
isPaused: !1,
|
|
256
|
-
status: "idle",
|
|
257
|
-
variables: void 0,
|
|
258
|
-
submittedAt: 0
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
function X(e) {
|
|
262
|
-
return { onFetch: (e, l) => {
|
|
263
|
-
let u = e.options, d = e.fetchOptions?.meta?.fetchMore?.direction, f = e.state.data?.pages || [], p = e.state.data?.pageParams || [], m = {
|
|
264
|
-
pages: [],
|
|
265
|
-
pageParams: []
|
|
266
|
-
}, h = 0, g = async () => {
|
|
267
|
-
let l = !1, g = (u) => {
|
|
268
|
-
Object.defineProperty(u, "signal", {
|
|
269
|
-
enumerable: !0,
|
|
270
|
-
get: () => (e.signal.aborted ? l = !0 : e.signal.addEventListener("abort", () => {
|
|
271
|
-
l = !0;
|
|
272
|
-
}), e.signal)
|
|
273
|
-
});
|
|
274
|
-
}, v = me(e.options, e.fetchOptions), y = async (u, d, f) => {
|
|
275
|
-
if (l) return Promise.reject();
|
|
276
|
-
if (d == null && u.pages.length) return Promise.resolve(u);
|
|
277
|
-
let p = {
|
|
278
|
-
client: e.client,
|
|
279
|
-
queryKey: e.queryKey,
|
|
280
|
-
pageParam: d,
|
|
281
|
-
direction: f ? "backward" : "forward",
|
|
282
|
-
meta: e.options.meta
|
|
283
|
-
};
|
|
284
|
-
g(p);
|
|
285
|
-
let m = await v(p), { maxPages: h } = e.options, y = f ? ve : be;
|
|
286
|
-
return {
|
|
287
|
-
pages: y(u.pages, m, h),
|
|
288
|
-
pageParams: y(u.pageParams, d, h)
|
|
289
|
-
};
|
|
290
|
-
};
|
|
291
|
-
if (d && f.length) {
|
|
292
|
-
let e = d === "backward", l = e ? ce : D, h = {
|
|
293
|
-
pages: f,
|
|
294
|
-
pageParams: p
|
|
295
|
-
};
|
|
296
|
-
m = await y(h, l(u, h), e);
|
|
297
|
-
} else {
|
|
298
|
-
let e = f.length;
|
|
299
|
-
do {
|
|
300
|
-
let e = h === 0 ? p[0] ?? u.initialPageParam : D(u, m);
|
|
301
|
-
if (h > 0 && e == null) break;
|
|
302
|
-
m = await y(m, e), h++;
|
|
303
|
-
} while (h < e);
|
|
304
|
-
}
|
|
305
|
-
return m;
|
|
306
|
-
};
|
|
307
|
-
e.options.persister ? e.fetchFn = () => e.options.persister?.(g, {
|
|
308
|
-
client: e.client,
|
|
309
|
-
queryKey: e.queryKey,
|
|
310
|
-
meta: e.options.meta,
|
|
311
|
-
signal: e.signal
|
|
312
|
-
}, l) : e.fetchFn = g;
|
|
313
|
-
} };
|
|
314
|
-
}
|
|
315
|
-
function D(e, { pages: l, pageParams: u }) {
|
|
316
|
-
let d = l.length - 1;
|
|
317
|
-
return l.length > 0 ? e.getNextPageParam(l[d], l, u[d], u) : void 0;
|
|
318
|
-
}
|
|
319
|
-
function ce(e, { pages: l, pageParams: u }) {
|
|
320
|
-
return l.length > 0 ? e.getPreviousPageParam?.(l[0], l, u[0], u) : void 0;
|
|
321
|
-
}
|
|
322
|
-
function ke(e, l) {
|
|
323
|
-
return l ? D(e, l) != null : !1;
|
|
324
|
-
}
|
|
325
|
-
function qe(e, l) {
|
|
326
|
-
return !l || !e.getPreviousPageParam ? !1 : ce(e, l) != null;
|
|
327
|
-
}
|
|
328
|
-
var he = class extends I {
|
|
329
|
-
constructor(e, l) {
|
|
330
|
-
super(), this.options = l, this.#e = e, this.#s = null, this.#o = Y(), this.options.experimental_prefetchInRender || this.#o.reject(/* @__PURE__ */ Error("experimental_prefetchInRender feature flag is not enabled")), this.bindMethods(), this.setOptions(l);
|
|
331
|
-
}
|
|
332
|
-
#e;
|
|
333
|
-
#t = void 0;
|
|
334
|
-
#n = void 0;
|
|
335
|
-
#r = void 0;
|
|
336
|
-
#i;
|
|
337
|
-
#a;
|
|
338
|
-
#o;
|
|
339
|
-
#s;
|
|
340
|
-
#c;
|
|
341
|
-
#l;
|
|
342
|
-
#u;
|
|
343
|
-
#d;
|
|
344
|
-
#f;
|
|
345
|
-
#p;
|
|
346
|
-
#m = /* @__PURE__ */ new Set();
|
|
347
|
-
bindMethods() {
|
|
348
|
-
this.refetch = this.refetch.bind(this);
|
|
349
|
-
}
|
|
350
|
-
onSubscribe() {
|
|
351
|
-
this.listeners.size === 1 && (this.#t.addObserver(this), Z(this.#t, this.options) ? this.#h() : this.updateResult(), this.#y());
|
|
352
|
-
}
|
|
353
|
-
onUnsubscribe() {
|
|
354
|
-
this.hasListeners() || this.destroy();
|
|
355
|
-
}
|
|
356
|
-
shouldFetchOnReconnect() {
|
|
357
|
-
return x(this.#t, this.options, this.options.refetchOnReconnect);
|
|
358
|
-
}
|
|
359
|
-
shouldFetchOnWindowFocus() {
|
|
360
|
-
return x(this.#t, this.options, this.options.refetchOnWindowFocus);
|
|
361
|
-
}
|
|
362
|
-
destroy() {
|
|
363
|
-
this.listeners = /* @__PURE__ */ new Set(), this.#b(), this.#x(), this.#t.removeObserver(this);
|
|
364
|
-
}
|
|
365
|
-
setOptions(e) {
|
|
366
|
-
let l = this.options, u = this.#t;
|
|
367
|
-
if (this.options = this.#e.defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof P(this.options.enabled, this.#t) != "boolean") throw Error("Expected enabled to be a boolean or a callback that returns a boolean");
|
|
368
|
-
this.#S(), this.#t.setOptions(this.options), l._defaulted && !Q(this.options, l) && this.#e.getQueryCache().notify({
|
|
369
|
-
type: "observerOptionsUpdated",
|
|
370
|
-
query: this.#t,
|
|
371
|
-
observer: this
|
|
372
|
-
});
|
|
373
|
-
let d = this.hasListeners();
|
|
374
|
-
d && G(this.#t, u, this.options, l) && this.#h(), this.updateResult(), d && (this.#t !== u || P(this.options.enabled, this.#t) !== P(l.enabled, this.#t) || q(this.options.staleTime, this.#t) !== q(l.staleTime, this.#t)) && this.#g();
|
|
375
|
-
let f = this.#_();
|
|
376
|
-
d && (this.#t !== u || P(this.options.enabled, this.#t) !== P(l.enabled, this.#t) || f !== this.#p) && this.#v(f);
|
|
377
|
-
}
|
|
378
|
-
getOptimisticResult(e) {
|
|
379
|
-
let l = this.#e.getQueryCache().build(this.#e, e), u = this.createResult(l, e);
|
|
380
|
-
return Qe(this, u) && (this.#r = u, this.#a = this.options, this.#i = this.#t.state), u;
|
|
381
|
-
}
|
|
382
|
-
getCurrentResult() {
|
|
383
|
-
return this.#r;
|
|
384
|
-
}
|
|
385
|
-
trackResult(e, l) {
|
|
386
|
-
return new Proxy(e, { get: (e, u) => (this.trackProp(u), l?.(u), Reflect.get(e, u)) });
|
|
387
|
-
}
|
|
388
|
-
trackProp(e) {
|
|
389
|
-
this.#m.add(e);
|
|
390
|
-
}
|
|
391
|
-
getCurrentQuery() {
|
|
392
|
-
return this.#t;
|
|
393
|
-
}
|
|
394
|
-
refetch({ ...e } = {}) {
|
|
395
|
-
return this.fetch({ ...e });
|
|
396
|
-
}
|
|
397
|
-
fetchOptimistic(e) {
|
|
398
|
-
let l = this.#e.defaultQueryOptions(e), u = this.#e.getQueryCache().build(this.#e, l);
|
|
399
|
-
return u.fetch().then(() => this.createResult(u, l));
|
|
400
|
-
}
|
|
401
|
-
fetch(e) {
|
|
402
|
-
return this.#h({
|
|
403
|
-
...e,
|
|
404
|
-
cancelRefetch: e.cancelRefetch ?? !0
|
|
405
|
-
}).then(() => (this.updateResult(), this.#r));
|
|
406
|
-
}
|
|
407
|
-
#h(e) {
|
|
408
|
-
this.#S();
|
|
409
|
-
let l = this.#t.fetch(this.options, e);
|
|
410
|
-
return e?.throwOnError || (l = l.catch(ge)), l;
|
|
411
|
-
}
|
|
412
|
-
#g() {
|
|
413
|
-
this.#b();
|
|
414
|
-
let e = q(this.options.staleTime, this.#t);
|
|
415
|
-
if (N || this.#r.isStale || !V(e)) return;
|
|
416
|
-
let l = ye(this.#r.dataUpdatedAt, e) + 1;
|
|
417
|
-
this.#d = setTimeout(() => {
|
|
418
|
-
this.#r.isStale || this.updateResult();
|
|
419
|
-
}, l);
|
|
420
|
-
}
|
|
421
|
-
#_() {
|
|
422
|
-
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#t) : this.options.refetchInterval) ?? !1;
|
|
423
|
-
}
|
|
424
|
-
#v(e) {
|
|
425
|
-
this.#x(), this.#p = e, !(N || P(this.options.enabled, this.#t) === !1 || !V(this.#p) || this.#p === 0) && (this.#f = setInterval(() => {
|
|
426
|
-
(this.options.refetchIntervalInBackground || Pe.isFocused()) && this.#h();
|
|
427
|
-
}, this.#p));
|
|
428
|
-
}
|
|
429
|
-
#y() {
|
|
430
|
-
this.#g(), this.#v(this.#_());
|
|
431
|
-
}
|
|
432
|
-
#b() {
|
|
433
|
-
this.#d &&= (clearTimeout(this.#d), void 0);
|
|
434
|
-
}
|
|
435
|
-
#x() {
|
|
436
|
-
this.#f &&= (clearInterval(this.#f), void 0);
|
|
437
|
-
}
|
|
438
|
-
createResult(e, l) {
|
|
439
|
-
let u = this.#t, d = this.options, f = this.#r, p = this.#i, m = this.#a, h = e === u ? this.#n : e.state, { state: g } = e, v = { ...g }, y = !1, b;
|
|
440
|
-
if (l._optimisticResults) {
|
|
441
|
-
let f = this.hasListeners(), p = !f && Z(e, l), m = f && G(e, u, l, d);
|
|
442
|
-
(p || m) && (v = {
|
|
443
|
-
...v,
|
|
444
|
-
...Ce(g.data, e.options)
|
|
445
|
-
}), l._optimisticResults === "isRestoring" && (v.fetchStatus = "idle");
|
|
446
|
-
}
|
|
447
|
-
let { error: S, errorUpdatedAt: w, status: E } = v;
|
|
448
|
-
b = v.data;
|
|
449
|
-
let O = !1;
|
|
450
|
-
if (l.placeholderData !== void 0 && b === void 0 && E === "pending") {
|
|
451
|
-
let e;
|
|
452
|
-
f?.isPlaceholderData && l.placeholderData === m?.placeholderData ? (e = f.data, O = !0) : e = typeof l.placeholderData == "function" ? l.placeholderData(this.#u?.state.data, this.#u) : l.placeholderData, e !== void 0 && (E = "success", b = W(f?.data, e, l), y = !0);
|
|
453
|
-
}
|
|
454
|
-
if (l.select && b !== void 0 && !O) if (f && b === p?.data && l.select === this.#c) b = this.#l;
|
|
455
|
-
else try {
|
|
456
|
-
this.#c = l.select, b = l.select(b), b = W(f?.data, b, l), this.#l = b, this.#s = null;
|
|
457
|
-
} catch (e) {
|
|
458
|
-
this.#s = e;
|
|
459
|
-
}
|
|
460
|
-
this.#s && (S = this.#s, b = this.#l, w = Date.now(), E = "error");
|
|
461
|
-
let k = v.fetchStatus === "fetching", j = E === "pending", F = E === "error", R = j && k, z = b !== void 0, $ = {
|
|
462
|
-
status: E,
|
|
463
|
-
fetchStatus: v.fetchStatus,
|
|
464
|
-
isPending: j,
|
|
465
|
-
isSuccess: E === "success",
|
|
466
|
-
isError: F,
|
|
467
|
-
isInitialLoading: R,
|
|
468
|
-
isLoading: R,
|
|
469
|
-
data: b,
|
|
470
|
-
dataUpdatedAt: v.dataUpdatedAt,
|
|
471
|
-
error: S,
|
|
472
|
-
errorUpdatedAt: w,
|
|
473
|
-
failureCount: v.fetchFailureCount,
|
|
474
|
-
failureReason: v.fetchFailureReason,
|
|
475
|
-
errorUpdateCount: v.errorUpdateCount,
|
|
476
|
-
isFetched: v.dataUpdateCount > 0 || v.errorUpdateCount > 0,
|
|
477
|
-
isFetchedAfterMount: v.dataUpdateCount > h.dataUpdateCount || v.errorUpdateCount > h.errorUpdateCount,
|
|
478
|
-
isFetching: k,
|
|
479
|
-
isRefetching: k && !j,
|
|
480
|
-
isLoadingError: F && !z,
|
|
481
|
-
isPaused: v.fetchStatus === "paused",
|
|
482
|
-
isPlaceholderData: y,
|
|
483
|
-
isRefetchError: F && z,
|
|
484
|
-
isStale: _(e, l),
|
|
485
|
-
refetch: this.refetch,
|
|
486
|
-
promise: this.#o
|
|
487
|
-
};
|
|
488
|
-
if (this.options.experimental_prefetchInRender) {
|
|
489
|
-
let l = (e) => {
|
|
490
|
-
$.status === "error" ? e.reject($.error) : $.data !== void 0 && e.resolve($.data);
|
|
491
|
-
}, d = () => {
|
|
492
|
-
l(this.#o = $.promise = Y());
|
|
493
|
-
}, f = this.#o;
|
|
494
|
-
switch (f.status) {
|
|
495
|
-
case "pending":
|
|
496
|
-
e.queryHash === u.queryHash && l(f);
|
|
497
|
-
break;
|
|
498
|
-
case "fulfilled":
|
|
499
|
-
($.status === "error" || $.data !== f.value) && d();
|
|
500
|
-
break;
|
|
501
|
-
case "rejected":
|
|
502
|
-
($.status !== "error" || $.error !== f.reason) && d();
|
|
503
|
-
break;
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
return $;
|
|
507
|
-
}
|
|
508
|
-
updateResult() {
|
|
509
|
-
let e = this.#r, l = this.createResult(this.#t, this.options);
|
|
510
|
-
this.#i = this.#t.state, this.#a = this.options, this.#i.data !== void 0 && (this.#u = this.#t), !Q(l, e) && (this.#r = l, this.#C({ listeners: (() => {
|
|
511
|
-
if (!e) return !0;
|
|
512
|
-
let { notifyOnChangeProps: l } = this.options, u = typeof l == "function" ? l() : l;
|
|
513
|
-
if (u === "all" || !u && !this.#m.size) return !0;
|
|
514
|
-
let d = new Set(u ?? this.#m);
|
|
515
|
-
return this.options.throwOnError && d.add("error"), Object.keys(this.#r).some((l) => {
|
|
516
|
-
let u = l;
|
|
517
|
-
return this.#r[u] !== e[u] && d.has(u);
|
|
518
|
-
});
|
|
519
|
-
})() }));
|
|
520
|
-
}
|
|
521
|
-
#S() {
|
|
522
|
-
let e = this.#e.getQueryCache().build(this.#e, this.options);
|
|
523
|
-
if (e === this.#t) return;
|
|
524
|
-
let l = this.#t;
|
|
525
|
-
this.#t = e, this.#n = e.state, this.hasListeners() && (l?.removeObserver(this), e.addObserver(this));
|
|
526
|
-
}
|
|
527
|
-
onQueryUpdate() {
|
|
528
|
-
this.updateResult(), this.hasListeners() && this.#y();
|
|
529
|
-
}
|
|
530
|
-
#C(e) {
|
|
531
|
-
ue.batch(() => {
|
|
532
|
-
e.listeners && this.listeners.forEach((e) => {
|
|
533
|
-
e(this.#r);
|
|
534
|
-
}), this.#e.getQueryCache().notify({
|
|
535
|
-
query: this.#t,
|
|
536
|
-
type: "observerResultsUpdated"
|
|
537
|
-
});
|
|
538
|
-
});
|
|
539
|
-
}
|
|
540
|
-
};
|
|
541
|
-
function Ne(e, l) {
|
|
542
|
-
return P(l.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && l.retryOnMount === !1);
|
|
543
|
-
}
|
|
544
|
-
function Z(e, l) {
|
|
545
|
-
return Ne(e, l) || e.state.data !== void 0 && x(e, l, l.refetchOnMount);
|
|
546
|
-
}
|
|
547
|
-
function x(e, l, u) {
|
|
548
|
-
if (P(l.enabled, e) !== !1) {
|
|
549
|
-
let d = typeof u == "function" ? u(e) : u;
|
|
550
|
-
return d === "always" || d !== !1 && _(e, l);
|
|
551
|
-
}
|
|
552
|
-
return !1;
|
|
553
|
-
}
|
|
554
|
-
function G(e, l, u, d) {
|
|
555
|
-
return (e !== l || P(d.enabled, e) === !1) && (!u.suspense || e.state.status !== "error") && _(e, u);
|
|
556
|
-
}
|
|
557
|
-
function _(e, l) {
|
|
558
|
-
return P(l.enabled, e) !== !1 && e.isStaleByTime(q(l.staleTime, e));
|
|
559
|
-
}
|
|
560
|
-
function Qe(e, l) {
|
|
561
|
-
return !Q(e.getCurrentResult(), l);
|
|
562
|
-
}
|
|
563
|
-
var Ie = class extends he {
|
|
564
|
-
constructor(e, l) {
|
|
565
|
-
super(e, l);
|
|
566
|
-
}
|
|
567
|
-
bindMethods() {
|
|
568
|
-
super.bindMethods(), this.fetchNextPage = this.fetchNextPage.bind(this), this.fetchPreviousPage = this.fetchPreviousPage.bind(this);
|
|
569
|
-
}
|
|
570
|
-
setOptions(e) {
|
|
571
|
-
super.setOptions({
|
|
572
|
-
...e,
|
|
573
|
-
behavior: X()
|
|
574
|
-
});
|
|
575
|
-
}
|
|
576
|
-
getOptimisticResult(e) {
|
|
577
|
-
return e.behavior = X(), super.getOptimisticResult(e);
|
|
578
|
-
}
|
|
579
|
-
fetchNextPage(e) {
|
|
580
|
-
return this.fetch({
|
|
581
|
-
...e,
|
|
582
|
-
meta: { fetchMore: { direction: "forward" } }
|
|
583
|
-
});
|
|
584
|
-
}
|
|
585
|
-
fetchPreviousPage(e) {
|
|
586
|
-
return this.fetch({
|
|
587
|
-
...e,
|
|
588
|
-
meta: { fetchMore: { direction: "backward" } }
|
|
589
|
-
});
|
|
590
|
-
}
|
|
591
|
-
createResult(e, l) {
|
|
592
|
-
let { state: u } = e, d = super.createResult(e, l), { isFetching: f, isRefetching: p, isError: m, isRefetchError: h } = d, g = u.fetchMeta?.fetchMore?.direction, v = m && g === "forward", y = f && g === "forward", b = m && g === "backward", S = f && g === "backward";
|
|
593
|
-
return {
|
|
594
|
-
...d,
|
|
595
|
-
fetchNextPage: this.fetchNextPage,
|
|
596
|
-
fetchPreviousPage: this.fetchPreviousPage,
|
|
597
|
-
hasNextPage: ke(l, u.data),
|
|
598
|
-
hasPreviousPage: qe(l, u.data),
|
|
599
|
-
isFetchNextPageError: v,
|
|
600
|
-
isFetchingNextPage: y,
|
|
601
|
-
isFetchPreviousPageError: b,
|
|
602
|
-
isFetchingPreviousPage: S,
|
|
603
|
-
isRefetchError: h && !v && !b,
|
|
604
|
-
isRefetching: p && !y && !S
|
|
605
|
-
};
|
|
606
|
-
}
|
|
607
|
-
}, Me = class extends I {
|
|
608
|
-
#e;
|
|
609
|
-
#t = void 0;
|
|
610
|
-
#n;
|
|
611
|
-
#r;
|
|
612
|
-
constructor(e, l) {
|
|
613
|
-
super(), this.#e = e, this.setOptions(l), this.bindMethods(), this.#i();
|
|
614
|
-
}
|
|
615
|
-
bindMethods() {
|
|
616
|
-
this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this);
|
|
617
|
-
}
|
|
618
|
-
setOptions(e) {
|
|
619
|
-
let l = this.options;
|
|
620
|
-
this.options = this.#e.defaultMutationOptions(e), Q(this.options, l) || this.#e.getMutationCache().notify({
|
|
621
|
-
type: "observerOptionsUpdated",
|
|
622
|
-
mutation: this.#n,
|
|
623
|
-
observer: this
|
|
624
|
-
}), l?.mutationKey && this.options.mutationKey && z$2(l.mutationKey) !== z$2(this.options.mutationKey) ? this.reset() : this.#n?.state.status === "pending" && this.#n.setOptions(this.options);
|
|
625
|
-
}
|
|
626
|
-
onUnsubscribe() {
|
|
627
|
-
this.hasListeners() || this.#n?.removeObserver(this);
|
|
628
|
-
}
|
|
629
|
-
onMutationUpdate(e) {
|
|
630
|
-
this.#i(), this.#a(e);
|
|
631
|
-
}
|
|
632
|
-
getCurrentResult() {
|
|
633
|
-
return this.#t;
|
|
634
|
-
}
|
|
635
|
-
reset() {
|
|
636
|
-
this.#n?.removeObserver(this), this.#n = void 0, this.#i(), this.#a();
|
|
637
|
-
}
|
|
638
|
-
mutate(e, l) {
|
|
639
|
-
return this.#r = l, this.#n?.removeObserver(this), this.#n = this.#e.getMutationCache().build(this.#e, this.options), this.#n.addObserver(this), this.#n.execute(e);
|
|
640
|
-
}
|
|
641
|
-
#i() {
|
|
642
|
-
let e = this.#n?.state ?? je();
|
|
643
|
-
this.#t = {
|
|
644
|
-
...e,
|
|
645
|
-
isPending: e.status === "pending",
|
|
646
|
-
isSuccess: e.status === "success",
|
|
647
|
-
isError: e.status === "error",
|
|
648
|
-
isIdle: e.status === "idle",
|
|
649
|
-
mutate: this.mutate,
|
|
650
|
-
reset: this.reset
|
|
651
|
-
};
|
|
652
|
-
}
|
|
653
|
-
#a(e) {
|
|
654
|
-
ue.batch(() => {
|
|
655
|
-
if (this.#r && this.hasListeners()) {
|
|
656
|
-
let l = this.#t.variables, u = this.#t.context;
|
|
657
|
-
e?.type === "success" ? (this.#r.onSuccess?.(e.data, l, u), this.#r.onSettled?.(e.data, null, l, u)) : e?.type === "error" && (this.#r.onError?.(e.error, l, u), this.#r.onSettled?.(void 0, e.error, l, u));
|
|
658
|
-
}
|
|
659
|
-
this.listeners.forEach((e) => {
|
|
660
|
-
e(this.#t);
|
|
661
|
-
});
|
|
662
|
-
});
|
|
663
|
-
}
|
|
664
|
-
}, Te = "VUE_QUERY_CLIENT";
|
|
665
|
-
function Le(e) {
|
|
666
|
-
return `${Te}${e ? `:${e}` : ""}`;
|
|
667
|
-
}
|
|
668
|
-
function U(e, l) {
|
|
669
|
-
Object.keys(e).forEach((u) => {
|
|
670
|
-
e[u] = l[u];
|
|
671
|
-
});
|
|
672
|
-
}
|
|
673
|
-
function K(e, l, u = "", d = 0) {
|
|
674
|
-
if (l) {
|
|
675
|
-
let f = l(e, u, d);
|
|
676
|
-
if (f === void 0 && isRef(e) || f !== void 0) return f;
|
|
677
|
-
}
|
|
678
|
-
if (Array.isArray(e)) return e.map((e, u) => K(e, l, String(u), d + 1));
|
|
679
|
-
if (typeof e == "object" && xe(e)) {
|
|
680
|
-
let u = Object.entries(e).map(([e, u]) => [e, K(u, l, e, d + 1)]);
|
|
681
|
-
return Object.fromEntries(u);
|
|
682
|
-
}
|
|
683
|
-
return e;
|
|
684
|
-
}
|
|
685
|
-
function De(e, l) {
|
|
686
|
-
return K(e, l);
|
|
687
|
-
}
|
|
688
|
-
function C(e, l = !1) {
|
|
689
|
-
return De(e, (e, u, d) => {
|
|
690
|
-
if (d === 1 && u === "queryKey") return C(e, !0);
|
|
691
|
-
if (l && Ue(e)) return C(e(), l);
|
|
692
|
-
if (isRef(e)) return C(unref(e), l);
|
|
693
|
-
});
|
|
694
|
-
}
|
|
695
|
-
function xe(e) {
|
|
696
|
-
if (Object.prototype.toString.call(e) !== "[object Object]") return !1;
|
|
697
|
-
let l = Object.getPrototypeOf(e);
|
|
698
|
-
return l === null || l === Object.prototype;
|
|
699
|
-
}
|
|
700
|
-
function Ue(e) {
|
|
701
|
-
return typeof e == "function";
|
|
702
|
-
}
|
|
703
|
-
function A(e = "") {
|
|
704
|
-
if (!hasInjectionContext()) throw Error("vue-query hooks can only be used inside setup() function or functions that support injection context.");
|
|
705
|
-
let l = inject(Le(e));
|
|
706
|
-
if (!l) throw Error("No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.");
|
|
707
|
-
return l;
|
|
708
|
-
}
|
|
709
|
-
function le(e, l, d) {
|
|
710
|
-
process.env.NODE_ENV === "development" && (getCurrentScope() || console.warn("vue-query composable like \"useQuery()\" should only be used inside a \"setup()\" function or a running effect scope. They might otherwise lead to memory leaks."));
|
|
711
|
-
let f = A(), m = computed(() => {
|
|
712
|
-
let e = C(l);
|
|
713
|
-
typeof e.enabled == "function" && (e.enabled = e.enabled());
|
|
714
|
-
let u = f.defaultQueryOptions(e);
|
|
715
|
-
return u._optimisticResults = f.isRestoring.value ? "isRestoring" : "optimistic", u;
|
|
716
|
-
}), h = new e(f, m.value), g = m.value.shallow ? shallowReactive(h.getCurrentResult()) : reactive(h.getCurrentResult()), v = () => {};
|
|
717
|
-
watch(f.isRestoring, (e) => {
|
|
718
|
-
e || (v(), v = h.subscribe((e) => {
|
|
719
|
-
U(g, e);
|
|
720
|
-
}));
|
|
721
|
-
}, { immediate: !0 });
|
|
722
|
-
let b = () => {
|
|
723
|
-
h.setOptions(m.value), U(g, h.getCurrentResult());
|
|
724
|
-
};
|
|
725
|
-
watch(m, b), onScopeDispose(() => {
|
|
726
|
-
v();
|
|
727
|
-
});
|
|
728
|
-
let E = (...e) => (b(), g.refetch(...e)), F = () => new Promise((e, l) => {
|
|
729
|
-
let u = () => {}, d = () => {
|
|
730
|
-
if (m.value.enabled !== !1) {
|
|
731
|
-
h.setOptions(m.value);
|
|
732
|
-
let d = h.getOptimisticResult(m.value);
|
|
733
|
-
d.isStale ? (u(), h.fetchOptimistic(m.value).then(e, (u) => {
|
|
734
|
-
L(m.value.throwOnError, [u, h.getCurrentQuery()]) ? l(u) : e(h.getCurrentResult());
|
|
735
|
-
})) : (u(), e(d));
|
|
736
|
-
}
|
|
737
|
-
};
|
|
738
|
-
d(), u = watch(m, d);
|
|
739
|
-
});
|
|
740
|
-
watch(() => g.error, (e) => {
|
|
741
|
-
if (g.isError && !g.isFetching && L(m.value.throwOnError, [e, h.getCurrentQuery()])) throw e;
|
|
742
|
-
});
|
|
743
|
-
let z = toRefs(m.value.shallow ? shallowReadonly(g) : readonly(g));
|
|
744
|
-
for (let e in g) typeof g[e] == "function" && (z[e] = g[e]);
|
|
745
|
-
return z.suspense = F, z.refetch = E, z;
|
|
746
|
-
}
|
|
747
|
-
function Ke(e, l) {
|
|
748
|
-
return le(he, e);
|
|
749
|
-
}
|
|
750
|
-
function _e(e, l) {
|
|
751
|
-
return le(Ie, e);
|
|
752
|
-
}
|
|
753
|
-
function Ae(e, l) {
|
|
754
|
-
process.env.NODE_ENV === "development" && (getCurrentScope() || console.warn("vue-query composable like \"useQuery()\" should only be used inside a \"setup()\" function or a running effect scope. They might otherwise lead to memory leaks."));
|
|
755
|
-
let d = A(), f = computed(() => d.defaultMutationOptions(C(e))), m = new Me(d, f.value), h = f.value.shallow ? shallowReactive(m.getCurrentResult()) : reactive(m.getCurrentResult()), g = m.subscribe((e) => {
|
|
756
|
-
U(h, e);
|
|
757
|
-
}), v = (e, l) => {
|
|
758
|
-
m.mutate(e, l).catch(() => {});
|
|
759
|
-
};
|
|
760
|
-
watch(f, () => {
|
|
761
|
-
m.setOptions(f.value);
|
|
762
|
-
}), onScopeDispose(() => {
|
|
763
|
-
g();
|
|
764
|
-
});
|
|
765
|
-
let b = toRefs(f.value.shallow ? shallowReadonly(h) : readonly(h));
|
|
766
|
-
return watch(() => h.error, (e) => {
|
|
767
|
-
if (e && L(f.value.throwOnError, [e])) throw e;
|
|
768
|
-
}), {
|
|
769
|
-
...b,
|
|
770
|
-
mutate: v,
|
|
771
|
-
mutateAsync: h.mutate,
|
|
772
|
-
reset: h.reset
|
|
773
|
-
};
|
|
774
|
-
}
|
|
775
|
-
function ze(e) {
|
|
776
|
-
let l = e.isDebug ?? !1, d = A();
|
|
777
|
-
async function f(u, f) {
|
|
778
|
-
await Promise.all(Object.entries(e.queryKeysToInvalidate).map(async ([e, p]) => {
|
|
779
|
-
let m = Object.entries(p).reduce((e, [l, d]) => (e[l] = d(f, u), e), {});
|
|
780
|
-
l && console.log(`[MUTATION] Invalidating ${e}`, m), await d.invalidateQueries({
|
|
781
|
-
exact: !1,
|
|
782
|
-
queryKey: [e, m]
|
|
783
|
-
});
|
|
784
|
-
}));
|
|
785
|
-
}
|
|
786
|
-
let p = Ae({
|
|
787
|
-
mutationFn: e.queryFn,
|
|
788
|
-
onSuccess: async (e, l) => {
|
|
789
|
-
if (l !== void 0 && "params" in l) {
|
|
790
|
-
await f(e, l.params);
|
|
791
|
-
return;
|
|
792
|
-
}
|
|
793
|
-
await f(e, {});
|
|
794
|
-
}
|
|
795
|
-
});
|
|
796
|
-
async function m(e) {
|
|
797
|
-
return await p.mutateAsync(e);
|
|
798
|
-
}
|
|
799
|
-
return {
|
|
800
|
-
isLoading: computed(() => p.isPending.value),
|
|
801
|
-
data: computed(() => p.data.value),
|
|
802
|
-
execute: m
|
|
803
|
-
};
|
|
804
|
-
}
|
|
805
|
-
function Be(e) {
|
|
806
|
-
let l = e.isDebug ?? !1, d = _e({
|
|
807
|
-
enabled: e.enabled,
|
|
808
|
-
getNextPageParam: (e) => {
|
|
809
|
-
if (e.meta === null) return null;
|
|
810
|
-
if ("next" in e.meta) return e.meta.next;
|
|
811
|
-
if ("offset" in e.meta) {
|
|
812
|
-
let l = e.meta.offset + e.meta.limit;
|
|
813
|
-
return l >= e.meta.total ? null : l;
|
|
814
|
-
}
|
|
815
|
-
return null;
|
|
816
|
-
},
|
|
817
|
-
initialPageParam: "key" in e.paginationOptions.value.pagination ? e.paginationOptions.value.pagination.key : e.paginationOptions.value.pagination.offset,
|
|
818
|
-
placeholderData: (e) => e,
|
|
819
|
-
queryFn: async ({ pageParam: l }) => {
|
|
820
|
-
let u = e.paginationOptions.value.pagination;
|
|
821
|
-
return await e.queryFn({
|
|
822
|
-
...e.paginationOptions.value,
|
|
823
|
-
pagination: "key" in u ? {
|
|
824
|
-
key: l,
|
|
825
|
-
limit: u.limit,
|
|
826
|
-
type: "keyset"
|
|
827
|
-
} : {
|
|
828
|
-
limit: u.limit,
|
|
829
|
-
offset: l,
|
|
830
|
-
type: "offset"
|
|
831
|
-
}
|
|
832
|
-
});
|
|
833
|
-
},
|
|
834
|
-
queryKey: f()
|
|
835
|
-
});
|
|
836
|
-
function f() {
|
|
837
|
-
let [u, d] = Object.entries(e.queryKey)[0];
|
|
838
|
-
return l && console.log(`Create query with key ${u}`, d), [u, d];
|
|
839
|
-
}
|
|
840
|
-
return {
|
|
841
|
-
hasNextPage: computed(() => d.hasNextPage.value),
|
|
842
|
-
isError: computed(() => d.isError.value),
|
|
843
|
-
isFetching: computed(() => d.isFetching.value),
|
|
844
|
-
isFetchingNextPage: computed(() => d.isFetchingNextPage.value),
|
|
845
|
-
isLoading: computed(() => d.isLoading.value),
|
|
846
|
-
isSuccess: computed(() => d.isSuccess.value),
|
|
847
|
-
data: computed(() => {
|
|
848
|
-
let e = d.data.value?.pages.flatMap((e) => e.data) ?? [], l = d.data.value?.pages[0].meta ?? null;
|
|
849
|
-
return l !== null && "next" in l ? {
|
|
850
|
-
data: e,
|
|
851
|
-
meta: {
|
|
852
|
-
next: l.next,
|
|
853
|
-
total: e.length
|
|
854
|
-
}
|
|
855
|
-
} : {
|
|
856
|
-
data: e,
|
|
857
|
-
meta: {
|
|
858
|
-
limit: l?.limit ?? 0,
|
|
859
|
-
offset: l?.offset ?? 0,
|
|
860
|
-
total: l?.total ?? 0
|
|
861
|
-
}
|
|
862
|
-
};
|
|
863
|
-
}),
|
|
864
|
-
error: computed(() => d.error.value),
|
|
865
|
-
getNextPage: async () => {
|
|
866
|
-
d.isFetchingNextPage.value || !d.hasNextPage.value || await d.fetchNextPage();
|
|
867
|
-
},
|
|
868
|
-
refetch: async () => {
|
|
869
|
-
await d.refetch();
|
|
870
|
-
}
|
|
871
|
-
};
|
|
872
|
-
}
|
|
873
|
-
function He(e) {
|
|
874
|
-
let l = e.isDebug ?? !1, d = Ke({
|
|
875
|
-
staleTime: e.staleTime,
|
|
876
|
-
enabled: e.isEnabled,
|
|
877
|
-
placeholderData: (e) => e,
|
|
878
|
-
queryFn: e.queryFn,
|
|
879
|
-
queryKey: f()
|
|
880
|
-
});
|
|
881
|
-
function f() {
|
|
882
|
-
let [u, d] = Object.entries(e.queryKey)[0];
|
|
883
|
-
return l && console.log(`Create query with key ${u}`, d), [u, d];
|
|
884
|
-
}
|
|
885
|
-
async function p() {
|
|
886
|
-
await d.refetch();
|
|
887
|
-
}
|
|
888
|
-
return {
|
|
889
|
-
isError: computed(() => d.isError.value),
|
|
890
|
-
isFetching: computed(() => d.isFetching.value),
|
|
891
|
-
isLoading: computed(() => d.isLoading.value),
|
|
892
|
-
isSuccess: computed(() => d.isSuccess.value),
|
|
893
|
-
data: computed(() => d.data.value ?? null),
|
|
894
|
-
error: computed(() => d.error.value),
|
|
895
|
-
refetch: p
|
|
896
|
-
};
|
|
897
|
-
}
|
|
898
|
-
var PlainDateTransformer = class {
|
|
899
|
-
static fromDto(e) {
|
|
900
|
-
return Temporal.PlainDate.from(e);
|
|
901
|
-
}
|
|
902
|
-
static fromNullableDto(e) {
|
|
903
|
-
return e === null ? null : this.fromDto(e);
|
|
904
|
-
}
|
|
905
|
-
static toDto(e) {
|
|
906
|
-
return e.toString();
|
|
907
|
-
}
|
|
908
|
-
static toNullableDto(e) {
|
|
909
|
-
return e === null ? null : this.toDto(e);
|
|
910
|
-
}
|
|
911
|
-
}, ZonedDateTimeTransformer = class {
|
|
912
|
-
static fromDto(e) {
|
|
913
|
-
let l = Temporal.Instant.from(e), u = Temporal.Now.timeZoneId();
|
|
914
|
-
return l.toZonedDateTimeISO(u);
|
|
915
|
-
}
|
|
916
|
-
static fromNullableDto(e) {
|
|
917
|
-
return e === null ? null : this.fromDto(e);
|
|
918
|
-
}
|
|
919
|
-
}, AppGroup_default = /* @__PURE__ */ defineComponent({
|
|
920
|
-
__name: "AppGroup",
|
|
921
|
-
props: {
|
|
922
|
-
align: { default: "center" },
|
|
923
|
-
direction: { default: "row" },
|
|
924
|
-
gap: { default: "md" },
|
|
925
|
-
justify: { default: "start" }
|
|
926
|
-
},
|
|
927
|
-
setup(e) {
|
|
928
|
-
let l = e, f = computed(() => {
|
|
929
|
-
switch (l.gap) {
|
|
930
|
-
case "2xl": return "gap-2xl";
|
|
931
|
-
case "3xl": return "gap-3xl";
|
|
932
|
-
case "4xl": return "gap-4xl";
|
|
933
|
-
case "5xl": return "gap-5xl";
|
|
934
|
-
case "6xl": return "gap-6xl";
|
|
935
|
-
case "7xl": return "gap-7xl";
|
|
936
|
-
case "8xl": return "gap-8xl";
|
|
937
|
-
case "9xl": return "gap-9xl";
|
|
938
|
-
case "10xl": return "gap-10xl";
|
|
939
|
-
case "11xl": return "gap-11xl";
|
|
940
|
-
case "lg": return "gap-lg";
|
|
941
|
-
case "md": return "gap-md";
|
|
942
|
-
case "none": return "gap-none";
|
|
943
|
-
case "sm": return "gap-sm";
|
|
944
|
-
case "xl": return "gap-xl";
|
|
945
|
-
case "xs": return "gap-xs";
|
|
946
|
-
case "xxs": return "gap-xxs";
|
|
947
|
-
default: return "gap-none";
|
|
948
|
-
}
|
|
949
|
-
}), p = computed(() => {
|
|
950
|
-
switch (l.justify) {
|
|
951
|
-
case "between": return "justify-between";
|
|
952
|
-
case "center": return "justify-center";
|
|
953
|
-
case "end": return "justify-end";
|
|
954
|
-
case "start": return "justify-start";
|
|
955
|
-
default: return "justify-start";
|
|
956
|
-
}
|
|
957
|
-
}), m = computed(() => {
|
|
958
|
-
switch (l.align) {
|
|
959
|
-
case "center": return "items-center";
|
|
960
|
-
case "end": return "items-end";
|
|
961
|
-
case "start": return "items-start";
|
|
962
|
-
case "stretch": return "items-stretch";
|
|
963
|
-
default: return "items-start";
|
|
964
|
-
}
|
|
965
|
-
}), h = computed(() => {
|
|
966
|
-
switch (l.direction) {
|
|
967
|
-
case "col": return "flex-col";
|
|
968
|
-
case "row": return "flex-row";
|
|
969
|
-
default: return "flex-row";
|
|
970
|
-
}
|
|
971
|
-
});
|
|
972
|
-
return (e, l) => (openBlock(), createElementBlock("div", { class: normalizeClass([[
|
|
973
|
-
m.value,
|
|
974
|
-
p.value,
|
|
975
|
-
f.value,
|
|
976
|
-
h.value
|
|
977
|
-
], "flex"]) }, [renderSlot(e.$slots, "default")], 2));
|
|
978
|
-
}
|
|
979
|
-
});
|
|
980
|
-
const plainDateSchema = z$1.instanceof(Temporal.PlainDate);
|
|
981
|
-
var DateUtil = class {
|
|
982
|
-
static dateTimeToZonedDateTime(e) {
|
|
983
|
-
return e.toZonedDateTime(this.getMyTimezone());
|
|
984
|
-
}
|
|
985
|
-
static diffInHours(e, l) {
|
|
986
|
-
return this.diffInMinutes(e, l) / 60;
|
|
987
|
-
}
|
|
988
|
-
static diffInMinutes(e, l) {
|
|
989
|
-
return this.diffInSeconds(e, l) / 60;
|
|
990
|
-
}
|
|
991
|
-
static diffInSeconds(e, l) {
|
|
992
|
-
return Number(l.epochNanoseconds - e.epochNanoseconds) / 1e9;
|
|
993
|
-
}
|
|
994
|
-
static getDefaultHourCycle(e) {
|
|
995
|
-
let { hourCycle: l } = new Intl.DateTimeFormat(e, { hour: "2-digit" }).resolvedOptions();
|
|
996
|
-
return l === "h11" || l === "h12" ? "12-hour" : "24-hour";
|
|
997
|
-
}
|
|
998
|
-
static getMyTimezone() {
|
|
999
|
-
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
1000
|
-
}
|
|
1001
|
-
static isToday(e) {
|
|
1002
|
-
let l = Temporal.Now.zonedDateTimeISO(this.getMyTimezone()).toPlainDate(), u = e.toPlainDate();
|
|
1003
|
-
return l.equals(u);
|
|
1004
|
-
}
|
|
1005
|
-
static plainDateToDate(e) {
|
|
1006
|
-
return new Date(e.year, e.month - 1, e.day);
|
|
1007
|
-
}
|
|
1008
|
-
};
|
|
1009
|
-
function getDateFormatOptions() {
|
|
1010
|
-
return {
|
|
1011
|
-
day: "2-digit",
|
|
1012
|
-
month: "2-digit",
|
|
1013
|
-
year: "numeric"
|
|
1014
|
-
};
|
|
1015
|
-
}
|
|
1016
|
-
function useDateTimeFormat() {
|
|
1017
|
-
let { locale: e, t: l } = useI18n(), d = useInjectConfigContext(), f = computed(() => d.hourCycle.value || DateUtil.getDefaultHourCycle(e.value));
|
|
1018
|
-
function p(e) {
|
|
1019
|
-
return {
|
|
1020
|
-
hour: "2-digit",
|
|
1021
|
-
hourCycle: f.value === "12-hour" ? "h11" : "h23",
|
|
1022
|
-
minute: "2-digit",
|
|
1023
|
-
second: e ? "2-digit" : void 0
|
|
1024
|
-
};
|
|
1025
|
-
}
|
|
1026
|
-
function m(l, u = !1) {
|
|
1027
|
-
return new Intl.DateTimeFormat(e.value, p(u)).format(l.epochMilliseconds);
|
|
1028
|
-
}
|
|
1029
|
-
function h(l) {
|
|
1030
|
-
return new Intl.DateTimeFormat(e.value, getDateFormatOptions()).format(l.toZonedDateTime("UTC").epochMilliseconds);
|
|
1031
|
-
}
|
|
1032
|
-
function g(l, u = !1) {
|
|
1033
|
-
return new Intl.DateTimeFormat(e.value, {
|
|
1034
|
-
...getDateFormatOptions(),
|
|
1035
|
-
...p(u)
|
|
1036
|
-
}).format(l.epochMilliseconds);
|
|
1037
|
-
}
|
|
1038
|
-
function v(u, d = Temporal.Now.instant()) {
|
|
1039
|
-
let f = new Intl.RelativeTimeFormat(e.value, {
|
|
1040
|
-
numeric: "auto",
|
|
1041
|
-
style: "long"
|
|
1042
|
-
}), p = u.epochMilliseconds - d.epochMilliseconds, m = [
|
|
1043
|
-
{
|
|
1044
|
-
ms: 1e3 * 60 * 60 * 24 * 365,
|
|
1045
|
-
unit: "year"
|
|
1046
|
-
},
|
|
1047
|
-
{
|
|
1048
|
-
ms: 1e3 * 60 * 60 * 24 * 30,
|
|
1049
|
-
unit: "month"
|
|
1050
|
-
},
|
|
1051
|
-
{
|
|
1052
|
-
ms: 1e3 * 60 * 60 * 24,
|
|
1053
|
-
unit: "day"
|
|
1054
|
-
},
|
|
1055
|
-
{
|
|
1056
|
-
ms: 1e3 * 60 * 60,
|
|
1057
|
-
unit: "hour"
|
|
1058
|
-
},
|
|
1059
|
-
{
|
|
1060
|
-
ms: 1e3 * 60,
|
|
1061
|
-
unit: "minute"
|
|
1062
|
-
},
|
|
1063
|
-
{
|
|
1064
|
-
ms: 1e3,
|
|
1065
|
-
unit: "second"
|
|
1066
|
-
}
|
|
1067
|
-
];
|
|
1068
|
-
if (Math.abs(p) < 60 * 1e3) return l("shared.time_format.now");
|
|
1069
|
-
for (let { ms: e, unit: l } of m) {
|
|
1070
|
-
let u = Math.round(p / e);
|
|
1071
|
-
if (Math.abs(u) >= 1) return f.format(u, l);
|
|
1072
|
-
}
|
|
1073
|
-
return f.format(0, "second");
|
|
1074
|
-
}
|
|
1075
|
-
function y(l, u = "long") {
|
|
1076
|
-
let { hours: d, minutes: f, seconds: p } = Temporal.Duration.from({ seconds: l });
|
|
1077
|
-
if (l < 60) return new Intl.NumberFormat(e.value, {
|
|
1078
|
-
style: "unit",
|
|
1079
|
-
unit: "second",
|
|
1080
|
-
unitDisplay: u
|
|
1081
|
-
}).format(p);
|
|
1082
|
-
let m = new Intl.NumberFormat(e.value, {
|
|
1083
|
-
style: "unit",
|
|
1084
|
-
unit: "hour",
|
|
1085
|
-
unitDisplay: "narrow"
|
|
1086
|
-
}).format(d), h = new Intl.NumberFormat(e.value, {
|
|
1087
|
-
style: "unit",
|
|
1088
|
-
unit: "minute",
|
|
1089
|
-
unitDisplay: d === 0 ? "long" : "narrow"
|
|
1090
|
-
}).format(f);
|
|
1091
|
-
return d === 0 ? h : f === 0 ? m : `${m} ${h}`;
|
|
1092
|
-
}
|
|
1093
|
-
return {
|
|
1094
|
-
toDate: h,
|
|
1095
|
-
toDateTime: g,
|
|
1096
|
-
toTime: m,
|
|
1097
|
-
fromNow: v,
|
|
1098
|
-
secondsToDuration: y
|
|
1099
|
-
};
|
|
1100
|
-
}
|
|
1101
|
-
var _sfc_main = {}, _hoisted_1 = { class: "bg-tertiary w-full animate-pulse rounded-lg" };
|
|
1102
|
-
function _sfc_render(e, l) {
|
|
1103
|
-
return openBlock(), createElementBlock("div", _hoisted_1);
|
|
1104
|
-
}
|
|
1105
|
-
var AppSkeletonLoader_default = /* @__PURE__ */ __plugin_vue_export_helper_default(_sfc_main, [["render", _sfc_render]]);
|
|
1106
|
-
export { AppGroup_default as a, Be as c, plainDateSchema as i, He as l, useDateTimeFormat as n, PlainDateTransformer as o, DateUtil as r, ZonedDateTimeTransformer as s, AppSkeletonLoader_default as t, ze as u };
|