UNPKG

react-mindee-js

Version:
1,484 lines (1,481 loc) 2.34 MB
var aa = Object.defineProperty; var ta = (f, r, e) => r in f ? aa(f, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : f[r] = e; var ir = (f, r, e) => (ta(f, typeof r != "symbol" ? r + "" : r, e), e), Nr = (f, r, e) => { if (!r.has(f)) throw TypeError("Cannot " + e); }; var F = (f, r, e) => (Nr(f, r, "read from private field"), e ? e.call(f) : r.get(f)), u0 = (f, r, e) => { if (r.has(f)) throw TypeError("Cannot add the same private member more than once"); r instanceof WeakSet ? r.add(f) : r.set(f, e); }, B0 = (f, r, e, a) => (Nr(f, r, "write to private field"), a ? a.call(f, e) : r.set(f, e), e), gr = (f, r, e, a) => ({ set _(t) { B0(f, r, t, e); }, get _() { return F(f, r, a); } }), k0 = (f, r, e) => (Nr(f, r, "access private method"), e); import require$$0, { useRef, useEffect } from "react"; var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function getDefaultExportFromCjs(f) { return f && f.__esModule && Object.prototype.hasOwnProperty.call(f, "default") ? f.default : f; } function getAugmentedNamespace(f) { if (f.__esModule) return f; var r = f.default; if (typeof r == "function") { var e = function a() { if (this instanceof a) { var t = [null]; t.push.apply(t, arguments); var s = Function.bind.apply(r, t); return new s(); } return r.apply(this, arguments); }; e.prototype = r.prototype; } else e = {}; return Object.defineProperty(e, "__esModule", { value: !0 }), Object.keys(f).forEach(function(a) { var t = Object.getOwnPropertyDescriptor(f, a); Object.defineProperty(e, a, t.get ? t : { enumerable: !0, get: function() { return f[a]; } }); }), e; } var jsxRuntime = { exports: {} }, reactJsxRuntime_production_min = {}; /** * @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 hasRequiredReactJsxRuntime_production_min; function requireReactJsxRuntime_production_min() { if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min; hasRequiredReactJsxRuntime_production_min = 1; var f = require$$0, r = Symbol.for("react.element"), e = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, t = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 }; function n(o, A, l) { var u, h = {}, c = null, g = null; l !== void 0 && (c = "" + l), A.key !== void 0 && (c = "" + A.key), A.ref !== void 0 && (g = A.ref); for (u in A) a.call(A, u) && !s.hasOwnProperty(u) && (h[u] = A[u]); if (o && o.defaultProps) for (u in A = o.defaultProps, A) h[u] === void 0 && (h[u] = A[u]); return { $$typeof: r, type: o, key: c, ref: g, props: h, _owner: t.current }; } return reactJsxRuntime_production_min.Fragment = e, reactJsxRuntime_production_min.jsx = n, reactJsxRuntime_production_min.jsxs = n, reactJsxRuntime_production_min; } var reactJsxRuntime_development = {}; /** * @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 hasRequiredReactJsxRuntime_development; function requireReactJsxRuntime_development() { return hasRequiredReactJsxRuntime_development || (hasRequiredReactJsxRuntime_development = 1, process.env.NODE_ENV !== "production" && function() { var f = require$$0, r = Symbol.for("react.element"), e = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), t = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), n = Symbol.for("react.provider"), o = Symbol.for("react.context"), A = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), u = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), c = Symbol.for("react.lazy"), g = Symbol.for("react.offscreen"), v = Symbol.iterator, m = "@@iterator"; function b(L) { if (L === null || typeof L != "object") return null; var g0 = v && L[v] || L[m]; return typeof g0 == "function" ? g0 : null; } var _ = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; function k(L) { { for (var g0 = arguments.length, S0 = new Array(g0 > 1 ? g0 - 1 : 0), P0 = 1; P0 < g0; P0++) S0[P0 - 1] = arguments[P0]; p("error", L, S0); } } function p(L, g0, S0) { { var P0 = _.ReactDebugCurrentFrame, Q0 = P0.getStackAddendum(); Q0 !== "" && (g0 += "%s", S0 = S0.concat([Q0])); var j0 = S0.map(function(H0) { return String(H0); }); j0.unshift("Warning: " + g0), Function.prototype.apply.call(console[L], console, j0); } } var C = !1, d = !1, y = !1, G = !1, T = !1, R; R = Symbol.for("react.module.reference"); function M(L) { return !!(typeof L == "string" || typeof L == "function" || L === a || L === s || T || L === t || L === l || L === u || G || L === g || C || d || y || typeof L == "object" && L !== null && (L.$$typeof === c || L.$$typeof === h || L.$$typeof === n || L.$$typeof === o || L.$$typeof === A || // 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. L.$$typeof === R || L.getModuleId !== void 0)); } function W(L, g0, S0) { var P0 = L.displayName; if (P0) return P0; var Q0 = g0.displayName || g0.name || ""; return Q0 !== "" ? S0 + "(" + Q0 + ")" : S0; } function Y(L) { return L.displayName || "Context"; } function U(L) { if (L == null) return null; if (typeof L.tag == "number" && k("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof L == "function") return L.displayName || L.name || null; if (typeof L == "string") return L; switch (L) { case a: return "Fragment"; case e: return "Portal"; case s: return "Profiler"; case t: return "StrictMode"; case l: return "Suspense"; case u: return "SuspenseList"; } if (typeof L == "object") switch (L.$$typeof) { case o: var g0 = L; return Y(g0) + ".Consumer"; case n: var S0 = L; return Y(S0._context) + ".Provider"; case A: return W(L, L.render, "ForwardRef"); case h: var P0 = L.displayName || null; return P0 !== null ? P0 : U(L.type) || "Memo"; case c: { var Q0 = L, j0 = Q0._payload, H0 = Q0._init; try { return U(H0(j0)); } catch { return null; } } } return null; } var O = Object.assign, a0 = 0, o0, f0, E, V, z, J, s0; function P() { } P.__reactDisabledLog = !0; function w() { { if (a0 === 0) { o0 = console.log, f0 = console.info, E = console.warn, V = console.error, z = console.group, J = console.groupCollapsed, s0 = console.groupEnd; var L = { configurable: !0, enumerable: !0, value: P, writable: !0 }; Object.defineProperties(console, { info: L, log: L, warn: L, error: L, group: L, groupCollapsed: L, groupEnd: L }); } a0++; } } function I() { { if (a0--, a0 === 0) { var L = { configurable: !0, enumerable: !0, writable: !0 }; Object.defineProperties(console, { log: O({}, L, { value: o0 }), info: O({}, L, { value: f0 }), warn: O({}, L, { value: E }), error: O({}, L, { value: V }), group: O({}, L, { value: z }), groupCollapsed: O({}, L, { value: J }), groupEnd: O({}, L, { value: s0 }) }); } a0 < 0 && k("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } } var B = _.ReactCurrentDispatcher, D; function N(L, g0, S0) { { if (D === void 0) try { throw Error(); } catch (Q0) { var P0 = Q0.stack.trim().match(/\n( *(at )?)/); D = P0 && P0[1] || ""; } return ` ` + D + L; } } var H = !1, q; { var i0 = typeof WeakMap == "function" ? WeakMap : Map; q = new i0(); } function l0(L, g0) { if (!L || H) return ""; { var S0 = q.get(L); if (S0 !== void 0) return S0; } var P0; H = !0; var Q0 = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var j0; j0 = B.current, B.current = null, w(); try { if (g0) { var H0 = function() { throw Error(); }; if (Object.defineProperty(H0.prototype, "props", { set: function() { throw Error(); } }), typeof Reflect == "object" && Reflect.construct) { try { Reflect.construct(H0, []); } catch (nr) { P0 = nr; } Reflect.construct(L, [], H0); } else { try { H0.call(); } catch (nr) { P0 = nr; } L.call(H0.prototype); } } else { try { throw Error(); } catch (nr) { P0 = nr; } L(); } } catch (nr) { if (nr && P0 && typeof nr.stack == "string") { for (var z0 = nr.stack.split(` `), $0 = P0.stack.split(` `), rr = z0.length - 1, er = $0.length - 1; rr >= 1 && er >= 0 && z0[rr] !== $0[er]; ) er--; for (; rr >= 1 && er >= 0; rr--, er--) if (z0[rr] !== $0[er]) { if (rr !== 1 || er !== 1) do if (rr--, er--, er < 0 || z0[rr] !== $0[er]) { var ar = ` ` + z0[rr].replace(" at new ", " at "); return L.displayName && ar.includes("<anonymous>") && (ar = ar.replace("<anonymous>", L.displayName)), typeof L == "function" && q.set(L, ar), ar; } while (rr >= 1 && er >= 0); break; } } } finally { H = !1, B.current = j0, I(), Error.prepareStackTrace = Q0; } var tr = L ? L.displayName || L.name : "", Ar = tr ? N(tr) : ""; return typeof L == "function" && q.set(L, Ar), Ar; } function c0(L, g0, S0) { return l0(L, !1); } function _0(L) { var g0 = L.prototype; return !!(g0 && g0.isReactComponent); } function E0(L, g0, S0) { if (L == null) return ""; if (typeof L == "function") return l0(L, _0(L)); if (typeof L == "string") return N(L); switch (L) { case l: return N("Suspense"); case u: return N("SuspenseList"); } if (typeof L == "object") switch (L.$$typeof) { case A: return c0(L.render); case h: return E0(L.type, g0, S0); case c: { var P0 = L, Q0 = P0._payload, j0 = P0._init; try { return E0(j0(Q0), g0, S0); } catch { } } } return ""; } var R0 = Object.prototype.hasOwnProperty, d0 = {}, T0 = _.ReactDebugCurrentFrame; function X0(L) { if (L) { var g0 = L._owner, S0 = E0(L.type, L._source, g0 ? g0.type : null); T0.setExtraStackFrame(S0); } else T0.setExtraStackFrame(null); } function D0(L, g0, S0, P0, Q0) { { var j0 = Function.call.bind(R0); for (var H0 in L) if (j0(L, H0)) { var z0 = void 0; try { if (typeof L[H0] != "function") { var $0 = Error((P0 || "React class") + ": " + S0 + " type `" + H0 + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof L[H0] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); throw $0.name = "Invariant Violation", $0; } z0 = L[H0](g0, H0, P0, S0, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); } catch (rr) { z0 = rr; } z0 && !(z0 instanceof Error) && (X0(Q0), k("%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).", P0 || "React class", S0, H0, typeof z0), X0(null)), z0 instanceof Error && !(z0.message in d0) && (d0[z0.message] = !0, X0(Q0), k("Failed %s type: %s", S0, z0.message), X0(null)); } } } var V0 = Array.isArray; function I0(L) { return V0(L); } function p0(L) { { var g0 = typeof Symbol == "function" && Symbol.toStringTag, S0 = g0 && L[Symbol.toStringTag] || L.constructor.name || "Object"; return S0; } } function m0(L) { try { return Z0(L), !1; } catch { return !0; } } function Z0(L) { return "" + L; } function O0(L) { if (m0(L)) return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", p0(L)), Z0(L); } var L0 = _.ReactCurrentOwner, J0 = { key: !0, ref: !0, __self: !0, __source: !0 }, K0, q0, Q; Q = {}; function x0(L) { if (R0.call(L, "ref")) { var g0 = Object.getOwnPropertyDescriptor(L, "ref").get; if (g0 && g0.isReactWarning) return !1; } return L.ref !== void 0; } function M0(L) { if (R0.call(L, "key")) { var g0 = Object.getOwnPropertyDescriptor(L, "key").get; if (g0 && g0.isReactWarning) return !1; } return L.key !== void 0; } function U0(L, g0) { if (typeof L.ref == "string" && L0.current && g0 && L0.current.stateNode !== g0) { var S0 = U(L0.current.type); Q[S0] || (k('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', U(L0.current.type), L.ref), Q[S0] = !0); } } function K(L, g0) { { var S0 = function() { K0 || (K0 = !0, k("%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)", g0)); }; S0.isReactWarning = !0, Object.defineProperty(L, "key", { get: S0, configurable: !0 }); } } function t0(L, g0) { { var S0 = function() { q0 || (q0 = !0, k("%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)", g0)); }; S0.isReactWarning = !0, Object.defineProperty(L, "ref", { get: S0, configurable: !0 }); } } var Z = function(L, g0, S0, P0, Q0, j0, H0) { var z0 = { // This tag allows us to uniquely identify this as a React Element $$typeof: r, // Built-in properties that belong on the element type: L, key: g0, ref: S0, props: H0, // Record the component responsible for creating this element. _owner: j0 }; return z0._store = {}, Object.defineProperty(z0._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: !1 }), Object.defineProperty(z0, "_self", { configurable: !1, enumerable: !1, writable: !1, value: P0 }), Object.defineProperty(z0, "_source", { configurable: !1, enumerable: !1, writable: !1, value: Q0 }), Object.freeze && (Object.freeze(z0.props), Object.freeze(z0)), z0; }; function b0(L, g0, S0, P0, Q0) { { var j0, H0 = {}, z0 = null, $0 = null; S0 !== void 0 && (O0(S0), z0 = "" + S0), M0(g0) && (O0(g0.key), z0 = "" + g0.key), x0(g0) && ($0 = g0.ref, U0(g0, Q0)); for (j0 in g0) R0.call(g0, j0) && !J0.hasOwnProperty(j0) && (H0[j0] = g0[j0]); if (L && L.defaultProps) { var rr = L.defaultProps; for (j0 in rr) H0[j0] === void 0 && (H0[j0] = rr[j0]); } if (z0 || $0) { var er = typeof L == "function" ? L.displayName || L.name || "Unknown" : L; z0 && K(H0, er), $0 && t0(H0, er); } return Z(L, z0, $0, Q0, P0, L0.current, H0); } } var F0 = _.ReactCurrentOwner, S = _.ReactDebugCurrentFrame; function C0(L) { if (L) { var g0 = L._owner, S0 = E0(L.type, L._source, g0 ? g0.type : null); S.setExtraStackFrame(S0); } else S.setExtraStackFrame(null); } var $; $ = !1; function X(L) { return typeof L == "object" && L !== null && L.$$typeof === r; } function r0() { { if (F0.current) { var L = U(F0.current.type); if (L) return ` Check the render method of \`` + L + "`."; } return ""; } } function A0(L) { { if (L !== void 0) { var g0 = L.fileName.replace(/^.*[\\\/]/, ""), S0 = L.lineNumber; return ` Check your code at ` + g0 + ":" + S0 + "."; } return ""; } } var W0 = {}; function y0(L) { { var g0 = r0(); if (!g0) { var S0 = typeof L == "string" ? L : L.displayName || L.name; S0 && (g0 = ` Check the top-level render call using <` + S0 + ">."); } return g0; } } function G0(L, g0) { { if (!L._store || L._store.validated || L.key != null) return; L._store.validated = !0; var S0 = y0(g0); if (W0[S0]) return; W0[S0] = !0; var P0 = ""; L && L._owner && L._owner !== F0.current && (P0 = " It was passed a child from " + U(L._owner.type) + "."), C0(L), k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', S0, P0), C0(null); } } function v0(L, g0) { { if (typeof L != "object") return; if (I0(L)) for (var S0 = 0; S0 < L.length; S0++) { var P0 = L[S0]; X(P0) && G0(P0, g0); } else if (X(L)) L._store && (L._store.validated = !0); else if (L) { var Q0 = b(L); if (typeof Q0 == "function" && Q0 !== L.entries) for (var j0 = Q0.call(L), H0; !(H0 = j0.next()).done; ) X(H0.value) && G0(H0.value, g0); } } } function Y0(L) { { var g0 = L.type; if (g0 == null || typeof g0 == "string") return; var S0; if (typeof g0 == "function") S0 = g0.propTypes; else if (typeof g0 == "object" && (g0.$$typeof === A || // Note: Memo only checks outer props here. // Inner props are checked in the reconciler. g0.$$typeof === h)) S0 = g0.propTypes; else return; if (S0) { var P0 = U(g0); D0(S0, L.props, "prop", P0, L); } else if (g0.PropTypes !== void 0 && !$) { $ = !0; var Q0 = U(g0); k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", Q0 || "Unknown"); } typeof g0.getDefaultProps == "function" && !g0.getDefaultProps.isReactClassApproved && k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); } } function N0(L) { { for (var g0 = Object.keys(L.props), S0 = 0; S0 < g0.length; S0++) { var P0 = g0[S0]; if (P0 !== "children" && P0 !== "key") { C0(L), k("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", P0), C0(null); break; } } L.ref !== null && (C0(L), k("Invalid attribute `ref` supplied to `React.Fragment`."), C0(null)); } } var e0 = {}; function x(L, g0, S0, P0, Q0, j0) { { var H0 = M(L); if (!H0) { var z0 = ""; (L === void 0 || typeof L == "object" && L !== null && Object.keys(L).length === 0) && (z0 += " 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 $0 = A0(Q0); $0 ? z0 += $0 : z0 += r0(); var rr; L === null ? rr = "null" : I0(L) ? rr = "array" : L !== void 0 && L.$$typeof === r ? (rr = "<" + (U(L.type) || "Unknown") + " />", z0 = " Did you accidentally export a JSX literal instead of a component?") : rr = typeof L, k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", rr, z0); } var er = b0(L, g0, S0, Q0, j0); if (er == null) return er; if (H0) { var ar = g0.children; if (ar !== void 0) if (P0) if (I0(ar)) { for (var tr = 0; tr < ar.length; tr++) v0(ar[tr], L); Object.freeze && Object.freeze(ar); } else k("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 v0(ar, L); } if (R0.call(g0, "key")) { var Ar = U(L), nr = Object.keys(g0).filter(function(ea) { return ea !== "key"; }), or = nr.length > 0 ? "{key: someKey, " + nr.join(": ..., ") + ": ...}" : "{key: someKey}"; if (!e0[Ar + or]) { var Er = nr.length > 0 ? "{" + nr.join(": ..., ") + ": ...}" : "{}"; k(`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} />`, or, Ar, Er, Ar), e0[Ar + or] = !0; } } return L === a ? N0(er) : Y0(er), er; } } function j(L, g0, S0) { return x(L, g0, S0, !0); } function n0(L, g0, S0) { return x(L, g0, S0, !1); } var h0 = n0, w0 = j; reactJsxRuntime_development.Fragment = a, reactJsxRuntime_development.jsx = h0, reactJsxRuntime_development.jsxs = w0; }()), reactJsxRuntime_development; } process.env.NODE_ENV === "production" ? jsxRuntime.exports = requireReactJsxRuntime_production_min() : jsxRuntime.exports = requireReactJsxRuntime_development(); var jsxRuntimeExports = jsxRuntime.exports, PI_OVER_180 = Math.PI / 180; function detectBrowser() { return typeof window < "u" && ({}.toString.call(window) === "[object Window]" || {}.toString.call(window) === "[object global]"); } const glob = typeof global < "u" ? global : typeof window < "u" ? window : typeof WorkerGlobalScope < "u" ? self : {}, Konva$2 = { _global: glob, version: "8.1.3", isBrowser: detectBrowser(), isUnminified: /param/.test(function(f) { }.toString()), dblClickWindow: 400, getAngle(f) { return Konva$2.angleDeg ? f * PI_OVER_180 : f; }, enableTrace: !1, pointerEventsEnabled: !0, autoDrawEnabled: !0, hitOnDragEnabled: !1, capturePointerEventsEnabled: !1, _mouseListenClick: !1, _touchListenClick: !1, _pointerListenClick: !1, _mouseInDblClickWindow: !1, _touchInDblClickWindow: !1, _pointerInDblClickWindow: !1, pixelRatio: typeof window < "u" && window.devicePixelRatio || 1, dragDistance: 3, angleDeg: !0, showWarnings: !0, dragButtons: [0, 1], isDragging() { return Konva$2.DD.isDragging; }, isDragReady() { return !!Konva$2.DD.node; }, document: glob.document, _injectGlobal(f) { glob.Konva = f; } }, _registerNode = (f) => { Konva$2[f.prototype.getClassName()] = f; }; Konva$2._injectGlobal(Konva$2); class Transform { constructor(r = [1, 0, 0, 1, 0, 0]) { this.dirty = !1, this.m = r && r.slice() || [1, 0, 0, 1, 0, 0]; } reset() { this.m[0] = 1, this.m[1] = 0, this.m[2] = 0, this.m[3] = 1, this.m[4] = 0, this.m[5] = 0; } copy() { return new Transform(this.m); } copyInto(r) { r.m[0] = this.m[0], r.m[1] = this.m[1], r.m[2] = this.m[2], r.m[3] = this.m[3], r.m[4] = this.m[4], r.m[5] = this.m[5]; } point(r) { var e = this.m; return { x: e[0] * r.x + e[2] * r.y + e[4], y: e[1] * r.x + e[3] * r.y + e[5] }; } translate(r, e) { return this.m[4] += this.m[0] * r + this.m[2] * e, this.m[5] += this.m[1] * r + this.m[3] * e, this; } scale(r, e) { return this.m[0] *= r, this.m[1] *= r, this.m[2] *= e, this.m[3] *= e, this; } rotate(r) { var e = Math.cos(r), a = Math.sin(r), t = this.m[0] * e + this.m[2] * a, s = this.m[1] * e + this.m[3] * a, n = this.m[0] * -a + this.m[2] * e, o = this.m[1] * -a + this.m[3] * e; return this.m[0] = t, this.m[1] = s, this.m[2] = n, this.m[3] = o, this; } getTranslation() { return { x: this.m[4], y: this.m[5] }; } skew(r, e) { var a = this.m[0] + this.m[2] * e, t = this.m[1] + this.m[3] * e, s = this.m[2] + this.m[0] * r, n = this.m[3] + this.m[1] * r; return this.m[0] = a, this.m[1] = t, this.m[2] = s, this.m[3] = n, this; } multiply(r) { var e = this.m[0] * r.m[0] + this.m[2] * r.m[1], a = this.m[1] * r.m[0] + this.m[3] * r.m[1], t = this.m[0] * r.m[2] + this.m[2] * r.m[3], s = this.m[1] * r.m[2] + this.m[3] * r.m[3], n = this.m[0] * r.m[4] + this.m[2] * r.m[5] + this.m[4], o = this.m[1] * r.m[4] + this.m[3] * r.m[5] + this.m[5]; return this.m[0] = e, this.m[1] = a, this.m[2] = t, this.m[3] = s, this.m[4] = n, this.m[5] = o, this; } invert() { var r = 1 / (this.m[0] * this.m[3] - this.m[1] * this.m[2]), e = this.m[3] * r, a = -this.m[1] * r, t = -this.m[2] * r, s = this.m[0] * r, n = r * (this.m[2] * this.m[5] - this.m[3] * this.m[4]), o = r * (this.m[1] * this.m[4] - this.m[0] * this.m[5]); return this.m[0] = e, this.m[1] = a, this.m[2] = t, this.m[3] = s, this.m[4] = n, this.m[5] = o, this; } getMatrix() { return this.m; } setAbsolutePosition(r, e) { var a = this.m[0], t = this.m[1], s = this.m[2], n = this.m[3], o = this.m[4], A = this.m[5], l = (a * (e - A) - t * (r - o)) / (a * n - t * s), u = (r - o - s * l) / a; return this.translate(u, l); } decompose() { var r = this.m[0], e = this.m[1], a = this.m[2], t = this.m[3], s = this.m[4], n = this.m[5], o = r * t - e * a; let A = { x: s, y: n, rotation: 0, scaleX: 0, scaleY: 0, skewX: 0, skewY: 0 }; if (r != 0 || e != 0) { var l = Math.sqrt(r * r + e * e); A.rotation = e > 0 ? Math.acos(r / l) : -Math.acos(r / l), A.scaleX = l, A.scaleY = o / l, A.skewX = (r * a + e * t) / o, A.skewY = 0; } else if (a != 0 || t != 0) { var u = Math.sqrt(a * a + t * t); A.rotation = Math.PI / 2 - (t > 0 ? Math.acos(-a / u) : -Math.acos(a / u)), A.scaleX = o / u, A.scaleY = u, A.skewX = 0, A.skewY = (r * a + e * t) / o; } return A.rotation = Util._getRotation(A.rotation), A; } } var OBJECT_ARRAY = "[object Array]", OBJECT_NUMBER = "[object Number]", OBJECT_STRING = "[object String]", OBJECT_BOOLEAN = "[object Boolean]", PI_OVER_DEG180 = Math.PI / 180, DEG180_OVER_PI = 180 / Math.PI, HASH$1 = "#", EMPTY_STRING$1 = "", ZERO = "0", KONVA_WARNING = "Konva warning: ", KONVA_ERROR = "Konva error: ", RGB_PAREN = "rgb(", COLORS = { aliceblue: [240, 248, 255], antiquewhite: [250, 235, 215], aqua: [0, 255, 255], aquamarine: [127, 255, 212], azure: [240, 255, 255], beige: [245, 245, 220], bisque: [255, 228, 196], black: [0, 0, 0], blanchedalmond: [255, 235, 205], blue: [0, 0, 255], blueviolet: [138, 43, 226], brown: [165, 42, 42], burlywood: [222, 184, 135], cadetblue: [95, 158, 160], chartreuse: [127, 255, 0], chocolate: [210, 105, 30], coral: [255, 127, 80], cornflowerblue: [100, 149, 237], cornsilk: [255, 248, 220], crimson: [220, 20, 60], cyan: [0, 255, 255], darkblue: [0, 0, 139], darkcyan: [0, 139, 139], darkgoldenrod: [184, 132, 11], darkgray: [169, 169, 169], darkgreen: [0, 100, 0], darkgrey: [169, 169, 169], darkkhaki: [189, 183, 107], darkmagenta: [139, 0, 139], darkolivegreen: [85, 107, 47], darkorange: [255, 140, 0], darkorchid: [153, 50, 204], darkred: [139, 0, 0], darksalmon: [233, 150, 122], darkseagreen: [143, 188, 143], darkslateblue: [72, 61, 139], darkslategray: [47, 79, 79], darkslategrey: [47, 79, 79], darkturquoise: [0, 206, 209], darkviolet: [148, 0, 211], deeppink: [255, 20, 147], deepskyblue: [0, 191, 255], dimgray: [105, 105, 105], dimgrey: [105, 105, 105], dodgerblue: [30, 144, 255], firebrick: [178, 34, 34], floralwhite: [255, 255, 240], forestgreen: [34, 139, 34], fuchsia: [255, 0, 255], gainsboro: [220, 220, 220], ghostwhite: [248, 248, 255], gold: [255, 215, 0], goldenrod: [218, 165, 32], gray: [128, 128, 128], green: [0, 128, 0], greenyellow: [173, 255, 47], grey: [128, 128, 128], honeydew: [240, 255, 240], hotpink: [255, 105, 180], indianred: [205, 92, 92], indigo: [75, 0, 130], ivory: [255, 255, 240], khaki: [240, 230, 140], lavender: [230, 230, 250], lavenderblush: [255, 240, 245], lawngreen: [124, 252, 0], lemonchiffon: [255, 250, 205], lightblue: [173, 216, 230], lightcoral: [240, 128, 128], lightcyan: [224, 255, 255], lightgoldenrodyellow: [250, 250, 210], lightgray: [211, 211, 211], lightgreen: [144, 238, 144], lightgrey: [211, 211, 211], lightpink: [255, 182, 193], lightsalmon: [255, 160, 122], lightseagreen: [32, 178, 170], lightskyblue: [135, 206, 250], lightslategray: [119, 136, 153], lightslategrey: [119, 136, 153], lightsteelblue: [176, 196, 222], lightyellow: [255, 255, 224], lime: [0, 255, 0], limegreen: [50, 205, 50], linen: [250, 240, 230], magenta: [255, 0, 255], maroon: [128, 0, 0], mediumaquamarine: [102, 205, 170], mediumblue: [0, 0, 205], mediumorchid: [186, 85, 211], mediumpurple: [147, 112, 219], mediumseagreen: [60, 179, 113], mediumslateblue: [123, 104, 238], mediumspringgreen: [0, 250, 154], mediumturquoise: [72, 209, 204], mediumvioletred: [199, 21, 133], midnightblue: [25, 25, 112], mintcream: [245, 255, 250], mistyrose: [255, 228, 225], moccasin: [255, 228, 181], navajowhite: [255, 222, 173], navy: [0, 0, 128], oldlace: [253, 245, 230], olive: [128, 128, 0], olivedrab: [107, 142, 35], orange: [255, 165, 0], orangered: [255, 69, 0], orchid: [218, 112, 214], palegoldenrod: [238, 232, 170], palegreen: [152, 251, 152], paleturquoise: [175, 238, 238], palevioletred: [219, 112, 147], papayawhip: [255, 239, 213], peachpuff: [255, 218, 185], peru: [205, 133, 63], pink: [255, 192, 203], plum: [221, 160, 203], powderblue: [176, 224, 230], purple: [128, 0, 128], rebeccapurple: [102, 51, 153], red: [255, 0, 0], rosybrown: [188, 143, 143], royalblue: [65, 105, 225], saddlebrown: [139, 69, 19], salmon: [250, 128, 114], sandybrown: [244, 164, 96], seagreen: [46, 139, 87], seashell: [255, 245, 238], sienna: [160, 82, 45], silver: [192, 192, 192], skyblue: [135, 206, 235], slateblue: [106, 90, 205], slategray: [119, 128, 144], slategrey: [119, 128, 144], snow: [255, 255, 250], springgreen: [0, 255, 127], steelblue: [70, 130, 180], tan: [210, 180, 140], teal: [0, 128, 128], thistle: [216, 191, 216], transparent: [255, 255, 255, 0], tomato: [255, 99, 71], turquoise: [64, 224, 208], violet: [238, 130, 238], wheat: [245, 222, 179], white: [255, 255, 255], whitesmoke: [245, 245, 245], yellow: [255, 255, 0], yellowgreen: [154, 205, 5] }, RGB_REGEX = /rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/, animQueue = []; const req = typeof requestAnimationFrame < "u" && requestAnimationFrame || function(f) { setTimeout(f, 60); }, Util = { _isElement(f) { return !!(f && f.nodeType == 1); }, _isFunction(f) { return !!(f && f.constructor && f.call && f.apply); }, _isPlainObject(f) { return !!f && f.constructor === Object; }, _isArray(f) { return Object.prototype.toString.call(f) === OBJECT_ARRAY; }, _isNumber(f) { return Object.prototype.toString.call(f) === OBJECT_NUMBER && !isNaN(f) && isFinite(f); }, _isString(f) { return Object.prototype.toString.call(f) === OBJECT_STRING; }, _isBoolean(f) { return Object.prototype.toString.call(f) === OBJECT_BOOLEAN; }, isObject(f) { return f instanceof Object; }, isValidSelector(f) { if (typeof f != "string") return !1; var r = f[0]; return r === "#" || r === "." || r === r.toUpperCase(); }, _sign(f) { return f === 0 || f > 0 ? 1 : -1; }, requestAnimFrame(f) { animQueue.push(f), animQueue.length === 1 && req(function() { const r = animQueue; animQueue = [], r.forEach(function(e) { e(); }); }); }, createCanvasElement() { var f = document.createElement("canvas"); try { f.style = f.style || {}; } catch { } return f; }, createImageElement() { return document.createElement("img"); }, _isInDocument(f) { for (; f = f.parentNode; ) if (f == document) return !0; return !1; }, _urlToImage(f, r) { var e = Util.createImageElement(); e.onload = function() { r(e); }, e.src = f; }, _rgbToHex(f, r, e) { return ((1 << 24) + (f << 16) + (r << 8) + e).toString(16).slice(1); }, _hexToRgb(f) { f = f.replace(HASH$1, EMPTY_STRING$1); var r = parseInt(f, 16); return { r: r >> 16 & 255, g: r >> 8 & 255, b: r & 255 }; }, getRandomColor() { for (var f = (Math.random() * 16777215 << 0).toString(16); f.length < 6; ) f = ZERO + f; return HASH$1 + f; }, getRGB(f) { var r; return f in COLORS ? (r = COLORS[f], { r: r[0], g: r[1], b: r[2] }) : f[0] === HASH$1 ? this._hexToRgb(f.substring(1)) : f.substr(0, 4) === RGB_PAREN ? (r = RGB_REGEX.exec(f.replace(/ /g, "")), { r: parseInt(r[1], 10), g: parseInt(r[2], 10), b: parseInt(r[3], 10) }) : { r: 0, g: 0, b: 0 }; }, colorToRGBA(f) { return f = f || "black", Util._namedColorToRBA(f) || Util._hex3ColorToRGBA(f) || Util._hex6ColorToRGBA(f) || Util._rgbColorToRGBA(f) || Util._rgbaColorToRGBA(f) || Util._hslColorToRGBA(f); }, _namedColorToRBA(f) { var r = COLORS[f.toLowerCase()]; return r ? { r: r[0], g: r[1], b: r[2], a: 1 } : null; }, _rgbColorToRGBA(f) { if (f.indexOf("rgb(") === 0) { f = f.match(/rgb\(([^)]+)\)/)[1]; var r = f.split(/ *, */).map(Number); return { r: r[0], g: r[1], b: r[2], a: 1 }; } }, _rgbaColorToRGBA(f) { if (f.indexOf("rgba(") === 0) { f = f.match(/rgba\(([^)]+)\)/)[1]; var r = f.split(/ *, */).map(Number); return { r: r[0], g: r[1], b: r[2], a: r[3] }; } }, _hex6ColorToRGBA(f) { if (f[0] === "#" && f.length === 7) return { r: parseInt(f.slice(1, 3), 16), g: parseInt(f.slice(3, 5), 16), b: parseInt(f.slice(5, 7), 16), a: 1 }; }, _hex3ColorToRGBA(f) { if (f[0] === "#" && f.length === 4) return { r: parseInt(f[1] + f[1], 16), g: parseInt(f[2] + f[2], 16), b: parseInt(f[3] + f[3], 16), a: 1 }; }, _hslColorToRGBA(f) { if (/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(f)) { const [r, ...e] = /hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(f), a = Number(e[0]) / 360, t = Number(e[1]) / 100, s = Number(e[2]) / 100; let n, o, A; if (t === 0) return A = s * 255, { r: Math.round(A), g: Math.round(A), b: Math.round(A), a: 1 }; s < 0.5 ? n = s * (1 + t) : n = s + t - s * t; const l = 2 * s - n, u = [0, 0, 0]; for (let h = 0; h < 3; h++) o = a + 1 / 3 * -(h - 1), o < 0 && o++, o > 1 && o--, 6 * o < 1 ? A = l + (n - l) * 6 * o : 2 * o < 1 ? A = n : 3 * o < 2 ? A = l + (n - l) * (2 / 3 - o) * 6 : A = l, u[h] = A * 255; return { r: Math.round(u[0]), g: Math.round(u[1]), b: Math.round(u[2]), a: 1 }; } }, haveIntersection(f, r) { return !(r.x > f.x + f.width || r.x + r.width < f.x || r.y > f.y + f.height || r.y + r.height < f.y); }, cloneObject(f) { var r = {}; for (var e in f) this._isPlainObject(f[e]) ? r[e] = this.cloneObject(f[e]) : this._isArray(f[e]) ? r[e] = this.cloneArray(f[e]) : r[e] = f[e]; return r; }, cloneArray(f) { return f.slice(0); }, degToRad(f) { return f * PI_OVER_DEG180; }, radToDeg(f) { return f * DEG180_OVER_PI; }, _degToRad(f) { return Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."), Util.degToRad(f); }, _radToDeg(f) { return Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."), Util.radToDeg(f); }, _getRotation(f) { return Konva$2.angleDeg ? Util.radToDeg(f) : f; }, _capitalize(f) { return f.charAt(0).toUpperCase() + f.slice(1); }, throw(f) { throw new Error(KONVA_ERROR + f); }, error(f) { console.error(KONVA_ERROR + f); }, warn(f) { Konva$2.showWarnings && console.warn(KONVA_WARNING + f); }, each(f, r) { for (var e in f) r(e, f[e]); }, _inRange(f, r, e) { return r <= f && f < e; }, _getProjectionToSegment(f, r, e, a, t, s) { var n, o, A, l = (f - e) * (f - e) + (r - a) * (r - a); if (l == 0) n = f, o = r, A = (t - e) * (t - e) + (s - a) * (s - a); else { var u = ((t - f) * (e - f) + (s - r) * (a - r)) / l; u < 0 ? (n = f, o = r, A = (f - t) * (f - t) + (r - s) * (r - s)) : u > 1 ? (n = e, o = a, A = (e - t) * (e - t) + (a - s) * (a - s)) : (n = f + u * (e - f), o = r + u * (a - r), A = (n - t) * (n - t) + (o - s) * (o - s)); } return [n, o, A]; }, _getProjectionToLine(f, r, e) { var a = Util.cloneObject(f), t = Number.MAX_VALUE; return r.forEach(function(s, n) { if (!(!e && n === r.length - 1)) { var o = r[(n + 1) % r.length], A = Util._getProjectionToSegment(s.x, s.y, o.x, o.y, f.x, f.y), l = A[0], u = A[1], h = A[2]; h < t && (a.x = l, a.y = u, t = h); } }), a; }, _prepareArrayForTween(f, r, e) { var a, t = [], s = []; if (f.length > r.length) { var n = r; r = f, f = n; } for (a = 0; a < f.length; a += 2) t.push({ x: f[a], y: f[a + 1] }); for (a = 0; a < r.length; a += 2) s.push({ x: r[a], y: r[a + 1] }); var o = []; return s.forEach(function(A) { var l = Util._getProjectionToLine(A, t, e); o.push(l.x), o.push(l.y); }), o; }, _prepareToStringify(f) { var r; f.visitedByCircularReferenceRemoval = !0; for (var e in f) if (f.hasOwnProperty(e) && f[e] && typeof f[e] == "object") { if (r = Object.getOwnPropertyDescriptor(f, e), f[e].visitedByCircularReferenceRemoval || Util._isElement(f[e])) if (r.configurable) delete f[e]; else return null; else if (Util._prepareToStringify(f[e]) === null) if (r.configurable) delete f[e]; else return null; } return delete f.visitedByCircularReferenceRemoval, f; }, _assign(f, r) { for (var e in r) f[e] = r[e]; return f; }, _getFirstPointerId(f) { return f.touches ? f.changedTouches[0].identifier : 999; } }; function _formatValue(f) { return Util._isString(f) ? '"' + f + '"' : Object.prototype.toString.call(f) === "[object Number]" || Util._isBoolean(f) ? f : Object.prototype.toString.call(f); } function RGBComponent(f) { return f > 255 ? 255 : f < 0 ? 0 : Math.round(f); } function getNumberValidator() { if (Konva$2.isUnminified) return function(f, r) { return Util._isNumber(f) || Util.warn(_formatValue(f) + ' is a not valid value for "' + r + '" attribute. The value should be a number.'), f; }; } function getNumberOrArrayOfNumbersValidator(f) { if (Konva$2.isUnminified) return function(r, e) { let a = Util._isNumber(r), t = Util._isArray(r) && r.length == f; return !a && !t && Util.warn(_formatValue(r) + ' is a not valid value for "' + e + '" attribute. The value should be a number or Array<number>(' + f + ")"), r; }; } function getNumberOrAutoValidator() { if (Konva$2.isUnminified) return function(f, r) { var e = Util._isNumber(f), a = f === "auto"; return e || a || Util.warn(_formatValue(f) + ' is a not valid value for "' + r + '" attribute. The value should be a number or "auto".'), f; }; } function getStringValidator() { if (Konva$2.isUnminified) return function(f, r) { return Util._isString(f) || Util.warn(_formatValue(f) + ' is a not valid value for "' + r + '" attribute. The value should be a string.'), f; }; } function getStringOrGradientValidator() { if (Konva$2.isUnminified) return function(f, r) { const e = Util._isString(f), a = Object.prototype.toString.call(f) === "[object CanvasGradient]" || f && f.addColorStop; return e || a || Util.warn(_formatValue(f) + ' is a not valid value for "' + r + '" attribute. The value should be a string or a native gradient.'), f; }; } function getNumberArrayValidator() { if (Konva$2.isUnminified) return function(f, r) { return Util._isArray(f) ? f.forEach(function(e) { Util._isNumber(e) || Util.warn('"' + r + '" attribute has non numeric element ' + e + ". Make sure that all elements are numbers."); }) : Util.warn(_formatValue(f) + ' is a not valid value for "' + r + '" attribute. The value should be a array of numbers.'), f; }; } function getBooleanValidator() { if (Konva$2.isUnminified) return function(f, r) { var e = f === !0 || f === !1; return e || Util.warn(_formatValue(f) + ' is a not valid value for "' + r + '" attribute. The value should be a boolean.'), f; }; } function getComponentValidator(f) { if (Konva$2.isUnminified) return function(r, e) { return Util.isObject(r) || Util.warn(_formatValue(r) + ' is a not valid value for "' + e + '" attribute. The value should be an object with properties ' + f), r; }; } var GET = "get", SET$1 = "set"; const Factory = { addGetterSetter(f, r, e, a, t) { Factory.addGetter(f, r, e), Factory.addSetter(f, r, a, t), Factory.addOverloadedGetterSetter(f, r); }, addGetter(f, r, e) { var a = GET + Util._capitalize(r); f.prototype[a] = f.prototype[a] || function() { var t = this.attrs[r]; return t === void 0 ? e : t; }; }, addSetter(f, r, e, a) { var t = SET$1 + Util._capitalize(r); f.prototype[t] || Factory.overWriteSetter(f, r, e, a); }, overWriteSetter(f, r, e, a) { var t = SET$1 + Util._capitalize(r); f.prototype[t] = function(s) { return e && s !== void 0 && s !== null && (s = e.call(this, s, r)), this._setAttr(r, s), a && a.call(this), this; }; }, addComponentsGetterSetter(f, r, e, a, t) { var s = e.length, n = Util._capitalize, o = GET + n(r), A = SET$1 + n(r), l, u; f.prototype[o] = function() { var c = {}; for (l = 0; l < s; l++) u = e[l], c[u] = this.getAttr(r + n(u)); return c; }; var h = getComponentValidator(e); f.prototype[A] = function(c) { var g = this.attrs[r], v; a && (c = a.call(this, c)), h && h.call(this, c, r); for (v in c) c.hasOwnProperty(v) && this._setAttr(r + n(v), c[v]); return this._fireChangeEvent(r, g, c), t && t.call(this), this; }, Factory.addOverloadedGetterSetter(f, r); }, addOverloadedGetterSetter(f, r) { var e = Util._capitalize(r), a = SET$1 + e, t = GET + e; f.prototype[r] = function() { return arguments.length ? (this[a](arguments[0]), this) : this[t](); }; }, addDeprecatedGetterSetter(f, r, e, a) { Util.error("Adding deprecated " + r); var t = GET + Util._capitalize(r), s = r + " property is deprecated and will be removed soon. Look at Konva change log for more information."; f.prototype[t] = function() { Util.error(s); var n = this.attrs[r]; return n === void 0 ? e : n; }, Factory.addSetter(f, r, a, function() { Util.error(s); }), Factory.addOverloadedGetterSetter(f, r); }, backCompat(f, r) { Util.each(r, function(e, a) { var t = f.prototype[a], s = GET + Util._capitalize(e), n = SET$1 + Util._capitalize(e); function o() { t.apply(this, arguments), Util.error('"' + e + '" method is deprecated and will be removed soon. Use ""' + a + '" instead.'); } f.prototype[e] = o, f.prototype[s] = o, f.prototype[n] = o; }); }, afterSetFilter() { this._filterUpToDate = !1; } }; function simplifyArray(f) { var r = [], e = f.length, a = Util, t, s; for (t = 0; t < e; t++) s = f[t], a._isNumber(s) ? s = Math.round(s * 1e3) / 1e3 : a._isString(s) || (s = s + ""), r.push(s); return r; } var COMMA = ",", OPEN_PAREN = "(", CLOSE_PAREN = ")", OPEN_PAREN_BRACKET = "([", CLOSE_BRACKET_PAREN = "])", SEMICOLON = ";", DOUBLE_PAREN = "()", EQUALS = "=", CONTEXT_METHODS = [ "arc", "arcTo", "beginPath", "bezierCurveTo", "clearRect", "clip", "closePath", "createLinearGradient", "createPattern", "createRadialGradient", "drawImage", "ellipse", "fill", "fillText", "getImageData", "createImageData", "lineTo", "moveTo", "putImageData", "quadraticCurveTo", "rect", "restore", "rotate", "save", "scale", "setLineDash", "setTransform", "stroke", "strokeText", "transform", "translate" ], CONTEXT_PROPERTIES = [ "fillStyle", "strokeStyle", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY", "lineCap", "lineDashOffset", "lineJoin", "lineWidth", "miterLimit", "font", "textAlign", "textBaseline", "globalAlpha", "globalCompositeOperation", "imageSmoothingEnabled" ]; const traceArrMax = 100; class Context { constructor(r) { this.canvas = r, this._context = r._canvas.getContext("2d"), Konva$2.enableTrace && (this.traceArr = [], this._enableTrace()); } fillShape(r) { r.fillEnabled() && this._fill(r); } _fill(r) { } strokeShape(r) { r.hasStroke() && this._stroke(r); } _stroke(r) { } fillStrokeShape(r) { r.attrs.fillAfterStrokeEnabled ? (this.strokeShape(r), this.fillShape(r)) : (this.fillShape(r), this.strokeShape(r)); } getTrace(r, e) { var a = this.traceArr, t = a.length, s = "", n, o, A, l; for (n = 0; n < t; n++) o = a[n], A = o.method, A ? (l = o.args, s += A, r ? s += DOUBLE_PAREN : Util._isArray(l[0]) ? s += OPEN_PAREN_BRACKET + l.join(COMMA) + CLOSE_BRACKET_PAREN : (e && (l = l.map((u) => typeof u == "number" ? Math.floor(u) : u)), s += OPEN_PAREN + l.join(COMMA) + CLOSE_PAREN)) : (s += o.property, r || (s += EQUALS + o.val)), s += SEMICOLON; return s; } clearTrace() { this.traceArr = []; } _trace(r) { var e = this.traceArr, a; e.push(r), a = e.length, a >= traceArrMax && e.shift(); } reset() { var r = this.getCanvas().getPixelRatio(); this.setTransform(1 * r, 0, 0, 1 * r, 0, 0); } getCanvas() { return this.canvas; } clear(r) { var e = this.getCanvas(); r ? this.clearRect(r.x || 0, r.y || 0, r.width || 0, r.height || 0) : this.clearRect(0, 0, e.getWidth() / e.pixelRatio, e.getHeight() / e.pixelRatio); } _applyLineCap(r) { var e = r.getLineCap(); e && this.setAttr("