@jskit-ai/assistant-core 0.1.165 → 0.1.166
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/examples/conversation/App.vue +104 -0
- package/examples/conversation/README.md +42 -0
- package/examples/conversation/dist/assets/index-CSTXm6q3.css +1 -0
- package/examples/conversation/dist/assets/index-DGgOLzoo.js +30 -0
- package/examples/conversation/dist/index.html +4 -0
- package/examples/conversation/index.html +2 -0
- package/examples/conversation/main.js +9 -0
- package/examples/conversation/node_modules/.vite/deps/@mdi_js.js +7450 -0
- package/examples/conversation/node_modules/.vite/deps/@mdi_js.js.map +1 -0
- package/examples/conversation/node_modules/.vite/deps/VTooltip-jIxO6ULs.js +2311 -0
- package/examples/conversation/node_modules/.vite/deps/VTooltip-jIxO6ULs.js.map +1 -0
- package/examples/conversation/node_modules/.vite/deps/_metadata.json +70 -0
- package/examples/conversation/node_modules/.vite/deps/defineComponent-DK6LSjDW.js +710 -0
- package/examples/conversation/node_modules/.vite/deps/defineComponent-DK6LSjDW.js.map +1 -0
- package/examples/conversation/node_modules/.vite/deps/hotkey-parsing-DnoZxtbW.js +1214 -0
- package/examples/conversation/node_modules/.vite/deps/hotkey-parsing-DnoZxtbW.js.map +1 -0
- package/examples/conversation/node_modules/.vite/deps/icons-ze2hmg7j.js +98 -0
- package/examples/conversation/node_modules/.vite/deps/icons-ze2hmg7j.js.map +1 -0
- package/examples/conversation/node_modules/.vite/deps/package.json +3 -0
- package/examples/conversation/node_modules/.vite/deps/theme-D78LVcJg.js +1301 -0
- package/examples/conversation/node_modules/.vite/deps/theme-D78LVcJg.js.map +1 -0
- package/examples/conversation/node_modules/.vite/deps/vue.js +2 -0
- package/examples/conversation/node_modules/.vite/deps/vue.runtime.esm-bundler-YcakWsDn.js +8538 -0
- package/examples/conversation/node_modules/.vite/deps/vue.runtime.esm-bundler-YcakWsDn.js.map +1 -0
- package/examples/conversation/node_modules/.vite/deps/vuetify.js +413 -0
- package/examples/conversation/node_modules/.vite/deps/vuetify.js.map +1 -0
- package/examples/conversation/node_modules/.vite/deps/vuetify_components.js +25370 -0
- package/examples/conversation/node_modules/.vite/deps/vuetify_components.js.map +1 -0
- package/examples/conversation/node_modules/.vite/deps/vuetify_directives.js +132 -0
- package/examples/conversation/node_modules/.vite/deps/vuetify_directives.js.map +1 -0
- package/examples/conversation/node_modules/.vite/deps/vuetify_iconsets_mdi-svg.js +70 -0
- package/examples/conversation/node_modules/.vite/deps/vuetify_iconsets_mdi-svg.js.map +1 -0
- package/examples/conversation/package.json +22 -0
- package/examples/conversation/server.js +123 -0
- package/examples/conversation/vite.config.js +8 -0
- package/package.json +59 -7
- package/src/client/conversation/AssistantComposerActions.vue +43 -0
- package/src/client/conversation/AssistantConversationElement.vue +78 -0
- package/src/client/conversation/AssistantProgress.vue +88 -0
- package/src/client/conversation/AssistantPromptInput.vue +467 -0
- package/src/client/conversation/AssistantTranscript.vue +1361 -0
- package/src/client/conversation/LongTextInlineParts.vue +64 -0
- package/src/client/conversation/LongTextPreviewBlocks.vue +324 -0
- package/src/client/conversation/index.js +9 -0
- package/src/client/conversation/submitText.js +29 -0
- package/src/client/conversation/useScrollToBottom.js +151 -0
- package/src/server/conversation/codexClient.js +328 -0
- package/src/server/conversation/codexEvents.js +623 -0
- package/src/server/conversation/codexTurn.js +280 -0
- package/src/server/conversation/index.js +2 -0
- package/src/server/conversation/memoryStorage.js +76 -0
- package/src/server/conversation/normalize.js +7 -0
- package/src/server/conversation/openCodeClient.js +512 -0
- package/src/server/conversation/transcript.js +92 -0
- package/src/shared/conversation/answerChoiceSugar.js +191 -0
- package/src/shared/conversation/index.js +6 -0
- package/src/shared/conversation/longTextBlocks.js +403 -0
- package/src/shared/conversation/numberedQuestionSugar.js +295 -0
- package/src/shared/conversation/scrollFollowState.js +32 -0
- package/src/shared/conversation/thinkingText.js +13 -0
- package/src/shared/conversation/turns.js +30 -0
- package/src/testing/conversationStorageContract.js +35 -0
- package/test/conversation.test.js +57 -0
|
@@ -0,0 +1,710 @@
|
|
|
1
|
+
import { Fn as isProxy, In as isReactive, Kn as ref, M as Fragment, O as Comment, Qn as toRef, Rn as isRef, U as computed, Ut as provide, Wn as reactive, Yn as shallowRef, Zn as toRaw, _n as watchEffect, hn as warn, ir as capitalize, nr as unref, nt as defineComponent$1, rr as camelize, ut as getCurrentInstance$1, wt as isVNode, xt as inject } from "./vue.runtime.esm-bundler-YcakWsDn.js";
|
|
2
|
+
//#region ../../../../node_modules/vuetify/lib/util/console.js
|
|
3
|
+
function consoleWarn(message) {
|
|
4
|
+
warn(`Vuetify: ${message}`);
|
|
5
|
+
}
|
|
6
|
+
function consoleError(message) {
|
|
7
|
+
warn(`Vuetify error: ${message}`);
|
|
8
|
+
}
|
|
9
|
+
function deprecate(original, replacement) {
|
|
10
|
+
replacement = Array.isArray(replacement) ? replacement.slice(0, -1).map((s) => `'${s}'`).join(", ") + ` or '${replacement.at(-1)}'` : `'${replacement}'`;
|
|
11
|
+
warn(`[Vuetify UPGRADE] '${original}' is deprecated, use ${replacement} instead.`);
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region ../../../../node_modules/vuetify/lib/util/globals.js
|
|
15
|
+
var IN_BROWSER = typeof window !== "undefined";
|
|
16
|
+
var SUPPORTS_INTERSECTION = IN_BROWSER && "IntersectionObserver" in window;
|
|
17
|
+
var SUPPORTS_TOUCH = IN_BROWSER && ("ontouchstart" in window || window.navigator.maxTouchPoints > 0);
|
|
18
|
+
var SUPPORTS_EYE_DROPPER = IN_BROWSER && "EyeDropper" in window;
|
|
19
|
+
var SUPPORTS_MATCH_MEDIA = IN_BROWSER && "matchMedia" in window && typeof window.matchMedia === "function";
|
|
20
|
+
var PREFERS_REDUCED_MOTION = () => SUPPORTS_MATCH_MEDIA && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region ../../../../node_modules/vuetify/lib/util/helpers.js
|
|
23
|
+
function getNestedValue(obj, path, fallback) {
|
|
24
|
+
const last = path.length - 1;
|
|
25
|
+
if (last < 0) return obj === void 0 ? fallback : obj;
|
|
26
|
+
for (let i = 0; i < last; i++) {
|
|
27
|
+
if (obj == null) return fallback;
|
|
28
|
+
obj = obj[path[i]];
|
|
29
|
+
}
|
|
30
|
+
if (obj == null) return fallback;
|
|
31
|
+
return obj[path[last]] === void 0 ? fallback : obj[path[last]];
|
|
32
|
+
}
|
|
33
|
+
function getObjectValueByPath(obj, path, fallback) {
|
|
34
|
+
if (obj == null || !path || typeof path !== "string") return fallback;
|
|
35
|
+
if (obj[path] !== void 0) return obj[path];
|
|
36
|
+
path = path.replace(/\[(\w+)\]/g, ".$1");
|
|
37
|
+
path = path.replace(/^\./, "");
|
|
38
|
+
return getNestedValue(obj, path.split("."), fallback);
|
|
39
|
+
}
|
|
40
|
+
function getPropertyFromItem(item, property, fallback) {
|
|
41
|
+
if (property === true) return item === void 0 ? fallback : item;
|
|
42
|
+
if (property == null || typeof property === "boolean") return fallback;
|
|
43
|
+
if (item !== Object(item)) {
|
|
44
|
+
if (typeof property !== "function") return fallback;
|
|
45
|
+
const value = property(item, fallback);
|
|
46
|
+
return typeof value === "undefined" ? fallback : value;
|
|
47
|
+
}
|
|
48
|
+
if (typeof property === "string") return getObjectValueByPath(item, property, fallback);
|
|
49
|
+
if (Array.isArray(property)) return getNestedValue(item, property, fallback);
|
|
50
|
+
if (typeof property !== "function") return fallback;
|
|
51
|
+
const value = property(item, fallback);
|
|
52
|
+
return typeof value === "undefined" ? fallback : value;
|
|
53
|
+
}
|
|
54
|
+
function createRange(length, start = 0) {
|
|
55
|
+
return Array.from({ length }, (v, k) => start + k);
|
|
56
|
+
}
|
|
57
|
+
function convertToUnit(str, unit = "px") {
|
|
58
|
+
if (str == null || str === "") return;
|
|
59
|
+
const num = Number(str);
|
|
60
|
+
if (isNaN(num)) return String(str);
|
|
61
|
+
else if (!isFinite(num)) return;
|
|
62
|
+
else return `${num}${unit}`;
|
|
63
|
+
}
|
|
64
|
+
function isObject(obj) {
|
|
65
|
+
return obj !== null && typeof obj === "object" && !Array.isArray(obj);
|
|
66
|
+
}
|
|
67
|
+
function isPlainObject(obj) {
|
|
68
|
+
let proto;
|
|
69
|
+
return obj !== null && typeof obj === "object" && ((proto = Object.getPrototypeOf(obj)) === Object.prototype || proto === null);
|
|
70
|
+
}
|
|
71
|
+
function refElement(obj) {
|
|
72
|
+
if (obj && "$el" in obj) {
|
|
73
|
+
const el = obj.$el;
|
|
74
|
+
if (el?.nodeType === Node.TEXT_NODE) return el.nextElementSibling;
|
|
75
|
+
return el;
|
|
76
|
+
}
|
|
77
|
+
return obj;
|
|
78
|
+
}
|
|
79
|
+
Object.freeze({
|
|
80
|
+
enter: 13,
|
|
81
|
+
tab: 9,
|
|
82
|
+
delete: 46,
|
|
83
|
+
esc: 27,
|
|
84
|
+
space: 32,
|
|
85
|
+
up: 38,
|
|
86
|
+
down: 40,
|
|
87
|
+
left: 37,
|
|
88
|
+
right: 39,
|
|
89
|
+
end: 35,
|
|
90
|
+
home: 36,
|
|
91
|
+
del: 46,
|
|
92
|
+
backspace: 8,
|
|
93
|
+
insert: 45,
|
|
94
|
+
pageup: 33,
|
|
95
|
+
pagedown: 34,
|
|
96
|
+
shift: 16
|
|
97
|
+
});
|
|
98
|
+
var keyValues = Object.freeze({
|
|
99
|
+
enter: "Enter",
|
|
100
|
+
tab: "Tab",
|
|
101
|
+
delete: "Delete",
|
|
102
|
+
esc: "Escape",
|
|
103
|
+
space: "Space",
|
|
104
|
+
up: "ArrowUp",
|
|
105
|
+
down: "ArrowDown",
|
|
106
|
+
left: "ArrowLeft",
|
|
107
|
+
right: "ArrowRight",
|
|
108
|
+
end: "End",
|
|
109
|
+
home: "Home",
|
|
110
|
+
del: "Delete",
|
|
111
|
+
backspace: "Backspace",
|
|
112
|
+
insert: "Insert",
|
|
113
|
+
pageup: "PageUp",
|
|
114
|
+
pagedown: "PageDown",
|
|
115
|
+
shift: "Shift"
|
|
116
|
+
});
|
|
117
|
+
function keys(o) {
|
|
118
|
+
return Object.keys(o);
|
|
119
|
+
}
|
|
120
|
+
function has(obj, key) {
|
|
121
|
+
return key.every((k) => obj.hasOwnProperty(k));
|
|
122
|
+
}
|
|
123
|
+
function pick(obj, paths) {
|
|
124
|
+
const found = {};
|
|
125
|
+
for (const key of paths) if (Object.prototype.hasOwnProperty.call(obj, key)) found[key] = obj[key];
|
|
126
|
+
return found;
|
|
127
|
+
}
|
|
128
|
+
function pickWithRest(obj, paths, exclude) {
|
|
129
|
+
const found = Object.create(null);
|
|
130
|
+
const rest = Object.create(null);
|
|
131
|
+
for (const key in obj) if (paths.some((path) => path instanceof RegExp ? path.test(key) : path === key) && !exclude?.some((path) => path === key)) found[key] = obj[key];
|
|
132
|
+
else rest[key] = obj[key];
|
|
133
|
+
return [found, rest];
|
|
134
|
+
}
|
|
135
|
+
function omit(obj, exclude) {
|
|
136
|
+
const clone = { ...obj };
|
|
137
|
+
exclude.forEach((prop) => delete clone[prop]);
|
|
138
|
+
return clone;
|
|
139
|
+
}
|
|
140
|
+
var onRE = /^on[^a-z]/;
|
|
141
|
+
var isOn = (key) => onRE.test(key);
|
|
142
|
+
var bubblingEvents = [
|
|
143
|
+
"onAfterscriptexecute",
|
|
144
|
+
"onAnimationcancel",
|
|
145
|
+
"onAnimationend",
|
|
146
|
+
"onAnimationiteration",
|
|
147
|
+
"onAnimationstart",
|
|
148
|
+
"onAuxclick",
|
|
149
|
+
"onBeforeinput",
|
|
150
|
+
"onBeforescriptexecute",
|
|
151
|
+
"onChange",
|
|
152
|
+
"onClick",
|
|
153
|
+
"onCompositionend",
|
|
154
|
+
"onCompositionstart",
|
|
155
|
+
"onCompositionupdate",
|
|
156
|
+
"onContextmenu",
|
|
157
|
+
"onCopy",
|
|
158
|
+
"onCut",
|
|
159
|
+
"onDblclick",
|
|
160
|
+
"onFocusin",
|
|
161
|
+
"onFocusout",
|
|
162
|
+
"onFullscreenchange",
|
|
163
|
+
"onFullscreenerror",
|
|
164
|
+
"onGesturechange",
|
|
165
|
+
"onGestureend",
|
|
166
|
+
"onGesturestart",
|
|
167
|
+
"onGotpointercapture",
|
|
168
|
+
"onInput",
|
|
169
|
+
"onKeydown",
|
|
170
|
+
"onKeypress",
|
|
171
|
+
"onKeyup",
|
|
172
|
+
"onLostpointercapture",
|
|
173
|
+
"onMousedown",
|
|
174
|
+
"onMousemove",
|
|
175
|
+
"onMouseout",
|
|
176
|
+
"onMouseover",
|
|
177
|
+
"onMouseup",
|
|
178
|
+
"onMousewheel",
|
|
179
|
+
"onPaste",
|
|
180
|
+
"onPointercancel",
|
|
181
|
+
"onPointerdown",
|
|
182
|
+
"onPointerenter",
|
|
183
|
+
"onPointerleave",
|
|
184
|
+
"onPointermove",
|
|
185
|
+
"onPointerout",
|
|
186
|
+
"onPointerover",
|
|
187
|
+
"onPointerup",
|
|
188
|
+
"onReset",
|
|
189
|
+
"onSelect",
|
|
190
|
+
"onSubmit",
|
|
191
|
+
"onTouchcancel",
|
|
192
|
+
"onTouchend",
|
|
193
|
+
"onTouchmove",
|
|
194
|
+
"onTouchstart",
|
|
195
|
+
"onTransitioncancel",
|
|
196
|
+
"onTransitionend",
|
|
197
|
+
"onTransitionrun",
|
|
198
|
+
"onTransitionstart",
|
|
199
|
+
"onWheel"
|
|
200
|
+
];
|
|
201
|
+
var compositionIgnoreKeys = [
|
|
202
|
+
"ArrowUp",
|
|
203
|
+
"ArrowDown",
|
|
204
|
+
"ArrowRight",
|
|
205
|
+
"ArrowLeft",
|
|
206
|
+
"Enter",
|
|
207
|
+
"Escape",
|
|
208
|
+
"Tab",
|
|
209
|
+
" "
|
|
210
|
+
];
|
|
211
|
+
function isComposingIgnoreKey(e) {
|
|
212
|
+
return e.isComposing && compositionIgnoreKeys.includes(e.key);
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Filter attributes that should be applied to
|
|
216
|
+
* the root element of an input component. Remaining
|
|
217
|
+
* attributes should be passed to the <input> element inside.
|
|
218
|
+
*/
|
|
219
|
+
function filterInputAttrs(attrs) {
|
|
220
|
+
const [events, props] = pickWithRest(attrs, [onRE]);
|
|
221
|
+
const inputEvents = omit(events, bubblingEvents);
|
|
222
|
+
const [rootAttrs, inputAttrs] = pickWithRest(props, [
|
|
223
|
+
"class",
|
|
224
|
+
"style",
|
|
225
|
+
"id",
|
|
226
|
+
"inert",
|
|
227
|
+
/^data-/
|
|
228
|
+
]);
|
|
229
|
+
Object.assign(rootAttrs, events);
|
|
230
|
+
Object.assign(inputAttrs, inputEvents);
|
|
231
|
+
return [rootAttrs, inputAttrs];
|
|
232
|
+
}
|
|
233
|
+
function wrapInArray(v) {
|
|
234
|
+
return v == null ? [] : Array.isArray(v) ? v : [v];
|
|
235
|
+
}
|
|
236
|
+
function debounce(fn, delay) {
|
|
237
|
+
let timeoutId = 0;
|
|
238
|
+
const wrap = (...args) => {
|
|
239
|
+
clearTimeout(timeoutId);
|
|
240
|
+
timeoutId = setTimeout(() => fn(...args), unref(delay));
|
|
241
|
+
};
|
|
242
|
+
wrap.clear = () => {
|
|
243
|
+
clearTimeout(timeoutId);
|
|
244
|
+
};
|
|
245
|
+
wrap.immediate = fn;
|
|
246
|
+
return wrap;
|
|
247
|
+
}
|
|
248
|
+
function clamp(value, min = 0, max = 1) {
|
|
249
|
+
return Math.max(min, Math.min(max, value));
|
|
250
|
+
}
|
|
251
|
+
function getDecimals(value) {
|
|
252
|
+
const trimmedStr = value.toString().trim();
|
|
253
|
+
return trimmedStr.includes(".") ? trimmedStr.length - trimmedStr.indexOf(".") - 1 : 0;
|
|
254
|
+
}
|
|
255
|
+
function padEnd(str, length, char = "0") {
|
|
256
|
+
return str + char.repeat(Math.max(0, length - str.length));
|
|
257
|
+
}
|
|
258
|
+
function padStart(str, length, char = "0") {
|
|
259
|
+
return char.repeat(Math.max(0, length - str.length)) + str;
|
|
260
|
+
}
|
|
261
|
+
function chunk(str, size = 1) {
|
|
262
|
+
const chunked = [];
|
|
263
|
+
let index = 0;
|
|
264
|
+
while (index < str.length) {
|
|
265
|
+
chunked.push(str.substr(index, size));
|
|
266
|
+
index += size;
|
|
267
|
+
}
|
|
268
|
+
return chunked;
|
|
269
|
+
}
|
|
270
|
+
function humanReadableFileSize(bytes, base = 1e3) {
|
|
271
|
+
if (bytes < base) return `${bytes} B`;
|
|
272
|
+
const prefix = base === 1024 ? [
|
|
273
|
+
"Ki",
|
|
274
|
+
"Mi",
|
|
275
|
+
"Gi"
|
|
276
|
+
] : [
|
|
277
|
+
"k",
|
|
278
|
+
"M",
|
|
279
|
+
"G"
|
|
280
|
+
];
|
|
281
|
+
let unit = -1;
|
|
282
|
+
while (Math.abs(bytes) >= base && unit < prefix.length - 1) {
|
|
283
|
+
bytes /= base;
|
|
284
|
+
++unit;
|
|
285
|
+
}
|
|
286
|
+
return `${bytes.toFixed(1)} ${prefix[unit]}B`;
|
|
287
|
+
}
|
|
288
|
+
function mergeDeep(source = {}, target = {}, arrayFn, targetCondition) {
|
|
289
|
+
const out = {};
|
|
290
|
+
for (const key in source) out[key] = source[key];
|
|
291
|
+
for (const key in target) {
|
|
292
|
+
const targetProperty = target[key];
|
|
293
|
+
if (targetCondition && !targetCondition(key, targetProperty)) continue;
|
|
294
|
+
const sourceProperty = source[key];
|
|
295
|
+
if (isPlainObject(sourceProperty) && isPlainObject(targetProperty)) {
|
|
296
|
+
out[key] = mergeDeep(sourceProperty, targetProperty, arrayFn, targetCondition);
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
299
|
+
if (arrayFn && Array.isArray(sourceProperty) && Array.isArray(targetProperty)) {
|
|
300
|
+
out[key] = arrayFn(sourceProperty, targetProperty);
|
|
301
|
+
continue;
|
|
302
|
+
}
|
|
303
|
+
out[key] = targetProperty;
|
|
304
|
+
}
|
|
305
|
+
return out;
|
|
306
|
+
}
|
|
307
|
+
function flattenFragments(nodes) {
|
|
308
|
+
return nodes.map((node) => {
|
|
309
|
+
if (node.type === Fragment) return flattenFragments(node.children);
|
|
310
|
+
else return node;
|
|
311
|
+
}).flat();
|
|
312
|
+
}
|
|
313
|
+
function toKebabCase(str = "") {
|
|
314
|
+
if (toKebabCase.cache.has(str)) return toKebabCase.cache.get(str);
|
|
315
|
+
const kebab = str.replace(/[^a-z]/gi, "-").replace(/\B([A-Z])/g, "-$1").toLowerCase();
|
|
316
|
+
toKebabCase.cache.set(str, kebab);
|
|
317
|
+
return kebab;
|
|
318
|
+
}
|
|
319
|
+
toKebabCase.cache = /* @__PURE__ */ new Map();
|
|
320
|
+
function findChildrenWithProvide(key, vnode) {
|
|
321
|
+
if (!vnode || typeof vnode !== "object") return [];
|
|
322
|
+
if (Array.isArray(vnode)) return vnode.map((child) => findChildrenWithProvide(key, child)).flat(1);
|
|
323
|
+
else if (vnode.suspense) return findChildrenWithProvide(key, vnode.ssContent);
|
|
324
|
+
else if (Array.isArray(vnode.children)) return vnode.children.map((child) => findChildrenWithProvide(key, child)).flat(1);
|
|
325
|
+
else if (vnode.component) {
|
|
326
|
+
if (Object.getOwnPropertyDescriptor(vnode.component.provides, key)) return [vnode.component];
|
|
327
|
+
else if (vnode.component.subTree) return findChildrenWithProvide(key, vnode.component.subTree).flat(1);
|
|
328
|
+
}
|
|
329
|
+
return [];
|
|
330
|
+
}
|
|
331
|
+
var CircularBuffer = class {
|
|
332
|
+
#arr = [];
|
|
333
|
+
#pointer = 0;
|
|
334
|
+
constructor(size) {
|
|
335
|
+
this.size = size;
|
|
336
|
+
}
|
|
337
|
+
get isFull() {
|
|
338
|
+
return this.#arr.length === this.size;
|
|
339
|
+
}
|
|
340
|
+
push(val) {
|
|
341
|
+
this.#arr[this.#pointer] = val;
|
|
342
|
+
this.#pointer = (this.#pointer + 1) % this.size;
|
|
343
|
+
}
|
|
344
|
+
values() {
|
|
345
|
+
return this.#arr.slice(this.#pointer).concat(this.#arr.slice(0, this.#pointer));
|
|
346
|
+
}
|
|
347
|
+
clear() {
|
|
348
|
+
this.#arr.length = 0;
|
|
349
|
+
this.#pointer = 0;
|
|
350
|
+
}
|
|
351
|
+
};
|
|
352
|
+
function getEventCoordinates(e) {
|
|
353
|
+
if ("touches" in e) return {
|
|
354
|
+
clientX: e.touches[0].clientX,
|
|
355
|
+
clientY: e.touches[0].clientY
|
|
356
|
+
};
|
|
357
|
+
return {
|
|
358
|
+
clientX: e.clientX,
|
|
359
|
+
clientY: e.clientY
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Convert a computed ref to a record of refs.
|
|
364
|
+
* The getter function must always return an object with the same keys.
|
|
365
|
+
*/
|
|
366
|
+
function destructComputed(getter) {
|
|
367
|
+
const refs = reactive({});
|
|
368
|
+
watchEffect(() => {
|
|
369
|
+
const base = getter();
|
|
370
|
+
for (const key in base) refs[key] = base[key];
|
|
371
|
+
}, { flush: "sync" });
|
|
372
|
+
const obj = {};
|
|
373
|
+
for (const key in refs) obj[key] = toRef(() => refs[key]);
|
|
374
|
+
return obj;
|
|
375
|
+
}
|
|
376
|
+
/** Array.includes but value can be any type */
|
|
377
|
+
function includes(arr, val) {
|
|
378
|
+
return arr.includes(val);
|
|
379
|
+
}
|
|
380
|
+
function eventName(propName) {
|
|
381
|
+
return propName[2].toLowerCase() + propName.slice(3);
|
|
382
|
+
}
|
|
383
|
+
var EventProp = () => [Function, Array];
|
|
384
|
+
function hasEvent(props, name) {
|
|
385
|
+
name = "on" + capitalize(name);
|
|
386
|
+
return !!(props[name] || props[`${name}Once`] || props[`${name}Capture`] || props[`${name}OnceCapture`] || props[`${name}CaptureOnce`]);
|
|
387
|
+
}
|
|
388
|
+
function callEvent(handler, ...args) {
|
|
389
|
+
if (Array.isArray(handler)) for (const h of handler) h(...args);
|
|
390
|
+
else if (typeof handler === "function") handler(...args);
|
|
391
|
+
}
|
|
392
|
+
function focusableChildren(el, filterByTabIndex = true) {
|
|
393
|
+
const targets = [
|
|
394
|
+
"button",
|
|
395
|
+
"[href]",
|
|
396
|
+
"input:not([type=\"hidden\"])",
|
|
397
|
+
"select",
|
|
398
|
+
"textarea",
|
|
399
|
+
"details:not(:has(> summary))",
|
|
400
|
+
"details > summary",
|
|
401
|
+
"[tabindex]",
|
|
402
|
+
"[contenteditable]:not([contenteditable=\"false\"])",
|
|
403
|
+
"audio[controls]",
|
|
404
|
+
"video[controls]"
|
|
405
|
+
].map((s) => `${s}${filterByTabIndex ? ":not([tabindex=\"-1\"])" : ""}:not([disabled], [inert])`).join(", ");
|
|
406
|
+
let elements;
|
|
407
|
+
try {
|
|
408
|
+
elements = [...el.querySelectorAll(targets)];
|
|
409
|
+
} catch (err) {
|
|
410
|
+
consoleError(String(err));
|
|
411
|
+
return [];
|
|
412
|
+
}
|
|
413
|
+
return elements.filter((x) => !x.closest("[inert]")).filter((x) => !!x.offsetParent || x.getClientRects().length > 0).filter((x) => !x.parentElement?.closest("details:not([open])") || x.tagName === "SUMMARY" && x.parentElement?.tagName === "DETAILS");
|
|
414
|
+
}
|
|
415
|
+
function getNextElement(elements, location, condition) {
|
|
416
|
+
let _el;
|
|
417
|
+
let idx = elements.indexOf(document.activeElement);
|
|
418
|
+
const inc = location === "next" ? 1 : -1;
|
|
419
|
+
do {
|
|
420
|
+
idx += inc;
|
|
421
|
+
_el = elements[idx];
|
|
422
|
+
} while ((!_el || _el.offsetParent == null || !(condition?.(_el) ?? true)) && idx < elements.length && idx >= 0);
|
|
423
|
+
return _el;
|
|
424
|
+
}
|
|
425
|
+
function focusChild(el, location) {
|
|
426
|
+
const focusable = focusableChildren(el);
|
|
427
|
+
if (location == null) {
|
|
428
|
+
if (el === document.activeElement || !el.contains(document.activeElement)) focusable[0]?.focus();
|
|
429
|
+
} else if (location === "first") focusable[0]?.focus();
|
|
430
|
+
else if (location === "last") focusable.at(-1)?.focus();
|
|
431
|
+
else if (typeof location === "number") focusable[location]?.focus();
|
|
432
|
+
else {
|
|
433
|
+
const _el = getNextElement(focusable, location);
|
|
434
|
+
if (_el) _el.focus();
|
|
435
|
+
else focusChild(el, location === "next" ? "first" : "last");
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
function isEmpty(val) {
|
|
439
|
+
return val === null || val === void 0 || typeof val === "string" && val.trim() === "";
|
|
440
|
+
}
|
|
441
|
+
function noop() {}
|
|
442
|
+
/** Returns null if the selector is not supported or we can't check */
|
|
443
|
+
function matchesSelector(el, selector) {
|
|
444
|
+
if (!(IN_BROWSER && typeof CSS !== "undefined" && typeof CSS.supports !== "undefined" && CSS.supports(`selector(${selector})`))) return null;
|
|
445
|
+
try {
|
|
446
|
+
return !!el && el.matches(selector);
|
|
447
|
+
} catch (err) {
|
|
448
|
+
return null;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
function ensureValidVNode(vnodes) {
|
|
452
|
+
return vnodes.some((child) => {
|
|
453
|
+
if (!isVNode(child)) return true;
|
|
454
|
+
if (child.type === Comment) return false;
|
|
455
|
+
return child.type !== Fragment || ensureValidVNode(child.children);
|
|
456
|
+
}) ? vnodes : null;
|
|
457
|
+
}
|
|
458
|
+
function renderSlot(slot, props, fallback) {
|
|
459
|
+
return slot?.(props) ?? fallback?.(props);
|
|
460
|
+
}
|
|
461
|
+
function defer(timeout, cb) {
|
|
462
|
+
if (!IN_BROWSER || timeout === 0) {
|
|
463
|
+
cb();
|
|
464
|
+
return () => {};
|
|
465
|
+
}
|
|
466
|
+
const timeoutId = window.setTimeout(cb, timeout);
|
|
467
|
+
return () => window.clearTimeout(timeoutId);
|
|
468
|
+
}
|
|
469
|
+
function isClickInsideElement(event, targetDiv) {
|
|
470
|
+
const mouseX = event.clientX;
|
|
471
|
+
const mouseY = event.clientY;
|
|
472
|
+
const divRect = targetDiv.getBoundingClientRect();
|
|
473
|
+
const divLeft = divRect.left;
|
|
474
|
+
const divTop = divRect.top;
|
|
475
|
+
const divRight = divRect.right;
|
|
476
|
+
const divBottom = divRect.bottom;
|
|
477
|
+
return mouseX >= divLeft && mouseX <= divRight && mouseY >= divTop && mouseY <= divBottom;
|
|
478
|
+
}
|
|
479
|
+
function templateRef() {
|
|
480
|
+
const el = shallowRef();
|
|
481
|
+
const fn = (target) => {
|
|
482
|
+
el.value = target;
|
|
483
|
+
};
|
|
484
|
+
Object.defineProperty(fn, "value", {
|
|
485
|
+
enumerable: true,
|
|
486
|
+
get: () => el.value,
|
|
487
|
+
set: (val) => el.value = val
|
|
488
|
+
});
|
|
489
|
+
Object.defineProperty(fn, "el", {
|
|
490
|
+
enumerable: true,
|
|
491
|
+
get: () => refElement(el.value)
|
|
492
|
+
});
|
|
493
|
+
return fn;
|
|
494
|
+
}
|
|
495
|
+
function checkPrintable(e) {
|
|
496
|
+
const isPrintableChar = e.key.length === 1;
|
|
497
|
+
const noModifier = !e.ctrlKey && !e.metaKey && !e.altKey;
|
|
498
|
+
return isPrintableChar && noModifier;
|
|
499
|
+
}
|
|
500
|
+
function isPrimitive(value) {
|
|
501
|
+
return typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "bigint";
|
|
502
|
+
}
|
|
503
|
+
function escapeForRegex(sign) {
|
|
504
|
+
return "\\^$*+?.()|{}[]".includes(sign) ? `\\${sign}` : sign;
|
|
505
|
+
}
|
|
506
|
+
function extractNumber(text, decimalDigitsLimit, decimalSeparator) {
|
|
507
|
+
const onlyValidCharacters = new RegExp(`[\\d\\-${escapeForRegex(decimalSeparator)}]`);
|
|
508
|
+
const cleanText = text.split("").filter((x) => onlyValidCharacters.test(x)).filter((x, i, all) => i === 0 && /[-]/.test(x) || x === decimalSeparator && i === all.indexOf(x) || /\d/.test(x)).join("");
|
|
509
|
+
if (decimalDigitsLimit === 0) return cleanText.split(decimalSeparator)[0];
|
|
510
|
+
const decimalPart = new RegExp(`${escapeForRegex(decimalSeparator)}\\d`);
|
|
511
|
+
if (decimalDigitsLimit !== null && decimalPart.test(cleanText)) {
|
|
512
|
+
const parts = cleanText.split(decimalSeparator);
|
|
513
|
+
return [parts[0], parts[1].substring(0, decimalDigitsLimit)].join(decimalSeparator);
|
|
514
|
+
}
|
|
515
|
+
return cleanText;
|
|
516
|
+
}
|
|
517
|
+
function camelizeProps(props) {
|
|
518
|
+
const out = {};
|
|
519
|
+
for (const prop in props) out[camelize(prop)] = props[prop];
|
|
520
|
+
return out;
|
|
521
|
+
}
|
|
522
|
+
function onlyDefinedProps(props) {
|
|
523
|
+
const booleanAttributes = ["checked", "disabled"];
|
|
524
|
+
return Object.fromEntries(Object.entries(props).filter(([key, v]) => booleanAttributes.includes(key) ? !!v : v !== void 0));
|
|
525
|
+
}
|
|
526
|
+
function deepToRaw(value) {
|
|
527
|
+
const objectIterator = (input) => {
|
|
528
|
+
if (Array.isArray(input)) return input.map((item) => objectIterator(item));
|
|
529
|
+
if (isRef(input) || isReactive(input) || isProxy(input)) return objectIterator(toRaw(input));
|
|
530
|
+
if (isPlainObject(input)) return Object.keys(input).reduce((acc, key) => {
|
|
531
|
+
acc[key] = objectIterator(input[key]);
|
|
532
|
+
return acc;
|
|
533
|
+
}, {});
|
|
534
|
+
return input;
|
|
535
|
+
};
|
|
536
|
+
return objectIterator(value);
|
|
537
|
+
}
|
|
538
|
+
//#endregion
|
|
539
|
+
//#region ../../../../node_modules/vuetify/lib/util/propsFactory.js
|
|
540
|
+
/**
|
|
541
|
+
* Creates a factory function for props definitions.
|
|
542
|
+
* This is used to define props in a composable then override
|
|
543
|
+
* default values in an implementing component.
|
|
544
|
+
*
|
|
545
|
+
* @example Simplified signature
|
|
546
|
+
* (props: Props) => (defaults?: Record<keyof props, any>) => Props
|
|
547
|
+
*
|
|
548
|
+
* @example Usage
|
|
549
|
+
* const makeProps = propsFactory({
|
|
550
|
+
* foo: String,
|
|
551
|
+
* })
|
|
552
|
+
*
|
|
553
|
+
* defineComponent({
|
|
554
|
+
* props: {
|
|
555
|
+
* ...makeProps({
|
|
556
|
+
* foo: 'a',
|
|
557
|
+
* }),
|
|
558
|
+
* },
|
|
559
|
+
* setup (props) {
|
|
560
|
+
* // would be "string | undefined", now "string" because a default has been provided
|
|
561
|
+
* props.foo
|
|
562
|
+
* },
|
|
563
|
+
* }
|
|
564
|
+
*/
|
|
565
|
+
function propsFactory(props, source) {
|
|
566
|
+
return (defaults) => {
|
|
567
|
+
return Object.keys(props).reduce((obj, prop) => {
|
|
568
|
+
const definition = typeof props[prop] === "object" && props[prop] != null && !Array.isArray(props[prop]) ? props[prop] : { type: props[prop] };
|
|
569
|
+
if (defaults && prop in defaults) obj[prop] = {
|
|
570
|
+
...definition,
|
|
571
|
+
default: defaults[prop]
|
|
572
|
+
};
|
|
573
|
+
else obj[prop] = definition;
|
|
574
|
+
if (source && !obj[prop].source) obj[prop].source = source;
|
|
575
|
+
return obj;
|
|
576
|
+
}, {});
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* Like `Partial<T>` but doesn't care what the value is
|
|
581
|
+
*/
|
|
582
|
+
//#endregion
|
|
583
|
+
//#region ../../../../node_modules/vuetify/lib/util/getCurrentInstance.js
|
|
584
|
+
function getCurrentInstance(name, message) {
|
|
585
|
+
const vm = getCurrentInstance$1();
|
|
586
|
+
if (!vm) throw new Error(`[Vuetify] ${name} ${message || "must be called from inside a setup function"}`);
|
|
587
|
+
return vm;
|
|
588
|
+
}
|
|
589
|
+
function getCurrentInstanceName(name = "composables") {
|
|
590
|
+
const vm = getCurrentInstance(name).type;
|
|
591
|
+
return toKebabCase(vm?.aliasName || vm?.name);
|
|
592
|
+
}
|
|
593
|
+
//#endregion
|
|
594
|
+
//#region ../../../../node_modules/vuetify/lib/util/injectSelf.js
|
|
595
|
+
function injectSelf(key, vm = getCurrentInstance("injectSelf")) {
|
|
596
|
+
const { provides } = vm;
|
|
597
|
+
if (provides && key in provides) return provides[key];
|
|
598
|
+
}
|
|
599
|
+
//#endregion
|
|
600
|
+
//#region ../../../../node_modules/vuetify/lib/composables/defaults.js
|
|
601
|
+
var DefaultsSymbol = Symbol.for("vuetify:defaults");
|
|
602
|
+
function createDefaults(options) {
|
|
603
|
+
return ref(options);
|
|
604
|
+
}
|
|
605
|
+
function injectDefaults() {
|
|
606
|
+
const defaults = inject(DefaultsSymbol);
|
|
607
|
+
if (!defaults) throw new Error("[Vuetify] Could not find defaults instance");
|
|
608
|
+
return defaults;
|
|
609
|
+
}
|
|
610
|
+
function provideDefaults(defaults, options) {
|
|
611
|
+
const injectedDefaults = injectDefaults();
|
|
612
|
+
const providedDefaults = ref(defaults);
|
|
613
|
+
const newDefaults = computed(() => {
|
|
614
|
+
if (unref(options?.disabled)) return injectedDefaults.value;
|
|
615
|
+
const scoped = unref(options?.scoped);
|
|
616
|
+
const reset = unref(options?.reset);
|
|
617
|
+
const root = unref(options?.root);
|
|
618
|
+
if (providedDefaults.value == null && !(scoped || reset || root)) return injectedDefaults.value;
|
|
619
|
+
let properties = mergeDeep(providedDefaults.value, { prev: injectedDefaults.value });
|
|
620
|
+
if (scoped) return properties;
|
|
621
|
+
if (reset || root) {
|
|
622
|
+
const len = Number(reset || Infinity);
|
|
623
|
+
for (let i = 0; i <= len; i++) {
|
|
624
|
+
if (!properties || !("prev" in properties)) break;
|
|
625
|
+
properties = properties.prev;
|
|
626
|
+
}
|
|
627
|
+
if (properties && typeof root === "string" && root in properties) properties = mergeDeep(mergeDeep(properties, { prev: properties }), properties[root]);
|
|
628
|
+
return properties;
|
|
629
|
+
}
|
|
630
|
+
return properties.prev ? mergeDeep(properties.prev, properties, void 0, (_, v) => v !== void 0) : properties;
|
|
631
|
+
});
|
|
632
|
+
provide(DefaultsSymbol, newDefaults);
|
|
633
|
+
return newDefaults;
|
|
634
|
+
}
|
|
635
|
+
function propIsDefined(vnode, prop) {
|
|
636
|
+
return vnode.props && (typeof vnode.props[prop] !== "undefined" || typeof vnode.props[toKebabCase(prop)] !== "undefined");
|
|
637
|
+
}
|
|
638
|
+
function internalUseDefaults(props = {}, name, defaults = injectDefaults()) {
|
|
639
|
+
const vm = getCurrentInstance("useDefaults");
|
|
640
|
+
name = name ?? vm.type.name ?? vm.type.__name;
|
|
641
|
+
if (!name) throw new Error("[Vuetify] Could not determine component name");
|
|
642
|
+
const componentDefaults = computed(() => defaults.value?.[props._as ?? name]);
|
|
643
|
+
const _props = new Proxy(props, { get(target, prop) {
|
|
644
|
+
const propValue = Reflect.get(target, prop);
|
|
645
|
+
if (prop === "class" || prop === "style") return [componentDefaults.value?.[prop], propValue].filter((v) => v != null);
|
|
646
|
+
if (propIsDefined(vm.vnode, prop)) return propValue;
|
|
647
|
+
const _componentDefault = componentDefaults.value?.[prop];
|
|
648
|
+
if (_componentDefault !== void 0) return _componentDefault;
|
|
649
|
+
const _globalDefault = defaults.value?.global?.[prop];
|
|
650
|
+
if (_globalDefault !== void 0) return _globalDefault;
|
|
651
|
+
return propValue;
|
|
652
|
+
} });
|
|
653
|
+
const _subcomponentDefaults = shallowRef();
|
|
654
|
+
watchEffect(() => {
|
|
655
|
+
if (componentDefaults.value) {
|
|
656
|
+
const subComponents = Object.entries(componentDefaults.value).filter(([key]) => key.startsWith(key[0].toUpperCase()));
|
|
657
|
+
_subcomponentDefaults.value = subComponents.length ? Object.fromEntries(subComponents) : void 0;
|
|
658
|
+
} else _subcomponentDefaults.value = void 0;
|
|
659
|
+
});
|
|
660
|
+
function provideSubDefaults() {
|
|
661
|
+
const injected = injectSelf(DefaultsSymbol, vm);
|
|
662
|
+
provide(DefaultsSymbol, computed(() => {
|
|
663
|
+
return _subcomponentDefaults.value ? mergeDeep(injected?.value ?? {}, _subcomponentDefaults.value) : injected?.value;
|
|
664
|
+
}));
|
|
665
|
+
}
|
|
666
|
+
return {
|
|
667
|
+
props: _props,
|
|
668
|
+
provideSubDefaults
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
function useDefaults(props = {}, name) {
|
|
672
|
+
const { props: _props, provideSubDefaults } = internalUseDefaults(props, name);
|
|
673
|
+
provideSubDefaults();
|
|
674
|
+
return _props;
|
|
675
|
+
}
|
|
676
|
+
//#endregion
|
|
677
|
+
//#region ../../../../node_modules/vuetify/lib/util/defineComponent.js
|
|
678
|
+
function defineComponent(options) {
|
|
679
|
+
options._setup = options._setup ?? options.setup;
|
|
680
|
+
if (!options.name) {
|
|
681
|
+
consoleWarn("The component is missing an explicit name, unable to generate default prop value");
|
|
682
|
+
return options;
|
|
683
|
+
}
|
|
684
|
+
if (options._setup) {
|
|
685
|
+
options.props = propsFactory(options.props ?? {}, options.name)();
|
|
686
|
+
const propKeys = Object.keys(options.props).filter((key) => key !== "class" && key !== "style");
|
|
687
|
+
options.filterProps = function filterProps(props) {
|
|
688
|
+
return pick(props, propKeys);
|
|
689
|
+
};
|
|
690
|
+
options.props._as = String;
|
|
691
|
+
options.setup = function setup(props, ctx) {
|
|
692
|
+
const defaults = injectDefaults();
|
|
693
|
+
if (!defaults.value) return options._setup(props, ctx);
|
|
694
|
+
const { props: _props, provideSubDefaults } = internalUseDefaults(props, props._as ?? options.name, defaults);
|
|
695
|
+
const setupBindings = options._setup(_props, ctx);
|
|
696
|
+
provideSubDefaults();
|
|
697
|
+
return setupBindings;
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
return options;
|
|
701
|
+
}
|
|
702
|
+
function genericComponent(exposeDefaults = true) {
|
|
703
|
+
return (options) => (exposeDefaults ? defineComponent : defineComponent$1)(options);
|
|
704
|
+
}
|
|
705
|
+
function defineFunctionalComponent(props, render) {
|
|
706
|
+
render.props = props;
|
|
707
|
+
return render;
|
|
708
|
+
}
|
|
709
|
+
//#endregion
|
|
710
|
+
export { omit as $, flattenFragments as A, humanReadableFileSize as B, destructComputed as C, extractNumber as D, eventName as E, getNextElement as F, isObject as G, isClickInsideElement as H, getObjectValueByPath as I, keyValues as J, isOn as K, getPropertyFromItem as L, focusableChildren as M, getDecimals as N, filterInputAttrs as O, getEventCoordinates as P, noop as Q, has as R, defer as S, escapeForRegex as T, isComposingIgnoreKey as U, includes as V, isEmpty as W, matchesSelector as X, keys as Y, mergeDeep as Z, clamp as _, consoleWarn as _t, createDefaults as a, refElement as at, debounce as b, getCurrentInstance as c, toKebabCase as ct, CircularBuffer as d, PREFERS_REDUCED_MOTION as dt, onlyDefinedProps as et, EventProp as f, SUPPORTS_EYE_DROPPER as ft, chunk as g, consoleError as gt, checkPrintable as h, SUPPORTS_TOUCH as ht, DefaultsSymbol as i, pickWithRest as it, focusChild as j, findChildrenWithProvide as k, getCurrentInstanceName as l, wrapInArray as lt, camelizeProps as m, SUPPORTS_MATCH_MEDIA as mt, defineFunctionalComponent as n, padStart as nt, provideDefaults as o, renderSlot as ot, callEvent as p, SUPPORTS_INTERSECTION as pt, isPrimitive as q, genericComponent as r, pick as rt, useDefaults as s, templateRef as st, defineComponent as t, padEnd as tt, propsFactory as u, IN_BROWSER as ut, convertToUnit as v, deprecate as vt, ensureValidVNode as w, deepToRaw as x, createRange as y, hasEvent as z };
|