@watergis/maplibre-gl-export
Version:
This module adds control which can export PDF and images.
1,158 lines • 517 kB
JavaScript
var Ml = Object.defineProperty;
var Dl = (n, e, r) => e in n ? Ml(n, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[e] = r;
var ie = (n, e, r) => Dl(n, typeof e != "symbol" ? e + "" : e, r);
import { Map as ql } from "maplibre-gl";
class Rl {
constructor(e) {
ie(this, "map");
ie(this, "width");
ie(this, "height");
ie(this, "svgCanvas");
ie(this, "xLine");
ie(this, "yLine");
ie(this, "color", "#535353");
this.map = e, this.mapResize = this.mapResize.bind(this);
}
create() {
this.updateValues(), this.map !== void 0 ? (this.map.on("resize", this.mapResize), this.createCanvas(this.map.getCanvasContainer())) : console.error("map object is null");
}
updateValues() {
var e, r;
this.width = (e = this.map) == null ? void 0 : e.getCanvas().clientWidth, this.height = (r = this.map) == null ? void 0 : r.getCanvas().clientHeight;
}
mapResize() {
this.updateValues(), this.updateCanvas();
}
updateCanvas() {
if (this.svgCanvas !== void 0 && this.yLine !== void 0 && this.xLine !== void 0 && this.width !== void 0 && this.height !== void 0) {
this.svgCanvas.setAttribute("width", `${this.width}px`), this.svgCanvas.setAttribute("height", `${this.height}px`);
const e = this.width / 2, r = this.height / 2;
this.yLine.setAttribute("x1", `${e}px`), this.yLine.setAttribute("y1", "0px"), this.yLine.setAttribute("x2", `${e}px`), this.yLine.setAttribute("y2", `${this.height}px`), this.xLine.setAttribute("x1", "0px"), this.xLine.setAttribute("y1", `${r}px`), this.xLine.setAttribute("x2", `${this.width}px`), this.xLine.setAttribute("y2", `${r}px`);
} else
console.error("element value is null");
}
createCanvas(e) {
if (this.width !== void 0 && this.height !== void 0) {
const r = document.createElementNS("http://www.w3.org/2000/svg", "svg");
r.style.position = "relative", r.setAttribute("width", `${this.width}px`), r.setAttribute("height", `${this.height}px`);
const i = this.width / 2, o = this.height / 2;
this.yLine = r.appendChild(
this.createLine(i, 0, i, this.height, this.color, "2px")
), this.xLine = r.appendChild(
this.createLine(0, o, this.width, o, this.color, "2px")
), e == null || e.appendChild(r), this.svgCanvas = r;
}
}
createLine(e, r, i, o, s, l) {
const h = document.createElementNS("http://www.w3.org/2000/svg", "line");
return h.setAttribute("x1", e), h.setAttribute("y1", r), h.setAttribute("x2", i), h.setAttribute("y2", o), h.setAttribute("stroke-dasharray", "5,5"), h.setAttribute("stroke", s), h.setAttribute("stroke-width", l), h;
}
destroy() {
this.xLine !== void 0 && (this.xLine.remove(), this.xLine = void 0), this.yLine !== void 0 && (this.yLine.remove(), this.yLine = void 0), this.svgCanvas !== void 0 && (this.svgCanvas.remove(), this.svgCanvas = void 0), this.map !== void 0 && (this.map.off("resize", this.mapResize), this.map = void 0);
}
}
const cu = {
72: 72,
96: 96,
200: 200,
300: 300,
400: 400
}, Fn = {
JPEG: "jpg",
PNG: "png",
PDF: "pdf",
SVG: "svg"
}, us = {
Landscape: "landscape",
Portrait: "portrait"
}, Fi = {
// A0, A1, B0, B1 are not working well.
// A0: [1189, 841],
// A1: [841, 594],
LETTER: [279, 216],
// 8.5x11 - works
//TABLOID: [432,279] // 11x17 - not working currently prints to 11.68x8.27 in landscape
A2: [594, 420],
A3: [420, 297],
A4: [297, 210],
A5: [210, 148],
A6: [148, 105],
// B0: [1414, 1000],
// B1: [1000, 707],
B2: [707, 500],
B3: [500, 353],
B4: [353, 250],
B5: [250, 176],
B6: [176, 125]
}, Di = {
// don't use inch unit. because page size setting is using mm unit.
in: "in",
mm: "mm"
};
class Tl {
constructor(e) {
ie(this, "map");
ie(this, "width");
ie(this, "height");
ie(this, "unit");
ie(this, "svgCanvas");
ie(this, "svgPath");
var l, h, f;
if (this.map = e, this.map === void 0)
return;
this.mapResize = this.mapResize.bind(this), this.map.on("resize", this.mapResize);
const r = (l = this.map) == null ? void 0 : l.getCanvas().clientWidth, i = (h = this.map) == null ? void 0 : h.getCanvas().clientHeight, o = document.createElementNS("http://www.w3.org/2000/svg", "svg");
o.style.position = "absolute", o.style.top = "0px", o.style.left = "0px", o.setAttribute("width", `${r}px`), o.setAttribute("height", `${i}px`);
const s = document.createElementNS("http://www.w3.org/2000/svg", "path");
s.setAttribute("style", "fill:#888888;stroke-width:0"), s.setAttribute("fill-opacity", "0.5"), o.append(s), (f = this.map) == null || f.getCanvasContainer().appendChild(o), this.svgCanvas = o, this.svgPath = s;
}
mapResize() {
this.generateCutOut();
}
updateArea(e, r) {
this.width = e, this.height = r, this.unit = Di.mm, this.generateCutOut();
}
generateCutOut() {
var g, b;
if (this.map === void 0 || this.svgCanvas === void 0 || this.svgPath === void 0)
return;
const e = this.toPixels(this.width), r = this.toPixels(this.height), i = (g = this.map) == null ? void 0 : g.getCanvas().clientWidth, o = (b = this.map) == null ? void 0 : b.getCanvas().clientHeight, s = i / 2 - e / 2, l = s + e, h = o / 2 - r / 2, f = h + r;
this.svgCanvas.setAttribute("width", `${i}px`), this.svgCanvas.setAttribute("height", `${o}px`), this.svgPath.setAttribute(
"d",
`M 0 0 L ${i} 0 L ${i} ${o} L 0 ${o} M ${s} ${h} L ${s} ${f} L ${l} ${f} L ${l} ${h}`
);
}
destroy() {
this.svgCanvas !== void 0 && (this.svgCanvas.remove(), this.svgCanvas = void 0), this.map !== void 0 && (this.map = void 0);
}
/**
* Convert mm/inch to pixel
* @param length mm/inch length
* @param conversionFactor DPI value. default is 96.
*/
toPixels(e, r = 96) {
return this.unit === Di.mm && (r /= 25.4), r * e;
}
}
const Fu = {
PageSize: "Page Size",
PageOrientation: "Page Orientation",
Format: "Format",
DPI: "DPI",
Generate: "Generate",
LanguageName: "English",
LanguageCode: "en"
}, zl = {
PageSize: "Taille de page",
PageOrientation: "Orientation de la page",
Format: "Format",
DPI: "DPI",
Generate: "Générer",
LanguageName: "Français",
LanguageCode: "fr"
}, Ul = {
PageSize: "Sivukoko",
PageOrientation: "Sivun suunta",
Format: "Muoto",
DPI: "DPI",
Generate: "Generoi",
LanguageName: "Suomalainen",
LanguageCode: "fi"
}, Hl = {
PageSize: "Papierformat",
PageOrientation: "Papierausrichtung",
Format: "Dateiformat",
DPI: "Druckauflösung",
Generate: "Erstellen",
LanguageName: "Deutsch",
LanguageCode: "de"
}, Wl = {
PageSize: "Sidstorlek",
PageOrientation: "Sidorientering",
Format: "Format",
DPI: "DPI",
Generate: "Generera",
LanguageName: "Svenska",
LanguageCode: "sv"
}, Gl = {
PageSize: "Tamaño de página",
PageOrientation: "Orientación de página",
Format: "Formato",
DPI: "DPI",
Generate: "Generar",
LanguageName: "Española",
LanguageCode: "es"
}, Vl = {
PageSize: "Mida",
PageOrientation: "Orientació",
Format: "Format",
DPI: "DPI",
Generate: "Genera",
LanguageName: "Catalan",
LanguageCode: "ca"
}, Jl = {
PageSize: "Kích thước trang",
PageOrientation: "Loại trang",
Format: "Định dạng",
DPI: "Mật độ điểm ảnh (DPI)",
Generate: "Tạo",
LanguageName: "Tiếng Việt",
LanguageCode: "vi"
}, Yl = {
PageSize: "Розмір сторінки",
PageOrientation: "Орієнтація сторінки",
Format: "Формат",
DPI: "DPI",
Generate: "Згенерувати",
LanguageName: "українська",
LanguageCode: "uk"
}, $l = {
PageSize: "页面大小",
PageOrientation: "页面方向",
Format: "格式",
DPI: "像素",
Generate: "导出",
LanguageName: "简体字",
LanguageCode: "zhHans"
}, Xl = {
PageSize: "頁面大小",
PageOrientation: "頁面方向",
Format: "格式",
DPI: "像素",
Generate: "導出",
LanguageName: "繁体字",
LanguageCode: "zhHant"
}, Kl = {
PageSize: "ページサイズ",
PageOrientation: "ページ方向",
Format: "フォーマット",
DPI: "DPI(解像度)",
Generate: "出力",
LanguageName: "日本語",
LanguageCode: "ja"
}, Zl = {
PageSize: "Tamanho da página",
PageOrientation: "Orientação da página",
Format: "Formato",
DPI: "DPI",
Generate: "Gerar",
LanguageName: "Português",
LanguageCode: "pt"
}, Ql = [
Fu,
zl,
Ul,
Hl,
Wl,
Gl,
Vl,
Jl,
Yl,
$l,
Xl,
Kl,
Zl
], rh = [
"en",
"fr",
"fi",
"de",
"sv",
"es",
"ca",
"vi",
"uk",
"zhHans",
"zhHant",
"ja",
"pt"
], tc = (n) => Ql.find((e) => e.LanguageCode === n) ?? Fu;
function de(n) {
"@babel/helpers - typeof";
return de = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
return typeof e;
} : function(e) {
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
}, de(n);
}
var er = Uint8Array, vr = Uint16Array, Oo = Int32Array, xs = new er([
0,
0,
0,
0,
0,
0,
0,
0,
1,
1,
1,
1,
2,
2,
2,
2,
3,
3,
3,
3,
4,
4,
4,
4,
5,
5,
5,
5,
0,
/* unused */
0,
0,
/* impossible */
0
]), Ls = new er([
0,
0,
0,
0,
1,
1,
2,
2,
3,
3,
4,
4,
5,
5,
6,
6,
7,
7,
8,
8,
9,
9,
10,
10,
11,
11,
12,
12,
13,
13,
/* unused */
0,
0
]), Lo = new er([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), ju = function(n, e) {
for (var r = new vr(31), i = 0; i < 31; ++i)
r[i] = e += 1 << n[i - 1];
for (var o = new Oo(r[30]), i = 1; i < 30; ++i)
for (var s = r[i]; s < r[i + 1]; ++s)
o[s] = s - r[i] << 5 | i;
return { b: r, r: o };
}, Ou = ju(xs, 2), Eu = Ou.b, Ao = Ou.r;
Eu[28] = 258, Ao[258] = 28;
var Bu = ju(Ls, 0), ec = Bu.b, hu = Bu.r, No = new vr(32768);
for (var xe = 0; xe < 32768; ++xe) {
var Cn = (xe & 43690) >> 1 | (xe & 21845) << 1;
Cn = (Cn & 52428) >> 2 | (Cn & 13107) << 2, Cn = (Cn & 61680) >> 4 | (Cn & 3855) << 4, No[xe] = ((Cn & 65280) >> 8 | (Cn & 255) << 8) >> 1;
}
var tn = function(n, e, r) {
for (var i = n.length, o = 0, s = new vr(e); o < i; ++o)
n[o] && ++s[n[o] - 1];
var l = new vr(e);
for (o = 1; o < e; ++o)
l[o] = l[o - 1] + s[o - 1] << 1;
var h;
if (r) {
h = new vr(1 << e);
var f = 15 - e;
for (o = 0; o < i; ++o)
if (n[o])
for (var g = o << 4 | n[o], b = e - n[o], y = l[n[o] - 1]++ << b, N = y | (1 << b) - 1; y <= N; ++y)
h[No[y] >> f] = g;
} else
for (h = new vr(i), o = 0; o < i; ++o)
n[o] && (h[o] = No[l[n[o] - 1]++] >> 15 - n[o]);
return h;
}, On = new er(288);
for (var xe = 0; xe < 144; ++xe)
On[xe] = 8;
for (var xe = 144; xe < 256; ++xe)
On[xe] = 9;
for (var xe = 256; xe < 280; ++xe)
On[xe] = 7;
for (var xe = 280; xe < 288; ++xe)
On[xe] = 8;
var va = new er(32);
for (var xe = 0; xe < 32; ++xe)
va[xe] = 5;
var rc = /* @__PURE__ */ tn(On, 9, 0), nc = /* @__PURE__ */ tn(On, 9, 1), ic = /* @__PURE__ */ tn(va, 5, 0), ac = /* @__PURE__ */ tn(va, 5, 1), fo = function(n) {
for (var e = n[0], r = 1; r < n.length; ++r)
n[r] > e && (e = n[r]);
return e;
}, Dr = function(n, e, r) {
var i = e / 8 | 0;
return (n[i] | n[i + 1] << 8) >> (e & 7) & r;
}, po = function(n, e) {
var r = e / 8 | 0;
return (n[r] | n[r + 1] << 8 | n[r + 2] << 16) >> (e & 7);
}, Eo = function(n) {
return (n + 7) / 8 | 0;
}, Mu = function(n, e, r) {
return (r == null || r > n.length) && (r = n.length), new er(n.subarray(e, r));
}, sc = [
"unexpected EOF",
"invalid block type",
"invalid length/literal",
"invalid distance",
"stream finished",
"no stream handler",
,
"no callback",
"invalid UTF-8 data",
"extra field too long",
"date not in range 1980-2099",
"filename too long",
"stream finishing",
"invalid zip data"
// determined by unknown compression method
], Rr = function(n, e, r) {
var i = new Error(e || sc[n]);
if (i.code = n, Error.captureStackTrace && Error.captureStackTrace(i, Rr), !r)
throw i;
return i;
}, oc = function(n, e, r, i) {
var o = n.length, s = 0;
if (!o || e.f && !e.l)
return r || new er(0);
var l = !r, h = l || e.i != 2, f = e.i;
l && (r = new er(o * 3));
var g = function(Lt) {
var Ct = r.length;
if (Lt > Ct) {
var _t = new er(Math.max(Ct * 2, Lt));
_t.set(r), r = _t;
}
}, b = e.f || 0, y = e.p || 0, N = e.b || 0, p = e.l, O = e.d, k = e.m, D = e.n, _ = o * 8;
do {
if (!p) {
b = Dr(n, y, 1);
var E = Dr(n, y + 1, 3);
if (y += 3, E)
if (E == 1)
p = nc, O = ac, k = 9, D = 5;
else if (E == 2) {
var wt = Dr(n, y, 31) + 257, tt = Dr(n, y + 10, 15) + 4, z = wt + Dr(n, y + 5, 31) + 1;
y += 14;
for (var nt = new er(z), dt = new er(19), P = 0; P < tt; ++P)
dt[Lo[P]] = Dr(n, y + P * 3, 7);
y += tt * 3;
for (var C = fo(dt), W = (1 << C) - 1, q = tn(dt, C, 1), P = 0; P < z; ) {
var ot = q[Dr(n, y, W)];
y += ot & 15;
var V = ot >> 4;
if (V < 16)
nt[P++] = V;
else {
var it = 0, ct = 0;
for (V == 16 ? (ct = 3 + Dr(n, y, 3), y += 2, it = nt[P - 1]) : V == 17 ? (ct = 3 + Dr(n, y, 7), y += 3) : V == 18 && (ct = 11 + Dr(n, y, 127), y += 7); ct--; )
nt[P++] = it;
}
}
var Z = nt.subarray(0, wt), ht = nt.subarray(wt);
k = fo(Z), D = fo(ht), p = tn(Z, k, 1), O = tn(ht, D, 1);
} else
Rr(1);
else {
var V = Eo(y) + 4, at = n[V - 4] | n[V - 3] << 8, lt = V + at;
if (lt > o) {
f && Rr(0);
break;
}
h && g(N + at), r.set(n.subarray(V, lt), N), e.b = N += at, e.p = y = lt * 8, e.f = b;
continue;
}
if (y > _) {
f && Rr(0);
break;
}
}
h && g(N + 131072);
for (var pt = (1 << k) - 1, It = (1 << D) - 1, L = y; ; L = y) {
var it = p[po(n, y) & pt], F = it >> 4;
if (y += it & 15, y > _) {
f && Rr(0);
break;
}
if (it || Rr(2), F < 256)
r[N++] = F;
else if (F == 256) {
L = y, p = null;
break;
} else {
var B = F - 254;
if (F > 264) {
var P = F - 257, T = xs[P];
B = Dr(n, y, (1 << T) - 1) + Eu[P], y += T;
}
var Y = O[po(n, y) & It], Q = Y >> 4;
Y || Rr(3), y += Y & 15;
var ht = ec[Q];
if (Q > 3) {
var T = Ls[Q];
ht += po(n, y) & (1 << T) - 1, y += T;
}
if (y > _) {
f && Rr(0);
break;
}
h && g(N + 131072);
var et = N + B;
if (N < ht) {
var rt = s - ht, At = Math.min(ht, et);
for (rt + N < 0 && Rr(3); N < At; ++N)
r[N] = i[rt + N];
}
for (; N < et; ++N)
r[N] = r[N - ht];
}
}
e.l = p, e.p = L, e.b = N, e.f = b, p && (b = 1, e.m = k, e.d = O, e.n = D);
} while (!b);
return N != r.length && l ? Mu(r, 0, N) : r.subarray(0, N);
}, pn = function(n, e, r) {
r <<= e & 7;
var i = e / 8 | 0;
n[i] |= r, n[i + 1] |= r >> 8;
}, pa = function(n, e, r) {
r <<= e & 7;
var i = e / 8 | 0;
n[i] |= r, n[i + 1] |= r >> 8, n[i + 2] |= r >> 16;
}, go = function(n, e) {
for (var r = [], i = 0; i < n.length; ++i)
n[i] && r.push({ s: i, f: n[i] });
var o = r.length, s = r.slice();
if (!o)
return { t: qu, l: 0 };
if (o == 1) {
var l = new er(r[0].s + 1);
return l[r[0].s] = 1, { t: l, l: 1 };
}
r.sort(function(lt, wt) {
return lt.f - wt.f;
}), r.push({ s: -1, f: 25001 });
var h = r[0], f = r[1], g = 0, b = 1, y = 2;
for (r[0] = { s: -1, f: h.f + f.f, l: h, r: f }; b != o - 1; )
h = r[r[g].f < r[y].f ? g++ : y++], f = r[g != b && r[g].f < r[y].f ? g++ : y++], r[b++] = { s: -1, f: h.f + f.f, l: h, r: f };
for (var N = s[0].s, i = 1; i < o; ++i)
s[i].s > N && (N = s[i].s);
var p = new vr(N + 1), O = So(r[b - 1], p, 0);
if (O > e) {
var i = 0, k = 0, D = O - e, _ = 1 << D;
for (s.sort(function(wt, tt) {
return p[tt.s] - p[wt.s] || wt.f - tt.f;
}); i < o; ++i) {
var E = s[i].s;
if (p[E] > e)
k += _ - (1 << O - p[E]), p[E] = e;
else
break;
}
for (k >>= D; k > 0; ) {
var V = s[i].s;
p[V] < e ? k -= 1 << e - p[V]++ - 1 : ++i;
}
for (; i >= 0 && k; --i) {
var at = s[i].s;
p[at] == e && (--p[at], ++k);
}
O = e;
}
return { t: new er(p), l: O };
}, So = function(n, e, r) {
return n.s == -1 ? Math.max(So(n.l, e, r + 1), So(n.r, e, r + 1)) : e[n.s] = r;
}, fu = function(n) {
for (var e = n.length; e && !n[--e]; )
;
for (var r = new vr(++e), i = 0, o = n[0], s = 1, l = function(f) {
r[i++] = f;
}, h = 1; h <= e; ++h)
if (n[h] == o && h != e)
++s;
else {
if (!o && s > 2) {
for (; s > 138; s -= 138)
l(32754);
s > 2 && (l(s > 10 ? s - 11 << 5 | 28690 : s - 3 << 5 | 12305), s = 0);
} else if (s > 3) {
for (l(o), --s; s > 6; s -= 6)
l(8304);
s > 2 && (l(s - 3 << 5 | 8208), s = 0);
}
for (; s--; )
l(o);
s = 1, o = n[h];
}
return { c: r.subarray(0, i), n: e };
}, ga = function(n, e) {
for (var r = 0, i = 0; i < e.length; ++i)
r += n[i] * e[i];
return r;
}, Du = function(n, e, r) {
var i = r.length, o = Eo(e + 2);
n[o] = i & 255, n[o + 1] = i >> 8, n[o + 2] = n[o] ^ 255, n[o + 3] = n[o + 1] ^ 255;
for (var s = 0; s < i; ++s)
n[o + s + 4] = r[s];
return (o + 4 + i) * 8;
}, du = function(n, e, r, i, o, s, l, h, f, g, b) {
pn(e, b++, r), ++o[256];
for (var y = go(o, 15), N = y.t, p = y.l, O = go(s, 15), k = O.t, D = O.l, _ = fu(N), E = _.c, V = _.n, at = fu(k), lt = at.c, wt = at.n, tt = new vr(19), z = 0; z < E.length; ++z)
++tt[E[z] & 31];
for (var z = 0; z < lt.length; ++z)
++tt[lt[z] & 31];
for (var nt = go(tt, 7), dt = nt.t, P = nt.l, C = 19; C > 4 && !dt[Lo[C - 1]]; --C)
;
var W = g + 5 << 3, q = ga(o, On) + ga(s, va) + l, ot = ga(o, N) + ga(s, k) + l + 14 + 3 * C + ga(tt, dt) + 2 * tt[16] + 3 * tt[17] + 7 * tt[18];
if (f >= 0 && W <= q && W <= ot)
return Du(e, b, n.subarray(f, f + g));
var it, ct, Z, ht;
if (pn(e, b, 1 + (ot < q)), b += 2, ot < q) {
it = tn(N, p, 0), ct = N, Z = tn(k, D, 0), ht = k;
var pt = tn(dt, P, 0);
pn(e, b, V - 257), pn(e, b + 5, wt - 1), pn(e, b + 10, C - 4), b += 14;
for (var z = 0; z < C; ++z)
pn(e, b + 3 * z, dt[Lo[z]]);
b += 3 * C;
for (var It = [E, lt], L = 0; L < 2; ++L)
for (var F = It[L], z = 0; z < F.length; ++z) {
var B = F[z] & 31;
pn(e, b, pt[B]), b += dt[B], B > 15 && (pn(e, b, F[z] >> 5 & 127), b += F[z] >> 12);
}
} else
it = rc, ct = On, Z = ic, ht = va;
for (var z = 0; z < h; ++z) {
var T = i[z];
if (T > 255) {
var B = T >> 18 & 31;
pa(e, b, it[B + 257]), b += ct[B + 257], B > 7 && (pn(e, b, T >> 23 & 31), b += xs[B]);
var Y = T & 31;
pa(e, b, Z[Y]), b += ht[Y], Y > 3 && (pa(e, b, T >> 5 & 8191), b += Ls[Y]);
} else
pa(e, b, it[T]), b += ct[T];
}
return pa(e, b, it[256]), b + ct[256];
}, uc = /* @__PURE__ */ new Oo([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]), qu = /* @__PURE__ */ new er(0), lc = function(n, e, r, i, o, s) {
var l = s.z || n.length, h = new er(i + l + 5 * (1 + Math.ceil(l / 7e3)) + o), f = h.subarray(i, h.length - o), g = s.l, b = (s.r || 0) & 7;
if (e) {
b && (f[0] = s.r >> 3);
for (var y = uc[e - 1], N = y >> 13, p = y & 8191, O = (1 << r) - 1, k = s.p || new vr(32768), D = s.h || new vr(O + 1), _ = Math.ceil(r / 3), E = 2 * _, V = function(Ut) {
return (n[Ut] ^ n[Ut + 1] << _ ^ n[Ut + 2] << E) & O;
}, at = new Oo(25e3), lt = new vr(288), wt = new vr(32), tt = 0, z = 0, nt = s.i || 0, dt = 0, P = s.w || 0, C = 0; nt + 2 < l; ++nt) {
var W = V(nt), q = nt & 32767, ot = D[W];
if (k[q] = ot, D[W] = q, P <= nt) {
var it = l - nt;
if ((tt > 7e3 || dt > 24576) && (it > 423 || !g)) {
b = du(n, f, 0, at, lt, wt, z, dt, C, nt - C, b), dt = tt = z = 0, C = nt;
for (var ct = 0; ct < 286; ++ct)
lt[ct] = 0;
for (var ct = 0; ct < 30; ++ct)
wt[ct] = 0;
}
var Z = 2, ht = 0, pt = p, It = q - ot & 32767;
if (it > 2 && W == V(nt - It))
for (var L = Math.min(N, it) - 1, F = Math.min(32767, nt), B = Math.min(258, it); It <= F && --pt && q != ot; ) {
if (n[nt + Z] == n[nt + Z - It]) {
for (var T = 0; T < B && n[nt + T] == n[nt + T - It]; ++T)
;
if (T > Z) {
if (Z = T, ht = It, T > L)
break;
for (var Y = Math.min(It, T - 2), Q = 0, ct = 0; ct < Y; ++ct) {
var et = nt - It + ct & 32767, rt = k[et], At = et - rt & 32767;
At > Q && (Q = At, ot = et);
}
}
}
q = ot, ot = k[q], It += q - ot & 32767;
}
if (ht) {
at[dt++] = 268435456 | Ao[Z] << 18 | hu[ht];
var Lt = Ao[Z] & 31, Ct = hu[ht] & 31;
z += xs[Lt] + Ls[Ct], ++lt[257 + Lt], ++wt[Ct], P = nt + Z, ++tt;
} else
at[dt++] = n[nt], ++lt[n[nt]];
}
}
for (nt = Math.max(nt, P); nt < l; ++nt)
at[dt++] = n[nt], ++lt[n[nt]];
b = du(n, f, g, at, lt, wt, z, dt, C, nt - C, b), g || (s.r = b & 7 | f[b / 8 | 0] << 3, b -= 7, s.h = D, s.p = k, s.i = nt, s.w = P);
} else {
for (var nt = s.w || 0; nt < l + g; nt += 65535) {
var _t = nt + 65535;
_t >= l && (f[b / 8 | 0] = g, _t = l), b = Du(f, b + 1, n.subarray(nt, _t));
}
s.i = l;
}
return Mu(h, 0, i + Eo(b) + o);
}, Ru = function() {
var n = 1, e = 0;
return {
p: function(r) {
for (var i = n, o = e, s = r.length | 0, l = 0; l != s; ) {
for (var h = Math.min(l + 2655, s); l < h; ++l)
o += i += r[l];
i = (i & 65535) + 15 * (i >> 16), o = (o & 65535) + 15 * (o >> 16);
}
n = i, e = o;
},
d: function() {
return n %= 65521, e %= 65521, (n & 255) << 24 | (n & 65280) << 8 | (e & 255) << 8 | e >> 8;
}
};
}, cc = function(n, e, r, i, o) {
if (!o && (o = { l: 1 }, e.dictionary)) {
var s = e.dictionary.subarray(-32768), l = new er(s.length + n.length);
l.set(s), l.set(n, s.length), n = l, o.w = s.length;
}
return lc(n, e.level == null ? 6 : e.level, e.mem == null ? o.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(n.length))) * 1.5) : 20 : 12 + e.mem, r, i, o);
}, Tu = function(n, e, r) {
for (; r; ++e)
n[e] = r, r >>>= 8;
}, hc = function(n, e) {
var r = e.level, i = r == 0 ? 0 : r < 6 ? 1 : r == 9 ? 3 : 2;
if (n[0] = 120, n[1] = i << 6 | (e.dictionary && 32), n[1] |= 31 - (n[0] << 8 | n[1]) % 31, e.dictionary) {
var o = Ru();
o.p(e.dictionary), Tu(n, 2, o.d());
}
}, fc = function(n, e) {
return ((n[0] & 15) != 8 || n[0] >> 4 > 7 || (n[0] << 8 | n[1]) % 31) && Rr(6, "invalid zlib data"), (n[1] >> 5 & 1) == 1 && Rr(6, "invalid zlib data: " + (n[1] & 32 ? "need" : "unexpected") + " dictionary"), (n[1] >> 3 & 4) + 2;
};
function _o(n, e) {
e || (e = {});
var r = Ru();
r.p(n);
var i = cc(n, e, e.dictionary ? 6 : 2, 4);
return hc(i, e), Tu(i, i.length - 4, r.d()), i;
}
function dc(n, e) {
return oc(n.subarray(fc(n), -4), { i: 2 }, e, e);
}
var pc = typeof TextDecoder < "u" && /* @__PURE__ */ new TextDecoder(), gc = 0;
try {
pc.decode(qu, { stream: !0 }), gc = 1;
} catch {
}
/** @license
*
* jsPDF - PDF Document creation from JavaScript
* Version 3.0.0 Built on 2025-02-19T09:26:58.791Z
* CommitID 00000000
*
* Copyright (c) 2010-2021 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF
* 2015-2021 yWorks GmbH, http://www.yworks.com
* 2015-2021 Lukas Holländer <lukas.hollaender@yworks.com>, https://github.com/HackbrettXXX
* 2016-2018 Aras Abbasi <aras.abbasi@gmail.com>
* 2010 Aaron Spike, https://github.com/acspike
* 2012 Willow Systems Corporation, https://github.com/willowsystems
* 2012 Pablo Hess, https://github.com/pablohess
* 2012 Florian Jenett, https://github.com/fjenett
* 2013 Warren Weckesser, https://github.com/warrenweckesser
* 2013 Youssef Beddad, https://github.com/lifof
* 2013 Lee Driscoll, https://github.com/lsdriscoll
* 2013 Stefan Slonevskiy, https://github.com/stefslon
* 2013 Jeremy Morel, https://github.com/jmorel
* 2013 Christoph Hartmann, https://github.com/chris-rock
* 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
* 2014 James Makes, https://github.com/dollaruw
* 2014 Diego Casorran, https://github.com/diegocr
* 2014 Steven Spungin, https://github.com/Flamenco
* 2014 Kenneth Glassey, https://github.com/Gavvers
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Contributor(s):
* siefkenj, ahwolf, rickygu, Midnith, saintclair, eaparango,
* kim3er, mfo, alnorth, Flamenco
*/
var Ht = /* @__PURE__ */ function() {
return typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : this;
}();
function mo() {
Ht.console && typeof Ht.console.log == "function" && Ht.console.log.apply(Ht.console, arguments);
}
var be = { log: mo, warn: function(n) {
Ht.console && (typeof Ht.console.warn == "function" ? Ht.console.warn.apply(Ht.console, arguments) : mo.call(null, arguments));
}, error: function(n) {
Ht.console && (typeof Ht.console.error == "function" ? Ht.console.error.apply(Ht.console, arguments) : mo(n));
} };
function vo(n, e, r) {
var i = new XMLHttpRequest();
i.open("GET", n), i.responseType = "blob", i.onload = function() {
Yn(i.response, e, r);
}, i.onerror = function() {
be.error("could not download file");
}, i.send();
}
function pu(n) {
var e = new XMLHttpRequest();
e.open("HEAD", n, !1);
try {
e.send();
} catch {
}
return e.status >= 200 && e.status <= 299;
}
function ls(n) {
try {
n.dispatchEvent(new MouseEvent("click"));
} catch {
var e = document.createEvent("MouseEvents");
e.initMouseEvent("click", !0, !0, window, 0, 0, 0, 80, 20, !1, !1, !1, !1, 0, null), n.dispatchEvent(e);
}
}
var ma, Po, Yn = Ht.saveAs || ((typeof window > "u" ? "undefined" : de(window)) !== "object" || window !== Ht ? function() {
} : typeof HTMLAnchorElement < "u" && "download" in HTMLAnchorElement.prototype ? function(n, e, r) {
var i = Ht.URL || Ht.webkitURL, o = document.createElement("a");
e = e || n.name || "download", o.download = e, o.rel = "noopener", typeof n == "string" ? (o.href = n, o.origin !== location.origin ? pu(o.href) ? vo(n, e, r) : ls(o, o.target = "_blank") : ls(o)) : (o.href = i.createObjectURL(n), setTimeout(function() {
i.revokeObjectURL(o.href);
}, 4e4), setTimeout(function() {
ls(o);
}, 0));
} : "msSaveOrOpenBlob" in navigator ? function(n, e, r) {
if (e = e || n.name || "download", typeof n == "string") if (pu(n)) vo(n, e, r);
else {
var i = document.createElement("a");
i.href = n, i.target = "_blank", setTimeout(function() {
ls(i);
});
}
else navigator.msSaveOrOpenBlob(function(o, s) {
return s === void 0 ? s = { autoBom: !1 } : de(s) !== "object" && (be.warn("Deprecated: Expected third argument to be a object"), s = { autoBom: !s }), s.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(o.type) ? new Blob(["\uFEFF", o], { type: o.type }) : o;
}(n, r), e);
} : function(n, e, r, i) {
if ((i = i || open("", "_blank")) && (i.document.title = i.document.body.innerText = "downloading..."), typeof n == "string") return vo(n, e, r);
var o = n.type === "application/octet-stream", s = /constructor/i.test(Ht.HTMLElement) || Ht.safari, l = /CriOS\/[\d]+/.test(navigator.userAgent);
if ((l || o && s) && (typeof FileReader > "u" ? "undefined" : de(FileReader)) === "object") {
var h = new FileReader();
h.onloadend = function() {
var b = h.result;
b = l ? b : b.replace(/^data:[^;]*;/, "data:attachment/file;"), i ? i.location.href = b : location = b, i = null;
}, h.readAsDataURL(n);
} else {
var f = Ht.URL || Ht.webkitURL, g = f.createObjectURL(n);
i ? i.location = g : location.href = g, i = null, setTimeout(function() {
f.revokeObjectURL(g);
}, 4e4);
}
});
/**
* A class to parse color values
* @author Stoyan Stefanov <sstoo@gmail.com>
* {@link http://www.phpied.com/rgb-color-parser-in-javascript/}
* @license Use it if you like it
*/
function zu(n) {
var e;
n = n || "", this.ok = !1, n.charAt(0) == "#" && (n = n.substr(1, 6)), n = { aliceblue: "f0f8ff", antiquewhite: "faebd7", aqua: "00ffff", aquamarine: "7fffd4", azure: "f0ffff", beige: "f5f5dc", bisque: "ffe4c4", black: "000000", blanchedalmond: "ffebcd", blue: "0000ff", blueviolet: "8a2be2", brown: "a52a2a", burlywood: "deb887", cadetblue: "5f9ea0", chartreuse: "7fff00", chocolate: "d2691e", coral: "ff7f50", cornflowerblue: "6495ed", cornsilk: "fff8dc", crimson: "dc143c", cyan: "00ffff", darkblue: "00008b", darkcyan: "008b8b", darkgoldenrod: "b8860b", darkgray: "a9a9a9", darkgreen: "006400", darkkhaki: "bdb76b", darkmagenta: "8b008b", darkolivegreen: "556b2f", darkorange: "ff8c00", darkorchid: "9932cc", darkred: "8b0000", darksalmon: "e9967a", darkseagreen: "8fbc8f", darkslateblue: "483d8b", darkslategray: "2f4f4f", darkturquoise: "00ced1", darkviolet: "9400d3", deeppink: "ff1493", deepskyblue: "00bfff", dimgray: "696969", dodgerblue: "1e90ff", feldspar: "d19275", firebrick: "b22222", floralwhite: "fffaf0", forestgreen: "228b22", fuchsia: "ff00ff", gainsboro: "dcdcdc", ghostwhite: "f8f8ff", gold: "ffd700", goldenrod: "daa520", gray: "808080", green: "008000", greenyellow: "adff2f", honeydew: "f0fff0", hotpink: "ff69b4", indianred: "cd5c5c", indigo: "4b0082", ivory: "fffff0", khaki: "f0e68c", lavender: "e6e6fa", lavenderblush: "fff0f5", lawngreen: "7cfc00", lemonchiffon: "fffacd", lightblue: "add8e6", lightcoral: "f08080", lightcyan: "e0ffff", lightgoldenrodyellow: "fafad2", lightgrey: "d3d3d3", lightgreen: "90ee90", lightpink: "ffb6c1", lightsalmon: "ffa07a", lightseagreen: "20b2aa", lightskyblue: "87cefa", lightslateblue: "8470ff", lightslategray: "778899", lightsteelblue: "b0c4de", lightyellow: "ffffe0", lime: "00ff00", limegreen: "32cd32", linen: "faf0e6", magenta: "ff00ff", maroon: "800000", mediumaquamarine: "66cdaa", mediumblue: "0000cd", mediumorchid: "ba55d3", mediumpurple: "9370d8", mediumseagreen: "3cb371", mediumslateblue: "7b68ee", mediumspringgreen: "00fa9a", mediumturquoise: "48d1cc", mediumvioletred: "c71585", midnightblue: "191970", mintcream: "f5fffa", mistyrose: "ffe4e1", moccasin: "ffe4b5", navajowhite: "ffdead", navy: "000080", oldlace: "fdf5e6", olive: "808000", olivedrab: "6b8e23", orange: "ffa500", orangered: "ff4500", orchid: "da70d6", palegoldenrod: "eee8aa", palegreen: "98fb98", paleturquoise: "afeeee", palevioletred: "d87093", papayawhip: "ffefd5", peachpuff: "ffdab9", peru: "cd853f", pink: "ffc0cb", plum: "dda0dd", powderblue: "b0e0e6", purple: "800080", red: "ff0000", rosybrown: "bc8f8f", royalblue: "4169e1", saddlebrown: "8b4513", salmon: "fa8072", sandybrown: "f4a460", seagreen: "2e8b57", seashell: "fff5ee", sienna: "a0522d", silver: "c0c0c0", skyblue: "87ceeb", slateblue: "6a5acd", slategray: "708090", snow: "fffafa", springgreen: "00ff7f", steelblue: "4682b4", tan: "d2b48c", teal: "008080", thistle: "d8bfd8", tomato: "ff6347", turquoise: "40e0d0", violet: "ee82ee", violetred: "d02090", wheat: "f5deb3", white: "ffffff", whitesmoke: "f5f5f5", yellow: "ffff00", yellowgreen: "9acd32" }[n = (n = n.replace(/ /g, "")).toLowerCase()] || n;
for (var r = [{ re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/, example: ["rgb(123, 234, 45)", "rgb(255,234,245)"], process: function(h) {
return [parseInt(h[1]), parseInt(h[2]), parseInt(h[3])];
} }, { re: /^(\w{2})(\w{2})(\w{2})$/, example: ["#00ff00", "336699"], process: function(h) {
return [parseInt(h[1], 16), parseInt(h[2], 16), parseInt(h[3], 16)];
} }, { re: /^(\w{1})(\w{1})(\w{1})$/, example: ["#fb0", "f0f"], process: function(h) {
return [parseInt(h[1] + h[1], 16), parseInt(h[2] + h[2], 16), parseInt(h[3] + h[3], 16)];
} }], i = 0; i < r.length; i++) {
var o = r[i].re, s = r[i].process, l = o.exec(n);
l && (e = s(l), this.r = e[0], this.g = e[1], this.b = e[2], this.ok = !0);
}
this.r = this.r < 0 || isNaN(this.r) ? 0 : this.r > 255 ? 255 : this.r, this.g = this.g < 0 || isNaN(this.g) ? 0 : this.g > 255 ? 255 : this.g, this.b = this.b < 0 || isNaN(this.b) ? 0 : this.b > 255 ? 255 : this.b, this.toRGB = function() {
return "rgb(" + this.r + ", " + this.g + ", " + this.b + ")";
}, this.toHex = function() {
var h = this.r.toString(16), f = this.g.toString(16), g = this.b.toString(16);
return h.length == 1 && (h = "0" + h), f.length == 1 && (f = "0" + f), g.length == 1 && (g = "0" + g), "#" + h + f + g;
};
}
/**
* @license
* Joseph Myers does not specify a particular license for his work.
*
* Author: Joseph Myers
* Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
*
* Modified by: Owen Leong
*/
function bo(n, e) {
var r = n[0], i = n[1], o = n[2], s = n[3];
r = Ke(r, i, o, s, e[0], 7, -680876936), s = Ke(s, r, i, o, e[1], 12, -389564586), o = Ke(o, s, r, i, e[2], 17, 606105819), i = Ke(i, o, s, r, e[3], 22, -1044525330), r = Ke(r, i, o, s, e[4], 7, -176418897), s = Ke(s, r, i, o, e[5], 12, 1200080426), o = Ke(o, s, r, i, e[6], 17, -1473231341), i = Ke(i, o, s, r, e[7], 22, -45705983), r = Ke(r, i, o, s, e[8], 7, 1770035416), s = Ke(s, r, i, o, e[9], 12, -1958414417), o = Ke(o, s, r, i, e[10], 17, -42063), i = Ke(i, o, s, r, e[11], 22, -1990404162), r = Ke(r, i, o, s, e[12], 7, 1804603682), s = Ke(s, r, i, o, e[13], 12, -40341101), o = Ke(o, s, r, i, e[14], 17, -1502002290), r = Ze(r, i = Ke(i, o, s, r, e[15], 22, 1236535329), o, s, e[1], 5, -165796510), s = Ze(s, r, i, o, e[6], 9, -1069501632), o = Ze(o, s, r, i, e[11], 14, 643717713), i = Ze(i, o, s, r, e[0], 20, -373897302), r = Ze(r, i, o, s, e[5], 5, -701558691), s = Ze(s, r, i, o, e[10], 9, 38016083), o = Ze(o, s, r, i, e[15], 14, -660478335), i = Ze(i, o, s, r, e[4], 20, -405537848), r = Ze(r, i, o, s, e[9], 5, 568446438), s = Ze(s, r, i, o, e[14], 9, -1019803690), o = Ze(o, s, r, i, e[3], 14, -187363961), i = Ze(i, o, s, r, e[8], 20, 1163531501), r = Ze(r, i, o, s, e[13], 5, -1444681467), s = Ze(s, r, i, o, e[2], 9, -51403784), o = Ze(o, s, r, i, e[7], 14, 1735328473), r = Qe(r, i = Ze(i, o, s, r, e[12], 20, -1926607734), o, s, e[5], 4, -378558), s = Qe(s, r, i, o, e[8], 11, -2022574463), o = Qe(o, s, r, i, e[11], 16, 1839030562), i = Qe(i, o, s, r, e[14], 23, -35309556), r = Qe(r, i, o, s, e[1], 4, -1530992060), s = Qe(s, r, i, o, e[4], 11, 1272893353), o = Qe(o, s, r, i, e[7], 16, -155497632), i = Qe(i, o, s, r, e[10], 23, -1094730640), r = Qe(r, i, o, s, e[13], 4, 681279174), s = Qe(s, r, i, o, e[0], 11, -358537222), o = Qe(o, s, r, i, e[3], 16, -722521979), i = Qe(i, o, s, r, e[6], 23, 76029189), r = Qe(r, i, o, s, e[9], 4, -640364487), s = Qe(s, r, i, o, e[12], 11, -421815835), o = Qe(o, s, r, i, e[15], 16, 530742520), r = tr(r, i = Qe(i, o, s, r, e[2], 23, -995338651), o, s, e[0], 6, -198630844), s = tr(s, r, i, o, e[7], 10, 1126891415), o = tr(o, s, r, i, e[14], 15, -1416354905), i = tr(i, o, s, r, e[5], 21, -57434055), r = tr(r, i, o, s, e[12], 6, 1700485571), s = tr(s, r, i, o, e[3], 10, -1894986606), o = tr(o, s, r, i, e[10], 15, -1051523), i = tr(i, o, s, r, e[1], 21, -2054922799), r = tr(r, i, o, s, e[8], 6, 1873313359), s = tr(s, r, i, o, e[15], 10, -30611744), o = tr(o, s, r, i, e[6], 15, -1560198380), i = tr(i, o, s, r, e[13], 21, 1309151649), r = tr(r, i, o, s, e[4], 6, -145523070), s = tr(s, r, i, o, e[11], 10, -1120210379), o = tr(o, s, r, i, e[2], 15, 718787259), i = tr(i, o, s, r, e[9], 21, -343485551), n[0] = jn(r, n[0]), n[1] = jn(i, n[1]), n[2] = jn(o, n[2]), n[3] = jn(s, n[3]);
}
function As(n, e, r, i, o, s) {
return e = jn(jn(e, n), jn(i, s)), jn(e << o | e >>> 32 - o, r);
}
function Ke(n, e, r, i, o, s, l) {
return As(e & r | ~e & i, n, e, o, s, l);
}
function Ze(n, e, r, i, o, s, l) {
return As(e & i | r & ~i, n, e, o, s, l);
}
function Qe(n, e, r, i, o, s, l) {
return As(e ^ r ^ i, n, e, o, s, l);
}
function tr(n, e, r, i, o, s, l) {
return As(r ^ (e | ~i), n, e, o, s, l);
}
function Uu(n) {
var e, r = n.length, i = [1732584193, -271733879, -1732584194, 271733878];
for (e = 64; e <= n.length; e += 64) bo(i, mc(n.substring(e - 64, e)));
n = n.substring(e - 64);
var o = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
for (e = 0; e < n.length; e++) o[e >> 2] |= n.charCodeAt(e) << (e % 4 << 3);
if (o[e >> 2] |= 128 << (e % 4 << 3), e > 55) for (bo(i, o), e = 0; e < 16; e++) o[e] = 0;
return o[14] = 8 * r, bo(i, o), i;
}
function mc(n) {
var e, r = [];
for (e = 0; e < 64; e += 4) r[e >> 2] = n.charCodeAt(e) + (n.charCodeAt(e + 1) << 8) + (n.charCodeAt(e + 2) << 16) + (n.charCodeAt(e + 3) << 24);
return r;
}
ma = Ht.atob.bind(Ht), Po = Ht.btoa.bind(Ht);
var gu = "0123456789abcdef".split("");
function vc(n) {
for (var e = "", r = 0; r < 4; r++) e += gu[n >> 8 * r + 4 & 15] + gu[n >> 8 * r & 15];
return e;
}
function bc(n) {
return String.fromCharCode((255 & n) >> 0, (65280 & n) >> 8, (16711680 & n) >> 16, (4278190080 & n) >> 24);
}
function ko(n) {
return Uu(n).map(bc).join("");
}
var yc = function(n) {
for (var e = 0; e < n.length; e++) n[e] = vc(n[e]);
return n.join("");
}(Uu("hello")) != "5d41402abc4b2a76b9719d911017c592";
function jn(n, e) {
if (yc) {
var r = (65535 & n) + (65535 & e);
return (n >> 16) + (e >> 16) + (r >> 16) << 16 | 65535 & r;
}
return n + e & 4294967295;
}
/**
* @license
* FPDF is released under a permissive license: there is no usage restriction.
* You may embed it freely in your application (commercial or not), with or
* without modifications.
*
* Reference: http://www.fpdf.org/en/script/script37.php
*/
function Co(n, e) {
var r, i, o, s;
if (n !== r) {
for (var l = (o = n, s = 1 + (256 / n.length >> 0), new Array(s + 1).join(o)), h = [], f = 0; f < 256; f++) h[f] = f;
var g = 0;
for (f = 0; f < 256; f++) {
var b = h[f];
g = (g + b + l.charCodeAt(f)) % 256, h[f] = h[g], h[g] = b;
}
r = n, i = h;
} else h = i;
var y = e.length, N = 0, p = 0, O = "";
for (f = 0; f < y; f++) p = (p + (b = h[N = (N + 1) % 256])) % 256, h[N] = h[p], h[p] = b, l = h[(h[N] + h[p]) % 256], O += String.fromCharCode(e.charCodeAt(f) ^ l);
return O;
}
/**
* @license
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
* Author: Owen Leong (@owenl131)
* Date: 15 Oct 2020
* References:
* https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
* https://github.com/foliojs/pdfkit/blob/master/lib/security.js
* http://www.fpdf.org/en/script/script37.php
*/
var mu = { print: 4, modify: 8, copy: 16, "annot-forms": 32 };
function Ci(n, e, r, i) {
this.v = 1, this.r = 2;
var o = 192;
n.forEach(function(h) {
if (mu.perm !== void 0) throw new Error("Invalid permission: " + h);
o += mu[h];
}), this.padding = "(¿N^NuAd\0NVÿú\b..\0¶Ðh>/\f©þdSiz";
var s = (e + this.padding).substr(0, 32), l = (r + this.padding).substr(0, 32);
this.O = this.processOwnerPassword(s, l), this.P = -(1 + (255 ^ o)), this.encryptionKey = ko(s + this.O + this.lsbFirstWord(this.P) + this.hexToBytes(i)).substr(0, 5), this.U = Co(this.encryptionKey, this.padding);
}
function Ii(n) {
if (/[^\u0000-\u00ff]/.test(n)) throw new Error("Invalid PDF Name Object: " + n + ", Only accept ASCII characters.");
for (var e = "", r = n.length, i = 0; i < r; i++) {
var o = n.charCodeAt(i);
o < 33 || o === 35 || o === 37 || o === 40 || o === 41 || o === 47 || o === 60 || o === 62 || o === 91 || o === 93 || o === 123 || o === 125 || o > 126 ? e += "#" + ("0" + o.toString(16)).slice(-2) : e += n[i];
}
return e;
}
function vu(n) {
if (de(n) !== "object") throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");
var e = {};
this.subscribe = function(r, i, o) {
if (o = o || !1, typeof r != "string" || typeof i != "function" || typeof o != "boolean") throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");
e.hasOwnProperty(r) || (e[r] = {});
var s = Math.random().toString(35);
return e[r][s] = [i, !!o], s;
}, this.unsubscribe = function(r) {
for (var i in e) if (e[i][r]) return delete e[i][r], Object.keys(e[i]).length === 0 && delete e[i], !0;
return !1;
}, this.publish = function(r) {
if (e.hasOwnProperty(r)) {
var i = Array.prototype.slice.call(arguments, 1), o = [];
for (var s in e[r]) {
var l = e[r][s];
try {
l[0].apply(n, i);
} catch (h) {
Ht.console && be.error("jsPDF PubSub Error", h.message, h);
}
l[1] && o.push(s);
}
o.length && o.forEach(this.unsubscribe);
}
}, this.getTopics = function() {
return e;
};
}
function vs(n) {
if (!(this instanceof vs)) return new vs(n);
var e = "opacity,stroke-opacity".split(",");
for (var r in n) n.hasOwnProperty(r) && e.indexOf(r) >= 0 && (this[r] = n[r]);
this.id = "", this.objectNumber = -1;
}
function Hu(n, e) {
this.gState = n, this.matrix = e, this.id = "", this.objectNumber = -1;
}
function $n(n, e, r, i, o) {
if (!(this instanceof $n)) return new $n(n, e, r, i, o);
this.type = n === "axial" ? 2 : 3, this.coords = e, this.colors = r, Hu.call(this, i, o);
}
function ji(n, e, r, i, o) {
if (!(this instanceof ji)) return new ji(n, e, r, i, o);
this.boundingBox = n, this.xStep = e, this.yStep = r, this.stream = "", this.cloneIndex = 0, Hu.call(this, i, o);
}
function zt(n) {
var e, r = typeof arguments[0] == "string" ? arguments[0] : "p", i = arguments[1], o = arguments[2], s = arguments[3], l = [], h = 1, f = 16, g = "S", b = null;
de(n = n || {}) === "object" && (r = n.orientation, i = n.unit || i, o = n.format || o, s = n.compress || n.compressPdf || s, (b = n.encryption || null) !== null && (b.userPassword = b.userPassword || "", b.ownerPassword = b.ownerPassword || "", b.userPermissions = b.userPermissions || []), h = typeof n.userUnit == "number" ? Math.abs(n.userUnit) : 1, n.precision !== void 0 && (e = n.precision), n.floatPrecision !== void 0 && (f = n.floatPrecision), g = n.defaultPathOperation || "S"), l = n.filters || (s === !0 ? ["FlateEncode"] : l), i = i || "mm", r = ("" + (r || "P")).toLowerCase();
var y = n.putOnlyUsedFonts || !1, N = {}, p = { internal: {}, __private__: {} };
p.__private__.PubSub = vu;
var O = "1.3", k = p.__private__.getPdfVersion = function() {
return O;
};
p.__private__.setPdfVersion = function(u) {
O = u;
};
var D = { a0: [2383.94, 3370.39], a1: [1683.78, 2383.94], a2: [1190.55, 1683.78], a3: [841.89, 1190.55], a4: [595.28, 841.89], a5: [419.53, 595.28], a6: [297.64, 419.53], a7: [209.76, 297.64], a8: [147.4, 209.76], a9: [104.88, 147.4], a10: [73.7, 104.88], b0: [2834.65, 4008.19], b1: [2004.09, 2834.65], b2: [1417.32, 2004.09], b3: [1000.63, 1417.32], b4: [708.66, 1000.63], b5: [498.9, 708.66], b6: [354.33, 498.9], b7: [249.45, 354.33], b8: [175.75, 249.45], b9: [124.72, 175.75], b10: [87.87, 124.72], c0: [2599.37, 3676.54], c1: [1836.85, 2599.37], c2: [1298.27, 1836.85], c3: [918.43, 1298.27], c4: [649.13, 918.43], c5: [459.21, 649.13], c6: [323.15, 459.21], c7: [229.61, 323.15], c8: [161.57, 229.61], c9: [113.39, 161.57], c10: [79.37, 113.39], dl: [311.81, 623.62], letter: [612, 792], "government-letter": [576, 756], legal: [612, 1008], "junior-legal": [576, 360], ledger: [1224, 792], tabloid: [792, 1224], "credit-card": [153, 243] };
p.__private__.getPageFormats = function() {
return D;
};
var _ = p.__private__.getPageFormat = function(u) {
return D[u];
};
o = o || "a4";
var E = { COMPAT: "compat", ADVANCED: "advanced" }, V = E.COMPAT;
function at() {
this.saveGraphicsState(), M(new Tt(jt, 0, 0, -jt, 0, vn() * jt).toString() + " cm"), this.setFontSize(this.getFontSize() / jt), g = "n", V = E.ADVANCED;
}
function lt() {
this.restoreGraphicsState(), g = "S", V = E.COMPAT;
}
var wt = p.__private__.combineFontStyleAndFontWeight = function(u, v) {
if (u == "bold" && v == "normal" || u == "bold" && v == 400 || u == "normal" && v == "italic" || u == "bold" && v == "italic") throw new Error("Invalid Combination of fontweight and fontstyle");
return v && (u = v == 400 || v === "normal" ? u === "italic" ? "italic" : "normal" : v != 700 && v !== "bold" || u !== "normal" ? (v == 700 ? "bold" : v) + "" + u : "bold"), u;
};
p.advancedAPI = function(u) {
var v = V === E.COMPAT;
return v && at.call(this), typeof u != "function" || (u(this), v && lt.call(this)), this;
}, p.compatAPI = function(u) {
var v = V === E.ADVANCED;
return v && lt.call(this), typeof u != "function" || (u(this), v && at.call(this)), this;
}, p.isAdvancedAPI = function() {
return V === E.ADVANCED;
};
var tt, z = function(u) {
if (V !== E.ADVANCED) throw new Error(u + " is only available in 'advanced' API mode. You need to call advancedAPI() first.");
}, nt = p.roundToPrecision = p.__private__.roundToPrecision = function(u, v) {
var j = e || v;
if (isNaN(u) || isNaN(j)) throw new Error("Invalid argument passed to jsPDF.roundToPrecision");
return u.toFixed(j).replace(/0+$/, "");
};
tt = p.hpf = p.__private__.hpf = typeof f == "number" ? function(u) {
if (isNaN(u)) throw new Error("Invalid argument passed to jsPDF.hpf");
return nt(u, f);
} : f === "smart" ? function(u) {
if (isNaN(u)) throw new Error("Invalid argument passed to jsPDF.hpf");
return nt(u, u > -1 && u < 1 ? 16 : 5);
} : function(u) {
if (isNaN(u)) throw new Error("Invalid argument passed to jsPDF.hpf");
return nt(u, 16);
};
var dt = p.f2 = p.__private__.f2 = function(u) {
if (isNaN(u)) throw new Error("Invalid argument passed to jsPDF.f2");
return nt(u, 2);
}, P = p.__private__.f3 = function(u) {
if (isNaN(u)) throw new Error("Invalid argument passed to jsPDF.f3");
return nt(u, 3);
}, C = p.scale = p.__private__.scale = function(u) {
if (isNaN(u)) throw new Error("Invalid argument passed to jsPDF.scale");
return V === E.COMPAT ? u * jt : V === E.ADVANCED ? u : void 0;
}, W = function(u) {
return V === E.COMPAT ? vn() - u : V === E.ADVANCED ? u : void 0;
}, q = function(u) {
return C(W(u));
};
p.__private__.setPrecision = p.setPrecision = function(u) {
typeof parseInt(u, 10) == "number" && (e = parseInt(u, 10));
};
var ot, it = "00000000000000000000000000000000", ct = p.__private__.getFileId = function() {
return it;
}, Z = p.__private__.setFileId = function(u) {
return it = u !== void 0 && /^[a-fA-F0-9]{32}$/.test(u) ? u.toUpperCase() : it.split("").map(function() {
return "ABCDEF0123456789".charAt(Math.floor(16 * Math.random()));
}).join(""), b !== null && ($e = new Ci(b.userPermissions, b.userPassword, b.ownerPassword, it)), it;
};
p.setFileId = function(u) {
return Z(u), this;
}, p.getFileId = function() {
return ct();
};
var ht = p.__private__.convertDateToPDFDate = function(u) {
var v = u.getTimezoneOffset(), j = v < 0 ? "+" : "-", R = Math.floor(Math.abs(v / 60)), $ = Math.abs(v % 60), ut = [j, B(R), "'", B($), "'"].join("");
return ["D:", u.getFullYear(), B(u.getMonth() + 1), B(u.getDate()), B(u.getHours()), B(u.getMinutes()), B(u.getSeconds()), ut].join("");
}, pt = p.__private__.convertPDFDateToDate = function(u) {
var v = parseInt(u.substr(2, 4), 10), j = parseInt(u.substr(6, 2), 10) - 1, R = parseInt(u.substr(8, 2), 10), $ = parseInt(u.substr(10, 2), 10), ut = parseInt(u.substr(12, 2), 10), yt = parseInt(u.substr(14, 2), 10);
return new Date(v, j, R, $, ut, yt, 0);
}, It = p.__private__.setCreationDate = function(u) {
var v;
if (u === void 0 && (u = /* @__PURE__ */ new Date()), u instanceof Date) v = ht(u);
else {
if (!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(u)) throw new Error("Invalid argument passed to jsPDF.setCreationDate");
v = u;
}
return ot = v;
}, L = p.__private__.getCreationDate = function(u) {
var v = ot;
return u === "jsDate" && (v = pt(ot)