UNPKG

@easypdf/react

Version:

Free and open source React library for generating beautiful PDFs from React components

1,361 lines (1,359 loc) 802 kB
var T1 = Object.defineProperty; var P1 = (e, A, t) => A in e ? T1(e, A, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[A] = t; var Gu = (e, A, t) => P1(e, typeof A != "symbol" ? A + "" : A, t); import rl, { createContext as O1, useContext as M1, useRef as k1, useState as Rs, useCallback as Ks } from "react"; import R1 from "react-dom"; const nl = { // Page Configuration pageSize: "A4", margins: { top: 30, right: 20, bottom: 20, left: 20 }, // Metadata metadata: { title: "Generated Document", author: "EasyPdf", creator: "EasyPdf Generator" }, // Watermark watermark: { text: "Easy PDF Watermark" }, // Export Options scale: 2, footer: { text: "Page {pageNumber} of {totalPages}", marginBottom: 10, marginLeft: 20, marginRight: 20, align: "center" }, header: { text: "Easy PDF Header", marginTop: 10, marginLeft: 20, marginRight: 20, align: "center" }, container: {}, // Enhanced Styling styles: { backgroundColor: "#ffffff", defaultFontSize: 12, defaultFontFamily: "Arial, sans-serif", defaultTextColor: "#333333", customCSS: "" } }, Zn = class Zn { constructor() { Gu(this, "config"); this.config = nl; } static initialize() { return Zn.instance || (Zn.instance = new Zn()), Zn.instance; } getConfig() { return this.config; } setConfig(A) { this.config = { ...this.config, ...A }; } }; Gu(Zn, "instance", null); let Gl = Zn; var bv = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function K1(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } var js = { exports: {} }, Ea = {}; /** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var Vl; function j1() { if (Vl) return Ea; Vl = 1; var e = rl, A = Symbol.for("react.element"), t = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, n = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 }; function s(o, u, h) { var B, g = {}, w = null, d = null; h !== void 0 && (w = "" + h), u.key !== void 0 && (w = "" + u.key), u.ref !== void 0 && (d = u.ref); for (B in u) r.call(u, B) && !i.hasOwnProperty(B) && (g[B] = u[B]); if (o && o.defaultProps) for (B in u = o.defaultProps, u) g[B] === void 0 && (g[B] = u[B]); return { $$typeof: A, type: o, key: w, ref: d, props: g, _owner: n.current }; } return Ea.Fragment = t, Ea.jsx = s, Ea.jsxs = s, Ea; } var La = {}; /** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var ql; function G1() { return ql || (ql = 1, process.env.NODE_ENV !== "production" && function() { var e = rl, A = Symbol.for("react.element"), t = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), o = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), h = Symbol.for("react.suspense"), B = Symbol.for("react.suspense_list"), g = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), d = Symbol.for("react.offscreen"), E = Symbol.iterator, m = "@@iterator"; function x(j) { if (j === null || typeof j != "object") return null; var QA = E && j[E] || j[m]; return typeof QA == "function" ? QA : null; } var v = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; function Q(j) { { for (var QA = arguments.length, IA = new Array(QA > 1 ? QA - 1 : 0), KA = 1; KA < QA; KA++) IA[KA - 1] = arguments[KA]; T("error", j, IA); } } function T(j, QA, IA) { { var KA = v.ReactDebugCurrentFrame, se = KA.getStackAddendum(); se !== "" && (QA += "%s", IA = IA.concat([se])); var le = IA.map(function(YA) { return String(YA); }); le.unshift("Warning: " + QA), Function.prototype.apply.call(console[j], console, le); } } var q = !1, V = !1, AA = !1, J = !1, O = !1, X; X = Symbol.for("react.module.reference"); function fA(j) { return !!(typeof j == "string" || typeof j == "function" || j === r || j === i || O || j === n || j === h || j === B || J || j === d || q || V || AA || typeof j == "object" && j !== null && (j.$$typeof === w || j.$$typeof === g || j.$$typeof === s || j.$$typeof === o || j.$$typeof === u || // This needs to include all possible module reference object // types supported by any Flight configuration anywhere since // we don't know which Flight build this will end up being used // with. j.$$typeof === X || j.getModuleId !== void 0)); } function S(j, QA, IA) { var KA = j.displayName; if (KA) return KA; var se = QA.displayName || QA.name || ""; return se !== "" ? IA + "(" + se + ")" : IA; } function H(j) { return j.displayName || "Context"; } function R(j) { if (j == null) return null; if (typeof j.tag == "number" && Q("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof j == "function") return j.displayName || j.name || null; if (typeof j == "string") return j; switch (j) { case r: return "Fragment"; case t: return "Portal"; case i: return "Profiler"; case n: return "StrictMode"; case h: return "Suspense"; case B: return "SuspenseList"; } if (typeof j == "object") switch (j.$$typeof) { case o: var QA = j; return H(QA) + ".Consumer"; case s: var IA = j; return H(IA._context) + ".Provider"; case u: return S(j, j.render, "ForwardRef"); case g: var KA = j.displayName || null; return KA !== null ? KA : R(j.type) || "Memo"; case w: { var se = j, le = se._payload, YA = se._init; try { return R(YA(le)); } catch { return null; } } } return null; } var k = Object.assign, iA = 0, Z, uA, eA, cA, hA, EA, b; function _() { } _.__reactDisabledLog = !0; function P() { { if (iA === 0) { Z = console.log, uA = console.info, eA = console.warn, cA = console.error, hA = console.group, EA = console.groupCollapsed, b = console.groupEnd; var j = { configurable: !0, enumerable: !0, value: _, writable: !0 }; Object.defineProperties(console, { info: j, log: j, warn: j, error: j, group: j, groupCollapsed: j, groupEnd: j }); } iA++; } } function K() { { if (iA--, iA === 0) { var j = { configurable: !0, enumerable: !0, writable: !0 }; Object.defineProperties(console, { log: k({}, j, { value: Z }), info: k({}, j, { value: uA }), warn: k({}, j, { value: eA }), error: k({}, j, { value: cA }), group: k({}, j, { value: hA }), groupCollapsed: k({}, j, { value: EA }), groupEnd: k({}, j, { value: b }) }); } iA < 0 && Q("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } } var Y = v.ReactCurrentDispatcher, rA; function oA(j, QA, IA) { { if (rA === void 0) try { throw Error(); } catch (se) { var KA = se.stack.trim().match(/\n( *(at )?)/); rA = KA && KA[1] || ""; } return ` ` + rA + j; } } var lA = !1, mA; { var CA = typeof WeakMap == "function" ? WeakMap : Map; mA = new CA(); } function UA(j, QA) { if (!j || lA) return ""; { var IA = mA.get(j); if (IA !== void 0) return IA; } var KA; lA = !0; var se = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var le; le = Y.current, Y.current = null, P(); try { if (QA) { var YA = function() { throw Error(); }; if (Object.defineProperty(YA.prototype, "props", { set: function() { throw Error(); } }), typeof Reflect == "object" && Reflect.construct) { try { Reflect.construct(YA, []); } catch (ht) { KA = ht; } Reflect.construct(j, [], YA); } else { try { YA.call(); } catch (ht) { KA = ht; } j.call(YA.prototype); } } else { try { throw Error(); } catch (ht) { KA = ht; } j(); } } catch (ht) { if (ht && KA && typeof ht.stack == "string") { for (var ZA = ht.stack.split(` `), Ke = KA.stack.split(` `), Ie = ZA.length - 1, He = Ke.length - 1; Ie >= 1 && He >= 0 && ZA[Ie] !== Ke[He]; ) He--; for (; Ie >= 1 && He >= 0; Ie--, He--) if (ZA[Ie] !== Ke[He]) { if (Ie !== 1 || He !== 1) do if (Ie--, He--, He < 0 || ZA[Ie] !== Ke[He]) { var ut = ` ` + ZA[Ie].replace(" at new ", " at "); return j.displayName && ut.includes("<anonymous>") && (ut = ut.replace("<anonymous>", j.displayName)), typeof j == "function" && mA.set(j, ut), ut; } while (Ie >= 1 && He >= 0); break; } } } finally { lA = !1, Y.current = le, K(), Error.prepareStackTrace = se; } var $t = j ? j.displayName || j.name : "", or = $t ? oA($t) : ""; return typeof j == "function" && mA.set(j, or), or; } function LA(j, QA, IA) { return UA(j, !1); } function VA(j) { var QA = j.prototype; return !!(QA && QA.isReactComponent); } function gA(j, QA, IA) { if (j == null) return ""; if (typeof j == "function") return UA(j, VA(j)); if (typeof j == "string") return oA(j); switch (j) { case h: return oA("Suspense"); case B: return oA("SuspenseList"); } if (typeof j == "object") switch (j.$$typeof) { case u: return LA(j.render); case g: return gA(j.type, QA, IA); case w: { var KA = j, se = KA._payload, le = KA._init; try { return gA(le(se), QA, IA); } catch { } } } return ""; } var M = Object.prototype.hasOwnProperty, $A = {}, RA = v.ReactDebugCurrentFrame; function bA(j) { if (j) { var QA = j._owner, IA = gA(j.type, j._source, QA ? QA.type : null); RA.setExtraStackFrame(IA); } else RA.setExtraStackFrame(null); } function xA(j, QA, IA, KA, se) { { var le = Function.call.bind(M); for (var YA in j) if (le(j, YA)) { var ZA = void 0; try { if (typeof j[YA] != "function") { var Ke = Error((KA || "React class") + ": " + IA + " type `" + YA + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof j[YA] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); throw Ke.name = "Invariant Violation", Ke; } ZA = j[YA](QA, YA, KA, IA, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); } catch (Ie) { ZA = Ie; } ZA && !(ZA instanceof Error) && (bA(se), Q("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", KA || "React class", IA, YA, typeof ZA), bA(null)), ZA instanceof Error && !(ZA.message in $A) && ($A[ZA.message] = !0, bA(se), Q("Failed %s type: %s", IA, ZA.message), bA(null)); } } } var _A = Array.isArray; function SA(j) { return _A(j); } function jA(j) { { var QA = typeof Symbol == "function" && Symbol.toStringTag, IA = QA && j[Symbol.toStringTag] || j.constructor.name || "Object"; return IA; } } function Ae(j) { try { return re(j), !1; } catch { return !0; } } function re(j) { return "" + j; } function ue(j) { if (Ae(j)) return Q("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", jA(j)), re(j); } var fe = v.ReactCurrentOwner, Fe = { key: !0, ref: !0, __self: !0, __source: !0 }, XA, ce; function DA(j) { if (M.call(j, "ref")) { var QA = Object.getOwnPropertyDescriptor(j, "ref").get; if (QA && QA.isReactWarning) return !1; } return j.ref !== void 0; } function ft(j) { if (M.call(j, "key")) { var QA = Object.getOwnPropertyDescriptor(j, "key").get; if (QA && QA.isReactWarning) return !1; } return j.key !== void 0; } function de(j, QA) { typeof j.ref == "string" && fe.current; } function zt(j, QA) { { var IA = function() { XA || (XA = !0, Q("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", QA)); }; IA.isReactWarning = !0, Object.defineProperty(j, "key", { get: IA, configurable: !0 }); } } function ye(j, QA) { { var IA = function() { ce || (ce = !0, Q("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", QA)); }; IA.isReactWarning = !0, Object.defineProperty(j, "ref", { get: IA, configurable: !0 }); } } var De = function(j, QA, IA, KA, se, le, YA) { var ZA = { // This tag allows us to uniquely identify this as a React Element $$typeof: A, // Built-in properties that belong on the element type: j, key: QA, ref: IA, props: YA, // Record the component responsible for creating this element. _owner: le }; return ZA._store = {}, Object.defineProperty(ZA._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: !1 }), Object.defineProperty(ZA, "_self", { configurable: !1, enumerable: !1, writable: !1, value: KA }), Object.defineProperty(ZA, "_source", { configurable: !1, enumerable: !1, writable: !1, value: se }), Object.freeze && (Object.freeze(ZA.props), Object.freeze(ZA)), ZA; }; function ar(j, QA, IA, KA, se) { { var le, YA = {}, ZA = null, Ke = null; IA !== void 0 && (ue(IA), ZA = "" + IA), ft(QA) && (ue(QA.key), ZA = "" + QA.key), DA(QA) && (Ke = QA.ref, de(QA, se)); for (le in QA) M.call(QA, le) && !Fe.hasOwnProperty(le) && (YA[le] = QA[le]); if (j && j.defaultProps) { var Ie = j.defaultProps; for (le in Ie) YA[le] === void 0 && (YA[le] = Ie[le]); } if (ZA || Ke) { var He = typeof j == "function" ? j.displayName || j.name || "Unknown" : j; ZA && zt(YA, He), Ke && ye(YA, He); } return De(j, ZA, Ke, se, KA, fe.current, YA); } } var pe = v.ReactCurrentOwner, Hr = v.ReactDebugCurrentFrame; function be(j) { if (j) { var QA = j._owner, IA = gA(j.type, j._source, QA ? QA.type : null); Hr.setExtraStackFrame(IA); } else Hr.setExtraStackFrame(null); } var _t; _t = !1; function Jt(j) { return typeof j == "object" && j !== null && j.$$typeof === A; } function Oe() { { if (pe.current) { var j = R(pe.current.type); if (j) return ` Check the render method of \`` + j + "`."; } return ""; } } function ee(j) { return ""; } var ve = {}; function qr(j) { { var QA = Oe(); if (!QA) { var IA = typeof j == "string" ? j : j.displayName || j.name; IA && (QA = ` Check the top-level render call using <` + IA + ">."); } return QA; } } function nt(j, QA) { { if (!j._store || j._store.validated || j.key != null) return; j._store.validated = !0; var IA = qr(QA); if (ve[IA]) return; ve[IA] = !0; var KA = ""; j && j._owner && j._owner !== pe.current && (KA = " It was passed a child from " + R(j._owner.type) + "."), be(j), Q('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', IA, KA), be(null); } } function Yt(j, QA) { { if (typeof j != "object") return; if (SA(j)) for (var IA = 0; IA < j.length; IA++) { var KA = j[IA]; Jt(KA) && nt(KA, QA); } else if (Jt(j)) j._store && (j._store.validated = !0); else if (j) { var se = x(j); if (typeof se == "function" && se !== j.entries) for (var le = se.call(j), YA; !(YA = le.next()).done; ) Jt(YA.value) && nt(YA.value, QA); } } } function sr(j) { { var QA = j.type; if (QA == null || typeof QA == "string") return; var IA; if (typeof QA == "function") IA = QA.propTypes; else if (typeof QA == "object" && (QA.$$typeof === u || // Note: Memo only checks outer props here. // Inner props are checked in the reconciler. QA.$$typeof === g)) IA = QA.propTypes; else return; if (IA) { var KA = R(QA); xA(IA, j.props, "prop", KA, j); } else if (QA.PropTypes !== void 0 && !_t) { _t = !0; var se = R(QA); Q("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", se || "Unknown"); } typeof QA.getDefaultProps == "function" && !QA.getDefaultProps.isReactClassApproved && Q("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); } } function qA(j) { { for (var QA = Object.keys(j.props), IA = 0; IA < QA.length; IA++) { var KA = QA[IA]; if (KA !== "children" && KA !== "key") { be(j), Q("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", KA), be(null); break; } } j.ref !== null && (be(j), Q("Invalid attribute `ref` supplied to `React.Fragment`."), be(null)); } } var kt = {}; function Zt(j, QA, IA, KA, se, le) { { var YA = fA(j); if (!YA) { var ZA = ""; (j === void 0 || typeof j == "object" && j !== null && Object.keys(j).length === 0) && (ZA += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."); var Ke = ee(); Ke ? ZA += Ke : ZA += Oe(); var Ie; j === null ? Ie = "null" : SA(j) ? Ie = "array" : j !== void 0 && j.$$typeof === A ? (Ie = "<" + (R(j.type) || "Unknown") + " />", ZA = " Did you accidentally export a JSX literal instead of a component?") : Ie = typeof j, Q("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Ie, ZA); } var He = ar(j, QA, IA, se, le); if (He == null) return He; if (YA) { var ut = QA.children; if (ut !== void 0) if (KA) if (SA(ut)) { for (var $t = 0; $t < ut.length; $t++) Yt(ut[$t], j); Object.freeze && Object.freeze(ut); } else Q("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."); else Yt(ut, j); } if (M.call(QA, "key")) { var or = R(j), ht = Object.keys(QA).filter(function(ai) { return ai !== "key"; }), Pn = ht.length > 0 ? "{key: someKey, " + ht.join(": ..., ") + ": ...}" : "{key: someKey}"; if (!kt[or + Pn]) { var sn = ht.length > 0 ? "{" + ht.join(": ..., ") + ": ...}" : "{}"; Q(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`, Pn, or, sn, or), kt[or + Pn] = !0; } } return j === r ? qA(He) : sr(He), He; } } function yt(j, QA, IA) { return Zt(j, QA, IA, !0); } function ze(j, QA, IA) { return Zt(j, QA, IA, !1); } var Ge = ze, Dt = yt; La.Fragment = r, La.jsx = Ge, La.jsxs = Dt; }()), La; } var Wl; function V1() { return Wl || (Wl = 1, process.env.NODE_ENV === "production" ? js.exports = j1() : js.exports = G1()), js.exports; } var q1 = V1(); const mh = O1(null), Uv = ({ instance: e, children: A }) => /* @__PURE__ */ q1.jsx(mh.Provider, { value: { instance: e }, children: A }), W1 = () => { const e = M1(mh); if (!e) throw new Error("useEasyPdf must be used within an EasyPdfProvider"); return e; }; var Ii = {}, Xl; function X1() { if (Xl) return Ii; Xl = 1; var e = R1; if (process.env.NODE_ENV === "production") Ii.createRoot = e.createRoot, Ii.hydrateRoot = e.hydrateRoot; else { var A = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; Ii.createRoot = function(t, r) { A.usingClientEntryPoint = !0; try { return e.createRoot(t, r); } finally { A.usingClientEntryPoint = !1; } }, Ii.hydrateRoot = function(t, r, n) { A.usingClientEntryPoint = !0; try { return e.hydrateRoot(t, r, n); } finally { A.usingClientEntryPoint = !1; } }; } return Ii; } var z1 = X1(); const J1 = /* @__PURE__ */ K1(z1); function xe(e) { "@babel/helpers - typeof"; return xe = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(A) { return typeof A; } : function(A) { return A && typeof Symbol == "function" && A.constructor === Symbol && A !== Symbol.prototype ? "symbol" : typeof A; }, xe(e); } var Nt = Uint8Array, ir = Uint16Array, il = Int32Array, Ro = new Nt([ 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 ]), Ko = new Nt([ 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 ]), Cc = new Nt([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), Ch = function(e, A) { for (var t = new ir(31), r = 0; r < 31; ++r) t[r] = A += 1 << e[r - 1]; for (var n = new il(t[30]), r = 1; r < 30; ++r) for (var i = t[r]; i < t[r + 1]; ++i) n[i] = i - t[r] << 5 | r; return { b: t, r: n }; }, Fh = Ch(Ro, 2), Qh = Fh.b, Fc = Fh.r; Qh[28] = 258, Fc[258] = 28; var yh = Ch(Ko, 0), Y1 = yh.b, zl = yh.r, Qc = new ir(32768); for (var ke = 0; ke < 32768; ++ke) { var Fn = (ke & 43690) >> 1 | (ke & 21845) << 1; Fn = (Fn & 52428) >> 2 | (Fn & 13107) << 2, Fn = (Fn & 61680) >> 4 | (Fn & 3855) << 4, Qc[ke] = ((Fn & 65280) >> 8 | (Fn & 255) << 8) >> 1; } var kr = function(e, A, t) { for (var r = e.length, n = 0, i = new ir(A); n < r; ++n) e[n] && ++i[e[n] - 1]; var s = new ir(A); for (n = 1; n < A; ++n) s[n] = s[n - 1] + i[n - 1] << 1; var o; if (t) { o = new ir(1 << A); var u = 15 - A; for (n = 0; n < r; ++n) if (e[n]) for (var h = n << 4 | e[n], B = A - e[n], g = s[e[n] - 1]++ << B, w = g | (1 << B) - 1; g <= w; ++g) o[Qc[g] >> u] = h; } else for (o = new ir(r), n = 0; n < r; ++n) e[n] && (o[n] = Qc[s[e[n] - 1]++] >> 15 - e[n]); return o; }, Hn = new Nt(288); for (var ke = 0; ke < 144; ++ke) Hn[ke] = 8; for (var ke = 144; ke < 256; ++ke) Hn[ke] = 9; for (var ke = 256; ke < 280; ++ke) Hn[ke] = 7; for (var ke = 280; ke < 288; ++ke) Hn[ke] = 8; var Wa = new Nt(32); for (var ke = 0; ke < 32; ++ke) Wa[ke] = 5; var Z1 = /* @__PURE__ */ kr(Hn, 9, 0), $1 = /* @__PURE__ */ kr(Hn, 9, 1), AB = /* @__PURE__ */ kr(Wa, 5, 0), eB = /* @__PURE__ */ kr(Wa, 5, 1), Vu = function(e) { for (var A = e[0], t = 1; t < e.length; ++t) e[t] > A && (A = e[t]); return A; }, br = function(e, A, t) { var r = A / 8 | 0; return (e[r] | e[r + 1] << 8) >> (A & 7) & t; }, qu = function(e, A) { var t = A / 8 | 0; return (e[t] | e[t + 1] << 8 | e[t + 2] << 16) >> (A & 7); }, al = function(e) { return (e + 7) / 8 | 0; }, bh = function(e, A, t) { return (t == null || t > e.length) && (t = e.length), new Nt(e.subarray(A, t)); }, tB = [ "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 ], Lr = function(e, A, t) { var r = new Error(A || tB[e]); if (r.code = e, Error.captureStackTrace && Error.captureStackTrace(r, Lr), !t) throw r; return r; }, rB = function(e, A, t, r) { var n = e.length, i = 0; if (!n || A.f && !A.l) return t || new Nt(0); var s = !t, o = s || A.i != 2, u = A.i; s && (t = new Nt(n * 3)); var h = function(CA) { var UA = t.length; if (CA > UA) { var LA = new Nt(Math.max(UA * 2, CA)); LA.set(t), t = LA; } }, B = A.f || 0, g = A.p || 0, w = A.b || 0, d = A.l, E = A.d, m = A.m, x = A.n, v = n * 8; do { if (!d) { B = br(e, g, 1); var Q = br(e, g + 1, 3); if (g += 3, Q) if (Q == 1) d = $1, E = eB, m = 9, x = 5; else if (Q == 2) { var AA = br(e, g, 31) + 257, J = br(e, g + 10, 15) + 4, O = AA + br(e, g + 5, 31) + 1; g += 14; for (var X = new Nt(O), fA = new Nt(19), S = 0; S < J; ++S) fA[Cc[S]] = br(e, g + S * 3, 7); g += J * 3; for (var H = Vu(fA), R = (1 << H) - 1, k = kr(fA, H, 1), S = 0; S < O; ) { var iA = k[br(e, g, R)]; g += iA & 15; var T = iA >> 4; if (T < 16) X[S++] = T; else { var Z = 0, uA = 0; for (T == 16 ? (uA = 3 + br(e, g, 3), g += 2, Z = X[S - 1]) : T == 17 ? (uA = 3 + br(e, g, 7), g += 3) : T == 18 && (uA = 11 + br(e, g, 127), g += 7); uA--; ) X[S++] = Z; } } var eA = X.subarray(0, AA), cA = X.subarray(AA); m = Vu(eA), x = Vu(cA), d = kr(eA, m, 1), E = kr(cA, x, 1); } else Lr(1); else { var T = al(g) + 4, q = e[T - 4] | e[T - 3] << 8, V = T + q; if (V > n) { u && Lr(0); break; } o && h(w + q), t.set(e.subarray(T, V), w), A.b = w += q, A.p = g = V * 8, A.f = B; continue; } if (g > v) { u && Lr(0); break; } } o && h(w + 131072); for (var hA = (1 << m) - 1, EA = (1 << x) - 1, b = g; ; b = g) { var Z = d[qu(e, g) & hA], _ = Z >> 4; if (g += Z & 15, g > v) { u && Lr(0); break; } if (Z || Lr(2), _ < 256) t[w++] = _; else if (_ == 256) { b = g, d = null; break; } else { var P = _ - 254; if (_ > 264) { var S = _ - 257, K = Ro[S]; P = br(e, g, (1 << K) - 1) + Qh[S], g += K; } var Y = E[qu(e, g) & EA], rA = Y >> 4; Y || Lr(3), g += Y & 15; var cA = Y1[rA]; if (rA > 3) { var K = Ko[rA]; cA += qu(e, g) & (1 << K) - 1, g += K; } if (g > v) { u && Lr(0); break; } o && h(w + 131072); var oA = w + P; if (w < cA) { var lA = i - cA, mA = Math.min(cA, oA); for (lA + w < 0 && Lr(3); w < mA; ++w) t[w] = r[lA + w]; } for (; w < oA; ++w) t[w] = t[w - cA]; } } A.l = d, A.p = b, A.b = w, A.f = B, d && (B = 1, A.m = m, A.d = E, A.n = x); } while (!B); return w != t.length && s ? bh(t, 0, w) : t.subarray(0, w); }, tn = function(e, A, t) { t <<= A & 7; var r = A / 8 | 0; e[r] |= t, e[r + 1] |= t >> 8; }, xa = function(e, A, t) { t <<= A & 7; var r = A / 8 | 0; e[r] |= t, e[r + 1] |= t >> 8, e[r + 2] |= t >> 16; }, Wu = function(e, A) { for (var t = [], r = 0; r < e.length; ++r) e[r] && t.push({ s: r, f: e[r] }); var n = t.length, i = t.slice(); if (!n) return { t: Eh, l: 0 }; if (n == 1) { var s = new Nt(t[0].s + 1); return s[t[0].s] = 1, { t: s, l: 1 }; } t.sort(function(V, AA) { return V.f - AA.f; }), t.push({ s: -1, f: 25001 }); var o = t[0], u = t[1], h = 0, B = 1, g = 2; for (t[0] = { s: -1, f: o.f + u.f, l: o, r: u }; B != n - 1; ) o = t[t[h].f < t[g].f ? h++ : g++], u = t[h != B && t[h].f < t[g].f ? h++ : g++], t[B++] = { s: -1, f: o.f + u.f, l: o, r: u }; for (var w = i[0].s, r = 1; r < n; ++r) i[r].s > w && (w = i[r].s); var d = new ir(w + 1), E = yc(t[B - 1], d, 0); if (E > A) { var r = 0, m = 0, x = E - A, v = 1 << x; for (i.sort(function(AA, J) { return d[J.s] - d[AA.s] || AA.f - J.f; }); r < n; ++r) { var Q = i[r].s; if (d[Q] > A) m += v - (1 << E - d[Q]), d[Q] = A; else break; } for (m >>= x; m > 0; ) { var T = i[r].s; d[T] < A ? m -= 1 << A - d[T]++ - 1 : ++r; } for (; r >= 0 && m; --r) { var q = i[r].s; d[q] == A && (--d[q], ++m); } E = A; } return { t: new Nt(d), l: E }; }, yc = function(e, A, t) { return e.s == -1 ? Math.max(yc(e.l, A, t + 1), yc(e.r, A, t + 1)) : A[e.s] = t; }, Jl = function(e) { for (var A = e.length; A && !e[--A]; ) ; for (var t = new ir(++A), r = 0, n = e[0], i = 1, s = function(u) { t[r++] = u; }, o = 1; o <= A; ++o) if (e[o] == n && o != A) ++i; else { if (!n && i > 2) { for (; i > 138; i -= 138) s(32754); i > 2 && (s(i > 10 ? i - 11 << 5 | 28690 : i - 3 << 5 | 12305), i = 0); } else if (i > 3) { for (s(n), --i; i > 6; i -= 6) s(8304); i > 2 && (s(i - 3 << 5 | 8208), i = 0); } for (; i--; ) s(n); i = 1, n = e[o]; } return { c: t.subarray(0, r), n: A }; }, Ia = function(e, A) { for (var t = 0, r = 0; r < A.length; ++r) t += e[r] * A[r]; return t; }, Uh = function(e, A, t) { var r = t.length, n = al(A + 2); e[n] = r & 255, e[n + 1] = r >> 8, e[n + 2] = e[n] ^ 255, e[n + 3] = e[n + 1] ^ 255; for (var i = 0; i < r; ++i) e[n + i + 4] = t[i]; return (n + 4 + r) * 8; }, Yl = function(e, A, t, r, n, i, s, o, u, h, B) { tn(A, B++, t), ++n[256]; for (var g = Wu(n, 15), w = g.t, d = g.l, E = Wu(i, 15), m = E.t, x = E.l, v = Jl(w), Q = v.c, T = v.n, q = Jl(m), V = q.c, AA = q.n, J = new ir(19), O = 0; O < Q.length; ++O) ++J[Q[O] & 31]; for (var O = 0; O < V.length; ++O) ++J[V[O] & 31]; for (var X = Wu(J, 7), fA = X.t, S = X.l, H = 19; H > 4 && !fA[Cc[H - 1]]; --H) ; var R = h + 5 << 3, k = Ia(n, Hn) + Ia(i, Wa) + s, iA = Ia(n, w) + Ia(i, m) + s + 14 + 3 * H + Ia(J, fA) + 2 * J[16] + 3 * J[17] + 7 * J[18]; if (u >= 0 && R <= k && R <= iA) return Uh(A, B, e.subarray(u, u + h)); var Z, uA, eA, cA; if (tn(A, B, 1 + (iA < k)), B += 2, iA < k) { Z = kr(w, d, 0), uA = w, eA = kr(m, x, 0), cA = m; var hA = kr(fA, S, 0); tn(A, B, T - 257), tn(A, B + 5, AA - 1), tn(A, B + 10, H - 4), B += 14; for (var O = 0; O < H; ++O) tn(A, B + 3 * O, fA[Cc[O]]); B += 3 * H; for (var EA = [Q, V], b = 0; b < 2; ++b) for (var _ = EA[b], O = 0; O < _.length; ++O) { var P = _[O] & 31; tn(A, B, hA[P]), B += fA[P], P > 15 && (tn(A, B, _[O] >> 5 & 127), B += _[O] >> 12); } } else Z = Z1, uA = Hn, eA = AB, cA = Wa; for (var O = 0; O < o; ++O) { var K = r[O]; if (K > 255) { var P = K >> 18 & 31; xa(A, B, Z[P + 257]), B += uA[P + 257], P > 7 && (tn(A, B, K >> 23 & 31), B += Ro[P]); var Y = K & 31; xa(A, B, eA[Y]), B += cA[Y], Y > 3 && (xa(A, B, K >> 5 & 8191), B += Ko[Y]); } else xa(A, B, Z[K]), B += uA[K]; } return xa(A, B, Z[256]), B + uA[256]; }, nB = /* @__PURE__ */ new il([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]), Eh = /* @__PURE__ */ new Nt(0), iB = function(e, A, t, r, n, i) { var s = i.z || e.length, o = new Nt(r + s + 5 * (1 + Math.ceil(s / 7e3)) + n), u = o.subarray(r, o.length - n), h = i.l, B = (i.r || 0) & 7; if (A) { B && (u[0] = i.r >> 3); for (var g = nB[A - 1], w = g >> 13, d = g & 8191, E = (1 << t) - 1, m = i.p || new ir(32768), x = i.h || new ir(E + 1), v = Math.ceil(t / 3), Q = 2 * v, T = function(VA) { return (e[VA] ^ e[VA + 1] << v ^ e[VA + 2] << Q) & E; }, q = new il(25e3), V = new ir(288), AA = new ir(32), J = 0, O = 0, X = i.i || 0, fA = 0, S = i.w || 0, H = 0; X + 2 < s; ++X) { var R = T(X), k = X & 32767, iA = x[R]; if (m[k] = iA, x[R] = k, S <= X) { var Z = s - X; if ((J > 7e3 || fA > 24576) && (Z > 423 || !h)) { B = Yl(e, u, 0, q, V, AA, O, fA, H, X - H, B), fA = J = O = 0, H = X; for (var uA = 0; uA < 286; ++uA) V[uA] = 0; for (var uA = 0; uA < 30; ++uA) AA[uA] = 0; } var eA = 2, cA = 0, hA = d, EA = k - iA & 32767; if (Z > 2 && R == T(X - EA)) for (var b = Math.min(w, Z) - 1, _ = Math.min(32767, X), P = Math.min(258, Z); EA <= _ && --hA && k != iA; ) { if (e[X + eA] == e[X + eA - EA]) { for (var K = 0; K < P && e[X + K] == e[X + K - EA]; ++K) ; if (K > eA) { if (eA = K, cA = EA, K > b) break; for (var Y = Math.min(EA, K - 2), rA = 0, uA = 0; uA < Y; ++uA) { var oA = X - EA + uA & 32767, lA = m[oA], mA = oA - lA & 32767; mA > rA && (rA = mA, iA = oA); } } } k = iA, iA = m[k], EA += k - iA & 32767; } if (cA) { q[fA++] = 268435456 | Fc[eA] << 18 | zl[cA]; var CA = Fc[eA] & 31, UA = zl[cA] & 31; O += Ro[CA] + Ko[UA], ++V[257 + CA], ++AA[UA], S = X + eA, ++J; } else q[fA++] = e[X], ++V[e[X]]; } } for (X = Math.max(X, S); X < s; ++X) q[fA++] = e[X], ++V[e[X]]; B = Yl(e, u, h, q, V, AA, O, fA, H, X - H, B), h || (i.r = B & 7 | u[B / 8 | 0] << 3, B -= 7, i.h = x, i.p = m, i.i = X, i.w = S); } else { for (var X = i.w || 0; X < s + h; X += 65535) { var LA = X + 65535; LA >= s && (u[B / 8 | 0] = h, LA = s), B = Uh(u, B + 1, e.subarray(X, LA)); } i.i = s; } return bh(o, 0, r + al(B) + n); }, Lh = function() { var e = 1, A = 0; return { p: function(t) { for (var r = e, n = A, i = t.length | 0, s = 0; s != i; ) { for (var o = Math.min(s + 2655, i); s < o; ++s) n += r += t[s]; r = (r & 65535) + 15 * (r >> 16), n = (n & 65535) + 15 * (n >> 16); } e = r, A = n; }, d: function() { return e %= 65521, A %= 65521, (e & 255) << 24 | (e & 65280) << 8 | (A & 255) << 8 | A >> 8; } }; }, aB = function(e, A, t, r, n) { if (!n && (n = { l: 1 }, A.dictionary)) { var i = A.dictionary.subarray(-32768), s = new Nt(i.length + e.length); s.set(i), s.set(e, i.length), e = s, n.w = i.length; } return iB(e, A.level == null ? 6 : A.level, A.mem == null ? n.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(e.length))) * 1.5) : 20 : 12 + A.mem, t, r, n); }, xh = function(e, A, t) { for (; t; ++A) e[A] = t, t >>>= 8; }, sB = function(e, A) { var t = A.level, r = t == 0 ? 0 : t < 6 ? 1 : t == 9 ? 3 : 2; if (e[0] = 120, e[1] = r << 6 | (A.dictionary && 32), e[1] |= 31 - (e[0] << 8 | e[1]) % 31, A.dictionary) { var n = Lh(); n.p(A.dictionary), xh(e, 2, n.d()); } }, oB = function(e, A) { return ((e[0] & 15) != 8 || e[0] >> 4 > 7 || (e[0] << 8 | e[1]) % 31) && Lr(6, "invalid zlib data"), (e[1] >> 5 & 1) == 1 && Lr(6, "invalid zlib data: " + (e[1] & 32 ? "need" : "unexpected") + " dictionary"), (e[1] >> 3 & 4) + 2; }; function bc(e, A) { A || (A = {}); var t = Lh(); t.p(e); var r = aB(e, A, A.dictionary ? 6 : 2, 4); return sB(r, A), xh(r, r.length - 4, t.d()), r; } function uB(e, A) { return rB(e.subarray(oB(e), -4), { i: 2 }, A, A); } var cB = typeof TextDecoder < "u" && /* @__PURE__ */ new TextDecoder(), lB = 0; try { cB.decode(Eh, { stream: !0 }), lB = 1; } catch { } /** @license * * jsPDF - PDF Document creation from JavaScript * Version 3.0.1 Built on 2025-03-17T14:19:36.873Z * 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 JA = /* @__PURE__ */ function() { return typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : this; }(); function Xu() { JA.console && typeof JA.console.log == "function" && JA.console.log.apply(JA.console, arguments); } var _e = { log: Xu, warn: function(e) { JA.console && (typeof JA.console.warn == "function" ? JA.console.warn.apply(JA.console, arguments) : Xu.call(null, arguments)); }, error: function(e) { JA.console && (typeof JA.console.error == "function" ? JA.console.error.apply(JA.console, arguments) : Xu(e)); } }; function zu(e, A, t) { var r = new XMLHttpRequest(); r.open("GET", e), r.responseType = "blob", r.onload = function() { zn(r.response, A, t); }, r.onerror = function() { _e.error("could not download file"); }, r.send(); } function Zl(e) { var A = new XMLHttpRequest(); A.open("HEAD", e, !1); try { A.send(); } catch { } return A.status >= 200 && A.status <= 299; } function Gs(e) { try { e.dispatchEvent(new MouseEvent("click")); } catch { var A = document.createEvent("MouseEvents"); A.initMouseEvent("click", !0, !0, window, 0, 0, 0, 80, 20, !1, !1, !1, !1, 0, null), e.dispatchEvent(A); } } var Ka, Uc, zn = JA.saveAs || ((typeof window > "u" ? "undefined" : xe(window)) !== "object" || window !== JA ? function() { } : typeof HTMLAnchorElement < "u" && "download" in HTMLAnchorElement.prototype ? function(e, A, t) { var r = JA.URL || JA.webkitURL, n = document.createElement("a"); A = A || e.name || "download", n.download = A, n.rel = "noopener", typeof e == "string" ? (n.href = e, n.origin !== location.origin ? Zl(n.href) ? zu(e, A, t) : Gs(n, n.target = "_blank") : Gs(n)) : (n.href = r.createObjectURL(e), setTimeout(function() { r.revokeObjectURL(n.href); }, 4e4), setTimeout(function() { Gs(n); }, 0)); } : "msSaveOrOpenBlob" in navigator ? function(e, A, t) { if (A = A || e.name || "download", typeof e == "string") if (Zl(e)) zu(e, A, t); else { var r = document.createElement("a"); r.href = e, r.target = "_blank", setTimeout(function() { Gs(r); }); } else navigator.msSaveOrOpenBlob(function(n, i) { return i === void 0 ? i = { autoBom: !1 } : xe(i) !== "object" && (_e.warn("Deprecated: Expected third argument to be a object"), i = { autoBom: !i }), i.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(n.type) ? new Blob(["\uFEFF", n], { type: n.type }) : n; }(e, t), A); } : function(e, A, t, r) { if ((r = r || open("", "_blank")) && (r.document.title = r.document.body.innerText = "downloading..."), typeof e == "string") return zu(e, A, t); var n = e.type === "application/octet-stream", i = /constructor/i.test(JA.HTMLElement) || JA.safari, s = /CriOS\/[\d]+/.test(navigator.userAgent); if ((s || n && i) && (typeof FileReader > "u" ? "undefined" : xe(FileReader)) === "object") { var o = new FileReader(); o.onloadend = function() { var B = o.result; B = s ? B : B.replace(/^data:[^;]*;/, "data:attachment/file;"), r ? r.location.href = B : location = B, r = null; }, o.readAsDataURL(e); } else { var u = JA.URL || JA.webkitURL, h = u.createObjectURL(e); r ? r.location = h : location.href = h, r = null, setTimeout(function() { u.revokeObjectURL(h); }, 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 Ih(e) { var A; e = e || "", this.ok = !1, e.charAt(0) == "#" && (e = e.substr(1, 6)), e = { 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" }[e = (e = e.replace(/ /g, "")).toLowerCase()] || e; for (var t = [{ re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/, example: ["rgb(123, 234, 45)", "rgb(255,234,245)"], process: function(o) { return [parseInt(o[1]), parseInt(o[2]), parseInt(o[3])]; } }, { re: /^(\w{2})(\w{2})(\w{2})$/, example: ["#00ff00", "336699"], process: function(o) { return [parseInt(o[1], 16), parseInt(o[2], 16), parseInt(o[3], 16)]; } }, { re: /^(\w{1})(\w{1})(\w{1})$/, example: ["#fb0", "f0f"], process: function(o) { return [parseInt(o[1] + o[1], 16), parseInt(o[2] + o[2], 16), parseInt(o[3] + o[3], 16)]; } }], r = 0; r < t.length; r++) { var n = t[r].re, i = t[r].process, s = n.exec(e); s && (A = i(s), this.r = A[0], this.g = A[1], this.b = A[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 o = this.r.toString(16), u = this.g.toString(16), h = this.b.toString(16); return o.length == 1 && (o = "0" + o), u.length == 1 && (u = "0" + u), h.length == 1 && (h