@pie-element/fraction-model 6.1.2-next.0 → 6.1.2-next.1
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/author/model-options.js +35 -35
- package/dist/browser/author/index.js +7410 -7964
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js +1 -1
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/delivery/index.js +1 -1
- package/dist/browser/{delivery-BSG67wbh.js → delivery-BwB7hVA6.js} +8963 -9451
- package/dist/browser/delivery-BwB7hVA6.js.map +1 -0
- package/dist/browser/dist-DSzihwLW.js +85 -0
- package/dist/browser/dist-DSzihwLW.js.map +1 -0
- package/dist/controller/index.js +11 -11
- package/dist/delivery/index.js +8 -8
- package/dist/delivery/main.js +28 -28
- package/dist/index.iife.js +2 -2
- package/dist/runtime-support.d.ts +12 -0
- package/dist/runtime-support.js +12 -0
- package/package.json +12 -8
- package/dist/browser/delivery-BSG67wbh.js.map +0 -1
- package/dist/browser/isEmpty-Cj-5W3cl.js +0 -16
- package/dist/browser/isEmpty-Cj-5W3cl.js.map +0 -1
- package/dist/browser/isTypedArray-yL07_GBh.js +0 -171
- package/dist/browser/isTypedArray-yL07_GBh.js.map +0 -1
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +0 -57
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +0 -4
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +0 -23
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +0 -33
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +0 -4
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +0 -21
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +0 -6
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
//#region ../../shared/lodash/dist/index.js
|
|
2
|
+
var e = Object.prototype;
|
|
3
|
+
function t(e) {
|
|
4
|
+
return typeof e == "object" && !!e;
|
|
5
|
+
}
|
|
6
|
+
function n(e) {
|
|
7
|
+
return Array.isArray(e) ? e : typeof e == "number" ? [e] : e.replace(/\[(\d+)\]/g, ".$1").split(".").filter(Boolean);
|
|
8
|
+
}
|
|
9
|
+
function r(e) {
|
|
10
|
+
if (!t(e)) return e;
|
|
11
|
+
if (e instanceof Date) return new Date(e.getTime());
|
|
12
|
+
if (Array.isArray(e)) return e.map((e) => r(e));
|
|
13
|
+
let n = {};
|
|
14
|
+
for (let [t, i] of Object.entries(e)) n[t] = r(i);
|
|
15
|
+
return n;
|
|
16
|
+
}
|
|
17
|
+
function i(e) {
|
|
18
|
+
return (e ?? []).filter(Boolean);
|
|
19
|
+
}
|
|
20
|
+
function a(e, t = 0, n = {}) {
|
|
21
|
+
let r, i, a, o, s, c = n.leading === !0, l = n.trailing !== !1, u = () => {
|
|
22
|
+
if (!a) return s;
|
|
23
|
+
let t = a, n = o;
|
|
24
|
+
return a = void 0, o = void 0, s = e.apply(n, t), s;
|
|
25
|
+
}, d = () => {
|
|
26
|
+
r && clearTimeout(r), i && clearTimeout(i), r = void 0, i = void 0, a = void 0, o = void 0;
|
|
27
|
+
}, f = function(...e) {
|
|
28
|
+
let d = c && !r;
|
|
29
|
+
return a = e, o = this, d && u(), r && clearTimeout(r), r = setTimeout(() => {
|
|
30
|
+
r = void 0, i &&= (clearTimeout(i), void 0), l ? u() : (a = void 0, o = void 0);
|
|
31
|
+
}, t), n.maxWait !== void 0 && !i && (i = setTimeout(() => {
|
|
32
|
+
r && clearTimeout(r), r = void 0, i = void 0, l || !c ? u() : (a = void 0, o = void 0);
|
|
33
|
+
}, n.maxWait)), s;
|
|
34
|
+
};
|
|
35
|
+
return f.cancel = d, f.flush = () => (r &&= (clearTimeout(r), void 0), i &&= (clearTimeout(i), void 0), u()), f;
|
|
36
|
+
}
|
|
37
|
+
function o(e) {
|
|
38
|
+
let t = [];
|
|
39
|
+
for (let n of e ?? []) Array.isArray(n) ? t.push(...n) : t.push(n);
|
|
40
|
+
return t;
|
|
41
|
+
}
|
|
42
|
+
function s(e, t, r) {
|
|
43
|
+
let i = e;
|
|
44
|
+
for (let e of n(t)) {
|
|
45
|
+
if (i == null) return r;
|
|
46
|
+
i = i[e];
|
|
47
|
+
}
|
|
48
|
+
return i === void 0 ? r : i;
|
|
49
|
+
}
|
|
50
|
+
function c(e) {
|
|
51
|
+
return e == null ? !0 : typeof e == "string" || Array.isArray(e) ? e.length === 0 : e instanceof Map || e instanceof Set ? e.size === 0 : t(e) ? Object.keys(e).length === 0 : !0;
|
|
52
|
+
}
|
|
53
|
+
function l(n, r, i) {
|
|
54
|
+
let a = i?.(n, r);
|
|
55
|
+
if (a !== void 0) return !!a;
|
|
56
|
+
if (Object.is(n, r)) return !0;
|
|
57
|
+
if (!t(n) || !t(r)) return !1;
|
|
58
|
+
if (n instanceof Date || r instanceof Date) return n instanceof Date && r instanceof Date && n.getTime() === r.getTime();
|
|
59
|
+
if (Array.isArray(n) || Array.isArray(r)) return Array.isArray(n) && Array.isArray(r) && n.length === r.length && n.every((e, t) => l(e, r[t], i));
|
|
60
|
+
let o = Object.keys(n), s = Object.keys(r);
|
|
61
|
+
return o.length === s.length && o.every((t) => e.hasOwnProperty.call(r, t) && l(n[t], r[t], i));
|
|
62
|
+
}
|
|
63
|
+
function u(e, t) {
|
|
64
|
+
return l(e, t);
|
|
65
|
+
}
|
|
66
|
+
function d(e) {
|
|
67
|
+
return Number.isFinite(e);
|
|
68
|
+
}
|
|
69
|
+
function f(e, t) {
|
|
70
|
+
let n = { ...e ?? {} };
|
|
71
|
+
for (let e of Array.isArray(t) ? t : [t]) delete n[e];
|
|
72
|
+
return n;
|
|
73
|
+
}
|
|
74
|
+
function p(e, t) {
|
|
75
|
+
let n = t ?? ((e) => e);
|
|
76
|
+
return Array.from({ length: Math.max(0, e) }, (e, t) => n(t));
|
|
77
|
+
}
|
|
78
|
+
function m(...e) {
|
|
79
|
+
let t = Math.max(0, ...e.map((e) => e.length));
|
|
80
|
+
return Array.from({ length: t }, (t, n) => e.map((e) => e[n]));
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
export { a, m as c, o as d, f as i, i as l, d as n, r as o, c as r, p as s, u as t, s as u };
|
|
84
|
+
|
|
85
|
+
//# sourceMappingURL=dist-DSzihwLW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dist-DSzihwLW.js","names":[],"sources":["../../../../shared/lodash/dist/index.js"],"sourcesContent":["//#region src/index.ts\nvar e = Object.prototype;\nfunction t(e) {\n\treturn typeof e == \"object\" && !!e;\n}\nfunction n(e) {\n\treturn Array.isArray(e) ? e : typeof e == \"number\" ? [e] : e.replace(/\\[(\\d+)\\]/g, \".$1\").split(\".\").filter(Boolean);\n}\nfunction r(e) {\n\treturn (t) => x(t, e);\n}\nfunction i(e) {\n\treturn (n) => t(n) ? Object.entries(e).every(([e, t]) => A(n[e], t)) : !1;\n}\nfunction a(e) {\n\treturn typeof e == \"function\" ? e : typeof e == \"string\" ? r(e) : t(e) ? i(e) : ((e) => e);\n}\nfunction o(e, ...t) {\n\treturn Object.assign(e, ...t.filter(Boolean));\n}\nfunction s(e, t = 1) {\n\tif (!e?.length || t < 1) return [];\n\tlet n = [];\n\tfor (let r = 0; r < e.length; r += t) n.push(e.slice(r, r + t));\n\treturn n;\n}\nfunction c(e) {\n\treturn Array.isArray(e) ? e.slice() : t(e) ? { ...e } : e;\n}\nfunction l(e) {\n\tif (!t(e)) return e;\n\tif (e instanceof Date) return new Date(e.getTime());\n\tif (Array.isArray(e)) return e.map((e) => l(e));\n\tlet n = {};\n\tfor (let [t, r] of Object.entries(e)) n[t] = l(r);\n\treturn n;\n}\nfunction u(e) {\n\treturn (e ?? []).filter(Boolean);\n}\nfunction d(e, ...t) {\n\tlet n = [...e ?? []];\n\tfor (let e of t) Array.isArray(e) ? n.push(...e) : n.push(e);\n\treturn n;\n}\nfunction f(e, t = 0, n = {}) {\n\tlet r, i, a, o, s, c = n.leading === !0, l = n.trailing !== !1, u = () => {\n\t\tif (!a) return s;\n\t\tlet t = a, n = o;\n\t\treturn a = void 0, o = void 0, s = e.apply(n, t), s;\n\t}, d = () => {\n\t\tr && clearTimeout(r), i && clearTimeout(i), r = void 0, i = void 0, a = void 0, o = void 0;\n\t}, f = function(...e) {\n\t\tlet d = c && !r;\n\t\treturn a = e, o = this, d && u(), r && clearTimeout(r), r = setTimeout(() => {\n\t\t\tr = void 0, i &&= (clearTimeout(i), void 0), l ? u() : (a = void 0, o = void 0);\n\t\t}, t), n.maxWait !== void 0 && !i && (i = setTimeout(() => {\n\t\t\tr && clearTimeout(r), r = void 0, i = void 0, l || !c ? u() : (a = void 0, o = void 0);\n\t\t}, n.maxWait)), s;\n\t};\n\treturn f.cancel = d, f.flush = () => (r &&= (clearTimeout(r), void 0), i &&= (clearTimeout(i), void 0), u()), f;\n}\nfunction p(e, ...t) {\n\tfor (let n of t) if (n) for (let [t, r] of Object.entries(n)) e[t] === void 0 && (e[t] = r);\n\treturn e;\n}\nfunction m(e, ...t) {\n\tlet n = new Set(t.flat());\n\treturn (e ?? []).filter((e) => !n.has(e));\n}\nfunction h(e, t, n) {\n\treturn (e ?? []).filter((e) => !(t ?? []).some((t) => n(e, t)));\n}\nfunction g(e, t) {\n\tlet n = a(t), r = Array.isArray(e) ? e.entries() : Object.entries(e ?? {});\n\tfor (let [t, i] of r) if (!n(i, t, e)) return !1;\n\treturn !0;\n}\nfunction ee(e) {\n\treturn String(e).replace(/&/g, \"&\").replace(/</g, \"<\").replace(/>/g, \">\").replace(/\"/g, \""\").replace(/'/g, \"'\");\n}\nfunction _(e, t) {\n\tlet n = a(t), r = Array.isArray(e) ? e.entries() : Object.entries(e ?? {});\n\tfor (let [t, i] of r) if (n(i, t, e)) return i;\n}\nfunction v(e, t) {\n\tlet n = a(t);\n\tfor (let [t, r] of Object.entries(e ?? {})) if (n(r, t, e)) return t;\n}\nfunction y(e) {\n\tlet t = [];\n\tfor (let n of e ?? []) Array.isArray(n) ? t.push(...n) : t.push(n);\n\treturn t;\n}\nfunction te(e, t) {\n\treturn R(e, t).flat();\n}\nfunction b(e, t) {\n\tlet n = Array.isArray(e) ? e.entries() : Object.entries(e ?? {});\n\tfor (let [r, i] of n) t(i, r, e);\n\treturn e;\n}\nfunction x(e, t, r) {\n\tlet i = e;\n\tfor (let e of n(t)) {\n\t\tif (i == null) return r;\n\t\ti = i[e];\n\t}\n\treturn i === void 0 ? r : i;\n}\nfunction S(e, t) {\n\tlet n = a(t);\n\treturn K(e, (t, r, i) => {\n\t\tlet a = String(n(r, i, e));\n\t\treturn (t[a] ??= []).push(r), t;\n\t}, {});\n}\nfunction C(e) {\n\treturn e?.[0];\n}\nfunction w(e) {\n\treturn (e ?? []).slice(0, -1);\n}\nfunction T(e, t) {\n\treturn typeof e == \"string\" ? e.includes(String(t)) : Array.isArray(e) ? e.includes(t) : Object.values(e ?? {}).includes(t);\n}\nfunction E(...e) {\n\tlet [t, ...n] = e;\n\treturn $((t ?? []).filter((e) => n.every((t) => (t ?? []).includes(e))));\n}\nfunction D(e) {\n\treturn Array.isArray(e);\n}\nfunction O(e) {\n\treturn e == null ? !0 : typeof e == \"string\" || Array.isArray(e) ? e.length === 0 : e instanceof Map || e instanceof Set ? e.size === 0 : t(e) ? Object.keys(e).length === 0 : !0;\n}\nfunction k(n, r, i) {\n\tlet a = i?.(n, r);\n\tif (a !== void 0) return !!a;\n\tif (Object.is(n, r)) return !0;\n\tif (!t(n) || !t(r)) return !1;\n\tif (n instanceof Date || r instanceof Date) return n instanceof Date && r instanceof Date && n.getTime() === r.getTime();\n\tif (Array.isArray(n) || Array.isArray(r)) return Array.isArray(n) && Array.isArray(r) && n.length === r.length && n.every((e, t) => k(e, r[t], i));\n\tlet o = Object.keys(n), s = Object.keys(r);\n\treturn o.length === s.length && o.every((t) => e.hasOwnProperty.call(r, t) && k(n[t], r[t], i));\n}\nfunction A(e, t) {\n\treturn k(e, t);\n}\nfunction j(e, t, n) {\n\treturn k(e, t, n);\n}\nfunction M(e) {\n\treturn Number.isFinite(e);\n}\nfunction N(e) {\n\treturn typeof e == \"function\";\n}\nfunction P(e) {\n\treturn typeof e == \"number\" || e instanceof Number;\n}\nfunction F(e) {\n\treturn typeof e == \"object\" && !!e || typeof e == \"function\";\n}\nfunction I(e) {\n\treturn typeof e == \"string\" || e instanceof String;\n}\nfunction L(e) {\n\treturn e === void 0;\n}\nfunction R(e, t) {\n\tlet n = a(t), r = Array.isArray(e) ? e.entries() : Object.entries(e ?? {}), i = [];\n\tfor (let [t, a] of r) i.push(n(a, t, e));\n\treturn i;\n}\nfunction z(e) {\n\treturn e?.length ? Math.max(...e) : void 0;\n}\nfunction B(e, ...n) {\n\tfor (let r of n) if (r) for (let [n, i] of Object.entries(r)) t(i) && !Array.isArray(i) && t(e[n]) ? B(e[n], i) : e[n] = l(i);\n\treturn e;\n}\nfunction V(e, t) {\n\tlet n = { ...e ?? {} };\n\tfor (let e of Array.isArray(t) ? t : [t]) delete n[e];\n\treturn n;\n}\nfunction H(e, t) {\n\tlet n = a(t), r = {};\n\tfor (let [t, i] of Object.entries(e ?? {})) n(i, t, e) || (r[t] = i);\n\treturn r;\n}\nfunction U(e, ...t) {\n\tlet n = {};\n\tfor (let r of t.flat()) e && r in e && (n[r] = e[r]);\n\treturn n;\n}\nfunction W(e, t, n = 1) {\n\tlet r = t ?? e, i = t === void 0 ? 0 : e;\n\tif (n === 0) return [];\n\tlet a = [], o = n > 0;\n\tfor (let e = i; o ? e < r : e > r; e += n) a.push(e);\n\treturn a;\n}\nfunction G(e, t, n = 1) {\n\treturn W(e, t, n).reverse();\n}\nfunction K(e, t, n) {\n\tlet r = n, i = Array.isArray(e) ? e.entries() : Object.entries(e ?? {});\n\tfor (let [n, a] of i) r = t(r, a, n, e);\n\treturn r;\n}\nfunction q(e, t) {\n\tlet n = a(t), r = [];\n\tfor (let t = e.length - 1; t >= 0; t--) n(e[t], t, e) && r.unshift(...e.splice(t, 1));\n\treturn r;\n}\nfunction J(e, t, r) {\n\tlet i = n(t), a = e;\n\treturn i.forEach((e, t) => {\n\t\tif (t === i.length - 1) {\n\t\t\ta[e] = r;\n\t\t\treturn;\n\t\t}\n\t\tlet n = i[t + 1];\n\t\ta[e] ??= typeof n == \"number\" || /^\\d+$/.test(String(n)) ? [] : {}, a = a[e];\n\t}), e;\n}\nfunction Y(e) {\n\tlet t = [...e ?? []];\n\tfor (let e = t.length - 1; e > 0; e--) {\n\t\tlet n = Math.floor(Math.random() * (e + 1));\n\t\t[t[e], t[n]] = [t[n], t[e]];\n\t}\n\treturn t;\n}\nfunction X(e) {\n\treturn (e ?? []).slice(1);\n}\nfunction Z(e, t = 1) {\n\treturn t <= 0 ? [] : (e ?? []).slice(-t);\n}\nfunction Q(e, t = 0, n = {}) {\n\treturn f(e, t, {\n\t\tleading: n.leading !== !1,\n\t\ttrailing: n.trailing !== !1,\n\t\tmaxWait: t\n\t});\n}\nfunction ne(e, t) {\n\tlet n = t ?? ((e) => e);\n\treturn Array.from({ length: Math.max(0, e) }, (e, t) => n(t));\n}\nvar re = 0;\nfunction ie(e = \"\") {\n\treturn re += 1, `${e}${re}`;\n}\nfunction $(e) {\n\treturn Array.from(new Set(e ?? []));\n}\nfunction ae(e, t) {\n\tlet n = [];\n\tfor (let r of e ?? []) n.some((e) => t(r, e)) || n.push(r);\n\treturn n;\n}\nfunction oe(...e) {\n\tlet t = Math.max(0, ...e.map((e) => e.length));\n\treturn Array.from({ length: t }, (t, n) => e.map((e) => e[n]));\n}\nvar se = {\n\tassign: o,\n\tchunk: s,\n\tclone: c,\n\tcloneDeep: l,\n\tcompact: u,\n\tconcat: d,\n\tdebounce: f,\n\tdefaults: p,\n\tdifference: m,\n\tdifferenceWith: h,\n\tevery: g,\n\tescape: ee,\n\tfind: _,\n\tfindKey: v,\n\tflatten: y,\n\tflatMap: te,\n\tforEach: b,\n\tget: x,\n\tgroupBy: S,\n\thead: C,\n\tincludes: T,\n\tinitial: w,\n\tintersection: E,\n\tisArray: D,\n\tisEmpty: O,\n\tisEqual: A,\n\tisEqualWith: j,\n\tisFinite: M,\n\tisFunction: N,\n\tisNumber: P,\n\tisObject: F,\n\tisString: I,\n\tisUndefined: L,\n\tmap: R,\n\tmax: z,\n\tmerge: B,\n\tomit: V,\n\tomitBy: H,\n\tpick: U,\n\trange: W,\n\trangeRight: G,\n\treduce: K,\n\tremove: q,\n\tset: J,\n\tshuffle: Y,\n\ttail: X,\n\ttakeRight: Z,\n\tthrottle: Q,\n\ttimes: ne,\n\tuniqueId: ie,\n\tuniq: $,\n\tuniqWith: ae,\n\tzip: oe\n};\n//#endregion\nexport { o as assign, s as chunk, c as clone, l as cloneDeep, u as compact, d as concat, f as debounce, se as default, p as defaults, m as difference, h as differenceWith, ee as escape, g as every, _ as find, v as findKey, te as flatMap, y as flatten, b as forEach, x as get, S as groupBy, C as head, T as includes, w as initial, E as intersection, D as isArray, O as isEmpty, A as isEqual, j as isEqualWith, M as isFinite, N as isFunction, P as isNumber, F as isObject, I as isString, L as isUndefined, R as map, z as max, B as merge, V as omit, H as omitBy, U as pick, W as range, G as rangeRight, K as reduce, q as remove, J as set, Y as shuffle, X as tail, Z as takeRight, Q as throttle, ne as times, $ as uniq, ae as uniqWith, ie as uniqueId, oe as zip };\n"],"mappings":";AACA,IAAI,IAAI,OAAO;AACf,SAAS,EAAE,GAAG;CACb,OAAO,OAAO,KAAK,YAAY,CAAC,CAAC;A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E,CAAC;AAC9D"}
|
package/dist/controller/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "
|
|
1
|
+
import e from "./defaults.js";
|
|
2
|
+
import { isEmpty as t } from "@pie-element/shared-lodash";
|
|
3
3
|
//#region src/controller/index.ts
|
|
4
4
|
var n = (e, t, n = {}) => {
|
|
5
5
|
let r;
|
|
6
6
|
return r = e.allowedStudentConfig ? !!(t.partsPerModel === e.partsPerModel && s(t.response, e.partsPerModel) && o(e.correctResponse, t.response)) : !!(s(t.response, e.partsPerModel) && o(e.correctResponse, t.response)), r ? "correct" : "incorrect";
|
|
7
7
|
}, r = (e, t, r = {}) => {
|
|
8
8
|
if (t.mode === "evaluate") return n(e, r, t);
|
|
9
|
-
}, i = (e, t, n = {}) => +(r(e, t, n) === "correct"), a = (
|
|
10
|
-
!n ||
|
|
9
|
+
}, i = (e, t, n = {}) => +(r(e, t, n) === "correct"), a = (e, n, r) => new Promise((a) => {
|
|
10
|
+
!n || t(n) ? a({
|
|
11
11
|
score: 0,
|
|
12
12
|
empty: !0
|
|
13
|
-
}) : r.mode === "evaluate" ? a({ score: i(
|
|
13
|
+
}) : r.mode === "evaluate" ? a({ score: i(e, r, n.answers) }) : a({
|
|
14
14
|
score: void 0,
|
|
15
15
|
completed: void 0
|
|
16
16
|
});
|
|
@@ -26,13 +26,13 @@ var n = (e, t, n = {}) => {
|
|
|
26
26
|
e.value !== t && n++;
|
|
27
27
|
}), n <= 1;
|
|
28
28
|
} else return !1;
|
|
29
|
-
}, c = (
|
|
30
|
-
...
|
|
31
|
-
...
|
|
32
|
-
}), l = (
|
|
29
|
+
}, c = (t = {}) => ({
|
|
30
|
+
...e.model,
|
|
31
|
+
...t
|
|
32
|
+
}), l = (e, n, a) => new Promise((o) => {
|
|
33
33
|
n ||= {};
|
|
34
|
-
let s = c(
|
|
35
|
-
(!n ||
|
|
34
|
+
let s = c(e), l, u;
|
|
35
|
+
(!n || t(n)) && a.mode === "evaluate" ? (l = "unanswered", u = "0%") : (l = r(s, a, n && n.answers), u = `${i(s, a, n && n.answers) * 100}%`);
|
|
36
36
|
let d = {
|
|
37
37
|
score: u,
|
|
38
38
|
correctness: l
|
package/dist/delivery/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import e from "./fraction-model-chart.js";
|
|
2
|
-
import t from "
|
|
3
|
-
import n from "
|
|
4
|
-
import r from "react";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import t from "./main.js";
|
|
3
|
+
import n from "react";
|
|
4
|
+
import { createRoot as r } from "react-dom/client";
|
|
5
|
+
import { SessionChangedEvent as i } from "@pie-element/shared-player-events";
|
|
6
|
+
import { cloneDeep as a } from "@pie-element/shared-lodash";
|
|
7
7
|
import { renderMath as o } from "@pie-element/shared-math-rendering-mathjax";
|
|
8
8
|
//#region src/delivery/index.ts
|
|
9
9
|
var s = class extends HTMLElement {
|
|
@@ -29,19 +29,19 @@ var s = class extends HTMLElement {
|
|
|
29
29
|
onSessionChange(e) {
|
|
30
30
|
this._session.answers = e && e.answers;
|
|
31
31
|
let t = this.isSessionComplete(this._session, this._model);
|
|
32
|
-
this.dispatchEvent(new
|
|
32
|
+
this.dispatchEvent(new i(this.tagName.toLowerCase(), t));
|
|
33
33
|
}
|
|
34
34
|
connectedCallback() {
|
|
35
35
|
this._render();
|
|
36
36
|
}
|
|
37
37
|
_render() {
|
|
38
38
|
if (this._model && this._session) {
|
|
39
|
-
let e =
|
|
39
|
+
let e = a(this._model), i = n.createElement(t, {
|
|
40
40
|
model: e,
|
|
41
41
|
session: this._session,
|
|
42
42
|
onSessionChange: this.onSessionChange.bind(this)
|
|
43
43
|
});
|
|
44
|
-
this._root ||=
|
|
44
|
+
this._root ||= r(this), this._root.render(i), queueMicrotask(() => {
|
|
45
45
|
o(this);
|
|
46
46
|
});
|
|
47
47
|
}
|
package/dist/delivery/main.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import e from "./answer-fraction.js";
|
|
2
2
|
import t from "./fraction-model-chart.js";
|
|
3
|
-
import n from "
|
|
4
|
-
import r from "
|
|
5
|
-
import i from "
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import c from "@pie-lib/
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
3
|
+
import n from "react";
|
|
4
|
+
import r from "prop-types";
|
|
5
|
+
import { styled as i } from "@mui/material/styles";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
import s from "@pie-lib/correct-answer-toggle";
|
|
8
|
+
import { AlertDialog as c } from "@pie-lib/config-ui";
|
|
9
|
+
import * as l from "@pie-lib/render-ui";
|
|
10
|
+
import { PreviewPrompt as u, UiLayout as d } from "@pie-lib/render-ui";
|
|
11
|
+
import { cloneDeep as f } from "@pie-element/shared-lodash";
|
|
12
12
|
//#region src/delivery/main.tsx
|
|
13
13
|
function p(e) {
|
|
14
14
|
return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
|
|
@@ -16,14 +16,14 @@ function p(e) {
|
|
|
16
16
|
function m(e, t) {
|
|
17
17
|
return !e || p(e) ? e : p(e.default) ? e.default : t && p(e[t]) ? e[t] : t && p(e[t]?.default) ? e[t].default : e;
|
|
18
18
|
}
|
|
19
|
-
var h = m(
|
|
19
|
+
var h = m(d, "UiLayout") || m(y.UiLayout, "UiLayout"), g = m(u, "PreviewPrompt") || m(y.PreviewPrompt, "PreviewPrompt"), _ = l, v = _.default, y = v && typeof v == "object" ? v : _, b = i("div")({ padding: "16px" }), x = i("div")({
|
|
20
20
|
textAlign: "center",
|
|
21
21
|
fontSize: "20px"
|
|
22
|
-
}), S = class extends
|
|
22
|
+
}), S = class extends n.Component {
|
|
23
23
|
static propTypes = {
|
|
24
|
-
model:
|
|
25
|
-
session:
|
|
26
|
-
onSessionChange:
|
|
24
|
+
model: r.object,
|
|
25
|
+
session: r.object,
|
|
26
|
+
onSessionChange: r.func.isRequired
|
|
27
27
|
};
|
|
28
28
|
constructor(e) {
|
|
29
29
|
super(e), this.state = {
|
|
@@ -47,16 +47,16 @@ var h = m(f, "UiLayout") || m(y.UiLayout, "UiLayout"), g = m(d, "PreviewPrompt")
|
|
|
47
47
|
return e.allowedStudentConfig && (t.noOfModel = "", t.partsPerModel = ""), t;
|
|
48
48
|
};
|
|
49
49
|
onAnswerChange = (e) => {
|
|
50
|
-
let t =
|
|
50
|
+
let t = f(this.state.session), n = {
|
|
51
51
|
...this.state.session,
|
|
52
52
|
answers: e
|
|
53
53
|
};
|
|
54
54
|
e.response.length > 0 ? this.setState({ answerChangeDialog: {
|
|
55
55
|
open: !0,
|
|
56
56
|
oldSession: t,
|
|
57
|
-
newSession:
|
|
57
|
+
newSession: n,
|
|
58
58
|
text: "Changing either the Number of Models or Parts per Model will remove added answer. Are you sure you want to continue?"
|
|
59
|
-
} }) : this.setState((e) => ({ session:
|
|
59
|
+
} }) : this.setState((e) => ({ session: n }), this.callOnSessionChange);
|
|
60
60
|
};
|
|
61
61
|
toggleShowCorrect = (e) => {
|
|
62
62
|
this.setState({ showCorrect: e });
|
|
@@ -72,34 +72,34 @@ var h = m(f, "UiLayout") || m(y.UiLayout, "UiLayout"), g = m(d, "PreviewPrompt")
|
|
|
72
72
|
};
|
|
73
73
|
generateRandomKey = () => Math.floor(Math.random() * 1e4);
|
|
74
74
|
render() {
|
|
75
|
-
let { model: n } = this.props, { showCorrect: r, session: i, answerChangeDialog:
|
|
76
|
-
return /* @__PURE__ */
|
|
75
|
+
let { model: n } = this.props, { showCorrect: r, session: i, answerChangeDialog: l } = this.state, { prompt: u, title: d, correctness: f = {}, extraCSSRules: p, language: m } = n, _ = f.correctness && f.correctness !== "correct", v = this.generateRandomKey();
|
|
76
|
+
return /* @__PURE__ */ a(h, {
|
|
77
77
|
extraCSSRules: p,
|
|
78
|
-
children: /* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */
|
|
78
|
+
children: /* @__PURE__ */ o(b, { children: [
|
|
79
|
+
/* @__PURE__ */ a(x, { children: /* @__PURE__ */ a(g, {
|
|
80
80
|
className: "prompt",
|
|
81
81
|
prompt: d,
|
|
82
82
|
tagName: "h3"
|
|
83
83
|
}) }),
|
|
84
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ a(g, {
|
|
85
85
|
className: "prompt",
|
|
86
86
|
prompt: u,
|
|
87
87
|
tagName: "p"
|
|
88
88
|
}),
|
|
89
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ a(s, {
|
|
90
90
|
language: m,
|
|
91
91
|
show: _,
|
|
92
92
|
toggled: r,
|
|
93
93
|
onToggle: this.toggleShowCorrect
|
|
94
94
|
}),
|
|
95
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ a(e, {
|
|
96
96
|
model: n,
|
|
97
97
|
showCorrect: r,
|
|
98
98
|
disabled: n.view,
|
|
99
99
|
onAnswerChange: this.onAnswerChange,
|
|
100
100
|
answers: i.answers
|
|
101
101
|
}),
|
|
102
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ a(t, {
|
|
103
103
|
disabled: n.view,
|
|
104
104
|
value: r ? n.correctResponse : i.answers.response,
|
|
105
105
|
modelType: n.modelTypeSelected,
|
|
@@ -108,10 +108,10 @@ var h = m(f, "UiLayout") || m(y.UiLayout, "UiLayout"), g = m(d, "PreviewPrompt")
|
|
|
108
108
|
showLabel: n.showGraphLabels,
|
|
109
109
|
onChange: this.onResponseChange
|
|
110
110
|
}, v),
|
|
111
|
-
/* @__PURE__ */
|
|
112
|
-
open:
|
|
111
|
+
/* @__PURE__ */ a(c, {
|
|
112
|
+
open: l.open,
|
|
113
113
|
title: "Warning",
|
|
114
|
-
text:
|
|
114
|
+
text: l.text,
|
|
115
115
|
onConfirm: () => {
|
|
116
116
|
let e = this.state.answerChangeDialog.newSession;
|
|
117
117
|
e.answers.response = [], this.setState(() => ({
|