@per-diem-calculator/vanilla 1.0.6 → 1.0.7
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/index.js +116 -116
- package/dist/index.umd.cjs +8 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -244,14 +244,14 @@ function la() {
|
|
|
244
244
|
const ir = bt({}, ["title", "style", "font", "a", "script"]);
|
|
245
245
|
let me = null;
|
|
246
246
|
const hn = ["application/xhtml+xml", "text/html"], bs = "text/html";
|
|
247
|
-
let
|
|
247
|
+
let Ft = null, pn = null;
|
|
248
248
|
const vs = t.createElement("form"), ti = function(L) {
|
|
249
249
|
return L instanceof RegExp || L instanceof Function;
|
|
250
250
|
}, Gr = function() {
|
|
251
251
|
let L = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
252
252
|
if (!(pn && pn === L)) {
|
|
253
253
|
if ((!L || typeof L != "object") && (L = {}), L = Ve(L), me = // eslint-disable-next-line unicorn/prefer-includes
|
|
254
|
-
hn.indexOf(L.PARSER_MEDIA_TYPE) === -1 ? bs : L.PARSER_MEDIA_TYPE,
|
|
254
|
+
hn.indexOf(L.PARSER_MEDIA_TYPE) === -1 ? bs : L.PARSER_MEDIA_TYPE, Ft = me === "application/xhtml+xml" ? Kr : fr, F = ve(L, "ALLOWED_TAGS") ? bt({}, L.ALLOWED_TAGS, Ft) : z, it = ve(L, "ALLOWED_ATTR") ? bt({}, L.ALLOWED_ATTR, Ft) : nt, cn = ve(L, "ALLOWED_NAMESPACES") ? bt({}, L.ALLOWED_NAMESPACES, Kr) : Wr, Ce = ve(L, "ADD_URI_SAFE_ATTR") ? bt(Ve(ie), L.ADD_URI_SAFE_ATTR, Ft) : ie, gt = ve(L, "ADD_DATA_URI_TAGS") ? bt(Ve(Vt), L.ADD_DATA_URI_TAGS, Ft) : Vt, st = ve(L, "FORBID_CONTENTS") ? bt({}, L.FORBID_CONTENTS, Ft) : wt, yt = ve(L, "FORBID_TAGS") ? bt({}, L.FORBID_TAGS, Ft) : {}, Ct = ve(L, "FORBID_ATTR") ? bt({}, L.FORBID_ATTR, Ft) : {}, J = ve(L, "USE_PROFILES") ? L.USE_PROFILES : !1, mt = L.ALLOW_ARIA_ATTR !== !1, vt = L.ALLOW_DATA_ATTR !== !1, At = L.ALLOW_UNKNOWN_PROTOCOLS || !1, xt = L.ALLOW_SELF_CLOSE_IN_ATTR !== !1, It = L.SAFE_FOR_TEMPLATES || !1, jt = L.SAFE_FOR_XML !== !1, l = L.WHOLE_DOCUMENT || !1, k = L.RETURN_DOM || !1, x = L.RETURN_DOM_FRAGMENT || !1, D = L.RETURN_TRUSTED_TYPE || !1, R = L.FORCE_BODY || !1, j = L.SANITIZE_DOM !== !1, q = L.SANITIZE_NAMED_PROPS || !1, K = L.KEEP_CONTENT !== !1, et = L.IN_PLACE || !1, dt = L.ALLOWED_URI_REGEXP || sa, _e = L.NAMESPACE || ee, dn = L.MATHML_TEXT_INTEGRATION_POINTS || dn, un = L.HTML_INTEGRATION_POINTS || un, W = L.CUSTOM_ELEMENT_HANDLING || {}, L.CUSTOM_ELEMENT_HANDLING && ti(L.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (W.tagNameCheck = L.CUSTOM_ELEMENT_HANDLING.tagNameCheck), L.CUSTOM_ELEMENT_HANDLING && ti(L.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (W.attributeNameCheck = L.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), L.CUSTOM_ELEMENT_HANDLING && typeof L.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (W.allowCustomizedBuiltInElements = L.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), It && (vt = !1), x && (k = !0), J && (F = bt({}, bi), it = [], J.html === !0 && (bt(F, gi), bt(it, vi)), J.svg === !0 && (bt(F, Jr), bt(it, e0), bt(it, or)), J.svgFilters === !0 && (bt(F, Qr), bt(it, e0), bt(it, or)), J.mathMl === !0 && (bt(F, t0), bt(it, wi), bt(it, or))), L.ADD_TAGS && (F === z && (F = Ve(F)), bt(F, L.ADD_TAGS, Ft)), L.ADD_ATTR && (it === nt && (it = Ve(it)), bt(it, L.ADD_ATTR, Ft)), L.ADD_URI_SAFE_ATTR && bt(Ce, L.ADD_URI_SAFE_ATTR, Ft), L.FORBID_CONTENTS && (st === wt && (st = Ve(st)), bt(st, L.FORBID_CONTENTS, Ft)), K && (F["#text"] = !0), l && bt(F, ["html", "head", "body"]), F.table && (bt(F, ["tbody"]), delete yt.tbody), L.TRUSTED_TYPES_POLICY) {
|
|
255
255
|
if (typeof L.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
256
256
|
throw Mn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
257
257
|
if (typeof L.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
@@ -323,8 +323,8 @@ function la() {
|
|
|
323
323
|
} catch {
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
|
-
const
|
|
327
|
-
return L && at &&
|
|
326
|
+
const Pt = Q.body || Q.documentElement;
|
|
327
|
+
return L && at && Pt.insertBefore(t.createTextNode(at), Pt.childNodes[0] || null), _e === ee ? C.call(Q, l ? "html" : "body")[0] : l ? Q.documentElement : Pt;
|
|
328
328
|
}, ii = function(L) {
|
|
329
329
|
return O.call(
|
|
330
330
|
L.ownerDocument || L,
|
|
@@ -347,7 +347,7 @@ function la() {
|
|
|
347
347
|
let Q = null;
|
|
348
348
|
if (Oe(G.beforeSanitizeElements, L, null), Xr(L))
|
|
349
349
|
return xe(L), !0;
|
|
350
|
-
const at =
|
|
350
|
+
const at = Ft(L.nodeName);
|
|
351
351
|
if (Oe(G.uponSanitizeElement, L, {
|
|
352
352
|
tagName: at,
|
|
353
353
|
allowedTags: F
|
|
@@ -357,11 +357,11 @@ function la() {
|
|
|
357
357
|
if (!yt[at] && li(at) && (W.tagNameCheck instanceof RegExp && Wt(W.tagNameCheck, at) || W.tagNameCheck instanceof Function && W.tagNameCheck(at)))
|
|
358
358
|
return !1;
|
|
359
359
|
if (K && !st[at]) {
|
|
360
|
-
const kt = S(L) || L.parentNode,
|
|
361
|
-
if (
|
|
362
|
-
const zt =
|
|
360
|
+
const kt = S(L) || L.parentNode, Pt = y(L) || L.childNodes;
|
|
361
|
+
if (Pt && kt) {
|
|
362
|
+
const zt = Pt.length;
|
|
363
363
|
for (let ne = zt - 1; ne >= 0; --ne) {
|
|
364
|
-
const ke = h(
|
|
364
|
+
const ke = h(Pt[ne], !0);
|
|
365
365
|
ke.__removalCount = (L.__removalCount || 0) + 1, kt.insertBefore(ke, g(L));
|
|
366
366
|
}
|
|
367
367
|
}
|
|
@@ -418,11 +418,11 @@ function la() {
|
|
|
418
418
|
};
|
|
419
419
|
let kt = Q.length;
|
|
420
420
|
for (; kt--; ) {
|
|
421
|
-
const
|
|
421
|
+
const Pt = Q[kt], {
|
|
422
422
|
name: zt,
|
|
423
423
|
namespaceURI: ne,
|
|
424
424
|
value: ke
|
|
425
|
-
} =
|
|
425
|
+
} = Pt, In = Ft(zt);
|
|
426
426
|
let qt = zt === "value" ? ke : Gs(ke);
|
|
427
427
|
if (at.attrName = In, at.attrValue = qt, at.keepAttr = !0, at.forceKeepAttr = void 0, Oe(G.uponSanitizeAttribute, L, at), qt = at.attrValue, q && (In === "id" || In === "name") && (ar(zt, L), qt = I + qt), jt && Wt(/((--!?|])>)|<\/(style|title)/i, qt)) {
|
|
428
428
|
ar(zt, L);
|
|
@@ -437,7 +437,7 @@ function la() {
|
|
|
437
437
|
It && sr([E, P, u], (ui) => {
|
|
438
438
|
qt = Rn(qt, ui, " ");
|
|
439
439
|
});
|
|
440
|
-
const di =
|
|
440
|
+
const di = Ft(L.nodeName);
|
|
441
441
|
if (oi(di, In, qt)) {
|
|
442
442
|
if (A && typeof f == "object" && typeof f.getAttributeType == "function" && !ne)
|
|
443
443
|
switch (f.getAttributeType(di, In)) {
|
|
@@ -465,7 +465,7 @@ function la() {
|
|
|
465
465
|
Oe(G.afterSanitizeShadowDOM, L, null);
|
|
466
466
|
};
|
|
467
467
|
return e.sanitize = function(ct) {
|
|
468
|
-
let L = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, Q = null, at = null, kt = null,
|
|
468
|
+
let L = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, Q = null, at = null, kt = null, Pt = null;
|
|
469
469
|
if (ae = !ct, ae && (ct = "<!-->"), typeof ct != "string" && !ai(ct))
|
|
470
470
|
if (typeof ct.toString == "function") {
|
|
471
471
|
if (ct = ct.toString(), typeof ct != "string")
|
|
@@ -476,7 +476,7 @@ function la() {
|
|
|
476
476
|
return ct;
|
|
477
477
|
if (H || Gr(L), e.removed = [], typeof ct == "string" && (et = !1), et) {
|
|
478
478
|
if (ct.nodeName) {
|
|
479
|
-
const ke =
|
|
479
|
+
const ke = Ft(ct.nodeName);
|
|
480
480
|
if (!F[ke] || yt[ke])
|
|
481
481
|
throw Mn("root node is forbidden and cannot be sanitized in-place");
|
|
482
482
|
}
|
|
@@ -497,11 +497,11 @@ function la() {
|
|
|
497
497
|
return ct;
|
|
498
498
|
if (k) {
|
|
499
499
|
if (x)
|
|
500
|
-
for (
|
|
501
|
-
|
|
500
|
+
for (Pt = B.call(Q.ownerDocument); Q.firstChild; )
|
|
501
|
+
Pt.appendChild(Q.firstChild);
|
|
502
502
|
else
|
|
503
|
-
|
|
504
|
-
return (it.shadowroot || it.shadowrootmode) && (
|
|
503
|
+
Pt = Q;
|
|
504
|
+
return (it.shadowroot || it.shadowrootmode) && (Pt = V.call(n, Pt, !0)), Pt;
|
|
505
505
|
}
|
|
506
506
|
let ne = l ? Q.outerHTML : Q.innerHTML;
|
|
507
507
|
return l && F["!doctype"] && Q.ownerDocument && Q.ownerDocument.doctype && Q.ownerDocument.doctype.name && Wt(oa, Q.ownerDocument.doctype.name) && (ne = "<!DOCTYPE " + Q.ownerDocument.doctype.name + `>
|
|
@@ -515,7 +515,7 @@ function la() {
|
|
|
515
515
|
pn = null, H = !1;
|
|
516
516
|
}, e.isValidAttribute = function(ct, L, Q) {
|
|
517
517
|
pn || Gr({});
|
|
518
|
-
const at =
|
|
518
|
+
const at = Ft(ct), kt = Ft(L);
|
|
519
519
|
return oi(at, kt, Q);
|
|
520
520
|
}, e.addHook = function(ct, L) {
|
|
521
521
|
typeof L == "function" && zn(G[ct], L);
|
|
@@ -6202,14 +6202,14 @@ const Sn = (r, e) => r.includes(e), er = (r) => ({ pointerStartX: r.clientX, poi
|
|
|
6202
6202
|
</div>
|
|
6203
6203
|
</div>
|
|
6204
6204
|
`, a0 = document.createElement("template");
|
|
6205
|
-
var
|
|
6205
|
+
var $t, Ln, Me, Ae, Gn, Ne, Xe, tt, ga, ba, va, wa, ya, x0, St, _a, bn, Dt, xa, Xn, ka, k0, mr;
|
|
6206
6206
|
class ma extends HTMLElement {
|
|
6207
6207
|
constructor(t, n, i) {
|
|
6208
6208
|
super();
|
|
6209
6209
|
ot(this, tt);
|
|
6210
6210
|
/* SETUP
|
|
6211
6211
|
*/
|
|
6212
|
-
ot(this,
|
|
6212
|
+
ot(this, $t);
|
|
6213
6213
|
ot(this, Ln);
|
|
6214
6214
|
ot(this, Me);
|
|
6215
6215
|
ot(this, Ae);
|
|
@@ -6247,12 +6247,12 @@ class ma extends HTMLElement {
|
|
|
6247
6247
|
) : (a.classList.add(`bg-${n}`), (o = a.querySelector("#lodging-amount")) == null || o.classList.remove("bg-white", "bg-neutral-50"), (d = a.querySelector("#lodging-amount")) == null || d.classList.add(`bg-${i}`));
|
|
6248
6248
|
}), this.style.position = "relative", this.style.overflow = "hidden", this.style.zIndex = t.toString();
|
|
6249
6249
|
});
|
|
6250
|
-
this.attachShadow({ mode: "open" }), ht(this,
|
|
6251
|
-
const { deductions: a, rates: s, lodgingAmount: o, mieAmount: d } = c(this,
|
|
6250
|
+
this.attachShadow({ mode: "open" }), ht(this, $t, t), ht(this, Me, n), ht(this, Ln, i);
|
|
6251
|
+
const { deductions: a, rates: s, lodgingAmount: o, mieAmount: d } = c(this, $t);
|
|
6252
6252
|
ht(this, Ae, s.maxLodging), ht(this, Gn, a.FirstLastDay ? s.maxMieFirstLast : s.maxMie), ht(this, Ne, o), ht(this, Xe, d), this.render(n);
|
|
6253
6253
|
}
|
|
6254
6254
|
render(t) {
|
|
6255
|
-
c(this, tt, Dt).innerHTML = "", t ? (a0.innerHTML = Oi, ln(c(this, tt, Dt))) : a0.innerHTML = Ue(Oi), c(this, tt, Dt).appendChild(a0.content.cloneNode(!0)), M(this, tt, ga).call(this), M(this, tt, ba).call(this), this.setAttribute("date", c(this,
|
|
6255
|
+
c(this, tt, Dt).innerHTML = "", t ? (a0.innerHTML = Oi, ln(c(this, tt, Dt))) : a0.innerHTML = Ue(Oi), c(this, tt, Dt).appendChild(a0.content.cloneNode(!0)), M(this, tt, ga).call(this), M(this, tt, ba).call(this), this.setAttribute("date", c(this, $t).date), M(this, tt, k0).call(this, c(this, Ne).toString()), this.updateMieAmount(c(this, Xe)), M(this, tt, mr).call(this), M(this, tt, va).call(this), M(this, tt, wa).call(this);
|
|
6256
6256
|
}
|
|
6257
6257
|
updateMieAmount(t) {
|
|
6258
6258
|
const n = c(this, tt, Dt).querySelector(
|
|
@@ -6268,31 +6268,31 @@ class ma extends HTMLElement {
|
|
|
6268
6268
|
/* GET DATA METHODS
|
|
6269
6269
|
*/
|
|
6270
6270
|
get rateSource() {
|
|
6271
|
-
return c(this,
|
|
6271
|
+
return c(this, $t).source;
|
|
6272
6272
|
}
|
|
6273
6273
|
get rateString() {
|
|
6274
|
-
const { effDate: t, ...n } = c(this,
|
|
6274
|
+
const { effDate: t, ...n } = c(this, $t).rates, { country: i, city: a } = c(this, $t);
|
|
6275
6275
|
return JSON.stringify({ city: a, country: i, rates: n });
|
|
6276
6276
|
}
|
|
6277
6277
|
get rateStringForTable() {
|
|
6278
|
-
const { date: t, country: n, city: i, rates: a } = c(this,
|
|
6278
|
+
const { date: t, country: n, city: i, rates: a } = c(this, $t), s = `${Ie(t)}/${de(t)}`;
|
|
6279
6279
|
return JSON.stringify({ monthYear: s, country: n, city: i, rates: a });
|
|
6280
6280
|
}
|
|
6281
6281
|
get amount() {
|
|
6282
|
-
const { mieAmount: t, lodgingAmount: n } = c(this,
|
|
6282
|
+
const { mieAmount: t, lodgingAmount: n } = c(this, $t);
|
|
6283
6283
|
return { mie: t, lodging: n };
|
|
6284
6284
|
}
|
|
6285
6285
|
}
|
|
6286
|
-
|
|
6287
|
-
const t = c(this, tt, Dt).querySelector("#month"), n = c(this, tt, Dt).querySelector("#day"), i = c(this, tt, Dt).querySelector("#year"), a = new Date(c(this,
|
|
6286
|
+
$t = new WeakMap(), Ln = new WeakMap(), Me = new WeakMap(), Ae = new WeakMap(), Gn = new WeakMap(), Ne = new WeakMap(), Xe = new WeakMap(), tt = new WeakSet(), ga = function() {
|
|
6287
|
+
const t = c(this, tt, Dt).querySelector("#month"), n = c(this, tt, Dt).querySelector("#day"), i = c(this, tt, Dt).querySelector("#year"), a = new Date(c(this, $t).date);
|
|
6288
6288
|
if (!(t && n && i))
|
|
6289
6289
|
throw new Error("Failed to render row's date elements.");
|
|
6290
|
-
t.textContent = fa(a.toUTCString()), n.textContent = Vn(c(this,
|
|
6290
|
+
t.textContent = fa(a.toUTCString()), n.textContent = Vn(c(this, $t).date), i.textContent = de(c(this, $t).date);
|
|
6291
6291
|
}, ba = function() {
|
|
6292
6292
|
const t = c(this, tt, Dt).querySelector("#location"), n = c(this, tt, Dt).querySelector("#lodging-rate"), i = c(this, tt, Dt).querySelector("#mie-rate");
|
|
6293
6293
|
if (!(t && n && i))
|
|
6294
6294
|
throw new Error("Failed to render row's rate elements.");
|
|
6295
|
-
t.textContent = `${c(this,
|
|
6295
|
+
t.textContent = `${c(this, $t).city} (${c(this, $t).country})`, n.innerHTML = `<span class="font-semibold block">Lodging</span>
|
|
6296
6296
|
<span class="text-sm normal-case font-normal">Max ${Kt.format(c(this, Ae))}</span>`, i.innerHTML = `<span class="font-semibold block">M&IE</span>
|
|
6297
6297
|
<span class="text-sm normal-case font-normal">Max ${Kt.format(c(this, Gn))}</span></span>`;
|
|
6298
6298
|
}, va = function() {
|
|
@@ -7604,7 +7604,7 @@ const be = (r) => typeof r > "u" || r === null ? null : vr(r), vr = (r) => typeo
|
|
|
7604
7604
|
return t || (r.setAttribute("id", e), e);
|
|
7605
7605
|
}, Ni = (r) => r.replace(/[\\"']/g, "\\$&"), je = (r, e) => {
|
|
7606
7606
|
e && r.append(e);
|
|
7607
|
-
},
|
|
7607
|
+
}, Nt = (r, e) => {
|
|
7608
7608
|
if (Array.isArray(r))
|
|
7609
7609
|
r.forEach(e);
|
|
7610
7610
|
else
|
|
@@ -7641,7 +7641,7 @@ const be = (r) => typeof r > "u" || r === null ? null : vr(r), vr = (r) => typeo
|
|
|
7641
7641
|
});
|
|
7642
7642
|
}, Ia = (r) => {
|
|
7643
7643
|
var e = [];
|
|
7644
|
-
return
|
|
7644
|
+
return Nt(r, (t) => {
|
|
7645
7645
|
typeof t == "string" && (t = t.trim().split(/[\t\n\f\r\s]/)), Array.isArray(t) && (e = e.concat(t));
|
|
7646
7646
|
}), e.filter(Boolean);
|
|
7647
7647
|
}, za = (r) => (Array.isArray(r) || (r = [r]), r), p0 = (r, e, t) => {
|
|
@@ -7659,7 +7659,7 @@ const be = (r) => typeof r > "u" || r === null ? null : vr(r), vr = (r) => typeo
|
|
|
7659
7659
|
r.matches(e) && t++;
|
|
7660
7660
|
return t;
|
|
7661
7661
|
}, Et = (r, e) => {
|
|
7662
|
-
|
|
7662
|
+
Nt(e, (t, n) => {
|
|
7663
7663
|
t == null ? r.removeAttribute(n) : r.setAttribute(n, "" + t);
|
|
7664
7664
|
});
|
|
7665
7665
|
}, A0 = (r, e) => {
|
|
@@ -7812,17 +7812,17 @@ function Yi(r, e) {
|
|
|
7812
7812
|
}
|
|
7813
7813
|
}, U = (O) => {
|
|
7814
7814
|
var B, C;
|
|
7815
|
-
C = A(O), C[d] = C[d] || O.getAttribute("label") || "", C[p] = C[p] || y++, C[s] = C[s] || O.disabled, C.$order = C.$order || ++S, _.optgroups.push(C), B = C[p],
|
|
7815
|
+
C = A(O), C[d] = C[d] || O.getAttribute("label") || "", C[p] = C[p] || y++, C[s] = C[s] || O.disabled, C.$order = C.$order || ++S, _.optgroups.push(C), B = C[p], Nt(O.children, (V) => {
|
|
7816
7816
|
T(V, B);
|
|
7817
7817
|
});
|
|
7818
7818
|
};
|
|
7819
|
-
_.maxItems = r.hasAttribute("multiple") ? null : 1,
|
|
7819
|
+
_.maxItems = r.hasAttribute("multiple") ? null : 1, Nt(r.children, (O) => {
|
|
7820
7820
|
h = O.tagName.toLowerCase(), h === "optgroup" ? U(O) : h === "option" && T(O);
|
|
7821
7821
|
});
|
|
7822
7822
|
}, m = () => {
|
|
7823
7823
|
const h = r.getAttribute(n);
|
|
7824
7824
|
if (h)
|
|
7825
|
-
_.options = JSON.parse(h),
|
|
7825
|
+
_.options = JSON.parse(h), Nt(_.options, (g) => {
|
|
7826
7826
|
_.items.push(g[a]);
|
|
7827
7827
|
});
|
|
7828
7828
|
else {
|
|
@@ -7830,7 +7830,7 @@ function Yi(r, e) {
|
|
|
7830
7830
|
if (!t.allowEmptyOption && !w.length)
|
|
7831
7831
|
return;
|
|
7832
7832
|
const g = w.split(t.delimiter);
|
|
7833
|
-
|
|
7833
|
+
Nt(g, (y) => {
|
|
7834
7834
|
const S = {};
|
|
7835
7835
|
S[i] = y, S[a] = y, _.options.push(S);
|
|
7836
7836
|
}), _.items = g;
|
|
@@ -7857,7 +7857,7 @@ class te extends Sl(El) {
|
|
|
7857
7857
|
if (oe(d, s.wrapperClass, _, f), oe(p, s.controlClass), je(d, p), oe(v, s.dropdownClass, f), s.copyClassesToDropdown && oe(v, _), oe(b, s.dropdownContentClass), je(v, b), Ee(s.dropdownParent || d).appendChild(v), Fa(s.controlInput)) {
|
|
7858
7858
|
m = Ee(s.controlInput);
|
|
7859
7859
|
var h = ["autocorrect", "autocapitalize", "autocomplete", "spellcheck"];
|
|
7860
|
-
|
|
7860
|
+
Nt(h, (w) => {
|
|
7861
7861
|
i.getAttribute(w) && Et(m, { [w]: i.getAttribute(w) });
|
|
7862
7862
|
}), m.tabIndex = -1, p.appendChild(m), this.focus_node = m;
|
|
7863
7863
|
} else s.controlInput ? (m = Ee(s.controlInput), this.focus_node = m) : (m = Ee("<input/>"), this.focus_node = p);
|
|
@@ -7927,7 +7927,7 @@ class te extends Sl(El) {
|
|
|
7927
7927
|
*
|
|
7928
7928
|
*/
|
|
7929
7929
|
setupOptions(e = [], t = []) {
|
|
7930
|
-
this.addOptions(e),
|
|
7930
|
+
this.addOptions(e), Nt(t, (n) => {
|
|
7931
7931
|
this.registerOptionGroup(n);
|
|
7932
7932
|
});
|
|
7933
7933
|
}
|
|
@@ -8029,7 +8029,7 @@ class te extends Sl(El) {
|
|
|
8029
8029
|
var n = t.inputValue();
|
|
8030
8030
|
if (n.match(t.settings.splitOn)) {
|
|
8031
8031
|
var i = n.trim().split(t.settings.splitOn);
|
|
8032
|
-
|
|
8032
|
+
Nt(i, (a) => {
|
|
8033
8033
|
be(a) && (this.options[a] ? t.addItem(a) : t.createItem(a));
|
|
8034
8034
|
});
|
|
8035
8035
|
}
|
|
@@ -8361,7 +8361,7 @@ class te extends Sl(El) {
|
|
|
8361
8361
|
if (e.settings.mode === "single")
|
|
8362
8362
|
return;
|
|
8363
8363
|
const t = e.controlChildren();
|
|
8364
|
-
t.length && (e.inputState(), e.close(), e.activeItems = t,
|
|
8364
|
+
t.length && (e.inputState(), e.close(), e.activeItems = t, Nt(t, (n) => {
|
|
8365
8365
|
e.setActiveItemClass(n);
|
|
8366
8366
|
}));
|
|
8367
8367
|
}
|
|
@@ -8473,7 +8473,7 @@ class te extends Sl(El) {
|
|
|
8473
8473
|
n > 0 && (G = G.cloneNode(!0), Et(G, { id: C.$id + "-clone-" + n, "aria-selected": null }), G.classList.add("ts-cloned"), ze(G, "active"), m.activeOption && m.activeOption.dataset.value == B && v && v.dataset.group === s.toString() && (y = G)), Y.appendChild(G), s != "" && (_[s] = u);
|
|
8474
8474
|
}
|
|
8475
8475
|
}
|
|
8476
|
-
m.settings.lockOptgroupOrder && f.sort((O, B) => O.order - B.order), d = document.createDocumentFragment(),
|
|
8476
|
+
m.settings.lockOptgroupOrder && f.sort((O, B) => O.order - B.order), d = document.createDocumentFragment(), Nt(f, (O) => {
|
|
8477
8477
|
let B = O.fragment, C = O.optgroup;
|
|
8478
8478
|
if (!B || !B.children.length)
|
|
8479
8479
|
return;
|
|
@@ -8485,7 +8485,7 @@ class te extends Sl(El) {
|
|
|
8485
8485
|
je(d, P);
|
|
8486
8486
|
} else
|
|
8487
8487
|
je(d, B);
|
|
8488
|
-
}), A.innerHTML = "", je(A, d), m.settings.highlight && (Jl(A), g.query.length && g.tokens.length &&
|
|
8488
|
+
}), A.innerHTML = "", je(A, d), m.settings.highlight && (Jl(A), g.query.length && g.tokens.length && Nt(g.tokens, (O) => {
|
|
8489
8489
|
Kl(A, O.regex);
|
|
8490
8490
|
}));
|
|
8491
8491
|
var U = (O) => {
|
|
@@ -8533,7 +8533,7 @@ class te extends Sl(El) {
|
|
|
8533
8533
|
*
|
|
8534
8534
|
*/
|
|
8535
8535
|
addOptions(e, t = !1) {
|
|
8536
|
-
|
|
8536
|
+
Nt(e, (n) => {
|
|
8537
8537
|
this.addOption(n, t);
|
|
8538
8538
|
});
|
|
8539
8539
|
}
|
|
@@ -8616,7 +8616,7 @@ class te extends Sl(El) {
|
|
|
8616
8616
|
const t = (e || this.clearFilter).bind(this);
|
|
8617
8617
|
this.loadedSearches = {}, this.userOptions = {}, this.clearCache();
|
|
8618
8618
|
const n = {};
|
|
8619
|
-
|
|
8619
|
+
Nt(this.options, (i, a) => {
|
|
8620
8620
|
t(i, a) && (n[a] = i);
|
|
8621
8621
|
}), this.options = this.sifter.items = n, this.lastQuery = null, this.trigger("option_clear");
|
|
8622
8622
|
}
|
|
@@ -8856,7 +8856,7 @@ class te extends Sl(El) {
|
|
|
8856
8856
|
var t = this;
|
|
8857
8857
|
if (t.items.length) {
|
|
8858
8858
|
var n = t.controlChildren();
|
|
8859
|
-
|
|
8859
|
+
Nt(n, (i) => {
|
|
8860
8860
|
t.removeItem(i, !0);
|
|
8861
8861
|
}), t.inputState(), e || t.updateOriginalInput(), t.trigger("clear");
|
|
8862
8862
|
}
|
|
@@ -8879,7 +8879,7 @@ class te extends Sl(El) {
|
|
|
8879
8879
|
t = e && e.keyCode === $i ? -1 : 1, n = Gl(s.control_input);
|
|
8880
8880
|
const o = [];
|
|
8881
8881
|
if (s.activeItems.length)
|
|
8882
|
-
a = Pi(s.activeItems, t), i = Bi(a), t > 0 && i++,
|
|
8882
|
+
a = Pi(s.activeItems, t), i = Bi(a), t > 0 && i++, Nt(s.activeItems, (d) => o.push(d));
|
|
8883
8883
|
else if ((s.isFocused || s.settings.mode === "single") && s.items.length) {
|
|
8884
8884
|
const d = s.controlChildren();
|
|
8885
8885
|
let p;
|
|
@@ -9025,7 +9025,7 @@ class te extends Sl(El) {
|
|
|
9025
9025
|
*
|
|
9026
9026
|
*/
|
|
9027
9027
|
clearCache() {
|
|
9028
|
-
|
|
9028
|
+
Nt(this.options, (e) => {
|
|
9029
9029
|
e.$div && (e.$div.remove(), delete e.$div);
|
|
9030
9030
|
});
|
|
9031
9031
|
}
|
|
@@ -9621,7 +9621,7 @@ const Ki = `<div
|
|
|
9621
9621
|
</svg>
|
|
9622
9622
|
</div>
|
|
9623
9623
|
`, f0 = document.createElement("template");
|
|
9624
|
-
var Xt, Ke, pe, Zn,
|
|
9624
|
+
var Xt, Ke, pe, Zn, Ht, lt, Ma, Na, Kn, le, D0, Pa, T0, C0, wr, Se, O0, F0, I0, z0;
|
|
9625
9625
|
class Ra extends HTMLElement {
|
|
9626
9626
|
constructor() {
|
|
9627
9627
|
super();
|
|
@@ -9630,16 +9630,16 @@ class Ra extends HTMLElement {
|
|
|
9630
9630
|
ot(this, Ke, !1);
|
|
9631
9631
|
ot(this, pe, !1);
|
|
9632
9632
|
ot(this, Zn, !1);
|
|
9633
|
-
ot(this,
|
|
9633
|
+
ot(this, Ht);
|
|
9634
9634
|
ot(this, Kn, (t) => {
|
|
9635
9635
|
const n = t.target;
|
|
9636
9636
|
if (console.log(t.target), !((n instanceof HTMLElement || n instanceof SVGElement) && (n.closest(".ts-control") || n.closest("button"))))
|
|
9637
9637
|
return;
|
|
9638
9638
|
Ar(() => {
|
|
9639
|
-
c(this,
|
|
9639
|
+
c(this, Ht).open();
|
|
9640
9640
|
})();
|
|
9641
9641
|
});
|
|
9642
|
-
this.attachShadow({ mode: "open" }), ht(this, Xt, this.getAttribute("pdc") === "country" ? "country" : "city"), ht(this, pe, this.getAttribute("styled") === "true"), ht(this,
|
|
9642
|
+
this.attachShadow({ mode: "open" }), ht(this, Xt, this.getAttribute("pdc") === "country" ? "country" : "city"), ht(this, pe, this.getAttribute("styled") === "true"), ht(this, Ht, M(this, lt, Ma).call(this));
|
|
9643
9643
|
}
|
|
9644
9644
|
/* EVENTS
|
|
9645
9645
|
*/
|
|
@@ -9647,7 +9647,7 @@ class Ra extends HTMLElement {
|
|
|
9647
9647
|
c(this, pe) && M(this, lt, O0).call(this, `bg-${i === "white" ? "white" : "neutral-50"}`);
|
|
9648
9648
|
}
|
|
9649
9649
|
focusEl() {
|
|
9650
|
-
c(this,
|
|
9650
|
+
c(this, Ht).control.focus();
|
|
9651
9651
|
}
|
|
9652
9652
|
/* UPDATE METHODS
|
|
9653
9653
|
*/
|
|
@@ -9655,20 +9655,20 @@ class Ra extends HTMLElement {
|
|
|
9655
9655
|
c(this, lt, Pa).setAttribute("tabindex", t ? "0" : "-1");
|
|
9656
9656
|
}
|
|
9657
9657
|
enable(t) {
|
|
9658
|
-
this.removeAttribute(c(this, Xt)), t ? (c(this,
|
|
9658
|
+
this.removeAttribute(c(this, Xt)), t ? (c(this, Ht).enable(), c(this, lt, le).classList.add("active"), c(this, lt, le).removeAttribute("inert")) : (c(this, Ht).disable(), c(this, lt, le).classList.remove("active", "success"), c(this, lt, le).setAttribute("inert", "")), this.enableTabIndex(t), c(this, lt, le).classList.remove("success", "error"), ht(this, Zn, t);
|
|
9659
9659
|
}
|
|
9660
9660
|
setOptions(t) {
|
|
9661
|
-
M(this, lt, F0).call(this, !0), this.enable(!1), c(this,
|
|
9661
|
+
M(this, lt, F0).call(this, !0), this.enable(!1), c(this, Ht).destroy(), M(this, lt, I0).call(this), t.forEach((n) => {
|
|
9662
9662
|
const i = c(this, Xt) === "country" ? n.country : n.city;
|
|
9663
9663
|
if (!n.label || !i)
|
|
9664
9664
|
throw new Error(
|
|
9665
9665
|
`Failed to get label when creating the options for ${n}.`
|
|
9666
9666
|
);
|
|
9667
9667
|
const a = document.createElement("option");
|
|
9668
|
-
a.setAttribute("value", i), a.textContent = n.label, c(this, lt, D0).appendChild(a), c(this,
|
|
9669
|
-
}), this.enable(!0), c(this,
|
|
9670
|
-
const n = c(this,
|
|
9671
|
-
Array.isArray(n) || (this.setAttribute(c(this, Xt), n), c(this, pe) && (M(this, lt, z0).call(this, !1), c(this, lt, le).classList.remove("error"), c(this, lt, le).classList.add("success")), c(this,
|
|
9668
|
+
a.setAttribute("value", i), a.textContent = n.label, c(this, lt, D0).appendChild(a), c(this, Ht).sync();
|
|
9669
|
+
}), this.enable(!0), c(this, Ht).on("change", () => {
|
|
9670
|
+
const n = c(this, Ht).getValue();
|
|
9671
|
+
Array.isArray(n) || (this.setAttribute(c(this, Xt), n), c(this, pe) && (M(this, lt, z0).call(this, !1), c(this, lt, le).classList.remove("error"), c(this, lt, le).classList.add("success")), c(this, Ht).control.setAttribute("tabindex", "-1"));
|
|
9672
9672
|
}), M(this, lt, F0).call(this, !1);
|
|
9673
9673
|
}
|
|
9674
9674
|
validate() {
|
|
@@ -9684,7 +9684,7 @@ class Ra extends HTMLElement {
|
|
|
9684
9684
|
return t || null;
|
|
9685
9685
|
}
|
|
9686
9686
|
}
|
|
9687
|
-
Xt = new WeakMap(), Ke = new WeakMap(), pe = new WeakMap(), Zn = new WeakMap(),
|
|
9687
|
+
Xt = new WeakMap(), Ke = new WeakMap(), pe = new WeakMap(), Zn = new WeakMap(), Ht = new WeakMap(), lt = new WeakSet(), Ma = function() {
|
|
9688
9688
|
return this.removeAttribute(c(this, Xt)), c(this, lt, Se).innerHTML = "", c(this, pe) ? (f0.innerHTML = Ki, ln(c(this, lt, Se))) : f0.innerHTML = Ue(Ki), c(this, lt, Se).appendChild(f0.content.cloneNode(!0)), c(this, lt, T0).textContent = c(this, Xt) === "country" ? "State" : "City", c(this, lt, T0).setAttribute(
|
|
9689
9689
|
"aria-label",
|
|
9690
9690
|
`Select the trip ${c(this, Xt) === "country" ? "state" : "city"}`
|
|
@@ -9777,7 +9777,7 @@ O0 = function(t = null) {
|
|
|
9777
9777
|
)
|
|
9778
9778
|
}
|
|
9779
9779
|
});
|
|
9780
|
-
return ht(this,
|
|
9780
|
+
return ht(this, Ht, n), c(this, Ht).disable(), c(this, Ht).tabIndex = -1, this.enableTabIndex(!1), M(this, lt, O0).call(this), n;
|
|
9781
9781
|
}, /* VALIDATION
|
|
9782
9782
|
*/
|
|
9783
9783
|
z0 = function(t) {
|
|
@@ -9834,19 +9834,19 @@ const Ji = `<div
|
|
|
9834
9834
|
</svg>
|
|
9835
9835
|
</div>
|
|
9836
9836
|
`, m0 = document.createElement("template");
|
|
9837
|
-
var
|
|
9837
|
+
var Rt, Je, we, Jn, $, $a, yr, Ot, R0, qe, Bn, wn, _r, Re, ue, xr, M0, $n, Hn, yn, _n, Ha, N0, Ua, Ya, ja, Va, kr, Er;
|
|
9838
9838
|
class Ba extends HTMLElement {
|
|
9839
9839
|
constructor() {
|
|
9840
9840
|
super();
|
|
9841
9841
|
ot(this, $);
|
|
9842
|
-
ot(this,
|
|
9842
|
+
ot(this, Rt);
|
|
9843
9843
|
ot(this, Je, !1);
|
|
9844
9844
|
ot(this, we, !1);
|
|
9845
9845
|
ot(this, Jn, !1);
|
|
9846
|
-
this.attachShadow({ mode: "open" }), ht(this,
|
|
9846
|
+
this.attachShadow({ mode: "open" }), ht(this, Rt, this.getAttribute("pdc") === "start" ? "start" : "end"), ht(this, we, this.getAttribute("styled") === "true"), c(this, we) ? (m0.innerHTML = Ji, ln(c(this, $, qe))) : m0.innerHTML = Ue(Ji), c(this, $, qe).appendChild(m0.content.cloneNode(!0)), c(this, $, yr).textContent = c(this, Rt).charAt(0).toUpperCase() + c(this, Rt).slice(1), c(this, $, yr).setAttribute(
|
|
9847
9847
|
"aria-label",
|
|
9848
|
-
`Select the trip ${c(this,
|
|
9849
|
-
), c(this, $, yr).setAttribute("for", c(this,
|
|
9848
|
+
`Select the trip ${c(this, Rt).charAt(0).toUpperCase()}${c(this, Rt).slice(1)} Date`
|
|
9849
|
+
), c(this, $, yr).setAttribute("for", c(this, Rt)), c(this, $, Ot).setAttribute("id", c(this, Rt)), c(this, Rt) === "start" ? this.restrictStartInput() : this.restrictEndInput(), this.enableTabIndex(!1), M(this, $, M0).call(this), M(this, $, $a).call(this);
|
|
9850
9850
|
}
|
|
9851
9851
|
/* EVENTS
|
|
9852
9852
|
*/
|
|
@@ -9854,24 +9854,24 @@ class Ba extends HTMLElement {
|
|
|
9854
9854
|
c(this, we) && M(this, $, M0).call(this, `bg-${i === "white" ? "white" : "neutral-50"}`);
|
|
9855
9855
|
}
|
|
9856
9856
|
focusEl() {
|
|
9857
|
-
c(this, $,
|
|
9857
|
+
c(this, $, Ot).focus();
|
|
9858
9858
|
}
|
|
9859
9859
|
/* UPDATE METHODS
|
|
9860
9860
|
*/
|
|
9861
9861
|
enableTabIndex(t) {
|
|
9862
|
-
c(this, $,
|
|
9862
|
+
c(this, $, Ot).setAttribute("tabindex", t ? "0" : "-1");
|
|
9863
9863
|
}
|
|
9864
9864
|
enable(t) {
|
|
9865
|
-
t ? (c(this, $,
|
|
9865
|
+
t ? (c(this, $, Ot).removeAttribute("disabled"), c(this, $, R0).removeAttribute("inert")) : (c(this, $, Ot).setAttribute("disabled", "true"), c(this, $, R0).setAttribute("inert", ""), c(this, $, Ot).classList.remove("success")), this.enableTabIndex(t), ht(this, Jn, t);
|
|
9866
9866
|
}
|
|
9867
9867
|
async handleInputChange(t = null) {
|
|
9868
|
-
c(this, we) && c(this, $,
|
|
9868
|
+
c(this, we) && c(this, $, Ot).classList.remove("success"), !(!M(this, $, ja).call(this, t) || !t) && (!await M(this, $, Va).call(this) || !ce(t) || (M(this, $, _n).call(this, t), M(this, $, yn).call(this, t), await c(this, $, Re).restrictStartInput(), c(this, $, ue).restrictEndInput(), c(this, we) && (c(this, $, Ot).classList.remove("error"), c(this, $, Ot).classList.add("success"), this.renderError(!1))));
|
|
9869
9869
|
}
|
|
9870
9870
|
/* VALIDATION
|
|
9871
9871
|
*/
|
|
9872
|
-
renderError(t, n = `Enter a valid ${c(this,
|
|
9872
|
+
renderError(t, n = `Enter a valid ${c(this, Rt)} date.`) {
|
|
9873
9873
|
if (t) {
|
|
9874
|
-
c(this, we) && (c(this, $,
|
|
9874
|
+
c(this, we) && (c(this, $, Ot).classList.add("error"), c(this, $, Ot).classList.remove("success"), c(this, $, xr).classList.add("active")), c(this, $, xr).textContent = n;
|
|
9875
9875
|
return;
|
|
9876
9876
|
}
|
|
9877
9877
|
c(this, we) && c(this, $, xr).classList.remove("active");
|
|
@@ -9894,24 +9894,24 @@ class Ba extends HTMLElement {
|
|
|
9894
9894
|
}
|
|
9895
9895
|
validate() {
|
|
9896
9896
|
ht(this, Je, !1);
|
|
9897
|
-
const t = this.getAttribute(c(this,
|
|
9897
|
+
const t = this.getAttribute(c(this, Rt));
|
|
9898
9898
|
return t && ce(t) ? (ht(this, Je, !0), c(this, Je)) : (this.renderError(!0), c(this, Je));
|
|
9899
9899
|
}
|
|
9900
9900
|
/* GET DATA METHODS
|
|
9901
9901
|
*/
|
|
9902
9902
|
get inputValue() {
|
|
9903
|
-
return c(this, $,
|
|
9903
|
+
return c(this, $, Ot).value;
|
|
9904
9904
|
}
|
|
9905
9905
|
get isEnabled() {
|
|
9906
9906
|
return c(this, Jn);
|
|
9907
9907
|
}
|
|
9908
9908
|
get pdcValue() {
|
|
9909
|
-
const t = this.getAttribute(c(this,
|
|
9909
|
+
const t = this.getAttribute(c(this, Rt));
|
|
9910
9910
|
return t && ce(t) ? t : null;
|
|
9911
9911
|
}
|
|
9912
9912
|
}
|
|
9913
|
-
|
|
9914
|
-
c(this, $,
|
|
9913
|
+
Rt = new WeakMap(), Je = new WeakMap(), we = new WeakMap(), Jn = new WeakMap(), $ = new WeakSet(), $a = function() {
|
|
9914
|
+
c(this, $, Ot).addEventListener("change", (t) => {
|
|
9915
9915
|
const n = t.target;
|
|
9916
9916
|
n instanceof HTMLInputElement && (r0.test(n.value) || this.handleInputChange(n.value));
|
|
9917
9917
|
});
|
|
@@ -9920,7 +9920,7 @@ Ht = new WeakMap(), Je = new WeakMap(), we = new WeakMap(), Jn = new WeakMap(),
|
|
|
9920
9920
|
if (!t)
|
|
9921
9921
|
throw new Error("Failed to render label in Date custom element");
|
|
9922
9922
|
return t;
|
|
9923
|
-
},
|
|
9923
|
+
}, Ot = function() {
|
|
9924
9924
|
const t = c(this, $, qe).querySelector("input");
|
|
9925
9925
|
if (!t)
|
|
9926
9926
|
throw new Error("Failed to render input in Date custom element");
|
|
@@ -9981,13 +9981,13 @@ M0 = function(t = null) {
|
|
|
9981
9981
|
const n = c(this, $, qe).querySelector("div");
|
|
9982
9982
|
n == null || n.classList.remove("bg-white", "bg-neutral-50"), n == null || n.classList.add(t || `bg-${this.getAttribute("bg")}`);
|
|
9983
9983
|
}, $n = function(t = null) {
|
|
9984
|
-
c(this, $,
|
|
9984
|
+
c(this, $, Ot).setAttribute("min", t || Eo);
|
|
9985
9985
|
}, Hn = function(t = null) {
|
|
9986
|
-
c(this, $,
|
|
9986
|
+
c(this, $, Ot).setAttribute("max", t || ko);
|
|
9987
9987
|
}, yn = function(t = null) {
|
|
9988
|
-
t ? this.setAttribute(c(this,
|
|
9988
|
+
t ? this.setAttribute(c(this, Rt), t) : this.removeAttribute(c(this, Rt));
|
|
9989
9989
|
}, _n = function(t = null) {
|
|
9990
|
-
c(this, $,
|
|
9990
|
+
c(this, $, Ot).value = t || "";
|
|
9991
9991
|
}, Ha = function() {
|
|
9992
9992
|
M(this, $, _n).call(this), M(this, $, yn).call(this), this.focusEl();
|
|
9993
9993
|
}, N0 = function() {
|
|
@@ -9997,15 +9997,15 @@ M0 = function(t = null) {
|
|
|
9997
9997
|
var n;
|
|
9998
9998
|
if (!c(this, $, wn).endDate) return;
|
|
9999
9999
|
const t = Ei(c(this, $, wn).endDate, 1);
|
|
10000
|
-
c(this, $, kr) !== t && (this.enable(!1), M(this, $, $n).call(this, t), M(this, $, _n).call(this, t), M(this, $, yn).call(this, t), c(this, $,
|
|
10000
|
+
c(this, $, kr) !== t && (this.enable(!1), M(this, $, $n).call(this, t), M(this, $, _n).call(this, t), M(this, $, yn).call(this, t), c(this, $, Ot).classList.add("success"), (n = c(this, $, wn).endEl) == null || n.enable(!1));
|
|
10001
10001
|
}, Ya = function() {
|
|
10002
10002
|
var n;
|
|
10003
10003
|
if (!c(this, $, _r).startDate) return;
|
|
10004
10004
|
this.enable(!1);
|
|
10005
10005
|
const t = Ei(c(this, $, _r).startDate, -1);
|
|
10006
|
-
c(this, $, Er) !== t && (M(this, $, Hn).call(this, t), M(this, $, _n).call(this, t), M(this, $, yn).call(this, t), c(this, $,
|
|
10006
|
+
c(this, $, Er) !== t && (M(this, $, Hn).call(this, t), M(this, $, _n).call(this, t), M(this, $, yn).call(this, t), c(this, $, Ot).classList.add("success"), (n = c(this, $, _r).startEl) == null || n.enable(!1));
|
|
10007
10007
|
}, ja = function(t = null) {
|
|
10008
|
-
return !t || Li.test(t) || Ai.test(t) || r0.test(t) || !ce(t) ? (M(this, $, Ha).call(this), c(this,
|
|
10008
|
+
return !t || Li.test(t) || Ai.test(t) || r0.test(t) || !ce(t) ? (M(this, $, Ha).call(this), c(this, Rt) === "start" && M(this, $, N0).call(this), t && (Li.test(t) && this.renderError(!0, "Date must be after 2020"), Ai.test(t) && this.renderError(!0, "Date must be before 2041"), r0.test(t) && this.renderError(!0, "Enter a valid date.")), !1) : !0;
|
|
10009
10009
|
}, Va = async function() {
|
|
10010
10010
|
return c(this, $, kr) ? c(this, $, Er) && Date.parse(c(this, $, kr)) > Date.parse(c(this, $, Er)) ? (await c(this, $, Re).restrictStartInput(), M(this, $, N0).call(this), c(this, $, ue).renderError(!0, "End date must be after start date."), !1) : !0 : !1;
|
|
10011
10011
|
}, kr = function() {
|
|
@@ -10676,7 +10676,7 @@ customElements.define("pdc-location-category", Ea);
|
|
|
10676
10676
|
customElements.define("pdc-location-select", Ra);
|
|
10677
10677
|
customElements.define("pdc-button", cc);
|
|
10678
10678
|
const v0 = document.createElement("template"), na = document.createElement("template");
|
|
10679
|
-
var en, Te, Fr, N, rs, Y0, Le, he, Sr, re, Yn,
|
|
10679
|
+
var en, Te, Fr, N, rs, Y0, Le, he, Sr, re, Yn, Bt, kn, En, Lr, j0, is, as, ss, os, ls, Fe, cs, V0, ds, jn, Ir, Dn, zr, Rr, tr, us, hs, nn, Mr, Nr, ps, fs, ms;
|
|
10680
10680
|
class ns extends HTMLElement {
|
|
10681
10681
|
constructor(t, n) {
|
|
10682
10682
|
super();
|
|
@@ -10897,7 +10897,7 @@ rs = function() {
|
|
|
10897
10897
|
summary: n,
|
|
10898
10898
|
details: a
|
|
10899
10899
|
};
|
|
10900
|
-
},
|
|
10900
|
+
}, Bt = function() {
|
|
10901
10901
|
var a, s, o, d, p;
|
|
10902
10902
|
const t = (s = (a = this.shadowRoot) == null ? void 0 : a.querySelector("#add-row")) == null ? void 0 : s.closest("div"), n = (o = this.shadowRoot) == null ? void 0 : o.querySelector("#expense-category"), i = (p = (d = this.shadowRoot) == null ? void 0 : d.querySelector("#calculate-expenses")) == null ? void 0 : p.closest("div");
|
|
10903
10903
|
if (!(t && n && i))
|
|
@@ -10954,10 +10954,10 @@ j0 = function(t = null) {
|
|
|
10954
10954
|
var i;
|
|
10955
10955
|
Object.values(M(this, N, re).call(this, t)).forEach(
|
|
10956
10956
|
(a) => a.isEnabled && a.enableTabIndex(n)
|
|
10957
|
-
), (i = c(this, N,
|
|
10957
|
+
), (i = c(this, N, Bt).calculateExpenses.querySelector("pdc-button")) == null || i.enableTabIndex(!n), [
|
|
10958
10958
|
M(this, N, Yn).call(this, t).deleteBtn,
|
|
10959
|
-
c(this, N,
|
|
10960
|
-
...c(this, N,
|
|
10959
|
+
c(this, N, Bt).addRow.querySelector("button"),
|
|
10960
|
+
...c(this, N, Bt).expenseCategory.querySelectorAll("label")
|
|
10961
10961
|
].forEach((a) => a && a.setAttribute("tabindex", n ? "-1" : "0"));
|
|
10962
10962
|
}, os = function() {
|
|
10963
10963
|
var t;
|
|
@@ -10969,9 +10969,9 @@ j0 = function(t = null) {
|
|
|
10969
10969
|
"-1"
|
|
10970
10970
|
)
|
|
10971
10971
|
);
|
|
10972
|
-
}), (t = c(this, N,
|
|
10973
|
-
c(this, N,
|
|
10974
|
-
...c(this, N,
|
|
10972
|
+
}), (t = c(this, N, Bt).calculateExpenses.querySelector("pdc-button")) == null || t.enableTabIndex(!1), [
|
|
10973
|
+
c(this, N, Bt).addRow.querySelector("button"),
|
|
10974
|
+
...c(this, N, Bt).expenseCategory.querySelectorAll("label")
|
|
10975
10975
|
].forEach((n) => n && n.setAttribute("tabindex", "-1"));
|
|
10976
10976
|
}, /* VISUAL METHODS
|
|
10977
10977
|
*/
|
|
@@ -10989,9 +10989,9 @@ ls = function() {
|
|
|
10989
10989
|
"pdc-row-open",
|
|
10990
10990
|
"pdc-row-close",
|
|
10991
10991
|
"pdc-row-initial"
|
|
10992
|
-
), t.classList.add("toggling", `pdc-row-${n}`), (n === "initial" || n === "add") && (c(this, Dn).call(this, t), c(this, nn).call(this, t)), await gn(0), M(this, N, os).call(this), (n === "open" || n === "initial" || n === "add") && (n !== "initial" && await M(this, N, jn).call(this, "open"), t.style.height = M(this, N, cs).call(this) + "px", await M(this, N, V0).call(this, t, "open")), n === "close" && (await M(this, N, V0).call(this, t, "close"), t.style.height = Ge + "px", await M(this, N, jn).call(this)), n === "delete" && (t.style.height = "0px", await M(this, N, ds).call(this, t, i)), n !== "delete" && (t.classList.remove("ring-transparent"), t.classList.add("ring-neutral-200")), window.screen.width >= Zt ? ((a = c(this, N,
|
|
10993
|
-
c(this, N,
|
|
10994
|
-
...c(this, N,
|
|
10992
|
+
), t.classList.add("toggling", `pdc-row-${n}`), (n === "initial" || n === "add") && (c(this, Dn).call(this, t), c(this, nn).call(this, t)), await gn(0), M(this, N, os).call(this), (n === "open" || n === "initial" || n === "add") && (n !== "initial" && await M(this, N, jn).call(this, "open"), t.style.height = M(this, N, cs).call(this) + "px", await M(this, N, V0).call(this, t, "open")), n === "close" && (await M(this, N, V0).call(this, t, "close"), t.style.height = Ge + "px", await M(this, N, jn).call(this)), n === "delete" && (t.style.height = "0px", await M(this, N, ds).call(this, t, i)), n !== "delete" && (t.classList.remove("ring-transparent"), t.classList.add("ring-neutral-200")), window.screen.width >= Zt ? ((a = c(this, N, Bt).calculateExpenses.querySelector("pdc-button")) == null || a.enableTabIndex(!0), [
|
|
10993
|
+
c(this, N, Bt).addRow.querySelector("button"),
|
|
10994
|
+
...c(this, N, Bt).expenseCategory.querySelectorAll("label")
|
|
10995
10995
|
].forEach((s) => s && s.setAttribute("tabindex", "0")), c(this, N, he).forEach((s) => {
|
|
10996
10996
|
var o, d;
|
|
10997
10997
|
(d = (o = s.querySelector('[data-pdc="location-row-sidebar"]')) == null ? void 0 : o.querySelector('[data-pdc="delete-row"]')) == null || d.setAttribute("tabindex", "0");
|
|
@@ -11017,9 +11017,9 @@ ls = function() {
|
|
|
11017
11017
|
}, jn = async function(t = null) {
|
|
11018
11018
|
t || await gn(w0);
|
|
11019
11019
|
const n = [
|
|
11020
|
-
c(this, N,
|
|
11021
|
-
c(this, N,
|
|
11022
|
-
c(this, N,
|
|
11020
|
+
c(this, N, Bt).addRow,
|
|
11021
|
+
c(this, N, Bt).expenseCategory,
|
|
11022
|
+
c(this, N, Bt).calculateExpenses
|
|
11023
11023
|
], i = window.screen.width < Zt && (t || [...c(this, N, he)].some(
|
|
11024
11024
|
(a) => a.offsetHeight !== Ge
|
|
11025
11025
|
));
|
|
@@ -11027,7 +11027,7 @@ ls = function() {
|
|
|
11027
11027
|
(a) => a.classList.remove(i ? "rows-closed" : "rows-open")
|
|
11028
11028
|
), n.forEach(
|
|
11029
11029
|
(a) => a.classList.add(i ? "rows-open" : "rows-closed")
|
|
11030
|
-
), await gn(w0), n.forEach((a) => a.style.zIndex = i ? "0" : "50"), i ? (c(this, N,
|
|
11030
|
+
), await gn(w0), n.forEach((a) => a.style.zIndex = i ? "0" : "50"), i ? (c(this, N, Bt).addRow.style.transform = "translateY(-100%)", c(this, N, Bt).expenseCategory.style.transform = "translateY(400%)", c(this, N, Bt).calculateExpenses.style.transform = "translateY(200%)") : n.forEach((a) => a.style.transform = "translateY(0%)");
|
|
11031
11031
|
}, Ir = new WeakMap(), Dn = new WeakMap(), zr = new WeakMap(), Rr = new WeakMap(), tr = new WeakMap(), us = function() {
|
|
11032
11032
|
const t = M(this, N, re).call(this, c(this, N, he)[0]).start.pdcValue, n = M(this, N, re).call(this, c(this, N, he)[c(this, N, he).length - 1]).end.pdcValue;
|
|
11033
11033
|
if (t && n) {
|
|
@@ -11075,7 +11075,7 @@ ls = function() {
|
|
|
11075
11075
|
};
|
|
11076
11076
|
customElements.define("pdc-expense-view", qa);
|
|
11077
11077
|
customElements.define("pdc-location-view", ns);
|
|
11078
|
-
var Tn, rn,
|
|
11078
|
+
var Tn, rn, Mt, Ut, Cn, an, sn, q0, Pr, Br, He, $r, gs, Hr, Ur;
|
|
11079
11079
|
class uc {
|
|
11080
11080
|
constructor(e, t = null) {
|
|
11081
11081
|
ot(this, sn);
|
|
@@ -11083,7 +11083,7 @@ class uc {
|
|
|
11083
11083
|
*/
|
|
11084
11084
|
ot(this, Tn);
|
|
11085
11085
|
ot(this, rn);
|
|
11086
|
-
ot(this,
|
|
11086
|
+
ot(this, Mt);
|
|
11087
11087
|
ot(this, Ut);
|
|
11088
11088
|
ot(this, Cn);
|
|
11089
11089
|
ot(this, an);
|
|
@@ -11092,7 +11092,7 @@ class uc {
|
|
|
11092
11092
|
ot(this, Pr, async (e) => {
|
|
11093
11093
|
c(this, Ut).renderEmtpy(), ml(e);
|
|
11094
11094
|
const t = e[e.length - 1], { index: n, start: i, end: a, category: s, country: o, city: d } = t;
|
|
11095
|
-
!d && o && (c(this,
|
|
11095
|
+
!d && o && (c(this, Mt).restrictRow(n, "country"), await c(this, He).call(this, t)), !o && s && (c(this, Mt).restrictRow(n, "category"), await c(this, He).call(this, t)), !a && i && c(this, Mt).restrictRow(n, "end"), i && !a && c(this, Mt).restrictRow(n, "start");
|
|
11096
11096
|
});
|
|
11097
11097
|
ot(this, Br, async (e, t, n) => {
|
|
11098
11098
|
const { index: i, start: a, end: s, category: o, country: d, city: p } = e;
|
|
@@ -11100,31 +11100,31 @@ class uc {
|
|
|
11100
11100
|
let v, b;
|
|
11101
11101
|
switch (!0) {
|
|
11102
11102
|
case (!n && !!d && !!o && !!s && !!a):
|
|
11103
|
-
c(this,
|
|
11103
|
+
c(this, Mt).restrictRow(i, "country"), await c(this, He).call(this, e);
|
|
11104
11104
|
return;
|
|
11105
11105
|
case (!n && !!o && !!s && !!a):
|
|
11106
|
-
c(this,
|
|
11106
|
+
c(this, Mt).restrictRow(i, "category"), await c(this, He).call(this, e);
|
|
11107
11107
|
return;
|
|
11108
11108
|
case (!n && !!s && !!a):
|
|
11109
|
-
c(this,
|
|
11109
|
+
c(this, Mt).restrictRow(i, "end");
|
|
11110
11110
|
return;
|
|
11111
11111
|
case !n:
|
|
11112
|
-
c(this,
|
|
11112
|
+
c(this, Mt).restrictRow(i, "start");
|
|
11113
11113
|
return;
|
|
11114
11114
|
case ((t === "start" || t === "end") && // To account for when rows are deleted and the only updates are to the start/end dates of prev/next rows
|
|
11115
11115
|
!!a && !!s && !!o && !!d && !!p):
|
|
11116
11116
|
if (v = new Date(a), b = new Date(s), v <= b)
|
|
11117
11117
|
return;
|
|
11118
|
-
c(this,
|
|
11118
|
+
c(this, Mt).restrictRow(i, t);
|
|
11119
11119
|
return;
|
|
11120
11120
|
default:
|
|
11121
|
-
c(this,
|
|
11121
|
+
c(this, Mt).restrictRow(i, t), (t === "category" || t === "country") && await c(this, He).call(this, e);
|
|
11122
11122
|
return;
|
|
11123
11123
|
}
|
|
11124
11124
|
});
|
|
11125
11125
|
ot(this, He, async (e) => {
|
|
11126
11126
|
const { index: t } = e, n = e.country ? "city" : "country", i = await bl(e);
|
|
11127
|
-
c(this,
|
|
11127
|
+
c(this, Mt).createOptions(t, i, n);
|
|
11128
11128
|
});
|
|
11129
11129
|
ot(this, $r, (e) => {
|
|
11130
11130
|
c(this, Ut).renderEmtpy(), e.valid && vl() && M(this, sn, gs).call(this, e);
|
|
@@ -11141,14 +11141,14 @@ class uc {
|
|
|
11141
11141
|
ot(this, Ur, () => {
|
|
11142
11142
|
c(this, Ut).createExpenseTable(Ti());
|
|
11143
11143
|
});
|
|
11144
|
-
ht(this, Tn, e), ht(this, rn, co(t)), ht(this, Cn, c(this, rn).styled), ht(this,
|
|
11144
|
+
ht(this, Tn, e), ht(this, rn, co(t)), ht(this, Cn, c(this, rn).styled), ht(this, Mt, new ns(
|
|
11145
11145
|
c(this, Cn),
|
|
11146
11146
|
c(this, rn).location
|
|
11147
|
-
)), ht(this, Ut, new qa()), c(this,
|
|
11147
|
+
)), ht(this, Ut, new qa()), c(this, Mt).controllerHandler(
|
|
11148
11148
|
c(this, Br),
|
|
11149
11149
|
c(this, Pr),
|
|
11150
11150
|
c(this, $r)
|
|
11151
|
-
), ht(this, an, new EventTarget()), c(this, Tn).insertAdjacentElement("afterbegin", c(this,
|
|
11151
|
+
), ht(this, an, new EventTarget()), c(this, Tn).insertAdjacentElement("afterbegin", c(this, Mt)), c(this, Tn).insertAdjacentElement("beforeend", c(this, Ut));
|
|
11152
11152
|
}
|
|
11153
11153
|
addEventListener(e, t) {
|
|
11154
11154
|
c(this, an).addEventListener(e, t);
|
|
@@ -11157,7 +11157,7 @@ class uc {
|
|
|
11157
11157
|
c(this, an).removeEventListener(e, t);
|
|
11158
11158
|
}
|
|
11159
11159
|
}
|
|
11160
|
-
Tn = new WeakMap(), rn = new WeakMap(),
|
|
11160
|
+
Tn = new WeakMap(), rn = new WeakMap(), Mt = new WeakMap(), Ut = new WeakMap(), Cn = new WeakMap(), an = new WeakMap(), sn = new WeakSet(), q0 = function() {
|
|
11161
11161
|
const e = new CustomEvent("expenseUpdate", {
|
|
11162
11162
|
detail: {
|
|
11163
11163
|
data: Ti()
|