@trintel/zooy 1.0.7 → 1.0.9
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/chunks/{button-DXiFxUx8.js → button-B5xRFIEh.js} +1 -1
- package/dist/chunks/{button-TQ5Z_213.js → button-C4sd9gLh.js} +4 -4
- package/dist/chunks/{button-skeleton-BXdxtWxx.js → button-skeleton-Dk5IzDLm.js} +4 -4
- package/dist/chunks/{button-skeleton-CQt93l0e.js → button-skeleton-MZDqqf3a.js} +1 -1
- package/dist/chunks/{checkbox-BLqSgzPl.js → checkbox-BBsWqHhb.js} +1 -1
- package/dist/chunks/{checkbox-Ce4iv245.js → checkbox-DsM29E1F.js} +5 -5
- package/dist/chunks/{class-map-B8BVmL9r.js → class-map-Blob2x1Q.js} +1 -1
- package/dist/chunks/{class-map-DRKcPEMq.js → class-map-DxXUQv4a.js} +1 -1
- package/dist/chunks/{content-switcher-item-C4poRBhP.js → content-switcher-item-B5XFOV0z.js} +4 -4
- package/dist/chunks/{content-switcher-item-BNzxXCQj.js → content-switcher-item-CaQRCBTe.js} +1 -1
- package/dist/chunks/{dropdown-item-B1PbWipg.js → dropdown-item-CJp_mZ2I.js} +6 -6
- package/dist/chunks/{dropdown-item-3hXddUyA.js → dropdown-item-Cwh3NfDc.js} +1 -1
- package/dist/chunks/{icon-loader-HxMZmG1S.js → icon-loader-BRYZ9-dX.js} +1 -1
- package/dist/chunks/{icon-loader-l936Y1Y2.js → icon-loader-CehUsWUX.js} +1 -1
- package/dist/chunks/{icon-loader-utils-D2_soUEJ.js → icon-loader-utils-BaBsGFM_.js} +1 -1
- package/dist/chunks/{icon-loader-utils-xTU_7Gkv.js → icon-loader-utils-DfhPr5h_.js} +1 -1
- package/dist/chunks/{if-defined-Cg6S0WRd.js → if-defined--YV9wEAj.js} +1 -1
- package/dist/chunks/{if-defined-CyKOTQoD.js → if-defined-BHvp27Od.js} +1 -1
- package/dist/chunks/if-non-empty-96tm0-2Q.js +1 -0
- package/dist/chunks/{if-non-empty-DZ7mMVRO.js → if-non-empty-DaS9zyOo.js} +1 -1
- package/dist/chunks/{index-iyY99q2y.js → index-2bKxAUu7.js} +8 -8
- package/dist/chunks/{index-DuozJDSN.js → index-B6-ZBaD4.js} +1 -1
- package/dist/chunks/{index-xg2SMEcO.js → index-B6bs42I0.js} +7 -7
- package/dist/chunks/{index-_Sa5BYRO.js → index-BBAH7Ul-.js} +3 -3
- package/dist/chunks/{index-gdF6Bio7.js → index-BDJw9hLf.js} +7 -7
- package/dist/chunks/{index-B8pBsLur.js → index-BE0iYsJ5.js} +3 -3
- package/dist/chunks/{index-DGzE2hxO.js → index-BE5FgC1Z.js} +1 -1
- package/dist/chunks/{index-Ci2eq45L.js → index-BF8o2tS2.js} +1 -1
- package/dist/chunks/{index-DOg7jdf1.js → index-BLYL92KD.js} +1 -1
- package/dist/chunks/{index-7EHleExF.js → index-BM59oOIJ.js} +7 -7
- package/dist/chunks/{index-PONQKFP4.js → index-BPOTiBnU.js} +4 -4
- package/dist/chunks/{index-C7X38aQp.js → index-BQOq1vvH.js} +1 -1
- package/dist/chunks/{index-D23kSFT_.js → index-BSFdROB8.js} +1 -1
- package/dist/chunks/{index-BpOQerSE.js → index-BSSJRamX.js} +1 -1
- package/dist/chunks/{index-0Lh4HDpB.js → index-BXDKiGII.js} +2 -2
- package/dist/chunks/{index-CmSIemMe.js → index-BXwNOxmz.js} +1 -1
- package/dist/chunks/{index-Bq2MmIX9.js → index-BYa48BT4.js} +1 -1
- package/dist/chunks/{index-BKKlb0J7.js → index-BZ7ODxUk.js} +5 -5
- package/dist/chunks/index-BZWvbxle.js +1 -0
- package/dist/chunks/{index-CmX7hAxw.js → index-Bd3h6IUe.js} +4 -4
- package/dist/chunks/{index-ChNYD8Dd.js → index-BdRBUuLB.js} +1 -1
- package/dist/chunks/{index-BmHPEq-x.js → index-Bey-4kZC.js} +6 -6
- package/dist/chunks/{index-DFGqcn1K.js → index-BjrjLGm3.js} +2 -2
- package/dist/chunks/{index-Cm4XjDTR.js → index-BlM79rIk.js} +1 -1
- package/dist/chunks/{index-r12okTDD.js → index-BmUKW0kW.js} +3 -3
- package/dist/chunks/{index-BSGMH-5J.js → index-BnHoSTWv.js} +4 -4
- package/dist/chunks/{index-BBtImtqf.js → index-BodCpKSq.js} +8 -8
- package/dist/chunks/index-BpO6h6ag.js +2 -0
- package/dist/chunks/{index-BOjkgfX5.js → index-BsNCKhBs.js} +1 -1
- package/dist/chunks/{index-CP3IQOrv.js → index-BtS9nsdr.js} +1 -1
- package/dist/chunks/{index-Cm71ZZ2p.js → index-BvUQiKco.js} +1 -1
- package/dist/chunks/{index-BjPbzP32.js → index-BwiG-jwr.js} +1 -1
- package/dist/chunks/{index-Cp9vq51a.js → index-C0Ziv4Lg.js} +1 -1
- package/dist/chunks/{index-CA51gBqW.js → index-C276f5fW.js} +1 -1
- package/dist/chunks/{index-O55HRlOa.js → index-C4pmKhMw.js} +3 -3
- package/dist/chunks/{index-v8Mej-zS.js → index-C77hqhqA.js} +1 -1
- package/dist/chunks/{index-BpXTO-26.js → index-CAgqWzow.js} +5 -5
- package/dist/chunks/{index-BeW5et-a.js → index-CCfRgzXS.js} +5 -5
- package/dist/chunks/{index-BDFyGWAo.js → index-CDCT9JBg.js} +5 -5
- package/dist/chunks/{index-iDpB9zzg.js → index-CFqEaeKw.js} +1 -1
- package/dist/chunks/{index-CxH5pDYR.js → index-CHJDVytM.js} +4 -4
- package/dist/chunks/{index-cy4Z2pfI.js → index-CKECA6Bi.js} +1 -1
- package/dist/chunks/{index-DctJ73IF.js → index-CKgr4QI3.js} +1 -1
- package/dist/chunks/{index-CftYyZu7.js → index-CLaUpA-S.js} +3 -3
- package/dist/chunks/{index-BE10kyvs.js → index-CLmuZhI5.js} +1 -1
- package/dist/chunks/{index-CxHVh1p1.js → index-CMmmbJSh.js} +7 -7
- package/dist/chunks/{index-D1Thmc8o.js → index-CNU6h6vt.js} +5 -5
- package/dist/chunks/{index-DB-v93tm.js → index-CORy3Pa1.js} +1 -1
- package/dist/chunks/{index-hqRCDkdq.js → index-COpJjxt8.js} +1 -1
- package/dist/chunks/{index-BliqP2AV.js → index-CTJm7mCD.js} +3 -3
- package/dist/chunks/{index-C3bqrUco.js → index-CUy68xO6.js} +4 -4
- package/dist/chunks/{index-BbN7FHHT.js → index-CV_L-5I4.js} +1 -1
- package/dist/chunks/{index-D64SgGEt.js → index-CX_XoqUh.js} +5 -5
- package/dist/chunks/{index-xTZMbzwZ.js → index-CmoxVlhj.js} +6 -6
- package/dist/chunks/{index-Cih_eNJk.js → index-Co797QQC.js} +1 -1
- package/dist/chunks/{index-kFuNICSc.js → index-Crj9Sc_q.js} +1 -1
- package/dist/chunks/{index-D14WfIVq.js → index-D0c8Scw_.js} +5 -5
- package/dist/chunks/{index-C_raMAyX.js → index-D8NYnDWQ.js} +4 -4
- package/dist/chunks/{index-BcwmUX5U.js → index-DEV12jMj.js} +1 -1
- package/dist/chunks/index-DEh2-UZJ.js +77 -0
- package/dist/chunks/{index-CH_UJgBt.js → index-DExrBB06.js} +4 -4
- package/dist/chunks/index-DEybieKF.js +4 -0
- package/dist/chunks/{index-Bbb3ajlK.js → index-DG1HMDEs.js} +1 -1
- package/dist/chunks/{index-CvY-7pXV.js → index-DGlzUO5f.js} +1 -1
- package/dist/chunks/{index-DMh9lcW4.js → index-DHles42i.js} +1 -1
- package/dist/chunks/{index-CuftEO4n.js → index-DJXH0nsT.js} +6 -6
- package/dist/chunks/{index-Cveej1JO.js → index-DLut9sH5.js} +8 -8
- package/dist/chunks/{index-BRj3l6eo.js → index-DNQ0R54o.js} +3 -3
- package/dist/chunks/{index-QH_p6nSd.js → index-DOb7ppJl.js} +5 -5
- package/dist/chunks/{index-C5DktJE6.js → index-DSbYxfLs.js} +1 -1
- package/dist/chunks/{index-DzX6ELl7.js → index-DV5sL-Mh.js} +1 -1
- package/dist/chunks/{index-ChiL5ZcD.js → index-DZMcd93M.js} +1 -1
- package/dist/chunks/{index-0q2seZ_8.js → index-D_xHARJW.js} +7 -7
- package/dist/chunks/{index-B4Cub9lZ.js → index-DabYIcPl.js} +10 -10
- package/dist/chunks/{index-CdOow-p_.js → index-Db8hq1oK.js} +5 -5
- package/dist/chunks/{index-CjwO7zvd.js → index-DbFgxLQe.js} +1 -1
- package/dist/chunks/{index-C5BoQgTc.js → index-DdUuX4Oe.js} +1 -1
- package/dist/chunks/{index-Dh5yT9_B.js → index-DfCYA2CL.js} +1 -1
- package/dist/chunks/{index-O_mx3px1.js → index-Dg53tAoz.js} +1 -1
- package/dist/chunks/{index-CvE8pMER.js → index-DghXFP1_.js} +1 -1
- package/dist/chunks/{index-ByGJtavW.js → index-Dkz860Ep.js} +3 -3
- package/dist/chunks/{index-CukkZSZU.js → index-DlEnFuPS.js} +1 -1
- package/dist/chunks/{index-iN8x96sv.js → index-DsABJ0hu.js} +6 -6
- package/dist/chunks/{index-DiIjZO0F.js → index-DtglBHCQ.js} +1 -1
- package/dist/chunks/{index-Burct9SW.js → index-Du6Xt9iB.js} +7 -7
- package/dist/chunks/{index-BI2UKnaQ.js → index-Dui3Vi6K.js} +5 -5
- package/dist/chunks/{index-PMtj9tz1.js → index-DvWjvPHH.js} +1 -1
- package/dist/chunks/{index-Dqq-jEHd.js → index-GSWXkQ54.js} +2 -2
- package/dist/chunks/{index-BlNNYi81.js → index-L5Km9H8v.js} +1 -1
- package/dist/chunks/{index-CL9hiht6.js → index-NZ7MusKR.js} +2 -2
- package/dist/chunks/{index-Bzbuw3yc.js → index-PQIjb1W1.js} +6 -6
- package/dist/chunks/{index-DAjx5ZMD.js → index-PlhvaDKI.js} +3 -3
- package/dist/chunks/{index-DDZQVOSB.js → index-ZBHwSMvY.js} +1 -1
- package/dist/chunks/{index-j7S_4l8J.js → index-b3n-T2Mr.js} +5 -5
- package/dist/chunks/{index-BsLnUTt2.js → index-cneeu7y_.js} +1 -1
- package/dist/chunks/{index-8gFTsVpU.js → index-d5VkMQr5.js} +1 -1
- package/dist/chunks/{index-ClrFW2rW.js → index-i6Ep70AY.js} +1 -1
- package/dist/chunks/{index-D0-FP58R.js → index-loKB7cIv.js} +5 -5
- package/dist/chunks/{index-Dl5FFbv7.js → index-oJ5OnqqB.js} +1 -1
- package/dist/chunks/{index-BI7Rc11b.js → index-qRCcVUtv.js} +1 -1
- package/dist/chunks/{index-DxXhIc-b.js → index-sISDYHRo.js} +4 -4
- package/dist/chunks/{index-CUY1VtLr.js → index-tOWItg8e.js} +5 -5
- package/dist/chunks/{index-O65Gc9nS.js → index-uEl2EDxm.js} +1 -1
- package/dist/chunks/{index-DnJkSee7.js → index-zn8VBbbH.js} +9 -9
- package/dist/chunks/{loading-icon-0rgLngL8.js → loading-icon-BjhgIkxm.js} +1 -1
- package/dist/chunks/{loading-icon-Bc7ZUsBX.js → loading-icon-CzsLYW5d.js} +1 -1
- package/dist/chunks/{main-jVeZRB91.js → main-1YHLay2M.js} +822 -688
- package/dist/chunks/main-Dieh-js6.js +87 -0
- package/dist/chunks/{property-CaIoT4YE.js → property-PcxHNqC7.js} +1 -1
- package/dist/chunks/{property-1hLlCJhn.js → property-rHw5Qiya.js} +1 -1
- package/dist/chunks/{register-Dhwzu75D.js → register-BVB1VVdT.js} +1 -1
- package/dist/chunks/register-BVJ7Rj88.js +1 -0
- package/dist/chunks/{register-EjYAUKbP.js → register-D-bV-b_k.js} +1 -1
- package/dist/chunks/register-DGyCiJGq.js +1673 -0
- package/dist/chunks/{search-CHy8KUEr.js → search-BM3u-Up9.js} +6 -6
- package/dist/chunks/{search-BNcImhhb.js → search-ClNSlscR.js} +1 -1
- package/dist/chunks/{select-CE-WFB8J.js → select-item-5W4QUbqx.js} +32 -32
- package/dist/chunks/select-item-D6fUNCbb.js +80 -0
- package/dist/chunks/{state-DqznQRLe.js → state-0RlnmTzo.js} +1 -1
- package/dist/chunks/{state-IflcMO5o.js → state-Dt3SwvJx.js} +1 -1
- package/dist/chunks/{text-input-CLVbLjFT.js → text-input-BsExNRbn.js} +1 -1
- package/dist/chunks/{text-input-DQKK3f2L.js → text-input-DgwJ4KjV.js} +5 -5
- package/dist/chunks/{tooltip-content-CQHg7T5-.js → tooltip-content-BEFieAlC.js} +3 -3
- package/dist/chunks/{tooltip-content-CEgi8B6v.js → tooltip-content-DHqA_dS-.js} +1 -1
- package/dist/chunks/{unsafe-html-paXBFqeo.js → unsafe-html-CRC4ViH6.js} +1 -1
- package/dist/chunks/{unsafe-html-bHNwXACd.js → unsafe-html-GZdjQgYe.js} +1 -1
- package/dist/zooy.cjs.js +1 -1
- package/dist/zooy.es.js +1 -1
- package/package.json +2 -3
- package/src/sass/_zoo.scss +20 -0
- package/src/sass/main.scss +1 -0
- package/dist/chunks/if-non-empty-Dx4pitmj.js +0 -1
- package/dist/chunks/index-BvwBHGZ_.js +0 -4
- package/dist/chunks/index-DMMym9Yx.js +0 -1
- package/dist/chunks/index-Dp_RyMLM.js +0 -2
- package/dist/chunks/index-ibm_789V.js +0 -77
- package/dist/chunks/main-riBD0E5n.js +0 -65
- package/dist/chunks/register-BZGWnDHd.js +0 -1622
- package/dist/chunks/register-DSUjA_iL.js +0 -1
- package/dist/chunks/select-Dnt9tUQJ.js +0 -80
|
@@ -3,35 +3,35 @@ const numericString = "0123456789".split("");
|
|
|
3
3
|
const alphaLower = "abcdefghijklmnopqrstuvwxyz".split(""), alphaUpper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");
|
|
4
4
|
[...alphaLower, ...alphaUpper, ...numericString];
|
|
5
5
|
(/* @__PURE__ */ new Map()).set("true", !0).set("false", !1);
|
|
6
|
-
const compose = (...
|
|
6
|
+
const compose = (...U) => (...w) => U.reduce((D, O) => (F) => D(O(F)))(...w), identity = (U) => U, whatType = (U) => typeof U, isDef = (U) => U !== void 0, isUndefined = (U) => U === void 0, isDefAndNotNull = (U) => U != null, isString = (U) => whatType(U) === "string", isNumber = (U) => whatType(U) === "number" && !Number.isNaN(
|
|
7
7
|
/** @type number */
|
|
8
|
-
|
|
9
|
-
), isObject = (
|
|
8
|
+
U
|
|
9
|
+
), isObject = (U) => (U && typeof U == "object" && !(U instanceof Array) && !(U instanceof Set) && !(U instanceof Map) && !(U instanceof Date)) === !0, isArray = (U) => U instanceof Array, reverse = (U) => Array.from(U).reduce((w, D) => [D, ...w], []), toLowerCase = (U) => U.toLowerCase(), toString$1 = (U) => U + "", toNumber = (U) => +U;
|
|
10
10
|
compose(toLowerCase, toString$1);
|
|
11
11
|
const makeRandomString = () => {
|
|
12
|
-
let
|
|
13
|
-
return Math.floor(Math.random() *
|
|
14
|
-
}, stripLeadingChar = (
|
|
12
|
+
let U = 2147483648;
|
|
13
|
+
return Math.floor(Math.random() * U).toString(36) + Math.abs(Math.floor(Math.random() * U) ^ Date.now()).toString(36);
|
|
14
|
+
}, stripLeadingChar = (U) => (w) => w.startsWith(U) ? w.slice(U.length) : w, join = (U) => (w) => w.join(U);
|
|
15
15
|
compose(join(""), reverse);
|
|
16
|
-
const pathOr = (
|
|
17
|
-
const
|
|
16
|
+
const pathOr = (U, w) => (D) => {
|
|
17
|
+
const O = w.reduce((F, q) => {
|
|
18
18
|
try {
|
|
19
19
|
return F[maybeNumber(q)];
|
|
20
20
|
} catch {
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
23
|
}, D);
|
|
24
|
-
return
|
|
25
|
-
}, objToPaths = (
|
|
26
|
-
isObject(F) ? objToPaths(F, [...w,
|
|
27
|
-
}), D), randomId = (
|
|
24
|
+
return O === void 0 ? U : O;
|
|
25
|
+
}, objToPaths = (U, w = [], D = []) => (Object.entries(U).forEach(([O, F]) => {
|
|
26
|
+
isObject(F) ? objToPaths(F, [...w, O], D) : D.push([[...w, O], F]);
|
|
27
|
+
}), D), randomId = (U) => {
|
|
28
28
|
const w = makeRandomString();
|
|
29
|
-
return
|
|
30
|
-
}, maybeNumber = (
|
|
31
|
-
if (
|
|
32
|
-
return
|
|
33
|
-
const w = 1 *
|
|
34
|
-
return w > Number.MAX_SAFE_INTEGER || Number.isNaN(w) ?
|
|
29
|
+
return U ? w.substr(0, U) : w;
|
|
30
|
+
}, maybeNumber = (U) => {
|
|
31
|
+
if (U === null || whatType(U) === "string" && U.length > 1 && U.startsWith("0") && !U.startsWith("0."))
|
|
32
|
+
return U;
|
|
33
|
+
const w = 1 * U;
|
|
34
|
+
return w > Number.MAX_SAFE_INTEGER || Number.isNaN(w) ? U : w;
|
|
35
35
|
};
|
|
36
36
|
compose(toNumber, join(""), reverse, toString$1);
|
|
37
37
|
class Evt extends EventTarget {
|
|
@@ -139,10 +139,10 @@ class Evt extends EventTarget {
|
|
|
139
139
|
* @param {!Function} action
|
|
140
140
|
* @param {boolean|!Object} options
|
|
141
141
|
*/
|
|
142
|
-
listen(w, D,
|
|
143
|
-
w.addEventListener(D,
|
|
142
|
+
listen(w, D, O, F = !1) {
|
|
143
|
+
w.addEventListener(D, O, F);
|
|
144
144
|
const q = this.listeningTo.get(w) || {};
|
|
145
|
-
q[D] = () => w.removeEventListener(D,
|
|
145
|
+
q[D] = () => w.removeEventListener(D, O, F), this.listeningTo.set(w, q), isDef(w.isListenedToBy) && w.isListenedToBy(this);
|
|
146
146
|
}
|
|
147
147
|
/**
|
|
148
148
|
* Remove self from all components tt are listening to me.
|
|
@@ -157,9 +157,9 @@ class Evt extends EventTarget {
|
|
|
157
157
|
* @param {string=} opt_event
|
|
158
158
|
*/
|
|
159
159
|
stopListeningTo(w, D) {
|
|
160
|
-
w && this.listeningTo.has(w) && (isDef(w.isObservedBy) && w.isObservedBy.delete(this), isDef(D) ? (Object.entries(this.listeningTo.get(w)).forEach(([
|
|
161
|
-
|
|
162
|
-
}), Object.keys(this.listeningTo.get(w)).length || this.listeningTo.delete(w)) : (Object.values(this.listeningTo.get(w)).forEach((
|
|
160
|
+
w && this.listeningTo.has(w) && (isDef(w.isObservedBy) && w.isObservedBy.delete(this), isDef(D) ? (Object.entries(this.listeningTo.get(w)).forEach(([O, F]) => {
|
|
161
|
+
O === D && F();
|
|
162
|
+
}), Object.keys(this.listeningTo.get(w)).length || this.listeningTo.delete(w)) : (Object.values(this.listeningTo.get(w)).forEach((O) => O()), this.listeningTo.delete(w)));
|
|
163
163
|
}
|
|
164
164
|
/**
|
|
165
165
|
* Removes all the event listeners that is managed by this
|
|
@@ -184,8 +184,8 @@ class Evt extends EventTarget {
|
|
|
184
184
|
* @param {number} interval The interval in milliseconds
|
|
185
185
|
*/
|
|
186
186
|
doOnBeat(w, D) {
|
|
187
|
-
const
|
|
188
|
-
this.activeIntervals.add(
|
|
187
|
+
const O = setInterval(w, D);
|
|
188
|
+
this.activeIntervals.add(O);
|
|
189
189
|
}
|
|
190
190
|
/**
|
|
191
191
|
* Disposes of the component. Calls `exitDocument`, which is expected to
|
|
@@ -237,128 +237,106 @@ const UiEventType = {
|
|
|
237
237
|
READY: randomId(),
|
|
238
238
|
PANEL_MINIMIZE: randomId(),
|
|
239
239
|
FORM_SUBMIT_SUCCESS: randomId()
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
if (
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
function toDate(O) {
|
|
268
|
-
return O instanceof Date ? O : !isNaN(O) || /^\d+$/.test(O) ? new Date(parseInt(O)) : (O = (O || "").trim().replace(/\.\d+/, "").replace(/-/, "/").replace(/-/, "/").replace(/(\d)T(\d)/, "$1 $2").replace(/Z/, " UTC").replace(/([+-]\d\d):?(\d\d)/, " $1$2"), new Date(O));
|
|
269
|
-
}
|
|
270
|
-
function formatDiff(O, w) {
|
|
271
|
-
var D = O < 0 ? 1 : 0;
|
|
272
|
-
O = Math.abs(O);
|
|
273
|
-
for (var U = O, F = 0; O >= SEC_ARRAY[F] && F < SEC_ARRAY.length; F++)
|
|
274
|
-
O /= SEC_ARRAY[F];
|
|
275
|
-
return O = Math.floor(O), F *= 2, O > (F === 0 ? 9 : 1) && (F += 1), w(O, F, U)[D].replace("%s", O.toString());
|
|
276
|
-
}
|
|
277
|
-
function diffSec(O, w) {
|
|
278
|
-
var D = /* @__PURE__ */ new Date();
|
|
279
|
-
return (+D - +toDate(O)) / 1e3;
|
|
280
|
-
}
|
|
281
|
-
var format = function(O, w, D) {
|
|
282
|
-
var U = diffSec(O);
|
|
283
|
-
return formatDiff(U, getLocale(w));
|
|
284
|
-
};
|
|
285
|
-
register("en_US", en_US);
|
|
286
|
-
register("zh_CN", zh_CN);
|
|
287
|
-
const getInputChecked_ = function(O) {
|
|
288
|
-
return O.checked ? (
|
|
240
|
+
}, format = (U) => {
|
|
241
|
+
const D = Math.floor((/* @__PURE__ */ new Date() - U) / 1e3), O = [
|
|
242
|
+
{ name: "year", seconds: 31536e3 },
|
|
243
|
+
{ name: "month", seconds: 2592e3 },
|
|
244
|
+
{ name: "week", seconds: 604800 },
|
|
245
|
+
{ name: "day", seconds: 86400 },
|
|
246
|
+
{ name: "hour", seconds: 3600 },
|
|
247
|
+
{ name: "minute", seconds: 60 },
|
|
248
|
+
{ name: "second", seconds: 1 }
|
|
249
|
+
];
|
|
250
|
+
if (D < 0) {
|
|
251
|
+
const F = Math.abs(D);
|
|
252
|
+
for (const q of O) {
|
|
253
|
+
const W = Math.floor(F / q.seconds);
|
|
254
|
+
if (W >= 1)
|
|
255
|
+
return new Intl.RelativeTimeFormat("en", { numeric: "auto" }).format(W, q.name);
|
|
256
|
+
}
|
|
257
|
+
return "just now";
|
|
258
|
+
}
|
|
259
|
+
for (const F of O) {
|
|
260
|
+
const q = Math.floor(D / F.seconds);
|
|
261
|
+
if (q >= 1)
|
|
262
|
+
return new Intl.RelativeTimeFormat("en", { numeric: "auto" }).format(-q, F.name);
|
|
263
|
+
}
|
|
264
|
+
return "just now";
|
|
265
|
+
}, getInputChecked_ = function(U) {
|
|
266
|
+
return U.checked ? (
|
|
289
267
|
/** @type {?} */
|
|
290
|
-
|
|
268
|
+
U.value
|
|
291
269
|
) : null;
|
|
292
|
-
}, getSelectSingle_ = function(
|
|
270
|
+
}, getSelectSingle_ = function(U) {
|
|
293
271
|
const w = (
|
|
294
272
|
/** @type {!HTMLSelectElement} */
|
|
295
|
-
|
|
273
|
+
U.selectedIndex
|
|
296
274
|
);
|
|
297
275
|
return w >= 0 ? (
|
|
298
276
|
/** @type {!HTMLSelectElement} */
|
|
299
|
-
|
|
277
|
+
U.options[w].value
|
|
300
278
|
) : null;
|
|
301
|
-
}, getSelectMultiple_ = function(
|
|
279
|
+
}, getSelectMultiple_ = function(U) {
|
|
302
280
|
const w = [];
|
|
303
|
-
for (let D,
|
|
304
|
-
|
|
281
|
+
for (let D, O = 0; D = /** @type {!HTMLSelectElement} */
|
|
282
|
+
U.options[O]; O++)
|
|
305
283
|
D.selected && w.push(D.value);
|
|
306
284
|
return w.length ? w : null;
|
|
307
|
-
}, getValue = function(
|
|
285
|
+
}, getValue = function(U) {
|
|
308
286
|
const w = (
|
|
309
287
|
/** @type {!HTMLInputElement} */
|
|
310
|
-
|
|
288
|
+
U.type
|
|
311
289
|
);
|
|
312
290
|
switch (isString(w) && w.toLowerCase()) {
|
|
313
291
|
case "checkbox":
|
|
314
292
|
case "radio":
|
|
315
|
-
return getInputChecked_(
|
|
293
|
+
return getInputChecked_(U);
|
|
316
294
|
case "select-one":
|
|
317
|
-
return getSelectSingle_(
|
|
295
|
+
return getSelectSingle_(U);
|
|
318
296
|
case "select-multiple":
|
|
319
|
-
return getSelectMultiple_(
|
|
297
|
+
return getSelectMultiple_(U);
|
|
320
298
|
default:
|
|
321
|
-
return
|
|
299
|
+
return U.value !== null && U.value !== void 0 ? U.value : null;
|
|
322
300
|
}
|
|
323
|
-
}, formToJSON = (
|
|
301
|
+
}, formToJSON = (U) => [...U].reduce((w, D) => (w[D.name] = D.value, w), {}), replaceNode = (U, w) => {
|
|
324
302
|
const D = w.parentNode;
|
|
325
|
-
D && D.replaceChild(
|
|
326
|
-
}, removeNode = (
|
|
327
|
-
w.parentNode && w.parentNode.insertBefore(
|
|
328
|
-
}, isInPage = (
|
|
329
|
-
const w = window.getComputedStyle(
|
|
330
|
-
return D +
|
|
331
|
-
}, totalHeight = (
|
|
332
|
-
const w = window.getComputedStyle(
|
|
333
|
-
return D +
|
|
303
|
+
D && D.replaceChild(U, w);
|
|
304
|
+
}, removeNode = (U) => U && U.parentNode ? U.parentNode.removeChild(U) : null, insertSiblingAfter = (U, w) => {
|
|
305
|
+
w.parentNode && w.parentNode.insertBefore(U, w.nextSibling);
|
|
306
|
+
}, isInPage = (U) => U === document.body ? !1 : document.body.contains(U), getPos = (U) => [U.offsetLeft, U.offsetTop], randomColour = (U) => [1, 2, 3].map(() => Math.floor(Math.random() * 256) + 1).reduce((w, D) => `${w}${D},`, "rgba(") + `${U || 0.5}`, totalWidth = (U) => {
|
|
307
|
+
const w = window.getComputedStyle(U), D = U.offsetWidth, O = parseFloat(w.marginLeft) + parseFloat(w.marginRight), F = parseFloat(w.paddingLeft) + parseFloat(w.paddingRight), q = parseFloat(w.borderLeftWidth) + parseFloat(w.borderRightWidth);
|
|
308
|
+
return D + O - F + q;
|
|
309
|
+
}, totalHeight = (U) => {
|
|
310
|
+
const w = window.getComputedStyle(U), D = U.offsetHeight, O = parseFloat(w.marginTop) + parseFloat(w.marginBottom), F = parseFloat(w.paddingTop) + parseFloat(w.paddingBottom), q = parseFloat(w.borderTopWidth) + parseFloat(w.borderBottomWidth);
|
|
311
|
+
return D + O - F + q;
|
|
334
312
|
}, evalScripts = (comp) => (arr) => {
|
|
335
313
|
arr && Array.from(arr).forEach((s) => {
|
|
336
314
|
(function() {
|
|
337
315
|
eval(s.text);
|
|
338
316
|
}).bind(comp)();
|
|
339
317
|
});
|
|
340
|
-
}, evalModules = (
|
|
318
|
+
}, evalModules = (U) => (w) => {
|
|
341
319
|
w && Array.from(w).forEach((D) => {
|
|
342
320
|
(function() {
|
|
343
|
-
const
|
|
344
|
-
|
|
345
|
-
const F =
|
|
346
|
-
q && (F.zvComponent =
|
|
347
|
-
}).bind(
|
|
321
|
+
const O = document.createElement("script");
|
|
322
|
+
O.type = "module", O.textContent = D.textContent;
|
|
323
|
+
const F = U.getElement(), q = getElDataMap(D).zv_comp_access;
|
|
324
|
+
q && (F.zvComponent = U, F.classList.add(q)), F.appendChild(O);
|
|
325
|
+
}).bind(U)();
|
|
348
326
|
});
|
|
349
|
-
}, splitScripts = (
|
|
350
|
-
const D = new DOMParser().parseFromString(
|
|
327
|
+
}, splitScripts = (U) => {
|
|
328
|
+
const D = new DOMParser().parseFromString(U, "text/html");
|
|
351
329
|
return {
|
|
352
330
|
html: D.body.firstElementChild,
|
|
353
331
|
scripts: D.querySelectorAll('script:not([type="module"])'),
|
|
354
332
|
modules: D.querySelectorAll('script[type="module"]')
|
|
355
333
|
};
|
|
356
|
-
}, handleTemplateProm = (
|
|
357
|
-
D ?
|
|
358
|
-
}, toggleClass = (
|
|
359
|
-
const D = !Array.from(
|
|
360
|
-
return enableClass(
|
|
361
|
-
}, getElDataMap = (
|
|
334
|
+
}, handleTemplateProm = (U) => Promise.resolve(splitScripts(U)), enableClass = (U, w, D) => {
|
|
335
|
+
D ? U.classList.add(w) : U.classList.remove(w);
|
|
336
|
+
}, toggleClass = (U, w) => {
|
|
337
|
+
const D = !Array.from(U.classList).includes(w);
|
|
338
|
+
return enableClass(U, w, D), D;
|
|
339
|
+
}, getElDataMap = (U) => U ? Object.assign({}, U.dataset || {}) : {}, dtFormatter = {
|
|
362
340
|
year: "numeric",
|
|
363
341
|
month: "short",
|
|
364
342
|
day: "numeric",
|
|
@@ -378,13 +356,13 @@ const getInputChecked_ = function(O) {
|
|
|
378
356
|
second: "2-digit",
|
|
379
357
|
// hour12: false
|
|
380
358
|
hourCycle: "h23"
|
|
381
|
-
}), dateToZooyStdTimeString = (
|
|
382
|
-
const [{ value: w }, , { value: D }, , { value:
|
|
383
|
-
return `${D} ${w} ${
|
|
384
|
-
}, parseMomentAgo = (
|
|
385
|
-
let
|
|
386
|
-
isNumber(
|
|
387
|
-
const F = new Date(
|
|
359
|
+
}), dateToZooyStdTimeString = (U) => {
|
|
360
|
+
const [{ value: w }, , { value: D }, , { value: O }, , { value: F }, , { value: q }, , { value: W }, ,] = dtf.formatToParts(U);
|
|
361
|
+
return `${D} ${w} ${O} ${F}:${q}:${W}`;
|
|
362
|
+
}, parseMomentAgo = (U, w = "both", D = void 0) => {
|
|
363
|
+
let O = U;
|
|
364
|
+
isNumber(O) && O < 9466848e5 ? O = O * 1e3 : D && (O = O + D);
|
|
365
|
+
const F = new Date(O), q = format(F), W = dateToZooyStdTimeString(F);
|
|
388
366
|
switch (w) {
|
|
389
367
|
case "time|ago":
|
|
390
368
|
return `${W}|${q}`;
|
|
@@ -398,30 +376,30 @@ const getInputChecked_ = function(O) {
|
|
|
398
376
|
default:
|
|
399
377
|
return `${q} (${W})`;
|
|
400
378
|
}
|
|
401
|
-
}, parseObfuscated = (
|
|
402
|
-
const D = ((F) => (q) => q < F.length - 4)(
|
|
403
|
-
return ((F) => F.split("").map((q, W) => D(W) ? "*" : q).join(""))(
|
|
404
|
-
}, parseMap = (/* @__PURE__ */ new Map()).set(void 0, (
|
|
405
|
-
const
|
|
406
|
-
return
|
|
407
|
-
}), parseDataPropKvDef = (
|
|
408
|
-
const [F, q] =
|
|
379
|
+
}, parseObfuscated = (U) => {
|
|
380
|
+
const D = ((F) => (q) => q < F.length - 4)(U);
|
|
381
|
+
return ((F) => F.split("").map((q, W) => D(W) ? "*" : q).join(""))(U);
|
|
382
|
+
}, parseMap = (/* @__PURE__ */ new Map()).set(void 0, (U, w, D) => identity(U)).set("", (U, w, D) => identity(U)).set("class_update_only", (U, w, D) => identity(U)).set("frac_100", (U, w, D) => Math.round(U * 100 * 100) / 100).set("date_and_time", (U, w, D) => new Date(U).toLocaleString(void 0, dtFormatter)).set("date", (U, w, D) => new Date(U).toLocaleString(void 0, dFormatter)).set("moment_ago", (U, w, D) => parseMomentAgo(U, "both", D.zdd_date_tz || void 0)).set("moment_ago_only", (U, w, D) => parseMomentAgo(U, "ago", D.zdd_date_tz || void 0)).set("moment_ago_datetime", (U, w, D) => parseMomentAgo(U, "datetime", D.zdd_date_tz || void 0)).set("pretty-json", (U, w, D) => JSON.stringify(U, null, 4)).set("obfuscated", (U, w, D) => parseObfuscated(U)).set("linear-progress", (U, w, D) => {
|
|
383
|
+
const O = toNumber(D.zpmax), F = w.linProg;
|
|
384
|
+
return O && F && (F.progress = U / O, U = void 0), U;
|
|
385
|
+
}), parseDataPropKvDef = (U) => U.trim().split(",").map((O) => O.trim()).map((O) => {
|
|
386
|
+
const [F, q] = O.split(":").map((W) => W.trim());
|
|
409
387
|
return [F, q];
|
|
410
|
-
}).filter(([
|
|
411
|
-
const D = getElDataMap(
|
|
412
|
-
delete
|
|
413
|
-
const
|
|
414
|
-
return parseDataPropKvDef(
|
|
415
|
-
|
|
416
|
-
}),
|
|
417
|
-
}, mapDataToEls = (
|
|
388
|
+
}).filter(([O, F]) => O !== "" && F !== ""), parseDataProps = (U, w) => {
|
|
389
|
+
const D = getElDataMap(U);
|
|
390
|
+
delete U.dataset.zoodatapropkv;
|
|
391
|
+
const O = D.zoodatapropkv || "";
|
|
392
|
+
return parseDataPropKvDef(O).forEach(([q, W]) => {
|
|
393
|
+
U.dataset[q] = pathOr(void 0, W.split("."))(w);
|
|
394
|
+
}), U;
|
|
395
|
+
}, mapDataToEls = (U, w, D = /* @__PURE__ */ new Map(), O = void 0) => {
|
|
418
396
|
if (!w)
|
|
419
397
|
return;
|
|
420
398
|
const F = new Map([...parseMap, ...D]);
|
|
421
|
-
[...
|
|
422
|
-
const W = getElDataMap(q),
|
|
423
|
-
let
|
|
424
|
-
if (isDefAndNotNull(
|
|
399
|
+
[...U.querySelectorAll("[data-zdd],[data-zdd_class_update],[data-zdd_template_loop_index]")].forEach((q) => {
|
|
400
|
+
const W = getElDataMap(q), Y = W.zdd || "", G = W.zdd_parse_as, K = W.zdd_render_effect || "", Q = W.zdd_class_update, tt = W.zdd_template_loop_index, J = W.zdd_units || "";
|
|
401
|
+
let X = pathOr(void 0, Y.split("."))(w);
|
|
402
|
+
if (isDefAndNotNull(X) && (X = F.has(G) ? F.get(G)(X, q, W) : X), tt && isNumber(O) && (console.log("loopIndex: ", tt, " opt_loopIndex: ", O), tt === "zero_indexed" ? q.innerHTML = O : tt === "one_indexed" ? q.innerHTML = O + 1 : q.innerHTML = O), Q) {
|
|
425
403
|
const [Z, et, st] = Q.split(":"), rt = pathOr(void 0, Z.split("."))(w);
|
|
426
404
|
if (isDefAndNotNull(rt))
|
|
427
405
|
switch (et) {
|
|
@@ -441,26 +419,26 @@ const getInputChecked_ = function(O) {
|
|
|
441
419
|
break;
|
|
442
420
|
}
|
|
443
421
|
}
|
|
444
|
-
if (G === "templated-array" && isArray(
|
|
445
|
-
if (
|
|
422
|
+
if (G === "templated-array" && isArray(X))
|
|
423
|
+
if (X.length === 0)
|
|
446
424
|
q.classList.add("display__none");
|
|
447
425
|
else {
|
|
448
|
-
q.classList.remove("display__none"),
|
|
426
|
+
q.classList.remove("display__none"), X = X || [];
|
|
449
427
|
const Z = q.firstElementChild;
|
|
450
|
-
Z.classList.remove("display__none"), q.replaceChildren(...
|
|
428
|
+
Z.classList.remove("display__none"), q.replaceChildren(...X.map((et, st) => {
|
|
451
429
|
const rt = Z.cloneNode(!0), nt = parseDataProps(rt, et);
|
|
452
430
|
return mapDataToEls(nt, et, void 0, st), nt;
|
|
453
431
|
}));
|
|
454
432
|
}
|
|
455
|
-
else if (isDefAndNotNull(
|
|
433
|
+
else if (isDefAndNotNull(X))
|
|
456
434
|
if (K === "typewriter") {
|
|
457
435
|
let Z = 0;
|
|
458
|
-
const et =
|
|
436
|
+
const et = X + J, st = 5, rt = () => {
|
|
459
437
|
Z < et.length && (q.innerHTML += et.charAt(Z), Z++, setTimeout(rt, st));
|
|
460
438
|
};
|
|
461
439
|
q.innerHTML = "", rt();
|
|
462
440
|
} else
|
|
463
|
-
q.innerHTML =
|
|
441
|
+
q.innerHTML = X + J;
|
|
464
442
|
});
|
|
465
443
|
}, domUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
466
444
|
__proto__: null,
|
|
@@ -571,10 +549,10 @@ class ComponentLibraryRegistry {
|
|
|
571
549
|
*/
|
|
572
550
|
static getCacheStats() {
|
|
573
551
|
const w = {};
|
|
574
|
-
for (const [D,
|
|
552
|
+
for (const [D, O] of this.#t.entries())
|
|
575
553
|
w[D] = {
|
|
576
|
-
cacheSize:
|
|
577
|
-
config:
|
|
554
|
+
cacheSize: O.cache.size,
|
|
555
|
+
config: O.config
|
|
578
556
|
};
|
|
579
557
|
return w;
|
|
580
558
|
}
|
|
@@ -896,10 +874,10 @@ class Component extends Evt {
|
|
|
896
874
|
if (w)
|
|
897
875
|
for (const D of ComponentLibraryRegistry.getRegisteredLibraries())
|
|
898
876
|
try {
|
|
899
|
-
const
|
|
900
|
-
|
|
901
|
-
} catch (
|
|
902
|
-
console.debug(`[${D}] Cleanup error during component disposal (non-critical):`,
|
|
877
|
+
const O = ComponentLibraryRegistry.get(D);
|
|
878
|
+
O.dispose && O.dispose(w);
|
|
879
|
+
} catch (O) {
|
|
880
|
+
console.debug(`[${D}] Cleanup error during component disposal (non-critical):`, O);
|
|
903
881
|
}
|
|
904
882
|
super.dispose();
|
|
905
883
|
}
|
|
@@ -921,7 +899,7 @@ class Component extends Evt {
|
|
|
921
899
|
* if any of the handlers returns false this will also return false.
|
|
922
900
|
*/
|
|
923
901
|
dispatchCompEvent(w, D) {
|
|
924
|
-
const
|
|
902
|
+
const O = new ZooyEventData(w, D), F = Evt.makeEvent(UiEventType.COMP, O);
|
|
925
903
|
return this.dispatchEvent(F);
|
|
926
904
|
}
|
|
927
905
|
}
|
|
@@ -953,14 +931,14 @@ const EV = {
|
|
|
953
931
|
DROP: "drop",
|
|
954
932
|
// Transitions
|
|
955
933
|
TRANSITIONEND: "transitionend"
|
|
956
|
-
}, touchEvents = [EV.TOUCHMOVE, EV.TOUCHSTART, EV.TOUCHEND], isTouchEvent = (
|
|
934
|
+
}, touchEvents = [EV.TOUCHMOVE, EV.TOUCHSTART, EV.TOUCHEND], isTouchEvent = (U) => touchEvents.includes(U.type), normalizeEvent = (U) => (isTouchEvent(U) && (U.clientX = U.targetTouches[0].clientX, U.clientY = U.targetTouches[0].clientY), U), dragStartListener = (U, w, D, O) => (F) => {
|
|
957
935
|
F.preventDefault();
|
|
958
936
|
const q = normalizeEvent(F), W = (
|
|
959
937
|
/** @type {!HTMLElement} */
|
|
960
938
|
q.currentTarget
|
|
961
|
-
), [
|
|
962
|
-
let Z = freeMoveListener(
|
|
963
|
-
["x", "ew"].includes(
|
|
939
|
+
), [Y, G] = getPos(W), K = q.clientX - Y, Q = q.clientY - G, tt = U(Y, G, K, Q, W), J = D(Y, G, K, Q, W), X = w(Y, G, K, Q, W);
|
|
940
|
+
let Z = freeMoveListener(X, W, K, Q);
|
|
941
|
+
["x", "ew"].includes(O) ? Z = xMoveOnlyListener(X, W, K) : ["y", "ns"].includes(O) && (Z = yMoveOnlyListener(X, W, K, Q));
|
|
964
942
|
let et = !1;
|
|
965
943
|
const st = (nt) => {
|
|
966
944
|
et = !0, Z(nt);
|
|
@@ -968,30 +946,30 @@ const EV = {
|
|
|
968
946
|
document.removeEventListener(EV.MOUSEMOVE, st, !0), document.removeEventListener(EV.TOUCHMOVE, st, !0), document.removeEventListener(EV.MOUSEUP, rt, !0), document.removeEventListener(EV.TOUCHEND, rt, !0), et && J(nt);
|
|
969
947
|
};
|
|
970
948
|
return document.addEventListener(EV.MOUSEUP, rt, !0), document.addEventListener(EV.TOUCHEND, rt, !0), document.addEventListener(EV.MOUSEMOVE, st, !0), document.addEventListener(EV.TOUCHMOVE, st, !0), tt(F), rt;
|
|
971
|
-
}, freeMoveListener = (
|
|
949
|
+
}, freeMoveListener = (U, w, D, O) => (F) => {
|
|
972
950
|
F.preventDefault();
|
|
973
951
|
const q = normalizeEvent(F);
|
|
974
|
-
w.style.left = `${q.clientX - D}px`, w.style.top = `${q.clientY -
|
|
975
|
-
}, xMoveOnlyListener = (
|
|
952
|
+
w.style.left = `${q.clientX - D}px`, w.style.top = `${q.clientY - O}px`, U(q);
|
|
953
|
+
}, xMoveOnlyListener = (U, w, D, O) => (F) => {
|
|
976
954
|
F.preventDefault();
|
|
977
955
|
const q = normalizeEvent(F);
|
|
978
|
-
w.style.left = `${q.clientX - D}px`,
|
|
979
|
-
}, yMoveOnlyListener = (
|
|
956
|
+
w.style.left = `${q.clientX - D}px`, U(q);
|
|
957
|
+
}, yMoveOnlyListener = (U, w, D, O) => (F) => {
|
|
980
958
|
F.preventDefault();
|
|
981
959
|
const q = normalizeEvent(F);
|
|
982
|
-
w.style.top = `${q.clientY -
|
|
983
|
-
}, makeEmitter = (
|
|
984
|
-
|
|
985
|
-
component:
|
|
986
|
-
browserEvent:
|
|
960
|
+
w.style.top = `${q.clientY - O}px`, U(q);
|
|
961
|
+
}, makeEmitter = (U, w) => (D, O, F, q, W) => (Y) => {
|
|
962
|
+
U.dispatchCompEvent(w, {
|
|
963
|
+
component: U,
|
|
964
|
+
browserEvent: Y,
|
|
987
965
|
left: D,
|
|
988
|
-
top:
|
|
989
|
-
clientX:
|
|
990
|
-
clientY:
|
|
966
|
+
top: O,
|
|
967
|
+
clientX: Y.clientX,
|
|
968
|
+
clientY: Y.clientY,
|
|
991
969
|
xOrg: F,
|
|
992
970
|
yOrg: q,
|
|
993
|
-
deltaX:
|
|
994
|
-
deltaY:
|
|
971
|
+
deltaX: Y.clientX - F - D,
|
|
972
|
+
deltaY: Y.clientY - q - O,
|
|
995
973
|
target: W
|
|
996
974
|
});
|
|
997
975
|
};
|
|
@@ -1043,12 +1021,12 @@ class Dragger extends Component {
|
|
|
1043
1021
|
* Make the component draggable
|
|
1044
1022
|
*/
|
|
1045
1023
|
unlock() {
|
|
1046
|
-
const w = (D) => (
|
|
1047
|
-
this.#r = D(
|
|
1024
|
+
const w = (D) => (O) => {
|
|
1025
|
+
this.#r = D(O);
|
|
1048
1026
|
};
|
|
1049
1027
|
if (this.isInDocument && this.#s) {
|
|
1050
|
-
const D = makeEmitter(this, UiEventType.COMP_DRAG_MOVE),
|
|
1051
|
-
|
|
1028
|
+
const D = makeEmitter(this, UiEventType.COMP_DRAG_MOVE), O = makeEmitter(this, UiEventType.COMP_DRAG_START), F = makeEmitter(this, UiEventType.COMP_DRAG_END), q = dragStartListener(
|
|
1029
|
+
O,
|
|
1052
1030
|
D,
|
|
1053
1031
|
F,
|
|
1054
1032
|
this.#t
|
|
@@ -1070,41 +1048,41 @@ const splitRe_ = new RegExp(
|
|
|
1070
1048
|
), ComponentIndex = {
|
|
1071
1049
|
PATH: 5,
|
|
1072
1050
|
QUERY_DATA: 6
|
|
1073
|
-
}, split = (
|
|
1051
|
+
}, split = (U) => (
|
|
1074
1052
|
/** @type {!Array<string|undefined>} */
|
|
1075
|
-
|
|
1076
|
-
), decodeOrEmpty_ = (
|
|
1053
|
+
U.match(splitRe_)
|
|
1054
|
+
), decodeOrEmpty_ = (U, w) => U ? decodeURI(U.replace(/%25/g, "%2525")) : "", getPath = (U) => decodeOrEmpty_(split(U)[ComponentIndex.PATH]), getQueryData = (U) => decodeOrEmpty_(split(U)[ComponentIndex.QUERY_DATA]), objectToUrlParms = (U) => [...Object.entries(U)].map(
|
|
1077
1055
|
(w) => `${w[0]}=${w[1]}`
|
|
1078
|
-
).join("&"), isValidValue = (
|
|
1079
|
-
const [
|
|
1080
|
-
return isValidValue(
|
|
1056
|
+
).join("&"), isValidValue = (U) => U != null && U !== "", queryDataToMap = (U) => U.split("&").reduce((w, D) => {
|
|
1057
|
+
const [O, F] = D.split("=");
|
|
1058
|
+
return isValidValue(O) && isValidValue(F) && w.set(O, F), w;
|
|
1081
1059
|
}, /* @__PURE__ */ new Map()), uriUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1082
1060
|
__proto__: null,
|
|
1083
1061
|
getPath,
|
|
1084
1062
|
getQueryData,
|
|
1085
1063
|
objectToUrlParms,
|
|
1086
1064
|
queryDataToMap
|
|
1087
|
-
}, Symbol.toStringTag, { value: "Module" })), stripLeadingSpace = stripLeadingChar(" "), stripLeadingSlash = stripLeadingChar("/"), getCookieByName = (
|
|
1065
|
+
}, Symbol.toStringTag, { value: "Module" })), stripLeadingSpace = stripLeadingChar(" "), stripLeadingSlash = stripLeadingChar("/"), getCookieByName = (U) => document.cookie.split(";").map((w) => w.split("=")).reduce((w, D) => w.set(stripLeadingSpace(D[0]), D[1]), /* @__PURE__ */ new Map()).get(U), spinner = (U) => {
|
|
1088
1066
|
let w = 0, D;
|
|
1089
|
-
const
|
|
1067
|
+
const O = (F) => {
|
|
1090
1068
|
const q = F > 0;
|
|
1091
1069
|
return q ? w += 1 : w -= 1, q ? w === 1 : w === 0;
|
|
1092
1070
|
};
|
|
1093
1071
|
return (F) => {
|
|
1094
|
-
D = D || document.getElementById(
|
|
1072
|
+
D = D || document.getElementById(U), D && O(F) && D.classList.toggle("viz", w > 0);
|
|
1095
1073
|
};
|
|
1096
|
-
}, spin = spinner("the_loader"), startSpin = () => Promise.resolve(spin(1)), stopSpin = (
|
|
1074
|
+
}, spin = spinner("the_loader"), startSpin = () => Promise.resolve(spin(1)), stopSpin = (U) => (spin(0), Promise.resolve(U)), checkStatus = (U) => U.ok ? Promise.resolve(U) : Promise.reject(new Error(`${U.url} ${U.status} (${U.statusText})`)), checkStatusTwo = (U) => (w) => {
|
|
1097
1075
|
if (w.type === "opaqueredirect" || w.redirected) {
|
|
1098
1076
|
const D = stripLeadingSlash(getPath(w.url));
|
|
1099
|
-
|
|
1077
|
+
U.setIsRedirected(!0, D), console.log("Redirect detected", D);
|
|
1100
1078
|
}
|
|
1101
1079
|
return checkStatus(w);
|
|
1102
|
-
}, getJson = (
|
|
1080
|
+
}, getJson = (U) => U.json(), getText = (U) => U.text().then(
|
|
1103
1081
|
(w) => Promise.resolve(w),
|
|
1104
1082
|
(w) => Promise.reject(new Error(`Could not get text from response: ${w}`))
|
|
1105
|
-
), getTextOrJson = (
|
|
1083
|
+
), getTextOrJson = (U) => U.headers.get("Content-Type") === "application/json" ? getJson(U) : getText(U), jsonInit = (U, w, D = "POST", O = void 0) => {
|
|
1106
1084
|
const F = new Headers();
|
|
1107
|
-
F.append("Content-type", "application/json"), F.append("X-Requested-With", "XMLHttpRequest"),
|
|
1085
|
+
F.append("Content-type", "application/json"), F.append("X-Requested-With", "XMLHttpRequest"), U && U !== "" && F.append("Authorization", `Bearer ${U}`);
|
|
1108
1086
|
const q = {
|
|
1109
1087
|
cache: "no-cache",
|
|
1110
1088
|
method: D,
|
|
@@ -1112,8 +1090,8 @@ const splitRe_ = new RegExp(
|
|
|
1112
1090
|
credentials: "include",
|
|
1113
1091
|
body: JSON.stringify(w)
|
|
1114
1092
|
};
|
|
1115
|
-
return
|
|
1116
|
-
}, basicPutPostPatchInit = (
|
|
1093
|
+
return O && (q.signal = O), q;
|
|
1094
|
+
}, basicPutPostPatchInit = (U, w, D = !1, O = void 0) => {
|
|
1117
1095
|
const F = new Headers();
|
|
1118
1096
|
if (w && w !== "" && F.append("Authorization", `Bearer ${w}`), F.append("X-Requested-With", "XMLHttpRequest"), D) {
|
|
1119
1097
|
const W = getCookieByName("csrftoken");
|
|
@@ -1121,29 +1099,29 @@ const splitRe_ = new RegExp(
|
|
|
1121
1099
|
}
|
|
1122
1100
|
const q = {
|
|
1123
1101
|
cache: "no-cache",
|
|
1124
|
-
method:
|
|
1102
|
+
method: U,
|
|
1125
1103
|
headers: F,
|
|
1126
1104
|
redirect: "follow",
|
|
1127
1105
|
// This is anyway the default.
|
|
1128
1106
|
credentials: "include"
|
|
1129
1107
|
};
|
|
1130
|
-
return
|
|
1131
|
-
}, formPostInit = (
|
|
1132
|
-
const F = basicPutPostPatchInit("POST",
|
|
1108
|
+
return O && (q.signal = O), q;
|
|
1109
|
+
}, formPostInit = (U, w, D = void 0) => {
|
|
1110
|
+
const F = basicPutPostPatchInit("POST", U, !1, D);
|
|
1133
1111
|
return F.body = new FormData(w.formEl), F;
|
|
1134
|
-
}, basicGetInit = (
|
|
1112
|
+
}, basicGetInit = (U, w = void 0) => {
|
|
1135
1113
|
const D = new Headers();
|
|
1136
|
-
D.append("Authorization", `Bearer ${
|
|
1137
|
-
const
|
|
1114
|
+
D.append("Authorization", `Bearer ${U}`), D.append("X-Requested-With", "XMLHttpRequest");
|
|
1115
|
+
const O = {
|
|
1138
1116
|
cache: "no-cache",
|
|
1139
1117
|
headers: D,
|
|
1140
1118
|
credentials: "include"
|
|
1141
1119
|
};
|
|
1142
|
-
return w && (
|
|
1143
|
-
}, putPostPatchNobody = (
|
|
1144
|
-
const D = new Request(
|
|
1120
|
+
return w && (O.signal = w), O;
|
|
1121
|
+
}, putPostPatchNobody = (U, w) => {
|
|
1122
|
+
const D = new Request(U);
|
|
1145
1123
|
return fetch(D, w).then(checkStatus).then(getText);
|
|
1146
|
-
}, genCatchClause = (
|
|
1124
|
+
}, genCatchClause = (U, w = void 0) => (D) => (stopSpin("").then(identity), D.name === "AbortError" ? console.info(U, "ABORTED!") : console.error(U, D), w);
|
|
1147
1125
|
class UserManager {
|
|
1148
1126
|
/**
|
|
1149
1127
|
* @param {!Object=} opt_data
|
|
@@ -1204,12 +1182,12 @@ class UserManager {
|
|
|
1204
1182
|
* @return {Promise}
|
|
1205
1183
|
*/
|
|
1206
1184
|
formSubmit(w) {
|
|
1207
|
-
const D = new Request(w.uri.toString()),
|
|
1185
|
+
const D = new Request(w.uri.toString()), O = w.processSubmitReply.bind(w), F = genCatchClause("Form submit error");
|
|
1208
1186
|
return startSpin().then(() => fetch(D, formPostInit(
|
|
1209
1187
|
this.jwt,
|
|
1210
1188
|
w,
|
|
1211
1189
|
w.abortController.signal
|
|
1212
|
-
))).then(checkStatusTwo(w)).then(stopSpin).then(getTextOrJson).then(
|
|
1190
|
+
))).then(checkStatusTwo(w)).then(stopSpin).then(getTextOrJson).then(O).catch(F);
|
|
1213
1191
|
}
|
|
1214
1192
|
/**
|
|
1215
1193
|
* @param {string} uri
|
|
@@ -1217,11 +1195,11 @@ class UserManager {
|
|
|
1217
1195
|
* @param {AbortSignal|undefined} signal
|
|
1218
1196
|
* @return {Promise}
|
|
1219
1197
|
*/
|
|
1220
|
-
putNoBody(w, D = void 0,
|
|
1198
|
+
putNoBody(w, D = void 0, O = !1) {
|
|
1221
1199
|
const F = genCatchClause("putNobody error"), q = basicPutPostPatchInit(
|
|
1222
1200
|
"PUT",
|
|
1223
1201
|
this.jwt,
|
|
1224
|
-
|
|
1202
|
+
O,
|
|
1225
1203
|
D
|
|
1226
1204
|
);
|
|
1227
1205
|
return putPostPatchNobody(w, q).catch(F);
|
|
@@ -1232,8 +1210,8 @@ class UserManager {
|
|
|
1232
1210
|
* @return {Promise}
|
|
1233
1211
|
*/
|
|
1234
1212
|
fetch(w, D = void 0) {
|
|
1235
|
-
const
|
|
1236
|
-
return startSpin().then(() => fetch(
|
|
1213
|
+
const O = new Request(w.toString()), F = genCatchClause(`UMan Text GET Fetch: ${w}`);
|
|
1214
|
+
return startSpin().then(() => fetch(O, basicGetInit(this.jwt, D))).then(checkStatus).then(stopSpin).then(getText).catch(F);
|
|
1237
1215
|
}
|
|
1238
1216
|
/**
|
|
1239
1217
|
* Use this if you want to directly get a parsed template that does not go
|
|
@@ -1243,8 +1221,8 @@ class UserManager {
|
|
|
1243
1221
|
* @return {Promise}
|
|
1244
1222
|
*/
|
|
1245
1223
|
fetchAndSplit(w, D = void 0) {
|
|
1246
|
-
const
|
|
1247
|
-
return this.fetch(w, D).then(handleTemplateProm).catch(
|
|
1224
|
+
const O = genCatchClause(`fetchAndSplit: ${w}`);
|
|
1225
|
+
return this.fetch(w, D).then(handleTemplateProm).catch(O);
|
|
1248
1226
|
}
|
|
1249
1227
|
/**
|
|
1250
1228
|
* @param {string} uri
|
|
@@ -1252,13 +1230,13 @@ class UserManager {
|
|
|
1252
1230
|
* @return {Promise}
|
|
1253
1231
|
*/
|
|
1254
1232
|
async fetchJson(w, D = void 0) {
|
|
1255
|
-
const
|
|
1233
|
+
const O = new Request(w.toString()), F = genCatchClause(`fetchJson: ${w}`, {}), q = basicGetInit(this.jwt, D);
|
|
1256
1234
|
await startSpin();
|
|
1257
1235
|
let W = {};
|
|
1258
1236
|
try {
|
|
1259
|
-
W = await (await fetch(
|
|
1260
|
-
} catch (
|
|
1261
|
-
return F(
|
|
1237
|
+
W = await (await fetch(O, q)).json();
|
|
1238
|
+
} catch (Y) {
|
|
1239
|
+
return F(Y);
|
|
1262
1240
|
}
|
|
1263
1241
|
return await stopSpin(), W;
|
|
1264
1242
|
}
|
|
@@ -1268,8 +1246,8 @@ class UserManager {
|
|
|
1268
1246
|
* @param {AbortSignal|undefined} signal
|
|
1269
1247
|
* @return {Promise}
|
|
1270
1248
|
*/
|
|
1271
|
-
patchJson(w, D,
|
|
1272
|
-
const F = new Request(w.toString()), q = genCatchClause(`patchJson: ${w}`), W = jsonInit(this.jwt, D, "PATCH",
|
|
1249
|
+
patchJson(w, D, O = void 0) {
|
|
1250
|
+
const F = new Request(w.toString()), q = genCatchClause(`patchJson: ${w}`), W = jsonInit(this.jwt, D, "PATCH", O);
|
|
1273
1251
|
return fetch(F, W).then(checkStatus).then(getJson).catch(q);
|
|
1274
1252
|
}
|
|
1275
1253
|
/**
|
|
@@ -1278,8 +1256,8 @@ class UserManager {
|
|
|
1278
1256
|
* @param {AbortSignal|undefined} signal
|
|
1279
1257
|
* @return {Promise}
|
|
1280
1258
|
*/
|
|
1281
|
-
postJson(w, D,
|
|
1282
|
-
const F = new Request(w.toString()), q = genCatchClause(`postJson: ${w}`), W = jsonInit(this.jwt, D, "POST",
|
|
1259
|
+
postJson(w, D, O = void 0) {
|
|
1260
|
+
const F = new Request(w.toString()), q = genCatchClause(`postJson: ${w}`), W = jsonInit(this.jwt, D, "POST", O);
|
|
1283
1261
|
return fetch(F, W).then(checkStatus).then(getJson).catch(q);
|
|
1284
1262
|
}
|
|
1285
1263
|
/**
|
|
@@ -1288,8 +1266,8 @@ class UserManager {
|
|
|
1288
1266
|
* @param {AbortSignal|undefined} signal
|
|
1289
1267
|
* @return {Promise}
|
|
1290
1268
|
*/
|
|
1291
|
-
putJson(w, D,
|
|
1292
|
-
const F = new Request(w.toString()), q = genCatchClause(`putJson: ${w}`), W = jsonInit(this.jwt, D, "PUT",
|
|
1269
|
+
putJson(w, D, O = void 0) {
|
|
1270
|
+
const F = new Request(w.toString()), q = genCatchClause(`putJson: ${w}`), W = jsonInit(this.jwt, D, "PUT", O);
|
|
1293
1271
|
return fetch(F, W).then(checkStatus).then(getJson).catch(q);
|
|
1294
1272
|
}
|
|
1295
1273
|
/**
|
|
@@ -1298,8 +1276,8 @@ class UserManager {
|
|
|
1298
1276
|
* @param {AbortSignal|undefined} signal
|
|
1299
1277
|
* @return {Promise}
|
|
1300
1278
|
*/
|
|
1301
|
-
delJson(w, D,
|
|
1302
|
-
const F = new Request(w.toString()), q = genCatchClause(`delJson: ${w}`), W = jsonInit(this.jwt, D, "DELETE",
|
|
1279
|
+
delJson(w, D, O = void 0) {
|
|
1280
|
+
const F = new Request(w.toString()), q = genCatchClause(`delJson: ${w}`), W = jsonInit(this.jwt, D, "DELETE", O);
|
|
1303
1281
|
return fetch(F, W).then(checkStatus).then(getJson).catch(q);
|
|
1304
1282
|
}
|
|
1305
1283
|
}
|
|
@@ -1399,9 +1377,9 @@ class Panel extends Component {
|
|
|
1399
1377
|
getCarbonComponentById(w) {
|
|
1400
1378
|
if (this.carbonComponents)
|
|
1401
1379
|
for (const D of this.carbonComponents.values()) {
|
|
1402
|
-
const
|
|
1403
|
-
if (
|
|
1404
|
-
return
|
|
1380
|
+
const O = D.find((F) => F.id === w);
|
|
1381
|
+
if (O)
|
|
1382
|
+
return O;
|
|
1405
1383
|
}
|
|
1406
1384
|
}
|
|
1407
1385
|
//--[ Template Render ]-----
|
|
@@ -1422,10 +1400,10 @@ class Panel extends Component {
|
|
|
1422
1400
|
*/
|
|
1423
1401
|
renderWithTemplate(w) {
|
|
1424
1402
|
const D = this.user;
|
|
1425
|
-
return D ? D.fetch(this.uri, this.abortController.signal).then((
|
|
1403
|
+
return D ? D.fetch(this.uri, this.abortController.signal).then((O) => (this.assertCanRenderAsync(), w && w(this), this.onRenderWithTemplateReply(O).catch((F) => {
|
|
1426
1404
|
F.message !== Component.compErrors().ALREADY_DISPOSED && console.error("RenderWithTemplate Err:", F);
|
|
1427
|
-
}), this)).catch((
|
|
1428
|
-
throw console.error("Panel.renderWithTemplate fetch failed:",
|
|
1405
|
+
}), this)).catch((O) => {
|
|
1406
|
+
throw console.error("Panel.renderWithTemplate fetch failed:", O), O;
|
|
1429
1407
|
}) : Promise.reject(new Error("No UserManager instance available for Panel.renderWithTemplate()"));
|
|
1430
1408
|
}
|
|
1431
1409
|
/**
|
|
@@ -1457,16 +1435,16 @@ class Panel extends Component {
|
|
|
1457
1435
|
* @param qs
|
|
1458
1436
|
*/
|
|
1459
1437
|
onReplacePartialDom(w, D) {
|
|
1460
|
-
const
|
|
1461
|
-
if (isUndefined(
|
|
1438
|
+
const O = this.getElement();
|
|
1439
|
+
if (isUndefined(O))
|
|
1462
1440
|
return;
|
|
1463
1441
|
const F = w.html;
|
|
1464
1442
|
if (D.startsWith("."))
|
|
1465
|
-
[...
|
|
1443
|
+
[...O.querySelectorAll(D)].filter((q) => isDefAndNotNull(q.id)).map((q) => [q, F.querySelector(`#${q.id}`)]).filter(([q, W]) => isDefAndNotNull(W)).forEach(([q, W]) => {
|
|
1466
1444
|
q.parentNode.replaceChild(W, q), this.parseContent(W);
|
|
1467
1445
|
});
|
|
1468
1446
|
else if (D.startsWith("#")) {
|
|
1469
|
-
const q = F.querySelector(D), W =
|
|
1447
|
+
const q = F.querySelector(D), W = O.querySelector(D);
|
|
1470
1448
|
W.parentNode.replaceChild(q, W), this.parseContent(q);
|
|
1471
1449
|
}
|
|
1472
1450
|
this.evalScripts(w.scripts), this.evalModules(w.modules);
|
|
@@ -1479,10 +1457,10 @@ class Panel extends Component {
|
|
|
1479
1457
|
* that will receive the reply event.
|
|
1480
1458
|
*/
|
|
1481
1459
|
renderWithJSON(w) {
|
|
1482
|
-
return this.user ? this.user.fetchJson(this.uri_, this.abortController.signal).then((
|
|
1483
|
-
this.assertCanRenderAsync(), w && w(
|
|
1484
|
-
}).catch((
|
|
1485
|
-
throw console.error("Panel.renderWithJSON fetch failed:",
|
|
1460
|
+
return this.user ? this.user.fetchJson(this.uri_, this.abortController.signal).then((O) => {
|
|
1461
|
+
this.assertCanRenderAsync(), w && w(O, this), this.onRenderWithJSON(O).then(identity);
|
|
1462
|
+
}).catch((O) => {
|
|
1463
|
+
throw console.error("Panel.renderWithJSON fetch failed:", O), O;
|
|
1486
1464
|
}) : Promise.reject(new Error("No UserManager instance available for Panel.renderWithJSON()"));
|
|
1487
1465
|
}
|
|
1488
1466
|
/**
|
|
@@ -1499,7 +1477,7 @@ class Panel extends Component {
|
|
|
1499
1477
|
* @param {Object} _elDataMap
|
|
1500
1478
|
* @param {Object} _json
|
|
1501
1479
|
*/
|
|
1502
|
-
onAsyncJsonReply(w, D,
|
|
1480
|
+
onAsyncJsonReply(w, D, O) {
|
|
1503
1481
|
}
|
|
1504
1482
|
/**
|
|
1505
1483
|
* Called on each async HTML response, after the content is in the DOM
|
|
@@ -1523,7 +1501,7 @@ class Panel extends Component {
|
|
|
1523
1501
|
parseContent(w) {
|
|
1524
1502
|
if (this.debugMe("Enable interactions. Panel:", w), typeof window.customElements < "u" && ComponentLibraryRegistry.has("carbon")) {
|
|
1525
1503
|
const J = ComponentLibraryRegistry.get("carbon");
|
|
1526
|
-
J.render.call(this, w, J.cache).catch((
|
|
1504
|
+
J.render.call(this, w, J.cache).catch((X) => console.error("[Zooy] Carbon initialization failed:", X));
|
|
1527
1505
|
}
|
|
1528
1506
|
if (ComponentLibraryRegistry.has("mdc")) {
|
|
1529
1507
|
const J = ComponentLibraryRegistry.get("mdc");
|
|
@@ -1534,80 +1512,80 @@ class Panel extends Component {
|
|
|
1534
1512
|
}), [...w.querySelectorAll(
|
|
1535
1513
|
".zoo__button:not(.external):not(.mdc-data-table__row)"
|
|
1536
1514
|
)].forEach((J) => {
|
|
1537
|
-
this.listen(J, EV.CLICK, (
|
|
1538
|
-
|
|
1539
|
-
const Z =
|
|
1515
|
+
this.listen(J, EV.CLICK, (X) => {
|
|
1516
|
+
X.stopPropagation();
|
|
1517
|
+
const Z = X.currentTarget, et = getElDataMap(Z);
|
|
1540
1518
|
this.dispatchPanelEvent(et.zv, Object.assign({
|
|
1541
|
-
orgEvt:
|
|
1519
|
+
orgEvt: X,
|
|
1542
1520
|
trigger: Z,
|
|
1543
1521
|
href: Z.href || et.href
|
|
1544
1522
|
}, et));
|
|
1545
1523
|
});
|
|
1546
1524
|
}), [...w.querySelectorAll("[href]:not(.external)")].forEach((J) => {
|
|
1547
|
-
this.listen(J, EV.CLICK, (
|
|
1548
|
-
const Z =
|
|
1549
|
-
|
|
1525
|
+
this.listen(J, EV.CLICK, (X) => {
|
|
1526
|
+
const Z = X.currentTarget;
|
|
1527
|
+
X.preventDefault(), X.stopPropagation();
|
|
1550
1528
|
const et = getElDataMap(Z), st = et.zv || "href";
|
|
1551
1529
|
this.dispatchPanelEvent(st, Object.assign({
|
|
1552
|
-
orgEvt:
|
|
1553
|
-
trigger:
|
|
1530
|
+
orgEvt: X,
|
|
1531
|
+
trigger: X.target,
|
|
1554
1532
|
href: Z.href || et.href
|
|
1555
1533
|
}, et));
|
|
1556
1534
|
});
|
|
1557
1535
|
}), [...w.querySelectorAll("form.intercept_submit")].forEach((J) => {
|
|
1558
|
-
J.noValidate = !0, this.listen(J, EV.SUBMIT, (
|
|
1559
|
-
|
|
1536
|
+
J.noValidate = !0, this.listen(J, EV.SUBMIT, (X) => {
|
|
1537
|
+
X.preventDefault(), X.stopPropagation();
|
|
1560
1538
|
const Z = getElDataMap(J), et = formToJSON(J.elements);
|
|
1561
1539
|
this.dispatchPanelEvent(Z.zv, Object.assign({
|
|
1562
|
-
orgEvt:
|
|
1563
|
-
trigger:
|
|
1540
|
+
orgEvt: X,
|
|
1541
|
+
trigger: X.target,
|
|
1564
1542
|
formData: et,
|
|
1565
1543
|
href: Z.href
|
|
1566
1544
|
}, Z));
|
|
1567
1545
|
});
|
|
1568
1546
|
}), [...w.querySelectorAll(".zoo__toggle_class_driver")].forEach(
|
|
1569
1547
|
(J) => {
|
|
1570
|
-
const
|
|
1548
|
+
const X = getElDataMap(J), Z = X.toggle_class_target_id, et = X.toggle_class, st = w.querySelector(`#${Z}`);
|
|
1571
1549
|
st && et && J.addEventListener(EV.CLICK, (rt) => {
|
|
1572
1550
|
rt.stopPropagation(), st.classList.toggle(et);
|
|
1573
1551
|
});
|
|
1574
1552
|
}
|
|
1575
1553
|
);
|
|
1576
|
-
const D = Array.from(w.querySelectorAll(".folder_drop_zone")),
|
|
1554
|
+
const D = Array.from(w.querySelectorAll(".folder_drop_zone")), O = Array.from(w.querySelectorAll("[draggable]")), F = (J) => {
|
|
1577
1555
|
J.preventDefault(), J.target.classList.add("drag_over");
|
|
1578
1556
|
}, q = (J) => {
|
|
1579
1557
|
J.preventDefault();
|
|
1580
1558
|
}, W = (J) => {
|
|
1581
1559
|
J.preventDefault(), J.target.classList.remove("drag_over");
|
|
1582
|
-
},
|
|
1560
|
+
}, Y = (J) => {
|
|
1583
1561
|
J.preventDefault(), J.target.classList.remove("drag_over");
|
|
1584
1562
|
}, G = (J) => {
|
|
1585
1563
|
J.preventDefault(), J.target.classList.remove("drag_over");
|
|
1586
1564
|
}, K = (J) => {
|
|
1587
1565
|
J.dataTransfer.dropEffect = "move";
|
|
1588
|
-
const
|
|
1589
|
-
J.dataTransfer.setData("text/plain", JSON.stringify(
|
|
1566
|
+
const X = getElDataMap(J.target);
|
|
1567
|
+
J.dataTransfer.setData("text/plain", JSON.stringify(X)), J.target.classList.add("drag_in_progress");
|
|
1590
1568
|
}, Q = (J) => {
|
|
1591
1569
|
J.target.classList.remove("drag_in_progress");
|
|
1592
1570
|
}, tt = (J) => {
|
|
1593
1571
|
G(J), J.stopPropagation();
|
|
1594
|
-
const
|
|
1572
|
+
const X = JSON.parse(J.dataTransfer.getData("text/plain")), Z = getElDataMap(J.target);
|
|
1595
1573
|
return this.dispatchPanelEvent("drop_on", {
|
|
1596
|
-
custom: { on: Z, from:
|
|
1574
|
+
custom: { on: Z, from: X }
|
|
1597
1575
|
}), !1;
|
|
1598
1576
|
};
|
|
1599
1577
|
D.forEach((J) => {
|
|
1600
|
-
this.listen(J, EV.DRAGOVER, q), this.listen(J, EV.DRAGENTER, F), this.listen(J, EV.DRAGEXIT,
|
|
1601
|
-
}),
|
|
1578
|
+
this.listen(J, EV.DRAGOVER, q), this.listen(J, EV.DRAGENTER, F), this.listen(J, EV.DRAGEXIT, Y), this.listen(J, EV.DRAGLEAVE, W), this.listen(J, EV.DROP, tt);
|
|
1579
|
+
}), O.forEach((J) => {
|
|
1602
1580
|
this.listen(J, EV.DRAGSTART, K), this.listen(J, EV.DRAGEND, Q);
|
|
1603
1581
|
}), [...w.querySelectorAll(".zoo_async_json")].forEach((J) => {
|
|
1604
|
-
const
|
|
1582
|
+
const X = getElDataMap(J), Z = X.href, et = this.onAsyncJsonReply.bind(this, J, X);
|
|
1605
1583
|
this.user.fetchJson(Z, this.abortController.signal).then(et);
|
|
1606
|
-
const st =
|
|
1584
|
+
const st = X.z_json_reusable;
|
|
1607
1585
|
st && (this.jsonCallFuncs = this.jsonCallFuncs || {}, this.jsonCallFuncs[st] = () => {
|
|
1608
1586
|
this.user.fetchJson(Z, this.abortController.signal).then(et);
|
|
1609
1587
|
});
|
|
1610
|
-
const rt = toNumber(
|
|
1588
|
+
const rt = toNumber(X.z_interval);
|
|
1611
1589
|
isNumber(rt) && this.doOnBeat(() => {
|
|
1612
1590
|
this.user.fetchJson(Z, this.abortController.signal).then(et);
|
|
1613
1591
|
}, rt * 60 * 1e3);
|
|
@@ -1616,11 +1594,11 @@ class Panel extends Component {
|
|
|
1616
1594
|
* @param {Element} el
|
|
1617
1595
|
*/
|
|
1618
1596
|
(J) => {
|
|
1619
|
-
const
|
|
1597
|
+
const X = getElDataMap(J), Z = X.href;
|
|
1620
1598
|
this.user.fetchAndSplit(Z, this.abortController.signal).then((st) => {
|
|
1621
|
-
J.appendChild(st.html), this.parseContent(J), this.evalScripts(st.scripts), this.evalModules(st.modules), this.onAsyncHtmlReply(J,
|
|
1599
|
+
J.appendChild(st.html), this.parseContent(J), this.evalScripts(st.scripts), this.evalModules(st.modules), this.onAsyncHtmlReply(J, X);
|
|
1622
1600
|
});
|
|
1623
|
-
const et = toNumber(
|
|
1601
|
+
const et = toNumber(X.z_interval);
|
|
1624
1602
|
isNumber(et) && this.doOnBeat(() => {
|
|
1625
1603
|
this.user.fetchAndSplit(Z, this.abortController.signal).then((st) => {
|
|
1626
1604
|
J.replaceChildren(st.html), this.parseContent(J), this.evalScripts(st.scripts), this.evalModules(st.modules);
|
|
@@ -1672,7 +1650,7 @@ class Panel extends Component {
|
|
|
1672
1650
|
* or if any of the handlers returns false this will also return false.
|
|
1673
1651
|
*/
|
|
1674
1652
|
dispatchPanelEvent(w, D) {
|
|
1675
|
-
const
|
|
1653
|
+
const O = new ZooyEventData(w, D), F = Evt.makeEvent(UiEventType.PANEL, O);
|
|
1676
1654
|
return this.debugMe(`PANEL EVENT FIRED:
|
|
1677
1655
|
value:${w}
|
|
1678
1656
|
data:${D}`), this.dispatchEvent(F);
|
|
@@ -1697,7 +1675,7 @@ class FormPanel extends Panel {
|
|
|
1697
1675
|
* @param {boolean} intercept If false, we do not try and intercept the forms
|
|
1698
1676
|
*/
|
|
1699
1677
|
constructor(w, D = !0) {
|
|
1700
|
-
super(w), this.#s = D, this.onSubmitSucFunc = (
|
|
1678
|
+
super(w), this.#s = D, this.onSubmitSucFunc = (O, F) => null;
|
|
1701
1679
|
}
|
|
1702
1680
|
/**
|
|
1703
1681
|
* Gets the form element managed by this panel.
|
|
@@ -1726,12 +1704,12 @@ class FormPanel extends Panel {
|
|
|
1726
1704
|
* @return {?HTMLFormElement}
|
|
1727
1705
|
*/
|
|
1728
1706
|
getFormFromId(w) {
|
|
1729
|
-
let D = null,
|
|
1730
|
-
return w && (
|
|
1707
|
+
let D = null, O = this.getElement().querySelector("form");
|
|
1708
|
+
return w && (O = document.getElementById(
|
|
1731
1709
|
/** @type {string} */
|
|
1732
1710
|
w
|
|
1733
|
-
) ||
|
|
1734
|
-
|
|
1711
|
+
) || O), O && O.tagName.toLowerCase() === "form" && (D = /** @type {HTMLFormElement} */
|
|
1712
|
+
O), D;
|
|
1735
1713
|
}
|
|
1736
1714
|
//--[ Field Validation Methods ]--
|
|
1737
1715
|
/**
|
|
@@ -1766,7 +1744,7 @@ class FormPanel extends Panel {
|
|
|
1766
1744
|
* Clear all existing validation errors
|
|
1767
1745
|
*/
|
|
1768
1746
|
clearAllValidationErrors() {
|
|
1769
|
-
[...this.#t ? this.#t.elements : []].forEach((
|
|
1747
|
+
[...this.#t ? this.#t.elements : []].forEach((O) => this.#i(O)), [...this.#t.querySelectorAll(".non-field-errors")].forEach((O) => O.classList.remove("alert-error"));
|
|
1770
1748
|
}
|
|
1771
1749
|
/**
|
|
1772
1750
|
* Format the message dom object and insert it into the DOM
|
|
@@ -1775,7 +1753,7 @@ class FormPanel extends Panel {
|
|
|
1775
1753
|
* @param {string} _css A CSS class name to add to the alert div.
|
|
1776
1754
|
* @private
|
|
1777
1755
|
*/
|
|
1778
|
-
displayAlert_(w, D,
|
|
1756
|
+
displayAlert_(w, D, O) {
|
|
1779
1757
|
const F = document.getElementById(`${w.id}-helper-text`) || document.createElement("p");
|
|
1780
1758
|
F.textContent = D, this.#e.set(w, F);
|
|
1781
1759
|
}
|
|
@@ -1804,8 +1782,8 @@ class FormPanel extends Panel {
|
|
|
1804
1782
|
* @param {string=} opt_msg
|
|
1805
1783
|
*/
|
|
1806
1784
|
displayFieldError(w, D) {
|
|
1807
|
-
const
|
|
1808
|
-
w.classList.add("error"), this.displayAlert_(w,
|
|
1785
|
+
const O = D || w.validationMessage;
|
|
1786
|
+
w.classList.add("error"), this.displayAlert_(w, O, "alert-error");
|
|
1809
1787
|
}
|
|
1810
1788
|
/**
|
|
1811
1789
|
* Display the given success message on the given form field.
|
|
@@ -1849,8 +1827,8 @@ class FormPanel extends Panel {
|
|
|
1849
1827
|
if (w && this.#s) {
|
|
1850
1828
|
w.noValidate = !0;
|
|
1851
1829
|
const D = this.user;
|
|
1852
|
-
this.listen(w, EV.SUBMIT, (
|
|
1853
|
-
|
|
1830
|
+
this.listen(w, EV.SUBMIT, (O) => {
|
|
1831
|
+
O.preventDefault(), this.debugMe("Intercepted from SUBMIT"), this.checkAllFields() && D && D.formSubmit(this);
|
|
1854
1832
|
});
|
|
1855
1833
|
}
|
|
1856
1834
|
return w;
|
|
@@ -1872,22 +1850,22 @@ class FormPanel extends Panel {
|
|
|
1872
1850
|
if (this.responseObject = splitScripts(w), this.responseObject.html) {
|
|
1873
1851
|
if (this.redirected) {
|
|
1874
1852
|
this.removeAllListener();
|
|
1875
|
-
const D = this.getElement(),
|
|
1876
|
-
this.setElementInternal_(this.responseObject.html),
|
|
1853
|
+
const D = this.getElement(), O = D.parentNode;
|
|
1854
|
+
this.setElementInternal_(this.responseObject.html), O.replaceChild(this.getElement(), D);
|
|
1877
1855
|
} else {
|
|
1878
1856
|
const D = (
|
|
1879
1857
|
/** @type {!Element} */
|
|
1880
1858
|
this.responseObject.html.querySelector("form")
|
|
1881
1859
|
);
|
|
1882
1860
|
D && replaceNode(D, this.#t);
|
|
1883
|
-
const
|
|
1861
|
+
const O = (
|
|
1884
1862
|
/** @type {!Element} */
|
|
1885
1863
|
this.responseObject.html.querySelector('button[type="submit"]')
|
|
1886
1864
|
), F = (
|
|
1887
1865
|
/** @type {!Element} */
|
|
1888
1866
|
this.getElement().querySelector('button[type="submit"]')
|
|
1889
1867
|
);
|
|
1890
|
-
|
|
1868
|
+
O && F && replaceNode(O, F);
|
|
1891
1869
|
}
|
|
1892
1870
|
this.enterDocument();
|
|
1893
1871
|
}
|
|
@@ -1899,7 +1877,7 @@ class FormPanel extends Panel {
|
|
|
1899
1877
|
refreshFromFromServer() {
|
|
1900
1878
|
const w = this.user, D = this.uri;
|
|
1901
1879
|
return w ? w.fetch(D, this.abortController.signal).then(
|
|
1902
|
-
(
|
|
1880
|
+
(O) => this.replaceForm(O)
|
|
1903
1881
|
) : Promise.reject(new Error("No UserManager instance available for FormPanel.refreshFromFromServer()"));
|
|
1904
1882
|
}
|
|
1905
1883
|
/**
|
|
@@ -1978,7 +1956,7 @@ class Split extends Component {
|
|
|
1978
1956
|
* @param {boolean=} opt_skipAni If true, skips animation
|
|
1979
1957
|
*/
|
|
1980
1958
|
closeAndLockAll(w = identity, D = !1) {
|
|
1981
|
-
this.nestNames.forEach((
|
|
1959
|
+
this.nestNames.forEach((O) => this.closeAndLock(O, w, D));
|
|
1982
1960
|
}
|
|
1983
1961
|
/**
|
|
1984
1962
|
* Opens and unlocks all nests in this split component.
|
|
@@ -1986,7 +1964,7 @@ class Split extends Component {
|
|
|
1986
1964
|
* @param {boolean=} opt_skipAni If true, skips animation
|
|
1987
1965
|
*/
|
|
1988
1966
|
openAndUnlockAll(w = identity, D = !1) {
|
|
1989
|
-
this.nestNames.forEach((
|
|
1967
|
+
this.nestNames.forEach((O) => this.openAndUnlock(O, w, D));
|
|
1990
1968
|
}
|
|
1991
1969
|
// ---------------------------------------------------------------------------
|
|
1992
1970
|
/**
|
|
@@ -2021,10 +1999,10 @@ class Split extends Component {
|
|
|
2021
1999
|
* @param {boolean?} opt_skipAni When true, the resize won't be animated, but
|
|
2022
2000
|
* simply affected directly.
|
|
2023
2001
|
*/
|
|
2024
|
-
resize(w, D,
|
|
2025
|
-
const { sizeNow: q, nestEl: W, canResize:
|
|
2026
|
-
|
|
2027
|
-
W.classList.remove("animated"), this.nestMap_.get(w).sizeNow = D,
|
|
2002
|
+
resize(w, D, O = identity, F = !1) {
|
|
2003
|
+
const { sizeNow: q, nestEl: W, canResize: Y } = this.nestMap_.get(w);
|
|
2004
|
+
Y && (F || q === D ? (W.classList.remove("animated"), W.style.flexBasis = `${D}px`, this.nestMap_.get(w).sizeNow = D, O()) : (W.classList.add("animated"), this.nestCallbackMap_.set(w, () => {
|
|
2005
|
+
W.classList.remove("animated"), this.nestMap_.get(w).sizeNow = D, O();
|
|
2028
2006
|
}), W.style.flexBasis = `${D}px`));
|
|
2029
2007
|
}
|
|
2030
2008
|
/**
|
|
@@ -2035,23 +2013,23 @@ class Split extends Component {
|
|
|
2035
2013
|
* @param {boolean?} opt_skipAni When true, the resize won't be animated, but
|
|
2036
2014
|
* simply affected directly.
|
|
2037
2015
|
*/
|
|
2038
|
-
closeAndLock(w, D = identity,
|
|
2016
|
+
closeAndLock(w, D = identity, O = !1) {
|
|
2039
2017
|
const { nestEl: F, dragEl: q, canResize: W } = this.nestMap_.get(w);
|
|
2040
2018
|
if (!W)
|
|
2041
2019
|
return;
|
|
2042
|
-
const
|
|
2020
|
+
const Y = () => {
|
|
2043
2021
|
q.classList.add("locked", "closed"), F.classList.add("closed"), D();
|
|
2044
2022
|
};
|
|
2045
|
-
this.resize(w, 0,
|
|
2023
|
+
this.resize(w, 0, Y, O);
|
|
2046
2024
|
}
|
|
2047
|
-
closeAndUnlock(w, D = identity,
|
|
2025
|
+
closeAndUnlock(w, D = identity, O = !1) {
|
|
2048
2026
|
const { nestEl: F, dragEl: q, canResize: W } = this.nestMap_.get(w);
|
|
2049
2027
|
if (!W)
|
|
2050
2028
|
return;
|
|
2051
|
-
const
|
|
2029
|
+
const Y = () => {
|
|
2052
2030
|
F.classList.remove("closed"), q.classList.remove("closed", "locked"), q.classList.add("collapsed"), D();
|
|
2053
2031
|
};
|
|
2054
|
-
this.resize(w, 0,
|
|
2032
|
+
this.resize(w, 0, Y, O);
|
|
2055
2033
|
}
|
|
2056
2034
|
/**
|
|
2057
2035
|
* Open a closed and locked nest. Simply a convenience method to combine
|
|
@@ -2063,19 +2041,19 @@ class Split extends Component {
|
|
|
2063
2041
|
* @param {boolean?} opt_skipAni When true, the resize won't be animated, but
|
|
2064
2042
|
* simply affected directly.
|
|
2065
2043
|
*/
|
|
2066
|
-
openAndUnlock(w, D,
|
|
2044
|
+
openAndUnlock(w, D, O, F = !1) {
|
|
2067
2045
|
const {
|
|
2068
2046
|
nestEl: q,
|
|
2069
2047
|
dragEl: W,
|
|
2070
|
-
defSize:
|
|
2048
|
+
defSize: Y,
|
|
2071
2049
|
lastSize: G,
|
|
2072
2050
|
canResize: K
|
|
2073
2051
|
} = this.nestMap_.get(w);
|
|
2074
2052
|
if (!K)
|
|
2075
2053
|
return;
|
|
2076
|
-
const Q = D || G ||
|
|
2054
|
+
const Q = D || G || Y;
|
|
2077
2055
|
q.classList.remove("closed"), W.classList.remove("closed", "locked", "collapsed"), setTimeout(() => {
|
|
2078
|
-
this.resize(w, Q,
|
|
2056
|
+
this.resize(w, Q, O, F);
|
|
2079
2057
|
}, 50);
|
|
2080
2058
|
}
|
|
2081
2059
|
/**
|
|
@@ -2087,19 +2065,19 @@ class Split extends Component {
|
|
|
2087
2065
|
* @param {boolean?} opt_skipAni When true, the resize won't be animated, but
|
|
2088
2066
|
* simply affected directly.
|
|
2089
2067
|
*/
|
|
2090
|
-
openAndLock(w, D,
|
|
2068
|
+
openAndLock(w, D, O, F = !1) {
|
|
2091
2069
|
const {
|
|
2092
2070
|
nestEl: q,
|
|
2093
2071
|
dragEl: W,
|
|
2094
|
-
defSize:
|
|
2072
|
+
defSize: Y,
|
|
2095
2073
|
lastSize: G,
|
|
2096
2074
|
canResize: K
|
|
2097
2075
|
} = this.nestMap_.get(w);
|
|
2098
2076
|
if (!K)
|
|
2099
2077
|
return;
|
|
2100
|
-
const Q = D || G ||
|
|
2078
|
+
const Q = D || G || Y;
|
|
2101
2079
|
q.classList.remove("closed"), W.classList.remove("closed", "collapsed"), setTimeout(() => {
|
|
2102
|
-
this.resize(w, Q,
|
|
2080
|
+
this.resize(w, Q, O, F);
|
|
2103
2081
|
}, 50);
|
|
2104
2082
|
}
|
|
2105
2083
|
/**
|
|
@@ -2111,15 +2089,15 @@ class Split extends Component {
|
|
|
2111
2089
|
* @param {boolean?} opt_skipAni When true, the resize won't be animated, but
|
|
2112
2090
|
* simply affected directly.
|
|
2113
2091
|
*/
|
|
2114
|
-
close(w, D = identity,
|
|
2092
|
+
close(w, D = identity, O = !1) {
|
|
2115
2093
|
const { dragEl: F, canResize: q, nestEl: W } = this.nestMap_.get(w);
|
|
2116
2094
|
if (!q)
|
|
2117
2095
|
return;
|
|
2118
2096
|
this.dispatchSplitEvent(UiEventType.SPLIT_WILL_CLOSE, { nestName: w, nestEl: W });
|
|
2119
|
-
const
|
|
2097
|
+
const Y = () => {
|
|
2120
2098
|
F.classList.add("collapsed"), this.dispatchSplitEvent(UiEventType.SPLIT_DID_CLOSE, { nestName: w, nestEl: W }), D();
|
|
2121
2099
|
};
|
|
2122
|
-
this.resize(w, 0,
|
|
2100
|
+
this.resize(w, 0, Y, O);
|
|
2123
2101
|
}
|
|
2124
2102
|
/**
|
|
2125
2103
|
* Open the nest ignoring its current locked state.
|
|
@@ -2129,15 +2107,15 @@ class Split extends Component {
|
|
|
2129
2107
|
* @param {boolean?} opt_skipAni When true, the resize won't be animated, but
|
|
2130
2108
|
* simply affected directly.
|
|
2131
2109
|
*/
|
|
2132
|
-
open(w, D = identity,
|
|
2133
|
-
const { defSize: F, lastSize: q, dragEl: W, canResize:
|
|
2134
|
-
if (!
|
|
2110
|
+
open(w, D = identity, O = !1) {
|
|
2111
|
+
const { defSize: F, lastSize: q, dragEl: W, canResize: Y, nestEl: G } = this.nestMap_.get(w);
|
|
2112
|
+
if (!Y)
|
|
2135
2113
|
return;
|
|
2136
2114
|
this.dispatchSplitEvent(UiEventType.SPLIT_WILL_OPEN, { nestName: w, nestEl: G }), W.classList.remove("collapsed", "closed");
|
|
2137
2115
|
const K = q || F, Q = () => {
|
|
2138
2116
|
this.dispatchSplitEvent(UiEventType.SPLIT_DID_OPEN, { nestName: w, nestEl: G }), D();
|
|
2139
2117
|
};
|
|
2140
|
-
this.resize(w, K, Q,
|
|
2118
|
+
this.resize(w, K, Q, O);
|
|
2141
2119
|
}
|
|
2142
2120
|
/**
|
|
2143
2121
|
* Close the nest ignoring its current locked state.
|
|
@@ -2147,8 +2125,8 @@ class Split extends Component {
|
|
|
2147
2125
|
* @param {boolean?} opt_skipAni When true, the resize won't be animated, but
|
|
2148
2126
|
* simply affected directly.
|
|
2149
2127
|
*/
|
|
2150
|
-
toggle(w, D,
|
|
2151
|
-
this.nestMap_.get(w).sizeNow === 0 ? this.open(w, D,
|
|
2128
|
+
toggle(w, D, O = !1) {
|
|
2129
|
+
this.nestMap_.get(w).sizeNow === 0 ? this.open(w, D, O) : this.close(w, D, O);
|
|
2152
2130
|
}
|
|
2153
2131
|
//----------------------------------------------------------------------------
|
|
2154
2132
|
/**
|
|
@@ -2185,7 +2163,7 @@ class Split extends Component {
|
|
|
2185
2163
|
* @param {?Array<string>} classArrDragger Extra classes for the dragger element
|
|
2186
2164
|
* @param {?Array<string>} classArrGrabber Extra classes for the grabber element
|
|
2187
2165
|
*/
|
|
2188
|
-
addSplit(w = void 0, D = "EW",
|
|
2166
|
+
addSplit(w = void 0, D = "EW", O = 100, F = 100, q = [], W = [], Y = [], G = [], K = []) {
|
|
2189
2167
|
const Q = w || this.getElement();
|
|
2190
2168
|
if (this.splitNests_.has(Q))
|
|
2191
2169
|
return ["Already used!", Q];
|
|
@@ -2198,13 +2176,13 @@ class Split extends Component {
|
|
|
2198
2176
|
else
|
|
2199
2177
|
return ["Element not managed by this component", w];
|
|
2200
2178
|
}
|
|
2201
|
-
const J = `${tt}A`,
|
|
2179
|
+
const J = `${tt}A`, X = makeOuterNest(O, ["zoo_nest__A", J, ...q]), Z = new Dragger(D);
|
|
2202
2180
|
Z.domFunc = makeDraggerEl([`zoo_drag_${J}`, ...G], K), Z.render(Q), this.nestMap_.set(J, {
|
|
2203
2181
|
side: "A",
|
|
2204
|
-
nestEl:
|
|
2182
|
+
nestEl: X,
|
|
2205
2183
|
dragger: Z,
|
|
2206
2184
|
dragEl: Z.getElement(),
|
|
2207
|
-
defSize:
|
|
2185
|
+
defSize: O,
|
|
2208
2186
|
sizeNow: -1,
|
|
2209
2187
|
canResize: !0
|
|
2210
2188
|
});
|
|
@@ -2212,7 +2190,7 @@ class Split extends Component {
|
|
|
2212
2190
|
this.nestMap_.set(et, { nestEl: st, canResize: !1 });
|
|
2213
2191
|
const rt = `${tt}C`, nt = new Dragger(D);
|
|
2214
2192
|
nt.domFunc = makeDraggerEl([`zoo_drag_${rt}`, ...G], K), nt.render(Q);
|
|
2215
|
-
const ot = makeOuterNest(F, ["zoo_nest__C", rt, ...
|
|
2193
|
+
const ot = makeOuterNest(F, ["zoo_nest__C", rt, ...Y]);
|
|
2216
2194
|
this.nestMap_.set(rt, {
|
|
2217
2195
|
side: "C",
|
|
2218
2196
|
nestEl: ot,
|
|
@@ -2221,19 +2199,19 @@ class Split extends Component {
|
|
|
2221
2199
|
defSize: F,
|
|
2222
2200
|
sizeNow: -1,
|
|
2223
2201
|
canResize: !0
|
|
2224
|
-
}), [
|
|
2202
|
+
}), [X, Z.getElement(), st, nt.getElement(), ot].forEach((it) => Q.appendChild(it));
|
|
2225
2203
|
let ct = 0;
|
|
2226
|
-
const ht = (it, at, lt,
|
|
2227
|
-
let
|
|
2228
|
-
const
|
|
2204
|
+
const ht = (it, at, lt, ft) => {
|
|
2205
|
+
let dt;
|
|
2206
|
+
const ut = it === "NS" ? "height" : "width", gt = it === "NS" ? "deltaY" : "deltaX";
|
|
2229
2207
|
return (pt) => {
|
|
2230
2208
|
switch (pt.detail.value_) {
|
|
2231
2209
|
case UiEventType.COMP_DRAG_START:
|
|
2232
|
-
|
|
2210
|
+
dt = at.getBoundingClientRect()[ut], ct = st.getBoundingClientRect()[ut] + dt, this.nestMap_.get(lt).dragEl.classList.remove("collapsed");
|
|
2233
2211
|
break;
|
|
2234
2212
|
case UiEventType.COMP_DRAG_MOVE: {
|
|
2235
|
-
const
|
|
2236
|
-
this.nestMap_.get(lt).lastSize =
|
|
2213
|
+
const mt = Math.min(ct, dt + ft * pt.detail.data_[gt]);
|
|
2214
|
+
this.nestMap_.get(lt).lastSize = mt, at.style.flexBasis = mt + "px";
|
|
2237
2215
|
break;
|
|
2238
2216
|
}
|
|
2239
2217
|
case UiEventType.COMP_DRAG_END:
|
|
@@ -2242,8 +2220,8 @@ class Split extends Component {
|
|
|
2242
2220
|
}
|
|
2243
2221
|
};
|
|
2244
2222
|
};
|
|
2245
|
-
this.listen(Z, Component.compEventCode(), ht(D,
|
|
2246
|
-
if (it.propertyName === "flex-basis" && it.target ===
|
|
2223
|
+
this.listen(Z, Component.compEventCode(), ht(D, X, J, 1)), this.listen(nt, Component.compEventCode(), ht(D, ot, rt, -1)), this.listen(Z.getElement(), EV.DBLCLICK, () => this.toggle(J)), this.listen(nt.getElement(), EV.DBLCLICK, () => this.toggle(rt)), this.listen(Z.getElement().querySelector(".zoo_grabber"), EV.CLICK, () => this.toggle(J)), this.listen(nt.getElement().querySelector(".zoo_grabber"), EV.CLICK, () => this.toggle(rt)), this.listen(X, EV.TRANSITIONEND, (it) => {
|
|
2224
|
+
if (it.propertyName === "flex-basis" && it.target === X) {
|
|
2247
2225
|
const at = this.nestCallbackMap_.get(J);
|
|
2248
2226
|
this.nestCallbackMap_.delete(J), at && at(), this.dispatchSplitEvent(UiEventType.SPLIT_TRANSITION_END, this.nestMap_.get(J));
|
|
2249
2227
|
}
|
|
@@ -2265,50 +2243,50 @@ class Split extends Component {
|
|
|
2265
2243
|
* if any of the handlers returns false this will also return false.
|
|
2266
2244
|
*/
|
|
2267
2245
|
dispatchSplitEvent(w, D) {
|
|
2268
|
-
const
|
|
2246
|
+
const O = new ZooyEventData(w, D), F = Evt.makeEvent(UiEventType.SPLIT, O);
|
|
2269
2247
|
return this.dispatchEvent(F);
|
|
2270
2248
|
}
|
|
2271
2249
|
}
|
|
2272
|
-
const convertElToSplit = (
|
|
2250
|
+
const convertElToSplit = (U, w) => (U.classList.add("zoo_split", `zoo_split__${w.toLowerCase()}`), U), makeOuterNest = (U, w = []) => {
|
|
2273
2251
|
const D = document.createElement("div");
|
|
2274
|
-
return D.setAttribute("id", randomId(7)), D.classList.add("zoo_nest", "zoo_nest__outer", ...w), D.style.flexBasis =
|
|
2275
|
-
}, makeInnerNest = (
|
|
2252
|
+
return D.setAttribute("id", randomId(7)), D.classList.add("zoo_nest", "zoo_nest__outer", ...w), D.style.flexBasis = U + "px", D;
|
|
2253
|
+
}, makeInnerNest = (U = []) => {
|
|
2276
2254
|
const w = document.createElement("div");
|
|
2277
|
-
return w.setAttribute("id", randomId(7)), w.classList.add("zoo_nest", "zoo_nest__inner", ...
|
|
2278
|
-
}, makeDraggerEl = (
|
|
2255
|
+
return w.setAttribute("id", randomId(7)), w.classList.add("zoo_nest", "zoo_nest__inner", ...U), w;
|
|
2256
|
+
}, makeDraggerEl = (U = [], w = []) => () => {
|
|
2279
2257
|
const D = document.createElement("div");
|
|
2280
|
-
D.setAttribute("id", randomId(7)), D.classList.add("zoo_dragger", ...
|
|
2281
|
-
const
|
|
2282
|
-
return
|
|
2283
|
-
}, needsToScroll = (
|
|
2284
|
-
const D =
|
|
2285
|
-
return (
|
|
2286
|
-
}, treeNodeSelect = (
|
|
2287
|
-
const D =
|
|
2258
|
+
D.setAttribute("id", randomId(7)), D.classList.add("zoo_dragger", ...U);
|
|
2259
|
+
const O = document.createElement("div");
|
|
2260
|
+
return O.classList.add("zoo_grabber", ...w), D.appendChild(O), D;
|
|
2261
|
+
}, needsToScroll = (U) => {
|
|
2262
|
+
const D = U.getBoundingClientRect().bottom;
|
|
2263
|
+
return (O) => O.getBoundingClientRect().bottom > D;
|
|
2264
|
+
}, treeNodeSelect = (U) => (w) => {
|
|
2265
|
+
const D = U.getElement().querySelector(".zv_tree_container"), O = needsToScroll(D), F = U.getElement().querySelectorAll(".tree-node");
|
|
2288
2266
|
let q;
|
|
2289
2267
|
[...F].forEach((W) => {
|
|
2290
2268
|
enableClass(W, "mdc-deprecated-list-item--activated", W.id === `tree-node_${w}`), W.id === `tree-node_${w}` && (q = W);
|
|
2291
|
-
}), q &&
|
|
2292
|
-
}, toggleTree = (
|
|
2293
|
-
const D = w.getElement().querySelector(".children"),
|
|
2269
|
+
}), q && O(q) && q.scrollIntoView(!1);
|
|
2270
|
+
}, toggleTree = (U, w) => {
|
|
2271
|
+
const D = w.getElement().querySelector(".children"), O = (
|
|
2294
2272
|
/**@type {boolean} */
|
|
2295
|
-
|
|
2273
|
+
U.isOn
|
|
2296
2274
|
), F = w.getElement().querySelectorAll(".children"), q = w.getElement().querySelectorAll(".zoo__reveal_icon");
|
|
2297
2275
|
[...F].forEach((W) => enableClass(
|
|
2298
2276
|
W,
|
|
2299
2277
|
"zoo__tree-children__hidden",
|
|
2300
|
-
W !== D && !
|
|
2278
|
+
W !== D && !O
|
|
2301
2279
|
)), [...q].forEach((W) => enableClass(
|
|
2302
2280
|
W,
|
|
2303
2281
|
"zoo__icon_rotated",
|
|
2304
|
-
W !== D && !
|
|
2282
|
+
W !== D && !O
|
|
2305
2283
|
));
|
|
2306
|
-
}, toggleTreeChildren = (
|
|
2307
|
-
const D = w.trigger,
|
|
2284
|
+
}, toggleTreeChildren = (U, w) => {
|
|
2285
|
+
const D = w.trigger, O = D.getAttribute("data-child-id"), F = U.getElement().querySelector(`#${O}`);
|
|
2308
2286
|
toggleClass(F, "zoo__tree-children__hidden"), toggleClass(D, "zoo__icon_rotated");
|
|
2309
|
-
}, _openTreeFromNodeUp = (
|
|
2287
|
+
}, _openTreeFromNodeUp = (U, w) => {
|
|
2310
2288
|
const D = w.parentElement;
|
|
2311
|
-
D.classList.contains("children") && (enableClass(D, "zoo__tree-children__hidden", !1), _openTreeFromNodeUp(
|
|
2289
|
+
D.classList.contains("children") && (enableClass(D, "zoo__tree-children__hidden", !1), _openTreeFromNodeUp(U, D));
|
|
2312
2290
|
}, treeUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2313
2291
|
__proto__: null,
|
|
2314
2292
|
_openTreeFromNodeUp,
|
|
@@ -2323,8 +2301,8 @@ const convertElToSplit = (O, w) => (O.classList.add("zoo_split", `zoo_split__${w
|
|
|
2323
2301
|
* @param {Object} eventData - Event data with isOn boolean
|
|
2324
2302
|
* @param {Panel} ePanel - The panel containing the tree
|
|
2325
2303
|
*/
|
|
2326
|
-
toggle_tree: function(
|
|
2327
|
-
toggleTree(
|
|
2304
|
+
toggle_tree: function(U, w) {
|
|
2305
|
+
toggleTree(U, w);
|
|
2328
2306
|
},
|
|
2329
2307
|
/**
|
|
2330
2308
|
* Toggle children visibility for a specific tree node.
|
|
@@ -2332,8 +2310,8 @@ const convertElToSplit = (O, w) => (O.classList.add("zoo_split", `zoo_split__${w
|
|
|
2332
2310
|
* @param {Object} eventData - Event data with trigger element
|
|
2333
2311
|
* @param {Panel} ePanel - The panel containing the tree
|
|
2334
2312
|
*/
|
|
2335
|
-
"tree_toggle-children": function(
|
|
2336
|
-
toggleTreeChildren(w,
|
|
2313
|
+
"tree_toggle-children": function(U, w) {
|
|
2314
|
+
toggleTreeChildren(w, U);
|
|
2337
2315
|
}
|
|
2338
2316
|
}, SearchHandlers = {
|
|
2339
2317
|
/**
|
|
@@ -2343,15 +2321,15 @@ const convertElToSplit = (O, w) => (O.classList.add("zoo_split", `zoo_split__${w
|
|
|
2343
2321
|
* @param {Object} eventData - Event data with href, formData.q, and targetval
|
|
2344
2322
|
* @param {Panel} ePanel - The panel to update
|
|
2345
2323
|
*/
|
|
2346
|
-
search: function(
|
|
2347
|
-
let D = `${
|
|
2348
|
-
const
|
|
2349
|
-
if (
|
|
2324
|
+
search: function(U, w) {
|
|
2325
|
+
let D = `${U.href}`;
|
|
2326
|
+
const O = U.formData.q, F = U.targetval;
|
|
2327
|
+
if (O !== "" && (D = `${D}?q=${O}`), F !== "") {
|
|
2350
2328
|
let q = F;
|
|
2351
|
-
F.includes("page=") && (q = F.split("&").filter((W) => !W.includes("page=")).join("&")), D =
|
|
2329
|
+
F.includes("page=") && (q = F.split("&").filter((W) => !W.includes("page=")).join("&")), D = O !== "" ? `${D}&${q}` : `${D}?${q}`;
|
|
2352
2330
|
}
|
|
2353
2331
|
this.user.fetchAndSplit(D, w.abortController.signal).then(
|
|
2354
|
-
(q) => w.onReplacePartialDom(q,
|
|
2332
|
+
(q) => w.onReplacePartialDom(q, U.zvptarget)
|
|
2355
2333
|
);
|
|
2356
2334
|
},
|
|
2357
2335
|
/**
|
|
@@ -2361,8 +2339,8 @@ const convertElToSplit = (O, w) => (O.classList.add("zoo_split", `zoo_split__${w
|
|
|
2361
2339
|
* @param {Object} eventData - Event data with trigger element
|
|
2362
2340
|
* @param {Panel} ePanel - The panel to update
|
|
2363
2341
|
*/
|
|
2364
|
-
reset_search: function(
|
|
2365
|
-
const D =
|
|
2342
|
+
reset_search: function(U, w) {
|
|
2343
|
+
const D = U.trigger.closest("form");
|
|
2366
2344
|
w.removeFromQParams("q"), D.elements.q.value = "", D.dispatchEvent(new Event("submit"));
|
|
2367
2345
|
}
|
|
2368
2346
|
}, QueryParamHandlers = {
|
|
@@ -2372,10 +2350,10 @@ const convertElToSplit = (O, w) => (O.classList.add("zoo_split", `zoo_split__${w
|
|
|
2372
2350
|
* @param {Object} eventData - Event data with href and targetval for pagination
|
|
2373
2351
|
* @param {Panel} ePanel - The panel to update
|
|
2374
2352
|
*/
|
|
2375
|
-
paginate: function(
|
|
2376
|
-
const D = `${
|
|
2353
|
+
paginate: function(U, w) {
|
|
2354
|
+
const D = `${U.href}?${U.targetval}`;
|
|
2377
2355
|
this.user.fetchAndSplit(D, w.abortController.signal).then(
|
|
2378
|
-
(
|
|
2356
|
+
(O) => w.onReplacePartialDom(O, U.zvptarget)
|
|
2379
2357
|
);
|
|
2380
2358
|
},
|
|
2381
2359
|
/**
|
|
@@ -2384,10 +2362,10 @@ const convertElToSplit = (O, w) => (O.classList.add("zoo_split", `zoo_split__${w
|
|
|
2384
2362
|
* @param {Object} eventData - Event data with href and targetval for filtering
|
|
2385
2363
|
* @param {Panel} ePanel - The panel to update
|
|
2386
2364
|
*/
|
|
2387
|
-
list_filter: function(
|
|
2388
|
-
const D = `${
|
|
2365
|
+
list_filter: function(U, w) {
|
|
2366
|
+
const D = `${U.href}?${U.targetval}`;
|
|
2389
2367
|
this.user.fetchAndSplit(D, w.abortController.signal).then(
|
|
2390
|
-
(
|
|
2368
|
+
(O) => w.onReplacePartialDom(O, U.zvptarget)
|
|
2391
2369
|
);
|
|
2392
2370
|
}
|
|
2393
2371
|
}, handlers = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -2428,8 +2406,8 @@ class View extends Evt {
|
|
|
2428
2406
|
}
|
|
2429
2407
|
set split(w) {
|
|
2430
2408
|
this.split_ = w, this.listen(this.split_, UiEventType.SPLIT, (D) => {
|
|
2431
|
-
const
|
|
2432
|
-
switch (
|
|
2409
|
+
const O = D.detail.getValue(), F = D.detail.getData();
|
|
2410
|
+
switch (O) {
|
|
2433
2411
|
case UiEventType.SPLIT_WILL_OPEN:
|
|
2434
2412
|
this.onSplitWillOpen(F);
|
|
2435
2413
|
break;
|
|
@@ -2520,8 +2498,8 @@ class View extends Evt {
|
|
|
2520
2498
|
* @param {Panel} panel
|
|
2521
2499
|
*/
|
|
2522
2500
|
removePanel(w) {
|
|
2523
|
-
const [D,
|
|
2524
|
-
D &&
|
|
2501
|
+
const [D, O] = [...this.panelMap.entries()].find(([F, q]) => q === w);
|
|
2502
|
+
D && O && (O.dispose(), this.panelMap.delete(D));
|
|
2525
2503
|
}
|
|
2526
2504
|
/**
|
|
2527
2505
|
* @param {string} name
|
|
@@ -2551,17 +2529,17 @@ class View extends Evt {
|
|
|
2551
2529
|
*/
|
|
2552
2530
|
initPanelEventsInternal_() {
|
|
2553
2531
|
const w = /* @__PURE__ */ new Map();
|
|
2554
|
-
return w.set("destroy_me", (D,
|
|
2555
|
-
this.removePanel(
|
|
2556
|
-
}), w.set("switch_view", (D,
|
|
2532
|
+
return w.set("destroy_me", (D, O) => {
|
|
2533
|
+
this.removePanel(O);
|
|
2534
|
+
}), w.set("switch_view", (D, O) => {
|
|
2557
2535
|
this.debugMe("switch_view received: eventData", D);
|
|
2558
2536
|
const F = D.view;
|
|
2559
|
-
this.switchViewMap_.has(F) ? this.switchViewMap_.get(F)(D,
|
|
2537
|
+
this.switchViewMap_.has(F) ? this.switchViewMap_.get(F)(D, O) : this.debugMe("NO VIEW FOUND FOR:", F, this.switchViewMap_);
|
|
2560
2538
|
}), Object.entries({
|
|
2561
2539
|
...SearchHandlers,
|
|
2562
2540
|
...QueryParamHandlers
|
|
2563
|
-
}).forEach(([D,
|
|
2564
|
-
w.set(D,
|
|
2541
|
+
}).forEach(([D, O]) => {
|
|
2542
|
+
w.set(D, O.bind(this));
|
|
2565
2543
|
}), w;
|
|
2566
2544
|
}
|
|
2567
2545
|
/**
|
|
@@ -2588,18 +2566,18 @@ class View extends Evt {
|
|
|
2588
2566
|
*/
|
|
2589
2567
|
onPanelEvent(w) {
|
|
2590
2568
|
let D = w.detail.getValue();
|
|
2591
|
-
const
|
|
2592
|
-
D.startsWith("switch_view:") && (
|
|
2569
|
+
const O = w.detail.getData();
|
|
2570
|
+
D.startsWith("switch_view:") && (O.view = D.split(":")[1], D = "switch_view");
|
|
2593
2571
|
const F = (
|
|
2594
2572
|
/** @type {Panel} */
|
|
2595
2573
|
w.target
|
|
2596
2574
|
);
|
|
2597
|
-
this.panelEventMap_.has(D) ? this.panelEventMap_.get(D)(
|
|
2575
|
+
this.panelEventMap_.has(D) ? this.panelEventMap_.get(D)(O, F) : this.debugMe(`NO EVENT MATCH - This usually you are missing
|
|
2598
2576
|
a "mapPanEv(${D} ..." statement in your panel JS
|
|
2599
2577
|
or you have a "event='${D}'" attribute in your panel HTML`, {
|
|
2600
2578
|
event: w,
|
|
2601
2579
|
eventValue: D,
|
|
2602
|
-
eventData:
|
|
2580
|
+
eventData: O,
|
|
2603
2581
|
panel: F.constructor.name
|
|
2604
2582
|
});
|
|
2605
2583
|
}
|
|
@@ -2650,7 +2628,7 @@ class View extends Evt {
|
|
|
2650
2628
|
* if any of the handlers returns false this will also return false.
|
|
2651
2629
|
*/
|
|
2652
2630
|
dispatchViewEvent(w, D) {
|
|
2653
|
-
const
|
|
2631
|
+
const O = new ZooyEventData(w, D), F = Evt.makeEvent(UiEventType.VIEW, O);
|
|
2654
2632
|
return this.dispatchEvent(F);
|
|
2655
2633
|
}
|
|
2656
2634
|
//--[ Meta Data ]--
|
|
@@ -2704,7 +2682,11 @@ class Conductor extends Evt {
|
|
|
2704
2682
|
constructor() {
|
|
2705
2683
|
super(), this.#n = this.#i(), window.addEventListener("popstate", (w) => {
|
|
2706
2684
|
w.state !== null && this.navTo(w.state);
|
|
2707
|
-
})
|
|
2685
|
+
}), this.doOnBeat(() => {
|
|
2686
|
+
document.dispatchEvent(new CustomEvent("zoo-tick-60", {
|
|
2687
|
+
detail: { timestamp: Date.now() }
|
|
2688
|
+
}));
|
|
2689
|
+
}, 6e4);
|
|
2708
2690
|
}
|
|
2709
2691
|
set split(w) {
|
|
2710
2692
|
this.#r = w;
|
|
@@ -2735,11 +2717,11 @@ class Conductor extends Evt {
|
|
|
2735
2717
|
#i() {
|
|
2736
2718
|
return (/* @__PURE__ */ new Map()).set("switch_view", (w, D) => {
|
|
2737
2719
|
if (this.#t.has(w.view)) {
|
|
2738
|
-
const
|
|
2720
|
+
const O = this.#t.get(w.view)(
|
|
2739
2721
|
w.pk || w.recordId,
|
|
2740
2722
|
w
|
|
2741
2723
|
);
|
|
2742
|
-
this.switchView(
|
|
2724
|
+
this.switchView(O);
|
|
2743
2725
|
}
|
|
2744
2726
|
});
|
|
2745
2727
|
}
|
|
@@ -2765,11 +2747,11 @@ class Conductor extends Evt {
|
|
|
2765
2747
|
* @param {!CustomEvent} e Event object.
|
|
2766
2748
|
*/
|
|
2767
2749
|
onViewEvent(w) {
|
|
2768
|
-
const D = w.detail.getValue(),
|
|
2750
|
+
const D = w.detail.getValue(), O = w.detail.getData(), F = (
|
|
2769
2751
|
/** @type {Panel} */
|
|
2770
2752
|
w.target
|
|
2771
2753
|
);
|
|
2772
|
-
this.#n.has(D) ? this.#n.get(D)(
|
|
2754
|
+
this.#n.has(D) ? this.#n.get(D)(O, F) : console.warn("Unhandled VIEW Event:", w, D, O, F);
|
|
2773
2755
|
}
|
|
2774
2756
|
/**
|
|
2775
2757
|
* Make the given view active.
|
|
@@ -2810,52 +2792,52 @@ class Conductor extends Evt {
|
|
|
2810
2792
|
*/
|
|
2811
2793
|
navTo = (w) => {
|
|
2812
2794
|
w.history = !0;
|
|
2813
|
-
const D = w.view,
|
|
2814
|
-
if (
|
|
2815
|
-
this.debugMe("NAV:VIEW:MAP", w),
|
|
2795
|
+
const D = w.view, O = this.#e;
|
|
2796
|
+
if (O.switchViewMap_.has(D))
|
|
2797
|
+
this.debugMe("NAV:VIEW:MAP", w), O.switchViewMap_.get(D)(w);
|
|
2816
2798
|
else if (this.#t.has(D)) {
|
|
2817
2799
|
const F = this.#t.get(D)(w.pk, w);
|
|
2818
2800
|
this.debugMe("NAV:NEW:VIEW", w), this.switchView(F);
|
|
2819
2801
|
}
|
|
2820
2802
|
};
|
|
2821
2803
|
}
|
|
2822
|
-
function _isPlaceholder(
|
|
2823
|
-
return
|
|
2804
|
+
function _isPlaceholder(U) {
|
|
2805
|
+
return U != null && typeof U == "object" && U["@@functional/placeholder"] === !0;
|
|
2824
2806
|
}
|
|
2825
|
-
function _curry1(
|
|
2807
|
+
function _curry1(U) {
|
|
2826
2808
|
return function w(D) {
|
|
2827
|
-
return arguments.length === 0 || _isPlaceholder(D) ? w :
|
|
2809
|
+
return arguments.length === 0 || _isPlaceholder(D) ? w : U.apply(this, arguments);
|
|
2828
2810
|
};
|
|
2829
2811
|
}
|
|
2830
|
-
function _curry2(
|
|
2831
|
-
return function w(D,
|
|
2812
|
+
function _curry2(U) {
|
|
2813
|
+
return function w(D, O) {
|
|
2832
2814
|
switch (arguments.length) {
|
|
2833
2815
|
case 0:
|
|
2834
2816
|
return w;
|
|
2835
2817
|
case 1:
|
|
2836
2818
|
return _isPlaceholder(D) ? w : _curry1(function(F) {
|
|
2837
|
-
return
|
|
2819
|
+
return U(D, F);
|
|
2838
2820
|
});
|
|
2839
2821
|
default:
|
|
2840
|
-
return _isPlaceholder(D) && _isPlaceholder(
|
|
2841
|
-
return
|
|
2842
|
-
}) : _isPlaceholder(
|
|
2843
|
-
return
|
|
2844
|
-
}) :
|
|
2822
|
+
return _isPlaceholder(D) && _isPlaceholder(O) ? w : _isPlaceholder(D) ? _curry1(function(F) {
|
|
2823
|
+
return U(F, O);
|
|
2824
|
+
}) : _isPlaceholder(O) ? _curry1(function(F) {
|
|
2825
|
+
return U(D, F);
|
|
2826
|
+
}) : U(D, O);
|
|
2845
2827
|
}
|
|
2846
2828
|
};
|
|
2847
2829
|
}
|
|
2848
|
-
function _concat(
|
|
2849
|
-
|
|
2850
|
-
var D,
|
|
2851
|
-
for (D = 0; D <
|
|
2852
|
-
q[q.length] =
|
|
2830
|
+
function _concat(U, w) {
|
|
2831
|
+
U = U || [], w = w || [];
|
|
2832
|
+
var D, O = U.length, F = w.length, q = [];
|
|
2833
|
+
for (D = 0; D < O; )
|
|
2834
|
+
q[q.length] = U[D], D += 1;
|
|
2853
2835
|
for (D = 0; D < F; )
|
|
2854
2836
|
q[q.length] = w[D], D += 1;
|
|
2855
2837
|
return q;
|
|
2856
2838
|
}
|
|
2857
|
-
function _arity(
|
|
2858
|
-
switch (
|
|
2839
|
+
function _arity(U, w) {
|
|
2840
|
+
switch (U) {
|
|
2859
2841
|
case 0:
|
|
2860
2842
|
return function() {
|
|
2861
2843
|
return w.apply(this, arguments);
|
|
@@ -2865,111 +2847,111 @@ function _arity(O, w) {
|
|
|
2865
2847
|
return w.apply(this, arguments);
|
|
2866
2848
|
};
|
|
2867
2849
|
case 2:
|
|
2868
|
-
return function(D,
|
|
2850
|
+
return function(D, O) {
|
|
2869
2851
|
return w.apply(this, arguments);
|
|
2870
2852
|
};
|
|
2871
2853
|
case 3:
|
|
2872
|
-
return function(D,
|
|
2854
|
+
return function(D, O, F) {
|
|
2873
2855
|
return w.apply(this, arguments);
|
|
2874
2856
|
};
|
|
2875
2857
|
case 4:
|
|
2876
|
-
return function(D,
|
|
2858
|
+
return function(D, O, F, q) {
|
|
2877
2859
|
return w.apply(this, arguments);
|
|
2878
2860
|
};
|
|
2879
2861
|
case 5:
|
|
2880
|
-
return function(D,
|
|
2862
|
+
return function(D, O, F, q, W) {
|
|
2881
2863
|
return w.apply(this, arguments);
|
|
2882
2864
|
};
|
|
2883
2865
|
case 6:
|
|
2884
|
-
return function(D,
|
|
2866
|
+
return function(D, O, F, q, W, Y) {
|
|
2885
2867
|
return w.apply(this, arguments);
|
|
2886
2868
|
};
|
|
2887
2869
|
case 7:
|
|
2888
|
-
return function(D,
|
|
2870
|
+
return function(D, O, F, q, W, Y, G) {
|
|
2889
2871
|
return w.apply(this, arguments);
|
|
2890
2872
|
};
|
|
2891
2873
|
case 8:
|
|
2892
|
-
return function(D,
|
|
2874
|
+
return function(D, O, F, q, W, Y, G, K) {
|
|
2893
2875
|
return w.apply(this, arguments);
|
|
2894
2876
|
};
|
|
2895
2877
|
case 9:
|
|
2896
|
-
return function(D,
|
|
2878
|
+
return function(D, O, F, q, W, Y, G, K, Q) {
|
|
2897
2879
|
return w.apply(this, arguments);
|
|
2898
2880
|
};
|
|
2899
2881
|
case 10:
|
|
2900
|
-
return function(D,
|
|
2882
|
+
return function(D, O, F, q, W, Y, G, K, Q, tt) {
|
|
2901
2883
|
return w.apply(this, arguments);
|
|
2902
2884
|
};
|
|
2903
2885
|
default:
|
|
2904
2886
|
throw new Error("First argument to _arity must be a non-negative integer no greater than ten");
|
|
2905
2887
|
}
|
|
2906
2888
|
}
|
|
2907
|
-
function _curryN(
|
|
2889
|
+
function _curryN(U, w, D) {
|
|
2908
2890
|
return function() {
|
|
2909
|
-
for (var
|
|
2891
|
+
for (var O = [], F = 0, q = U, W = 0, Y = !1; W < w.length || F < arguments.length; ) {
|
|
2910
2892
|
var G;
|
|
2911
|
-
W < w.length && (!_isPlaceholder(w[W]) || F >= arguments.length) ? G = w[W] : (G = arguments[F], F += 1),
|
|
2893
|
+
W < w.length && (!_isPlaceholder(w[W]) || F >= arguments.length) ? G = w[W] : (G = arguments[F], F += 1), O[W] = G, _isPlaceholder(G) ? Y = !0 : q -= 1, W += 1;
|
|
2912
2894
|
}
|
|
2913
|
-
return !
|
|
2895
|
+
return !Y && q <= 0 ? D.apply(this, O) : _arity(Math.max(0, q), _curryN(U, O, D));
|
|
2914
2896
|
};
|
|
2915
2897
|
}
|
|
2916
|
-
var curryN = /* @__PURE__ */ _curry2(function
|
|
2898
|
+
var curryN = /* @__PURE__ */ _curry2(function U(w, D) {
|
|
2917
2899
|
return w === 1 ? _curry1(D) : _arity(w, _curryN(w, [], D));
|
|
2918
2900
|
});
|
|
2919
|
-
function _curry3(
|
|
2920
|
-
return function w(D,
|
|
2901
|
+
function _curry3(U) {
|
|
2902
|
+
return function w(D, O, F) {
|
|
2921
2903
|
switch (arguments.length) {
|
|
2922
2904
|
case 0:
|
|
2923
2905
|
return w;
|
|
2924
2906
|
case 1:
|
|
2925
2907
|
return _isPlaceholder(D) ? w : _curry2(function(q, W) {
|
|
2926
|
-
return
|
|
2908
|
+
return U(D, q, W);
|
|
2927
2909
|
});
|
|
2928
2910
|
case 2:
|
|
2929
|
-
return _isPlaceholder(D) && _isPlaceholder(
|
|
2930
|
-
return
|
|
2931
|
-
}) : _isPlaceholder(
|
|
2932
|
-
return
|
|
2911
|
+
return _isPlaceholder(D) && _isPlaceholder(O) ? w : _isPlaceholder(D) ? _curry2(function(q, W) {
|
|
2912
|
+
return U(q, O, W);
|
|
2913
|
+
}) : _isPlaceholder(O) ? _curry2(function(q, W) {
|
|
2914
|
+
return U(D, q, W);
|
|
2933
2915
|
}) : _curry1(function(q) {
|
|
2934
|
-
return
|
|
2916
|
+
return U(D, O, q);
|
|
2935
2917
|
});
|
|
2936
2918
|
default:
|
|
2937
|
-
return _isPlaceholder(D) && _isPlaceholder(
|
|
2938
|
-
return
|
|
2919
|
+
return _isPlaceholder(D) && _isPlaceholder(O) && _isPlaceholder(F) ? w : _isPlaceholder(D) && _isPlaceholder(O) ? _curry2(function(q, W) {
|
|
2920
|
+
return U(q, W, F);
|
|
2939
2921
|
}) : _isPlaceholder(D) && _isPlaceholder(F) ? _curry2(function(q, W) {
|
|
2940
|
-
return
|
|
2941
|
-
}) : _isPlaceholder(
|
|
2942
|
-
return
|
|
2922
|
+
return U(q, O, W);
|
|
2923
|
+
}) : _isPlaceholder(O) && _isPlaceholder(F) ? _curry2(function(q, W) {
|
|
2924
|
+
return U(D, q, W);
|
|
2943
2925
|
}) : _isPlaceholder(D) ? _curry1(function(q) {
|
|
2944
|
-
return
|
|
2945
|
-
}) : _isPlaceholder(
|
|
2946
|
-
return
|
|
2926
|
+
return U(q, O, F);
|
|
2927
|
+
}) : _isPlaceholder(O) ? _curry1(function(q) {
|
|
2928
|
+
return U(D, q, F);
|
|
2947
2929
|
}) : _isPlaceholder(F) ? _curry1(function(q) {
|
|
2948
|
-
return
|
|
2949
|
-
}) :
|
|
2930
|
+
return U(D, O, q);
|
|
2931
|
+
}) : U(D, O, F);
|
|
2950
2932
|
}
|
|
2951
2933
|
};
|
|
2952
2934
|
}
|
|
2953
|
-
const _isArray = Array.isArray || function
|
|
2935
|
+
const _isArray = Array.isArray || function U(w) {
|
|
2954
2936
|
return w != null && w.length >= 0 && Object.prototype.toString.call(w) === "[object Array]";
|
|
2955
2937
|
};
|
|
2956
|
-
function _isTransformer(
|
|
2957
|
-
return
|
|
2938
|
+
function _isTransformer(U) {
|
|
2939
|
+
return U != null && typeof U["@@transducer/step"] == "function";
|
|
2958
2940
|
}
|
|
2959
|
-
function _dispatchable(
|
|
2941
|
+
function _dispatchable(U, w, D) {
|
|
2960
2942
|
return function() {
|
|
2961
2943
|
if (arguments.length === 0)
|
|
2962
2944
|
return D();
|
|
2963
|
-
var
|
|
2964
|
-
if (!_isArray(
|
|
2965
|
-
for (var F = 0; F <
|
|
2966
|
-
if (typeof U[
|
|
2967
|
-
return U[
|
|
2945
|
+
var O = arguments[arguments.length - 1];
|
|
2946
|
+
if (!_isArray(O)) {
|
|
2947
|
+
for (var F = 0; F < U.length; ) {
|
|
2948
|
+
if (typeof O[U[F]] == "function")
|
|
2949
|
+
return O[U[F]].apply(O, Array.prototype.slice.call(arguments, 0, -1));
|
|
2968
2950
|
F += 1;
|
|
2969
2951
|
}
|
|
2970
|
-
if (_isTransformer(
|
|
2952
|
+
if (_isTransformer(O)) {
|
|
2971
2953
|
var q = w.apply(null, Array.prototype.slice.call(arguments, 0, -1));
|
|
2972
|
-
return q(
|
|
2954
|
+
return q(O);
|
|
2973
2955
|
}
|
|
2974
2956
|
}
|
|
2975
2957
|
return D.apply(this, arguments);
|
|
@@ -2979,12 +2961,12 @@ const _xfBase = {
|
|
|
2979
2961
|
init: function() {
|
|
2980
2962
|
return this.xf["@@transducer/init"]();
|
|
2981
2963
|
},
|
|
2982
|
-
result: function(
|
|
2983
|
-
return this.xf["@@transducer/result"](
|
|
2964
|
+
result: function(U) {
|
|
2965
|
+
return this.xf["@@transducer/result"](U);
|
|
2984
2966
|
}
|
|
2985
2967
|
};
|
|
2986
|
-
function _has(
|
|
2987
|
-
return Object.prototype.hasOwnProperty.call(w,
|
|
2968
|
+
function _has(U, w) {
|
|
2969
|
+
return Object.prototype.hasOwnProperty.call(w, U);
|
|
2988
2970
|
}
|
|
2989
2971
|
var toString = Object.prototype.toString, _isArguments = /* @__PURE__ */ (function() {
|
|
2990
2972
|
return toString.call(arguments) === "[object Arguments]" ? function(w) {
|
|
@@ -2996,82 +2978,82 @@ var toString = Object.prototype.toString, _isArguments = /* @__PURE__ */ (functi
|
|
|
2996
2978
|
toString: null
|
|
2997
2979
|
}.propertyIsEnumerable("toString"), nonEnumerableProps = ["constructor", "valueOf", "isPrototypeOf", "toString", "propertyIsEnumerable", "hasOwnProperty", "toLocaleString"], hasArgsEnumBug = /* @__PURE__ */ (function() {
|
|
2998
2980
|
return arguments.propertyIsEnumerable("length");
|
|
2999
|
-
})(), contains = function
|
|
3000
|
-
for (var
|
|
3001
|
-
if (w[
|
|
2981
|
+
})(), contains = function U(w, D) {
|
|
2982
|
+
for (var O = 0; O < w.length; ) {
|
|
2983
|
+
if (w[O] === D)
|
|
3002
2984
|
return !0;
|
|
3003
|
-
|
|
2985
|
+
O += 1;
|
|
3004
2986
|
}
|
|
3005
2987
|
return !1;
|
|
3006
|
-
}, keys = /* @__PURE__ */ _curry1(typeof Object.keys == "function" && !hasArgsEnumBug ? function
|
|
2988
|
+
}, keys = /* @__PURE__ */ _curry1(typeof Object.keys == "function" && !hasArgsEnumBug ? function U(w) {
|
|
3007
2989
|
return Object(w) !== w ? [] : Object.keys(w);
|
|
3008
|
-
} : function
|
|
2990
|
+
} : function U(w) {
|
|
3009
2991
|
if (Object(w) !== w)
|
|
3010
2992
|
return [];
|
|
3011
|
-
var D,
|
|
2993
|
+
var D, O, F = [], q = hasArgsEnumBug && _isArguments(w);
|
|
3012
2994
|
for (D in w)
|
|
3013
2995
|
_has(D, w) && (!q || D !== "length") && (F[F.length] = D);
|
|
3014
2996
|
if (hasEnumBug)
|
|
3015
|
-
for (
|
|
3016
|
-
D = nonEnumerableProps[
|
|
2997
|
+
for (O = nonEnumerableProps.length - 1; O >= 0; )
|
|
2998
|
+
D = nonEnumerableProps[O], _has(D, w) && !contains(F, D) && (F[F.length] = D), O -= 1;
|
|
3017
2999
|
return F;
|
|
3018
3000
|
});
|
|
3019
|
-
function _map(
|
|
3020
|
-
for (var D = 0,
|
|
3021
|
-
F[D] =
|
|
3001
|
+
function _map(U, w) {
|
|
3002
|
+
for (var D = 0, O = w.length, F = Array(O); D < O; )
|
|
3003
|
+
F[D] = U(w[D]), D += 1;
|
|
3022
3004
|
return F;
|
|
3023
3005
|
}
|
|
3024
|
-
function _arrayReduce(
|
|
3025
|
-
for (var
|
|
3026
|
-
w =
|
|
3006
|
+
function _arrayReduce(U, w, D) {
|
|
3007
|
+
for (var O = 0, F = D.length; O < F; )
|
|
3008
|
+
w = U(w, D[O]), O += 1;
|
|
3027
3009
|
return w;
|
|
3028
3010
|
}
|
|
3029
3011
|
var XMap = /* @__PURE__ */ (function() {
|
|
3030
|
-
function
|
|
3012
|
+
function U(w, D) {
|
|
3031
3013
|
this.xf = D, this.f = w;
|
|
3032
3014
|
}
|
|
3033
|
-
return
|
|
3015
|
+
return U.prototype["@@transducer/init"] = _xfBase.init, U.prototype["@@transducer/result"] = _xfBase.result, U.prototype["@@transducer/step"] = function(w, D) {
|
|
3034
3016
|
return this.xf["@@transducer/step"](w, this.f(D));
|
|
3035
|
-
},
|
|
3036
|
-
})(), _xmap = function
|
|
3017
|
+
}, U;
|
|
3018
|
+
})(), _xmap = function U(w) {
|
|
3037
3019
|
return function(D) {
|
|
3038
3020
|
return new XMap(w, D);
|
|
3039
3021
|
};
|
|
3040
|
-
}, map = /* @__PURE__ */ _curry2(/* @__PURE__ */ _dispatchable(["fantasy-land/map", "map"], _xmap, function
|
|
3022
|
+
}, map = /* @__PURE__ */ _curry2(/* @__PURE__ */ _dispatchable(["fantasy-land/map", "map"], _xmap, function U(w, D) {
|
|
3041
3023
|
switch (Object.prototype.toString.call(D)) {
|
|
3042
3024
|
case "[object Function]":
|
|
3043
3025
|
return curryN(D.length, function() {
|
|
3044
3026
|
return w.call(this, D.apply(this, arguments));
|
|
3045
3027
|
});
|
|
3046
3028
|
case "[object Object]":
|
|
3047
|
-
return _arrayReduce(function(
|
|
3048
|
-
return
|
|
3029
|
+
return _arrayReduce(function(O, F) {
|
|
3030
|
+
return O[F] = w(D[F]), O;
|
|
3049
3031
|
}, {}, keys(D));
|
|
3050
3032
|
default:
|
|
3051
3033
|
return _map(w, D);
|
|
3052
3034
|
}
|
|
3053
3035
|
}));
|
|
3054
|
-
const _isInteger = Number.isInteger || function
|
|
3036
|
+
const _isInteger = Number.isInteger || function U(w) {
|
|
3055
3037
|
return w << 0 === w;
|
|
3056
3038
|
};
|
|
3057
|
-
function _nth(
|
|
3058
|
-
var D =
|
|
3039
|
+
function _nth(U, w) {
|
|
3040
|
+
var D = U < 0 ? w.length + U : U;
|
|
3059
3041
|
return w[D];
|
|
3060
3042
|
}
|
|
3061
|
-
function _prop(
|
|
3043
|
+
function _prop(U, w) {
|
|
3062
3044
|
if (w != null)
|
|
3063
|
-
return _isInteger(
|
|
3045
|
+
return _isInteger(U) ? _nth(U, w) : w[U];
|
|
3064
3046
|
}
|
|
3065
|
-
function _isString(
|
|
3066
|
-
return Object.prototype.toString.call(
|
|
3047
|
+
function _isString(U) {
|
|
3048
|
+
return Object.prototype.toString.call(U) === "[object String]";
|
|
3067
3049
|
}
|
|
3068
|
-
var _isArrayLike = /* @__PURE__ */ _curry1(function
|
|
3050
|
+
var _isArrayLike = /* @__PURE__ */ _curry1(function U(w) {
|
|
3069
3051
|
return _isArray(w) ? !0 : !w || typeof w != "object" || _isString(w) ? !1 : w.length === 0 ? !0 : w.length > 0 ? w.hasOwnProperty(0) && w.hasOwnProperty(w.length - 1) : !1;
|
|
3070
3052
|
}), symIterator = typeof Symbol < "u" ? Symbol.iterator : "@@iterator";
|
|
3071
|
-
function _createReduce(
|
|
3053
|
+
function _createReduce(U, w, D) {
|
|
3072
3054
|
return function(F, q, W) {
|
|
3073
3055
|
if (_isArrayLike(W))
|
|
3074
|
-
return
|
|
3056
|
+
return U(F, q, W);
|
|
3075
3057
|
if (W == null)
|
|
3076
3058
|
return q;
|
|
3077
3059
|
if (typeof W["fantasy-land/reduce"] == "function")
|
|
@@ -3085,78 +3067,78 @@ function _createReduce(O, w, D) {
|
|
|
3085
3067
|
throw new TypeError("reduce: list must be array or iterable");
|
|
3086
3068
|
};
|
|
3087
3069
|
}
|
|
3088
|
-
var and = /* @__PURE__ */ _curry2(function
|
|
3070
|
+
var and = /* @__PURE__ */ _curry2(function U(w, D) {
|
|
3089
3071
|
return w && D;
|
|
3090
3072
|
});
|
|
3091
|
-
function _iterableReduce(
|
|
3092
|
-
for (var
|
|
3093
|
-
w =
|
|
3073
|
+
function _iterableReduce(U, w, D) {
|
|
3074
|
+
for (var O = D.next(); !O.done; )
|
|
3075
|
+
w = U(w, O.value), O = D.next();
|
|
3094
3076
|
return w;
|
|
3095
3077
|
}
|
|
3096
|
-
function _methodReduce(
|
|
3097
|
-
return D[
|
|
3078
|
+
function _methodReduce(U, w, D, O) {
|
|
3079
|
+
return D[O](U, w);
|
|
3098
3080
|
}
|
|
3099
|
-
var _reduce = /* @__PURE__ */ _createReduce(_arrayReduce, _methodReduce, _iterableReduce), ap = /* @__PURE__ */ _curry2(function
|
|
3100
|
-
return typeof D["fantasy-land/ap"] == "function" ? D["fantasy-land/ap"](w) : typeof w.ap == "function" ? w.ap(D) : typeof w == "function" ? function(
|
|
3101
|
-
return w(
|
|
3102
|
-
} : _reduce(function(
|
|
3103
|
-
return _concat(
|
|
3081
|
+
var _reduce = /* @__PURE__ */ _createReduce(_arrayReduce, _methodReduce, _iterableReduce), ap = /* @__PURE__ */ _curry2(function U(w, D) {
|
|
3082
|
+
return typeof D["fantasy-land/ap"] == "function" ? D["fantasy-land/ap"](w) : typeof w.ap == "function" ? w.ap(D) : typeof w == "function" ? function(O) {
|
|
3083
|
+
return w(O)(D(O));
|
|
3084
|
+
} : _reduce(function(O, F) {
|
|
3085
|
+
return _concat(O, map(F, D));
|
|
3104
3086
|
}, [], w);
|
|
3105
3087
|
});
|
|
3106
|
-
function _assoc(
|
|
3107
|
-
if (_isInteger(
|
|
3108
|
-
var
|
|
3109
|
-
return F[
|
|
3088
|
+
function _assoc(U, w, D) {
|
|
3089
|
+
if (_isInteger(U) && _isArray(D)) {
|
|
3090
|
+
var O = U < 0 ? D.length + U : U, F = [].concat(D);
|
|
3091
|
+
return F[O] = w, F;
|
|
3110
3092
|
}
|
|
3111
3093
|
var q = {};
|
|
3112
3094
|
for (var W in D)
|
|
3113
3095
|
q[W] = D[W];
|
|
3114
|
-
return q[
|
|
3096
|
+
return q[U] = w, q;
|
|
3115
3097
|
}
|
|
3116
|
-
var isNil = /* @__PURE__ */ _curry1(function
|
|
3098
|
+
var isNil = /* @__PURE__ */ _curry1(function U(w) {
|
|
3117
3099
|
return w == null;
|
|
3118
|
-
}), assocPath = /* @__PURE__ */ _curry3(function
|
|
3100
|
+
}), assocPath = /* @__PURE__ */ _curry3(function U(w, D, O) {
|
|
3119
3101
|
if (w.length === 0)
|
|
3120
3102
|
return D;
|
|
3121
3103
|
var F = w[0];
|
|
3122
3104
|
if (w.length > 1) {
|
|
3123
|
-
var q = _prop(F,
|
|
3124
|
-
(isNil(q) || typeof q != "object") && (q = _isInteger(w[1]) ? [] : {}), D =
|
|
3105
|
+
var q = _prop(F, O);
|
|
3106
|
+
(isNil(q) || typeof q != "object") && (q = _isInteger(w[1]) ? [] : {}), D = U(Array.prototype.slice.call(w, 1), D, q);
|
|
3125
3107
|
}
|
|
3126
|
-
return _assoc(F, D,
|
|
3108
|
+
return _assoc(F, D, O);
|
|
3127
3109
|
});
|
|
3128
|
-
function _isFunction(
|
|
3129
|
-
var w = Object.prototype.toString.call(
|
|
3110
|
+
function _isFunction(U) {
|
|
3111
|
+
var w = Object.prototype.toString.call(U);
|
|
3130
3112
|
return w === "[object Function]" || w === "[object AsyncFunction]" || w === "[object GeneratorFunction]" || w === "[object AsyncGeneratorFunction]";
|
|
3131
3113
|
}
|
|
3132
|
-
var liftN = /* @__PURE__ */ _curry2(function
|
|
3133
|
-
var
|
|
3114
|
+
var liftN = /* @__PURE__ */ _curry2(function U(w, D) {
|
|
3115
|
+
var O = curryN(w, D);
|
|
3134
3116
|
return curryN(w, function() {
|
|
3135
|
-
return _arrayReduce(ap, map(
|
|
3117
|
+
return _arrayReduce(ap, map(O, arguments[0]), Array.prototype.slice.call(arguments, 1));
|
|
3136
3118
|
});
|
|
3137
|
-
}), lift = /* @__PURE__ */ _curry1(function
|
|
3119
|
+
}), lift = /* @__PURE__ */ _curry1(function U(w) {
|
|
3138
3120
|
return liftN(w.length, w);
|
|
3139
|
-
}), both = /* @__PURE__ */ _curry2(function
|
|
3121
|
+
}), both = /* @__PURE__ */ _curry2(function U(w, D) {
|
|
3140
3122
|
return _isFunction(w) ? function() {
|
|
3141
3123
|
return w.apply(this, arguments) && D.apply(this, arguments);
|
|
3142
3124
|
} : lift(and)(w, D);
|
|
3143
|
-
}), hasPath = /* @__PURE__ */ _curry2(function
|
|
3125
|
+
}), hasPath = /* @__PURE__ */ _curry2(function U(w, D) {
|
|
3144
3126
|
if (w.length === 0 || isNil(D))
|
|
3145
3127
|
return !1;
|
|
3146
|
-
for (var
|
|
3147
|
-
if (!isNil(
|
|
3148
|
-
|
|
3128
|
+
for (var O = D, F = 0; F < w.length; )
|
|
3129
|
+
if (!isNil(O) && _has(w[F], O))
|
|
3130
|
+
O = O[w[F]], F += 1;
|
|
3149
3131
|
else
|
|
3150
3132
|
return !1;
|
|
3151
3133
|
return !0;
|
|
3152
|
-
}), has = /* @__PURE__ */ _curry2(function
|
|
3134
|
+
}), has = /* @__PURE__ */ _curry2(function U(w, D) {
|
|
3153
3135
|
return hasPath([w], D);
|
|
3154
3136
|
});
|
|
3155
|
-
function _path(
|
|
3156
|
-
for (var D = w,
|
|
3137
|
+
function _path(U, w) {
|
|
3138
|
+
for (var D = w, O = 0; O < U.length; O += 1) {
|
|
3157
3139
|
if (D == null)
|
|
3158
3140
|
return;
|
|
3159
|
-
var F = O
|
|
3141
|
+
var F = U[O];
|
|
3160
3142
|
_isInteger(F) ? D = _nth(F, D) : D = D[F];
|
|
3161
3143
|
}
|
|
3162
3144
|
return D;
|
|
@@ -3166,16 +3148,16 @@ const DEFAULT_FORMATTERS = {
|
|
|
3166
3148
|
/**
|
|
3167
3149
|
* Format as JSON (useful for debugging)
|
|
3168
3150
|
*/
|
|
3169
|
-
json: (
|
|
3151
|
+
json: (U) => JSON.stringify(U, null, 2),
|
|
3170
3152
|
/**
|
|
3171
3153
|
* Format date as "DD MMM YY HH:mm:ss" (e.g., "10 Nov 25 11:27:49")
|
|
3172
3154
|
* Accepts ISO date strings, timestamps, or Date objects.
|
|
3173
3155
|
* Returns empty string for null/undefined values.
|
|
3174
3156
|
*/
|
|
3175
|
-
date: (
|
|
3176
|
-
if (!
|
|
3177
|
-
const w =
|
|
3178
|
-
return isNaN(w.getTime()) ? (console.warn("[Binder] Invalid date value:",
|
|
3157
|
+
date: (U) => {
|
|
3158
|
+
if (!U) return "";
|
|
3159
|
+
const w = U instanceof Date ? U : new Date(U);
|
|
3160
|
+
return isNaN(w.getTime()) ? (console.warn("[Binder] Invalid date value:", U), "") : dateToZooyStdTimeString(w);
|
|
3179
3161
|
},
|
|
3180
3162
|
/**
|
|
3181
3163
|
* Template string interpolation formatter
|
|
@@ -3197,13 +3179,13 @@ const DEFAULT_FORMATTERS = {
|
|
|
3197
3179
|
* <span zoo-bind="price|tpl"
|
|
3198
3180
|
* zoo-bind-tpl="$${(value / 100).toFixed(2)}">
|
|
3199
3181
|
*/
|
|
3200
|
-
tpl: (
|
|
3201
|
-
const
|
|
3202
|
-
if (!
|
|
3182
|
+
tpl: (U, w, D) => {
|
|
3183
|
+
const O = D?.getAttribute("zoo-bind-attr-tpl");
|
|
3184
|
+
if (!O) return U;
|
|
3203
3185
|
try {
|
|
3204
|
-
return new Function("value", "data", `return \`${
|
|
3186
|
+
return new Function("value", "data", `return \`${O}\`;`)(U, w);
|
|
3205
3187
|
} catch (F) {
|
|
3206
|
-
return console.warn("[Binder] Invalid template:",
|
|
3188
|
+
return console.warn("[Binder] Invalid template:", O, F), U;
|
|
3207
3189
|
}
|
|
3208
3190
|
}
|
|
3209
3191
|
};
|
|
@@ -3224,12 +3206,12 @@ class Binder {
|
|
|
3224
3206
|
* @param {Object<string, Function>} [options.formatters] - Custom formatters
|
|
3225
3207
|
* @throws {Error} If url or rootEl is missing/invalid
|
|
3226
3208
|
*/
|
|
3227
|
-
constructor(w, D,
|
|
3209
|
+
constructor(w, D, O, F = {}) {
|
|
3228
3210
|
if (!D)
|
|
3229
3211
|
throw new Error("Binder requires a URL");
|
|
3230
|
-
if (!
|
|
3212
|
+
if (!O || !(O instanceof Element))
|
|
3231
3213
|
throw new Error("Binder requires a valid rootEl Element");
|
|
3232
|
-
this.#t = w, this.#e = new URL(D, window.location.origin), this.#s =
|
|
3214
|
+
this.#t = w, this.#e = new URL(D, window.location.origin), this.#s = O, this.#n = { ...DEFAULT_FORMATTERS, ...F.formatters }, F.urlParams ? this.#i(F.urlParams) : this.#o();
|
|
3233
3215
|
}
|
|
3234
3216
|
get url() {
|
|
3235
3217
|
return this.#e;
|
|
@@ -3247,16 +3229,16 @@ class Binder {
|
|
|
3247
3229
|
return both(has("count"), has("results"))(this.#r);
|
|
3248
3230
|
}
|
|
3249
3231
|
#i(w) {
|
|
3250
|
-
return Object.entries(w).forEach(([D,
|
|
3251
|
-
if (!isDefAndNotNull(
|
|
3232
|
+
return Object.entries(w).forEach(([D, O]) => {
|
|
3233
|
+
if (!isDefAndNotNull(O) || O === "" || Array.isArray(O) && O.length < 1) {
|
|
3252
3234
|
this.#e.searchParams.delete(D);
|
|
3253
3235
|
return;
|
|
3254
3236
|
}
|
|
3255
|
-
if (Array.isArray(
|
|
3256
|
-
this.#e.searchParams.set(D,
|
|
3237
|
+
if (Array.isArray(O)) {
|
|
3238
|
+
this.#e.searchParams.set(D, O.join(","));
|
|
3257
3239
|
return;
|
|
3258
3240
|
}
|
|
3259
|
-
this.#e.searchParams.set(D,
|
|
3241
|
+
this.#e.searchParams.set(D, O);
|
|
3260
3242
|
}), this.#o(), this.#e;
|
|
3261
3243
|
}
|
|
3262
3244
|
/**
|
|
@@ -3339,19 +3321,19 @@ class Binder {
|
|
|
3339
3321
|
* @param {boolean} [options.removeAttributes=false] - Remove binding attributes after processing (vs keeping for re-render)
|
|
3340
3322
|
* @private
|
|
3341
3323
|
*/
|
|
3342
|
-
#a(w, D,
|
|
3324
|
+
#a(w, D, O = 0, F = {}) {
|
|
3343
3325
|
const q = F.removeAttributes ?? !1;
|
|
3344
3326
|
w.querySelectorAll("[zoo-bind-attr]").forEach((W) => {
|
|
3345
3327
|
if (W.closest("[zoo-template]")) return;
|
|
3346
3328
|
W.getAttribute("zoo-bind-attr").split(",").forEach((G) => {
|
|
3347
3329
|
const [K, Q] = G.split(":").map((Z) => Z.trim()), [tt, J] = Q.split("|").map((Z) => Z.trim());
|
|
3348
|
-
let
|
|
3349
|
-
J && this.#n[J] && (
|
|
3330
|
+
let X = this.#c(D, tt, O);
|
|
3331
|
+
J && this.#n[J] && (X = this.#n[J](X, D, W)), isDefAndNotNull(X) && W.setAttribute(K, X);
|
|
3350
3332
|
}), q && (W.removeAttribute("zoo-bind-attr"), W.removeAttribute("zoo-bind-attr-tpl"));
|
|
3351
3333
|
}), w.querySelectorAll("[zoo-bind]").forEach((W) => {
|
|
3352
3334
|
if (W.closest("[zoo-template]")) return;
|
|
3353
|
-
const
|
|
3354
|
-
let Q = this.#c(D, G,
|
|
3335
|
+
const Y = W.getAttribute("zoo-bind"), [G, K] = Y.split("|").map((tt) => tt.trim());
|
|
3336
|
+
let Q = this.#c(D, G, O);
|
|
3355
3337
|
K && this.#n[K] && (Q = this.#n[K](Q, D, W)), W.textContent = Q ?? "", q && (W.removeAttribute("zoo-bind"), W.removeAttribute("zoo-bind-tpl"));
|
|
3356
3338
|
});
|
|
3357
3339
|
}
|
|
@@ -3362,14 +3344,14 @@ class Binder {
|
|
|
3362
3344
|
*/
|
|
3363
3345
|
#l() {
|
|
3364
3346
|
this.#s.querySelectorAll("[zoo-template]").forEach((D) => {
|
|
3365
|
-
const
|
|
3366
|
-
if (!
|
|
3347
|
+
const O = D.getAttribute("zoo-template"), F = D.getAttribute("zoo-template-bind");
|
|
3348
|
+
if (!O) {
|
|
3367
3349
|
console.warn("[Binder] Consumer missing template ID", D);
|
|
3368
3350
|
return;
|
|
3369
3351
|
}
|
|
3370
|
-
const q = this.#s.querySelector(`#${
|
|
3352
|
+
const q = this.#s.querySelector(`#${O}`);
|
|
3371
3353
|
if (!q || q.tagName !== "TEMPLATE") {
|
|
3372
|
-
console.error(`[DataBinder] Template not found or invalid: ${
|
|
3354
|
+
console.error(`[DataBinder] Template not found or invalid: ${O}`);
|
|
3373
3355
|
return;
|
|
3374
3356
|
}
|
|
3375
3357
|
const W = F ? path(F.split("."), this.#r) : this.#r;
|
|
@@ -3381,8 +3363,8 @@ class Binder {
|
|
|
3381
3363
|
console.error(`[DataBinder] Data slice is not an array. Path: ${F}`, W);
|
|
3382
3364
|
return;
|
|
3383
3365
|
}
|
|
3384
|
-
D.innerHTML = "", W.forEach((
|
|
3385
|
-
const K = this.#h(q,
|
|
3366
|
+
D.innerHTML = "", W.forEach((Y, G) => {
|
|
3367
|
+
const K = this.#h(q, Y, G);
|
|
3386
3368
|
D.appendChild(K);
|
|
3387
3369
|
});
|
|
3388
3370
|
});
|
|
@@ -3397,9 +3379,9 @@ class Binder {
|
|
|
3397
3379
|
* @return {DocumentFragment} Rendered template clone
|
|
3398
3380
|
* @private
|
|
3399
3381
|
*/
|
|
3400
|
-
#h(w, D,
|
|
3382
|
+
#h(w, D, O) {
|
|
3401
3383
|
const F = w.content.cloneNode(!0);
|
|
3402
|
-
return this.#a(F, D,
|
|
3384
|
+
return this.#a(F, D, O, {
|
|
3403
3385
|
removeAttributes: !0
|
|
3404
3386
|
}), F;
|
|
3405
3387
|
}
|
|
@@ -3418,12 +3400,12 @@ class Binder {
|
|
|
3418
3400
|
* @return {*} The value, or undefined if not found
|
|
3419
3401
|
* @private
|
|
3420
3402
|
*/
|
|
3421
|
-
#c(w, D,
|
|
3403
|
+
#c(w, D, O) {
|
|
3422
3404
|
const F = {
|
|
3423
|
-
$index: () =>
|
|
3424
|
-
$index__paged: () => this.offset +
|
|
3425
|
-
$index1: () =>
|
|
3426
|
-
$index1__paged: () => this.offset +
|
|
3405
|
+
$index: () => O,
|
|
3406
|
+
$index__paged: () => this.offset + O,
|
|
3407
|
+
$index1: () => O + 1,
|
|
3408
|
+
$index1__paged: () => this.offset + O + 1
|
|
3427
3409
|
};
|
|
3428
3410
|
return F[D] ? F[D]() : path(D.split("."), w);
|
|
3429
3411
|
}
|
|
@@ -3439,13 +3421,13 @@ const SEMANTIC_ATTRS = new Map(Object.entries({
|
|
|
3439
3421
|
"zoo-view": "view",
|
|
3440
3422
|
"zoo-event": "event",
|
|
3441
3423
|
"zoo-href": "href"
|
|
3442
|
-
})), getSemanticAttributes = (
|
|
3424
|
+
})), getSemanticAttributes = (U) => {
|
|
3443
3425
|
let w = {};
|
|
3444
|
-
return Array.from(
|
|
3445
|
-
const
|
|
3446
|
-
SEMANTIC_ATTRS.has(
|
|
3426
|
+
return Array.from(U.attributes).forEach((D) => {
|
|
3427
|
+
const O = D.name, F = D.value;
|
|
3428
|
+
SEMANTIC_ATTRS.has(O) ? w[SEMANTIC_ATTRS.get(O)] = F : (O.startsWith("data-") || O.startsWith("zoo-")) && (w = assocPath(O.split("-"), F, w));
|
|
3447
3429
|
}), w;
|
|
3448
|
-
}, getEventAttribute = (
|
|
3430
|
+
}, getEventAttribute = (U, w, D = "event") => U.getAttribute(w) || U.getAttribute(D);
|
|
3449
3431
|
/**
|
|
3450
3432
|
* @license
|
|
3451
3433
|
* Copyright 2019 Google LLC
|
|
@@ -3453,16 +3435,16 @@ const SEMANTIC_ATTRS = new Map(Object.entries({
|
|
|
3453
3435
|
*/
|
|
3454
3436
|
const t$1 = globalThis, e$2 = t$1.ShadowRoot && (t$1.ShadyCSS === void 0 || t$1.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, s$2 = Symbol(), o$3 = /* @__PURE__ */ new WeakMap();
|
|
3455
3437
|
let n$2 = class {
|
|
3456
|
-
constructor(w, D,
|
|
3457
|
-
if (this._$cssResult$ = !0,
|
|
3438
|
+
constructor(w, D, O) {
|
|
3439
|
+
if (this._$cssResult$ = !0, O !== s$2) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
3458
3440
|
this.cssText = w, this.t = D;
|
|
3459
3441
|
}
|
|
3460
3442
|
get styleSheet() {
|
|
3461
3443
|
let w = this.o;
|
|
3462
3444
|
const D = this.t;
|
|
3463
3445
|
if (e$2 && w === void 0) {
|
|
3464
|
-
const
|
|
3465
|
-
|
|
3446
|
+
const O = D !== void 0 && D.length === 1;
|
|
3447
|
+
O && (w = o$3.get(D)), w === void 0 && ((this.o = w = new CSSStyleSheet()).replaceSync(this.cssText), O && o$3.set(D, w));
|
|
3466
3448
|
}
|
|
3467
3449
|
return w;
|
|
3468
3450
|
}
|
|
@@ -3470,58 +3452,58 @@ let n$2 = class {
|
|
|
3470
3452
|
return this.cssText;
|
|
3471
3453
|
}
|
|
3472
3454
|
};
|
|
3473
|
-
const r$2 = (
|
|
3474
|
-
const D =
|
|
3455
|
+
const r$2 = (U) => new n$2(typeof U == "string" ? U : U + "", void 0, s$2), i$3 = (U, ...w) => {
|
|
3456
|
+
const D = U.length === 1 ? U[0] : w.reduce(((O, F, q) => O + ((W) => {
|
|
3475
3457
|
if (W._$cssResult$ === !0) return W.cssText;
|
|
3476
3458
|
if (typeof W == "number") return W;
|
|
3477
3459
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + W + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
3478
|
-
})(F) +
|
|
3479
|
-
return new n$2(D,
|
|
3480
|
-
}, S$1 = (
|
|
3481
|
-
if (e$2)
|
|
3460
|
+
})(F) + U[q + 1]), U[0]);
|
|
3461
|
+
return new n$2(D, U, s$2);
|
|
3462
|
+
}, S$1 = (U, w) => {
|
|
3463
|
+
if (e$2) U.adoptedStyleSheets = w.map(((D) => D instanceof CSSStyleSheet ? D : D.styleSheet));
|
|
3482
3464
|
else for (const D of w) {
|
|
3483
|
-
const
|
|
3484
|
-
F !== void 0 &&
|
|
3465
|
+
const O = document.createElement("style"), F = t$1.litNonce;
|
|
3466
|
+
F !== void 0 && O.setAttribute("nonce", F), O.textContent = D.cssText, U.appendChild(O);
|
|
3485
3467
|
}
|
|
3486
|
-
}, c$2 = e$2 ? (
|
|
3468
|
+
}, c$2 = e$2 ? (U) => U : (U) => U instanceof CSSStyleSheet ? ((w) => {
|
|
3487
3469
|
let D = "";
|
|
3488
|
-
for (const
|
|
3470
|
+
for (const O of w.cssRules) D += O.cssText;
|
|
3489
3471
|
return r$2(D);
|
|
3490
|
-
})(
|
|
3472
|
+
})(U) : U;
|
|
3491
3473
|
/**
|
|
3492
3474
|
* @license
|
|
3493
3475
|
* Copyright 2017 Google LLC
|
|
3494
3476
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
3495
3477
|
*/
|
|
3496
|
-
const { is: i$2, defineProperty: e$1, getOwnPropertyDescriptor: h$1, getOwnPropertyNames: r$1, getOwnPropertySymbols: o$2, getPrototypeOf: n$1 } = Object, a$1 = globalThis, c$1 = a$1.trustedTypes, l$1 = c$1 ? c$1.emptyScript : "", p$1 = a$1.reactiveElementPolyfillSupport, d$1 = (
|
|
3478
|
+
const { is: i$2, defineProperty: e$1, getOwnPropertyDescriptor: h$1, getOwnPropertyNames: r$1, getOwnPropertySymbols: o$2, getPrototypeOf: n$1 } = Object, a$1 = globalThis, c$1 = a$1.trustedTypes, l$1 = c$1 ? c$1.emptyScript : "", p$1 = a$1.reactiveElementPolyfillSupport, d$1 = (U, w) => U, u$1 = { toAttribute(U, w) {
|
|
3497
3479
|
switch (w) {
|
|
3498
3480
|
case Boolean:
|
|
3499
|
-
|
|
3481
|
+
U = U ? l$1 : null;
|
|
3500
3482
|
break;
|
|
3501
3483
|
case Object:
|
|
3502
3484
|
case Array:
|
|
3503
|
-
|
|
3485
|
+
U = U == null ? U : JSON.stringify(U);
|
|
3504
3486
|
}
|
|
3505
|
-
return
|
|
3506
|
-
}, fromAttribute(
|
|
3507
|
-
let D =
|
|
3487
|
+
return U;
|
|
3488
|
+
}, fromAttribute(U, w) {
|
|
3489
|
+
let D = U;
|
|
3508
3490
|
switch (w) {
|
|
3509
3491
|
case Boolean:
|
|
3510
|
-
D =
|
|
3492
|
+
D = U !== null;
|
|
3511
3493
|
break;
|
|
3512
3494
|
case Number:
|
|
3513
|
-
D =
|
|
3495
|
+
D = U === null ? null : Number(U);
|
|
3514
3496
|
break;
|
|
3515
3497
|
case Object:
|
|
3516
3498
|
case Array:
|
|
3517
3499
|
try {
|
|
3518
|
-
D = JSON.parse(
|
|
3500
|
+
D = JSON.parse(U);
|
|
3519
3501
|
} catch {
|
|
3520
3502
|
D = null;
|
|
3521
3503
|
}
|
|
3522
3504
|
}
|
|
3523
3505
|
return D;
|
|
3524
|
-
} }, f$1 = (
|
|
3506
|
+
} }, f$1 = (U, w) => !i$2(U, w), b$1 = { attribute: !0, type: String, converter: u$1, reflect: !1, useDefault: !1, hasChanged: f$1 };
|
|
3525
3507
|
Symbol.metadata ??= Symbol("metadata"), a$1.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
3526
3508
|
let y$1 = class extends HTMLElement {
|
|
3527
3509
|
static addInitializer(w) {
|
|
@@ -3532,19 +3514,19 @@ let y$1 = class extends HTMLElement {
|
|
|
3532
3514
|
}
|
|
3533
3515
|
static createProperty(w, D = b$1) {
|
|
3534
3516
|
if (D.state && (D.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(w) && ((D = Object.create(D)).wrapped = !0), this.elementProperties.set(w, D), !D.noAccessor) {
|
|
3535
|
-
const
|
|
3517
|
+
const O = Symbol(), F = this.getPropertyDescriptor(w, O, D);
|
|
3536
3518
|
F !== void 0 && e$1(this.prototype, w, F);
|
|
3537
3519
|
}
|
|
3538
3520
|
}
|
|
3539
|
-
static getPropertyDescriptor(w, D,
|
|
3521
|
+
static getPropertyDescriptor(w, D, O) {
|
|
3540
3522
|
const { get: F, set: q } = h$1(this.prototype, w) ?? { get() {
|
|
3541
3523
|
return this[D];
|
|
3542
3524
|
}, set(W) {
|
|
3543
3525
|
this[D] = W;
|
|
3544
3526
|
} };
|
|
3545
3527
|
return { get: F, set(W) {
|
|
3546
|
-
const
|
|
3547
|
-
q?.call(this, W), this.requestUpdate(w,
|
|
3528
|
+
const Y = F?.call(this);
|
|
3529
|
+
q?.call(this, W), this.requestUpdate(w, Y, O);
|
|
3548
3530
|
}, configurable: !0, enumerable: !0 };
|
|
3549
3531
|
}
|
|
3550
3532
|
static getPropertyOptions(w) {
|
|
@@ -3558,17 +3540,17 @@ let y$1 = class extends HTMLElement {
|
|
|
3558
3540
|
static finalize() {
|
|
3559
3541
|
if (this.hasOwnProperty(d$1("finalized"))) return;
|
|
3560
3542
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(d$1("properties"))) {
|
|
3561
|
-
const D = this.properties,
|
|
3562
|
-
for (const F of
|
|
3543
|
+
const D = this.properties, O = [...r$1(D), ...o$2(D)];
|
|
3544
|
+
for (const F of O) this.createProperty(F, D[F]);
|
|
3563
3545
|
}
|
|
3564
3546
|
const w = this[Symbol.metadata];
|
|
3565
3547
|
if (w !== null) {
|
|
3566
3548
|
const D = litPropertyMetadata.get(w);
|
|
3567
|
-
if (D !== void 0) for (const [
|
|
3549
|
+
if (D !== void 0) for (const [O, F] of D) this.elementProperties.set(O, F);
|
|
3568
3550
|
}
|
|
3569
3551
|
this._$Eh = /* @__PURE__ */ new Map();
|
|
3570
|
-
for (const [D,
|
|
3571
|
-
const F = this._$Eu(D,
|
|
3552
|
+
for (const [D, O] of this.elementProperties) {
|
|
3553
|
+
const F = this._$Eu(D, O);
|
|
3572
3554
|
F !== void 0 && this._$Eh.set(F, D);
|
|
3573
3555
|
}
|
|
3574
3556
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
@@ -3576,14 +3558,14 @@ let y$1 = class extends HTMLElement {
|
|
|
3576
3558
|
static finalizeStyles(w) {
|
|
3577
3559
|
const D = [];
|
|
3578
3560
|
if (Array.isArray(w)) {
|
|
3579
|
-
const
|
|
3580
|
-
for (const F of
|
|
3561
|
+
const O = new Set(w.flat(1 / 0).reverse());
|
|
3562
|
+
for (const F of O) D.unshift(c$2(F));
|
|
3581
3563
|
} else w !== void 0 && D.push(c$2(w));
|
|
3582
3564
|
return D;
|
|
3583
3565
|
}
|
|
3584
3566
|
static _$Eu(w, D) {
|
|
3585
|
-
const
|
|
3586
|
-
return
|
|
3567
|
+
const O = D.attribute;
|
|
3568
|
+
return O === !1 ? void 0 : typeof O == "string" ? O : typeof w == "string" ? w.toLowerCase() : void 0;
|
|
3587
3569
|
}
|
|
3588
3570
|
constructor() {
|
|
3589
3571
|
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
@@ -3599,7 +3581,7 @@ let y$1 = class extends HTMLElement {
|
|
|
3599
3581
|
}
|
|
3600
3582
|
_$E_() {
|
|
3601
3583
|
const w = /* @__PURE__ */ new Map(), D = this.constructor.elementProperties;
|
|
3602
|
-
for (const
|
|
3584
|
+
for (const O of D.keys()) this.hasOwnProperty(O) && (w.set(O, this[O]), delete this[O]);
|
|
3603
3585
|
w.size > 0 && (this._$Ep = w);
|
|
3604
3586
|
}
|
|
3605
3587
|
createRenderRoot() {
|
|
@@ -3614,35 +3596,35 @@ let y$1 = class extends HTMLElement {
|
|
|
3614
3596
|
disconnectedCallback() {
|
|
3615
3597
|
this._$EO?.forEach(((w) => w.hostDisconnected?.()));
|
|
3616
3598
|
}
|
|
3617
|
-
attributeChangedCallback(w, D,
|
|
3618
|
-
this._$AK(w,
|
|
3599
|
+
attributeChangedCallback(w, D, O) {
|
|
3600
|
+
this._$AK(w, O);
|
|
3619
3601
|
}
|
|
3620
3602
|
_$ET(w, D) {
|
|
3621
|
-
const
|
|
3622
|
-
if (F !== void 0 &&
|
|
3623
|
-
const q = (
|
|
3603
|
+
const O = this.constructor.elementProperties.get(w), F = this.constructor._$Eu(w, O);
|
|
3604
|
+
if (F !== void 0 && O.reflect === !0) {
|
|
3605
|
+
const q = (O.converter?.toAttribute !== void 0 ? O.converter : u$1).toAttribute(D, O.type);
|
|
3624
3606
|
this._$Em = w, q == null ? this.removeAttribute(F) : this.setAttribute(F, q), this._$Em = null;
|
|
3625
3607
|
}
|
|
3626
3608
|
}
|
|
3627
3609
|
_$AK(w, D) {
|
|
3628
|
-
const
|
|
3610
|
+
const O = this.constructor, F = O._$Eh.get(w);
|
|
3629
3611
|
if (F !== void 0 && this._$Em !== F) {
|
|
3630
|
-
const q =
|
|
3612
|
+
const q = O.getPropertyOptions(F), W = typeof q.converter == "function" ? { fromAttribute: q.converter } : q.converter?.fromAttribute !== void 0 ? q.converter : u$1;
|
|
3631
3613
|
this._$Em = F;
|
|
3632
|
-
const
|
|
3633
|
-
this[F] =
|
|
3614
|
+
const Y = W.fromAttribute(D, q.type);
|
|
3615
|
+
this[F] = Y ?? this._$Ej?.get(F) ?? Y, this._$Em = null;
|
|
3634
3616
|
}
|
|
3635
3617
|
}
|
|
3636
|
-
requestUpdate(w, D,
|
|
3618
|
+
requestUpdate(w, D, O) {
|
|
3637
3619
|
if (w !== void 0) {
|
|
3638
3620
|
const F = this.constructor, q = this[w];
|
|
3639
|
-
if (
|
|
3640
|
-
this.C(w, D,
|
|
3621
|
+
if (O ??= F.getPropertyOptions(w), !((O.hasChanged ?? f$1)(q, D) || O.useDefault && O.reflect && q === this._$Ej?.get(w) && !this.hasAttribute(F._$Eu(w, O)))) return;
|
|
3622
|
+
this.C(w, D, O);
|
|
3641
3623
|
}
|
|
3642
3624
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
3643
3625
|
}
|
|
3644
|
-
C(w, D, { useDefault:
|
|
3645
|
-
|
|
3626
|
+
C(w, D, { useDefault: O, reflect: F, wrapped: q }, W) {
|
|
3627
|
+
O && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(w) && (this._$Ej.set(w, W ?? D ?? this[w]), q !== !0 || W !== void 0) || (this._$AL.has(w) || (this.hasUpdated || O || (D = void 0), this._$AL.set(w, D)), F === !0 && this._$Em !== w && (this._$Eq ??= /* @__PURE__ */ new Set()).add(w));
|
|
3646
3628
|
}
|
|
3647
3629
|
async _$EP() {
|
|
3648
3630
|
this.isUpdatePending = !0;
|
|
@@ -3664,18 +3646,18 @@ let y$1 = class extends HTMLElement {
|
|
|
3664
3646
|
for (const [F, q] of this._$Ep) this[F] = q;
|
|
3665
3647
|
this._$Ep = void 0;
|
|
3666
3648
|
}
|
|
3667
|
-
const
|
|
3668
|
-
if (
|
|
3669
|
-
const { wrapped: W } = q,
|
|
3670
|
-
W !== !0 || this._$AL.has(F) ||
|
|
3649
|
+
const O = this.constructor.elementProperties;
|
|
3650
|
+
if (O.size > 0) for (const [F, q] of O) {
|
|
3651
|
+
const { wrapped: W } = q, Y = this[F];
|
|
3652
|
+
W !== !0 || this._$AL.has(F) || Y === void 0 || this.C(F, void 0, q, Y);
|
|
3671
3653
|
}
|
|
3672
3654
|
}
|
|
3673
3655
|
let w = !1;
|
|
3674
3656
|
const D = this._$AL;
|
|
3675
3657
|
try {
|
|
3676
|
-
w = this.shouldUpdate(D), w ? (this.willUpdate(D), this._$EO?.forEach(((
|
|
3677
|
-
} catch (
|
|
3678
|
-
throw w = !1, this._$EM(),
|
|
3658
|
+
w = this.shouldUpdate(D), w ? (this.willUpdate(D), this._$EO?.forEach(((O) => O.hostUpdate?.())), this.update(D)) : this._$EM();
|
|
3659
|
+
} catch (O) {
|
|
3660
|
+
throw w = !1, this._$EM(), O;
|
|
3679
3661
|
}
|
|
3680
3662
|
w && this._$AE(D);
|
|
3681
3663
|
}
|
|
@@ -3710,46 +3692,46 @@ y$1.elementStyles = [], y$1.shadowRootOptions = { mode: "open" }, y$1[d$1("eleme
|
|
|
3710
3692
|
* Copyright 2017 Google LLC
|
|
3711
3693
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
3712
3694
|
*/
|
|
3713
|
-
const t = globalThis, i$1 = t.trustedTypes, s$1 = i$1 ? i$1.createPolicy("lit-html", { createHTML: (
|
|
3695
|
+
const t = globalThis, i$1 = t.trustedTypes, s$1 = i$1 ? i$1.createPolicy("lit-html", { createHTML: (U) => U }) : void 0, e = "$lit$", h = `lit$${Math.random().toFixed(9).slice(2)}$`, o$1 = "?" + h, n = `<${o$1}>`, r = document, l = () => r.createComment(""), c = (U) => U === null || typeof U != "object" && typeof U != "function", a = Array.isArray, u = (U) => a(U) || typeof U?.[Symbol.iterator] == "function", d = `[
|
|
3714
3696
|
\f\r]`, f = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, v = /-->/g, _ = />/g, m = RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^
|
|
3715
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), p = /'/g, g = /"/g, $ = /^(?:script|style|textarea|title)$/i, y = (
|
|
3716
|
-
function P(
|
|
3717
|
-
if (!a(
|
|
3697
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), p = /'/g, g = /"/g, $ = /^(?:script|style|textarea|title)$/i, y = (U) => (w, ...D) => ({ _$litType$: U, strings: w, values: D }), x = y(1), b = y(2), T = Symbol.for("lit-noChange"), E = Symbol.for("lit-nothing"), A = /* @__PURE__ */ new WeakMap(), C = r.createTreeWalker(r, 129);
|
|
3698
|
+
function P(U, w) {
|
|
3699
|
+
if (!a(U) || !U.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
3718
3700
|
return s$1 !== void 0 ? s$1.createHTML(w) : w;
|
|
3719
3701
|
}
|
|
3720
|
-
const V = (
|
|
3721
|
-
const D =
|
|
3702
|
+
const V = (U, w) => {
|
|
3703
|
+
const D = U.length - 1, O = [];
|
|
3722
3704
|
let F, q = w === 2 ? "<svg>" : w === 3 ? "<math>" : "", W = f;
|
|
3723
|
-
for (let
|
|
3724
|
-
const G =
|
|
3705
|
+
for (let Y = 0; Y < D; Y++) {
|
|
3706
|
+
const G = U[Y];
|
|
3725
3707
|
let K, Q, tt = -1, J = 0;
|
|
3726
3708
|
for (; J < G.length && (W.lastIndex = J, Q = W.exec(G), Q !== null); ) J = W.lastIndex, W === f ? Q[1] === "!--" ? W = v : Q[1] !== void 0 ? W = _ : Q[2] !== void 0 ? ($.test(Q[2]) && (F = RegExp("</" + Q[2], "g")), W = m) : Q[3] !== void 0 && (W = m) : W === m ? Q[0] === ">" ? (W = F ?? f, tt = -1) : Q[1] === void 0 ? tt = -2 : (tt = W.lastIndex - Q[2].length, K = Q[1], W = Q[3] === void 0 ? m : Q[3] === '"' ? g : p) : W === g || W === p ? W = m : W === v || W === _ ? W = f : (W = m, F = void 0);
|
|
3727
|
-
const
|
|
3728
|
-
q += W === f ? G + n : tt >= 0 ? (
|
|
3709
|
+
const X = W === m && U[Y + 1].startsWith("/>") ? " " : "";
|
|
3710
|
+
q += W === f ? G + n : tt >= 0 ? (O.push(K), G.slice(0, tt) + e + G.slice(tt) + h + X) : G + h + (tt === -2 ? Y : X);
|
|
3729
3711
|
}
|
|
3730
|
-
return [P(
|
|
3712
|
+
return [P(U, q + (U[D] || "<?>") + (w === 2 ? "</svg>" : w === 3 ? "</math>" : "")), O];
|
|
3731
3713
|
};
|
|
3732
3714
|
class N {
|
|
3733
|
-
constructor({ strings: w, _$litType$: D },
|
|
3715
|
+
constructor({ strings: w, _$litType$: D }, O) {
|
|
3734
3716
|
let F;
|
|
3735
3717
|
this.parts = [];
|
|
3736
3718
|
let q = 0, W = 0;
|
|
3737
|
-
const
|
|
3738
|
-
if (this.el = N.createElement(K,
|
|
3719
|
+
const Y = w.length - 1, G = this.parts, [K, Q] = V(w, D);
|
|
3720
|
+
if (this.el = N.createElement(K, O), C.currentNode = this.el.content, D === 2 || D === 3) {
|
|
3739
3721
|
const tt = this.el.content.firstChild;
|
|
3740
3722
|
tt.replaceWith(...tt.childNodes);
|
|
3741
3723
|
}
|
|
3742
|
-
for (; (F = C.nextNode()) !== null && G.length <
|
|
3724
|
+
for (; (F = C.nextNode()) !== null && G.length < Y; ) {
|
|
3743
3725
|
if (F.nodeType === 1) {
|
|
3744
3726
|
if (F.hasAttributes()) for (const tt of F.getAttributeNames()) if (tt.endsWith(e)) {
|
|
3745
|
-
const J = Q[W++],
|
|
3746
|
-
G.push({ type: 1, index: q, name: Z[2], strings:
|
|
3727
|
+
const J = Q[W++], X = F.getAttribute(tt).split(h), Z = /([.?@])?(.*)/.exec(J);
|
|
3728
|
+
G.push({ type: 1, index: q, name: Z[2], strings: X, ctor: Z[1] === "." ? H : Z[1] === "?" ? I : Z[1] === "@" ? L : k }), F.removeAttribute(tt);
|
|
3747
3729
|
} else tt.startsWith(h) && (G.push({ type: 6, index: q }), F.removeAttribute(tt));
|
|
3748
3730
|
if ($.test(F.tagName)) {
|
|
3749
3731
|
const tt = F.textContent.split(h), J = tt.length - 1;
|
|
3750
3732
|
if (J > 0) {
|
|
3751
3733
|
F.textContent = i$1 ? i$1.emptyScript : "";
|
|
3752
|
-
for (let
|
|
3734
|
+
for (let X = 0; X < J; X++) F.append(tt[X], l()), C.nextNode(), G.push({ type: 2, index: ++q });
|
|
3753
3735
|
F.append(tt[J], l());
|
|
3754
3736
|
}
|
|
3755
3737
|
}
|
|
@@ -3762,15 +3744,15 @@ class N {
|
|
|
3762
3744
|
}
|
|
3763
3745
|
}
|
|
3764
3746
|
static createElement(w, D) {
|
|
3765
|
-
const
|
|
3766
|
-
return
|
|
3747
|
+
const O = r.createElement("template");
|
|
3748
|
+
return O.innerHTML = w, O;
|
|
3767
3749
|
}
|
|
3768
3750
|
}
|
|
3769
|
-
function S(
|
|
3751
|
+
function S(U, w, D = U, O) {
|
|
3770
3752
|
if (w === T) return w;
|
|
3771
|
-
let F =
|
|
3753
|
+
let F = O !== void 0 ? D._$Co?.[O] : D._$Cl;
|
|
3772
3754
|
const q = c(w) ? void 0 : w._$litDirective$;
|
|
3773
|
-
return F?.constructor !== q && (F?._$AO?.(!1), q === void 0 ? F = void 0 : (F = new q(
|
|
3755
|
+
return F?.constructor !== q && (F?._$AO?.(!1), q === void 0 ? F = void 0 : (F = new q(U), F._$AT(U, D, O)), O !== void 0 ? (D._$Co ??= [])[O] = F : D._$Cl = F), F !== void 0 && (w = S(U, F._$AS(U, w.values), F, O)), w;
|
|
3774
3756
|
}
|
|
3775
3757
|
class M {
|
|
3776
3758
|
constructor(w, D) {
|
|
@@ -3783,13 +3765,13 @@ class M {
|
|
|
3783
3765
|
return this._$AM._$AU;
|
|
3784
3766
|
}
|
|
3785
3767
|
u(w) {
|
|
3786
|
-
const { el: { content: D }, parts:
|
|
3768
|
+
const { el: { content: D }, parts: O } = this._$AD, F = (w?.creationScope ?? r).importNode(D, !0);
|
|
3787
3769
|
C.currentNode = F;
|
|
3788
|
-
let q = C.nextNode(), W = 0,
|
|
3770
|
+
let q = C.nextNode(), W = 0, Y = 0, G = O[0];
|
|
3789
3771
|
for (; G !== void 0; ) {
|
|
3790
3772
|
if (W === G.index) {
|
|
3791
3773
|
let K;
|
|
3792
|
-
G.type === 2 ? K = new R(q, q.nextSibling, this, w) : G.type === 1 ? K = new G.ctor(q, G.name, G.strings, this, w) : G.type === 6 && (K = new z(q, this, w)), this._$AV.push(K), G =
|
|
3774
|
+
G.type === 2 ? K = new R(q, q.nextSibling, this, w) : G.type === 1 ? K = new G.ctor(q, G.name, G.strings, this, w) : G.type === 6 && (K = new z(q, this, w)), this._$AV.push(K), G = O[++Y];
|
|
3793
3775
|
}
|
|
3794
3776
|
W !== G?.index && (q = C.nextNode(), W++);
|
|
3795
3777
|
}
|
|
@@ -3797,15 +3779,15 @@ class M {
|
|
|
3797
3779
|
}
|
|
3798
3780
|
p(w) {
|
|
3799
3781
|
let D = 0;
|
|
3800
|
-
for (const
|
|
3782
|
+
for (const O of this._$AV) O !== void 0 && (O.strings !== void 0 ? (O._$AI(w, O, D), D += O.strings.length - 2) : O._$AI(w[D])), D++;
|
|
3801
3783
|
}
|
|
3802
3784
|
}
|
|
3803
3785
|
class R {
|
|
3804
3786
|
get _$AU() {
|
|
3805
3787
|
return this._$AM?._$AU ?? this._$Cv;
|
|
3806
3788
|
}
|
|
3807
|
-
constructor(w, D,
|
|
3808
|
-
this.type = 2, this._$AH = E, this._$AN = void 0, this._$AA = w, this._$AB = D, this._$AM =
|
|
3789
|
+
constructor(w, D, O, F) {
|
|
3790
|
+
this.type = 2, this._$AH = E, this._$AN = void 0, this._$AA = w, this._$AB = D, this._$AM = O, this.options = F, this._$Cv = F?.isConnected ?? !0;
|
|
3809
3791
|
}
|
|
3810
3792
|
get parentNode() {
|
|
3811
3793
|
let w = this._$AA.parentNode;
|
|
@@ -3831,7 +3813,7 @@ class R {
|
|
|
3831
3813
|
this._$AH !== E && c(this._$AH) ? this._$AA.nextSibling.data = w : this.T(r.createTextNode(w)), this._$AH = w;
|
|
3832
3814
|
}
|
|
3833
3815
|
$(w) {
|
|
3834
|
-
const { values: D, _$litType$:
|
|
3816
|
+
const { values: D, _$litType$: O } = w, F = typeof O == "number" ? this._$AC(w) : (O.el === void 0 && (O.el = N.createElement(P(O.h, O.h[0]), this.options)), O);
|
|
3835
3817
|
if (this._$AH?._$AD === F) this._$AH.p(D);
|
|
3836
3818
|
else {
|
|
3837
3819
|
const q = new M(F, this), W = q.u(this.options);
|
|
@@ -3845,14 +3827,14 @@ class R {
|
|
|
3845
3827
|
k(w) {
|
|
3846
3828
|
a(this._$AH) || (this._$AH = [], this._$AR());
|
|
3847
3829
|
const D = this._$AH;
|
|
3848
|
-
let
|
|
3849
|
-
for (const q of w) F === D.length ? D.push(
|
|
3850
|
-
F < D.length && (this._$AR(
|
|
3830
|
+
let O, F = 0;
|
|
3831
|
+
for (const q of w) F === D.length ? D.push(O = new R(this.O(l()), this.O(l()), this, this.options)) : O = D[F], O._$AI(q), F++;
|
|
3832
|
+
F < D.length && (this._$AR(O && O._$AB.nextSibling, F), D.length = F);
|
|
3851
3833
|
}
|
|
3852
3834
|
_$AR(w = this._$AA.nextSibling, D) {
|
|
3853
3835
|
for (this._$AP?.(!1, !0, D); w !== this._$AB; ) {
|
|
3854
|
-
const
|
|
3855
|
-
w.remove(), w =
|
|
3836
|
+
const O = w.nextSibling;
|
|
3837
|
+
w.remove(), w = O;
|
|
3856
3838
|
}
|
|
3857
3839
|
}
|
|
3858
3840
|
setConnected(w) {
|
|
@@ -3866,17 +3848,17 @@ class k {
|
|
|
3866
3848
|
get _$AU() {
|
|
3867
3849
|
return this._$AM._$AU;
|
|
3868
3850
|
}
|
|
3869
|
-
constructor(w, D,
|
|
3870
|
-
this.type = 1, this._$AH = E, this._$AN = void 0, this.element = w, this.name = D, this._$AM = F, this.options = q,
|
|
3851
|
+
constructor(w, D, O, F, q) {
|
|
3852
|
+
this.type = 1, this._$AH = E, this._$AN = void 0, this.element = w, this.name = D, this._$AM = F, this.options = q, O.length > 2 || O[0] !== "" || O[1] !== "" ? (this._$AH = Array(O.length - 1).fill(new String()), this.strings = O) : this._$AH = E;
|
|
3871
3853
|
}
|
|
3872
|
-
_$AI(w, D = this,
|
|
3854
|
+
_$AI(w, D = this, O, F) {
|
|
3873
3855
|
const q = this.strings;
|
|
3874
3856
|
let W = !1;
|
|
3875
3857
|
if (q === void 0) w = S(this, w, D, 0), W = !c(w) || w !== this._$AH && w !== T, W && (this._$AH = w);
|
|
3876
3858
|
else {
|
|
3877
|
-
const
|
|
3859
|
+
const Y = w;
|
|
3878
3860
|
let G, K;
|
|
3879
|
-
for (w = q[0], G = 0; G < q.length - 1; G++) K = S(this,
|
|
3861
|
+
for (w = q[0], G = 0; G < q.length - 1; G++) K = S(this, Y[O + G], D, G), K === T && (K = this._$AH[G]), W ||= !c(K) || K !== this._$AH[G], K === E ? w = E : w !== E && (w += (K ?? "") + q[G + 1]), this._$AH[G] = K;
|
|
3880
3862
|
}
|
|
3881
3863
|
W && !F && this.j(w);
|
|
3882
3864
|
}
|
|
@@ -3901,21 +3883,21 @@ class I extends k {
|
|
|
3901
3883
|
}
|
|
3902
3884
|
}
|
|
3903
3885
|
class L extends k {
|
|
3904
|
-
constructor(w, D,
|
|
3905
|
-
super(w, D,
|
|
3886
|
+
constructor(w, D, O, F, q) {
|
|
3887
|
+
super(w, D, O, F, q), this.type = 5;
|
|
3906
3888
|
}
|
|
3907
3889
|
_$AI(w, D = this) {
|
|
3908
3890
|
if ((w = S(this, w, D, 0) ?? E) === T) return;
|
|
3909
|
-
const
|
|
3910
|
-
F && this.element.removeEventListener(this.name, this,
|
|
3891
|
+
const O = this._$AH, F = w === E && O !== E || w.capture !== O.capture || w.once !== O.once || w.passive !== O.passive, q = w !== E && (O === E || F);
|
|
3892
|
+
F && this.element.removeEventListener(this.name, this, O), q && this.element.addEventListener(this.name, this, w), this._$AH = w;
|
|
3911
3893
|
}
|
|
3912
3894
|
handleEvent(w) {
|
|
3913
3895
|
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, w) : this._$AH.handleEvent(w);
|
|
3914
3896
|
}
|
|
3915
3897
|
}
|
|
3916
3898
|
class z {
|
|
3917
|
-
constructor(w, D,
|
|
3918
|
-
this.element = w, this.type = 6, this._$AN = void 0, this._$AM = D, this.options =
|
|
3899
|
+
constructor(w, D, O) {
|
|
3900
|
+
this.element = w, this.type = 6, this._$AN = void 0, this._$AM = D, this.options = O;
|
|
3919
3901
|
}
|
|
3920
3902
|
get _$AU() {
|
|
3921
3903
|
return this._$AM._$AU;
|
|
@@ -3926,14 +3908,14 @@ class z {
|
|
|
3926
3908
|
}
|
|
3927
3909
|
const j = t.litHtmlPolyfillSupport;
|
|
3928
3910
|
j?.(N, R), (t.litHtmlVersions ??= []).push("3.3.1");
|
|
3929
|
-
const B = (
|
|
3930
|
-
const
|
|
3931
|
-
let F =
|
|
3911
|
+
const B = (U, w, D) => {
|
|
3912
|
+
const O = D?.renderBefore ?? w;
|
|
3913
|
+
let F = O._$litPart$;
|
|
3932
3914
|
if (F === void 0) {
|
|
3933
3915
|
const q = D?.renderBefore ?? null;
|
|
3934
|
-
|
|
3916
|
+
O._$litPart$ = F = new R(w.insertBefore(l(), q), q, void 0, D ?? {});
|
|
3935
3917
|
}
|
|
3936
|
-
return F._$AI(
|
|
3918
|
+
return F._$AI(U), F;
|
|
3937
3919
|
};
|
|
3938
3920
|
/**
|
|
3939
3921
|
* @license
|
|
@@ -3994,7 +3976,7 @@ class ZooTag extends i {
|
|
|
3994
3976
|
}
|
|
3995
3977
|
`;
|
|
3996
3978
|
render() {
|
|
3997
|
-
const w = this.prefix ?? "", D = this.token ?? "default",
|
|
3979
|
+
const w = this.prefix ?? "", D = this.token ?? "default", O = this.postfix ?? "", F = `${w}${D}${O}`;
|
|
3998
3980
|
return x`
|
|
3999
3981
|
<span
|
|
4000
3982
|
class="tag"
|
|
@@ -4009,19 +3991,171 @@ class ZooTag extends i {
|
|
|
4009
3991
|
}
|
|
4010
3992
|
}
|
|
4011
3993
|
customElements.get("zoo-tag") || customElements.define("zoo-tag", ZooTag);
|
|
3994
|
+
const formatRelativeTime = (U) => {
|
|
3995
|
+
const D = Math.floor((/* @__PURE__ */ new Date() - U) / 1e3), O = [
|
|
3996
|
+
{ name: "year", seconds: 31536e3 },
|
|
3997
|
+
{ name: "month", seconds: 2592e3 },
|
|
3998
|
+
{ name: "week", seconds: 604800 },
|
|
3999
|
+
{ name: "day", seconds: 86400 },
|
|
4000
|
+
{ name: "hour", seconds: 3600 },
|
|
4001
|
+
{ name: "minute", seconds: 60 },
|
|
4002
|
+
{ name: "second", seconds: 1 }
|
|
4003
|
+
];
|
|
4004
|
+
if (D < 0) {
|
|
4005
|
+
const F = Math.abs(D);
|
|
4006
|
+
for (const q of O) {
|
|
4007
|
+
const W = Math.floor(F / q.seconds);
|
|
4008
|
+
if (W >= 1)
|
|
4009
|
+
return new Intl.RelativeTimeFormat("en", { numeric: "auto" }).format(W, q.name);
|
|
4010
|
+
}
|
|
4011
|
+
return "just now";
|
|
4012
|
+
}
|
|
4013
|
+
for (const F of O) {
|
|
4014
|
+
const q = Math.floor(D / F.seconds);
|
|
4015
|
+
if (q >= 1)
|
|
4016
|
+
return new Intl.RelativeTimeFormat("en", { numeric: "auto" }).format(-q, F.name);
|
|
4017
|
+
}
|
|
4018
|
+
return "just now";
|
|
4019
|
+
}, formatDatetime = (U) => {
|
|
4020
|
+
const w = new Intl.DateTimeFormat("en", {
|
|
4021
|
+
day: "2-digit",
|
|
4022
|
+
month: "short",
|
|
4023
|
+
year: "2-digit",
|
|
4024
|
+
hour: "2-digit",
|
|
4025
|
+
minute: "2-digit",
|
|
4026
|
+
second: "2-digit",
|
|
4027
|
+
hourCycle: "h23"
|
|
4028
|
+
}), [{ value: D }, , { value: O }, , { value: F }, , { value: q }, , { value: W }, , { value: Y }] = w.formatToParts(U);
|
|
4029
|
+
return `${O} ${D} ${F} ${q}:${W}:${Y}`;
|
|
4030
|
+
}, formatDate = (U) => {
|
|
4031
|
+
const w = new Intl.DateTimeFormat("en", {
|
|
4032
|
+
day: "2-digit",
|
|
4033
|
+
month: "short",
|
|
4034
|
+
year: "2-digit"
|
|
4035
|
+
}), [{ value: D }, , { value: O }, , { value: F }] = w.formatToParts(U);
|
|
4036
|
+
return `${O} ${D} ${F}`;
|
|
4037
|
+
};
|
|
4038
|
+
class ZooTimestamp extends i {
|
|
4039
|
+
static properties = {
|
|
4040
|
+
timestamp: { type: Number },
|
|
4041
|
+
kind: { type: String },
|
|
4042
|
+
concat: { type: String }
|
|
4043
|
+
};
|
|
4044
|
+
static styles = i$3`
|
|
4045
|
+
:host {
|
|
4046
|
+
display: inline;
|
|
4047
|
+
}
|
|
4048
|
+
|
|
4049
|
+
.relative {
|
|
4050
|
+
color: var(--zoo-timestamp-relative-color, inherit);
|
|
4051
|
+
font-weight: var(--zoo-timestamp-relative-weight, inherit);
|
|
4052
|
+
font-size: var(--zoo-timestamp-relative-size, inherit);
|
|
4053
|
+
}
|
|
4054
|
+
|
|
4055
|
+
.static {
|
|
4056
|
+
color: var(--zoo-timestamp-static-color, inherit);
|
|
4057
|
+
font-weight: var(--zoo-timestamp-static-weight, inherit);
|
|
4058
|
+
font-size: var(--zoo-timestamp-static-size, inherit);
|
|
4059
|
+
}
|
|
4060
|
+
|
|
4061
|
+
.separator {
|
|
4062
|
+
color: var(--zoo-timestamp-separator-color, inherit);
|
|
4063
|
+
}
|
|
4064
|
+
`;
|
|
4065
|
+
constructor() {
|
|
4066
|
+
super(), this.timestamp = Date.now(), this.kind = "both", this.concat = "r (s)", this._boundTickHandler = this._onTimeTick.bind(this), this._isListening = !1;
|
|
4067
|
+
}
|
|
4068
|
+
/**
|
|
4069
|
+
* Determines if the current kind requires listening to time ticks
|
|
4070
|
+
* @returns {boolean}
|
|
4071
|
+
*/
|
|
4072
|
+
_shouldListenToTicks() {
|
|
4073
|
+
return this.kind === "relative" || this.kind === "both";
|
|
4074
|
+
}
|
|
4075
|
+
connectedCallback() {
|
|
4076
|
+
super.connectedCallback(), this._updateTickListener();
|
|
4077
|
+
}
|
|
4078
|
+
disconnectedCallback() {
|
|
4079
|
+
this._removeTickListener(), super.disconnectedCallback();
|
|
4080
|
+
}
|
|
4081
|
+
updated(w) {
|
|
4082
|
+
super.updated(w), w.has("kind") && this._updateTickListener();
|
|
4083
|
+
}
|
|
4084
|
+
/**
|
|
4085
|
+
* Add or remove tick listener based on kind
|
|
4086
|
+
*/
|
|
4087
|
+
_updateTickListener() {
|
|
4088
|
+
const w = this._shouldListenToTicks();
|
|
4089
|
+
w && !this._isListening ? (document.addEventListener("zoo-tick-60", this._boundTickHandler), this._isListening = !0) : !w && this._isListening && this._removeTickListener();
|
|
4090
|
+
}
|
|
4091
|
+
/**
|
|
4092
|
+
* Remove tick listener
|
|
4093
|
+
*/
|
|
4094
|
+
_removeTickListener() {
|
|
4095
|
+
this._isListening && (document.removeEventListener("zoo-tick-60", this._boundTickHandler), this._isListening = !1);
|
|
4096
|
+
}
|
|
4097
|
+
_onTimeTick() {
|
|
4098
|
+
this.requestUpdate();
|
|
4099
|
+
}
|
|
4100
|
+
/**
|
|
4101
|
+
* Parses the concat template and splits it into parts
|
|
4102
|
+
* @param {string} template - Template string with 'r' and 's' placeholders
|
|
4103
|
+
* @returns {Array} Array of objects with {type: 'text'|'relative'|'static', value: string}
|
|
4104
|
+
*/
|
|
4105
|
+
_parseTemplate(w) {
|
|
4106
|
+
const D = [];
|
|
4107
|
+
let O = w;
|
|
4108
|
+
for (; O.length > 0; ) {
|
|
4109
|
+
const F = O.indexOf("r"), q = O.indexOf("s"), W = [F, q].filter((Y) => Y !== -1).sort((Y, G) => Y - G)[0];
|
|
4110
|
+
if (W === void 0) {
|
|
4111
|
+
O.length > 0 && D.push({ type: "text", value: O });
|
|
4112
|
+
break;
|
|
4113
|
+
}
|
|
4114
|
+
W > 0 && D.push({ type: "text", value: O.substring(0, W) }), W === F ? D.push({ type: "relative", value: "" }) : D.push({ type: "static", value: "" }), O = O.substring(W + 1);
|
|
4115
|
+
}
|
|
4116
|
+
return D;
|
|
4117
|
+
}
|
|
4118
|
+
_getFormattedParts() {
|
|
4119
|
+
let w = this.timestamp;
|
|
4120
|
+
w < 9466848e5 && (w = w * 1e3);
|
|
4121
|
+
const D = new Date(w), O = formatRelativeTime(D), F = formatDatetime(D), q = formatDate(D);
|
|
4122
|
+
switch (this.kind) {
|
|
4123
|
+
case "relative":
|
|
4124
|
+
return [{ type: "relative", value: O }];
|
|
4125
|
+
case "datetime":
|
|
4126
|
+
return [{ type: "static", value: F }];
|
|
4127
|
+
case "date":
|
|
4128
|
+
return [{ type: "static", value: q }];
|
|
4129
|
+
case "both":
|
|
4130
|
+
return this._parseTemplate(this.concat).map((G) => G.type === "relative" ? { type: "relative", value: O } : G.type === "static" ? { type: "static", value: F } : G);
|
|
4131
|
+
default:
|
|
4132
|
+
return this._parseTemplate(this.concat).map((G) => G.type === "relative" ? { type: "relative", value: O } : G.type === "static" ? { type: "static", value: F } : G);
|
|
4133
|
+
}
|
|
4134
|
+
}
|
|
4135
|
+
render() {
|
|
4136
|
+
let w = this.timestamp;
|
|
4137
|
+
w < 9466848e5 && (w = w * 1e3);
|
|
4138
|
+
const D = new Date(w), O = this._getFormattedParts();
|
|
4139
|
+
return x`<time datetime="${D.toISOString()}">
|
|
4140
|
+
${O.map((F) => F.type === "relative" ? x`<span class="relative">${F.value}</span>` : F.type === "static" ? x`<span class="static">${F.value}</span>` : x`<span class="separator">${F.value}</span>`)}
|
|
4141
|
+
</time>`;
|
|
4142
|
+
}
|
|
4143
|
+
}
|
|
4144
|
+
customElements.get("zoo-timestamp") || customElements.define("zoo-timestamp", ZooTimestamp);
|
|
4012
4145
|
const zoo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4013
4146
|
__proto__: null,
|
|
4014
4147
|
ZooTag,
|
|
4148
|
+
ZooTimestamp,
|
|
4015
4149
|
getEventAttribute,
|
|
4016
4150
|
getSemanticAttributes
|
|
4017
4151
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4018
4152
|
async function registerCarbonLibrary() {
|
|
4019
|
-
const { registerCarbonLibrary:
|
|
4020
|
-
return
|
|
4153
|
+
const { registerCarbonLibrary: U } = await import("./register-DGyCiJGq.js");
|
|
4154
|
+
return U();
|
|
4021
4155
|
}
|
|
4022
4156
|
async function registerMdcLibrary() {
|
|
4023
|
-
const { registerMdcLibrary:
|
|
4024
|
-
return
|
|
4157
|
+
const { registerMdcLibrary: U } = await import("./register-D-bV-b_k.js");
|
|
4158
|
+
return U();
|
|
4025
4159
|
}
|
|
4026
4160
|
const zooy = {
|
|
4027
4161
|
Evt,
|
|
@@ -4045,7 +4179,7 @@ const zooy = {
|
|
|
4045
4179
|
};
|
|
4046
4180
|
export {
|
|
4047
4181
|
uriUtils as A,
|
|
4048
|
-
|
|
4182
|
+
B,
|
|
4049
4183
|
ComponentLibraryRegistry as C,
|
|
4050
4184
|
Dragger as D,
|
|
4051
4185
|
E,
|
|
@@ -4065,10 +4199,10 @@ export {
|
|
|
4065
4199
|
isDefAndNotNull as e,
|
|
4066
4200
|
f$1 as f,
|
|
4067
4201
|
getSemanticAttributes as g,
|
|
4068
|
-
|
|
4202
|
+
Binder as h,
|
|
4069
4203
|
i,
|
|
4070
|
-
|
|
4071
|
-
|
|
4204
|
+
hasPath as j,
|
|
4205
|
+
getEventAttribute as k,
|
|
4072
4206
|
getElDataMap as l,
|
|
4073
4207
|
treeUtils as m,
|
|
4074
4208
|
registerMdcLibrary as n,
|