@per-diem-calculator/vanilla 1.0.18 → 1.0.20
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 +148 -148
- package/dist/index.umd.cjs +14 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var di = (r) => {
|
|
|
3
3
|
throw TypeError(r);
|
|
4
4
|
};
|
|
5
5
|
var ws = (r, e, t) => e in r ? vs(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
6
|
-
var
|
|
6
|
+
var ae = (r, e, t) => ws(r, typeof e != "symbol" ? e + "" : e, t), Xr = (r, e, t) => e.has(r) || di("Cannot " + t);
|
|
7
7
|
var c = (r, e, t) => (Xr(r, e, "read from private field"), t ? t.call(r) : e.get(r)), ot = (r, e, t) => e.has(r) ? di("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), ht = (r, e, t, n) => (Xr(r, e, "write to private field"), n ? n.call(r, t) : e.set(r, t), t), M = (r, e, t) => (Xr(r, e, "access private method"), t);
|
|
8
8
|
const ys = {
|
|
9
9
|
styled: !0,
|
|
@@ -14,7 +14,7 @@ const ys = {
|
|
|
14
14
|
heading: "Expenses",
|
|
15
15
|
body: "Confirm lodging amount and meals provided for each day"
|
|
16
16
|
}
|
|
17
|
-
}, ea = 150, _s = 450, na = 350, V0 = 2, xs = 10, ks = 1e3, Es = 60, Ss = 60, Ls = 24, As = ks * Es * Ss * Ls, Ds = 365.25, Ts = 12, Os = 6, Cs = Ds / Ts, Fs = Cs * Os,
|
|
17
|
+
}, ea = 150, _s = 450, na = 350, V0 = 2, xs = 10, ks = 1e3, Es = 60, Ss = 60, Ls = 24, As = ks * Es * Ss * Ls, Ds = 365.25, Ts = 12, Os = 6, Cs = Ds / Ts, Fs = Cs * Os, le = 1024, ze = 96;
|
|
18
18
|
/*! @license DOMPurify 3.2.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.5/LICENSE */
|
|
19
19
|
const {
|
|
20
20
|
entries: ra,
|
|
@@ -237,8 +237,8 @@ function oa() {
|
|
|
237
237
|
let gt = null;
|
|
238
238
|
const Yt = bt({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
239
239
|
let Ce = null;
|
|
240
|
-
const
|
|
241
|
-
let xe = Qt,
|
|
240
|
+
const re = bt({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), _e = "http://www.w3.org/1998/Math/MathML", _t = "http://www.w3.org/2000/svg", Qt = "http://www.w3.org/1999/xhtml";
|
|
241
|
+
let xe = Qt, ie = !1, un = null;
|
|
242
242
|
const qr = bt({}, [_e, _t, Qt], Zr);
|
|
243
243
|
let hn = bt({}, ["mi", "mo", "mn", "ms", "mtext"]), fn = bt({}, ["annotation-xml"]);
|
|
244
244
|
const nr = bt({}, ["title", "style", "font", "a", "script"]);
|
|
@@ -251,7 +251,7 @@ function oa() {
|
|
|
251
251
|
let L = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
252
252
|
if (!(mn && mn === L)) {
|
|
253
253
|
if ((!L || typeof L != "object") && (L = {}), L = We(L), pe = // eslint-disable-next-line unicorn/prefer-includes
|
|
254
|
-
pn.indexOf(L.PARSER_MEDIA_TYPE) === -1 ? ps : L.PARSER_MEDIA_TYPE, Ft = pe === "application/xhtml+xml" ? Zr : hr, F = we(L, "ALLOWED_TAGS") ? bt({}, L.ALLOWED_TAGS, Ft) : z, it = we(L, "ALLOWED_ATTR") ? bt({}, L.ALLOWED_ATTR, Ft) : nt, un = we(L, "ALLOWED_NAMESPACES") ? bt({}, L.ALLOWED_NAMESPACES, Zr) : qr, Ce = we(L, "ADD_URI_SAFE_ATTR") ? bt(We(
|
|
254
|
+
pn.indexOf(L.PARSER_MEDIA_TYPE) === -1 ? ps : L.PARSER_MEDIA_TYPE, Ft = pe === "application/xhtml+xml" ? Zr : hr, F = we(L, "ALLOWED_TAGS") ? bt({}, L.ALLOWED_TAGS, Ft) : z, it = we(L, "ALLOWED_ATTR") ? bt({}, L.ALLOWED_ATTR, Ft) : nt, un = we(L, "ALLOWED_NAMESPACES") ? bt({}, L.ALLOWED_NAMESPACES, Zr) : qr, Ce = we(L, "ADD_URI_SAFE_ATTR") ? bt(We(re), L.ADD_URI_SAFE_ATTR, Ft) : re, gt = we(L, "ADD_DATA_URI_TAGS") ? bt(We(Yt), L.ADD_DATA_URI_TAGS, Ft) : Yt, st = we(L, "FORBID_CONTENTS") ? bt({}, L.FORBID_CONTENTS, Ft) : wt, yt = we(L, "FORBID_TAGS") ? bt({}, L.FORBID_TAGS, Ft) : {}, Ot = we(L, "FORBID_ATTR") ? bt({}, L.FORBID_ATTR, Ft) : {}, J = we(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, Y = 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 || aa, xe = L.NAMESPACE || Qt, hn = L.MATHML_TEXT_INTEGRATION_POINTS || hn, fn = L.HTML_INTEGRATION_POINTS || fn, W = L.CUSTOM_ELEMENT_HANDLING || {}, L.CUSTOM_ELEMENT_HANDLING && J0(L.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (W.tagNameCheck = L.CUSTOM_ELEMENT_HANDLING.tagNameCheck), L.CUSTOM_ELEMENT_HANDLING && J0(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({}, mi), it = [], J.html === !0 && (bt(F, pi), bt(it, gi)), J.svg === !0 && (bt(F, Kr), bt(it, t0), bt(it, ar)), J.svgFilters === !0 && (bt(F, Jr), bt(it, t0), bt(it, ar)), J.mathMl === !0 && (bt(F, Qr), bt(it, bi), bt(it, ar))), L.ADD_TAGS && (F === z && (F = We(F)), bt(F, L.ADD_TAGS, Ft)), L.ADD_ATTR && (it === nt && (it = We(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 = We(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")
|
|
@@ -319,7 +319,7 @@ function oa() {
|
|
|
319
319
|
if (!Q || !Q.documentElement) {
|
|
320
320
|
Q = U.createDocument(xe, "template", null);
|
|
321
321
|
try {
|
|
322
|
-
Q.documentElement.innerHTML =
|
|
322
|
+
Q.documentElement.innerHTML = ie ? T : kt;
|
|
323
323
|
} catch {
|
|
324
324
|
}
|
|
325
325
|
}
|
|
@@ -466,7 +466,7 @@ function oa() {
|
|
|
466
466
|
};
|
|
467
467
|
return e.sanitize = function(ct) {
|
|
468
468
|
let L = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, Q = null, at = null, kt = null, Pt = null;
|
|
469
|
-
if (
|
|
469
|
+
if (ie = !ct, ie && (ct = "<!-->"), typeof ct != "string" && !ri(ct))
|
|
470
470
|
if (typeof ct.toString == "function") {
|
|
471
471
|
if (ct = ct.toString(), typeof ct != "string")
|
|
472
472
|
throw Mn("dirty is not a string, aborting");
|
|
@@ -2714,15 +2714,15 @@ function no() {
|
|
|
2714
2714
|
for (D.max_code = wt, Y = x.heap_len >> 1; 1 <= Y; Y--) xt(x, K, Y);
|
|
2715
2715
|
for (I = st; Y = x.heap[1], x.heap[1] = x.heap[x.heap_len--], xt(x, K, 1), q = x.heap[1], x.heap[--x.heap_max] = Y, x.heap[--x.heap_max] = q, K[2 * I] = K[2 * Y] + K[2 * q], x.depth[I] = (x.depth[Y] >= x.depth[q] ? x.depth[Y] : x.depth[q]) + 1, K[2 * Y + 1] = K[2 * q + 1] = I, x.heap[1] = I++, xt(x, K, 1), 2 <= x.heap_len; ) ;
|
|
2716
2716
|
x.heap[--x.heap_max] = x.heap[1], function(gt, Yt) {
|
|
2717
|
-
var Ce,
|
|
2717
|
+
var Ce, re, _e, _t, Qt, xe, ie = Yt.dyn_tree, un = Yt.max_code, qr = Yt.stat_desc.static_tree, hn = Yt.stat_desc.has_stree, fn = Yt.stat_desc.extra_bits, nr = Yt.stat_desc.extra_base, pe = Yt.stat_desc.max_length, pn = 0;
|
|
2718
2718
|
for (_t = 0; _t <= w; _t++) gt.bl_count[_t] = 0;
|
|
2719
|
-
for (
|
|
2719
|
+
for (ie[2 * gt.heap[gt.heap_max] + 1] = 0, Ce = gt.heap_max + 1; Ce < h; Ce++) pe < (_t = ie[2 * ie[2 * (re = gt.heap[Ce]) + 1] + 1] + 1) && (_t = pe, pn++), ie[2 * re + 1] = _t, un < re || (gt.bl_count[_t]++, Qt = 0, nr <= re && (Qt = fn[re - nr]), xe = ie[2 * re], gt.opt_len += xe * (_t + Qt), hn && (gt.static_len += xe * (qr[2 * re + 1] + Qt)));
|
|
2720
2720
|
if (pn !== 0) {
|
|
2721
2721
|
do {
|
|
2722
2722
|
for (_t = pe - 1; gt.bl_count[_t] === 0; ) _t--;
|
|
2723
2723
|
gt.bl_count[_t]--, gt.bl_count[_t + 1] += 2, gt.bl_count[pe]--, pn -= 2;
|
|
2724
2724
|
} while (0 < pn);
|
|
2725
|
-
for (_t = pe; _t !== 0; _t--) for (
|
|
2725
|
+
for (_t = pe; _t !== 0; _t--) for (re = gt.bl_count[_t]; re !== 0; ) un < (_e = gt.heap[--Ce]) || (ie[2 * _e + 1] !== _t && (gt.opt_len += (_t - ie[2 * _e + 1]) * ie[2 * _e], ie[2 * _e + 1] = _t), re--);
|
|
2726
2726
|
}
|
|
2727
2727
|
}(x, D), Ot(K, wt, x.bl_count);
|
|
2728
2728
|
}
|
|
@@ -2902,9 +2902,9 @@ const Sn = (r, e) => r.includes(e), Qn = (r) => ({ pointerStartX: r.clientX, poi
|
|
|
2902
2902
|
}, uo = (r) => {
|
|
2903
2903
|
if (r.length !== ua.length)
|
|
2904
2904
|
throw new Error("Invalid date string format.");
|
|
2905
|
-
}, G0 = (r) => (er(r), r.slice(W0, Fn.length)),
|
|
2905
|
+
}, G0 = (r) => (er(r), r.slice(W0, Fn.length)), de = (r) => (er(r), r.slice(W0, ao)), Cn = (r, e = "ISO") => (e === "ISO" && er(r), r.slice(la, so)), Re = (r) => (er(r), r.slice(ca, oo)), jn = (r) => (er(r), r.slice(da, lo)), fa = (r) => (uo(r), r.slice(ha, co)), ce = (r) => {
|
|
2906
2906
|
if (!r) return !1;
|
|
2907
|
-
const e =
|
|
2907
|
+
const e = de(r), t = Re(r), n = jn(r);
|
|
2908
2908
|
return Sn(Yn, e) && Sn(ho, t) && Sn(fo, n);
|
|
2909
2909
|
}, Yn = [
|
|
2910
2910
|
"2021",
|
|
@@ -2976,10 +2976,10 @@ const Sn = (r, e) => r.includes(e), Qn = (r) => ({ pointerStartX: r.clientX, poi
|
|
|
2976
2976
|
const t = new Date(r);
|
|
2977
2977
|
e && t.setUTCDate(t.getUTCDate() + e);
|
|
2978
2978
|
const n = G0(t.toISOString());
|
|
2979
|
-
if (!
|
|
2979
|
+
if (!ce(n)) throw new Error("Failed to create valid date");
|
|
2980
2980
|
return n;
|
|
2981
2981
|
}, ki = (r) => Sn(Yn, r), po = `${Yn[Yn.length - 1]}-12-31`, mo = `${Yn[0]}-01-01`, Ei = /^((?:1\d{3})|(?:20(?:0\d|1\d|20)))/, Si = /^(?:[3-9]\d{3,}|[2-9]\d{4,}|20(?:4[1-9]|5\d|6\d|7\d|8\d|9\d))/, n0 = /^0\d{3}/, cn = (r) => {
|
|
2982
|
-
const e =
|
|
2982
|
+
const e = de(r), n = de((/* @__PURE__ */ new Date()).toISOString());
|
|
2983
2983
|
if (!ki(e) || !ki(n))
|
|
2984
2984
|
throw new Error("Failed to create valid year for API call.");
|
|
2985
2985
|
return +e > +n ? n : e;
|
|
@@ -3311,7 +3311,7 @@ const Sn = (r, e) => r.includes(e), Qn = (r) => ({ pointerStartX: r.clientX, poi
|
|
|
3311
3311
|
const { start: e, end: t, country: n, city: i } = r, a = [], s = new Date(e), o = new Date(t);
|
|
3312
3312
|
for (; s <= o; ) {
|
|
3313
3313
|
const d = G0(s.toISOString());
|
|
3314
|
-
if (!
|
|
3314
|
+
if (!ce(d))
|
|
3315
3315
|
throw new Error("Failed to create valid date.");
|
|
3316
3316
|
a.push({
|
|
3317
3317
|
date: d,
|
|
@@ -3336,8 +3336,8 @@ const Sn = (r, e) => r.includes(e), Qn = (r) => ({ pointerStartX: r.clientX, poi
|
|
|
3336
3336
|
);
|
|
3337
3337
|
return t;
|
|
3338
3338
|
}, Ho = (r, e, t) => {
|
|
3339
|
-
const n = `${
|
|
3340
|
-
if (!
|
|
3339
|
+
const n = `${de(r.date)}-${Re(r.date)}-01`;
|
|
3340
|
+
if (!ce(n))
|
|
3341
3341
|
throw new Error(
|
|
3342
3342
|
`Failed to create valid effective date for rate: ${r.date} - ${r.city}`
|
|
3343
3343
|
);
|
|
@@ -3389,7 +3389,7 @@ const Sn = (r, e) => r.includes(e), Qn = (r) => ({ pointerStartX: r.clientX, poi
|
|
|
3389
3389
|
);
|
|
3390
3390
|
return { date: s, effDate: o, expDate: d, startDate: f, endDate: v };
|
|
3391
3391
|
}, Vo = (r, e, t) => t.find((n) => {
|
|
3392
|
-
const i =
|
|
3392
|
+
const i = de(r), {
|
|
3393
3393
|
countryText: a,
|
|
3394
3394
|
effDateText: s,
|
|
3395
3395
|
expDateText: o,
|
|
@@ -3430,11 +3430,11 @@ const Sn = (r, e) => r.includes(e), Qn = (r) => ({ pointerStartX: r.clientX, poi
|
|
|
3430
3430
|
return { lodgingText: e, mieText: t, rateStartDateText: n };
|
|
3431
3431
|
}, Xo = (r, e, t, n) => {
|
|
3432
3432
|
const i = +e, a = +t, s = /* @__PURE__ */ new Date(
|
|
3433
|
-
`${
|
|
3433
|
+
`${de(r)}-${n.replaceAll("/", "-")}`
|
|
3434
3434
|
);
|
|
3435
|
-
new Date(r) < s && s.setUTCFullYear(+
|
|
3435
|
+
new Date(r) < s && s.setUTCFullYear(+de(r) - 1);
|
|
3436
3436
|
const d = G0(s.toISOString());
|
|
3437
|
-
if (!
|
|
3437
|
+
if (!ce(d))
|
|
3438
3438
|
throw new Error(
|
|
3439
3439
|
`Failed to create valid effective date for ${r} `
|
|
3440
3440
|
);
|
|
@@ -5641,8 +5641,8 @@ const Sn = (r, e) => r.includes(e), Qn = (r) => ({ pointerStartX: r.clientX, poi
|
|
|
5641
5641
|
`Failed to get mie rates for ${e.date} - ${e.city} - ${t}`
|
|
5642
5642
|
);
|
|
5643
5643
|
}
|
|
5644
|
-
}, rl = (r) => +
|
|
5645
|
-
const e = /* @__PURE__ */ new Date(), t =
|
|
5644
|
+
}, rl = (r) => +Re(r) < xs ? +de(r) : +de(r) + 1, il = (r) => {
|
|
5645
|
+
const e = /* @__PURE__ */ new Date(), t = Re(e.toISOString()), n = de(e.toISOString()), i = Re(r), a = de(r), s = +a > +n ? Cn(e.toISOString()) : Cn(r);
|
|
5646
5646
|
return `${+a > +n || +i > +t ? t : i}-01-${s}`;
|
|
5647
5647
|
}, al = (r) => {
|
|
5648
5648
|
const { date: e, country: t, city: n } = r;
|
|
@@ -6198,7 +6198,7 @@ const Sn = (r, e) => r.includes(e), Qn = (r) => ({ pointerStartX: r.clientX, poi
|
|
|
6198
6198
|
</div>
|
|
6199
6199
|
</div>
|
|
6200
6200
|
`, i0 = document.createElement("template");
|
|
6201
|
-
var $t, Ln,
|
|
6201
|
+
var $t, Ln, Pe, De, qn, $e, Ke, tt, ma, ga, ba, va, wa, y0, St, ya, ee, Dt, Wn, _a, _0, pr;
|
|
6202
6202
|
class pa extends HTMLElement {
|
|
6203
6203
|
constructor(t, n, i) {
|
|
6204
6204
|
super();
|
|
@@ -6207,30 +6207,30 @@ class pa extends HTMLElement {
|
|
|
6207
6207
|
*/
|
|
6208
6208
|
ot(this, $t);
|
|
6209
6209
|
ot(this, Ln);
|
|
6210
|
-
ot(this,
|
|
6210
|
+
ot(this, Pe);
|
|
6211
6211
|
ot(this, De);
|
|
6212
6212
|
ot(this, qn);
|
|
6213
|
-
ot(this,
|
|
6213
|
+
ot(this, $e);
|
|
6214
6214
|
ot(this, Ke);
|
|
6215
6215
|
/* VISUAL METHODS
|
|
6216
6216
|
*/
|
|
6217
|
-
|
|
6218
|
-
if (!(!c(this,
|
|
6217
|
+
ae(this, "rowToggle", async (t = null) => {
|
|
6218
|
+
if (!(!c(this, Pe) || c(this, tt, St).classList.contains("toggling"))) {
|
|
6219
6219
|
if (!t) {
|
|
6220
|
-
const n = window.screen.width >=
|
|
6220
|
+
const n = window.screen.width >= le || c(this, tt, St).offsetHeight === ze ? "open" : "close";
|
|
6221
6221
|
this.rowToggle(n);
|
|
6222
6222
|
return;
|
|
6223
6223
|
}
|
|
6224
|
-
c(this, tt, St).classList.remove("pdc-row-open", "pdc-row-close"), c(this, tt, St).classList.add("toggling", `pdc-row-${t}`), t === "open" ? (c(this, tt, St).style.height = c(this, tt,
|
|
6224
|
+
c(this, tt, St).classList.remove("pdc-row-open", "pdc-row-close"), c(this, tt, St).classList.add("toggling", `pdc-row-${t}`), t === "open" ? (c(this, tt, St).style.height = c(this, tt, ee).details.offsetHeight + "px", c(this, tt, ee).contents.style.height = c(this, tt, ee).details.offsetHeight + "px", await c(this, Wn).call(this, "open")) : (c(this, tt, St).style.height = ze + "px", c(this, tt, ee).contents.style.height = ze + "px", await c(this, Wn).call(this, "close")), c(this, tt, St).classList.remove("toggling");
|
|
6225
6225
|
}
|
|
6226
6226
|
});
|
|
6227
6227
|
ot(this, Wn, async (t) => {
|
|
6228
|
-
M(this, tt, _a).call(this, t === "open"), c(this, tt,
|
|
6228
|
+
M(this, tt, _a).call(this, t === "open"), c(this, tt, ee).summary.style.opacity = t === "open" ? "0" : "100", c(this, tt, ee).summary.style.transform = t === "open" ? "translateY(-200%)" : "translateY(0%)", c(this, tt, ee).details.style.opacity = t === "open" ? "100" : "0", c(this, tt, ee).details.style.transform = t === "open" ? "translateX(100%)" : "translateX(0%)";
|
|
6229
6229
|
});
|
|
6230
|
-
|
|
6231
|
-
window.screen.width <
|
|
6230
|
+
ae(this, "resizeRow", () => {
|
|
6231
|
+
window.screen.width < le && c(this, tt, St).offsetHeight === ze || (c(this, tt, St).style.height = c(this, tt, ee).details.offsetHeight + "px", c(this, tt, ee).contents.style.height = c(this, tt, ee).details.offsetHeight + "px", this.styleRow(), window.screen.width >= le && this.rowToggle("open"));
|
|
6232
6232
|
});
|
|
6233
|
-
|
|
6233
|
+
ae(this, "styleRow", () => {
|
|
6234
6234
|
if (!this.parentNode)
|
|
6235
6235
|
throw new Error("Failed to get row index in Expense view.");
|
|
6236
6236
|
const t = Array.from(
|
|
@@ -6238,17 +6238,17 @@ class pa extends HTMLElement {
|
|
|
6238
6238
|
).indexOf(this), n = t % 2 === 0 ? "neutral-50" : "white", i = n === "neutral-50" ? "white" : "neutral-50";
|
|
6239
6239
|
c(this, tt, St).classList.remove("bg-neutral-50", "bg-white"), c(this, tt, St).classList.add(`bg-${n}`), Object.values(c(this, tt, ya)).forEach((a, s) => {
|
|
6240
6240
|
var o, d;
|
|
6241
|
-
a.classList.remove("bg-white", "bg-neutral-50"), window.screen.width <
|
|
6241
|
+
a.classList.remove("bg-white", "bg-neutral-50"), window.screen.width < le ? a.classList.add(
|
|
6242
6242
|
s % 2 === 0 ? `bg-${n}` : `bg-${i}`
|
|
6243
6243
|
) : (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}`));
|
|
6244
6244
|
}), this.style.position = "relative", this.style.overflow = "hidden", this.style.zIndex = t.toString();
|
|
6245
6245
|
});
|
|
6246
|
-
this.attachShadow({ mode: "open" }), ht(this, $t, t), ht(this,
|
|
6246
|
+
this.attachShadow({ mode: "open" }), ht(this, $t, t), ht(this, Pe, n), ht(this, Ln, i);
|
|
6247
6247
|
const { deductions: a, rates: s, lodgingAmount: o, mieAmount: d } = c(this, $t);
|
|
6248
|
-
ht(this, De, s.maxLodging), ht(this, qn, a.FirstLastDay ? s.maxMieFirstLast : s.maxMie), ht(this,
|
|
6248
|
+
ht(this, De, s.maxLodging), ht(this, qn, a.FirstLastDay ? s.maxMieFirstLast : s.maxMie), ht(this, $e, o), ht(this, Ke, d), this.render(n);
|
|
6249
6249
|
}
|
|
6250
6250
|
render(t) {
|
|
6251
|
-
c(this, tt, Dt).innerHTML = "", t ? (i0.innerHTML = Ti, dn(c(this, tt, Dt))) : i0.innerHTML = Ye(Ti), c(this, tt, Dt).appendChild(i0.content.cloneNode(!0)), M(this, tt, ma).call(this), M(this, tt, ga).call(this), this.setAttribute("date", c(this, $t).date), M(this, tt, _0).call(this, c(this,
|
|
6251
|
+
c(this, tt, Dt).innerHTML = "", t ? (i0.innerHTML = Ti, dn(c(this, tt, Dt))) : i0.innerHTML = Ye(Ti), c(this, tt, Dt).appendChild(i0.content.cloneNode(!0)), M(this, tt, ma).call(this), M(this, tt, ga).call(this), this.setAttribute("date", c(this, $t).date), M(this, tt, _0).call(this, c(this, $e).toString()), this.updateMieAmount(c(this, Ke)), M(this, tt, pr).call(this), M(this, tt, ba).call(this), c(this, tt, ee).contents.style.height = (window.screen.width >= le ? c(this, tt, ee).details.offsetHeight : ze) + "px", M(this, tt, va).call(this);
|
|
6252
6252
|
}
|
|
6253
6253
|
updateMieAmount(t) {
|
|
6254
6254
|
const n = c(this, tt, Dt).querySelector(
|
|
@@ -6259,7 +6259,7 @@ class pa extends HTMLElement {
|
|
|
6259
6259
|
if (!(n && i))
|
|
6260
6260
|
throw new Error("Failed to render row's M&IE elements.");
|
|
6261
6261
|
const a = n.value, s = t.toFixed(2).toString();
|
|
6262
|
-
a !== s && (n.value = s, i.textContent = Xt.format(t), ht(this, Ke, t), c(this,
|
|
6262
|
+
a !== s && (n.value = s, i.textContent = Xt.format(t), ht(this, Ke, t), c(this, Pe) && r0(n), M(this, tt, pr).call(this));
|
|
6263
6263
|
}
|
|
6264
6264
|
/* GET DATA METHODS
|
|
6265
6265
|
*/
|
|
@@ -6271,7 +6271,7 @@ class pa extends HTMLElement {
|
|
|
6271
6271
|
return JSON.stringify({ city: a, country: i, rates: n });
|
|
6272
6272
|
}
|
|
6273
6273
|
get rateStringForTable() {
|
|
6274
|
-
const { date: t, country: n, city: i, rates: a } = c(this, $t), s = `${
|
|
6274
|
+
const { date: t, country: n, city: i, rates: a } = c(this, $t), s = `${Re(t)}/${de(t)}`;
|
|
6275
6275
|
return JSON.stringify({ monthYear: s, country: n, city: i, rates: a });
|
|
6276
6276
|
}
|
|
6277
6277
|
get amount() {
|
|
@@ -6279,11 +6279,11 @@ class pa extends HTMLElement {
|
|
|
6279
6279
|
return { mie: t, lodging: n };
|
|
6280
6280
|
}
|
|
6281
6281
|
}
|
|
6282
|
-
$t = new WeakMap(), Ln = new WeakMap(),
|
|
6282
|
+
$t = new WeakMap(), Ln = new WeakMap(), Pe = new WeakMap(), De = new WeakMap(), qn = new WeakMap(), $e = new WeakMap(), Ke = new WeakMap(), tt = new WeakSet(), ma = function() {
|
|
6283
6283
|
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);
|
|
6284
6284
|
if (!(t && n && i))
|
|
6285
6285
|
throw new Error("Failed to render row's date elements.");
|
|
6286
|
-
t.textContent = fa(a.toUTCString()), n.textContent = jn(c(this, $t).date), i.textContent =
|
|
6286
|
+
t.textContent = fa(a.toUTCString()), n.textContent = jn(c(this, $t).date), i.textContent = de(c(this, $t).date);
|
|
6287
6287
|
}, ga = function() {
|
|
6288
6288
|
const t = c(this, tt, Dt).querySelector("#location"), n = c(this, tt, Dt).querySelector("#lodging-rate"), i = c(this, tt, Dt).querySelector("#mie-rate");
|
|
6289
6289
|
if (!(t && n && i))
|
|
@@ -6340,7 +6340,7 @@ va = function() {
|
|
|
6340
6340
|
if (!(t && n && i && a && s))
|
|
6341
6341
|
throw new Error("Failed to render row expense elements.");
|
|
6342
6342
|
return { location: t, deductions: n, mie: i, lodging: a, total: s };
|
|
6343
|
-
},
|
|
6343
|
+
}, ee = function() {
|
|
6344
6344
|
const t = c(this, tt, St).querySelector(
|
|
6345
6345
|
'[data-pdc="expense-row-summary"]'
|
|
6346
6346
|
), n = c(this, tt, St).querySelector(
|
|
@@ -6376,13 +6376,13 @@ _a = function(t) {
|
|
|
6376
6376
|
throw new Error(
|
|
6377
6377
|
"Failed to render input element for lodging in Expense row."
|
|
6378
6378
|
);
|
|
6379
|
-
((s) => !isNaN(parseFloat(s)) && +s >= 0 && +s <= c(this, De))(t) ? (this.setAttribute("lodging", t), n.value = (+t).toFixed(2).toString(), ht(this,
|
|
6379
|
+
((s) => !isNaN(parseFloat(s)) && +s >= 0 && +s <= c(this, De))(t) ? (this.setAttribute("lodging", t), n.value = (+t).toFixed(2).toString(), ht(this, $e, +t), i.textContent = Xt.format(+t)) : (this.setAttribute("lodging", c(this, De).toString()), n.value = c(this, De).toFixed(2).toString(), ht(this, $e, c(this, De)), i.textContent = Xt.format(c(this, De))), c(this, Pe) && r0(n), M(this, tt, pr).call(this);
|
|
6380
6380
|
}, pr = function() {
|
|
6381
|
-
const t = c(this,
|
|
6381
|
+
const t = c(this, $e) + c(this, Ke), n = c(this, tt, Dt).querySelectorAll(
|
|
6382
6382
|
'[data-pdc="expense-total"]'
|
|
6383
6383
|
);
|
|
6384
6384
|
n == null || n.forEach((i) => {
|
|
6385
|
-
i instanceof HTMLInputElement && (i.value = t.toFixed(2).toString(), c(this,
|
|
6385
|
+
i instanceof HTMLInputElement && (i.value = t.toFixed(2).toString(), c(this, Pe) && r0(i)), i instanceof HTMLParagraphElement && (i.textContent = `${Xt.format(t)}`);
|
|
6386
6386
|
});
|
|
6387
6387
|
};
|
|
6388
6388
|
const Oi = `<fieldset
|
|
@@ -7050,7 +7050,7 @@ E0 = function(t, n = "Select a category.") {
|
|
|
7050
7050
|
}), c(this, ft, gr).classList.remove("active"));
|
|
7051
7051
|
}, /* SETUP
|
|
7052
7052
|
*/
|
|
7053
|
-
|
|
7053
|
+
ae(xa, "observedAttributes", ["bg"]);
|
|
7054
7054
|
function s0(r, e) {
|
|
7055
7055
|
r.split(/\s+/).forEach((t) => {
|
|
7056
7056
|
e(t);
|
|
@@ -7307,10 +7307,10 @@ const Al = (r) => {
|
|
|
7307
7307
|
};
|
|
7308
7308
|
class Tr {
|
|
7309
7309
|
constructor() {
|
|
7310
|
-
|
|
7311
|
-
|
|
7312
|
-
|
|
7313
|
-
|
|
7310
|
+
ae(this, "parts");
|
|
7311
|
+
ae(this, "substrs");
|
|
7312
|
+
ae(this, "start");
|
|
7313
|
+
ae(this, "end");
|
|
7314
7314
|
this.parts = [], this.substrs = [], this.start = 0, this.end = 0;
|
|
7315
7315
|
}
|
|
7316
7316
|
add(e) {
|
|
@@ -7398,9 +7398,9 @@ class Ml {
|
|
|
7398
7398
|
*
|
|
7399
7399
|
*/
|
|
7400
7400
|
constructor(e, t) {
|
|
7401
|
-
|
|
7401
|
+
ae(this, "items");
|
|
7402
7402
|
// []|{};
|
|
7403
|
-
|
|
7403
|
+
ae(this, "settings");
|
|
7404
7404
|
this.items = e, this.settings = t || { diacritics: !0 };
|
|
7405
7405
|
}
|
|
7406
7406
|
/**
|
|
@@ -7622,14 +7622,14 @@ const ge = (r) => typeof r > "u" || r === null ? null : br(r), br = (r) => typeo
|
|
|
7622
7622
|
t.initEvent(e, !0, !1), r.dispatchEvent(t);
|
|
7623
7623
|
}, cr = (r, e) => {
|
|
7624
7624
|
Object.assign(r.style, e);
|
|
7625
|
-
},
|
|
7625
|
+
}, se = (r, ...e) => {
|
|
7626
7626
|
var t = Ca(e);
|
|
7627
7627
|
r = Fa(r), r.map((n) => {
|
|
7628
7628
|
t.map((i) => {
|
|
7629
7629
|
n.classList.add(i);
|
|
7630
7630
|
});
|
|
7631
7631
|
});
|
|
7632
|
-
},
|
|
7632
|
+
}, Me = (r, ...e) => {
|
|
7633
7633
|
var t = Ca(e);
|
|
7634
7634
|
r = Fa(r), r.map((n) => {
|
|
7635
7635
|
t.map((i) => {
|
|
@@ -7851,7 +7851,7 @@ class Jt extends gl(ml) {
|
|
|
7851
7851
|
typeof o != "function" && (typeof o == "string" && (o = new RegExp(o)), o instanceof RegExp ? s.createFilter = (w) => o.test(w) : s.createFilter = (w) => this.settings.duplicates || !this.options[w]), this.initializePlugins(s.plugins), this.setupCallbacks(), this.setupTemplates();
|
|
7852
7852
|
const d = Se("<div>"), f = Se("<div>"), v = this._render("dropdown"), b = Se('<div role="listbox" tabindex="-1">'), _ = this.input.getAttribute("class") || "", p = s.mode;
|
|
7853
7853
|
var m;
|
|
7854
|
-
if (
|
|
7854
|
+
if (se(d, s.wrapperClass, _, p), se(f, s.controlClass), qe(d, f), se(v, s.dropdownClass, p), s.copyClassesToDropdown && se(v, _), se(b, s.dropdownContentClass), qe(v, b), Se(s.dropdownParent || d).appendChild(v), Oa(s.controlInput)) {
|
|
7855
7855
|
m = Se(s.controlInput);
|
|
7856
7856
|
var h = ["autocorrect", "autocapitalize", "autocomplete", "spellcheck"];
|
|
7857
7857
|
Nt(h, (w) => {
|
|
@@ -7882,7 +7882,7 @@ class Jt extends gl(ml) {
|
|
|
7882
7882
|
}
|
|
7883
7883
|
if (s.style.width = d.style.width, e.plugins.names.length) {
|
|
7884
7884
|
const y = "plugin-" + e.plugins.names.join(" plugin-");
|
|
7885
|
-
|
|
7885
|
+
se([s, i], y);
|
|
7886
7886
|
}
|
|
7887
7887
|
(t.maxItems === null || t.maxItems > 1) && e.is_select_tag && Et(d, { multiple: "multiple" }), t.placeholder && Et(n, { placeholder: t.placeholder }), !t.splitOn && t.delimiter && (t.splitOn = new RegExp("\\s*" + Vn(t.delimiter) + "+\\s*")), t.load && t.loadThrottle && (t.load = Pl(t.load, t.loadThrottle)), Wt(i, "mousemove", () => {
|
|
7888
7888
|
e.ignoreHover = !1;
|
|
@@ -7917,7 +7917,7 @@ class Jt extends gl(ml) {
|
|
|
7917
7917
|
tabIndex: d.tabIndex
|
|
7918
7918
|
}, d.tabIndex = -1, d.insertAdjacentElement("afterend", e.wrapper), e.sync(!1), t.items = [], delete t.optgroups, delete t.options, Wt(d, "invalid", () => {
|
|
7919
7919
|
e.isValid && (e.isValid = !1, e.isInvalid = !0, e.refreshState());
|
|
7920
|
-
}), e.updateOriginalInput(), e.refreshItems(), e.close(!1), e.inputState(), e.isSetup = !0, d.disabled ? e.disable() : d.readOnly ? e.setReadOnly(!0) : e.enable(), e.on("change", this.onChange),
|
|
7920
|
+
}), e.updateOriginalInput(), e.refreshItems(), e.close(!1), e.inputState(), e.isSetup = !0, d.disabled ? e.disable() : d.readOnly ? e.setReadOnly(!0) : e.enable(), e.on("change", this.onChange), se(d, "tomselected", "ts-hidden-accessible"), e.trigger("initialize"), t.preload === !0 && e.preload();
|
|
7921
7921
|
}
|
|
7922
7922
|
/**
|
|
7923
7923
|
* Register options and optgroups
|
|
@@ -8224,7 +8224,7 @@ class Jt extends gl(ml) {
|
|
|
8224
8224
|
const t = this;
|
|
8225
8225
|
if (!t.canLoad(e))
|
|
8226
8226
|
return;
|
|
8227
|
-
|
|
8227
|
+
se(t.wrapper, t.settings.loadingClass), t.loading++;
|
|
8228
8228
|
const n = t.loadCallback.bind(t);
|
|
8229
8229
|
t.settings.load.call(t, e, n);
|
|
8230
8230
|
}
|
|
@@ -8234,7 +8234,7 @@ class Jt extends gl(ml) {
|
|
|
8234
8234
|
*/
|
|
8235
8235
|
loadCallback(e, t) {
|
|
8236
8236
|
const n = this;
|
|
8237
|
-
n.loading = Math.max(n.loading - 1, 0), n.lastQuery = null, n.clearActiveOption(), n.setupOptions(e, t), n.refreshOptions(n.isFocused && !n.isInputHidden), n.loading ||
|
|
8237
|
+
n.loading = Math.max(n.loading - 1, 0), n.lastQuery = null, n.clearActiveOption(), n.setupOptions(e, t), n.refreshOptions(n.isFocused && !n.isInputHidden), n.loading || Me(n.wrapper, n.settings.loadingClass), n.trigger("load", e, t);
|
|
8238
8238
|
}
|
|
8239
8239
|
preload() {
|
|
8240
8240
|
var e = this.wrapper.classList;
|
|
@@ -8300,7 +8300,7 @@ class Jt extends gl(ml) {
|
|
|
8300
8300
|
*/
|
|
8301
8301
|
setActiveItemClass(e) {
|
|
8302
8302
|
const t = this, n = t.control.querySelector(".last-active");
|
|
8303
|
-
n &&
|
|
8303
|
+
n && Me(n, "last-active"), se(e, "active last-active"), t.trigger("item_select", e), t.activeItems.indexOf(e) == -1 && t.activeItems.push(e);
|
|
8304
8304
|
}
|
|
8305
8305
|
/**
|
|
8306
8306
|
* Remove active item
|
|
@@ -8308,14 +8308,14 @@ class Jt extends gl(ml) {
|
|
|
8308
8308
|
*/
|
|
8309
8309
|
removeActiveItem(e) {
|
|
8310
8310
|
var t = this.activeItems.indexOf(e);
|
|
8311
|
-
this.activeItems.splice(t, 1),
|
|
8311
|
+
this.activeItems.splice(t, 1), Me(e, "active");
|
|
8312
8312
|
}
|
|
8313
8313
|
/**
|
|
8314
8314
|
* Clears all the active items
|
|
8315
8315
|
*
|
|
8316
8316
|
*/
|
|
8317
8317
|
clearActiveItems() {
|
|
8318
|
-
|
|
8318
|
+
Me(this.activeItems, "active"), this.activeItems = [];
|
|
8319
8319
|
}
|
|
8320
8320
|
/**
|
|
8321
8321
|
* Sets the selected item in the dropdown menu
|
|
@@ -8323,7 +8323,7 @@ class Jt extends gl(ml) {
|
|
|
8323
8323
|
*
|
|
8324
8324
|
*/
|
|
8325
8325
|
setActiveOption(e, t = !0) {
|
|
8326
|
-
e !== this.activeOption && (this.clearActiveOption(), e && (this.activeOption = e, Et(this.focus_node, { "aria-activedescendant": e.getAttribute("id") }), Et(e, { "aria-selected": "true" }),
|
|
8326
|
+
e !== this.activeOption && (this.clearActiveOption(), e && (this.activeOption = e, Et(this.focus_node, { "aria-activedescendant": e.getAttribute("id") }), Et(e, { "aria-selected": "true" }), se(e, "active"), t && this.scrollToOption(e)));
|
|
8327
8327
|
}
|
|
8328
8328
|
/**
|
|
8329
8329
|
* Sets the dropdown_content scrollTop to display the option
|
|
@@ -8348,7 +8348,7 @@ class Jt extends gl(ml) {
|
|
|
8348
8348
|
*
|
|
8349
8349
|
*/
|
|
8350
8350
|
clearActiveOption() {
|
|
8351
|
-
this.activeOption && (
|
|
8351
|
+
this.activeOption && (Me(this.activeOption, "active"), Et(this.activeOption, { "aria-selected": null })), this.activeOption = null, Et(this.focus_node, { "aria-activedescendant": null });
|
|
8352
8352
|
}
|
|
8353
8353
|
/**
|
|
8354
8354
|
* Selects all items (CTRL + A).
|
|
@@ -8467,7 +8467,7 @@ class Jt extends gl(ml) {
|
|
|
8467
8467
|
let E = O.$order, N = m.optgroups[s];
|
|
8468
8468
|
N === void 0 ? s = "" : E = N.$order;
|
|
8469
8469
|
const [u, j] = T(s, E);
|
|
8470
|
-
n > 0 && (G = G.cloneNode(!0), Et(G, { id: O.$id + "-clone-" + n, "aria-selected": null }), G.classList.add("ts-cloned"),
|
|
8470
|
+
n > 0 && (G = G.cloneNode(!0), Et(G, { id: O.$id + "-clone-" + n, "aria-selected": null }), G.classList.add("ts-cloned"), Me(G, "active"), m.activeOption && m.activeOption.dataset.value == P && v && v.dataset.group === s.toString() && (y = G)), j.appendChild(G), s != "" && (_[s] = u);
|
|
8471
8471
|
}
|
|
8472
8472
|
}
|
|
8473
8473
|
m.settings.lockOptgroupOrder && p.sort((C, P) => C.order - P.order), d = document.createDocumentFragment(), Nt(p, (C) => {
|
|
@@ -8596,7 +8596,7 @@ class Jt extends gl(ml) {
|
|
|
8596
8596
|
}
|
|
8597
8597
|
f.remove();
|
|
8598
8598
|
}
|
|
8599
|
-
v && (a = n.items.indexOf(s), a !== -1 && n.items.splice(a, 1, o), i = n._render("item", t), v.classList.contains("active") &&
|
|
8599
|
+
v && (a = n.items.indexOf(s), a !== -1 && n.items.splice(a, 1, o), i = n._render("item", t), v.classList.contains("active") && se(i, "active"), S0(v, i)), n.lastQuery = null;
|
|
8600
8600
|
}
|
|
8601
8601
|
/**
|
|
8602
8602
|
* Removes a single option.
|
|
@@ -8715,7 +8715,7 @@ class Jt extends gl(ml) {
|
|
|
8715
8715
|
return;
|
|
8716
8716
|
var i, a;
|
|
8717
8717
|
const s = e.dataset.value;
|
|
8718
|
-
i = Ni(e), e.remove(), e.classList.contains("active") && (a = n.activeItems.indexOf(e), n.activeItems.splice(a, 1),
|
|
8718
|
+
i = Ni(e), e.remove(), e.classList.contains("active") && (a = n.activeItems.indexOf(e), n.activeItems.splice(a, 1), Me(e, "active")), n.items.splice(i, 1), n.lastQuery = null, !n.settings.persist && n.userOptions.hasOwnProperty(s) && n.removeOption(s, t), i < n.caretPos && n.setCaret(n.caretPos - 1), n.updateOriginalInput({ silent: t }), n.refreshState(), n.positionDropdown(), n.trigger("item_remove", s, e);
|
|
8719
8719
|
}
|
|
8720
8720
|
/**
|
|
8721
8721
|
* Invokes the `create` method provided in the
|
|
@@ -8984,7 +8984,7 @@ class Jt extends gl(ml) {
|
|
|
8984
8984
|
*/
|
|
8985
8985
|
destroy() {
|
|
8986
8986
|
var e = this, t = e.revertSettings;
|
|
8987
|
-
e.trigger("destroy"), e.off(), e.wrapper.remove(), e.dropdown.remove(), e.input.innerHTML = t.innerHTML, e.input.tabIndex = t.tabIndex,
|
|
8987
|
+
e.trigger("destroy"), e.off(), e.wrapper.remove(), e.dropdown.remove(), e.input.innerHTML = t.innerHTML, e.input.tabIndex = t.tabIndex, Me(e.input, "tomselected", "ts-hidden-accessible"), e._destroy(), delete e.input.tomselect;
|
|
8988
8988
|
}
|
|
8989
8989
|
/**
|
|
8990
8990
|
* A helper method for rendering "item" and
|
|
@@ -8998,7 +8998,7 @@ class Jt extends gl(ml) {
|
|
|
8998
8998
|
return null;
|
|
8999
8999
|
if (i = Se(i), e === "option" || e === "option_create" ? t[a.settings.disabledField] ? Et(i, { "aria-disabled": "true" }) : Et(i, { "data-selectable": "" }) : e === "optgroup" && (n = t.group[a.settings.optgroupValueField], Et(i, { "data-group": n }), t.group[a.settings.disabledField] && Et(i, { "data-disabled": "" })), e === "option" || e === "item") {
|
|
9000
9000
|
const s = br(t[a.settings.valueField]);
|
|
9001
|
-
Et(i, { "data-value": s }), e === "item" ? (
|
|
9001
|
+
Et(i, { "data-value": s }), e === "item" ? (se(i, a.settings.itemClass), Et(i, { "data-ts-item": "" })) : (se(i, a.settings.optionClass), Et(i, {
|
|
9002
9002
|
role: "option",
|
|
9003
9003
|
id: t.$id
|
|
9004
9004
|
}), t.$div = i, a.options[s] = t);
|
|
@@ -9618,14 +9618,14 @@ const Xi = `<div
|
|
|
9618
9618
|
</svg>
|
|
9619
9619
|
</div>
|
|
9620
9620
|
`, f0 = document.createElement("template");
|
|
9621
|
-
var Gt, Qe,
|
|
9621
|
+
var Gt, Qe, he, Gn, Bt, lt, za, Ra, Xn, oe, L0, Ma, A0, D0, vr, Le, T0, O0, C0, F0;
|
|
9622
9622
|
class Ia extends HTMLElement {
|
|
9623
9623
|
constructor() {
|
|
9624
9624
|
super();
|
|
9625
9625
|
ot(this, lt);
|
|
9626
9626
|
ot(this, Gt);
|
|
9627
9627
|
ot(this, Qe, !1);
|
|
9628
|
-
ot(this,
|
|
9628
|
+
ot(this, he, !1);
|
|
9629
9629
|
ot(this, Gn, !1);
|
|
9630
9630
|
ot(this, Bt);
|
|
9631
9631
|
ot(this, Xn, (t) => {
|
|
@@ -9636,12 +9636,12 @@ class Ia extends HTMLElement {
|
|
|
9636
9636
|
c(this, Bt).open();
|
|
9637
9637
|
})();
|
|
9638
9638
|
});
|
|
9639
|
-
this.attachShadow({ mode: "open" }), ht(this, Gt, this.getAttribute("pdc") === "country" ? "country" : "city"), ht(this,
|
|
9639
|
+
this.attachShadow({ mode: "open" }), ht(this, Gt, this.getAttribute("pdc") === "country" ? "country" : "city"), ht(this, he, this.getAttribute("styled") === "true"), ht(this, Bt, M(this, lt, za).call(this));
|
|
9640
9640
|
}
|
|
9641
9641
|
/* EVENTS
|
|
9642
9642
|
*/
|
|
9643
9643
|
attributeChangedCallback(t, n, i) {
|
|
9644
|
-
c(this,
|
|
9644
|
+
c(this, he) && M(this, lt, T0).call(this, `bg-${i === "white" ? "white" : "neutral-50"}`);
|
|
9645
9645
|
}
|
|
9646
9646
|
focusEl() {
|
|
9647
9647
|
c(this, Bt).control.focus();
|
|
@@ -9652,7 +9652,7 @@ class Ia extends HTMLElement {
|
|
|
9652
9652
|
c(this, lt, Ma).setAttribute("tabindex", t ? "0" : "-1");
|
|
9653
9653
|
}
|
|
9654
9654
|
enable(t) {
|
|
9655
|
-
this.removeAttribute(c(this, Gt)), t ? (c(this, Bt).enable(), c(this, lt,
|
|
9655
|
+
this.removeAttribute(c(this, Gt)), t ? (c(this, Bt).enable(), c(this, lt, oe).classList.add("active"), c(this, lt, oe).removeAttribute("inert")) : (c(this, Bt).disable(), c(this, lt, oe).classList.remove("active", "success"), c(this, lt, oe).setAttribute("inert", "")), this.enableTabIndex(t), c(this, lt, oe).classList.remove("success", "error"), ht(this, Gn, t);
|
|
9656
9656
|
}
|
|
9657
9657
|
setOptions(t) {
|
|
9658
9658
|
M(this, lt, O0).call(this, !0), this.enable(!1), c(this, Bt).destroy(), M(this, lt, C0).call(this), t.forEach((n) => {
|
|
@@ -9665,13 +9665,13 @@ class Ia extends HTMLElement {
|
|
|
9665
9665
|
a.setAttribute("value", i), a.textContent = n.label, c(this, lt, L0).appendChild(a), c(this, Bt).sync();
|
|
9666
9666
|
}), this.enable(!0), c(this, Bt).on("change", () => {
|
|
9667
9667
|
const n = c(this, Bt).getValue();
|
|
9668
|
-
Array.isArray(n) || (this.setAttribute(c(this, Gt), n), c(this,
|
|
9668
|
+
Array.isArray(n) || (this.setAttribute(c(this, Gt), n), c(this, he) && (M(this, lt, F0).call(this, !1), c(this, lt, oe).classList.remove("error"), c(this, lt, oe).classList.add("success")), c(this, Bt).control.setAttribute("tabindex", "-1"));
|
|
9669
9669
|
}), setTimeout(() => {
|
|
9670
9670
|
M(this, lt, O0).call(this, !1);
|
|
9671
9671
|
}, na * 2);
|
|
9672
9672
|
}
|
|
9673
9673
|
validate() {
|
|
9674
|
-
return ht(this, Qe, !1), this.hasAttribute(c(this, Gt)) ? (ht(this, Qe, !0), c(this, Qe)) : (c(this,
|
|
9674
|
+
return ht(this, Qe, !1), this.hasAttribute(c(this, Gt)) ? (ht(this, Qe, !0), c(this, Qe)) : (c(this, he) && M(this, lt, F0).call(this, !0), c(this, Qe));
|
|
9675
9675
|
}
|
|
9676
9676
|
/* GET DATA METHODS
|
|
9677
9677
|
*/
|
|
@@ -9683,18 +9683,18 @@ class Ia extends HTMLElement {
|
|
|
9683
9683
|
return t || null;
|
|
9684
9684
|
}
|
|
9685
9685
|
}
|
|
9686
|
-
Gt = new WeakMap(), Qe = new WeakMap(),
|
|
9687
|
-
return this.removeAttribute(c(this, Gt)), c(this, lt, Le).innerHTML = "", c(this,
|
|
9686
|
+
Gt = new WeakMap(), Qe = new WeakMap(), he = new WeakMap(), Gn = new WeakMap(), Bt = new WeakMap(), lt = new WeakSet(), za = function() {
|
|
9687
|
+
return this.removeAttribute(c(this, Gt)), c(this, lt, Le).innerHTML = "", c(this, he) ? (f0.innerHTML = Xi, dn(c(this, lt, Le))) : f0.innerHTML = Ye(Xi), c(this, lt, Le).appendChild(f0.content.cloneNode(!0)), c(this, lt, A0).textContent = c(this, Gt) === "country" ? "State" : "City", c(this, lt, A0).setAttribute(
|
|
9688
9688
|
"aria-label",
|
|
9689
9689
|
`Select the trip ${c(this, Gt) === "country" ? "state" : "city"}`
|
|
9690
9690
|
), M(this, lt, Ra).call(this), M(this, lt, C0).call(this);
|
|
9691
9691
|
}, Ra = function() {
|
|
9692
9692
|
let t = 0, n = 0;
|
|
9693
|
-
c(this, lt,
|
|
9693
|
+
c(this, lt, oe).addEventListener("pointerdown", (i) => {
|
|
9694
9694
|
if (!(i instanceof PointerEvent)) return;
|
|
9695
9695
|
const a = Qn(i);
|
|
9696
9696
|
t = a.pointerStartX, n = a.pointerStartY;
|
|
9697
|
-
}), c(this, lt,
|
|
9697
|
+
}), c(this, lt, oe).addEventListener("pointerup", (i) => {
|
|
9698
9698
|
if (!(i instanceof PointerEvent)) return;
|
|
9699
9699
|
const a = tr(
|
|
9700
9700
|
i,
|
|
@@ -9703,10 +9703,10 @@ Gt = new WeakMap(), Qe = new WeakMap(), ue = new WeakMap(), Gn = new WeakMap(),
|
|
|
9703
9703
|
n
|
|
9704
9704
|
);
|
|
9705
9705
|
t = a.pointerStartX, n = a.pointerStartY;
|
|
9706
|
-
}), c(this, lt,
|
|
9706
|
+
}), c(this, lt, oe).addEventListener("keydown", (i) => {
|
|
9707
9707
|
i instanceof KeyboardEvent && (i.key === "Enter" || i.key === " ") && c(this, Xn).call(this, i);
|
|
9708
9708
|
});
|
|
9709
|
-
}, Xn = new WeakMap(),
|
|
9709
|
+
}, Xn = new WeakMap(), oe = function() {
|
|
9710
9710
|
const t = c(this, lt, Le).querySelector("#pdc-container");
|
|
9711
9711
|
if (!t)
|
|
9712
9712
|
throw new Error(
|
|
@@ -9754,11 +9754,11 @@ Gt = new WeakMap(), Qe = new WeakMap(), ue = new WeakMap(), Gn = new WeakMap(),
|
|
|
9754
9754
|
}, /* VISUAL METHODS
|
|
9755
9755
|
*/
|
|
9756
9756
|
T0 = function(t = null) {
|
|
9757
|
-
if (!c(this,
|
|
9757
|
+
if (!c(this, he)) return;
|
|
9758
9758
|
const n = c(this, lt, Le).querySelector("div");
|
|
9759
9759
|
n == null || n.classList.remove("bg-white", "bg-neutral-50"), n == null || n.classList.add(t || `bg-${this.getAttribute("bg")}`);
|
|
9760
9760
|
}, O0 = function(t) {
|
|
9761
|
-
c(this,
|
|
9761
|
+
c(this, he) && (t ? c(this, lt, D0).classList.add("active") : c(this, lt, D0).classList.remove("active"));
|
|
9762
9762
|
}, C0 = function() {
|
|
9763
9763
|
const t = c(this, Gt) === "city" ? `No results
|
|
9764
9764
|
found. Choose the first available option such as "Standard Rate", "[OTHER]", etc.` : "No results found.", n = new Jt(c(this, lt, L0), {
|
|
@@ -9781,13 +9781,13 @@ T0 = function(t = null) {
|
|
|
9781
9781
|
*/
|
|
9782
9782
|
F0 = function(t) {
|
|
9783
9783
|
if (t) {
|
|
9784
|
-
c(this,
|
|
9784
|
+
c(this, he) && (c(this, lt, oe).classList.add("error"), c(this, lt, vr).classList.add("active")), c(this, lt, vr).textContent = c(this, Gt) === "country" ? "Select state." : "Select city.";
|
|
9785
9785
|
return;
|
|
9786
9786
|
}
|
|
9787
|
-
c(this,
|
|
9787
|
+
c(this, he) && (c(this, lt, oe).classList.remove("error"), c(this, lt, vr).classList.remove("active"));
|
|
9788
9788
|
}, /* SETUP
|
|
9789
9789
|
*/
|
|
9790
|
-
|
|
9790
|
+
ae(Ia, "observedAttributes", ["bg"]);
|
|
9791
9791
|
const Zi = `<div
|
|
9792
9792
|
inert
|
|
9793
9793
|
id="pdc-container"
|
|
@@ -9828,7 +9828,7 @@ const Zi = `<div
|
|
|
9828
9828
|
</svg>
|
|
9829
9829
|
</div>
|
|
9830
9830
|
`, p0 = document.createElement("template");
|
|
9831
|
-
var Rt, tn, ye, Zn, $, Pa, wr, Ct, I0, Ge, $n, wn, yr,
|
|
9831
|
+
var Rt, tn, ye, Zn, $, Pa, wr, Ct, I0, Ge, $n, wn, yr, Ne, ue, _r, z0, Bn, Hn, yn, _n, $a, R0, Ba, Ha, Ua, ja, xr, kr;
|
|
9832
9832
|
class Na extends HTMLElement {
|
|
9833
9833
|
constructor() {
|
|
9834
9834
|
super();
|
|
@@ -9859,7 +9859,7 @@ class Na extends HTMLElement {
|
|
|
9859
9859
|
t ? (c(this, $, Ct).removeAttribute("disabled"), c(this, $, I0).removeAttribute("inert")) : (c(this, $, Ct).setAttribute("disabled", "true"), c(this, $, I0).setAttribute("inert", ""), c(this, $, Ct).classList.remove("success")), this.enableTabIndex(t), ht(this, Zn, t);
|
|
9860
9860
|
}
|
|
9861
9861
|
async handleInputChange(t = null) {
|
|
9862
|
-
c(this, ye) && c(this, $, Ct).classList.remove("success"), !(!M(this, $, Ua).call(this, t) || !t) && (!await M(this, $, ja).call(this) || !
|
|
9862
|
+
c(this, ye) && c(this, $, Ct).classList.remove("success"), !(!M(this, $, Ua).call(this, t) || !t) && (!await M(this, $, ja).call(this) || !ce(t) || (M(this, $, _n).call(this, t), M(this, $, yn).call(this, t), await c(this, $, Ne).restrictStartInput(), c(this, $, ue).restrictEndInput(), c(this, ye) && (c(this, $, Ct).classList.remove("error"), c(this, $, Ct).classList.add("success"), this.renderError(!1))));
|
|
9863
9863
|
}
|
|
9864
9864
|
/* VALIDATION
|
|
9865
9865
|
*/
|
|
@@ -9871,15 +9871,15 @@ class Na extends HTMLElement {
|
|
|
9871
9871
|
c(this, ye) && c(this, $, _r).classList.remove("active");
|
|
9872
9872
|
}
|
|
9873
9873
|
async restrictStartInput() {
|
|
9874
|
-
if (!c(this, $,
|
|
9874
|
+
if (!c(this, $, ue).pdcValue && !c(this, $, wn).el) {
|
|
9875
9875
|
this.enable(!0), M(this, $, Hn).call(this), M(this, $, Bn).call(this);
|
|
9876
9876
|
return;
|
|
9877
9877
|
}
|
|
9878
|
-
c(this, $, wn).el || this.enable(!0), c(this, $,
|
|
9878
|
+
c(this, $, wn).el || this.enable(!0), c(this, $, ue).pdcValue && M(this, $, Hn).call(this, c(this, $, ue).pdcValue), M(this, $, Ba).call(this);
|
|
9879
9879
|
}
|
|
9880
9880
|
restrictEndInput() {
|
|
9881
|
-
if (c(this, $,
|
|
9882
|
-
this.enable(!0), M(this, $, Bn).call(this, c(this, $,
|
|
9881
|
+
if (c(this, $, Ne).pdcValue)
|
|
9882
|
+
this.enable(!0), M(this, $, Bn).call(this, c(this, $, Ne).pdcValue);
|
|
9883
9883
|
else {
|
|
9884
9884
|
this.enable(!1), M(this, $, Bn).call(this), M(this, $, Hn).call(this);
|
|
9885
9885
|
return;
|
|
@@ -9889,7 +9889,7 @@ class Na extends HTMLElement {
|
|
|
9889
9889
|
validate() {
|
|
9890
9890
|
ht(this, tn, !1);
|
|
9891
9891
|
const t = this.getAttribute(c(this, Rt));
|
|
9892
|
-
return t &&
|
|
9892
|
+
return t && ce(t) ? (ht(this, tn, !0), c(this, tn)) : (this.renderError(!0), c(this, tn));
|
|
9893
9893
|
}
|
|
9894
9894
|
/* GET DATA METHODS
|
|
9895
9895
|
*/
|
|
@@ -9901,7 +9901,7 @@ class Na extends HTMLElement {
|
|
|
9901
9901
|
}
|
|
9902
9902
|
get pdcValue() {
|
|
9903
9903
|
const t = this.getAttribute(c(this, Rt));
|
|
9904
|
-
return t &&
|
|
9904
|
+
return t && ce(t) ? t : null;
|
|
9905
9905
|
}
|
|
9906
9906
|
}
|
|
9907
9907
|
Rt = new WeakMap(), tn = new WeakMap(), ye = new WeakMap(), Zn = new WeakMap(), $ = new WeakSet(), Pa = function() {
|
|
@@ -9944,14 +9944,14 @@ Rt = new WeakMap(), tn = new WeakMap(), ye = new WeakMap(), Zn = new WeakMap(),
|
|
|
9944
9944
|
var s;
|
|
9945
9945
|
const t = c(this, $, $n).nextElementSibling, n = t == null ? void 0 : t.querySelector('[pdc="start"]'), i = n == null ? void 0 : n.pdcValue, a = (s = t == null ? void 0 : t.querySelector('[pdc="end"]')) == null ? void 0 : s.pdcValue;
|
|
9946
9946
|
return { el: t, startEl: n, startDate: i, endDate: a };
|
|
9947
|
-
},
|
|
9947
|
+
}, Ne = function() {
|
|
9948
9948
|
const t = c(this, $, $n).querySelector('[pdc="start"]');
|
|
9949
9949
|
if (!t)
|
|
9950
9950
|
throw new Error(
|
|
9951
9951
|
"Failed to get row startDateEl from Date custom element"
|
|
9952
9952
|
);
|
|
9953
9953
|
return t;
|
|
9954
|
-
},
|
|
9954
|
+
}, ue = function() {
|
|
9955
9955
|
const t = c(this, $, $n).querySelector('[pdc="end"]');
|
|
9956
9956
|
if (!t)
|
|
9957
9957
|
throw new Error(
|
|
@@ -9986,7 +9986,7 @@ z0 = function(t = null) {
|
|
|
9986
9986
|
M(this, $, _n).call(this), M(this, $, yn).call(this), this.focusEl();
|
|
9987
9987
|
}, R0 = function() {
|
|
9988
9988
|
var t, n;
|
|
9989
|
-
M(t = c(this, $,
|
|
9989
|
+
M(t = c(this, $, ue), $, _n).call(t), M(n = c(this, $, ue), $, yn).call(n), c(this, $, ue).restrictEndInput();
|
|
9990
9990
|
}, Ba = function() {
|
|
9991
9991
|
var n;
|
|
9992
9992
|
if (!c(this, $, wn).endDate) return;
|
|
@@ -9999,16 +9999,16 @@ z0 = function(t = null) {
|
|
|
9999
9999
|
const t = xi(c(this, $, yr).startDate, -1);
|
|
10000
10000
|
c(this, $, kr) !== t && (M(this, $, Hn).call(this, t), M(this, $, _n).call(this, t), M(this, $, yn).call(this, t), c(this, $, Ct).classList.add("success"), (n = c(this, $, yr).startEl) == null || n.enable(!1));
|
|
10001
10001
|
}, Ua = function(t = null) {
|
|
10002
|
-
return !t || Ei.test(t) || Si.test(t) || n0.test(t) || !
|
|
10002
|
+
return !t || Ei.test(t) || Si.test(t) || n0.test(t) || !ce(t) ? (M(this, $, $a).call(this), c(this, Rt) === "start" && M(this, $, R0).call(this), t && (Ei.test(t) && this.renderError(!0, "Date must be after 2020"), Si.test(t) && this.renderError(!0, "Date must be before 2041"), n0.test(t) && this.renderError(!0, "Enter a valid date.")), !1) : !0;
|
|
10003
10003
|
}, ja = async function() {
|
|
10004
|
-
return c(this, $, xr) ? c(this, $, kr) && Date.parse(c(this, $, xr)) > Date.parse(c(this, $, kr)) ? (await c(this, $,
|
|
10004
|
+
return c(this, $, xr) ? c(this, $, kr) && Date.parse(c(this, $, xr)) > Date.parse(c(this, $, kr)) ? (await c(this, $, Ne).restrictStartInput(), M(this, $, R0).call(this), c(this, $, ue).renderError(!0, "End date must be after start date."), !1) : !0 : !1;
|
|
10005
10005
|
}, xr = function() {
|
|
10006
|
-
return c(this, $,
|
|
10006
|
+
return c(this, $, Ne).inputValue && ce(c(this, $, Ne).inputValue) ? c(this, $, Ne).inputValue : null;
|
|
10007
10007
|
}, kr = function() {
|
|
10008
|
-
return c(this, $,
|
|
10008
|
+
return c(this, $, ue).inputValue && ce(c(this, $, ue).inputValue) ? c(this, $, ue).inputValue : null;
|
|
10009
10009
|
}, /* SETUP
|
|
10010
10010
|
*/
|
|
10011
|
-
|
|
10011
|
+
ae(Na, "observedAttributes", ["bg"]);
|
|
10012
10012
|
const Ki = `<button
|
|
10013
10013
|
tabindex="-1"
|
|
10014
10014
|
class="group focus-visible:after:!border-b-primary-800 after:content-[_]
|
|
@@ -10075,17 +10075,17 @@ Kn = new WeakMap(), en = new WeakSet(), Un = function() {
|
|
|
10075
10075
|
};
|
|
10076
10076
|
customElements.define("pdc-expense-row", pa);
|
|
10077
10077
|
const g0 = document.createElement("template");
|
|
10078
|
-
var
|
|
10078
|
+
var Be, nn, He, Ue, Or, rt, Va, M0, N0, P0, xn, Xe, $0, Tt, qa, Wa, B0, Ga, Xa, Za, Ka, Ja, Qa;
|
|
10079
10079
|
class Ya extends HTMLElement {
|
|
10080
10080
|
constructor() {
|
|
10081
10081
|
super();
|
|
10082
10082
|
ot(this, rt);
|
|
10083
10083
|
/* Initial setup
|
|
10084
10084
|
*/
|
|
10085
|
-
ot(this,
|
|
10085
|
+
ot(this, Be, !1);
|
|
10086
10086
|
ot(this, nn, null);
|
|
10087
|
-
ot(this, Be, 0);
|
|
10088
10087
|
ot(this, He, 0);
|
|
10088
|
+
ot(this, Ue, 0);
|
|
10089
10089
|
ot(this, Or, (t) => {
|
|
10090
10090
|
const n = c(this, rt, Tt).querySelector("#heading"), i = c(this, rt, Tt).querySelector("#heading-print"), a = c(this, rt, Tt).querySelector("#body"), s = c(this, rt, Tt).querySelector("#body-print");
|
|
10091
10091
|
n && t.heading ? (n.innerHTML = "", n.insertAdjacentHTML("beforeend", t.heading)) : n == null || n.remove(), i && t.headingPrint ? (i.innerHTML = "", i.insertAdjacentHTML("beforeend", t.headingPrint)) : i == null || i.remove(), a && t.body ? (a.innerHTML = "", a.insertAdjacentHTML("beforeend", t.body)) : a == null || a.remove(), s && t.bodyPrint ? (s.innerHTML = "", s.insertAdjacentHTML("beforeend", t.bodyPrint)) : s == null || s.remove();
|
|
@@ -10094,10 +10094,10 @@ class Ya extends HTMLElement {
|
|
|
10094
10094
|
}
|
|
10095
10095
|
render(t, n) {
|
|
10096
10096
|
var i;
|
|
10097
|
-
c(this, rt, Tt).innerHTML = "", window.removeEventListener("resize", M(this, rt, M0).call(this)), ht(this,
|
|
10097
|
+
c(this, rt, Tt).innerHTML = "", window.removeEventListener("resize", M(this, rt, M0).call(this)), ht(this, Be, t), c(this, Be) ? (g0.innerHTML = Di, dn(c(this, rt, Tt))) : g0.innerHTML = Ye(Di), c(this, rt, Tt).appendChild(g0.content.cloneNode(!0)), c(this, Or).call(this, n), (i = c(this, rt, Tt).querySelector("pdc-button")) == null || i.enableTabIndex(!0), M(this, rt, Va).call(this);
|
|
10098
10098
|
}
|
|
10099
10099
|
renderLoadingSpinner(t) {
|
|
10100
|
-
if (!c(this,
|
|
10100
|
+
if (!c(this, Be)) return;
|
|
10101
10101
|
const n = c(this, rt, Tt).querySelector(
|
|
10102
10102
|
'[data-pdc="loading-spinner"]'
|
|
10103
10103
|
);
|
|
@@ -10108,16 +10108,16 @@ class Ya extends HTMLElement {
|
|
|
10108
10108
|
}
|
|
10109
10109
|
updateRowMie(t, n, i, a) {
|
|
10110
10110
|
var s;
|
|
10111
|
-
(s = c(this, rt, Tt).querySelector(`[date="${t}"]`)) == null || s.updateMieAmount(n), ht(this,
|
|
10111
|
+
(s = c(this, rt, Tt).querySelector(`[date="${t}"]`)) == null || s.updateMieAmount(n), ht(this, He, i), ht(this, Ue, a), M(this, rt, B0).call(this);
|
|
10112
10112
|
}
|
|
10113
10113
|
async addRows(t, n) {
|
|
10114
10114
|
c(this, rt, P0).innerHTML = "", t.forEach((a) => {
|
|
10115
10115
|
const s = new pa(
|
|
10116
10116
|
a,
|
|
10117
|
-
c(this,
|
|
10117
|
+
c(this, Be),
|
|
10118
10118
|
n
|
|
10119
10119
|
);
|
|
10120
|
-
c(this, rt, P0).appendChild(s), s.styleRow(), window.screen.width >=
|
|
10120
|
+
c(this, rt, P0).appendChild(s), s.styleRow(), window.screen.width >= le && s.rowToggle("open");
|
|
10121
10121
|
});
|
|
10122
10122
|
const i = this.getBoundingClientRect().top + window.pageYOffset;
|
|
10123
10123
|
window.scrollTo({ top: i, behavior: "smooth" }), await M(this, rt, Wa).call(this), M(this, rt, B0).call(this), M(this, rt, Ga).call(this), M(this, rt, Xa).call(this);
|
|
@@ -10171,7 +10171,7 @@ class Ya extends HTMLElement {
|
|
|
10171
10171
|
});
|
|
10172
10172
|
}
|
|
10173
10173
|
}
|
|
10174
|
-
|
|
10174
|
+
Be = new WeakMap(), nn = new WeakMap(), He = new WeakMap(), Ue = new WeakMap(), Or = new WeakMap(), rt = new WeakSet(), /* Events
|
|
10175
10175
|
*/
|
|
10176
10176
|
Va = function() {
|
|
10177
10177
|
let t = 0, n = 0;
|
|
@@ -10245,13 +10245,13 @@ Va = function() {
|
|
|
10245
10245
|
}, /* Visual methods
|
|
10246
10246
|
*/
|
|
10247
10247
|
qa = function(t) {
|
|
10248
|
-
if (!c(this,
|
|
10248
|
+
if (!c(this, Be)) return;
|
|
10249
10249
|
t.classList.toggle("active");
|
|
10250
10250
|
const n = t.classList.contains("active") ? "open" : "close";
|
|
10251
10251
|
c(this, rt, xn).forEach((i) => i.rowToggle(n));
|
|
10252
10252
|
}, Wa = async function() {
|
|
10253
|
-
ht(this,
|
|
10254
|
-
ht(this,
|
|
10253
|
+
ht(this, He, 0), ht(this, Ue, 0), c(this, rt, xn).forEach((t) => {
|
|
10254
|
+
ht(this, He, c(this, He) + t.amount.mie), ht(this, Ue, c(this, Ue) + t.amount.lodging);
|
|
10255
10255
|
});
|
|
10256
10256
|
}, B0 = function() {
|
|
10257
10257
|
const t = c(this, rt, Tt).querySelector("#mie-subtotal"), n = c(this, rt, Tt).querySelector("#lodging-subtotal"), i = c(this, rt, Tt).querySelector("#total");
|
|
@@ -10259,7 +10259,7 @@ qa = function(t) {
|
|
|
10259
10259
|
throw new Error(
|
|
10260
10260
|
"Failed to render subtotal/total elements in Expense view."
|
|
10261
10261
|
);
|
|
10262
|
-
t.textContent = `${Xt.format(c(this,
|
|
10262
|
+
t.textContent = `${Xt.format(c(this, He))}`, n.textContent = `${Xt.format(c(this, Ue))}`, i.textContent = `${Xt.format(c(this, He) + c(this, Ue))}`;
|
|
10263
10263
|
}, /* Create prinout
|
|
10264
10264
|
*/
|
|
10265
10265
|
Ga = function() {
|
|
@@ -10317,7 +10317,7 @@ Ga = function() {
|
|
|
10317
10317
|
/*HTML*/
|
|
10318
10318
|
`
|
|
10319
10319
|
<tr>
|
|
10320
|
-
<td class="text-center">${
|
|
10320
|
+
<td class="text-center">${Re(t.date)}/${jn(t.date)}/${Cn(t.date)}</td> <!-- // 2024-10-01 to 10/01/24 -->
|
|
10321
10321
|
<td class="text-left">${n}</td>
|
|
10322
10322
|
<td class="text-right">${Xt.format(t.mieAmount)}</td>
|
|
10323
10323
|
<td class="text-right">${Xt.format(t.lodgingAmount)}</td>
|
|
@@ -10327,7 +10327,7 @@ Ga = function() {
|
|
|
10327
10327
|
);
|
|
10328
10328
|
}, Qa = function(t) {
|
|
10329
10329
|
const n = t.closest("pdc-expense-row"), i = n == null ? void 0 : n.getAttribute("date"), a = n == null ? void 0 : n.getAttribute("lodging"), s = (n == null ? void 0 : n.getAttribute("breakfastprovided")) === "yes", o = (n == null ? void 0 : n.getAttribute("lunchprovided")) === "yes", d = (n == null ? void 0 : n.getAttribute("dinnerprovided")) === "yes";
|
|
10330
|
-
if (!(i &&
|
|
10330
|
+
if (!(i && ce(i) && a))
|
|
10331
10331
|
throw new Error(
|
|
10332
10332
|
"Failed to get date and lodging values to update row in expense View."
|
|
10333
10333
|
);
|
|
@@ -10468,8 +10468,8 @@ const Ji = `<div
|
|
|
10468
10468
|
<!-- Row sidebar: number, toggle -->
|
|
10469
10469
|
<div
|
|
10470
10470
|
data-pdc="location-row-sidebar"
|
|
10471
|
-
class="relative z-10 mr-4 ml-2 sm:mr-6 lg:mx-6 lg:flex
|
|
10472
|
-
lg:justify-between lg:text-center"
|
|
10471
|
+
class="relative z-10 mr-4 ml-2 h-full sm:mr-6 lg:mx-6 lg:flex
|
|
10472
|
+
lg:flex-col lg:justify-between lg:text-center"
|
|
10473
10473
|
>
|
|
10474
10474
|
<div
|
|
10475
10475
|
data-pdc="location-row-toggle"
|
|
@@ -10652,7 +10652,7 @@ customElements.define("pdc-location-category", xa);
|
|
|
10652
10652
|
customElements.define("pdc-location-select", Ia);
|
|
10653
10653
|
customElements.define("pdc-button", tc);
|
|
10654
10654
|
const b0 = document.createElement("template"), ta = document.createElement("template");
|
|
10655
|
-
var rn, Oe, Cr, H, es, H0, Ae, be, Er,
|
|
10655
|
+
var rn, Oe, Cr, H, es, H0, Ae, be, Er, ne, ve, Ze, kn, En, Sr, U0, ns, rs, is, as, ss, Ie, j0, os, Fr, Dn, Ir, zr, Jn, ls, cs, an, Rr, Mr, ds, us, hs;
|
|
10656
10656
|
class ts extends HTMLElement {
|
|
10657
10657
|
constructor(t, n) {
|
|
10658
10658
|
super();
|
|
@@ -10668,13 +10668,13 @@ class ts extends HTMLElement {
|
|
|
10668
10668
|
});
|
|
10669
10669
|
ot(this, Fr, () => {
|
|
10670
10670
|
[...c(this, H, be)].forEach((t) => {
|
|
10671
|
-
window.screen.width <
|
|
10671
|
+
window.screen.width < le && t.offsetHeight === ze || (c(this, Dn).call(this, t), t.style.height = M(this, H, ve).call(this, t).details.scrollHeight + "px", M(this, H, ve).call(this, t).contents.style.height = M(this, H, ve).call(this, t).details.scrollHeight + "px", window.screen.width >= le && M(this, H, Ie).call(this, t, "open"));
|
|
10672
10672
|
});
|
|
10673
10673
|
});
|
|
10674
10674
|
ot(this, Dn, (t) => {
|
|
10675
10675
|
const n = M(this, H, Sr).call(this, t), i = n % 2 === 0 ? "neutral-50" : "white", a = i === "neutral-50" ? "white" : "neutral-50";
|
|
10676
|
-
t.classList.remove("bg-white", "bg-neutral-50"), t.classList.add(`bg-${i}`), t.style.zIndex = n.toString(), Object.values(M(this, H,
|
|
10677
|
-
window.screen.width <
|
|
10676
|
+
t.classList.remove("bg-white", "bg-neutral-50"), t.classList.add(`bg-${i}`), t.style.zIndex = n.toString(), Object.values(M(this, H, ne).call(this, t)).forEach((s, o) => {
|
|
10677
|
+
window.screen.width < le ? s.setAttribute("bg", o % 2 === 0 ? i : a) : s.setAttribute("bg", i);
|
|
10678
10678
|
});
|
|
10679
10679
|
});
|
|
10680
10680
|
/* VALIDATION
|
|
@@ -10713,8 +10713,8 @@ class ts extends HTMLElement {
|
|
|
10713
10713
|
return (p = n.querySelector(`[pdc="${_}"]`)) == null ? void 0 : p.pdcValue;
|
|
10714
10714
|
}, a = M(this, H, Sr).call(this, n), s = i("start"), o = i("end"), d = i("category"), f = i("country"), v = i("city"), b = {
|
|
10715
10715
|
index: a,
|
|
10716
|
-
...s &&
|
|
10717
|
-
...o &&
|
|
10716
|
+
...s && ce(s) && { start: s },
|
|
10717
|
+
...o && ce(o) && { end: o },
|
|
10718
10718
|
...(d === "domestic" || d === "intl") && {
|
|
10719
10719
|
category: d
|
|
10720
10720
|
},
|
|
@@ -10729,7 +10729,7 @@ class ts extends HTMLElement {
|
|
|
10729
10729
|
});
|
|
10730
10730
|
ot(this, Mr, () => {
|
|
10731
10731
|
var i, a;
|
|
10732
|
-
this.removeAttribute("validate"), window.screen.width <
|
|
10732
|
+
this.removeAttribute("validate"), window.screen.width < le && c(this, H, be).forEach((s) => M(this, H, Ie).call(this, s, "close"));
|
|
10733
10733
|
const t = (a = (i = this.shadowRoot) == null ? void 0 : i.querySelector(
|
|
10734
10734
|
'input[name="expenses-category"]:checked'
|
|
10735
10735
|
)) == null ? void 0 : a.value, n = t === "mie" || t === "lodging" ? t : "both";
|
|
@@ -10755,10 +10755,10 @@ class ts extends HTMLElement {
|
|
|
10755
10755
|
const i = M(this, H, Er).call(this, t);
|
|
10756
10756
|
switch (n) {
|
|
10757
10757
|
case "city":
|
|
10758
|
-
window.screen.width <
|
|
10758
|
+
window.screen.width < le && (await fr(ea), M(this, H, Ie).call(this, i, "close"));
|
|
10759
10759
|
return;
|
|
10760
10760
|
case "country":
|
|
10761
|
-
M(this, H,
|
|
10761
|
+
M(this, H, ne).call(this, i).city.enable(!0);
|
|
10762
10762
|
return;
|
|
10763
10763
|
case "category":
|
|
10764
10764
|
M(this, H, hs).call(this, i);
|
|
@@ -10846,7 +10846,7 @@ es = function() {
|
|
|
10846
10846
|
`Failed to get row using row index of ${t} in Location view.`
|
|
10847
10847
|
);
|
|
10848
10848
|
return n;
|
|
10849
|
-
},
|
|
10849
|
+
}, ne = function(t) {
|
|
10850
10850
|
const n = t.querySelector('[pdc="start"]'), i = t.querySelector('[pdc="end"]'), a = t.querySelector('[pdc="category"]'), s = t.querySelector('[pdc="country"]'), o = t.querySelector('[pdc="city"]');
|
|
10851
10851
|
if (!(n && i && a && s && o))
|
|
10852
10852
|
throw new Error("Failed to render row custom elements.");
|
|
@@ -10916,7 +10916,7 @@ U0 = function(t = null) {
|
|
|
10916
10916
|
return;
|
|
10917
10917
|
}
|
|
10918
10918
|
const n = t.previousElementSibling, i = t.nextElementSibling;
|
|
10919
|
-
await M(this, H, Ie).call(this, t, "delete", i), n && (M(this, H,
|
|
10919
|
+
await M(this, H, Ie).call(this, t, "delete", i), n && (M(this, H, ne).call(this, n).start.restrictStartInput(), M(this, H, ne).call(this, n).end.restrictStartInput()), i && (M(this, H, ne).call(this, i).start.restrictStartInput(), M(this, H, ne).call(this, i).end.restrictStartInput()), c(this, H, Ae).setAttribute("update-state", "true");
|
|
10920
10920
|
}, rs = function(t) {
|
|
10921
10921
|
const { index: n, start: i, end: a, country: s, city: o } = t, d = M(this, H, Er).call(this, n), f = d.querySelector(
|
|
10922
10922
|
'[data-pdc="location-row-number"]'
|
|
@@ -10927,16 +10927,16 @@ U0 = function(t = null) {
|
|
|
10927
10927
|
);
|
|
10928
10928
|
if (!(f && v && b))
|
|
10929
10929
|
throw new Error("Failed to render row summary elements.");
|
|
10930
|
-
const _ = (n + 1).toString().padStart(2, "0"), p = i ? `${
|
|
10930
|
+
const _ = (n + 1).toString().padStart(2, "0"), p = i ? `${Re(i)}/${jn(i)}/${Cn(i)}` : " ", m = a ? ` to ${Re(a)}/${jn(a)}/${Cn(a)}` : " ", h = o && s ? `${o} (${s})` : " ";
|
|
10931
10931
|
f.textContent = _, v.textContent = p + m, b.textContent = h;
|
|
10932
10932
|
}, is = function(t, n) {
|
|
10933
|
-
Object.values(M(this, H,
|
|
10933
|
+
Object.values(M(this, H, ne).call(this, t)).forEach(
|
|
10934
10934
|
(i) => i.isEnabled && i.enableTabIndex(n)
|
|
10935
10935
|
);
|
|
10936
10936
|
}, as = function() {
|
|
10937
10937
|
var t;
|
|
10938
10938
|
c(this, H, be).forEach((n) => {
|
|
10939
|
-
Object.values(M(this, H,
|
|
10939
|
+
Object.values(M(this, H, ne).call(this, n)).forEach(
|
|
10940
10940
|
(i) => i.isEnabled && i.enableTabIndex(!1),
|
|
10941
10941
|
M(this, H, ve).call(this, n).deleteBtn.setAttribute(
|
|
10942
10942
|
"tabindex",
|
|
@@ -10955,7 +10955,7 @@ ss = function() {
|
|
|
10955
10955
|
var a;
|
|
10956
10956
|
if (!(!t || !c(this, rn) || t.classList.contains("toggling"))) {
|
|
10957
10957
|
if (!n) {
|
|
10958
|
-
const s = window.screen.width >=
|
|
10958
|
+
const s = window.screen.width >= le || t.offsetHeight === ze ? "open" : "close";
|
|
10959
10959
|
M(this, H, Ie).call(this, t, s);
|
|
10960
10960
|
return;
|
|
10961
10961
|
}
|
|
@@ -10963,7 +10963,7 @@ ss = function() {
|
|
|
10963
10963
|
"pdc-row-open",
|
|
10964
10964
|
"pdc-row-close",
|
|
10965
10965
|
"pdc-row-initial"
|
|
10966
|
-
), t.classList.add("toggling", `pdc-row-${n}`), (n === "initial" || n === "add") && (c(this, Dn).call(this, t), c(this, an).call(this, t)), await fr(0), M(this, H, as).call(this), (n === "open" || n === "initial" || n === "add") && (t.style.height = M(this, H, ve).call(this, t).details.offsetHeight + "px", M(this, H, ve).call(this, t).contents.style.height = M(this, H, ve).call(this, t).details.offsetHeight + "px", await M(this, H, j0).call(this, t, "open")), n === "close" && (await M(this, H, j0).call(this, t, "close"), t.style.height =
|
|
10966
|
+
), t.classList.add("toggling", `pdc-row-${n}`), (n === "initial" || n === "add") && (c(this, Dn).call(this, t), c(this, an).call(this, t)), await fr(0), M(this, H, as).call(this), (n === "open" || n === "initial" || n === "add") && (t.style.height = M(this, H, ve).call(this, t).details.offsetHeight + "px", M(this, H, ve).call(this, t).contents.style.height = M(this, H, ve).call(this, t).details.offsetHeight + "px", await M(this, H, j0).call(this, t, "open")), n === "close" && (await M(this, H, j0).call(this, t, "close"), t.style.height = ze + "px", M(this, H, ve).call(this, t).contents.style.height = ze + "px"), n === "delete" && (t.style.height = "0px", await M(this, H, os).call(this, t, i)), n !== "delete" && (t.classList.remove("ring-transparent"), t.classList.add("ring-neutral-200")), window.screen.width >= le ? c(this, H, be).forEach((s) => {
|
|
10967
10967
|
var o, d;
|
|
10968
10968
|
(d = (o = s.querySelector('[data-pdc="location-row-sidebar"]')) == null ? void 0 : o.querySelector('[data-pdc="delete-row"]')) == null || d.setAttribute("tabindex", "0");
|
|
10969
10969
|
}) : c(this, H, be).forEach((s) => {
|
|
@@ -10988,7 +10988,7 @@ ss = function() {
|
|
|
10988
10988
|
});
|
|
10989
10989
|
}
|
|
10990
10990
|
}, Fr = new WeakMap(), Dn = new WeakMap(), Ir = new WeakMap(), zr = new WeakMap(), Jn = new WeakMap(), ls = function() {
|
|
10991
|
-
const t = M(this, H,
|
|
10991
|
+
const t = M(this, H, ne).call(this, c(this, H, be)[0]).start.pdcValue, n = M(this, H, ne).call(this, c(this, H, be)[c(this, H, be).length - 1]).end.pdcValue;
|
|
10992
10992
|
if (t && n) {
|
|
10993
10993
|
const i = new Date(t), a = new Date(n), s = Math.abs(a.getTime() - i.getTime());
|
|
10994
10994
|
return !(Math.ceil(s / As) > Fs);
|
|
@@ -11023,18 +11023,18 @@ ss = function() {
|
|
|
11023
11023
|
attributeFilter: ["update-state", "validate", ...Li]
|
|
11024
11024
|
});
|
|
11025
11025
|
}, an = new WeakMap(), Rr = new WeakMap(), Mr = new WeakMap(), ds = function(t) {
|
|
11026
|
-
const { start: n, end: i, category: a, country: s, city: o } = M(this, H,
|
|
11026
|
+
const { start: n, end: i, category: a, country: s, city: o } = M(this, H, ne).call(this, t);
|
|
11027
11027
|
n.restrictStartInput(), i.restrictEndInput(), i.pdcValue || (a.enable(!1), s.enable(!1), o.enable(!1));
|
|
11028
11028
|
}, us = function(t) {
|
|
11029
|
-
const { start: n, end: i, category: a, country: s, city: o } = M(this, H,
|
|
11029
|
+
const { start: n, end: i, category: a, country: s, city: o } = M(this, H, ne).call(this, t);
|
|
11030
11030
|
s.enable(!1), o.enable(!1), n.restrictStartInput(), i.restrictEndInput(), a.enable(!0);
|
|
11031
11031
|
}, hs = function(t) {
|
|
11032
|
-
const { country: n, city: i } = M(this, H,
|
|
11032
|
+
const { country: n, city: i } = M(this, H, ne).call(this, t);
|
|
11033
11033
|
i.enable(!1), n.enable(!0);
|
|
11034
11034
|
};
|
|
11035
11035
|
customElements.define("pdc-expense-view", Ya);
|
|
11036
11036
|
customElements.define("pdc-location-view", ts);
|
|
11037
|
-
var Tn, sn, Mt, Ht, On, on, ln, Y0, Nr, Pr,
|
|
11037
|
+
var Tn, sn, Mt, Ht, On, on, ln, Y0, Nr, Pr, je, $r, fs, Br, Hr;
|
|
11038
11038
|
class nc {
|
|
11039
11039
|
constructor(e, t = null) {
|
|
11040
11040
|
ot(this, ln);
|
|
@@ -11051,7 +11051,7 @@ class nc {
|
|
|
11051
11051
|
ot(this, Nr, async (e) => {
|
|
11052
11052
|
c(this, Ht).renderEmtpy(), sl(e);
|
|
11053
11053
|
const t = e[e.length - 1], { index: n, start: i, end: a, category: s, country: o, city: d } = t;
|
|
11054
|
-
!d && o && (c(this, Mt).restrictRow(n, "country"), await c(this,
|
|
11054
|
+
!d && o && (c(this, Mt).restrictRow(n, "country"), await c(this, je).call(this, t)), !o && s && (c(this, Mt).restrictRow(n, "category"), await c(this, je).call(this, t)), !a && i && c(this, Mt).restrictRow(n, "end"), i && !a && c(this, Mt).restrictRow(n, "start");
|
|
11055
11055
|
});
|
|
11056
11056
|
ot(this, Pr, async (e, t, n) => {
|
|
11057
11057
|
const { index: i, start: a, end: s, category: o, country: d, city: f } = e;
|
|
@@ -11059,10 +11059,10 @@ class nc {
|
|
|
11059
11059
|
let v, b;
|
|
11060
11060
|
switch (!0) {
|
|
11061
11061
|
case (!n && !!d && !!o && !!s && !!a):
|
|
11062
|
-
c(this, Mt).restrictRow(i, "country"), await c(this,
|
|
11062
|
+
c(this, Mt).restrictRow(i, "country"), await c(this, je).call(this, e);
|
|
11063
11063
|
return;
|
|
11064
11064
|
case (!n && !!o && !!s && !!a):
|
|
11065
|
-
c(this, Mt).restrictRow(i, "category"), await c(this,
|
|
11065
|
+
c(this, Mt).restrictRow(i, "category"), await c(this, je).call(this, e);
|
|
11066
11066
|
return;
|
|
11067
11067
|
case (!n && !!s && !!a):
|
|
11068
11068
|
c(this, Mt).restrictRow(i, "end");
|
|
@@ -11077,11 +11077,11 @@ class nc {
|
|
|
11077
11077
|
c(this, Mt).restrictRow(i, t);
|
|
11078
11078
|
return;
|
|
11079
11079
|
default:
|
|
11080
|
-
c(this, Mt).restrictRow(i, t), (t === "category" || t === "country") && await c(this,
|
|
11080
|
+
c(this, Mt).restrictRow(i, t), (t === "category" || t === "country") && await c(this, je).call(this, e);
|
|
11081
11081
|
return;
|
|
11082
11082
|
}
|
|
11083
11083
|
});
|
|
11084
|
-
ot(this,
|
|
11084
|
+
ot(this, je, async (e) => {
|
|
11085
11085
|
const { index: t } = e, n = e.country ? "city" : "country", i = await ll(e);
|
|
11086
11086
|
c(this, Mt).createOptions(t, i, n);
|
|
11087
11087
|
});
|
|
@@ -11123,7 +11123,7 @@ Tn = new WeakMap(), sn = new WeakMap(), Mt = new WeakMap(), Ht = new WeakMap(),
|
|
|
11123
11123
|
}
|
|
11124
11124
|
});
|
|
11125
11125
|
c(this, on).dispatchEvent(e);
|
|
11126
|
-
}, Nr = new WeakMap(), Pr = new WeakMap(),
|
|
11126
|
+
}, Nr = new WeakMap(), Pr = new WeakMap(), je = new WeakMap(), $r = new WeakMap(), fs = async function(e) {
|
|
11127
11127
|
try {
|
|
11128
11128
|
c(this, Ht).render(c(this, On), c(this, sn).expense), c(this, Ht).renderLoadingSpinner(!0), c(this, Ht).controllerHandler(
|
|
11129
11129
|
c(this, Br),
|